Skip to content

Commit

Permalink
Add transform
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianStehle committed Aug 8, 2023
1 parent aa3508b commit f25c5db
Show file tree
Hide file tree
Showing 97 changed files with 323 additions and 323 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -29,7 +29,7 @@ export class AssetTagsComponent {
@Input({ required: true })
public tagsSelected!: TagsSelected;

@Input()
@Input({ transform: booleanAttribute })
public canRename = false;

public tagRenaming?: TagItem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -23,13 +23,13 @@ export class ContentEditorComponent {
@Output()
public contentIdChange = new EventEmitter<string>();

@Input()
@Input({ transform: booleanAttribute })
public isNew = false;

@Input()
@Input({ transform: booleanAttribute })
public isDeleted?: boolean;

@Input()
@Input({ transform: booleanAttribute })
public showIdInput = false;

@Input({ required: true })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -18,7 +18,7 @@ export class ContentFieldComponent {
@Output()
public languageChange = new EventEmitter<AppLanguageDto>();

@Input()
@Input({ transform: booleanAttribute })
public isCompact?: boolean | null;

@Input()
Expand All @@ -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 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -23,7 +23,7 @@ export class ContentSectionComponent extends StatefulComponent<State> {
@Output()
public languageChange = new EventEmitter<AppLanguageDto>();

@Input()
@Input({ transform: booleanAttribute })
public isCompact?: boolean | null;

@Input({ required: true })
Expand All @@ -32,7 +32,7 @@ export class ContentSectionComponent extends StatefulComponent<State> {
@Input()
public formCompare?: EditContentForm | null;

@Input({ required: true })
@Input({ required: true, transform: numberAttribute })
public formLevel!: number;

@Input({ required: true })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -18,7 +18,7 @@ export class FieldLanguagesComponent {
@Output()
public showAllControlsChange = new EventEmitter<boolean>();

@Input()
@Input({ transform: booleanAttribute })
public showAllControls?: boolean | null;

@Output()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -19,7 +19,7 @@ const OPTION_IMMEDIATELY = 'Immediately';
export class DueTimeSelectorComponent {
private dueTimeResult?: Subject<string | null>;

@Input()
@Input({ transform: booleanAttribute })
public disabled?: boolean | null;

public dueTimeDialog = new DialogModel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -52,10 +52,10 @@ export class AssetsEditorComponent extends StatefulControlComponent<State, Reado
@Input()
public folderId?: string;

@Input()
@Input({ transform: booleanAttribute })
public isExpanded = false;

@Input()
@Input({ transform: booleanAttribute })
public set disabled(value: boolean | undefined | null) {
this.setDisabledState(value === true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Copyright (c) Squidex UG (haftungsbeschränkt). All rights reserved.
*/

import { ChangeDetectionStrategy, Component, Input, QueryList, ViewChildren } from '@angular/core';
import { booleanAttribute, ChangeDetectionStrategy, Component, Input, numberAttribute, QueryList, ViewChildren } from '@angular/core';
import { AbstractContentForm, AppLanguageDto, EditContentForm, FieldDto, FieldSection } from '@app/shared';
import { FieldEditorComponent } from './field-editor.component';

Expand All @@ -22,13 +22,13 @@ export class ComponentSectionComponent {
@Input({ required: true })
public formContext!: any;

@Input({ required: true })
@Input({ required: true, transform: numberAttribute })
public formLevel!: number;

@Input({ required: true })
public formSection!: FieldSection<FieldDto, any>;

@Input({ required: true })
@Input({ required: true, transform: booleanAttribute })
public isComparing = false;

@Input({ required: true })
Expand All @@ -37,10 +37,10 @@ export class ComponentSectionComponent {
@Input({ required: true })
public languages!: ReadonlyArray<AppLanguageDto>;

@Input()
@Input({ transform: numberAttribute })
public index: number | null | undefined;

@Input()
@Input({ transform: booleanAttribute })
public canUnset?: boolean | null;

@ViewChildren(FieldEditorComponent)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 })
Expand All @@ -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 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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 })
Expand All @@ -39,13 +39,13 @@ export class FieldEditorComponent {
@Input({ required: true })
public languages!: ReadonlyArray<AppLanguageDto>;

@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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -39,7 +39,7 @@ export class IFrameEditorComponent extends StatefulComponent<State> implements
@Output()
public isExpandedChange = new EventEmitter();

@Input()
@Input({ transform: booleanAttribute })
public isExpanded = false;

@Input({ required: true })
Expand All @@ -51,7 +51,7 @@ export class IFrameEditorComponent extends StatefulComponent<State> implements
@Input({ required: true })
public formField = '';

@Input({ required: true })
@Input({ required: true, transform: numberAttribute })
public formIndex?: number | null;

@Input({ required: true })
Expand All @@ -63,7 +63,7 @@ export class IFrameEditorComponent extends StatefulComponent<State> implements
@Input({ required: true })
public formControlBinding!: AbstractControl;

@Input()
@Input({ transform: booleanAttribute })
public set disabled(value: boolean | undefined | null) {
this.updatedisabled(value === true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -41,7 +41,7 @@ type Request = { search?: string; page: number };
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class StockPhotoEditorComponent extends StatefulControlComponent<State, string> implements OnInit {
@Input()
@Input({ transform: booleanAttribute })
public set disabled(value: boolean | undefined | null) {
this.setDisabledState(value === true);
}
Expand Down
Loading

0 comments on commit f25c5db

Please sign in to comment.