@radix-ng/primitives 1.0.8 → 1.0.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.
Files changed (39) hide show
  1. package/fesm2022/radix-ng-primitives-autocomplete.mjs +11 -3
  2. package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -1
  3. package/fesm2022/radix-ng-primitives-combobox.mjs +11 -3
  4. package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -1
  5. package/fesm2022/radix-ng-primitives-core.mjs +9 -6
  6. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  7. package/fesm2022/radix-ng-primitives-date-field.mjs +18 -8
  8. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
  9. package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs +9 -0
  10. package/fesm2022/radix-ng-primitives-floating-focus-manager.mjs.map +1 -1
  11. package/fesm2022/radix-ng-primitives-focus-scope.mjs +241 -95
  12. package/fesm2022/radix-ng-primitives-focus-scope.mjs.map +1 -1
  13. package/fesm2022/radix-ng-primitives-menu.mjs +97 -9
  14. package/fesm2022/radix-ng-primitives-menu.mjs.map +1 -1
  15. package/fesm2022/radix-ng-primitives-navigation-menu.mjs +17 -3
  16. package/fesm2022/radix-ng-primitives-navigation-menu.mjs.map +1 -1
  17. package/fesm2022/radix-ng-primitives-popper.mjs +148 -23
  18. package/fesm2022/radix-ng-primitives-popper.mjs.map +1 -1
  19. package/fesm2022/radix-ng-primitives-portal.mjs +16 -5
  20. package/fesm2022/radix-ng-primitives-portal.mjs.map +1 -1
  21. package/fesm2022/radix-ng-primitives-presence.mjs +4 -2
  22. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  23. package/fesm2022/radix-ng-primitives-select.mjs +14 -6
  24. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  25. package/fesm2022/radix-ng-primitives-time-field.mjs +12 -4
  26. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  27. package/package.json +1 -5
  28. package/types/radix-ng-primitives-core.d.ts +15 -12
  29. package/types/radix-ng-primitives-date-field.d.ts +14 -4
  30. package/types/radix-ng-primitives-floating-focus-manager.d.ts +7 -0
  31. package/types/radix-ng-primitives-focus-scope.d.ts +61 -44
  32. package/types/radix-ng-primitives-menu.d.ts +14 -3
  33. package/types/radix-ng-primitives-popper.d.ts +136 -43
  34. package/types/radix-ng-primitives-portal.d.ts +18 -8
  35. package/types/radix-ng-primitives-time-field.d.ts +12 -4
  36. package/fesm2022/radix-ng-primitives-focus-guards.mjs +0 -53
  37. package/fesm2022/radix-ng-primitives-focus-guards.mjs.map +0 -1
  38. package/focus-guards/README.md +0 -1
  39. package/types/radix-ng-primitives-focus-guards.d.ts +0 -15
