@ng-forge/dynamic-forms-bootstrap 1.2.0 → 1.3.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,1335 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import * as i1 from '@ng-forge/dynamic-forms/integration';
|
|
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
|
-
import { FormField } from '@angular/forms/signals';
|
|
7
|
-
import { InputConstraintsDirective, BOOTSTRAP_CONFIG, BS_INPUT_TYPE_OVERRIDE, runBsPresetAction } from '@ng-forge/dynamic-forms-bootstrap/shared';
|
|
1
|
+
import { DEFAULT_PROPS, ARRAY_CONTEXT, injectNonFieldLogicResolver, buildBaseInputs, valueFieldMapper, optionsFieldMapper, checkboxFieldMapper, submitButtonFieldMapper, nextButtonFieldMapper, previousButtonFieldMapper, addArrayItemButtonMapper, prependArrayItemButtonMapper, insertArrayItemButtonMapper, removeArrayItemButtonMapper, popArrayItemButtonMapper, shiftArrayItemButtonMapper, datepickerFieldMapper, ADDON_TYPE_DEFINITIONS } from '@ng-forge/dynamic-forms/integration';
|
|
2
|
+
import { inject, computed, isSignal } from '@angular/core';
|
|
3
|
+
import { BOOTSTRAP_CONFIG } from '@ng-forge/dynamic-forms-bootstrap/shared';
|
|
8
4
|
export { BOOTSTRAP_CONFIG, BS_INPUT_TYPE_OVERRIDE } from '@ng-forge/dynamic-forms-bootstrap/shared';
|
|
9
|
-
import {
|
|
10
|
-
import { explicitEffect } from 'ngxtension/explicit-effect';
|
|
11
|
-
|
|
12
|
-
class BsButtonFieldComponent {
|
|
13
|
-
action = injectNgForgeAction();
|
|
14
|
-
props = input(/* @ts-ignore */
|
|
15
|
-
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
16
|
-
buttonType = computed(() => this.props()?.type ?? 'button', /* @ts-ignore */
|
|
17
|
-
...(ngDevMode ? [{ debugName: "buttonType" }] : /* istanbul ignore next */ []));
|
|
18
|
-
buttonTestId = computed(() => `${this.buttonType()}-${this.action.key()}`, /* @ts-ignore */
|
|
19
|
-
...(ngDevMode ? [{ debugName: "buttonTestId" }] : /* istanbul ignore next */ []));
|
|
20
|
-
buttonClasses = computed(() => {
|
|
21
|
-
const p = this.props();
|
|
22
|
-
const variant = p?.variant || 'primary';
|
|
23
|
-
const outline = p?.outline ? 'outline-' : '';
|
|
24
|
-
return [
|
|
25
|
-
'btn',
|
|
26
|
-
`btn-${outline}${variant}`,
|
|
27
|
-
p?.size === 'sm' && 'btn-sm',
|
|
28
|
-
p?.size === 'lg' && 'btn-lg',
|
|
29
|
-
p?.block && 'w-100',
|
|
30
|
-
p?.active && 'active',
|
|
31
|
-
this.action.className(),
|
|
32
|
-
]
|
|
33
|
-
.filter(Boolean)
|
|
34
|
-
.join(' ');
|
|
35
|
-
}, /* @ts-ignore */
|
|
36
|
-
...(ngDevMode ? [{ debugName: "buttonClasses" }] : /* istanbul ignore next */ []));
|
|
37
|
-
onClick() {
|
|
38
|
-
if (this.buttonType() === 'submit')
|
|
39
|
-
return;
|
|
40
|
-
this.action.dispatch();
|
|
41
|
-
}
|
|
42
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsButtonFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
43
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.5", 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: `
|
|
44
|
-
@let buttonId = action.key() + '-button';
|
|
45
|
-
<button
|
|
46
|
-
[id]="buttonId"
|
|
47
|
-
[type]="buttonType()"
|
|
48
|
-
[disabled]="action.disabled()"
|
|
49
|
-
[class]="buttonClasses()"
|
|
50
|
-
[attr.tabindex]="action.tabIndex()"
|
|
51
|
-
[attr.data-testid]="buttonTestId()"
|
|
52
|
-
(click)="onClick()"
|
|
53
|
-
>
|
|
54
|
-
{{ action.label() | dynamicText | async }}
|
|
55
|
-
</button>
|
|
56
|
-
`, 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 });
|
|
57
|
-
}
|
|
58
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsButtonFieldComponent, decorators: [{
|
|
59
|
-
type: Component,
|
|
60
|
-
args: [{ selector: 'df-bs-button', imports: [DynamicTextPipe, AsyncPipe], hostDirectives: [NgForgeActionHost], template: `
|
|
61
|
-
@let buttonId = action.key() + '-button';
|
|
62
|
-
<button
|
|
63
|
-
[id]="buttonId"
|
|
64
|
-
[type]="buttonType()"
|
|
65
|
-
[disabled]="action.disabled()"
|
|
66
|
-
[class]="buttonClasses()"
|
|
67
|
-
[attr.tabindex]="action.tabIndex()"
|
|
68
|
-
[attr.data-testid]="buttonTestId()"
|
|
69
|
-
(click)="onClick()"
|
|
70
|
-
>
|
|
71
|
-
{{ action.label() | dynamicText | async }}
|
|
72
|
-
</button>
|
|
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"] }]
|
|
74
|
-
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
class BsCheckboxFieldComponent {
|
|
78
|
-
ngf = injectNgForgeField();
|
|
79
|
-
props = input(/* @ts-ignore */
|
|
80
|
-
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
81
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsCheckboxFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
82
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", 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: `
|
|
83
|
-
@let f = ngf.field(); @let checkboxId = ngf.key() + '-checkbox';
|
|
84
|
-
|
|
85
|
-
<div
|
|
86
|
-
class="form-check"
|
|
87
|
-
[class.form-switch]="props()?.switch"
|
|
88
|
-
[class.form-check-inline]="props()?.inline"
|
|
89
|
-
[class.form-check-reverse]="props()?.reverse"
|
|
90
|
-
[attr.hidden]="f().hidden() || null"
|
|
91
|
-
>
|
|
92
|
-
<input
|
|
93
|
-
ngForgeControl
|
|
94
|
-
type="checkbox"
|
|
95
|
-
[formField]="f"
|
|
96
|
-
[id]="checkboxId"
|
|
97
|
-
[indeterminate]="props()?.indeterminate ?? false"
|
|
98
|
-
class="form-check-input"
|
|
99
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
100
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
101
|
-
/>
|
|
102
|
-
<label [for]="checkboxId" class="form-check-label">
|
|
103
|
-
{{ ngf.label() | dynamicText | async }}
|
|
104
|
-
</label>
|
|
105
|
-
</div>
|
|
106
|
-
|
|
107
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
108
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
109
|
-
} @else if (props()?.hint; as hint) {
|
|
110
|
-
<div class="form-text" [id]="ngf.hintId()" [attr.hidden]="f().hidden() || null">{{ hint | dynamicText | async }}</div>
|
|
111
|
-
}
|
|
112
|
-
`, 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 });
|
|
113
|
-
}
|
|
114
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsCheckboxFieldComponent, decorators: [{
|
|
115
|
-
type: Component,
|
|
116
|
-
args: [{ selector: 'df-bs-checkbox', imports: [FormField, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
117
|
-
@let f = ngf.field(); @let checkboxId = ngf.key() + '-checkbox';
|
|
118
|
-
|
|
119
|
-
<div
|
|
120
|
-
class="form-check"
|
|
121
|
-
[class.form-switch]="props()?.switch"
|
|
122
|
-
[class.form-check-inline]="props()?.inline"
|
|
123
|
-
[class.form-check-reverse]="props()?.reverse"
|
|
124
|
-
[attr.hidden]="f().hidden() || null"
|
|
125
|
-
>
|
|
126
|
-
<input
|
|
127
|
-
ngForgeControl
|
|
128
|
-
type="checkbox"
|
|
129
|
-
[formField]="f"
|
|
130
|
-
[id]="checkboxId"
|
|
131
|
-
[indeterminate]="props()?.indeterminate ?? false"
|
|
132
|
-
class="form-check-input"
|
|
133
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
134
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
135
|
-
/>
|
|
136
|
-
<label [for]="checkboxId" class="form-check-label">
|
|
137
|
-
{{ ngf.label() | dynamicText | async }}
|
|
138
|
-
</label>
|
|
139
|
-
</div>
|
|
140
|
-
|
|
141
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
142
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
143
|
-
} @else if (props()?.hint; as hint) {
|
|
144
|
-
<div class="form-text" [id]="ngf.hintId()" [attr.hidden]="f().hidden() || null">{{ hint | dynamicText | async }}</div>
|
|
145
|
-
}
|
|
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"] }]
|
|
147
|
-
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
148
|
-
|
|
149
|
-
class BsDatepickerFieldComponent {
|
|
150
|
-
ngf = injectNgForgeField();
|
|
151
|
-
minDate = input(null, /* @ts-ignore */
|
|
152
|
-
...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
|
|
153
|
-
maxDate = input(null, /* @ts-ignore */
|
|
154
|
-
...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
155
|
-
startAt = input(null, /* @ts-ignore */
|
|
156
|
-
...(ngDevMode ? [{ debugName: "startAt" }] : /* istanbul ignore next */ []));
|
|
157
|
-
props = input(/* @ts-ignore */
|
|
158
|
-
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
159
|
-
minAsString = computed(() => {
|
|
160
|
-
const min = this.minDate();
|
|
161
|
-
return min instanceof Date ? min.toISOString().split('T')[0] : min;
|
|
162
|
-
}, /* @ts-ignore */
|
|
163
|
-
...(ngDevMode ? [{ debugName: "minAsString" }] : /* istanbul ignore next */ []));
|
|
164
|
-
maxAsString = computed(() => {
|
|
165
|
-
const max = this.maxDate();
|
|
166
|
-
return max instanceof Date ? max.toISOString().split('T')[0] : max;
|
|
167
|
-
}, /* @ts-ignore */
|
|
168
|
-
...(ngDevMode ? [{ debugName: "maxAsString" }] : /* istanbul ignore next */ []));
|
|
169
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsDatepickerFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
170
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", 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: `
|
|
171
|
-
@let f = ngf.field(); @let p = props(); @let inputId = ngf.key() + '-input';
|
|
172
|
-
@if (p?.floatingLabel) {
|
|
173
|
-
<!-- Floating label variant -->
|
|
174
|
-
<div class="form-floating mb-3">
|
|
175
|
-
<input
|
|
176
|
-
ngForgeControl
|
|
177
|
-
dfBsInputConstraints
|
|
178
|
-
[formField]="f"
|
|
179
|
-
[id]="inputId"
|
|
180
|
-
type="date"
|
|
181
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
182
|
-
[dfMin]="minAsString()"
|
|
183
|
-
[dfMax]="maxAsString()"
|
|
184
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
185
|
-
class="form-control"
|
|
186
|
-
[class.form-control-sm]="p?.size === 'sm'"
|
|
187
|
-
[class.form-control-lg]="p?.size === 'lg'"
|
|
188
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
189
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
190
|
-
/>
|
|
191
|
-
@if (ngf.label()) {
|
|
192
|
-
<label [for]="inputId">{{ ngf.label() | dynamicText | async }}</label>
|
|
193
|
-
}
|
|
194
|
-
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
195
|
-
<div class="valid-feedback d-block">
|
|
196
|
-
{{ p?.validFeedback | dynamicText | async }}
|
|
197
|
-
</div>
|
|
198
|
-
}
|
|
199
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
200
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
201
|
-
}
|
|
202
|
-
</div>
|
|
203
|
-
} @else {
|
|
204
|
-
<!-- Standard variant -->
|
|
205
|
-
<div class="mb-3">
|
|
206
|
-
@if (ngf.label()) {
|
|
207
|
-
<label [for]="inputId" class="form-label">{{ ngf.label() | dynamicText | async }}</label>
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
<input
|
|
211
|
-
ngForgeControl
|
|
212
|
-
dfBsInputConstraints
|
|
213
|
-
[formField]="f"
|
|
214
|
-
[id]="inputId"
|
|
215
|
-
type="date"
|
|
216
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
217
|
-
[dfMin]="minAsString()"
|
|
218
|
-
[dfMax]="maxAsString()"
|
|
219
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
220
|
-
class="form-control"
|
|
221
|
-
[class.form-control-sm]="p?.size === 'sm'"
|
|
222
|
-
[class.form-control-lg]="p?.size === 'lg'"
|
|
223
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
224
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
225
|
-
/>
|
|
226
|
-
|
|
227
|
-
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
228
|
-
<div class="valid-feedback d-block">
|
|
229
|
-
{{ p?.validFeedback | dynamicText | async }}
|
|
230
|
-
</div>
|
|
231
|
-
}
|
|
232
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
233
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
234
|
-
} @else if (p?.hint) {
|
|
235
|
-
<div class="form-text" [id]="ngf.hintId()">{{ p?.hint | dynamicText | async }}</div>
|
|
236
|
-
}
|
|
237
|
-
</div>
|
|
238
|
-
}
|
|
239
|
-
`, 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 });
|
|
240
|
-
}
|
|
241
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsDatepickerFieldComponent, decorators: [{
|
|
242
|
-
type: Component,
|
|
243
|
-
args: [{ selector: 'df-bs-datepicker', imports: [FormField, DynamicTextPipe, AsyncPipe, InputConstraintsDirective, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
244
|
-
@let f = ngf.field(); @let p = props(); @let inputId = ngf.key() + '-input';
|
|
245
|
-
@if (p?.floatingLabel) {
|
|
246
|
-
<!-- Floating label variant -->
|
|
247
|
-
<div class="form-floating mb-3">
|
|
248
|
-
<input
|
|
249
|
-
ngForgeControl
|
|
250
|
-
dfBsInputConstraints
|
|
251
|
-
[formField]="f"
|
|
252
|
-
[id]="inputId"
|
|
253
|
-
type="date"
|
|
254
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
255
|
-
[dfMin]="minAsString()"
|
|
256
|
-
[dfMax]="maxAsString()"
|
|
257
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
258
|
-
class="form-control"
|
|
259
|
-
[class.form-control-sm]="p?.size === 'sm'"
|
|
260
|
-
[class.form-control-lg]="p?.size === 'lg'"
|
|
261
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
262
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
263
|
-
/>
|
|
264
|
-
@if (ngf.label()) {
|
|
265
|
-
<label [for]="inputId">{{ ngf.label() | dynamicText | async }}</label>
|
|
266
|
-
}
|
|
267
|
-
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
268
|
-
<div class="valid-feedback d-block">
|
|
269
|
-
{{ p?.validFeedback | dynamicText | async }}
|
|
270
|
-
</div>
|
|
271
|
-
}
|
|
272
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
273
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
274
|
-
}
|
|
275
|
-
</div>
|
|
276
|
-
} @else {
|
|
277
|
-
<!-- Standard variant -->
|
|
278
|
-
<div class="mb-3">
|
|
279
|
-
@if (ngf.label()) {
|
|
280
|
-
<label [for]="inputId" class="form-label">{{ ngf.label() | dynamicText | async }}</label>
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
<input
|
|
284
|
-
ngForgeControl
|
|
285
|
-
dfBsInputConstraints
|
|
286
|
-
[formField]="f"
|
|
287
|
-
[id]="inputId"
|
|
288
|
-
type="date"
|
|
289
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
290
|
-
[dfMin]="minAsString()"
|
|
291
|
-
[dfMax]="maxAsString()"
|
|
292
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
293
|
-
class="form-control"
|
|
294
|
-
[class.form-control-sm]="p?.size === 'sm'"
|
|
295
|
-
[class.form-control-lg]="p?.size === 'lg'"
|
|
296
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
297
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
298
|
-
/>
|
|
299
|
-
|
|
300
|
-
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
301
|
-
<div class="valid-feedback d-block">
|
|
302
|
-
{{ p?.validFeedback | dynamicText | async }}
|
|
303
|
-
</div>
|
|
304
|
-
}
|
|
305
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
306
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
307
|
-
} @else if (p?.hint) {
|
|
308
|
-
<div class="form-text" [id]="ngf.hintId()">{{ p?.hint | dynamicText | async }}</div>
|
|
309
|
-
}
|
|
310
|
-
</div>
|
|
311
|
-
}
|
|
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"] }]
|
|
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 }] }] } });
|
|
314
|
-
|
|
315
|
-
class BsInputFieldComponent {
|
|
316
|
-
bootstrapConfig = inject(BOOTSTRAP_CONFIG, { optional: true });
|
|
317
|
-
ngf = injectNgForgeField();
|
|
318
|
-
ngfa = injectNgForgeAddons();
|
|
319
|
-
props = input(/* @ts-ignore */
|
|
320
|
-
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
321
|
-
fieldInputs = input(/* @ts-ignore */
|
|
322
|
-
...(ngDevMode ? [undefined, { debugName: "fieldInputs" }] : /* istanbul ignore next */ []));
|
|
323
|
-
typeOverride = inject(BS_INPUT_TYPE_OVERRIDE);
|
|
324
|
-
size = computed(() => this.props()?.size ?? this.bootstrapConfig?.size, /* @ts-ignore */
|
|
325
|
-
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
326
|
-
floatingLabel = computed(() => this.props()?.floatingLabel ?? this.bootstrapConfig?.floatingLabel ?? false, /* @ts-ignore */
|
|
327
|
-
...(ngDevMode ? [{ debugName: "floatingLabel" }] : /* istanbul ignore next */ []));
|
|
328
|
-
type = computed(() => this.typeOverride() ?? this.props()?.type ?? 'text', /* @ts-ignore */
|
|
329
|
-
...(ngDevMode ? [{ debugName: "type" }] : /* istanbul ignore next */ []));
|
|
330
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsInputFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
331
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: BsInputFieldComponent, isStandalone: true, selector: "df-bs-input", inputs: { props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null }, fieldInputs: { classPropertyName: "fieldInputs", publicName: "fieldInputs", isSignal: true, isRequired: false, transformFunction: null } }, providers: [
|
|
332
|
-
{
|
|
333
|
-
provide: BS_INPUT_TYPE_OVERRIDE,
|
|
334
|
-
useFactory: () => signal(undefined),
|
|
335
|
-
},
|
|
336
|
-
{
|
|
337
|
-
provide: ADDON_PRESET_HANDLER,
|
|
338
|
-
useFactory: () => {
|
|
339
|
-
const typeOverride = inject(BS_INPUT_TYPE_OVERRIDE);
|
|
340
|
-
const fsc = inject(FIELD_SIGNAL_CONTEXT, { optional: true });
|
|
341
|
-
const logger = inject(DynamicFormLogger);
|
|
342
|
-
const host = inject(forwardRef(() => BsInputFieldComponent));
|
|
343
|
-
return {
|
|
344
|
-
run: (preset, ctx) => {
|
|
345
|
-
const fieldKey = ctx.field.key;
|
|
346
|
-
return runBsPresetAction(preset, ctx, {
|
|
347
|
-
typeOverride,
|
|
348
|
-
fieldValueSetter: ctx.setValue,
|
|
349
|
-
fieldDefaultValueGetter: fsc && fieldKey ? () => fsc.defaultValues()?.[fieldKey] : undefined,
|
|
350
|
-
baselineType: () => host.props()?.type,
|
|
351
|
-
logger,
|
|
352
|
-
});
|
|
353
|
-
},
|
|
354
|
-
};
|
|
355
|
-
},
|
|
356
|
-
},
|
|
357
|
-
], hostDirectives: [{ directive: i1.NgForgeFieldHost }, { directive: i1.NgForgeAddons }], ngImport: i0, template: `
|
|
358
|
-
@let f = ngf.field(); @let p = props(); @let inputId = ngf.key() + '-input';
|
|
359
|
-
@if (floatingLabel()) {
|
|
360
|
-
<div class="mb-3">
|
|
361
|
-
@if (ngfa.hasAddons()) {
|
|
362
|
-
<div class="input-group">
|
|
363
|
-
@for (a of ngfa.prefixAddons(); track $index) {
|
|
364
|
-
<span class="input-group-text">
|
|
365
|
-
<df-addon-slot [addon]="a" [fieldInputs]="fieldInputs()" [hidden]="ngfa.hiddenSignalCache().get(a)" />
|
|
366
|
-
</span>
|
|
367
|
-
}
|
|
368
|
-
<div class="form-floating">
|
|
369
|
-
<input
|
|
370
|
-
ngForgeControl
|
|
371
|
-
[formField]="f"
|
|
372
|
-
[id]="inputId"
|
|
373
|
-
[type]="type()"
|
|
374
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
375
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
376
|
-
class="form-control"
|
|
377
|
-
[class.form-control-sm]="size() === 'sm'"
|
|
378
|
-
[class.form-control-lg]="size() === 'lg'"
|
|
379
|
-
[class.form-control-plaintext]="p?.plaintext"
|
|
380
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
381
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
382
|
-
/>
|
|
383
|
-
@if (ngf.label()) {
|
|
384
|
-
<label [for]="inputId">{{ ngf.label() | dynamicText | async }}</label>
|
|
385
|
-
}
|
|
386
|
-
</div>
|
|
387
|
-
@for (a of ngfa.suffixAddons(); track $index) {
|
|
388
|
-
<span class="input-group-text">
|
|
389
|
-
<df-addon-slot [addon]="a" [fieldInputs]="fieldInputs()" [hidden]="ngfa.hiddenSignalCache().get(a)" />
|
|
390
|
-
</span>
|
|
391
|
-
}
|
|
392
|
-
</div>
|
|
393
|
-
} @else {
|
|
394
|
-
<div class="form-floating">
|
|
395
|
-
<input
|
|
396
|
-
ngForgeControl
|
|
397
|
-
[formField]="f"
|
|
398
|
-
[id]="inputId"
|
|
399
|
-
[type]="type()"
|
|
400
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
401
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
402
|
-
class="form-control"
|
|
403
|
-
[class.form-control-sm]="size() === 'sm'"
|
|
404
|
-
[class.form-control-lg]="size() === 'lg'"
|
|
405
|
-
[class.form-control-plaintext]="p?.plaintext"
|
|
406
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
407
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
408
|
-
/>
|
|
409
|
-
@if (ngf.label()) {
|
|
410
|
-
<label [for]="inputId">{{ ngf.label() | dynamicText | async }}</label>
|
|
411
|
-
}
|
|
412
|
-
</div>
|
|
413
|
-
}
|
|
414
|
-
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
415
|
-
<div class="valid-feedback d-block">
|
|
416
|
-
{{ p?.validFeedback | dynamicText | async }}
|
|
417
|
-
</div>
|
|
418
|
-
}
|
|
419
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
420
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
421
|
-
}
|
|
422
|
-
</div>
|
|
423
|
-
} @else {
|
|
424
|
-
<div class="mb-3">
|
|
425
|
-
@if (ngf.label()) {
|
|
426
|
-
<label [for]="inputId" class="form-label">{{ ngf.label() | dynamicText | async }}</label>
|
|
427
|
-
}
|
|
428
|
-
@if (ngfa.hasAddons()) {
|
|
429
|
-
<div class="input-group">
|
|
430
|
-
@for (a of ngfa.prefixAddons(); track $index) {
|
|
431
|
-
<span class="input-group-text">
|
|
432
|
-
<df-addon-slot [addon]="a" [fieldInputs]="fieldInputs()" [hidden]="ngfa.hiddenSignalCache().get(a)" />
|
|
433
|
-
</span>
|
|
434
|
-
}
|
|
435
|
-
<input
|
|
436
|
-
ngForgeControl
|
|
437
|
-
[formField]="f"
|
|
438
|
-
[id]="inputId"
|
|
439
|
-
[type]="type()"
|
|
440
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
441
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
442
|
-
class="form-control"
|
|
443
|
-
[class.form-control-sm]="size() === 'sm'"
|
|
444
|
-
[class.form-control-lg]="size() === 'lg'"
|
|
445
|
-
[class.form-control-plaintext]="p?.plaintext"
|
|
446
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
447
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
448
|
-
/>
|
|
449
|
-
@for (a of ngfa.suffixAddons(); track $index) {
|
|
450
|
-
<span class="input-group-text">
|
|
451
|
-
<df-addon-slot [addon]="a" [fieldInputs]="fieldInputs()" [hidden]="ngfa.hiddenSignalCache().get(a)" />
|
|
452
|
-
</span>
|
|
453
|
-
}
|
|
454
|
-
</div>
|
|
455
|
-
} @else {
|
|
456
|
-
<input
|
|
457
|
-
ngForgeControl
|
|
458
|
-
[formField]="f"
|
|
459
|
-
[id]="inputId"
|
|
460
|
-
[type]="type()"
|
|
461
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
462
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
463
|
-
class="form-control"
|
|
464
|
-
[class.form-control-sm]="size() === 'sm'"
|
|
465
|
-
[class.form-control-lg]="size() === 'lg'"
|
|
466
|
-
[class.form-control-plaintext]="p?.plaintext"
|
|
467
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
468
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
469
|
-
/>
|
|
470
|
-
}
|
|
471
|
-
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
472
|
-
<div class="valid-feedback d-block">
|
|
473
|
-
{{ p?.validFeedback | dynamicText | async }}
|
|
474
|
-
</div>
|
|
475
|
-
}
|
|
476
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
477
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
478
|
-
} @else if (p?.hint) {
|
|
479
|
-
<div class="form-text" [id]="ngf.hintId()">{{ p?.hint | dynamicText | async }}</div>
|
|
480
|
-
}
|
|
481
|
-
</div>
|
|
482
|
-
}
|
|
483
|
-
`, 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}: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"], dependencies: [{ kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "directive", type: NgForgeControl, selector: "[ngForgeControl]", inputs: ["ngForgeControl"] }, { kind: "component", type: DfAddonSlot, selector: "df-addon-slot", inputs: ["addon", "fieldInputs", "hidden"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
484
|
-
}
|
|
485
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsInputFieldComponent, decorators: [{
|
|
486
|
-
type: Component,
|
|
487
|
-
args: [{ selector: 'df-bs-input', imports: [FormField, DynamicTextPipe, AsyncPipe, NgForgeControl, DfAddonSlot], hostDirectives: [NgForgeFieldHost, NgForgeAddons], template: `
|
|
488
|
-
@let f = ngf.field(); @let p = props(); @let inputId = ngf.key() + '-input';
|
|
489
|
-
@if (floatingLabel()) {
|
|
490
|
-
<div class="mb-3">
|
|
491
|
-
@if (ngfa.hasAddons()) {
|
|
492
|
-
<div class="input-group">
|
|
493
|
-
@for (a of ngfa.prefixAddons(); track $index) {
|
|
494
|
-
<span class="input-group-text">
|
|
495
|
-
<df-addon-slot [addon]="a" [fieldInputs]="fieldInputs()" [hidden]="ngfa.hiddenSignalCache().get(a)" />
|
|
496
|
-
</span>
|
|
497
|
-
}
|
|
498
|
-
<div class="form-floating">
|
|
499
|
-
<input
|
|
500
|
-
ngForgeControl
|
|
501
|
-
[formField]="f"
|
|
502
|
-
[id]="inputId"
|
|
503
|
-
[type]="type()"
|
|
504
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
505
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
506
|
-
class="form-control"
|
|
507
|
-
[class.form-control-sm]="size() === 'sm'"
|
|
508
|
-
[class.form-control-lg]="size() === 'lg'"
|
|
509
|
-
[class.form-control-plaintext]="p?.plaintext"
|
|
510
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
511
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
512
|
-
/>
|
|
513
|
-
@if (ngf.label()) {
|
|
514
|
-
<label [for]="inputId">{{ ngf.label() | dynamicText | async }}</label>
|
|
515
|
-
}
|
|
516
|
-
</div>
|
|
517
|
-
@for (a of ngfa.suffixAddons(); track $index) {
|
|
518
|
-
<span class="input-group-text">
|
|
519
|
-
<df-addon-slot [addon]="a" [fieldInputs]="fieldInputs()" [hidden]="ngfa.hiddenSignalCache().get(a)" />
|
|
520
|
-
</span>
|
|
521
|
-
}
|
|
522
|
-
</div>
|
|
523
|
-
} @else {
|
|
524
|
-
<div class="form-floating">
|
|
525
|
-
<input
|
|
526
|
-
ngForgeControl
|
|
527
|
-
[formField]="f"
|
|
528
|
-
[id]="inputId"
|
|
529
|
-
[type]="type()"
|
|
530
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
531
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
532
|
-
class="form-control"
|
|
533
|
-
[class.form-control-sm]="size() === 'sm'"
|
|
534
|
-
[class.form-control-lg]="size() === 'lg'"
|
|
535
|
-
[class.form-control-plaintext]="p?.plaintext"
|
|
536
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
537
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
538
|
-
/>
|
|
539
|
-
@if (ngf.label()) {
|
|
540
|
-
<label [for]="inputId">{{ ngf.label() | dynamicText | async }}</label>
|
|
541
|
-
}
|
|
542
|
-
</div>
|
|
543
|
-
}
|
|
544
|
-
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
545
|
-
<div class="valid-feedback d-block">
|
|
546
|
-
{{ p?.validFeedback | dynamicText | async }}
|
|
547
|
-
</div>
|
|
548
|
-
}
|
|
549
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
550
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
551
|
-
}
|
|
552
|
-
</div>
|
|
553
|
-
} @else {
|
|
554
|
-
<div class="mb-3">
|
|
555
|
-
@if (ngf.label()) {
|
|
556
|
-
<label [for]="inputId" class="form-label">{{ ngf.label() | dynamicText | async }}</label>
|
|
557
|
-
}
|
|
558
|
-
@if (ngfa.hasAddons()) {
|
|
559
|
-
<div class="input-group">
|
|
560
|
-
@for (a of ngfa.prefixAddons(); track $index) {
|
|
561
|
-
<span class="input-group-text">
|
|
562
|
-
<df-addon-slot [addon]="a" [fieldInputs]="fieldInputs()" [hidden]="ngfa.hiddenSignalCache().get(a)" />
|
|
563
|
-
</span>
|
|
564
|
-
}
|
|
565
|
-
<input
|
|
566
|
-
ngForgeControl
|
|
567
|
-
[formField]="f"
|
|
568
|
-
[id]="inputId"
|
|
569
|
-
[type]="type()"
|
|
570
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
571
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
572
|
-
class="form-control"
|
|
573
|
-
[class.form-control-sm]="size() === 'sm'"
|
|
574
|
-
[class.form-control-lg]="size() === 'lg'"
|
|
575
|
-
[class.form-control-plaintext]="p?.plaintext"
|
|
576
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
577
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
578
|
-
/>
|
|
579
|
-
@for (a of ngfa.suffixAddons(); track $index) {
|
|
580
|
-
<span class="input-group-text">
|
|
581
|
-
<df-addon-slot [addon]="a" [fieldInputs]="fieldInputs()" [hidden]="ngfa.hiddenSignalCache().get(a)" />
|
|
582
|
-
</span>
|
|
583
|
-
}
|
|
584
|
-
</div>
|
|
585
|
-
} @else {
|
|
586
|
-
<input
|
|
587
|
-
ngForgeControl
|
|
588
|
-
[formField]="f"
|
|
589
|
-
[id]="inputId"
|
|
590
|
-
[type]="type()"
|
|
591
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
592
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
593
|
-
class="form-control"
|
|
594
|
-
[class.form-control-sm]="size() === 'sm'"
|
|
595
|
-
[class.form-control-lg]="size() === 'lg'"
|
|
596
|
-
[class.form-control-plaintext]="p?.plaintext"
|
|
597
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
598
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
599
|
-
/>
|
|
600
|
-
}
|
|
601
|
-
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
602
|
-
<div class="valid-feedback d-block">
|
|
603
|
-
{{ p?.validFeedback | dynamicText | async }}
|
|
604
|
-
</div>
|
|
605
|
-
}
|
|
606
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
607
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
608
|
-
} @else if (p?.hint) {
|
|
609
|
-
<div class="form-text" [id]="ngf.hintId()">{{ p?.hint | dynamicText | async }}</div>
|
|
610
|
-
}
|
|
611
|
-
</div>
|
|
612
|
-
}
|
|
613
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, providers: [
|
|
614
|
-
{
|
|
615
|
-
provide: BS_INPUT_TYPE_OVERRIDE,
|
|
616
|
-
useFactory: () => signal(undefined),
|
|
617
|
-
},
|
|
618
|
-
{
|
|
619
|
-
provide: ADDON_PRESET_HANDLER,
|
|
620
|
-
useFactory: () => {
|
|
621
|
-
const typeOverride = inject(BS_INPUT_TYPE_OVERRIDE);
|
|
622
|
-
const fsc = inject(FIELD_SIGNAL_CONTEXT, { optional: true });
|
|
623
|
-
const logger = inject(DynamicFormLogger);
|
|
624
|
-
const host = inject(forwardRef(() => BsInputFieldComponent));
|
|
625
|
-
return {
|
|
626
|
-
run: (preset, ctx) => {
|
|
627
|
-
const fieldKey = ctx.field.key;
|
|
628
|
-
return runBsPresetAction(preset, ctx, {
|
|
629
|
-
typeOverride,
|
|
630
|
-
fieldValueSetter: ctx.setValue,
|
|
631
|
-
fieldDefaultValueGetter: fsc && fieldKey ? () => fsc.defaultValues()?.[fieldKey] : undefined,
|
|
632
|
-
baselineType: () => host.props()?.type,
|
|
633
|
-
logger,
|
|
634
|
-
});
|
|
635
|
-
},
|
|
636
|
-
};
|
|
637
|
-
},
|
|
638
|
-
},
|
|
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"] }]
|
|
640
|
-
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], fieldInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldInputs", required: false }] }] } });
|
|
641
|
-
|
|
642
|
-
class BsMultiCheckboxFieldComponent {
|
|
643
|
-
ngf = injectNgForgeField();
|
|
644
|
-
options = input([], /* @ts-ignore */
|
|
645
|
-
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
646
|
-
props = input(/* @ts-ignore */
|
|
647
|
-
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
648
|
-
checkedValuesMap = computed(() => {
|
|
649
|
-
const map = {};
|
|
650
|
-
for (const opt of this.valueViewModel()) {
|
|
651
|
-
map[String(opt.value)] = true;
|
|
652
|
-
}
|
|
653
|
-
return map;
|
|
654
|
-
}, /* @ts-ignore */
|
|
655
|
-
...(ngDevMode ? [{ debugName: "checkedValuesMap" }] : /* istanbul ignore next */ []));
|
|
656
|
-
valueViewModel = linkedSignal(() => {
|
|
657
|
-
const currentValues = this.ngf.field()().value();
|
|
658
|
-
return this.options().filter((option) => currentValues.includes(option.value));
|
|
659
|
-
}, { ...(ngDevMode ? { debugName: "valueViewModel" } : /* istanbul ignore next */ {}), equal: isEqual });
|
|
660
|
-
constructor() {
|
|
661
|
-
explicitEffect([this.valueViewModel], ([selectedOptions]) => {
|
|
662
|
-
const selectedValues = selectedOptions.map((option) => option.value);
|
|
663
|
-
if (!isEqual(selectedValues, this.ngf.field()().value())) {
|
|
664
|
-
this.ngf.field()().value.set(selectedValues);
|
|
665
|
-
}
|
|
666
|
-
});
|
|
667
|
-
explicitEffect([this.options], ([options]) => {
|
|
668
|
-
const values = options.map((option) => option.value);
|
|
669
|
-
const uniqueValues = new Set(values);
|
|
670
|
-
if (values.length !== uniqueValues.size) {
|
|
671
|
-
const duplicates = values.filter((value, index) => values.indexOf(value) !== index);
|
|
672
|
-
throw new Error(`Duplicate option values detected in bs-multi-checkbox: ${duplicates.join(', ')}`);
|
|
673
|
-
}
|
|
674
|
-
});
|
|
675
|
-
}
|
|
676
|
-
onCheckboxChange(option, event) {
|
|
677
|
-
const checked = event.target.checked;
|
|
678
|
-
this.valueViewModel.update((currentOptions) => {
|
|
679
|
-
if (checked) {
|
|
680
|
-
return currentOptions.some((opt) => opt.value === option.value)
|
|
681
|
-
? currentOptions
|
|
682
|
-
: [...currentOptions, option];
|
|
683
|
-
}
|
|
684
|
-
else {
|
|
685
|
-
return currentOptions.filter((opt) => opt.value !== option.value);
|
|
686
|
-
}
|
|
687
|
-
});
|
|
688
|
-
}
|
|
689
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsMultiCheckboxFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
690
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: BsMultiCheckboxFieldComponent, isStandalone: true, selector: "df-bs-multi-checkbox", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
691
|
-
@let f = ngf.field();
|
|
692
|
-
@let checked = checkedValuesMap();
|
|
693
|
-
@if (ngf.label(); as label) {
|
|
694
|
-
<div class="form-label">{{ label | dynamicText | async }}</div>
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
<div class="checkbox-group">
|
|
698
|
-
@for (option of options(); track option.value; let i = $index) {
|
|
699
|
-
<div
|
|
700
|
-
class="form-check"
|
|
701
|
-
[class.form-switch]="props()?.switch"
|
|
702
|
-
[class.form-check-inline]="props()?.inline"
|
|
703
|
-
[class.form-check-reverse]="props()?.reverse"
|
|
704
|
-
>
|
|
705
|
-
<input
|
|
706
|
-
ngForgeControl
|
|
707
|
-
type="checkbox"
|
|
708
|
-
[id]="ngf.key() + '_' + i"
|
|
709
|
-
[checked]="checked['' + option.value]"
|
|
710
|
-
[disabled]="f().disabled() || option.disabled"
|
|
711
|
-
(change)="onCheckboxChange(option, $event)"
|
|
712
|
-
class="form-check-input"
|
|
713
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
714
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
715
|
-
/>
|
|
716
|
-
<label [for]="ngf.key() + '_' + i" class="form-check-label">
|
|
717
|
-
{{ option.label | dynamicText | async }}
|
|
718
|
-
</label>
|
|
719
|
-
</div>
|
|
720
|
-
}
|
|
721
|
-
</div>
|
|
722
|
-
|
|
723
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
724
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
725
|
-
} @else if (props()?.hint; as hint) {
|
|
726
|
-
<div class="form-text" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</div>
|
|
727
|
-
}
|
|
728
|
-
`, 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}.checkbox-group{margin-bottom:.5rem}:host([hidden]){display:none!important}\n"], dependencies: [{ kind: "directive", type: NgForgeControl, selector: "[ngForgeControl]", inputs: ["ngForgeControl"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
729
|
-
}
|
|
730
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsMultiCheckboxFieldComponent, decorators: [{
|
|
731
|
-
type: Component,
|
|
732
|
-
args: [{ selector: 'df-bs-multi-checkbox', imports: [DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
733
|
-
@let f = ngf.field();
|
|
734
|
-
@let checked = checkedValuesMap();
|
|
735
|
-
@if (ngf.label(); as label) {
|
|
736
|
-
<div class="form-label">{{ label | dynamicText | async }}</div>
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
<div class="checkbox-group">
|
|
740
|
-
@for (option of options(); track option.value; let i = $index) {
|
|
741
|
-
<div
|
|
742
|
-
class="form-check"
|
|
743
|
-
[class.form-switch]="props()?.switch"
|
|
744
|
-
[class.form-check-inline]="props()?.inline"
|
|
745
|
-
[class.form-check-reverse]="props()?.reverse"
|
|
746
|
-
>
|
|
747
|
-
<input
|
|
748
|
-
ngForgeControl
|
|
749
|
-
type="checkbox"
|
|
750
|
-
[id]="ngf.key() + '_' + i"
|
|
751
|
-
[checked]="checked['' + option.value]"
|
|
752
|
-
[disabled]="f().disabled() || option.disabled"
|
|
753
|
-
(change)="onCheckboxChange(option, $event)"
|
|
754
|
-
class="form-check-input"
|
|
755
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
756
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
757
|
-
/>
|
|
758
|
-
<label [for]="ngf.key() + '_' + i" class="form-check-label">
|
|
759
|
-
{{ option.label | dynamicText | async }}
|
|
760
|
-
</label>
|
|
761
|
-
</div>
|
|
762
|
-
}
|
|
763
|
-
</div>
|
|
764
|
-
|
|
765
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
766
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
767
|
-
} @else if (props()?.hint; as hint) {
|
|
768
|
-
<div class="form-text" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</div>
|
|
769
|
-
}
|
|
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"] }]
|
|
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 }] }] } });
|
|
772
|
-
|
|
773
|
-
class BsRadioGroupComponent {
|
|
774
|
-
parentField = inject(NgForgeField, { optional: true });
|
|
775
|
-
value = model(undefined, /* @ts-ignore */
|
|
776
|
-
...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
777
|
-
disabled = input(false, /* @ts-ignore */
|
|
778
|
-
...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
779
|
-
readonly = input(false, /* @ts-ignore */
|
|
780
|
-
...(ngDevMode ? [{ debugName: "readonly" }] : /* istanbul ignore next */ []));
|
|
781
|
-
name = input('', /* @ts-ignore */
|
|
782
|
-
...(ngDevMode ? [{ debugName: "name" }] : /* istanbul ignore next */ []));
|
|
783
|
-
label = input(/* @ts-ignore */
|
|
784
|
-
...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
785
|
-
options = input.required(/* @ts-ignore */
|
|
786
|
-
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
787
|
-
properties = input(/* @ts-ignore */
|
|
788
|
-
...(ngDevMode ? [undefined, { debugName: "properties" }] : /* istanbul ignore next */ []));
|
|
789
|
-
onRadioChange(newValue) {
|
|
790
|
-
if (!this.disabled() && !this.readonly()) {
|
|
791
|
-
this.value.set(newValue);
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsRadioGroupComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
795
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: BsRadioGroupComponent, isStandalone: true, selector: "df-bs-radio-group", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: true, transformFunction: null }, properties: { classPropertyName: "properties", publicName: "properties", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange" }, host: { attributes: { "role": "radiogroup" }, properties: { "attr.aria-invalid": "parentField?.ariaInvalid() || null", "attr.aria-required": "parentField?.ariaRequired()", "attr.aria-describedby": "parentField?.ariaDescribedBy()" } }, ngImport: i0, template: `
|
|
796
|
-
@let props = properties();
|
|
797
|
-
@if (props?.buttonGroup) {
|
|
798
|
-
<div class="btn-group" role="group" [attr.aria-label]="label() | dynamicText | async">
|
|
799
|
-
@for (option of options(); track option.value; let i = $index) {
|
|
800
|
-
<input
|
|
801
|
-
ngForgeControl
|
|
802
|
-
type="radio"
|
|
803
|
-
[name]="name()"
|
|
804
|
-
[value]="option.value"
|
|
805
|
-
[checked]="value() === option.value"
|
|
806
|
-
(change)="onRadioChange(option.value)"
|
|
807
|
-
[disabled]="disabled() || option.disabled || false"
|
|
808
|
-
class="btn-check"
|
|
809
|
-
[id]="name() + '_' + i"
|
|
810
|
-
autocomplete="off"
|
|
811
|
-
/>
|
|
812
|
-
<label
|
|
813
|
-
class="btn btn-outline-primary"
|
|
814
|
-
[class.btn-sm]="props?.buttonSize === 'sm'"
|
|
815
|
-
[class.btn-lg]="props?.buttonSize === 'lg'"
|
|
816
|
-
[for]="name() + '_' + i"
|
|
817
|
-
>
|
|
818
|
-
{{ option.label | dynamicText | async }}
|
|
819
|
-
</label>
|
|
820
|
-
}
|
|
821
|
-
</div>
|
|
822
|
-
} @else {
|
|
823
|
-
@for (option of options(); track option.value; let i = $index) {
|
|
824
|
-
<div class="form-check" [class.form-check-inline]="props?.inline" [class.form-check-reverse]="props?.reverse">
|
|
825
|
-
<input
|
|
826
|
-
ngForgeControl
|
|
827
|
-
type="radio"
|
|
828
|
-
[name]="name()"
|
|
829
|
-
[value]="option.value"
|
|
830
|
-
[checked]="value() === option.value"
|
|
831
|
-
(change)="onRadioChange(option.value)"
|
|
832
|
-
[disabled]="disabled() || option.disabled || false"
|
|
833
|
-
class="form-check-input"
|
|
834
|
-
[id]="name() + '_' + i"
|
|
835
|
-
/>
|
|
836
|
-
<label class="form-check-label" [for]="name() + '_' + i">
|
|
837
|
-
{{ option.label | dynamicText | async }}
|
|
838
|
-
</label>
|
|
839
|
-
</div>
|
|
840
|
-
}
|
|
841
|
-
}
|
|
842
|
-
`, isInline: true, styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: NgForgeControl, selector: "[ngForgeControl]", inputs: ["ngForgeControl"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
843
|
-
}
|
|
844
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsRadioGroupComponent, decorators: [{
|
|
845
|
-
type: Component,
|
|
846
|
-
args: [{ selector: 'df-bs-radio-group', imports: [DynamicTextPipe, AsyncPipe, NgForgeControl], host: {
|
|
847
|
-
role: 'radiogroup',
|
|
848
|
-
'[attr.aria-invalid]': 'parentField?.ariaInvalid() || null',
|
|
849
|
-
'[attr.aria-required]': 'parentField?.ariaRequired()',
|
|
850
|
-
'[attr.aria-describedby]': 'parentField?.ariaDescribedBy()',
|
|
851
|
-
}, template: `
|
|
852
|
-
@let props = properties();
|
|
853
|
-
@if (props?.buttonGroup) {
|
|
854
|
-
<div class="btn-group" role="group" [attr.aria-label]="label() | dynamicText | async">
|
|
855
|
-
@for (option of options(); track option.value; let i = $index) {
|
|
856
|
-
<input
|
|
857
|
-
ngForgeControl
|
|
858
|
-
type="radio"
|
|
859
|
-
[name]="name()"
|
|
860
|
-
[value]="option.value"
|
|
861
|
-
[checked]="value() === option.value"
|
|
862
|
-
(change)="onRadioChange(option.value)"
|
|
863
|
-
[disabled]="disabled() || option.disabled || false"
|
|
864
|
-
class="btn-check"
|
|
865
|
-
[id]="name() + '_' + i"
|
|
866
|
-
autocomplete="off"
|
|
867
|
-
/>
|
|
868
|
-
<label
|
|
869
|
-
class="btn btn-outline-primary"
|
|
870
|
-
[class.btn-sm]="props?.buttonSize === 'sm'"
|
|
871
|
-
[class.btn-lg]="props?.buttonSize === 'lg'"
|
|
872
|
-
[for]="name() + '_' + i"
|
|
873
|
-
>
|
|
874
|
-
{{ option.label | dynamicText | async }}
|
|
875
|
-
</label>
|
|
876
|
-
}
|
|
877
|
-
</div>
|
|
878
|
-
} @else {
|
|
879
|
-
@for (option of options(); track option.value; let i = $index) {
|
|
880
|
-
<div class="form-check" [class.form-check-inline]="props?.inline" [class.form-check-reverse]="props?.reverse">
|
|
881
|
-
<input
|
|
882
|
-
ngForgeControl
|
|
883
|
-
type="radio"
|
|
884
|
-
[name]="name()"
|
|
885
|
-
[value]="option.value"
|
|
886
|
-
[checked]="value() === option.value"
|
|
887
|
-
(change)="onRadioChange(option.value)"
|
|
888
|
-
[disabled]="disabled() || option.disabled || false"
|
|
889
|
-
class="form-check-input"
|
|
890
|
-
[id]="name() + '_' + i"
|
|
891
|
-
/>
|
|
892
|
-
<label class="form-check-label" [for]="name() + '_' + i">
|
|
893
|
-
{{ option.label | dynamicText | async }}
|
|
894
|
-
</label>
|
|
895
|
-
</div>
|
|
896
|
-
}
|
|
897
|
-
}
|
|
898
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{display:block}\n"] }]
|
|
899
|
-
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: true }] }], properties: [{ type: i0.Input, args: [{ isSignal: true, alias: "properties", required: false }] }] } });
|
|
900
|
-
|
|
901
|
-
class BsRadioFieldComponent {
|
|
902
|
-
ngf = injectNgForgeField();
|
|
903
|
-
options = input([], /* @ts-ignore */
|
|
904
|
-
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
905
|
-
props = input(/* @ts-ignore */
|
|
906
|
-
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
907
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsRadioFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
908
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: BsRadioFieldComponent, isStandalone: true, selector: "df-bs-radio", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
909
|
-
@let f = ngf.field();
|
|
910
|
-
|
|
911
|
-
<div class="mb-3">
|
|
912
|
-
@if (ngf.label(); as label) {
|
|
913
|
-
<div class="form-label">{{ label | dynamicText | async }}</div>
|
|
914
|
-
}
|
|
915
|
-
|
|
916
|
-
<df-bs-radio-group [formField]="f" [label]="ngf.label()" [options]="options()" [properties]="props()" />
|
|
917
|
-
|
|
918
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
919
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
920
|
-
} @else if (props()?.hint; as hint) {
|
|
921
|
-
<div class="form-text" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</div>
|
|
922
|
-
}
|
|
923
|
-
</div>
|
|
924
|
-
`, 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: "component", type: BsRadioGroupComponent, selector: "df-bs-radio-group", inputs: ["value", "disabled", "readonly", "name", "label", "options", "properties"], outputs: ["valueChange"] }, { kind: "directive", type: FormField, selector: "[formField]", inputs: ["formField"], exportAs: ["formField"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
925
|
-
}
|
|
926
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsRadioFieldComponent, decorators: [{
|
|
927
|
-
type: Component,
|
|
928
|
-
args: [{ selector: 'df-bs-radio', imports: [BsRadioGroupComponent, FormField, DynamicTextPipe, AsyncPipe], hostDirectives: [NgForgeFieldHost], template: `
|
|
929
|
-
@let f = ngf.field();
|
|
930
|
-
|
|
931
|
-
<div class="mb-3">
|
|
932
|
-
@if (ngf.label(); as label) {
|
|
933
|
-
<div class="form-label">{{ label | dynamicText | async }}</div>
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
<df-bs-radio-group [formField]="f" [label]="ngf.label()" [options]="options()" [properties]="props()" />
|
|
937
|
-
|
|
938
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
939
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
940
|
-
} @else if (props()?.hint; as hint) {
|
|
941
|
-
<div class="form-text" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</div>
|
|
942
|
-
}
|
|
943
|
-
</div>
|
|
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"] }]
|
|
945
|
-
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
946
|
-
|
|
947
|
-
class BsSelectFieldComponent {
|
|
948
|
-
ngf = injectNgForgeField();
|
|
949
|
-
options = input([], /* @ts-ignore */
|
|
950
|
-
...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
951
|
-
props = input(/* @ts-ignore */
|
|
952
|
-
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
953
|
-
defaultCompare = Object.is;
|
|
954
|
-
isSelected(optionValue, fieldValue) {
|
|
955
|
-
const compareWith = this.props()?.compareWith || this.defaultCompare;
|
|
956
|
-
if (Array.isArray(fieldValue)) {
|
|
957
|
-
return fieldValue.some((v) => compareWith(v, optionValue));
|
|
958
|
-
}
|
|
959
|
-
return fieldValue !== null && compareWith(fieldValue, optionValue);
|
|
960
|
-
}
|
|
961
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsSelectFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
962
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: BsSelectFieldComponent, isStandalone: true, selector: "df-bs-select", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
963
|
-
@let f = ngf.field(); @let selectId = ngf.key() + '-select';
|
|
964
|
-
|
|
965
|
-
<div class="mb-3">
|
|
966
|
-
@if (ngf.label(); as label) {
|
|
967
|
-
<label [for]="selectId" class="form-label">{{ label | dynamicText | async }}</label>
|
|
968
|
-
}
|
|
969
|
-
<select
|
|
970
|
-
ngForgeControl
|
|
971
|
-
[formField]="f"
|
|
972
|
-
[id]="selectId"
|
|
973
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
974
|
-
class="form-select"
|
|
975
|
-
[class.form-select-sm]="props()?.size === 'sm'"
|
|
976
|
-
[class.form-select-lg]="props()?.size === 'lg'"
|
|
977
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
978
|
-
[multiple]="props()?.multiple || false"
|
|
979
|
-
[attr.size]="props()?.htmlSize ?? null"
|
|
980
|
-
>
|
|
981
|
-
@if (ngf.placeholder(); as placeholder) {
|
|
982
|
-
<option value="" disabled [selected]="!f().value()">{{ placeholder | dynamicText | async }}</option>
|
|
983
|
-
}
|
|
984
|
-
@for (option of options(); track option.value) {
|
|
985
|
-
<option [value]="option.value" [disabled]="option.disabled || false" [selected]="isSelected(option.value, f().value())">
|
|
986
|
-
{{ option.label | dynamicText | async }}
|
|
987
|
-
</option>
|
|
988
|
-
}
|
|
989
|
-
</select>
|
|
990
|
-
|
|
991
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
992
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
993
|
-
} @else if (props()?.hint; as hint) {
|
|
994
|
-
<div class="form-text" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</div>
|
|
995
|
-
}
|
|
996
|
-
</div>
|
|
997
|
-
`, 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: NgForgeControl, selector: "[ngForgeControl]", inputs: ["ngForgeControl"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
998
|
-
}
|
|
999
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsSelectFieldComponent, decorators: [{
|
|
1000
|
-
type: Component,
|
|
1001
|
-
args: [{ selector: 'df-bs-select', imports: [FormField, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
1002
|
-
@let f = ngf.field(); @let selectId = ngf.key() + '-select';
|
|
1003
|
-
|
|
1004
|
-
<div class="mb-3">
|
|
1005
|
-
@if (ngf.label(); as label) {
|
|
1006
|
-
<label [for]="selectId" class="form-label">{{ label | dynamicText | async }}</label>
|
|
1007
|
-
}
|
|
1008
|
-
<select
|
|
1009
|
-
ngForgeControl
|
|
1010
|
-
[formField]="f"
|
|
1011
|
-
[id]="selectId"
|
|
1012
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
1013
|
-
class="form-select"
|
|
1014
|
-
[class.form-select-sm]="props()?.size === 'sm'"
|
|
1015
|
-
[class.form-select-lg]="props()?.size === 'lg'"
|
|
1016
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
1017
|
-
[multiple]="props()?.multiple || false"
|
|
1018
|
-
[attr.size]="props()?.htmlSize ?? null"
|
|
1019
|
-
>
|
|
1020
|
-
@if (ngf.placeholder(); as placeholder) {
|
|
1021
|
-
<option value="" disabled [selected]="!f().value()">{{ placeholder | dynamicText | async }}</option>
|
|
1022
|
-
}
|
|
1023
|
-
@for (option of options(); track option.value) {
|
|
1024
|
-
<option [value]="option.value" [disabled]="option.disabled || false" [selected]="isSelected(option.value, f().value())">
|
|
1025
|
-
{{ option.label | dynamicText | async }}
|
|
1026
|
-
</option>
|
|
1027
|
-
}
|
|
1028
|
-
</select>
|
|
1029
|
-
|
|
1030
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
1031
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
1032
|
-
} @else if (props()?.hint; as hint) {
|
|
1033
|
-
<div class="form-text" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</div>
|
|
1034
|
-
}
|
|
1035
|
-
</div>
|
|
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"] }]
|
|
1037
|
-
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1038
|
-
|
|
1039
|
-
class BsSliderFieldComponent {
|
|
1040
|
-
ngf = injectNgForgeField();
|
|
1041
|
-
min = input(0, /* @ts-ignore */
|
|
1042
|
-
...(ngDevMode ? [{ debugName: "min" }] : /* istanbul ignore next */ []));
|
|
1043
|
-
max = input(100, /* @ts-ignore */
|
|
1044
|
-
...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
1045
|
-
step = input(/* @ts-ignore */
|
|
1046
|
-
...(ngDevMode ? [undefined, { debugName: "step" }] : /* istanbul ignore next */ []));
|
|
1047
|
-
props = input(/* @ts-ignore */
|
|
1048
|
-
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
1049
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsSliderFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1050
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: BsSliderFieldComponent, isStandalone: true, selector: "df-bs-slider", inputs: { min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
1051
|
-
@let f = ngf.field(); @let inputId = ngf.key() + '-input';
|
|
1052
|
-
|
|
1053
|
-
<div class="mb-3">
|
|
1054
|
-
@if (ngf.label(); as label) {
|
|
1055
|
-
<label [for]="inputId" class="form-label">
|
|
1056
|
-
{{ label | dynamicText | async }}
|
|
1057
|
-
@if (props()?.showValue) {
|
|
1058
|
-
<span class="ms-2 badge bg-secondary"> {{ props()?.valuePrefix }}{{ f().value() }}{{ props()?.valueSuffix }} </span>
|
|
1059
|
-
}
|
|
1060
|
-
</label>
|
|
1061
|
-
}
|
|
1062
|
-
|
|
1063
|
-
<input
|
|
1064
|
-
ngForgeControl
|
|
1065
|
-
type="range"
|
|
1066
|
-
dfBsInputConstraints
|
|
1067
|
-
[formField]="f"
|
|
1068
|
-
[id]="inputId"
|
|
1069
|
-
[dfMin]="f().min?.() ?? props()?.min ?? min()"
|
|
1070
|
-
[dfMax]="f().max?.() ?? props()?.max ?? max()"
|
|
1071
|
-
[dfStep]="step() ?? props()?.step ?? 1"
|
|
1072
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
1073
|
-
class="form-range"
|
|
1074
|
-
/>
|
|
1075
|
-
|
|
1076
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
1077
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
1078
|
-
} @else if (props()?.hint; as hint) {
|
|
1079
|
-
<div class="form-text" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</div>
|
|
1080
|
-
}
|
|
1081
|
-
</div>
|
|
1082
|
-
`, 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: 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 });
|
|
1083
|
-
}
|
|
1084
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsSliderFieldComponent, decorators: [{
|
|
1085
|
-
type: Component,
|
|
1086
|
-
args: [{ selector: 'df-bs-slider', imports: [FormField, DynamicTextPipe, AsyncPipe, InputConstraintsDirective, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
1087
|
-
@let f = ngf.field(); @let inputId = ngf.key() + '-input';
|
|
1088
|
-
|
|
1089
|
-
<div class="mb-3">
|
|
1090
|
-
@if (ngf.label(); as label) {
|
|
1091
|
-
<label [for]="inputId" class="form-label">
|
|
1092
|
-
{{ label | dynamicText | async }}
|
|
1093
|
-
@if (props()?.showValue) {
|
|
1094
|
-
<span class="ms-2 badge bg-secondary"> {{ props()?.valuePrefix }}{{ f().value() }}{{ props()?.valueSuffix }} </span>
|
|
1095
|
-
}
|
|
1096
|
-
</label>
|
|
1097
|
-
}
|
|
1098
|
-
|
|
1099
|
-
<input
|
|
1100
|
-
ngForgeControl
|
|
1101
|
-
type="range"
|
|
1102
|
-
dfBsInputConstraints
|
|
1103
|
-
[formField]="f"
|
|
1104
|
-
[id]="inputId"
|
|
1105
|
-
[dfMin]="f().min?.() ?? props()?.min ?? min()"
|
|
1106
|
-
[dfMax]="f().max?.() ?? props()?.max ?? max()"
|
|
1107
|
-
[dfStep]="step() ?? props()?.step ?? 1"
|
|
1108
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
1109
|
-
class="form-range"
|
|
1110
|
-
/>
|
|
1111
|
-
|
|
1112
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
1113
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
1114
|
-
} @else if (props()?.hint; as hint) {
|
|
1115
|
-
<div class="form-text" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</div>
|
|
1116
|
-
}
|
|
1117
|
-
</div>
|
|
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"] }]
|
|
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 }] }] } });
|
|
1120
|
-
|
|
1121
|
-
class BsTextareaFieldComponent {
|
|
1122
|
-
ngf = injectNgForgeField();
|
|
1123
|
-
props = input(/* @ts-ignore */
|
|
1124
|
-
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
1125
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsTextareaFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1126
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: BsTextareaFieldComponent, isStandalone: true, selector: "df-bs-textarea", inputs: { props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
1127
|
-
@let f = ngf.field(); @let p = props(); @let textareaId = ngf.key() + '-textarea';
|
|
1128
|
-
@if (p?.floatingLabel) {
|
|
1129
|
-
<!-- Floating label variant -->
|
|
1130
|
-
<div class="form-floating mb-3">
|
|
1131
|
-
<textarea
|
|
1132
|
-
ngForgeControl
|
|
1133
|
-
[formField]="f"
|
|
1134
|
-
[id]="textareaId"
|
|
1135
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
1136
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
1137
|
-
class="form-control"
|
|
1138
|
-
[class.form-control-sm]="p?.size === 'sm'"
|
|
1139
|
-
[class.form-control-lg]="p?.size === 'lg'"
|
|
1140
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
1141
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
1142
|
-
></textarea>
|
|
1143
|
-
|
|
1144
|
-
@if (ngf.label()) {
|
|
1145
|
-
<label [for]="textareaId">{{ ngf.label() | dynamicText | async }}</label>
|
|
1146
|
-
}
|
|
1147
|
-
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
1148
|
-
<div class="valid-feedback d-block">
|
|
1149
|
-
{{ p?.validFeedback | dynamicText | async }}
|
|
1150
|
-
</div>
|
|
1151
|
-
}
|
|
1152
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
1153
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
1154
|
-
} @else if (p?.hint) {
|
|
1155
|
-
<div class="form-text" [id]="ngf.hintId()">{{ p?.hint | dynamicText | async }}</div>
|
|
1156
|
-
}
|
|
1157
|
-
</div>
|
|
1158
|
-
} @else {
|
|
1159
|
-
<!-- Standard variant -->
|
|
1160
|
-
<div class="mb-3">
|
|
1161
|
-
@if (ngf.label()) {
|
|
1162
|
-
<label [for]="textareaId" class="form-label">{{ ngf.label() | dynamicText | async }}</label>
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
<textarea
|
|
1166
|
-
ngForgeControl
|
|
1167
|
-
[formField]="f"
|
|
1168
|
-
[id]="textareaId"
|
|
1169
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
1170
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
1171
|
-
class="form-control"
|
|
1172
|
-
[class.form-control-sm]="p?.size === 'sm'"
|
|
1173
|
-
[class.form-control-lg]="p?.size === 'lg'"
|
|
1174
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
1175
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
1176
|
-
></textarea>
|
|
1177
|
-
|
|
1178
|
-
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
1179
|
-
<div class="valid-feedback d-block">
|
|
1180
|
-
{{ p?.validFeedback | dynamicText | async }}
|
|
1181
|
-
</div>
|
|
1182
|
-
}
|
|
1183
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
1184
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
1185
|
-
} @else if (p?.hint) {
|
|
1186
|
-
<div class="form-text" [id]="ngf.hintId()">{{ p?.hint | dynamicText | async }}</div>
|
|
1187
|
-
}
|
|
1188
|
-
</div>
|
|
1189
|
-
}
|
|
1190
|
-
`, 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: NgForgeControl, selector: "[ngForgeControl]", inputs: ["ngForgeControl"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1191
|
-
}
|
|
1192
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsTextareaFieldComponent, decorators: [{
|
|
1193
|
-
type: Component,
|
|
1194
|
-
args: [{ selector: 'df-bs-textarea', imports: [FormField, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
1195
|
-
@let f = ngf.field(); @let p = props(); @let textareaId = ngf.key() + '-textarea';
|
|
1196
|
-
@if (p?.floatingLabel) {
|
|
1197
|
-
<!-- Floating label variant -->
|
|
1198
|
-
<div class="form-floating mb-3">
|
|
1199
|
-
<textarea
|
|
1200
|
-
ngForgeControl
|
|
1201
|
-
[formField]="f"
|
|
1202
|
-
[id]="textareaId"
|
|
1203
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
1204
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
1205
|
-
class="form-control"
|
|
1206
|
-
[class.form-control-sm]="p?.size === 'sm'"
|
|
1207
|
-
[class.form-control-lg]="p?.size === 'lg'"
|
|
1208
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
1209
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
1210
|
-
></textarea>
|
|
1211
|
-
|
|
1212
|
-
@if (ngf.label()) {
|
|
1213
|
-
<label [for]="textareaId">{{ ngf.label() | dynamicText | async }}</label>
|
|
1214
|
-
}
|
|
1215
|
-
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
1216
|
-
<div class="valid-feedback d-block">
|
|
1217
|
-
{{ p?.validFeedback | dynamicText | async }}
|
|
1218
|
-
</div>
|
|
1219
|
-
}
|
|
1220
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
1221
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
1222
|
-
} @else if (p?.hint) {
|
|
1223
|
-
<div class="form-text" [id]="ngf.hintId()">{{ p?.hint | dynamicText | async }}</div>
|
|
1224
|
-
}
|
|
1225
|
-
</div>
|
|
1226
|
-
} @else {
|
|
1227
|
-
<!-- Standard variant -->
|
|
1228
|
-
<div class="mb-3">
|
|
1229
|
-
@if (ngf.label()) {
|
|
1230
|
-
<label [for]="textareaId" class="form-label">{{ ngf.label() | dynamicText | async }}</label>
|
|
1231
|
-
}
|
|
1232
|
-
|
|
1233
|
-
<textarea
|
|
1234
|
-
ngForgeControl
|
|
1235
|
-
[formField]="f"
|
|
1236
|
-
[id]="textareaId"
|
|
1237
|
-
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
1238
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
1239
|
-
class="form-control"
|
|
1240
|
-
[class.form-control-sm]="p?.size === 'sm'"
|
|
1241
|
-
[class.form-control-lg]="p?.size === 'lg'"
|
|
1242
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
1243
|
-
[class.is-valid]="f().valid() && f().touched() && p?.validFeedback"
|
|
1244
|
-
></textarea>
|
|
1245
|
-
|
|
1246
|
-
@if (p?.validFeedback && f().valid() && f().touched()) {
|
|
1247
|
-
<div class="valid-feedback d-block">
|
|
1248
|
-
{{ p?.validFeedback | dynamicText | async }}
|
|
1249
|
-
</div>
|
|
1250
|
-
}
|
|
1251
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
1252
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
1253
|
-
} @else if (p?.hint) {
|
|
1254
|
-
<div class="form-text" [id]="ngf.hintId()">{{ p?.hint | dynamicText | async }}</div>
|
|
1255
|
-
}
|
|
1256
|
-
</div>
|
|
1257
|
-
}
|
|
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"] }]
|
|
1259
|
-
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1260
|
-
|
|
1261
|
-
class BsToggleFieldComponent {
|
|
1262
|
-
ngf = injectNgForgeField();
|
|
1263
|
-
props = input(/* @ts-ignore */
|
|
1264
|
-
...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
1265
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsToggleFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1266
|
-
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: `
|
|
1267
|
-
@let f = ngf.field(); @let inputId = ngf.key() + '-input';
|
|
1268
|
-
|
|
1269
|
-
<div
|
|
1270
|
-
class="form-check form-switch"
|
|
1271
|
-
[class.form-check-inline]="props()?.inline"
|
|
1272
|
-
[class.form-check-reverse]="props()?.reverse"
|
|
1273
|
-
[class.form-switch-sm]="props()?.size === 'sm'"
|
|
1274
|
-
[class.form-switch-lg]="props()?.size === 'lg'"
|
|
1275
|
-
[attr.hidden]="f().hidden() || null"
|
|
1276
|
-
>
|
|
1277
|
-
<input
|
|
1278
|
-
ngForgeControl
|
|
1279
|
-
type="checkbox"
|
|
1280
|
-
[formField]="f"
|
|
1281
|
-
[id]="inputId"
|
|
1282
|
-
class="form-check-input"
|
|
1283
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
1284
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
1285
|
-
/>
|
|
1286
|
-
<label [for]="inputId" class="form-check-label">
|
|
1287
|
-
{{ ngf.label() | dynamicText | async }}
|
|
1288
|
-
</label>
|
|
1289
|
-
</div>
|
|
1290
|
-
|
|
1291
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
1292
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
1293
|
-
} @else if (props()?.hint; as hint) {
|
|
1294
|
-
<div class="form-text" [id]="ngf.hintId()" [attr.hidden]="f().hidden() || null">{{ hint | dynamicText | async }}</div>
|
|
1295
|
-
}
|
|
1296
|
-
`, 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 });
|
|
1297
|
-
}
|
|
1298
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsToggleFieldComponent, decorators: [{
|
|
1299
|
-
type: Component,
|
|
1300
|
-
args: [{ selector: 'df-bs-toggle', imports: [FormField, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
1301
|
-
@let f = ngf.field(); @let inputId = ngf.key() + '-input';
|
|
1302
|
-
|
|
1303
|
-
<div
|
|
1304
|
-
class="form-check form-switch"
|
|
1305
|
-
[class.form-check-inline]="props()?.inline"
|
|
1306
|
-
[class.form-check-reverse]="props()?.reverse"
|
|
1307
|
-
[class.form-switch-sm]="props()?.size === 'sm'"
|
|
1308
|
-
[class.form-switch-lg]="props()?.size === 'lg'"
|
|
1309
|
-
[attr.hidden]="f().hidden() || null"
|
|
1310
|
-
>
|
|
1311
|
-
<input
|
|
1312
|
-
ngForgeControl
|
|
1313
|
-
type="checkbox"
|
|
1314
|
-
[formField]="f"
|
|
1315
|
-
[id]="inputId"
|
|
1316
|
-
class="form-check-input"
|
|
1317
|
-
[class.is-invalid]="f().invalid() && f().touched()"
|
|
1318
|
-
[attr.tabindex]="ngf.tabIndex()"
|
|
1319
|
-
/>
|
|
1320
|
-
<label [for]="inputId" class="form-check-label">
|
|
1321
|
-
{{ ngf.label() | dynamicText | async }}
|
|
1322
|
-
</label>
|
|
1323
|
-
</div>
|
|
1324
|
-
|
|
1325
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
1326
|
-
<div class="invalid-feedback d-block" [id]="ngf.errorId()" role="alert">{{ error.message }}</div>
|
|
1327
|
-
} @else if (props()?.hint; as hint) {
|
|
1328
|
-
<div class="form-text" [id]="ngf.hintId()" [attr.hidden]="f().hidden() || null">{{ hint | dynamicText | async }}</div>
|
|
1329
|
-
}
|
|
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"] }]
|
|
1331
|
-
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1332
|
-
|
|
5
|
+
import { DynamicFormError } from '@ng-forge/dynamic-forms';
|
|
1333
6
|
|
|
1334
7
|
const BsField = {
|
|
1335
8
|
Input: 'input',
|
|
@@ -1589,102 +262,9 @@ function withBootstrapAddons() {
|
|
|
1589
262
|
};
|
|
1590
263
|
}
|
|
1591
264
|
|
|
1592
|
-
class BsIconAddonComponent {
|
|
1593
|
-
addon = input.required(/* @ts-ignore */
|
|
1594
|
-
...(ngDevMode ? [{ debugName: "addon" }] : /* istanbul ignore next */ []));
|
|
1595
|
-
fieldInputs = input(/* @ts-ignore */
|
|
1596
|
-
...(ngDevMode ? [undefined, { debugName: "fieldInputs" }] : /* istanbul ignore next */ []));
|
|
1597
|
-
iconClass = computed(() => `bi bi-${this.addon().icon}`, /* @ts-ignore */
|
|
1598
|
-
...(ngDevMode ? [{ debugName: "iconClass" }] : /* istanbul ignore next */ []));
|
|
1599
|
-
ariaLabel = computed(() => this.addon().ariaLabel, /* @ts-ignore */
|
|
1600
|
-
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1601
|
-
hasAriaLabel = computed(() => this.addon().ariaLabel !== undefined, /* @ts-ignore */
|
|
1602
|
-
...(ngDevMode ? [{ debugName: "hasAriaLabel" }] : /* istanbul ignore next */ []));
|
|
1603
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsIconAddonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1604
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.5", 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 });
|
|
1605
|
-
}
|
|
1606
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsIconAddonComponent, decorators: [{
|
|
1607
|
-
type: Component,
|
|
1608
|
-
args: [{
|
|
1609
|
-
selector: 'df-bs-icon-addon',
|
|
1610
|
-
imports: [AsyncPipe, DynamicTextPipe],
|
|
1611
|
-
template: `<i [class]="iconClass()" [attr.aria-label]="(ariaLabel() | dynamicText | async) ?? null"></i>`,
|
|
1612
|
-
host: {
|
|
1613
|
-
'[attr.aria-hidden]': 'hasAriaLabel() ? null : "true"',
|
|
1614
|
-
},
|
|
1615
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1616
|
-
}]
|
|
1617
|
-
}], propDecorators: { addon: [{ type: i0.Input, args: [{ isSignal: true, alias: "addon", required: true }] }], fieldInputs: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldInputs", required: false }] }] } });
|
|
1618
|
-
|
|
1619
|
-
class BsButtonAddonComponent {
|
|
1620
|
-
action = injectNgForgeAddonAction();
|
|
1621
|
-
addon = this.action.addon;
|
|
1622
|
-
label = computed(() => this.addon().label, /* @ts-ignore */
|
|
1623
|
-
...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1624
|
-
ariaLabel = computed(() => this.addon().ariaLabel, /* @ts-ignore */
|
|
1625
|
-
...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
1626
|
-
iconClass = computed(() => {
|
|
1627
|
-
const icon = this.addon().icon;
|
|
1628
|
-
return icon ? `bi bi-${icon}` : '';
|
|
1629
|
-
}, /* @ts-ignore */
|
|
1630
|
-
...(ngDevMode ? [{ debugName: "iconClass" }] : /* istanbul ignore next */ []));
|
|
1631
|
-
buttonClass = computed(() => `btn btn-outline-${this.addon().severity ?? 'secondary'}`, /* @ts-ignore */
|
|
1632
|
-
...(ngDevMode ? [{ debugName: "buttonClass" }] : /* istanbul ignore next */ []));
|
|
1633
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsButtonAddonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1634
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: BsButtonAddonComponent, isStandalone: true, selector: "df-bs-button-addon", hostDirectives: [{ directive: i1.NgForgeAddonAction }], ngImport: i0, template: `
|
|
1635
|
-
<button
|
|
1636
|
-
type="button"
|
|
1637
|
-
[class]="buttonClass()"
|
|
1638
|
-
[disabled]="action.disabled() || action.loading()"
|
|
1639
|
-
[attr.aria-label]="(ariaLabel() | dynamicText | async) ?? null"
|
|
1640
|
-
[attr.aria-busy]="action.loading() || null"
|
|
1641
|
-
(click)="action.dispatch()"
|
|
1642
|
-
>
|
|
1643
|
-
@if (action.loading()) {
|
|
1644
|
-
<!-- Visually-hidden role=status text gives a reliable AT announcement (VO/JAWS/NVDA). -->
|
|
1645
|
-
<span class="spinner-border spinner-border-sm" aria-hidden="true"></span>
|
|
1646
|
-
<span class="visually-hidden" role="status">Loading…</span>
|
|
1647
|
-
} @else if (iconClass(); as ic) {
|
|
1648
|
-
<i [class]="ic" aria-hidden="true"></i>
|
|
1649
|
-
}
|
|
1650
|
-
@if (label(); as l) {
|
|
1651
|
-
<span>{{ l | dynamicText | async }}</span>
|
|
1652
|
-
}
|
|
1653
|
-
</button>
|
|
1654
|
-
`, isInline: true, dependencies: [{ kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1655
|
-
}
|
|
1656
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsButtonAddonComponent, decorators: [{
|
|
1657
|
-
type: Component,
|
|
1658
|
-
args: [{
|
|
1659
|
-
selector: 'df-bs-button-addon',
|
|
1660
|
-
imports: [DynamicTextPipe, AsyncPipe],
|
|
1661
|
-
hostDirectives: [NgForgeAddonAction],
|
|
1662
|
-
template: `
|
|
1663
|
-
<button
|
|
1664
|
-
type="button"
|
|
1665
|
-
[class]="buttonClass()"
|
|
1666
|
-
[disabled]="action.disabled() || action.loading()"
|
|
1667
|
-
[attr.aria-label]="(ariaLabel() | dynamicText | async) ?? null"
|
|
1668
|
-
[attr.aria-busy]="action.loading() || null"
|
|
1669
|
-
(click)="action.dispatch()"
|
|
1670
|
-
>
|
|
1671
|
-
@if (action.loading()) {
|
|
1672
|
-
<!-- Visually-hidden role=status text gives a reliable AT announcement (VO/JAWS/NVDA). -->
|
|
1673
|
-
<span class="spinner-border spinner-border-sm" aria-hidden="true"></span>
|
|
1674
|
-
<span class="visually-hidden" role="status">Loading…</span>
|
|
1675
|
-
} @else if (iconClass(); as ic) {
|
|
1676
|
-
<i [class]="ic" aria-hidden="true"></i>
|
|
1677
|
-
}
|
|
1678
|
-
@if (label(); as l) {
|
|
1679
|
-
<span>{{ l | dynamicText | async }}</span>
|
|
1680
|
-
}
|
|
1681
|
-
</button>
|
|
1682
|
-
`,
|
|
1683
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1684
|
-
}]
|
|
1685
|
-
}] });
|
|
1686
265
|
|
|
266
|
+
/* eslint-disable @nx/enforce-module-boundaries -- Package self-imports preserve ng-packagr secondary entry points. */
|
|
1687
267
|
|
|
1688
268
|
|
|
1689
|
-
export { BOOTSTRAP_FIELD_TYPES,
|
|
269
|
+
export { BOOTSTRAP_FIELD_TYPES, BsField, withBootstrapAddons, withBootstrapFields };
|
|
1690
270
|
//# sourceMappingURL=ng-forge-dynamic-forms-bootstrap.mjs.map
|