@ngx-formly/bootstrap 10.0.1 → 11.1.0-rc.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.
Files changed (29) hide show
  1. package/README.md +88 -177
  2. package/fesm2022/ngx-formly-bootstrap-addons.mjs +150 -65
  3. package/fesm2022/ngx-formly-bootstrap-addons.mjs.map +1 -1
  4. package/fesm2022/ngx-formly-bootstrap-checkbox.mjs +173 -79
  5. package/fesm2022/ngx-formly-bootstrap-checkbox.mjs.map +1 -1
  6. package/fesm2022/ngx-formly-bootstrap-form-field.mjs +204 -72
  7. package/fesm2022/ngx-formly-bootstrap-form-field.mjs.map +1 -1
  8. package/fesm2022/ngx-formly-bootstrap-input.mjs +169 -84
  9. package/fesm2022/ngx-formly-bootstrap-input.mjs.map +1 -1
  10. package/fesm2022/ngx-formly-bootstrap-multicheckbox.mjs +161 -91
  11. package/fesm2022/ngx-formly-bootstrap-multicheckbox.mjs.map +1 -1
  12. package/fesm2022/ngx-formly-bootstrap-radio.mjs +181 -79
  13. package/fesm2022/ngx-formly-bootstrap-radio.mjs.map +1 -1
  14. package/fesm2022/ngx-formly-bootstrap-select.mjs +189 -79
  15. package/fesm2022/ngx-formly-bootstrap-select.mjs.map +1 -1
  16. package/fesm2022/ngx-formly-bootstrap-textarea.mjs +152 -71
  17. package/fesm2022/ngx-formly-bootstrap-textarea.mjs.map +1 -1
  18. package/fesm2022/ngx-formly-bootstrap.mjs +89 -66
  19. package/fesm2022/ngx-formly-bootstrap.mjs.map +1 -1
  20. package/package.json +2 -2
  21. package/types/ngx-formly-bootstrap-addons.d.ts +30 -34
  22. package/types/ngx-formly-bootstrap-checkbox.d.ts +27 -32
  23. package/types/ngx-formly-bootstrap-form-field.d.ts +26 -30
  24. package/types/ngx-formly-bootstrap-input.d.ts +21 -27
  25. package/types/ngx-formly-bootstrap-multicheckbox.d.ts +27 -32
  26. package/types/ngx-formly-bootstrap-radio.d.ts +27 -32
  27. package/types/ngx-formly-bootstrap-select.d.ts +27 -32
  28. package/types/ngx-formly-bootstrap-textarea.d.ts +26 -31
  29. package/types/ngx-formly-bootstrap.d.ts +16 -20
