@radix-ng/primitives 1.0.7 → 1.0.8

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.
Files changed (52) hide show
  1. package/fesm2022/radix-ng-primitives-autocomplete.mjs +43 -9
  2. package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -1
  3. package/fesm2022/radix-ng-primitives-checkbox.mjs +89 -8
  4. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  5. package/fesm2022/radix-ng-primitives-combobox.mjs +43 -9
  6. package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -1
  7. package/fesm2022/radix-ng-primitives-core.mjs +208 -2
  8. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  9. package/fesm2022/radix-ng-primitives-date-field.mjs +50 -9
  10. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
  11. package/fesm2022/radix-ng-primitives-editable.mjs +31 -5
  12. package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
  13. package/fesm2022/radix-ng-primitives-field.mjs +265 -46
  14. package/fesm2022/radix-ng-primitives-field.mjs.map +1 -1
  15. package/fesm2022/radix-ng-primitives-form.mjs +110 -26
  16. package/fesm2022/radix-ng-primitives-form.mjs.map +1 -1
  17. package/fesm2022/radix-ng-primitives-input.mjs +16 -6
  18. package/fesm2022/radix-ng-primitives-input.mjs.map +1 -1
  19. package/fesm2022/radix-ng-primitives-number-field.mjs +32 -7
  20. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
  21. package/fesm2022/radix-ng-primitives-radio.mjs +18 -4
  22. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  23. package/fesm2022/radix-ng-primitives-select.mjs +26 -8
  24. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  25. package/fesm2022/radix-ng-primitives-signal-forms.mjs +184 -0
  26. package/fesm2022/radix-ng-primitives-signal-forms.mjs.map +1 -0
  27. package/fesm2022/radix-ng-primitives-slider.mjs +24 -8
  28. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  29. package/fesm2022/radix-ng-primitives-switch.mjs +29 -5
  30. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  31. package/fesm2022/radix-ng-primitives-time-field.mjs +49 -9
  32. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  33. package/fesm2022/radix-ng-primitives-toggle-group.mjs +23 -12
  34. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  35. package/package.json +11 -1
  36. package/types/radix-ng-primitives-autocomplete.d.ts +21 -2
  37. package/types/radix-ng-primitives-checkbox.d.ts +53 -4
  38. package/types/radix-ng-primitives-combobox.d.ts +51 -2
  39. package/types/radix-ng-primitives-core.d.ts +206 -3
  40. package/types/radix-ng-primitives-date-field.d.ts +27 -2
  41. package/types/radix-ng-primitives-editable.d.ts +15 -2
  42. package/types/radix-ng-primitives-field.d.ts +136 -33
  43. package/types/radix-ng-primitives-form.d.ts +115 -21
  44. package/types/radix-ng-primitives-input.d.ts +8 -1
  45. package/types/radix-ng-primitives-number-field.d.ts +14 -3
  46. package/types/radix-ng-primitives-radio.d.ts +7 -2
  47. package/types/radix-ng-primitives-select.d.ts +11 -3
  48. package/types/radix-ng-primitives-signal-forms.d.ts +97 -0
  49. package/types/radix-ng-primitives-slider.d.ts +9 -7
  50. package/types/radix-ng-primitives-switch.d.ts +15 -2
  51. package/types/radix-ng-primitives-time-field.d.ts +26 -2
  52. package/types/radix-ng-primitives-toggle-group.d.ts +6 -4
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { InjectionToken, inject, ElementRef, input, computed, signal, effect, Directive, model, booleanAttribute, contentChildren, linkedSignal, NgModule } from '@angular/core';
3
- import { useDateField, isNullish, normalizeDateStep, createFormatter, normalizeHourCycle, getDefaultDate, hasTime, syncSegmentValues, initializeSegmentValues, isBefore, createContent, watch, ARROW_LEFT, ARROW_RIGHT, isSegmentNavigationKey, provideToken } from '@radix-ng/primitives/core';
3
+ import { useDateField, isNullish, RdxFormUiControlBase, normalizeDateStep, createFormatter, normalizeHourCycle, getDefaultDate, hasTime, syncSegmentValues, initializeSegmentValues, isBefore, resolveDisplayValid, createContent, watch, ARROW_LEFT, ARROW_RIGHT, isSegmentNavigationKey, provideToken } from '@radix-ng/primitives/core';
4
4
  import { injectDirection } from '@radix-ng/primitives/direction-provider';
5
5
 
6
6
  const DATE_FIELDS_ROOT_CONTEXT = new InjectionToken('DATE_FIELDS_ROOT_CONTEXT');
@@ -43,8 +43,11 @@ class RdxDateFieldInputDirective {
43
43
  /**
44
44
  * @ignore
45
45
  */
46
- this.isInvalid = computed(() => this.rootContext.isInvalid(), /* @ts-ignore */
46
+ this.isInvalid = computed(() => this.rootContext.invalidState(), /* @ts-ignore */
47
47
  ...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
48
+ /** @ignore Tri-state display validity from the root (gated by an enclosing Field). */
49
+ this.displayValid = computed(() => this.rootContext.displayValid(), /* @ts-ignore */
50
+ ...(ngDevMode ? [{ debugName: "displayValid" }] : /* istanbul ignore next */ []));
48
51
  /**
49
52
  * @ignore
50
53
  */
@@ -132,7 +135,7 @@ class RdxDateFieldInputDirective {
132
135
  this.hasLeftFocus.set(true);
133
136
  }
134
137
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxDateFieldInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
135
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxDateFieldInputDirective, isStandalone: true, selector: "[rdxDateFieldInput]", inputs: { part: { classPropertyName: "part", publicName: "part", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "part() !== \"literal\" && handleSegmentClick($event)", "keydown": "part() !== \"literal\" && handleSegmentKeydown($event)", "focus": "part() !== \"literal\" && onFocus($event)", "focusout": "part() !== \"literal\" && onFocusOut()" }, properties: { "attr.contenteditable": "disabled() || readonly() ? false : part() !== \"literal\"", "style.caret-color": "part() !== \"literal\" ? \"transparent\" : undefined", "attr.data-rdx-date-field-segment": "part()", "attr.aria-disabled": "disabled() ? \"true\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-invalid": "isInvalid() ? \"\" : undefined", "attr.aria-invalid": "isInvalid() ? true : undefined" } }, ngImport: i0 }); }
138
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxDateFieldInputDirective, isStandalone: true, selector: "[rdxDateFieldInput]", inputs: { part: { classPropertyName: "part", publicName: "part", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "mousedown": "part() !== \"literal\" && handleSegmentClick($event)", "keydown": "part() !== \"literal\" && handleSegmentKeydown($event)", "focus": "part() !== \"literal\" && onFocus($event)", "focusout": "part() !== \"literal\" && onFocusOut()" }, properties: { "attr.contenteditable": "disabled() || readonly() ? false : part() !== \"literal\"", "style.caret-color": "part() !== \"literal\" ? \"transparent\" : undefined", "attr.data-rdx-date-field-segment": "part()", "attr.aria-disabled": "disabled() ? \"true\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-invalid": "displayValid() === false ? \"\" : undefined", "attr.aria-invalid": "displayValid() === false ? true : undefined" } }, ngImport: i0 }); }
136
139
  }
137
140
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxDateFieldInputDirective, decorators: [{
138
141
  type: Directive,
@@ -144,8 +147,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
144
147
  '[attr.data-rdx-date-field-segment]': 'part()',
145
148
  '[attr.aria-disabled]': 'disabled() ? "true" : undefined',
146
149
  '[attr.data-disabled]': 'disabled() ? "" : undefined',
147
- '[attr.data-invalid]': 'isInvalid() ? "" : undefined',
148
- '[attr.aria-invalid]': 'isInvalid() ? true : undefined',
150
+ '[attr.data-invalid]': 'displayValid() === false ? "" : undefined',
151
+ '[attr.aria-invalid]': 'displayValid() === false ? true : undefined',
149
152
  '(mousedown)': 'part() !== "literal" && handleSegmentClick($event)',
150
153
  '(keydown)': 'part() !== "literal" && handleSegmentKeydown($event)',
151
154
  '(focus)': 'part() !== "literal" && onFocus($event)',
@@ -154,8 +157,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
154
157
  }]
