@radix-ng/primitives 1.0.6 → 1.0.7

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/aspect-ratio/README.md +1 -1
  2. package/fesm2022/radix-ng-primitives-accordion.mjs +6 -1
  3. package/fesm2022/radix-ng-primitives-accordion.mjs.map +1 -1
  4. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs +9 -34
  5. package/fesm2022/radix-ng-primitives-aspect-ratio.mjs.map +1 -1
  6. package/fesm2022/radix-ng-primitives-avatar.mjs +69 -18
  7. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-checkbox.mjs +5 -9
  9. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-collapsible.mjs +4 -3
  11. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  12. package/fesm2022/radix-ng-primitives-field.mjs +13 -14
  13. package/fesm2022/radix-ng-primitives-field.mjs.map +1 -1
  14. package/fesm2022/radix-ng-primitives-form.mjs +1 -1
  15. package/fesm2022/radix-ng-primitives-form.mjs.map +1 -1
  16. package/fesm2022/radix-ng-primitives-label.mjs +5 -4
  17. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  18. package/fesm2022/radix-ng-primitives-number-field.mjs +7 -3
  19. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
  20. package/fesm2022/radix-ng-primitives-progress.mjs +37 -22
  21. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  22. package/fesm2022/radix-ng-primitives-radio.mjs +1 -6
  23. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  24. package/fesm2022/radix-ng-primitives-scroll-area.mjs +4 -4
  25. package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
  26. package/fesm2022/radix-ng-primitives-separator.mjs +7 -13
  27. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  28. package/fesm2022/radix-ng-primitives-slider.mjs +1 -2
  29. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  30. package/fesm2022/radix-ng-primitives-switch.mjs +3 -3
  31. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  32. package/fesm2022/radix-ng-primitives-tabs.mjs +4 -4
  33. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  34. package/fesm2022/radix-ng-primitives-toggle-group.mjs +10 -4
  35. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  36. package/fesm2022/radix-ng-primitives-toggle.mjs +24 -29
  37. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  38. package/fesm2022/radix-ng-primitives-toolbar.mjs +15 -2
  39. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  40. package/package.json +1 -1
  41. package/types/radix-ng-primitives-accordion.d.ts +1 -0
  42. package/types/radix-ng-primitives-aspect-ratio.d.ts +10 -23
  43. package/types/radix-ng-primitives-avatar.d.ts +51 -25
  44. package/types/radix-ng-primitives-checkbox.d.ts +26 -98
  45. package/types/radix-ng-primitives-field.d.ts +33 -207
  46. package/types/radix-ng-primitives-form.d.ts +24 -33
  47. package/types/radix-ng-primitives-label.d.ts +3 -2
  48. package/types/radix-ng-primitives-number-field.d.ts +1 -1
  49. package/types/radix-ng-primitives-progress.d.ts +59 -121
  50. package/types/radix-ng-primitives-radio.d.ts +0 -1
  51. package/types/radix-ng-primitives-separator.d.ts +0 -7
  52. package/types/radix-ng-primitives-toggle-group.d.ts +7 -3
  53. package/types/radix-ng-primitives-toggle.d.ts +8 -8
  54. package/types/radix-ng-primitives-toolbar.d.ts +2 -0
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-field.mjs","sources":["../../../packages/primitives/field/src/field-root.ts","../../../packages/primitives/field/src/field-control.ts","../../../packages/primitives/field/src/field-description.ts","../../../packages/primitives/field/src/field-error.ts","../../../packages/primitives/field/src/field-label.ts","../../../packages/primitives/field/radix-ng-primitives-field.ts"],"sourcesContent":["import { booleanAttribute, computed, DestroyRef, Directive, ElementRef, inject, input, signal } from '@angular/core';\nimport { BooleanInput, createContext, RdxValidationError } from '@radix-ng/primitives/core';\nimport { injectFormRootContext, RdxFormFieldRegistration } from '@radix-ng/primitives/form';\n\nlet fieldId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * External owner of field state. An adapter (e.g. a future Signal Forms\n * `[rdxSignalField]` directive, or a Reactive Forms bridge) registers one via\n * `setStateProvider` so Field reads authoritative form state instead of\n * self-computing it from the DOM. Each member is an optional signal-like\n * accessor; only the states the adapter owns need to be provided — the rest\n * fall back to the root's inputs / DOM heuristic. Keeping these as plain\n * `() => boolean` accessors keeps Field framework-agnostic (no dependency on\n * `@angular/forms/signals`).\n *\n * See ADR 0004 and `signal-forms-readiness.md` (prep #4).\n */\nexport interface RdxFieldState {\n invalid?: () => boolean;\n disabled?: () => boolean;\n required?: () => boolean;\n dirty?: () => boolean;\n touched?: () => boolean;\n filled?: () => boolean;\n focused?: () => boolean;\n /**\n * Optional source of error *content* (not just the invalid boolean). When provided and non-empty\n * it forces `invalidState` true, and its messages (`message ?? kind` per error) surface through\n * `RdxFieldError.messages()` ahead of any enclosing Form's external messages. Uses `core`'s\n * framework-free shim type so the seam stays free of `@angular/forms/signals` (ADR 0004 amendment).\n */\n errors?: () => RdxValidationError[];\n}\n\nconst addId = (ids: string[], id: string) => (ids.includes(id) ? ids : [...ids, id]);\nconst removeId = (ids: string[], id: string) => ids.filter((item) => item !== id);\n\nconst fieldRootContext = () => {\n const root = injectFieldRoot();\n\n return {\n controlId: root.controlId,\n name: root.name,\n descriptionIds: root.descriptionIds,\n errorIds: root.errorIds,\n /** Combined external messages (state provider's, then enclosing Form's), for `RdxFieldError`. */\n messages: root.messages,\n /** Notify an enclosing Form that this field's control was edited (composite-control opt-in). */\n notifyEdited: () => root.notifyEdited(),\n invalidState: root.invalidState,\n disabledState: root.disabledState,\n requiredState: root.requiredState,\n dirtyState: root.dirtyState,\n touchedState: root.touchedState,\n filledState: root.filledState,\n focusedState: root.focusedState,\n setControlId: (id: string) => root.controlId.set(id),\n addDescriptionId: (id: string) => root.descriptionIds.update((ids) => addId(ids, id)),\n removeDescriptionId: (id: string) => root.descriptionIds.update((ids) => removeId(ids, id)),\n addErrorId: (id: string) => root.errorIds.update((ids) => addId(ids, id)),\n removeErrorId: (id: string) => root.errorIds.update((ids) => removeId(ids, id)),\n setFocused: (value: boolean) => root.focusedValue.set(value),\n setFilled: (value: boolean) => root.filledValue.set(value),\n setDirty: (value: boolean) => root.dirtyValue.set(value),\n setTouched: (value: boolean) => root.touchedValue.set(value),\n /**\n * Register (or clear with `null`) an external owner of field state.\n * While a provider is registered, any state it exposes takes precedence\n * over the root inputs and the DOM-derived values. Returns the previous\n * provider so adapters can restore it on teardown.\n */\n setStateProvider: (provider: RdxFieldState | null) => root.setStateProvider(provider),\n hasStateProvider: root.hasStateProvider\n };\n};\n\nexport type RdxFieldRootContext = ReturnType<typeof fieldRootContext>;\n\nexport const [injectFieldRootContext, provideFieldRootContext] = createContext<RdxFieldRootContext>(\n 'RdxFieldRoot',\n 'components/field'\n);\n\n/**\n * Groups a form control with its label, description, error message, and field state.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldRoot]',\n exportAs: 'rdxFieldRoot',\n providers: [provideFieldRootContext(fieldRootContext)],\n host: {\n '[attr.data-invalid]': 'dataAttr(invalidState())',\n '[attr.data-valid]': 'dataAttr(!invalidState())',\n '[attr.data-disabled]': 'dataAttr(disabledState())',\n '[attr.data-required]': 'dataAttr(requiredState())',\n '[attr.data-dirty]': 'dataAttr(dirtyState())',\n '[attr.data-touched]': 'dataAttr(touchedState())',\n '[attr.data-filled]': 'dataAttr(filledState())',\n '[attr.data-focused]': 'dataAttr(focusedState())',\n '(input)': 'notifyEdited()',\n '(change)': 'notifyEdited()'\n }\n})\nexport class RdxFieldRoot {\n /**\n * Whether the field is invalid.\n *\n * @group Props\n * @defaultValue false\n */\n readonly invalid = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field is disabled.\n *\n * @group Props\n * @defaultValue false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field is required.\n *\n * @group Props\n * @defaultValue false\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field value has changed from its initial value.\n *\n * @group Props\n * @defaultValue false\n */\n readonly dirty = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field has been blurred after receiving focus.\n *\n * @group Props\n * @defaultValue false\n */\n readonly touched = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Overrides whether the control has a non-empty value.\n *\n * @group Props\n */\n readonly filled = input<boolean>();\n\n /**\n * Overrides whether the control is focused.\n *\n * @group Props\n */\n readonly focused = input<boolean>();\n\n /**\n * Identifies the field to an enclosing Form for external (server) error matching. Fields without a\n * `name` never match external errors.\n *\n * @group Props\n */\n readonly name = input<string>();\n\n /** The enclosing Form, if any. All Form-related behavior is a no-op when this is `null`. */\n private readonly formContext = injectFormRootContext(true);\n\n readonly controlId = signal(`rdx-field-control-${fieldId++}`);\n readonly descriptionIds = signal<string[]>([]);\n readonly errorIds = signal<string[]>([]);\n\n readonly focusedValue = signal(false);\n readonly filledValue = signal(false);\n readonly dirtyValue = signal(false);\n readonly touchedValue = signal(false);\n\n /** External state owner registered through the context; `null` when Field self-computes. */\n private readonly stateProvider = signal<RdxFieldState | null>(null);\n\n /** Whether an external adapter currently owns field state. */\n readonly hasStateProvider = computed(() => this.stateProvider() !== null);\n\n /** Error content from a registered state provider (e.g. a Signal Forms adapter). */\n private readonly providerErrors = computed(() => this.stateProvider()?.errors?.() ?? []);\n\n /** External messages from the enclosing Form matched by this field's `name`. */\n readonly externalErrors = computed(() => this.formContext?.errorsFor(this.name()) ?? []);\n\n /** Provider messages first (`message ?? kind`), then the Form's external messages. */\n readonly messages = computed(() => [\n ...this.providerErrors().map((error) => error.message ?? error.kind),\n ...this.externalErrors()\n ]);\n\n // External errors (provider content or Form server errors) force invalid regardless of the input or\n // a provider's `invalid` accessor — a server error must show even when client-side validity passes.\n readonly invalidState = computed(() => {\n if (this.externalErrors().length > 0 || this.providerErrors().length > 0) {\n return true;\n }\n return this.resolve('invalid', () => this.invalid());\n });\n readonly disabledState = computed(() => this.resolve('disabled', () => this.disabled()));\n readonly requiredState = computed(() => this.resolve('required', () => this.required()));\n readonly dirtyState = computed(() => this.resolve('dirty', () => this.dirty() || this.dirtyValue()));\n readonly touchedState = computed(() => this.resolve('touched', () => this.touched() || this.touchedValue()));\n readonly filledState = computed(() => this.resolve('filled', () => this.filled() ?? this.filledValue()));\n readonly focusedState = computed(() => this.resolve('focused', () => this.focused() ?? this.focusedValue()));\n\n protected readonly dataAttr = attr;\n\n constructor() {\n // Register with an enclosing Form (if any) for aggregate state, submit guard, and reset; a\n // standalone field never enters this branch and behaves exactly as before.\n const formContext = this.formContext;\n if (formContext) {\n const registration: RdxFormFieldRegistration = {\n name: () => this.name(),\n invalid: () => this.invalidState(),\n dirty: () => this.dirtyState(),\n touched: () => this.touchedState(),\n focus: () => this.focusControl(),\n resetState: () => this.resetState()\n };\n const unregister = formContext.register(registration);\n inject(DestroyRef).onDestroy(unregister);\n }\n }\n\n /** Notify the enclosing Form (if any) that this field's control was edited (clear-on-edit). */\n notifyEdited(): void {\n this.formContext?.notifyEdited(this.name());\n }\n\n /** Reset interaction state on native form reset: touched/dirty/focused → false, filled re-synced. */\n resetState(): void {\n this.touchedValue.set(false);\n this.dirtyValue.set(false);\n this.focusedValue.set(false);\n const control = this.controlElement();\n const value = control?.value ?? '';\n this.filledValue.set(value != null && value !== '');\n }\n\n /** Focus the field's control (used by the Form's first-invalid-focus on blocked submit). */\n private focusControl(): void {\n this.controlElement()?.focus();\n }\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /**\n * The field's control element, found by `controlId` but scoped to this field's own subtree — a\n * duplicate or consumer-reused id elsewhere on the page can't steal focus/reset. The control\n * registers its id through `setControlId`, so this matches the same element the labels point at.\n */\n private controlElement(): HTMLInputElement | null {\n return this.host.querySelector<HTMLInputElement>(`[id=\"${this.controlId()}\"]`);\n }\n\n /**\n * Register an external owner of field state, returning the previous one.\n * @ignore\n */\n setStateProvider(provider: RdxFieldState | null): RdxFieldState | null {\n const previous = this.stateProvider();\n this.stateProvider.set(provider);\n return previous;\n }\n\n /**\n * Prefer the registered provider's value for `key` when it exposes one,\n * otherwise fall back to the root inputs / DOM-derived signals.\n */\n private resolve(key: Exclude<keyof RdxFieldState, 'errors'>, fallback: () => boolean): boolean {\n const accessor = this.stateProvider()?.[key];\n return accessor ? accessor() : fallback();\n }\n}\n\nfunction injectFieldRoot(): RdxFieldRoot {\n return inject(RdxFieldRoot);\n}\n","import { afterNextRender, computed, Directive, effect, ElementRef, inject, input } from '@angular/core';\nimport { injectFieldRootContext } from './field-root';\n\nlet controlId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Connects a form control to the field label, description, error, and state.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldControl]',\n exportAs: 'rdxFieldControl',\n host: {\n '[attr.id]': 'id()',\n '[attr.aria-describedby]': 'describedBy()',\n '[attr.aria-invalid]': 'rootContext.invalidState() ? \"true\" : undefined',\n '[attr.aria-required]': 'rootContext.requiredState() ? \"true\" : undefined',\n '[attr.aria-disabled]': 'rootContext.disabledState() ? \"true\" : undefined',\n '[attr.disabled]': 'isNativeFormControl() && rootContext.disabledState() ? \"\" : undefined',\n '[attr.required]': 'isNativeFormControl() && rootContext.requiredState() ? \"\" : undefined',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-valid]': 'dataAttr(!rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())',\n '[attr.data-required]': 'dataAttr(rootContext.requiredState())',\n '[attr.data-filled]': 'dataAttr(rootContext.filledState())',\n '[attr.data-focused]': 'dataAttr(rootContext.focusedState())',\n '(focus)': 'onFocus()',\n '(blur)': 'onBlur()',\n '(input)': 'syncFilled()',\n '(change)': 'syncFilled()'\n }\n})\nexport class RdxFieldControl {\n protected readonly rootContext = injectFieldRootContext();\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private initialValue = '';\n\n /**\n * Control id. Labels and descriptions use this value for accessible relationships.\n *\n * @group Props\n */\n readonly id = input(`rdx-field-control-${controlId++}`);\n\n protected readonly describedBy = computed(() => {\n const ids = [\n ...this.rootContext.descriptionIds(),\n ...(this.rootContext.invalidState() ? this.rootContext.errorIds() : [])\n ];\n\n return ids.length ? ids.join(' ') : undefined;\n });\n\n constructor() {\n effect(() => {\n this.rootContext.setControlId(this.id());\n });\n\n afterNextRender(() => {\n this.initialValue = this.currentValue();\n this.syncFilled();\n });\n }\n\n onFocus(): void {\n this.rootContext.setFocused(true);\n }\n\n onBlur(): void {\n this.rootContext.setFocused(false);\n this.rootContext.setTouched(true);\n }\n\n syncFilled(): void {\n const value = this.currentValue();\n\n this.rootContext.setFilled(Array.isArray(value) ? value.length > 0 : value != null && value !== '');\n this.rootContext.setDirty(value !== this.initialValue);\n }\n\n protected isNativeFormControl(): boolean {\n return ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(this.elementRef.nativeElement.tagName);\n }\n\n protected readonly dataAttr = attr;\n\n private currentValue(): string {\n const element = this.elementRef.nativeElement as HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;\n return element.value ?? '';\n }\n}\n","import { Directive, effect, input } from '@angular/core';\nimport { injectFieldRootContext } from './field-root';\n\nlet descriptionId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Describes the field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldDescription]',\n exportAs: 'rdxFieldDescription',\n host: {\n '[attr.id]': 'id()',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'\n }\n})\nexport class RdxFieldDescription {\n protected readonly rootContext = injectFieldRootContext();\n\n /**\n * Description id.\n *\n * @group Props\n */\n readonly id = input(`rdx-field-description-${descriptionId++}`);\n\n constructor() {\n effect((onCleanup) => {\n const id = this.id();\n this.rootContext.addDescriptionId(id);\n onCleanup(() => this.rootContext.removeDescriptionId(id));\n });\n }\n\n protected readonly dataAttr = attr;\n}\n","import { Directive, effect, input } from '@angular/core';\nimport { injectFieldRootContext } from './field-root';\n\nlet errorId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Describes an invalid field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldError]',\n exportAs: 'rdxFieldError',\n host: {\n '[attr.id]': 'id()',\n '[attr.hidden]': 'rootContext.invalidState() ? undefined : \"\"',\n '[attr.aria-live]': '\"polite\"',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'\n }\n})\nexport class RdxFieldError {\n protected readonly rootContext = injectFieldRootContext();\n\n /**\n * Error message id.\n *\n * @group Props\n */\n readonly id = input(`rdx-field-error-${errorId++}`);\n\n /**\n * The field's external messages (state provider's, then enclosing Form's), `[]` when none. Render\n * them explicitly via the `exportAs` reference — the directive never injects text content itself:\n * `<p rdxFieldError #err=\"rdxFieldError\">{{ err.messages().join(' ') }}</p>`.\n */\n readonly messages = this.rootContext.messages;\n\n constructor() {\n effect((onCleanup) => {\n const id = this.id();\n this.rootContext.addErrorId(id);\n onCleanup(() => this.rootContext.removeErrorId(id));\n });\n }\n\n protected readonly dataAttr = attr;\n}\n","import { Directive, input } from '@angular/core';\nimport { rdxCheckLabelElement } from '@radix-ng/primitives/core';\nimport { injectFieldRootContext } from './field-root';\n\nlet labelId = 0;\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Labels the field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldLabel]',\n exportAs: 'rdxFieldLabel',\n host: {\n '[attr.id]': 'id()',\n '[attr.for]': 'htmlFor()',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())',\n '[attr.data-required]': 'dataAttr(rootContext.requiredState())'\n }\n})\nexport class RdxFieldLabel {\n protected readonly rootContext = injectFieldRootContext();\n\n /**\n * Label id.\n *\n * @group Props\n */\n readonly id = input(`rdx-field-label-${labelId++}`);\n\n readonly htmlFor = () => this.rootContext.controlId();\n\n constructor() {\n rdxCheckLabelElement('rdxFieldLabel', 'field/unassociated-label', 'components/field');\n }\n\n protected readonly dataAttr = attr;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["attr"],"mappings":";;;;;AAIA,IAAI,OAAO,GAAG,CAAC;AAEf,MAAMA,MAAI,GAAG,CAAC,KAAc,MAAM,KAAK,GAAG,EAAE,GAAG,SAAS,CAAC;AA+BzD,MAAM,KAAK,GAAG,CAAC,GAAa,EAAE,EAAU,MAAM,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,EAAE,CAAC,CAAC;AACpF,MAAM,QAAQ,GAAG,CAAC,GAAa,EAAE,EAAU,KAAK,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,IAAI,KAAK,EAAE,CAAC;AAEjF,MAAM,gBAAgB,GAAG,MAAK;AAC1B,IAAA,MAAM,IAAI,GAAG,eAAe,EAAE;IAE9B,OAAO;QACH,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,cAAc,EAAE,IAAI,CAAC,cAAc;QACnC,QAAQ,EAAE,IAAI,CAAC,QAAQ;;QAEvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;;AAEvB,QAAA,YAAY,EAAE,MAAM,I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/primitives/field/src/field-control.ts","../../../packages/primitives/field/src/field-description.ts","../../../packages/primitives/field/src/field-error.ts","../../../packages/primitives/field/src/field-label.ts","../../../packages/primitives/field/radix-ng-primitives-field.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n signal,\n Signal\n} from '@angular/core';\nimport { BooleanInput, createContext, injectId, RdxValidationError } from '@radix-ng/primitives/core';\nimport { injectFormRootContext, RdxFormFieldRegistration } from '@radix-ng/primitives/form';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * External owner of field state. An adapter (e.g. a future Signal Forms\n * `[rdxSignalField]` directive, or a Reactive Forms bridge) registers one via\n * `setStateProvider` so Field reads authoritative form state instead of\n * self-computing it from the DOM. Each member is an optional signal-like\n * accessor; only the states the adapter owns need to be provided — the rest\n * fall back to the root's inputs / DOM heuristic. Keeping these as plain\n * `() => boolean` accessors keeps Field framework-agnostic (no dependency on\n * `@angular/forms/signals`).\n *\n * See ADR 0004 and `signal-forms-readiness.md` (prep #4).\n */\nexport interface RdxFieldState {\n invalid?: () => boolean;\n disabled?: () => boolean;\n required?: () => boolean;\n dirty?: () => boolean;\n touched?: () => boolean;\n filled?: () => boolean;\n focused?: () => boolean;\n /**\n * Optional source of error *content* (not just the invalid boolean). When provided and non-empty\n * it forces `invalidState` true, and its messages (`message ?? kind` per error) surface through\n * `RdxFieldError.messages()` ahead of any enclosing Form's external messages. Uses `core`'s\n * framework-free shim type so the seam stays free of `@angular/forms/signals` (ADR 0004 amendment).\n */\n errors?: () => RdxValidationError[];\n}\n\nconst addId = (ids: string[], id: string) => (ids.includes(id) ? ids : [...ids, id]);\nconst removeId = (ids: string[], id: string) => ids.filter((item) => item !== id);\n\nexport interface RdxFieldRootContext {\n controlId: Signal<string>;\n name: Signal<string | undefined>;\n descriptionIds: Signal<string[]>;\n errorIds: Signal<string[]>;\n messages: Signal<string[]>;\n notifyEdited: () => void;\n invalidState: Signal<boolean>;\n disabledState: Signal<boolean>;\n requiredState: Signal<boolean>;\n dirtyState: Signal<boolean>;\n touchedState: Signal<boolean>;\n filledState: Signal<boolean>;\n focusedState: Signal<boolean>;\n setControlId: (id: string) => void;\n addDescriptionId: (id: string) => void;\n removeDescriptionId: (id: string) => void;\n addErrorId: (id: string) => void;\n removeErrorId: (id: string) => void;\n setFocused: (value: boolean) => void;\n setFilled: (value: boolean) => void;\n setDirty: (value: boolean) => void;\n setTouched: (value: boolean) => void;\n setStateProvider: (provider: RdxFieldState | null) => RdxFieldState | null;\n hasStateProvider: Signal<boolean>;\n}\n\nconst fieldRootContext = (): RdxFieldRootContext => {\n const root = injectFieldRoot();\n\n return {\n controlId: root.controlId,\n name: root.name,\n descriptionIds: root.descriptionIds,\n errorIds: root.errorIds,\n /** Combined external messages (state provider's, then enclosing Form's), for `RdxFieldError`. */\n messages: root.messages,\n /** Notify an enclosing Form that this field's control was edited (composite-control opt-in). */\n notifyEdited: () => root.notifyEdited(),\n invalidState: root.invalidState,\n disabledState: root.disabledState,\n requiredState: root.requiredState,\n dirtyState: root.dirtyState,\n touchedState: root.touchedState,\n filledState: root.filledState,\n focusedState: root.focusedState,\n setControlId: (id: string) => root.controlId.set(id),\n addDescriptionId: (id: string) => root.descriptionIds.update((ids) => addId(ids, id)),\n removeDescriptionId: (id: string) => root.descriptionIds.update((ids) => removeId(ids, id)),\n addErrorId: (id: string) => root.errorIds.update((ids) => addId(ids, id)),\n removeErrorId: (id: string) => root.errorIds.update((ids) => removeId(ids, id)),\n setFocused: (value: boolean) => root.focusedValue.set(value),\n setFilled: (value: boolean) => root.filledValue.set(value),\n setDirty: (value: boolean) => root.dirtyValue.set(value),\n setTouched: (value: boolean) => root.touchedValue.set(value),\n /**\n * Register (or clear with `null`) an external owner of field state.\n * While a provider is registered, any state it exposes takes precedence\n * over the root inputs and the DOM-derived values. Returns the previous\n * provider so adapters can restore it on teardown.\n */\n setStateProvider: (provider: RdxFieldState | null) => root.setStateProvider(provider),\n hasStateProvider: root.hasStateProvider\n };\n};\n\nexport const [injectFieldRootContext, provideFieldRootContext] = createContext<RdxFieldRootContext>(\n 'RdxFieldRoot',\n 'components/field'\n);\n\n/**\n * Groups a form control with its label, description, error message, and field state.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldRoot]',\n exportAs: 'rdxFieldRoot',\n providers: [provideFieldRootContext(fieldRootContext)],\n host: {\n '[attr.data-invalid]': 'dataAttr(invalidState())',\n '[attr.data-valid]': 'dataAttr(!invalidState())',\n '[attr.data-disabled]': 'dataAttr(disabledState())',\n '[attr.data-required]': 'dataAttr(requiredState())',\n '[attr.data-dirty]': 'dataAttr(dirtyState())',\n '[attr.data-touched]': 'dataAttr(touchedState())',\n '[attr.data-filled]': 'dataAttr(filledState())',\n '[attr.data-focused]': 'dataAttr(focusedState())',\n '(input)': 'notifyEdited()',\n '(change)': 'notifyEdited()'\n }\n})\nexport class RdxFieldRoot {\n /**\n * Whether the field is invalid.\n *\n * @group Props\n * @defaultValue false\n */\n readonly invalid = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field is disabled.\n *\n * @group Props\n * @defaultValue false\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field is required.\n *\n * @group Props\n * @defaultValue false\n */\n readonly required = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field value has changed from its initial value.\n *\n * @group Props\n * @defaultValue false\n */\n readonly dirty = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Whether the field has been blurred after receiving focus.\n *\n * @group Props\n * @defaultValue false\n */\n readonly touched = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Overrides whether the control has a non-empty value.\n *\n * @group Props\n */\n readonly filled = input<boolean>();\n\n /**\n * Overrides whether the control is focused.\n *\n * @group Props\n */\n readonly focused = input<boolean>();\n\n /**\n * Identifies the field to an enclosing Form for external (server) error matching. Fields without a\n * `name` never match external errors.\n *\n * @group Props\n */\n readonly name = input<string>();\n\n /** The enclosing Form, if any. All Form-related behavior is a no-op when this is `null`. */\n private readonly formContext = injectFormRootContext(true);\n\n readonly controlId = signal(injectId('rdx-field-control-'));\n readonly descriptionIds = signal<string[]>([]);\n readonly errorIds = signal<string[]>([]);\n\n readonly focusedValue = signal(false);\n readonly filledValue = signal(false);\n readonly dirtyValue = signal(false);\n readonly touchedValue = signal(false);\n\n /** External state owner registered through the context; `null` when Field self-computes. */\n private readonly stateProvider = signal<RdxFieldState | null>(null);\n\n /** Whether an external adapter currently owns field state. */\n readonly hasStateProvider = computed(() => this.stateProvider() !== null);\n\n /** Error content from a registered state provider (e.g. a Signal Forms adapter). */\n private readonly providerErrors = computed(() => this.stateProvider()?.errors?.() ?? []);\n\n /** External messages from the enclosing Form matched by this field's `name`. */\n readonly externalErrors = computed(() => this.formContext?.errorsFor(this.name()) ?? []);\n\n /** Provider messages first (`message ?? kind`), then the Form's external messages. */\n readonly messages = computed(() => [\n ...this.providerErrors().map((error) => error.message ?? error.kind),\n ...this.externalErrors()\n ]);\n\n // External errors (provider content or Form server errors) force invalid regardless of the input or\n // a provider's `invalid` accessor — a server error must show even when client-side validity passes.\n readonly invalidState = computed(() => {\n if (this.externalErrors().length > 0 || this.providerErrors().length > 0) {\n return true;\n }\n return this.resolve('invalid', () => this.invalid());\n });\n readonly disabledState = computed(() => this.resolve('disabled', () => this.disabled()));\n readonly requiredState = computed(() => this.resolve('required', () => this.required()));\n readonly dirtyState = computed(() => this.resolve('dirty', () => this.dirty() || this.dirtyValue()));\n readonly touchedState = computed(() => this.resolve('touched', () => this.touched() || this.touchedValue()));\n readonly filledState = computed(() => this.resolve('filled', () => this.filled() ?? this.filledValue()));\n readonly focusedState = computed(() => this.resolve('focused', () => this.focused() ?? this.focusedValue()));\n\n protected readonly dataAttr = attr;\n\n constructor() {\n // Register with an enclosing Form (if any) for aggregate state, submit guard, and reset; a\n // standalone field never enters this branch and behaves exactly as before.\n const formContext = this.formContext;\n if (formContext) {\n const registration: RdxFormFieldRegistration = {\n name: () => this.name(),\n invalid: () => this.invalidState(),\n dirty: () => this.dirtyState(),\n touched: () => this.touchedState(),\n focus: () => this.focusControl(),\n resetState: () => this.resetState()\n };\n const unregister = formContext.register(registration);\n inject(DestroyRef).onDestroy(unregister);\n }\n }\n\n /** Notify the enclosing Form (if any) that this field's control was edited (clear-on-edit). */\n notifyEdited(): void {\n this.formContext?.notifyEdited(this.name());\n }\n\n /** Reset interaction state on native form reset: touched/dirty/focused → false, filled re-synced. */\n resetState(): void {\n this.touchedValue.set(false);\n this.dirtyValue.set(false);\n this.focusedValue.set(false);\n const control = this.controlElement();\n const value = control?.value ?? '';\n this.filledValue.set(value != null && value !== '');\n }\n\n /** Focus the field's control (used by the Form's first-invalid-focus on blocked submit). */\n private focusControl(): void {\n this.controlElement()?.focus();\n }\n\n private readonly host = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n\n /**\n * The field's control element, found by `controlId` but scoped to this field's own subtree — a\n * duplicate or consumer-reused id elsewhere on the page can't steal focus/reset. The control\n * registers its id through `setControlId`, so this matches the same element the labels point at.\n */\n private controlElement(): HTMLInputElement | null {\n return this.host.querySelector<HTMLInputElement>(`[id=\"${this.controlId()}\"]`);\n }\n\n /**\n * Register an external owner of field state, returning the previous one.\n * @ignore\n */\n setStateProvider(provider: RdxFieldState | null): RdxFieldState | null {\n const previous = this.stateProvider();\n this.stateProvider.set(provider);\n return previous;\n }\n\n /**\n * Prefer the registered provider's value for `key` when it exposes one,\n * otherwise fall back to the root inputs / DOM-derived signals.\n */\n private resolve(key: Exclude<keyof RdxFieldState, 'errors'>, fallback: () => boolean): boolean {\n const accessor = this.stateProvider()?.[key];\n return accessor ? accessor() : fallback();\n }\n}\n\nfunction injectFieldRoot(): RdxFieldRoot {\n return inject(RdxFieldRoot);\n}\n","import { afterNextRender, computed, Directive, effect, ElementRef, inject, input } from '@angular/core';\nimport { injectId } from '@radix-ng/primitives/core';\nimport { injectFieldRootContext } from './field-root';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Connects a form control to the field label, description, error, and state.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldControl]',\n exportAs: 'rdxFieldControl',\n host: {\n '[attr.id]': 'id()',\n '[attr.aria-describedby]': 'describedBy()',\n '[attr.aria-invalid]': 'rootContext.invalidState() ? \"true\" : undefined',\n // On a native control the native `required`/`disabled` attributes already convey the state, so\n // `aria-required`/`aria-disabled` are only emitted on non-native (custom) controls.\n '[attr.aria-required]': '!isNativeFormControl() && rootContext.requiredState() ? \"true\" : undefined',\n '[attr.aria-disabled]': '!isNativeFormControl() && rootContext.disabledState() ? \"true\" : undefined',\n '[attr.disabled]': 'isNativeFormControl() && rootContext.disabledState() ? \"\" : undefined',\n '[attr.required]': 'isNativeFormControl() && rootContext.requiredState() ? \"\" : undefined',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-valid]': 'dataAttr(!rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())',\n '[attr.data-required]': 'dataAttr(rootContext.requiredState())',\n '[attr.data-dirty]': 'dataAttr(rootContext.dirtyState())',\n '[attr.data-touched]': 'dataAttr(rootContext.touchedState())',\n '[attr.data-filled]': 'dataAttr(rootContext.filledState())',\n '[attr.data-focused]': 'dataAttr(rootContext.focusedState())',\n '(focus)': 'onFocus()',\n '(blur)': 'onBlur()',\n '(input)': 'syncFilled()',\n '(change)': 'syncFilled()'\n }\n})\nexport class RdxFieldControl {\n protected readonly rootContext = injectFieldRootContext();\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private initialValue = '';\n\n /**\n * Control id. Labels and descriptions use this value for accessible relationships.\n *\n * @group Props\n */\n readonly id = input(injectId('rdx-field-control-'));\n\n protected readonly describedBy = computed(() => {\n const ids = [\n ...this.rootContext.descriptionIds(),\n ...(this.rootContext.invalidState() ? this.rootContext.errorIds() : [])\n ];\n\n return ids.length ? ids.join(' ') : undefined;\n });\n\n constructor() {\n effect(() => {\n this.rootContext.setControlId(this.id());\n });\n\n afterNextRender(() => {\n this.initialValue = this.currentValue();\n this.syncFilled();\n });\n }\n\n onFocus(): void {\n this.rootContext.setFocused(true);\n }\n\n onBlur(): void {\n this.rootContext.setFocused(false);\n this.rootContext.setTouched(true);\n }\n\n syncFilled(): void {\n const value = this.currentValue();\n\n this.rootContext.setFilled(Array.isArray(value) ? value.length > 0 : value != null && value !== '');\n this.rootContext.setDirty(value !== this.initialValue);\n }\n\n protected isNativeFormControl(): boolean {\n return ['INPUT', 'SELECT', 'TEXTAREA', 'BUTTON'].includes(this.elementRef.nativeElement.tagName);\n }\n\n protected readonly dataAttr = attr;\n\n private currentValue(): string {\n const element = this.elementRef.nativeElement as HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;\n return element.value ?? '';\n }\n}\n","import { Directive, effect, input } from '@angular/core';\nimport { injectId } from '@radix-ng/primitives/core';\nimport { injectFieldRootContext } from './field-root';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Describes the field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldDescription]',\n exportAs: 'rdxFieldDescription',\n host: {\n '[attr.id]': 'id()',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'\n }\n})\nexport class RdxFieldDescription {\n protected readonly rootContext = injectFieldRootContext();\n\n /**\n * Description id.\n *\n * @group Props\n */\n readonly id = input(injectId('rdx-field-description-'));\n\n constructor() {\n effect((onCleanup) => {\n const id = this.id();\n this.rootContext.addDescriptionId(id);\n onCleanup(() => this.rootContext.removeDescriptionId(id));\n });\n }\n\n protected readonly dataAttr = attr;\n}\n","import { Directive, effect, input } from '@angular/core';\nimport { injectId } from '@radix-ng/primitives/core';\nimport { injectFieldRootContext } from './field-root';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Describes an invalid field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldError]',\n exportAs: 'rdxFieldError',\n host: {\n '[attr.id]': 'id()',\n '[attr.hidden]': 'rootContext.invalidState() ? undefined : \"\"',\n '[attr.aria-live]': '\"polite\"',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())'\n }\n})\nexport class RdxFieldError {\n protected readonly rootContext = injectFieldRootContext();\n\n /**\n * Error message id.\n *\n * @group Props\n */\n readonly id = input(injectId('rdx-field-error-'));\n\n /**\n * The field's external messages (state provider's, then enclosing Form's), `[]` when none. Render\n * them explicitly via the `exportAs` reference — the directive never injects text content itself:\n * `<p rdxFieldError #err=\"rdxFieldError\">{{ err.messages().join(' ') }}</p>`.\n */\n readonly messages = this.rootContext.messages;\n\n constructor() {\n effect((onCleanup) => {\n const id = this.id();\n this.rootContext.addErrorId(id);\n onCleanup(() => this.rootContext.removeErrorId(id));\n });\n }\n\n protected readonly dataAttr = attr;\n}\n","import { Directive, input } from '@angular/core';\nimport { injectId, rdxCheckLabelElement } from '@radix-ng/primitives/core';\nimport { injectFieldRootContext } from './field-root';\n\nconst attr = (value: boolean) => (value ? '' : undefined);\n\n/**\n * Labels the field control.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxFieldLabel]',\n exportAs: 'rdxFieldLabel',\n host: {\n '[attr.id]': 'id()',\n '[attr.for]': 'htmlFor()',\n '[attr.data-invalid]': 'dataAttr(rootContext.invalidState())',\n '[attr.data-disabled]': 'dataAttr(rootContext.disabledState())',\n '[attr.data-required]': 'dataAttr(rootContext.requiredState())'\n }\n})\nexport class RdxFieldLabel {\n protected readonly rootContext = injectFieldRootContext();\n\n /**\n * Label id.\n *\n * @group Props\n */\n readonly id = input(injectId('rdx-field-label-'));\n\n readonly htmlFor = () => this.rootContext.controlId();\n\n constructor() {\n rdxCheckLabelElement('rdxFieldLabel', 'field/unassociated-label', 'components/field');\n }\n\n protected readonly dataAtt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AAA,EAAA,MAAA,EAAA,UAAA,EAAA,WAAA,EAAA,mBAAA,EAAA,sCAAA,EAAA,oBAAA,EAAA,uCAAA,EAAA,oBAAA,EAAA,uCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,eAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAXzB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,eAAe;AACzB,oBAAA,IAAI,EAAE;AACF,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,YAAY,EAAE,WAAW;AACzB,wBAAA,qBAAqB,EAAE,sCAAsC;AAC7D,wBAAA,sBAAsB,EAAE,uCAAuC;AAC/D,wBAAA,sBAAsB,EAAE;AAC3B;AACJ,iBAAA;;;ACrBD;;AAEG;;;;"}
@@ -91,7 +91,7 @@ class RdxFormRoot {
91
91
  return;
92
92
  }
