@open-rlb/ng-bootstrap 2.3.1 → 2.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10283,65 +10283,68 @@ class SwitchComponent extends AbstractComponent {
|
|
|
10283
10283
|
}
|
|
10284
10284
|
}
|
|
10285
10285
|
onWrite(data) {
|
|
10286
|
+
this.data = data;
|
|
10287
|
+
}
|
|
10288
|
+
ngAfterViewInit() {
|
|
10286
10289
|
if (this.el && this.el.nativeElement) {
|
|
10287
|
-
if (data === undefined || data === null)
|
|
10290
|
+
if (this.data === undefined || this.data === null)
|
|
10288
10291
|
return;
|
|
10289
|
-
if (typeof data === 'string') {
|
|
10290
|
-
this.el.nativeElement.checked = /^true$/i.test(data);
|
|
10292
|
+
if (typeof this.data === 'string') {
|
|
10293
|
+
this.el.nativeElement.checked = /^true$/i.test(this.data);
|
|
10291
10294
|
}
|
|
10292
10295
|
else {
|
|
10293
|
-
this.el.nativeElement.checked = data;
|
|
10296
|
+
this.el.nativeElement.checked = this.data;
|
|
10294
10297
|
}
|
|
10295
10298
|
}
|
|
10296
10299
|
}
|
|
10297
10300
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SwitchComponent, deps: [{ token: UniqueIdService }, { token: i2$2.NgControl, optional: true, self: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
10298
10301
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "20.3.15", type: SwitchComponent, isStandalone: false, selector: "rlb-switch", inputs: { disabled: ["disabled", "disabled", booleanAttribute], readonly: ["readonly", "readonly", booleanAttribute], size: "size", userDefinedId: ["id", "userDefinedId", (v) => v || ''] }, viewQueries: [{ propertyName: "el", first: true, predicate: ["field"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
10299
|
-
|
|
10300
|
-
|
|
10301
|
-
|
|
10302
|
-
|
|
10303
|
-
|
|
10304
|
-
|
|
10305
|
-
|
|
10306
|
-
|
|
10307
|
-
|
|
10308
|
-
|
|
10309
|
-
|
|
10310
|
-
|
|
10311
|
-
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10302
|
+
<div class="d-flex align-items-center gap-2">
|
|
10303
|
+
<ng-content select="[before]"></ng-content>
|
|
10304
|
+
|
|
10305
|
+
<div class="form-check form-switch m-0">
|
|
10306
|
+
<input
|
|
10307
|
+
#field
|
|
10308
|
+
class="form-check-input"
|
|
10309
|
+
type="checkbox"
|
|
10310
|
+
[id]="id"
|
|
10311
|
+
[attr.disabled]="disabled ? true : undefined"
|
|
10312
|
+
[attr.readonly]="readonly ? true : undefined"
|
|
10313
|
+
(blur)="touch()"
|
|
10314
|
+
[ngClass]="{ 'is-invalid': control?.touched && control?.invalid }"
|
|
10315
|
+
(input)="update($event.target)"
|
|
10316
|
+
/>
|
|
10317
|
+
</div>
|
|
10318
|
+
|
|
10319
|
+
<ng-content select="[after]"></ng-content>
|
|
10316
10320
|
</div>
|
|
10317
|
-
|
|
10318
|
-
<ng-content select="[after]"></ng-content>`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: i1.JsonPipe, name: "json" }] }); }
|
|
10321
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
|
|
10319
10322
|
}
|
|
10320
10323
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.15", ngImport: i0, type: SwitchComponent, decorators: [{
|
|
10321
10324
|
type: Component,
|
|
10322
10325
|
args: [{
|
|
10323
10326
|
selector: 'rlb-switch',
|
|
10324
10327
|
template: `
|
|
10325
|
-
|
|
10326
|
-
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
|
|
10333
|
-
|
|
10334
|
-
|
|
10335
|
-
|
|
10336
|
-
|
|
10337
|
-
|
|
10338
|
-
|
|
10339
|
-
|
|
10340
|
-
|
|
10341
|
-
|
|
10328
|
+
<div class="d-flex align-items-center gap-2">
|
|
10329
|
+
<ng-content select="[before]"></ng-content>
|
|
10330
|
+
|
|
10331
|
+
<div class="form-check form-switch m-0">
|
|
10332
|
+
<input
|
|
10333
|
+
#field
|
|
10334
|
+
class="form-check-input"
|
|
10335
|
+
type="checkbox"
|
|
10336
|
+
[id]="id"
|
|
10337
|
+
[attr.disabled]="disabled ? true : undefined"
|
|
10338
|
+
[attr.readonly]="readonly ? true : undefined"
|
|
10339
|
+
(blur)="touch()"
|
|
10340
|
+
[ngClass]="{ 'is-invalid': control?.touched && control?.invalid }"
|
|
10341
|
+
(input)="update($event.target)"
|
|
10342
|
+
/>
|
|
10343
|
+
</div>
|
|
10344
|
+
|
|
10345
|
+
<ng-content select="[after]"></ng-content>
|
|
10342
10346
|
</div>
|
|
10343
|
-
|
|
10344
|
-
<ng-content select="[after]"></ng-content>`,
|
|
10347
|
+
`,
|
|
10345
10348
|
standalone: false
|
|
10346
10349
|
}]
|
|
10347
10350
|
}], ctorParameters: () => [{ type: UniqueIdService }, { type: i2$2.NgControl, decorators: [{
|