@@ -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, RdxFormUiControlBase, normalizeDateStep, createFormatter, normalizeHourCycle, getDefaultDate, hasTime, syncSegmentValues, initializeSegmentValues, isBefore, resolveDisplayValid, 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, provideExistingToken } 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');
@@ -62,7 +62,7 @@ class RdxDateFieldInputDirective {
62
62
  return useDateField({
63
63
  hasLeftFocus: this.hasLeftFocus,
64
64
  lastKeyZero: this.lastKeyZero,
65
- placeholder: this.rootContext.placeholder,
65
+ placeholder: this.rootContext.effectivePlaceholder,
66
66
  hourCycle: this.rootContext.hourCycle(),
67
67
  segmentValues: this.rootContext.segmentValues,
68
68
  formatter: this.rootContext.formatter(),
@@ -242,6 +242,14 @@ class RdxDateFieldRootDirective extends RdxFormUiControlBase {
242
242
  */
243
243
  this.placeholder = model(this.defaultDate().copy(), /* @ts-ignore */
244
244
  ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
245
+ /**
246
+ * Always-defined placeholder used for segment math. A controlled `[placeholder]` can be reset to
247
+ * `undefined`; fall back to the default date so segment attributes and key handlers never
248
+ * dereference `undefined`.
249
+ * @ignore
250
+ */
251
+ this.effectivePlaceholder = computed(() => this.placeholder() ?? this.defaultDate().copy(), /* @ts-ignore */
252
+ ...(ngDevMode ? [{ debugName: "effectivePlaceholder" }] : /* istanbul ignore next */ []));
245
253
  // Internal state
246
254
  /**
247
255
  * Segment input parts, collected from the projected content in DOM order. This
@@ -268,10 +276,12 @@ class RdxDateFieldRootDirective extends RdxFormUiControlBase {
268
276
  * @ignore
269
277
  */
270
278
  this.inferredGranularity = computed(() => {
271
- const placeholder = this.placeholder();
279
+ // Use the always-defined placeholder: a controlled `[placeholder]` reset to `undefined` while
280
+ // `value` is a date-time must still infer 'minute' (from the default's shape), not drop to 'day'.
281
+ const placeholder = this.effectivePlaceholder();
272
282
  if (this.granularity())
273
- return placeholder && !hasTime(placeholder) ? 'day' : this.granularity();
274
- return placeholder && hasTime(placeholder) ? 'minute' : 'day';
283
+ return !hasTime(placeholder) ? 'day' : this.granularity();
284
+ return hasTime(placeholder) ? 'minute' : 'day';
275
285
  }, /* @ts-ignore */
276
286
  ...(ngDevMode ? [{ debugName: "inferredGranularity" }] : /* istanbul ignore next */ []));
277
287
  /**
@@ -327,7 +337,7 @@ class RdxDateFieldRootDirective extends RdxFormUiControlBase {
327
337
  */
328
338
  this.allSegmentContent = computed(() => createContent({
329
339
  granularity: this.inferredGranularity(),
330
- dateRef: this.placeholder(),
340
+ dateRef: this.effectivePlaceholder(),
331
341
  formatter: this.formatter(),
332
342
  hideTimeZone: this.hideTimeZone(),
333
343
  hourCycle: this.hourCycle(),
@@ -426,14 +436,14 @@ class RdxDateFieldRootDirective extends RdxFormUiControlBase {
426
436
  this.userInteracted.set(true);
427
437
  }
428
438
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxDateFieldRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
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 }); }
439
+ 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: [provideExistingToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)], queries: [{ propertyName: "segmentInputs", predicate: RdxDateFieldInputDirective, isSignal: true }], exportAs: ["rdxDateFieldRoot"], usesInheritance: true, ngImport: i0 }); }
430
440
  }