93
93
  const values = serializeFormData(new FormData(this.form));
94
- this.onFormSubmit.emit({ values, event });
94
+ this.onFormSubmit.emit({ values, reason: 'none', event });
95
95
  }
96
96
  onReset() {
97
97
  // Don't prevent the native reset — control values revert on their own.
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-form.mjs","sources":["../../../packages/primitives/form/src/form-root.ts","../../../packages/primitives/form/index.ts","../../../packages/primitives/form/radix-ng-primitives-form.ts"],"sourcesContent":["import {\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n linkedSignal,\n output,\n signal\n} from '@angular/core';\nimport { createContext } from '@radix-ng/primitives/core';\n\n/** A normalized external-error map: each field name maps to its message(s) in display order. */\nexport type RdxFormErrors = Record<string, string | string[]>;\n\n/** Payload of {@link RdxFormRoot.onFormSubmit}. */\nexport interface RdxFormSubmitEvent {\n /** The form's values serialized from `FormData` (repeated names collapse into arrays). */\n values: Record<string, FormDataEntryValue | FormDataEntryValue[]>;\n /** The original native submit event (already `preventDefault`-ed). */\n event: SubmitEvent;\n}\n\n/**\n * What a {@link RdxFieldRoot} registers with an enclosing Form. Structural `() =>` accessors keep the\n * Form entry free of any import from `field` (acyclic ng-packagr graph: `field` → `form`).\n */\nexport interface RdxFormFieldRegistration {\n /** The field's `name` (key external errors match against), or `undefined`. */\n name: () => string | undefined;\n /** The field's merged invalid state (includes external errors). */\n invalid: () => boolean;\n /** Whether the field is dirty. */\n dirty: () => boolean;\n /** Whether the field is touched. */\n touched: () => boolean;\n /** Focus the field's control (by its `controlId`). */\n focus: () => void;\n /** Reset the field's interaction state (touched/dirty/focused → false, filled re-sync). */\n resetState: () => void;\n}\n\n/**\n * External owner of form-level state (e.g. a future Signal Forms `[rdxSignalForm]` adapter). Mirrors\n * Field's `RdxFieldState` seam one level up. Each member is optional: a provided accessor wins over the\n * built-in registry/`errors`-input behavior; absent accessors leave the built-in behavior untouched.\n * Kept as framework-free `() =>` accessors (no `@angular/forms/signals` dependency). See ADR 0004.\n */\nexport interface RdxFormState {\n invalid?: () => boolean;\n dirty?: () => boolean;\n touched?: () => boolean;\n submitting?: () => boolean;\n /** Per-name external error source; while provided, the `errors` input + clear-on-edit are inert. */\n errorsFor?: (name: string) => string[];\n}\n\nconst formRootContext = () => {\n const root = inject(RdxFormRoot);\n return {\n errorsFor: (name: string | undefined) => root.errorsFor(name),\n notifyEdited: (name: string | undefined) => root.notifyEdited(name),\n register: (field: RdxFormFieldRegistration) => root.register(field),\n setStateProvider: (provider: RdxFormState | null) => root.setStateProvider(provider),\n hasStateProvider: root.hasStateProvider\n };\n};\n\nexport type RdxFormRootContext = ReturnType<typeof formRootContext>;\n\nexport const [injectFormRootContext, provideFormRootContext] = createContext<RdxFormRootContext>(\n 'RdxFormRoot',\n 'components/form'\n);\n\n/** Collapses `FormData` into a plain object; repeated names collapse into arrays. */\nfunction serializeFormData(data: FormData): Record<string, FormDataEntryValue | FormDataEntryValue[]> {\n const values: Record<string, FormDataEntryValue | FormDataEntryValue[]> = {};\n data.forEach((value, key) => {\n // `Object.hasOwn`, not `key in values` — a control named after an Object.prototype member\n // (`toString`, `constructor`, …) must not be misread as a duplicate.\n if (Object.hasOwn(values, key)) {\n const existing = values[key];\n values[key] = Array.isArray(existing) ? [...existing, value] : [existing, value];\n } else {\n values[key] = value;\n }\n });\n return values;\n}\n\n/**\n * The top of the forms layer cake: a single directive on the native `<form>` element that aggregates\n * field state, maps external (server) errors onto fields by `name`, intercepts submit (values-as-object,\n * focus the first invalid field), and resets field interaction state on native `reset`. It owns no\n * values and runs no validation — Angular form systems (or Field inputs) remain the source of validity.\n *\n * @group Components\n */\n@Directive({\n selector: 'form[rdxFormRoot]',\n exportAs: 'rdxFormRoot',\n providers: [provideFormRootContext(formRootContext)],\n host: {\n novalidate: '',\n '[attr.data-invalid]': 'anyInvalid() ? \"\" : undefined',\n '[attr.data-dirty]': 'anyDirty() ? \"\" : undefined',\n '[attr.data-touched]': 'anyTouched() ? \"\" : undefined',\n '[attr.data-submitting]': 'submitting() ? \"\" : undefined',\n '(submit)': 'onSubmit($event)',\n '(reset)': 'onReset()'\n }\n})\nexport class RdxFormRoot {\n private readonly form = inject<ElementRef<HTMLFormElement>>(ElementRef).nativeElement;\n\n /** External/server validation errors keyed by `Field.Root` `name`. */\n readonly errors = input<RdxFormErrors | null | undefined>();\n\n /** Emits the remaining error map after a field's external error is cleared by a user edit (or reset). */\n readonly onClearErrors = output<RdxFormErrors>();\n\n /** Emits the serialized form values when a valid form is submitted. */\n readonly onFormSubmit = output<RdxFormSubmitEvent>();\n\n private readonly fields = signal<RdxFormFieldRegistration[]>([]);\n\n private readonly stateProvider = signal<RdxFormState | null>(null);\n\n /** Whether an external adapter currently owns form-level state. */\n readonly hasStateProvider = computed(() => this.stateProvider() !== null);\n\n /**\n * Names whose external error has been cleared by a user edit. Reset to empty whenever a new `errors`\n * object reference is assigned — the server just spoke, so everything it said is live again.\n */\n private readonly clearedNames = linkedSignal<RdxFormErrors | null | undefined, Set<string>>({\n source: this.errors,\n computation: () => new Set<string>()\n });\n\n /** The `errors` input minus cleared names, normalized to `string[]`. */\n private readonly effectiveErrors = computed<Record<string, string[]>>(() => {\n const errors = this.errors() ?? {};\n const cleared = this.clearedNames();\n const result: Record<string, string[]> = {};\n for (const key of Object.keys(errors)) {\n if (cleared.has(key)) {\n continue;\n }\n const value = errors[key];\n result[key] = Array.isArray(value) ? value : [value];\n }\n return result;\n });\n\n readonly anyInvalid = computed(() => this.aggregate('invalid'));\n readonly anyDirty = computed(() => this.aggregate('dirty'));\n readonly anyTouched = computed(() => this.aggregate('touched'));\n readonly submitting = computed(() => this.stateProvider()?.submitting?.() ?? false);\n\n /** Resolve a boolean aggregate: a registered provider's accessor wins, else OR over the registry. */\n private aggregate(key: 'invalid' | 'dirty' | 'touched'): boolean {\n const accessor = this.stateProvider()?.[key];\n return accessor ? accessor() : this.fields().some((field) => field[key]());\n }\n\n /** Resolves the external messages for a field name (provider source wins over the `errors` input). */\n errorsFor(name: string | undefined): string[] {\n if (!name) {\n return [];\n }\n const provider = this.stateProvider();\n if (provider?.errorsFor) {\n return provider.errorsFor(name);\n }\n return this.effectiveErrors()[name] ?? [];\n }\n\n /** Clears a field's external error after a user edit, emitting the remaining map. */\n notifyEdited(name: string | undefined): void {\n if (!name) {\n return;\n }\n // While a provider owns errors, Signal Forms clears/reapplies them itself — stay inert.\n if (this.stateProvider()?.errorsFor) {\n return;\n }\n const errors = this.errors() ?? {};\n if (!Object.hasOwn(errors, name) || this.clearedNames().has(name)) {\n return;\n }\n this.clearedNames.update((set) => new Set(set).add(name));\n this.onClearErrors.emit(this.remainingErrors());\n }\n\n register(field: RdxFormFieldRegistration): () => void {\n this.fields.update((list) => [...list, field]);\n return () => this.fields.update((list) => list.filter((item) => item !== field));\n }\n\n /** Register (or clear with `null`) an external owner of form-level state; returns the previous one. */\n setStateProvider(provider: RdxFormState | null): RdxFormState | null {\n const previous = this.stateProvider();\n this.stateProvider.set(provider);\n return previous;\n }\n\n onSubmit(event: SubmitEvent): void {\n // SPA submits never navigate; never stopPropagation so Reactive Forms `(ngSubmit)` keeps firing.\n event.preventDefault();\n\n if (this.aggregate('invalid')) {\n // Focus the first invalid registered field (DOM order); provider-only invalid has none to focus.\n this.fields()\n .find((field) => field.invalid())\n ?.focus();\n return;\n }\n\n const values = serializeFormData(new FormData(this.form));\n this.onFormSubmit.emit({ values, event });\n }\n\n onReset(): void {\n // Don't prevent the native reset — control values revert on their own.\n if (!this.stateProvider()?.errorsFor) {\n const keys = Object.keys(this.errors() ?? {});\n const hadVisible = keys.some((key) => !this.clearedNames().has(key));\n if (keys.length) {\n this.clearedNames.set(new Set(keys));\n }\n if (hadVisible) {\n this.onClearErrors.emit({});\n }\n }\n // Values revert asynchronously relative to the reset event — re-sync field state next macrotask.\n // Read the registry fresh inside the callback (fields may register/unregister in between), and\n // cancel on destroy so resetState never runs against a torn-down field.\n const timer = setTimeout(() => {\n this.resetTimers.delete(timer);\n this.fields().forEach((field) => field.resetState());\n });\n this.resetTimers.add(timer);\n }\n\n private readonly resetTimers = new Set<ReturnType<typeof setTimeout>>();\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.resetTimers.forEach((timer) => clearTimeout(timer)));\n }\n\n private remainingErrors(): RdxFormErrors {\n const errors = this.errors() ?? {};\n const cleared = this.clearedNames();\n const result: RdxFormErrors = {};\n for (const key of Object.keys(errors)) {\n if (!cleared.has(key)) {\n result[key] = errors[key];\n }\n }\n return result;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxFormRoot } from './src/form-root';\n\nexport * from './src/form-root';\n\nexport const _importsForm = [RdxFormRoot];\n\n@NgModule({\n imports: [..._importsForm],\n exports: [..._importsForm]\n})\nexport class RdxFormModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AA0DA,MAAM,eAAe,GAAG,MAAK;AACzB,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,W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zB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,YAAY,CAAC;AAC1B,oBAAA,OAAO,EAAE,CAAC,GAAG,YAAY;AAC5B,iBAAA;;;ACVD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-form.mjs","sources":["../../../packages/primitives/form/src/form-root.ts","../../../packages/primitives/form/index.ts","../../../packages/primitives/form/radix-ng-primitives-form.ts"],"sourcesContent":["import {\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n input,\n linkedSignal,\n output,\n signal,\n Signal\n} from '@angular/core';\nimport { createContext } from '@radix-ng/primitives/core';\n\n/** A normalized external-error map: each field name maps to its message(s) in display order. */\nexport type RdxFormErrors = Record<string, string | string[]>;\n\n/** Payload of {@link RdxFormRoot.onFormSubmit}. Mirrors Base UI's `(values, eventDetails)` shape. */\nexport interface RdxFormSubmitEvent {\n /** The form's values serialized from `FormData` (repeated names collapse into arrays). */\n values: Record<string, FormDataEntryValue | FormDataEntryValue[]>;\n /** Why the submit happened (Base UI `SubmitEventDetails.reason`). Always `'none'` for a user submit. */\n reason: 'none';\n /** The original native submit event (already `preventDefault`-ed). */\n event: SubmitEvent;\n}\n\n/**\n * What a {@link RdxFieldRoot} registers with an enclosing Form. Structural `() =>` accessors keep the\n * Form entry free of any import from `field` (acyclic ng-packagr graph: `field` → `form`).\n */\nexport interface RdxFormFieldRegistration {\n /** The field's `name` (key external errors match against), or `undefined`. */\n name: () => string | undefined;\n /** The field's merged invalid state (includes external errors). */\n invalid: () => boolean;\n /** Whether the field is dirty. */\n dirty: () => boolean;\n /** Whether the field is touched. */\n touched: () => boolean;\n /** Focus the field's control (by its `controlId`). */\n focus: () => void;\n /** Reset the field's interaction state (touched/dirty/focused → false, filled re-sync). */\n resetState: () => void;\n}\n\n/**\n * External owner of form-level state (e.g. a future Signal Forms `[rdxSignalForm]` adapter). Mirrors\n * Field's `RdxFieldState` seam one level up. Each member is optional: a provided accessor wins over the\n * built-in registry/`errors`-input behavior; absent accessors leave the built-in behavior untouched.\n * Kept as framework-free `() =>` accessors (no `@angular/forms/signals` dependency). See ADR 0004.\n */\nexport interface RdxFormState {\n invalid?: () => boolean;\n dirty?: () => boolean;\n touched?: () => boolean;\n submitting?: () => boolean;\n /** Per-name external error source; while provided, the `errors` input + clear-on-edit are inert. */\n errorsFor?: (name: string) => string[];\n}\n\nexport interface RdxFormRootContext {\n errorsFor: (name: string | undefined) => string[];\n notifyEdited: (name: string | undefined) => void;\n /** Registers a field; returns its unregister callback. */\n register: (field: RdxFormFieldRegistration) => () => void;\n setStateProvider: (provider: RdxFormState | null) => RdxFormState | null;\n hasStateProvider: Signal<boolean>;\n}\n\nconst formRootContext = (): RdxFormRootContext => {\n const root = inject(RdxFormRoot);\n return {\n errorsFor: (name: string | undefined) => root.errorsFor(name),\n notifyEdited: (name: string | undefined) => root.notifyEdited(name),\n register: (field: RdxFormFieldRegistration) => root.register(field),\n setStateProvider: (provider: RdxFormState | null) => root.setStateProvider(provider),\n hasStateProvider: root.hasStateProvider\n };\n};\n\nexport const [injectFormRootContext, provideFormRootContext] = createContext<RdxFormRootContext>(\n 'RdxFormRoot',\n 'components/form'\n);\n\n/** Collapses `FormData` into a plain object; repeated names collapse into arrays. */\nfunction serializeFormData(data: FormData): Record<string, FormDataEntryValue | FormDataEntryValue[]> {\n const values: Record<string, FormDataEntryValue | FormDataEntryValue[]> = {};\n data.forEach((value, key) => {\n // `Object.hasOwn`, not `key in values` — a control named after an Object.prototype member\n // (`toString`, `constructor`, …) must not be misread as a duplicate.\n if (Object.hasOwn(values, key)) {\n const existing = values[key];\n values[key] = Array.isArray(existing) ? [...existing, value] : [existing, value];\n } else {\n values[key] = value;\n }\n });\n return values;\n}\n\n/**\n * The top of the forms layer cake: a single directive on the native `<form>` element that aggregates\n * field state, maps external (server) errors onto fields by `name`, intercepts submit (values-as-object,\n * focus the first invalid field), and resets field interaction state on native `reset`. It owns no\n * values and runs no validation — Angular form systems (or Field inputs) remain the source of validity.\n *\n * @group Components\n */\n@Directive({\n selector: 'form[rdxFormRoot]',\n exportAs: 'rdxFormRoot',\n providers: [provideFormRootContext(formRootContext)],\n host: {\n novalidate: '',\n '[attr.data-invalid]': 'anyInvalid() ? \"\" : undefined',\n '[attr.data-dirty]': 'anyDirty() ? \"\" : undefined',\n '[attr.data-touched]': 'anyTouched() ? \"\" : undefined',\n '[attr.data-submitting]': 'submitting() ? \"\" : undefined',\n '(submit)': 'onSubmit($event)',\n '(reset)': 'onReset()'\n }\n})\nexport class RdxFormRoot {\n private readonly form = inject<ElementRef<HTMLFormElement>>(ElementRef).nativeElement;\n\n /** External/server validation errors keyed by `Field.Root` `name`. */\n readonly errors = input<RdxFormErrors | null | undefined>();\n\n /** Emits the remaining error map after a field's external error is cleared by a user edit (or reset). */\n readonly onClearErrors = output<RdxFormErrors>();\n\n /** Emits the serialized form values when a valid form is submitted. */\n readonly onFormSubmit = output<RdxFormSubmitEvent>();\n\n private readonly fields = signal<RdxFormFieldRegistration[]>([]);\n\n private readonly stateProvider = signal<RdxFormState | null>(null);\n\n /** Whether an external adapter currently owns form-level state. */\n readonly hasStateProvider = computed(() => this.stateProvider() !== null);\n\n /**\n * Names whose external error has been cleared by a user edit. Reset to empty whenever a new `errors`\n * object reference is assigned — the server just spoke, so everything it said is live again.\n */\n private readonly clearedNames = linkedSignal<RdxFormErrors | null | undefined, Set<string>>({\n source: this.errors,\n computation: () => new Set<string>()\n });\n\n /** The `errors` input minus cleared names, normalized to `string[]`. */\n private readonly effectiveErrors = computed<Record<string, string[]>>(() => {\n const errors = this.errors() ?? {};\n const cleared = this.clearedNames();\n const result: Record<string, string[]> = {};\n for (const key of Object.keys(errors)) {\n if (cleared.has(key)) {\n continue;\n }\n const value = errors[key];\n result[key] = Array.isArray(value) ? value : [value];\n }\n return result;\n });\n\n readonly anyInvalid = computed(() => this.aggregate('invalid'));\n readonly anyDirty = computed(() => this.aggregate('dirty'));\n readonly anyTouched = computed(() => this.aggregate('touched'));\n readonly submitting = computed(() => this.stateProvider()?.submitting?.() ?? false);\n\n /** Resolve a boolean aggregate: a registered provider's accessor wins, else OR over the registry. */\n private aggregate(key: 'invalid' | 'dirty' | 'touched'): boolean {\n const accessor = this.stateProvider()?.[key];\n return accessor ? accessor() : this.fields().some((field) => field[key]());\n }\n\n /** Resolves the external messages for a field name (provider source wins over the `errors` input). */\n errorsFor(name: string | undefined): string[] {\n if (!name) {\n return [];\n }\n const provider = this.stateProvider();\n if (provider?.errorsFor) {\n return provider.errorsFor(name);\n }\n return this.effectiveErrors()[name] ?? [];\n }\n\n /** Clears a field's external error after a user edit, emitting the remaining map. */\n notifyEdited(name: string | undefined): void {\n if (!name) {\n return;\n }\n // While a provider owns errors, Signal Forms clears/reapplies them itself — stay inert.\n if (this.stateProvider()?.errorsFor) {\n return;\n }\n const errors = this.errors() ?? {};\n if (!Object.hasOwn(errors, name) || this.clearedNames().has(name)) {\n return;\n }\n this.clearedNames.update((set) => new Set(set).add(name));\n this.onClearErrors.emit(this.remainingErrors());\n }\n\n register(field: RdxFormFieldRegistration): () => void {\n this.fields.update((list) => [...list, field]);\n return () => this.fields.update((list) => list.filter((item) => item !== field));\n }\n\n /** Register (or clear with `null`) an external owner of form-level state; returns the previous one. */\n setStateProvider(provider: RdxFormState | null): RdxFormState | null {\n const previous = this.stateProvider();\n this.stateProvider.set(provider);\n return previous;\n }\n\n onSubmit(event: SubmitEvent): void {\n // SPA submits never navigate; never stopPropagation so Reactive Forms `(ngSubmit)` keeps firing.\n event.preventDefault();\n\n if (this.aggregate('invalid')) {\n // Focus the first invalid registered field (DOM order); provider-only invalid has none to focus.\n this.fields()\n .find((field) => field.invalid())\n ?.focus();\n return;\n }\n\n const values = serializeFormData(new FormData(this.form));\n this.onFormSubmit.emit({ values, reason: 'none', event });\n }\n\n onReset(): void {\n // Don't prevent the native reset — control values revert on their own.\n if (!this.stateProvider()?.errorsFor) {\n const keys = Object.keys(this.errors() ?? {});\n const hadVisible = keys.some((key) => !this.clearedNames().has(key));\n if (keys.length) {\n this.clearedNames.set(new Set(keys));\n }\n if (hadVisible) {\n this.onClearErrors.emit({});\n }\n }\n // Values revert asynchronously relative to the reset event — re-sync field state next macrotask.\n // Read the registry fresh inside the callback (fields may register/unregister in between), and\n // cancel on destroy so resetState never runs against a torn-down field.\n const timer = setTimeout(() => {\n this.resetTimers.delete(timer);\n this.fields().forEach((field) => field.resetState());\n });\n this.resetTimers.add(timer);\n }\n\n private readonly resetTimers = new Set<ReturnType<typeof setTimeout>>();\n\n constructor() {\n inject(DestroyRef).onDestroy(() => this.resetTimers.forEach((timer) => clearTimeout(timer)));\n }\n\n private remainingErrors(): RdxFormErrors {\n const errors = this.errors() ?? {};\n const cleared = this.clearedNames();\n const result: RdxFormErrors = {};\n for (const key of Object.keys(errors)) {\n if (!cleared.has(key)) {\n result[key] = errors[key];\n }\n }\n return result;\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxFormRoot } from './src/form-root';\n\nexport * from './src/form-root';\n\nexport const _importsForm = [RdxFormRoot];\n\n@NgModule({\n imports: [..._importsForm],\n exports: [..._importsForm]\n})\nexport class RdxFormModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAsEA,MAAM,eAAe,GAAG,MAAyB;AAC7C,IAAA,MAAM,IAAI,GAAG,MAAM,CAAC,WAAW,CAAC;IAChC,OAAO;QACH,SAAS,EAAE,CAAC,IAAwB,KAAK,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;QAC7D,YAAY,EAAE,CAAC,IAAwB,KAAK,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;QACnE,QAAQ,EAAE,CAAC,KAA+B,KAAK,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC;QACnE,gBAAgB,EAAE,CAAC,QAA6B,KAAK,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC;QACpF,gBAAgB,EAAE,IAAI,CAAC;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QAAA,EAAA,CAAA,aAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAW3C,WAAW,EAAA,UAAA,EAAA,CAAA;kBAdvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,mBAAmB;AAC7B,oBAAA,QAAQ,EAAE,aAAa;AACvB,oBAAA,SAAS,EAAE,CAAC,sBAAsB,CAAC,eAAe,CAAC,CAAC;AACpD,oBAAA,IAAI,EAAE;AACF,wBAAA,UAAU,EAAE,EAAE;AACd,wBAAA,qBAAqB,EAAE,+BAA+B;AACtD,wBAAA,mBAAmB,EAAE,6BAA6B;AAClD,wBAAA,qBAAqB,EAAE,+BAA+B;AACtD,wBAAA,wBAAwB,EAAE,+BAA+B;AACzD,wBAAA,UAAU,EAAE,kBAAkB;AAC9B,wBAAA,SAAS,EAAE;AACd;AACJ,iBAAA;;;ACtHM,MAAM,YAAY,GAAG,CAAC,WAAW;MAM3B,aAAa,CAAA;8GAAb,aAAa,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAb,aAAa,EAAA,OAAA,EAAA,CANG,WAAW,CAAA,EAAA,OAAA,EAAA,CAAX,WAAW,CAAA,EAAA,CAAA,CAAA;+GAM3B,aAAa,EAAA,CAAA,CAAA;;2FAAb,aAAa,EAAA,UAAA,EAAA,CAAA;kBAJzB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,YAAY,CAAC;AAC1B,oBAAA,OAAO,EAAE,CAAC,GAAG,YAAY;AAC5B,iBAAA;;;ACVD;;AAEG;;;;"}
@@ -1,7 +1,7 @@
1
1
  import * as i0 from '@angular/core';
2
2
  import { inject, ElementRef, input, Directive } from '@angular/core';
3
+ import { injectId } from '@radix-ng/primitives/core';
3
4
 
4
- let idIterator = 0;
5
5
  /**
6
6
  * @group Components
7
7
  */
@@ -9,14 +9,15 @@ class RdxLabelDirective {
9
9
  constructor() {
10
10
  this.elementRef = inject((ElementRef));
11
11
  /**
12
- * @default 'rdx-label-{idIterator}'
12
+ * The label id. Defaults to a stable generated id.
13
+ * @group Props
13
14
  */
14
- this.id = input(`rdx-label-${idIterator++}`, /* @ts-ignore */
15
+ this.id = input(injectId('rdx-label-'), /* @ts-ignore */
15
16
  ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
16
17
  /**
17
18
  * The id of the element the label is associated with.
18
19
  * @group Props
19
- * @defaultValue false
20
+ * @default undefined
20
21
  */
21
22
  this.htmlFor = input(/* @ts-ignore */
22
23
  ...(ngDevMode ? [undefined, { debugName: "htmlFor" }] : /* istanbul ignore next */ []));
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-label.mjs","sources":["../../../packages/primitives/label/src/label.directive.ts","../../../packages/primitives/label/radix-ng-primitives-label.ts"],"sourcesContent":["import { Directive, ElementRef, inject, input } from '@angular/core';\n\nlet idIterator = 0;\n\n/**\n * @group Components\n */\n@Directive({\n selector: 'label[rdxLabel]',\n exportAs: 'rdxLabel',\n host: {\n '[attr.id]': 'id()',\n '[attr.for]': 'htmlFor() ? htmlFor() : undefined',\n '(mousedown)': 'onMouseDown($event)'\n }\n})\nexport class RdxLabelDirective {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * @default 'rdx-label-{idIterator}'\n */\n readonly id = input<string>(`rdx-label-${idIterator++}`);\n\n /**\n * The id of the element the label is associated with.\n * @group Props\n * @defaultValue false\n */\n readonly htmlFor = input<string>();\n\n // prevent text selection when double-clicking label\n // The main problem with double-clicks in a web app is that\n // you will have to create special code to handle this on touch enabled devices.\n /**\n * @ignore\n */\n onMouseDown(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n\n // only prevent text selection if not clicking inside an interactive control (or its\n // descendants), so clicks still focus/activate the associated control.\n if (target.closest('button, input, select, textarea')) {\n return;\n }\n\n // prevent text selection when double-clicking label\n if (this.elementRef.nativeElement.contains(target) && !event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAEA,IAAI,UAAU,GAAG,CAAC;AAElB;;AAEG;MAUU,iBAAiB,CAAA;AAT9B,IAAA,WAAA,GAAA;AAUqB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;AAE7D;;AAEG;AACM,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,CAAA,UAAA,EAAa,UAAU,EAAE,CAAA,CAAE;+EAAC;AAExD;;;;AAIG;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK;+FAAU;AAsBrC,IAAA;;;;AAjBG;;AAEG;AACH,IAAA,WAAW,CAAC,KAAiB,EAAA;AACzB,QAAA,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB;;;AAI1C,QAAA,IAAI,MAAM,CAAC,OAAO,CAAC,iCAAiC,CAAC,EAAE;YACnD;QACJ;;QAGA,IAAI,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/F,KAAK,CAAC,cAAc,EAAE;QAC1B;IACJ;8GAlCS,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,WAAA,EAAA,qBAAA,EAAA,EAAA,UAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,mCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAT7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,UAAU;AACpB,oBAAA,IAAI,EAAE;AACF,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,YAAY,EAAE,mCAAmC;AACjD,wBAAA,aAAa,EAAE;AAClB;AACJ,iBAAA;;;ACfD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-label.mjs","sources":["../../../packages/primitives/label/src/label.directive.ts","../../../packages/primitives/label/radix-ng-primitives-label.ts"],"sourcesContent":["import { Directive, ElementRef, inject, input } from '@angular/core';\nimport { injectId } from '@radix-ng/primitives/core';\n\n/**\n * @group Components\n */\n@Directive({\n selector: 'label[rdxLabel]',\n exportAs: 'rdxLabel',\n host: {\n '[attr.id]': 'id()',\n '[attr.for]': 'htmlFor() ? htmlFor() : undefined',\n '(mousedown)': 'onMouseDown($event)'\n }\n})\nexport class RdxLabelDirective {\n private readonly elementRef = inject(ElementRef<HTMLElement>);\n\n /**\n * The label id. Defaults to a stable generated id.\n * @group Props\n */\n readonly id = input<string>(injectId('rdx-label-'));\n\n /**\n * The id of the element the label is associated with.\n * @group Props\n * @default undefined\n */\n readonly htmlFor = input<string>();\n\n // prevent text selection when double-clicking label\n // The main problem with double-clicks in a web app is that\n // you will have to create special code to handle this on touch enabled devices.\n /**\n * @ignore\n */\n onMouseDown(event: MouseEvent): void {\n const target = event.target as HTMLElement;\n\n // only prevent text selection if not clicking inside an interactive control (or its\n // descendants), so clicks still focus/activate the associated control.\n if (target.closest('button, input, select, textarea')) {\n return;\n }\n\n // prevent text selection when double-clicking label\n if (this.elementRef.nativeElement.contains(target) && !event.defaultPrevented && event.detail > 1) {\n event.preventDefault();\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAGA;;AAEG;MAUU,iBAAiB,CAAA;AAT9B,IAAA,WAAA,GAAA;AAUqB,QAAA,IAAA,CAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;AAE7D;;;AAGG;AACM,QAAA,IAAA,CAAA,EAAE,GAAG,KAAK,CAAS,QAAQ,CAAC,YAAY,CAAC;+EAAC;AAEnD;;;;AAIG;AACM,QAAA,IAAA,CAAA,OAAO,GAAG,KAAK;+FAAU;AAsBrC,IAAA;;;;AAjBG;;AAEG;AACH,IAAA,WAAW,CAAC,KAAiB,EAAA;AACzB,QAAA,MAAM,MAAM,GAAG,KAAK,CAAC,MAAqB;;;AAI1C,QAAA,IAAI,MAAM,CAAC,OAAO,CAAC,iCAAiC,CAAC,EAAE;YACnD;QACJ;;QAGA,IAAI,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,gBAAgB,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/F,KAAK,CAAC,cAAc,EAAE;QAC1B;IACJ;8GAnCS,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAjB,iBAAiB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA,EAAA,EAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,OAAA,EAAA,EAAA,iBAAA,EAAA,SAAA,EAAA,UAAA,EAAA,SAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,SAAA,EAAA,EAAA,WAAA,EAAA,qBAAA,EAAA,EAAA,UAAA,EAAA,EAAA,SAAA,EAAA,MAAA,EAAA,UAAA,EAAA,mCAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,UAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAT7B,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,iBAAiB;AAC3B,oBAAA,QAAQ,EAAE,UAAU;AACpB,oBAAA,IAAI,EAAE;AACF,wBAAA,WAAW,EAAE,MAAM;AACnB,wBAAA,YAAY,EAAE,mCAAmC;AACjD,wBAAA,aAAa,EAAE;AAClB;AACJ,iBAAA;;;ACdD;;AAEG;;;;"}
@@ -284,7 +284,7 @@ class RdxNumberFieldButton {
284
284
  }
285
285
  }
286
286
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxNumberFieldButton, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
287
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxNumberFieldButton, isStandalone: true, inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "tabindex": "-1" }, listeners: { "click": "onClick($event)", "pointerdown": "onPointerDown($event)", "contextmenu": "$event.preventDefault()" }, properties: { "attr.aria-controls": "rootContext.id()", "attr.aria-readonly": "rootContext.readonly() ? \"true\" : undefined", "attr.disabled": "buttonDisabled() ? \"\" : undefined", "attr.data-disabled": "buttonDisabled() ? \"\" : undefined", "attr.data-pressed": "press.isPressing() ? \"\" : undefined", "style.user-select": "\"none\"", "style.-webkit-user-select": "\"none\"" } }, ngImport: i0 }); }
287
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxNumberFieldButton, isStandalone: true, inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "type": "button", "tabindex": "-1" }, listeners: { "click": "onClick($event)", "pointerdown": "onPointerDown($event)", "contextmenu": "$event.preventDefault()" }, properties: { "attr.aria-controls": "rootContext.id()", "attr.disabled": "interactionDisabled() ? \"\" : undefined", "attr.data-disabled": "buttonDisabled() ? \"\" : undefined", "attr.data-readonly": "rootContext.readonly() ? \"\" : undefined", "attr.data-pressed": "press.isPressing() ? \"\" : undefined", "style.user-select": "\"none\"", "style.-webkit-user-select": "\"none\"" } }, ngImport: i0 }); }
288
288
  }
289
289
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxNumberFieldButton, decorators: [{
290
290
  type: Directive,
@@ -293,9 +293,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
293
293
  type: 'button',
294
294
  tabindex: '-1',
295
295
  '[attr.aria-controls]': 'rootContext.id()',
296
- '[attr.aria-readonly]': 'rootContext.readonly() ? "true" : undefined',
297
- '[attr.disabled]': 'buttonDisabled() ? "" : undefined',
296
+ // Read-only blocks interaction too, so the button is natively disabled (Base UI passes
297
+ // `disabled: disabled || readOnly` to useButton). `aria-readonly` is intentionally NOT set —
298
+ // it isn't a valid state for `role=button`. `data-disabled` stays tied to the true disabled
299
+ // state so styling can tell disabled apart from read-only (`data-readonly`).
300
+ '[attr.disabled]': 'interactionDisabled() ? "" : undefined',
298
301
  '[attr.data-disabled]': 'buttonDisabled() ? "" : undefined',
302
+ '[attr.data-readonly]': 'rootContext.readonly() ? "" : undefined',
299
303
  '[attr.data-pressed]': 'press.isPressing() ? "" : undefined',
300
304
  '[style.user-select]': '"none"',
301
305
  '[style.-webkit-user-select]': '"none"',