155
158
  }], ctorParameters: () => [], propDecorators: { part: [{ type: i0.Input, args: [{ isSignal: true, alias: "part", required: false }] }] } });
156
159
 
157
- class RdxDateFieldRootDirective {
160
+ class RdxDateFieldRootDirective extends RdxFormUiControlBase {
161
+ /** @ignore Mark the field touched (model + `touch` output) for Signal Forms. Called on segment blur. */
162
+ markAsTouched() {
163
+ this.formUi.markAsTouched();
164
+ }
158
165
  constructor() {
166
+ super();
159
167
  /**
160
168
  * The controlled value of the date field.
161
169
  */
@@ -294,6 +302,26 @@ class RdxDateFieldRootDirective {
294
302
  return false;
295
303
  }, /* @ts-ignore */
296
304
  ...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
305
+ /**
306
+ * @ignore Effective invalid: the built-in range/availability check OR the form-driven
307
+ * `invalid` / `errors` (Signal Forms). Reflected on the root and segments.
308
+ */
309
+ this.invalidState = computed(() => this.isInvalid() || this.formUi.invalidState(), /* @ts-ignore */
310
+ ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
311
+ /**
312
+ * @ignore Tri-state display validity: the enclosing Field's gated state when inside a `rdxFieldRoot`,
313
+ * else the date-field's own (parse + form) invalidity. Overrides the base (whose default uses only
314
+ * `formUi.invalidState`) so the standalone path keeps the built-in range/availability check.
315
+ */
316
+ this.displayValid = computed(() => resolveDisplayValid(this.fieldValidity, this.invalidState), /* @ts-ignore */
317
+ ...(ngDevMode ? [{ debugName: "displayValid" }] : /* istanbul ignore next */ []));
318
+ /** @ignore */
319
+ this.touchedState = this.formUi.touchedState;
320
+ /** @ignore */
321
+ this.dirtyState = this.formUi.dirtyState;
322
+ /** @ignore Whether the user has focused a segment — gates dirty tracking so a form/initial seed of `value` doesn't mark dirty. */
323
+ this.userInteracted = signal(false, /* @ts-ignore */
324
+ ...(ngDevMode ? [{ debugName: "userInteracted" }] : /* istanbul ignore next */ []));
297
325
  /**
298
326
  * @ignore
299
327
  */
@@ -349,6 +377,13 @@ class RdxDateFieldRootDirective {
349
377
  this.focusNext = () => {
350
378
  this.nextFocusableSegment()?.focus();
351
379
  };
380
+ // Mark dirty when the value changes after the user has interacted (a form/initial seed of
381
+ // `value` lands before any segment focus, so it is excluded).
382
+ watch([this.value], () => {
383
+ if (this.userInteracted()) {
384
+ this.formUi.markDirty();
385
+ }
386
+ });
352
387
  watch([this.value], ([modelValue]) => {
353
388
  if (!isNullish(modelValue) && this.placeholder()?.compare(modelValue) !== 0) {
354
389
  this.placeholder.set(modelValue.copy());
@@ -388,9 +423,10 @@ class RdxDateFieldRootDirective {
388
423
  */
389
424
  setFocusedElement(el) {
390
425
  this.currentFocusedElement.set(el);
426
+ this.userInteracted.set(true);
391
427
  }
392
428
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxDateFieldRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
393
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.2", type: RdxDateFieldRootDirective, isStandalone: true, selector: "[rdxDateFieldRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, isDateUnavailable: { classPropertyName: "isDateUnavailable", publicName: "isDateUnavailable", isSignal: true, isRequired: false, transformFunction: null }, hourCycle: { classPropertyName: "hourCycle", publicName: "hourCycle", isSignal: true, isRequired: false, transformFunction: null }, granularity: { classPropertyName: "granularity", publicName: "granularity", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, hideTimeZone: { classPropertyName: "hideTimeZone", publicName: "hideTimeZone", 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 }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", placeholder: "placeholderChange" }, host: { attributes: { "role": "group" }, listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.aria-disabled": "disabled() ? \"true\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-readonly": "readonly() ? \"\" : undefined", "attr.data-invalid": "isInvalid() ? \"\" : undefined", "attr.dir": "dir()" } }, providers: [provideToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)], queries: [{ propertyName: "segmentInputs", predicate: RdxDateFieldInputDirective, isSignal: true }], exportAs: ["rdxDateFieldRoot"], ngImport: i0 }); }
429
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.2", type: RdxDateFieldRootDirective, isStandalone: true, selector: "[rdxDateFieldRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, isDateUnavailable: { classPropertyName: "isDateUnavailable", publicName: "isDateUnavailable", isSignal: true, isRequired: false, transformFunction: null }, hourCycle: { classPropertyName: "hourCycle", publicName: "hourCycle", isSignal: true, isRequired: false, transformFunction: null }, granularity: { classPropertyName: "granularity", publicName: "granularity", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, dirInput: { classPropertyName: "dirInput", publicName: "dir", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, hideTimeZone: { classPropertyName: "hideTimeZone", publicName: "hideTimeZone", 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 }, step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", placeholder: "placeholderChange" }, host: { attributes: { "role": "group" }, listeners: { "keydown": "onKeydown($event)", "focusout": "markAsTouched()" }, properties: { "attr.aria-disabled": "disabled() ? \"true\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-readonly": "readonly() ? \"\" : undefined", "attr.aria-invalid": "displayValid() === false ? \"true\" : undefined", "attr.data-invalid": "displayValid() === false ? \"\" : undefined", "attr.data-valid": "displayValid() === true ? \"\" : undefined", "attr.data-touched": "touchedState() ? \"\" : undefined", "attr.data-dirty": "dirtyState() ? \"\" : undefined", "attr.dir": "dir()" } }, providers: [provideToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)], queries: [{ propertyName: "segmentInputs", predicate: RdxDateFieldInputDirective, isSignal: true }], exportAs: ["rdxDateFieldRoot"], usesInheritance: true, ngImport: i0 }); }
394
430
  }
395
431
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxDateFieldRootDirective, decorators: [{
396
432
  type: Directive,
@@ -403,9 +439,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
403
439
  '[attr.aria-disabled]': 'disabled() ? "true" : undefined',
404
440
  '[attr.data-disabled]': 'disabled() ? "" : undefined',
405
441
  '[attr.data-readonly]': 'readonly() ? "" : undefined',
406
- '[attr.data-invalid]': 'isInvalid() ? "" : undefined',
442
+ '[attr.aria-invalid]': 'displayValid() === false ? "true" : undefined',
443
+ '[attr.data-invalid]': 'displayValid() === false ? "" : undefined',
444
+ '[attr.data-valid]': 'displayValid() === true ? "" : undefined',
445
+ '[attr.data-touched]': 'touchedState() ? "" : undefined',
446
+ '[attr.data-dirty]': 'dirtyState() ? "" : undefined',
407
447
  '[attr.dir]': 'dir()',
408
- '(keydown)': 'onKeydown($event)'
448
+ '(keydown)': 'onKeydown($event)',
449
+ '(focusout)': 'markAsTouched()'
409
450
  }
410
451
  }]
