@ngx-formly/bootstrap 6.0.0-next.9 → 6.0.0-rc.2

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 (80) hide show
  1. package/README.md +15 -14
  2. package/addons/addons.component.d.ts +20 -2
  3. package/checkbox/checkbox.type.d.ts +14 -4
  4. package/checkbox/public_api.d.ts +1 -1
  5. package/esm2020/addons/addon.extension.mjs +3 -3
  6. package/esm2020/addons/addons.component.mjs +21 -9
  7. package/esm2020/addons/addons.module.mjs +5 -5
  8. package/esm2020/checkbox/checkbox.module.mjs +5 -5
  9. package/esm2020/checkbox/checkbox.type.mjs +53 -49
  10. package/esm2020/checkbox/public_api.mjs +1 -1
  11. package/esm2020/form-field/field.type.mjs +25 -0
  12. package/esm2020/form-field/form-field.module.mjs +5 -5
  13. package/esm2020/form-field/form-field.wrapper.mjs +35 -15
  14. package/esm2020/form-field/public_api.mjs +2 -1
  15. package/esm2020/input/input.module.mjs +9 -9
  16. package/esm2020/input/input.type.mjs +30 -26
  17. package/esm2020/input/public_api.mjs +1 -1
  18. package/esm2020/lib/bootstrap.module.mjs +5 -5
  19. package/esm2020/multicheckbox/multicheckbox.module.mjs +5 -5
  20. package/esm2020/multicheckbox/multicheckbox.type.mjs +58 -53
  21. package/esm2020/multicheckbox/public_api.mjs +1 -1
  22. package/esm2020/radio/public_api.mjs +1 -1
  23. package/esm2020/radio/radio.module.mjs +5 -5
  24. package/esm2020/radio/radio.type.mjs +54 -50
  25. package/esm2020/select/public_api.mjs +1 -1
  26. package/esm2020/select/select.module.mjs +5 -5
  27. package/esm2020/select/select.type.mjs +62 -90
  28. package/esm2020/textarea/public_api.mjs +1 -1
  29. package/esm2020/textarea/textarea.module.mjs +5 -5
  30. package/esm2020/textarea/textarea.type.mjs +28 -24
  31. package/fesm2015/ngx-formly-bootstrap-addons.mjs +26 -14
  32. package/fesm2015/ngx-formly-bootstrap-addons.mjs.map +1 -1
  33. package/fesm2015/ngx-formly-bootstrap-checkbox.mjs +57 -53
  34. package/fesm2015/ngx-formly-bootstrap-checkbox.mjs.map +1 -1
  35. package/fesm2015/ngx-formly-bootstrap-form-field.mjs +65 -21
  36. package/fesm2015/ngx-formly-bootstrap-form-field.mjs.map +1 -1
  37. package/fesm2015/ngx-formly-bootstrap-input.mjs +38 -34
  38. package/fesm2015/ngx-formly-bootstrap-input.mjs.map +1 -1
  39. package/fesm2015/ngx-formly-bootstrap-multicheckbox.mjs +62 -57
  40. package/fesm2015/ngx-formly-bootstrap-multicheckbox.mjs.map +1 -1
  41. package/fesm2015/ngx-formly-bootstrap-radio.mjs +58 -54
  42. package/fesm2015/ngx-formly-bootstrap-radio.mjs.map +1 -1
  43. package/fesm2015/ngx-formly-bootstrap-select.mjs +66 -94
  44. package/fesm2015/ngx-formly-bootstrap-select.mjs.map +1 -1
  45. package/fesm2015/ngx-formly-bootstrap-textarea.mjs +32 -28
  46. package/fesm2015/ngx-formly-bootstrap-textarea.mjs.map +1 -1
  47. package/fesm2015/ngx-formly-bootstrap.mjs +4 -4
  48. package/fesm2015/ngx-formly-bootstrap.mjs.map +1 -1
  49. package/fesm2020/ngx-formly-bootstrap-addons.mjs +26 -14
  50. package/fesm2020/ngx-formly-bootstrap-addons.mjs.map +1 -1
  51. package/fesm2020/ngx-formly-bootstrap-checkbox.mjs +57 -53
  52. package/fesm2020/ngx-formly-bootstrap-checkbox.mjs.map +1 -1
  53. package/fesm2020/ngx-formly-bootstrap-form-field.mjs +63 -21
  54. package/fesm2020/ngx-formly-bootstrap-form-field.mjs.map +1 -1
  55. package/fesm2020/ngx-formly-bootstrap-input.mjs +38 -34
  56. package/fesm2020/ngx-formly-bootstrap-input.mjs.map +1 -1
  57. package/fesm2020/ngx-formly-bootstrap-multicheckbox.mjs +62 -57
  58. package/fesm2020/ngx-formly-bootstrap-multicheckbox.mjs.map +1 -1
  59. package/fesm2020/ngx-formly-bootstrap-radio.mjs +58 -54
  60. package/fesm2020/ngx-formly-bootstrap-radio.mjs.map +1 -1
  61. package/fesm2020/ngx-formly-bootstrap-select.mjs +66 -94
  62. package/fesm2020/ngx-formly-bootstrap-select.mjs.map +1 -1
  63. package/fesm2020/ngx-formly-bootstrap-textarea.mjs +32 -28
  64. package/fesm2020/ngx-formly-bootstrap-textarea.mjs.map +1 -1
  65. package/fesm2020/ngx-formly-bootstrap.mjs +4 -4
  66. package/fesm2020/ngx-formly-bootstrap.mjs.map +1 -1
  67. package/form-field/field.type.d.ts +10 -0
  68. package/form-field/form-field.wrapper.d.ts +7 -2
  69. package/form-field/public_api.d.ts +2 -0
  70. package/input/input.type.d.ts +10 -2
  71. package/input/public_api.d.ts +1 -1
  72. package/multicheckbox/multicheckbox.type.d.ts +13 -4
  73. package/multicheckbox/public_api.d.ts +1 -1
  74. package/package.json +2 -2
  75. package/radio/public_api.d.ts +1 -1
  76. package/radio/radio.type.d.ts +13 -4
  77. package/select/public_api.d.ts +1 -1
  78. package/select/select.type.d.ts +15 -5
  79. package/textarea/public_api.d.ts +1 -1
  80. package/textarea/textarea.type.d.ts +13 -3