431
441
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxDateFieldRootDirective, decorators: [{
432
442
  type: Directive,
433
443
  args: [{
434
444
  selector: '[rdxDateFieldRoot]',
435
445
  exportAs: 'rdxDateFieldRoot',
436
- providers: [provideToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)],
446
+ providers: [provideExistingToken(DATE_FIELDS_ROOT_CONTEXT, RdxDateFieldRootDirective)],
437
447
  host: {
438
448
  role: 'group',
439
449
  '[attr.aria-disabled]': 'disabled() ? "true" : undefined',
@@ -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 /** 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: [..._imports]\n})\nexport class RdxDateFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAuBa,wBAAwB,GAAG,IAAI,cAAc,CAAwB,0BAA0B;SAE5F,2BAA2B,GAAA;AACvC,IAAA,OAAO,MAAM,CAAC,wBAAwB,CAAC;AAC3C;;ACvBA;;;;AAIG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;MAmBjD,0BAA0B,CAAA;AAwEnC,IAAA,WAAA,GAAA;AAvEiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAEhD;;;;AAIG;AACM,QAAA,IAAA,CAAA,OAAO,GAAgB,IAAI,CAAC,UAAU,CAAC,aAAa;QAE5C,IAAA,C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A;;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 // Read-only views: consumers only read these. Typed as `Signal<…>` supertypes so the concrete\n // signal kind (transformed input, model, computed) is an implementation detail and mocks stay simple.\n disabled: Signal<boolean>;\n readonly: Signal<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 /** The controlled placeholder; may be `undefined`. Use `effectivePlaceholder` for segment math. */\n placeholder: Signal<DateValue | undefined>;\n /** Always-defined placeholder (falls back to the default date) for segment attributes/key handlers. */\n effectivePlaceholder: Signal<DateValue>;\n hourCycle: Signal<HourCycle | undefined>;\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.effectivePlaceholder,\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 provideExistingToken,\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: [provideExistingToken(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 /**\n * Always-defined placeholder used for segment math. A controlled `[placeholder]` can be reset to\n * `undefined`; fall back to the default date so segment attributes and key handlers never\n * dereference `undefined`.\n * @ignore\n */\n readonly effectivePlaceholder = computed(() => this.placeholder() ?? 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 // Use the always-defined placeholder: a controlled `[placeholder]` reset to `undefined` while\n // `value` is a date-time must still infer 'minute' (from the default's shape), not drop to 'day'.\n const placeholder = this.effectivePlaceholder();\n\n if (this.granularity()) return !hasTime(placeholder) ? 'day' : this.granularity();\n\n return 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: this.effectivePlaceholder(),\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: [..._imports]\n})\nexport class RdxDateFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MA4Ba,wBAAwB,GAAG,IAAI,cAAc,CAAwB,0BAA0B;SAE5F,2BAA2B,GAAA;AACvC,IAAA,OAAO,MAAM,CAAC,wBAAwB,CAAC;AAC3C;;AC5BA;;;;AAIG;AACH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;MAmBjD,0BAA0B,CAAA;AAwEnC,IAAA,WAAA,GAAA;AAvEiB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAEhD;;;;AAIG;AACM,QAAA,IAAA,CAAA,OAAO,GAAgB,IAAI,CAAC,UAAU,CAAC,aAAa;QAE5C,IAAA,CAAA,WAAW,GAAG,2BAA2B,EAAE;AAE5D;;;AAGG;AACM,QAAA,IAAA,CAAA,IAAI,GAAG,KAAK;4FAAe;AAEpC;;AAEG;QACM,IAAA,CAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE;qFAAC;AAE/D;;AAEG;QACM,IAAA,CAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE;qFAAC;AAE/D;;AAEG;QACM,IAAA,CAAA,SAAS,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE;sFAAC;;QAG3D,IAAA,CAAA,YAAY,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE;yFAAC;AAEvE;;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AA+C;AACtE,wBAAA,qBAAqB,EAAE,2CAA2C;AAClE,wBAAA,mBAAmB,EAAE,0CAA0C;AAC/D,wBAAA,qBAAqB,EAAE,iCAAiC;AACxD,wBAAA,mBAAmB,EAAE,+BAA+B;AACpD,wBAAA,YAAY,EAAE,OAAO;AAErB,wBAAA,WAAW,EAAE,mBAAmB;AAChC,wBAAA,YAAY,EAAE;AACjB;AACJ,iBAAA;88CA2GoD,0BAA0B,CAAA,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AClK/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;;;;"}
@@ -403,6 +403,15 @@ class RdxFloatingFocusManager {
403
403
  * - an element (direct or from a callback) → that element (returned **explicitly**, bypassing the
404
404
  * "focus moved elsewhere" guard).
405
405
  */
406
+ /**
407
+ * Public view of {@link resolveReturnFocusTarget} for a **keep-mounted** primitive to apply
408
+ * return-focus on *close* — the composed scope's unmount-driven return never runs while the popup
409
+ * stays in the DOM. Returns an explicit element, `false` (suppress), or `undefined` (default →
410
+ * caller restores the previously-focused element, e.g. the trigger).
411
+ */
412
+ resolveReturnTarget() {
413
+ return this.resolveReturnFocusTarget();
414
+ }
406
415
  resolveReturnFocusTarget() {
407
416
  const resolved = resolveReturnFocus(this.effectiveReturnFocus(), this.effectiveCloseInteractionType());
408
417
  if (resolved === false) {