@radix-ng/primitives 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) 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-autocomplete.mjs +43 -9
  7. package/fesm2022/radix-ng-primitives-autocomplete.mjs.map +1 -1
  8. package/fesm2022/radix-ng-primitives-avatar.mjs +69 -18
  9. package/fesm2022/radix-ng-primitives-avatar.mjs.map +1 -1
  10. package/fesm2022/radix-ng-primitives-checkbox.mjs +93 -16
  11. package/fesm2022/radix-ng-primitives-checkbox.mjs.map +1 -1
  12. package/fesm2022/radix-ng-primitives-collapsible.mjs +4 -3
  13. package/fesm2022/radix-ng-primitives-collapsible.mjs.map +1 -1
  14. package/fesm2022/radix-ng-primitives-combobox.mjs +43 -9
  15. package/fesm2022/radix-ng-primitives-combobox.mjs.map +1 -1
  16. package/fesm2022/radix-ng-primitives-core.mjs +208 -2
  17. package/fesm2022/radix-ng-primitives-core.mjs.map +1 -1
  18. package/fesm2022/radix-ng-primitives-date-field.mjs +50 -9
  19. package/fesm2022/radix-ng-primitives-date-field.mjs.map +1 -1
  20. package/fesm2022/radix-ng-primitives-editable.mjs +31 -5
  21. package/fesm2022/radix-ng-primitives-editable.mjs.map +1 -1
  22. package/fesm2022/radix-ng-primitives-field.mjs +276 -58
  23. package/fesm2022/radix-ng-primitives-field.mjs.map +1 -1
  24. package/fesm2022/radix-ng-primitives-form.mjs +111 -27
  25. package/fesm2022/radix-ng-primitives-form.mjs.map +1 -1
  26. package/fesm2022/radix-ng-primitives-input.mjs +16 -6
  27. package/fesm2022/radix-ng-primitives-input.mjs.map +1 -1
  28. package/fesm2022/radix-ng-primitives-label.mjs +5 -4
  29. package/fesm2022/radix-ng-primitives-label.mjs.map +1 -1
  30. package/fesm2022/radix-ng-primitives-number-field.mjs +39 -10
  31. package/fesm2022/radix-ng-primitives-number-field.mjs.map +1 -1
  32. package/fesm2022/radix-ng-primitives-progress.mjs +37 -22
  33. package/fesm2022/radix-ng-primitives-progress.mjs.map +1 -1
  34. package/fesm2022/radix-ng-primitives-radio.mjs +18 -9
  35. package/fesm2022/radix-ng-primitives-radio.mjs.map +1 -1
  36. package/fesm2022/radix-ng-primitives-scroll-area.mjs +4 -4
  37. package/fesm2022/radix-ng-primitives-scroll-area.mjs.map +1 -1
  38. package/fesm2022/radix-ng-primitives-select.mjs +26 -8
  39. package/fesm2022/radix-ng-primitives-select.mjs.map +1 -1
  40. package/fesm2022/radix-ng-primitives-separator.mjs +7 -13
  41. package/fesm2022/radix-ng-primitives-separator.mjs.map +1 -1
  42. package/fesm2022/radix-ng-primitives-signal-forms.mjs +184 -0
  43. package/fesm2022/radix-ng-primitives-signal-forms.mjs.map +1 -0
  44. package/fesm2022/radix-ng-primitives-slider.mjs +25 -10
  45. package/fesm2022/radix-ng-primitives-slider.mjs.map +1 -1
  46. package/fesm2022/radix-ng-primitives-switch.mjs +32 -8
  47. package/fesm2022/radix-ng-primitives-switch.mjs.map +1 -1
  48. package/fesm2022/radix-ng-primitives-tabs.mjs +4 -4
  49. package/fesm2022/radix-ng-primitives-tabs.mjs.map +1 -1
  50. package/fesm2022/radix-ng-primitives-time-field.mjs +49 -9
  51. package/fesm2022/radix-ng-primitives-time-field.mjs.map +1 -1
  52. package/fesm2022/radix-ng-primitives-toggle-group.mjs +33 -16
  53. package/fesm2022/radix-ng-primitives-toggle-group.mjs.map +1 -1
  54. package/fesm2022/radix-ng-primitives-toggle.mjs +24 -29
  55. package/fesm2022/radix-ng-primitives-toggle.mjs.map +1 -1
  56. package/fesm2022/radix-ng-primitives-toolbar.mjs +15 -2
  57. package/fesm2022/radix-ng-primitives-toolbar.mjs.map +1 -1
  58. package/package.json +11 -1
  59. package/types/radix-ng-primitives-accordion.d.ts +1 -0
  60. package/types/radix-ng-primitives-aspect-ratio.d.ts +10 -23
  61. package/types/radix-ng-primitives-autocomplete.d.ts +21 -2
  62. package/types/radix-ng-primitives-avatar.d.ts +51 -25
  63. package/types/radix-ng-primitives-checkbox.d.ts +78 -101
  64. package/types/radix-ng-primitives-combobox.d.ts +51 -2
  65. package/types/radix-ng-primitives-core.d.ts +206 -3
  66. package/types/radix-ng-primitives-date-field.d.ts +27 -2
  67. package/types/radix-ng-primitives-editable.d.ts +15 -2
  68. package/types/radix-ng-primitives-field.d.ts +165 -236
  69. package/types/radix-ng-primitives-form.d.ts +122 -37
  70. package/types/radix-ng-primitives-input.d.ts +8 -1
  71. package/types/radix-ng-primitives-label.d.ts +3 -2
  72. package/types/radix-ng-primitives-number-field.d.ts +15 -4
  73. package/types/radix-ng-primitives-progress.d.ts +59 -121
  74. package/types/radix-ng-primitives-radio.d.ts +7 -3
  75. package/types/radix-ng-primitives-select.d.ts +11 -3
  76. package/types/radix-ng-primitives-separator.d.ts +0 -7
  77. package/types/radix-ng-primitives-signal-forms.d.ts +97 -0
  78. package/types/radix-ng-primitives-slider.d.ts +9 -7
  79. package/types/radix-ng-primitives-switch.d.ts +15 -2
  80. package/types/radix-ng-primitives-time-field.d.ts +26 -2
  81. package/types/radix-ng-primitives-toggle-group.d.ts +13 -7
  82. package/types/radix-ng-primitives-toggle.d.ts +8 -8
  83. package/types/radix-ng-primitives-toolbar.d.ts +2 -0
@@ -1 +1 @@
1
- # @radix-ng/primitives/avatar
1
+ # @radix-ng/primitives/aspect-ratio
@@ -318,6 +318,7 @@ class RdxAccordionTriggerDirective {
318
318
  constructor() {
319
319
  this.rootContext = injectAccordionRootContext();
320
320
  this.itemContext = injectAccordionItemContext();
321
+ this.collapsibleContext = injectCollapsibleRootContext();
321
322
  this.itemContext.triggerId.set(injectId('rdx-accordion-trigger-'));
322
323
  }
323
324
  changeItem(event) {
@@ -328,7 +329,7 @@ class RdxAccordionTriggerDirective {
328
329
  this.rootContext.changeModelValue(this.itemContext.value(), event);
329
330
  }
330
331
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxAccordionTriggerDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
331
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxAccordionTriggerDirective, isStandalone: true, selector: "[rdxAccordionTrigger]", host: { listeners: { "click": "changeItem($event)" }, properties: { "id": "itemContext.triggerId()", "attr.role": "\"button\"", "attr.aria-expanded": "itemContext.open()", "attr.aria-disabled": "itemContext.dataDisabled() ? \"true\" : undefined", "attr.data-disabled": "itemContext.dataDisabled() ? \"\" : undefined", "attr.data-panel-open": "itemContext.open() ? \"\" : undefined" } }, ngImport: i0 }); }
332
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "22.0.2", type: RdxAccordionTriggerDirective, isStandalone: true, selector: "[rdxAccordionTrigger]", host: { listeners: { "click": "changeItem($event)" }, properties: { "id": "itemContext.triggerId()", "attr.role": "\"button\"", "attr.aria-expanded": "itemContext.open()", "attr.aria-controls": "itemContext.open() ? collapsibleContext.panelId() : undefined", "attr.aria-disabled": "itemContext.dataDisabled() ? \"true\" : undefined", "attr.data-disabled": "itemContext.dataDisabled() ? \"\" : undefined", "attr.data-panel-open": "itemContext.open() ? \"\" : undefined" } }, ngImport: i0 }); }
332
333
  }
