@ng-forge/dynamic-forms-bootstrap 1.1.0 → 1.2.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-D4qTxFSp.mjs +25 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-D4qTxFSp.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 +85 -179
- package/fesm2022/ng-forge-dynamic-forms-bootstrap.mjs.map +1 -1
- package/package.json +56 -4
- 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.1.5", ngImport: i0, type: BsToggleFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", 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.1.5", 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.1.5", ngImport: i0, type: InputConstraintsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
29
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.1.5", 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.1.5", 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"]}
|