@ng-forge/dynamic-forms-bootstrap 1.2.0-next.5 → 1.2.0-next.7
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/fesm2022/ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-BAPwLlkJ.mjs +25 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-BAPwLlkJ.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-addon-button.mjs +77 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-addon-button.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-addon-icon.mjs +35 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-addon-icon.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-button.mjs +74 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-button.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-checkbox.mjs +82 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-checkbox.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-datepicker.mjs +177 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-datepicker.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-input.mjs +339 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-input.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-multi-checkbox.mjs +141 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-multi-checkbox.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-radio.mjs +184 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-radio.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-select.mjs +102 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-select.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-slider.mjs +93 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-slider.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-textarea.mjs +150 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-textarea.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-toggle.mjs +82 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-toggle.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-shared.mjs +44 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-shared.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap.mjs +43 -139
- package/fesm2022/ng-forge-dynamic-forms-bootstrap.mjs.map +1 -1
- package/package.json +55 -3
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-addon-button.d.ts +19 -0
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-addon-icon.d.ts +18 -0
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-button.d.ts +121 -0
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-checkbox.d.ts +23 -0
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-datepicker.d.ts +33 -0
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-input.d.ts +51 -0
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-multi-checkbox.d.ts +28 -0
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-radio.d.ts +24 -0
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-select.d.ts +33 -0
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-slider.d.ts +40 -0
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-textarea.d.ts +23 -0
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-toggle.d.ts +22 -0
- package/types/ng-forge-dynamic-forms-bootstrap-shared.d.ts +100 -0
- package/types/ng-forge-dynamic-forms-bootstrap.d.ts +9 -138
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { FormField } from '@angular/forms/signals';
|
|
4
|
+
import * as i1 from '@ng-forge/dynamic-forms/integration';
|
|
5
|
+
import { injectNgForgeField, NgForgeControl, DynamicTextPipe, NgForgeFieldHost } from '@ng-forge/dynamic-forms/integration';
|
|
6
|
+
import { AsyncPipe } from '@angular/common';
|
|
7
|
+
|
|
8
|
+
class BsToggleFieldComponent {
|
|
9
|
+
ngf = injectNgForgeField();
|
|
10
|
+
props = input(/* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
12
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: BsToggleFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: BsToggleFieldComponent, isStandalone: true, selector: "df-bs-toggle", inputs: { props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
14
|
+
@let f = ngf.field(); @let inputId = ngf.key() + '-input';
|
|
15
|
+
|
|
16
|
+
<div
|
|
17
|
+
class="form-check form-switch"
|
|
18
|
+
[class.form-check-inline]="props()?.inline"
|
|
19
|
+
[class.form-check-reverse]="props()?.reverse"
|
|
20
|
+
[class.form-switch-sm]="props()?.size === 'sm'"
|
|
21
|
+
[class.form-switch-lg]="props()?.size === 'lg'"
|
|
22
|
+
[attr.hidden]="f().hidden() || null"
|
|
23
|
+
>
|
|
24
|
+
<input
|
|
25
|
+
ngForgeControl
|
|
26
|
+
type="checkbox"
|
|
27
|
+
[formField]="f"
|
|
28
|
+
[id]="inputId"
|
|
29
|
+
class="form-check-input"
|
|
30
|
+
[class.is-invalid]="f().invalid() && f().touched()"
|
|
31
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
32
|
+
/>
|
|
33
|
+
<label [for]="inputId" class="form-check-label">
|
|
34
|
+
{{ ngf.label() | dynamicText | async }}
|
|
35
|
+
</label>
|
|
36
|
+
</div>
|
|
37
|
+
|
|
38
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
39
|
+
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
40
|
+
} @else if (props()?.hint; as hint) {
|
|
41
|
+
<div class="form-text" [id]="ngf.hintId()" [attr.hidden]="f().hidden() || null">{{ hint | dynamicText | async }}</div>
|
|
42
|
+
}
|
|
43
|
+
`, isInline: true, styles: [".df-bs-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%;margin-bottom:var(--df-bs-field-margin-bottom, 1rem)}.df-bs-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit);margin-bottom:0}.df-bs-hint{color:var(--df-hint-color, var(--bs-secondary-color, #6c757d));font-size:var(--df-hint-font-size, .875rem);margin-top:var(--df-bs-hint-margin-top, .25rem)}.df-bs-field:has(.df-bs-hint){margin-bottom:var(--df-bs-field-with-hint-margin-bottom, .5rem)}:host([hidden]){display:none!important}\n", ":host{display:block}:host([hidden]){display:none!important}.form-switch-sm .form-check-input{width:1.75rem;height:1rem;font-size:.875rem}.form-switch-lg .form-check-input{width:3rem;height:1.75rem;font-size:1.125rem}\n"], dependencies: [{ kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "directive", type: NgForgeControl, selector: "[ngForgeControl]", inputs: ["ngForgeControl"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
44
|
+
}
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: BsToggleFieldComponent, decorators: [{
|
|
46
|
+
type: Component,
|
|
47
|
+
args: [{ selector: 'df-bs-toggle', imports: [FormField, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
48
|
+
@let f = ngf.field(); @let inputId = ngf.key() + '-input';
|
|
49
|
+
|
|
50
|
+
<div
|
|
51
|
+
class="form-check form-switch"
|
|
52
|
+
[class.form-check-inline]="props()?.inline"
|
|
53
|
+
[class.form-check-reverse]="props()?.reverse"
|
|
54
|
+
[class.form-switch-sm]="props()?.size === 'sm'"
|
|
55
|
+
[class.form-switch-lg]="props()?.size === 'lg'"
|
|
56
|
+
[attr.hidden]="f().hidden() || null"
|
|
57
|
+
>
|
|
58
|
+
<input
|
|
59
|
+
ngForgeControl
|
|
60
|
+
type="checkbox"
|
|
61
|
+
[formField]="f"
|
|
62
|
+
[id]="inputId"
|
|
63
|
+
class="form-check-input"
|
|
64
|
+
[class.is-invalid]="f().invalid() && f().touched()"
|
|
65
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
66
|
+
/>
|
|
67
|
+
<label [for]="inputId" class="form-check-label">
|
|
68
|
+
{{ ngf.label() | dynamicText | async }}
|
|
69
|
+
</label>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
73
|
+
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
74
|
+
} @else if (props()?.hint; as hint) {
|
|
75
|
+
<div class="form-text" [id]="ngf.hintId()" [attr.hidden]="f().hidden() || null">{{ hint | dynamicText | async }}</div>
|
|
76
|
+
}
|
|
77
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".df-bs-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%;margin-bottom:var(--df-bs-field-margin-bottom, 1rem)}.df-bs-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit);margin-bottom:0}.df-bs-hint{color:var(--df-hint-color, var(--bs-secondary-color, #6c757d));font-size:var(--df-hint-font-size, .875rem);margin-top:var(--df-bs-hint-margin-top, .25rem)}.df-bs-field:has(.df-bs-hint){margin-bottom:var(--df-bs-field-with-hint-margin-bottom, .5rem)}:host([hidden]){display:none!important}\n", ":host{display:block}:host([hidden]){display:none!important}.form-switch-sm .form-check-input{width:1.75rem;height:1rem;font-size:.875rem}.form-switch-lg .form-check-input{width:3rem;height:1.75rem;font-size:1.125rem}\n"] }]
|
|
78
|
+
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
export { BsToggleFieldComponent };
|
|
82
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-bootstrap-lazy-toggle.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-bootstrap-lazy-toggle.mjs","mappings":";;;;;;;AAqEc;;AAGH;;;AAHU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA3BlB;;;;AAlCS","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-bootstrap/src/lib/fields/toggle/bs-toggle.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { FormField } from '@angular/forms/signals';\nimport { DynamicTextPipe } from '@ng-forge/dynamic-forms/integration';\nimport { NgForgeControl, injectNgForgeField, NgForgeFieldHost } from '@ng-forge/dynamic-forms/integration';\nimport { BsToggleProps } from './bs-toggle.type';\nimport { AsyncPipe } from '@angular/common';\n\n@Component({\n selector: 'df-bs-toggle',\n imports: [FormField, DynamicTextPipe, AsyncPipe, NgForgeControl],\n styleUrl: '../../styles/_form-field.scss',\n hostDirectives: [NgForgeFieldHost],\n template: `\n @let f = ngf.field(); @let inputId = ngf.key() + '-input';\n\n <div\n class=\"form-check form-switch\"\n [class.form-check-inline]=\"props()?.inline\"\n [class.form-check-reverse]=\"props()?.reverse\"\n [class.form-switch-sm]=\"props()?.size === 'sm'\"\n [class.form-switch-lg]=\"props()?.size === 'lg'\"\n [attr.hidden]=\"f().hidden() || null\"\n >\n <input\n ngForgeControl\n type=\"checkbox\"\n [formField]=\"f\"\n [id]=\"inputId\"\n class=\"form-check-input\"\n [class.is-invalid]=\"f().invalid() && f().touched()\"\n [attr.tabindex]=\"ngf.tabIndex()\"\n />\n <label [for]=\"inputId\" class=\"form-check-label\">\n {{ ngf.label() | dynamicText | async }}\n </label>\n </div>\n\n @if (ngf.errorsToDisplay()[0]; as error) {\n <div class=\"invalid-feedback d-block\" [id]=\"ngf.errorId()\" role=\"alert\">{{ error.message }}</div>\n } @else if (props()?.hint; as hint) {\n <div class=\"form-text\" [id]=\"ngf.hintId()\" [attr.hidden]=\"f().hidden() || null\">{{ hint | dynamicText | async }}</div>\n }\n `,\n styles: [\n `\n :host {\n display: block;\n }\n\n :host([hidden]) {\n display: none !important;\n }\n\n /* Custom size variants for switches */\n .form-switch-sm .form-check-input {\n width: 1.75rem;\n height: 1rem;\n font-size: 0.875rem;\n }\n\n .form-switch-lg .form-check-input {\n width: 3rem;\n height: 1.75rem;\n font-size: 1.125rem;\n }\n `,\n ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class BsToggleFieldComponent {\n protected readonly ngf = injectNgForgeField<boolean>();\n\n readonly props = input<BsToggleProps>();\n}\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, input, inject, ElementRef, Directive } from '@angular/core';
|
|
3
|
+
import { explicitEffect } from 'ngxtension/explicit-effect';
|
|
4
|
+
import { runPresetAction } from '@ng-forge/dynamic-forms/integration';
|
|
5
|
+
|
|
6
|
+
const BOOTSTRAP_CONFIG = new InjectionToken('BOOTSTRAP_CONFIG');
|
|
7
|
+
|
|
8
|
+
const BS_INPUT_TYPE_OVERRIDE = new InjectionToken('BS_INPUT_TYPE_OVERRIDE');
|
|
9
|
+
|
|
10
|
+
class InputConstraintsDirective {
|
|
11
|
+
dfMin = input(/* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [undefined, { debugName: "dfMin" }] : /* istanbul ignore next */ []));
|
|
13
|
+
dfMax = input(/* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [undefined, { debugName: "dfMax" }] : /* istanbul ignore next */ []));
|
|
15
|
+
dfStep = input(/* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [undefined, { debugName: "dfStep" }] : /* istanbul ignore next */ []));
|
|
17
|
+
element = inject(ElementRef);
|
|
18
|
+
minEffect = explicitEffect([this.dfMin], ([value]) => this.reflectAttribute('min', value));
|
|
19
|
+
maxEffect = explicitEffect([this.dfMax], ([value]) => this.reflectAttribute('max', value));
|
|
20
|
+
stepEffect = explicitEffect([this.dfStep], ([value]) => this.reflectAttribute('step', value));
|
|
21
|
+
reflectAttribute(name, value) {
|
|
22
|
+
if (value === null || value === undefined) {
|
|
23
|
+
this.element.nativeElement.removeAttribute(name);
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
this.element.nativeElement.setAttribute(name, String(value));
|
|
27
|
+
}
|
|
28
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: InputConstraintsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
29
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.1", type: InputConstraintsDirective, isStandalone: true, selector: "[dfBsInputConstraints]", inputs: { dfMin: { classPropertyName: "dfMin", publicName: "dfMin", isSignal: true, isRequired: false, transformFunction: null }, dfMax: { classPropertyName: "dfMax", publicName: "dfMax", isSignal: true, isRequired: false, transformFunction: null }, dfStep: { classPropertyName: "dfStep", publicName: "dfStep", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
30
|
+
}
|
|
31
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: InputConstraintsDirective, decorators: [{
|
|
32
|
+
type: Directive,
|
|
33
|
+
args: [{
|
|
34
|
+
selector: '[dfBsInputConstraints]',
|
|
35
|
+
}]
|
|
36
|
+
}], propDecorators: { dfMin: [{ type: i0.Input, args: [{ isSignal: true, alias: "dfMin", required: false }] }], dfMax: [{ type: i0.Input, args: [{ isSignal: true, alias: "dfMax", required: false }] }], dfStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "dfStep", required: false }] }] } });
|
|
37
|
+
|
|
38
|
+
function runBsPresetAction(preset, context, collaborators) {
|
|
39
|
+
return runPresetAction(preset, context, collaborators, 'Bootstrap', 'bs-input');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
export { BOOTSTRAP_CONFIG, BS_INPUT_TYPE_OVERRIDE, InputConstraintsDirective, runBsPresetAction };
|
|
44
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-bootstrap-shared.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-bootstrap-shared.mjs","mappings":";;;;;;;;;;AAQW;;AACA;;AACA;;AAEQ;;;;;;;;;AAWf;;;;;;;AAnBO;AACT;AACD;;;;ACKC;AACF","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-bootstrap/shared/input-constraints.directive.ts","../../../../packages/dynamic-forms-bootstrap/shared/preset-actions.ts"],"sourcesContent":["import { Directive, ElementRef, inject, input } from '@angular/core';\nimport { explicitEffect } from 'ngxtension/explicit-effect';\n\n/** Declaratively reflects min, max, and step signal inputs to a native form control. */\n@Directive({\n selector: '[dfBsInputConstraints]',\n})\nexport class InputConstraintsDirective {\n readonly dfMin = input<number | string | null | undefined>();\n readonly dfMax = input<number | string | null | undefined>();\n readonly dfStep = input<number | string | null | undefined>();\n\n private readonly element = inject<ElementRef<HTMLInputElement>>(ElementRef);\n\n private readonly minEffect = explicitEffect([this.dfMin], ([value]) => this.reflectAttribute('min', value));\n private readonly maxEffect = explicitEffect([this.dfMax], ([value]) => this.reflectAttribute('max', value));\n private readonly stepEffect = explicitEffect([this.dfStep], ([value]) => this.reflectAttribute('step', value));\n\n private reflectAttribute(name: 'min' | 'max' | 'step', value: number | string | null | undefined): void {\n if (value === null || value === undefined) {\n this.element.nativeElement.removeAttribute(name);\n return;\n }\n this.element.nativeElement.setAttribute(name, String(value));\n }\n}\n","import type { AddonActionContext, AddonActionPreset } from '@ng-forge/dynamic-forms';\nimport { runPresetAction, type PresetCollaborators } from '@ng-forge/dynamic-forms/integration';\n\nexport type { PresetCollaborators };\n\n/** Bootstrap adapter binding for the shared preset runner. */\nexport function runBsPresetAction(\n preset: AddonActionPreset,\n context: AddonActionContext,\n collaborators: PresetCollaborators,\n): Promise<void> {\n return runPresetAction(preset, context, collaborators, 'Bootstrap', 'bs-input');\n}\n"]}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { AsyncPipe } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { input, computed, ChangeDetectionStrategy, Component, inject,
|
|
3
|
+
import { input, computed, ChangeDetectionStrategy, Component, inject, signal, forwardRef, linkedSignal, model, isSignal } from '@angular/core';
|
|
4
4
|
import * as i1 from '@ng-forge/dynamic-forms/integration';
|
|
5
|
-
import { injectNgForgeAction, DynamicTextPipe, NgForgeActionHost, injectNgForgeField, NgForgeControl, NgForgeFieldHost,
|
|
5
|
+
import { injectNgForgeAction, DynamicTextPipe, NgForgeActionHost, injectNgForgeField, NgForgeControl, NgForgeFieldHost, injectNgForgeAddons, DfAddonSlot, ADDON_PRESET_HANDLER, FIELD_SIGNAL_CONTEXT, NgForgeAddons, isEqual, NgForgeField, DEFAULT_PROPS, ARRAY_CONTEXT, injectNonFieldLogicResolver, buildBaseInputs, valueFieldMapper, optionsFieldMapper, checkboxFieldMapper, submitButtonFieldMapper, nextButtonFieldMapper, previousButtonFieldMapper, addArrayItemButtonMapper, prependArrayItemButtonMapper, insertArrayItemButtonMapper, removeArrayItemButtonMapper, popArrayItemButtonMapper, shiftArrayItemButtonMapper, datepickerFieldMapper, ADDON_TYPE_DEFINITIONS, injectNgForgeAddonAction, NgForgeAddonAction } from '@ng-forge/dynamic-forms/integration';
|
|
6
6
|
import { FormField } from '@angular/forms/signals';
|
|
7
|
-
import {
|
|
7
|
+
import { InputConstraintsDirective, BOOTSTRAP_CONFIG, BS_INPUT_TYPE_OVERRIDE, runBsPresetAction } from '@ng-forge/dynamic-forms-bootstrap/shared';
|
|
8
|
+
export { BOOTSTRAP_CONFIG, BS_INPUT_TYPE_OVERRIDE } from '@ng-forge/dynamic-forms-bootstrap/shared';
|
|
8
9
|
import { DynamicFormLogger, DynamicFormError } from '@ng-forge/dynamic-forms';
|
|
10
|
+
import { explicitEffect } from 'ngxtension/explicit-effect';
|
|
9
11
|
|
|
10
12
|
class BsButtonFieldComponent {
|
|
11
13
|
action = injectNgForgeAction();
|
|
@@ -71,11 +73,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
71
73
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".df-bs-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%;margin-bottom:var(--df-bs-field-margin-bottom, 1rem)}.df-bs-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit);margin-bottom:0}.df-bs-hint{color:var(--df-hint-color, var(--bs-secondary-color, #6c757d));font-size:var(--df-hint-font-size, .875rem);margin-top:var(--df-bs-hint-margin-top, .25rem)}.df-bs-field:has(.df-bs-hint){margin-bottom:var(--df-bs-field-with-hint-margin-bottom, .5rem)}:host([hidden]){display:none!important}\n"] }]
|
|
72
74
|
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
73
75
|
|
|
74
|
-
var bsButton_component = /*#__PURE__*/Object.freeze({
|
|
75
|
-
__proto__: null,
|
|
76
|
-
default: BsButtonFieldComponent
|
|
77
|
-
});
|
|
78
|
-
|
|
79
76
|
|
|
80
77
|
class BsCheckboxFieldComponent {
|
|
81
78
|
ngf = injectNgForgeField();
|
|
@@ -149,56 +146,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
149
146
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".df-bs-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%;margin-bottom:var(--df-bs-field-margin-bottom, 1rem)}.df-bs-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit);margin-bottom:0}.df-bs-hint{color:var(--df-hint-color, var(--bs-secondary-color, #6c757d));font-size:var(--df-hint-font-size, .875rem);margin-top:var(--df-bs-hint-margin-top, .25rem)}.df-bs-field:has(.df-bs-hint){margin-bottom:var(--df-bs-field-with-hint-margin-bottom, .5rem)}:host([hidden]){display:none!important}\n", ":host{display:block}:host([hidden]){display:none!important}\n"] }]
|
|
150
147
|
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
151
148
|
|
|
152
|
-
var bsCheckbox_component = /*#__PURE__*/Object.freeze({
|
|
153
|
-
__proto__: null,
|
|
154
|
-
default: BsCheckboxFieldComponent
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
class InputConstraintsDirective {
|
|
158
|
-
dfMin = input(/* @ts-ignore */
|
|
159
|
-
...(ngDevMode ? [undefined, { debugName: "dfMin" }] : /* istanbul ignore next */ []));
|
|
160
|
-
dfMax = input(/* @ts-ignore */
|
|
161
|
-
...(ngDevMode ? [undefined, { debugName: "dfMax" }] : /* istanbul ignore next */ []));
|
|
162
|
-
dfStep = input(/* @ts-ignore */
|
|
163
|
-
...(ngDevMode ? [undefined, { debugName: "dfStep" }] : /* istanbul ignore next */ []));
|
|
164
|
-
el = inject(ElementRef);
|
|
165
|
-
minEffect = explicitEffect([this.dfMin], ([minValue]) => {
|
|
166
|
-
const nativeElement = this.el.nativeElement;
|
|
167
|
-
if (minValue !== null && minValue !== undefined) {
|
|
168
|
-
nativeElement.setAttribute('min', String(minValue));
|
|
169
|
-
}
|
|
170
|
-
else {
|
|
171
|
-
nativeElement.removeAttribute('min');
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
maxEffect = explicitEffect([this.dfMax], ([maxValue]) => {
|
|
175
|
-
const nativeElement = this.el.nativeElement;
|
|
176
|
-
if (maxValue !== null && maxValue !== undefined) {
|
|
177
|
-
nativeElement.setAttribute('max', String(maxValue));
|
|
178
|
-
}
|
|
179
|
-
else {
|
|
180
|
-
nativeElement.removeAttribute('max');
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
stepEffect = explicitEffect([this.dfStep], ([stepValue]) => {
|
|
184
|
-
const nativeElement = this.el.nativeElement;
|
|
185
|
-
if (stepValue !== null && stepValue !== undefined) {
|
|
186
|
-
nativeElement.setAttribute('step', String(stepValue));
|
|
187
|
-
}
|
|
188
|
-
else {
|
|
189
|
-
nativeElement.removeAttribute('step');
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: InputConstraintsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
193
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.1", type: InputConstraintsDirective, isStandalone: true, selector: "[dfBsInputConstraints]", inputs: { dfMin: { classPropertyName: "dfMin", publicName: "dfMin", isSignal: true, isRequired: false, transformFunction: null }, dfMax: { classPropertyName: "dfMax", publicName: "dfMax", isSignal: true, isRequired: false, transformFunction: null }, dfStep: { classPropertyName: "dfStep", publicName: "dfStep", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 });
|
|
194
|
-
}
|
|
195
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: InputConstraintsDirective, decorators: [{
|
|
196
|
-
type: Directive,
|
|
197
|
-
args: [{
|
|
198
|
-
selector: '[dfBsInputConstraints]',
|
|
199
|
-
}]
|
|
200
|
-
}], propDecorators: { dfMin: [{ type: i0.Input, args: [{ isSignal: true, alias: "dfMin", required: false }] }], dfMax: [{ type: i0.Input, args: [{ isSignal: true, alias: "dfMax", required: false }] }], dfStep: [{ type: i0.Input, args: [{ isSignal: true, alias: "dfStep", required: false }] }] } });
|
|
201
|
-
|
|
202
149
|
class BsDatepickerFieldComponent {
|
|
203
150
|
ngf = injectNgForgeField();
|
|
204
151
|
minDate = input(null, /* @ts-ignore */
|
|
@@ -365,19 +312,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
365
312
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".df-bs-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%;margin-bottom:var(--df-bs-field-margin-bottom, 1rem)}.df-bs-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit);margin-bottom:0}.df-bs-hint{color:var(--df-hint-color, var(--bs-secondary-color, #6c757d));font-size:var(--df-hint-font-size, .875rem);margin-top:var(--df-bs-hint-margin-top, .25rem)}.df-bs-field:has(.df-bs-hint){margin-bottom:var(--df-bs-field-with-hint-margin-bottom, .5rem)}:host([hidden]){display:none!important}\n", ":host([hidden]){display:none!important}\n"] }]
|
|
366
313
|
}], propDecorators: { minDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "minDate", required: false }] }], maxDate: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxDate", required: false }] }], startAt: [{ type: i0.Input, args: [{ isSignal: true, alias: "startAt", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
367
314
|
|
|
368
|
-
var bsDatepicker_component = /*#__PURE__*/Object.freeze({
|
|
369
|
-
__proto__: null,
|
|
370
|
-
default: BsDatepickerFieldComponent
|
|
371
|
-
});
|
|
372
|
-
|
|
373
|
-
const BOOTSTRAP_CONFIG = new InjectionToken('BOOTSTRAP_CONFIG');
|
|
374
|
-
|
|
375
|
-
function runBsPresetAction(preset, ctx, collaborators) {
|
|
376
|
-
return runPresetAction(preset, ctx, collaborators, 'Bootstrap', 'bs-input');
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
const BS_INPUT_TYPE_OVERRIDE = new InjectionToken('BS_INPUT_TYPE_OVERRIDE');
|
|
380
|
-
|
|
381
315
|
class BsInputFieldComponent {
|
|
382
316
|
bootstrapConfig = inject(BOOTSTRAP_CONFIG, { optional: true });
|
|
383
317
|
ngf = injectNgForgeField();
|
|
@@ -705,11 +639,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
705
639
|
], styles: [".df-bs-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%;margin-bottom:var(--df-bs-field-margin-bottom, 1rem)}.df-bs-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit);margin-bottom:0}.df-bs-hint{color:var(--df-hint-color, var(--bs-secondary-color, #6c757d));font-size:var(--df-hint-font-size, .875rem);margin-top:var(--df-bs-hint-margin-top, .25rem)}.df-bs-field:has(.df-bs-hint){margin-bottom:var(--df-bs-field-with-hint-margin-bottom, .5rem)}:host([hidden]){display:none!important}\n", ":host([hidden]){display:none!important}:host{--df-bs-addon-prefix-outer-padding: .75rem;--df-bs-addon-prefix-inner-padding: .75rem;--df-bs-addon-suffix-inner-padding: .75rem;--df-bs-addon-suffix-outer-padding: .75rem}:host ::ng-deep .input-group>.input-group-text:first-child{padding-left:var(--df-bs-addon-prefix-outer-padding);padding-right:var(--df-bs-addon-prefix-inner-padding)}:host ::ng-deep .input-group>.input-group-text:last-child{padding-left:var(--df-bs-addon-suffix-inner-padding);padding-right:var(--df-bs-addon-suffix-outer-padding)}:host ::ng-deep .input-group-text df-bs-button-addon .btn{--bs-btn-bg: transparent;--bs-btn-color: var(--bs-body-color);--bs-btn-border-color: transparent;--bs-btn-hover-bg: rgba(127, 127, 127, .12);--bs-btn-hover-color: var(--bs-body-color);--bs-btn-hover-border-color: transparent;--bs-btn-active-bg: rgba(127, 127, 127, .18);--bs-btn-active-border-color: transparent;--bs-btn-focus-shadow-rgb: 0, 0, 0;--bs-btn-padding-x: 0;--bs-btn-padding-y: 0;box-shadow:none}:host ::ng-deep .input-group-text df-bs-button-addon .btn:focus-visible{box-shadow:none;outline:2px solid currentColor;outline-offset:2px}\n"] }]
|
|
706
640
|
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], fieldInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldInputs", required: false }] }] } });
|
|
707
641
|
|
|
708
|
-
var bsInput_component = /*#__PURE__*/Object.freeze({
|
|
709
|
-
__proto__: null,
|
|
710
|
-
default: BsInputFieldComponent
|
|
711
|
-
});
|
|
712
|
-
|
|
713
642
|
class BsMultiCheckboxFieldComponent {
|
|
714
643
|
ngf = injectNgForgeField();
|
|
715
644
|
options = input([], /* @ts-ignore */
|
|
@@ -841,11 +770,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
841
770
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".df-bs-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%;margin-bottom:var(--df-bs-field-margin-bottom, 1rem)}.df-bs-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit);margin-bottom:0}.df-bs-hint{color:var(--df-hint-color, var(--bs-secondary-color, #6c757d));font-size:var(--df-hint-font-size, .875rem);margin-top:var(--df-bs-hint-margin-top, .25rem)}.df-bs-field:has(.df-bs-hint){margin-bottom:var(--df-bs-field-with-hint-margin-bottom, .5rem)}:host([hidden]){display:none!important}\n", ":host{display:block}.checkbox-group{margin-bottom:.5rem}:host([hidden]){display:none!important}\n"] }]
|
|
842
771
|
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
843
772
|
|
|
844
|
-
var bsMultiCheckbox_component = /*#__PURE__*/Object.freeze({
|
|
845
|
-
__proto__: null,
|
|
846
|
-
default: BsMultiCheckboxFieldComponent
|
|
847
|
-
});
|
|
848
|
-
|
|
849
773
|
class BsRadioGroupComponent {
|
|
850
774
|
parentField = inject(NgForgeField, { optional: true });
|
|
851
775
|
value = model(undefined, /* @ts-ignore */
|
|
@@ -1020,11 +944,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
1020
944
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".df-bs-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%;margin-bottom:var(--df-bs-field-margin-bottom, 1rem)}.df-bs-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit);margin-bottom:0}.df-bs-hint{color:var(--df-hint-color, var(--bs-secondary-color, #6c757d));font-size:var(--df-hint-font-size, .875rem);margin-top:var(--df-bs-hint-margin-top, .25rem)}.df-bs-field:has(.df-bs-hint){margin-bottom:var(--df-bs-field-with-hint-margin-bottom, .5rem)}:host([hidden]){display:none!important}\n", ":host{display:block}:host([hidden]){display:none!important}\n"] }]
|
|
1021
945
|
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1022
946
|
|
|
1023
|
-
var bsRadio_component = /*#__PURE__*/Object.freeze({
|
|
1024
|
-
__proto__: null,
|
|
1025
|
-
default: BsRadioFieldComponent
|
|
1026
|
-
});
|
|
1027
|
-
|
|
1028
947
|
class BsSelectFieldComponent {
|
|
1029
948
|
ngf = injectNgForgeField();
|
|
1030
949
|
options = input([], /* @ts-ignore */
|
|
@@ -1117,11 +1036,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
1117
1036
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".df-bs-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%;margin-bottom:var(--df-bs-field-margin-bottom, 1rem)}.df-bs-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit);margin-bottom:0}.df-bs-hint{color:var(--df-hint-color, var(--bs-secondary-color, #6c757d));font-size:var(--df-hint-font-size, .875rem);margin-top:var(--df-bs-hint-margin-top, .25rem)}.df-bs-field:has(.df-bs-hint){margin-bottom:var(--df-bs-field-with-hint-margin-bottom, .5rem)}:host([hidden]){display:none!important}\n", ":host([hidden]){display:none!important}\n"] }]
|
|
1118
1037
|
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1119
1038
|
|
|
1120
|
-
var bsSelect_component = /*#__PURE__*/Object.freeze({
|
|
1121
|
-
__proto__: null,
|
|
1122
|
-
default: BsSelectFieldComponent
|
|
1123
|
-
});
|
|
1124
|
-
|
|
1125
1039
|
class BsSliderFieldComponent {
|
|
1126
1040
|
ngf = injectNgForgeField();
|
|
1127
1041
|
min = input(0, /* @ts-ignore */
|
|
@@ -1204,11 +1118,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
1204
1118
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".df-bs-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%;margin-bottom:var(--df-bs-field-margin-bottom, 1rem)}.df-bs-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit);margin-bottom:0}.df-bs-hint{color:var(--df-hint-color, var(--bs-secondary-color, #6c757d));font-size:var(--df-hint-font-size, .875rem);margin-top:var(--df-bs-hint-margin-top, .25rem)}.df-bs-field:has(.df-bs-hint){margin-bottom:var(--df-bs-field-with-hint-margin-bottom, .5rem)}:host([hidden]){display:none!important}\n", ":host{display:block}:host([hidden]){display:none!important}\n"] }]
|
|
1205
1119
|
}], propDecorators: { min: [{ type: i0.Input, args: [{ isSignal: true, alias: "min", required: false }] }], max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1206
1120
|
|
|
1207
|
-
var bsSlider_component = /*#__PURE__*/Object.freeze({
|
|
1208
|
-
__proto__: null,
|
|
1209
|
-
default: BsSliderFieldComponent
|
|
1210
|
-
});
|
|
1211
|
-
|
|
1212
1121
|
class BsTextareaFieldComponent {
|
|
1213
1122
|
ngf = injectNgForgeField();
|
|
1214
1123
|
props = input(/* @ts-ignore */
|
|
@@ -1349,11 +1258,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
1349
1258
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".df-bs-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%;margin-bottom:var(--df-bs-field-margin-bottom, 1rem)}.df-bs-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit);margin-bottom:0}.df-bs-hint{color:var(--df-hint-color, var(--bs-secondary-color, #6c757d));font-size:var(--df-hint-font-size, .875rem);margin-top:var(--df-bs-hint-margin-top, .25rem)}.df-bs-field:has(.df-bs-hint){margin-bottom:var(--df-bs-field-with-hint-margin-bottom, .5rem)}:host([hidden]){display:none!important}\n", ":host([hidden]){display:none!important}\n"] }]
|
|
1350
1259
|
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1351
1260
|
|
|
1352
|
-
var bsTextarea_component = /*#__PURE__*/Object.freeze({
|
|
1353
|
-
__proto__: null,
|
|
1354
|
-
default: BsTextareaFieldComponent
|
|
1355
|
-
});
|
|
1356
|
-
|
|
1357
1261
|
class BsToggleFieldComponent {
|
|
1358
1262
|
ngf = injectNgForgeField();
|
|
1359
1263
|
props = input(/* @ts-ignore */
|
|
@@ -1426,11 +1330,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
1426
1330
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [".df-bs-field{display:flex;flex-direction:column;gap:var(--df-field-gap, .5rem);width:100%;margin-bottom:var(--df-bs-field-margin-bottom, 1rem)}.df-bs-label{font-weight:var(--df-label-font-weight, 500);color:var(--df-label-color, inherit);margin-bottom:0}.df-bs-hint{color:var(--df-hint-color, var(--bs-secondary-color, #6c757d));font-size:var(--df-hint-font-size, .875rem);margin-top:var(--df-bs-hint-margin-top, .25rem)}.df-bs-field:has(.df-bs-hint){margin-bottom:var(--df-bs-field-with-hint-margin-bottom, .5rem)}:host([hidden]){display:none!important}\n", ":host{display:block}:host([hidden]){display:none!important}.form-switch-sm .form-check-input{width:1.75rem;height:1rem;font-size:.875rem}.form-switch-lg .form-check-input{width:3rem;height:1.75rem;font-size:1.125rem}\n"] }]
|
|
1427
1331
|
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1428
1332
|
|
|
1429
|
-
var bsToggle_component = /*#__PURE__*/Object.freeze({
|
|
1430
|
-
__proto__: null,
|
|
1431
|
-
default: BsToggleFieldComponent
|
|
1432
|
-
});
|
|
1433
|
-
|
|
1434
1333
|
|
|
1435
1334
|
const BsField = {
|
|
1436
1335
|
Input: 'input',
|
|
@@ -1499,10 +1398,20 @@ const BUTTON_FIELD_TYPES_BASE = {
|
|
|
1499
1398
|
renderReadyWhen: [],
|
|
1500
1399
|
valueHandling: 'exclude',
|
|
1501
1400
|
};
|
|
1401
|
+
const loadInputComponent = () => import('@ng-forge/dynamic-forms-bootstrap/lazy/input').then(({ BsInputFieldComponent }) => BsInputFieldComponent);
|
|
1402
|
+
const loadSelectComponent = () => import('@ng-forge/dynamic-forms-bootstrap/lazy/select').then(({ BsSelectFieldComponent }) => BsSelectFieldComponent);
|
|
1403
|
+
const loadCheckboxComponent = () => import('@ng-forge/dynamic-forms-bootstrap/lazy/checkbox').then(({ BsCheckboxFieldComponent }) => BsCheckboxFieldComponent);
|
|
1404
|
+
const loadButtonComponent = () => import('@ng-forge/dynamic-forms-bootstrap/lazy/button').then(({ BsButtonFieldComponent }) => BsButtonFieldComponent);
|
|
1405
|
+
const loadTextareaComponent = () => import('@ng-forge/dynamic-forms-bootstrap/lazy/textarea').then(({ BsTextareaFieldComponent }) => BsTextareaFieldComponent);
|
|
1406
|
+
const loadRadioComponent = () => import('@ng-forge/dynamic-forms-bootstrap/lazy/radio').then(({ BsRadioFieldComponent }) => BsRadioFieldComponent);
|
|
1407
|
+
const loadMultiCheckboxComponent = () => import('@ng-forge/dynamic-forms-bootstrap/lazy/multi-checkbox').then(({ BsMultiCheckboxFieldComponent }) => BsMultiCheckboxFieldComponent);
|
|
1408
|
+
const loadDatepickerComponent = () => import('@ng-forge/dynamic-forms-bootstrap/lazy/datepicker').then(({ BsDatepickerFieldComponent }) => BsDatepickerFieldComponent);
|
|
1409
|
+
const loadSliderComponent = () => import('@ng-forge/dynamic-forms-bootstrap/lazy/slider').then(({ BsSliderFieldComponent }) => BsSliderFieldComponent);
|
|
1410
|
+
const loadToggleComponent = () => import('@ng-forge/dynamic-forms-bootstrap/lazy/toggle').then(({ BsToggleFieldComponent }) => BsToggleFieldComponent);
|
|
1502
1411
|
const BOOTSTRAP_FIELD_TYPES = [
|
|
1503
1412
|
{
|
|
1504
1413
|
name: BsField.Input,
|
|
1505
|
-
loadComponent:
|
|
1414
|
+
loadComponent: loadInputComponent,
|
|
1506
1415
|
mapper: valueFieldMapper,
|
|
1507
1416
|
propsToMeta: ['type'],
|
|
1508
1417
|
scope: ['text-input', 'numeric'],
|
|
@@ -1513,81 +1422,81 @@ const BOOTSTRAP_FIELD_TYPES = [
|
|
|
1513
1422
|
},
|
|
1514
1423
|
{
|
|
1515
1424
|
name: BsField.Select,
|
|
1516
|
-
loadComponent:
|
|
1425
|
+
loadComponent: loadSelectComponent,
|
|
1517
1426
|
mapper: optionsFieldMapper,
|
|
1518
1427
|
scope: 'single-select',
|
|
1519
1428
|
...VALUE_FIELD_TYPES_BASE,
|
|
1520
1429
|
},
|
|
1521
1430
|
{
|
|
1522
1431
|
name: BsField.Checkbox,
|
|
1523
|
-
loadComponent:
|
|
1432
|
+
loadComponent: loadCheckboxComponent,
|
|
1524
1433
|
mapper: checkboxFieldMapper,
|
|
1525
1434
|
scope: 'boolean',
|
|
1526
1435
|
...VALUE_FIELD_TYPES_BASE,
|
|
1527
1436
|
},
|
|
1528
1437
|
{
|
|
1529
1438
|
name: BsField.Button,
|
|
1530
|
-
loadComponent:
|
|
1439
|
+
loadComponent: loadButtonComponent,
|
|
1531
1440
|
mapper: buttonFieldMapper,
|
|
1532
1441
|
...BUTTON_FIELD_TYPES_BASE,
|
|
1533
1442
|
},
|
|
1534
1443
|
{
|
|
1535
1444
|
name: BsField.Submit,
|
|
1536
|
-
loadComponent:
|
|
1445
|
+
loadComponent: loadButtonComponent,
|
|
1537
1446
|
mapper: submitButtonFieldMapper,
|
|
1538
1447
|
...BUTTON_FIELD_TYPES_BASE,
|
|
1539
1448
|
},
|
|
1540
1449
|
{
|
|
1541
1450
|
name: BsField.Next,
|
|
1542
|
-
loadComponent:
|
|
1451
|
+
loadComponent: loadButtonComponent,
|
|
1543
1452
|
mapper: nextButtonFieldMapper,
|
|
1544
1453
|
...BUTTON_FIELD_TYPES_BASE,
|
|
1545
1454
|
},
|
|
1546
1455
|
{
|
|
1547
1456
|
name: BsField.Previous,
|
|
1548
|
-
loadComponent:
|
|
1457
|
+
loadComponent: loadButtonComponent,
|
|
1549
1458
|
mapper: previousButtonFieldMapper,
|
|
1550
1459
|
...BUTTON_FIELD_TYPES_BASE,
|
|
1551
1460
|
},
|
|
1552
1461
|
{
|
|
1553
1462
|
name: BsField.AddArrayItem,
|
|
1554
|
-
loadComponent:
|
|
1463
|
+
loadComponent: loadButtonComponent,
|
|
1555
1464
|
mapper: addArrayItemButtonMapper,
|
|
1556
1465
|
...BUTTON_FIELD_TYPES_BASE,
|
|
1557
1466
|
},
|
|
1558
1467
|
{
|
|
1559
1468
|
name: BsField.PrependArrayItem,
|
|
1560
|
-
loadComponent:
|
|
1469
|
+
loadComponent: loadButtonComponent,
|
|
1561
1470
|
mapper: prependArrayItemButtonMapper,
|
|
1562
1471
|
...BUTTON_FIELD_TYPES_BASE,
|
|
1563
1472
|
},
|
|
1564
1473
|
{
|
|
1565
1474
|
name: BsField.InsertArrayItem,
|
|
1566
|
-
loadComponent:
|
|
1475
|
+
loadComponent: loadButtonComponent,
|
|
1567
1476
|
mapper: insertArrayItemButtonMapper,
|
|
1568
1477
|
...BUTTON_FIELD_TYPES_BASE,
|
|
1569
1478
|
},
|
|
1570
1479
|
{
|
|
1571
1480
|
name: BsField.RemoveArrayItem,
|
|
1572
|
-
loadComponent:
|
|
1481
|
+
loadComponent: loadButtonComponent,
|
|
1573
1482
|
mapper: removeArrayItemButtonMapper,
|
|
1574
1483
|
...BUTTON_FIELD_TYPES_BASE,
|
|
1575
1484
|
},
|
|
1576
1485
|
{
|
|
1577
1486
|
name: BsField.PopArrayItem,
|
|
1578
|
-
loadComponent:
|
|
1487
|
+
loadComponent: loadButtonComponent,
|
|
1579
1488
|
mapper: popArrayItemButtonMapper,
|
|
1580
1489
|
...BUTTON_FIELD_TYPES_BASE,
|
|
1581
1490
|
},
|
|
1582
1491
|
{
|
|
1583
1492
|
name: BsField.ShiftArrayItem,
|
|
1584
|
-
loadComponent:
|
|
1493
|
+
loadComponent: loadButtonComponent,
|
|
1585
1494
|
mapper: shiftArrayItemButtonMapper,
|
|
1586
1495
|
...BUTTON_FIELD_TYPES_BASE,
|
|
1587
1496
|
},
|
|
1588
1497
|
{
|
|
1589
1498
|
name: BsField.Textarea,
|
|
1590
|
-
loadComponent:
|
|
1499
|
+
loadComponent: loadTextareaComponent,
|
|
1591
1500
|
mapper: valueFieldMapper,
|
|
1592
1501
|
propsToMeta: ['rows'],
|
|
1593
1502
|
scope: 'text-input',
|
|
@@ -1595,35 +1504,35 @@ const BOOTSTRAP_FIELD_TYPES = [
|
|
|
1595
1504
|
},
|
|
1596
1505
|
{
|
|
1597
1506
|
name: BsField.Radio,
|
|
1598
|
-
loadComponent:
|
|
1507
|
+
loadComponent: loadRadioComponent,
|
|
1599
1508
|
mapper: optionsFieldMapper,
|
|
1600
1509
|
scope: 'single-select',
|
|
1601
1510
|
...VALUE_FIELD_TYPES_BASE,
|
|
1602
1511
|
},
|
|
1603
1512
|
{
|
|
1604
1513
|
name: BsField.MultiCheckbox,
|
|
1605
|
-
loadComponent:
|
|
1514
|
+
loadComponent: loadMultiCheckboxComponent,
|
|
1606
1515
|
mapper: optionsFieldMapper,
|
|
1607
1516
|
scope: 'multi-select',
|
|
1608
1517
|
...VALUE_FIELD_TYPES_BASE,
|
|
1609
1518
|
},
|
|
1610
1519
|
{
|
|
1611
1520
|
name: BsField.Datepicker,
|
|
1612
|
-
loadComponent:
|
|
1521
|
+
loadComponent: loadDatepickerComponent,
|
|
1613
1522
|
mapper: datepickerFieldMapper,
|
|
1614
1523
|
scope: 'date',
|
|
1615
1524
|
...VALUE_FIELD_TYPES_BASE,
|
|
1616
1525
|
},
|
|
1617
1526
|
{
|
|
1618
1527
|
name: BsField.Slider,
|
|
1619
|
-
loadComponent:
|
|
1528
|
+
loadComponent: loadSliderComponent,
|
|
1620
1529
|
mapper: valueFieldMapper,
|
|
1621
1530
|
scope: 'numeric',
|
|
1622
1531
|
...VALUE_FIELD_TYPES_BASE,
|
|
1623
1532
|
},
|
|
1624
1533
|
{
|
|
1625
1534
|
name: BsField.Toggle,
|
|
1626
|
-
loadComponent:
|
|
1535
|
+
loadComponent: loadToggleComponent,
|
|
1627
1536
|
mapper: checkboxFieldMapper,
|
|
1628
1537
|
scope: 'boolean',
|
|
1629
1538
|
...VALUE_FIELD_TYPES_BASE,
|
|
@@ -1631,8 +1540,13 @@ const BOOTSTRAP_FIELD_TYPES = [
|
|
|
1631
1540
|
];
|
|
1632
1541
|
|
|
1633
1542
|
|
|
1543
|
+
const BOOTSTRAP_FIELD_ERRORS_WRAPPER = {
|
|
1544
|
+
wrapperName: 'field-errors',
|
|
1545
|
+
loadComponent: () => import('./ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-BAPwLlkJ.mjs'),
|
|
1546
|
+
rendersFieldErrors: true,
|
|
1547
|
+
};
|
|
1634
1548
|
function withBootstrapFields(config) {
|
|
1635
|
-
const base = [...BOOTSTRAP_FIELD_TYPES, withBootstrapAddons()];
|
|
1549
|
+
const base = [...BOOTSTRAP_FIELD_TYPES, withBootstrapAddons(), BOOTSTRAP_FIELD_ERRORS_WRAPPER];
|
|
1636
1550
|
if (config) {
|
|
1637
1551
|
base.push({
|
|
1638
1552
|
ɵkind: 'bootstrap-config',
|
|
@@ -1645,7 +1559,7 @@ function withBootstrapFields(config) {
|
|
|
1645
1559
|
/* -- Bootstrap addon types --------------------------------------------- */
|
|
1646
1560
|
const BS_ICON_KIND = {
|
|
1647
1561
|
type: 'bs-icon',
|
|
1648
|
-
loadComponent: () =>
|
|
1562
|
+
loadComponent: () => import('@ng-forge/dynamic-forms-bootstrap/lazy/addon-icon').then((m) => m.BsIconAddonComponent),
|
|
1649
1563
|
validate: (addon, fieldKey) => {
|
|
1650
1564
|
if (typeof addon.icon !== 'string' || addon.icon.length === 0) {
|
|
1651
1565
|
throw new DynamicFormError(`Addon type 'bs-icon' requires a non-empty 'icon' string (field: '${fieldKey}').`);
|
|
@@ -1654,7 +1568,7 @@ const BS_ICON_KIND = {
|
|
|
1654
1568
|
};
|
|
1655
1569
|
const BS_BUTTON_KIND = {
|
|
1656
1570
|
type: 'bs-button',
|
|
1657
|
-
loadComponent: () =>
|
|
1571
|
+
loadComponent: () => import('@ng-forge/dynamic-forms-bootstrap/lazy/addon-button').then((m) => m.BsButtonAddonComponent),
|
|
1658
1572
|
validate: (addon, fieldKey) => {
|
|
1659
1573
|
const set = [addon.preset, addon.actionRef, addon.action].filter((v) => v !== undefined);
|
|
1660
1574
|
if (set.length > 1) {
|
|
@@ -1702,11 +1616,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
1702
1616
|
}]
|
|
1703
1617
|
}], propDecorators: { addon: [{ type: i0.Input, args: [{ isSignal: true, alias: "addon", required: true }] }], fieldInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldInputs", required: false }] }] } });
|
|
1704
1618
|
|
|
1705
|
-
var bsIconAddon_component = /*#__PURE__*/Object.freeze({
|
|
1706
|
-
__proto__: null,
|
|
1707
|
-
BsIconAddonComponent: BsIconAddonComponent
|
|
1708
|
-
});
|
|
1709
|
-
|
|
1710
1619
|
class BsButtonAddonComponent {
|
|
1711
1620
|
action = injectNgForgeAddonAction();
|
|
1712
1621
|
addon = this.action.addon;
|
|
@@ -1775,12 +1684,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImpor
|
|
|
1775
1684
|
}]
|
|
1776
1685
|
}] });
|
|
1777
1686
|
|
|
1778
|
-
var bsButtonAddon_component = /*#__PURE__*/Object.freeze({
|
|
1779
|
-
__proto__: null,
|
|
1780
|
-
BsButtonAddonComponent: BsButtonAddonComponent
|
|
1781
|
-
});
|
|
1782
|
-
|
|
1783
1687
|
|
|
1784
1688
|
|
|
1785
|
-
export {
|
|
1689
|
+
export { BOOTSTRAP_FIELD_TYPES, BsButtonAddonComponent, BsButtonFieldComponent, BsCheckboxFieldComponent, BsDatepickerFieldComponent, BsField, BsIconAddonComponent, BsInputFieldComponent, BsMultiCheckboxFieldComponent, BsRadioFieldComponent, BsSelectFieldComponent, BsSliderFieldComponent, BsTextareaFieldComponent, BsToggleFieldComponent, withBootstrapAddons, withBootstrapFields };
|
|
1786
1690
|
//# sourceMappingURL=ng-forge-dynamic-forms-bootstrap.mjs.map
|