@@ -1,5 +1,5 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, NgModule } from '@angular/core';
2
+ import { Component, ViewEncapsulation, ViewChild, NgModule } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i1$1 from '@ngx-formly/core';
@@ -7,37 +7,49 @@ import { FieldWrapper, FormlyModule } from '@ngx-formly/core';
7
7
  import { ReactiveFormsModule } from '@angular/forms';
8
8
 
9
9
  class FormlyWrapperAddons extends FieldWrapper {
10
+ constructor(hostContainerRef) {
11
+ super();
12
+ this.hostContainerRef = hostContainerRef;
13
+ }
14
+ set content(templateRef) {
15
+ if (templateRef && this.hostContainerRef) {
16
+ this.hostContainerRef.createEmbeddedView(templateRef);
17
+ }
18
+ }
10
19
  addonRightClick($event) {
11
20
  var _a, _b;
12
- (_b = (_a = this.to.addonRight).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, this.field, $event);
21
+ (_b = (_a = this.props.addonRight).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, this.field, $event);
13
22
  }
14
23
  addonLeftClick($event) {
15
24
  var _a, _b;
16
- (_b = (_a = this.to.addonLeft).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, this.field, $event);
25
+ (_b = (_a = this.props.addonLeft).onClick) === null || _b === void 0 ? void 0 : _b.call(_a, this.field, $event);
17
26
  }
18
27
  }