333
334
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxAccordionTriggerDirective, decorators: [{
334
335
  type: Directive,
@@ -338,6 +339,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
338
339
  '[id]': 'itemContext.triggerId()',
339
340
  '[attr.role]': '"button"',
340
341
  '[attr.aria-expanded]': 'itemContext.open()',
342
+ // Point at the panel only while open — the panel unmounts when closed, so referencing a
343
+ // missing id would be an invalid ARIA relationship. The id comes from the composed
344
+ // collapsible root (the same id the accordion panel renders).
345
+ '[attr.aria-controls]': 'itemContext.open() ? collapsibleContext.panelId() : undefined',
341
346
  // Disabled triggers stay focusable (Base UI parity) — `aria-disabled`, not native `disabled`.
342
347
  '[attr.aria-disabled]': 'itemContext.dataDisabled() ? "true" : undefined',
343
348
  '[attr.data-disabled]': 'itemContext.dataDisabled() ? "" : undefined',
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-accordion.mjs","sources":["../../../packages/primitives/accordion/src/accordion-root.directive.ts","../../../packages/primitives/accordion/src/accordion-item.directive.ts","../../../packages/primitives/accordion/src/accordion-header.directive.ts","../../../packages/primitives/accordion/src/accordion-panel.directive.ts","../../../packages/primitives/accordion/src/accordion-trigger.directive.ts","../../../packages/primitives/accordion/index.ts","../../../packages/primitives/accordion/radix-ng-primitives-accordion.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n InputSignal,\n InputSignalWithTransform,\n model,\n ModelSignal,\n output,\n Signal\n} from '@angular/core';\nimport { RdxCompositeList } from '@radix-ng/primitives/composite';\nimport {\n AcceptableValue,\n BooleanInput,\n createCancelableChangeEventDetails,\n createContext,\n DataOrientation,\n RdxCancelableChangeEventDetails\n} from '@radix-ng/primitives/core';\n\n/** The reason an accordion value change was requested. */\nexport type RdxAccordionValueChangeReason = 'trigger-press' | 'none';\nexport type RdxAccordionValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxAccordionValueChangeReason>;\n\n/** Payload of {@link RdxAccordionRootDirective.onValueChange}, mirroring Base UI's `(value, eventDetails)`. */\nexport interface RdxAccordionValueChangeEvent {\n value: AcceptableValue | AcceptableValue[] | undefined;\n eventDetails: RdxAccordionValueChangeEventDetails;\n}\n\nexport type AccordionRootContext = {\n disabled: InputSignalWithTransform<boolean, BooleanInput>;\n orientation: InputSignal<DataOrientation>;\n value: ModelSignal<AcceptableValue | AcceptableValue[] | undefined>;\n isSingle: Signal<boolean>;\n keepMounted: InputSignalWithTransform<boolean, BooleanInput>;\n hiddenUntilFound: InputSignalWithTransform<boolean, BooleanInput>;\n changeModelValue: (value: string, event?: Event) => void;\n};\n\nexport const [injectAccordionRootContext, provideAccordionRootContext] = createContext<AccordionRootContext>(\n 'AccordionRootContext',\n 'components/accordion'\n);\n\nconst rootContext = (): AccordionRootContext => {\n const instance = inject(RdxAccordionRootDirective);\n\n return {\n disabled: instance.disabled,\n orientation: instance.orientation,\n value: instance.value,\n isSingle: instance.isSingle,\n keepMounted: instance.keepMounted,\n hiddenUntilFound: instance.hiddenUntilFound,\n changeModelValue: instance.changeModelValue\n };\n};\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxAccordionRoot]',\n exportAs: 'rdxAccordionRoot',\n providers: [provideAccordionRootContext(rootContext)],\n hostDirectives: [RdxCompositeList],\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxAccordionRootDirective {\n /** Whether the Accordion is disabled.\n * @defaultValue false\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The orientation of the accordion.\n *\n * Deprecated following the APG guidance update to remove roving focus.\n * This prop no longer affects keyboard focus behavior.\n *\n * @defaultValue 'vertical'\n * @group Props\n * @deprecated\n */\n readonly orientation = input<DataOrientation>('vertical');\n\n /**\n * The default active value of the item(s).\n *\n * Use when you do not need to control the state of the item(s).\n * @group Props\n */\n readonly defaultValue = input<string | string[]>();\n\n /**\n * The controlled value of the item to expand.\n *\n * @group Props\n */\n readonly value = model<AcceptableValue | AcceptableValue[]>();\n\n /**\n * Allow multiple panels to be open simultaneously. In single mode an open item can always be\n * closed by clicking its trigger again (Base UI parity — there is no separate `collapsible`).\n *\n * @defaultValue false\n * @group Props\n */\n readonly multiple = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Deprecated following the APG guidance update to remove roving focus.\n * This prop no longer affects keyboard focus behavior.\n *\n * @defaultValue true\n * @group Props\n * @deprecated\n */\n readonly loopFocus = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /**\n * Whether to keep the content of collapsed items mounted in the DOM.\n * When `true`, closed panels keep their element in the DOM while hidden.\n *\n * @defaultValue false\n * @group Props\n */\n readonly keepMounted = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Allow collapsed panels to remain mounted (but hidden) so the browser's in-page search\n * can find and reveal them. Mirrors Base UI's `hiddenUntilFound`.\n *\n * @defaultValue false\n * @group Props\n */\n readonly hiddenUntilFound = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Event handler called when the expanded value changes. Emits the next value plus a cancelable\n * `eventDetails` (Base UI parity); call `eventDetails.cancel()` to reject the change.\n * @group Emits\n */\n readonly onValueChange = output<RdxAccordionValueChangeEvent>();\n\n readonly isSingle = computed(() => !this.multiple());\n\n constructor() {\n effect(() => {\n if (this.defaultValue() !== undefined) {\n this.value.set(this.defaultValue());\n }\n });\n }\n\n changeModelValue = (newValue: string, event?: Event) => {\n let nextValue: AcceptableValue | AcceptableValue[] | undefined;\n\n if (this.isSingle()) {\n nextValue = this.isEqual(newValue, this.value()) ? undefined : newValue;\n } else {\n const currentValue = this.value();\n let modelValueArray: AcceptableValue[] = [];\n\n if (Array.isArray(currentValue)) {\n modelValueArray = [...currentValue];\n } else if (currentValue !== undefined && currentValue !== null) {\n modelValueArray = [currentValue];\n }\n\n if (this.isValueEqualOrExist(modelValueArray, newValue)) {\n const index = modelValueArray.findIndex((item) => this.isEqual(item, newValue));\n if (index !== -1) {\n modelValueArray.splice(index, 1);\n }\n } else {\n modelValueArray.push(newValue);\n }\n\n nextValue = modelValueArray;\n }\n\n const { eventDetails } = createCancelableChangeEventDetails<RdxAccordionValueChangeReason>(\n event ? 'trigger-press' : 'none',\n event ?? new Event('change')\n );\n\n this.onValueChange.emit({ value: nextValue, eventDetails });\n\n if (eventDetails.isCanceled()) {\n return;\n }\n\n this.value.set(nextValue);\n };\n\n private isValueEqualOrExist(arr: AcceptableValue[], value: AcceptableValue): boolean {\n return arr.some((item) => this.isEqual(item, value));\n }\n\n private isEqual(a: any, b: any): boolean {\n return JSON.stringify(a) === JSON.stringify(b);\n }\n}\n","import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n Signal,\n WritableSignal\n} from '@angular/core';\nimport { injectCollapsibleRootContext, RdxCollapsibleRootDirective } from '@radix-ng/primitives/collapsible';\nimport { RdxCompositeListItem } from '@radix-ng/primitives/composite';\nimport { BooleanInput, createCancelableChangeEventDetails, createContext } from '@radix-ng/primitives/core';\nimport { injectAccordionRootContext, RdxAccordionValueChangeEventDetails } from './accordion-root.directive';\n\n/** Payload of {@link RdxAccordionItemDirective.onOpenChange}, mirroring Base UI's `(open, eventDetails)`. */\nexport interface RdxAccordionItemOpenChangeEvent {\n open: boolean;\n eventDetails: RdxAccordionValueChangeEventDetails;\n}\n\nexport type AccordionItemContext = {\n open: Signal<boolean>;\n disabled: Signal<boolean>;\n triggerId: WritableSignal<string>;\n dataDisabled: Signal<boolean>;\n currentElement: ElementRef<HTMLElement>;\n value: Signal<string | undefined>;\n updateOpen: () => void;\n index: Signal<number>;\n};\n\nexport const [injectAccordionItemContext, provideAccordionItemContext] = createContext<AccordionItemContext>(\n 'AccordionItemContext',\n 'components/accordion'\n);\n\nconst itemContext = (): AccordionItemContext => {\n const instance = inject(RdxAccordionItemDirective);\n\n return {\n open: instance.open,\n disabled: instance.disabled,\n dataDisabled: instance.isDisabled,\n triggerId: instance.triggerId,\n currentElement: instance.elementRef,\n value: computed(() => instance.value()),\n updateOpen: instance.updateOpen,\n index: instance.index\n };\n};\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxAccordionItem]',\n exportAs: 'rdxAccordionItem',\n providers: [provideAccordionItemContext(itemContext)],\n hostDirectives: [\n {\n directive: RdxCollapsibleRootDirective,\n inputs: ['disabled: disabled', 'open: open']\n },\n RdxCompositeListItem\n ],\n host: {\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-open]': 'open() ? \"\" : undefined',\n '[attr.data-index]': 'index()'\n }\n})\nexport class RdxAccordionItemDirective {\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n private readonly collapsibleContext = injectCollapsibleRootContext();\n private readonly listItem = inject(RdxCompositeListItem, { self: true });\n\n protected readonly rootContext = injectAccordionRootContext();\n\n /**\n * A string value for the accordion item. All items within an accordion should use a unique value.\n * @group Props\n */\n readonly value = input<string>();\n\n /**\n * Whether or not an accordion item is disabled from user interaction.\n * When `true`, prevents the user from interacting with the item.\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Event handler called when the panel open state changes. Emits `{ open, eventDetails }`\n * (Base UI parity).\n * @group Emits\n */\n readonly onOpenChange = output<RdxAccordionItemOpenChangeEvent>();\n\n readonly isDisabled = computed(() => {\n return this.rootContext.disabled() || this.disabled();\n });\n\n readonly open = computed(() => {\n const rootValue = this.rootContext.value();\n\n return this.rootContext.isSingle()\n ? this.value() === rootValue\n : Array.isArray(rootValue) && rootValue.includes(this.value()!);\n });\n\n /** Set by the trigger; links the content's `aria-labelledby` to the trigger `id`. */\n readonly triggerId = signal('');\n\n readonly index = this.listItem.index;\n\n constructor() {\n effect(() => {\n this.updateOpen();\n });\n\n // Forward the accordion-level mount controls onto the composed collapsible panel.\n effect(() => {\n this.collapsibleContext.keepMounted.set(this.rootContext.keepMounted());\n });\n effect(() => {\n this.collapsibleContext.hiddenUntilFound.set(this.rootContext.hiddenUntilFound());\n });\n\n let initialized = false;\n effect(() => {\n const isOpen = this.open();\n if (!initialized) {\n initialized = true;\n return;\n }\n const { eventDetails } = createCancelableChangeEventDetails('none', new Event('change'));\n this.onOpenChange.emit({ open: isOpen, eventDetails });\n });\n }\n\n updateOpen = () => {\n this.collapsibleContext.open.set(this.open());\n };\n}\n","import { Directive } from '@angular/core';\nimport { injectAccordionItemContext } from './accordion-item.directive';\n\n@Directive({\n selector: '[rdxAccordionHeader]',\n host: {\n '[attr.data-open]': 'itemContext.open() ? \"\" : undefined',\n '[attr.data-disabled]': 'itemContext.dataDisabled() ? \"\" : undefined',\n '[attr.data-index]': 'itemContext.index()'\n }\n})\nexport class RdxAccordionHeaderDirective {\n protected readonly itemContext = injectAccordionItemContext();\n}\n","import { Directive } from '@angular/core';\nimport { RdxCollapsiblePanelDirective } from '@radix-ng/primitives/collapsible';\nimport { injectAccordionItemContext } from './accordion-item.directive';\nimport { injectAccordionRootContext } from './accordion-root.directive';\n\n@Directive({\n selector: '[rdxAccordionPanel]',\n hostDirectives: [RdxCollapsiblePanelDirective],\n host: {\n role: 'region',\n '[attr.aria-labelledby]': 'itemContext.triggerId()',\n '[attr.data-disabled]': 'itemContext.dataDisabled() ? \"\" : undefined',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-index]': 'itemContext.index()',\n // Base UI's accordion panel exposes `data-open` (no `data-closed`) — suppress the\n // `data-closed` the composed RdxCollapsiblePanelDirective would otherwise add.\n '[attr.data-closed]': 'undefined',\n // `data-open` / `data-starting-style` / `data-ending-style` and the `--collapsible-panel-*`\n // size vars come from the composed RdxCollapsiblePanelDirective.\n // Re-expose the size vars under Base UI's accordion-scoped names.\n '[style]': `{\n '--accordion-panel-height': 'var(--collapsible-panel-height)',\n '--accordion-panel-width': 'var(--collapsible-panel-width)',\n }`\n }\n})\nexport class RdxAccordionPanelDirective {\n protected readonly rootContext = injectAccordionRootContext();\n protected readonly itemContext = injectAccordionItemContext();\n}\n","import { Directive } from '@angular/core';\nimport { injectId } from '@radix-ng/primitives/core';\nimport { injectAccordionItemContext } from './accordion-item.directive';\nimport { injectAccordionRootContext } from './accordion-root.directive';\n\n@Directive({\n selector: '[rdxAccordionTrigger]',\n host: {\n '[id]': 'itemContext.triggerId()',\n '[attr.role]': '\"button\"',\n '[attr.aria-expanded]': 'itemContext.open()',\n // Disabled triggers stay focusable (Base UI parity) — `aria-disabled`, not native `disabled`.\n '[attr.aria-disabled]': 'itemContext.dataDisabled() ? \"true\" : undefined',\n '[attr.data-disabled]': 'itemContext.dataDisabled() ? \"\" : undefined',\n '[attr.data-panel-open]': 'itemContext.open() ? \"\" : undefined',\n\n '(click)': 'changeItem($event)'\n }\n})\nexport class RdxAccordionTriggerDirective {\n protected readonly rootContext = injectAccordionRootContext();\n protected readonly itemContext = injectAccordionItemContext();\n\n constructor() {\n this.itemContext.triggerId.set(injectId('rdx-accordion-trigger-'));\n }\n\n changeItem(event: Event) {\n // `dataDisabled` is the effective disabled state (accordion-root OR item level).\n if (this.itemContext.dataDisabled()) {\n return;\n }\n\n this.rootContext.changeModelValue(this.itemContext.value()!, event);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxAccordionHeaderDirective } from './src/accordion-header.directive';\nimport { RdxAccordionItemDirective } from './src/accordion-item.directive';\nimport { RdxAccordionPanelDirective } from './src/accordion-panel.directive';\nimport { RdxAccordionRootDirective } from './src/accordion-root.directive';\nimport { RdxAccordionTriggerDirective } from './src/accordion-trigger.directive';\n\nexport * from './src/accordion-header.directive';\nexport * from './src/accordion-item.directive';\nexport * from './src/accordion-panel.directive';\nexport * from './src/accordion-root.directive';\nexport * from './src/accordion-trigger.directive';\n\nconst _imports = [\n RdxAccordionHeaderDirective,\n RdxAccordionItemDirective,\n RdxAccordionPanelDirective,\n RdxAccordionRootDirective,\n RdxAccordionTriggerDirective\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxAccordionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;AA4CO,MAAM,CAAC,0BAA0B,EAAE,2BAA2B,CAAC,GAAG,aAAa,CAClF,sBA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yBAAyB;IACzB;CACH;MAMY,kBAAkB,CAAA;8GAAlB,kBAAkB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAlB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,kBAAkB,YAX3B,2BAA2B;YAC3B,yBAAyB;YACzB,0BAA0B;YAC1B,yBAAyB;AACzB,YAAA,4BAA4B,aAJ5B,2BAA2B;YAC3B,yBAAyB;YACzB,0BAA0B;YAC1B,yBAAyB;YACzB,4BAA4B,CAAA,EAAA,CAAA,CAAA;+GAOnB,kBAAkB,EAAA,CAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACxBD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-accordion.mjs","sources":["../../../packages/primitives/accordion/src/accordion-root.directive.ts","../../../packages/primitives/accordion/src/accordion-item.directive.ts","../../../packages/primitives/accordion/src/accordion-header.directive.ts","../../../packages/primitives/accordion/src/accordion-panel.directive.ts","../../../packages/primitives/accordion/src/accordion-trigger.directive.ts","../../../packages/primitives/accordion/index.ts","../../../packages/primitives/accordion/radix-ng-primitives-accordion.ts"],"sourcesContent":["import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n inject,\n input,\n InputSignal,\n InputSignalWithTransform,\n model,\n ModelSignal,\n output,\n Signal\n} from '@angular/core';\nimport { RdxCompositeList } from '@radix-ng/primitives/composite';\nimport {\n AcceptableValue,\n BooleanInput,\n createCancelableChangeEventDetails,\n createContext,\n DataOrientation,\n RdxCancelableChangeEventDetails\n} from '@radix-ng/primitives/core';\n\n/** The reason an accordion value change was requested. */\nexport type RdxAccordionValueChangeReason = 'trigger-press' | 'none';\nexport type RdxAccordionValueChangeEventDetails = RdxCancelableChangeEventDetails<RdxAccordionValueChangeReason>;\n\n/** Payload of {@link RdxAccordionRootDirective.onValueChange}, mirroring Base UI's `(value, eventDetails)`. */\nexport interface RdxAccordionValueChangeEvent {\n value: AcceptableValue | AcceptableValue[] | undefined;\n eventDetails: RdxAccordionValueChangeEventDetails;\n}\n\nexport type AccordionRootContext = {\n disabled: InputSignalWithTransform<boolean, BooleanInput>;\n orientation: InputSignal<DataOrientation>;\n value: ModelSignal<AcceptableValue | AcceptableValue[] | undefined>;\n isSingle: Signal<boolean>;\n keepMounted: InputSignalWithTransform<boolean, BooleanInput>;\n hiddenUntilFound: InputSignalWithTransform<boolean, BooleanInput>;\n changeModelValue: (value: string, event?: Event) => void;\n};\n\nexport const [injectAccordionRootContext, provideAccordionRootContext] = createContext<AccordionRootContext>(\n 'AccordionRootContext',\n 'components/accordion'\n);\n\nconst rootContext = (): AccordionRootContext => {\n const instance = inject(RdxAccordionRootDirective);\n\n return {\n disabled: instance.disabled,\n orientation: instance.orientation,\n value: instance.value,\n isSingle: instance.isSingle,\n keepMounted: instance.keepMounted,\n hiddenUntilFound: instance.hiddenUntilFound,\n changeModelValue: instance.changeModelValue\n };\n};\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxAccordionRoot]',\n exportAs: 'rdxAccordionRoot',\n providers: [provideAccordionRootContext(rootContext)],\n hostDirectives: [RdxCompositeList],\n host: {\n '[attr.data-orientation]': 'orientation()',\n '[attr.data-disabled]': 'disabled() ? \"\" : undefined'\n }\n})\nexport class RdxAccordionRootDirective {\n /** Whether the Accordion is disabled.\n * @defaultValue false\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * The orientation of the accordion.\n *\n * Deprecated following the APG guidance update to remove roving focus.\n * This prop no longer affects keyboard focus behavior.\n *\n * @defaultValue 'vertical'\n * @group Props\n * @deprecated\n */\n readonly orientation = input<DataOrientation>('vertical');\n\n /**\n * The default active value of the item(s).\n *\n * Use when you do not need to control the state of the item(s).\n * @group Props\n */\n readonly defaultValue = input<string | string[]>();\n\n /**\n * The controlled value of the item to expand.\n *\n * @group Props\n */\n readonly value = model<AcceptableValue | AcceptableValue[]>();\n\n /**\n * Allow multiple panels to be open simultaneously. In single mode an open item can always be\n * closed by clicking its trigger again (Base UI parity — there is no separate `collapsible`).\n *\n * @defaultValue false\n * @group Props\n */\n readonly multiple = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Deprecated following the APG guidance update to remove roving focus.\n * This prop no longer affects keyboard focus behavior.\n *\n * @defaultValue true\n * @group Props\n * @deprecated\n */\n readonly loopFocus = input<boolean, BooleanInput>(true, { transform: booleanAttribute });\n\n /**\n * Whether to keep the content of collapsed items mounted in the DOM.\n * When `true`, closed panels keep their element in the DOM while hidden.\n *\n * @defaultValue false\n * @group Props\n */\n readonly keepMounted = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Allow collapsed panels to remain mounted (but hidden) so the browser's in-page search\n * can find and reveal them. Mirrors Base UI's `hiddenUntilFound`.\n *\n * @defaultValue false\n * @group Props\n */\n readonly hiddenUntilFound = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Event handler called when the expanded value changes. Emits the next value plus a cancelable\n * `eventDetails` (Base UI parity); call `eventDetails.cancel()` to reject the change.\n * @group Emits\n */\n readonly onValueChange = output<RdxAccordionValueChangeEvent>();\n\n readonly isSingle = computed(() => !this.multiple());\n\n constructor() {\n effect(() => {\n if (this.defaultValue() !== undefined) {\n this.value.set(this.defaultValue());\n }\n });\n }\n\n changeModelValue = (newValue: string, event?: Event) => {\n let nextValue: AcceptableValue | AcceptableValue[] | undefined;\n\n if (this.isSingle()) {\n nextValue = this.isEqual(newValue, this.value()) ? undefined : newValue;\n } else {\n const currentValue = this.value();\n let modelValueArray: AcceptableValue[] = [];\n\n if (Array.isArray(currentValue)) {\n modelValueArray = [...currentValue];\n } else if (currentValue !== undefined && currentValue !== null) {\n modelValueArray = [currentValue];\n }\n\n if (this.isValueEqualOrExist(modelValueArray, newValue)) {\n const index = modelValueArray.findIndex((item) => this.isEqual(item, newValue));\n if (index !== -1) {\n modelValueArray.splice(index, 1);\n }\n } else {\n modelValueArray.push(newValue);\n }\n\n nextValue = modelValueArray;\n }\n\n const { eventDetails } = createCancelableChangeEventDetails<RdxAccordionValueChangeReason>(\n event ? 'trigger-press' : 'none',\n event ?? new Event('change')\n );\n\n this.onValueChange.emit({ value: nextValue, eventDetails });\n\n if (eventDetails.isCanceled()) {\n return;\n }\n\n this.value.set(nextValue);\n };\n\n private isValueEqualOrExist(arr: AcceptableValue[], value: AcceptableValue): boolean {\n return arr.some((item) => this.isEqual(item, value));\n }\n\n private isEqual(a: unknown, b: unknown): boolean {\n return JSON.stringify(a) === JSON.stringify(b);\n }\n}\n","import {\n booleanAttribute,\n computed,\n Directive,\n effect,\n ElementRef,\n inject,\n input,\n output,\n signal,\n Signal,\n WritableSignal\n} from '@angular/core';\nimport { injectCollapsibleRootContext, RdxCollapsibleRootDirective } from '@radix-ng/primitives/collapsible';\nimport { RdxCompositeListItem } from '@radix-ng/primitives/composite';\nimport { BooleanInput, createCancelableChangeEventDetails, createContext } from '@radix-ng/primitives/core';\nimport { injectAccordionRootContext, RdxAccordionValueChangeEventDetails } from './accordion-root.directive';\n\n/** Payload of {@link RdxAccordionItemDirective.onOpenChange}, mirroring Base UI's `(open, eventDetails)`. */\nexport interface RdxAccordionItemOpenChangeEvent {\n open: boolean;\n eventDetails: RdxAccordionValueChangeEventDetails;\n}\n\nexport type AccordionItemContext = {\n open: Signal<boolean>;\n disabled: Signal<boolean>;\n triggerId: WritableSignal<string>;\n dataDisabled: Signal<boolean>;\n currentElement: ElementRef<HTMLElement>;\n value: Signal<string | undefined>;\n updateOpen: () => void;\n index: Signal<number>;\n};\n\nexport const [injectAccordionItemContext, provideAccordionItemContext] = createContext<AccordionItemContext>(\n 'AccordionItemContext',\n 'components/accordion'\n);\n\nconst itemContext = (): AccordionItemContext => {\n const instance = inject(RdxAccordionItemDirective);\n\n return {\n open: instance.open,\n disabled: instance.disabled,\n dataDisabled: instance.isDisabled,\n triggerId: instance.triggerId,\n currentElement: instance.elementRef,\n value: computed(() => instance.value()),\n updateOpen: instance.updateOpen,\n index: instance.index\n };\n};\n\n/**\n * @group Components\n */\n@Directive({\n selector: '[rdxAccordionItem]',\n exportAs: 'rdxAccordionItem',\n providers: [provideAccordionItemContext(itemContext)],\n hostDirectives: [\n {\n directive: RdxCollapsibleRootDirective,\n inputs: ['disabled: disabled', 'open: open']\n },\n RdxCompositeListItem\n ],\n host: {\n '[attr.data-disabled]': 'isDisabled() ? \"\" : undefined',\n '[attr.data-open]': 'open() ? \"\" : undefined',\n '[attr.data-index]': 'index()'\n }\n})\nexport class RdxAccordionItemDirective {\n readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n\n private readonly collapsibleContext = injectCollapsibleRootContext();\n private readonly listItem = inject(RdxCompositeListItem, { self: true });\n\n protected readonly rootContext = injectAccordionRootContext();\n\n /**\n * A string value for the accordion item. All items within an accordion should use a unique value.\n * @group Props\n */\n readonly value = input<string>();\n\n /**\n * Whether or not an accordion item is disabled from user interaction.\n * When `true`, prevents the user from interacting with the item.\n * @group Props\n */\n readonly disabled = input<boolean, BooleanInput>(false, { transform: booleanAttribute });\n\n /**\n * Event handler called when the panel open state changes. Emits `{ open, eventDetails }`\n * (Base UI parity).\n * @group Emits\n */\n readonly onOpenChange = output<RdxAccordionItemOpenChangeEvent>();\n\n readonly isDisabled = computed(() => {\n return this.rootContext.disabled() || this.disabled();\n });\n\n readonly open = computed(() => {\n const rootValue = this.rootContext.value();\n\n return this.rootContext.isSingle()\n ? this.value() === rootValue\n : Array.isArray(rootValue) && rootValue.includes(this.value()!);\n });\n\n /** Set by the trigger; links the content's `aria-labelledby` to the trigger `id`. */\n readonly triggerId = signal('');\n\n readonly index = this.listItem.index;\n\n constructor() {\n effect(() => {\n this.updateOpen();\n });\n\n // Forward the accordion-level mount controls onto the composed collapsible panel.\n effect(() => {\n this.collapsibleContext.keepMounted.set(this.rootContext.keepMounted());\n });\n effect(() => {\n this.collapsibleContext.hiddenUntilFound.set(this.rootContext.hiddenUntilFound());\n });\n\n let initialized = false;\n effect(() => {\n const isOpen = this.open();\n if (!initialized) {\n initialized = true;\n return;\n }\n const { eventDetails } = createCancelableChangeEventDetails('none', new Event('change'));\n this.onOpenChange.emit({ open: isOpen, eventDetails });\n });\n }\n\n updateOpen = () => {\n this.collapsibleContext.open.set(this.open());\n };\n}\n","import { Directive } from '@angular/core';\nimport { injectAccordionItemContext } from './accordion-item.directive';\n\n@Directive({\n selector: '[rdxAccordionHeader]',\n host: {\n '[attr.data-open]': 'itemContext.open() ? \"\" : undefined',\n '[attr.data-disabled]': 'itemContext.dataDisabled() ? \"\" : undefined',\n '[attr.data-index]': 'itemContext.index()'\n }\n})\nexport class RdxAccordionHeaderDirective {\n protected readonly itemContext = injectAccordionItemContext();\n}\n","import { Directive } from '@angular/core';\nimport { RdxCollapsiblePanelDirective } from '@radix-ng/primitives/collapsible';\nimport { injectAccordionItemContext } from './accordion-item.directive';\nimport { injectAccordionRootContext } from './accordion-root.directive';\n\n@Directive({\n selector: '[rdxAccordionPanel]',\n hostDirectives: [RdxCollapsiblePanelDirective],\n host: {\n role: 'region',\n '[attr.aria-labelledby]': 'itemContext.triggerId()',\n '[attr.data-disabled]': 'itemContext.dataDisabled() ? \"\" : undefined',\n '[attr.data-orientation]': 'rootContext.orientation()',\n '[attr.data-index]': 'itemContext.index()',\n // Base UI's accordion panel exposes `data-open` (no `data-closed`) — suppress the\n // `data-closed` the composed RdxCollapsiblePanelDirective would otherwise add.\n '[attr.data-closed]': 'undefined',\n // `data-open` / `data-starting-style` / `data-ending-style` and the `--collapsible-panel-*`\n // size vars come from the composed RdxCollapsiblePanelDirective.\n // Re-expose the size vars under Base UI's accordion-scoped names.\n '[style]': `{\n '--accordion-panel-height': 'var(--collapsible-panel-height)',\n '--accordion-panel-width': 'var(--collapsible-panel-width)',\n }`\n }\n})\nexport class RdxAccordionPanelDirective {\n protected readonly rootContext = injectAccordionRootContext();\n protected readonly itemContext = injectAccordionItemContext();\n}\n","import { Directive } from '@angular/core';\nimport { injectCollapsibleRootContext } from '@radix-ng/primitives/collapsible';\nimport { injectId } from '@radix-ng/primitives/core';\nimport { injectAccordionItemContext } from './accordion-item.directive';\nimport { injectAccordionRootContext } from './accordion-root.directive';\n\n@Directive({\n selector: '[rdxAccordionTrigger]',\n host: {\n '[id]': 'itemContext.triggerId()',\n '[attr.role]': '\"button\"',\n '[attr.aria-expanded]': 'itemContext.open()',\n // Point at the panel only while open — the panel unmounts when closed, so referencing a\n // missing id would be an invalid ARIA relationship. The id comes from the composed\n // collapsible root (the same id the accordion panel renders).\n '[attr.aria-controls]': 'itemContext.open() ? collapsibleContext.panelId() : undefined',\n // Disabled triggers stay focusable (Base UI parity) — `aria-disabled`, not native `disabled`.\n '[attr.aria-disabled]': 'itemContext.dataDisabled() ? \"true\" : undefined',\n '[attr.data-disabled]': 'itemContext.dataDisabled() ? \"\" : undefined',\n '[attr.data-panel-open]': 'itemContext.open() ? \"\" : undefined',\n\n '(click)': 'changeItem($event)'\n }\n})\nexport class RdxAccordionTriggerDirective {\n protected readonly rootContext = injectAccordionRootContext();\n protected readonly itemContext = injectAccordionItemContext();\n protected readonly collapsibleContext = injectCollapsibleRootContext();\n\n constructor() {\n this.itemContext.triggerId.set(injectId('rdx-accordion-trigger-'));\n }\n\n changeItem(event: Event) {\n // `dataDisabled` is the effective disabled state (accordion-root OR item level).\n if (this.itemContext.dataDisabled()) {\n return;\n }\n\n this.rootContext.changeModelValue(this.itemContext.value()!, event);\n }\n}\n","import { NgModule } from '@angular/core';\nimport { RdxAccordionHeaderDirective } from './src/accordion-header.directive';\nimport { RdxAccordionItemDirective } from './src/accordion-item.directive';\nimport { RdxAccordionPanelDirective } from './src/accordion-panel.directive';\nimport { RdxAccordionRootDirective } from './src/accordion-root.directive';\nimport { RdxAccordionTriggerDirective } from './src/accordion-trigger.directive';\n\nexport * from './src/accordion-header.directive';\nexport * from './src/accordion-item.directive';\nexport * from './src/accordion-panel.directive';\nexport * from './src/accordion-root.directive';\nexport * from './src/accordion-trigger.directive';\n\nconst _imports = [\n RdxAccordionHeaderDirective,\n RdxAccordionItemDirective,\n RdxAccordionPanelDirective,\n RdxAccordionRootDirective,\n RdxAccordionTriggerDirective\n];\n\n@NgModule({\n imports: [..._imports],\n exports: [..._imports]\n})\nexport class RdxAccordionModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1","i2"],"mappings":";;;;;;;;AA4CO,MAAM,CAAC,0BAA0B,EAAE,2BAA2B,CAAC,GAAG,aAAa,CAClF,sBAAsB,EACtB,sBAAsB;AAG1B,MAAM,WAAW,GAAG,MAA2B;AAC3C,IAAA,MAAM,QAAQ,GAAG,MAAM,CAAC,yBAAyB,CAAC;IAElD,OAAO;QACH,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,QAAQ,EAAE,QAAQ,CAAC,QAAQ;QAC3B,WAAW,EAAE,QAAQ,CAAC,WAAW;QACjC,gBAAgB,EAAE,QAAQ,CAAC,gBAAgB;QAC3C,gBAAgB,EAAE,QAAQ,CAAC;KAC9B;AACL,CAAC;AAED;;AAEG;MAWU,yBAAyB,CAAA;AAgFlC,IAAA,WAAA,GAAA;AA/EA;;;AAGG;QACM,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAwB,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;AAExF;;;;;;;;;AASG;QACM,IAAA,CAA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AAA;+GAOnB,kBAAkB,EAAA,CAAA,CAAA;;2FAAlB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAJ9B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACN,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ,CAAC;AACtB,oBAAA,OAAO,EAAE,CAAC,GAAG,QAAQ;AACxB,iBAAA;;;ACxBD;;AAEG;;;;"}
@@ -1,58 +1,33 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, ElementRef, Renderer2, input, numberAttribute, computed, Directive } from '@angular/core';
2
+ import { input, numberAttribute, Directive } from '@angular/core';
3
3
 
4
4
  /**
5
- * Directive to maintain an aspect ratio for an element.
6
- * The element will have its `padding-bottom` dynamically calculated
7
- * based on the provided aspect ratio to maintain the desired ratio.
8
- * The content inside the element will be positioned absolutely.
5
+ * Maintains a fixed aspect ratio for its content using the native CSS `aspect-ratio` property.
6
+ * Place the content inside (e.g. an `<img class="size-full object-cover">`) and it fills the box.
7
+ *
9
8
  * @group Components
10
9
  */
11
10
  class RdxAspectRatioDirective {
12
11
  constructor() {
13
- this.element = inject(ElementRef);
14
- this.renderer = inject(Renderer2);
15
12
  /**
16
- * The desired aspect ratio (e.g., 16/9).
17
- * By default, it is set to 1 (which results in a square, 1:1).
13
+ * The desired aspect ratio (e.g. `16 / 9`). Defaults to `1` (a square, 1:1).
14
+ *
18
15
  * @group Props
19
16
  * @defaultValue 1
20
17
  */
21
18
  this.ratio = input(1, { ...(ngDevMode ? { debugName: "ratio" } : /* istanbul ignore next */ {}), transform: numberAttribute });
22
- /**
23
- * Dynamically computed `padding-bottom` style for the element.
24
- * This value is calculated based on the inverse of the aspect ratio.
25
- *
26
- * If the ratio is zero, it defaults to `0%` to avoid division by zero.
27
- *
28
- */
29
- this.paddingBottom = computed(() => {
30
- const ratioValue = this.ratio();
31
- return `${ratioValue !== 0 ? (1 / ratioValue) * 100 : 0}%`;
32
- }, /* @ts-ignore */
33
- ...(ngDevMode ? [{ debugName: "paddingBottom" }] : /* istanbul ignore next */ []));
34
- }
35
- ngAfterViewInit() {
36
- const content = this.element.nativeElement.firstElementChild;
37
- if (content) {
38
- // Set the content to cover the entire element with absolute positioning
39
- this.renderer.setStyle(content, 'position', 'absolute');
40
- this.renderer.setStyle(content, 'inset', '0');
41
- }
42
19
  }
43
20
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxAspectRatioDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
44
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxAspectRatioDirective, isStandalone: true, selector: "[rdxAspectRatio]", inputs: { ratio: { classPropertyName: "ratio", publicName: "ratio", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.position": "'relative'", "style.width": "'100%'", "style.padding-bottom": "paddingBottom()" } }, exportAs: ["rdxAspectRatio"], ngImport: i0 }); }
21
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxAspectRatioDirective, isStandalone: true, selector: "[rdxAspectRatio]", inputs: { ratio: { classPropertyName: "ratio", publicName: "ratio", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.aspect-ratio": "ratio() || null", "style.width": "\"100%\"" } }, exportAs: ["rdxAspectRatio"], ngImport: i0 }); }
45
22
  }