@@ -1,26 +1,41 @@
1
- import * as i0 from '@angular/core';
2
- import { ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
3
- import { FieldType, FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';
4
- import * as i1 from '@angular/common';
5
- import { CommonModule } from '@angular/common';
6
- import * as i2 from '@angular/forms';
7
- import { ReactiveFormsModule } from '@angular/forms';
8
- import * as i3 from '@ngx-formly/core';
9
- import { FormlyModule } from '@ngx-formly/core';
10
-
11
- class FormlyFieldCheckbox extends FieldType {
12
- constructor() {
13
- super(...arguments);
14
- this.defaultOptions = {
15
- props: {
16
- indeterminate: true,
17
- hideLabel: true,
18
- formCheck: 'default',
19
- },
20
- };
21
- }
22
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyFieldCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
23
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: FormlyFieldCheckbox, isStandalone: false, selector: "formly-field-checkbox", usesInheritance: true, ngImport: i0, template: `
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, NgModule } from "@angular/core";
3
+ import { FieldType, FormlyBootstrapFormFieldModule } from "@ngx-formly/bootstrap/form-field";
4
+ import * as i1 from "@angular/common";
5
+ import { CommonModule } from "@angular/common";
6
+ import * as i2 from "@angular/forms";
7
+ import { ReactiveFormsModule } from "@angular/forms";
8
+ import * as i3 from "@ngx-formly/core";
9
+ import { FormlyModule } from "@ngx-formly/core";
10
+ var FormlyFieldCheckbox = class FormlyFieldCheckbox extends FieldType {
11
+ constructor() {
12
+ super(...arguments);
13
+ this.defaultOptions = { props: {
14
+ indeterminate: true,
15
+ hideLabel: true,
16
+ formCheck: "default"
17
+ } };
18
+ }
19
+ static {
20
+ this.ɵfac = i0.ɵɵngDeclareFactory({
21
+ minVersion: "12.0.0",
22
+ version: "22.2.2",
23
+ ngImport: i0,
24
+ type: FormlyFieldCheckbox,
25
+ deps: null,
26
+ target: i0.ɵɵFactoryTarget.Component
27
+ });
28
+ }
29
+ static {
30
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
31
+ minVersion: "17.0.0",
32
+ version: "22.2.2",
33
+ type: FormlyFieldCheckbox,
34
+ isStandalone: false,
35
+ selector: "formly-field-checkbox",
36
+ usesInheritance: true,
37
+ ngImport: i0,
38
+ template: `
24
39
  <ng-template #fieldTypeTemplate>
25
40
  <div
26
41
  class="form-check"
@@ -42,7 +57,11 @@ class FormlyFieldCheckbox extends FieldType {
42
57
  />
43
58
  @if (props.formCheck !== 'nolabel') {
44
59
  <label [for]="id" class="form-check-label">
45
- {{ props.label }}
60
+ @if (props.allowHtml) {
61
+ <span [innerHTML]="props.label"></span>
62
+ } @else {
63
+ {{ props.label }}
64
+ }
46
65
  @if (props.required && props.hideRequiredMarker !== true) {
47
66
  <span aria-hidden="true">*</span>
48
67
  }
@@ -50,13 +69,57 @@ class FormlyFieldCheckbox extends FieldType {
50
69
  }
51
70
  </div>
52
71
  </ng-template>
53
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "directive", type: i3.LegacyFormlyAttributes, selector: "[formlyAttributes]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
54
- }
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyFieldCheckbox, decorators: [{
56
- type: Component,
57
- args: [{
58
- selector: 'formly-field-checkbox',
59
- template: `
72
+ `,
73
+ isInline: true,
74
+ dependencies: [
75
+ {
76
+ kind: "directive",
77
+ type: i1.NgClass,
78
+ selector: "[ngClass]",
79
+ inputs: ["class", "ngClass"]
80
+ },
81
+ {
82
+ kind: "directive",
83
+ type: i2.CheckboxControlValueAccessor,
84
+ selector: "input[type=checkbox]:not([ngNoCva])[formControlName],input[type=checkbox]:not([ngNoCva])[formControl],input[type=checkbox]:not([ngNoCva])[ngModel]"
85
+ },
86
+ {
87
+ kind: "directive",
88
+ type: i2.NgControlStatus,
89
+ selector: "[formControlName],[ngModel],[formControl]"
90
+ },
91
+ {
92
+ kind: "directive",
93
+ type: i2.FormControlDirective,
94
+ selector: "[formControl]",
95
+ inputs: [
96
+ "formControl",
97
+ "disabled",
98
+ "ngModel"
99
+ ],
100
+ outputs: ["ngModelChange"],
101
+ exportAs: ["ngForm"]
102
+ },
103
+ {
104
+ kind: "directive",
105
+ type: i3.LegacyFormlyAttributes,
106
+ selector: "[formlyAttributes]"
107
+ }
108
+ ],
109
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
110
+ });
111
+ }
112
+ };
113
+ i0.ɵɵngDeclareClassMetadata({
114
+ minVersion: "12.0.0",
115
+ version: "22.2.2",
116
+ ngImport: i0,
117
+ type: FormlyFieldCheckbox,
118
+ decorators: [{
119
+ type: Component,
120
+ args: [{
121
+ selector: "formly-field-checkbox",
122
+ template: `
60
123
  <ng-template #fieldTypeTemplate>
61
124
  <div
62
125
  class="form-check"
@@ -78,7 +141,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
78
141
  />
79
142
  @if (props.formCheck !== 'nolabel') {
80
143
  <label [for]="id" class="form-check-label">
81
- {{ props.label }}
144
+ @if (props.allowHtml) {
145
+ <span [innerHTML]="props.label"></span>
146
+ } @else {
147
+ {{ props.label }}
148
+ }
82
149
  @if (props.required && props.hideRequiredMarker !== true) {
83
150
  <span aria-hidden="true">*</span>
84
151
  }
@@ -87,53 +154,80 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
87
154
  </div>
88
155
  </ng-template>
89
156
  `,
90
- changeDetection: ChangeDetectionStrategy.OnPush,
91
- standalone: false,
92
- }]
93
- }] });
94
-
157
+ changeDetection: ChangeDetectionStrategy.OnPush,
158
+ standalone: false
159
+ }]
160
+ }]
161
+ });
95
162
  function withFormlyFieldCheckbox() {
96
- return {
97
- types: [
98
- {
99
- name: 'checkbox',
100
- component: FormlyFieldCheckbox,
101
- wrappers: ['form-field'],
102
- },
103
- {
104
- name: 'boolean',
105
- extends: 'checkbox',
106
- },
107
- ],
108
- };
163
+ return { types: [{
164
+ name: "checkbox",
165
+ component: FormlyFieldCheckbox,
166
+ wrappers: ["form-field"]
167
+ }, {
168
+ name: "boolean",
169
+ extends: "checkbox"
170
+ }] };
109
171
  }