19
- FormlyWrapperAddons.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyWrapperAddons, deps: null, target: i0.ɵɵFactoryTarget.Component });
20
- FormlyWrapperAddons.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: FormlyWrapperAddons, selector: "formly-wrapper-addons", usesInheritance: true, ngImport: i0, template: "<div class=\"input-group\" [class.has-validation]=\"showError\">\n <div\n class=\"input-group-text\"\n *ngIf=\"to.addonLeft\"\n [class.input-group-btn]=\"to.addonLeft.onClick\"\n (click)=\"addonLeftClick($event)\"\n >\n <i [ngClass]=\"to.addonLeft.class\" *ngIf=\"to.addonLeft.class\"></i>\n <span *ngIf=\"to.addonLeft.text\">{{ to.addonLeft.text }}</span>\n </div>\n <div class=\"input-addons\">\n <ng-container #fieldComponent></ng-container>\n </div>\n <div\n class=\"input-group-text\"\n *ngIf=\"to.addonRight\"\n [class.input-group-btn]=\"to.addonRight.onClick\"\n (click)=\"addonRightClick($event)\"\n >\n <i [ngClass]=\"to.addonRight.class\" *ngIf=\"to.addonRight.class\"></i>\n <span *ngIf=\"to.addonRight.text\">{{ to.addonRight.text }}</span>\n </div>\n</div>\n", styles: [":host ::ng-deep .input-group>.input-group-btn{cursor:pointer}:host ::ng-deep .input-group>:not(:first-child) .form-control{border-top-left-radius:0;border-bottom-left-radius:0}:host ::ng-deep .input-group>:not(:last-child) .form-control{border-top-right-radius:0;border-bottom-right-radius:0}:host ::ng-deep .input-group>.input-addons{position:relative;flex:1 1 auto;width:1%;margin-bottom:0}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] });
21
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyWrapperAddons, decorators: [{
28
+ FormlyWrapperAddons.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyWrapperAddons, deps: [{ token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Component });
29
+ FormlyWrapperAddons.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyWrapperAddons, selector: "formly-wrapper-addons", viewQueries: [{ propertyName: "content", first: true, predicate: ["fieldTypeTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0, template: "<ng-template #fieldTypeTemplate>\n <div class=\"input-group\" [class.has-validation]=\"showError\">\n <div\n class=\"input-group-text\"\n *ngIf=\"props.addonLeft\"\n [class.input-group-btn]=\"props.addonLeft.onClick\"\n (click)=\"addonLeftClick($event)\"\n >\n <i [ngClass]=\"props.addonLeft.class\" *ngIf=\"props.addonLeft.class\"></i>\n <span *ngIf=\"props.addonLeft.text\">{{ props.addonLeft.text }}</span>\n </div>\n <ng-container #fieldComponent></ng-container>\n <div\n class=\"input-group-text\"\n *ngIf=\"props.addonRight\"\n [class.input-group-btn]=\"props.addonRight.onClick\"\n (click)=\"addonRightClick($event)\"\n >\n <i [ngClass]=\"props.addonRight.class\" *ngIf=\"props.addonRight.class\"></i>\n <span *ngIf=\"props.addonRight.text\">{{ props.addonRight.text }}</span>\n </div>\n </div>\n</ng-template>\n", styles: ["formly-wrapper-form-field .input-group-btn{cursor:pointer}\n"], directives: [{ type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], encapsulation: i0.ViewEncapsulation.None });
30
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyWrapperAddons, decorators: [{
22
31
  type: Component,
23
- args: [{ selector: 'formly-wrapper-addons', template: "<div class=\"input-group\" [class.has-validation]=\"showError\">\n <div\n class=\"input-group-text\"\n *ngIf=\"to.addonLeft\"\n [class.input-group-btn]=\"to.addonLeft.onClick\"\n (click)=\"addonLeftClick($event)\"\n >\n <i [ngClass]=\"to.addonLeft.class\" *ngIf=\"to.addonLeft.class\"></i>\n <span *ngIf=\"to.addonLeft.text\">{{ to.addonLeft.text }}</span>\n </div>\n <div class=\"input-addons\">\n <ng-container #fieldComponent></ng-container>\n </div>\n <div\n class=\"input-group-text\"\n *ngIf=\"to.addonRight\"\n [class.input-group-btn]=\"to.addonRight.onClick\"\n (click)=\"addonRightClick($event)\"\n >\n <i [ngClass]=\"to.addonRight.class\" *ngIf=\"to.addonRight.class\"></i>\n <span *ngIf=\"to.addonRight.text\">{{ to.addonRight.text }}</span>\n </div>\n</div>\n", styles: [":host ::ng-deep .input-group>.input-group-btn{cursor:pointer}:host ::ng-deep .input-group>:not(:first-child) .form-control{border-top-left-radius:0;border-bottom-left-radius:0}:host ::ng-deep .input-group>:not(:last-child) .form-control{border-top-right-radius:0;border-bottom-right-radius:0}:host ::ng-deep .input-group>.input-addons{position:relative;flex:1 1 auto;width:1%;margin-bottom:0}\n"] }]
24
- }] });
32
+ args: [{ selector: 'formly-wrapper-addons', encapsulation: ViewEncapsulation.None, template: "<ng-template #fieldTypeTemplate>\n <div class=\"input-group\" [class.has-validation]=\"showError\">\n <div\n class=\"input-group-text\"\n *ngIf=\"props.addonLeft\"\n [class.input-group-btn]=\"props.addonLeft.onClick\"\n (click)=\"addonLeftClick($event)\"\n >\n <i [ngClass]=\"props.addonLeft.class\" *ngIf=\"props.addonLeft.class\"></i>\n <span *ngIf=\"props.addonLeft.text\">{{ props.addonLeft.text }}</span>\n </div>\n <ng-container #fieldComponent></ng-container>\n <div\n class=\"input-group-text\"\n *ngIf=\"props.addonRight\"\n [class.input-group-btn]=\"props.addonRight.onClick\"\n (click)=\"addonRightClick($event)\"\n >\n <i [ngClass]=\"props.addonRight.class\" *ngIf=\"props.addonRight.class\"></i>\n <span *ngIf=\"props.addonRight.text\">{{ props.addonRight.text }}</span>\n </div>\n </div>\n</ng-template>\n", styles: ["formly-wrapper-form-field .input-group-btn{cursor:pointer}\n"] }]
33
+ }], ctorParameters: function () { return [{ type: i0.ViewContainerRef }]; }, propDecorators: { content: [{
34
+ type: ViewChild,
35
+ args: ['fieldTypeTemplate', { static: true }]
36
+ }] } });
25
37
 
