@ngx-formly/bootstrap 7.1.0 → 9.0.0
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/README.md +26 -9
- package/addons/index.d.ts +39 -5
- package/checkbox/index.d.ts +38 -5
- package/fesm2022/ngx-formly-bootstrap-addons.mjs +8 -8
- package/fesm2022/ngx-formly-bootstrap-addons.mjs.map +1 -1
- package/fesm2022/ngx-formly-bootstrap-checkbox.mjs +25 -16
- package/fesm2022/ngx-formly-bootstrap-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-formly-bootstrap-form-field.mjs +64 -48
- package/fesm2022/ngx-formly-bootstrap-form-field.mjs.map +1 -1
- package/fesm2022/ngx-formly-bootstrap-input.mjs +37 -37
- package/fesm2022/ngx-formly-bootstrap-input.mjs.map +1 -1
- package/fesm2022/ngx-formly-bootstrap-multicheckbox.mjs +61 -58
- package/fesm2022/ngx-formly-bootstrap-multicheckbox.mjs.map +1 -1
- package/fesm2022/ngx-formly-bootstrap-radio.mjs +54 -57
- package/fesm2022/ngx-formly-bootstrap-radio.mjs.map +1 -1
- package/fesm2022/ngx-formly-bootstrap-select.mjs +8 -7
- package/fesm2022/ngx-formly-bootstrap-select.mjs.map +1 -1
- package/fesm2022/ngx-formly-bootstrap-textarea.mjs +8 -7
- package/fesm2022/ngx-formly-bootstrap-textarea.mjs.map +1 -1
- package/fesm2022/ngx-formly-bootstrap.mjs +4 -4
- package/form-field/index.d.ts +35 -5
- package/index.d.ts +20 -5
- package/input/index.d.ts +30 -5
- package/multicheckbox/index.d.ts +38 -5
- package/package.json +2 -20
- package/radio/index.d.ts +38 -5
- package/select/index.d.ts +38 -5
- package/textarea/index.d.ts +37 -5
- package/addons/addon.extension.d.ts +0 -2
- package/addons/addons.component.d.ts +0 -26
- package/addons/addons.config.d.ts +0 -2
- package/addons/addons.module.d.ts +0 -10
- package/addons/public_api.d.ts +0 -2
- package/checkbox/checkbox.config.d.ts +0 -2
- package/checkbox/checkbox.module.d.ts +0 -11
- package/checkbox/checkbox.type.d.ts +0 -23
- package/checkbox/public_api.d.ts +0 -3
- package/esm2022/addons/addon.extension.mjs +0 -9
- package/esm2022/addons/addons.component.mjs +0 -31
- package/esm2022/addons/addons.config.mjs +0 -9
- package/esm2022/addons/addons.module.mjs +0 -21
- package/esm2022/addons/ngx-formly-bootstrap-addons.mjs +0 -5
- package/esm2022/addons/public_api.mjs +0 -3
- package/esm2022/checkbox/checkbox.config.mjs +0 -17
- package/esm2022/checkbox/checkbox.module.mjs +0 -32
- package/esm2022/checkbox/checkbox.type.mjs +0 -81
- package/esm2022/checkbox/ngx-formly-bootstrap-checkbox.mjs +0 -5
- package/esm2022/checkbox/public_api.mjs +0 -4
- package/esm2022/form-field/field.type.mjs +0 -25
- package/esm2022/form-field/form-field.config.mjs +0 -12
- package/esm2022/form-field/form-field.module.mjs +0 -21
- package/esm2022/form-field/form-field.wrapper.mjs +0 -72
- package/esm2022/form-field/ngx-formly-bootstrap-form-field.mjs +0 -5
- package/esm2022/form-field/public_api.mjs +0 -4
- package/esm2022/input/input.config.mjs +0 -32
- package/esm2022/input/input.module.mjs +0 -32
- package/esm2022/input/input.type.mjs +0 -70
- package/esm2022/input/ngx-formly-bootstrap-input.mjs +0 -5
- package/esm2022/input/public_api.mjs +0 -4
- package/esm2022/lib/bootstrap.config.mjs +0 -21
- package/esm2022/lib/bootstrap.mjs +0 -3
- package/esm2022/lib/bootstrap.module.mjs +0 -45
- package/esm2022/multicheckbox/multicheckbox.config.mjs +0 -13
- package/esm2022/multicheckbox/multicheckbox.module.mjs +0 -36
- package/esm2022/multicheckbox/multicheckbox.type.mjs +0 -99
- package/esm2022/multicheckbox/ngx-formly-bootstrap-multicheckbox.mjs +0 -5
- package/esm2022/multicheckbox/public_api.mjs +0 -4
- package/esm2022/ngx-formly-bootstrap.mjs +0 -5
- package/esm2022/public_api.mjs +0 -5
- package/esm2022/radio/ngx-formly-bootstrap-radio.mjs +0 -5
- package/esm2022/radio/public_api.mjs +0 -4
- package/esm2022/radio/radio.config.mjs +0 -13
- package/esm2022/radio/radio.module.mjs +0 -36
- package/esm2022/radio/radio.type.mjs +0 -82
- package/esm2022/select/ngx-formly-bootstrap-select.mjs +0 -5
- package/esm2022/select/public_api.mjs +0 -4
- package/esm2022/select/select.config.mjs +0 -14
- package/esm2022/select/select.module.mjs +0 -36
- package/esm2022/select/select.type.mjs +0 -144
- package/esm2022/textarea/ngx-formly-bootstrap-textarea.mjs +0 -5
- package/esm2022/textarea/public_api.mjs +0 -4
- package/esm2022/textarea/textarea.config.mjs +0 -13
- package/esm2022/textarea/textarea.module.mjs +0 -32
- package/esm2022/textarea/textarea.type.mjs +0 -53
- package/form-field/field.type.d.ts +0 -10
- package/form-field/form-field.config.d.ts +0 -2
- package/form-field/form-field.module.d.ts +0 -10
- package/form-field/form-field.wrapper.d.ts +0 -11
- package/form-field/public_api.d.ts +0 -4
- package/input/input.config.d.ts +0 -2
- package/input/input.module.d.ts +0 -11
- package/input/input.type.d.ts +0 -15
- package/input/public_api.d.ts +0 -3
- package/lib/bootstrap.config.d.ts +0 -1
- package/lib/bootstrap.d.ts +0 -2
- package/lib/bootstrap.module.d.ts +0 -14
- package/multicheckbox/multicheckbox.config.d.ts +0 -2
- package/multicheckbox/multicheckbox.module.d.ts +0 -12
- package/multicheckbox/multicheckbox.type.d.ts +0 -22
- package/multicheckbox/public_api.d.ts +0 -3
- package/public_api.d.ts +0 -1
- package/radio/public_api.d.ts +0 -3
- package/radio/radio.config.d.ts +0 -2
- package/radio/radio.module.d.ts +0 -12
- package/radio/radio.type.d.ts +0 -22
- package/select/public_api.d.ts +0 -3
- package/select/select.config.d.ts +0 -2
- package/select/select.module.d.ts +0 -12
- package/select/select.type.d.ts +0 -22
- package/textarea/public_api.d.ts +0 -3
- package/textarea/textarea.config.d.ts +0 -2
- package/textarea/textarea.module.d.ts +0 -11
- package/textarea/textarea.type.d.ts +0 -22
|
@@ -1,31 +1,30 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
3
|
import { FieldType, FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';
|
|
4
|
-
import * as i1 from '@angular/
|
|
5
|
-
import { CommonModule } from '@angular/common';
|
|
6
|
-
import * as i2 from '@angular/forms';
|
|
4
|
+
import * as i1 from '@angular/forms';
|
|
7
5
|
import { ReactiveFormsModule } from '@angular/forms';
|
|
8
|
-
import * as
|
|
6
|
+
import * as i2 from '@ngx-formly/core';
|
|
9
7
|
import { FormlyModule } from '@ngx-formly/core';
|
|
8
|
+
import { CommonModule } from '@angular/common';
|
|
10
9
|
|
|
11
10
|
class FormlyFieldInput extends FieldType {
|
|
12
11
|
get type() {
|
|
13
12
|
return this.props.type || 'text';
|
|
14
13
|
}
|
|
15
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
16
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
14
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyFieldInput, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
15
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.33", type: FormlyFieldInput, isStandalone: false, selector: "formly-field-input", usesInheritance: true, ngImport: i0, template: `
|
|
17
16
|
<ng-template #fieldTypeTemplate>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
17
|
+
@if (type !== 'number') {
|
|
18
|
+
<input
|
|
19
|
+
[type]="type"
|
|
20
|
+
[formControl]="formControl"
|
|
21
|
+
class="form-control"
|
|
22
|
+
[formlyAttributes]="field"
|
|
23
|
+
[class.is-invalid]="showError"
|
|
24
|
+
[attr.aria-describedby]="id + '-formly-validation-error'"
|
|
25
|
+
[attr.aria-invalid]="showError"
|
|
26
|
+
/>
|
|
27
|
+
} @else {
|
|
29
28
|
<input
|
|
30
29
|
type="number"
|
|
31
30
|
[formControl]="formControl"
|
|
@@ -35,27 +34,27 @@ class FormlyFieldInput extends FieldType {
|
|
|
35
34
|
[attr.aria-describedby]="id + '-formly-validation-error'"
|
|
36
35
|
[attr.aria-invalid]="showError"
|
|
37
36
|
/>
|
|
38
|
-
|
|
37
|
+
}
|
|
39
38
|
</ng-template>
|
|
40
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.
|
|
39
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
41
40
|
}
|
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
41
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyFieldInput, decorators: [{
|
|
43
42
|
type: Component,
|
|
44
43
|
args: [{
|
|
45
44
|
selector: 'formly-field-input',
|
|
46
45
|
template: `
|
|
47
46
|
<ng-template #fieldTypeTemplate>
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
@if (type !== 'number') {
|
|
48
|
+
<input
|
|
49
|
+
[type]="type"
|
|
50
|
+
[formControl]="formControl"
|
|
51
|
+
class="form-control"
|
|
52
|
+
[formlyAttributes]="field"
|
|
53
|
+
[class.is-invalid]="showError"
|
|
54
|
+
[attr.aria-describedby]="id + '-formly-validation-error'"
|
|
55
|
+
[attr.aria-invalid]="showError"
|
|
56
|
+
/>
|
|
57
|
+
} @else {
|
|
59
58
|
<input
|
|
60
59
|
type="number"
|
|
61
60
|
[formControl]="formControl"
|
|
@@ -65,10 +64,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImpo
|
|
|
65
64
|
[attr.aria-describedby]="id + '-formly-validation-error'"
|
|
66
65
|
[attr.aria-invalid]="showError"
|
|
67
66
|
/>
|
|
68
|
-
|
|
67
|
+
}
|
|
69
68
|
</ng-template>
|
|
70
69
|
`,
|
|
71
70
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
71
|
+
standalone: false,
|
|
72
72
|
}]
|
|
73
73
|
}] });
|
|
74
74
|
|
|
@@ -104,16 +104,16 @@ function withFormlyFieldInput() {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
class FormlyBootstrapInputModule {
|
|
107
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
108
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
107
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyBootstrapInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
108
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.33", ngImport: i0, type: FormlyBootstrapInputModule, declarations: [FormlyFieldInput], imports: [CommonModule,
|
|
109
109
|
ReactiveFormsModule,
|
|
110
|
-
FormlyBootstrapFormFieldModule,
|
|
111
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
110
|
+
FormlyBootstrapFormFieldModule, i2.FormlyModule] }); }
|
|
111
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyBootstrapInputModule, imports: [CommonModule,
|
|
112
112
|
ReactiveFormsModule,
|
|
113
113
|
FormlyBootstrapFormFieldModule,
|
|
114
114
|
FormlyModule.forChild(withFormlyFieldInput())] }); }
|
|
115
115
|
}
|
|
116
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyBootstrapInputModule, decorators: [{
|
|
117
117
|
type: NgModule,
|
|
118
118
|
args: [{
|
|
119
119
|
declarations: [FormlyFieldInput],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-bootstrap-input.mjs","sources":["../../../../src/ui/bootstrap/input/src/input.type.ts","../../../../src/ui/bootstrap/input/src/input.config.ts","../../../../src/ui/bootstrap/input/src/input.module.ts","../../../../src/ui/bootstrap/input/src/ngx-formly-bootstrap-input.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 InputProps extends FormlyFieldProps {}\n\nexport interface FormlyInputFieldConfig extends FormlyFieldConfig<InputProps> {\n type: 'input' | Type<FormlyFieldInput>;\n}\n\n@Component({\n selector: 'formly-field-input',\n template: `\n <ng-template #fieldTypeTemplate>\n
|
|
1
|
+
{"version":3,"file":"ngx-formly-bootstrap-input.mjs","sources":["../../../../src/ui/bootstrap/input/src/input.type.ts","../../../../src/ui/bootstrap/input/src/input.config.ts","../../../../src/ui/bootstrap/input/src/input.module.ts","../../../../src/ui/bootstrap/input/src/ngx-formly-bootstrap-input.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 InputProps extends FormlyFieldProps {}\n\nexport interface FormlyInputFieldConfig extends FormlyFieldConfig<InputProps> {\n type: 'input' | Type<FormlyFieldInput>;\n}\n\n@Component({\n selector: 'formly-field-input',\n template: `\n <ng-template #fieldTypeTemplate>\n @if (type !== 'number') {\n <input\n [type]=\"type\"\n [formControl]=\"formControl\"\n class=\"form-control\"\n [formlyAttributes]=\"field\"\n [class.is-invalid]=\"showError\"\n [attr.aria-describedby]=\"id + '-formly-validation-error'\"\n [attr.aria-invalid]=\"showError\"\n />\n } @else {\n <input\n type=\"number\"\n [formControl]=\"formControl\"\n class=\"form-control\"\n [formlyAttributes]=\"field\"\n [class.is-invalid]=\"showError\"\n [attr.aria-describedby]=\"id + '-formly-validation-error'\"\n [attr.aria-invalid]=\"showError\"\n />\n }\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n})\nexport class FormlyFieldInput extends FieldType<FieldTypeConfig<InputProps>> {\n get type() {\n return this.props.type || 'text';\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldInput } from './input.type';\n\nexport function withFormlyFieldInput(): ConfigOption {\n return {\n types: [\n {\n name: 'input',\n component: FormlyFieldInput,\n wrappers: ['form-field'],\n },\n { name: 'string', extends: 'input' },\n {\n name: 'number',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n {\n name: 'integer',\n extends: 'input',\n defaultOptions: {\n props: {\n type: 'number',\n },\n },\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\n\nimport { FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';\n\nimport { FormlyFieldInput } from './input.type';\nimport { withFormlyFieldInput } from './input.config';\n\n@NgModule({\n declarations: [FormlyFieldInput],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n FormlyBootstrapFormFieldModule,\n FormlyModule.forChild(withFormlyFieldInput()),\n ],\n})\nexport class FormlyBootstrapInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;AAwCM,MAAO,gBAAiB,SAAQ,SAAsC,CAAA;AAC1E,IAAA,IAAI,IAAI,GAAA;AACN,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,MAAM;IAClC;+GAHW,gBAAgB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAhB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,gBAAgB,EAAA,YAAA,EAAA,KAAA,EAAA,QAAA,EAAA,oBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EA5BjB;;;;;;;;;;;;;;;;;;;;;;;;AAwBT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,oBAAA,EAAA,QAAA,EAAA,8MAAA,EAAA,EAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EAAA,EAAA,CAAA,mBAAA,EAAA,QAAA,EAAA,iGAAA,EAAA,EAAA,EAAA,IA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EAAE,SAAS;AACf,gBAAA,OAAO,EAAE,OAAO;AAChB,gBAAA,cAAc,EAAE;AACd,oBAAA,KAAK,EAAE;AACL,wBAAA,IAAI,EAAE,QAAQ;AACf,qBAAA;AACF,iBAAA;AACF,aAAA;AACF,SAAA;KACF;AACH;;MCZa,0BAA0B,CAAA;+GAA1B,0BAA0B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;gHAA1B,0BAA0B,EAAA,YAAA,EAAA,CATtB,gBAAgB,CAAA,EAAA,OAAA,EAAA,CAE7B,YAAY;YACZ,mBAAmB;YAEnB,8BAA8B,EAAAA,EAAA,CAAA,YAAA,CAAA,EAAA,CAAA,CAAA;AAIrB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,0BAA0B,YAPnC,YAAY;YACZ,mBAAmB;YAEnB,8BAA8B;AAC9B,YAAA,YAAY,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC,CAAA,EAAA,CAAA,CAAA;;4FAGpC,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAVtC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,gBAAgB,CAAC;AAChC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBAEnB,8BAA8B;AAC9B,wBAAA,YAAY,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC;AAC9C,qBAAA;AACF,iBAAA;;;ACnBD;;AAEG;;;;"}
|
|
@@ -34,71 +34,74 @@ class FormlyFieldMultiCheckbox extends FieldType {
|
|
|
34
34
|
const value = this.formControl.value;
|
|
35
35
|
return value && (this.props.type === 'array' ? value.indexOf(option.value) !== -1 : value[option.value]);
|
|
36
36
|
}
|
|
37
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
38
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
37
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyFieldMultiCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
38
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.33", type: FormlyFieldMultiCheckbox, isStandalone: false, selector: "formly-field-multicheckbox", usesInheritance: true, ngImport: i0, template: `
|
|
39
39
|
<ng-template #fieldTypeTemplate>
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
40
|
+
@for (option of props.options | formlySelectOptions: field | async; track option; let i = $index) {
|
|
41
|
+
<div
|
|
42
|
+
class="form-check"
|
|
43
|
+
[ngClass]="{
|
|
44
|
+
'form-check-inline': props.formCheck === 'inline' || props.formCheck === 'inline-switch',
|
|
45
|
+
'form-switch': props.formCheck === 'switch' || props.formCheck === 'inline-switch',
|
|
46
|
+
}"
|
|
47
|
+
>
|
|
48
|
+
<input
|
|
49
|
+
type="checkbox"
|
|
50
|
+
[id]="id + '_' + i"
|
|
51
|
+
class="form-check-input"
|
|
52
|
+
[class.is-invalid]="showError"
|
|
53
|
+
[value]="option.value"
|
|
54
|
+
[checked]="isChecked(option)"
|
|
55
|
+
[formlyAttributes]="field"
|
|
56
|
+
[disabled]="formControl.disabled || option.disabled"
|
|
57
|
+
[attr.aria-describedby]="id + '-formly-validation-error'"
|
|
58
|
+
[attr.aria-invalid]="showError"
|
|
59
|
+
(change)="onChange(option.value, $any($event.target).checked)"
|
|
60
|
+
/>
|
|
61
|
+
<label class="form-check-label" [for]="id + '_' + i">
|
|
62
|
+
{{ option.label }}
|
|
63
|
+
</label>
|
|
64
|
+
</div>
|
|
65
|
+
}
|
|
65
66
|
</ng-template>
|
|
66
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type:
|
|
67
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.LegacyFormlyAttributes, selector: "[formlyAttributes]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i3.LegacyFormlySelectOptionsPipe, name: "formlySelectOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
67
68
|
}
|
|
68
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyFieldMultiCheckbox, decorators: [{
|
|
69
70
|
type: Component,
|
|
70
71
|
args: [{
|
|
71
72
|
selector: 'formly-field-multicheckbox',
|
|
72
73
|
template: `
|
|
73
74
|
<ng-template #fieldTypeTemplate>
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
75
|
+
@for (option of props.options | formlySelectOptions: field | async; track option; let i = $index) {
|
|
76
|
+
<div
|
|
77
|
+
class="form-check"
|
|
78
|
+
[ngClass]="{
|
|
79
|
+
'form-check-inline': props.formCheck === 'inline' || props.formCheck === 'inline-switch',
|
|
80
|
+
'form-switch': props.formCheck === 'switch' || props.formCheck === 'inline-switch',
|
|
81
|
+
}"
|
|
82
|
+
>
|
|
83
|
+
<input
|
|
84
|
+
type="checkbox"
|
|
85
|
+
[id]="id + '_' + i"
|
|
86
|
+
class="form-check-input"
|
|
87
|
+
[class.is-invalid]="showError"
|
|
88
|
+
[value]="option.value"
|
|
89
|
+
[checked]="isChecked(option)"
|
|
90
|
+
[formlyAttributes]="field"
|
|
91
|
+
[disabled]="formControl.disabled || option.disabled"
|
|
92
|
+
[attr.aria-describedby]="id + '-formly-validation-error'"
|
|
93
|
+
[attr.aria-invalid]="showError"
|
|
94
|
+
(change)="onChange(option.value, $any($event.target).checked)"
|
|
95
|
+
/>
|
|
96
|
+
<label class="form-check-label" [for]="id + '_' + i">
|
|
97
|
+
{{ option.label }}
|
|
98
|
+
</label>
|
|
99
|
+
</div>
|
|
100
|
+
}
|
|
99
101
|
</ng-template>
|
|
100
102
|
`,
|
|
101
103
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
104
|
+
standalone: false,
|
|
102
105
|
}]
|
|
103
106
|
}] });
|
|
104
107
|
|
|
@@ -115,18 +118,18 @@ function withFormlyFieldMultiCheckbox() {
|
|
|
115
118
|
}
|
|
116
119
|
|
|
117
120
|
class FormlyBootstrapMultiCheckboxModule {
|
|
118
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
119
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
121
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyBootstrapMultiCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
122
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.33", ngImport: i0, type: FormlyBootstrapMultiCheckboxModule, declarations: [FormlyFieldMultiCheckbox], imports: [CommonModule,
|
|
120
123
|
ReactiveFormsModule,
|
|
121
124
|
FormlyBootstrapFormFieldModule,
|
|
122
125
|
FormlySelectModule, i2.FormlyModule] }); }
|
|
123
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
126
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyBootstrapMultiCheckboxModule, imports: [CommonModule,
|
|
124
127
|
ReactiveFormsModule,
|
|
125
128
|
FormlyBootstrapFormFieldModule,
|
|
126
129
|
FormlySelectModule,
|
|
127
130
|
FormlyModule.forChild(withFormlyFieldMultiCheckbox())] }); }
|
|
128
131
|
}
|
|
129
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
132
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyBootstrapMultiCheckboxModule, decorators: [{
|
|
130
133
|
type: NgModule,
|
|
131
134
|
args: [{
|
|
132
135
|
declarations: [FormlyFieldMultiCheckbox],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-bootstrap-multicheckbox.mjs","sources":["../../../../src/ui/bootstrap/multicheckbox/src/multicheckbox.type.ts","../../../../src/ui/bootstrap/multicheckbox/src/multicheckbox.config.ts","../../../../src/ui/bootstrap/multicheckbox/src/multicheckbox.module.ts","../../../../src/ui/bootstrap/multicheckbox/src/ngx-formly-bootstrap-multicheckbox.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 MultiCheckboxProps extends FormlyFieldProps {\n formCheck?: 'default' | 'inline' | 'switch' | 'inline-switch';\n}\n\nexport interface FormlyMultiCheckboxFieldConfig extends FormlyFieldConfig<MultiCheckboxProps> {\n type: 'multicheckbox' | Type<FormlyFieldMultiCheckbox>;\n}\n\n@Component({\n selector: 'formly-field-multicheckbox',\n template: `\n <ng-template #fieldTypeTemplate>\n
|
|
1
|
+
{"version":3,"file":"ngx-formly-bootstrap-multicheckbox.mjs","sources":["../../../../src/ui/bootstrap/multicheckbox/src/multicheckbox.type.ts","../../../../src/ui/bootstrap/multicheckbox/src/multicheckbox.config.ts","../../../../src/ui/bootstrap/multicheckbox/src/multicheckbox.module.ts","../../../../src/ui/bootstrap/multicheckbox/src/ngx-formly-bootstrap-multicheckbox.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 MultiCheckboxProps extends FormlyFieldProps {\n formCheck?: 'default' | 'inline' | 'switch' | 'inline-switch';\n}\n\nexport interface FormlyMultiCheckboxFieldConfig extends FormlyFieldConfig<MultiCheckboxProps> {\n type: 'multicheckbox' | Type<FormlyFieldMultiCheckbox>;\n}\n\n@Component({\n selector: 'formly-field-multicheckbox',\n template: `\n <ng-template #fieldTypeTemplate>\n @for (option of props.options | formlySelectOptions: field | async; track option; let i = $index) {\n <div\n class=\"form-check\"\n [ngClass]=\"{\n 'form-check-inline': props.formCheck === 'inline' || props.formCheck === 'inline-switch',\n 'form-switch': props.formCheck === 'switch' || props.formCheck === 'inline-switch',\n }\"\n >\n <input\n type=\"checkbox\"\n [id]=\"id + '_' + i\"\n class=\"form-check-input\"\n [class.is-invalid]=\"showError\"\n [value]=\"option.value\"\n [checked]=\"isChecked(option)\"\n [formlyAttributes]=\"field\"\n [disabled]=\"formControl.disabled || option.disabled\"\n [attr.aria-describedby]=\"id + '-formly-validation-error'\"\n [attr.aria-invalid]=\"showError\"\n (change)=\"onChange(option.value, $any($event.target).checked)\"\n />\n <label class=\"form-check-label\" [for]=\"id + '_' + i\">\n {{ option.label }}\n </label>\n </div>\n }\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n})\nexport class FormlyFieldMultiCheckbox extends FieldType<FieldTypeConfig<MultiCheckboxProps>> {\n override defaultOptions = {\n props: {\n formCheck: 'default' as const, // 'default' | 'inline' | 'switch' | 'inline-switch'\n },\n };\n\n onChange(value: any, checked: boolean) {\n this.formControl.markAsDirty();\n if (this.props.type === 'array') {\n this.formControl.patchValue(\n checked\n ? [...(this.formControl.value || []), value]\n : [...(this.formControl.value || [])].filter((o) => o !== value),\n );\n } else {\n this.formControl.patchValue({ ...this.formControl.value, [value]: checked });\n }\n this.formControl.markAsTouched();\n }\n\n isChecked(option: any) {\n const value = this.formControl.value;\n\n return value && (this.props.type === 'array' ? value.indexOf(option.value) !== -1 : value[option.value]);\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldMultiCheckbox } from './multicheckbox.type';\n\nexport function withFormlyFieldMultiCheckbox(): ConfigOption {\n return {\n types: [\n {\n name: 'multicheckbox',\n component: FormlyFieldMultiCheckbox,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { FormlySelectModule } from '@ngx-formly/core/select';\nimport { FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';\n\nimport { FormlyFieldMultiCheckbox } from './multicheckbox.type';\nimport { withFormlyFieldMultiCheckbox } from './multicheckbox.config';\n\n@NgModule({\n declarations: [FormlyFieldMultiCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n FormlyBootstrapFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild(withFormlyFieldMultiCheckbox()),\n ],\n})\nexport class FormlyBootstrapMultiCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;;AA+CM,MAAO,wBAAyB,SAAQ,SAA8C,CAAA;AAnC5F,IAAA,WAAA,GAAA;;AAoCW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;gBACL,SAAS,EAAE,SAAkB;AAC9B,aAAA;SACF;AAqBF,IAAA;IAnBC,QAAQ,CAAC,KAAU,EAAE,OAAgB,EAAA;AACnC,QAAA,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE;QAC9B,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,EAAE;AAC/B,YAAA,IAAI,CAAC,WAAW,CAAC,UAAU,CACzB;AACE,kBAAE,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,KAAK;kBACzC,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,CACnE;QACH;aAAO;YACL,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,EAAE,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,KAAK,GAAG,OAAO,EAAE,CAAC;QAC9E;AACA,QAAA,IAAI,CAAC,WAAW,CAAC,aAAa,EAAE;IAClC;AAEA,IAAA,SAAS,CAAC,MAAW,EAAA;AACnB,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,KAAK;AAEpC,QAAA,OAAO,KAAK,KAAK,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,KA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
import * as i0 from '@angular/core';
|
|
2
2
|
import { ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
|
|
3
3
|
import { FieldType, FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';
|
|
4
|
-
import * as
|
|
4
|
+
import * as i1 from '@angular/forms';
|
|
5
5
|
import { UntypedFormControl, ReactiveFormsModule } from '@angular/forms';
|
|
6
|
-
import * as
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
8
|
-
import * as i3 from '@ngx-formly/core';
|
|
6
|
+
import * as i2 from '@ngx-formly/core';
|
|
9
7
|
import { FormlyModule } from '@ngx-formly/core';
|
|
8
|
+
import * as i3 from '@angular/common';
|
|
9
|
+
import { CommonModule } from '@angular/common';
|
|
10
10
|
import * as i4 from '@ngx-formly/core/select';
|
|
11
11
|
import { FormlySelectModule } from '@ngx-formly/core/select';
|
|
12
12
|
|
|
@@ -22,65 +22,62 @@ class FormlyFieldRadio extends FieldType {
|
|
|
22
22
|
get disabledControl() {
|
|
23
23
|
return new UntypedFormControl({ value: this.formControl.value, disabled: true });
|
|
24
24
|
}
|
|
25
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
26
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
25
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyFieldRadio, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
|
26
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.33", type: FormlyFieldRadio, isStandalone: false, selector: "formly-field-radio", usesInheritance: true, ngImport: i0, template: `
|
|
27
27
|
<ng-template #fieldTypeTemplate>
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
[
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</label>
|
|
49
|
-
</div>
|
|
28
|
+
@for (option of props.options | formlySelectOptions: field | async; track option; let i = $index) {
|
|
29
|
+
<div class="form-check" [class.form-check-inline]="props.formCheck === 'inline'">
|
|
30
|
+
<input
|
|
31
|
+
type="radio"
|
|
32
|
+
[id]="id + '_' + i"
|
|
33
|
+
class="form-check-input"
|
|
34
|
+
[name]="field.name || id"
|
|
35
|
+
[class.is-invalid]="showError"
|
|
36
|
+
[attr.value]="option.value"
|
|
37
|
+
[value]="option.value"
|
|
38
|
+
[formControl]="option.disabled ? disabledControl : formControl"
|
|
39
|
+
[formlyAttributes]="field"
|
|
40
|
+
[attr.aria-describedby]="id + '-formly-validation-error'"
|
|
41
|
+
[attr.aria-invalid]="showError"
|
|
42
|
+
/>
|
|
43
|
+
<label class="form-check-label" [for]="id + '_' + i">
|
|
44
|
+
{{ option.label }}
|
|
45
|
+
</label>
|
|
46
|
+
</div>
|
|
47
|
+
}
|
|
50
48
|
</ng-template>
|
|
51
|
-
`, isInline: true, dependencies: [{ kind: "directive", type: i1.
|
|
49
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.LegacyFormlyAttributes, selector: "[formlyAttributes]" }, { kind: "pipe", type: i3.AsyncPipe, name: "async" }, { kind: "pipe", type: i4.LegacyFormlySelectOptionsPipe, name: "formlySelectOptions" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
52
50
|
}
|
|
53
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyFieldRadio, decorators: [{
|
|
54
52
|
type: Component,
|
|
55
53
|
args: [{
|
|
56
54
|
selector: 'formly-field-radio',
|
|
57
55
|
template: `
|
|
58
56
|
<ng-template #fieldTypeTemplate>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
[
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
</label>
|
|
80
|
-
</div>
|
|
57
|
+
@for (option of props.options | formlySelectOptions: field | async; track option; let i = $index) {
|
|
58
|
+
<div class="form-check" [class.form-check-inline]="props.formCheck === 'inline'">
|
|
59
|
+
<input
|
|
60
|
+
type="radio"
|
|
61
|
+
[id]="id + '_' + i"
|
|
62
|
+
class="form-check-input"
|
|
63
|
+
[name]="field.name || id"
|
|
64
|
+
[class.is-invalid]="showError"
|
|
65
|
+
[attr.value]="option.value"
|
|
66
|
+
[value]="option.value"
|
|
67
|
+
[formControl]="option.disabled ? disabledControl : formControl"
|
|
68
|
+
[formlyAttributes]="field"
|
|
69
|
+
[attr.aria-describedby]="id + '-formly-validation-error'"
|
|
70
|
+
[attr.aria-invalid]="showError"
|
|
71
|
+
/>
|
|
72
|
+
<label class="form-check-label" [for]="id + '_' + i">
|
|
73
|
+
{{ option.label }}
|
|
74
|
+
</label>
|
|
75
|
+
</div>
|
|
76
|
+
}
|
|
81
77
|
</ng-template>
|
|
82
78
|
`,
|
|
83
79
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
80
|
+
standalone: false,
|
|
84
81
|
}]
|
|
85
82
|
}] });
|
|
86
83
|
|
|
@@ -97,18 +94,18 @@ function withFormlyFieldRadio() {
|
|
|
97
94
|
}
|
|
98
95
|
|
|
99
96
|
class FormlyBootstrapRadioModule {
|
|
100
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
101
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "
|
|
97
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyBootstrapRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
98
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.33", ngImport: i0, type: FormlyBootstrapRadioModule, declarations: [FormlyFieldRadio], imports: [CommonModule,
|
|
102
99
|
ReactiveFormsModule,
|
|
103
100
|
FormlyBootstrapFormFieldModule,
|
|
104
|
-
FormlySelectModule,
|
|
105
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "
|
|
101
|
+
FormlySelectModule, i2.FormlyModule] }); }
|
|
102
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyBootstrapRadioModule, imports: [CommonModule,
|
|
106
103
|
ReactiveFormsModule,
|
|
107
104
|
FormlyBootstrapFormFieldModule,
|
|
108
105
|
FormlySelectModule,
|
|
109
106
|
FormlyModule.forChild(withFormlyFieldRadio())] }); }
|
|
110
107
|
}
|
|
111
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
108
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.33", ngImport: i0, type: FormlyBootstrapRadioModule, decorators: [{
|
|
112
109
|
type: NgModule,
|
|
113
110
|
args: [{
|
|
114
111
|
declarations: [FormlyFieldRadio],
|
|
@@ -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.config.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 { UntypedFormControl } 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
|
|
1
|
+
{"version":3,"file":"ngx-formly-bootstrap-radio.mjs","sources":["../../../../src/ui/bootstrap/radio/src/radio.type.ts","../../../../src/ui/bootstrap/radio/src/radio.config.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 { UntypedFormControl } 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 @for (option of props.options | formlySelectOptions: field | async; track option; let i = $index) {\n <div class=\"form-check\" [class.form-check-inline]=\"props.formCheck === 'inline'\">\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 [attr.aria-describedby]=\"id + '-formly-validation-error'\"\n [attr.aria-invalid]=\"showError\"\n />\n <label class=\"form-check-label\" [for]=\"id + '_' + i\">\n {{ option.label }}\n </label>\n </div>\n }\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\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 UntypedFormControl({ value: this.formControl.value, disabled: true });\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldRadio } from './radio.type';\n\nexport function withFormlyFieldRadio(): ConfigOption {\n return {\n types: [\n {\n name: 'radio',\n component: FormlyFieldRadio,\n wrappers: ['form-field'],\n },\n ],\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';\nimport { withFormlyFieldRadio } from './radio.config';\n\n@NgModule({\n declarations: [FormlyFieldRadio],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n FormlyBootstrapFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild(withFormlyFieldRadio()),\n ],\n})\nexport class FormlyBootstr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