@radix-ng/primitives 1.0.7 → 1.0.9

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 (54) 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-presence.mjs +4 -2
  22. package/fesm2022/radix-ng-primitives-presence.mjs.map +1 -1
  23. package/fesm2022/radix-ng-primitives-radio.mjs +18 -4
  24. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  25. package/fesm2022/radix-ng-primitives-select.mjs +26 -8
  26. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  27. package/fesm2022/radix-ng-primitives-signal-forms.mjs +184 -0
  28. package/fesm2022/radix-ng-primitives-signal-forms.mjs.map +1 -0
  29. package/fesm2022/radix-ng-primitives-slider.mjs +24 -8
  30. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  31. package/fesm2022/radix-ng-primitives-switch.mjs +29 -5
  32. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  33. package/fesm2022/radix-ng-primitives-time-field.mjs +49 -9
  34. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  35. package/fesm2022/radix-ng-primitives-toggle-group.mjs +23 -12
  36. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  37. package/package.json +11 -1
  38. package/types/radix-ng-primitives-autocomplete.d.ts +21 -2
  39. package/types/radix-ng-primitives-checkbox.d.ts +53 -4
  40. package/types/radix-ng-primitives-combobox.d.ts +51 -2
  41. package/types/radix-ng-primitives-core.d.ts +206 -3
  42. package/types/radix-ng-primitives-date-field.d.ts +27 -2
  43. package/types/radix-ng-primitives-editable.d.ts +15 -2
  44. package/types/radix-ng-primitives-field.d.ts +136 -33
  45. package/types/radix-ng-primitives-form.d.ts +115 -21
  46. package/types/radix-ng-primitives-input.d.ts +8 -1
  47. package/types/radix-ng-primitives-number-field.d.ts +14 -3
  48. package/types/radix-ng-primitives-radio.d.ts +7 -2
  49. package/types/radix-ng-primitives-select.d.ts +11 -3
  50. package/types/radix-ng-primitives-signal-forms.d.ts +97 -0
  51. package/types/radix-ng-primitives-slider.d.ts +9 -7
  52. package/types/radix-ng-primitives-switch.d.ts +15 -2
  53. package/types/radix-ng-primitives-time-field.d.ts +26 -2
  54. package/types/radix-ng-primitives-toggle-group.d.ts +6 -4
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { Directive, inject, computed, input, booleanAttribute, model, output, effect, NgModule } from '@angular/core';
3
3
  import * as i1 from '@radix-ng/primitives/core';
4
- import { createContext, injectControlValueAccessor, injectId, createCancelableChangeEventDetails, RdxControlValueAccessor } from '@radix-ng/primitives/core';
4
+ import { createContext, injectControlValueAccessor, RdxFormUiControlBase, injectId, createCancelableChangeEventDetails, RdxControlValueAccessor } from '@radix-ng/primitives/core';
5
5
 
6
6
  const [injectSwitchContext, provideSwitchContext] = createContext('RdxSwitchContext', 'components/switch');
7
7
 
@@ -53,7 +53,7 @@ const context = () => {
53
53
  value: root.submitValue,
54
54
  ariaLabel: root.ariaLabel,
55
55
  ariaLabelledBy: root.ariaLabelledBy,
56
- markAsTouched: () => cva.markAsTouched()
56
+ markAsTouched: () => root.markAsTouched()
57
57
  };
58
58
  };
59
59
  /**
@@ -61,8 +61,9 @@ const context = () => {
61
61
  *
62
62
  * @see https://base-ui.com/react/components/switch
63
63
  */
64
- class RdxSwitchRoot {
64
+ class RdxSwitchRoot extends RdxFormUiControlBase {
65
65
  constructor() {
66
+ super();
66
67
  /** @ignore */
67
68
  this.cva = injectControlValueAccessor();
68
69
  this.id = input(injectId('rdx-switch-'), /* @ts-ignore */
@@ -120,6 +121,12 @@ class RdxSwitchRoot {
120
121
  /** @ignore */
121
122
  this.isDisabled = computed(() => !!this.cva.disabled(), /* @ts-ignore */
122
123
  ...(ngDevMode ? [{ debugName: "isDisabled" }] : /* istanbul ignore next */ []));
124
+ /** @ignore */
125
+ this.invalidState = this.formUi.invalidState;
126
+ /** @ignore */
127
+ this.touchedState = this.formUi.touchedState;
128
+ /** @ignore */
129
+ this.dirtyState = this.formUi.dirtyState;
123
130
  // Apply the uncontrolled `defaultChecked` once. `input()` values are not bound at field-init,
124
131
  // so the on state must be seeded here — into both the `checked` model and the CVA value, which
125
132
  // is the source of truth for `checkedState`/`aria-checked`/`data-checked`.
@@ -133,6 +140,17 @@ class RdxSwitchRoot {
133
140
  }
134
141
  });
135
142
  }
143
+ /** @ignore Bridge the CVA into `markAsTouched` (dual). */
144
+ formUiTouchTarget() {
145
+ return injectControlValueAccessor();
146
+ }
147
+ /**
148
+ * Mark the switch touched — CVA for Reactive forms, plus the `touched` model + `touch` output for
149
+ * Signal Forms. Called on blur of the root button or the hidden input.
150
+ */
151
+ markAsTouched() {
152
+ this.formUi.markAsTouched();
153
+ }
136
154
  /** @ignore Toggles the checked state unless disabled or read-only. */
137
155
  toggle(event) {
138
156
  if (this.isDisabled() || this.readonly()) {
@@ -147,9 +165,10 @@ class RdxSwitchRoot {
147
165
  }
148
166
  this.checked.set(next);
149
167
  this.cva.setValue(next);
168
+ this.formUi.markDirty();
150
169
  }
151
170
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxSwitchRoot, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
152
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxSwitchRoot, isStandalone: true, selector: "button[rdxSwitchRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, defaultChecked: { classPropertyName: "defaultChecked", publicName: "defaultChecked", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", 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 }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, submitValue: { classPropertyName: "submitValue", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", onCheckedChange: "onCheckedChange" }, host: { attributes: { "role": "switch", "type": "button" }, listeners: { "click": "toggle($event)", "blur": "cva.markAsTouched()" }, properties: { "id": "id()", "attr.aria-checked": "checkedState()", "attr.aria-required": "required() ? \"true\" : undefined", "attr.aria-readonly": "readonly() ? \"true\" : undefined", "attr.data-checked": "checkedState() ? \"\" : undefined", "attr.data-unchecked": "checkedState() ? undefined : \"\"", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-readonly": "readonly() ? \"\" : undefined", "attr.data-required": "required() ? \"\" : undefined", "attr.disabled": "isDisabled() ? \"\" : undefined" } }, providers: [provideSwitchContext(context)], exportAs: ["rdxSwitchRoot"], hostDirectives: [{ directive: i1.RdxControlValueAccessor, inputs: ["value", "checked", "disabled", "disabled"] }], ngImport: i0 }); }
171
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxSwitchRoot, isStandalone: true, selector: "button[rdxSwitchRoot]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, defaultChecked: { classPropertyName: "defaultChecked", publicName: "defaultChecked", isSignal: true, isRequired: false, transformFunction: null }, checked: { classPropertyName: "checked", publicName: "checked", 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 }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, submitValue: { classPropertyName: "submitValue", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, ariaLabelledBy: { classPropertyName: "ariaLabelledBy", publicName: "aria-labelledby", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { checked: "checkedChange", onCheckedChange: "onCheckedChange" }, host: { attributes: { "role": "switch", "type": "button" }, listeners: { "click": "toggle($event)", "blur": "markAsTouched()" }, properties: { "id": "id()", "attr.aria-checked": "checkedState()", "attr.aria-required": "required() ? \"true\" : undefined", "attr.aria-readonly": "readonly() ? \"true\" : undefined", "attr.aria-invalid": "displayValid() === false ? \"true\" : undefined", "attr.data-checked": "checkedState() ? \"\" : undefined", "attr.data-unchecked": "checkedState() ? undefined : \"\"", "attr.data-disabled": "isDisabled() ? \"\" : undefined", "attr.data-readonly": "readonly() ? \"\" : undefined", "attr.data-required": "required() ? \"\" : undefined", "attr.data-invalid": "displayValid() === false ? \"\" : undefined", "attr.data-valid": "displayValid() === true ? \"\" : undefined", "attr.data-touched": "touchedState() ? \"\" : undefined", "attr.data-dirty": "dirtyState() ? \"\" : undefined", "attr.disabled": "isDisabled() ? \"\" : undefined" } }, providers: [provideSwitchContext(context)], exportAs: ["rdxSwitchRoot"], usesInheritance: true, hostDirectives: [{ directive: i1.RdxControlValueAccessor, inputs: ["value", "checked", "disabled", "disabled"] }], ngImport: i0 }); }
153
172
  }