411
452
  }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], isDateUnavailable: [{ type: i0.Input, args: [{ isSignal: true, alias: "isDateUnavailable", required: false }] }], hourCycle: [{ type: i0.Input, args: [{ isSignal: true, alias: "hourCycle", required: false }] }], granularity: [{ type: i0.Input, args: [{ isSignal: true, alias: "granularity", required: false }] }], locale: [{ type: i0.Input, args: [{ isSignal: true, alias: "locale", required: false }] }], dirInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "dir", required: false }] }], minValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "minValue", required: false }] }], maxValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxValue", required: false }] }], hideTimeZone: [{ type: i0.Input, args: [{ isSignal: true, alias: "hideTimeZone", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }, { type: i0.Output, args: ["placeholderChange"] }], segmentInputs: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => RdxDateFieldInputDirective), { isSignal: true }] }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-date-field.mjs","sources":["../../../packages/primitives/date-field/src/date-field-context.token.ts","../../../packages/primitives/date-field/src/date-field-input.directive.ts","../../../packages/primitives/date-field/src/date-field-root.directive.ts","../../../packages/primitives/date-field/index.ts","../../../packages/primitives/date-field/radix-ng-primitives-date-field.ts"],"sourcesContent":["import { inject, InjectionToken, InputSignal, ModelSignal, Signal, WritableSignal } from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport { DateStep, Formatter, HourCycle, SegmentValueObj } from '@radix-ng/primitives/core';\n\nexport interface DateFieldContextToken {\n locale: InputSignal<string>;\n value: ModelSignal<DateValue | undefined>;\n disabled: InputSignal<boolean>;\n readonly: InputSignal<boolean>;\n isInvalid: Signal<boolean>;\n placeholder: ModelSignal<DateValue>;\n hourCycle: InputSignal<HourCycle>;\n step$: Signal<DateStep>;\n formatter: Signal<Formatter>;\n segmentValues: WritableSignal<SegmentValueObj>;\n focusNext: () => void;\n setFocusedElement: (el: HTMLElement) => void;\n}\n\nexport const DATE_FIELDS_ROOT_CONTEXT = new InjectionToken<DateFieldContextToken>('DATE_FIELDS_ROOT_CONTEXT');\n\nexport function injectDateFieldsRootContext(): DateFieldContextToken {\n return inject(DATE_FIELDS_ROOT_CONTEXT);\n}\n","import { computed, Directive, effect, ElementRef, inject, input, signal } from '@angular/core';\nimport { isNullish, SegmentPart, useDateField } from '@radix-ng/primitives/core';\nimport { injectDateFieldsRootContext } from './date-field-context.token';\n\n/**\n * Attribute keys produced by `useDateField().attributes()` that are instead owned by host\n * bindings. Writing them imperatively would clobber the host value — re-enabling a disabled\n * segment via `contenteditable`, or overwriting a consumer's inline `style`.\n */\nconst hostManagedAttrs = new Set(['contenteditable', 'style']);\n\n@Directive({\n selector: '[rdxDateFieldInput]',\n host: {\n '[attr.contenteditable]': 'disabled() || readonly() ? false : part() !== \"literal\"',\n '[style.caret-color]': 'part() !== \"literal\" ? \"transparent\" : undefined',\n '[attr.data-rdx-date-field-segment]': 'part()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-invalid]': 'isInvalid() ? \"\" : undefined',\n '[attr.aria-invalid]': 'isInvalid() ? true : undefined',\n\n '(mousedown)': 'part() !== \"literal\" && handleSegmentClick($event)',\n '(keydown)': 'part() !== \"literal\" && handleSegmentKeydown($event)',\n '(focus)': 'part() !== \"literal\" && onFocus($event)',\n '(focusout)': 'part() !== \"literal\" && onFocusOut()'\n }\n})\nexport class RdxDateFieldInputDirective {\n private readonly elementRef = inject(ElementRef);\n\n /**\n * The host element of this segment. Consumed by the root to collect focusable\n * segments in DOM order.\n * @ignore\n */\n readonly element: HTMLElement = this.elementRef.nativeElement;\n\n private readonly rootContext = injectDateFieldsRootContext();\n\n /**\n * The part of the date to render\n * `'day' | 'month' | 'year' | 'hour' | 'minute' | 'second' | 'dayPeriod' | 'literal' | 'timeZoneName'`\n */\n readonly part = input<SegmentPart>();\n\n /**\n * @ignore\n */\n readonly disabled = computed(() => this.rootContext.disabled());\n\n /**\n * @ignore\n */\n readonly readonly = computed(() => this.rootContext.readonly());\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => this.rootContext.isInvalid());\n\n /**\n * @ignore\n */\n readonly hasLeftFocus = signal<boolean>(true);\n\n /**\n * @ignore\n */\n readonly lastKeyZero = signal<boolean>(false);\n\n private readonly fieldData = computed(() => {\n return useDateField({\n hasLeftFocus: this.hasLeftFocus,\n lastKeyZero: this.lastKeyZero,\n placeholder: this.rootContext.placeholder,\n hourCycle: this.rootContext.hourCycle(),\n segmentValues: this.rootContext.segmentValues,\n formatter: this.rootContext.formatter(),\n part: <SegmentPart>this.part(),\n disabled: this.rootContext.disabled,\n readonly: this.rootContext.readonly,\n step: this.rootContext.step$,\n modelValue: this.rootContext.value,\n focusNext: this.rootContext.focusNext\n });\n });\n\n private readonly attributes = computed(() => this.fieldData().attributes());\n\n /**\n * Attribute keys applied imperatively on the previous effect run, so keys that\n * disappear from `attributes()` are removed instead of lingering as stale state.\n * @ignore\n */\n private appliedAttrs = new Set<string>();\n\n constructor() {\n effect(() => {\n const element = this.elementRef.nativeElement as HTMLElement;\n const attrs = this.attributes();\n const next = new Set<string>();\n\n for (const [attr, value] of Object.entries(attrs)) {\n // Skip keys a host binding already owns, so this effect never fights it.\n if (hostManagedAttrs.has(attr)) {\n continue;\n }\n\n // A nullish value means the attribute should be absent (e.g. `data-placeholder`\n // once a segment is filled); removing it avoids a literal `\"undefined\"` string.\n if (isNullish(value)) {\n element.removeAttribute(attr);\n } else {\n element.setAttribute(attr, String(value));\n next.add(attr);\n }\n }\n\n for (const attr of this.appliedAttrs) {\n if (!next.has(attr)) {\n element.removeAttribute(attr);\n }\n }\n\n this.appliedAttrs = next;\n });\n }\n\n /**\n * @ignore\n */\n handleSegmentClick(event: Event) {\n this.fieldData().handleSegmentClick(event as MouseEvent);\n }\n\n /**\n * @ignore\n */\n handleSegmentKeydown(event: Event) {\n this.fieldData().handleSegmentKeydown(event as KeyboardEvent);\n }\n\n /**\n * @ignore\n */\n onFocus(e: Event) {\n this.rootContext.setFocusedElement(e.target as HTMLElement);\n }\n\n /**\n * @ignore\n */\n onFocusOut() {\n this.hasLeftFocus.set(true);\n }\n}\n","import {\n booleanAttribute,\n computed,\n contentChildren,\n Directive,\n input,\n linkedSignal,\n model,\n Signal,\n signal\n} from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport {\n ARROW_LEFT,\n ARROW_RIGHT,\n BooleanInput,\n createContent,\n createFormatter,\n DateMatcher,\n DateStep,\n Direction,\n Formatter,\n getDefaultDate,\n Granularity,\n hasTime,\n HourCycle,\n initializeSegmentValues,\n isBefore,\n isNullish,\n isSegmentNavigationKey,\n normalizeDateStep,\n normalizeHourCycle,\n provideToken,\n SegmentValueObj,\n syncSegmentValues,\n watch\n} from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { DATE_FIELDS_ROOT_CONTEXT } from './date-field-context.token';\nimport { RdxDateFieldInputDirective } from './date-field-input.directive';\n\n@Directive({\n selector: '[rdxDateFieldRoot]',\n exportAs: 'rdxDateFieldRoot',\n providers: [provideToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)],\n host: {\n role: 'group',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonly() ? \"\" : undefined',\n '[attr.data-invalid]': 'isInvalid() ? \"\" : undefined',\n '[attr.dir]': 'dir()',\n\n '(keydown)': 'onKeydown($event)'\n }\n})\nexport class RdxDateFieldRootDirective {\n /**\n * The controlled value of the date field.\n */\n readonly value = model<DateValue | undefined>();\n\n /**\n * A matcher that marks specific dates as unavailable; a matched value makes the field invalid.\n */\n readonly isDateUnavailable = input<DateMatcher | undefined>(undefined);\n\n /**\n * The hour cycle to use for formatting times. Defaults to the locale preference\n */\n readonly hourCycle = input<HourCycle>();\n\n /**\n * The granularity to use for formatting the field. Defaults to 'day' if a CalendarDate is provided, otherwise defaults to 'minute'.\n * The field will render segments for each part of the date up to and including the specified granularity.\n */\n readonly granularity = input<Granularity>();\n\n /**\n * The locale to use for formatting dates.\n */\n readonly locale = input<string>('en');\n\n readonly dirInput = input<Direction | undefined>(undefined, { alias: 'dir' });\n readonly dir = injectDirection(this.dirInput);\n\n /**\n * The minimum valid date that can be entered.\n */\n readonly minValue = input<DateValue>();\n\n /**\n * The maximum valid date that can be entered.\n */\n readonly maxValue = input<DateValue>();\n\n /**\n * Whether or not to hide the time zone segment of the field.\n */\n readonly hideTimeZone = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether or not the field is readonly.\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The stepping interval for the time fields. Defaults to 1\n */\n readonly step = input<DateStep>();\n\n readonly step$ = computed(() => normalizeDateStep(this.step()));\n\n /**\n * Locale- and hour-cycle-aware formatter. Recomputed whenever `locale` or\n * `hourCycle` change so segments always render with the current settings.\n * @ignore\n */\n readonly formatter: Signal<Formatter> = computed(() =>\n createFormatter(this.locale(), {\n hourCycle: normalizeHourCycle(this.hourCycle())\n })\n );\n\n /**\n * @ignore\n */\n readonly defaultDate = computed(() =>\n getDefaultDate({\n defaultPlaceholder: undefined,\n granularity: this.granularity(),\n defaultValue: this.value(),\n locale: this.locale()\n })\n );\n\n /**\n * The placeholder date, which is used to determine what month to display when no date is selected. This updates as the user navigates the calendar and can be used to programmatically control the calendar view\n */\n readonly placeholder = model<DateValue | undefined>(this.defaultDate().copy());\n\n // Internal state\n\n /**\n * Segment input parts, collected from the projected content in DOM order. This\n * stays in sync with `segmentContents()` (granularity / locale / value changes\n * add or remove segments) instead of being captured once after view init.\n * @ignore\n */\n private readonly segmentInputs = contentChildren(RdxDateFieldInputDirective);\n\n /**\n * The focusable (non-literal) segment elements, in DOM order.\n * @ignore\n */\n readonly segmentElements = computed(() =>\n this.segmentInputs()\n .filter((seg) => seg.part() !== 'literal')\n .map((seg) => seg.element)\n );\n\n /**\n * @ignore\n */\n readonly currentFocusedElement = signal<HTMLElement | null>(null);\n\n /**\n * @ignore\n */\n readonly inferredGranularity = computed(() => {\n const placeholder = this.placeholder();\n\n if (this.granularity()) return placeholder && !hasTime(placeholder) ? 'day' : this.granularity();\n\n return placeholder && hasTime(placeholder) ? 'minute' : 'day';\n });\n\n /**\n * The per-segment values. Writable so segment editing (via `useDateField`) can\n * update individual parts, but re-synced from the model whenever the value,\n * granularity or formatter change — so a controlled `value` set after init is\n * reflected, and an empty field re-initializes when granularity changes.\n * @ignore\n */\n readonly segmentValues = linkedSignal<\n { value: DateValue | undefined; granularity: Granularity; formatter: Formatter },\n SegmentValueObj\n >({\n source: () => ({\n value: this.value(),\n granularity: <Granularity>this.inferredGranularity(),\n formatter: this.formatter()\n }),\n computation: ({ value, granularity, formatter }) =>\n value ? { ...syncSegmentValues({ value, formatter }) } : { ...initializeSegmentValues(granularity) }\n });\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => {\n if (!this.value()) return false;\n\n if (this.isDateUnavailable()?.(<DateValue>this.value())) return true;\n\n if (this.minValue() && isBefore(<DateValue>this.value(), <DateValue>this.minValue())) return true;\n\n if (this.maxValue() && isBefore(<DateValue>this.maxValue(), <DateValue>this.value())) return true;\n\n return false;\n });\n\n /**\n * @ignore\n */\n readonly allSegmentContent = computed(() =>\n createContent({\n granularity: <Granularity>this.inferredGranularity(),\n dateRef: <DateValue>this.placeholder(),\n formatter: this.formatter(),\n hideTimeZone: this.hideTimeZone(),\n hourCycle: this.hourCycle(),\n segmentValues: this.segmentValues(),\n locale: this.locale\n })\n );\n\n /**\n * An array of segments that should be readonly, which prevent user input on them.\n */\n readonly segmentContents = computed(() => this.allSegmentContent().arr);\n\n /**\n * @ignore\n */\n readonly currentSegmentIndex = computed(() =>\n this.segmentElements().findIndex((el) => el === this.currentFocusedElement())\n );\n\n /**\n * @ignore\n */\n readonly prevFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const elements = this.segmentElements();\n const index = this.currentSegmentIndex();\n const prevCondition = sign > 0 ? index < 0 : index > elements.length - 1;\n if (prevCondition) return null;\n\n return elements[index - sign];\n });\n\n /**\n * @ignore\n */\n readonly nextFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const elements = this.segmentElements();\n const index = this.currentSegmentIndex();\n const nextCondition = sign < 0 ? index < 0 : index > elements.length - 1;\n if (nextCondition) return null;\n\n return elements[index + sign];\n });\n\n /**\n * @ignore\n */\n readonly focusNext = () => {\n this.nextFocusableSegment()?.focus();\n };\n\n constructor() {\n watch([this.value], ([modelValue]) => {\n if (!isNullish(modelValue) && this.placeholder()?.compare(modelValue) !== 0) {\n this.placeholder.set(modelValue.copy());\n }\n });\n\n // The placeholder is seeded once at construction, before `locale` binds. When the locale\n // selects a different calendar system (e.g. Buddhist, Japanese) and the field is still\n // empty, re-seed it so segments and `getDaysInMonth` use that calendar.\n watch([this.locale], () => {\n if (!isNullish(this.value())) return;\n const next = this.defaultDate();\n if (this.placeholder()?.calendar.identifier !== next.calendar.identifier) {\n this.placeholder.set(next.copy());\n }\n });\n }\n\n /**\n * @ignore\n */\n onKeydown(event: Event) {\n const keyEvent = event as KeyboardEvent;\n const code = keyEvent.code;\n if ([ARROW_LEFT, ARROW_RIGHT].includes(code)) {\n if (!isSegmentNavigationKey(keyEvent.key)) return;\n\n if (code === ARROW_LEFT) {\n this.prevFocusableSegment()?.focus();\n }\n\n if (code === ARROW_RIGHT) {\n this.nextFocusableSegment()?.focus();\n }\n }\n }\n\n /**\n * @ignore\n */\n setFocusedElement(el: HTMLElement) {\n this.currentFocusedElement.set(el);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxDateFieldInputDirective } from './src/date-field-input.directive';\nimport { RdxDateFieldRootDirective } from './src/date-field-root.directive';\n\nexport * from './src/date-field-context.token';\nexport * from './src/date-field-input.directive';\nexport * from './src/date-field-root.directive';\n\nconst _imports = [RdxDateFieldRootDirective, RdxDateFieldInputDirective];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxDateFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAmBa,wBAAwB,GAAG,IAAI,cAAc,CAAwB,0BAA0B;SAE5F,2BAA2B,GAAA;AACvC,IAAA,OAAO,MAAM,CAAC,wBAAwB,CAAC;A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A,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YANb,yBAAyB,EAAE,0BAA0B,CAAA,EAAA,OAAA,EAAA,CAArD,yBAAyB,EAAE,0BAA0B,CAAA,EAAA,CAAA,CAAA;+GAM1D,kBAAkB,EAAA,CAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-date-field.mjs","sources":["../../../packages/primitives/date-field/src/date-field-context.token.ts","../../../packages/primitives/date-field/src/date-field-input.directive.ts","../../../packages/primitives/date-field/src/date-field-root.directive.ts","../../../packages/primitives/date-field/index.ts","../../../packages/primitives/date-field/radix-ng-primitives-date-field.ts"],"sourcesContent":["import { inject, InjectionToken, InputSignal, ModelSignal, Signal, WritableSignal } from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport { DateStep, Formatter, HourCycle, SegmentValueObj } from '@radix-ng/primitives/core';\n\nexport interface DateFieldContextToken {\n locale: InputSignal<string>;\n value: ModelSignal<DateValue | undefined>;\n disabled: InputSignal<boolean>;\n readonly: InputSignal<boolean>;\n isInvalid: Signal<boolean>;\n /** Effective invalid: the built-in range/availability check OR the form-driven invalid state. */\n invalidState: Signal<boolean>;\n /** Tri-state displayed validity (`true`/`false`/`null`): the field's gated state inside a Field, else own. */\n displayValid: Signal<boolean | null>;\n placeholder: ModelSignal<DateValue>;\n hourCycle: InputSignal<HourCycle>;\n step$: Signal<DateStep>;\n formatter: Signal<Formatter>;\n segmentValues: WritableSignal<SegmentValueObj>;\n focusNext: () => void;\n setFocusedElement: (el: HTMLElement) => void;\n}\n\nexport const DATE_FIELDS_ROOT_CONTEXT = new InjectionToken<DateFieldContextToken>('DATE_FIELDS_ROOT_CONTEXT');\n\nexport function injectDateFieldsRootContext(): DateFieldContextToken {\n return inject(DATE_FIELDS_ROOT_CONTEXT);\n}\n","import { computed, Directive, effect, ElementRef, inject, input, signal } from '@angular/core';\nimport { isNullish, SegmentPart, useDateField } from '@radix-ng/primitives/core';\nimport { injectDateFieldsRootContext } from './date-field-context.token';\n\n/**\n * Attribute keys produced by `useDateField().attributes()` that are instead owned by host\n * bindings. Writing them imperatively would clobber the host value — re-enabling a disabled\n * segment via `contenteditable`, or overwriting a consumer's inline `style`.\n */\nconst hostManagedAttrs = new Set(['contenteditable', 'style']);\n\n@Directive({\n selector: '[rdxDateFieldInput]',\n host: {\n '[attr.contenteditable]': 'disabled() || readonly() ? false : part() !== \"literal\"',\n '[style.caret-color]': 'part() !== \"literal\" ? \"transparent\" : undefined',\n '[attr.data-rdx-date-field-segment]': 'part()',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-invalid]': 'displayValid() === false ? \"\" : undefined',\n '[attr.aria-invalid]': 'displayValid() === false ? true : undefined',\n\n '(mousedown)': 'part() !== \"literal\" && handleSegmentClick($event)',\n '(keydown)': 'part() !== \"literal\" && handleSegmentKeydown($event)',\n '(focus)': 'part() !== \"literal\" && onFocus($event)',\n '(focusout)': 'part() !== \"literal\" && onFocusOut()'\n }\n})\nexport class RdxDateFieldInputDirective {\n private readonly elementRef = inject(ElementRef);\n\n /**\n * The host element of this segment. Consumed by the root to collect focusable\n * segments in DOM order.\n * @ignore\n */\n readonly element: HTMLElement = this.elementRef.nativeElement;\n\n private readonly rootContext = injectDateFieldsRootContext();\n\n /**\n * The part of the date to render\n * `'day' | 'month' | 'year' | 'hour' | 'minute' | 'second' | 'dayPeriod' | 'literal' | 'timeZoneName'`\n */\n readonly part = input<SegmentPart>();\n\n /**\n * @ignore\n */\n readonly disabled = computed(() => this.rootContext.disabled());\n\n /**\n * @ignore\n */\n readonly readonly = computed(() => this.rootContext.readonly());\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => this.rootContext.invalidState());\n\n /** @ignore Tri-state display validity from the root (gated by an enclosing Field). */\n readonly displayValid = computed(() => this.rootContext.displayValid());\n\n /**\n * @ignore\n */\n readonly hasLeftFocus = signal<boolean>(true);\n\n /**\n * @ignore\n */\n readonly lastKeyZero = signal<boolean>(false);\n\n private readonly fieldData = computed(() => {\n return useDateField({\n hasLeftFocus: this.hasLeftFocus,\n lastKeyZero: this.lastKeyZero,\n placeholder: this.rootContext.placeholder,\n hourCycle: this.rootContext.hourCycle(),\n segmentValues: this.rootContext.segmentValues,\n formatter: this.rootContext.formatter(),\n part: <SegmentPart>this.part(),\n disabled: this.rootContext.disabled,\n readonly: this.rootContext.readonly,\n step: this.rootContext.step$,\n modelValue: this.rootContext.value,\n focusNext: this.rootContext.focusNext\n });\n });\n\n private readonly attributes = computed(() => this.fieldData().attributes());\n\n /**\n * Attribute keys applied imperatively on the previous effect run, so keys that\n * disappear from `attributes()` are removed instead of lingering as stale state.\n * @ignore\n */\n private appliedAttrs = new Set<string>();\n\n constructor() {\n effect(() => {\n const element = this.elementRef.nativeElement as HTMLElement;\n const attrs = this.attributes();\n const next = new Set<string>();\n\n for (const [attr, value] of Object.entries(attrs)) {\n // Skip keys a host binding already owns, so this effect never fights it.\n if (hostManagedAttrs.has(attr)) {\n continue;\n }\n\n // A nullish value means the attribute should be absent (e.g. `data-placeholder`\n // once a segment is filled); removing it avoids a literal `\"undefined\"` string.\n if (isNullish(value)) {\n element.removeAttribute(attr);\n } else {\n element.setAttribute(attr, String(value));\n next.add(attr);\n }\n }\n\n for (const attr of this.appliedAttrs) {\n if (!next.has(attr)) {\n element.removeAttribute(attr);\n }\n }\n\n this.appliedAttrs = next;\n });\n }\n\n /**\n * @ignore\n */\n handleSegmentClick(event: Event) {\n this.fieldData().handleSegmentClick(event as MouseEvent);\n }\n\n /**\n * @ignore\n */\n handleSegmentKeydown(event: Event) {\n this.fieldData().handleSegmentKeydown(event as KeyboardEvent);\n }\n\n /**\n * @ignore\n */\n onFocus(e: Event) {\n this.rootContext.setFocusedElement(e.target as HTMLElement);\n }\n\n /**\n * @ignore\n */\n onFocusOut() {\n this.hasLeftFocus.set(true);\n }\n}\n","import {\n booleanAttribute,\n computed,\n contentChildren,\n Directive,\n input,\n linkedSignal,\n model,\n Signal,\n signal\n} from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport {\n ARROW_LEFT,\n ARROW_RIGHT,\n BooleanInput,\n createContent,\n createFormatter,\n DateMatcher,\n DateStep,\n Direction,\n Formatter,\n getDefaultDate,\n Granularity,\n hasTime,\n HourCycle,\n initializeSegmentValues,\n isBefore,\n isNullish,\n isSegmentNavigationKey,\n normalizeDateStep,\n normalizeHourCycle,\n provideToken,\n RdxFormUiControlBase,\n RdxFormValueControl,\n resolveDisplayValid,\n SegmentValueObj,\n syncSegmentValues,\n watch\n} from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { DATE_FIELDS_ROOT_CONTEXT } from './date-field-context.token';\nimport { RdxDateFieldInputDirective } from './date-field-input.directive';\n\n@Directive({\n selector: '[rdxDateFieldRoot]',\n exportAs: 'rdxDateFieldRoot',\n providers: [provideToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)],\n host: {\n role: 'group',\n '[attr.aria-disabled]': 'disabled() ? \"true\" : undefined',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonly() ? \"\" : undefined',\n '[attr.aria-invalid]': 'displayValid() === false ? \"true\" : undefined',\n '[attr.data-invalid]': 'displayValid() === false ? \"\" : undefined',\n '[attr.data-valid]': 'displayValid() === true ? \"\" : undefined',\n '[attr.data-touched]': 'touchedState() ? \"\" : undefined',\n '[attr.data-dirty]': 'dirtyState() ? \"\" : undefined',\n '[attr.dir]': 'dir()',\n\n '(keydown)': 'onKeydown($event)',\n '(focusout)': 'markAsTouched()'\n }\n})\nexport class RdxDateFieldRootDirective\n extends RdxFormUiControlBase\n implements RdxFormValueControl<DateValue | undefined>\n{\n /**\n * The controlled value of the date field.\n */\n readonly value = model<DateValue | undefined>();\n\n /**\n * A matcher that marks specific dates as unavailable; a matched value makes the field invalid.\n */\n readonly isDateUnavailable = input<DateMatcher | undefined>(undefined);\n\n /**\n * The hour cycle to use for formatting times. Defaults to the locale preference\n */\n readonly hourCycle = input<HourCycle>();\n\n /**\n * The granularity to use for formatting the field. Defaults to 'day' if a CalendarDate is provided, otherwise defaults to 'minute'.\n * The field will render segments for each part of the date up to and including the specified granularity.\n */\n readonly granularity = input<Granularity>();\n\n /**\n * The locale to use for formatting dates.\n */\n readonly locale = input<string>('en');\n\n readonly dirInput = input<Direction | undefined>(undefined, { alias: 'dir' });\n readonly dir = injectDirection(this.dirInput);\n\n /**\n * The minimum valid date that can be entered.\n */\n readonly minValue = input<DateValue>();\n\n /**\n * The maximum valid date that can be entered.\n */\n readonly maxValue = input<DateValue>();\n\n /**\n * Whether or not to hide the time zone segment of the field.\n */\n readonly hideTimeZone = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether or not the field is readonly.\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The stepping interval for the time fields. Defaults to 1\n */\n readonly step = input<DateStep>();\n\n readonly step$ = computed(() => normalizeDateStep(this.step()));\n\n /**\n * Locale- and hour-cycle-aware formatter. Recomputed whenever `locale` or\n * `hourCycle` change so segments always render with the current settings.\n * @ignore\n */\n readonly formatter: Signal<Formatter> = computed(() =>\n createFormatter(this.locale(), {\n hourCycle: normalizeHourCycle(this.hourCycle())\n })\n );\n\n /**\n * @ignore\n */\n readonly defaultDate = computed(() =>\n getDefaultDate({\n defaultPlaceholder: undefined,\n granularity: this.granularity(),\n defaultValue: this.value(),\n locale: this.locale()\n })\n );\n\n /**\n * The placeholder date, which is used to determine what month to display when no date is selected. This updates as the user navigates the calendar and can be used to programmatically control the calendar view\n */\n readonly placeholder = model<DateValue | undefined>(this.defaultDate().copy());\n\n // Internal state\n\n /**\n * Segment input parts, collected from the projected content in DOM order. This\n * stays in sync with `segmentContents()` (granularity / locale / value changes\n * add or remove segments) instead of being captured once after view init.\n * @ignore\n */\n private readonly segmentInputs = contentChildren(RdxDateFieldInputDirective);\n\n /**\n * The focusable (non-literal) segment elements, in DOM order.\n * @ignore\n */\n readonly segmentElements = computed(() =>\n this.segmentInputs()\n .filter((seg) => seg.part() !== 'literal')\n .map((seg) => seg.element)\n );\n\n /**\n * @ignore\n */\n readonly currentFocusedElement = signal<HTMLElement | null>(null);\n\n /**\n * @ignore\n */\n readonly inferredGranularity = computed(() => {\n const placeholder = this.placeholder();\n\n if (this.granularity()) return placeholder && !hasTime(placeholder) ? 'day' : this.granularity();\n\n return placeholder && hasTime(placeholder) ? 'minute' : 'day';\n });\n\n /**\n * The per-segment values. Writable so segment editing (via `useDateField`) can\n * update individual parts, but re-synced from the model whenever the value,\n * granularity or formatter change — so a controlled `value` set after init is\n * reflected, and an empty field re-initializes when granularity changes.\n * @ignore\n */\n readonly segmentValues = linkedSignal<\n { value: DateValue | undefined; granularity: Granularity; formatter: Formatter },\n SegmentValueObj\n >({\n source: () => ({\n value: this.value(),\n granularity: <Granularity>this.inferredGranularity(),\n formatter: this.formatter()\n }),\n computation: ({ value, granularity, formatter }) =>\n value ? { ...syncSegmentValues({ value, formatter }) } : { ...initializeSegmentValues(granularity) }\n });\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => {\n if (!this.value()) return false;\n\n if (this.isDateUnavailable()?.(<DateValue>this.value())) return true;\n\n if (this.minValue() && isBefore(<DateValue>this.value(), <DateValue>this.minValue())) return true;\n\n if (this.maxValue() && isBefore(<DateValue>this.maxValue(), <DateValue>this.value())) return true;\n\n return false;\n });\n\n /**\n * @ignore Effective invalid: the built-in range/availability check OR the form-driven\n * `invalid` / `errors` (Signal Forms). Reflected on the root and segments.\n */\n readonly invalidState = computed(() => this.isInvalid() || this.formUi.invalidState());\n /**\n * @ignore Tri-state display validity: the enclosing Field's gated state when inside a `rdxFieldRoot`,\n * else the date-field's own (parse + form) invalidity. Overrides the base (whose default uses only\n * `formUi.invalidState`) so the standalone path keeps the built-in range/availability check.\n */\n override readonly displayValid = computed(() => resolveDisplayValid(this.fieldValidity, this.invalidState));\n /** @ignore */\n readonly touchedState = this.formUi.touchedState;\n /** @ignore */\n readonly dirtyState = this.formUi.dirtyState;\n\n /** @ignore Whether the user has focused a segment — gates dirty tracking so a form/initial seed of `value` doesn't mark dirty. */\n private readonly userInteracted = signal(false);\n\n /** @ignore Mark the field touched (model + `touch` output) for Signal Forms. Called on segment blur. */\n markAsTouched(): void {\n this.formUi.markAsTouched();\n }\n\n /**\n * @ignore\n */\n readonly allSegmentContent = computed(() =>\n createContent({\n granularity: <Granularity>this.inferredGranularity(),\n dateRef: <DateValue>this.placeholder(),\n formatter: this.formatter(),\n hideTimeZone: this.hideTimeZone(),\n hourCycle: this.hourCycle(),\n segmentValues: this.segmentValues(),\n locale: this.locale\n })\n );\n\n /**\n * An array of segments that should be readonly, which prevent user input on them.\n */\n readonly segmentContents = computed(() => this.allSegmentContent().arr);\n\n /**\n * @ignore\n */\n readonly currentSegmentIndex = computed(() =>\n this.segmentElements().findIndex((el) => el === this.currentFocusedElement())\n );\n\n /**\n * @ignore\n */\n readonly prevFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const elements = this.segmentElements();\n const index = this.currentSegmentIndex();\n const prevCondition = sign > 0 ? index < 0 : index > elements.length - 1;\n if (prevCondition) return null;\n\n return elements[index - sign];\n });\n\n /**\n * @ignore\n */\n readonly nextFocusableSegment = computed(() => {\n const sign = this.dir() === 'rtl' ? -1 : 1;\n const elements = this.segmentElements();\n const index = this.currentSegmentIndex();\n const nextCondition = sign < 0 ? index < 0 : index > elements.length - 1;\n if (nextCondition) return null;\n\n return elements[index + sign];\n });\n\n /**\n * @ignore\n */\n readonly focusNext = () => {\n this.nextFocusableSegment()?.focus();\n };\n\n constructor() {\n super();\n\n // Mark dirty when the value changes after the user has interacted (a form/initial seed of\n // `value` lands before any segment focus, so it is excluded).\n watch([this.value], () => {\n if (this.userInteracted()) {\n this.formUi.markDirty();\n }\n });\n\n watch([this.value], ([modelValue]) => {\n if (!isNullish(modelValue) && this.placeholder()?.compare(modelValue) !== 0) {\n this.placeholder.set(modelValue.copy());\n }\n });\n\n // The placeholder is seeded once at construction, before `locale` binds. When the locale\n // selects a different calendar system (e.g. Buddhist, Japanese) and the field is still\n // empty, re-seed it so segments and `getDaysInMonth` use that calendar.\n watch([this.locale], () => {\n if (!isNullish(this.value())) return;\n const next = this.defaultDate();\n if (this.placeholder()?.calendar.identifier !== next.calendar.identifier) {\n this.placeholder.set(next.copy());\n }\n });\n }\n\n /**\n * @ignore\n */\n onKeydown(event: Event) {\n const keyEvent = event as KeyboardEvent;\n const code = keyEvent.code;\n if ([ARROW_LEFT, ARROW_RIGHT].includes(code)) {\n if (!isSegmentNavigationKey(keyEvent.key)) return;\n\n if (code === ARROW_LEFT) {\n this.prevFocusableSegment()?.focus();\n }\n\n if (code === ARROW_RIGHT) {\n this.nextFocusableSegment()?.focus();\n }\n }\n }\n\n /**\n * @ignore\n */\n setFocusedElement(el: HTMLElement) {\n this.currentFocusedElement.set(el);\n this.userInteracted.set(true);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxDateFieldInputDirective } from './src/date-field-input.directive';\nimport { RdxDateFieldRootDirective } from './src/date-field-root.directive';\n\nexport * from './src/date-field-context.token';\nexport * from './src/date-field-input.directive';\nexport * from './src/date-field-root.directive';\n\nconst _imports = [RdxDateFieldRootDirective, RdxDateFieldInputDirective];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._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AAA,CAAA,EAAA,EAAA,CAAA;;AC1J/E,MAAM,QAAQ,GAAG,CAAC,yBAAyB,EAAE,0BAA0B,CAAC;MAM3D,kBAAkB,CAAA;8GAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YANb,yBAAyB,EAAE,0BAA0B,CAAA,EAAA,OAAA,EAAA,CAArD,yBAAyB,EAAE,0BAA0B,CAAA,EAAA,CAAA,CAAA;+GAM1D,kBAAkB,EAAA,CAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACbD;;AAEG;;;;"}
@@ -1,6 +1,6 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, model, input, booleanAttribute, numberAttribute, output, computed, linkedSignal, signal, effect, afterRenderEffect, Directive, ElementRef, afterNextRender, NgModule } from '@angular/core';
3
- import { createContext, watch, createCancelableChangeEventDetails, ENTER } from '@radix-ng/primitives/core';
3
+ import { createContext, RdxFormUiControlBase, watch, createCancelableChangeEventDetails, ENTER } from '@radix-ng/primitives/core';
4
4
  import * as i1 from '@radix-ng/primitives/dismissable-layer';