110
-
111
- class FormlyBootstrapCheckboxModule {
112
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyBootstrapCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
113
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: FormlyBootstrapCheckboxModule, declarations: [FormlyFieldCheckbox], imports: [CommonModule,
114
- ReactiveFormsModule,
115
- FormlyBootstrapFormFieldModule, i3.FormlyModule] }); }
116
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyBootstrapCheckboxModule, imports: [CommonModule,
117
- ReactiveFormsModule,
118
- FormlyBootstrapFormFieldModule,
119
- FormlyModule.forChild(withFormlyFieldCheckbox())] }); }
120
- }
121
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyBootstrapCheckboxModule, decorators: [{
122
- type: NgModule,
123
- args: [{
124
- declarations: [FormlyFieldCheckbox],
125
- imports: [
126
- CommonModule,
127
- ReactiveFormsModule,
128
- FormlyBootstrapFormFieldModule,
129
- FormlyModule.forChild(withFormlyFieldCheckbox()),
130
- ],
131
- }]
132
- }] });
133
-
134
- /**
135
- * Generated bundle index. Do not edit.
136
- */
137
-
172
+ var FormlyBootstrapCheckboxModule = class FormlyBootstrapCheckboxModule {
173
+ static {
174
+ this.ɵfac = i0.ɵɵngDeclareFactory({
175
+ minVersion: "12.0.0",
176
+ version: "22.2.2",
177
+ ngImport: i0,
178
+ type: FormlyBootstrapCheckboxModule,
179
+ deps: [],
180
+ target: i0.ɵɵFactoryTarget.NgModule
181
+ });
182
+ }
183
+ static {
184
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
185
+ minVersion: "14.0.0",
186
+ version: "22.2.2",
187
+ ngImport: i0,
188
+ type: FormlyBootstrapCheckboxModule,
189
+ declarations: [FormlyFieldCheckbox],
190
+ imports: [
191
+ CommonModule,
192
+ ReactiveFormsModule,
193
+ FormlyBootstrapFormFieldModule,
194
+ i3.FormlyModule
195
+ ]
196
+ });
197
+ }
198
+ static {
199
+ this.ɵinj = i0.ɵɵngDeclareInjector({
200
+ minVersion: "12.0.0",
201
+ version: "22.2.2",
202
+ ngImport: i0,
203
+ type: FormlyBootstrapCheckboxModule,
204
+ imports: [
205
+ CommonModule,
206
+ ReactiveFormsModule,
207
+ FormlyBootstrapFormFieldModule,
208
+ FormlyModule.forChild(withFormlyFieldCheckbox())
209
+ ]
210
+ });
211
+ }
212
+ };
213
+ i0.ɵɵngDeclareClassMetadata({
214
+ minVersion: "12.0.0",
215
+ version: "22.2.2",
216
+ ngImport: i0,
217
+ type: FormlyBootstrapCheckboxModule,
218
+ decorators: [{
219
+ type: NgModule,
220
+ args: [{
221
+ declarations: [FormlyFieldCheckbox],
222
+ imports: [
223
+ CommonModule,
224
+ ReactiveFormsModule,
225
+ FormlyBootstrapFormFieldModule,
226
+ FormlyModule.forChild(withFormlyFieldCheckbox())
227
+ ]
228
+ }]
229
+ }]
230
+ });
138
231
  export { FormlyBootstrapCheckboxModule, FormlyFieldCheckbox, withFormlyFieldCheckbox };
