@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
package/fesm2022/ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-BAPwLlkJ.mjs
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { FieldErrorsWrapperBase, provideFieldErrorDisplay } from '@ng-forge/dynamic-forms/integration';
|
|
4
|
+
|
|
5
|
+
class BsFieldErrorsWrapperComponent extends FieldErrorsWrapperBase {
|
|
6
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: BsFieldErrorsWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: BsFieldErrorsWrapperComponent, isStandalone: true, selector: "df-bs-field-errors", providers: [provideFieldErrorDisplay(() => BsFieldErrorsWrapperComponent)], usesInheritance: true, ngImport: i0, template: `
|
|
8
|
+
<ng-container #fieldComponent></ng-container>
|
|
9
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
10
|
+
<div class="invalid-feedback d-block" role="alert" [id]="ngf.errorId()">{{ error.message }}</div>
|
|
11
|
+
}
|
|
12
|
+
`, isInline: true, styles: [".invalid-feedback{color:var(--df-error-color, var(--bs-form-invalid-color, var(--bs-danger, #dc3545)));font-size:var(--df-error-font-size, .875em)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
13
|
+
}
|
|
14
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: BsFieldErrorsWrapperComponent, decorators: [{
|
|
15
|
+
type: Component,
|
|
16
|
+
args: [{ selector: 'df-bs-field-errors', template: `
|
|
17
|
+
<ng-container #fieldComponent></ng-container>
|
|
18
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
19
|
+
<div class="invalid-feedback d-block" role="alert" [id]="ngf.errorId()">{{ error.message }}</div>
|
|
20
|
+
}
|
|
21
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, providers: [provideFieldErrorDisplay(() => BsFieldErrorsWrapperComponent)], styles: [".invalid-feedback{color:var(--df-error-color, var(--bs-form-invalid-color, var(--bs-danger, #dc3545)));font-size:var(--df-error-font-size, .875em)}\n"] }]
|
|
22
|
+
}] });
|
|
23
|
+
|
|
24
|
+
export { BsFieldErrorsWrapperComponent, BsFieldErrorsWrapperComponent as default };
|
|
25
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-BAPwLlkJ.mjs.map
|
package/fesm2022/ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-BAPwLlkJ.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-BAPwLlkJ.mjs","mappings":";;;;AAoBc;;;;;;;AALX;;;;AANS","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-bootstrap/src/lib/wrappers/field-errors/bs-field-errors-wrapper.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { FieldErrorsWrapperBase, provideFieldErrorDisplay } from '@ng-forge/dynamic-forms/integration';\n\n/**\n * Bootstrap rendering of a validation message for the wrapped field.\n * `d-block` is required — Bootstrap only reveals `.invalid-feedback` next to a\n * sibling `.is-invalid` control, which a container has none of.\n */\n@Component({\n selector: 'df-bs-field-errors',\n template: `\n <ng-container #fieldComponent></ng-container>\n @if (ngf.errorsToDisplay()[0]; as error) {\n <div class=\"invalid-feedback d-block\" role=\"alert\" [id]=\"ngf.errorId()\">{{ error.message }}</div>\n }\n `,\n styleUrl: './bs-field-errors-wrapper.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [provideFieldErrorDisplay(() => BsFieldErrorsWrapperComponent)],\n})\nexport default class BsFieldErrorsWrapperComponent extends FieldErrorsWrapperBase {}\n\nexport { BsFieldErrorsWrapperComponent };\n"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { AsyncPipe } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import * as i1 from '@ng-forge/dynamic-forms/integration';
|
|
5
|
+
import { injectNgForgeAddonAction, DynamicTextPipe, NgForgeAddonAction } from '@ng-forge/dynamic-forms/integration';
|
|
6
|
+
|
|
7
|
+
class BsButtonAddonComponent {
|
|
8
|
+
action = injectNgForgeAddonAction();
|
|
9
|
+
addon = this.action.addon;
|
|
10
|
+
label = computed(() => this.addon().label, /* @ts-ignore */
|
|
11
|
+
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
12
|
+
ariaLabel = computed(() => this.addon().ariaLabel, /* @ts-ignore */
|
|
13
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
14
|
+
iconClass = computed(() => {
|
|
15
|
+
const icon = this.addon().icon;
|
|
16
|
+
return icon ? `bi bi-${icon}` : '';
|
|
17
|
+
}, /* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [{ debugName: "iconClass" }] : /* istanbul ignore next */ []));
|
|
19
|
+
buttonClass = computed(() => `btn btn-outline-${this.addon().severity ?? 'secondary'}`, /* @ts-ignore */
|
|
20
|
+
...(ngDevMode ? [{ debugName: "buttonClass" }] : /* istanbul ignore next */ []));
|
|
21
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: BsButtonAddonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: BsButtonAddonComponent, isStandalone: true, selector: "df-bs-button-addon", hostDirectives: [{ directive: i1.NgForgeAddonAction }], ngImport: i0, template: `
|
|
23
|
+
<button
|
|
24
|
+
type="button"
|
|
25
|
+
[class]="buttonClass()"
|
|
26
|
+
[disabled]="action.disabled() || action.loading()"
|
|
27
|
+
[attr.aria-label]="(ariaLabel() | dynamicText | async) ?? null"
|
|
28
|
+
[attr.aria-busy]="action.loading() || null"
|
|
29
|
+
(click)="action.dispatch()"
|
|
30
|
+
>
|
|
31
|
+
@if (action.loading()) {
|
|
32
|
+
<!-- Visually-hidden role=status text gives a reliable AT announcement (VO/JAWS/NVDA). -->
|
|
33
|
+
<span class="spinner-border spinner-border-sm" aria-hidden="true"></span>
|
|
34
|
+
<span class="visually-hidden" role="status">Loading…</span>
|
|
35
|
+
} @else if (iconClass(); as ic) {
|
|
36
|
+
<i [class]="ic" aria-hidden="true"></i>
|
|
37
|
+
}
|
|
38
|
+
@if (label(); as l) {
|
|
39
|
+
<span>{{ l | dynamicText | async }}</span>
|
|
40
|
+
}
|
|
41
|
+
</button>
|
|
42
|
+
`, isInline: true, dependencies: [{ kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
43
|
+
}
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: BsButtonAddonComponent, decorators: [{
|
|
45
|
+
type: Component,
|
|
46
|
+
args: [{
|
|
47
|
+
selector: 'df-bs-button-addon',
|
|
48
|
+
imports: [DynamicTextPipe, AsyncPipe],
|
|
49
|
+
hostDirectives: [NgForgeAddonAction],
|
|
50
|
+
template: `
|
|
51
|
+
<button
|
|
52
|
+
type="button"
|
|
53
|
+
[class]="buttonClass()"
|
|
54
|
+
[disabled]="action.disabled() || action.loading()"
|
|
55
|
+
[attr.aria-label]="(ariaLabel() | dynamicText | async) ?? null"
|
|
56
|
+
[attr.aria-busy]="action.loading() || null"
|
|
57
|
+
(click)="action.dispatch()"
|
|
58
|
+
>
|
|
59
|
+
@if (action.loading()) {
|
|
60
|
+
<!-- Visually-hidden role=status text gives a reliable AT announcement (VO/JAWS/NVDA). -->
|
|
61
|
+
<span class="spinner-border spinner-border-sm" aria-hidden="true"></span>
|
|
62
|
+
<span class="visually-hidden" role="status">Loading…</span>
|
|
63
|
+
} @else if (iconClass(); as ic) {
|
|
64
|
+
<i [class]="ic" aria-hidden="true"></i>
|
|
65
|
+
}
|
|
66
|
+
@if (label(); as l) {
|
|
67
|
+
<span>{{ l | dynamicText | async }}</span>
|
|
68
|
+
}
|
|
69
|
+
</button>
|
|
70
|
+
`,
|
|
71
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
72
|
+
}]
|
|
73
|
+
}] });
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
export { BsButtonAddonComponent };
|
|
77
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-bootstrap-lazy-addon-button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-bootstrap-lazy-addon-button.mjs","mappings":";;;;;;;;IAsCqB;;;;;AAIA;;;;;AAIA;;;AAZR;;;;;;;;;;;;;;;;;;;;;;;;AA3BF;AACT;AACA;;AAEA;;;;;;;;;;;;;;;;;;;;AAoBC;;AAEF","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-bootstrap/src/lib/addons/bs-button-addon.component.ts"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed } from '@angular/core';\nimport { DynamicTextPipe } from '@ng-forge/dynamic-forms/integration';\nimport { injectNgForgeAddonAction, NgForgeAddonAction } from '@ng-forge/dynamic-forms/integration';\nimport type { BsButtonAddon } from '@ng-forge/dynamic-forms-bootstrap/shared';\n\n/** Renderer for the `bs-button` addon type. */\n@Component({\n selector: 'df-bs-button-addon',\n imports: [DynamicTextPipe, AsyncPipe],\n hostDirectives: [NgForgeAddonAction],\n template: `\n <button\n type=\"button\"\n [class]=\"buttonClass()\"\n [disabled]=\"action.disabled() || action.loading()\"\n [attr.aria-label]=\"(ariaLabel() | dynamicText | async) ?? null\"\n [attr.aria-busy]=\"action.loading() || null\"\n (click)=\"action.dispatch()\"\n >\n @if (action.loading()) {\n <!-- Visually-hidden role=status text gives a reliable AT announcement (VO/JAWS/NVDA). -->\n <span class=\"spinner-border spinner-border-sm\" aria-hidden=\"true\"></span>\n <span class=\"visually-hidden\" role=\"status\">Loading…</span>\n } @else if (iconClass(); as ic) {\n <i [class]=\"ic\" aria-hidden=\"true\"></i>\n }\n @if (label(); as l) {\n <span>{{ l | dynamicText | async }}</span>\n }\n </button>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsButtonAddonComponent {\n protected readonly action = injectNgForgeAddonAction<BsButtonAddon>();\n\n /** Re-exposed for template binding — same signal stored on the directive. */\n protected readonly addon = this.action.addon;\n\n protected readonly label = computed(() => this.addon().label);\n protected readonly ariaLabel = computed(() => this.addon().ariaLabel);\n protected readonly iconClass = computed(() => {\n const icon = this.addon().icon;\n return icon ? `bi bi-${icon}` : '';\n });\n protected readonly buttonClass = computed(() => `btn btn-outline-${this.addon().severity ?? 'secondary'}`);\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { AsyncPipe } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import { DynamicTextPipe } from '@ng-forge/dynamic-forms/integration';
|
|
5
|
+
|
|
6
|
+
class BsIconAddonComponent {
|
|
7
|
+
addon = input.required(/* @ts-ignore */
|
|
8
|
+
...(ngDevMode ? [{ debugName: "addon" }] : /* istanbul ignore next */ []));
|
|
9
|
+
fieldInputs = input(/* @ts-ignore */
|
|
10
|
+
...(ngDevMode ? [undefined, { debugName: "fieldInputs" }] : /* istanbul ignore next */ []));
|
|
11
|
+
iconClass = computed(() => `bi bi-${this.addon().icon}`, /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "iconClass" }] : /* istanbul ignore next */ []));
|
|
13
|
+
ariaLabel = computed(() => this.addon().ariaLabel, /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
15
|
+
hasAriaLabel = computed(() => this.addon().ariaLabel !== undefined, /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "hasAriaLabel" }] : /* istanbul ignore next */ []));
|
|
17
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: BsIconAddonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
18
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.1", type: BsIconAddonComponent, isStandalone: true, selector: "df-bs-icon-addon", inputs: { addon: { classPropertyName: "addon", publicName: "addon", isSignal: true, isRequired: true, transformFunction: null }, fieldInputs: { classPropertyName: "fieldInputs", publicName: "fieldInputs", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "attr.aria-hidden": "hasAriaLabel() ? null : \"true\"" } }, ngImport: i0, template: `<i [class]="iconClass()" [attr.aria-label]="(ariaLabel() | dynamicText | async) ?? null"></i>`, isInline: true, dependencies: [{ kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
19
|
+
}
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: BsIconAddonComponent, decorators: [{
|
|
21
|
+
type: Component,
|
|
22
|
+
args: [{
|
|
23
|
+
selector: 'df-bs-icon-addon',
|
|
24
|
+
imports: [AsyncPipe, DynamicTextPipe],
|
|
25
|
+
template: `<i [class]="iconClass()" [attr.aria-label]="(ariaLabel() | dynamicText | async) ?? null"></i>`,
|
|
26
|
+
host: {
|
|
27
|
+
'[attr.aria-hidden]': 'hasAriaLabel() ? null : "true"',
|
|
28
|
+
},
|
|
29
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
30
|
+
}]
|
|
31
|
+
}], propDecorators: { addon: [{ type: i0.Input, args: [{ isSignal: true, alias: "addon", required: true }] }], fieldInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldInputs", required: false }] }] } });
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
export { BsIconAddonComponent };
|
|
35
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-bootstrap-lazy-addon-icon.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-bootstrap-lazy-addon-icon.mjs","mappings":";;;;;;;;IAmBW;;AAEU;;;;AAEA;;;AAPR;;;;AATF;AACT;AACA;AACA;AACA;AACE;AACD;;AAEF","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-bootstrap/src/lib/addons/bs-icon-addon.component.ts"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { WrapperFieldInputs } from '@ng-forge/dynamic-forms/integration';\nimport { DynamicTextPipe } from '@ng-forge/dynamic-forms/integration';\nimport type { BsIconAddon } from '@ng-forge/dynamic-forms-bootstrap/shared';\n\n/** Renderer for the `bs-icon` addon type. */\n@Component({\n selector: 'df-bs-icon-addon',\n imports: [AsyncPipe, DynamicTextPipe],\n template: `<i [class]=\"iconClass()\" [attr.aria-label]=\"(ariaLabel() | dynamicText | async) ?? null\"></i>`,\n host: {\n '[attr.aria-hidden]': 'hasAriaLabel() ? null : \"true\"',\n },\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class BsIconAddonComponent {\n readonly addon = input.required<BsIconAddon>();\n /** Accepted for contract uniformity — `NgComponentOutlet` setInput is strict; every type must declare it. */\n readonly fieldInputs = input<WrapperFieldInputs | undefined>();\n\n protected readonly iconClass = computed(() => `bi bi-${this.addon().icon}`);\n protected readonly ariaLabel = computed(() => this.addon().ariaLabel);\n protected readonly hasAriaLabel = computed(() => this.addon().ariaLabel !== undefined);\n}\n"]}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { AsyncPipe } from '@angular/common';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { input, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import * as i1 from '@ng-forge/dynamic-forms/integration';
|
|
5
|
+
import { injectNgForgeAction, DynamicTextPipe, NgForgeActionHost } from '@ng-forge/dynamic-forms/integration';
|
|
6
|
+
|
|
7
|
+
class BsButtonFieldComponent {
|
|
8
|
+
action = injectNgForgeAction();
|
|
9
|
+
props = input(/* @ts-ignore */
|
|
10
|
+
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
11
|
+
buttonType = computed(() => this.props()?.type ?? 'button', /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "buttonType" }] : /* istanbul ignore next */ []));
|
|
13
|
+
buttonTestId = computed(() => `${this.buttonType()}-${this.action.key()}`, /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "buttonTestId" }] : /* istanbul ignore next */ []));
|
|
15
|
+
buttonClasses = computed(() => {
|
|
16
|
+
const p = this.props();
|
|
17
|
+
const variant = p?.variant || 'primary';
|
|
18
|
+
const outline = p?.outline ? 'outline-' : '';
|
|
19
|
+
return [
|
|
20
|
+
'btn',
|
|
21
|
+
`btn-${outline}${variant}`,
|
|
22
|
+
p?.size === 'sm' && 'btn-sm',
|
|
23
|
+
p?.size === 'lg' && 'btn-lg',
|
|
24
|
+
p?.block && 'w-100',
|
|
25
|
+
p?.active && 'active',
|
|
26
|
+
this.action.className(),
|
|
27
|
+
]
|
|
28
|
+
.filter(Boolean)
|
|
29
|
+
.join(' ');
|
|
30
|
+
}, /* @ts-ignore */
|
|
31
|
+
...(ngDevMode ? [{ debugName: "buttonClasses" }] : /* istanbul ignore next */ []));
|
|
32
|
+
onClick() {
|
|
33
|
+
if (this.buttonType() === 'submit')
|
|
34
|
+
return;
|
|
35
|
+
this.action.dispatch();
|
|
36
|
+
}
|
|
37
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: BsButtonFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
38
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.0.1", type: BsButtonFieldComponent, isStandalone: true, selector: "df-bs-button", inputs: { props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeActionHost }], ngImport: i0, template: `
|
|
39
|
+
@let buttonId = action.key() + '-button';
|
|
40
|
+
<button
|
|
41
|
+
[id]="buttonId"
|
|
42
|
+
[type]="buttonType()"
|
|
43
|
+
[disabled]="action.disabled()"
|
|
44
|
+
[class]="buttonClasses()"
|
|
45
|
+
[attr.tabindex]="action.tabIndex()"
|
|
46
|
+
[attr.data-testid]="buttonTestId()"
|
|
47
|
+
(click)="onClick()"
|
|
48
|
+
>
|
|
49
|
+
{{ action.label() | dynamicText | async }}
|
|
50
|
+
</button>
|
|
51
|
+
`, 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"], dependencies: [{ kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
52
|
+
}
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: BsButtonFieldComponent, decorators: [{
|
|
54
|
+
type: Component,
|
|
55
|
+
args: [{ selector: 'df-bs-button', imports: [DynamicTextPipe, AsyncPipe], hostDirectives: [NgForgeActionHost], template: `
|
|
56
|
+
@let buttonId = action.key() + '-button';
|
|
57
|
+
<button
|
|
58
|
+
[id]="buttonId"
|
|
59
|
+
[type]="buttonType()"
|
|
60
|
+
[disabled]="action.disabled()"
|
|
61
|
+
[class]="buttonClasses()"
|
|
62
|
+
[attr.tabindex]="action.tabIndex()"
|
|
63
|
+
[attr.data-testid]="buttonTestId()"
|
|
64
|
+
(click)="onClick()"
|
|
65
|
+
>
|
|
66
|
+
{{ action.label() | dynamicText | async }}
|
|
67
|
+
</button>
|
|
68
|
+
`, 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"] }]
|
|
69
|
+
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
export { BsButtonFieldComponent };
|
|
74
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-bootstrap-lazy-button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-bootstrap-lazy-button.mjs","mappings":";;;;;;AA4Bc;;AAGH;;IAGA;;AAEA;;AAEA;AACP;AACA;AACA;;;;AAKE;AACA;;;AAGA;AACD;;;;;;AAOD;;AACA;;;AA/BiB","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-bootstrap/src/lib/fields/button/bs-button.component.ts"],"sourcesContent":["import { AsyncPipe } from '@angular/common';\nimport { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { FormEvent } from '@ng-forge/dynamic-forms';\nimport { DynamicTextPipe } from '@ng-forge/dynamic-forms/integration';\nimport { injectNgForgeAction, NgForgeActionHost } from '@ng-forge/dynamic-forms/integration';\nimport { BsButtonProps } from './bs-button.type';\n\n@Component({\n selector: 'df-bs-button',\n imports: [DynamicTextPipe, AsyncPipe],\n styleUrl: '../../styles/_form-field.scss',\n hostDirectives: [NgForgeActionHost],\n template: `\n @let buttonId = action.key() + '-button';\n <button\n [id]=\"buttonId\"\n [type]=\"buttonType()\"\n [disabled]=\"action.disabled()\"\n [class]=\"buttonClasses()\"\n [attr.tabindex]=\"action.tabIndex()\"\n [attr.data-testid]=\"buttonTestId()\"\n (click)=\"onClick()\"\n >\n {{ action.label() | dynamicText | async }}\n </button>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class BsButtonFieldComponent<TEvent extends FormEvent> {\n protected readonly action = injectNgForgeAction<TEvent>();\n\n readonly props = input<BsButtonProps>();\n\n /** Resolved button type — defaults to 'button' unless overridden via props. */\n readonly buttonType = computed(() => this.props()?.type ?? 'button');\n\n readonly buttonTestId = computed(() => `${this.buttonType()}-${this.action.key()}`);\n\n readonly buttonClasses = computed(() => {\n const p = this.props();\n const variant = p?.variant || 'primary';\n const outline = p?.outline ? 'outline-' : '';\n\n return [\n 'btn',\n `btn-${outline}${variant}`,\n p?.size === 'sm' && 'btn-sm',\n p?.size === 'lg' && 'btn-lg',\n p?.block && 'w-100',\n p?.active && 'active',\n this.action.className(),\n ]\n .filter(Boolean)\n .join(' ');\n });\n\n /** Submit buttons let the native form handle submission; other buttons dispatch via the directive. */\n onClick(): void {\n if (this.buttonType() === 'submit') return;\n this.action.dispatch();\n }\n}\n"]}
|
|
@@ -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 BsCheckboxFieldComponent {
|
|
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: BsCheckboxFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
13
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: BsCheckboxFieldComponent, isStandalone: true, selector: "df-bs-checkbox", 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 checkboxId = ngf.key() + '-checkbox';
|
|
15
|
+
|
|
16
|
+
<div
|
|
17
|
+
class="form-check"
|
|
18
|
+
[class.form-switch]="props()?.switch"
|
|
19
|
+
[class.form-check-inline]="props()?.inline"
|
|
20
|
+
[class.form-check-reverse]="props()?.reverse"
|
|
21
|
+
[attr.hidden]="f().hidden() || null"
|
|
22
|
+
>
|
|
23
|
+
<input
|
|
24
|
+
ngForgeControl
|
|
25
|
+
type="checkbox"
|
|
26
|
+
[formField]="f"
|
|
27
|
+
[id]="checkboxId"
|
|
28
|
+
[indeterminate]="props()?.indeterminate ?? false"
|
|
29
|
+
class="form-check-input"
|
|
30
|
+
[class.is-invalid]="f().invalid() && f().touched()"
|
|
31
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
32
|
+
/>
|
|
33
|
+
<label [for]="checkboxId" 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}\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: BsCheckboxFieldComponent, decorators: [{
|
|
46
|
+
type: Component,
|
|
47
|
+
args: [{ selector: 'df-bs-checkbox', imports: [FormField, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
48
|
+
@let f = ngf.field(); @let checkboxId = ngf.key() + '-checkbox';
|
|
49
|
+
|
|
50
|
+
<div
|
|
51
|
+
class="form-check"
|
|
52
|
+
[class.form-switch]="props()?.switch"
|
|
53
|
+
[class.form-check-inline]="props()?.inline"
|
|
54
|
+
[class.form-check-reverse]="props()?.reverse"
|
|
55
|
+
[attr.hidden]="f().hidden() || null"
|
|
56
|
+
>
|
|
57
|
+
<input
|
|
58
|
+
ngForgeControl
|
|
59
|
+
type="checkbox"
|
|
60
|
+
[formField]="f"
|
|
61
|
+
[id]="checkboxId"
|
|
62
|
+
[indeterminate]="props()?.indeterminate ?? false"
|
|
63
|
+
class="form-check-input"
|
|
64
|
+
[class.is-invalid]="f().invalid() && f().touched()"
|
|
65
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
66
|
+
/>
|
|
67
|
+
<label [for]="checkboxId" 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}\n"] }]
|
|
78
|
+
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
export { BsCheckboxFieldComponent };
|
|
82
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-bootstrap-lazy-checkbox.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-bootstrap-lazy-checkbox.mjs","mappings":";;;;;;;AAwDc;;AAGH;;;AAHU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAdlB;;;;AAlCS","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-bootstrap/src/lib/fields/checkbox/bs-checkbox.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 { BsCheckboxProps } from './bs-checkbox.type';\nimport { AsyncPipe } from '@angular/common';\n\n@Component({\n selector: 'df-bs-checkbox',\n imports: [FormField, DynamicTextPipe, AsyncPipe, NgForgeControl],\n styleUrl: '../../styles/_form-field.scss',\n hostDirectives: [NgForgeFieldHost],\n template: `\n @let f = ngf.field(); @let checkboxId = ngf.key() + '-checkbox';\n\n <div\n class=\"form-check\"\n [class.form-switch]=\"props()?.switch\"\n [class.form-check-inline]=\"props()?.inline\"\n [class.form-check-reverse]=\"props()?.reverse\"\n [attr.hidden]=\"f().hidden() || null\"\n >\n <input\n ngForgeControl\n type=\"checkbox\"\n [formField]=\"f\"\n [id]=\"checkboxId\"\n [indeterminate]=\"props()?.indeterminate ?? false\"\n class=\"form-check-input\"\n [class.is-invalid]=\"f().invalid() && f().touched()\"\n [attr.tabindex]=\"ngf.tabIndex()\"\n />\n <label [for]=\"checkboxId\" 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 ],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class BsCheckboxFieldComponent {\n protected readonly ngf = injectNgForgeField<boolean>();\n\n readonly props = input<BsCheckboxProps>();\n}\n"]}
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, computed, 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
|
+
import { InputConstraintsDirective } from '@ng-forge/dynamic-forms-bootstrap/shared';
|
|
8
|
+
|
|
9
|
+
class BsDatepickerFieldComponent {
|
|
10
|
+
ngf = injectNgForgeField();
|
|
11
|
+
minDate = input(null, /* @ts-ignore */
|
|
12
|
+
...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
|
|
13
|
+
maxDate = input(null, /* @ts-ignore */
|
|
14
|
+
...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
15
|
+
startAt = input(null, /* @ts-ignore */
|
|
16
|
+
...(ngDevMode ? [{ debugName: "startAt" }] : /* istanbul ignore next */ []));
|
|
17
|
+
props = input(/* @ts-ignore */
|
|
18
|
+
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
19
|
+
minAsString = computed(() => {
|
|
20
|
+
const min = this.minDate();
|
|
21
|
+
return min instanceof Date ? min.toISOString().split('T')[0] : min;
|
|
22
|
+
}, /* @ts-ignore */
|
|
23
|
+
...(ngDevMode ? [{ debugName: "minAsString" }] : /* istanbul ignore next */ []));
|
|
24
|
+
maxAsString = computed(() => {
|
|
25
|
+
const max = this.maxDate();
|
|
26
|
+
return max instanceof Date ? max.toISOString().split('T')[0] : max;
|
|
27
|
+
}, /* @ts-ignore */
|
|
28
|
+
...(ngDevMode ? [{ debugName: "maxAsString" }] : /* istanbul ignore next */ []));
|
|
29
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: BsDatepickerFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
30
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.0.1", type: BsDatepickerFieldComponent, isStandalone: true, selector: "df-bs-datepicker", inputs: { minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, startAt: { classPropertyName: "startAt", publicName: "startAt", isSignal: true, isRequired: false, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
31
|
+
@let f = ngf.field(); @let p = props(); @let inputId = ngf.key() + '-input';
|
|
32
|
+
@if (p?.floatingLabel) {
|
|
33
|
+
<!-- Floating label variant -->
|
|
34
|
+
<div class="form-floating mb-3">
|
|
35
|
+
<input
|
|
36
|
+
ngForgeControl
|
|
37
|
+
dfBsInputConstraints
|
|
38
|
+
[formField]="f"
|
|
39
|
+
[id]="inputId"
|
|
40
|
+
type="date"
|
|
41
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
42
|
+
[dfMin]="minAsString()"
|
|
43
|
+
[dfMax]="maxAsString()"
|
|
44
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
45
|
+
class="form-control"
|
|
46
|
+
[class.form-control-sm]="p?.size === 'sm'"
|
|
47
|
+
[class.form-control-lg]="p?.size === 'lg'"
|
|
48
|
+
[class.is-invalid]="f().invalid() && f().touched()"
|
|
49
|
+
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
50
|
+
/>
|
|
51
|
+
@if (ngf.label()) {
|
|
52
|
+
<label [for]="inputId">{{ ngf.label() | dynamicText | async }}</label>
|
|
53
|
+
}
|
|
54
|
+
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
55
|
+
<div class="valid-feedback d-block">
|
|
56
|
+
{{ p?.validFeedback | dynamicText | async }}
|
|
57
|
+
</div>
|
|
58
|
+
}
|
|
59
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
60
|
+
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
61
|
+
}
|
|
62
|
+
</div>
|
|
63
|
+
} @else {
|
|
64
|
+
<!-- Standard variant -->
|
|
65
|
+
<div class="mb-3">
|
|
66
|
+
@if (ngf.label()) {
|
|
67
|
+
<label [for]="inputId" class="form-label">{{ ngf.label() | dynamicText | async }}</label>
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
<input
|
|
71
|
+
ngForgeControl
|
|
72
|
+
dfBsInputConstraints
|
|
73
|
+
[formField]="f"
|
|
74
|
+
[id]="inputId"
|
|
75
|
+
type="date"
|
|
76
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
77
|
+
[dfMin]="minAsString()"
|
|
78
|
+
[dfMax]="maxAsString()"
|
|
79
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
80
|
+
class="form-control"
|
|
81
|
+
[class.form-control-sm]="p?.size === 'sm'"
|
|
82
|
+
[class.form-control-lg]="p?.size === 'lg'"
|
|
83
|
+
[class.is-invalid]="f().invalid() && f().touched()"
|
|
84
|
+
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
85
|
+
/>
|
|
86
|
+
|
|
87
|
+
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
88
|
+
<div class="valid-feedback d-block">
|
|
89
|
+
{{ p?.validFeedback | dynamicText | async }}
|
|
90
|
+
</div>
|
|
91
|
+
}
|
|
92
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
93
|
+
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
94
|
+
} @else if (p?.hint) {
|
|
95
|
+
<div class="form-text" [id]="ngf.hintId()">{{ p?.hint | dynamicText | async }}</div>
|
|
96
|
+
}
|
|
97
|
+
</div>
|
|
98
|
+
}
|
|
99
|
+
`, 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([hidden]){display:none!important}\n"], dependencies: [{ kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "directive", type: InputConstraintsDirective, selector: "[dfBsInputConstraints]", inputs: ["dfMin", "dfMax", "dfStep"] }, { kind: "directive", type: NgForgeControl, selector: "[ngForgeControl]", inputs: ["ngForgeControl"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
100
|
+
}
|
|
101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.1", ngImport: i0, type: BsDatepickerFieldComponent, decorators: [{
|
|
102
|
+
type: Component,
|
|
103
|
+
args: [{ selector: 'df-bs-datepicker', imports: [FormField, DynamicTextPipe, AsyncPipe, InputConstraintsDirective, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
104
|
+
@let f = ngf.field(); @let p = props(); @let inputId = ngf.key() + '-input';
|
|
105
|
+
@if (p?.floatingLabel) {
|
|
106
|
+
<!-- Floating label variant -->
|
|
107
|
+
<div class="form-floating mb-3">
|
|
108
|
+
<input
|
|
109
|
+
ngForgeControl
|
|
110
|
+
dfBsInputConstraints
|
|
111
|
+
[formField]="f"
|
|
112
|
+
[id]="inputId"
|
|
113
|
+
type="date"
|
|
114
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
115
|
+
[dfMin]="minAsString()"
|
|
116
|
+
[dfMax]="maxAsString()"
|
|
117
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
118
|
+
class="form-control"
|
|
119
|
+
[class.form-control-sm]="p?.size === 'sm'"
|
|
120
|
+
[class.form-control-lg]="p?.size === 'lg'"
|
|
121
|
+
[class.is-invalid]="f().invalid() && f().touched()"
|
|
122
|
+
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
123
|
+
/>
|
|
124
|
+
@if (ngf.label()) {
|
|
125
|
+
<label [for]="inputId">{{ ngf.label() | dynamicText | async }}</label>
|
|
126
|
+
}
|
|
127
|
+
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
128
|
+
<div class="valid-feedback d-block">
|
|
129
|
+
{{ p?.validFeedback | dynamicText | async }}
|
|
130
|
+
</div>
|
|
131
|
+
}
|
|
132
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
133
|
+
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
134
|
+
}
|
|
135
|
+
</div>
|
|
136
|
+
} @else {
|
|
137
|
+
<!-- Standard variant -->
|
|
138
|
+
<div class="mb-3">
|
|
139
|
+
@if (ngf.label()) {
|
|
140
|
+
<label [for]="inputId" class="form-label">{{ ngf.label() | dynamicText | async }}</label>
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
<input
|
|
144
|
+
ngForgeControl
|
|
145
|
+
dfBsInputConstraints
|
|
146
|
+
[formField]="f"
|
|
147
|
+
[id]="inputId"
|
|
148
|
+
type="date"
|
|
149
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
150
|
+
[dfMin]="minAsString()"
|
|
151
|
+
[dfMax]="maxAsString()"
|
|
152
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
153
|
+
class="form-control"
|
|
154
|
+
[class.form-control-sm]="p?.size === 'sm'"
|
|
155
|
+
[class.form-control-lg]="p?.size === 'lg'"
|
|
156
|
+
[class.is-invalid]="f().invalid() && f().touched()"
|
|
157
|
+
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
158
|
+
/>
|
|
159
|
+
|
|
160
|
+
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
161
|
+
<div class="valid-feedback d-block">
|
|
162
|
+
{{ p?.validFeedback | dynamicText | async }}
|
|
163
|
+
</div>
|
|
164
|
+
}
|
|
165
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
166
|
+
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
167
|
+
} @else if (p?.hint) {
|
|
168
|
+
<div class="form-text" [id]="ngf.hintId()">{{ p?.hint | dynamicText | async }}</div>
|
|
169
|
+
}
|
|
170
|
+
</div>
|
|
171
|
+
}
|
|
172
|
+
`, 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"] }]
|
|
173
|
+
}], 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 }] }] } });
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
export { BsDatepickerFieldComponent };
|
|
177
|
+
//# sourceMappingURL=ng-forge-dynamic-forms-bootstrap-lazy-datepicker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ng-forge-dynamic-forms-bootstrap-lazy-datepicker.mjs","mappings":";;;;;;;;AA4Fc;;;;;;;;AAMH;;IAGA;AACP;;;;AAIO;AACP;;;;;AAfiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAnFT","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-bootstrap/src/lib/fields/datepicker/bs-datepicker.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component, computed, 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 { BsDatepickerProps } from './bs-datepicker.type';\nimport { AsyncPipe } from '@angular/common';\nimport { InputConstraintsDirective } from '@ng-forge/dynamic-forms-bootstrap/shared';\n\n@Component({\n selector: 'df-bs-datepicker',\n imports: [FormField, DynamicTextPipe, AsyncPipe, InputConstraintsDirective, NgForgeControl],\n styleUrl: '../../styles/_form-field.scss',\n hostDirectives: [NgForgeFieldHost],\n template: `\n @let f = ngf.field(); @let p = props(); @let inputId = ngf.key() + '-input';\n @if (p?.floatingLabel) {\n <!-- Floating label variant -->\n <div class=\"form-floating mb-3\">\n <input\n ngForgeControl\n dfBsInputConstraints\n [formField]=\"f\"\n [id]=\"inputId\"\n type=\"date\"\n [placeholder]=\"(ngf.placeholder() | dynamicText | async) ?? ''\"\n [dfMin]=\"minAsString()\"\n [dfMax]=\"maxAsString()\"\n [attr.tabindex]=\"ngf.tabIndex()\"\n class=\"form-control\"\n [class.form-control-sm]=\"p?.size === 'sm'\"\n [class.form-control-lg]=\"p?.size === 'lg'\"\n [class.is-invalid]=\"f().invalid() && f().touched()\"\n [class.is-valid]=\"f().valid() && f().touched() && p?.validFeedback\"\n />\n @if (ngf.label()) {\n <label [for]=\"inputId\">{{ ngf.label() | dynamicText | async }}</label>\n }\n @if (p?.validFeedback && f().valid() && f().touched()) {\n <div class=\"valid-feedback d-block\">\n {{ p?.validFeedback | dynamicText | async }}\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 }\n </div>\n } @else {\n <!-- Standard variant -->\n <div class=\"mb-3\">\n @if (ngf.label()) {\n <label [for]=\"inputId\" class=\"form-label\">{{ ngf.label() | dynamicText | async }}</label>\n }\n\n <input\n ngForgeControl\n dfBsInputConstraints\n [formField]=\"f\"\n [id]=\"inputId\"\n type=\"date\"\n [placeholder]=\"(ngf.placeholder() | dynamicText | async) ?? ''\"\n [dfMin]=\"minAsString()\"\n [dfMax]=\"maxAsString()\"\n [attr.tabindex]=\"ngf.tabIndex()\"\n class=\"form-control\"\n [class.form-control-sm]=\"p?.size === 'sm'\"\n [class.form-control-lg]=\"p?.size === 'lg'\"\n [class.is-invalid]=\"f().invalid() && f().touched()\"\n [class.is-valid]=\"f().valid() && f().touched() && p?.validFeedback\"\n />\n\n @if (p?.validFeedback && f().valid() && f().touched()) {\n <div class=\"valid-feedback d-block\">\n {{ p?.validFeedback | dynamicText | async }}\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 (p?.hint) {\n <div class=\"form-text\" [id]=\"ngf.hintId()\">{{ p?.hint | dynamicText | async }}</div>\n }\n </div>\n }\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n styles: [\n `\n :host([hidden]) {\n display: none !important;\n }\n `,\n ],\n})\nexport default class BsDatepickerFieldComponent {\n protected readonly ngf = injectNgForgeField<string>();\n\n readonly minDate = input<Date | string | null>(null);\n readonly maxDate = input<Date | string | null>(null);\n readonly startAt = input<Date | null>(null);\n readonly props = input<BsDatepickerProps>();\n\n // Helper methods to convert Date to string for HTML attributes\n readonly minAsString = computed(() => {\n const min = this.minDate();\n return min instanceof Date ? min.toISOString().split('T')[0] : min;\n });\n\n readonly maxAsString = computed(() => {\n const max = this.maxDate();\n return max instanceof Date ? max.toISOString().split('T')[0] : max;\n });\n}\n"]}
|