diff --git a/frontend/src/app/features/assets/pages/asset-tags.component.ts b/frontend/src/app/features/assets/pages/asset-tags.component.ts index 31ea829cbb..9c95959c9c 100644 --- a/frontend/src/app/features/assets/pages/asset-tags.component.ts +++ b/frontend/src/app/features/assets/pages/asset-tags.component.ts @@ -7,7 +7,7 @@ /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { DialogModel, TagItem, TagsSelected } from '@app/shared'; @Component({ @@ -29,7 +29,7 @@ export class AssetTagsComponent { @Input({ required: true }) public tagsSelected!: TagsSelected; - @Input() + @Input({ transform: booleanAttribute }) public canRename = false; public tagRenaming?: TagItem; diff --git a/frontend/src/app/features/content/pages/content/editor/content-editor.component.ts b/frontend/src/app/features/content/pages/content/editor/content-editor.component.ts index f17ca82bcc..cd2ff3a0d3 100644 --- a/frontend/src/app/features/content/pages/content/editor/content-editor.component.ts +++ b/frontend/src/app/features/content/pages/content/editor/content-editor.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, Component, EventEmitter, Input, Output } from '@angular/core'; import { AppLanguageDto, EditContentForm, FieldForm, FieldSection, RootFieldDto, SchemaDto, Version } from '@app/shared'; @Component({ @@ -23,13 +23,13 @@ export class ContentEditorComponent { @Output() public contentIdChange = new EventEmitter(); - @Input() + @Input({ transform: booleanAttribute }) public isNew = false; - @Input() + @Input({ transform: booleanAttribute }) public isDeleted?: boolean; - @Input() + @Input({ transform: booleanAttribute }) public showIdInput = false; @Input({ required: true }) diff --git a/frontend/src/app/features/content/pages/content/editor/content-field.component.ts b/frontend/src/app/features/content/pages/content/editor/content-field.component.ts index e6d238b156..ad3f7d66c9 100644 --- a/frontend/src/app/features/content/pages/content/editor/content-field.component.ts +++ b/frontend/src/app/features/content/pages/content/editor/content-field.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, EventEmitter, HostBinding, Input, Output } from '@angular/core'; +import { booleanAttribute, Component, EventEmitter, HostBinding, Input, numberAttribute, Output } from '@angular/core'; import { Observable } from 'rxjs'; import { AppLanguageDto, AppsState, changed$, disabled$, EditContentForm, FieldForm, invalid$, LocalStoreService, SchemaDto, Settings, TranslationsService, TypedSimpleChanges } from '@app/shared'; @@ -18,7 +18,7 @@ export class ContentFieldComponent { @Output() public languageChange = new EventEmitter(); - @Input() + @Input({ transform: booleanAttribute }) public isCompact?: boolean | null; @Input() @@ -30,7 +30,7 @@ export class ContentFieldComponent { @Input({ required: true }) public formContext!: any; - @Input({ required: true }) + @Input({ required: true, transform: numberAttribute }) public formLevel!: number; @Input({ required: true }) diff --git a/frontend/src/app/features/content/pages/content/editor/content-section.component.ts b/frontend/src/app/features/content/pages/content/editor/content-section.component.ts index 22fc5a5e77..12844ea767 100644 --- a/frontend/src/app/features/content/pages/content/editor/content-section.component.ts +++ b/frontend/src/app/features/content/pages/content/editor/content-section.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, numberAttribute, Output } from '@angular/core'; import { AppLanguageDto, EditContentForm, FieldForm, FieldSection, LocalStoreService, RootFieldDto, SchemaDto, Settings, StatefulComponent, TypedSimpleChanges } from '@app/shared'; interface State { @@ -23,7 +23,7 @@ export class ContentSectionComponent extends StatefulComponent { @Output() public languageChange = new EventEmitter(); - @Input() + @Input({ transform: booleanAttribute }) public isCompact?: boolean | null; @Input({ required: true }) @@ -32,7 +32,7 @@ export class ContentSectionComponent extends StatefulComponent { @Input() public formCompare?: EditContentForm | null; - @Input({ required: true }) + @Input({ required: true, transform: numberAttribute }) public formLevel!: number; @Input({ required: true }) diff --git a/frontend/src/app/features/content/pages/content/editor/field-languages.component.ts b/frontend/src/app/features/content/pages/content/editor/field-languages.component.ts index 261ab24e67..7249a1a0d3 100644 --- a/frontend/src/app/features/content/pages/content/editor/field-languages.component.ts +++ b/frontend/src/app/features/content/pages/content/editor/field-languages.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { AppLanguageDto, FieldForm } from '@app/shared'; @Component({ @@ -18,7 +18,7 @@ export class FieldLanguagesComponent { @Output() public showAllControlsChange = new EventEmitter(); - @Input() + @Input({ transform: booleanAttribute }) public showAllControls?: boolean | null; @Output() diff --git a/frontend/src/app/features/content/shared/due-time-selector.component.ts b/frontend/src/app/features/content/shared/due-time-selector.component.ts index 1dc45f8a57..c00264d2a5 100644 --- a/frontend/src/app/features/content/shared/due-time-selector.component.ts +++ b/frontend/src/app/features/content/shared/due-time-selector.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input } from '@angular/core'; +import { booleanAttribute, Component, Input } from '@angular/core'; import { Observable, of, Subject } from 'rxjs'; import { DialogModel } from '@app/shared'; @@ -19,7 +19,7 @@ const OPTION_IMMEDIATELY = 'Immediately'; export class DueTimeSelectorComponent { private dueTimeResult?: Subject; - @Input() + @Input({ transform: booleanAttribute }) public disabled?: boolean | null; public dueTimeDialog = new DialogModel(); diff --git a/frontend/src/app/features/content/shared/forms/array-editor.component.ts b/frontend/src/app/features/content/shared/forms/array-editor.component.ts index ee837aa805..9ead4f4fc2 100644 --- a/frontend/src/app/features/content/shared/forms/array-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/array-editor.component.ts @@ -6,7 +6,7 @@ */ import { CdkDragDrop } from '@angular/cdk/drag-drop'; -import { ChangeDetectionStrategy, Component, Input, QueryList, ViewChildren } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, Input, numberAttribute, QueryList, ViewChildren } from '@angular/core'; import { VirtualScrollerComponent } from '@iharbeck/ngx-virtual-scroller'; import { combineLatest, Observable } from 'rxjs'; import { map } from 'rxjs/operators'; @@ -26,19 +26,19 @@ export class ArrayEditorComponent { @Input({ required: true }) public formContext!: any; - @Input({ required: true }) + @Input({ required: true, transform: numberAttribute }) public formLevel!: number; @Input({ required: true }) public formModel!: FieldArrayForm; - @Input({ required: true }) + @Input({ required: true, transform: booleanAttribute }) public isComparing = false; - @Input() + @Input({ transform: booleanAttribute }) public isExpanded = false; - @Input() + @Input({ transform: booleanAttribute }) public canUnset?: boolean | null; @Input({ required: true }) diff --git a/frontend/src/app/features/content/shared/forms/array-item.component.ts b/frontend/src/app/features/content/shared/forms/array-item.component.ts index ec5e0176eb..1ae46d1e56 100644 --- a/frontend/src/app/features/content/shared/forms/array-item.component.ts +++ b/frontend/src/app/features/content/shared/forms/array-item.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, QueryList, ViewChildren } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, numberAttribute, Output, QueryList, ViewChildren } from '@angular/core'; import { Observable, of } from 'rxjs'; import { map } from 'rxjs/operators'; import { AppLanguageDto, ComponentForm, EditContentForm, FieldDto, FieldFormatter, FieldSection, invalid$, ObjectFormBase, RootFieldDto, TypedSimpleChanges, Types, valueProjection$ } from '@app/shared'; @@ -36,31 +36,31 @@ export class ArrayItemComponent { @Input({ required: true }) public formContext!: any; - @Input({ required: true }) + @Input({ required: true, transform: numberAttribute }) public formLevel!: number; @Input({ required: true }) public formModel!: ObjectFormBase; - @Input() + @Input({ transform: booleanAttribute }) public canUnset?: boolean | null; - @Input({ required: true }) + @Input({ required: true, transform: booleanAttribute }) public isComparing = false; - @Input() + @Input({ transform: booleanAttribute }) public isCollapsedInitial = false; - @Input() + @Input({ transform: booleanAttribute }) public isFirst?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public isLast?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public isDisabled?: boolean | null; - @Input({ required: true }) + @Input({ required: true, transform: numberAttribute }) public index!: number; @Input({ required: true }) diff --git a/frontend/src/app/features/content/shared/forms/assets-editor.component.ts b/frontend/src/app/features/content/shared/forms/assets-editor.component.ts index 0f7633dbc9..d01689e790 100644 --- a/frontend/src/app/features/content/shared/forms/assets-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/assets-editor.component.ts @@ -6,7 +6,7 @@ */ import { CdkDragDrop } from '@angular/cdk/drag-drop'; -import { ChangeDetectionStrategy, Component, forwardRef, Input, OnInit } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, forwardRef, Input, OnInit } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { AssetDto, DialogModel, LocalStoreService, MessageBus, ResolveAssets, Settings, sorted, StatefulControlComponent, Types } from '@app/shared'; @@ -52,10 +52,10 @@ export class AssetsEditorComponent extends StatefulControlComponent; - @Input({ required: true }) + @Input({ required: true, transform: booleanAttribute }) public isComparing = false; @Input({ required: true }) @@ -37,10 +37,10 @@ export class ComponentSectionComponent { @Input({ required: true }) public languages!: ReadonlyArray; - @Input() + @Input({ transform: numberAttribute }) public index: number | null | undefined; - @Input() + @Input({ transform: booleanAttribute }) public canUnset?: boolean | null; @ViewChildren(FieldEditorComponent) diff --git a/frontend/src/app/features/content/shared/forms/component.component.ts b/frontend/src/app/features/content/shared/forms/component.component.ts index 220f565964..2418e281b4 100644 --- a/frontend/src/app/features/content/shared/forms/component.component.ts +++ b/frontend/src/app/features/content/shared/forms/component.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, QueryList, ViewChildren } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, numberAttribute, QueryList, ViewChildren } from '@angular/core'; import { Observable } from 'rxjs'; import { AppLanguageDto, ComponentFieldPropertiesDto, ComponentForm, disabled$, EditContentForm, FieldDto, FieldSection, ModalModel, ResourceOwner, SchemaDto, TypedSimpleChanges, Types } from '@app/shared'; import { ComponentSectionComponent } from './component-section.component'; @@ -17,7 +17,7 @@ import { ComponentSectionComponent } from './component-section.component'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class ComponentComponent extends ResourceOwner { - @Input() + @Input({ transform: booleanAttribute }) public canUnset?: boolean | null; @Input({ required: true }) @@ -26,13 +26,13 @@ export class ComponentComponent extends ResourceOwner { @Input({ required: true }) public formContext!: any; - @Input({ required: true }) + @Input({ required: true, transform: numberAttribute }) public formLevel!: number; @Input({ required: true }) public formModel!: ComponentForm; - @Input({ required: true }) + @Input({ required: true, transform: booleanAttribute }) public isComparing = false; @Input({ required: true }) diff --git a/frontend/src/app/features/content/shared/forms/field-editor.component.ts b/frontend/src/app/features/content/shared/forms/field-editor.component.ts index f53e6bbcc5..36cc8f023e 100644 --- a/frontend/src/app/features/content/shared/forms/field-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/field-editor.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, ElementRef, EventEmitter, Input, Output, ViewChild } from '@angular/core'; +import { booleanAttribute, Component, ElementRef, EventEmitter, Input, numberAttribute, Output, ViewChild } from '@angular/core'; import { AbstractControl } from '@angular/forms'; import { Observable } from 'rxjs'; import { AbstractContentForm, AppLanguageDto, DialogModel, EditContentForm, FieldDto, hasNoValue$, MathHelper, TypedSimpleChanges, Types } from '@app/shared'; @@ -27,7 +27,7 @@ export class FieldEditorComponent { @Input({ required: true }) public formContext!: any; - @Input({ required: true }) + @Input({ required: true, transform: numberAttribute }) public formLevel!: number; @Input({ required: true }) @@ -39,13 +39,13 @@ export class FieldEditorComponent { @Input({ required: true }) public languages!: ReadonlyArray; - @Input() + @Input({ transform: numberAttribute }) public index: number | null | undefined; - @Input({ required: true }) + @Input({ required: true, transform: booleanAttribute }) public isComparing = false; - @Input() + @Input({ transform: booleanAttribute }) public canUnset?: boolean | null; @Input() diff --git a/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts b/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts index 829432a75c..e800ddf0d7 100644 --- a/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/iframe-editor.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostListener, Input, OnDestroy, Output, Renderer2, ViewChild } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, HostListener, Input, numberAttribute, OnDestroy, Output, Renderer2, ViewChild } from '@angular/core'; import { AbstractControl } from '@angular/forms'; import { Router } from '@angular/router'; import { DialogModel, DialogService, disabled$, StatefulComponent, TypedSimpleChanges, Types, value$ } from '@app/framework'; @@ -39,7 +39,7 @@ export class IFrameEditorComponent extends StatefulComponent implements @Output() public isExpandedChange = new EventEmitter(); - @Input() + @Input({ transform: booleanAttribute }) public isExpanded = false; @Input({ required: true }) @@ -51,7 +51,7 @@ export class IFrameEditorComponent extends StatefulComponent implements @Input({ required: true }) public formField = ''; - @Input({ required: true }) + @Input({ required: true, transform: numberAttribute }) public formIndex?: number | null; @Input({ required: true }) @@ -63,7 +63,7 @@ export class IFrameEditorComponent extends StatefulComponent implements @Input({ required: true }) public formControlBinding!: AbstractControl; - @Input() + @Input({ transform: booleanAttribute }) public set disabled(value: boolean | undefined | null) { this.updatedisabled(value === true); } diff --git a/frontend/src/app/features/content/shared/forms/stock-photo-editor.component.ts b/frontend/src/app/features/content/shared/forms/stock-photo-editor.component.ts index 1e14484b1b..77512a0a2a 100644 --- a/frontend/src/app/features/content/shared/forms/stock-photo-editor.component.ts +++ b/frontend/src/app/features/content/shared/forms/stock-photo-editor.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, forwardRef, Input, OnInit } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, forwardRef, Input, OnInit } from '@angular/core'; import { NG_VALUE_ACCESSOR, UntypedFormControl } from '@angular/forms'; import { BehaviorSubject, of } from 'rxjs'; import { debounceTime, map, switchMap, tap } from 'rxjs/operators'; @@ -41,7 +41,7 @@ type Request = { search?: string; page: number }; changeDetection: ChangeDetectionStrategy.OnPush, }) export class StockPhotoEditorComponent extends StatefulControlComponent implements OnInit { - @Input() + @Input({ transform: booleanAttribute }) public set disabled(value: boolean | undefined | null) { this.setDisabledState(value === true); } diff --git a/frontend/src/app/features/content/shared/list/content.component.ts b/frontend/src/app/features/content/shared/list/content.component.ts index 2168f3ec84..e93c3e0e41 100644 --- a/frontend/src/app/features/content/shared/list/content.component.ts +++ b/frontend/src/app/features/content/shared/list/content.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output, QueryList, ViewChildren } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output, QueryList, ViewChildren } from '@angular/core'; import { AppLanguageDto, ContentDto, ContentListFieldComponent, ContentsState, ModalModel, PatchContentForm, SchemaDto, TableField, TableSettings, TypedSimpleChanges } from '@app/shared'; /* tslint:disable: component-selector */ @@ -29,7 +29,7 @@ export class ContentComponent { @Output() public selectedChange = new EventEmitter(); - @Input() + @Input({ transform: booleanAttribute }) public selected = false; @Input() @@ -47,7 +47,7 @@ export class ContentComponent { @Input() public tableSettings!: TableSettings; - @Input() + @Input({ transform: booleanAttribute }) public cloneable?: boolean | null; @Input() diff --git a/frontend/src/app/features/content/shared/references/reference-dropdown.component.ts b/frontend/src/app/features/content/shared/references/reference-dropdown.component.ts index 0f08b42fd9..bb232abb0b 100644 --- a/frontend/src/app/features/content/shared/references/reference-dropdown.component.ts +++ b/frontend/src/app/features/content/shared/references/reference-dropdown.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, forwardRef, Input } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, forwardRef, Input } from '@angular/core'; import { NG_VALUE_ACCESSOR, UntypedFormControl } from '@angular/forms'; import { Observable } from 'rxjs'; import { ContentsDto } from '@app/shared'; @@ -56,7 +56,7 @@ export class ReferenceDropdownComponent extends StatefulControlComponent; - @Input() + @Input({ transform: booleanAttribute }) public canRemove?: boolean | null = true; - @Input() + @Input({ transform: booleanAttribute }) public isCompact?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public isDisabled?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public validations?: { [id: string]: boolean }; - @Input() + @Input({ transform: booleanAttribute }) public validityVisible?: boolean | null; - @Input() + @Input({ transform: numberAttribute }) public columns = 0; @Input('sqxReferenceItem') diff --git a/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts b/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts index 2880a54f49..068e5997ea 100644 --- a/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts +++ b/frontend/src/app/features/content/shared/references/references-checkboxes.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, forwardRef, Input } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, forwardRef, Input } from '@angular/core'; import { NG_VALUE_ACCESSOR, UntypedFormControl } from '@angular/forms'; import { AppsState, ContentDto, ContentsService, LanguageDto, LocalizerService, StatefulControlComponent, TypedSimpleChanges, UIOptions } from '@app/shared/internal'; import { ReferencesTagsConverter } from './references-tag-converter'; @@ -40,7 +40,7 @@ export class ReferencesCheckboxesComponent extends StatefulControlComponent; - @Input() + @Input({ transform: booleanAttribute }) public set disabled(value: boolean | undefined | null) { this.setDisabledState(value === true); } diff --git a/frontend/src/app/features/dashboard/pages/dashboard-config.component.ts b/frontend/src/app/features/dashboard/pages/dashboard-config.component.ts index ac2e29a984..b580c87a18 100644 --- a/frontend/src/app/features/dashboard/pages/dashboard-config.component.ts +++ b/frontend/src/app/features/dashboard/pages/dashboard-config.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, Component, EventEmitter, Input, Output } from '@angular/core'; import { GridsterItem } from 'angular-gridster2'; import { take } from 'rxjs/operators'; import { AppDto, AppsState, AuthService, DialogModel, DialogService, LocalizerService, ModalModel, TypedSimpleChanges, Types, UIState } from '@app/shared'; @@ -28,7 +28,7 @@ export class DashboardConfigComponent { @Input() public configAvailable!: GridsterItem[]; - @Input() + @Input({ transform: booleanAttribute }) public needsAttention?: boolean | null; @Output() diff --git a/frontend/src/app/features/rules/pages/events/rule-event.component.ts b/frontend/src/app/features/rules/pages/events/rule-event.component.ts index c93b045c70..1f9d72151a 100644 --- a/frontend/src/app/features/rules/pages/events/rule-event.component.ts +++ b/frontend/src/app/features/rules/pages/events/rule-event.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { RuleEventDto } from '@app/shared'; @Component({ @@ -18,7 +18,7 @@ export class RuleEventComponent { @Input('sqxRuleEvent') public event!: RuleEventDto; - @Input() + @Input({ transform: booleanAttribute }) public expanded = false; @Output() diff --git a/frontend/src/app/features/rules/pages/simulator/simulated-rule-event.component.ts b/frontend/src/app/features/rules/pages/simulator/simulated-rule-event.component.ts index 7f04d88673..3ebad2a036 100644 --- a/frontend/src/app/features/rules/pages/simulator/simulated-rule-event.component.ts +++ b/frontend/src/app/features/rules/pages/simulator/simulated-rule-event.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { SimulatedRuleEventDto } from '@app/shared'; const ERRORS_AFTER_EVENT = [ @@ -37,7 +37,7 @@ export class SimulatedRuleEventComponent { @Input('sqxSimulatedRuleEvent') public event!: SimulatedRuleEventDto; - @Input() + @Input({ transform: booleanAttribute }) public expanded = false; @Output() diff --git a/frontend/src/app/features/rules/shared/rule-element.component.ts b/frontend/src/app/features/rules/shared/rule-element.component.ts index 0ec7bde4a0..792979bf93 100644 --- a/frontend/src/app/features/rules/shared/rule-element.component.ts +++ b/frontend/src/app/features/rules/shared/rule-element.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { RuleElementMetadataDto } from '@app/shared'; @Component({ @@ -21,9 +21,9 @@ export class RuleElementComponent { @Input({ required: true }) public element!: RuleElementMetadataDto; - @Input() + @Input({ transform: booleanAttribute }) public isSmall?: boolean | null = true; - @Input() + @Input({ transform: booleanAttribute }) public disabled = false; } diff --git a/frontend/src/app/features/schemas/pages/schema/fields/field-group.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/field-group.component.ts index b318b78f2a..f507b5d5cc 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/field-group.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/field-group.component.ts @@ -6,7 +6,7 @@ */ import { CdkDragDrop } from '@angular/cdk/drag-drop'; -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, Component, EventEmitter, Input, Output } from '@angular/core'; import { AppSettingsDto, FieldDto, FieldGroup, LanguageDto, LocalStoreService, RootFieldDto, SchemaDto, Settings, StatefulComponent } from '@app/shared'; interface State { @@ -32,13 +32,13 @@ export class FieldGroupComponent extends StatefulComponent { @Input({ required: true }) public settings!: AppSettingsDto; - @Input() + @Input({ transform: booleanAttribute }) public sortable = false; @Input({ required: true }) public schema!: SchemaDto; - @Input() + @Input({ transform: booleanAttribute }) public fieldsEmpty = false; @Input({ required: true }) diff --git a/frontend/src/app/features/schemas/pages/schema/fields/field.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/field.component.ts index e070a107ee..cd8a5930ba 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/field.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/field.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input } from '@angular/core'; +import { booleanAttribute, Component, Input } from '@angular/core'; import { AppSettingsDto, createProperties, DialogModel, EditFieldForm, FieldDto, LanguageDto, ModalModel, NestedFieldDto, RootFieldDto, SchemaDto, SchemasState, TypedSimpleChanges } from '@app/shared'; @Component({ @@ -20,7 +20,7 @@ export class FieldComponent { @Input({ required: true }) public schema!: SchemaDto; - @Input() + @Input({ transform: booleanAttribute }) public plain = false; @Input() diff --git a/frontend/src/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.ts index 10be74c47b..89bf79bcca 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/forms/field-form-validation.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input } from '@angular/core'; +import { booleanAttribute, Component, Input } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { AppSettingsDto, FieldDto, LanguageDto, SchemaDto } from '@app/shared'; @@ -30,6 +30,6 @@ export class FieldFormValidationComponent { @Input({ required: true }) public languages!: ReadonlyArray; - @Input() + @Input({ transform: booleanAttribute }) public isLocalizable?: boolean | null; } diff --git a/frontend/src/app/features/schemas/pages/schema/fields/forms/field-form.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/forms/field-form.component.ts index d20d123ad3..6b4b831ea4 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/forms/field-form.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/forms/field-form.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { AfterViewInit, Component, EventEmitter, Input, Output } from '@angular/core'; +import { AfterViewInit, booleanAttribute, Component, EventEmitter, Input, Output } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { AppSettingsDto, FieldDto, LanguageDto, SchemaDto } from '@app/shared'; @@ -15,10 +15,10 @@ import { AppSettingsDto, FieldDto, LanguageDto, SchemaDto } from '@app/shared'; templateUrl: './field-form.component.html', }) export class FieldFormComponent implements AfterViewInit { - @Input() + @Input({ transform: booleanAttribute }) public showButtons?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public isEditable?: boolean | null; @Input({ required: true }) @@ -36,7 +36,7 @@ export class FieldFormComponent implements AfterViewInit { @Input({ required: true }) public languages!: ReadonlyArray; - @Input() + @Input({ transform: booleanAttribute }) public isLocalizable?: boolean | null; @Output() diff --git a/frontend/src/app/features/schemas/pages/schema/fields/sortable-field-list.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/sortable-field-list.component.ts index f8b980be6a..9d3b720454 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/sortable-field-list.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/sortable-field-list.component.ts @@ -6,7 +6,7 @@ */ import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop'; -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, Component, EventEmitter, Input, Output } from '@angular/core'; import { AppSettingsDto, FieldDto, FieldGroup, groupFields, LanguageDto, RootFieldDto, SchemaDto } from '@app/shared'; @Component({ @@ -30,10 +30,10 @@ export class SortableFieldListComponent { @Input() public schema!: SchemaDto; - @Input() + @Input({ transform: booleanAttribute }) public sortable = false; - @Input() + @Input({ transform: booleanAttribute }) public fieldsEmpty = false; @Input({ required: true }) diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/assets-validation.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/types/assets-validation.component.ts index 49ffbf8dd5..9c5f2c722d 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/types/assets-validation.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/assets-validation.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input } from '@angular/core'; +import { booleanAttribute, Component, Input } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { AssetsFieldPropertiesDto, FieldDto, LanguageDto } from '@app/shared'; @@ -27,6 +27,6 @@ export class AssetsValidationComponent { @Input({ required: true }) public languages!: ReadonlyArray; - @Input() + @Input({ transform: booleanAttribute }) public isLocalizable?: boolean | null; } diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/boolean-validation.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/types/boolean-validation.component.ts index b5b73b406c..9357b0c71b 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/types/boolean-validation.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/boolean-validation.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input } from '@angular/core'; +import { booleanAttribute, Component, Input } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { Observable } from 'rxjs'; import { BooleanFieldPropertiesDto, FieldDto, hasNoValue$, LanguageDto, TypedSimpleChanges } from '@app/shared'; @@ -28,7 +28,7 @@ export class BooleanValidationComponent { @Input({ required: true }) public languages!: ReadonlyArray; - @Input() + @Input({ transform: booleanAttribute }) public isLocalizable?: boolean | null; public showDefaultValue?: Observable; diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/date-time-validation.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/types/date-time-validation.component.ts index 735a8587d0..e5f8c0b2f8 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/types/date-time-validation.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/date-time-validation.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input } from '@angular/core'; +import { booleanAttribute, Component, Input } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { Observable } from 'rxjs'; import { DateTimeFieldPropertiesDto, FieldDto, hasNoValue$, LanguageDto, TypedSimpleChanges } from '@app/shared'; @@ -30,7 +30,7 @@ export class DateTimeValidationComponent { @Input({ required: true }) public languages!: ReadonlyArray; - @Input() + @Input({ transform: booleanAttribute }) public isLocalizable?: boolean | null; public showDefaultValues?: Observable; diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/number-validation.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/types/number-validation.component.ts index 7391b47b18..46424ebd2e 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/types/number-validation.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/number-validation.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input } from '@angular/core'; +import { booleanAttribute, Component, Input } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { FieldDto, LanguageDto, NumberFieldPropertiesDto, RootFieldDto, SchemaDto, Types } from '@app/shared'; @@ -30,7 +30,7 @@ export class NumberValidationComponent { @Input({ required: true }) public languages!: ReadonlyArray; - @Input() + @Input({ transform: booleanAttribute }) public isLocalizable?: boolean | null; public get showUnique() { diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/references-validation.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/types/references-validation.component.ts index 5943a1bb4b..dcbb635d09 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/types/references-validation.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/references-validation.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input } from '@angular/core'; +import { booleanAttribute, Component, Input } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { FieldDto, LanguageDto, ReferencesFieldPropertiesDto, SchemaTagSource } from '@app/shared'; @@ -27,7 +27,7 @@ export class ReferencesValidationComponent { @Input({ required: true }) public languages!: ReadonlyArray; - @Input() + @Input({ transform: booleanAttribute }) public isLocalizable?: boolean | null; constructor( diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/string-validation.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/types/string-validation.component.ts index 3f4266f84f..e0d7bbe89f 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/types/string-validation.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/string-validation.component.ts @@ -5,10 +5,10 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input } from '@angular/core'; +import { booleanAttribute, Component, Input } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { Observable } from 'rxjs'; -import { AppSettingsDto, FieldDto, hasNoValue$, hasValue$, LanguageDto, ModalModel, PatternDto, ResourceOwner, RootFieldDto, SchemaDto, STRING_CONTENT_TYPES, StringFieldPropertiesDto, Types, value$, TypedSimpleChanges } from '@app/shared'; +import { AppSettingsDto, FieldDto, hasNoValue$, hasValue$, LanguageDto, ModalModel, PatternDto, ResourceOwner, RootFieldDto, SchemaDto, STRING_CONTENT_TYPES, StringFieldPropertiesDto, TypedSimpleChanges, Types, value$ } from '@app/shared'; @Component({ selector: 'sqx-string-validation', @@ -36,7 +36,7 @@ export class StringValidationComponent extends ResourceOwner { @Input({ required: true }) public languages!: ReadonlyArray; - @Input() + @Input({ transform: booleanAttribute }) public isLocalizable?: boolean | null; public showPatternMessage?: Observable; diff --git a/frontend/src/app/features/schemas/pages/schema/fields/types/tags-validation.component.ts b/frontend/src/app/features/schemas/pages/schema/fields/types/tags-validation.component.ts index 2d439c6e37..5dccec6df9 100644 --- a/frontend/src/app/features/schemas/pages/schema/fields/types/tags-validation.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/fields/types/tags-validation.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, Input } from '@angular/core'; +import { booleanAttribute, Component, Input } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { FieldDto, LanguageDto, TagsFieldPropertiesDto } from '@app/shared'; @@ -27,6 +27,6 @@ export class TagsValidationComponent { @Input({ required: true }) public languages!: ReadonlyArray; - @Input() + @Input({ transform: booleanAttribute }) public isLocalizable?: boolean | null; } diff --git a/frontend/src/app/features/schemas/pages/schema/ui/field-list.component.ts b/frontend/src/app/features/schemas/pages/schema/ui/field-list.component.ts index 6fdde4f5b4..74db189b66 100644 --- a/frontend/src/app/features/schemas/pages/schema/ui/field-list.component.ts +++ b/frontend/src/app/features/schemas/pages/schema/ui/field-list.component.ts @@ -6,7 +6,7 @@ */ import { CdkDragDrop, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop'; -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { META_FIELDS, SchemaDto, TableField } from '@app/shared'; const META_FIELD_NAMES = Object.values(META_FIELDS).filter(x => x !== META_FIELDS.empty); @@ -27,7 +27,7 @@ export class FieldListComponent { @Input({ required: true }) public fieldNames!: ReadonlyArray; - @Input() + @Input({ transform: booleanAttribute }) public withMetaFields = false; @Output() diff --git a/frontend/src/app/features/settings/pages/workflows/workflow-step.component.ts b/frontend/src/app/features/settings/pages/workflows/workflow-step.component.ts index 58b51ae3bf..73f8dcf094 100644 --- a/frontend/src/app/features/settings/pages/workflows/workflow-step.component.ts +++ b/frontend/src/app/features/settings/pages/workflows/workflow-step.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, Component, EventEmitter, Input, Output } from '@angular/core'; import { TypedSimpleChanges, WorkflowDto, WorkflowStep, WorkflowStepValues, WorkflowTransition, WorkflowTransitionValues, WorkflowTransitionView } from '@app/shared'; @Component({ @@ -46,7 +46,7 @@ export class WorkflowStepComponent { @Input({ required: true }) public roles!: ReadonlyArray; - @Input() + @Input({ transform: booleanAttribute }) public disabled?: boolean | null; public openSteps!: ReadonlyArray; diff --git a/frontend/src/app/features/settings/pages/workflows/workflow-transition.component.ts b/frontend/src/app/features/settings/pages/workflows/workflow-transition.component.ts index 23a932d0e8..beaaa02b5d 100644 --- a/frontend/src/app/features/settings/pages/workflows/workflow-transition.component.ts +++ b/frontend/src/app/features/settings/pages/workflows/workflow-transition.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, Component, EventEmitter, Input, Output } from '@angular/core'; import { RoleDto, WorkflowTransitionValues, WorkflowTransitionView } from '@app/shared'; @Component({ @@ -28,7 +28,7 @@ export class WorkflowTransitionComponent { @Input({ required: true }) public roles!: ReadonlyArray; - @Input() + @Input({ transform: booleanAttribute }) public disabled?: boolean | null; public changeExpression(expression: string) { diff --git a/frontend/src/app/framework/angular/avatar.component.ts b/frontend/src/app/framework/angular/avatar.component.ts index 23004ec4fc..41233bdf1f 100644 --- a/frontend/src/app/framework/angular/avatar.component.ts +++ b/frontend/src/app/framework/angular/avatar.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, numberAttribute } from '@angular/core'; import { picasso, TypedSimpleChanges } from '@app/framework/internal'; @Component({ @@ -21,7 +21,7 @@ export class AvatarComponent { @Input() public image: string | undefined | null; - @Input() + @Input({ transform: numberAttribute }) public size = 50; public imageSource?: string | null; diff --git a/frontend/src/app/framework/angular/forms/confirm-click.directive.ts b/frontend/src/app/framework/angular/forms/confirm-click.directive.ts index dacc452adb..dc386c90fd 100644 --- a/frontend/src/app/framework/angular/forms/confirm-click.directive.ts +++ b/frontend/src/app/framework/angular/forms/confirm-click.directive.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Directive, EventEmitter, HostListener, Input, Output } from '@angular/core'; +import { booleanAttribute, Directive, EventEmitter, HostListener, Input, Output } from '@angular/core'; import { Subscriber, take } from 'rxjs'; import { DialogService, Types } from '@app/framework/internal'; @@ -22,7 +22,7 @@ export class ConfirmClickDirective { @Input() public confirmRememberKey = ''; - @Input() + @Input({ transform: booleanAttribute }) public confirmRequired?: boolean | null = true; @Output() diff --git a/frontend/src/app/framework/angular/forms/editable-title.component.ts b/frontend/src/app/framework/angular/forms/editable-title.component.ts index 069c092c1e..bf06e5557d 100644 --- a/frontend/src/app/framework/angular/forms/editable-title.component.ts +++ b/frontend/src/app/framework/angular/forms/editable-title.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, Component, EventEmitter, Input, numberAttribute, Output } from '@angular/core'; import { FormControl, ValidatorFn, Validators } from '@angular/forms'; import { Keys } from '@app/framework/internal'; @@ -21,16 +21,16 @@ export class EditableTitleComponent { @Input({ required: true }) public inputTitle!: string; - @Input() + @Input({ transform: numberAttribute }) public inputTitleLength = 20; - @Input() + @Input({ transform: booleanAttribute }) public inputTitleRequired = true; - @Input() + @Input({ transform: booleanAttribute }) public disabled?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public closeButton = true; @Input() diff --git a/frontend/src/app/framework/angular/forms/editors/autocomplete.component.ts b/frontend/src/app/framework/angular/forms/editors/autocomplete.component.ts index 6287c58412..aa607fb2ec 100644 --- a/frontend/src/app/framework/angular/forms/editors/autocomplete.component.ts +++ b/frontend/src/app/framework/angular/forms/editors/autocomplete.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, ContentChild, ElementRef, forwardRef, Input, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, ContentChild, ElementRef, forwardRef, Input, numberAttribute, OnDestroy, OnInit, TemplateRef, ViewChild } from '@angular/core'; import { NG_VALUE_ACCESSOR, UntypedFormControl } from '@angular/forms'; import { merge, Observable, of, Subject } from 'rxjs'; import { catchError, debounceTime, finalize, map, switchMap, tap } from 'rxjs/operators'; @@ -54,7 +54,7 @@ export class AutocompleteComponent extends StatefulControlComponent imple @ViewChild('editor', { static: false }) public editor!: ElementRef; - @Input() + @Input({ transform: booleanAttribute }) public borderless?: boolean | null; @Input() @@ -49,22 +49,22 @@ export class CodeEditorComponent extends StatefulControlComponent<{}, any> imple @Input() public valueMode: 'String' | 'Json' | 'JsonString' = 'String'; - @Input() + @Input({ transform: numberAttribute }) public maxLines: number | undefined; - @Input() + @Input({ transform: booleanAttribute }) public singleLine = false; - @Input() + @Input({ transform: booleanAttribute }) public snippets = true; - @Input() + @Input({ transform: booleanAttribute }) public wordWrap = false; - @Input() + @Input({ transform: numberAttribute }) public height: number | 'auto' | 'full' = 'full'; - @Input() + @Input({ transform: booleanAttribute }) public set disabled(value: boolean | undefined | null) { this.setDisabledState(value === true); } diff --git a/frontend/src/app/framework/angular/forms/editors/color-picker.component.ts b/frontend/src/app/framework/angular/forms/editors/color-picker.component.ts index 7c1d0684ef..7df8701036 100644 --- a/frontend/src/app/framework/angular/forms/editors/color-picker.component.ts +++ b/frontend/src/app/framework/angular/forms/editors/color-picker.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, forwardRef, Input } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, forwardRef, Input } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { MathHelper, ModalModel, StatefulControlComponent } from '@app/framework/internal'; import { FocusComponent } from './../forms-helper'; @@ -40,7 +40,7 @@ export class ColorPickerComponent extends StatefulControlComponent | undefined | null = []; - @Input() + @Input({ transform: booleanAttribute }) public itemSeparator?: boolean | null; @Input() @@ -64,19 +64,19 @@ export class DropdownComponent extends StatefulControlComponent @Input() public layout: 'Auto' | 'Singleline' | 'Multiline' = 'Auto'; - @Input() + @Input({ transform: booleanAttribute }) public unsorted = true; - @Input() + @Input({ transform: booleanAttribute }) public set disabled(value: boolean | undefined | null) { this.setDisabledState(value === true); } diff --git a/frontend/src/app/framework/angular/forms/editors/stars.component.ts b/frontend/src/app/framework/angular/forms/editors/stars.component.ts index f007d1c088..115a2667d5 100644 --- a/frontend/src/app/framework/angular/forms/editors/stars.component.ts +++ b/frontend/src/app/framework/angular/forms/editors/stars.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, forwardRef, Input } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, forwardRef, Input, numberAttribute } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { StatefulControlComponent, Types } from '@app/framework/internal'; @@ -36,12 +36,12 @@ interface State { export class StarsComponent extends StatefulControlComponent { private maximumStarsValue = 5; - @Input() + @Input({ transform: booleanAttribute }) public set disabled(value: boolean | undefined | null) { this.setDisabledState(value === true); } - @Input() + @Input({ transform: numberAttribute }) public set maximumStars(value: number) { const maxStars: number = Types.isNumber(value) ? value : 5; diff --git a/frontend/src/app/framework/angular/forms/editors/tag-editor.component.ts b/frontend/src/app/framework/angular/forms/editors/tag-editor.component.ts index 973f2b1a9e..eea436f6fd 100644 --- a/frontend/src/app/framework/angular/forms/editors/tag-editor.component.ts +++ b/frontend/src/app/framework/angular/forms/editors/tag-editor.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, forwardRef, Input, OnInit, Output, ViewChild } from '@angular/core'; +import { AfterViewInit, booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, forwardRef, Input, OnInit, Output, ViewChild } from '@angular/core'; import { NG_VALUE_ACCESSOR, UntypedFormControl } from '@angular/forms'; import { distinctUntilChanged, map, tap } from 'rxjs/operators'; import { getTagValues, Keys, ModalModel, StatefulControlComponent, StringConverter, TagValue, TextMeasurer, TypedSimpleChanges, Types } from '@app/framework/internal'; @@ -60,28 +60,28 @@ export class TagEditorComponent extends StatefulControlComponent { - @Input() + @Input({ transform: booleanAttribute }) public threeStates?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public set disabled(value: boolean | undefined | null) { this.setDisabledState(value === true); } diff --git a/frontend/src/app/framework/angular/forms/focus-on-init.directive.ts b/frontend/src/app/framework/angular/forms/focus-on-init.directive.ts index 6a98460855..a04b0b1a7e 100644 --- a/frontend/src/app/framework/angular/forms/focus-on-init.directive.ts +++ b/frontend/src/app/framework/angular/forms/focus-on-init.directive.ts @@ -5,14 +5,14 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { AfterViewInit, Directive, ElementRef, Input } from '@angular/core'; +import { AfterViewInit, booleanAttribute, Directive, ElementRef, Input } from '@angular/core'; import { Types } from '@app/framework/internal'; @Directive({ selector: '[sqxFocusOnInit]', }) export class FocusOnInitDirective implements AfterViewInit { - @Input() + @Input({ transform: booleanAttribute }) public select = false; @Input('sqxFocusOnInit') diff --git a/frontend/src/app/framework/angular/forms/form-alert.component.ts b/frontend/src/app/framework/angular/forms/form-alert.component.ts index e430599a7e..aedcc28c70 100644 --- a/frontend/src/app/framework/angular/forms/form-alert.component.ts +++ b/frontend/src/app/framework/angular/forms/form-alert.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, Input, numberAttribute } from '@angular/core'; @Component({ selector: 'sqx-form-alert', @@ -17,15 +17,15 @@ export class FormAlertComponent { @Input() public class = ''; - @Input() + @Input({ transform: numberAttribute }) public marginTop: number | string | undefined | null = 2; - @Input() + @Input({ transform: numberAttribute }) public marginBottom: number | string | undefined | null = 4; - @Input() + @Input({ transform: booleanAttribute }) public light?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public large?: boolean | null; } diff --git a/frontend/src/app/framework/angular/forms/form-error.component.ts b/frontend/src/app/framework/angular/forms/form-error.component.ts index 092af69de3..3f53b62463 100644 --- a/frontend/src/app/framework/angular/forms/form-error.component.ts +++ b/frontend/src/app/framework/angular/forms/form-error.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { ErrorDto, TypedSimpleChanges } from '@app/framework/internal'; @Component({ @@ -18,10 +18,10 @@ export class FormErrorComponent { @Input({ required: true }) public error?: ErrorDto | null; - @Input() + @Input({ transform: booleanAttribute }) public bubble?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public closeable?: boolean | null; public show = false; diff --git a/frontend/src/app/framework/angular/forms/form-hint.component.ts b/frontend/src/app/framework/angular/forms/form-hint.component.ts index 070a680ccf..a732eb1a8c 100644 --- a/frontend/src/app/framework/angular/forms/form-hint.component.ts +++ b/frontend/src/app/framework/angular/forms/form-hint.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, numberAttribute } from '@angular/core'; @Component({ selector: 'sqx-form-hint', @@ -17,9 +17,9 @@ export class FormHintComponent { @Input() public class = ''; - @Input() + @Input({ transform: numberAttribute }) public marginTop: number | string = 0; - @Input() + @Input({ transform: numberAttribute }) public marginBottom: number | string = 0; } diff --git a/frontend/src/app/framework/angular/forms/indeterminate-value.directive.ts b/frontend/src/app/framework/angular/forms/indeterminate-value.directive.ts index 39b9104549..340be373d9 100644 --- a/frontend/src/app/framework/angular/forms/indeterminate-value.directive.ts +++ b/frontend/src/app/framework/angular/forms/indeterminate-value.directive.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Directive, ElementRef, forwardRef, HostListener, Input, Renderer2 } from '@angular/core'; +import { booleanAttribute, Directive, ElementRef, forwardRef, HostListener, Input, Renderer2 } from '@angular/core'; import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms'; import { Types } from '@app/framework/internal'; @@ -24,7 +24,7 @@ export class IndeterminateValueDirective implements ControlValueAccessor { private callTouched = () => { /* NOOP */ }; private isChecked?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public threeStates = true; constructor( diff --git a/frontend/src/app/framework/angular/forms/progress-bar.component.ts b/frontend/src/app/framework/angular/forms/progress-bar.component.ts index b77c700309..019ba1955e 100644 --- a/frontend/src/app/framework/angular/forms/progress-bar.component.ts +++ b/frontend/src/app/framework/angular/forms/progress-bar.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, OnInit, Renderer2 } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, numberAttribute, OnInit, Renderer2 } from '@angular/core'; import * as ProgressBar from 'progressbar.js'; import { TypedSimpleChanges } from '@app/framework/internal'; @@ -31,19 +31,19 @@ export class ProgressBarComponent implements OnInit { @Input() public trailColor = '#f4f4f4'; - @Input() + @Input({ transform: numberAttribute }) public trailWidth = 4; - @Input() + @Input({ transform: numberAttribute }) public strokeWidth = 4; - @Input() + @Input({ transform: booleanAttribute }) public showText?: boolean | null = true; - @Input() + @Input({ transform: booleanAttribute }) public animated?: boolean | null = true; - @Input() + @Input({ transform: numberAttribute }) public value = 0; constructor(changeDetector: ChangeDetectorRef, diff --git a/frontend/src/app/framework/angular/image-source.directive.ts b/frontend/src/app/framework/angular/image-source.directive.ts index 3d4c9e57c7..2f435bc85c 100644 --- a/frontend/src/app/framework/angular/image-source.directive.ts +++ b/frontend/src/app/framework/angular/image-source.directive.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { AfterViewInit, Directive, ElementRef, Input, NgZone, OnDestroy, OnInit, Renderer2 } from '@angular/core'; +import { AfterViewInit, Directive, ElementRef, Input, NgZone, numberAttribute, OnDestroy, OnInit, Renderer2 } from '@angular/core'; import { MathHelper, ResourceOwner, StringHelper } from '@app/framework/internal'; const LAYOUT_CACHE: { [key: string]: { width: number; height: number } } = {}; @@ -22,7 +22,7 @@ export class ImageSourceDirective extends ResourceOwner implements OnDestroy, O @Input('sqxImageSource') public imageSource!: string; - @Input() + @Input({ transform: numberAttribute }) public retryCount = 0; @Input() diff --git a/frontend/src/app/framework/angular/language-selector.component.ts b/frontend/src/app/framework/angular/language-selector.component.ts index 77f27303de..8fc89db0c4 100644 --- a/frontend/src/app/framework/angular/language-selector.component.ts +++ b/frontend/src/app/framework/angular/language-selector.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, numberAttribute, OnInit, Output } from '@angular/core'; import { FloatingPlacement, ModalModel } from '@app/framework/internal'; export interface Language { iso2Code: string; englishName: string; isMasterLanguage?: boolean } @@ -26,10 +26,10 @@ export class LanguageSelectorComponent implements OnInit { @Input({ required: true }) public languages: ReadonlyArray = []; - @Input() + @Input({ transform: booleanAttribute }) public exists?: { [language: string]: boolean } | null; - @Input() + @Input({ transform: numberAttribute }) public percents?: { [language: string]: number } | null; @Input() diff --git a/frontend/src/app/framework/angular/layout.component.ts b/frontend/src/app/framework/angular/layout.component.ts index 4346e084b6..cfea53d474 100644 --- a/frontend/src/app/framework/angular/layout.component.ts +++ b/frontend/src/app/framework/angular/layout.component.ts @@ -7,7 +7,7 @@ /* eslint-disable import/no-cycle */ -import { AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, OnDestroy, OnInit, Optional, Renderer2, ViewChild } from '@angular/core'; +import { AfterViewInit, booleanAttribute, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Input, numberAttribute, OnDestroy, OnInit, Optional, Renderer2, ViewChild } from '@angular/core'; import { ActivatedRoute, NavigationEnd, QueryParamsHandling, Router } from '@angular/router'; import { concat, defer, filter, map, of } from 'rxjs'; import { LayoutContainerDirective } from './layout-container.directive'; @@ -44,25 +44,25 @@ export class LayoutComponent implements OnInit, OnDestroy, AfterViewInit { @Input() public innerWidth = -1; - @Input() + @Input({ transform: numberAttribute }) public innerWidthPadding = 3; - @Input() + @Input({ transform: booleanAttribute }) public white = false; - @Input() + @Input({ transform: booleanAttribute }) public overflow = false; - @Input() + @Input({ transform: booleanAttribute }) public hideHeader = false; - @Input() + @Input({ transform: booleanAttribute }) public hideSidebar = false; - @Input() + @Input({ transform: booleanAttribute }) public padding = false; - @Input() + @Input({ transform: booleanAttribute }) public customHeader = false; @ViewChild('panel', { static: false }) diff --git a/frontend/src/app/framework/angular/list-view.component.ts b/frontend/src/app/framework/angular/list-view.component.ts index 9ba30a6957..bd566e8cbe 100644 --- a/frontend/src/app/framework/angular/list-view.component.ts +++ b/frontend/src/app/framework/angular/list-view.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, HostBinding, Input, Renderer2, ViewChild } from '@angular/core'; +import { AfterViewInit, booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, HostBinding, Input, Renderer2, ViewChild } from '@angular/core'; import { StatefulComponent } from '@app/framework/internal'; interface State { @@ -31,25 +31,25 @@ export class ListViewComponent extends StatefulComponent implements After @ViewChild('contentElement', { static: false }) public contentElement!: ElementRef; - @Input() @HostBinding('class.overflow') + @Input({ transform: booleanAttribute }) @HostBinding('class.overflow') public overflow?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public syncedHeader?: boolean | null; @Input() public innerWidth = '100%'; - @Input() + @Input({ transform: booleanAttribute }) public table?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public tableNoPadding?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public isLoaded: boolean | undefined | null = true; - @Input() + @Input({ transform: booleanAttribute }) public set isLoading(value: boolean | undefined | null) { clearTimeout(this.timer); diff --git a/frontend/src/app/framework/angular/loader.component.ts b/frontend/src/app/framework/angular/loader.component.ts index d36e173a21..946d2a2c6b 100644 --- a/frontend/src/app/framework/angular/loader.component.ts +++ b/frontend/src/app/framework/angular/loader.component.ts @@ -7,7 +7,7 @@ /* eslint-disable import/no-cycle */ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { ChangeDetectionStrategy, Component, Input, numberAttribute } from '@angular/core'; @Component({ selector: 'sqx-loader', @@ -16,9 +16,9 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class LoaderComponent { - @Input() + @Input({ transform: numberAttribute }) public size = 18; @Input() public color: 'input' | 'theme' | 'white' | 'text' = 'text'; -} \ No newline at end of file +} diff --git a/frontend/src/app/framework/angular/markdown.directive.ts b/frontend/src/app/framework/angular/markdown.directive.ts index 4f0a3305f0..54ab21a306 100644 --- a/frontend/src/app/framework/angular/markdown.directive.ts +++ b/frontend/src/app/framework/angular/markdown.directive.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Directive, ElementRef, Input, Renderer2 } from '@angular/core'; +import { booleanAttribute, Directive, ElementRef, Input, Renderer2 } from '@angular/core'; import { renderMarkdown } from '@app/framework/internal'; @Directive({ @@ -15,10 +15,10 @@ export class MarkdownDirective { @Input('sqxMarkdown') public markdown!: string; - @Input() + @Input({ transform: booleanAttribute }) public inline = true; - @Input() + @Input({ transform: booleanAttribute }) public optional = false; constructor( diff --git a/frontend/src/app/framework/angular/modals/modal-dialog.component.ts b/frontend/src/app/framework/angular/modals/modal-dialog.component.ts index 3ec54decd3..d233ac3eb0 100644 --- a/frontend/src/app/framework/angular/modals/modal-dialog.component.ts +++ b/frontend/src/app/framework/angular/modals/modal-dialog.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, Renderer2, ViewChild } from '@angular/core'; +import { AfterViewInit, booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, EventEmitter, Input, Output, Renderer2, ViewChild } from '@angular/core'; import { fadeAnimation } from '@app/framework/internal'; @Component({ @@ -21,25 +21,25 @@ export class ModalDialogComponent implements AfterViewInit { @Output() public close = new EventEmitter(); - @Input() + @Input({ transform: booleanAttribute }) public showClose?: boolean | null = true; - @Input() + @Input({ transform: booleanAttribute }) public showHeader?: boolean | null = true; - @Input() + @Input({ transform: booleanAttribute }) public showFooter?: boolean | null = true; - @Input() + @Input({ transform: booleanAttribute }) public hasTabs?: boolean | null = false; @Input() public size: 'sm' | 'md' | 'lg' | 'xl' = 'md'; - @Input() + @Input({ transform: booleanAttribute }) public flexBody?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public fullHeight?: boolean | null; @Input() diff --git a/frontend/src/app/framework/angular/modals/modal-placement.directive.ts b/frontend/src/app/framework/angular/modals/modal-placement.directive.ts index 38057380fe..e56df91e85 100644 --- a/frontend/src/app/framework/angular/modals/modal-placement.directive.ts +++ b/frontend/src/app/framework/angular/modals/modal-placement.directive.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { AfterViewInit, Directive, ElementRef, Input, OnDestroy, Renderer2 } from '@angular/core'; +import { AfterViewInit, booleanAttribute, Directive, ElementRef, Input, numberAttribute, OnDestroy, Renderer2 } from '@angular/core'; import { autoUpdate, computePosition, flip, Middleware, offset, shift, size } from '@floating-ui/dom'; import { FloatingPlacement, TypedSimpleChanges, Types } from '@app/framework/internal'; @@ -19,31 +19,31 @@ export class ModalPlacementDirective implements AfterViewInit, OnDestroy { @Input('sqxAnchoredTo') public target?: Element; - @Input() + @Input({ transform: booleanAttribute }) public scrollX = false; - @Input() + @Input({ transform: booleanAttribute }) public scrollY = false; - @Input() + @Input({ transform: numberAttribute }) public scrollMargin = 10; - @Input() + @Input({ transform: numberAttribute }) public offset = 2; - @Input() + @Input({ transform: numberAttribute }) public spaceX = 0; - @Input() + @Input({ transform: numberAttribute }) public spaceY = 0; @Input() public position: FloatingPlacement = 'bottom-end'; - @Input() + @Input({ transform: booleanAttribute }) public adjustWidth = false; - @Input() + @Input({ transform: booleanAttribute }) public adjustHeight = false; constructor( @@ -233,4 +233,4 @@ export class ModalPlacementDirective implements AfterViewInit, OnDestroy { this.renderer.setStyle(modalRef, 'top', `${computedSize.y}px`); this.renderer.setStyle(modalRef, 'visibility', 'visible'); } -} \ No newline at end of file +} diff --git a/frontend/src/app/framework/angular/modals/tooltip.directive.ts b/frontend/src/app/framework/angular/modals/tooltip.directive.ts index 08ba4b1db3..d5e26ac637 100644 --- a/frontend/src/app/framework/angular/modals/tooltip.directive.ts +++ b/frontend/src/app/framework/angular/modals/tooltip.directive.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Directive, ElementRef, HostListener, Input, OnDestroy, Renderer2 } from '@angular/core'; +import { Directive, ElementRef, HostListener, Input, numberAttribute, OnDestroy, Renderer2 } from '@angular/core'; import { DialogService, FloatingPlacement, Tooltip } from '@app/framework/internal'; @Directive({ @@ -22,13 +22,13 @@ export class TooltipDirective implements OnDestroy { @Input() public shortcut?: string | undefined; - @Input() + @Input({ transform: numberAttribute }) public shortcutDelay = 2000; @Input() public titlePosition: FloatingPlacement = 'top-end'; - @Input() + @Input({ transform: numberAttribute }) public titleDelay = 1000; @Input() diff --git a/frontend/src/app/framework/angular/pager.component.ts b/frontend/src/app/framework/angular/pager.component.ts index 45ef73f936..fdc9e36313 100644 --- a/frontend/src/app/framework/angular/pager.component.ts +++ b/frontend/src/app/framework/angular/pager.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { PagingInfo } from './../state'; export const PAGE_SIZES: ReadonlyArray = [10, 20, 30, 50]; @@ -26,7 +26,7 @@ export class PagerComponent { @Input({ required: true }) public paging: PagingInfo | undefined | null; - @Input() + @Input({ transform: booleanAttribute }) public autoHide?: boolean | null; public totalPages = 0; diff --git a/frontend/src/app/framework/angular/routers/parent-link.directive.ts b/frontend/src/app/framework/angular/routers/parent-link.directive.ts index a871661aad..8e674e11f4 100644 --- a/frontend/src/app/framework/angular/routers/parent-link.directive.ts +++ b/frontend/src/app/framework/angular/routers/parent-link.directive.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Directive, ElementRef, HostListener, Input, OnInit, Renderer2 } from '@angular/core'; +import { booleanAttribute, Directive, ElementRef, HostListener, Input, OnInit, Renderer2 } from '@angular/core'; import { ActivatedRoute, NavigationEnd, QueryParamsHandling, Router } from '@angular/router'; import { ResourceOwner } from '@app/framework/internal'; @@ -15,7 +15,7 @@ import { ResourceOwner } from '@app/framework/internal'; export class ParentLinkDirective extends ResourceOwner implements OnInit { private url?: string; - @Input() + @Input({ transform: booleanAttribute }) public isLazyLoaded?: boolean | null; @Input() diff --git a/frontend/src/app/framework/angular/shortcut.component.ts b/frontend/src/app/framework/angular/shortcut.component.ts index 91d47fd9f4..afcc8203eb 100644 --- a/frontend/src/app/framework/angular/shortcut.component.ts +++ b/frontend/src/app/framework/angular/shortcut.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectorRef, Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core'; import { ShortcutService } from '@app/framework/internal'; @Component({ @@ -21,7 +21,7 @@ export class ShortcutComponent implements OnDestroy, OnInit { @Input() public keys = ''; - @Input() + @Input({ transform: booleanAttribute }) public disabled?: boolean | null; constructor(changeDetector: ChangeDetectorRef, diff --git a/frontend/src/app/framework/angular/template-wrapper.directive.ts b/frontend/src/app/framework/angular/template-wrapper.directive.ts index ed184db121..0a4ee4c43c 100644 --- a/frontend/src/app/framework/angular/template-wrapper.directive.ts +++ b/frontend/src/app/framework/angular/template-wrapper.directive.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Directive, EmbeddedViewRef, Input, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core'; +import { Directive, EmbeddedViewRef, Input, numberAttribute, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core'; import { TypedSimpleChanges } from '@app/framework/internal'; @Directive({ @@ -15,7 +15,7 @@ export class TemplateWrapperDirective implements OnDestroy, OnInit { @Input() public item: any; - @Input() + @Input({ transform: numberAttribute }) public index = 0; @Input() diff --git a/frontend/src/app/shared/components/assets/asset-folder-dropdown-item.component.ts b/frontend/src/app/shared/components/assets/asset-folder-dropdown-item.component.ts index 2491cb5c64..c3fbd4304e 100644 --- a/frontend/src/app/shared/components/assets/asset-folder-dropdown-item.component.ts +++ b/frontend/src/app/shared/components/assets/asset-folder-dropdown-item.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core'; +import { ChangeDetectorRef, Component, EventEmitter, Input, numberAttribute, Output } from '@angular/core'; import { AssetsService } from '@app/shared/internal'; import { AssetFolderDropdowNode } from './asset-folder-dropdown.state'; @@ -21,7 +21,7 @@ export class AssetFolderDropdownItemComponent { @Input({ required: true }) public nodeModel!: AssetFolderDropdowNode; - @Input() + @Input({ transform: numberAttribute }) public nodeLevel = 0; @Output() diff --git a/frontend/src/app/shared/components/assets/asset-folder-dropdown.component.ts b/frontend/src/app/shared/components/assets/asset-folder-dropdown.component.ts index c706c65636..798206f4e6 100644 --- a/frontend/src/app/shared/components/assets/asset-folder-dropdown.component.ts +++ b/frontend/src/app/shared/components/assets/asset-folder-dropdown.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, forwardRef, Input } from '@angular/core'; +import { booleanAttribute, Component, forwardRef, Input } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { ModalModel, StatefulControlComponent, Types } from '@app/framework'; import { AppsState, AssetsService, ROOT_ITEM } from '@app/shared/internal'; @@ -24,7 +24,7 @@ export const SQX_ASSETS_FOLDER_DROPDOWN_CONTROL_VALUE_ACCESSOR: any = { ], }) export class AssetFolderDropdownComponent extends StatefulControlComponent { - @Input() + @Input({ transform: booleanAttribute }) public set disabled(value: boolean | undefined | null) { this.setDisabledState(value === true); } diff --git a/frontend/src/app/shared/components/assets/asset-folder.component.ts b/frontend/src/app/shared/components/assets/asset-folder.component.ts index 6ed1625fec..1199ee39d4 100644 --- a/frontend/src/app/shared/components/assets/asset-folder.component.ts +++ b/frontend/src/app/shared/components/assets/asset-folder.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { AssetFolderDto, AssetPathItem, DialogModel, ModalModel, Types } from '@app/shared/internal'; @Component({ @@ -21,7 +21,7 @@ export class AssetFolderComponent { @Output() public delete = new EventEmitter(); - @Input() + @Input({ transform: booleanAttribute }) public isDisabled?: boolean | null; @Input({ required: true }) diff --git a/frontend/src/app/shared/components/assets/asset-path.component.ts b/frontend/src/app/shared/components/assets/asset-path.component.ts index c11282a248..1a064d3639 100644 --- a/frontend/src/app/shared/components/assets/asset-path.component.ts +++ b/frontend/src/app/shared/components/assets/asset-path.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { AssetPathItem } from '@app/shared/internal'; @Component({ @@ -21,6 +21,6 @@ export class AssetPathComponent { @Input() public path?: ReadonlyArray | null; - @Input() + @Input({ transform: booleanAttribute }) public all?: boolean | null; } diff --git a/frontend/src/app/shared/components/assets/asset.component.ts b/frontend/src/app/shared/components/assets/asset.component.ts index 594318a146..76134eb2ea 100644 --- a/frontend/src/app/shared/components/assets/asset.component.ts +++ b/frontend/src/app/shared/components/assets/asset.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input, OnInit, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input, OnInit, Output } from '@angular/core'; import { AssetDto, AssetUploaderState, DialogService, StatefulComponent, Types, UploadCanceled } from '@app/shared/internal'; interface State { @@ -50,32 +50,32 @@ export class AssetComponent extends StatefulComponent implements OnInit { @Input() public folderId?: string; - @Input() + @Input({ transform: booleanAttribute }) public folderIcon?: boolean | null | undefined; - @Input() + @Input({ transform: booleanAttribute }) public removeMode?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public isDisabled?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public isSelected?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public isCompact: boolean | undefined | null; - @Input() + @Input({ transform: booleanAttribute }) public isSelectable?: boolean | null; - @Input() @HostBinding('class.isListView') + @Input({ transform: booleanAttribute }) @HostBinding('class.isListView') public isListView?: boolean | null; constructor( private readonly assetUploader: AssetUploaderState, private readonly dialogs: DialogService, ) { - super({ progress: 0,}); + super({ progress: 0 }); } public ngOnInit() { diff --git a/frontend/src/app/shared/components/assets/assets-list.component.ts b/frontend/src/app/shared/components/assets/assets-list.component.ts index d831db780d..ed71b4eb2f 100644 --- a/frontend/src/app/shared/components/assets/assets-list.component.ts +++ b/frontend/src/app/shared/components/assets/assets-list.component.ts @@ -6,7 +6,7 @@ */ import { CdkDrag, CdkDragDrop, CdkDropList } from '@angular/cdk/drag-drop'; -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { AssetDto, AssetFolderDto, AssetsState, getFiles, StatefulComponent, Types } from '@app/shared/internal'; interface State { @@ -30,20 +30,20 @@ export class AssetsListComponent extends StatefulComponent { @Input({ required: true }) public assetsState!: AssetsState; - @Input() + @Input({ transform: booleanAttribute }) public isDisabled?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public isListView?: boolean | null; @Input() public selectedIds?: Record; - @Input() + @Input({ transform: booleanAttribute }) public showFolderIcon?: boolean | null = true; constructor() { - super({ newFiles: [], }); + super({ newFiles: [] }); } public add(file: File, asset: AssetDto) { diff --git a/frontend/src/app/shared/components/cards/api-performance-card.component.ts b/frontend/src/app/shared/components/cards/api-performance-card.component.ts index fe6a2f9846..df1e990365 100644 --- a/frontend/src/app/shared/components/cards/api-performance-card.component.ts +++ b/frontend/src/app/shared/components/cards/api-performance-card.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { CallsUsageDto, ChartHelpers, ChartOptions } from '@app/shared/internal'; @Component({ @@ -18,7 +18,7 @@ export class ApiPerformanceCardComponent { @Input({ required: true }) public usage?: CallsUsageDto; - @Input() + @Input({ transform: booleanAttribute }) public isStacked?: boolean | null; @Output() diff --git a/frontend/src/app/shared/components/cards/api-traffic-card.component.ts b/frontend/src/app/shared/components/cards/api-traffic-card.component.ts index a5b76e6793..f09a108b96 100644 --- a/frontend/src/app/shared/components/cards/api-traffic-card.component.ts +++ b/frontend/src/app/shared/components/cards/api-traffic-card.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { CallsUsageDto, ChartHelpers, ChartOptions, TypedSimpleChanges } from '@app/shared/internal'; @Component({ @@ -18,7 +18,7 @@ export class ApiTrafficCardComponent { @Input({ required: true }) public usage?: CallsUsageDto; - @Input() + @Input({ transform: booleanAttribute }) public isStacked?: boolean | null; @Output() diff --git a/frontend/src/app/shared/components/comments/comment.component.ts b/frontend/src/app/shared/components/comments/comment.component.ts index f2b64e693b..efd27c0901 100644 --- a/frontend/src/app/shared/components/comments/comment.component.ts +++ b/frontend/src/app/shared/components/comments/comment.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { MentionConfig } from 'angular-mentions'; import { CommentDto, CommentsState, ContributorDto, DialogService, Keys, StatefulComponent } from '@app/shared/internal'; @@ -20,19 +20,19 @@ interface State { changeDetection: ChangeDetectionStrategy.OnPush, }) export class CommentComponent extends StatefulComponent { - @Input() + @Input({ transform: booleanAttribute }) public canFollow?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public canDelete?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public canEdit?: boolean | null; @Input({ required: true }) public commentsState!: CommentsState; - @Input() + @Input({ transform: booleanAttribute }) public confirmDelete?: boolean | null = true; @Input({ required: true }) diff --git a/frontend/src/app/shared/components/contents/content-list-cell.directive.ts b/frontend/src/app/shared/components/contents/content-list-cell.directive.ts index b3f789835b..d170e3548a 100644 --- a/frontend/src/app/shared/components/contents/content-list-cell.directive.ts +++ b/frontend/src/app/shared/components/contents/content-list-cell.directive.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Directive, ElementRef, Input, OnDestroy, OnInit, Pipe, PipeTransform, Renderer2 } from '@angular/core'; +import { Directive, ElementRef, Input, numberAttribute, OnDestroy, OnInit, Pipe, PipeTransform, Renderer2 } from '@angular/core'; import { ResourceOwner } from '@app/framework'; import { ContentDto, FieldSizes, META_FIELDS, TableField, TableSettings } from '@app/shared/internal'; @@ -187,7 +187,7 @@ export class ContentListCellResizeDirective implements OnInit, OnDestroy { @Input('fields') public tableFields?: TableSettings; - @Input() + @Input({ transform: numberAttribute }) public minimumWidth = 50; constructor( @@ -280,4 +280,4 @@ export class ContentListCellResizeDirective implements OnInit, OnDestroy { this.windowBlur?.(); this.windowBlur = undefined; } -} \ No newline at end of file +} diff --git a/frontend/src/app/shared/components/contents/content-list-field.component.ts b/frontend/src/app/shared/components/contents/content-list-field.component.ts index ea08a1217b..44bda3091d 100644 --- a/frontend/src/app/shared/components/contents/content-list-field.component.ts +++ b/frontend/src/app/shared/components/contents/content-list-field.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { UntypedFormGroup } from '@angular/forms'; import { ContentDto, FieldValue, getContentValue, LanguageDto, META_FIELDS, SchemaDto, StatefulComponent, TableField, TableSettings } from '@app/shared/internal'; @@ -32,7 +32,7 @@ export class ContentListFieldComponent extends StatefulComponent { @Input({ required: true }) public content!: ContentDto; - @Input() + @Input({ transform: booleanAttribute }) public patchAllowed?: boolean | null; @Input() diff --git a/frontend/src/app/shared/components/contents/content-status.component.ts b/frontend/src/app/shared/components/contents/content-status.component.ts index 9a20e02248..8b36b3f5fa 100644 --- a/frontend/src/app/shared/components/contents/content-status.component.ts +++ b/frontend/src/app/shared/components/contents/content-status.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, Input } from '@angular/core'; import { LocalizerService, TypedSimpleChanges } from '@app/framework'; import { ScheduleDto } from '@app/shared/internal'; @@ -28,10 +28,10 @@ export class ContentStatusComponent { @Input() public layout: 'icon' | 'text' | 'multiline' = 'icon'; - @Input() + @Input({ transform: booleanAttribute }) public truncate?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public small?: boolean | null; public tooltipText = ''; diff --git a/frontend/src/app/shared/components/forms/geolocation-editor.component.ts b/frontend/src/app/shared/components/forms/geolocation-editor.component.ts index ca0dfd0d3e..4f8cf2ed9b 100644 --- a/frontend/src/app/shared/components/forms/geolocation-editor.component.ts +++ b/frontend/src/app/shared/components/forms/geolocation-editor.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { AfterViewInit, ChangeDetectionStrategy, Component, ElementRef, forwardRef, Input, ViewChild } from '@angular/core'; +import { AfterViewInit, booleanAttribute, ChangeDetectionStrategy, Component, ElementRef, forwardRef, Input, ViewChild } from '@angular/core'; import { NG_VALUE_ACCESSOR, UntypedFormControl } from '@angular/forms'; import { ExtendedFormGroup, LocalStoreService, ResourceLoaderService, Settings, StatefulControlComponent, Types, UIOptions, ValidatorsEx } from '@app/shared/internal'; @@ -42,7 +42,7 @@ export class GeolocationEditorComponent extends StatefulControlComponent im @Input() public folderId = ''; - @Input() + @Input({ transform: booleanAttribute }) public set disabled(value: boolean | undefined | null) { this.setDisabledState(value === true); } diff --git a/frontend/src/app/shared/components/references/content-selector-item.component.ts b/frontend/src/app/shared/components/references/content-selector-item.component.ts index fe15f8f76a..2f0318fb8b 100644 --- a/frontend/src/app/shared/components/references/content-selector-item.component.ts +++ b/frontend/src/app/shared/components/references/content-selector-item.component.ts @@ -7,7 +7,7 @@ /* tslint:disable: component-selector */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { ContentDto, LanguageDto, META_FIELDS, SchemaDto } from '@app/shared/internal'; @Component({ @@ -22,10 +22,10 @@ export class ContentSelectorItemComponent { @Output() public selectedChange = new EventEmitter(); - @Input() + @Input({ transform: booleanAttribute }) public selected?: boolean | null; - @Input() + @Input({ transform: booleanAttribute }) public selectable?: boolean | null = true; @Input() diff --git a/frontend/src/app/shared/components/references/content-selector.component.ts b/frontend/src/app/shared/components/references/content-selector.component.ts index 45729035ef..dd56e7cf3d 100644 --- a/frontend/src/app/shared/components/references/content-selector.component.ts +++ b/frontend/src/app/shared/components/references/content-selector.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; +import { booleanAttribute, Component, EventEmitter, Input, OnInit, Output } from '@angular/core'; import { BehaviorSubject, of } from 'rxjs'; import { distinctUntilChanged, map, switchMap } from 'rxjs/operators'; import { ApiUrlConfig, AppsState, ComponentContentsState, ContentDto, LanguageDto, META_FIELDS, Query, ResourceOwner, SchemaDto, SchemasService, SchemasState } from '@app/shared/internal'; @@ -42,7 +42,7 @@ export class ContentSelectorComponent extends ResourceOwner implements OnInit { @Input({ required: true }) public languages!: ReadonlyArray; - @Input() + @Input({ transform: booleanAttribute }) public allowDuplicates?: boolean | null; @Input() diff --git a/frontend/src/app/shared/components/references/reference-input.component.ts b/frontend/src/app/shared/components/references/reference-input.component.ts index 986017b794..1c4f6baa40 100644 --- a/frontend/src/app/shared/components/references/reference-input.component.ts +++ b/frontend/src/app/shared/components/references/reference-input.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, forwardRef, Input } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, forwardRef, Input } from '@angular/core'; import { NG_VALUE_ACCESSOR } from '@angular/forms'; import { AppsState, ContentDto, ContentsService, DialogModel, getContentValue, LanguageDto, LocalizerService, StatefulControlComponent, TypedSimpleChanges, Types } from '@app/shared/internal'; @@ -43,7 +43,7 @@ export class ReferenceInputComponent extends StatefulControlComponent | null; - @Input() + @Input({ transform: numberAttribute }) public level = 0; - @Input() + @Input({ transform: booleanAttribute }) public isRoot?: boolean | null; @Input({ required: true }) diff --git a/frontend/src/app/shared/components/search/queries/filter-node.component.ts b/frontend/src/app/shared/components/search/queries/filter-node.component.ts index 37ceea96ae..084e64b9b3 100644 --- a/frontend/src/app/shared/components/search/queries/filter-node.component.ts +++ b/frontend/src/app/shared/components/search/queries/filter-node.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { ChangeDetectionStrategy, Component, EventEmitter, Input, numberAttribute, Output } from '@angular/core'; import { FilterComparison, FilterLogical, FilterNode, LanguageDto, QueryModel, StatusInfo } from '@app/shared/internal'; @Component({ @@ -32,7 +32,7 @@ export class FilterNodeComponent { @Input({ required: true }) public statuses?: ReadonlyArray | null; - @Input() + @Input({ transform: numberAttribute }) public level = 0; @Input({ required: true }) diff --git a/frontend/src/app/shared/components/search/query-list.component.ts b/frontend/src/app/shared/components/search/query-list.component.ts index c17bc04764..a0e9d0742a 100644 --- a/frontend/src/app/shared/components/search/query-list.component.ts +++ b/frontend/src/app/shared/components/search/query-list.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { equalsQuery, Query, SavedQuery } from '@app/shared/internal'; @Component({ @@ -27,7 +27,7 @@ export class QueryListComponent { @Input() public queries?: ReadonlyArray | null; - @Input() + @Input({ transform: booleanAttribute }) public canRemove?: boolean | null; @Input() diff --git a/frontend/src/app/shared/components/search/search-form.component.ts b/frontend/src/app/shared/components/search/search-form.component.ts index 30399f5243..ec9e1a6a2b 100644 --- a/frontend/src/app/shared/components/search/search-form.component.ts +++ b/frontend/src/app/shared/components/search/search-form.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { Observable } from 'rxjs'; import { DialogModel, equalsQuery, hasFilter, LanguageDto, Queries, Query, QueryModel, SaveQueryForm, StatusInfo, TypedSimpleChanges, Types } from '@app/shared/internal'; @@ -45,7 +45,7 @@ export class SearchFormComponent { @Input() public queriesTypes = ''; - @Input() + @Input({ transform: booleanAttribute }) public enableShortcut?: boolean | null; @Input() diff --git a/frontend/src/app/shared/components/table-header.component.ts b/frontend/src/app/shared/components/table-header.component.ts index fe4064a2d2..62a5c83a89 100644 --- a/frontend/src/app/shared/components/table-header.component.ts +++ b/frontend/src/app/shared/components/table-header.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, EventEmitter, Input, Output } from '@angular/core'; import { LanguageDto, Query, SortMode, Types } from '@app/shared/internal'; @Component({ @@ -30,7 +30,7 @@ export class TableHeaderComponent { @Input() public sortPath?: string | undefined | null; - @Input() + @Input({ transform: booleanAttribute }) public sortable?: boolean | null; @Input() diff --git a/frontend/src/app/shared/components/tour-hint.directive.ts b/frontend/src/app/shared/components/tour-hint.directive.ts index 59f5f41992..c742485706 100644 --- a/frontend/src/app/shared/components/tour-hint.directive.ts +++ b/frontend/src/app/shared/components/tour-hint.directive.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { Directive, Input, OnDestroy, OnInit } from '@angular/core'; +import { Directive, Input, numberAttribute, OnDestroy, OnInit } from '@angular/core'; import { timer } from 'rxjs'; import { FloatingPlacement, ResourceOwner, StepDefinition, TourService, TourState, Types } from '@app/shared/internal'; @@ -19,7 +19,7 @@ export class TourHintDirective extends ResourceOwner implements OnDestroy, OnIni @Input() public hintText!: string; - @Input() + @Input({ transform: numberAttribute }) public hintAfter: number | string = 1000; @Input() @@ -84,4 +84,4 @@ export class TourHintDirective extends ResourceOwner implements OnDestroy, OnIni this.tourService.end(); this.tourState.disableAllHints(); } -} \ No newline at end of file +} diff --git a/frontend/src/app/shell/pages/internal/logo.component.ts b/frontend/src/app/shell/pages/internal/logo.component.ts index 9c0ccb4e24..f1e1d5c33f 100644 --- a/frontend/src/app/shell/pages/internal/logo.component.ts +++ b/frontend/src/app/shell/pages/internal/logo.component.ts @@ -5,7 +5,7 @@ * Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved. */ -import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; +import { booleanAttribute, ChangeDetectionStrategy, Component, Input } from '@angular/core'; @Component({ selector: 'sqx-logo', @@ -14,6 +14,6 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core'; changeDetection: ChangeDetectionStrategy.OnPush, }) export class LogoComponent { - @Input() + @Input({ transform: booleanAttribute }) public isLoading?: boolean | null; }