5
5
  import { RdxFocusOutside, RdxPointerDownOutside } from '@radix-ng/primitives/dismissable-layer';
6
6
 
@@ -9,6 +9,10 @@ const rootContext = () => {
9
9
  const context = inject(RdxEditableRoot);
10
10
  return {
11
11
  disabled: context.disabled,
12
+ invalidState: context.invalidState,
13
+ displayValid: context.displayValid,
14
+ touchedState: context.touchedState,
15
+ dirtyState: context.dirtyState,
12
16
  value: context.value,
13
17
  inputValue: context.inputValue,
14
18
  placeholder: context.$placeholder,
@@ -33,12 +37,19 @@ const rootContext = () => {
33
37
  /**
34
38
  * @group Components
35
39
  */
36
- class RdxEditableRoot {
40
+ class RdxEditableRoot extends RdxFormUiControlBase {
37
41
  constructor() {
42
+ super();
38
43
  this.focusOutside = inject(RdxFocusOutside);
39
44
  this.pointerDownOutside = inject(RdxPointerDownOutside);
40
45
  this.value = model(/* @ts-ignore */
41
46
  ...(ngDevMode ? [undefined, { debugName: "value" }] : /* istanbul ignore next */ []));
47
+ /** @ignore */
48
+ this.invalidState = this.formUi.invalidState;
49
+ /** @ignore */
50
+ this.touchedState = this.formUi.touchedState;
51
+ /** @ignore */
52
+ this.dirtyState = this.formUi.dirtyState;
42
53
  /** Uncontrolled initial value. */
43
54
  this.defaultValue = input(/* @ts-ignore */
44
55
  ...(ngDevMode ? [undefined, { debugName: "defaultValue" }] : /* istanbul ignore next */ []));
@@ -112,6 +123,10 @@ class RdxEditableRoot {
112
123
  canActivateOnFocus() {
113
124
  return !this.suppressFocusActivation;
114
125
  }
126
+ /** @ignore Mark the field touched (model + `touch` output) for Signal Forms. Called on leaving edit mode. */
127
+ markAsTouched() {
128
+ this.formUi.markAsTouched();
129
+ }
115
130
  handleDismiss() {
116
131
  if (this.isEditing()) {
117
132
  if (this.submitMode() === 'blur' || this.submitMode() === 'both') {
@@ -130,12 +145,18 @@ class RdxEditableRoot {
130
145
  if (eventDetails.isCanceled()) {
131
146
  return;
132
147
  }
148
+ const changed = (this.value() ?? '') !== value;
133
149
  this.value.set(value);
150
+ if (changed) {
151
+ this.formUi.markDirty();
152
+ }
153
+ this.markAsTouched();
134
154
  this.restoreFocusOnExit = true;
135
155
  this.isEditing.set(false);
136
156
  }
137
157
  cancel() {
138
158
  this.inputValue.set(this.value());
159
+ this.markAsTouched();
139
160
  this.restoreFocusOnExit = true;
140
161
  this.isEditing.set(false);
141
162
  }
@@ -144,7 +165,7 @@ class RdxEditableRoot {
144
165
  this.isEditing.set(true);
145
166
  }
146
167
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxEditableRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
147
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxEditableRoot, isStandalone: true, selector: "[rdxEditableRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", 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 }, selectOnFocus: { classPropertyName: "selectOnFocus", publicName: "selectOnFocus", isSignal: true, isRequired: false, transformFunction: null }, submitMode: { classPropertyName: "submitMode", publicName: "submitMode", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, startWithEditMode: { classPropertyName: "startWithEditMode", publicName: "startWithEditMode", isSignal: true, isRequired: false, transformFunction: null }, activationMode: { classPropertyName: "activationMode", publicName: "activationMode", isSignal: true, isRequired: false, transformFunction: null }, autoResize: { classPropertyName: "autoResize", publicName: "autoResize", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onValueChange: "onValueChange" }, host: { properties: { "attr.data-dismissable-layer": "\"\"" } }, providers: [provideEditableRootContext(rootContext)], exportAs: ["rdxEditableRoot"], hostDirectives: [{ directive: i1.RdxFocusOutside }, { directive: i1.RdxPointerDownOutside }], ngImport: i0 }); }
168
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxEditableRoot, isStandalone: true, selector: "[rdxEditableRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, defaultValue: { classPropertyName: "defaultValue", publicName: "defaultValue", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", 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 }, selectOnFocus: { classPropertyName: "selectOnFocus", publicName: "selectOnFocus", isSignal: true, isRequired: false, transformFunction: null }, submitMode: { classPropertyName: "submitMode", publicName: "submitMode", isSignal: true, isRequired: false, transformFunction: null }, maxLength: { classPropertyName: "maxLength", publicName: "maxLength", isSignal: true, isRequired: false, transformFunction: null }, startWithEditMode: { classPropertyName: "startWithEditMode", publicName: "startWithEditMode", isSignal: true, isRequired: false, transformFunction: null }, activationMode: { classPropertyName: "activationMode", publicName: "activationMode", isSignal: true, isRequired: false, transformFunction: null }, autoResize: { classPropertyName: "autoResize", publicName: "autoResize", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { value: "valueChange", onValueChange: "onValueChange" }, host: { properties: { "attr.data-dismissable-layer": "\"\"" } }, providers: [provideEditableRootContext(rootContext)], exportAs: ["rdxEditableRoot"], usesInheritance: true, hostDirectives: [{ directive: i1.RdxFocusOutside }, { directive: i1.RdxPointerDownOutside }], ngImport: i0 }); }
148
169
  }
149
170
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxEditableRoot, decorators: [{
150
171
  type: Directive,
@@ -164,7 +185,7 @@ class RdxEditableArea {
164
185
  this.rootContext = injectEditableRootContext();
165
186
  }
166
187
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxEditableArea, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
167
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxEditableArea, isStandalone: true, selector: "[rdxEditableArea]", host: { properties: { "attr.data-placeholder-shown": "rootContext.isEditing() ? undefined : \"\"", "attr.data-focus": "rootContext.isEditing() ? \"\" : undefined", "attr.data-empty": "rootContext.isEmpty() ? \"\" : undefined", "attr.data-readonly": "rootContext.readonly() ? \"\" : undefined", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.data-auto-resize": "rootContext.autoResize() ? \"\" : undefined", "style.display": "rootContext.autoResize() ? \"inline-grid\" : undefined" } }, ngImport: i0 }); }
188
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxEditableArea, isStandalone: true, selector: "[rdxEditableArea]", host: { properties: { "attr.data-placeholder-shown": "rootContext.isEditing() ? undefined : \"\"", "attr.data-focus": "rootContext.isEditing() ? \"\" : undefined", "attr.data-empty": "rootContext.isEmpty() ? \"\" : undefined", "attr.data-readonly": "rootContext.readonly() ? \"\" : undefined", "attr.data-disabled": "rootContext.disabled() ? \"\" : undefined", "attr.data-invalid": "rootContext.displayValid() === false ? \"\" : undefined", "attr.data-valid": "rootContext.displayValid() === true ? \"\" : undefined", "attr.data-touched": "rootContext.touchedState() ? \"\" : undefined", "attr.data-dirty": "rootContext.dirtyState() ? \"\" : undefined", "attr.data-auto-resize": "rootContext.autoResize() ? \"\" : undefined", "style.display": "rootContext.autoResize() ? \"inline-grid\" : undefined" } }, ngImport: i0 }); }
168
189
  }
