@ng-forge/dynamic-forms-ionic 0.8.0 → 0.9.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,72 +1,27 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import {
|
|
2
|
+
import { input, computed, ChangeDetectionStrategy, Component, signal, InjectionToken, inject, ElementRef, linkedSignal, model, isSignal } from '@angular/core';
|
|
3
3
|
import { IonButton, IonCheckbox, IonNote, IonInput, IonModal, IonDatetime, IonButtons, IonHeader, IonContent, IonToolbar, IonTitle, IonItem, IonRadioGroup, IonRadio, IonSelect, IonSelectOption, IonRange, IonTextarea, IonToggle } from '@ionic/angular/standalone';
|
|
4
|
-
import { EventBus, ARRAY_CONTEXT, resolveTokens, DynamicTextPipe, DEFAULT_PROPS, buildBaseInputs } from '@ng-forge/dynamic-forms';
|
|
5
4
|
import { AsyncPipe } from '@angular/common';
|
|
5
|
+
import { DynamicTextPipe, DEFAULT_PROPS, ARRAY_CONTEXT, buildBaseInputs } from '@ng-forge/dynamic-forms';
|
|
6
|
+
import * as i1 from '@ng-forge/dynamic-forms/integration';
|
|
7
|
+
import { injectNgForgeAction, NgForgeActionHost, injectNgForgeField, NgForgeControl, NgForgeFieldHost, isEqual, NgForgeHostControl, valueFieldMapper, optionsFieldMapper, checkboxFieldMapper, submitButtonFieldMapper, nextButtonFieldMapper, previousButtonFieldMapper, addArrayItemButtonMapper, prependArrayItemButtonMapper, insertArrayItemButtonMapper, removeArrayItemButtonMapper, popArrayItemButtonMapper, shiftArrayItemButtonMapper, datepickerFieldMapper } from '@ng-forge/dynamic-forms/integration';
|
|
6
8
|
import { FormField } from '@angular/forms/signals';
|
|
7
|
-
import { createResolvedErrorsSignal, shouldShowErrors, setupMetaTracking, isEqual, valueFieldMapper, optionsFieldMapper, checkboxFieldMapper, submitButtonFieldMapper, nextButtonFieldMapper, previousButtonFieldMapper, addArrayItemButtonMapper, prependArrayItemButtonMapper, insertArrayItemButtonMapper, removeArrayItemButtonMapper, popArrayItemButtonMapper, shiftArrayItemButtonMapper, datepickerFieldMapper } from '@ng-forge/dynamic-forms/integration';
|
|
8
9
|
import { format } from 'date-fns';
|
|
9
10
|
import { explicitEffect } from 'ngxtension/explicit-effect';
|
|
10
11
|
|
|
11
12
|
class IonicButtonFieldComponent {
|
|
12
|
-
|
|
13
|
-
arrayContext = inject(ARRAY_CONTEXT, { optional: true });
|
|
14
|
-
key = input.required(...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
15
|
-
label = input.required(...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
16
|
-
disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled" }] : /* istanbul ignore next */ []));
|
|
17
|
-
hidden = input(false, ...(ngDevMode ? [{ debugName: "hidden" }] : /* istanbul ignore next */ []));
|
|
18
|
-
tabIndex = input(...(ngDevMode ? [undefined, { debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
19
|
-
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
20
|
-
/** Event to dispatch on click. Optional for submit buttons (native form submit handles it). */
|
|
21
|
-
event = input(...(ngDevMode ? [undefined, { debugName: "event" }] : /* istanbul ignore next */ []));
|
|
22
|
-
eventArgs = input(...(ngDevMode ? [undefined, { debugName: "eventArgs" }] : /* istanbul ignore next */ []));
|
|
13
|
+
action = injectNgForgeAction();
|
|
23
14
|
props = input(...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
24
|
-
eventContext = input(...(ngDevMode ? [undefined, { debugName: "eventContext" }] : /* istanbul ignore next */ []));
|
|
25
|
-
/** Resolved button type - defaults to 'button' if not specified in props */
|
|
26
15
|
buttonType = computed(() => this.props()?.type ?? 'button', ...(ngDevMode ? [{ debugName: "buttonType" }] : /* istanbul ignore next */ []));
|
|
27
|
-
buttonTestId = computed(() => `${this.buttonType()}-${this.key()}`, ...(ngDevMode ? [{ debugName: "buttonTestId" }] : /* istanbul ignore next */ []));
|
|
28
|
-
/**
|
|
29
|
-
* Handle button click.
|
|
30
|
-
* - For submit buttons (type="submit"): do nothing, native form submit handles it
|
|
31
|
-
* - For other buttons: dispatch the configured event via EventBus
|
|
32
|
-
*/
|
|
16
|
+
buttonTestId = computed(() => `${this.buttonType()}-${this.action.key()}`, ...(ngDevMode ? [{ debugName: "buttonTestId" }] : /* istanbul ignore next */ []));
|
|
33
17
|
onClick() {
|
|
34
|
-
|
|
35
|
-
if (this.buttonType() === 'submit') {
|
|
18
|
+
if (this.buttonType() === 'submit')
|
|
36
19
|
return;
|
|
37
|
-
|
|
38
|
-
// Other buttons dispatch their event (if configured)
|
|
39
|
-
const event = this.event();
|
|
40
|
-
if (event) {
|
|
41
|
-
this.dispatchEvent(event);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
dispatchEvent(event) {
|
|
45
|
-
const args = this.eventArgs();
|
|
46
|
-
if (args && args.length > 0) {
|
|
47
|
-
// Build context from injected ARRAY_CONTEXT (with linkedSignal index) or fallback to eventContext
|
|
48
|
-
const context = this.arrayContext
|
|
49
|
-
? {
|
|
50
|
-
key: this.key(),
|
|
51
|
-
// Read signal to get current index (automatically updates via linkedSignal)
|
|
52
|
-
index: this.arrayContext.index(),
|
|
53
|
-
arrayKey: this.arrayContext.arrayKey,
|
|
54
|
-
formValue: this.arrayContext.formValue,
|
|
55
|
-
}
|
|
56
|
-
: this.eventContext() || { key: this.key() };
|
|
57
|
-
// Resolve tokens in event args using the provided context
|
|
58
|
-
const resolvedArgs = resolveTokens(args, context);
|
|
59
|
-
// Dispatch event with resolved args
|
|
60
|
-
this.eventBus.dispatch(event, ...resolvedArgs);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
// No args, dispatch event without arguments
|
|
64
|
-
this.eventBus.dispatch(event);
|
|
65
|
-
}
|
|
20
|
+
this.action.dispatch();
|
|
66
21
|
}
|
|
67
22
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicButtonFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
68
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: IonicButtonFieldComponent, isStandalone: true, selector: "df-ion-button", inputs: {
|
|
69
|
-
@let buttonId = key() + '-button';
|
|
23
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: IonicButtonFieldComponent, isStandalone: true, selector: "df-ion-button", inputs: { props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeActionHost }], ngImport: i0, template: `
|
|
24
|
+
@let buttonId = action.key() + '-button';
|
|
70
25
|
|
|
71
26
|
<ion-button
|
|
72
27
|
[id]="buttonId"
|
|
@@ -77,23 +32,19 @@ class IonicButtonFieldComponent {
|
|
|
77
32
|
[size]="props()?.size"
|
|
78
33
|
[color]="props()?.color || 'primary'"
|
|
79
34
|
[strong]="props()?.strong"
|
|
80
|
-
[disabled]="disabled()"
|
|
35
|
+
[disabled]="action.disabled()"
|
|
36
|
+
[attr.tabindex]="action.tabIndex()"
|
|
81
37
|
[attr.data-testid]="buttonTestId()"
|
|
82
38
|
(click)="onClick()"
|
|
83
39
|
>
|
|
84
|
-
{{ label() | dynamicText | async }}
|
|
40
|
+
{{ action.label() | dynamicText | async }}
|
|
85
41
|
</ion-button>
|
|
86
42
|
`, isInline: true, styles: [":host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
87
43
|
}
|
|
88
44
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicButtonFieldComponent, decorators: [{
|
|
89
45
|
type: Component,
|
|
90
|
-
args: [{ selector: 'df-ion-button', imports: [IonButton, DynamicTextPipe, AsyncPipe],
|
|
91
|
-
|
|
92
|
-
'[class]': 'className()',
|
|
93
|
-
'[attr.data-testid]': 'key()',
|
|
94
|
-
'[attr.hidden]': 'hidden() || null',
|
|
95
|
-
}, template: `
|
|
96
|
-
@let buttonId = key() + '-button';
|
|
46
|
+
args: [{ selector: 'df-ion-button', imports: [IonButton, DynamicTextPipe, AsyncPipe], hostDirectives: [NgForgeActionHost], template: `
|
|
47
|
+
@let buttonId = action.key() + '-button';
|
|
97
48
|
|
|
98
49
|
<ion-button
|
|
99
50
|
[id]="buttonId"
|
|
@@ -104,14 +55,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
104
55
|
[size]="props()?.size"
|
|
105
56
|
[color]="props()?.color || 'primary'"
|
|
106
57
|
[strong]="props()?.strong"
|
|
107
|
-
[disabled]="disabled()"
|
|
58
|
+
[disabled]="action.disabled()"
|
|
59
|
+
[attr.tabindex]="action.tabIndex()"
|
|
108
60
|
[attr.data-testid]="buttonTestId()"
|
|
109
61
|
(click)="onClick()"
|
|
110
62
|
>
|
|
111
|
-
{{ label() | dynamicText | async }}
|
|
63
|
+
{{ action.label() | dynamicText | async }}
|
|
112
64
|
</ion-button>
|
|
113
65
|
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host([hidden]){display:none!important}\n"] }]
|
|
114
|
-
}], propDecorators: {
|
|
66
|
+
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
115
67
|
|
|
116
68
|
var ionicButton_component = /*#__PURE__*/Object.freeze({
|
|
117
69
|
__proto__: null,
|
|
@@ -120,129 +72,60 @@ var ionicButton_component = /*#__PURE__*/Object.freeze({
|
|
|
120
72
|
|
|
121
73
|
// Public API - component
|
|
122
74
|
|
|
123
|
-
/**
|
|
124
|
-
* Creates a signal that computes the aria-describedby value based on errors and hint state.
|
|
125
|
-
* Errors take precedence over hints - when errors are displayed, the hint is hidden.
|
|
126
|
-
* Only the first error is displayed (single error ID, not indexed).
|
|
127
|
-
*
|
|
128
|
-
* @param errorsToDisplay Signal containing the array of errors currently being displayed
|
|
129
|
-
* @param errorId Signal containing the ID for the error element (single error only)
|
|
130
|
-
* @param hintId Signal containing the ID for the hint element
|
|
131
|
-
* @param hasHint Function that returns true if a hint is configured
|
|
132
|
-
* @returns Signal containing the aria-describedby value or null
|
|
133
|
-
*/
|
|
134
|
-
function createAriaDescribedBySignal(errorsToDisplay, errorId, hintId, hasHint) {
|
|
135
|
-
return computed(() => {
|
|
136
|
-
if (errorsToDisplay().length > 0) {
|
|
137
|
-
return errorId();
|
|
138
|
-
}
|
|
139
|
-
if (hasHint()) {
|
|
140
|
-
return hintId();
|
|
141
|
-
}
|
|
142
|
-
return null;
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
|
|
146
75
|
class IonicCheckboxFieldComponent {
|
|
147
|
-
|
|
148
|
-
field = input.required(...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
|
|
149
|
-
key = input.required(...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
150
|
-
// Properties
|
|
151
|
-
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
152
|
-
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
153
|
-
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
154
|
-
tabIndex = input(...(ngDevMode ? [undefined, { debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
76
|
+
ngf = injectNgForgeField();
|
|
155
77
|
props = input(...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
156
|
-
meta = input(...(ngDevMode ? [undefined, { debugName: "meta" }] : /* istanbul ignore next */ []));
|
|
157
|
-
validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
|
|
158
|
-
defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
|
|
159
|
-
resolvedErrors = createResolvedErrorsSignal(this.field, this.validationMessages, this.defaultValidationMessages);
|
|
160
|
-
showErrors = shouldShowErrors(this.field);
|
|
161
|
-
errorsToDisplay = computed(() => (this.showErrors() ? this.resolvedErrors() : []), ...(ngDevMode ? [{ debugName: "errorsToDisplay" }] : /* istanbul ignore next */ []));
|
|
162
|
-
constructor() {
|
|
163
|
-
// Shadow DOM - apply meta to ion-checkbox element
|
|
164
|
-
setupMetaTracking(this.elementRef, this.meta, {
|
|
165
|
-
selector: 'ion-checkbox',
|
|
166
|
-
});
|
|
167
|
-
}
|
|
168
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
169
|
-
// Accessibility
|
|
170
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
171
|
-
/** Base ID for error elements */
|
|
172
|
-
errorId = computed(() => `${this.key()}-error`, ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
173
|
-
/** Unique ID for the helper text element */
|
|
174
|
-
hintId = computed(() => `${this.key()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
175
|
-
/** Whether the field is currently in an invalid state (invalid AND touched) */
|
|
176
|
-
ariaInvalid = computed(() => {
|
|
177
|
-
const fieldState = this.field()();
|
|
178
|
-
return fieldState.invalid() && fieldState.touched();
|
|
179
|
-
}, ...(ngDevMode ? [{ debugName: "ariaInvalid" }] : /* istanbul ignore next */ []));
|
|
180
|
-
/** Whether the field has a required validator */
|
|
181
|
-
ariaRequired = computed(() => {
|
|
182
|
-
return this.field()().required?.() === true ? true : null;
|
|
183
|
-
}, ...(ngDevMode ? [{ debugName: "ariaRequired" }] : /* istanbul ignore next */ []));
|
|
184
|
-
/** aria-describedby linking to hint OR error elements (mutually exclusive) */
|
|
185
|
-
ariaDescribedBy = createAriaDescribedBySignal(this.errorsToDisplay, this.errorId, this.hintId, () => !!this.props()?.hint);
|
|
186
78
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicCheckboxFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
187
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicCheckboxFieldComponent, isStandalone: true, selector: "df-ion-checkbox", inputs: {
|
|
188
|
-
@let f = field();
|
|
189
|
-
@let checkboxId = key() + '-checkbox';
|
|
79
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicCheckboxFieldComponent, isStandalone: true, selector: "df-ion-checkbox", inputs: { props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
80
|
+
@let f = ngf.field();
|
|
81
|
+
@let checkboxId = ngf.key() + '-checkbox';
|
|
190
82
|
|
|
191
83
|
<ion-checkbox
|
|
84
|
+
ngForgeControl
|
|
192
85
|
[id]="checkboxId"
|
|
193
86
|
[formField]="f"
|
|
194
87
|
[labelPlacement]="props()?.labelPlacement ?? 'end'"
|
|
195
88
|
[justify]="props()?.justify"
|
|
196
89
|
[color]="props()?.color ?? 'primary'"
|
|
197
90
|
[indeterminate]="props()?.indeterminate ?? false"
|
|
198
|
-
[attr.tabindex]="tabIndex()"
|
|
199
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
200
|
-
[attr.aria-required]="ariaRequired()"
|
|
201
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
91
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
202
92
|
>
|
|
203
|
-
{{ label() | dynamicText | async }}
|
|
93
|
+
{{ ngf.label() | dynamicText | async }}
|
|
204
94
|
</ion-checkbox>
|
|
205
95
|
|
|
206
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
207
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
96
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
97
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
208
98
|
} @else if (props()?.hint; as hint) {
|
|
209
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
99
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
210
100
|
}
|
|
211
|
-
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonCheckbox, selector: "ion-checkbox", inputs: ["checked", "color", "disabled", "errorText", "helperText", "indeterminate", "justify", "labelPlacement", "mode", "name", "value"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { 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 });
|
|
101
|
+
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonCheckbox, selector: "ion-checkbox", inputs: ["checked", "color", "disabled", "errorText", "helperText", "indeterminate", "justify", "labelPlacement", "mode", "name", "value"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { 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 });
|
|
212
102
|
}
|
|
213
103
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicCheckboxFieldComponent, decorators: [{
|
|
214
104
|
type: Component,
|
|
215
|
-
args: [{ selector: 'df-ion-checkbox', imports: [IonCheckbox, IonNote, FormField, DynamicTextPipe, AsyncPipe], template: `
|
|
216
|
-
@let f = field();
|
|
217
|
-
@let checkboxId = key() + '-checkbox';
|
|
105
|
+
args: [{ selector: 'df-ion-checkbox', imports: [IonCheckbox, IonNote, FormField, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
106
|
+
@let f = ngf.field();
|
|
107
|
+
@let checkboxId = ngf.key() + '-checkbox';
|
|
218
108
|
|
|
219
109
|
<ion-checkbox
|
|
110
|
+
ngForgeControl
|
|
220
111
|
[id]="checkboxId"
|
|
221
112
|
[formField]="f"
|
|
222
113
|
[labelPlacement]="props()?.labelPlacement ?? 'end'"
|
|
223
114
|
[justify]="props()?.justify"
|
|
224
115
|
[color]="props()?.color ?? 'primary'"
|
|
225
116
|
[indeterminate]="props()?.indeterminate ?? false"
|
|
226
|
-
[attr.tabindex]="tabIndex()"
|
|
227
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
228
|
-
[attr.aria-required]="ariaRequired()"
|
|
229
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
117
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
230
118
|
>
|
|
231
|
-
{{ label() | dynamicText | async }}
|
|
119
|
+
{{ ngf.label() | dynamicText | async }}
|
|
232
120
|
</ion-checkbox>
|
|
233
121
|
|
|
234
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
235
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
122
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
123
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
236
124
|
} @else if (props()?.hint; as hint) {
|
|
237
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
125
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
238
126
|
}
|
|
239
|
-
`, host: {
|
|
240
|
-
|
|
241
|
-
'[id]': '`${key()}`',
|
|
242
|
-
'[attr.data-testid]': 'key()',
|
|
243
|
-
'[attr.hidden]': 'field()().hidden() || null',
|
|
244
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}\n"] }]
|
|
245
|
-
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], validationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "validationMessages", required: false }] }], defaultValidationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValidationMessages", required: false }] }] } });
|
|
127
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}\n"] }]
|
|
128
|
+
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
246
129
|
|
|
247
130
|
var ionicCheckbox_component = /*#__PURE__*/Object.freeze({
|
|
248
131
|
__proto__: null,
|
|
@@ -250,48 +133,12 @@ var ionicCheckbox_component = /*#__PURE__*/Object.freeze({
|
|
|
250
133
|
});
|
|
251
134
|
|
|
252
135
|
class IonicDatepickerFieldComponent {
|
|
253
|
-
|
|
254
|
-
field = input.required(...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
|
|
255
|
-
key = input.required(...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
256
|
-
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
257
|
-
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
258
|
-
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
259
|
-
tabIndex = input(...(ngDevMode ? [undefined, { debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
136
|
+
ngf = injectNgForgeField();
|
|
260
137
|
minDate = input(null, ...(ngDevMode ? [{ debugName: "minDate" }] : /* istanbul ignore next */ []));
|
|
261
138
|
maxDate = input(null, ...(ngDevMode ? [{ debugName: "maxDate" }] : /* istanbul ignore next */ []));
|
|
262
139
|
startAt = input(null, ...(ngDevMode ? [{ debugName: "startAt" }] : /* istanbul ignore next */ []));
|
|
263
140
|
props = input(...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
264
|
-
meta = input(...(ngDevMode ? [undefined, { debugName: "meta" }] : /* istanbul ignore next */ []));
|
|
265
|
-
validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
|
|
266
|
-
defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
|
|
267
|
-
resolvedErrors = createResolvedErrorsSignal(this.field, this.validationMessages, this.defaultValidationMessages);
|
|
268
|
-
showErrors = shouldShowErrors(this.field);
|
|
269
|
-
errorsToDisplay = computed(() => (this.showErrors() ? this.resolvedErrors() : []), ...(ngDevMode ? [{ debugName: "errorsToDisplay" }] : /* istanbul ignore next */ []));
|
|
270
141
|
isModalOpen = signal(false, ...(ngDevMode ? [{ debugName: "isModalOpen" }] : /* istanbul ignore next */ []));
|
|
271
|
-
constructor() {
|
|
272
|
-
// Shadow DOM - apply meta to ion-input element
|
|
273
|
-
setupMetaTracking(this.elementRef, this.meta, {
|
|
274
|
-
selector: 'ion-input',
|
|
275
|
-
});
|
|
276
|
-
}
|
|
277
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
278
|
-
// Accessibility
|
|
279
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
280
|
-
/** Base ID for error elements */
|
|
281
|
-
errorId = computed(() => `${this.key()}-error`, ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
282
|
-
/** Unique ID for the helper text element */
|
|
283
|
-
hintId = computed(() => `${this.key()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
284
|
-
/** Whether the field is currently in an invalid state (invalid AND touched) */
|
|
285
|
-
ariaInvalid = computed(() => {
|
|
286
|
-
const fieldState = this.field()();
|
|
287
|
-
return fieldState.invalid() && fieldState.touched();
|
|
288
|
-
}, ...(ngDevMode ? [{ debugName: "ariaInvalid" }] : /* istanbul ignore next */ []));
|
|
289
|
-
/** Whether the field has a required validator */
|
|
290
|
-
ariaRequired = computed(() => {
|
|
291
|
-
return this.field()().required?.() === true ? true : null;
|
|
292
|
-
}, ...(ngDevMode ? [{ debugName: "ariaRequired" }] : /* istanbul ignore next */ []));
|
|
293
|
-
/** aria-describedby linking to hint OR error elements (mutually exclusive) */
|
|
294
|
-
ariaDescribedBy = createAriaDescribedBySignal(this.errorsToDisplay, this.errorId, this.hintId, () => !!this.props()?.hint);
|
|
295
142
|
openModal() {
|
|
296
143
|
this.isModalOpen.set(true);
|
|
297
144
|
}
|
|
@@ -300,14 +147,14 @@ class IonicDatepickerFieldComponent {
|
|
|
300
147
|
}
|
|
301
148
|
onDateChange(event) {
|
|
302
149
|
const value = event.detail.value;
|
|
303
|
-
// ion-datetime emits ISO 8601 strings internally;
|
|
304
|
-
// to match the
|
|
150
|
+
// ion-datetime emits ISO 8601 strings internally; convert to Date | null
|
|
151
|
+
// to match the field tree's value type.
|
|
305
152
|
if (value && typeof value === 'string' && value.length > 0) {
|
|
306
153
|
const date = new Date(value);
|
|
307
|
-
this.field()().value.set(date);
|
|
154
|
+
this.ngf.field()().value.set(date);
|
|
308
155
|
}
|
|
309
156
|
else {
|
|
310
|
-
this.field()().value.set(null);
|
|
157
|
+
this.ngf.field()().value.set(null);
|
|
311
158
|
}
|
|
312
159
|
this.closeModal();
|
|
313
160
|
}
|
|
@@ -339,37 +186,35 @@ class IonicDatepickerFieldComponent {
|
|
|
339
186
|
}
|
|
340
187
|
}
|
|
341
188
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicDatepickerFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
342
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicDatepickerFieldComponent, isStandalone: true, selector: "df-ion-datepicker", inputs: {
|
|
343
|
-
@let f = field();
|
|
189
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicDatepickerFieldComponent, isStandalone: true, selector: "df-ion-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: `
|
|
190
|
+
@let f = ngf.field();
|
|
344
191
|
@let dateValue = f().value();
|
|
345
|
-
@let inputId = key() + '-input';
|
|
192
|
+
@let inputId = ngf.key() + '-input';
|
|
346
193
|
|
|
347
194
|
<ion-input
|
|
195
|
+
ngForgeControl
|
|
348
196
|
[id]="inputId"
|
|
349
|
-
[label]="(label() | dynamicText | async) ?? undefined"
|
|
197
|
+
[label]="(ngf.label() | dynamicText | async) ?? undefined"
|
|
350
198
|
[labelPlacement]="'stacked'"
|
|
351
|
-
[placeholder]="(placeholder() | dynamicText | async) ?? ''"
|
|
199
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
352
200
|
[disabled]="f().disabled()"
|
|
353
201
|
[value]="formatDisplayDate(dateValue)"
|
|
354
202
|
[readonly]="true"
|
|
355
203
|
[fill]="'outline'"
|
|
356
|
-
[attr.tabindex]="tabIndex()"
|
|
357
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
358
|
-
[attr.aria-required]="ariaRequired()"
|
|
359
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
204
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
360
205
|
(click)="!f().disabled() && openModal()"
|
|
361
206
|
/>
|
|
362
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
363
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
207
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
208
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
364
209
|
} @else if (props()?.hint; as hint) {
|
|
365
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
210
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
366
211
|
}
|
|
367
212
|
|
|
368
213
|
<ion-modal [isOpen]="isModalOpen()" (didDismiss)="closeModal()">
|
|
369
214
|
<ng-template>
|
|
370
215
|
<ion-header>
|
|
371
216
|
<ion-toolbar>
|
|
372
|
-
<ion-title>{{ label() | dynamicText | async }}</ion-title>
|
|
217
|
+
<ion-title>{{ ngf.label() | dynamicText | async }}</ion-title>
|
|
373
218
|
<ion-buttons slot="end">
|
|
374
219
|
<ion-button (click)="closeModal()">Close</ion-button>
|
|
375
220
|
</ion-buttons>
|
|
@@ -394,7 +239,7 @@ class IonicDatepickerFieldComponent {
|
|
|
394
239
|
</ion-content>
|
|
395
240
|
</ng-template>
|
|
396
241
|
</ion-modal>
|
|
397
|
-
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", "ion-input{cursor:pointer}:host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: IonModal, selector: "ion-modal" }, { kind: "component", type: IonDatetime, selector: "ion-datetime", inputs: ["cancelText", "clearText", "color", "dayValues", "disabled", "doneText", "firstDayOfWeek", "formatOptions", "highlightedDates", "hourCycle", "hourValues", "isDateEnabled", "locale", "max", "min", "minuteValues", "mode", "monthValues", "multiple", "name", "preferWheel", "presentation", "readonly", "showAdjacentDays", "showClearButton", "showDefaultButtons", "showDefaultTimeLabel", "showDefaultTitle", "size", "titleSelectedDatesFormatter", "value", "yearValues"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
242
|
+
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", "ion-input{cursor:pointer}:host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: IonModal, selector: "ion-modal" }, { kind: "component", type: IonDatetime, selector: "ion-datetime", inputs: ["cancelText", "clearText", "color", "dayValues", "disabled", "doneText", "firstDayOfWeek", "formatOptions", "highlightedDates", "hourCycle", "hourValues", "isDateEnabled", "locale", "max", "min", "minuteValues", "mode", "monthValues", "multiple", "name", "preferWheel", "presentation", "readonly", "showAdjacentDays", "showClearButton", "showDefaultButtons", "showDefaultTimeLabel", "showDefaultTitle", "size", "titleSelectedDatesFormatter", "value", "yearValues"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { kind: "component", type: IonButtons, selector: "ion-buttons", inputs: ["collapse"] }, { kind: "component", type: IonHeader, selector: "ion-header", inputs: ["collapse", "mode", "translucent"] }, { kind: "component", type: IonContent, selector: "ion-content", inputs: ["color", "fixedSlotPlacement", "forceOverscroll", "fullscreen", "scrollEvents", "scrollX", "scrollY"] }, { kind: "component", type: IonToolbar, selector: "ion-toolbar", inputs: ["color", "mode"] }, { kind: "component", type: IonTitle, selector: "ion-title", inputs: ["color", "size"] }, { kind: "component", type: IonButton, selector: "ion-button", inputs: ["buttonType", "color", "disabled", "download", "expand", "fill", "form", "href", "mode", "rel", "routerAnimation", "routerDirection", "shape", "size", "strong", "target", "type"] }, { kind: "directive", type: NgForgeControl, selector: "[ngForgeControl]", inputs: ["ngForgeControl"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
398
243
|
}
|
|
399
244
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicDatepickerFieldComponent, decorators: [{
|
|
400
245
|
type: Component,
|
|
@@ -411,37 +256,36 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
411
256
|
IonButton,
|
|
412
257
|
DynamicTextPipe,
|
|
413
258
|
AsyncPipe,
|
|
414
|
-
|
|
415
|
-
|
|
259
|
+
NgForgeControl,
|
|
260
|
+
], hostDirectives: [NgForgeFieldHost], template: `
|
|
261
|
+
@let f = ngf.field();
|
|
416
262
|
@let dateValue = f().value();
|
|
417
|
-
@let inputId = key() + '-input';
|
|
263
|
+
@let inputId = ngf.key() + '-input';
|
|
418
264
|
|
|
419
265
|
<ion-input
|
|
266
|
+
ngForgeControl
|
|
420
267
|
[id]="inputId"
|
|
421
|
-
[label]="(label() | dynamicText | async) ?? undefined"
|
|
268
|
+
[label]="(ngf.label() | dynamicText | async) ?? undefined"
|
|
422
269
|
[labelPlacement]="'stacked'"
|
|
423
|
-
[placeholder]="(placeholder() | dynamicText | async) ?? ''"
|
|
270
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
424
271
|
[disabled]="f().disabled()"
|
|
425
272
|
[value]="formatDisplayDate(dateValue)"
|
|
426
273
|
[readonly]="true"
|
|
427
274
|
[fill]="'outline'"
|
|
428
|
-
[attr.tabindex]="tabIndex()"
|
|
429
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
430
|
-
[attr.aria-required]="ariaRequired()"
|
|
431
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
275
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
432
276
|
(click)="!f().disabled() && openModal()"
|
|
433
277
|
/>
|
|
434
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
435
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
278
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
279
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
436
280
|
} @else if (props()?.hint; as hint) {
|
|
437
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
281
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
438
282
|
}
|
|
439
283
|
|
|
440
284
|
<ion-modal [isOpen]="isModalOpen()" (didDismiss)="closeModal()">
|
|
441
285
|
<ng-template>
|
|
442
286
|
<ion-header>
|
|
443
287
|
<ion-toolbar>
|
|
444
|
-
<ion-title>{{ label() | dynamicText | async }}</ion-title>
|
|
288
|
+
<ion-title>{{ ngf.label() | dynamicText | async }}</ion-title>
|
|
445
289
|
<ion-buttons slot="end">
|
|
446
290
|
<ion-button (click)="closeModal()">Close</ion-button>
|
|
447
291
|
</ion-buttons>
|
|
@@ -466,13 +310,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
466
310
|
</ion-content>
|
|
467
311
|
</ng-template>
|
|
468
312
|
</ion-modal>
|
|
469
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
470
|
-
|
|
471
|
-
'[attr.data-testid]': 'key()',
|
|
472
|
-
'[class]': 'className()',
|
|
473
|
-
'[attr.hidden]': 'field()().hidden() || null',
|
|
474
|
-
}, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", "ion-input{cursor:pointer}:host([hidden]){display:none!important}\n"] }]
|
|
475
|
-
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], 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 }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], validationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "validationMessages", required: false }] }], defaultValidationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValidationMessages", required: false }] }] } });
|
|
313
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", "ion-input{cursor:pointer}:host([hidden]){display:none!important}\n"] }]
|
|
314
|
+
}], 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 }] }] } });
|
|
476
315
|
|
|
477
316
|
var ionicDatepicker_component = /*#__PURE__*/Object.freeze({
|
|
478
317
|
__proto__: null,
|
|
@@ -524,32 +363,17 @@ const IONIC_CONFIG = new InjectionToken('IONIC_CONFIG');
|
|
|
524
363
|
class IonicInputFieldComponent {
|
|
525
364
|
elementRef = inject((ElementRef));
|
|
526
365
|
ionicConfig = inject(IONIC_CONFIG, { optional: true });
|
|
527
|
-
|
|
528
|
-
key = input.required(...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
529
|
-
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
530
|
-
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
531
|
-
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
532
|
-
tabIndex = input(...(ngDevMode ? [undefined, { debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
366
|
+
ngf = injectNgForgeField();
|
|
533
367
|
props = input(...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
effectiveShape = computed(() => this.props()?.shape ?? this.ionicConfig?.shape, ...(ngDevMode ? [{ debugName: "effectiveShape" }] : /* istanbul ignore next */ []));
|
|
539
|
-
effectiveLabelPlacement = computed(() => this.props()?.labelPlacement ?? this.ionicConfig?.labelPlacement ?? 'start', ...(ngDevMode ? [{ debugName: "effectiveLabelPlacement" }] : /* istanbul ignore next */ []));
|
|
540
|
-
effectiveColor = computed(() => this.props()?.color ?? this.ionicConfig?.color, ...(ngDevMode ? [{ debugName: "effectiveColor" }] : /* istanbul ignore next */ []));
|
|
541
|
-
resolvedErrors = createResolvedErrorsSignal(this.field, this.validationMessages, this.defaultValidationMessages);
|
|
542
|
-
showErrors = shouldShowErrors(this.field);
|
|
543
|
-
errorsToDisplay = computed(() => (this.showErrors() ? this.resolvedErrors() : []), ...(ngDevMode ? [{ debugName: "errorsToDisplay" }] : /* istanbul ignore next */ []));
|
|
368
|
+
fill = computed(() => this.props()?.fill ?? this.ionicConfig?.fill ?? 'solid', ...(ngDevMode ? [{ debugName: "fill" }] : /* istanbul ignore next */ []));
|
|
369
|
+
shape = computed(() => this.props()?.shape ?? this.ionicConfig?.shape, ...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
|
|
370
|
+
labelPlacement = computed(() => this.props()?.labelPlacement ?? this.ionicConfig?.labelPlacement ?? 'start', ...(ngDevMode ? [{ debugName: "labelPlacement" }] : /* istanbul ignore next */ []));
|
|
371
|
+
color = computed(() => this.props()?.color ?? this.ionicConfig?.color, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
544
372
|
constructor() {
|
|
545
|
-
// Shadow DOM - apply meta to ion-input element
|
|
546
|
-
setupMetaTracking(this.elementRef, this.meta, {
|
|
547
|
-
selector: 'ion-input',
|
|
548
|
-
});
|
|
549
373
|
// ion-input encapsulates a native <input> in shadow DOM and does not automatically
|
|
550
374
|
// propagate aria-describedby to it. This effect imperatively syncs the attribute
|
|
551
375
|
// after a microtask to ensure Ionic has resolved the internal element.
|
|
552
|
-
explicitEffect([this.ariaDescribedBy], ([describedBy]) => {
|
|
376
|
+
explicitEffect([this.ngf.ariaDescribedBy], ([describedBy]) => {
|
|
553
377
|
queueMicrotask(() => {
|
|
554
378
|
const ionInput = this.elementRef.nativeElement.querySelector('ion-input');
|
|
555
379
|
if (ionInput?.getInputElement) {
|
|
@@ -567,92 +391,65 @@ class IonicInputFieldComponent {
|
|
|
567
391
|
});
|
|
568
392
|
});
|
|
569
393
|
}
|
|
570
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
571
|
-
// Accessibility
|
|
572
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
573
|
-
/** Base ID for error elements */
|
|
574
|
-
errorId = computed(() => `${this.key()}-error`, ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
575
|
-
/** Unique ID for the helper text element */
|
|
576
|
-
hintId = computed(() => `${this.key()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
577
|
-
/** Whether the field is currently in an invalid state (invalid AND touched) */
|
|
578
|
-
ariaInvalid = computed(() => {
|
|
579
|
-
const fieldState = this.field()();
|
|
580
|
-
return fieldState.invalid() && fieldState.touched();
|
|
581
|
-
}, ...(ngDevMode ? [{ debugName: "ariaInvalid" }] : /* istanbul ignore next */ []));
|
|
582
|
-
/** Whether the field has a required validator */
|
|
583
|
-
ariaRequired = computed(() => {
|
|
584
|
-
return this.field()().required?.() === true ? true : null;
|
|
585
|
-
}, ...(ngDevMode ? [{ debugName: "ariaRequired" }] : /* istanbul ignore next */ []));
|
|
586
|
-
/** aria-describedby linking to hint OR error elements (mutually exclusive) */
|
|
587
|
-
ariaDescribedBy = createAriaDescribedBySignal(this.errorsToDisplay, this.errorId, this.hintId, () => !!this.props()?.hint);
|
|
588
394
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicInputFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
589
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicInputFieldComponent, isStandalone: true, selector: "df-ion-input", inputs: {
|
|
590
|
-
@let f = field();
|
|
591
|
-
@let inputId = key() + '-input';
|
|
395
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicInputFieldComponent, isStandalone: true, selector: "df-ion-input", inputs: { props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
396
|
+
@let f = ngf.field();
|
|
397
|
+
@let inputId = ngf.key() + '-input';
|
|
592
398
|
|
|
593
399
|
<ion-input
|
|
400
|
+
ngForgeControl
|
|
594
401
|
[id]="inputId"
|
|
595
402
|
[type]="props()?.type ?? 'text'"
|
|
596
403
|
[formField]="f"
|
|
597
|
-
[label]="(label() | dynamicText | async) ?? undefined"
|
|
598
|
-
[labelPlacement]="
|
|
599
|
-
[placeholder]="(placeholder() | dynamicText | async) ?? ''"
|
|
404
|
+
[label]="(ngf.label() | dynamicText | async) ?? undefined"
|
|
405
|
+
[labelPlacement]="labelPlacement()"
|
|
406
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
600
407
|
[clearInput]="props()?.clearInput ?? false"
|
|
601
408
|
[counter]="props()?.counter ?? false"
|
|
602
409
|
[minlength]="f().minLength?.()"
|
|
603
410
|
[maxlength]="f().maxLength?.()"
|
|
604
|
-
[color]="
|
|
605
|
-
[fill]="
|
|
606
|
-
[shape]="
|
|
411
|
+
[color]="color()"
|
|
412
|
+
[fill]="fill()"
|
|
413
|
+
[shape]="shape()"
|
|
607
414
|
[readonly]="f().readonly()"
|
|
608
|
-
[helperText]="errorsToDisplay().length === 0 ? ((props()?.hint | dynamicText | async) ?? undefined) : undefined"
|
|
609
|
-
[attr.tabindex]="tabIndex()"
|
|
610
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
611
|
-
[attr.aria-required]="ariaRequired()"
|
|
612
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
415
|
+
[helperText]="ngf.errorsToDisplay().length === 0 ? ((props()?.hint | dynamicText | async) ?? undefined) : undefined"
|
|
416
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
613
417
|
/>
|
|
614
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
615
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
418
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
419
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
616
420
|
}
|
|
617
|
-
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { 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 });
|
|
421
|
+
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonInput, selector: "ion-input", inputs: ["accept", "autocapitalize", "autocomplete", "autocorrect", "autofocus", "clearInput", "clearOnEdit", "color", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "max", "maxlength", "min", "minlength", "mode", "multiple", "name", "pattern", "placeholder", "readonly", "required", "shape", "size", "spellcheck", "step", "type", "value"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { 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 });
|
|
618
422
|
}
|
|
619
423
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicInputFieldComponent, decorators: [{
|
|
620
424
|
type: Component,
|
|
621
|
-
args: [{ selector: 'df-ion-input', imports: [IonInput, IonNote, FormField, DynamicTextPipe, AsyncPipe], template: `
|
|
622
|
-
@let f = field();
|
|
623
|
-
@let inputId = key() + '-input';
|
|
425
|
+
args: [{ selector: 'df-ion-input', imports: [IonInput, IonNote, FormField, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
426
|
+
@let f = ngf.field();
|
|
427
|
+
@let inputId = ngf.key() + '-input';
|
|
624
428
|
|
|
625
429
|
<ion-input
|
|
430
|
+
ngForgeControl
|
|
626
431
|
[id]="inputId"
|
|
627
432
|
[type]="props()?.type ?? 'text'"
|
|
628
433
|
[formField]="f"
|
|
629
|
-
[label]="(label() | dynamicText | async) ?? undefined"
|
|
630
|
-
[labelPlacement]="
|
|
631
|
-
[placeholder]="(placeholder() | dynamicText | async) ?? ''"
|
|
434
|
+
[label]="(ngf.label() | dynamicText | async) ?? undefined"
|
|
435
|
+
[labelPlacement]="labelPlacement()"
|
|
436
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
632
437
|
[clearInput]="props()?.clearInput ?? false"
|
|
633
438
|
[counter]="props()?.counter ?? false"
|
|
634
439
|
[minlength]="f().minLength?.()"
|
|
635
440
|
[maxlength]="f().maxLength?.()"
|
|
636
|
-
[color]="
|
|
637
|
-
[fill]="
|
|
638
|
-
[shape]="
|
|
441
|
+
[color]="color()"
|
|
442
|
+
[fill]="fill()"
|
|
443
|
+
[shape]="shape()"
|
|
639
444
|
[readonly]="f().readonly()"
|
|
640
|
-
[helperText]="errorsToDisplay().length === 0 ? ((props()?.hint | dynamicText | async) ?? undefined) : undefined"
|
|
641
|
-
[attr.tabindex]="tabIndex()"
|
|
642
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
643
|
-
[attr.aria-required]="ariaRequired()"
|
|
644
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
445
|
+
[helperText]="ngf.errorsToDisplay().length === 0 ? ((props()?.hint | dynamicText | async) ?? undefined) : undefined"
|
|
446
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
645
447
|
/>
|
|
646
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
647
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
448
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
449
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
648
450
|
}
|
|
649
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
650
|
-
|
|
651
|
-
'[attr.data-testid]': 'key()',
|
|
652
|
-
'[class]': 'className()',
|
|
653
|
-
'[attr.hidden]': 'field()().hidden() || null',
|
|
654
|
-
}, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host([hidden]){display:none!important}\n"] }]
|
|
655
|
-
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], validationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "validationMessages", required: false }] }], defaultValidationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValidationMessages", required: false }] }] } });
|
|
451
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host([hidden]){display:none!important}\n"] }]
|
|
452
|
+
}], ctorParameters: () => [], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
656
453
|
|
|
657
454
|
var ionicInput_component = /*#__PURE__*/Object.freeze({
|
|
658
455
|
__proto__: null,
|
|
@@ -660,41 +457,11 @@ var ionicInput_component = /*#__PURE__*/Object.freeze({
|
|
|
660
457
|
});
|
|
661
458
|
|
|
662
459
|
class IonicMultiCheckboxFieldComponent {
|
|
663
|
-
|
|
664
|
-
field = input.required(...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
|
|
665
|
-
key = input.required(...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
666
|
-
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
667
|
-
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
668
|
-
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
669
|
-
tabIndex = input(...(ngDevMode ? [undefined, { debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
460
|
+
ngf = injectNgForgeField();
|
|
670
461
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
671
462
|
props = input(...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
672
|
-
meta = input(...(ngDevMode ? [undefined, { debugName: "meta" }] : /* istanbul ignore next */ []));
|
|
673
|
-
validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
|
|
674
|
-
defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
|
|
675
|
-
resolvedErrors = createResolvedErrorsSignal(this.field, this.validationMessages, this.defaultValidationMessages);
|
|
676
|
-
showErrors = shouldShowErrors(this.field);
|
|
677
|
-
errorsToDisplay = computed(() => (this.showErrors() ? this.resolvedErrors() : []), ...(ngDevMode ? [{ debugName: "errorsToDisplay" }] : /* istanbul ignore next */ []));
|
|
678
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
679
|
-
// Accessibility
|
|
680
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
681
|
-
/** Base ID for error elements */
|
|
682
|
-
errorId = computed(() => `${this.key()}-error`, ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
683
|
-
/** Unique ID for the helper text element */
|
|
684
|
-
hintId = computed(() => `${this.key()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
685
|
-
/** Whether the field is currently in an invalid state (invalid AND touched) */
|
|
686
|
-
ariaInvalid = computed(() => {
|
|
687
|
-
const fieldState = this.field()();
|
|
688
|
-
return fieldState.invalid() && fieldState.touched();
|
|
689
|
-
}, ...(ngDevMode ? [{ debugName: "ariaInvalid" }] : /* istanbul ignore next */ []));
|
|
690
|
-
/** Whether the field has a required validator */
|
|
691
|
-
ariaRequired = computed(() => {
|
|
692
|
-
return this.field()().required?.() === true ? true : null;
|
|
693
|
-
}, ...(ngDevMode ? [{ debugName: "ariaRequired" }] : /* istanbul ignore next */ []));
|
|
694
|
-
/** aria-describedby linking to hint OR error elements (mutually exclusive) */
|
|
695
|
-
ariaDescribedBy = createAriaDescribedBySignal(this.errorsToDisplay, this.errorId, this.hintId, () => !!this.props()?.hint);
|
|
696
463
|
valueViewModel = linkedSignal(() => {
|
|
697
|
-
const currentValues = this.field()().value();
|
|
464
|
+
const currentValues = this.ngf.field()().value();
|
|
698
465
|
return this.options().filter((option) => currentValues.includes(option.value));
|
|
699
466
|
}, { ...(ngDevMode ? { debugName: "valueViewModel" } : /* istanbul ignore next */ {}), equal: isEqual });
|
|
700
467
|
/** Computed map of checked option values for O(1) lookup in template */
|
|
@@ -706,15 +473,10 @@ class IonicMultiCheckboxFieldComponent {
|
|
|
706
473
|
return map;
|
|
707
474
|
}, ...(ngDevMode ? [{ debugName: "checkedValuesMap" }] : /* istanbul ignore next */ []));
|
|
708
475
|
constructor() {
|
|
709
|
-
// Shadow DOM - apply meta to ion-checkbox elements, re-apply when options change
|
|
710
|
-
setupMetaTracking(this.elementRef, this.meta, {
|
|
711
|
-
selector: 'ion-checkbox',
|
|
712
|
-
dependents: [this.options],
|
|
713
|
-
});
|
|
714
476
|
explicitEffect([this.valueViewModel], ([selectedOptions]) => {
|
|
715
477
|
const selectedValues = selectedOptions.map((option) => option.value);
|
|
716
|
-
if (!isEqual(selectedValues, this.field()().value())) {
|
|
717
|
-
this.field()().value.set(selectedValues);
|
|
478
|
+
if (!isEqual(selectedValues, this.ngf.field()().value())) {
|
|
479
|
+
this.ngf.field()().value.set(selectedValues);
|
|
718
480
|
}
|
|
719
481
|
});
|
|
720
482
|
explicitEffect([this.options], ([options]) => {
|
|
@@ -737,25 +499,26 @@ class IonicMultiCheckboxFieldComponent {
|
|
|
737
499
|
});
|
|
738
500
|
}
|
|
739
501
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicMultiCheckboxFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
740
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicMultiCheckboxFieldComponent, isStandalone: true, selector: "df-ion-multi-checkbox", inputs: {
|
|
741
|
-
@let f = field();
|
|
502
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicMultiCheckboxFieldComponent, isStandalone: true, selector: "df-ion-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: `
|
|
503
|
+
@let f = ngf.field();
|
|
742
504
|
@let checked = checkedValuesMap();
|
|
743
|
-
@if (label(); as label) {
|
|
505
|
+
@if (ngf.label(); as label) {
|
|
744
506
|
<div class="checkbox-group-label">{{ label | dynamicText | async }}</div>
|
|
745
507
|
}
|
|
746
508
|
|
|
747
509
|
<div
|
|
748
510
|
class="checkbox-group"
|
|
749
511
|
role="group"
|
|
750
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
751
|
-
[attr.aria-required]="ariaRequired()"
|
|
752
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
753
|
-
[class.ion-invalid]="showErrors()"
|
|
754
|
-
[class.ion-touched]="
|
|
512
|
+
[attr.aria-invalid]="ngf.ariaInvalid()"
|
|
513
|
+
[attr.aria-required]="ngf.ariaRequired()"
|
|
514
|
+
[attr.aria-describedby]="ngf.ariaDescribedBy()"
|
|
515
|
+
[class.ion-invalid]="ngf.showErrors()"
|
|
516
|
+
[class.ion-touched]="f().touched()"
|
|
755
517
|
>
|
|
756
518
|
@for (option of options(); track option.value) {
|
|
757
519
|
<ion-item lines="none">
|
|
758
520
|
<ion-checkbox
|
|
521
|
+
ngForgeControl
|
|
759
522
|
[checked]="checked['' + option.value]"
|
|
760
523
|
[disabled]="f().disabled() || option.disabled"
|
|
761
524
|
[labelPlacement]="props()?.labelPlacement ?? 'end'"
|
|
@@ -769,34 +532,35 @@ class IonicMultiCheckboxFieldComponent {
|
|
|
769
532
|
}
|
|
770
533
|
</div>
|
|
771
534
|
|
|
772
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
773
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
535
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
536
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
774
537
|
} @else if (props()?.hint; as hint) {
|
|
775
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
538
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
776
539
|
}
|
|
777
|
-
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}.checkbox-group-label{margin-bottom:8px;font-weight:500}.checkbox-group{display:flex;flex-direction:column;gap:4px}ion-item{--padding-start: 0;--inner-padding-end: 0}\n"], dependencies: [{ kind: "component", type: IonCheckbox, selector: "ion-checkbox", inputs: ["checked", "color", "disabled", "errorText", "helperText", "indeterminate", "justify", "labelPlacement", "mode", "name", "value"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
540
|
+
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}.checkbox-group-label{margin-bottom:8px;font-weight:500}.checkbox-group{display:flex;flex-direction:column;gap:4px}ion-item{--padding-start: 0;--inner-padding-end: 0}\n"], dependencies: [{ kind: "component", type: IonCheckbox, selector: "ion-checkbox", inputs: ["checked", "color", "disabled", "errorText", "helperText", "indeterminate", "justify", "labelPlacement", "mode", "name", "value"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { kind: "directive", type: NgForgeControl, selector: "[ngForgeControl]", inputs: ["ngForgeControl"] }, { kind: "pipe", type: DynamicTextPipe, name: "dynamicText" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
778
541
|
}
|
|
779
542
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicMultiCheckboxFieldComponent, decorators: [{
|
|
780
543
|
type: Component,
|
|
781
|
-
args: [{ selector: 'df-ion-multi-checkbox', imports: [IonCheckbox, IonItem, IonNote, DynamicTextPipe, AsyncPipe], template: `
|
|
782
|
-
@let f = field();
|
|
544
|
+
args: [{ selector: 'df-ion-multi-checkbox', imports: [IonCheckbox, IonItem, IonNote, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
545
|
+
@let f = ngf.field();
|
|
783
546
|
@let checked = checkedValuesMap();
|
|
784
|
-
@if (label(); as label) {
|
|
547
|
+
@if (ngf.label(); as label) {
|
|
785
548
|
<div class="checkbox-group-label">{{ label | dynamicText | async }}</div>
|
|
786
549
|
}
|
|
787
550
|
|
|
788
551
|
<div
|
|
789
552
|
class="checkbox-group"
|
|
790
553
|
role="group"
|
|
791
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
792
|
-
[attr.aria-required]="ariaRequired()"
|
|
793
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
794
|
-
[class.ion-invalid]="showErrors()"
|
|
795
|
-
[class.ion-touched]="
|
|
554
|
+
[attr.aria-invalid]="ngf.ariaInvalid()"
|
|
555
|
+
[attr.aria-required]="ngf.ariaRequired()"
|
|
556
|
+
[attr.aria-describedby]="ngf.ariaDescribedBy()"
|
|
557
|
+
[class.ion-invalid]="ngf.showErrors()"
|
|
558
|
+
[class.ion-touched]="f().touched()"
|
|
796
559
|
>
|
|
797
560
|
@for (option of options(); track option.value) {
|
|
798
561
|
<ion-item lines="none">
|
|
799
562
|
<ion-checkbox
|
|
563
|
+
ngForgeControl
|
|
800
564
|
[checked]="checked['' + option.value]"
|
|
801
565
|
[disabled]="f().disabled() || option.disabled"
|
|
802
566
|
[labelPlacement]="props()?.labelPlacement ?? 'end'"
|
|
@@ -810,18 +574,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
810
574
|
}
|
|
811
575
|
</div>
|
|
812
576
|
|
|
813
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
814
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
577
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
578
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
815
579
|
} @else if (props()?.hint; as hint) {
|
|
816
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
580
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
817
581
|
}
|
|
818
|
-
`, host: {
|
|
819
|
-
|
|
820
|
-
'[id]': '`${key()}`',
|
|
821
|
-
'[attr.data-testid]': 'key()',
|
|
822
|
-
'[attr.hidden]': 'field()().hidden() || null',
|
|
823
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}.checkbox-group-label{margin-bottom:8px;font-weight:500}.checkbox-group{display:flex;flex-direction:column;gap:4px}ion-item{--padding-start: 0;--inner-padding-end: 0}\n"] }]
|
|
824
|
-
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], validationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "validationMessages", required: false }] }], defaultValidationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValidationMessages", required: false }] }] } });
|
|
582
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}.checkbox-group-label{margin-bottom:8px;font-weight:500}.checkbox-group{display:flex;flex-direction:column;gap:4px}ion-item{--padding-start: 0;--inner-padding-end: 0}\n"] }]
|
|
583
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
825
584
|
|
|
826
585
|
var ionicMultiCheckbox_component = /*#__PURE__*/Object.freeze({
|
|
827
586
|
__proto__: null,
|
|
@@ -829,53 +588,15 @@ var ionicMultiCheckbox_component = /*#__PURE__*/Object.freeze({
|
|
|
829
588
|
});
|
|
830
589
|
|
|
831
590
|
class IonicRadioFieldComponent {
|
|
832
|
-
|
|
833
|
-
field = input.required(...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
|
|
834
|
-
key = input.required(...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
835
|
-
// Properties
|
|
836
|
-
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
837
|
-
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
838
|
-
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
839
|
-
tabIndex = input(...(ngDevMode ? [undefined, { debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
591
|
+
ngf = injectNgForgeField();
|
|
840
592
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
841
593
|
props = input(...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
842
|
-
meta = input(...(ngDevMode ? [undefined, { debugName: "meta" }] : /* istanbul ignore next */ []));
|
|
843
|
-
validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
|
|
844
|
-
defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
|
|
845
|
-
resolvedErrors = createResolvedErrorsSignal(this.field, this.validationMessages, this.defaultValidationMessages);
|
|
846
|
-
showErrors = shouldShowErrors(this.field);
|
|
847
|
-
errorsToDisplay = computed(() => (this.showErrors() ? this.resolvedErrors() : []), ...(ngDevMode ? [{ debugName: "errorsToDisplay" }] : /* istanbul ignore next */ []));
|
|
848
594
|
defaultCompare = Object.is;
|
|
849
|
-
constructor() {
|
|
850
|
-
// Shadow DOM - apply meta to ion-radio elements, re-apply when options change
|
|
851
|
-
setupMetaTracking(this.elementRef, this.meta, {
|
|
852
|
-
selector: 'ion-radio',
|
|
853
|
-
dependents: [this.options],
|
|
854
|
-
});
|
|
855
|
-
}
|
|
856
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
857
|
-
// Accessibility
|
|
858
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
859
|
-
/** Base ID for error elements */
|
|
860
|
-
errorId = computed(() => `${this.key()}-error`, ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
861
|
-
/** Unique ID for the helper text element */
|
|
862
|
-
hintId = computed(() => `${this.key()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
863
|
-
/** Whether the field is currently in an invalid state (invalid AND touched) */
|
|
864
|
-
ariaInvalid = computed(() => {
|
|
865
|
-
const fieldState = this.field()();
|
|
866
|
-
return fieldState.invalid() && fieldState.touched();
|
|
867
|
-
}, ...(ngDevMode ? [{ debugName: "ariaInvalid" }] : /* istanbul ignore next */ []));
|
|
868
|
-
/** Whether the field has a required validator */
|
|
869
|
-
ariaRequired = computed(() => {
|
|
870
|
-
return this.field()().required?.() === true ? true : null;
|
|
871
|
-
}, ...(ngDevMode ? [{ debugName: "ariaRequired" }] : /* istanbul ignore next */ []));
|
|
872
|
-
/** aria-describedby linking to hint OR error elements (mutually exclusive) */
|
|
873
|
-
ariaDescribedBy = createAriaDescribedBySignal(this.errorsToDisplay, this.errorId, this.hintId, () => !!this.props()?.hint);
|
|
874
595
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicRadioFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
875
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicRadioFieldComponent, isStandalone: true, selector: "df-ion-radio", inputs: {
|
|
876
|
-
@let f = field();
|
|
877
|
-
@let radioGroupId = key() + '-radio-group';
|
|
878
|
-
@if (label(); as label) {
|
|
596
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicRadioFieldComponent, isStandalone: true, selector: "df-ion-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: `
|
|
597
|
+
@let f = ngf.field();
|
|
598
|
+
@let radioGroupId = ngf.key() + '-radio-group';
|
|
599
|
+
@if (ngf.label(); as label) {
|
|
879
600
|
<div class="radio-label">{{ label | dynamicText | async }}</div>
|
|
880
601
|
}
|
|
881
602
|
|
|
@@ -883,13 +604,14 @@ class IonicRadioFieldComponent {
|
|
|
883
604
|
[id]="radioGroupId"
|
|
884
605
|
[formField]="f"
|
|
885
606
|
[compareWith]="props()?.compareWith || defaultCompare"
|
|
886
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
887
|
-
[attr.aria-required]="ariaRequired()"
|
|
888
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
607
|
+
[attr.aria-invalid]="ngf.ariaInvalid()"
|
|
608
|
+
[attr.aria-required]="ngf.ariaRequired()"
|
|
609
|
+
[attr.aria-describedby]="ngf.ariaDescribedBy()"
|
|
889
610
|
>
|
|
890
611
|
@for (option of options(); track option.value) {
|
|
891
612
|
<ion-item [lines]="'none'">
|
|
892
613
|
<ion-radio
|
|
614
|
+
ngForgeControl
|
|
893
615
|
[value]="option.value"
|
|
894
616
|
[disabled]="option.disabled || false"
|
|
895
617
|
[labelPlacement]="props()?.labelPlacement ?? 'end'"
|
|
@@ -902,19 +624,19 @@ class IonicRadioFieldComponent {
|
|
|
902
624
|
}
|
|
903
625
|
</ion-radio-group>
|
|
904
626
|
|
|
905
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
906
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
627
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
628
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
907
629
|
} @else if (props()?.hint; as hint) {
|
|
908
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
630
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
909
631
|
}
|
|
910
|
-
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}.radio-label{font-size:.875rem;font-weight:500;margin-bottom:.5rem;color:var(--ion-text-color)}\n"], dependencies: [{ kind: "component", type: IonRadioGroup, selector: "ion-radio-group", inputs: ["allowEmptySelection", "compareWith", "errorText", "helperText", "name", "value"] }, { kind: "component", type: IonRadio, selector: "ion-radio", inputs: ["alignment", "color", "disabled", "justify", "labelPlacement", "mode", "name", "value"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { 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 });
|
|
632
|
+
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}.radio-label{font-size:.875rem;font-weight:500;margin-bottom:.5rem;color:var(--ion-text-color)}\n"], dependencies: [{ kind: "component", type: IonRadioGroup, selector: "ion-radio-group", inputs: ["allowEmptySelection", "compareWith", "errorText", "helperText", "name", "value"] }, { kind: "component", type: IonRadio, selector: "ion-radio", inputs: ["alignment", "color", "disabled", "justify", "labelPlacement", "mode", "name", "value"] }, { kind: "component", type: IonItem, selector: "ion-item", inputs: ["button", "color", "detail", "detailIcon", "disabled", "download", "href", "lines", "mode", "rel", "routerAnimation", "routerDirection", "target", "type"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { 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 });
|
|
911
633
|
}
|
|
912
634
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicRadioFieldComponent, decorators: [{
|
|
913
635
|
type: Component,
|
|
914
|
-
args: [{ selector: 'df-ion-radio', imports: [IonRadioGroup, IonRadio, IonItem, IonNote, FormField, DynamicTextPipe, AsyncPipe], template: `
|
|
915
|
-
@let f = field();
|
|
916
|
-
@let radioGroupId = key() + '-radio-group';
|
|
917
|
-
@if (label(); as label) {
|
|
636
|
+
args: [{ selector: 'df-ion-radio', imports: [IonRadioGroup, IonRadio, IonItem, IonNote, FormField, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
637
|
+
@let f = ngf.field();
|
|
638
|
+
@let radioGroupId = ngf.key() + '-radio-group';
|
|
639
|
+
@if (ngf.label(); as label) {
|
|
918
640
|
<div class="radio-label">{{ label | dynamicText | async }}</div>
|
|
919
641
|
}
|
|
920
642
|
|
|
@@ -922,13 +644,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
922
644
|
[id]="radioGroupId"
|
|
923
645
|
[formField]="f"
|
|
924
646
|
[compareWith]="props()?.compareWith || defaultCompare"
|
|
925
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
926
|
-
[attr.aria-required]="ariaRequired()"
|
|
927
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
647
|
+
[attr.aria-invalid]="ngf.ariaInvalid()"
|
|
648
|
+
[attr.aria-required]="ngf.ariaRequired()"
|
|
649
|
+
[attr.aria-describedby]="ngf.ariaDescribedBy()"
|
|
928
650
|
>
|
|
929
651
|
@for (option of options(); track option.value) {
|
|
930
652
|
<ion-item [lines]="'none'">
|
|
931
653
|
<ion-radio
|
|
654
|
+
ngForgeControl
|
|
932
655
|
[value]="option.value"
|
|
933
656
|
[disabled]="option.disabled || false"
|
|
934
657
|
[labelPlacement]="props()?.labelPlacement ?? 'end'"
|
|
@@ -941,18 +664,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
941
664
|
}
|
|
942
665
|
</ion-radio-group>
|
|
943
666
|
|
|
944
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
945
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
667
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
668
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
946
669
|
} @else if (props()?.hint; as hint) {
|
|
947
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
670
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
948
671
|
}
|
|
949
|
-
`, host: {
|
|
950
|
-
|
|
951
|
-
'[id]': '`${key()}`',
|
|
952
|
-
'[attr.data-testid]': 'key()',
|
|
953
|
-
'[attr.hidden]': 'field()().hidden() || null',
|
|
954
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}.radio-label{font-size:.875rem;font-weight:500;margin-bottom:.5rem;color:var(--ion-text-color)}\n"] }]
|
|
955
|
-
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], validationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "validationMessages", required: false }] }], defaultValidationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValidationMessages", required: false }] }] } });
|
|
672
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}.radio-label{font-size:.875rem;font-weight:500;margin-bottom:.5rem;color:var(--ion-text-color)}\n"] }]
|
|
673
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
956
674
|
|
|
957
675
|
var ionicRadio_component = /*#__PURE__*/Object.freeze({
|
|
958
676
|
__proto__: null,
|
|
@@ -960,54 +678,22 @@ var ionicRadio_component = /*#__PURE__*/Object.freeze({
|
|
|
960
678
|
});
|
|
961
679
|
|
|
962
680
|
class IonicSelectFieldComponent {
|
|
963
|
-
|
|
964
|
-
field = input.required(...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
|
|
965
|
-
key = input.required(...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
966
|
-
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
967
|
-
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
968
|
-
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
969
|
-
tabIndex = input(...(ngDevMode ? [undefined, { debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
681
|
+
ngf = injectNgForgeField();
|
|
970
682
|
options = input([], ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
|
|
971
683
|
props = input(...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
972
|
-
meta = input(...(ngDevMode ? [undefined, { debugName: "meta" }] : /* istanbul ignore next */ []));
|
|
973
|
-
validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
|
|
974
|
-
defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
|
|
975
|
-
constructor() {
|
|
976
|
-
setupMetaTracking(this.elementRef, this.meta, { selector: 'ion-select' });
|
|
977
|
-
}
|
|
978
|
-
resolvedErrors = createResolvedErrorsSignal(this.field, this.validationMessages, this.defaultValidationMessages);
|
|
979
|
-
showErrors = shouldShowErrors(this.field);
|
|
980
|
-
errorsToDisplay = computed(() => (this.showErrors() ? this.resolvedErrors() : []), ...(ngDevMode ? [{ debugName: "errorsToDisplay" }] : /* istanbul ignore next */ []));
|
|
981
684
|
defaultCompare = Object.is;
|
|
982
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
983
|
-
// Accessibility
|
|
984
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
985
|
-
/** Base ID for error elements */
|
|
986
|
-
errorId = computed(() => `${this.key()}-error`, ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
987
|
-
/** Unique ID for the helper text element */
|
|
988
|
-
hintId = computed(() => `${this.key()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
989
|
-
/** Whether the field is currently in an invalid state (invalid AND touched) */
|
|
990
|
-
ariaInvalid = computed(() => {
|
|
991
|
-
const fieldState = this.field()();
|
|
992
|
-
return fieldState.invalid() && fieldState.touched();
|
|
993
|
-
}, ...(ngDevMode ? [{ debugName: "ariaInvalid" }] : /* istanbul ignore next */ []));
|
|
994
|
-
/** Whether the field has a required validator */
|
|
995
|
-
ariaRequired = computed(() => {
|
|
996
|
-
return this.field()().required?.() === true ? true : null;
|
|
997
|
-
}, ...(ngDevMode ? [{ debugName: "ariaRequired" }] : /* istanbul ignore next */ []));
|
|
998
|
-
/** aria-describedby linking to hint OR error elements (mutually exclusive) */
|
|
999
|
-
ariaDescribedBy = createAriaDescribedBySignal(this.errorsToDisplay, this.errorId, this.hintId, () => !!this.props()?.hint);
|
|
1000
685
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicSelectFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1001
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicSelectFieldComponent, isStandalone: true, selector: "df-ion-select", inputs: {
|
|
1002
|
-
@let f = field();
|
|
1003
|
-
@let selectId = key() + '-select';
|
|
686
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicSelectFieldComponent, isStandalone: true, selector: "df-ion-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: `
|
|
687
|
+
@let f = ngf.field();
|
|
688
|
+
@let selectId = ngf.key() + '-select';
|
|
1004
689
|
|
|
1005
690
|
<ion-select
|
|
691
|
+
ngForgeControl
|
|
1006
692
|
[id]="selectId"
|
|
1007
693
|
[formField]="f"
|
|
1008
|
-
[label]="(label() | dynamicText | async) ?? undefined"
|
|
694
|
+
[label]="(ngf.label() | dynamicText | async) ?? undefined"
|
|
1009
695
|
[labelPlacement]="props()?.labelPlacement ?? 'stacked'"
|
|
1010
|
-
[placeholder]="(placeholder() | dynamicText | async) ?? ''"
|
|
696
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
1011
697
|
[multiple]="props()?.multiple ?? false"
|
|
1012
698
|
[compareWith]="props()?.compareWith ?? defaultCompare"
|
|
1013
699
|
[interface]="props()?.interface ?? 'alert'"
|
|
@@ -1017,10 +703,7 @@ class IonicSelectFieldComponent {
|
|
|
1017
703
|
[color]="props()?.color"
|
|
1018
704
|
[fill]="props()?.fill ?? 'outline'"
|
|
1019
705
|
[shape]="props()?.shape"
|
|
1020
|
-
[attr.tabindex]="tabIndex()"
|
|
1021
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
1022
|
-
[attr.aria-required]="ariaRequired()"
|
|
1023
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
706
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
1024
707
|
>
|
|
1025
708
|
@for (option of options(); track option.value) {
|
|
1026
709
|
<ion-select-option [value]="option.value" [disabled]="option.disabled || false">
|
|
@@ -1028,25 +711,26 @@ class IonicSelectFieldComponent {
|
|
|
1028
711
|
</ion-select-option>
|
|
1029
712
|
}
|
|
1030
713
|
</ion-select>
|
|
1031
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
1032
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
714
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
715
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
1033
716
|
} @else if (props()?.hint; as hint) {
|
|
1034
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
717
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
1035
718
|
}
|
|
1036
|
-
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonSelect, selector: "ion-select", inputs: ["cancelText", "color", "compareWith", "disabled", "errorText", "expandedIcon", "fill", "helperText", "interface", "interfaceOptions", "justify", "label", "labelPlacement", "mode", "multiple", "name", "okText", "placeholder", "selectedText", "shape", "toggleIcon", "value"] }, { kind: "component", type: IonSelectOption, selector: "ion-select-option", inputs: ["disabled", "value"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { 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 });
|
|
719
|
+
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonSelect, selector: "ion-select", inputs: ["cancelText", "color", "compareWith", "disabled", "errorText", "expandedIcon", "fill", "helperText", "interface", "interfaceOptions", "justify", "label", "labelPlacement", "mode", "multiple", "name", "okText", "placeholder", "selectedText", "shape", "toggleIcon", "value"] }, { kind: "component", type: IonSelectOption, selector: "ion-select-option", inputs: ["disabled", "value"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { 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 });
|
|
1037
720
|
}
|
|
1038
721
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicSelectFieldComponent, decorators: [{
|
|
1039
722
|
type: Component,
|
|
1040
|
-
args: [{ selector: 'df-ion-select', imports: [IonSelect, IonSelectOption, IonNote, FormField, DynamicTextPipe, AsyncPipe], template: `
|
|
1041
|
-
@let f = field();
|
|
1042
|
-
@let selectId = key() + '-select';
|
|
723
|
+
args: [{ selector: 'df-ion-select', imports: [IonSelect, IonSelectOption, IonNote, FormField, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
724
|
+
@let f = ngf.field();
|
|
725
|
+
@let selectId = ngf.key() + '-select';
|
|
1043
726
|
|
|
1044
727
|
<ion-select
|
|
728
|
+
ngForgeControl
|
|
1045
729
|
[id]="selectId"
|
|
1046
730
|
[formField]="f"
|
|
1047
|
-
[label]="(label() | dynamicText | async) ?? undefined"
|
|
731
|
+
[label]="(ngf.label() | dynamicText | async) ?? undefined"
|
|
1048
732
|
[labelPlacement]="props()?.labelPlacement ?? 'stacked'"
|
|
1049
|
-
[placeholder]="(placeholder() | dynamicText | async) ?? ''"
|
|
733
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
1050
734
|
[multiple]="props()?.multiple ?? false"
|
|
1051
735
|
[compareWith]="props()?.compareWith ?? defaultCompare"
|
|
1052
736
|
[interface]="props()?.interface ?? 'alert'"
|
|
@@ -1056,10 +740,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1056
740
|
[color]="props()?.color"
|
|
1057
741
|
[fill]="props()?.fill ?? 'outline'"
|
|
1058
742
|
[shape]="props()?.shape"
|
|
1059
|
-
[attr.tabindex]="tabIndex()"
|
|
1060
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
1061
|
-
[attr.aria-required]="ariaRequired()"
|
|
1062
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
743
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
1063
744
|
>
|
|
1064
745
|
@for (option of options(); track option.value) {
|
|
1065
746
|
<ion-select-option [value]="option.value" [disabled]="option.disabled || false">
|
|
@@ -1067,18 +748,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1067
748
|
</ion-select-option>
|
|
1068
749
|
}
|
|
1069
750
|
</ion-select>
|
|
1070
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
1071
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
751
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
752
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
1072
753
|
} @else if (props()?.hint; as hint) {
|
|
1073
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
754
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
1074
755
|
}
|
|
1075
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1076
|
-
|
|
1077
|
-
'[attr.data-testid]': 'key()',
|
|
1078
|
-
'[class]': 'className()',
|
|
1079
|
-
'[attr.hidden]': 'field()().hidden() || null',
|
|
1080
|
-
}, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host([hidden]){display:none!important}\n"] }]
|
|
1081
|
-
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], validationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "validationMessages", required: false }] }], defaultValidationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValidationMessages", required: false }] }] } });
|
|
756
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host([hidden]){display:none!important}\n"] }]
|
|
757
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1082
758
|
|
|
1083
759
|
var ionicSelect_component = /*#__PURE__*/Object.freeze({
|
|
1084
760
|
__proto__: null,
|
|
@@ -1086,52 +762,19 @@ var ionicSelect_component = /*#__PURE__*/Object.freeze({
|
|
|
1086
762
|
});
|
|
1087
763
|
|
|
1088
764
|
class IonicSliderFieldComponent {
|
|
1089
|
-
|
|
1090
|
-
field = input.required(...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
|
|
1091
|
-
key = input.required(...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
1092
|
-
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1093
|
-
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
1094
|
-
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
1095
|
-
tabIndex = input(...(ngDevMode ? [undefined, { debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
765
|
+
ngf = injectNgForgeField();
|
|
1096
766
|
step = input(...(ngDevMode ? [undefined, { debugName: "step" }] : /* istanbul ignore next */ []));
|
|
1097
767
|
props = input(...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
1098
|
-
meta = input(...(ngDevMode ? [undefined, { debugName: "meta" }] : /* istanbul ignore next */ []));
|
|
1099
|
-
validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
|
|
1100
|
-
defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
|
|
1101
|
-
constructor() {
|
|
1102
|
-
setupMetaTracking(this.elementRef, this.meta);
|
|
1103
|
-
}
|
|
1104
|
-
resolvedErrors = createResolvedErrorsSignal(this.field, this.validationMessages, this.defaultValidationMessages);
|
|
1105
|
-
showErrors = shouldShowErrors(this.field);
|
|
1106
|
-
errorsToDisplay = computed(() => (this.showErrors() ? this.resolvedErrors() : []), ...(ngDevMode ? [{ debugName: "errorsToDisplay" }] : /* istanbul ignore next */ []));
|
|
1107
768
|
defaultPinFormatter = (value) => String(value);
|
|
1108
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
1109
|
-
// Accessibility
|
|
1110
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
1111
|
-
/** Base ID for error elements */
|
|
1112
|
-
errorId = computed(() => `${this.key()}-error`, ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
1113
|
-
/** Unique ID for the helper text element */
|
|
1114
|
-
hintId = computed(() => `${this.key()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
1115
|
-
/** Whether the field is currently in an invalid state (invalid AND touched) */
|
|
1116
|
-
ariaInvalid = computed(() => {
|
|
1117
|
-
const fieldState = this.field()();
|
|
1118
|
-
return fieldState.invalid() && fieldState.touched();
|
|
1119
|
-
}, ...(ngDevMode ? [{ debugName: "ariaInvalid" }] : /* istanbul ignore next */ []));
|
|
1120
|
-
/** Whether the field has a required validator */
|
|
1121
|
-
ariaRequired = computed(() => {
|
|
1122
|
-
return this.field()().required?.() === true ? true : null;
|
|
1123
|
-
}, ...(ngDevMode ? [{ debugName: "ariaRequired" }] : /* istanbul ignore next */ []));
|
|
1124
|
-
/** aria-describedby linking to hint OR error elements (mutually exclusive) */
|
|
1125
|
-
ariaDescribedBy = createAriaDescribedBySignal(this.errorsToDisplay, this.errorId, this.hintId, () => !!this.props()?.hint);
|
|
1126
769
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicSliderFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1127
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicSliderFieldComponent, isStandalone: true, selector: "df-ion-slider", inputs: {
|
|
1128
|
-
@let f = field();
|
|
1129
|
-
@let inputId = key() + '-input';
|
|
770
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicSliderFieldComponent, isStandalone: true, selector: "df-ion-slider", inputs: { 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 }, { directive: i1.NgForgeHostControl }], ngImport: i0, template: `
|
|
771
|
+
@let f = ngf.field();
|
|
772
|
+
@let inputId = ngf.key() + '-input';
|
|
1130
773
|
|
|
1131
774
|
<ion-range
|
|
1132
775
|
[id]="inputId"
|
|
1133
776
|
[formField]="f"
|
|
1134
|
-
[label]="(label() | dynamicText | async) ?? undefined"
|
|
777
|
+
[label]="(ngf.label() | dynamicText | async) ?? undefined"
|
|
1135
778
|
[labelPlacement]="props()?.labelPlacement ?? 'stacked'"
|
|
1136
779
|
[min]="f().min?.() ?? props()?.min ?? 0"
|
|
1137
780
|
[max]="f().max?.() ?? props()?.max ?? 100"
|
|
@@ -1142,29 +785,25 @@ class IonicSliderFieldComponent {
|
|
|
1142
785
|
[ticks]="props()?.ticks ?? false"
|
|
1143
786
|
[snaps]="props()?.snaps ?? false"
|
|
1144
787
|
[color]="props()?.color ?? 'primary'"
|
|
1145
|
-
[attr.tabindex]="tabIndex()"
|
|
1146
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
1147
|
-
[attr.aria-required]="ariaRequired()"
|
|
1148
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
1149
788
|
/>
|
|
1150
789
|
|
|
1151
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
1152
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
790
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
791
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
1153
792
|
} @else if (props()?.hint; as hint) {
|
|
1154
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
793
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
1155
794
|
}
|
|
1156
795
|
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonRange, selector: "ion-range", inputs: ["activeBarStart", "color", "debounce", "disabled", "dualKnobs", "label", "labelPlacement", "max", "min", "mode", "name", "pin", "pinFormatter", "snaps", "step", "ticks", "value"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { 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 });
|
|
1157
796
|
}
|
|
1158
797
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicSliderFieldComponent, decorators: [{
|
|
1159
798
|
type: Component,
|
|
1160
|
-
args: [{ selector: 'df-ion-slider', imports: [IonRange, IonNote, FormField, DynamicTextPipe, AsyncPipe], template: `
|
|
1161
|
-
@let f = field();
|
|
1162
|
-
@let inputId = key() + '-input';
|
|
799
|
+
args: [{ selector: 'df-ion-slider', imports: [IonRange, IonNote, FormField, DynamicTextPipe, AsyncPipe], hostDirectives: [NgForgeFieldHost, NgForgeHostControl], template: `
|
|
800
|
+
@let f = ngf.field();
|
|
801
|
+
@let inputId = ngf.key() + '-input';
|
|
1163
802
|
|
|
1164
803
|
<ion-range
|
|
1165
804
|
[id]="inputId"
|
|
1166
805
|
[formField]="f"
|
|
1167
|
-
[label]="(label() | dynamicText | async) ?? undefined"
|
|
806
|
+
[label]="(ngf.label() | dynamicText | async) ?? undefined"
|
|
1168
807
|
[labelPlacement]="props()?.labelPlacement ?? 'stacked'"
|
|
1169
808
|
[min]="f().min?.() ?? props()?.min ?? 0"
|
|
1170
809
|
[max]="f().max?.() ?? props()?.max ?? 100"
|
|
@@ -1175,24 +814,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1175
814
|
[ticks]="props()?.ticks ?? false"
|
|
1176
815
|
[snaps]="props()?.snaps ?? false"
|
|
1177
816
|
[color]="props()?.color ?? 'primary'"
|
|
1178
|
-
[attr.tabindex]="tabIndex()"
|
|
1179
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
1180
|
-
[attr.aria-required]="ariaRequired()"
|
|
1181
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
1182
817
|
/>
|
|
1183
818
|
|
|
1184
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
1185
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
819
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
820
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
1186
821
|
} @else if (props()?.hint; as hint) {
|
|
1187
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
822
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
1188
823
|
}
|
|
1189
|
-
`, host: {
|
|
1190
|
-
|
|
1191
|
-
'[id]': '`${key()}`',
|
|
1192
|
-
'[attr.data-testid]': 'key()',
|
|
1193
|
-
'[attr.hidden]': 'field()().hidden() || null',
|
|
1194
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}\n"] }]
|
|
1195
|
-
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], validationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "validationMessages", required: false }] }], defaultValidationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValidationMessages", required: false }] }] } });
|
|
824
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}\n"] }]
|
|
825
|
+
}], propDecorators: { step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1196
826
|
|
|
1197
827
|
var ionicSlider_component = /*#__PURE__*/Object.freeze({
|
|
1198
828
|
__proto__: null,
|
|
@@ -1201,28 +831,13 @@ var ionicSlider_component = /*#__PURE__*/Object.freeze({
|
|
|
1201
831
|
|
|
1202
832
|
class IonicTextareaFieldComponent {
|
|
1203
833
|
elementRef = inject((ElementRef));
|
|
1204
|
-
|
|
1205
|
-
key = input.required(...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
1206
|
-
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1207
|
-
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
1208
|
-
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
1209
|
-
tabIndex = input(...(ngDevMode ? [undefined, { debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
834
|
+
ngf = injectNgForgeField();
|
|
1210
835
|
props = input(...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
1211
|
-
meta = input(...(ngDevMode ? [undefined, { debugName: "meta" }] : /* istanbul ignore next */ []));
|
|
1212
|
-
validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
|
|
1213
|
-
defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
|
|
1214
|
-
resolvedErrors = createResolvedErrorsSignal(this.field, this.validationMessages, this.defaultValidationMessages);
|
|
1215
|
-
showErrors = shouldShowErrors(this.field);
|
|
1216
|
-
errorsToDisplay = computed(() => (this.showErrors() ? this.resolvedErrors() : []), ...(ngDevMode ? [{ debugName: "errorsToDisplay" }] : /* istanbul ignore next */ []));
|
|
1217
836
|
constructor() {
|
|
1218
|
-
// Shadow DOM - apply meta to ion-textarea element
|
|
1219
|
-
setupMetaTracking(this.elementRef, this.meta, {
|
|
1220
|
-
selector: 'ion-textarea',
|
|
1221
|
-
});
|
|
1222
837
|
// ion-textarea encapsulates a native <textarea> in shadow DOM and does not automatically
|
|
1223
838
|
// propagate aria-describedby to it. This effect imperatively syncs the attribute
|
|
1224
839
|
// after a microtask to ensure Ionic has resolved the internal element.
|
|
1225
|
-
explicitEffect([this.ariaDescribedBy], ([describedBy]) => {
|
|
840
|
+
explicitEffect([this.ngf.ariaDescribedBy], ([describedBy]) => {
|
|
1226
841
|
queueMicrotask(() => {
|
|
1227
842
|
const ionTextarea = this.elementRef.nativeElement.querySelector('ion-textarea');
|
|
1228
843
|
if (ionTextarea?.getInputElement) {
|
|
@@ -1240,35 +855,18 @@ class IonicTextareaFieldComponent {
|
|
|
1240
855
|
});
|
|
1241
856
|
});
|
|
1242
857
|
}
|
|
1243
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
1244
|
-
// Accessibility
|
|
1245
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
1246
|
-
/** Base ID for error elements */
|
|
1247
|
-
errorId = computed(() => `${this.key()}-error`, ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
1248
|
-
/** Unique ID for the helper text element */
|
|
1249
|
-
hintId = computed(() => `${this.key()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
1250
|
-
/** Whether the field is currently in an invalid state (invalid AND touched) */
|
|
1251
|
-
ariaInvalid = computed(() => {
|
|
1252
|
-
const fieldState = this.field()();
|
|
1253
|
-
return fieldState.invalid() && fieldState.touched();
|
|
1254
|
-
}, ...(ngDevMode ? [{ debugName: "ariaInvalid" }] : /* istanbul ignore next */ []));
|
|
1255
|
-
/** Whether the field has a required validator */
|
|
1256
|
-
ariaRequired = computed(() => {
|
|
1257
|
-
return this.field()().required?.() === true ? true : null;
|
|
1258
|
-
}, ...(ngDevMode ? [{ debugName: "ariaRequired" }] : /* istanbul ignore next */ []));
|
|
1259
|
-
/** aria-describedby linking to hint OR error elements (mutually exclusive) */
|
|
1260
|
-
ariaDescribedBy = createAriaDescribedBySignal(this.errorsToDisplay, this.errorId, this.hintId, () => !!this.props()?.hint);
|
|
1261
858
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicTextareaFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1262
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicTextareaFieldComponent, isStandalone: true, selector: "df-ion-textarea", inputs: {
|
|
1263
|
-
@let f = field();
|
|
1264
|
-
@let textareaId = key() + '-textarea';
|
|
859
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicTextareaFieldComponent, isStandalone: true, selector: "df-ion-textarea", inputs: { props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
860
|
+
@let f = ngf.field();
|
|
861
|
+
@let textareaId = ngf.key() + '-textarea';
|
|
1265
862
|
|
|
1266
863
|
<ion-textarea
|
|
864
|
+
ngForgeControl
|
|
1267
865
|
[id]="textareaId"
|
|
1268
866
|
[formField]="f"
|
|
1269
|
-
[label]="(label() | dynamicText | async) ?? undefined"
|
|
867
|
+
[label]="(ngf.label() | dynamicText | async) ?? undefined"
|
|
1270
868
|
[labelPlacement]="props()?.labelPlacement ?? 'stacked'"
|
|
1271
|
-
[placeholder]="(placeholder() | dynamicText | async) ?? ''"
|
|
869
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
1272
870
|
[rows]="props()?.rows ?? 4"
|
|
1273
871
|
[autoGrow]="props()?.autoGrow ?? false"
|
|
1274
872
|
[counter]="props()?.counter ?? false"
|
|
@@ -1278,29 +876,27 @@ class IonicTextareaFieldComponent {
|
|
|
1278
876
|
[fill]="props()?.fill ?? 'outline'"
|
|
1279
877
|
[shape]="props()?.shape"
|
|
1280
878
|
[readonly]="f().readonly()"
|
|
1281
|
-
[helperText]="errorsToDisplay().length === 0 ? ((props()?.hint | dynamicText | async) ?? undefined) : undefined"
|
|
1282
|
-
[attr.tabindex]="tabIndex()"
|
|
1283
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
1284
|
-
[attr.aria-required]="ariaRequired()"
|
|
1285
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
879
|
+
[helperText]="ngf.errorsToDisplay().length === 0 ? ((props()?.hint | dynamicText | async) ?? undefined) : undefined"
|
|
880
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
1286
881
|
/>
|
|
1287
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
1288
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
882
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
883
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
1289
884
|
}
|
|
1290
|
-
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonTextarea, selector: "ion-textarea", inputs: ["autoGrow", "autocapitalize", "autofocus", "clearOnEdit", "color", "cols", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "maxlength", "minlength", "mode", "name", "placeholder", "readonly", "required", "rows", "shape", "spellcheck", "value", "wrap"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { 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 });
|
|
885
|
+
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonTextarea, selector: "ion-textarea", inputs: ["autoGrow", "autocapitalize", "autofocus", "clearOnEdit", "color", "cols", "counter", "counterFormatter", "debounce", "disabled", "enterkeyhint", "errorText", "fill", "helperText", "inputmode", "label", "labelPlacement", "maxlength", "minlength", "mode", "name", "placeholder", "readonly", "required", "rows", "shape", "spellcheck", "value", "wrap"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { 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 });
|
|
1291
886
|
}
|
|
1292
887
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicTextareaFieldComponent, decorators: [{
|
|
1293
888
|
type: Component,
|
|
1294
|
-
args: [{ selector: 'df-ion-textarea', imports: [IonTextarea, IonNote, FormField, DynamicTextPipe, AsyncPipe], template: `
|
|
1295
|
-
@let f = field();
|
|
1296
|
-
@let textareaId = key() + '-textarea';
|
|
889
|
+
args: [{ selector: 'df-ion-textarea', imports: [IonTextarea, IonNote, FormField, DynamicTextPipe, AsyncPipe, NgForgeControl], hostDirectives: [NgForgeFieldHost], template: `
|
|
890
|
+
@let f = ngf.field();
|
|
891
|
+
@let textareaId = ngf.key() + '-textarea';
|
|
1297
892
|
|
|
1298
893
|
<ion-textarea
|
|
894
|
+
ngForgeControl
|
|
1299
895
|
[id]="textareaId"
|
|
1300
896
|
[formField]="f"
|
|
1301
|
-
[label]="(label() | dynamicText | async) ?? undefined"
|
|
897
|
+
[label]="(ngf.label() | dynamicText | async) ?? undefined"
|
|
1302
898
|
[labelPlacement]="props()?.labelPlacement ?? 'stacked'"
|
|
1303
|
-
[placeholder]="(placeholder() | dynamicText | async) ?? ''"
|
|
899
|
+
[placeholder]="(ngf.placeholder() | dynamicText | async) ?? ''"
|
|
1304
900
|
[rows]="props()?.rows ?? 4"
|
|
1305
901
|
[autoGrow]="props()?.autoGrow ?? false"
|
|
1306
902
|
[counter]="props()?.counter ?? false"
|
|
@@ -1310,22 +906,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1310
906
|
[fill]="props()?.fill ?? 'outline'"
|
|
1311
907
|
[shape]="props()?.shape"
|
|
1312
908
|
[readonly]="f().readonly()"
|
|
1313
|
-
[helperText]="errorsToDisplay().length === 0 ? ((props()?.hint | dynamicText | async) ?? undefined) : undefined"
|
|
1314
|
-
[attr.tabindex]="tabIndex()"
|
|
1315
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
1316
|
-
[attr.aria-required]="ariaRequired()"
|
|
1317
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
909
|
+
[helperText]="ngf.errorsToDisplay().length === 0 ? ((props()?.hint | dynamicText | async) ?? undefined) : undefined"
|
|
910
|
+
[attr.tabindex]="ngf.tabIndex()"
|
|
1318
911
|
/>
|
|
1319
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
1320
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
912
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
913
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
1321
914
|
}
|
|
1322
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
1323
|
-
|
|
1324
|
-
'[attr.data-testid]': 'key()',
|
|
1325
|
-
'[class]': 'className()',
|
|
1326
|
-
'[attr.hidden]': 'field()().hidden() || null',
|
|
1327
|
-
}, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host([hidden]){display:none!important}\n"] }]
|
|
1328
|
-
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], validationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "validationMessages", required: false }] }], defaultValidationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValidationMessages", required: false }] }] } });
|
|
915
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host([hidden]){display:none!important}\n"] }]
|
|
916
|
+
}], ctorParameters: () => [], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1329
917
|
|
|
1330
918
|
var ionicTextarea_component = /*#__PURE__*/Object.freeze({
|
|
1331
919
|
__proto__: null,
|
|
@@ -1333,14 +921,11 @@ var ionicTextarea_component = /*#__PURE__*/Object.freeze({
|
|
|
1333
921
|
});
|
|
1334
922
|
|
|
1335
923
|
/**
|
|
1336
|
-
*
|
|
1337
|
-
*
|
|
1338
|
-
*
|
|
1339
|
-
* We use FormCheckboxControl because ion-toggle is a boolean checkbox-like control.
|
|
1340
|
-
* The Field directive binds to the `checked` model for checkbox controls.
|
|
924
|
+
* ion-toggle wrapper implementing FormCheckboxControl. Rendered inside
|
|
925
|
+
* `df-ion-toggle`. `NgForgeControl` on `<ion-toggle>` claims the ambient
|
|
926
|
+
* parent NgForgeField and routes meta + aria onto that element.
|
|
1341
927
|
*/
|
|
1342
928
|
class IonicToggleControlComponent {
|
|
1343
|
-
elementRef = inject((ElementRef));
|
|
1344
929
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
1345
930
|
// FormCheckboxControl implementation
|
|
1346
931
|
// ─────────────────────────────────────────────────────────────────────────────
|
|
@@ -1364,29 +949,9 @@ class IonicToggleControlComponent {
|
|
|
1364
949
|
color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
1365
950
|
enableOnOffLabels = input(false, ...(ngDevMode ? [{ debugName: "enableOnOffLabels" }] : /* istanbul ignore next */ []));
|
|
1366
951
|
tabIndex = input(undefined, ...(ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
// Shadow DOM - apply meta to ion-toggle element
|
|
1371
|
-
setupMetaTracking(this.elementRef, this.meta, {
|
|
1372
|
-
selector: 'ion-toggle',
|
|
1373
|
-
});
|
|
1374
|
-
}
|
|
1375
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
1376
|
-
// Computed ARIA attributes
|
|
1377
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
1378
|
-
/** aria-invalid: true when field is invalid AND touched */
|
|
1379
|
-
ariaInvalid = computed(() => {
|
|
1380
|
-
return this.invalid() && this.touched();
|
|
1381
|
-
}, ...(ngDevMode ? [{ debugName: "ariaInvalid" }] : /* istanbul ignore next */ []));
|
|
1382
|
-
/** aria-required: true if field is required, null otherwise */
|
|
1383
|
-
ariaRequired = computed(() => {
|
|
1384
|
-
return this.required() ? true : null;
|
|
1385
|
-
}, ...(ngDevMode ? [{ debugName: "ariaRequired" }] : /* istanbul ignore next */ []));
|
|
1386
|
-
/** aria-readonly: true if field is readonly, null otherwise */
|
|
1387
|
-
ariaReadonly = computed(() => {
|
|
1388
|
-
return this.readonly() ? true : null;
|
|
1389
|
-
}, ...(ngDevMode ? [{ debugName: "ariaReadonly" }] : /* istanbul ignore next */ []));
|
|
952
|
+
// aria-invalid / aria-required / aria-describedby are written to <ion-toggle>
|
|
953
|
+
// by NgForgeControl. aria-readonly is Ionic-specific and stays template-side.
|
|
954
|
+
ariaReadonly = computed(() => (this.readonly() ? true : null), ...(ngDevMode ? [{ debugName: "ariaReadonly" }] : /* istanbul ignore next */ []));
|
|
1390
955
|
/** Computed checked state - ensures proper boolean conversion for ion-toggle */
|
|
1391
956
|
isChecked = computed(() => {
|
|
1392
957
|
return this.checked() === true;
|
|
@@ -1410,8 +975,9 @@ class IonicToggleControlComponent {
|
|
|
1410
975
|
this.touched.set(true);
|
|
1411
976
|
}
|
|
1412
977
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicToggleControlComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1413
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: IonicToggleControlComponent, isStandalone: true, selector: "df-ion-toggle-control", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", 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 }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, labelPlacement: { classPropertyName: "labelPlacement", publicName: "labelPlacement", isSignal: true, isRequired: false, transformFunction: null }, justify: { classPropertyName: "justify", publicName: "justify", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, enableOnOffLabels: { classPropertyName: "enableOnOffLabels", publicName: "enableOnOffLabels", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null }
|
|
978
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.8", type: IonicToggleControlComponent, isStandalone: true, selector: "df-ion-toggle-control", inputs: { checked: { classPropertyName: "checked", publicName: "checked", isSignal: true, isRequired: false, transformFunction: null }, touched: { classPropertyName: "touched", publicName: "touched", 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 }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, labelPlacement: { classPropertyName: "labelPlacement", publicName: "labelPlacement", isSignal: true, isRequired: false, transformFunction: null }, justify: { classPropertyName: "justify", publicName: "justify", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, enableOnOffLabels: { classPropertyName: "enableOnOffLabels", publicName: "enableOnOffLabels", isSignal: true, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", touched: "touchedChange" }, host: { styleAttribute: "display: block" }, ngImport: i0, template: `
|
|
1414
979
|
<ion-toggle
|
|
980
|
+
ngForgeControl
|
|
1415
981
|
[checked]="isChecked()"
|
|
1416
982
|
(ionChange)="onToggleChange($event)"
|
|
1417
983
|
(ionBlur)="onBlur()"
|
|
@@ -1421,19 +987,17 @@ class IonicToggleControlComponent {
|
|
|
1421
987
|
[enableOnOffLabels]="enableOnOffLabels()"
|
|
1422
988
|
[disabled]="isEffectivelyDisabled()"
|
|
1423
989
|
[attr.tabindex]="tabIndex()"
|
|
1424
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
1425
|
-
[attr.aria-required]="ariaRequired()"
|
|
1426
990
|
[attr.aria-readonly]="ariaReadonly()"
|
|
1427
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
1428
991
|
>
|
|
1429
992
|
<ng-content />
|
|
1430
993
|
</ion-toggle>
|
|
1431
|
-
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n"], dependencies: [{ kind: "component", type: IonToggle, selector: "ion-toggle", inputs: ["checked", "color", "disabled", "enableOnOffLabels", "errorText", "helperText", "justify", "labelPlacement", "mode", "name", "value"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
994
|
+
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n"], dependencies: [{ kind: "component", type: IonToggle, selector: "ion-toggle", inputs: ["checked", "color", "disabled", "enableOnOffLabels", "errorText", "helperText", "justify", "labelPlacement", "mode", "name", "value"] }, { kind: "directive", type: NgForgeControl, selector: "[ngForgeControl]", inputs: ["ngForgeControl"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1432
995
|
}
|
|
1433
996
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicToggleControlComponent, decorators: [{
|
|
1434
997
|
type: Component,
|
|
1435
|
-
args: [{ selector: 'df-ion-toggle-control', imports: [IonToggle], template: `
|
|
998
|
+
args: [{ selector: 'df-ion-toggle-control', imports: [IonToggle, NgForgeControl], template: `
|
|
1436
999
|
<ion-toggle
|
|
1000
|
+
ngForgeControl
|
|
1437
1001
|
[checked]="isChecked()"
|
|
1438
1002
|
(ionChange)="onToggleChange($event)"
|
|
1439
1003
|
(ionBlur)="onBlur()"
|
|
@@ -1443,104 +1007,67 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImpor
|
|
|
1443
1007
|
[enableOnOffLabels]="enableOnOffLabels()"
|
|
1444
1008
|
[disabled]="isEffectivelyDisabled()"
|
|
1445
1009
|
[attr.tabindex]="tabIndex()"
|
|
1446
|
-
[attr.aria-invalid]="ariaInvalid()"
|
|
1447
|
-
[attr.aria-required]="ariaRequired()"
|
|
1448
1010
|
[attr.aria-readonly]="ariaReadonly()"
|
|
1449
|
-
[attr.aria-describedby]="ariaDescribedBy()"
|
|
1450
1011
|
>
|
|
1451
1012
|
<ng-content />
|
|
1452
1013
|
</ion-toggle>
|
|
1453
1014
|
`, host: {
|
|
1454
1015
|
style: 'display: block',
|
|
1455
1016
|
}, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n"] }]
|
|
1456
|
-
}],
|
|
1017
|
+
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], touched: [{ type: i0.Input, args: [{ isSignal: true, alias: "touched", required: false }] }, { type: i0.Output, args: ["touchedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], invalid: [{ type: i0.Input, args: [{ isSignal: true, alias: "invalid", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], labelPlacement: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelPlacement", required: false }] }], justify: [{ type: i0.Input, args: [{ isSignal: true, alias: "justify", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], enableOnOffLabels: [{ type: i0.Input, args: [{ isSignal: true, alias: "enableOnOffLabels", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }] } });
|
|
1457
1018
|
|
|
1458
1019
|
class IonicToggleFieldComponent {
|
|
1459
|
-
|
|
1460
|
-
field = input.required(...(ngDevMode ? [{ debugName: "field" }] : /* istanbul ignore next */ []));
|
|
1461
|
-
key = input.required(...(ngDevMode ? [{ debugName: "key" }] : /* istanbul ignore next */ []));
|
|
1462
|
-
// Properties
|
|
1463
|
-
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1464
|
-
placeholder = input(...(ngDevMode ? [undefined, { debugName: "placeholder" }] : /* istanbul ignore next */ []));
|
|
1465
|
-
className = input('', ...(ngDevMode ? [{ debugName: "className" }] : /* istanbul ignore next */ []));
|
|
1466
|
-
tabIndex = input(...(ngDevMode ? [undefined, { debugName: "tabIndex" }] : /* istanbul ignore next */ []));
|
|
1020
|
+
ngf = injectNgForgeField();
|
|
1467
1021
|
props = input(...(ngDevMode ? [undefined, { debugName: "props" }] : /* istanbul ignore next */ []));
|
|
1468
|
-
meta = input(...(ngDevMode ? [undefined, { debugName: "meta" }] : /* istanbul ignore next */ []));
|
|
1469
|
-
validationMessages = input(...(ngDevMode ? [undefined, { debugName: "validationMessages" }] : /* istanbul ignore next */ []));
|
|
1470
|
-
defaultValidationMessages = input(...(ngDevMode ? [undefined, { debugName: "defaultValidationMessages" }] : /* istanbul ignore next */ []));
|
|
1471
|
-
constructor() {
|
|
1472
|
-
setupMetaTracking(this.elementRef, this.meta);
|
|
1473
|
-
}
|
|
1474
|
-
resolvedErrors = createResolvedErrorsSignal(this.field, this.validationMessages, this.defaultValidationMessages);
|
|
1475
|
-
showErrors = shouldShowErrors(this.field);
|
|
1476
|
-
errorsToDisplay = computed(() => (this.showErrors() ? this.resolvedErrors() : []), ...(ngDevMode ? [{ debugName: "errorsToDisplay" }] : /* istanbul ignore next */ []));
|
|
1477
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
1478
|
-
// Accessibility
|
|
1479
|
-
// ─────────────────────────────────────────────────────────────────────────────
|
|
1480
|
-
/** Base ID for error elements */
|
|
1481
|
-
errorId = computed(() => `${this.key()}-error`, ...(ngDevMode ? [{ debugName: "errorId" }] : /* istanbul ignore next */ []));
|
|
1482
|
-
/** Unique ID for the helper text element */
|
|
1483
|
-
hintId = computed(() => `${this.key()}-hint`, ...(ngDevMode ? [{ debugName: "hintId" }] : /* istanbul ignore next */ []));
|
|
1484
|
-
/** aria-describedby linking to hint OR error elements (mutually exclusive) */
|
|
1485
|
-
ariaDescribedBy = createAriaDescribedBySignal(this.errorsToDisplay, this.errorId, this.hintId, () => !!this.props()?.hint);
|
|
1486
1022
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicToggleFieldComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1487
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicToggleFieldComponent, isStandalone: true, selector: "df-ion-toggle", inputs: {
|
|
1488
|
-
@let f = field();
|
|
1489
|
-
@let toggleId = key() + '-toggle';
|
|
1023
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.8", type: IonicToggleFieldComponent, isStandalone: true, selector: "df-ion-toggle", inputs: { props: { classPropertyName: "props", publicName: "props", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: i1.NgForgeFieldHost }], ngImport: i0, template: `
|
|
1024
|
+
@let f = ngf.field();
|
|
1025
|
+
@let toggleId = ngf.key() + '-toggle';
|
|
1490
1026
|
|
|
1491
1027
|
<df-ion-toggle-control
|
|
1492
1028
|
[id]="toggleId"
|
|
1493
1029
|
[formField]="f"
|
|
1494
|
-
[meta]="meta()"
|
|
1495
1030
|
[labelPlacement]="props()?.labelPlacement ?? 'end'"
|
|
1496
1031
|
[justify]="props()?.justify"
|
|
1497
1032
|
[color]="props()?.color ?? 'primary'"
|
|
1498
1033
|
[enableOnOffLabels]="props()?.enableOnOffLabels ?? false"
|
|
1499
|
-
[tabIndex]="tabIndex()"
|
|
1500
|
-
[ariaDescribedBy]="ariaDescribedBy()"
|
|
1034
|
+
[tabIndex]="ngf.tabIndex()"
|
|
1501
1035
|
>
|
|
1502
|
-
{{ label() | dynamicText | async }}
|
|
1036
|
+
{{ ngf.label() | dynamicText | async }}
|
|
1503
1037
|
</df-ion-toggle-control>
|
|
1504
1038
|
|
|
1505
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
1506
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
1039
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
1040
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
1507
1041
|
} @else if (props()?.hint; as hint) {
|
|
1508
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
1042
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
1509
1043
|
}
|
|
1510
|
-
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonicToggleControlComponent, selector: "df-ion-toggle-control", inputs: ["checked", "touched", "disabled", "readonly", "invalid", "required", "labelPlacement", "justify", "color", "enableOnOffLabels", "tabIndex"
|
|
1044
|
+
`, isInline: true, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}\n"], dependencies: [{ kind: "component", type: IonicToggleControlComponent, selector: "df-ion-toggle-control", inputs: ["checked", "touched", "disabled", "readonly", "invalid", "required", "labelPlacement", "justify", "color", "enableOnOffLabels", "tabIndex"], outputs: ["checkedChange", "touchedChange"] }, { kind: "component", type: IonNote, selector: "ion-note", inputs: ["color", "mode"] }, { 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 });
|
|
1511
1045
|
}
|
|
1512
1046
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.8", ngImport: i0, type: IonicToggleFieldComponent, decorators: [{
|
|
1513
1047
|
type: Component,
|
|
1514
|
-
args: [{ selector: 'df-ion-toggle', imports: [IonicToggleControlComponent, IonNote, FormField, DynamicTextPipe, AsyncPipe], template: `
|
|
1515
|
-
@let f = field();
|
|
1516
|
-
@let toggleId = key() + '-toggle';
|
|
1048
|
+
args: [{ selector: 'df-ion-toggle', imports: [IonicToggleControlComponent, IonNote, FormField, DynamicTextPipe, AsyncPipe], hostDirectives: [NgForgeFieldHost], template: `
|
|
1049
|
+
@let f = ngf.field();
|
|
1050
|
+
@let toggleId = ngf.key() + '-toggle';
|
|
1517
1051
|
|
|
1518
1052
|
<df-ion-toggle-control
|
|
1519
1053
|
[id]="toggleId"
|
|
1520
1054
|
[formField]="f"
|
|
1521
|
-
[meta]="meta()"
|
|
1522
1055
|
[labelPlacement]="props()?.labelPlacement ?? 'end'"
|
|
1523
1056
|
[justify]="props()?.justify"
|
|
1524
1057
|
[color]="props()?.color ?? 'primary'"
|
|
1525
1058
|
[enableOnOffLabels]="props()?.enableOnOffLabels ?? false"
|
|
1526
|
-
[tabIndex]="tabIndex()"
|
|
1527
|
-
[ariaDescribedBy]="ariaDescribedBy()"
|
|
1059
|
+
[tabIndex]="ngf.tabIndex()"
|
|
1528
1060
|
>
|
|
1529
|
-
{{ label() | dynamicText | async }}
|
|
1061
|
+
{{ ngf.label() | dynamicText | async }}
|
|
1530
1062
|
</df-ion-toggle-control>
|
|
1531
1063
|
|
|
1532
|
-
@if (errorsToDisplay()[0]; as error) {
|
|
1533
|
-
<ion-note color="danger" class="df-ion-error" [id]="errorId()" role="alert">{{ error.message }}</ion-note>
|
|
1064
|
+
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
1065
|
+
<ion-note color="danger" class="df-ion-error" [id]="ngf.errorId()" role="alert">{{ error.message }}</ion-note>
|
|
1534
1066
|
} @else if (props()?.hint; as hint) {
|
|
1535
|
-
<ion-note class="df-ion-hint" [id]="hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
1067
|
+
<ion-note class="df-ion-hint" [id]="ngf.hintId()">{{ hint | dynamicText | async }}</ion-note>
|
|
1536
1068
|
}
|
|
1537
|
-
`, host: {
|
|
1538
|
-
|
|
1539
|
-
'[id]': '`${key()}`',
|
|
1540
|
-
'[attr.data-testid]': 'key()',
|
|
1541
|
-
'[attr.hidden]': 'field()().hidden() || null',
|
|
1542
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}\n"] }]
|
|
1543
|
-
}], ctorParameters: () => [], propDecorators: { field: [{ type: i0.Input, args: [{ isSignal: true, alias: "field", required: true }] }], key: [{ type: i0.Input, args: [{ isSignal: true, alias: "key", required: true }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], tabIndex: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabIndex", required: false }] }], props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }], meta: [{ type: i0.Input, args: [{ isSignal: true, alias: "meta", required: false }] }], validationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "validationMessages", required: false }] }], defaultValidationMessages: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultValidationMessages", required: false }] }] } });
|
|
1069
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, styles: [":host{--df-field-gap: .5rem;--df-label-font-weight: 500;--df-label-color: inherit;--df-hint-color: var(--ion-color-medium, #92949c);--df-hint-font-size: .875rem;--df-error-color: var(--ion-color-danger, #eb445a);--df-error-font-size: .875rem}.df-ion-field{display:flex;flex-direction:column;gap:var(--df-field-gap);width:100%}.df-ion-label{font-weight:var(--df-label-font-weight);color:var(--df-label-color)}.df-ion-hint{display:block;color:var(--df-hint-color);font-size:var(--df-hint-font-size)}.df-ion-error{display:block;color:var(--df-error-color);font-size:var(--df-error-font-size)}:host([hidden]){display:none!important}ion-input.ng-invalid.ng-touched,ion-textarea.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-select.ng-invalid.ng-touched{--highlight-color: var(--ion-color-danger);--border-color: var(--ion-color-danger)}ion-checkbox.ng-invalid.ng-touched{--checkbox-background-checked: var(--ion-color-danger);--border-color: var(--ion-color-danger);--border-color-checked: var(--ion-color-danger)}ion-radio.ng-invalid.ng-touched{--color: var(--ion-color-danger);--color-checked: var(--ion-color-danger)}ion-range.ng-invalid.ng-touched{--bar-background: var(--ion-color-danger);--knob-background: var(--ion-color-danger)}ion-toggle.ng-invalid.ng-touched{--track-background: var(--ion-color-danger-tint);--track-background-checked: var(--ion-color-danger);--handle-background-checked: var(--ion-color-danger-contrast)}\n", ":host{display:block}:host([hidden]){display:none!important}\n"] }]
|
|
1070
|
+
}], propDecorators: { props: [{ type: i0.Input, args: [{ isSignal: true, alias: "props", required: false }] }] } });
|
|
1544
1071
|
|
|
1545
1072
|
var ionicToggle_component = /*#__PURE__*/Object.freeze({
|
|
1546
1073
|
__proto__: null,
|