diff --git a/e2e/process-services/form/form-widgets-component.e2e.ts b/e2e/process-services/form/form-widgets-component.e2e.ts index 56f27000fc..a9acf98ed9 100644 --- a/e2e/process-services/form/form-widgets-component.e2e.ts +++ b/e2e/process-services/form/form-widgets-component.e2e.ts @@ -145,7 +145,7 @@ describe('Form widgets', () => { }); it('[C272783] Should display displayText and displayValue in form', async () => { - const expected0 = formInstance.getWidgetBy('id', appFields.displayText_id).value; + const expected0 = ' ' + formInstance.getWidgetBy('id', appFields.displayText_id).value; const expected1 = (formInstance.getWidgetBy('id', appFields.displayValue_id).value as string) || 'Display value'; const expected2 = (formInstance.getWidgetBy('id', appFields.displayValue_id).value as string) || ''; diff --git a/lib/core/src/lib/form/components/form-base.component.ts b/lib/core/src/lib/form/components/form-base.component.ts index 77066d4c88..48475aabcc 100644 --- a/lib/core/src/lib/form/components/form-base.component.ts +++ b/lib/core/src/lib/form/components/form-base.component.ts @@ -15,11 +15,13 @@ * limitations under the License. */ -import { FormOutcomeModel, FormFieldValidator, FormFieldModel, FormOutcomeEvent, FormModel } from './widgets'; -import { EventEmitter, Input, Output, Directive } from '@angular/core'; +import { Directive, EventEmitter, Input, Output } from '@angular/core'; import { ThemePalette } from '@angular/material/core'; +import { FormFieldModel, FormFieldValidator, FormModel, FormOutcomeEvent, FormOutcomeModel } from './widgets'; -@Directive() +@Directive({ + standalone: true +}) // eslint-disable-next-line @angular-eslint/directive-class-suffix export abstract class FormBaseComponent { static SAVE_OUTCOME_ID: string = '$save'; @@ -210,10 +212,14 @@ export abstract class FormBaseComponent { } abstract onRefreshClicked(): void; + abstract saveTaskForm(): void; + abstract completeTaskForm(outcome?: string): void; protected abstract onTaskSaved(form: FormModel): void; + protected abstract storeFormAsMetadata(): void; + protected abstract onExecuteOutcome(outcome: FormOutcomeModel): boolean; } diff --git a/lib/core/src/lib/form/components/form-custom-button.directive.ts b/lib/core/src/lib/form/components/form-custom-button.directive.ts index ccdfb28fe7..4269f956b0 100644 --- a/lib/core/src/lib/form/components/form-custom-button.directive.ts +++ b/lib/core/src/lib/form/components/form-custom-button.directive.ts @@ -17,7 +17,8 @@ import { Directive } from '@angular/core'; -/** - * Directive selectors without adf- prefix will be deprecated on 3.0.0 - */ -@Directive({ selector: '[adf-form-custom-button], [form-custom-button]' }) export class StartFormCustomButtonDirective {} +@Directive({ + selector: '[adf-form-custom-button]', + standalone: true +}) +export class StartFormCustomButtonDirective {} diff --git a/lib/core/src/lib/form/components/form-field/form-field.component.html b/lib/core/src/lib/form/components/form-field/form-field.component.html new file mode 100644 index 0000000000..2d49e5563d --- /dev/null +++ b/lib/core/src/lib/form/components/form-field/form-field.component.html @@ -0,0 +1,8 @@ +
+
+
diff --git a/lib/core/src/lib/form/components/form-field/form-field.component.spec.ts b/lib/core/src/lib/form/components/form-field/form-field.component.spec.ts index 34f5b15a6e..8702076a83 100644 --- a/lib/core/src/lib/form/components/form-field/form-field.component.spec.ts +++ b/lib/core/src/lib/form/components/form-field/form-field.component.spec.ts @@ -16,12 +16,10 @@ */ import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormRenderingService } from '../../services/form-rendering.service'; -import { FormFieldModel, FormFieldTypes, FormModel } from '../widgets/core'; -import { TextWidgetComponent, CheckboxWidgetComponent } from '../widgets'; -import { FormFieldComponent } from './form-field.component'; -import { FormBaseModule } from '../../form-base.module'; import { CoreTestingModule } from '../../../testing'; +import { FormRenderingService } from '../../services/form-rendering.service'; +import { CheckboxWidgetComponent, FormFieldModel, FormFieldTypes, FormModel, TextWidgetComponent } from '../widgets'; +import { FormFieldComponent } from './form-field.component'; describe('FormFieldComponent', () => { let fixture: ComponentFixture; @@ -32,7 +30,7 @@ describe('FormFieldComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule, FormBaseModule] + imports: [CoreTestingModule] }); fixture = TestBed.createComponent(FormFieldComponent); component = fixture.componentInstance; diff --git a/lib/core/src/lib/form/components/form-field/form-field.component.ts b/lib/core/src/lib/form/components/form-field/form-field.component.ts index cbab0fa981..635e93ff1e 100644 --- a/lib/core/src/lib/form/components/form-field/form-field.component.ts +++ b/lib/core/src/lib/form/components/form-field/form-field.component.ts @@ -28,27 +28,16 @@ import { ViewContainerRef, ViewEncapsulation } from '@angular/core'; - import { FormRenderingService } from '../../services/form-rendering.service'; import { WidgetVisibilityService } from '../../services/widget-visibility.service'; -import { FormFieldModel } from '../widgets/core/form-field.model'; +import { FormFieldModel } from '../widgets'; declare const adf: any; @Component({ selector: 'adf-form-field', - template: ` -
-
-
- `, + standalone: true, + templateUrl: './form-field.component.html', encapsulation: ViewEncapsulation.None }) export class FormFieldComponent implements OnInit, OnDestroy { @@ -109,6 +98,12 @@ export class FormFieldComponent implements OnInit, OnDestroy { } } + focusToggle() { + setTimeout(() => { + this.focus = !this.focus; + }); + } + private getField(): FormFieldModel { if (this.field?.params) { const wrappedField = this.field.params.field; @@ -149,10 +144,4 @@ export class FormFieldComponent implements OnInit, OnDestroy { return module.componentFactories.find((x) => x.componentType === decoratedCmp); } - - focusToggle() { - setTimeout(() => { - this.focus = !this.focus; - }); - } } diff --git a/lib/core/src/lib/form/components/form-renderer.component.html b/lib/core/src/lib/form/components/form-renderer.component.html index 61ec14531b..fa508c0ca4 100644 --- a/lib/core/src/lib/form/components/form-renderer.component.html +++ b/lib/core/src/lib/form/components/form-renderer.component.html @@ -1,4 +1,5 @@ -
+
@@ -16,44 +17,36 @@
-
+
-

- - {{ currentRootElement.name | translate }} + + {{ currentRootElement.name | translate }} +

-
-
+
+
@@ -61,11 +54,9 @@
-
+
diff --git a/lib/core/src/lib/form/components/form-renderer.component.spec.ts b/lib/core/src/lib/form/components/form-renderer.component.spec.ts index e48f316c68..3cef324b60 100644 --- a/lib/core/src/lib/form/components/form-renderer.component.spec.ts +++ b/lib/core/src/lib/form/components/form-renderer.component.spec.ts @@ -15,37 +15,36 @@ * limitations under the License. */ -import { TestBed, ComponentFixture } from '@angular/core/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { CoreTestingModule } from '../../testing'; +import { FormRulesManager } from '../models/form-rules.model'; +import { FormRenderingService } from '../services/form-rendering.service'; +import { FormService } from '../services/form.service'; import { FormRendererComponent } from './form-renderer.component'; -import { FormBaseModule } from '../form-base.module'; import { - formDisplayValueVisibility, - formDisplayValueForm, - formDisplayValueCombinedVisibility, - formNumberWidgetVisibility, - formNumberTextJson, - formRequiredNumberWidget, - colspanForm, - numberNotRequiredForm, - numberMinMaxForm, - textWidgetVisibility, - numberWidgetVisibilityForm, - radioWidgetVisibilityForm, - customWidgetForm, - formDateVisibility, - customWidgetFormWithVisibility, amountWidgetFormVisibilityMock, checkboxWidgetFormVisibilityMock, + colspanForm, + customWidgetForm, + customWidgetFormWithVisibility, dateWidgetFormVisibilityMock, - multilineWidgetFormVisibilityMock, + displayBigDecimalWidgetMock, displayTextWidgetFormVisibilityMock, - displayBigDecimalWidgetMock + formDateVisibility, + formDisplayValueCombinedVisibility, + formDisplayValueForm, + formDisplayValueVisibility, + formNumberTextJson, + formNumberWidgetVisibility, + formRequiredNumberWidget, + multilineWidgetFormVisibilityMock, + numberMinMaxForm, + numberNotRequiredForm, + numberWidgetVisibilityForm, + radioWidgetVisibilityForm, + textWidgetVisibility } from './mock/form-renderer.component.mock'; -import { FormService } from '../services/form.service'; -import { CoreTestingModule } from '../../testing'; -import { FormRenderingService } from '../services/form-rendering.service'; import { TextWidgetComponent } from './widgets'; -import { FormRulesManager } from '../models/form-rules.model'; const typeIntoInput = (targetInput: HTMLInputElement, message: string) => { expect(targetInput).toBeTruthy('Expected input to set to be valid and not null'); @@ -87,7 +86,7 @@ describe('Form Renderer Component', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule, FormBaseModule] + imports: [CoreTestingModule] }); fixture = TestBed.createComponent(FormRendererComponent); formRendererComponent = fixture.componentInstance; diff --git a/lib/core/src/lib/form/components/form-renderer.component.ts b/lib/core/src/lib/form/components/form-renderer.component.ts index a720598cec..c2dd28aeb1 100644 --- a/lib/core/src/lib/form/components/form-renderer.component.ts +++ b/lib/core/src/lib/form/components/form-renderer.component.ts @@ -15,15 +15,23 @@ * limitations under the License. */ -import { Component, ViewEncapsulation, Input, OnDestroy, Injector, OnInit, Inject } from '@angular/core'; +import { JsonPipe, NgClass, NgForOf, NgIf, NgStyle, NgTemplateOutlet } from '@angular/common'; +import { Component, Inject, Injector, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatButtonModule } from '@angular/material/button'; +import { MatIconModule } from '@angular/material/icon'; +import { MatSlideToggleModule } from '@angular/material/slide-toggle'; +import { MatTabsModule } from '@angular/material/tabs'; +import { TranslateModule } from '@ngx-translate/core'; import { FormRulesManager, formRulesManagerFactory } from '../models/form-rules.model'; -import { FormModel } from './widgets/core/form.model'; -import { ContainerModel, FormFieldModel, TabModel } from './widgets'; import { FormService } from '../services/form.service'; +import { FormFieldComponent } from './form-field/form-field.component'; import { FORM_FIELD_MODEL_RENDER_MIDDLEWARE, FormFieldModelRenderMiddleware } from './middlewares/middleware'; +import { ContainerModel, FormFieldModel, FormModel, TabModel } from './widgets'; @Component({ selector: 'adf-form-renderer', + standalone: true, templateUrl: './form-renderer.component.html', styleUrls: ['./form-renderer.component.scss'], providers: [ @@ -32,7 +40,21 @@ import { FORM_FIELD_MODEL_RENDER_MIDDLEWARE, FormFieldModelRenderMiddleware } fr useFactory: formRulesManagerFactory, deps: [Injector] } - + ], + imports: [ + NgIf, + MatTabsModule, + NgForOf, + NgTemplateOutlet, + TranslateModule, + MatButtonModule, + MatIconModule, + NgStyle, + FormFieldComponent, + MatSlideToggleModule, + FormsModule, + JsonPipe, + NgClass ], encapsulation: ViewEncapsulation.None }) @@ -135,7 +157,7 @@ export class FormRendererComponent implements OnInit, OnDestroy { private runMiddlewareServices(): void { const formFields = this.formDefinition.getFormFields(); - formFields.forEach(field => { + formFields.forEach((field) => { this.middlewareServices.forEach((middlewareService) => { if (middlewareService.type === field.type) { field = middlewareService.getParsedField(field); diff --git a/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.html b/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.html index 1a3a6614cb..dbe5963f81 100644 --- a/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.html +++ b/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.html @@ -1,14 +1,10 @@ -
+
- + diff --git a/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.spec.ts b/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.spec.ts index 7bb0be6b39..dab06484c2 100644 --- a/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.spec.ts +++ b/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.spec.ts @@ -17,7 +17,7 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { UntypedFormControl } from '@angular/forms'; -import { CoreTestingModule } from '../../../testing/core.testing.module'; +import { CoreTestingModule } from '../../../testing'; import { InplaceFormInputComponent } from './inplace-form-input.component'; describe('InplaceFormInputComponent', () => { @@ -27,8 +27,7 @@ describe('InplaceFormInputComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [CoreTestingModule], - declarations: [InplaceFormInputComponent] + imports: [CoreTestingModule, InplaceFormInputComponent] }).compileComponents(); }); diff --git a/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.ts b/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.ts index c62c2d665a..1c2cac9315 100644 --- a/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.ts +++ b/lib/core/src/lib/form/components/inplace-form-input/inplace-form-input.component.ts @@ -15,17 +15,18 @@ * limitations under the License. */ -import { - Component, - Input, - ViewEncapsulation -} from '@angular/core'; -import { UntypedFormControl } from '@angular/forms'; +import { NgClass } from '@angular/common'; +import { Component, Input, ViewEncapsulation } from '@angular/core'; +import { ReactiveFormsModule, UntypedFormControl } from '@angular/forms'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; @Component({ selector: 'adf-inplace-form-input', + standalone: true, templateUrl: './inplace-form-input.component.html', styleUrls: ['./inplace-form-input.component.scss'], + imports: [MatFormFieldModule, ReactiveFormsModule, MatInputModule, NgClass], encapsulation: ViewEncapsulation.None }) export class InplaceFormInputComponent { diff --git a/lib/core/src/lib/form/components/middlewares/middleware.ts b/lib/core/src/lib/form/components/middlewares/middleware.ts index eece09ac12..5276d50da8 100644 --- a/lib/core/src/lib/form/components/middlewares/middleware.ts +++ b/lib/core/src/lib/form/components/middlewares/middleware.ts @@ -16,10 +16,11 @@ */ import { InjectionToken } from '@angular/core'; -import { FormFieldModel } from '../../components/widgets'; +import { FormFieldModel } from '../widgets'; export interface FormFieldModelRenderMiddleware { type: string; + getParsedField(field: FormFieldModel): FormFieldModel; } diff --git a/lib/core/src/lib/form/components/widgets/amount/amount.widget.html b/lib/core/src/lib/form/components/widgets/amount/amount.widget.html index 16c8bee0e1..1a19e880e8 100644 --- a/lib/core/src/lib/form/components/widgets/amount/amount.widget.html +++ b/lib/core/src/lib/form/components/widgets/amount/amount.widget.html @@ -1,21 +1,33 @@ -
-
- -
-
- - {{ currency }}   - - - - -
-
\ No newline at end of file +
+
+ +
+
+ + {{ currency }}   + + + + +
+
diff --git a/lib/core/src/lib/form/components/widgets/amount/amount.widget.spec.ts b/lib/core/src/lib/form/components/widgets/amount/amount.widget.spec.ts index e0b3e17672..85289e63e6 100644 --- a/lib/core/src/lib/form/components/widgets/amount/amount.widget.spec.ts +++ b/lib/core/src/lib/form/components/widgets/amount/amount.widget.spec.ts @@ -15,18 +15,15 @@ * limitations under the License. */ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormFieldModel } from '../core/form-field.model'; -import { AmountWidgetComponent, ADF_AMOUNT_SETTINGS } from './amount.widget'; -import { FormBaseModule } from '../../../form-base.module'; -import { FormFieldTypes } from '../core/form-field-types'; -import { CoreTestingModule } from '../../../../testing/core.testing.module'; -import { FormModel } from '../core/form.model'; import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; -import { MatTooltipHarness } from '@angular/material/tooltip/testing'; -import { MatInputHarness } from '@angular/material/input/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatFormFieldHarness } from '@angular/material/form-field/testing'; +import { MatInputHarness } from '@angular/material/input/testing'; +import { MatTooltipHarness } from '@angular/material/tooltip/testing'; +import { CoreTestingModule } from '../../../../testing'; +import { FormFieldModel, FormFieldTypes, FormModel } from '../core'; +import { ADF_AMOUNT_SETTINGS, AmountWidgetComponent } from './amount.widget'; describe('AmountWidgetComponent', () => { let loader: HarnessLoader; @@ -36,7 +33,7 @@ describe('AmountWidgetComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule, FormBaseModule] + imports: [CoreTestingModule] }); fixture = TestBed.createComponent(AmountWidgetComponent); widget = fixture.componentInstance; @@ -144,7 +141,7 @@ describe('AmountWidgetComponent - rendering', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule, FormBaseModule] + imports: [CoreTestingModule] }); fixture = TestBed.createComponent(AmountWidgetComponent); widget = fixture.componentInstance; @@ -203,7 +200,7 @@ describe('AmountWidgetComponent - rendering', () => { expect(await field.getPrefixText()).toBe('$'); const widgetLabel = fixture.nativeElement.querySelector('label.adf-label'); - expect(widgetLabel.textContent).toBe('Test Amount*'); + expect(widgetLabel.textContent.trim()).toBe('Test Amount*'); expect(widget.field.isValid).toBe(false); const input = await loader.getHarness(MatInputHarness); @@ -239,7 +236,7 @@ describe('AmountWidgetComponent - rendering', () => { await fixture.whenStable(); const widgetLabel = fixture.nativeElement.querySelector('label.adf-label'); - expect(widgetLabel.textContent).toBe('Test Amount*'); + expect(widgetLabel.textContent.trim()).toBe('Test Amount*'); const field = await loader.getHarness(MatFormFieldHarness); expect(await field.getPrefixText()).toBe('£'); @@ -339,7 +336,7 @@ describe('AmountWidgetComponent settings', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule, FormBaseModule], + imports: [CoreTestingModule], providers: [ { provide: ADF_AMOUNT_SETTINGS, diff --git a/lib/core/src/lib/form/components/widgets/amount/amount.widget.ts b/lib/core/src/lib/form/components/widgets/amount/amount.widget.ts index 4de563805d..4558e03525 100644 --- a/lib/core/src/lib/form/components/widgets/amount/amount.widget.ts +++ b/lib/core/src/lib/form/components/widgets/amount/amount.widget.ts @@ -17,8 +17,15 @@ /* eslint-disable @angular-eslint/component-selector */ +import { NgIf } from '@angular/common'; import { Component, OnInit, ViewEncapsulation, InjectionToken, Inject, Optional } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { TranslateModule } from '@ngx-translate/core'; import { FormService } from '../../../services/form.service'; +import { ErrorWidgetComponent } from '../error/error.component'; import { WidgetComponent } from '../widget.component'; export interface AmountWidgetSettings { @@ -29,6 +36,7 @@ export const ADF_AMOUNT_SETTINGS = new InjectionToken('adf @Component({ selector: 'amount-widget', + standalone: true, templateUrl: './amount.widget.html', styleUrls: ['./amount.widget.scss'], host: { @@ -42,6 +50,7 @@ export const ADF_AMOUNT_SETTINGS = new InjectionToken('adf '(invalid)': 'event($event)', '(select)': 'event($event)' }, + imports: [MatFormFieldModule, MatTooltipModule, MatInputModule, FormsModule, ErrorWidgetComponent, TranslateModule, NgIf], encapsulation: ViewEncapsulation.None }) export class AmountWidgetComponent extends WidgetComponent implements OnInit { diff --git a/lib/core/src/lib/form/components/widgets/base-viewer/base-viewer.widget.html b/lib/core/src/lib/form/components/widgets/base-viewer/base-viewer.widget.html index 8657e32aad..2373607eb0 100644 --- a/lib/core/src/lib/form/components/widgets/base-viewer/base-viewer.widget.html +++ b/lib/core/src/lib/form/components/widgets/base-viewer/base-viewer.widget.html @@ -1,7 +1,13 @@ -
- - +
+ +
diff --git a/lib/core/src/lib/form/components/widgets/base-viewer/base-viewer.widget.spec.ts b/lib/core/src/lib/form/components/widgets/base-viewer/base-viewer.widget.spec.ts index bd366824e7..185bf3419a 100644 --- a/lib/core/src/lib/form/components/widgets/base-viewer/base-viewer.widget.spec.ts +++ b/lib/core/src/lib/form/components/widgets/base-viewer/base-viewer.widget.spec.ts @@ -15,12 +15,11 @@ * limitations under the License. */ -import { FormModel } from '../core/form.model'; -import { FormFieldModel } from '../core/form-field.model'; -import { FormService } from '../../../services/form.service'; -import { CoreTestingModule } from '../../../../testing/core.testing.module'; -import { BaseViewerWidgetComponent } from './base-viewer.widget'; import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { CoreTestingModule } from '../../../../testing'; +import { FormService } from '../../../services/form.service'; +import { FormFieldModel, FormModel } from '../core'; +import { BaseViewerWidgetComponent } from './base-viewer.widget'; describe('BaseViewerWidgetComponent', () => { const fakeForm = new FormModel(); @@ -45,8 +44,7 @@ describe('BaseViewerWidgetComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule], - declarations: [BaseViewerWidgetComponent], + imports: [CoreTestingModule, BaseViewerWidgetComponent], providers: [{ provide: FormService, useValue: formServiceStub }] }); diff --git a/lib/core/src/lib/form/components/widgets/base-viewer/base-viewer.widget.ts b/lib/core/src/lib/form/components/widgets/base-viewer/base-viewer.widget.ts index f50586b82f..94abd07ff1 100644 --- a/lib/core/src/lib/form/components/widgets/base-viewer/base-viewer.widget.ts +++ b/lib/core/src/lib/form/components/widgets/base-viewer/base-viewer.widget.ts @@ -15,14 +15,19 @@ * limitations under the License. */ +import { NgIf } from '@angular/common'; import { Component, OnInit, ViewEncapsulation } from '@angular/core'; +import { TranslateModule } from '@ngx-translate/core'; +import { ViewerComponent } from '../../../../viewer'; import { FormService } from '../../../services/form.service'; +import { ErrorWidgetComponent } from '../error/error.component'; import { WidgetComponent } from '../widget.component'; /* eslint-disable @angular-eslint/component-selector */ @Component({ selector: 'base-viewer-widget', + standalone: true, templateUrl: './base-viewer.widget.html', styleUrls: ['./base-viewer.widget.scss'], host: { @@ -36,6 +41,7 @@ import { WidgetComponent } from '../widget.component'; '(invalid)': 'event($event)', '(select)': 'event($event)' }, + imports: [NgIf, TranslateModule, ViewerComponent, ErrorWidgetComponent], encapsulation: ViewEncapsulation.None }) export class BaseViewerWidgetComponent extends WidgetComponent implements OnInit { diff --git a/lib/core/src/lib/form/components/widgets/checkbox/checkbox.widget.html b/lib/core/src/lib/form/components/widgets/checkbox/checkbox.widget.html index ca292a9a61..dc82152d06 100644 --- a/lib/core/src/lib/form/components/widgets/checkbox/checkbox.widget.html +++ b/lib/core/src/lib/form/components/widgets/checkbox/checkbox.widget.html @@ -1,19 +1,19 @@
- - {{field.name | translate }} - * + + {{ field.name | translate }} + * - +
diff --git a/lib/core/src/lib/form/components/widgets/checkbox/checkbox.widget.spec.ts b/lib/core/src/lib/form/components/widgets/checkbox/checkbox.widget.spec.ts index 06e93c8ab5..dfc7438a10 100644 --- a/lib/core/src/lib/form/components/widgets/checkbox/checkbox.widget.spec.ts +++ b/lib/core/src/lib/form/components/widgets/checkbox/checkbox.widget.spec.ts @@ -15,21 +15,18 @@ * limitations under the License. */ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormFieldTypes } from '../core/form-field-types'; -import { FormFieldModel } from '../core/form-field.model'; -import { FormModel } from '../core/form.model'; -import { CheckboxWidgetComponent } from './checkbox.widget'; -import { FormBaseModule } from '../../../form-base.module'; -import { TranslateLoader } from '@ngx-translate/core'; -import { TranslateLoaderService } from '../../../../translation/translate-loader.service'; -import { MatCheckboxModule } from '@angular/material/checkbox'; -import { CoreTestingModule } from '../../../../testing'; -import { MatTooltipModule } from '@angular/material/tooltip'; import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatCheckboxModule } from '@angular/material/checkbox'; import { MatCheckboxHarness } from '@angular/material/checkbox/testing'; +import { MatTooltipModule } from '@angular/material/tooltip'; import { MatTooltipHarness } from '@angular/material/tooltip/testing'; +import { TranslateLoader } from '@ngx-translate/core'; +import { CoreTestingModule } from '../../../../testing'; +import { TranslateLoaderService } from '../../../../translation'; +import { FormFieldModel, FormFieldTypes, FormModel } from '../core'; +import { CheckboxWidgetComponent } from './checkbox.widget'; describe('CheckboxWidgetComponent', () => { let loader: HarnessLoader; @@ -39,7 +36,7 @@ describe('CheckboxWidgetComponent', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [CoreTestingModule, FormBaseModule, MatCheckboxModule, MatTooltipModule], + imports: [CoreTestingModule, MatCheckboxModule, MatTooltipModule], providers: [{ provide: TranslateLoader, useClass: TranslateLoaderService }] }); fixture = TestBed.createComponent(CheckboxWidgetComponent); diff --git a/lib/core/src/lib/form/components/widgets/checkbox/checkbox.widget.ts b/lib/core/src/lib/form/components/widgets/checkbox/checkbox.widget.ts index 7d2f3afe1d..22e8e51437 100644 --- a/lib/core/src/lib/form/components/widgets/checkbox/checkbox.widget.ts +++ b/lib/core/src/lib/form/components/widgets/checkbox/checkbox.widget.ts @@ -17,12 +17,19 @@ /* eslint-disable @angular-eslint/component-selector, @angular-eslint/no-input-rename */ +import { NgClass, NgIf } from '@angular/common'; import { Component, ViewEncapsulation } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatCheckboxModule } from '@angular/material/checkbox'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { TranslateModule } from '@ngx-translate/core'; import { FormService } from '../../../services/form.service'; +import { ErrorWidgetComponent } from '../error/error.component'; import { WidgetComponent } from '../widget.component'; @Component({ selector: 'checkbox-widget', + standalone: true, templateUrl: './checkbox.widget.html', host: { '(click)': 'event($event)', @@ -35,6 +42,7 @@ import { WidgetComponent } from '../widget.component'; '(invalid)': 'event($event)', '(select)': 'event($event)' }, + imports: [NgClass, MatCheckboxModule, FormsModule, TranslateModule, MatTooltipModule, ErrorWidgetComponent, NgIf], encapsulation: ViewEncapsulation.None }) export class CheckboxWidgetComponent extends WidgetComponent { diff --git a/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.html b/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.html index 4e509f6869..fed0a6edc8 100644 --- a/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.html +++ b/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.html @@ -1,36 +1,47 @@ -
+
- -
+ +
- - + + - + [matDatetimepicker]="datetimePicker" + [id]="field.id" + [(ngModel)]="value" + [required]="isRequired()" + [disabled]="field.readOnly" + (change)="onValueChanged($event)" + (dateChange)="onDateChanged($event)" + (keydown.enter)="datetimePicker.open()" + [placeholder]="field.placeholder" + [matTooltip]="field.tooltip" + (blur)="markAsTouched()" + matTooltipPosition="above" + [matTooltipShowDelay]="1000" + [min]="minDate" + [max]="maxDate"> + - + + data-automation-id="adf-date-time-widget-picker" + type="datetime" + [touchUi]="true" + [timeInterval]="5" + [disabled]="field.readOnly">
diff --git a/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.spec.ts b/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.spec.ts index 5b28f84f3f..85cff4f113 100644 --- a/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.spec.ts +++ b/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.spec.ts @@ -15,18 +15,15 @@ * limitations under the License. */ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { FormFieldModel } from '../core/form-field.model'; -import { FormModel } from '../core/form.model'; -import { DateTimeWidgetComponent } from './date-time.widget'; -import { CoreTestingModule } from '../../../../testing/core.testing.module'; -import { MatTooltipModule } from '@angular/material/tooltip'; -import { FormFieldTypes } from '../core/form-field-types'; -import { DateFieldValidator, DateTimeFieldValidator } from '../core'; import { HarnessLoader } from '@angular/cdk/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; -import { MatTooltipHarness } from '@angular/material/tooltip/testing'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; import { MatInputHarness } from '@angular/material/input/testing'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { MatTooltipHarness } from '@angular/material/tooltip/testing'; +import { CoreTestingModule } from '../../../../testing'; +import { DateFieldValidator, DateTimeFieldValidator, FormFieldModel, FormFieldTypes, FormModel } from '../core'; +import { DateTimeWidgetComponent } from './date-time.widget'; describe('DateTimeWidgetComponent', () => { let loader: HarnessLoader; diff --git a/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.ts b/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.ts index f614322b6d..a6cc9844c1 100644 --- a/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.ts +++ b/lib/core/src/lib/form/components/widgets/date-time/date-time.widget.ts @@ -17,26 +17,42 @@ /* eslint-disable @angular-eslint/component-selector */ +import { NgIf } from '@angular/common'; import { Component, Input, OnInit, ViewEncapsulation } from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core'; -import { DatetimeAdapter, MAT_DATETIME_FORMATS, MatDatetimepickerInputEvent } from '@mat-datetimepicker/core'; -import { FormService } from '../../../services/form.service'; -import { WidgetComponent } from '../widget.component'; -import { ADF_DATE_FORMATS, AdfDateFnsAdapter } from '../../../../common/utils/date-fns-adapter'; -import { ADF_DATETIME_FORMATS, AdfDateTimeFnsAdapter } from '../../../../common/utils/datetime-fns-adapter'; -import { DateFnsUtils } from '../../../../common'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { DatetimeAdapter, MAT_DATETIME_FORMATS, MatDatetimepickerInputEvent, MatDatetimepickerModule } from '@mat-datetimepicker/core'; +import { TranslateModule } from '@ngx-translate/core'; import { isValid } from 'date-fns'; +import { ADF_DATE_FORMATS, ADF_DATETIME_FORMATS, AdfDateFnsAdapter, AdfDateTimeFnsAdapter, DateFnsUtils } from '../../../../common'; +import { FormService } from '../../../services/form.service'; +import { ErrorWidgetComponent } from '../error/error.component'; +import { WidgetComponent } from '../widget.component'; @Component({ + selector: 'date-time-widget', + standalone: true, providers: [ { provide: MAT_DATE_FORMATS, useValue: ADF_DATE_FORMATS }, { provide: MAT_DATETIME_FORMATS, useValue: ADF_DATETIME_FORMATS }, { provide: DateAdapter, useClass: AdfDateFnsAdapter }, { provide: DatetimeAdapter, useClass: AdfDateTimeFnsAdapter } ], - selector: 'date-time-widget', templateUrl: './date-time.widget.html', styleUrls: ['./date-time.widget.scss'], + imports: [ + NgIf, + TranslateModule, + MatFormFieldModule, + MatInputModule, + MatDatetimepickerModule, + FormsModule, + MatTooltipModule, + ErrorWidgetComponent + ], encapsulation: ViewEncapsulation.None }) export class DateTimeWidgetComponent extends WidgetComponent implements OnInit { @@ -46,9 +62,7 @@ export class DateTimeWidgetComponent extends WidgetComponent implements OnInit { @Input() value: any = null; - constructor(public formService: FormService, - private dateAdapter: DateAdapter, - private dateTimeAdapter: DatetimeAdapter) { + constructor(public formService: FormService, private dateAdapter: DateAdapter, private dateTimeAdapter: DatetimeAdapter) { super(formService); } diff --git a/lib/core/src/lib/form/components/widgets/date/date.widget.html b/lib/core/src/lib/form/components/widgets/date/date.widget.html index af40b0a88f..5b05f45249 100644 --- a/lib/core/src/lib/form/components/widgets/date/date.widget.html +++ b/lib/core/src/lib/form/components/widgets/date/date.widget.html @@ -1,25 +1,28 @@ -
+
{{field.name | translate }} ({{field.dateDisplayFormat}}) - + [id]="field.id + '-label'" + [attr.for]="field.id"> + {{ field.name | translate }} ({{ field.dateDisplayFormat }}) + + + [startAt]="startAt" + [disabled]="field.readOnly"> - +
diff --git a/lib/core/src/lib/form/components/widgets/date/date.widget.spec.ts b/lib/core/src/lib/form/components/widgets/date/date.widget.spec.ts index 8076bd3a7c..5719cd6121 100644 --- a/lib/core/src/lib/form/components/widgets/date/date.widget.spec.ts +++ b/lib/core/src/lib/form/components/widgets/date/date.widget.spec.ts @@ -17,12 +17,9 @@ import { ComponentFixture, TestBed } from '@angular/core/testing'; import { DateAdapter } from '@angular/material/core'; -import { FormFieldModel } from '../core/form-field.model'; -import { FormModel } from '../core/form.model'; +import { CoreTestingModule } from '../../../../testing'; +import { DateFieldValidator, FormFieldModel, FormFieldTypes, FormModel, MaxDateFieldValidator, MinDateFieldValidator } from '../core'; import { DateWidgetComponent } from './date.widget'; -import { CoreTestingModule } from '../../../../testing/core.testing.module'; -import { FormFieldTypes } from '../core/form-field-types'; -import { DateFieldValidator, MaxDateFieldValidator, MinDateFieldValidator } from '../core/form-field-validator'; describe('DateWidgetComponent', () => { let widget: DateWidgetComponent; diff --git a/lib/core/src/lib/form/components/widgets/date/date.widget.ts b/lib/core/src/lib/form/components/widgets/date/date.widget.ts index 9194c680fe..b8342ccdff 100644 --- a/lib/core/src/lib/form/components/widgets/date/date.widget.ts +++ b/lib/core/src/lib/form/components/widgets/date/date.widget.ts @@ -17,16 +17,23 @@ /* eslint-disable @angular-eslint/component-selector */ -import { Component, OnInit, ViewEncapsulation, OnDestroy, Input } from '@angular/core'; +import { NgIf } from '@angular/common'; +import { Component, Input, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core'; +import { FormsModule } from '@angular/forms'; import { DateAdapter, MAT_DATE_FORMATS } from '@angular/material/core'; -import { FormService } from '../../../services/form.service'; -import { WidgetComponent } from '../widget.component'; +import { MatDatepickerInputEvent, MatDatepickerModule } from '@angular/material/datepicker'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { TranslateModule } from '@ngx-translate/core'; import { Subject } from 'rxjs'; -import { MatDatepickerInputEvent } from '@angular/material/datepicker'; -import { ADF_DATE_FORMATS, AdfDateFnsAdapter } from '../../../../common/utils/date-fns-adapter'; +import { ADF_DATE_FORMATS, AdfDateFnsAdapter } from '../../../../common'; +import { FormService } from '../../../services/form.service'; +import { ErrorWidgetComponent } from '../error/error.component'; +import { WidgetComponent } from '../widget.component'; @Component({ selector: 'date-widget', + standalone: true, providers: [ { provide: MAT_DATE_FORMATS, useValue: ADF_DATE_FORMATS }, { provide: DateAdapter, useClass: AdfDateFnsAdapter } @@ -43,6 +50,7 @@ import { ADF_DATE_FORMATS, AdfDateFnsAdapter } from '../../../../common/utils/da '(invalid)': 'event($event)', '(select)': 'event($event)' }, + imports: [MatFormFieldModule, TranslateModule, MatInputModule, MatDatepickerModule, FormsModule, ErrorWidgetComponent, NgIf], encapsulation: ViewEncapsulation.None }) export class DateWidgetComponent extends WidgetComponent implements OnInit, OnDestroy { diff --git a/lib/core/src/lib/form/components/widgets/decimal/decimal.component.html b/lib/core/src/lib/form/components/widgets/decimal/decimal.component.html index 28c624efa5..7484e222ab 100644 --- a/lib/core/src/lib/form/components/widgets/decimal/decimal.component.html +++ b/lib/core/src/lib/form/components/widgets/decimal/decimal.component.html @@ -1,9 +1,7 @@ -
+
- + - +
diff --git a/lib/core/src/lib/form/components/widgets/decimal/decimal.component.spec.ts b/lib/core/src/lib/form/components/widgets/decimal/decimal.component.spec.ts index 0328ff0916..06ceb4e150 100644 --- a/lib/core/src/lib/form/components/widgets/decimal/decimal.component.spec.ts +++ b/lib/core/src/lib/form/components/widgets/decimal/decimal.component.spec.ts @@ -15,18 +15,17 @@ * limitations under the License. */ -import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; import { HarnessLoader } from '@angular/cdk/testing'; - -import { DecimalWidgetComponent } from './decimal.component'; -import { FormService } from '../../../services/form.service'; -import { FormFieldModel, FormFieldTypes, FormModel } from '../core'; +import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { MatInputModule } from '@angular/material/input'; import { MatInputHarness } from '@angular/material/input/testing'; import { MatTooltipHarness } from '@angular/material/tooltip/testing'; -import { MatInputModule } from '@angular/material/input'; import { CoreTestingModule } from '../../../../testing'; -import { FormsModule } from '@angular/forms'; +import { FormService } from '../../../services/form.service'; +import { FormFieldModel, FormFieldTypes, FormModel } from '../core'; + +import { DecimalWidgetComponent } from './decimal.component'; describe('DecimalComponent', () => { let loader: HarnessLoader; @@ -36,8 +35,7 @@ describe('DecimalComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ - imports: [CoreTestingModule, MatInputModule, FormsModule], - declarations: [DecimalWidgetComponent], + imports: [CoreTestingModule, MatInputModule, DecimalWidgetComponent], providers: [FormService] }).compileComponents(); diff --git a/lib/core/src/lib/form/components/widgets/decimal/decimal.component.ts b/lib/core/src/lib/form/components/widgets/decimal/decimal.component.ts index a1a1f21316..1ab7edb8d1 100644 --- a/lib/core/src/lib/form/components/widgets/decimal/decimal.component.ts +++ b/lib/core/src/lib/form/components/widgets/decimal/decimal.component.ts @@ -15,12 +15,20 @@ * limitations under the License. */ +import { NgIf } from '@angular/common'; import { Component, ViewEncapsulation } from '@angular/core'; +import { FormsModule } from '@angular/forms'; +import { MatFormFieldModule } from '@angular/material/form-field'; +import { MatInputModule } from '@angular/material/input'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { TranslateModule } from '@ngx-translate/core'; import { FormService } from '../../../services/form.service'; +import { ErrorWidgetComponent } from '../error/error.component'; import { WidgetComponent } from '../widget.component'; @Component({ selector: 'adf-decimal', + standalone: true, templateUrl: './decimal.component.html', styleUrls: ['./decimal.component.scss'], host: { @@ -34,6 +42,7 @@ import { WidgetComponent } from '../widget.component'; '(invalid)': 'event($event)', '(select)': 'event($event)' }, + imports: [NgIf, TranslateModule, MatFormFieldModule, MatInputModule, FormsModule, MatTooltipModule, ErrorWidgetComponent], encapsulation: ViewEncapsulation.None }) export class DecimalWidgetComponent extends WidgetComponent { diff --git a/lib/core/src/lib/form/components/widgets/display-text/display-text.widget.html b/lib/core/src/lib/form/components/widgets/display-text/display-text.widget.html index 6770760e46..3056ef4b65 100644 --- a/lib/core/src/lib/form/components/widgets/display-text/display-text.widget.html +++ b/lib/core/src/lib/form/components/widgets/display-text/display-text.widget.html @@ -1,2 +1,6 @@ -
{{field.value | translate}}
+
+ {{ field.value | translate }} +
diff --git a/lib/core/src/lib/form/components/widgets/display-text/display-text.widget.ts b/lib/core/src/lib/form/components/widgets/display-text/display-text.widget.ts index 64e6453aa7..da48511482 100644 --- a/lib/core/src/lib/form/components/widgets/display-text/display-text.widget.ts +++ b/lib/core/src/lib/form/components/widgets/display-text/display-text.widget.ts @@ -15,14 +15,17 @@ * limitations under the License. */ - /* eslint-disable @angular-eslint/component-selector */ +/* eslint-disable @angular-eslint/component-selector */ import { Component, ViewEncapsulation } from '@angular/core'; +import { MatTooltipModule } from '@angular/material/tooltip'; +import { TranslateModule } from '@ngx-translate/core'; import { FormService } from '../../../services/form.service'; import { WidgetComponent } from '../widget.component'; @Component({ selector: 'display-text-widget', + standalone: true, templateUrl: './display-text.widget.html', styleUrls: ['./display-text.widget.scss'], host: { @@ -36,12 +39,11 @@ import { WidgetComponent } from '../widget.component'; '(invalid)': 'event($event)', '(select)': 'event($event)' }, + imports: [MatTooltipModule, TranslateModule], encapsulation: ViewEncapsulation.None }) export class DisplayTextWidgetComponent extends WidgetComponent { - constructor(public formService: FormService) { - super(formService); + super(formService); } - } diff --git a/lib/core/src/lib/form/components/widgets/error/error.component.html b/lib/core/src/lib/form/components/widgets/error/error.component.html index 99ae5edcba..939bcf0249 100644 --- a/lib/core/src/lib/form/components/widgets/error/error.component.html +++ b/lib/core/src/lib/form/components/widgets/error/error.component.html @@ -1,10 +1,10 @@
error_outline -
{{error.message | translate:translateParameters}}
+
{{ error.message | translate:translateParameters }}
error_outline -
{{required}}
+
{{ required }}
diff --git a/lib/core/src/lib/form/components/widgets/error/error.component.spec.ts b/lib/core/src/lib/form/components/widgets/error/error.component.spec.ts index 81e4dcaa5c..f55dc31e61 100644 --- a/lib/core/src/lib/form/components/widgets/error/error.component.spec.ts +++ b/lib/core/src/lib/form/components/widgets/error/error.component.spec.ts @@ -17,28 +17,25 @@ import { SimpleChange, SimpleChanges } from '@angular/core'; import { ComponentFixture, TestBed } from '@angular/core/testing'; -import { ErrorWidgetComponent } from './error.component'; import { CoreTestingModule } from '../../../../testing'; -import { ErrorMessageModel } from '../index'; +import { ErrorMessageModel } from '../core'; +import { ErrorWidgetComponent } from './error.component'; describe('ErrorWidgetComponent', () => { - let widget: ErrorWidgetComponent; let fixture: ComponentFixture; let element: HTMLElement; beforeEach(() => { TestBed.configureTestingModule({ - imports: [ - CoreTestingModule - ] + imports: [CoreTestingModule] }); fixture = TestBed.createComponent(ErrorWidgetComponent); widget = fixture.componentInstance; element = fixture.nativeElement; }); const errorMessage: string = 'fake-error'; - const errorMessageModel: ErrorMessageModel = new ErrorMessageModel({message: errorMessage}); + const errorMessageModel: ErrorMessageModel = new ErrorMessageModel({ message: errorMessage }); const errorChanges: SimpleChanges = { error: new SimpleChange(errorMessageModel, errorMessageModel, false) }; diff --git a/lib/core/src/lib/form/components/widgets/error/error.component.ts b/lib/core/src/lib/form/components/widgets/error/error.component.ts index 9832cb052c..e44cdb50a7 100644 --- a/lib/core/src/lib/form/components/widgets/error/error.component.ts +++ b/lib/core/src/lib/form/components/widgets/error/error.component.ts @@ -18,19 +18,29 @@ /* eslint-disable @angular-eslint/component-selector */ import { animate, state, style, transition, trigger } from '@angular/animations'; +import { NgIf } from '@angular/common'; import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core'; -import { ErrorMessageModel } from '../core'; +import { MatIconModule } from '@angular/material/icon'; +import { TranslateModule } from '@ngx-translate/core'; import { FormService } from '../../../services/form.service'; +import { ErrorMessageModel } from '../core'; import { WidgetComponent } from '../widget.component'; @Component({ selector: 'error-widget', + standalone: true, templateUrl: './error.component.html', styleUrls: ['./error.component.scss'], animations: [ trigger('transitionMessages', [ state('enter', style({ opacity: 1, transform: 'translateY(0%)' })), - transition('void => enter', [style({ opacity: 0, transform: 'translateY(-100%)' }), animate('300ms cubic-bezier(0.55, 0, 0.55, 0.2)')]) + transition('void => enter', [ + style({ + opacity: 0, + transform: 'translateY(-100%)' + }), + animate('300ms cubic-bezier(0.55, 0, 0.55, 0.2)') + ]) ]) ], host: { @@ -44,6 +54,7 @@ import { WidgetComponent } from '../widget.component'; '(invalid)': 'event($event)', '(select)': 'event($event)' }, + imports: [NgIf, MatIconModule, TranslateModule], encapsulation: ViewEncapsulation.None }) export class ErrorWidgetComponent extends WidgetComponent implements OnChanges { diff --git a/lib/core/src/lib/form/components/widgets/hyperlink/hyperlink.widget.html b/lib/core/src/lib/form/components/widgets/hyperlink/hyperlink.widget.html index 8a75d32156..c6515347eb 100644 --- a/lib/core/src/lib/form/components/widgets/hyperlink/hyperlink.widget.html +++ b/lib/core/src/lib/form/components/widgets/hyperlink/hyperlink.widget.html @@ -1,7 +1,10 @@