169
190
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxEditableArea, decorators: [{
170
191
  type: Directive,
@@ -176,6 +197,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
176
197
  '[attr.data-empty]': 'rootContext.isEmpty() ? "" : undefined',
177
198
  '[attr.data-readonly]': 'rootContext.readonly() ? "" : undefined',
178
199
  '[attr.data-disabled]': 'rootContext.disabled() ? "" : undefined',
200
+ '[attr.data-invalid]': 'rootContext.displayValid() === false ? "" : undefined',
201
+ '[attr.data-valid]': 'rootContext.displayValid() === true ? "" : undefined',
202
+ '[attr.data-touched]': 'rootContext.touchedState() ? "" : undefined',
203
+ '[attr.data-dirty]': 'rootContext.dirtyState() ? "" : undefined',
179
204
  '[attr.data-auto-resize]': 'rootContext.autoResize() ? "" : undefined',
180
205
  // Auto-resize overlays the preview and input in a single grid cell so the area
181
206
  // sizes to the larger of the two. This is the layout mechanism for the feature,
@@ -272,7 +297,7 @@ class RdxEditableInput {
272
297
  }
273
298
  }
274
299
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxEditableInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
275
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxEditableInput, isStandalone: true, selector: "input[rdxEditableInput]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "handleInput($event)", "keydown.escape": "rootContext.cancel()", "keydown.enter": "handleSubmitKeyDown($event)" }, properties: { "attr.aria-label": "ariaLabel()", "attr.aria-required": "rootContext.required() ? \"true\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-readonly": "rootContext.readonly() ? \"\" : undefined", "readonly": "rootContext.readonly()", "required": "rootContext.required()", "attr.disabled": "disabled() ? \"\" : undefined", "attr.maxlength": "rootContext.maxLength()", "attr.value": "rootContext.inputValue()", "attr.placeholder": "placeholder()", "attr.data-auto-resize": "rootContext.autoResize() ? \"\" : undefined", "attr.hidden": "rootContext.autoResize() || rootContext.isEditing() ? undefined : \"\"", "style.all": "rootContext.autoResize() ? \"unset\" : undefined", "style.grid-area": "rootContext.autoResize() ? \"1 / 1 / auto / auto\" : undefined", "style.visibility": "rootContext.autoResize() && !rootContext.isEditing() ? \"hidden\" : undefined" } }, ngImport: i0 }); }
300
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxEditableInput, isStandalone: true, selector: "input[rdxEditableInput]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, host: { listeners: { "input": "handleInput($event)", "keydown.escape": "rootContext.cancel()", "keydown.enter": "handleSubmitKeyDown($event)" }, properties: { "attr.aria-label": "ariaLabel()", "attr.aria-required": "rootContext.required() ? \"true\" : undefined", "attr.aria-invalid": "rootContext.displayValid() === false ? \"true\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-readonly": "rootContext.readonly() ? \"\" : undefined", "readonly": "rootContext.readonly()", "required": "rootContext.required()", "attr.disabled": "disabled() ? \"\" : undefined", "attr.maxlength": "rootContext.maxLength()", "attr.value": "rootContext.inputValue()", "attr.placeholder": "placeholder()", "attr.data-auto-resize": "rootContext.autoResize() ? \"\" : undefined", "attr.hidden": "rootContext.autoResize() || rootContext.isEditing() ? undefined : \"\"", "style.all": "rootContext.autoResize() ? \"unset\" : undefined", "style.grid-area": "rootContext.autoResize() ? \"1 / 1 / auto / auto\" : undefined", "style.visibility": "rootContext.autoResize() && !rootContext.isEditing() ? \"hidden\" : undefined" } }, ngImport: i0 }); }
276
301
  }
277
302
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxEditableInput, decorators: [{
278
303
  type: Directive,
@@ -281,6 +306,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
281
306
  host: {
282
307
  '[attr.aria-label]': 'ariaLabel()',
283
308
  '[attr.aria-required]': 'rootContext.required() ? "true" : undefined',
309
+ '[attr.aria-invalid]': 'rootContext.displayValid() === false ? "true" : undefined',
284
310
  '[attr.data-disabled]': 'disabled() ? "" : undefined',
285
311
  '[attr.data-readonly]': 'rootContext.readonly() ? "" : undefined',
286
312
  '[readonly]': 'rootContext.readonly()',