154
173
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxSwitchRoot, decorators: [{
155
174
  type: Directive,
@@ -170,16 +189,21 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
170
189
  '[attr.aria-checked]': 'checkedState()',
171
190
  '[attr.aria-required]': 'required() ? "true" : undefined',
172
191
  '[attr.aria-readonly]': 'readonly() ? "true" : undefined',
192
+ '[attr.aria-invalid]': 'displayValid() === false ? "true" : undefined',
173
193
  '[attr.data-checked]': 'checkedState() ? "" : undefined',
174
194
  '[attr.data-unchecked]': 'checkedState() ? undefined : ""',
175
195
  '[attr.data-disabled]': 'isDisabled() ? "" : undefined',
176
196
  '[attr.data-readonly]': 'readonly() ? "" : undefined',
177
197
  '[attr.data-required]': 'required() ? "" : undefined',
198
+ '[attr.data-invalid]': 'displayValid() === false ? "" : undefined',
199
+ '[attr.data-valid]': 'displayValid() === true ? "" : undefined',
200
+ '[attr.data-touched]': 'touchedState() ? "" : undefined',
201
+ '[attr.data-dirty]': 'dirtyState() ? "" : undefined',
178
202
  // Native `<button rdxSwitchRoot>` → native `disabled` (Base UI's `nativeButton: true` path in
179
203
  // `useFocusableWhenDisabled`). The hidden `[rdxSwitchInput]` is also disabled for form exclusion.
180
204
  '[attr.disabled]': 'isDisabled() ? "" : undefined',
181
205
  '(click)': 'toggle($event)',
182
- '(blur)': 'cva.markAsTouched()'
206
+ '(blur)': 'markAsTouched()'
183
207
  }
184
208
  }]