139
- //# sourceMappingURL=ngx-formly-bootstrap-checkbox.mjs.map
232
+
233
+ //# sourceMappingURL=ngx-formly-bootstrap-checkbox.mjs.map
@@ -1 +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.config.ts","../../../../src/ui/bootstrap/checkbox/src/checkbox.module.ts","../../../../src/ui/bootstrap/checkbox/src/ngx-formly-bootstrap-checkbox.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 CheckboxProps extends FormlyFieldProps {\n formCheck?: 'default' | 'inline' | 'switch' | 'inline-switch' | 'nolabel';\n indeterminate?: boolean;\n}\n\nexport interface FormlyCheckboxFieldConfig extends FormlyFieldConfig<CheckboxProps> {\n type: 'checkbox' | Type<FormlyFieldCheckbox>;\n}\n\n@Component({\n selector: 'formly-field-checkbox',\n template: `\n <ng-template #fieldTypeTemplate>\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 [class.is-invalid]=\"showError\"\n class=\"form-check-input\"\n [class.position-static]=\"props.formCheck === 'nolabel'\"\n [indeterminate]=\"props.indeterminate && formControl.value == null\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [attr.aria-describedby]=\"id + '-formly-validation-error'\"\n [attr.aria-invalid]=\"showError\"\n />\n @if (props.formCheck !== 'nolabel') {\n <label [for]=\"id\" class=\"form-check-label\">\n {{ props.label }}\n @if (props.required && props.hideRequiredMarker !== true) {\n <span aria-hidden=\"true\">*</span>\n }\n </label>\n }\n </div>\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n})\nexport class FormlyFieldCheckbox extends FieldType<FieldTypeConfig<CheckboxProps>> {\n override defaultOptions = {\n props: {\n indeterminate: true,\n hideLabel: true,\n formCheck: 'default' as const,\n },\n };\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldCheckbox } from './checkbox.type';\n\nexport function withFormlyFieldCheckbox(): ConfigOption {\n return {\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","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';\nimport { withFormlyFieldCheckbox } from './checkbox.config';\n\n@NgModule({\n declarations: [FormlyFieldCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormlyBootstrapFormFieldModule,\n FormlyModule.forChild(withFormlyFieldCheckbox()),\n ],\n})\nexport class FormlyBootstrapCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;;;AAiDM,MAAO,mBAAoB,SAAQ,SAAyC,CAAA;AApClF,IAAA,WAAA,GAAA;;AAqCW,QAAA,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,aAAa,EAAE,IAAI;AACnB,gBAAA,SAAS,EAAE,IAAI;AACf,g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C,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBACnB,8BAA8B;AAC9B,wBAAA,YAAY,CAAC,QAAQ,CAAC,uBAAuB,EAAE,CAAC;AACjD,qBAAA;AACF,iBAAA;;;AClBD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-formly-bootstrap-checkbox.mjs","names":[],"sources":["../../../../src/ui/bootstrap/checkbox/src/checkbox.type.ts","../../../../src/ui/bootstrap/checkbox/src/checkbox.config.ts","../../../../src/ui/bootstrap/checkbox/src/checkbox.module.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 CheckboxProps extends FormlyFieldProps {\n formCheck?: 'default' | 'inline' | 'switch' | 'inline-switch' | 'nolabel';\n indeterminate?: boolean;\n}\n\nexport interface FormlyCheckboxFieldConfig extends FormlyFieldConfig<CheckboxProps> {\n type: 'checkbox' | Type<FormlyFieldCheckbox>;\n}\n\n@Component({\n selector: 'formly-field-checkbox',\n template: `\n <ng-template #fieldTypeTemplate>\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 [class.is-invalid]=\"showError\"\n class=\"form-check-input\"\n [class.position-static]=\"props.formCheck === 'nolabel'\"\n [indeterminate]=\"props.indeterminate && formControl.value == null\"\n [formControl]=\"formControl\"\n [formlyAttributes]=\"field\"\n [attr.aria-describedby]=\"id + '-formly-validation-error'\"\n [attr.aria-invalid]=\"showError\"\n />\n @if (props.formCheck !== 'nolabel') {\n <label [for]=\"id\" class=\"form-check-label\">\n @if (props.allowHtml) {\n <span [innerHTML]=\"props.label\"></span>\n } @else {\n {{ props.label }}\n }\n @if (props.required && props.hideRequiredMarker !== true) {\n <span aria-hidden=\"true\">*</span>\n }\n </label>\n }\n </div>\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n standalone: false,\n})\nexport class FormlyFieldCheckbox extends FieldType<FieldTypeConfig<CheckboxProps>> {\n override defaultOptions = {\n props: {\n indeterminate: true,\n hideLabel: true,\n formCheck: 'default' as const,\n },\n };\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldCheckbox } from './checkbox.type';\n\nexport function withFormlyFieldCheckbox(): ConfigOption {\n return {\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","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';\nimport { withFormlyFieldCheckbox } from './checkbox.config';\n\n@NgModule({\n declarations: [FormlyFieldCheckbox],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n FormlyBootstrapFormFieldModule,\n FormlyModule.forChild(withFormlyFieldCheckbox()),\n ],\n})\nexport class FormlyBootstrapCheckboxModule {}\n"],"mappings":";;;;;;;;;AAqDA,IAAa,sBAAb,MAAa,4BAA4B,UAAyC;CAxClF,cAAA;;EAyCW,KAAA,iBAAiB,EACxB,OAAO;GACL,eAAe;GACf,WAAW;GACX,WAAW;EACZ,EACF;CACF;CARY;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAmB,MAAA;GAAA,QAAA,GAAA,gBAAA;EAAA,CAAA;CAAA;CAAnB;EAAA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AA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA6B,cAAA,CARzB,mBAAmB;GAAA,SAAA;IAEhC;IACA;IACA;IAA8B,GAAA;GAAA;EAAA,CAAA;CAAA;CAIrB;EAAA,KAAA,OAAA,GAAA,oBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAA6B,SAAA;IANtC;IACA;IACA;IACA,aAAa,SAAS,wBAAuB,CAAE;GAAC;EAAA,CAAA;CAAA;;AAGvC,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAA6B,YAAA,CAAA;EATzC,MAAA;EAAS,MAAA,CAAA;GACR,cAAc,CAAC,mBAAmB;GAClC,SAAS;IACP;IACA;IACA;IACA,aAAa,SAAS,wBAAuB,CAAE;GAChD;EACF,CAAA"}
@@ -1,18 +1,39 @@
1
- import * as i0 from '@angular/core';
2
- import { Component, NgModule, ViewChild, Optional, Directive } from '@angular/core';
3
- import * as i2 from '@ngx-formly/core';
4
- import { FieldWrapper, FormlyModule, FieldType as FieldType$1 } from '@ngx-formly/core';
5
- import * as i1 from '@angular/common';
6
- import { CommonModule } from '@angular/common';
7
- import { ReactiveFormsModule } from '@angular/forms';
8
-
9
- class FormlyWrapperFormField extends FieldWrapper {
10
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyWrapperFormField, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
11
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: FormlyWrapperFormField, isStandalone: false, selector: "formly-wrapper-form-field", usesInheritance: true, ngImport: i0, template: `
1
+ import * as i0 from "@angular/core";
2
+ import { Component, Directive, NgModule, Optional, ViewChild } from "@angular/core";
3
+ import * as i2 from "@ngx-formly/core";
4
+ import { FieldType as FieldType$1, FieldWrapper, FormlyModule } from "@ngx-formly/core";
5
+ import * as i1 from "@angular/common";
6
+ import { CommonModule } from "@angular/common";
7
+ import { ReactiveFormsModule } from "@angular/forms";
8
+ var FormlyWrapperFormField = class FormlyWrapperFormField extends FieldWrapper {
9
+ static {
10
+ this.ɵfac = i0.ɵɵngDeclareFactory({
11
+ minVersion: "12.0.0",
12
+ version: "22.2.2",
13
+ ngImport: i0,
14
+ type: FormlyWrapperFormField,
15
+ deps: null,
16
+ target: i0.ɵɵFactoryTarget.Component
17
+ });
18
+ }
19
+ static {
20
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
21
+ minVersion: "17.0.0",
22
+ version: "22.2.2",
23
+ type: FormlyWrapperFormField,
24
+ isStandalone: false,
25
+ selector: "formly-wrapper-form-field",
26
+ usesInheritance: true,
27
+ ngImport: i0,
28
+ template: `
12
29
  <ng-template #labelTemplate>
13
30
  @if (props.label && props.hideLabel !== true) {
14
31
  <label [attr.for]="id" class="form-label">
15
- {{ props.label }}
32
+ @if (props.allowHtml) {
33
+ <span [innerHTML]="props.label"></span>
34
+ } @else {
35
+ {{ props.label }}
36
+ }
16
37
  @if (props.required && props.hideRequiredMarker !== true) {
17
38
  <span aria-hidden="true">*</span>
18
39
  }
@@ -42,18 +63,53 @@ class FormlyWrapperFormField extends FieldWrapper {
42
63
  }
43
64
 
44
65
  @if (props.description) {
45
- <small class="form-text text-muted">{{ props.description }}</small>
66
+ <small class="form-text text-muted">
67
+ @if (props.allowHtml) {
68
+ <span [innerHTML]="props.description"></span>
69
+ } @else {
70
+ <ng-container>{{ props.description }}</ng-container>
71
+ }
72
+ </small>
46
73
  }
47
74
  </div>
48
- `, isInline: true, styles: [":host{display:block;margin-bottom:1rem}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i2.LegacyFormlyValidationMessage, selector: "formly-validation-message" }] }); }
49
- }
50
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyWrapperFormField, decorators: [{
51
- type: Component,
52
- args: [{ selector: 'formly-wrapper-form-field', template: `
75
+ `,
76
+ isInline: true,
77
+ styles: [":host{display:block;margin-bottom:1rem}\n"],
78
+ dependencies: [{
79
+ kind: "directive",
80
+ type: i1.NgTemplateOutlet,
81
+ selector: "[ngTemplateOutlet]",
82
+ inputs: [
83
+ "ngTemplateOutletContext",
84
+ "ngTemplateOutlet",
85
+ "ngTemplateOutletInjector"
86
+ ]
87
+ }, {
88
+ kind: "component",
89
+ type: i2.LegacyFormlyValidationMessage,
90
+ selector: "formly-validation-message"
91
+ }]
92
+ });
93
+ }
94
+ };
95
+ i0.ɵɵngDeclareClassMetadata({
96
+ minVersion: "12.0.0",
97
+ version: "22.2.2",
98
+ ngImport: i0,
99
+ type: FormlyWrapperFormField,
100
+ decorators: [{
101
+ type: Component,
102
+ args: [{
103
+ selector: "formly-wrapper-form-field",
104
+ template: `
53
105
  <ng-template #labelTemplate>
54
106
  @if (props.label && props.hideLabel !== true) {
55
107
  <label [attr.for]="id" class="form-label">
56
- {{ props.label }}
108
+ @if (props.allowHtml) {
109
+ <span [innerHTML]="props.label"></span>
110
+ } @else {
111
+ {{ props.label }}
112
+ }
57
113
  @if (props.required && props.hideRequiredMarker !== true) {
58
114
  <span aria-hidden="true">*</span>
59
115
  }
@@ -83,61 +139,137 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
83
139
  }
84
140
 
85
141
  @if (props.description) {
86
- <small class="form-text text-muted">{{ props.description }}</small>
142
+ <small class="form-text text-muted">
143
+ @if (props.allowHtml) {
144
+ <span [innerHTML]="props.description"></span>
145
+ } @else {
146
+ <ng-container>{{ props.description }}</ng-container>
147
+ }
148
+ </small>
87
149
  }
88
150
  </div>
89
- `, standalone: false, styles: [":host{display:block;margin-bottom:1rem}\n"] }]
90
- }] });
91
-
151
+ `,
152
+ standalone: false,
153
+ styles: [":host{display:block;margin-bottom:1rem}\n"]
154
+ }]
155
+ }]
156
+ });
92
157
  function withFormlyFormField() {
93
- return {
94
- wrappers: [
95
- {
96
- name: 'form-field',
97
- component: FormlyWrapperFormField,
98
- },
99
- ],
100
- };
158
+ return { wrappers: [{
159
+ name: "form-field",
160
+ component: FormlyWrapperFormField
161
+ }] };
101
162
  }
