@ngx-formly/bootstrap 5.10.24 → 6.0.0-next.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/README.md +4 -2
- package/addons/addons.component.d.ts +3 -0
- package/addons/addons.module.d.ts +8 -0
- package/addons/ngx-formly-bootstrap-addons.d.ts +1 -2
- package/addons/package.json +6 -9
- package/checkbox/checkbox.module.d.ts +11 -0
- package/{lib/types/checkbox.d.ts → checkbox/checkbox.type.d.ts} +3 -0
- package/checkbox/ngx-formly-bootstrap-checkbox.d.ts +5 -0
- package/checkbox/package.json +10 -0
- package/checkbox/public_api.d.ts +2 -0
- package/esm2020/addons/addon.extension.mjs +9 -0
- package/esm2020/addons/addons.component.mjs +19 -0
- package/esm2020/addons/addons.module.mjs +36 -0
- package/esm2020/addons/ngx-formly-bootstrap-addons.mjs +5 -0
- package/esm2020/addons/public_api.mjs +2 -0
- package/esm2020/checkbox/checkbox.module.mjs +57 -0
- package/esm2020/checkbox/checkbox.type.mjs +73 -0
- package/esm2020/checkbox/ngx-formly-bootstrap-checkbox.mjs +5 -0
- package/esm2020/checkbox/public_api.mjs +3 -0
- package/esm2020/form-field/form-field.module.mjs +43 -0
- package/esm2020/form-field/form-field.wrapper.mjs +48 -0
- package/esm2020/form-field/ngx-formly-bootstrap-form-field.mjs +5 -0
- package/esm2020/form-field/public_api.mjs +2 -0
- package/esm2020/input/input.module.mjs +87 -0
- package/esm2020/input/input.type.mjs +58 -0
- package/esm2020/input/ngx-formly-bootstrap-input.mjs +5 -0
- package/esm2020/input/public_api.mjs +3 -0
- package/esm2020/lib/bootstrap.mjs +2 -0
- package/esm2020/lib/bootstrap.module.mjs +47 -0
- package/esm2020/multicheckbox/multicheckbox.module.mjs +53 -0
- package/esm2020/multicheckbox/multicheckbox.type.mjs +87 -0
- package/esm2020/multicheckbox/ngx-formly-bootstrap-multicheckbox.mjs +5 -0
- package/esm2020/multicheckbox/public_api.mjs +3 -0
- package/esm2020/ngx-formly-bootstrap.mjs +5 -0
- package/esm2020/public_api.mjs +5 -0
- package/esm2020/radio/ngx-formly-bootstrap-radio.mjs +5 -0
- package/esm2020/radio/public_api.mjs +3 -0
- package/esm2020/radio/radio.module.mjs +53 -0
- package/esm2020/radio/radio.type.mjs +73 -0
- package/esm2020/select/ngx-formly-bootstrap-select.mjs +5 -0
- package/esm2020/select/public_api.mjs +3 -0
- package/esm2020/select/select.module.mjs +55 -0
- package/esm2020/select/select.type.mjs +200 -0
- package/esm2020/textarea/ngx-formly-bootstrap-textarea.mjs +5 -0
- package/esm2020/textarea/public_api.mjs +3 -0
- package/esm2020/textarea/textarea.module.mjs +49 -0
- package/esm2020/textarea/textarea.type.mjs +47 -0
- package/fesm2015/ngx-formly-bootstrap-addons.mjs +68 -0
- package/fesm2015/ngx-formly-bootstrap-addons.mjs.map +1 -0
- package/fesm2015/ngx-formly-bootstrap-checkbox.mjs +132 -0
- package/fesm2015/ngx-formly-bootstrap-checkbox.mjs.map +1 -0
- package/fesm2015/ngx-formly-bootstrap-form-field.mjs +93 -0
- package/fesm2015/ngx-formly-bootstrap-form-field.mjs.map +1 -0
- package/fesm2015/ngx-formly-bootstrap-input.mjs +147 -0
- package/fesm2015/ngx-formly-bootstrap-input.mjs.map +1 -0
- package/fesm2015/ngx-formly-bootstrap-multicheckbox.mjs +142 -0
- package/fesm2015/ngx-formly-bootstrap-multicheckbox.mjs.map +1 -0
- package/fesm2015/ngx-formly-bootstrap-radio.mjs +128 -0
- package/fesm2015/ngx-formly-bootstrap-radio.mjs.map +1 -0
- package/fesm2015/ngx-formly-bootstrap-select.mjs +256 -0
- package/fesm2015/ngx-formly-bootstrap-select.mjs.map +1 -0
- package/fesm2015/ngx-formly-bootstrap-textarea.mjs +98 -0
- package/fesm2015/ngx-formly-bootstrap-textarea.mjs.map +1 -0
- package/fesm2015/ngx-formly-bootstrap.mjs +58 -0
- package/fesm2015/ngx-formly-bootstrap.mjs.map +1 -0
- package/fesm2020/ngx-formly-bootstrap-addons.mjs +66 -0
- package/fesm2020/ngx-formly-bootstrap-addons.mjs.map +1 -0
- package/fesm2020/ngx-formly-bootstrap-checkbox.mjs +132 -0
- package/fesm2020/ngx-formly-bootstrap-checkbox.mjs.map +1 -0
- package/fesm2020/ngx-formly-bootstrap-form-field.mjs +93 -0
- package/fesm2020/ngx-formly-bootstrap-form-field.mjs.map +1 -0
- package/fesm2020/ngx-formly-bootstrap-input.mjs +147 -0
- package/fesm2020/ngx-formly-bootstrap-input.mjs.map +1 -0
- package/fesm2020/ngx-formly-bootstrap-multicheckbox.mjs +142 -0
- package/fesm2020/ngx-formly-bootstrap-multicheckbox.mjs.map +1 -0
- package/fesm2020/ngx-formly-bootstrap-radio.mjs +128 -0
- package/fesm2020/ngx-formly-bootstrap-radio.mjs.map +1 -0
- package/fesm2020/ngx-formly-bootstrap-select.mjs +256 -0
- package/fesm2020/ngx-formly-bootstrap-select.mjs.map +1 -0
- package/fesm2020/ngx-formly-bootstrap-textarea.mjs +98 -0
- package/fesm2020/ngx-formly-bootstrap-textarea.mjs.map +1 -0
- package/fesm2020/ngx-formly-bootstrap.mjs +58 -0
- package/fesm2020/ngx-formly-bootstrap.mjs.map +1 -0
- package/form-field/form-field.module.d.ts +10 -0
- package/form-field/form-field.wrapper.d.ts +6 -0
- package/form-field/ngx-formly-bootstrap-form-field.d.ts +5 -0
- package/form-field/package.json +10 -0
- package/form-field/public_api.d.ts +1 -0
- package/input/input.module.d.ts +11 -0
- package/input/input.type.d.ts +7 -0
- package/input/ngx-formly-bootstrap-input.d.ts +5 -0
- package/input/package.json +10 -0
- package/input/public_api.d.ts +2 -0
- package/lib/bootstrap.d.ts +0 -2
- package/lib/bootstrap.module.d.ts +12 -0
- package/multicheckbox/multicheckbox.module.d.ts +12 -0
- package/{lib/types/multicheckbox.d.ts → multicheckbox/multicheckbox.type.d.ts} +3 -0
- package/multicheckbox/ngx-formly-bootstrap-multicheckbox.d.ts +5 -0
- package/multicheckbox/package.json +10 -0
- package/multicheckbox/public_api.d.ts +2 -0
- package/ngx-formly-bootstrap.d.ts +1 -1
- package/package.json +94 -33
- package/radio/ngx-formly-bootstrap-radio.d.ts +5 -0
- package/radio/package.json +10 -0
- package/radio/public_api.d.ts +2 -0
- package/radio/radio.module.d.ts +12 -0
- package/{lib/types/radio.d.ts → radio/radio.type.d.ts} +3 -0
- package/select/ngx-formly-bootstrap-select.d.ts +5 -0
- package/select/package.json +10 -0
- package/select/public_api.d.ts +2 -0
- package/select/select.module.d.ts +12 -0
- package/{lib/types/select.d.ts → select/select.type.d.ts} +7 -1
- package/textarea/ngx-formly-bootstrap-textarea.d.ts +5 -0
- package/textarea/package.json +10 -0
- package/textarea/public_api.d.ts +2 -0
- package/textarea/textarea.module.d.ts +11 -0
- package/textarea/textarea.type.d.ts +12 -0
- package/addons/ngx-formly-bootstrap-addons.metadata.json +0 -1
- package/bundles/ngx-formly-bootstrap-addons.umd.js +0 -172
- package/bundles/ngx-formly-bootstrap-addons.umd.js.map +0 -1
- package/bundles/ngx-formly-bootstrap-addons.umd.min.js +0 -2
- package/bundles/ngx-formly-bootstrap-addons.umd.min.js.map +0 -1
- package/bundles/ngx-formly-bootstrap.umd.js +0 -460
- package/bundles/ngx-formly-bootstrap.umd.js.map +0 -1
- package/bundles/ngx-formly-bootstrap.umd.min.js +0 -2
- package/bundles/ngx-formly-bootstrap.umd.min.js.map +0 -1
- package/esm2015/addons/addon.extension.js +0 -17
- package/esm2015/addons/addons.component.js +0 -34
- package/esm2015/addons/addons.module.js +0 -30
- package/esm2015/addons/ngx-formly-bootstrap-addons.js +0 -11
- package/esm2015/addons/public_api.js +0 -6
- package/esm2015/lib/bootstrap.config.js +0 -57
- package/esm2015/lib/bootstrap.js +0 -8
- package/esm2015/lib/bootstrap.module.js +0 -28
- package/esm2015/lib/types/checkbox.js +0 -55
- package/esm2015/lib/types/input.js +0 -26
- package/esm2015/lib/types/multicheckbox.js +0 -87
- package/esm2015/lib/types/radio.js +0 -57
- package/esm2015/lib/types/select.js +0 -146
- package/esm2015/lib/types/textarea.js +0 -33
- package/esm2015/lib/types/types.js +0 -11
- package/esm2015/lib/wrappers/form-field.wrapper.js +0 -30
- package/esm2015/lib/wrappers/wrappers.js +0 -6
- package/esm2015/ngx-formly-bootstrap.js +0 -10
- package/esm2015/public_api.js +0 -9
- package/esm5/addons/addon.extension.js +0 -18
- package/esm5/addons/addons.component.js +0 -49
- package/esm5/addons/addons.module.js +0 -34
- package/esm5/addons/ngx-formly-bootstrap-addons.js +0 -11
- package/esm5/addons/public_api.js +0 -6
- package/esm5/lib/bootstrap.config.js +0 -57
- package/esm5/lib/bootstrap.js +0 -8
- package/esm5/lib/bootstrap.module.js +0 -32
- package/esm5/lib/types/checkbox.js +0 -34
- package/esm5/lib/types/input.js +0 -32
- package/esm5/lib/types/multicheckbox.js +0 -73
- package/esm5/lib/types/radio.js +0 -33
- package/esm5/lib/types/select.js +0 -95
- package/esm5/lib/types/textarea.js +0 -33
- package/esm5/lib/types/types.js +0 -11
- package/esm5/lib/wrappers/form-field.wrapper.js +0 -22
- package/esm5/lib/wrappers/wrappers.js +0 -6
- package/esm5/ngx-formly-bootstrap.js +0 -10
- package/esm5/public_api.js +0 -9
- package/fesm2015/ngx-formly-bootstrap-addons.js +0 -91
- package/fesm2015/ngx-formly-bootstrap-addons.js.map +0 -1
- package/fesm2015/ngx-formly-bootstrap.js +0 -505
- package/fesm2015/ngx-formly-bootstrap.js.map +0 -1
- package/fesm5/ngx-formly-bootstrap-addons.js +0 -108
- package/fesm5/ngx-formly-bootstrap-addons.js.map +0 -1
- package/fesm5/ngx-formly-bootstrap.js +0 -383
- package/fesm5/ngx-formly-bootstrap.js.map +0 -1
- package/lib/bootstrap.config.d.ts +0 -5
- package/lib/types/input.d.ts +0 -4
- package/lib/types/textarea.d.ts +0 -9
- package/lib/types/types.d.ts +0 -6
- package/lib/wrappers/form-field.wrapper.d.ts +0 -3
- package/lib/wrappers/wrappers.d.ts +0 -1
- package/ngx-formly-bootstrap.metadata.json +0 -1
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i3 from '@ngx-formly/core';
|
|
6
|
+
import { FieldType, FormlyModule } from '@ngx-formly/core';
|
|
7
|
+
import * as i2 from '@angular/forms';
|
|
8
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
9
|
+
import { FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';
|
|
10
|
+
|
|
11
|
+
class FormlyFieldCheckbox extends FieldType {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.defaultOptions = {
|
|
15
|
+
templateOptions: {
|
|
16
|
+
indeterminate: true,
|
|
17
|
+
hideLabel: true,
|
|
18
|
+
formCheck: 'default', // 'default' | 'inline' | 'switch' | 'inline-switch' | 'nolabel'
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
FormlyFieldCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyFieldCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
24
|
+
FormlyFieldCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: FormlyFieldCheckbox, selector: "formly-field-checkbox", usesInheritance: true, ngImport: i0, template: `
|
|
25
|
+
<div
|
|
26
|
+
class="form-check"
|
|
27
|
+
[ngClass]="{
|
|
28
|
+
'form-check-inline': to.formCheck === 'inline' || to.formCheck === 'inline-switch',
|
|
29
|
+
'form-switch': to.formCheck === 'switch' || to.formCheck === 'inline-switch'
|
|
30
|
+
}"
|
|
31
|
+
>
|
|
32
|
+
<input
|
|
33
|
+
type="checkbox"
|
|
34
|
+
[class.is-invalid]="showError"
|
|
35
|
+
class="form-check-input"
|
|
36
|
+
[class.position-static]="to.formCheck === 'nolabel'"
|
|
37
|
+
[indeterminate]="to.indeterminate && formControl.value == null"
|
|
38
|
+
[formControl]="formControl"
|
|
39
|
+
[formlyAttributes]="field"
|
|
40
|
+
/>
|
|
41
|
+
<label *ngIf="to.formCheck !== 'nolabel'" [for]="id" class="form-check-label">
|
|
42
|
+
{{ to.label }}
|
|
43
|
+
<span *ngIf="to.required && to.hideRequiredMarker !== true" aria-hidden="true">*</span>
|
|
44
|
+
</label>
|
|
45
|
+
</div>
|
|
46
|
+
`, isInline: true, directives: [{ type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
47
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyFieldCheckbox, decorators: [{
|
|
48
|
+
type: Component,
|
|
49
|
+
args: [{
|
|
50
|
+
selector: 'formly-field-checkbox',
|
|
51
|
+
template: `
|
|
52
|
+
<div
|
|
53
|
+
class="form-check"
|
|
54
|
+
[ngClass]="{
|
|
55
|
+
'form-check-inline': to.formCheck === 'inline' || to.formCheck === 'inline-switch',
|
|
56
|
+
'form-switch': to.formCheck === 'switch' || to.formCheck === 'inline-switch'
|
|
57
|
+
}"
|
|
58
|
+
>
|
|
59
|
+
<input
|
|
60
|
+
type="checkbox"
|
|
61
|
+
[class.is-invalid]="showError"
|
|
62
|
+
class="form-check-input"
|
|
63
|
+
[class.position-static]="to.formCheck === 'nolabel'"
|
|
64
|
+
[indeterminate]="to.indeterminate && formControl.value == null"
|
|
65
|
+
[formControl]="formControl"
|
|
66
|
+
[formlyAttributes]="field"
|
|
67
|
+
/>
|
|
68
|
+
<label *ngIf="to.formCheck !== 'nolabel'" [for]="id" class="form-check-label">
|
|
69
|
+
{{ to.label }}
|
|
70
|
+
<span *ngIf="to.required && to.hideRequiredMarker !== true" aria-hidden="true">*</span>
|
|
71
|
+
</label>
|
|
72
|
+
</div>
|
|
73
|
+
`,
|
|
74
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
75
|
+
}]
|
|
76
|
+
}] });
|
|
77
|
+
|
|
78
|
+
class FormlyBootstrapCheckboxModule {
|
|
79
|
+
}
|
|
80
|
+
FormlyBootstrapCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
81
|
+
FormlyBootstrapCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapCheckboxModule, declarations: [FormlyFieldCheckbox], imports: [CommonModule,
|
|
82
|
+
ReactiveFormsModule,
|
|
83
|
+
FormlyBootstrapFormFieldModule, i3.FormlyModule] });
|
|
84
|
+
FormlyBootstrapCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapCheckboxModule, imports: [[
|
|
85
|
+
CommonModule,
|
|
86
|
+
ReactiveFormsModule,
|
|
87
|
+
FormlyBootstrapFormFieldModule,
|
|
88
|
+
FormlyModule.forChild({
|
|
89
|
+
types: [
|
|
90
|
+
{
|
|
91
|
+
name: 'checkbox',
|
|
92
|
+
component: FormlyFieldCheckbox,
|
|
93
|
+
wrappers: ['form-field'],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: 'boolean',
|
|
97
|
+
extends: 'checkbox',
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
}),
|
|
101
|
+
]] });
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapCheckboxModule, decorators: [{
|
|
103
|
+
type: NgModule,
|
|
104
|
+
args: [{
|
|
105
|
+
declarations: [FormlyFieldCheckbox],
|
|
106
|
+
imports: [
|
|
107
|
+
CommonModule,
|
|
108
|
+
ReactiveFormsModule,
|
|
109
|
+
FormlyBootstrapFormFieldModule,
|
|
110
|
+
FormlyModule.forChild({
|
|
111
|
+
types: [
|
|
112
|
+
{
|
|
113
|
+
name: 'checkbox',
|
|
114
|
+
component: FormlyFieldCheckbox,
|
|
115
|
+
wrappers: ['form-field'],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
name: 'boolean',
|
|
119
|
+
extends: 'checkbox',
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
}),
|
|
123
|
+
],
|
|
124
|
+
}]
|
|
125
|
+
}] });
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Generated bundle index. Do not edit.
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
export { FormlyBootstrapCheckboxModule, FormlyFieldCheckbox };
|
|
132
|
+
//# sourceMappingURL=ngx-formly-bootstrap-checkbox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-formly-bootstrap-checkbox.mjs","sources":["../../../../src/ui/bootstrap/checkbox/src/checkbox.type.ts","../../../../src/ui/bootstrap/checkbox/src/checkbox.module.ts","../../../../src/ui/bootstrap/checkbox/src/ngx-formly-bootstrap-checkbox.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType } from '@ngx-formly/core';\n\n@Component({\n selector: 'formly-field-checkbox',\n template: `\n <div\n class=\"form-check\"\n [ngClass]=\"{\n 'form-check-inline': to.formCheck === 'inline' || to.formCheck === 'inline-switch',\n 'form-switch': to.formCheck === 'switch' || to.formCheck === 'inline-switch'\n }\"\n >\n <input\n type=\"checkbox\"\n [class.is-invalid]=\"showError\"\n class=\"form-check-input\"\n [class.position-static]=\"to.formCheck === 'nolabel'\"\n [indeterminate]=\"to.indeterminate && formControl.value == null\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n />\n <label *ngIf=\"to.formCheck !== 'nolabel'\" [for]=\"id\" class=\"form-check-label\">\n {{ to.label }}\n <span *ngIf=\"to.required && to.hideRequiredMarker !== true\" aria-hidden=\"true\">*</span>\n </label>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldCheckbox extends FieldType {\n defaultOptions = {\n templateOptions: {\n indeterminate: true,\n hideLabel: true,\n formCheck: 'default', // 'default' | 'inline' | 'switch' | 'inline-switch' | 'nolabel'\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 { FormlyFieldCheckbox } from './checkbox.type';\n\n@NgModule({\n declarations: [FormlyFieldCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormlyBootstrapFormFieldModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'checkbox',\n component: FormlyFieldCheckbox,\n wrappers: ['form-field'],\n },\n {\n name: 'boolean',\n extends: 'checkbox',\n },\n ],\n }),\n ],\n})\nexport class FormlyBootstrapCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;MA8Ba,mBAAoB,SAAQ,SAAS;IA3BlD;;QA4BE,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0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
3
|
+
import * as i2 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i1 from '@ngx-formly/core';
|
|
6
|
+
import { FieldWrapper, FormlyModule } from '@ngx-formly/core';
|
|
7
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
8
|
+
|
|
9
|
+
class FormlyWrapperFormField extends FieldWrapper {
|
|
10
|
+
}
|
|
11
|
+
FormlyWrapperFormField.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyWrapperFormField, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
12
|
+
FormlyWrapperFormField.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: FormlyWrapperFormField, selector: "formly-wrapper-form-field", usesInheritance: true, ngImport: i0, template: `
|
|
13
|
+
<div class="mb-3" [class.has-error]="showError">
|
|
14
|
+
<label *ngIf="to.label && to.hideLabel !== true" [attr.for]="id" class="form-label">
|
|
15
|
+
{{ to.label }}
|
|
16
|
+
<span *ngIf="to.required && to.hideRequiredMarker !== true" aria-hidden="true">*</span>
|
|
17
|
+
</label>
|
|
18
|
+
|
|
19
|
+
<ng-template #fieldComponent></ng-template>
|
|
20
|
+
|
|
21
|
+
<div *ngIf="showError" class="invalid-feedback" [style.display]="'block'">
|
|
22
|
+
<formly-validation-message [field]="field"></formly-validation-message>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<small *ngIf="to.description" class="form-text text-muted">{{ to.description }}</small>
|
|
26
|
+
</div>
|
|
27
|
+
`, isInline: true, components: [{ type: i1.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
28
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyWrapperFormField, decorators: [{
|
|
29
|
+
type: Component,
|
|
30
|
+
args: [{
|
|
31
|
+
selector: 'formly-wrapper-form-field',
|
|
32
|
+
template: `
|
|
33
|
+
<div class="mb-3" [class.has-error]="showError">
|
|
34
|
+
<label *ngIf="to.label && to.hideLabel !== true" [attr.for]="id" class="form-label">
|
|
35
|
+
{{ to.label }}
|
|
36
|
+
<span *ngIf="to.required && to.hideRequiredMarker !== true" aria-hidden="true">*</span>
|
|
37
|
+
</label>
|
|
38
|
+
|
|
39
|
+
<ng-template #fieldComponent></ng-template>
|
|
40
|
+
|
|
41
|
+
<div *ngIf="showError" class="invalid-feedback" [style.display]="'block'">
|
|
42
|
+
<formly-validation-message [field]="field"></formly-validation-message>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<small *ngIf="to.description" class="form-text text-muted">{{ to.description }}</small>
|
|
46
|
+
</div>
|
|
47
|
+
`,
|
|
48
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
49
|
+
}]
|
|
50
|
+
}] });
|
|
51
|
+
|
|
52
|
+
class FormlyBootstrapFormFieldModule {
|
|
53
|
+
}
|
|
54
|
+
FormlyBootstrapFormFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
55
|
+
FormlyBootstrapFormFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapFormFieldModule, declarations: [FormlyWrapperFormField], imports: [CommonModule,
|
|
56
|
+
ReactiveFormsModule, i1.FormlyModule] });
|
|
57
|
+
FormlyBootstrapFormFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapFormFieldModule, imports: [[
|
|
58
|
+
CommonModule,
|
|
59
|
+
ReactiveFormsModule,
|
|
60
|
+
FormlyModule.forChild({
|
|
61
|
+
wrappers: [
|
|
62
|
+
{
|
|
63
|
+
name: 'form-field',
|
|
64
|
+
component: FormlyWrapperFormField,
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
}),
|
|
68
|
+
]] });
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapFormFieldModule, decorators: [{
|
|
70
|
+
type: NgModule,
|
|
71
|
+
args: [{
|
|
72
|
+
declarations: [FormlyWrapperFormField],
|
|
73
|
+
imports: [
|
|
74
|
+
CommonModule,
|
|
75
|
+
ReactiveFormsModule,
|
|
76
|
+
FormlyModule.forChild({
|
|
77
|
+
wrappers: [
|
|
78
|
+
{
|
|
79
|
+
name: 'form-field',
|
|
80
|
+
component: FormlyWrapperFormField,
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
}),
|
|
84
|
+
],
|
|
85
|
+
}]
|
|
86
|
+
}] });
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Generated bundle index. Do not edit.
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
export { FormlyBootstrapFormFieldModule };
|
|
93
|
+
//# sourceMappingURL=ngx-formly-bootstrap-form-field.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-formly-bootstrap-form-field.mjs","sources":["../../../../src/ui/bootstrap/form-field/src/form-field.wrapper.ts","../../../../src/ui/bootstrap/form-field/src/form-field.module.ts","../../../../src/ui/bootstrap/form-field/src/ngx-formly-bootstrap-form-field.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldWrapper } from '@ngx-formly/core';\n\n@Component({\n selector: 'formly-wrapper-form-field',\n template: `\n <div class=\"mb-3\" [class.has-error]=\"showError\">\n <label *ngIf=\"to.label && to.hideLabel !== true\" [attr.for]=\"id\" class=\"form-label\">\n {{ to.label }}\n <span *ngIf=\"to.required && to.hideRequiredMarker !== true\" aria-hidden=\"true\">*</span>\n </label>\n\n <ng-template #fieldComponent></ng-template>\n\n <div *ngIf=\"showError\" class=\"invalid-feedback\" [style.display]=\"'block'\">\n <formly-validation-message [field]=\"field\"></formly-validation-message>\n </div>\n\n <small *ngIf=\"to.description\" class=\"form-text text-muted\">{{ to.description }}</small>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyWrapperFormField extends FieldWrapper {}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { FormlyWrapperFormField } from './form-field.wrapper';\n\n@NgModule({\n declarations: [FormlyWrapperFormField],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n FormlyModule.forChild({\n wrappers: [\n {\n name: 'form-field',\n component: FormlyWrapperFormField,\n },\n ],\n }),\n ],\n})\nexport class FormlyBootstrapFormFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;MAuBa,sBAAuB,SAAQ,YAAY;;mHAA3C,sBAAsB;uGAAtB,sBAAsB,wFAlBvB;;;;;;;;;;;;;;;GAeT;2FAGU,sBAAsB;kBApBlC,SAAS;mBAAC;oBACT,QAAQ,EAAE,2BAA2B;oBACrC,QAAQ,EAAE;;;;;;;;;;;;;;;GAeT;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;;;MCAY,8BAA8B;;2HAA9B,8BAA8B;4HAA9B,8BAA8B,iBAf1B,sBAAsB,aAEnC,YAAY;QACZ,mBAAmB;4HAYV,8BAA8B,YAdhC;YACP,YAAY;YACZ,mBAAmB;YAEnB,YAAY,CAAC,QAAQ,CAAC;gBACpB,QAAQ,EAAE;oBACR;wBACE,IAAI,EAAE,YAAY;wBAClB,SAAS,EAAE,sBAAsB;qBAClC;iBACF;aACF,CAAC;SACH;2FAEU,8BAA8B;kBAhB1C,QAAQ;mBAAC;oBACR,YAAY,EAAE,CAAC,sBAAsB,CAAC;oBACtC,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBAEnB,YAAY,CAAC,QAAQ,CAAC;4BACpB,QAAQ,EAAE;gCACR;oCACE,IAAI,EAAE,YAAY;oCAClB,SAAS,EAAE,sBAAsB;iCAClC;6BACF;yBACF,CAAC;qBACH;iBACF;;;ACrBD;;;;;;"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import * as i3 from '@ngx-formly/core';
|
|
6
|
+
import { FieldType, FormlyModule } from '@ngx-formly/core';
|
|
7
|
+
import * as i2 from '@angular/forms';
|
|
8
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
9
|
+
import { FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';
|
|
10
|
+
|
|
11
|
+
class FormlyFieldInput extends FieldType {
|
|
12
|
+
get type() {
|
|
13
|
+
return this.to.type || 'text';
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
FormlyFieldInput.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyFieldInput, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
17
|
+
FormlyFieldInput.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: FormlyFieldInput, selector: "formly-field-input", usesInheritance: true, ngImport: i0, template: `
|
|
18
|
+
<input
|
|
19
|
+
*ngIf="type !== 'number'; else numberTmp"
|
|
20
|
+
[type]="type"
|
|
21
|
+
[formControl]="formControl"
|
|
22
|
+
class="form-control"
|
|
23
|
+
[formlyAttributes]="field"
|
|
24
|
+
[class.is-invalid]="showError"
|
|
25
|
+
/>
|
|
26
|
+
<ng-template #numberTmp>
|
|
27
|
+
<input
|
|
28
|
+
type="number"
|
|
29
|
+
[formControl]="formControl"
|
|
30
|
+
class="form-control"
|
|
31
|
+
[formlyAttributes]="field"
|
|
32
|
+
[class.is-invalid]="showError"
|
|
33
|
+
/>
|
|
34
|
+
</ng-template>
|
|
35
|
+
`, isInline: true, directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { type: i3.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { type: i2.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
36
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyFieldInput, decorators: [{
|
|
37
|
+
type: Component,
|
|
38
|
+
args: [{
|
|
39
|
+
selector: 'formly-field-input',
|
|
40
|
+
template: `
|
|
41
|
+
<input
|
|
42
|
+
*ngIf="type !== 'number'; else numberTmp"
|
|
43
|
+
[type]="type"
|
|
44
|
+
[formControl]="formControl"
|
|
45
|
+
class="form-control"
|
|
46
|
+
[formlyAttributes]="field"
|
|
47
|
+
[class.is-invalid]="showError"
|
|
48
|
+
/>
|
|
49
|
+
<ng-template #numberTmp>
|
|
50
|
+
<input
|
|
51
|
+
type="number"
|
|
52
|
+
[formControl]="formControl"
|
|
53
|
+
class="form-control"
|
|
54
|
+
[formlyAttributes]="field"
|
|
55
|
+
[class.is-invalid]="showError"
|
|
56
|
+
/>
|
|
57
|
+
</ng-template>
|
|
58
|
+
`,
|
|
59
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
60
|
+
}]
|
|
61
|
+
}] });
|
|
62
|
+
|
|
63
|
+
class FormlyBootstrapInputModule {
|
|
64
|
+
}
|
|
65
|
+
FormlyBootstrapInputModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
66
|
+
FormlyBootstrapInputModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapInputModule, declarations: [FormlyFieldInput], imports: [CommonModule,
|
|
67
|
+
ReactiveFormsModule,
|
|
68
|
+
FormlyBootstrapFormFieldModule, i3.FormlyModule] });
|
|
69
|
+
FormlyBootstrapInputModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapInputModule, imports: [[
|
|
70
|
+
CommonModule,
|
|
71
|
+
ReactiveFormsModule,
|
|
72
|
+
FormlyBootstrapFormFieldModule,
|
|
73
|
+
FormlyModule.forChild({
|
|
74
|
+
types: [
|
|
75
|
+
{
|
|
76
|
+
name: 'input',
|
|
77
|
+
component: FormlyFieldInput,
|
|
78
|
+
wrappers: ['form-field'],
|
|
79
|
+
},
|
|
80
|
+
{ name: 'string', extends: 'input' },
|
|
81
|
+
{
|
|
82
|
+
name: 'number',
|
|
83
|
+
extends: 'input',
|
|
84
|
+
defaultOptions: {
|
|
85
|
+
templateOptions: {
|
|
86
|
+
type: 'number',
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
name: 'integer',
|
|
92
|
+
extends: 'input',
|
|
93
|
+
defaultOptions: {
|
|
94
|
+
templateOptions: {
|
|
95
|
+
type: 'number',
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
}),
|
|
101
|
+
]] });
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapInputModule, decorators: [{
|
|
103
|
+
type: NgModule,
|
|
104
|
+
args: [{
|
|
105
|
+
declarations: [FormlyFieldInput],
|
|
106
|
+
imports: [
|
|
107
|
+
CommonModule,
|
|
108
|
+
ReactiveFormsModule,
|
|
109
|
+
FormlyBootstrapFormFieldModule,
|
|
110
|
+
FormlyModule.forChild({
|
|
111
|
+
types: [
|
|
112
|
+
{
|
|
113
|
+
name: 'input',
|
|
114
|
+
component: FormlyFieldInput,
|
|
115
|
+
wrappers: ['form-field'],
|
|
116
|
+
},
|
|
117
|
+
{ name: 'string', extends: 'input' },
|
|
118
|
+
{
|
|
119
|
+
name: 'number',
|
|
120
|
+
extends: 'input',
|
|
121
|
+
defaultOptions: {
|
|
122
|
+
templateOptions: {
|
|
123
|
+
type: 'number',
|
|
124
|
+
},
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'integer',
|
|
129
|
+
extends: 'input',
|
|
130
|
+
defaultOptions: {
|
|
131
|
+
templateOptions: {
|
|
132
|
+
type: 'number',
|
|
133
|
+
},
|
|
134
|
+
},
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
}),
|
|
138
|
+
],
|
|
139
|
+
}]
|
|
140
|
+
}] });
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Generated bundle index. Do not edit.
|
|
144
|
+
*/
|
|
145
|
+
|
|
146
|
+
export { FormlyBootstrapInputModule, FormlyFieldInput };
|
|
147
|
+
//# sourceMappingURL=ngx-formly-bootstrap-input.mjs.map
|
|
@@ -0,0 +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.module.ts","../../../../src/ui/bootstrap/input/src/ngx-formly-bootstrap-input.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType } from '@ngx-formly/core';\n\n@Component({\n selector: 'formly-field-input',\n template: `\n <input\n *ngIf=\"type !== 'number'; else numberTmp\"\n [type]=\"type\"\n [formControl]=\"formControl\"\n class=\"form-control\"\n [formlyAttributes]=\"field\"\n [class.is-invalid]=\"showError\"\n />\n <ng-template #numberTmp>\n <input\n type=\"number\"\n [formControl]=\"formControl\"\n class=\"form-control\"\n [formlyAttributes]=\"field\"\n [class.is-invalid]=\"showError\"\n />\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldInput extends FieldType {\n get type() {\n return this.to.type || 'text';\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';\n\n@NgModule({\n declarations: [FormlyFieldInput],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n FormlyBootstrapFormFieldModule,\n FormlyModule.forChild({\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 templateOptions: {\n type: 'number',\n },\n },\n },\n {\n name: 'integer',\n extends: 'input',\n defaultOptions: {\n templateOptions: {\n type: 'number',\n },\n },\n },\n ],\n }),\n ],\n})\nexport class FormlyBootstrapInputModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;MA0Ba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ACE,IAAI,EAAE,OAAO;oCACb,SAAS,EAAE,gBAAgB;oCAC3B,QAAQ,EAAE,CAAC,YAAY,CAAC;iCACzB;gCACD,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE;gCACpC;oCACE,IAAI,EAAE,QAAQ;oCACd,OAAO,EAAE,OAAO;oCAChB,cAAc,EAAE;wCACd,eAAe,EAAE;4CACf,IAAI,EAAE,QAAQ;yCACf;qCACF;iCACF;gCACD;oCACE,IAAI,EAAE,SAAS;oCACf,OAAO,EAAE,OAAO;oCAChB,cAAc,EAAE;wCACd,eAAe,EAAE;4CACf,IAAI,EAAE,QAAQ;yCACf;qCACF;iCACF;6BACF;yBACF,CAAC;qBACH;iBACF;;;AC7CD;;;;;;"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/common';
|
|
4
|
+
import { CommonModule } from '@angular/common';
|
|
5
|
+
import { ReactiveFormsModule } from '@angular/forms';
|
|
6
|
+
import * as i2 from '@ngx-formly/core';
|
|
7
|
+
import { FieldType, FormlyModule } from '@ngx-formly/core';
|
|
8
|
+
import * as i3 from '@ngx-formly/core/select';
|
|
9
|
+
import { FormlySelectModule } from '@ngx-formly/core/select';
|
|
10
|
+
import { FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';
|
|
11
|
+
|
|
12
|
+
class FormlyFieldMultiCheckbox extends FieldType {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
this.defaultOptions = {
|
|
16
|
+
templateOptions: {
|
|
17
|
+
options: [],
|
|
18
|
+
formCheck: 'default', // 'default' | 'inline' | 'switch' | 'inline-switch'
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
onChange(value, checked) {
|
|
23
|
+
if (this.to.type === 'array') {
|
|
24
|
+
this.formControl.patchValue(checked
|
|
25
|
+
? [...(this.formControl.value || []), value]
|
|
26
|
+
: [...(this.formControl.value || [])].filter((o) => o !== value));
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
this.formControl.patchValue({ ...this.formControl.value, [value]: checked });
|
|
30
|
+
}
|
|
31
|
+
this.formControl.markAsTouched();
|
|
32
|
+
}
|
|
33
|
+
isChecked(option) {
|
|
34
|
+
const value = this.formControl.value;
|
|
35
|
+
return value && (this.to.type === 'array' ? value.indexOf(option.value) !== -1 : value[option.value]);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
FormlyFieldMultiCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyFieldMultiCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
39
|
+
FormlyFieldMultiCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: FormlyFieldMultiCheckbox, selector: "formly-field-multicheckbox", usesInheritance: true, ngImport: i0, template: `
|
|
40
|
+
<div
|
|
41
|
+
*ngFor="let option of to.options | formlySelectOptions: field | async; let i = index"
|
|
42
|
+
class="form-check"
|
|
43
|
+
[ngClass]="{
|
|
44
|
+
'form-check-inline': to.formCheck === 'inline' || to.formCheck === 'inline-switch',
|
|
45
|
+
'form-switch': to.formCheck === 'switch' || to.formCheck === 'inline-switch'
|
|
46
|
+
}"
|
|
47
|
+
>
|
|
48
|
+
<input
|
|
49
|
+
type="checkbox"
|
|
50
|
+
[id]="id + '_' + i"
|
|
51
|
+
class="form-check-input"
|
|
52
|
+
[value]="option.value"
|
|
53
|
+
[checked]="isChecked(option)"
|
|
54
|
+
[formlyAttributes]="field"
|
|
55
|
+
(change)="onChange(option.value, $event.target.checked)"
|
|
56
|
+
/>
|
|
57
|
+
<label class="form-check-label" [for]="id + '_' + i">
|
|
58
|
+
{{ option.label }}
|
|
59
|
+
</label>
|
|
60
|
+
</div>
|
|
61
|
+
`, isInline: true, directives: [{ type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i2.ɵFormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }], pipes: { "async": i1.AsyncPipe, "formlySelectOptions": i3.ɵFormlySelectOptionsPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
62
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyFieldMultiCheckbox, decorators: [{
|
|
63
|
+
type: Component,
|
|
64
|
+
args: [{
|
|
65
|
+
selector: 'formly-field-multicheckbox',
|
|
66
|
+
template: `
|
|
67
|
+
<div
|
|
68
|
+
*ngFor="let option of to.options | formlySelectOptions: field | async; let i = index"
|
|
69
|
+
class="form-check"
|
|
70
|
+
[ngClass]="{
|
|
71
|
+
'form-check-inline': to.formCheck === 'inline' || to.formCheck === 'inline-switch',
|
|
72
|
+
'form-switch': to.formCheck === 'switch' || to.formCheck === 'inline-switch'
|
|
73
|
+
}"
|
|
74
|
+
>
|
|
75
|
+
<input
|
|
76
|
+
type="checkbox"
|
|
77
|
+
[id]="id + '_' + i"
|
|
78
|
+
class="form-check-input"
|
|
79
|
+
[value]="option.value"
|
|
80
|
+
[checked]="isChecked(option)"
|
|
81
|
+
[formlyAttributes]="field"
|
|
82
|
+
(change)="onChange(option.value, $event.target.checked)"
|
|
83
|
+
/>
|
|
84
|
+
<label class="form-check-label" [for]="id + '_' + i">
|
|
85
|
+
{{ option.label }}
|
|
86
|
+
</label>
|
|
87
|
+
</div>
|
|
88
|
+
`,
|
|
89
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
90
|
+
}]
|
|
91
|
+
}] });
|
|
92
|
+
|
|
93
|
+
class FormlyBootstrapMultiCheckboxModule {
|
|
94
|
+
}
|
|
95
|
+
FormlyBootstrapMultiCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapMultiCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
96
|
+
FormlyBootstrapMultiCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapMultiCheckboxModule, declarations: [FormlyFieldMultiCheckbox], imports: [CommonModule,
|
|
97
|
+
ReactiveFormsModule,
|
|
98
|
+
FormlyBootstrapFormFieldModule,
|
|
99
|
+
FormlySelectModule, i2.FormlyModule] });
|
|
100
|
+
FormlyBootstrapMultiCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapMultiCheckboxModule, imports: [[
|
|
101
|
+
CommonModule,
|
|
102
|
+
ReactiveFormsModule,
|
|
103
|
+
FormlyBootstrapFormFieldModule,
|
|
104
|
+
FormlySelectModule,
|
|
105
|
+
FormlyModule.forChild({
|
|
106
|
+
types: [
|
|
107
|
+
{
|
|
108
|
+
name: 'multicheckbox',
|
|
109
|
+
component: FormlyFieldMultiCheckbox,
|
|
110
|
+
wrappers: ['form-field'],
|
|
111
|
+
},
|
|
112
|
+
],
|
|
113
|
+
}),
|
|
114
|
+
]] });
|
|
115
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: FormlyBootstrapMultiCheckboxModule, decorators: [{
|
|
116
|
+
type: NgModule,
|
|
117
|
+
args: [{
|
|
118
|
+
declarations: [FormlyFieldMultiCheckbox],
|
|
119
|
+
imports: [
|
|
120
|
+
CommonModule,
|
|
121
|
+
ReactiveFormsModule,
|
|
122
|
+
FormlyBootstrapFormFieldModule,
|
|
123
|
+
FormlySelectModule,
|
|
124
|
+
FormlyModule.forChild({
|
|
125
|
+
types: [
|
|
126
|
+
{
|
|
127
|
+
name: 'multicheckbox',
|
|
128
|
+
component: FormlyFieldMultiCheckbox,
|
|
129
|
+
wrappers: ['form-field'],
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
}),
|
|
133
|
+
],
|
|
134
|
+
}]
|
|
135
|
+
}] });
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Generated bundle index. Do not edit.
|
|
139
|
+
*/
|
|
140
|
+
|
|
141
|
+
export { FormlyBootstrapMultiCheckboxModule, FormlyFieldMultiCheckbox };
|
|
142
|
+
//# sourceMappingURL=ngx-formly-bootstrap-multicheckbox.mjs.map
|
|
@@ -0,0 +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.module.ts","../../../../src/ui/bootstrap/multicheckbox/src/ngx-formly-bootstrap-multicheckbox.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType } from '@ngx-formly/core';\n\n@Component({\n selector: 'formly-field-multicheckbox',\n template: `\n <div\n *ngFor=\"let option of to.options | formlySelectOptions: field | async; let i = index\"\n class=\"form-check\"\n [ngClass]=\"{\n 'form-check-inline': to.formCheck === 'inline' || to.formCheck === 'inline-switch',\n 'form-switch': to.formCheck === 'switch' || to.formCheck === 'inline-switch'\n }\"\n >\n <input\n type=\"checkbox\"\n [id]=\"id + '_' + i\"\n class=\"form-check-input\"\n [value]=\"option.value\"\n [checked]=\"isChecked(option)\"\n [formlyAttributes]=\"field\"\n (change)=\"onChange(option.value, $event.target.checked)\"\n />\n <label class=\"form-check-label\" [for]=\"id + '_' + i\">\n {{ option.label }}\n </label>\n </div>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class FormlyFieldMultiCheckbox extends FieldType {\n defaultOptions = {\n templateOptions: {\n options: [],\n formCheck: 'default', // 'default' | 'inline' | 'switch' | 'inline-switch'\n },\n };\n\n onChange(value: any, checked: boolean) {\n if (this.to.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.to.type === 'array' ? value.indexOf(option.value) !== -1 : value[option.value]);\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';\n\n@NgModule({\n declarations: [FormlyFieldMultiCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n FormlyBootstrapFormFieldModule,\n FormlySelectModule,\n FormlyModule.forChild({\n types: [\n {\n name: 'multicheckbox',\n component: FormlyFieldMultiCheckbox,\n wrappers: ['form-field'],\n },\n ],\n }),\n ],\n})\nexport class FormlyBootstrapMultiCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;MA8Ba,wBAAyB,SAAQ,SAAS;IA3BvD;;QA4BE,mBAAc,GAAG;YACf,eAAe,EAAE;gBACf,OAAO,EAAE,EAAE;gBACX,SAAS,EAAE,SAAS;aACrB;SACF,CAAC;KAoBH;IAlBC,QAAQ,CAAC,KAAU,EAAE,OAAgB;QACnC,IAAI,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,OAAO,EAAE;YAC5B,IAAI,CAAC,WAAW,CAAC,UAAU,CACzB,OAAO;kBACH,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,KAAK,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