185
209
  }], ctorParameters: () => [], propDecorators: { id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], defaultChecked: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultChecked", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }, { type: i0.Output, args: ["checkedChange"] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], readonly: [{ type: i0.Input, args: [{ isSignal: true, alias: "readonly", required: false }] }], required: [{ type: i0.Input, args: [{ isSignal: true, alias: "required", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], submitValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], ariaLabelledBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-labelledby", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], onCheckedChange: [{ type: i0.Output, args: ["onCheckedChange"] }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../../../packages/primitives/switch/src/switch-context.ts","../../../packages/primitives/switch/src/switch-input.ts","../../../packages/primitives/switch/src/switch-root.ts","../../../packages/primitives/switch/src/switch-thumb.ts","../../../packages/primitives/switch/index.ts","../../../packages/primitives/switch/radix-ng-primitives-switch.ts"],"sourcesContent":["import { Signal } from '@angular/core';\nimport { createContext } from '@radix-ng/primitives/core';\n\nexport interface RdxSwitchContext {\n /** Whether the switch is on. */\n readonly checked: Signal<boolean>;\n\n /** Whether the switch is disabled. */\n readonly disabled: Signal<boolean>;\n\n /** Whether the switch is read-only (focusable, but cannot be toggled). */\n readonly readonly: Signal<boolean>;\n\n /** Whether the switch must be on to submit the owning form. */\n readonly required: Signal<boolean>;\n\n /** Name of the hidden form input. */\n readonly name: Signal<string | undefined>;\n\n /** Value submitted with the form when the switch is on. */\n readonly value: Signal<string>;\n\n readonly ariaLabel: Signal<string | undefined>;\n readonly ariaLabelledBy: Signal<string | undefined>;\n\n markAsTouched(): void;\n}\n\nexport const [injectSwitchContext, provideSwitchContext] = createContext<RdxSwitchContext>(\n 'RdxSwitchContext',\n 'components/switch'\n);\n","import { Directive } from '@angular/core';\nimport { injectSwitchContext } from './switch-context';\n\n/**\n * The hidden native checkbox that mirrors the switch state for form submission and screen readers.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'input[rdxSwitchInput]',\n exportAs: 'rdxSwitchInput',\n host: {\n type: 'checkbox',\n tabindex: '-1',\n 'aria-hidden': 'true',\n '[attr.name]': 'rootContext.name()',\n '[attr.value]': 'rootContext.value()',\n '[checked]': 'rootContext.checked()',\n '[disabled]': 'rootContext.disabled()',\n '[attr.required]': 'rootContext.required() ? \"\" : undefined',\n '[attr.aria-label]': 'rootContext.ariaLabel()',\n '[attr.aria-labelledby]': 'rootContext.ariaLabelledBy()',\n // The hidden form input carries no `data-*` (Base UI parity) — state attributes live on the\n // root button and thumb.\n style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointer-events: none; opacity: 0; margin: 0;',\n '(blur)': 'rootContext.markAsTouched()'\n }\n})\nexport class RdxSwitchInput {\n protected readonly rootContext = injectSwitchContext();\n}\n","import { booleanAttribute, computed, Directive, effect, inject, input, model, output } from '@angular/core';\nimport {\n BooleanInput,\n createCancelableChangeEventDetails,\n injectControlValueAccessor,\n injectId,\n RdxCancelableChangeEventDetails,\n RdxControlValueAccessor,\n RdxFormCheckboxControl\n} from '@radix-ng/primitives/core';\nimport { provideSwitchContext, RdxSwitchContext } from './switch-context';\n\nexport type RdxSwitchCheckedChangeReason = 'none';\nexport type RdxSwitchCheckedChangeEventDetails = RdxCancelableChangeEventDetails<RdxSwitchCheckedChangeReason>;\n\nexport interface RdxSwitchCheckedChangeEvent {\n checked: boolean;\n eventDetails: RdxSwitchCheckedChangeEventDetails;\n}\n\nconst context = (): RdxSwitchContext => {\n const root = inject(RdxSwitchRoot);\n const cva = injectControlValueAccessor<boolean | undefined>();\n\n return {\n checked: root.checkedState,\n disabled: computed(() => !!cva.disabled()),\n readonly: root.readonly,\n required: root.required,\n name: root.name,\n value: root.submitValue,\n ariaLabel: root.ariaLabel,\n ariaLabelledBy: root.ariaLabelledBy,\n markAsTouched: () => cva.markAsTouched()\n };\n};\n\n/**\n * A control that toggles between on and off.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'button[rdxSwitchRoot]',\n exportAs: 'rdxSwitchRoot',\n providers: [provideSwitchContext(context)],\n hostDirectives: [\n {\n directive: RdxControlValueAccessor,\n inputs: ['value: checked', 'disabled']\n }\n ],\n host: {\n role: 'switch',\n type: 'button',\n '[id]': 'id()',\n '[attr.aria-checked]': 'checkedState()',\n '[attr.aria-required]': 'required() ? \"true\" : undefined',\n '[attr.aria-readonly]': 'readonly() ? \"true\" : undefined',\n '[attr.data-checked]': 'checkedState() ? \"\" : undefined',\n '[attr.data-unchecked]': 'checkedState() ? undefined : \"\"',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonly() ? \"\" : undefined',\n '[attr.data-required]': 'required() ? \"\" : undefined',\n // Native `<button rdxSwitchRoot>` → native `disabled` (Base UI's `nativeButton: true` path in\n // `useFocusableWhenDisabled`). The hidden `[rdxSwitchInput]` is also disabled for form exclusion.\n '[attr.disabled]': 'isDisabled() ? \"\" : undefined',\n '(click)': 'toggle($event)',\n '(blur)': 'cva.markAsTouched()'\n }\n})\nexport class RdxSwitchRoot implements RdxFormCheckboxControl {\n /** @ignore */\n protected readonly cva = injectControlValueAccessor<boolean | undefined>();\n\n readonly id = input<string>(injectId('rdx-switch-'));\n\n /**\n * The state of the switch when it is initially rendered. Use when you do not need to control its state.\n *\n * @default false\n */\n readonly defaultChecked = input<boolean | undefined, BooleanInput | undefined>(undefined, {\n transform: (value) => (value === undefined ? undefined : booleanAttribute(value))\n });\n\n /**\n * The controlled checked state. Use with `(onCheckedChange)` or two-way `[(checked)]`.\n */\n readonly checked = model<boolean>(false);\n\n /**\n * When `true`, prevents the user from interacting with the switch.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * When `true`, the switch is focusable but cannot be toggled.\n *\n * @default false\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * When `true`, the switch must be on before the owning form can be submitted.\n *\n * @default false\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Name of the hidden form input rendered by `[rdxSwitchInput]`. */\n readonly name = input<string>();\n\n /**\n * Value submitted with the form when the switch is on.\n *\n * Bound publicly as `[value]`; the TS member is named `submitValue` so the\n * directive can satisfy `RdxFormCheckboxControl`, whose contract reserves a\n * `value` member for `RdxFormValueControl` and forbids it on checkbox-style\n * controls.\n *\n * @default 'on'\n */\n readonly submitValue = input<string>('on', { alias: 'value' });\n\n readonly ariaLabelledBy = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n /** Event handler called when the checked state of the switch changes. */\n readonly onCheckedChange = output<RdxSwitchCheckedChangeEvent>();\n\n /** @ignore */\n readonly checkedState = computed(() => !!this.cva.value());\n /** @ignore */\n protected readonly isDisabled = computed(() => !!this.cva.disabled());\n\n constructor() {\n // Apply the uncontrolled `defaultChecked` once. `input()` values are not bound at field-init,\n // so the on state must be seeded here — into both the `checked` model and the CVA value, which\n // is the source of truth for `checkedState`/`aria-checked`/`data-checked`.\n let hasAppliedDefault = false;\n effect(() => {\n const defaultChecked = this.defaultChecked();\n if (!hasAppliedDefault && defaultChecked !== undefined) {\n hasAppliedDefault = true;\n this.checked.set(defaultChecked);\n this.cva.setValue(defaultChecked);\n }\n });\n }\n\n /** @ignore Toggles the checked state unless disabled or read-only. */\n toggle(event?: Event): void {\n if (this.isDisabled() || this.readonly()) {\n return;\n }\n\n const next = !this.cva.value();\n const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;\n const { eventDetails } = createCancelableChangeEventDetails(\n 'none',\n event ?? new Event('switch.checked-change'),\n trigger\n );\n this.onCheckedChange.emit({ checked: next, eventDetails });\n if (eventDetails.isCanceled()) {\n return;\n }\n\n this.checked.set(next);\n this.cva.setValue(next);\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitchContext } from './switch-context';\n\n/**\n * The moving part of the switch that indicates whether it is on or off.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'span[rdxSwitchThumb]',\n exportAs: 'rdxSwitchThumb',\n host: {\n '[attr.data-checked]': 'rootContext.checked() ? \"\" : undefined',\n '[attr.data-unchecked]': 'rootContext.checked() ? undefined : \"\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'rootContext.readonly() ? \"\" : undefined',\n '[attr.data-required]': 'rootContext.required() ? \"\" : undefined'\n }\n})\nexport class RdxSwitchThumb {\n protected readonly rootContext = injectSwitchContext();\n}\n","import { NgModule } from '@angular/core';\nimport { RdxSwitchInput } from './src/switch-input';\nimport { RdxSwitchRoot } from './src/switch-root';\nimport { RdxSwitchThumb } from './src/switch-thumb';\n\nexport * from './src/switch-context';\nexport * from './src/switch-input';\nexport * from './src/switch-root';\nexport * from './src/switch-thumb';\n\nexport const switchImports = [RdxSwitchRoot, RdxSwitchInput, RdxSwitchThumb];\n\n@NgModule({\n imports: [...switchImports],\n exports: [...switchImports]\n})\nex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EAAE,CAAC,GAAG,aAAa,CAAC;AAC3B,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa;AAC7B,iBAAA;;;ACfD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-switch.mjs","sources":["../../../packages/primitives/switch/src/switch-context.ts","../../../packages/primitives/switch/src/switch-input.ts","../../../packages/primitives/switch/src/switch-root.ts","../../../packages/primitives/switch/src/switch-thumb.ts","../../../packages/primitives/switch/index.ts","../../../packages/primitives/switch/radix-ng-primitives-switch.ts"],"sourcesContent":["import { Signal } from '@angular/core';\nimport { createContext } from '@radix-ng/primitives/core';\n\nexport interface RdxSwitchContext {\n /** Whether the switch is on. */\n readonly checked: Signal<boolean>;\n\n /** Whether the switch is disabled. */\n readonly disabled: Signal<boolean>;\n\n /** Whether the switch is read-only (focusable, but cannot be toggled). */\n readonly readonly: Signal<boolean>;\n\n /** Whether the switch must be on to submit the owning form. */\n readonly required: Signal<boolean>;\n\n /** Name of the hidden form input. */\n readonly name: Signal<string | undefined>;\n\n /** Value submitted with the form when the switch is on. */\n readonly value: Signal<string>;\n\n readonly ariaLabel: Signal<string | undefined>;\n readonly ariaLabelledBy: Signal<string | undefined>;\n\n markAsTouched(): void;\n}\n\nexport const [injectSwitchContext, provideSwitchContext] = createContext<RdxSwitchContext>(\n 'RdxSwitchContext',\n 'components/switch'\n);\n","import { Directive } from '@angular/core';\nimport { injectSwitchContext } from './switch-context';\n\n/**\n * The hidden native checkbox that mirrors the switch state for form submission and screen readers.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'input[rdxSwitchInput]',\n exportAs: 'rdxSwitchInput',\n host: {\n type: 'checkbox',\n tabindex: '-1',\n 'aria-hidden': 'true',\n '[attr.name]': 'rootContext.name()',\n '[attr.value]': 'rootContext.value()',\n '[checked]': 'rootContext.checked()',\n '[disabled]': 'rootContext.disabled()',\n '[attr.required]': 'rootContext.required() ? \"\" : undefined',\n '[attr.aria-label]': 'rootContext.ariaLabel()',\n '[attr.aria-labelledby]': 'rootContext.ariaLabelledBy()',\n // The hidden form input carries no `data-*` (Base UI parity) — state attributes live on the\n // root button and thumb.\n style: 'transform: translateX(-100%); position: absolute; overflow: hidden; pointer-events: none; opacity: 0; margin: 0;',\n '(blur)': 'rootContext.markAsTouched()'\n }\n})\nexport class RdxSwitchInput {\n protected readonly rootContext = injectSwitchContext();\n}\n","import { booleanAttribute, computed, Directive, effect, inject, input, model, output } from '@angular/core';\nimport {\n BooleanInput,\n createCancelableChangeEventDetails,\n injectControlValueAccessor,\n injectId,\n RdxCancelableChangeEventDetails,\n RdxControlValueAccessor,\n RdxFormCheckboxControl,\n RdxFormUiControlBase,\n RdxFormUiTouchTarget\n} from '@radix-ng/primitives/core';\nimport { provideSwitchContext, RdxSwitchContext } from './switch-context';\n\nexport type RdxSwitchCheckedChangeReason = 'none';\nexport type RdxSwitchCheckedChangeEventDetails = RdxCancelableChangeEventDetails<RdxSwitchCheckedChangeReason>;\n\nexport interface RdxSwitchCheckedChangeEvent {\n checked: boolean;\n eventDetails: RdxSwitchCheckedChangeEventDetails;\n}\n\nconst context = (): RdxSwitchContext => {\n const root = inject(RdxSwitchRoot);\n const cva = injectControlValueAccessor<boolean | undefined>();\n\n return {\n checked: root.checkedState,\n disabled: computed(() => !!cva.disabled()),\n readonly: root.readonly,\n required: root.required,\n name: root.name,\n value: root.submitValue,\n ariaLabel: root.ariaLabel,\n ariaLabelledBy: root.ariaLabelledBy,\n markAsTouched: () => root.markAsTouched()\n };\n};\n\n/**\n * A control that toggles between on and off.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'button[rdxSwitchRoot]',\n exportAs: 'rdxSwitchRoot',\n providers: [provideSwitchContext(context)],\n hostDirectives: [\n {\n directive: RdxControlValueAccessor,\n inputs: ['value: checked', 'disabled']\n }\n ],\n host: {\n role: 'switch',\n type: 'button',\n '[id]': 'id()',\n '[attr.aria-checked]': 'checkedState()',\n '[attr.aria-required]': 'required() ? \"true\" : undefined',\n '[attr.aria-readonly]': 'readonly() ? \"true\" : undefined',\n '[attr.aria-invalid]': 'displayValid() === false ? \"true\" : undefined',\n '[attr.data-checked]': 'checkedState() ? \"\" : undefined',\n '[attr.data-unchecked]': 'checkedState() ? undefined : \"\"',\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'readonly() ? \"\" : undefined',\n '[attr.data-required]': 'required() ? \"\" : 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 // Native `<button rdxSwitchRoot>` → native `disabled` (Base UI's `nativeButton: true` path in\n // `useFocusableWhenDisabled`). The hidden `[rdxSwitchInput]` is also disabled for form exclusion.\n '[attr.disabled]': 'isDisabled() ? \"\" : undefined',\n '(click)': 'toggle($event)',\n '(blur)': 'markAsTouched()'\n }\n})\nexport class RdxSwitchRoot extends RdxFormUiControlBase implements RdxFormCheckboxControl {\n /** @ignore */\n protected readonly cva = injectControlValueAccessor<boolean | undefined>();\n\n readonly id = input<string>(injectId('rdx-switch-'));\n\n /**\n * The state of the switch when it is initially rendered. Use when you do not need to control its state.\n *\n * @default false\n */\n readonly defaultChecked = input<boolean | undefined, BooleanInput | undefined>(undefined, {\n transform: (value) => (value === undefined ? undefined : booleanAttribute(value))\n });\n\n /**\n * The controlled checked state. Use with `(onCheckedChange)` or two-way `[(checked)]`.\n */\n readonly checked = model<boolean>(false);\n\n /**\n * When `true`, prevents the user from interacting with the switch.\n *\n * @default false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * When `true`, the switch is focusable but cannot be toggled.\n *\n * @default false\n */\n readonly readonly = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * When `true`, the switch must be on before the owning form can be submitted.\n *\n * @default false\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /** Name of the hidden form input rendered by `[rdxSwitchInput]`. */\n readonly name = input<string>();\n\n /**\n * Value submitted with the form when the switch is on.\n *\n * Bound publicly as `[value]`; the TS member is named `submitValue` so the\n * directive can satisfy `RdxFormCheckboxControl`, whose contract reserves a\n * `value` member for `RdxFormValueControl` and forbids it on checkbox-style\n * controls.\n *\n * @default 'on'\n */\n readonly submitValue = input<string>('on', { alias: 'value' });\n\n readonly ariaLabelledBy = input<string | undefined>(undefined, { alias: 'aria-labelledby' });\n readonly ariaLabel = input<string | undefined>(undefined, { alias: 'aria-label' });\n\n /** Event handler called when the checked state of the switch changes. */\n readonly onCheckedChange = output<RdxSwitchCheckedChangeEvent>();\n\n /** @ignore */\n readonly checkedState = computed(() => !!this.cva.value());\n /** @ignore */\n protected readonly isDisabled = computed(() => !!this.cva.disabled());\n\n /** @ignore */\n readonly invalidState = this.formUi.invalidState;\n /** @ignore */\n readonly touchedState = this.formUi.touchedState;\n /** @ignore */\n readonly dirtyState = this.formUi.dirtyState;\n\n constructor() {\n super();\n\n // Apply the uncontrolled `defaultChecked` once. `input()` values are not bound at field-init,\n // so the on state must be seeded here — into both the `checked` model and the CVA value, which\n // is the source of truth for `checkedState`/`aria-checked`/`data-checked`.\n let hasAppliedDefault = false;\n effect(() => {\n const defaultChecked = this.defaultChecked();\n if (!hasAppliedDefault && defaultChecked !== undefined) {\n hasAppliedDefault = true;\n this.checked.set(defaultChecked);\n this.cva.setValue(defaultChecked);\n }\n });\n }\n\n /** @ignore Bridge the CVA into `markAsTouched` (dual). */\n protected override formUiTouchTarget(): RdxFormUiTouchTarget {\n return injectControlValueAccessor<boolean | undefined>();\n }\n\n /**\n * Mark the switch touched — CVA for Reactive forms, plus the `touched` model + `touch` output for\n * Signal Forms. Called on blur of the root button or the hidden input.\n */\n markAsTouched(): void {\n this.formUi.markAsTouched();\n }\n\n /** @ignore Toggles the checked state unless disabled or read-only. */\n toggle(event?: Event): void {\n if (this.isDisabled() || this.readonly()) {\n return;\n }\n\n const next = !this.cva.value();\n const trigger = event?.currentTarget instanceof HTMLElement ? event.currentTarget : undefined;\n const { eventDetails } = createCancelableChangeEventDetails(\n 'none',\n event ?? new Event('switch.checked-change'),\n trigger\n );\n this.onCheckedChange.emit({ checked: next, eventDetails });\n if (eventDetails.isCanceled()) {\n return;\n }\n\n this.checked.set(next);\n this.cva.setValue(next);\n this.formUi.markDirty();\n }\n}\n","import { Directive } from '@angular/core';\nimport { injectSwitchContext } from './switch-context';\n\n/**\n * The moving part of the switch that indicates whether it is on or off.\n *\n * @see https://base-ui.com/react/components/switch\n */\n@Directive({\n selector: 'span[rdxSwitchThumb]',\n exportAs: 'rdxSwitchThumb',\n host: {\n '[attr.data-checked]': 'rootContext.checked() ? \"\" : undefined',\n '[attr.data-unchecked]': 'rootContext.checked() ? undefined : \"\"',\n '[attr.data-disabled]': 'rootContext.disabled() ? \"\" : undefined',\n '[attr.data-readonly]': 'rootContext.readonly() ? \"\" : undefined',\n '[attr.data-required]': 'rootContext.required() ? \"\" : undefined'\n }\n})\nexport class RdxSwitchThumb {\n protected readonly rootContext = injectSwitchContext();\n}\n","import { NgModule } from '@angular/core';\nimport { RdxSwitchInput } from './src/switch-input';\nimport { RdxSwitchRoot } from './src/switch-root';\nimport { RdxSwitchThumb } from './src/switch-thumb';\n\nexport * from './src/switch-context';\nexport * from './src/switch-input';\nexport * from './src/switch-root';\nexport * from './src/switch-thumb';\n\nexport const switchImports = [RdxSwitchRoot, RdxSwitchInput, RdxSwitchThumb];\n\n@NgModule({\n imports: [...switchImports],\n exports: [...switchImports]\n})\nexport class RdxSwitchModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;AA4BO,MAAM,CAAC,mBAAmB,EAAE,oBAAoB,CAAC,GAAG,aAAa,CACpE,kBAAkB,EAClB,mBAAmB;;AC3BvB;;;;AAIG;MAqBU,cAAc,CAAA;AApB3B,IA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,cAAc,EAAE,cAAc;MAM9D,eAAe,CAAA;8GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAf,eAAe,EAAA,OAAA,EAAA,CANE,aAAa,EAAE,cAAc,EAAE,cAAc,CAAA,EAAA,OAAA,EAAA,CAA7C,aAAa,EAAE,cAAc,EAAE,cAAc,CAAA,EAAA,CAAA,CAAA;+GAM9D,eAAe,EAAA,CAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAJ3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa,CAAC;AAC3B,oBAAA,OAAO,EAAE,CAAC,GAAG,aAAa;AAC7B,iBAAA;;;ACfD;;AAEG;;;;"}
@@ -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, getDefaultTime, syncSegmentValues, initializeSegmentValues, isBefore, createContent, watch, isSegmentNavigationKey, ARROW_LEFT, ARROW_RIGHT, provideToken } from '@radix-ng/primitives/core';
3
+ import { useDateField, isNullish, RdxFormUiControlBase, normalizeDateStep, createFormatter, normalizeHourCycle, getDefaultTime, syncSegmentValues, initializeSegmentValues, isBefore, resolveDisplayValid, createContent, watch, isSegmentNavigationKey, ARROW_LEFT, ARROW_RIGHT, provideToken } from '@radix-ng/primitives/core';
4
4
  import { toCalendarDateTime, today, getLocalTimeZone, Time, isEqualDay } from '@internationalized/date';
5
5
  import { injectDirection } from '@radix-ng/primitives/direction-provider';
6
6
 
@@ -38,8 +38,11 @@ class RdxTimeFieldInputDirective {
38
38
  /**
39
39
  * @ignore
40
40
  */
41
- this.isInvalid = computed(() => this.rootContext.isInvalid(), /* @ts-ignore */
41
+ this.isInvalid = computed(() => this.rootContext.invalidState(), /* @ts-ignore */
42
42
  ...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
43
+ /** @ignore Tri-state display validity from the root (gated by an enclosing Field). */
44
+ this.displayValid = computed(() => this.rootContext.displayValid(), /* @ts-ignore */
45
+ ...(ngDevMode ? [{ debugName: "displayValid" }] : /* istanbul ignore next */ []));
43
46
  /**
44
47
  * @ignore
45
48
  */
@@ -94,7 +97,7 @@ class RdxTimeFieldInputDirective {
94
97
  this.hasLeftFocus.set(true);
95
98
  }
96
99
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxTimeFieldInputDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
97
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxTimeFieldInputDirective, isStandalone: true, selector: "[rdxTimeFieldInput]", 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\"", "attr.data-rdx-date-field-segment": "part()", "attr.aria-disabled": "disabled() ? \"\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-invalid": "isInvalid() ? \"\" : undefined", "attr.aria-invalid": "isInvalid() ? true : undefined" } }, ngImport: i0 }); }
100
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxTimeFieldInputDirective, isStandalone: true, selector: "[rdxTimeFieldInput]", 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\"", "attr.data-rdx-date-field-segment": "part()", "attr.aria-disabled": "disabled() ? \"\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-invalid": "displayValid() === false ? \"\" : undefined", "attr.aria-invalid": "displayValid() === false ? true : undefined" } }, ngImport: i0 }); }
98
101
  }
