@ngx-formly/bootstrap 6.0.2 → 6.0.4
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.
- package/esm2020/radio/radio.type.mjs +7 -5
- package/fesm2015/ngx-formly-bootstrap-radio.mjs +6 -5
- package/fesm2015/ngx-formly-bootstrap-radio.mjs.map +1 -1
- package/fesm2020/ngx-formly-bootstrap-radio.mjs +6 -5
- package/fesm2020/ngx-formly-bootstrap-radio.mjs.map +1 -1
- package/package.json +2 -2
- package/radio/radio.type.d.ts +2 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component, ChangeDetectionStrategy } from '@angular/core';
|
|
2
2
|
import { FieldType } from '@ngx-formly/bootstrap/form-field';
|
|
3
|
+
import { FormControl } from '@angular/forms';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
import * as i1 from "@angular/common";
|
|
5
6
|
import * as i2 from "@angular/forms";
|
|
@@ -14,6 +15,9 @@ export class FormlyFieldRadio extends FieldType {
|
|
|
14
15
|
},
|
|
15
16
|
};
|
|
16
17
|
}
|
|
18
|
+
get disabledControl() {
|
|
19
|
+
return new FormControl({ value: this.formControl.value, disabled: true });
|
|
20
|
+
}
|
|
17
21
|
}
|
|
18
22
|
FormlyFieldRadio.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldRadio, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
19
23
|
FormlyFieldRadio.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyFieldRadio, selector: "formly-field-radio", usesInheritance: true, ngImport: i0, template: `
|
|
@@ -31,9 +35,8 @@ FormlyFieldRadio.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
31
35
|
[class.is-invalid]="showError"
|
|
32
36
|
[attr.value]="option.value"
|
|
33
37
|
[value]="option.value"
|
|
34
|
-
[formControl]="formControl"
|
|
38
|
+
[formControl]="option.disabled ? disabledControl : formControl"
|
|
35
39
|
[formlyAttributes]="field"
|
|
36
|
-
[attr.disabled]="option.disabled || formControl.disabled ? true : null"
|
|
37
40
|
/>
|
|
38
41
|
<label class="form-check-label" [for]="id + '_' + i">
|
|
39
42
|
{{ option.label }}
|
|
@@ -60,9 +63,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
60
63
|
[class.is-invalid]="showError"
|
|
61
64
|
[attr.value]="option.value"
|
|
62
65
|
[value]="option.value"
|
|
63
|
-
[formControl]="formControl"
|
|
66
|
+
[formControl]="option.disabled ? disabledControl : formControl"
|
|
64
67
|
[formlyAttributes]="field"
|
|
65
|
-
[attr.disabled]="option.disabled || formControl.disabled ? true : null"
|
|
66
68
|
/>
|
|
67
69
|
<label class="form-check-label" [for]="id + '_' + i">
|
|
68
70
|
{{ option.label }}
|
|
@@ -73,4 +75,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
73
75
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
74
76
|
}]
|
|
75
77
|
}] });
|
|
76
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
78
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmFkaW8udHlwZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3NyYy91aS9ib290c3RyYXAvcmFkaW8vc3JjL3JhZGlvLnR5cGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFNBQVMsRUFBRSx1QkFBdUIsRUFBUSxNQUFNLGVBQWUsQ0FBQztBQUV6RSxPQUFPLEVBQUUsU0FBUyxFQUFvQixNQUFNLGtDQUFrQyxDQUFDO0FBQy9FLE9BQU8sRUFBRSxXQUFXLEV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gICAgICAgW2Zvcm1Db250cm9sXT1cIm9wdGlvbi5kaXNhYmxlZCA/IGRpc2FibGVkQ29udHJvbCA6IGZvcm1Db250cm9sXCJcbiAgICAgICAgICBbZm9ybWx5QXR0cmlidXRlc109XCJmaWVsZFwiXG4gICAgICAgIC8+XG4gICAgICAgIDxsYWJlbCBjbGFzcz1cImZvcm0tY2hlY2stbGFiZWxcIiBbZm9yXT1cImlkICsgJ18nICsgaVwiPlxuICAgICAgICAgIHt7IG9wdGlvbi5sYWJlbCB9fVxuICAgICAgICA8L2xhYmVsPlxuICAgICAgPC9kaXY+XG4gICAgPC9uZy10ZW1wbGF0ZT5cbiAgYCxcbiAgY2hhbmdlRGV0ZWN0aW9uOiBDaGFuZ2VEZXRlY3Rpb25TdHJhdGVneS5PblB1c2gsXG59KVxuZXhwb3J0IGNsYXNzIEZvcm1seUZpZWxkUmFkaW8gZXh0ZW5kcyBGaWVsZFR5cGU8RmllbGRUeXBlQ29uZmlnPFJhZGlvUHJvcHM+PiB7XG4gIG92ZXJyaWRlIGRlZmF1bHRPcHRpb25zID0ge1xuICAgIHByb3BzOiB7XG4gICAgICBmb3JtQ2hlY2s6ICdkZWZhdWx0JyBhcyBjb25zdCxcbiAgICB9LFxuICB9O1xuXG4gIGdldCBkaXNhYmxlZENvbnRyb2woKSB7XG4gICAgcmV0dXJuIG5ldyBGb3JtQ29udHJvbCh7IHZhbHVlOiB0aGlzLmZvcm1Db250cm9sLnZhbHVlLCBkaXNhYmxlZDogdHJ1ZSB9KTtcbiAgfVxufVxuIl19
|
|
@@ -5,7 +5,7 @@ import { CommonModule } from '@angular/common';
|
|
|
5
5
|
import * as i3 from '@ngx-formly/core';
|
|
6
6
|
import { FormlyModule } from '@ngx-formly/core';
|
|
7
7
|
import * as i2 from '@angular/forms';
|
|
8
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import * as i4 from '@ngx-formly/core/select';
|
|
10
10
|
import { FormlySelectModule } from '@ngx-formly/core/select';
|
|
11
11
|
import { FieldType, FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';
|
|
@@ -19,6 +19,9 @@ class FormlyFieldRadio extends FieldType {
|
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
+
get disabledControl() {
|
|
23
|
+
return new FormControl({ value: this.formControl.value, disabled: true });
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
FormlyFieldRadio.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldRadio, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
24
27
|
FormlyFieldRadio.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyFieldRadio, selector: "formly-field-radio", usesInheritance: true, ngImport: i0, template: `
|
|
@@ -36,9 +39,8 @@ FormlyFieldRadio.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
36
39
|
[class.is-invalid]="showError"
|
|
37
40
|
[attr.value]="option.value"
|
|
38
41
|
[value]="option.value"
|
|
39
|
-
[formControl]="formControl"
|
|
42
|
+
[formControl]="option.disabled ? disabledControl : formControl"
|
|
40
43
|
[formlyAttributes]="field"
|
|
41
|
-
[attr.disabled]="option.disabled || formControl.disabled ? true : null"
|
|
42
44
|
/>
|
|
43
45
|
<label class="form-check-label" [for]="id + '_' + i">
|
|
44
46
|
{{ option.label }}
|
|
@@ -65,9 +67,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
65
67
|
[class.is-invalid]="showError"
|
|
66
68
|
[attr.value]="option.value"
|
|
67
69
|
[value]="option.value"
|
|
68
|
-
[formControl]="formControl"
|
|
70
|
+
[formControl]="option.disabled ? disabledControl : formControl"
|
|
69
71
|
[formlyAttributes]="field"
|
|
70
|
-
[attr.disabled]="option.disabled || formControl.disabled ? true : null"
|
|
71
72
|
/>
|
|
72
73
|
<label class="form-check-label" [for]="id + '_' + i">
|
|
73
74
|
{{ option.label }}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-bootstrap-radio.mjs","sources":["../../../../src/ui/bootstrap/radio/src/radio.type.ts","../../../../src/ui/bootstrap/radio/src/radio.module.ts","../../../../src/ui/bootstrap/radio/src/ngx-formly-bootstrap-radio.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/bootstrap/form-field';\n\ninterface RadioProps extends FormlyFieldProps {\n formCheck?: 'default' | 'inline';\n}\n\nexport interface FormlyRadioFieldConfig extends FormlyFieldConfig<RadioProps> {\n type: 'radio' | Type<FormlyFieldRadio>;\n}\n\n@Component({\n selector: 'formly-field-radio',\n template: `\n <ng-template #fieldTypeTemplate>\n <div\n *ngFor=\"let option of props.options | formlySelectOptions: field | async; let i = index\"\n class=\"form-check\"\n [class.form-check-inline]=\"props.formCheck === 'inline'\"\n >\n <input\n type=\"radio\"\n [id]=\"id + '_' + i\"\n class=\"form-check-input\"\n [name]=\"field.name || id\"\n [class.is-invalid]=\"showError\"\n [attr.value]=\"option.value\"\n [value]=\"option.value\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n
|
|
1
|
+
{"version":3,"file":"ngx-formly-bootstrap-radio.mjs","sources":["../../../../src/ui/bootstrap/radio/src/radio.type.ts","../../../../src/ui/bootstrap/radio/src/radio.module.ts","../../../../src/ui/bootstrap/radio/src/ngx-formly-bootstrap-radio.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/bootstrap/form-field';\nimport { FormControl } from '@angular/forms';\n\ninterface RadioProps extends FormlyFieldProps {\n formCheck?: 'default' | 'inline';\n}\n\nexport interface FormlyRadioFieldConfig extends FormlyFieldConfig<RadioProps> {\n type: 'radio' | Type<FormlyFieldRadio>;\n}\n\n@Component({\n selector: 'formly-field-radio',\n template: `\n <ng-template #fieldTypeTemplate>\n <div\n *ngFor=\"let option of props.options | formlySelectOptions: field | async; let i = index\"\n class=\"form-check\"\n [class.form-check-inline]=\"props.formCheck === 'inline'\"\n >\n <input\n type=\"radio\"\n [id]=\"id + '_' + i\"\n class=\"form-check-input\"\n [name]=\"field.name || id\"\n [class.is-invalid]=\"showError\"\n [attr.value]=\"option.value\"\n [value]=\"option.value\"\n [formControl]=\"option.disabled ? disabledControl : formControl\"\n [formlyAttributes]=\"field\"\n />\n <label class=\"form-check-label\" [for]=\"id + '_' + i\">\n {{ option.label }}\n </label>\n </div>\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldRadio extends FieldType<FieldTypeConfig<RadioProps>> {\n override defaultOptions = {\n props: {\n formCheck: 'default' as const,\n },\n };\n\n get disabledControl() {\n return new FormControl({ value: this.formControl.value, disabled: true });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\n\nimport { FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';\nimport { FormlyFieldRadio } from './radio.type';\n\n@NgModule({\n declarations: [FormlyFieldRadio],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n FormlyBootstrapFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'radio',\n component: FormlyFieldRadio,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyBootstrapRadioModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"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AAA;YACP,YAAY;YACZ,mBAAmB;YAEnB,8BAA8B;YAC9B,kBAAkB;YAClB,YAAY,CAAC,QAAQ,CAAC;AACpB,gBAAA,KAAK,EAAE;AACL,oBAAA;AACE,wBAAA,IAAI,EAAE,OAAO;AACb,wBAAA,SAAS,EAAE,gBAAgB;wBAC3B,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,qBAAA;AACF,iBAAA;aACF,CAAC;SACH,CAAA,EAAA,CAAA,CAAA;4FAEU,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAnBtC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBAEnB,8BAA8B;wBAC9B,kBAAkB;wBAClB,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,OAAO;AACb,oCAAA,SAAS,EAAE,gBAAgB;oCAC3B,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;iBACF,CAAA;;;AC3BD;;AAEG;;;;"}
|
|
@@ -5,7 +5,7 @@ import { CommonModule } from '@angular/common';
|
|
|
5
5
|
import * as i3 from '@ngx-formly/core';
|
|
6
6
|
import { FormlyModule } from '@ngx-formly/core';
|
|
7
7
|
import * as i2 from '@angular/forms';
|
|
8
|
-
import { ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
import { FormControl, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import * as i4 from '@ngx-formly/core/select';
|
|
10
10
|
import { FormlySelectModule } from '@ngx-formly/core/select';
|
|
11
11
|
import { FieldType, FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';
|
|
@@ -19,6 +19,9 @@ class FormlyFieldRadio extends FieldType {
|
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
+
get disabledControl() {
|
|
23
|
+
return new FormControl({ value: this.formControl.value, disabled: true });
|
|
24
|
+
}
|
|
22
25
|
}
|
|
23
26
|
FormlyFieldRadio.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldRadio, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
24
27
|
FormlyFieldRadio.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyFieldRadio, selector: "formly-field-radio", usesInheritance: true, ngImport: i0, template: `
|
|
@@ -36,9 +39,8 @@ FormlyFieldRadio.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", versi
|
|
|
36
39
|
[class.is-invalid]="showError"
|
|
37
40
|
[attr.value]="option.value"
|
|
38
41
|
[value]="option.value"
|
|
39
|
-
[formControl]="formControl"
|
|
42
|
+
[formControl]="option.disabled ? disabledControl : formControl"
|
|
40
43
|
[formlyAttributes]="field"
|
|
41
|
-
[attr.disabled]="option.disabled || formControl.disabled ? true : null"
|
|
42
44
|
/>
|
|
43
45
|
<label class="form-check-label" [for]="id + '_' + i">
|
|
44
46
|
{{ option.label }}
|
|
@@ -65,9 +67,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
|
|
|
65
67
|
[class.is-invalid]="showError"
|
|
66
68
|
[attr.value]="option.value"
|
|
67
69
|
[value]="option.value"
|
|
68
|
-
[formControl]="formControl"
|
|
70
|
+
[formControl]="option.disabled ? disabledControl : formControl"
|
|
69
71
|
[formlyAttributes]="field"
|
|
70
|
-
[attr.disabled]="option.disabled || formControl.disabled ? true : null"
|
|
71
72
|
/>
|
|
72
73
|
<label class="form-check-label" [for]="id + '_' + i">
|
|
73
74
|
{{ option.label }}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-bootstrap-radio.mjs","sources":["../../../../src/ui/bootstrap/radio/src/radio.type.ts","../../../../src/ui/bootstrap/radio/src/radio.module.ts","../../../../src/ui/bootstrap/radio/src/ngx-formly-bootstrap-radio.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/bootstrap/form-field';\n\ninterface RadioProps extends FormlyFieldProps {\n formCheck?: 'default' | 'inline';\n}\n\nexport interface FormlyRadioFieldConfig extends FormlyFieldConfig<RadioProps> {\n type: 'radio' | Type<FormlyFieldRadio>;\n}\n\n@Component({\n selector: 'formly-field-radio',\n template: `\n <ng-template #fieldTypeTemplate>\n <div\n *ngFor=\"let option of props.options | formlySelectOptions: field | async; let i = index\"\n class=\"form-check\"\n [class.form-check-inline]=\"props.formCheck === 'inline'\"\n >\n <input\n type=\"radio\"\n [id]=\"id + '_' + i\"\n class=\"form-check-input\"\n [name]=\"field.name || id\"\n [class.is-invalid]=\"showError\"\n [attr.value]=\"option.value\"\n [value]=\"option.value\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n
|
|
1
|
+
{"version":3,"file":"ngx-formly-bootstrap-radio.mjs","sources":["../../../../src/ui/bootstrap/radio/src/radio.type.ts","../../../../src/ui/bootstrap/radio/src/radio.module.ts","../../../../src/ui/bootstrap/radio/src/ngx-formly-bootstrap-radio.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, Type } from '@angular/core';\nimport { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FieldType, FormlyFieldProps } from '@ngx-formly/bootstrap/form-field';\nimport { FormControl } from '@angular/forms';\n\ninterface RadioProps extends FormlyFieldProps {\n formCheck?: 'default' | 'inline';\n}\n\nexport interface FormlyRadioFieldConfig extends FormlyFieldConfig<RadioProps> {\n type: 'radio' | Type<FormlyFieldRadio>;\n}\n\n@Component({\n selector: 'formly-field-radio',\n template: `\n <ng-template #fieldTypeTemplate>\n <div\n *ngFor=\"let option of props.options | formlySelectOptions: field | async; let i = index\"\n class=\"form-check\"\n [class.form-check-inline]=\"props.formCheck === 'inline'\"\n >\n <input\n type=\"radio\"\n [id]=\"id + '_' + i\"\n class=\"form-check-input\"\n [name]=\"field.name || id\"\n [class.is-invalid]=\"showError\"\n [attr.value]=\"option.value\"\n [value]=\"option.value\"\n [formControl]=\"option.disabled ? disabledControl : formControl\"\n [formlyAttributes]=\"field\"\n />\n <label class=\"form-check-label\" [for]=\"id + '_' + i\">\n {{ option.label }}\n </label>\n </div>\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldRadio extends FieldType<FieldTypeConfig<RadioProps>> {\n override defaultOptions = {\n props: {\n formCheck: 'default' as const,\n },\n };\n\n get disabledControl() {\n return new FormControl({ value: this.formControl.value, disabled: true });\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\n\nimport { FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';\nimport { FormlyFieldRadio } from './radio.type';\n\n@NgModule({\n declarations: [FormlyFieldRadio],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n FormlyBootstrapFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'radio',\n component: FormlyFieldRadio,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyBootstrapRadioModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;;AAyCM,MAAO,gBAAiB,SAAQ,SAAsC,CAAA;AA5B5E,IAAA,WAAA,GAAA;;AA6BW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,SAAS,EAAE,SAAkB;AAC9B,aAAA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E,gBAAgB;wBAC3B,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,qBAAA;AACF,iBAAA;aACF,CAAC;AACH,SAAA,CAAA,EAAA,CAAA,CAAA;4FAEU,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAnBtC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBAEnB,8BAA8B;wBAC9B,kBAAkB;wBAClB,YAAY,CAAC,QAAQ,CAAC;AACpB,4BAAA,KAAK,EAAE;AACL,gCAAA;AACE,oCAAA,IAAI,EAAE,OAAO;AACb,oCAAA,SAAS,EAAE,gBAAgB;oCAC3B,QAAQ,EAAE,CAAC,YAAY,CAAC;AACzB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;AACF,iBAAA,CAAA;;;AC3BD;;AAEG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ngx-formly/bootstrap",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"tslib": "^2.0.0"
|
|
7
7
|
},
|
|
8
8
|
"peerDependencies": {
|
|
9
|
-
"@ngx-formly/core": "6.0.
|
|
9
|
+
"@ngx-formly/core": "6.0.4",
|
|
10
10
|
"bootstrap": "^5.0.0"
|
|
11
11
|
},
|
|
12
12
|
"module": "fesm2015/ngx-formly-bootstrap.mjs",
|
package/radio/radio.type.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
2
|
import { FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';
|
|
3
3
|
import { FieldType, FormlyFieldProps } from '@ngx-formly/bootstrap/form-field';
|
|
4
|
+
import { FormControl } from '@angular/forms';
|
|
4
5
|
import * as i0 from "@angular/core";
|
|
5
6
|
interface RadioProps extends FormlyFieldProps {
|
|
6
7
|
formCheck?: 'default' | 'inline';
|
|
@@ -14,6 +15,7 @@ export declare class FormlyFieldRadio extends FieldType<FieldTypeConfig<RadioPro
|
|
|
14
15
|
formCheck: "default";
|
|
15
16
|
};
|
|
16
17
|
};
|
|
18
|
+
get disabledControl(): FormControl;
|
|
17
19
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormlyFieldRadio, never>;
|
|
18
20
|
static ɵcmp: i0.ɵɵComponentDeclaration<FormlyFieldRadio, "formly-field-radio", never, {}, {}, never, never>;
|
|
19
21
|
}
|