46
23
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxAspectRatioDirective, decorators: [{
47
24
  type: Directive,
48
25
  args: [{
49
26
  selector: '[rdxAspectRatio]',
50
27
  exportAs: 'rdxAspectRatio',
51
- standalone: true,
52
28
  host: {
53
- '[style.position]': `'relative'`,
54
- '[style.width]': `'100%'`,
55
- '[style.padding-bottom]': 'paddingBottom()'
29
+ '[style.aspect-ratio]': 'ratio() || null',
30
+ '[style.width]': '"100%"'
56
31
  }
57
32
  }]
58
33
  }], propDecorators: { ratio: [{ type: i0.Input, args: [{ isSignal: true, alias: "ratio", required: false }] }] } });
@@ -1 +1 @@
1
- {"version":3,"file":"radix-ng-primitives-aspect-ratio.mjs","sources":["../../../packages/primitives/aspect-ratio/src/aspect-ratio.directive.ts","../../../packages/primitives/aspect-ratio/radix-ng-primitives-aspect-ratio.ts"],"sourcesContent":["import {\n AfterViewInit,\n computed,\n Directive,\n ElementRef,\n inject,\n input,\n numberAttribute,\n Renderer2\n} from '@angular/core';\nimport { NumberInput } from '@radix-ng/primitives/core';\n\n/**\n * Directive to maintain an aspect ratio for an element.\n * The element will have its `padding-bottom` dynamically calculated\n * based on the provided aspect ratio to maintain the desired ratio.\n * The content inside the element will be positioned absolutely.\n * @group Components\n */\n@Directive({\n selector: '[rdxAspectRatio]',\n exportAs: 'rdxAspectRatio',\n standalone: true,\n host: {\n '[style.position]': `'relative'`,\n '[style.width]': `'100%'`,\n '[style.padding-bottom]': 'paddingBottom()'\n }\n})\nexport class RdxAspectRatioDirective implements AfterViewInit {\n private readonly element = inject(ElementRef);\n private readonly renderer = inject(Renderer2);\n\n /**\n * The desired aspect ratio (e.g., 16/9).\n * By default, it is set to 1 (which results in a square, 1:1).\n * @group Props\n * @defaultValue 1\n */\n readonly ratio = input<number, NumberInput>(1, { transform: numberAttribute });\n\n /**\n * Dynamically computed `padding-bottom` style for the element.\n * This value is calculated based on the inverse of the aspect ratio.\n *\n * If the ratio is zero, it defaults to `0%` to avoid division by zero.\n *\n */\n protected readonly paddingBottom = computed(() => {\n const ratioValue = this.ratio();\n return `${ratioValue !== 0 ? (1 / ratioValue) * 100 : 0}%`;\n });\n\n ngAfterViewInit() {\n const content = this.element.nativeElement.firstElementChild;\n if (content) {\n // Set the content to cover the entire element with absolute positioning\n this.renderer.setStyle(content, 'position', 'absolute');\n this.renderer.setStyle(content, 'inset', '0');\n }\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAYA;;;;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AA,EAAA,aAAA,EAAA,QAAA,EAAA,sBAAA,EAAA,iBAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBAVnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,IAAI,EAAE;AACF,wBAAA,kBAAkB,EAAE,CAAA,UAAA,CAAY;AAChC,wBAAA,eAAe,EAAE,CAAA,MAAA,CAAQ;AACzB,wBAAA,wBAAwB,EAAE;AAC7B;AACJ,iBAAA;;;AC5BD;;AAEG;;;;"}
1
+ {"version":3,"file":"radix-ng-primitives-aspect-ratio.mjs","sources":["../../../packages/primitives/aspect-ratio/src/aspect-ratio.directive.ts","../../../packages/primitives/aspect-ratio/radix-ng-primitives-aspect-ratio.ts"],"sourcesContent":["import { Directive, input, numberAttribute } from '@angular/core';\nimport { NumberInput } from '@radix-ng/primitives/core';\n\n/**\n * Maintains a fixed aspect ratio for its content using the native CSS `aspect-ratio` property.\n * Place the content inside (e.g. an `<img class=\"size-full object-cover\">`) and it fills the box.\n *\n * @group Components\n */\n@Directive({\n selector: '[rdxAspectRatio]',\n exportAs: 'rdxAspectRatio',\n host: {\n '[style.aspect-ratio]': 'ratio() || null',\n '[style.width]': '\"100%\"'\n }\n})\nexport class RdxAspectRatioDirective {\n /**\n * The desired aspect ratio (e.g. `16 / 9`). Defaults to `1` (a square, 1:1).\n *\n * @group Props\n * @defaultValue 1\n */\n readonly ratio = input<number, NumberInput>(1, { transform: numberAttribute });\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;AAGA;;;;;AAKG;MASU,uBAAuB,CAAA;AARpC,IAAA,WAAA,GAAA;AASI;;;;;AAKG;QACM,IAAA,CAAA,KAAK,GAAG,KAAK,CAAsB,CAAC,6EAAI,SAAS,EAAE,eAAe,EAAA,CAAG;AACjF,IAAA;8GARY,uBAAuB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA,CAAA;kGAAvB,uBAAuB,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,kBAAA,EAAA,MAAA,EAAA,EAAA,KAAA,EAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,UAAA,EAAA,OAAA,EAAA,QAAA,EAAA,IAAA,EAAA,UAAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,UAAA,EAAA,EAAA,oBAAA,EAAA,iBAAA,EAAA,aAAA,EAAA,UAAA,EAAA,EAAA,EAAA,QAAA,EAAA,CAAA,gBAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA,CAAA;;2FAAvB,uBAAuB,EAAA,UAAA,EAAA,CAAA;kBARnC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACP,oBAAA,QAAQ,EAAE,kBAAkB;AAC5B,oBAAA,QAAQ,EAAE,gBAAgB;AAC1B,oBAAA,IAAI,EAAE;AACF,wBAAA,sBAAsB,EAAE,iBAAiB;AACzC,wBAAA,eAAe,EAAE;AACpB;AACJ,iBAAA;;;AChBD;;AAEG;;;;"}
@@ -8,7 +8,7 @@ import * as i1$2 from '@radix-ng/primitives/dismissable-layer';
8
8
  import { RdxFloatingInsideElement, RdxDismiss } from '@radix-ng/primitives/dismissable-layer';
9
9
  import { NG_VALUE_ACCESSOR } from '@angular/forms';
10
10
  import * as i2 from '@radix-ng/primitives/core';
11
- import { createFloatingRootContext, rdxDevWarning, isItemEqualToValue, itemToStringLabel, createCancelableChangeEventDetails, provideFloatingTree, provideFloatingRootContext, setupInternalBackdrop, injectId, RDX_FLOATING_ROOT_CONTEXT, RDX_FLOATING_REGISTRATION, useAnchoredScrollLock, RdxFloatingNodeRegistration, rdxDevError } from '@radix-ng/primitives/core';
11
+ import { RdxFormUiControlBase, createFloatingRootContext, rdxDevWarning, isItemEqualToValue, itemToStringLabel, createCancelableChangeEventDetails, provideFloatingTree, provideFloatingRootContext, setupInternalBackdrop, injectId, RDX_FLOATING_ROOT_CONTEXT, RDX_FLOATING_REGISTRATION, useAnchoredScrollLock, RdxFloatingNodeRegistration, rdxDevError } from '@radix-ng/primitives/core';
12
12
  import { injectDirection } from '@radix-ng/primitives/direction-provider';
13
13
  import { injectFieldRootContext } from '@radix-ng/primitives/field';
14
14
 
@@ -142,6 +142,9 @@ const context = () => {
142
142
  setInputValue: (value) => root.setQuery(value),
143
143
  openAndHighlight: (edge, reason, event) => root.openAndHighlight(edge, reason, event),
144
144
  navigateByKeyboard: (direction, event) => root.navigateByKeyboard(direction, event),
145
+ invalidState: root.invalidState,
146
+ touchedState: root.touchedState,
147
+ dirtyState: root.dirtyState,
145
148
  select: (item, event) => root.handleSelect(item, event),
146
149
  selectIndex: (index, event) => root.selectIndex(index, event),
147
150
  selectHighlighted: (event) => root.selectHighlighted(event),
@@ -171,7 +174,7 @@ function coerceAutoHighlight(value) {
171
174
  *
172
175
  * @group Components
173
176
  */
174
- class RdxAutocompleteRoot {
177
+ class RdxAutocompleteRoot extends RdxFormUiControlBase {
175
178
  // --- engine-backed surface read by the parts / tests ---
176
179
  get listId() {
177
180
  return this.engine.listId;
@@ -231,6 +234,7 @@ class RdxAutocompleteRoot {
231
234
  return this.engine.triggerElement;
232
235
  }
233
236
  constructor() {
237
+ super();
234
238
  this.injector = inject(Injector);
235
239
  /** Per-popup floating root context (ADR 0015) — `open` / `triggers` / reference for the dismissal engine. */
236
240
  this.floatingContext = createFloatingRootContext({
@@ -332,6 +336,12 @@ class RdxAutocompleteRoot {
332
336
  ...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
333
337
  this.requiredState = computed(() => this.required(), /* @ts-ignore */
334
338
  ...(ngDevMode ? [{ debugName: "requiredState" }] : /* istanbul ignore next */ []));
339
+ /** @ignore */
340
+ this.invalidState = this.formUi.invalidState;
341
+ /** @ignore */
342
+ this.touchedState = this.formUi.touchedState;
343
+ /** @ignore */
344
+ this.dirtyState = this.formUi.dirtyState;
335
345
  this.preventUnmountOnClose = signal(false, /* @ts-ignore */
336
346
  ...(ngDevMode ? [{ debugName: "preventUnmountOnClose" }] : /* istanbul ignore next */ []));
337
347
  this.present = computed(() => this.open() || this.preventUnmountOnClose(), /* @ts-ignore */
@@ -603,8 +613,12 @@ class RdxAutocompleteRoot {
603
613
  focusInput() {
604
614
  this.engine.focusInput();
605
615
  }
616
+ /** @ignore Bridge the CVA `onTouched` so `markAsTouched()` also notifies Reactive/template forms. */
617
+ formUiTouchTarget() {
618
+ return { markAsTouched: () => this.onTouched?.() };
619
+ }
606
620
  markAsTouched() {
607
- this.onTouched?.();
621
+ this.formUi.markAsTouched();
608
622
  }
609
623
  commitValue(value, reason, event = new Event('autocomplete.value-change')) {
610
624
  // Mirror combobox's guarded commit: never mutate the value while disabled or read-only
@@ -618,6 +632,7 @@ class RdxAutocompleteRoot {
618
632
  return;
619
633
  }
620
634
  this.value.set(value);
635
+ this.formUi.markDirty();
621
636
  this.onChange?.(value);
622
637
  }
623
638
  createOpenChangeEvent(open, reason, event) {
@@ -661,7 +676,7 @@ class RdxAutocompleteRoot {
661
676
  // New floating foundation (ADR 0015/0017) — the dismissal capability reads this shared context.
662
677
  provideFloatingTree(),
663
678
  provideFloatingRootContext(() => inject(RdxAutocompleteRoot).floatingContext)
664
- ], exportAs: ["rdxAutocompleteRoot"], hostDirectives: [{ directive: i1$1.RdxPopper }], ngImport: i0 }); }
679
+ ], exportAs: ["rdxAutocompleteRoot"], usesInheritance: true, hostDirectives: [{ directive: i1$1.RdxPopper }], ngImport: i0 }); }
665
680
  }
666
681
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxAutocompleteRoot, decorators: [{
667
682
  type: Directive,
@@ -882,12 +897,27 @@ class RdxAutocompleteInput {
882
897
  // `aria-autocomplete` tokens. Must reflect the static mechanism, not the transient inline preview.
883
898
  this.ariaAutocomplete = computed(() => this.root.mode(), /* @ts-ignore */
884
899
  ...(ngDevMode ? [{ debugName: "ariaAutocomplete" }] : /* istanbul ignore next */ []));
885
- this.invalidState = computed(() => this.invalid() || Boolean(this.fieldRootContext?.invalidState()), /* @ts-ignore */
900
+ this.invalidState = computed(() => this.invalid() || this.root.invalidState() || Boolean(this.fieldRootContext?.invalidState()), /* @ts-ignore */
886
901
  ...(ngDevMode ? [{ debugName: "invalidState" }] : /* istanbul ignore next */ []));
902
+ /**
903
+ * Tri-state *displayed* validity: the enclosing Field's gated `validState` when inside a `rdxFieldRoot`
904
+ * (so a field whose `validationMode` defers display (e.g. `onBlur`) keeps the input neutral until revealed), else the input's
905
+ * own binary invalidity.
906
+ */
907
+ this.displayValid = computed(() => this.fieldRootContext
908
+ ? this.fieldRootContext.validState()
909
+ : this.invalid() || this.root.invalidState()
910
+ ? false
911
+ : true, /* @ts-ignore */
912
+ ...(ngDevMode ? [{ debugName: "displayValid" }] : /* istanbul ignore next */ []));
887
913
  this.disabledState = computed(() => this.root.disabledState() || Boolean(this.fieldRootContext?.disabledState()), /* @ts-ignore */
888
914
  ...(ngDevMode ? [{ debugName: "disabledState" }] : /* istanbul ignore next */ []));
889
915
  this.requiredState = computed(() => this.root.requiredState() || Boolean(this.fieldRootContext?.requiredState()), /* @ts-ignore */
890
916
  ...(ngDevMode ? [{ debugName: "requiredState" }] : /* istanbul ignore next */ []));
917
+ this.touchedState = computed(() => this.root.touchedState() || Boolean(this.fieldRootContext?.touchedState()), /* @ts-ignore */
918
+ ...(ngDevMode ? [{ debugName: "touchedState" }] : /* istanbul ignore next */ []));
919
+ this.dirtyState = computed(() => this.root.dirtyState() || Boolean(this.fieldRootContext?.dirtyState()), /* @ts-ignore */
920
+ ...(ngDevMode ? [{ debugName: "dirtyState" }] : /* istanbul ignore next */ []));
891
921
  this.filledState = computed(() => Boolean(this.root.value()) || Boolean(this.fieldRootContext?.filledState()), /* @ts-ignore */
892
922
  ...(ngDevMode ? [{ debugName: "filledState" }] : /* istanbul ignore next */ []));
893
923
  this.focusedState = computed(() => Boolean(this.fieldRootContext?.focusedState()), /* @ts-ignore */
@@ -959,6 +989,8 @@ class RdxAutocompleteInput {
959
989
  onBlur() {
960
990
  this.fieldRootContext?.setFocused(false);
961
991
  this.fieldRootContext?.setTouched(true);
992
+ // Notify Signal Forms (touched model + touch output) the control was touched.
993
+ this.root.markAsTouched();
962
994
  }
963
995
  onKeydown(event) {
964
996
  if (event.isComposing || this.composing) {
@@ -1060,7 +1092,7 @@ class RdxAutocompleteInput {
1060
1092
  }
1061
1093
  }
1062
1094
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxAutocompleteInput, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
1063
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxAutocompleteInput, isStandalone: true, selector: "input[rdxAutocompleteInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "combobox", "autocomplete": "off" }, listeners: { "input": "onInput($event)", "click": "onClick($event)", "focus": "onFocus()", "blur": "onBlur()", "keydown": "onKeydown($event)", "compositionstart": "composing = true", "compositionend": "onCompositionEnd($event)" }, properties: { "attr.aria-autocomplete": "ariaAutocomplete()", "attr.id": "id()", "attr.aria-haspopup": "root.grid() ? \"grid\" : \"listbox\"", "attr.aria-expanded": "root.open()", "attr.aria-controls": "root.listId", "attr.aria-labelledby": "root.labelId()", "attr.aria-activedescendant": "root.activeId()", "attr.aria-describedby": "describedBy()", "attr.aria-invalid": "invalidState() ? \"true\" : undefined", "attr.aria-required": "requiredState() ? \"true\" : undefined", "attr.aria-disabled": "disabledState() ? \"true\" : undefined", "attr.disabled": "disabledState() ? \"\" : undefined", "attr.readonly": "root.readOnly() ? \"\" : undefined", "attr.required": "requiredState() ? \"\" : undefined", "value": "root.displayValue()", "attr.data-popup-open": "dataAttr(root.open())", "attr.data-list-empty": "dataAttr(root.visibleCount() === 0)", "attr.data-invalid": "dataAttr(invalidState())", "attr.data-valid": "dataAttr(!invalidState())", "attr.data-disabled": "dataAttr(disabledState())", "attr.data-required": "dataAttr(requiredState())", "attr.data-filled": "dataAttr(filledState())", "attr.data-focused": "dataAttr(focusedState())" } }, exportAs: ["rdxAutocompleteInput"], hostDirectives: [{ directive: i1$1.RdxPopperAnchor }, { directive: i1$2.RdxFloatingInsideElement }], ngImport: i0 }); }
1095
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "22.0.2", type: RdxAutocompleteInput, isStandalone: true, selector: "input[rdxAutocompleteInput]", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, invalid: { classPropertyName: "invalid", publicName: "invalid", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "combobox", "autocomplete": "off" }, listeners: { "input": "onInput($event)", "click": "onClick($event)", "focus": "onFocus()", "blur": "onBlur()", "keydown": "onKeydown($event)", "compositionstart": "composing = true", "compositionend": "onCompositionEnd($event)" }, properties: { "attr.aria-autocomplete": "ariaAutocomplete()", "attr.id": "id()", "attr.aria-haspopup": "root.grid() ? \"grid\" : \"listbox\"", "attr.aria-expanded": "root.open()", "attr.aria-controls": "root.listId", "attr.aria-labelledby": "root.labelId()", "attr.aria-activedescendant": "root.activeId()", "attr.aria-describedby": "describedBy()", "attr.aria-invalid": "displayValid() === false ? \"true\" : undefined", "attr.aria-required": "requiredState() ? \"true\" : undefined", "attr.aria-disabled": "disabledState() ? \"true\" : undefined", "attr.disabled": "disabledState() ? \"\" : undefined", "attr.readonly": "root.readOnly() ? \"\" : undefined", "attr.required": "requiredState() ? \"\" : undefined", "value": "root.displayValue()", "attr.data-popup-open": "dataAttr(root.open())", "attr.data-list-empty": "dataAttr(root.visibleCount() === 0)", "attr.data-invalid": "dataAttr(displayValid() === false)", "attr.data-valid": "dataAttr(displayValid() === true)", "attr.data-disabled": "dataAttr(disabledState())", "attr.data-required": "dataAttr(requiredState())", "attr.data-touched": "dataAttr(touchedState())", "attr.data-dirty": "dataAttr(dirtyState())", "attr.data-filled": "dataAttr(filledState())", "attr.data-focused": "dataAttr(focusedState())" } }, exportAs: ["rdxAutocompleteInput"], hostDirectives: [{ directive: i1$1.RdxPopperAnchor }, { directive: i1$2.RdxFloatingInsideElement }], ngImport: i0 }); }
1064
1096
  }
1065
1097
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImport: i0, type: RdxAutocompleteInput, decorators: [{
1066
1098
  type: Directive,
@@ -1079,7 +1111,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
1079
1111
  '[attr.aria-labelledby]': 'root.labelId()',
1080
1112
  '[attr.aria-activedescendant]': 'root.activeId()',
1081
1113
  '[attr.aria-describedby]': 'describedBy()',
1082
- '[attr.aria-invalid]': 'invalidState() ? "true" : undefined',
1114
+ '[attr.aria-invalid]': 'displayValid() === false ? "true" : undefined',
1083
1115
  '[attr.aria-required]': 'requiredState() ? "true" : undefined',
1084
1116
  '[attr.aria-disabled]': 'disabledState() ? "true" : undefined',
1085
1117
  '[attr.disabled]': 'disabledState() ? "" : undefined',
@@ -1088,10 +1120,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.2", ngImpor
1088
1120
  '[value]': 'root.displayValue()',
1089
1121
  '[attr.data-popup-open]': 'dataAttr(root.open())',
1090
1122
  '[attr.data-list-empty]': 'dataAttr(root.visibleCount() === 0)',
1091
- '[attr.data-invalid]': 'dataAttr(invalidState())',
1092
- '[attr.data-valid]': 'dataAttr(!invalidState())',
1123
+ '[attr.data-invalid]': 'dataAttr(displayValid() === false)',
1124
+ '[attr.data-valid]': 'dataAttr(displayValid() === true)',
1093
1125
  '[attr.data-disabled]': 'dataAttr(disabledState())',
1094
1126
  '[attr.data-required]': 'dataAttr(requiredState())',
1127
+ '[attr.data-touched]': 'dataAttr(touchedState())',
1128
+ '[attr.data-dirty]': 'dataAttr(dirtyState())',
1095
1129
  '[attr.data-filled]': 'dataAttr(filledState())',
1096
1130
  '[attr.data-focused]': 'dataAttr(focusedState())',
1097
1131
  '(input)': 'onInput($event)',