26
38
  function addonsExtension(field) {
27
- if (!field.templateOptions || (field.wrappers && field.wrappers.indexOf('addons') !== -1)) {
39
+ if (!field.props || (field.wrappers && field.wrappers.indexOf('addons') !== -1)) {
28
40
  return;
29
41
  }
30
- if (field.templateOptions.addonLeft || field.templateOptions.addonRight) {
42
+ if (field.props.addonLeft || field.props.addonRight) {
31
43
  field.wrappers = [...(field.wrappers || []), 'addons'];
32
44
  }
33
45
  }
34
46
 
35
47
  class FormlyBootstrapAddonsModule {
36
48
  }
37
- FormlyBootstrapAddonsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyBootstrapAddonsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
38
- FormlyBootstrapAddonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyBootstrapAddonsModule, declarations: [FormlyWrapperAddons], imports: [CommonModule,
49
+ FormlyBootstrapAddonsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyBootstrapAddonsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
50
+ FormlyBootstrapAddonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyBootstrapAddonsModule, declarations: [FormlyWrapperAddons], imports: [CommonModule,
39
51
  ReactiveFormsModule, i1$1.FormlyModule] });
40
- FormlyBootstrapAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyBootstrapAddonsModule, imports: [[
52
+ FormlyBootstrapAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyBootstrapAddonsModule, imports: [[
41
53
  CommonModule,
42
54
  ReactiveFormsModule,
43
55
  FormlyModule.forChild({
@@ -45,7 +57,7 @@ FormlyBootstrapAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0
45
57
  extensions: [{ name: 'addons', extension: { postPopulate: addonsExtension } }],
46
58
  }),
47
59
  ]] });
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyBootstrapAddonsModule, decorators: [{
60
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyBootstrapAddonsModule, decorators: [{
49
61
  type: NgModule,
50
62
  args: [{
51
63
  declarations: [FormlyWrapperAddons],
@@ -1 +1 @@
1
- {"version":3,"file":"ngx-formly-bootstrap-addons.mjs","sources":["../../../../src/ui/bootstrap/addons/src/addons.component.ts","../../../../src/ui/bootstrap/addons/src/addons.component.html","../../../../src/ui/bootstrap/addons/src/addon.extension.ts","../../../../src/ui/bootstrap/addons/src/addons.module.ts","../../../../src/ui/bootstrap/addons/src/ngx-formly-bootstrap-addons.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { FieldWrapper } from '@ngx-formly/core';\n\n@Component({\n selector: 'formly-wrapper-addons',\n templateUrl: './addons.component.html',\n styleUrls: ['./addons.component.scss'],\n})\nexport class FormlyWrapperAddons extends FieldWrapper {\n addonRightClick($event: any) {\n this.to.addonRight.onClick?.(this.field, $event);\n }\n\n addonLeftClick($event: any) {\n this.to.addonLeft.onClick?.(this.field, $event);\n }\n}\n","<div class=\"input-group\" [class.has-validation]=\"showError\">\n <div\n class=\"input-group-text\"\n *ngIf=\"to.addonLeft\"\n [class.input-group-btn]=\"to.addonLeft.onClick\"\n (click)=\"addonLeftClick($event)\"\n >\n <i [ngClass]=\"to.addonLeft.class\" *ngIf=\"to.addonLeft.class\"></i>\n <span *ngIf=\"to.addonLeft.text\">{{ to.addonLeft.text }}</span>\n </div>\n <div class=\"input-addons\">\n <ng-container #fieldComponent></ng-container>\n </div>\n <div\n class=\"input-group-text\"\n *ngIf=\"to.addonRight\"\n [class.input-group-btn]=\"to.addonRight.onClick\"\n (click)=\"addonRightClick($event)\"\n >\n <i [ngClass]=\"to.addonRight.class\" *ngIf=\"to.addonRight.class\"></i>\n <span *ngIf=\"to.addonRight.text\">{{ to.addonRight.text }}</span>\n </div>\n</div>\n","import { FormlyFieldConfig } from '@ngx-formly/core';\n\nexport function addonsExtension(field: FormlyFieldConfig) {\n if (!field.templateOptions || (field.wrappers && field.wrappers.indexOf('addons') !== -1)) {\n return;\n }\n\n if (field.templateOptions.addonLeft || field.templateOptions.addonRight) {\n field.wrappers = [...(field.wrappers || []), 'addons'];\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 { FormlyWrapperAddons } from './addons.component';\nimport { addonsExtension } from './addon.extension';\n\n@NgModule({\n declarations: [FormlyWrapperAddons],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n FormlyModule.forChild({\n wrappers: [{ name: 'addons', component: FormlyWrapperAddons }],\n extensions: [{ name: 'addons', extension: { postPopulate: addonsExtension } }],\n }),\n ],\n})\nexport class FormlyBootstrapAddonsModule {}\n","/**\n * Gener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EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE,CAAC;aAC/E,CAAC;SACH,CAAA,EAAA,CAAA,CAAA;2FAEU,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAZvC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;oBACR,YAAY,EAAE,CAAC,mBAAmB,CAAC;AACnC,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,mBAAmB;wBAEnB,YAAY,CAAC,QAAQ,CAAC;4BACpB,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;AAC9D,4BAAA,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE,CAAC;yBAC/E,CAAC;AACH,qBAAA;iBACF,CAAA;;;ACnBD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngx-formly-bootstrap-addons.mjs","sources":["../../../../src/ui/bootstrap/addons/src/addons.component.ts","../../../../src/ui/bootstrap/addons/src/addons.component.html","../../../../src/ui/bootstrap/addons/src/addon.extension.ts","../../../../src/ui/bootstrap/addons/src/addons.module.ts","../../../../src/ui/bootstrap/addons/src/ngx-formly-bootstrap-addons.ts"],"sourcesContent":["import { Component, TemplateRef, ViewChild, ViewContainerRef, ViewEncapsulation } from '@angular/core';\nimport { FormlyFieldConfig, FieldTypeConfig, FieldWrapper } from '@ngx-formly/core';\nimport { FormlyFieldProps } from '@ngx-formly/bootstrap/form-field';\n\ninterface AddonsProps extends FormlyFieldProps {\n addonRight?: {\n onClick?: (field: FormlyFieldConfig, event?: any) => void;\n class?: string;\n text?: string;\n };\n addonLeft?: {\n onClick?: (field: FormlyFieldConfig, event?: any) => void;\n class?: string;\n text?: string;\n };\n}\n\n@Component({\n selector: 'formly-wrapper-addons',\n templateUrl: './addons.component.html',\n styleUrls: ['./addons.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class FormlyWrapperAddons extends FieldWrapper<FieldTypeConfig<AddonsProps>> {\n @ViewChild('fieldTypeTemplate', { static: true }) set content(templateRef: TemplateRef<any>) {\n if (templateRef && this.hostContainerRef) {\n this.hostContainerRef.createEmbeddedView(templateRef);\n }\n }\n\n constructor(private hostContainerRef?: ViewContainerRef) {\n super();\n }\n\n addonRightClick($event: any) {\n this.props.addonRight.onClick?.(this.field, $event);\n }\n\n addonLeftClick($event: any) {\n this.props.addonLeft.onClick?.(this.field, $event);\n }\n}\n","<ng-template #fieldTypeTemplate>\n <div class=\"input-group\" [class.has-validation]=\"showError\">\n <div\n class=\"input-group-text\"\n *ngIf=\"props.addonLeft\"\n [class.input-group-btn]=\"props.addonLeft.onClick\"\n (click)=\"addonLeftClick($event)\"\n >\n <i [ngClass]=\"props.addonLeft.class\" *ngIf=\"props.addonLeft.class\"></i>\n <span *ngIf=\"props.addonLeft.text\">{{ props.addonLeft.text }}</span>\n </div>\n <ng-container #fieldComponent></ng-container>\n <div\n class=\"input-group-text\"\n *ngIf=\"props.addonRight\"\n [class.input-group-btn]=\"props.addonRight.onClick\"\n (click)=\"addonRightClick($event)\"\n >\n <i [ngClass]=\"props.addonRight.class\" *ngIf=\"props.addonRight.class\"></i>\n <span *ngIf=\"props.addonRight.text\">{{ props.addonRight.text }}</span>\n </div>\n </div>\n</ng-template>\n","import { FormlyFieldConfig } from '@ngx-formly/core';\n\nexport function addonsExtension(field: FormlyFieldConfig) {\n if (!field.props || (field.wrappers && field.wrappers.indexOf('addons') !== -1)) {\n return;\n }\n\n if (field.props.addonLeft || field.props.addonRight) {\n field.wrappers = [...(field.wrappers || []), 'addons'];\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 { FormlyWrapperAddons } from './addons.component';\nimport { addonsExtension } from './addon.extension';\n\n@NgModule({\n declarations: [FormlyWrapperAddons],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n\n FormlyModule.forChild({\n wrappers: [{ name: 'addons', component: FormlyWrapperAddons }],\n extensions: [{ name: 'addons', extension: { postPopulate: addonsExtension } }],\n }),\n ],\n})\nexport class FormlyBootstrapAddonsModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["i1"],"mappings":";;;;;;;;AAuBM,MAAO,mBAAoB,SAAQ,YAA0C,CAAA;AAOjF,IAAA,WAAA,CAAoB,gBAAmC,EAAA;AACrD,QAAA,KAAK,EAAE,CAAC;AADU,QAAA,IAAgB,CAAA,gBAAA,GAAhB,gBAAgB,CAAmB;KAEtD;IARD,IAAsD,OAAO,CAAC,WAA6B,EAAA;AACzF,QAAA,IAAI,WAAW,IAAI,IAAI,CAAC,gBAAgB,EAAE;AACxC,YAAA,IAAI,CAAC,gBAAgB,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;AACvD,SAAA;KACF;AAMD,IAAA,eAAe,CAAC,MAAW,EAAA;;AACzB,QAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,IAAI,CAAC,KAAK,CAAC,UAAU,EAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,EAAG,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;KACrD;AAED,IAAA,cAAc,CAAC,MAAW,EAAA;;AACxB,QAAA,CAAA,EAAA,GAAA,CAAA,EAAA,GAAA,IAAI,CAAC,KAAK,CAAC,SAAS,EAAC,OAAO,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,IAAA,CAAA,EAAA,EAAG,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;KACpD;;iHAjBU,mBAAmB,EAAA,IAAA,EAAA,CAAA,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A,UAAU,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,eAAe,EAAE,EAAE,CAAC;yBAC/E,CAAC;AACH,qBAAA;iBACF,CAAA;;;ACnBD;;AAEG;;;;"}
@@ -3,73 +3,77 @@ import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
3
  import * as i1 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i3 from '@ngx-formly/core';
6
- import { FieldType, FormlyModule } from '@ngx-formly/core';
6
+ import { FormlyModule } from '@ngx-formly/core';
7
7
  import * as i2 from '@angular/forms';
8
8
  import { ReactiveFormsModule } from '@angular/forms';
9
- import { FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';
9
+ import { FieldType, FormlyBootstrapFormFieldModule } from '@ngx-formly/bootstrap/form-field';
10
10
 
11
11
  class FormlyFieldCheckbox extends FieldType {
12
12
  constructor() {
13
13
  super(...arguments);
14
14
  this.defaultOptions = {
15
- templateOptions: {
15
+ props: {
16
16
  indeterminate: true,
17
17
  hideLabel: true,
18
- formCheck: 'default', // 'default' | 'inline' | 'switch' | 'inline-switch' | 'nolabel'
18
+ formCheck: 'default',
19
19
  },
20
20
  };
21
21
  }
22
22
  }
23
- FormlyFieldCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyFieldCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component });
24
- FormlyFieldCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", 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>
23
+ FormlyFieldCheckbox.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Component });
24
+ FormlyFieldCheckbox.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyFieldCheckbox, selector: "formly-field-checkbox", usesInheritance: true, ngImport: i0, template: `
25
+ <ng-template #fieldTypeTemplate>
26
+ <div
27
+ class="form-check"
28
+ [ngClass]="{
29
+ 'form-check-inline': props.formCheck === 'inline' || props.formCheck === 'inline-switch',
30
+ 'form-switch': props.formCheck === 'switch' || props.formCheck === 'inline-switch'
31
+ }"
32
+ >
33
+ <input
34
+ type="checkbox"
35
+ [class.is-invalid]="showError"
36
+ class="form-check-input"
37
+ [class.position-static]="props.formCheck === 'nolabel'"
38
+ [indeterminate]="props.indeterminate && formControl.value == null"
39
+ [formControl]="formControl"
40
+ [formlyAttributes]="field"
41
+ />
42
+ <label *ngIf="props.formCheck !== 'nolabel'" [for]="id" class="form-check-label">
43
+ {{ props.label }}
44
+ <span *ngIf="props.required && props.hideRequiredMarker !== true" aria-hidden="true">*</span>
45
+ </label>
46
+ </div>
47
+ </ng-template>
46
48
  `, 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.2.6", ngImport: i0, type: FormlyFieldCheckbox, decorators: [{
49
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyFieldCheckbox, decorators: [{
48
50
  type: Component,
49
51
  args: [{
50
52
  selector: 'formly-field-checkbox',
51
53
  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>
54
+ <ng-template #fieldTypeTemplate>
55
+ <div
56
+ class="form-check"
57
+ [ngClass]="{
58
+ 'form-check-inline': props.formCheck === 'inline' || props.formCheck === 'inline-switch',
59
+ 'form-switch': props.formCheck === 'switch' || props.formCheck === 'inline-switch'
60
+ }"
61
+ >
62
+ <input
63
+ type="checkbox"
64
+ [class.is-invalid]="showError"
65
+ class="form-check-input"
66
+ [class.position-static]="props.formCheck === 'nolabel'"
67
+ [indeterminate]="props.indeterminate && formControl.value == null"
68
+ [formControl]="formControl"
69
+ [formlyAttributes]="field"
70
+ />
71
+ <label *ngIf="props.formCheck !== 'nolabel'" [for]="id" class="form-check-label">
72
+ {{ props.label }}
73
+ <span *ngIf="props.required && props.hideRequiredMarker !== true" aria-hidden="true">*</span>
74
+ </label>
75
+ </div>
76
+ </ng-template>
73
77
  `,
74
78
  changeDetection: ChangeDetectionStrategy.OnPush,
75
79
  }]
@@ -77,11 +81,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
77
81
 
78
82
  class FormlyBootstrapCheckboxModule {
79
83
  }
80
- FormlyBootstrapCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyBootstrapCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
81
- FormlyBootstrapCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyBootstrapCheckboxModule, declarations: [FormlyFieldCheckbox], imports: [CommonModule,
84
+ FormlyBootstrapCheckboxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyBootstrapCheckboxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
85
+ FormlyBootstrapCheckboxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyBootstrapCheckboxModule, declarations: [FormlyFieldCheckbox], imports: [CommonModule,
82
86
  ReactiveFormsModule,
83
87
  FormlyBootstrapFormFieldModule, i3.FormlyModule] });
84
- FormlyBootstrapCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyBootstrapCheckboxModule, imports: [[
88
+ FormlyBootstrapCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyBootstrapCheckboxModule, imports: [[
85
89
  CommonModule,
86
90
  ReactiveFormsModule,
87
91
  FormlyBootstrapFormFieldModule,
@@ -99,7 +103,7 @@ FormlyBootstrapCheckboxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12
99
103
  ],
100
104
  }),
101
105
  ]] });
102
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyBootstrapCheckboxModule, decorators: [{
106
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyBootstrapCheckboxModule, decorators: [{
103
107
  type: NgModule,
104
108
  args: [{
105
109
  declarations: [FormlyFieldCheckbox],
@@ -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.module.ts","../../../../src/ui/bootstrap/checkbox/src/ngx-formly-bootstrap-checkbox.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy } from '@angular/core';\nimport { FieldType, FieldTypeConfig } 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<FieldTypeConfig> {\n override 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":["i1"],"mappings":";;;;;;;;;;AA8BM,MAAO,mBAAoB,SAAQ,SAA0B,CAAA;AA3BnE,IAAA,WAAA,GAAA;;QA4BW,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,eAAe,EAAE;AACf,gBAAA,aAAa,EAAE,IAAI;AACnB,gBAAA,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,SAAS;AACrB,aAAA;SACF,CAAC;KACH;;gHARY,mBAAmB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,mBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,mBAAmB,EAzBpB,QAAA,EAAA,uBAAA,EAAA,eAAA,EAAA,IAAA,E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CAAA,OAAO,EAAE,UAAU;AACpB,iCAAA;AACF,6BAAA;yBACF,CAAC;AACH,qBAAA;iBACF,CAAA;;;AC7BD;;AAEG;;;;"}
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, 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 />\n <label *ngIf=\"props.formCheck !== 'nolabel'\" [for]=\"id\" class=\"form-check-label\">\n {{ props.label }}\n <span *ngIf=\"props.required && props.hideRequiredMarker !== true\" aria-hidden=\"true\">*</span>\n </label>\n </div>\n </ng-template>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\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 { 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":["i1"],"mappings":";;;;;;;;;;AA0CM,MAAO,mBAAoB,SAAQ,SAAyC,CAAA;AA7BlF,IAAA,WAAA,GAAA;;QA8BW,IAAA,CAAA,cAAc,GAAG;AACxB,YAAA,KAAK,EAAE;AACL,gBAAA,aAAa,EAAE,IAAI;AACnB,gBAAA,SAAS,EAAE,IAAI;AACf,gBAAA,SAAS,EAAE,SAAkB;AAC9B,aAAA;SACF,CAAC;KACH;;iHARY,mBAAmB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAnB,mBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,mBAAmB,EA3BpB,QAAA,EAAA,uBAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;AAwBT,EAAA,CAAA,EAAA,QAAA,EAAA,I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
@@ -1,48 +1,68 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, NgModule } from '@angular/core';
2
+ import { Component, NgModule, Directive, Optional, ViewChild } from '@angular/core';
3
3
  import * as i2 from '@angular/common';
4
4
  import { CommonModule } from '@angular/common';
5
5
  import * as i1 from '@ngx-formly/core';
6
- import { FieldWrapper, FormlyModule } from '@ngx-formly/core';
6
+ import { FieldWrapper, FormlyModule, FieldType as FieldType$1 } from '@ngx-formly/core';
7
7
  import { ReactiveFormsModule } from '@angular/forms';
8
8
 
9
9
  class FormlyWrapperFormField extends FieldWrapper {
10
10
  }
11
- FormlyWrapperFormField.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyWrapperFormField, deps: null, target: i0.ɵɵFactoryTarget.Component });
12
- FormlyWrapperFormField.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", 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>
11
+ FormlyWrapperFormField.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyWrapperFormField, deps: null, target: i0.ɵɵFactoryTarget.Component });
12
+ FormlyWrapperFormField.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: FormlyWrapperFormField, selector: "formly-wrapper-form-field", usesInheritance: true, ngImport: i0, template: `
13
+ <ng-template #labelTemplate>
14
+ <label *ngIf="props.label && props.hideLabel !== true" [attr.for]="id" class="form-label">
15
+ {{ props.label }}
16
+ <span *ngIf="props.required && props.hideRequiredMarker !== true" aria-hidden="true">*</span>
17
17
  </label>
18
+ </ng-template>
19
+
20
+ <div class="mb-3" [class.form-floating]="props.labelPosition === 'floating'" [class.has-error]="showError">
21
+ <ng-container *ngIf="props.labelPosition !== 'floating'">
22
+ <ng-container [ngTemplateOutlet]="labelTemplate"></ng-container>
23
+ </ng-container>
18
24
 
19
25
  <ng-template #fieldComponent></ng-template>
20
26
 
27
+ <ng-container *ngIf="props.labelPosition === 'floating'">
28
+ <ng-container [ngTemplateOutlet]="labelTemplate"></ng-container>
29
+ </ng-container>
30
+
21
31
  <div *ngIf="showError" class="invalid-feedback" [style.display]="'block'">
22
32
  <formly-validation-message [field]="field"></formly-validation-message>
23
33
  </div>
24
34
 
25
- <small *ngIf="to.description" class="form-text text-muted">{{ to.description }}</small>
35
+ <small *ngIf="props.description" class="form-text text-muted">{{ props.description }}</small>
26
36
  </div>
27
- `, isInline: true, components: [{ type: i1.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
28
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyWrapperFormField, decorators: [{
37
+ `, isInline: true, components: [{ type: i1.ɵFormlyValidationMessage, selector: "formly-validation-message", inputs: ["field"] }], directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }] });
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyWrapperFormField, decorators: [{
29
39
  type: Component,
30
40
  args: [{
31
41
  selector: 'formly-wrapper-form-field',
32
42
  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>
43
+ <ng-template #labelTemplate>
44
+ <label *ngIf="props.label && props.hideLabel !== true" [attr.for]="id" class="form-label">
45
+ {{ props.label }}
46
+ <span *ngIf="props.required && props.hideRequiredMarker !== true" aria-hidden="true">*</span>
37
47
  </label>
48
+ </ng-template>
49
+
50
+ <div class="mb-3" [class.form-floating]="props.labelPosition === 'floating'" [class.has-error]="showError">
51
+ <ng-container *ngIf="props.labelPosition !== 'floating'">
52
+ <ng-container [ngTemplateOutlet]="labelTemplate"></ng-container>
53
+ </ng-container>
38
54
 
39
55
  <ng-template #fieldComponent></ng-template>
40
56
 
57
+ <ng-container *ngIf="props.labelPosition === 'floating'">
58
+ <ng-container [ngTemplateOutlet]="labelTemplate"></ng-container>
59
+ </ng-container>
60
+
41
61
  <div *ngIf="showError" class="invalid-feedback" [style.display]="'block'">
42
62
  <formly-validation-message [field]="field"></formly-validation-message>
43
63
  </div>
44
64
 
45
- <small *ngIf="to.description" class="form-text text-muted">{{ to.description }}</small>
65
+ <small *ngIf="props.description" class="form-text text-muted">{{ props.description }}</small>
46
66
  </div>
47
67
  `,
48
68
  }]
@@ -50,10 +70,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
50
70
 
51
71
  class FormlyBootstrapFormFieldModule {
52
72
  }
53
- FormlyBootstrapFormFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyBootstrapFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
54
- FormlyBootstrapFormFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyBootstrapFormFieldModule, declarations: [FormlyWrapperFormField], imports: [CommonModule,
73
+ FormlyBootstrapFormFieldModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyBootstrapFormFieldModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
74
+ FormlyBootstrapFormFieldModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyBootstrapFormFieldModule, declarations: [FormlyWrapperFormField], imports: [CommonModule,
55
75
  ReactiveFormsModule, i1.FormlyModule] });
56
- FormlyBootstrapFormFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyBootstrapFormFieldModule, imports: [[
76
+ FormlyBootstrapFormFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyBootstrapFormFieldModule, imports: [[
57
77
  CommonModule,
58
78
  ReactiveFormsModule,
59
79
  FormlyModule.forChild({
@@ -65,7 +85,7 @@ FormlyBootstrapFormFieldModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "1
65
85
  ],
66
86
  }),
67
87
  ]] });
68
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: FormlyBootstrapFormFieldModule, decorators: [{
88
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FormlyBootstrapFormFieldModule, decorators: [{
69
89
  type: NgModule,
70
90
  args: [{
71
91
  declarations: [FormlyWrapperFormField],
@@ -84,9 +104,33 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImpor
84
104
  }]
85
105
  }] });
86
106
 
107
+ class FieldType extends FieldType$1 {
108
+ constructor(hostContainerRef) {
109
+ super();
110
+ this.hostContainerRef = hostContainerRef;
111
+ }
112
+ set content(templateRef) {
113
+ if (templateRef && this.hostContainerRef) {
114
+ this.hostContainerRef.createEmbeddedView(templateRef);
115
+ }
116
+ }
117
+ }
118
+ FieldType.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FieldType, deps: [{ token: i0.ViewContainerRef, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
119
+ FieldType.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.11", type: FieldType, viewQueries: [{ propertyName: "content", first: true, predicate: ["fieldTypeTemplate"], descendants: true, static: true }], usesInheritance: true, ngImport: i0 });
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: FieldType, decorators: [{
121
+ type: Directive
122
+ }], ctorParameters: function () {
123
+ return [{ type: i0.ViewContainerRef, decorators: [{
124
+ type: Optional
125
+ }] }];
126
+ }, propDecorators: { content: [{
127
+ type: ViewChild,
128
+ args: ['fieldTypeTemplate', { static: true }]
129
+ }] } });
130
+
87
131
  /**
88
132
  * Generated bundle index. Do not edit.
89
133
  */
90
134
 
91
- export { FormlyBootstrapFormFieldModule };
135
+ export { FieldType, FormlyBootstrapFormFieldModule };
92
136
  //# sourceMappingURL=ngx-formly-bootstrap-form-field.mjs.map
@@ -1 +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 } 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})\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":";;;;;;;;AAsBM,MAAO,sBAAuB,SAAQ,YAAY,CAAA;;mHAA3C,sBAAsB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,sBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,sBAAsB,EAjBvB,QAAA,EAAA,2BAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;;;;;;;;;;;;GAeT,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,wBAAA,EAAA,QAAA,EAAA,2BAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,IAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;2FAEU,sBAAsB,EAAA,UAAA,EAAA,CAAA;kBAnBl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AEG;;;;"}
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/field.type.ts","../../../../src/ui/bootstrap/form-field/src/ngx-formly-bootstrap-form-field.ts"],"sourcesContent":["import { Component } from '@angular/core';\nimport { FieldWrapper, FormlyFieldConfig, FormlyFieldProps as CoreFormlyFieldProps } from '@ngx-formly/core';\n\nexport interface FormlyFieldProps extends CoreFormlyFieldProps {\n hideLabel?: boolean;\n hideRequiredMarker?: boolean;\n labelPosition?: 'floating';\n}\n\n@Component({\n selector: 'formly-wrapper-form-field',\n template: `\n <ng-template #labelTemplate>\n <label *ngIf=\"props.label && props.hideLabel !== true\" [attr.for]=\"id\" class=\"form-label\">\n {{ props.label }}\n <span *ngIf=\"props.required && props.hideRequiredMarker !== true\" aria-hidden=\"true\">*</span>\n </label>\n </ng-template>\n\n <div class=\"mb-3\" [class.form-floating]=\"props.labelPosition === 'floating'\" [class.has-error]=\"showError\">\n <ng-container *ngIf=\"props.labelPosition !== 'floating'\">\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n </ng-container>\n\n <ng-template #fieldComponent></ng-template>\n\n <ng-container *ngIf=\"props.labelPosition === 'floating'\">\n <ng-container [ngTemplateOutlet]=\"labelTemplate\"></ng-container>\n </ng-container>\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=\"props.description\" class=\"form-text text-muted\">{{ props.description }}</small>\n </div>\n `,\n})\nexport class FormlyWrapperFormField extends FieldWrapper<FormlyFieldConfig<FormlyFieldProps>> {}\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","import { Directive, Optional, TemplateRef, ViewChild, ViewContainerRef } from '@angular/core';\nimport { FieldType as CoreFieldType, FormlyFieldConfig } from '@ngx-formly/core';\n\n@Directive()\nexport abstract class FieldType<F extends FormlyFieldConfig = FormlyFieldConfig> extends CoreFieldType<F> {\n @ViewChild('fieldTypeTemplate', { static: true }) set content(templateRef: TemplateRef<any>) {\n if (templateRef && this.hostContainerRef) {\n this.hostContainerRef.createEmbeddedView(templateRef);\n }\n }\n\n constructor(@Optional() private hostContainerRef?: ViewContainerRef) {\n super();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":["CoreFieldType"],"mappings":";;;;;;;;AAsCM,MAAO,sBAAuB,SAAQ,YAAiD,CAAA;;oHAAhF,sBAAsB,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;AAAtB,sBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,oBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,IAAA,EAAA,sBAAsB,EA3BvB,QAAA,EAAA,2BAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,wBAAA,EAAA,QAAA,EAAA,2BAAA,EAAA,MAAA,EAAA,CAAA,OAAA,CAAA,EAAA,CAAA,EAAA,UAAA,EAAA,CAAA,EAA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