Skip to content

Commit 02c6bd3

Browse files
committed
11.0.2
1 parent fb9051c commit 02c6bd3

26 files changed

+63
-63
lines changed

projects/ng-dynamic-forms/core/src/lib/component/dynamic-form-control-container.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export abstract class DynamicFormControlContainerComponent implements OnChanges,
140140
}
141141

142142
get hint(): string | null {
143-
return (this.model as DynamicFormValueControlModel<any>).hint || null;
143+
return (this.model as DynamicFormValueControlModel<any>).hint ?? null;
144144
}
145145

146146
get isCheckbox(): boolean {
@@ -253,7 +253,7 @@ export abstract class DynamicFormControlContainerComponent implements OnChanges,
253253
}
254254

255255
onLayoutOrModelChange(): void {
256-
this.controlLayout = this.layoutService.findByModel(this.model, this.layout) || this.model.layout as DynamicFormControlLayout;
256+
this.controlLayout = this.layoutService.findByModel(this.model, this.layout) ?? this.model.layout as DynamicFormControlLayout;
257257
this.klass = `${Array.isArray(this.hostClass) ? this.hostClass.join(" ") : ""} ${this.layoutService.getHostClass(this.controlLayout)}`;
258258
}
259259

@@ -300,7 +300,7 @@ export abstract class DynamicFormControlContainerComponent implements OnChanges,
300300

301301
if (model.inputType === DYNAMIC_FORM_CONTROL_INPUT_TYPE_FILE) {
302302

303-
const inputElement: any = $event.target || $event.srcElement;
303+
const inputElement: any = $event.target ?? $event.srcElement;
304304

305305
model.files = inputElement.files as FileList;
306306
}

projects/ng-dynamic-forms/core/src/lib/component/dynamic-form-control.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ export abstract class DynamicFormControlComponent implements DynamicFormControl
7474
model: DynamicFormControlModel = this.model): string {
7575

7676
const controlLayout = model === this.model ? this.layout :
77-
this.layoutService.findByModel(model, this.formLayout) || model.layout as DynamicFormControlLayout;
77+
this.layoutService.findByModel(model, this.formLayout) ?? model.layout as DynamicFormControlLayout;
7878

7979
return this.layoutService.getClass(controlLayout, context, place);
8080
}

projects/ng-dynamic-forms/core/src/lib/model/datepicker/dynamic-datepicker.model.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ export class DynamicDatePickerModel extends DynamicDateControlModel {
3939
super(config, layout);
4040

4141
this.autoFocus = isBoolean(config.autoFocus) ? config.autoFocus : false;
42-
this.focusedDate = config.focusedDate || null;
42+
this.focusedDate = config.focusedDate ?? null;
4343
this.inline = isBoolean(config.inline) ? config.inline : false;
44-
this.prefix = config.prefix || null;
44+
this.prefix = config.prefix ?? null;
4545
this.readOnly = isBoolean(config.readOnly) ? config.readOnly : false;
4646
this.toggleIcon = isString(config.toggleIcon) ? config.toggleIcon : null;
4747
this.toggleLabel = isString(config.toggleLabel) ? config.toggleLabel : null;
48-
this.suffix = config.suffix || null;
48+
this.suffix = config.suffix ?? null;
4949
}
50-
}
50+
}

projects/ng-dynamic-forms/core/src/lib/model/dynamic-check-control.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export abstract class DynamicCheckControlModel extends DynamicFormValueControlMo
1616

1717
super(config, layout);
1818

19-
this.labelPosition = config.labelPosition || null;
19+
this.labelPosition = config.labelPosition ?? null;
2020
this.checked = isBoolean(this.value) ? this.value : false;
2121
}
2222

projects/ng-dynamic-forms/core/src/lib/model/dynamic-date-control.model.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ export abstract class DynamicDateControlModel extends DynamicFormValueControlMod
2323

2424
super(config, layout);
2525

26-
this.format = config.format || null;
27-
this.max = config.max || null;
28-
this.min = config.min || null;
29-
this.placeholder = config.placeholder || null;
26+
this.format = config.format ?? null;
27+
this.max = config.max ?? null;
28+
this.min = config.min ?? null;
29+
this.placeholder = config.placeholder ?? null;
3030
}
3131
}