102
-
103
- class FormlyBootstrapFormFieldModule {
104
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyBootstrapFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
105
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: FormlyBootstrapFormFieldModule, declarations: [FormlyWrapperFormField], imports: [CommonModule, ReactiveFormsModule, i2.FormlyModule] }); }
106
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyBootstrapFormFieldModule, imports: [CommonModule, ReactiveFormsModule, FormlyModule.forChild(withFormlyFormField())] }); }
107
- }
108
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyBootstrapFormFieldModule, decorators: [{
109
- type: NgModule,
110
- args: [{
111
- declarations: [FormlyWrapperFormField],
112
- imports: [CommonModule, ReactiveFormsModule, FormlyModule.forChild(withFormlyFormField())],
113
- }]
114
- }] });
115
-
116
- class FieldType extends FieldType$1 {
117
- set content(templateRef) {
118
- if (templateRef && this.hostContainerRef) {
119
- this.hostContainerRef.createEmbeddedView(templateRef);
120
- }
121
- }
122
- constructor(hostContainerRef) {
123
- super();
124
- this.hostContainerRef = hostContainerRef;
125
- }
126
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FieldType, deps: [{ token: i0.ViewContainerRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
127
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.2.25", type: FieldType, isStandalone: true, viewQueries: [{ propertyName: "content", first: true, predicate: ["fieldTypeTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0 }); }
128
- }
129
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FieldType, decorators: [{
130
- type: Directive
131
- }], ctorParameters: () => [{ type: i0.ViewContainerRef, decorators: [{
132
- type: Optional
133
- }] }], propDecorators: { content: [{
134
- type: ViewChild,
135
- args: ['fieldTypeTemplate', { static: true }]
136
- }] } });
137
-
138
- /**
139
- * Generated bundle index. Do not edit.
140
- */
141
-
163
+ var FormlyBootstrapFormFieldModule = class FormlyBootstrapFormFieldModule {
164
+ static {
165
+ this.ɵfac = i0.ɵɵngDeclareFactory({
166
+ minVersion: "12.0.0",
167
+ version: "22.2.2",
168
+ ngImport: i0,
169
+ type: FormlyBootstrapFormFieldModule,
170
+ deps: [],
171
+ target: i0.ɵɵFactoryTarget.NgModule
172
+ });
173
+ }
174
+ static {
175
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
176
+ minVersion: "14.0.0",
177
+ version: "22.2.2",
178
+ ngImport: i0,
179
+ type: FormlyBootstrapFormFieldModule,
180
+ declarations: [FormlyWrapperFormField],
181
+ imports: [
182
+ CommonModule,
183
+ ReactiveFormsModule,
184
+ i2.FormlyModule
185
+ ]
186
+ });
187
+ }
188
+ static {
189
+ this.ɵinj = i0.ɵɵngDeclareInjector({
190
+ minVersion: "12.0.0",
191
+ version: "22.2.2",
192
+ ngImport: i0,
193
+ type: FormlyBootstrapFormFieldModule,
194
+ imports: [
195
+ CommonModule,
196
+ ReactiveFormsModule,
197
+ FormlyModule.forChild(withFormlyFormField())
198
+ ]
199
+ });
200
+ }
201
+ };
202
+ i0.ɵɵngDeclareClassMetadata({
203
+ minVersion: "12.0.0",
204
+ version: "22.2.2",
205
+ ngImport: i0,
206
+ type: FormlyBootstrapFormFieldModule,
207
+ decorators: [{
208
+ type: NgModule,
209
+ args: [{
210
+ declarations: [FormlyWrapperFormField],
211
+ imports: [
212
+ CommonModule,
213
+ ReactiveFormsModule,
214
+ FormlyModule.forChild(withFormlyFormField())
215
+ ]
216
+ }]
217
+ }]
218
+ });
219
+ var FieldType = class FieldType extends FieldType$1 {
220
+ set content(templateRef) {
221
+ if (templateRef && this.hostContainerRef) this.hostContainerRef.createEmbeddedView(templateRef);
222
+ }
223
+ constructor(hostContainerRef) {
224
+ super();
225
+ this.hostContainerRef = hostContainerRef;
226
+ }
227
+ static {
228
+ this.ɵfac = i0.ɵɵngDeclareFactory({
229
+ minVersion: "12.0.0",
230
+ version: "22.2.2",
231
+ ngImport: i0,
232
+ type: FieldType,
233
+ deps: [{
234
+ token: i0.ViewContainerRef,
235
+ optional: true
236
+ }],
237
+ target: i0.ɵɵFactoryTarget.Directive
238
+ });
239
+ }
240
+ static {
241
+ this.ɵdir = i0.ɵɵngDeclareDirective({
242
+ minVersion: "14.0.0",
243
+ version: "22.2.2",
244
+ type: FieldType,
245
+ isStandalone: true,
246
+ viewQueries: [{
247
+ propertyName: "content",
248
+ first: true,
249
+ predicate: ["fieldTypeTemplate"],
250
+ descendants: true,
251
+ static: true
252
+ }],
253
+ usesInheritance: true,
254
+ ngImport: i0
255
+ });
256
+ }
257
+ };
258
+ i0.ɵɵngDeclareClassMetadata({
259
+ minVersion: "12.0.0",
260
+ version: "22.2.2",
261
+ ngImport: i0,
262
+ type: FieldType,
263
+ decorators: [{ type: Directive }],
264
+ ctorParameters: () => [{
265
+ type: i0.ViewContainerRef,
266
+ decorators: [{ type: Optional }]
267
+ }],
268
+ propDecorators: { content: [{
269
+ type: ViewChild,
270
+ args: ["fieldTypeTemplate", { static: true }]
271
+ }] }
272
+ });
142
273
  export { FieldType, FormlyBootstrapFormFieldModule, withFormlyFormField };
143
- //# sourceMappingURL=ngx-formly-bootstrap-form-field.mjs.map
274
+
275
+ //# sourceMappingURL=ngx-formly-bootstrap-form-field.mjs.map