99
102
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxTimeFieldInputDirective, decorators: [{
100
103
  type: Directive,
@@ -105,8 +108,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
105
108
  '[attr.data-rdx-date-field-segment]': 'part()',
106
109
  '[attr.aria-disabled]': 'disabled() ? "" : undefined',
107
110
  '[attr.data-disabled]': 'disabled() ? "" : undefined',
108
- '[attr.data-invalid]': 'isInvalid() ? "" : undefined',
109
- '[attr.aria-invalid]': 'isInvalid() ? true : undefined',
111
+ '[attr.data-invalid]': 'displayValid() === false ? "" : undefined',
112
+ '[attr.aria-invalid]': 'displayValid() === false ? true : undefined',
110
113
  '(mousedown)': 'part() !== "literal" && handleSegmentClick($event)',
111
114
  '(keydown)': 'part() !== "literal" && handleSegmentKeydown($event)',
112
115
  '(focus)': 'part() !== "literal" && onFocus($event)',
@@ -137,8 +140,13 @@ function isSameTimeValue(a, b) {
137
140
  return a === b;
138
141
  return a.compare(b) === 0;
139
142
  }
140
- class RdxTimeFieldRootDirective {
143
+ class RdxTimeFieldRootDirective extends RdxFormUiControlBase {
144
+ /** @ignore Mark the field touched (model + `touch` output) for Signal Forms. Called on segment blur. */
145
+ markAsTouched() {
146
+ this.formUi.markAsTouched();
147
+ }
141
148
  constructor() {
149
+ super();
142
150
  /**
143
151
  * The controlled checked state of the calendar.
144
152
  */
@@ -285,6 +293,25 @@ class RdxTimeFieldRootDirective {
285
293
  return false;
286
294
  }, /* @ts-ignore */
287
295
  ...(ngDevMode ? [{ debugName: "isInvalid" }] : /* istanbul ignore next */ []));
296
+ /**
297
+ * @ignore Effective invalid: the built-in range check OR the form-driven `invalid` / `errors`
298
+ * (Signal Forms). Reflected on the root and segments.
299
+ */
300
+ this.invalidState = computed(() => this.isInvalid() || this.formUi.invalidState(), /* @ts-ignore */
301
+ ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
302
+ /**
303
+ * @ignore Tri-state display validity: the enclosing Field's gated state when inside a `rdxFieldRoot`,
304
+ * else the time-field's own (parse + form) invalidity. Overrides the base default (`formUi` only).
305
+ */
306
+ this.displayValid = computed(() => resolveDisplayValid(this.fieldValidity, this.invalidState), /* @ts-ignore */
307
+ ...(ngDevMode ? [{ debugName: "displayValid" }] : /* istanbul ignore next */ []));
308
+ /** @ignore */
309
+ this.touchedState = this.formUi.touchedState;
310
+ /** @ignore */
311
+ this.dirtyState = this.formUi.dirtyState;
312
+ /** @ignore Whether the user has focused a segment — gates dirty tracking so a form/initial seed of `value` doesn't mark dirty. */
313
+ this.userInteracted = signal(false, /* @ts-ignore */
314
+ ...(ngDevMode ? [{ debugName: "userInteracted" }] : /* istanbul ignore next */ []));
288
315
  /**
289
316
  * @ignore
290
317
  */
@@ -341,6 +368,13 @@ class RdxTimeFieldRootDirective {
341
368
  this.focusNext = () => {
342
369
  this.nextFocusableSegment()?.focus();
343
370
  };
371
+ // Mark dirty when the value changes after the user has interacted (a form/initial seed of
372
+ // `value` lands before any segment focus, so it is excluded).
373
+ watch([this.value], () => {
374
+ if (this.userInteracted()) {
375
+ this.formUi.markDirty();
376
+ }
377
+ });
344
378
  watch([this.convertedModelValue], ([value]) => {
345
379
  if (!isNullish(value) &&
346
380
  (!isEqualDay(this.convertedPlaceholder(), value) ||
@@ -378,9 +412,10 @@ class RdxTimeFieldRootDirective {
378
412
  */
379
413
  setFocusedElement(el) {
380
414
  this.currentFocusedElement.set(el);
415
+ this.userInteracted.set(true);
381
416
  }
382
417
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxTimeFieldRootDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
383
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.2", type: RdxTimeFieldRootDirective, isStandalone: true, selector: "[rdxTimeFieldRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", 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() ? \"\" : undefined", "attr.data-disabled": "disabled() ? \"\" : undefined", "attr.data-readonly": "readonly() ? \"\" : undefined", "attr.data-invalid": "isInvalid() ? \"\" : undefined", "attr.dir": "dir()" } }, providers: [provideToken(TIME_FIELDS_ROOT_CONTEXT, RdxTimeFieldRootDirective)], queries: [{ propertyName: "segmentInputs", predicate: RdxTimeFieldInputDirective, isSignal: true }], exportAs: ["rdxTimeFieldRoot"], ngImport: i0 }); }
418
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "22.0.2", type: RdxTimeFieldRootDirective, isStandalone: true, selector: "[rdxTimeFieldRoot]", inputs: { value: { classPropertyName: "value", publicName: "value", 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() ? \"\" : 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(TIME_FIELDS_ROOT_CONTEXT, RdxTimeFieldRootDirective)], queries: [{ propertyName: "segmentInputs", predicate: RdxTimeFieldInputDirective, isSignal: true }], exportAs: ["rdxTimeFieldRoot"], usesInheritance: true, ngImport: i0 }); }
384
419
  }
385
420
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxTimeFieldRootDirective, decorators: [{
386
421
  type: Directive,
@@ -393,9 +428,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
393
428
  '[attr.aria-disabled]': 'disabled() ? "" : undefined',
394
429
  '[attr.data-disabled]': 'disabled() ? "" : undefined',
395
430
  '[attr.data-readonly]': 'readonly() ? "" : undefined',
396
- '[attr.data-invalid]': 'isInvalid() ? "" : undefined',
431
+ '[attr.aria-invalid]': 'displayValid() === false ? "true" : undefined',
432
+ '[attr.data-invalid]': 'displayValid() === false ? "" : undefined',
433
+ '[attr.data-valid]': 'displayValid() === true ? "" : undefined',
434
+ '[attr.data-touched]': 'touchedState() ? "" : undefined',
435
+ '[attr.data-dirty]': 'dirtyState() ? "" : undefined',
397
436
  '[attr.dir]': 'dir()',
398
- '(keydown)': 'onKeydown($event)'
437
+ '(keydown)': 'onKeydown($event)',
438
+ '(focusout)': 'markAsTouched()'
399
439
  }
400
440
  }]
401
441
  }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }, { type: i0.Output, args: ["valueChange"] }], 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(() => RdxTimeFieldInputDirective), { isSignal: true }] }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-time-field.mjs","sources":["../../../packages/primitives/time-field/src/time-field-context.token.ts","../../../packages/primitives/time-field/src/time-field-input.directive.ts","../../../packages/primitives/time-field/src/time-field-root.directive.ts","../../../packages/primitives/time-field/index.ts","../../../packages/primitives/time-field/radix-ng-primitives-time-field.ts"],"sourcesContent":["import { inject, InjectionToken, InputSignal, ModelSignal, Signal, WritableSignal } from '@angular/core';\nimport { DateStep, Formatter, HourCycle, SegmentValueObj, TimeValue } from '@radix-ng/primitives/core';\n\nexport interface TimeFieldContextToken {\n locale: InputSignal<string>;\n value: ModelSignal<TimeValue | undefined>;\n placeholder: ModelSignal<TimeValue>;\n isInvalid: Signal<boolean>;\n disabled: InputSignal<boolean>;\n readonly: InputSignal<boolean>;\n formatter: Signal<Formatter>;\n hourCycle: InputSignal<HourCycle>;\n segmentValues: WritableSignal<SegmentValueObj>;\n focusNext: () => void;\n setFocusedElement: (el: HTMLElement) => void;\n convertedModelValue: WritableSignal<TimeValue | undefined>;\n convertedPlaceholder: WritableSignal<TimeValue>;\n step$: Signal<DateStep>;\n}\n\nexport const TIME_FIELDS_ROOT_CONTEXT = new InjectionToken<TimeFieldContextToken>('TIME_FIELDS_ROOT_CONTEXT');\n\nexport function injectTimeFieldsRootContext(): TimeFieldContextToken {\n return inject(TIME_FIELDS_ROOT_CONTEXT);\n}\n","import { computed, Directive, effect, ElementRef, inject, input, signal, WritableSignal } from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport { SegmentPart, useDateField } from '@radix-ng/primitives/core';\nimport { injectTimeFieldsRootContext } from './time-field-context.token';\n\n@Directive({\n selector: '[rdxTimeFieldInput]',\n host: {\n '[attr.contenteditable]': 'disabled() || readonly() ? false : part() !== \"literal\"',\n '[attr.data-rdx-date-field-segment]': 'part()',\n '[attr.aria-disabled]': 'disabled() ? \"\" : 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 RdxTimeFieldInputDirective {\n private readonly el = 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.el.nativeElement;\n\n private readonly rootContext = injectTimeFieldsRootContext();\n\n /**\n * The part of the date to render\n * `'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.convertedPlaceholder as unknown as WritableSignal<DateValue>,\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 modelValue: this.rootContext.convertedModelValue as unknown as WritableSignal<DateValue>,\n focusNext: this.rootContext.focusNext,\n step: this.rootContext.step$\n });\n });\n\n private readonly attributes = computed(() => this.fieldData().attributes());\n\n /**\n * @ignore\n */\n handleSegmentClick: (e: Event) => void;\n\n /**\n * @ignore\n */\n handleSegmentKeydown: (e: Event) => void;\n\n constructor() {\n effect(() => {\n const { handleSegmentClick, handleSegmentKeydown } = this.fieldData();\n this.handleSegmentKeydown = handleSegmentKeydown as (e: Event) => void;\n this.handleSegmentClick = handleSegmentClick as (e: Event) => void;\n });\n\n effect(() => {\n const attrs = this.attributes();\n Object.entries(attrs).forEach(([attr, value]) => {\n this.el.nativeElement.setAttribute(attr, String(value));\n });\n });\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, getLocalTimeZone, isEqualDay, Time, toCalendarDateTime, today } from '@internationalized/date';\nimport {\n ARROW_LEFT,\n ARROW_RIGHT,\n BooleanInput,\n createContent,\n createFormatter,\n DateStep,\n Direction,\n Formatter,\n getDefaultTime,\n Granularity,\n HourCycle,\n initializeSegmentValues,\n isBefore,\n isNullish,\n isSegmentNavigationKey,\n normalizeDateStep,\n normalizeHourCycle,\n provideToken,\n SegmentValueObj,\n syncSegmentValues,\n TimeValue,\n watch\n} from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { TIME_FIELDS_ROOT_CONTEXT } from './time-field-context.token';\nimport { RdxTimeFieldInputDirective } from './time-field-input.directive';\n\nfunction convertValue(value: TimeValue, date: DateValue = today(getLocalTimeZone())) {\n if (value && 'day' in value) {\n return value;\n }\n\n return toCalendarDateTime(date, value);\n}\n\n/**\n * Map the internal edit buffer (`convertedModelValue`, always a date-bearing value\n * so the segment editor has a date context) back onto the public `value` model.\n * A date-bearing model keeps its shape; a time-only model is exposed as a plain `Time`.\n */\nfunction toModelValue(value: TimeValue, current: TimeValue | undefined): TimeValue {\n if (current && 'day' in current) {\n return value;\n }\n\n return new Time(value.hour, value.minute, value.second, value.millisecond);\n}\n\nfunction isSameTimeValue(a: TimeValue | undefined, b: TimeValue | undefined): boolean {\n if (isNullish(a) || isNullish(b)) return a === b;\n return (a as { compare(other: TimeValue): number }).compare(b) === 0;\n}\n\n@Directive({\n selector: '[rdxTimeFieldRoot]',\n exportAs: 'rdxTimeFieldRoot',\n providers: [provideToken(TIME_FIELDS_ROOT_CONTEXT, RdxTimeFieldRootDirective)],\n host: {\n role: 'group',\n '[attr.aria-disabled]': 'disabled() ? \"\" : 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 RdxTimeFieldRootDirective {\n /**\n * The controlled checked state of the calendar.\n */\n readonly value = model<TimeValue | 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<TimeValue>();\n\n /**\n * The maximum valid date that can be entered.\n */\n readonly maxValue = input<TimeValue>();\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 getDefaultTime({\n defaultPlaceholder: undefined,\n defaultValue: this.value()\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<TimeValue | 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(RdxTimeFieldInputDirective);\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(() => this.granularity() ?? 'minute');\n\n readonly convertedMinValue = computed(() => (this.minValue() ? convertValue(this.minValue()!) : undefined));\n readonly convertedMaxValue = computed(() => (this.maxValue() ? convertValue(this.maxValue()!) : undefined));\n\n readonly convertedModelValue = linkedSignal({\n source: () => {\n if (isNullish(this.value())) return this.value();\n\n return convertValue(this.value()!);\n },\n computation: (value: TimeValue | undefined) => {\n return value;\n }\n });\n\n readonly convertedPlaceholder = linkedSignal({\n source: () => {\n return convertValue(<TimeValue>this.placeholder());\n },\n computation: (value: TimeValue) => {\n return value;\n }\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: TimeValue | undefined; granularity: Granularity; formatter: Formatter },\n SegmentValueObj\n >({\n source: () => ({\n value: this.convertedModelValue(),\n granularity: this.inferredGranularity(),\n formatter: this.formatter()\n }),\n computation: ({ value, granularity, formatter }) =>\n value\n ? { ...syncSegmentValues({ value: <DateValue>value, formatter }) }\n : { ...initializeSegmentValues(granularity, true) }\n });\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => {\n if (!this.value()) return false;\n\n if (\n this.convertedMinValue() &&\n isBefore(<DateValue>this.convertedModelValue(), <DateValue>this.convertedMinValue())\n )\n return true;\n\n if (\n this.convertedMaxValue() &&\n isBefore(<DateValue>this.convertedMaxValue(), <DateValue>this.convertedModelValue())\n )\n return true;\n\n return false;\n });\n\n /**\n * @ignore\n */\n readonly allSegmentContent = computed(() =>\n createContent({\n granularity: this.inferredGranularity(),\n dateRef: <DateValue>this.convertedPlaceholder(),\n formatter: this.formatter(),\n hideTimeZone: this.hideTimeZone(),\n hourCycle: this.hourCycle(),\n segmentValues: this.segmentValues(),\n locale: this.locale,\n isTimeValue: true\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.convertedModelValue], ([value]) => {\n if (\n !isNullish(value) &&\n (!isEqualDay(<DateValue>this.convertedPlaceholder(), <DateValue>value) ||\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n this.convertedPlaceholder().compare(value) !== 0)\n )\n this.placeholder.set(value.copy());\n\n // Segment editing (via `useDateField`) writes the internal `convertedModelValue`\n // buffer; mirror it back onto the public `value` model so two-way binding and\n // `valueChange` fire. The guard keeps this idempotent and breaks the feedback loop\n // (`value` → `convertedModelValue` source → here) once the values agree.\n const next = isNullish(value) ? undefined : toModelValue(value, this.value());\n if (!isSameTimeValue(this.value(), next)) {\n this.value.set(next);\n }\n });\n }\n\n /**\n * @ignore\n */\n onKeydown(event: Event) {\n const keyEvent = event as KeyboardEvent;\n if (!isSegmentNavigationKey(keyEvent.key)) return;\n const code = keyEvent.code;\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 * @ignore\n */\n setFocusedElement(el: HTMLElement) {\n this.currentFocusedElement.set(el);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxTimeFieldInputDirective } from './src/time-field-input.directive';\nimport { RdxTimeFieldRootDirective } from './src/time-field-root.directive';\n\nexport * from './src/time-field-context.token';\nexport * from './src/time-field-input.directive';\nexport * from './src/time-field-root.directive';\n\nconst _imports = [RdxTimeFieldRootDirective, RdxTimeFieldInputDirective];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxTimeFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAoBa,wBAAwB,GAAG,IAAI,cAAc,CAAwB,0BAA0B;SAE5F,2BAA2B,GAAA;AACvC,IAAA,OAAO,MAAM,CAAC,wBAAwB,CAAC;AAC3C;;MCHa,0BAA0B,CAAA;AAwEnC,IAAA,WAAA,GAAA;AAvEiB,QAAA,IAAA,CAAA,EAAE,GAAG,MAAM,CAAC,UAAU,CAAC;AAExC;;;;AAIG;AACM,QAAA,IAAA,CAAA,OAAO,GAAgB,IAAI,CAAC,EAAE,CAAC,aAAa;QAEpC,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,M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AA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACbD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-time-field.mjs","sources":["../../../packages/primitives/time-field/src/time-field-context.token.ts","../../../packages/primitives/time-field/src/time-field-input.directive.ts","../../../packages/primitives/time-field/src/time-field-root.directive.ts","../../../packages/primitives/time-field/index.ts","../../../packages/primitives/time-field/radix-ng-primitives-time-field.ts"],"sourcesContent":["import { inject, InjectionToken, InputSignal, ModelSignal, Signal, WritableSignal } from '@angular/core';\nimport { DateStep, Formatter, HourCycle, SegmentValueObj, TimeValue } from '@radix-ng/primitives/core';\n\nexport interface TimeFieldContextToken {\n locale: InputSignal<string>;\n value: ModelSignal<TimeValue | undefined>;\n placeholder: ModelSignal<TimeValue>;\n isInvalid: Signal<boolean>;\n /** Effective invalid: the built-in range 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 disabled: InputSignal<boolean>;\n readonly: InputSignal<boolean>;\n formatter: Signal<Formatter>;\n hourCycle: InputSignal<HourCycle>;\n segmentValues: WritableSignal<SegmentValueObj>;\n focusNext: () => void;\n setFocusedElement: (el: HTMLElement) => void;\n convertedModelValue: WritableSignal<TimeValue | undefined>;\n convertedPlaceholder: WritableSignal<TimeValue>;\n step$: Signal<DateStep>;\n}\n\nexport const TIME_FIELDS_ROOT_CONTEXT = new InjectionToken<TimeFieldContextToken>('TIME_FIELDS_ROOT_CONTEXT');\n\nexport function injectTimeFieldsRootContext(): TimeFieldContextToken {\n return inject(TIME_FIELDS_ROOT_CONTEXT);\n}\n","import { computed, Directive, effect, ElementRef, inject, input, signal, WritableSignal } from '@angular/core';\nimport { DateValue } from '@internationalized/date';\nimport { SegmentPart, useDateField } from '@radix-ng/primitives/core';\nimport { injectTimeFieldsRootContext } from './time-field-context.token';\n\n@Directive({\n selector: '[rdxTimeFieldInput]',\n host: {\n '[attr.contenteditable]': 'disabled() || readonly() ? false : part() !== \"literal\"',\n '[attr.data-rdx-date-field-segment]': 'part()',\n '[attr.aria-disabled]': 'disabled() ? \"\" : 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 RdxTimeFieldInputDirective {\n private readonly el = 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.el.nativeElement;\n\n private readonly rootContext = injectTimeFieldsRootContext();\n\n /**\n * The part of the date to render\n * `'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.convertedPlaceholder as unknown as WritableSignal<DateValue>,\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 modelValue: this.rootContext.convertedModelValue as unknown as WritableSignal<DateValue>,\n focusNext: this.rootContext.focusNext,\n step: this.rootContext.step$\n });\n });\n\n private readonly attributes = computed(() => this.fieldData().attributes());\n\n /**\n * @ignore\n */\n handleSegmentClick: (e: Event) => void;\n\n /**\n * @ignore\n */\n handleSegmentKeydown: (e: Event) => void;\n\n constructor() {\n effect(() => {\n const { handleSegmentClick, handleSegmentKeydown } = this.fieldData();\n this.handleSegmentKeydown = handleSegmentKeydown as (e: Event) => void;\n this.handleSegmentClick = handleSegmentClick as (e: Event) => void;\n });\n\n effect(() => {\n const attrs = this.attributes();\n Object.entries(attrs).forEach(([attr, value]) => {\n this.el.nativeElement.setAttribute(attr, String(value));\n });\n });\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, getLocalTimeZone, isEqualDay, Time, toCalendarDateTime, today } from '@internationalized/date';\nimport {\n ARROW_LEFT,\n ARROW_RIGHT,\n BooleanInput,\n createContent,\n createFormatter,\n DateStep,\n Direction,\n Formatter,\n getDefaultTime,\n Granularity,\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 TimeValue,\n watch\n} from '@radix-ng/primitives/core';\nimport { injectDirection } from '@radix-ng/primitives/direction-provider';\nimport { TIME_FIELDS_ROOT_CONTEXT } from './time-field-context.token';\nimport { RdxTimeFieldInputDirective } from './time-field-input.directive';\n\nfunction convertValue(value: TimeValue, date: DateValue = today(getLocalTimeZone())) {\n if (value && 'day' in value) {\n return value;\n }\n\n return toCalendarDateTime(date, value);\n}\n\n/**\n * Map the internal edit buffer (`convertedModelValue`, always a date-bearing value\n * so the segment editor has a date context) back onto the public `value` model.\n * A date-bearing model keeps its shape; a time-only model is exposed as a plain `Time`.\n */\nfunction toModelValue(value: TimeValue, current: TimeValue | undefined): TimeValue {\n if (current && 'day' in current) {\n return value;\n }\n\n return new Time(value.hour, value.minute, value.second, value.millisecond);\n}\n\nfunction isSameTimeValue(a: TimeValue | undefined, b: TimeValue | undefined): boolean {\n if (isNullish(a) || isNullish(b)) return a === b;\n return (a as { compare(other: TimeValue): number }).compare(b) === 0;\n}\n\n@Directive({\n selector: '[rdxTimeFieldRoot]',\n exportAs: 'rdxTimeFieldRoot',\n providers: [provideToken(TIME_FIELDS_ROOT_CONTEXT, RdxTimeFieldRootDirective)],\n host: {\n role: 'group',\n '[attr.aria-disabled]': 'disabled() ? \"\" : 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 RdxTimeFieldRootDirective\n extends RdxFormUiControlBase\n implements RdxFormValueControl<TimeValue | undefined>\n{\n /**\n * The controlled checked state of the calendar.\n */\n readonly value = model<TimeValue | 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<TimeValue>();\n\n /**\n * The maximum valid date that can be entered.\n */\n readonly maxValue = input<TimeValue>();\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 getDefaultTime({\n defaultPlaceholder: undefined,\n defaultValue: this.value()\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<TimeValue | 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(RdxTimeFieldInputDirective);\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(() => this.granularity() ?? 'minute');\n\n readonly convertedMinValue = computed(() => (this.minValue() ? convertValue(this.minValue()!) : undefined));\n readonly convertedMaxValue = computed(() => (this.maxValue() ? convertValue(this.maxValue()!) : undefined));\n\n readonly convertedModelValue = linkedSignal({\n source: () => {\n if (isNullish(this.value())) return this.value();\n\n return convertValue(this.value()!);\n },\n computation: (value: TimeValue | undefined) => {\n return value;\n }\n });\n\n readonly convertedPlaceholder = linkedSignal({\n source: () => {\n return convertValue(<TimeValue>this.placeholder());\n },\n computation: (value: TimeValue) => {\n return value;\n }\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: TimeValue | undefined; granularity: Granularity; formatter: Formatter },\n SegmentValueObj\n >({\n source: () => ({\n value: this.convertedModelValue(),\n granularity: this.inferredGranularity(),\n formatter: this.formatter()\n }),\n computation: ({ value, granularity, formatter }) =>\n value\n ? { ...syncSegmentValues({ value: <DateValue>value, formatter }) }\n : { ...initializeSegmentValues(granularity, true) }\n });\n\n /**\n * @ignore\n */\n readonly isInvalid = computed(() => {\n if (!this.value()) return false;\n\n if (\n this.convertedMinValue() &&\n isBefore(<DateValue>this.convertedModelValue(), <DateValue>this.convertedMinValue())\n )\n return true;\n\n if (\n this.convertedMaxValue() &&\n isBefore(<DateValue>this.convertedMaxValue(), <DateValue>this.convertedModelValue())\n )\n return true;\n\n return false;\n });\n\n /**\n * @ignore Effective invalid: the built-in range check OR the form-driven `invalid` / `errors`\n * (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 time-field's own (parse + form) invalidity. Overrides the base default (`formUi` only).\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: this.inferredGranularity(),\n dateRef: <DateValue>this.convertedPlaceholder(),\n formatter: this.formatter(),\n hideTimeZone: this.hideTimeZone(),\n hourCycle: this.hourCycle(),\n segmentValues: this.segmentValues(),\n locale: this.locale,\n isTimeValue: true\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.convertedModelValue], ([value]) => {\n if (\n !isNullish(value) &&\n (!isEqualDay(<DateValue>this.convertedPlaceholder(), <DateValue>value) ||\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-expect-error\n this.convertedPlaceholder().compare(value) !== 0)\n )\n this.placeholder.set(value.copy());\n\n // Segment editing (via `useDateField`) writes the internal `convertedModelValue`\n // buffer; mirror it back onto the public `value` model so two-way binding and\n // `valueChange` fire. The guard keeps this idempotent and breaks the feedback loop\n // (`value` → `convertedModelValue` source → here) once the values agree.\n const next = isNullish(value) ? undefined : toModelValue(value, this.value());\n if (!isSameTimeValue(this.value(), next)) {\n this.value.set(next);\n }\n });\n }\n\n /**\n * @ignore\n */\n onKeydown(event: Event) {\n const keyEvent = event as KeyboardEvent;\n if (!isSegmentNavigationKey(keyEvent.key)) return;\n const code = keyEvent.code;\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 * @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 { RdxTimeFieldInputDirective } from './src/time-field-input.directive';\nimport { RdxTimeFieldRootDirective } from './src/time-field-root.directive';\n\nexport * from './src/time-field-context.token';\nexport * from './src/time-field-input.directive';\nexport * from './src/time-field-root.directive';\n\nconst _imports = [RdxTimeFieldRootDirective, RdxTimeFieldInputDirective];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxTimeFieldModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;MAwBa,wBAAwB,GAAG,IAAI,cAAc,CAAwB,0BAA0B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