projects/ng-dynamic-forms/core/src/lib/model/dynamic-form-control.model.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,18 @@ export abstract class DynamicFormControlModel implements DynamicPathable {
4747

4848
protected constructor(config: DynamicFormControlModelConfig, layout: DynamicFormControlLayout | null = null) {
4949

50-
this.asyncValidators = config.asyncValidators || null;
51-
this.errorMessages = config.errorMessages || null;
50+
this.asyncValidators = config.asyncValidators ?? null;
51+
this.errorMessages = config.errorMessages ?? null;
5252
this.hidden = isBoolean(config.hidden) ? config.hidden : false;
5353
this.id = config.id;
54-
this.label = config.label || null;
55-
this.labelTooltip = config.labelTooltip || null;
56-
this.controlTooltip = config.controlTooltip || null;
54+
this.label = config.label ?? null;
55+
this.labelTooltip = config.labelTooltip ?? null;
56+
this.controlTooltip = config.controlTooltip ?? null;
5757
this.layout = layout;
58-
this.name = config.name || config.id;
58+
this.name = config.name ?? config.id;
5959
this.relations = Array.isArray(config.relations) ? config.relations : [];
6060
this.updateOn = isString(config.updateOn) ? config.updateOn : null;
61-
this.validators = config.validators || null;
61+
this.validators = config.validators ?? null;
6262

6363
this.disabled$ = new BehaviorSubject(isBoolean(config.disabled) ? config.disabled : false);
6464
this.disabled$.subscribe(disabled => this._disabled = disabled);

projects/ng-dynamic-forms/core/src/lib/model/dynamic-form-value-control.model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ export abstract class DynamicFormValueControlModel<T> extends DynamicFormControl
3030
super(config, layout);
3131

3232
this.additional = isObject(config.additional) ? config.additional : null;
33-
this.hint = config.hint || null;
33+
this.hint = config.hint ?? null;
3434
this.required = isBoolean(config.required) ? config.required : false;
35-
this.tabIndex = config.tabIndex || null;
35+
this.tabIndex = config.tabIndex ?? null;
3636

37-
this.value$ = new BehaviorSubject(config.value !== null && config.value !== undefined ? config.value : null);
37+
this.value$ = new BehaviorSubject(config.value ?? null);
3838
this.value$.subscribe(value => this._value = value);
3939
this.valueChanges = this.value$.asObservable();
4040
}

projects/ng-dynamic-forms/core/src/lib/model/dynamic-input-control.model.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,14 @@ export abstract class DynamicInputControlModel<T> extends DynamicFormValueContro
3232

3333
super(config, layout);
3434

35-
this.autoComplete = config.autoComplete || "on";
35+
this.autoComplete = config.autoComplete ?? "on";
3636
this.autoFocus = isBoolean(config.autoFocus) ? config.autoFocus : false;
3737
this.maxLength = isNumber(config.maxLength) ? config.maxLength : null;
3838
this.minLength = isNumber(config.minLength) ? config.minLength : null;
39-
this.placeholder = config.placeholder || "";
40-
this.prefix = config.prefix || null;
39+
this.placeholder = config.placeholder ?? "";
40+
this.prefix = config.prefix ?? null;
4141
this.readOnly = isBoolean(config.readOnly) ? config.readOnly : false;
4242
this.spellCheck = isBoolean(config.spellCheck) ? config.spellCheck : false;
43-
this.suffix = config.suffix || null;
43+
this.suffix = config.suffix ?? null;
4444
}
4545
}

projects/ng-dynamic-forms/core/src/lib/model/dynamic-option-control.model.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export class DynamicFormOption<T> {
2121
constructor(config: DynamicFormOptionConfig<T>) {
2222

2323
this.disabled = isBoolean(config.disabled) ? config.disabled : false;
24-
this.label = config.label || null;
24+
this.label = config.label ?? null;
2525
this.value = config.value;
2626
}
2727

projects/ng-dynamic-forms/core/src/lib/model/file-upload/dynamic-file-upload.model.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ export class DynamicFileUploadModel extends DynamicFileControlModel {
3636
this.autoUpload = isBoolean(config.autoUpload) ? config.autoUpload : true;
3737
this.maxSize = isNumber(config.maxSize) ? config.maxSize : null;
3838
this.minSize = isNumber(config.minSize) ? config.minSize : null;
39-
this.removeUrl = config.removeUrl || null;
39+
this.removeUrl = config.removeUrl ?? null;
4040
this.showFileList = isBoolean(config.showFileList) ? config.showFileList : true;
41-
this.url = config.url || null;
41+
this.url = config.url ?? null;
4242
}
43-
}
43+
}

0 commit comments

Comments
 (0)