@tailng-ui/primitives 0.14.0 → 0.16.0

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 (56) hide show
  1. package/package.json +3 -2
  2. package/src/index.d.ts +1 -0
  3. package/src/index.d.ts.map +1 -1
  4. package/src/index.js +1 -0
  5. package/src/index.js.map +1 -1
  6. package/src/lib/form/datepicker/__tests__/tng-datepicker.test-helpers.d.ts +25 -0
  7. package/src/lib/form/datepicker/__tests__/tng-datepicker.test-helpers.d.ts.map +1 -0
  8. package/src/lib/form/datepicker/__tests__/tng-datepicker.test-helpers.js +105 -0
  9. package/src/lib/form/datepicker/__tests__/tng-datepicker.test-helpers.js.map +1 -0
  10. package/src/lib/form/datepicker/datepicker.adapters.d.ts +5 -0
  11. package/src/lib/form/datepicker/datepicker.adapters.d.ts.map +1 -0
  12. package/src/lib/form/datepicker/datepicker.adapters.js +194 -0
  13. package/src/lib/form/datepicker/datepicker.adapters.js.map +1 -0
  14. package/src/lib/form/datepicker/datepicker.state.d.ts +10 -0
  15. package/src/lib/form/datepicker/datepicker.state.d.ts.map +1 -0
  16. package/src/lib/form/datepicker/datepicker.state.js +97 -0
  17. package/src/lib/form/datepicker/datepicker.state.js.map +1 -0
  18. package/src/lib/form/datepicker/datepicker.types.d.ts +269 -0
  19. package/src/lib/form/datepicker/datepicker.types.d.ts.map +1 -0
  20. package/src/lib/form/datepicker/datepicker.types.js +1 -0
  21. package/src/lib/form/datepicker/datepicker.types.js.map +1 -0
  22. package/src/lib/form/datepicker/datepicker.utils.d.ts +75 -0
  23. package/src/lib/form/datepicker/datepicker.utils.d.ts.map +1 -0
  24. package/src/lib/form/datepicker/datepicker.utils.js +238 -0
  25. package/src/lib/form/datepicker/datepicker.utils.js.map +1 -0
  26. package/src/lib/form/datepicker/index.d.ts +3 -0
  27. package/src/lib/form/datepicker/index.d.ts.map +1 -0
  28. package/src/lib/form/datepicker/index.js +3 -0
  29. package/src/lib/form/datepicker/index.js.map +1 -0
  30. package/src/lib/form/datepicker/tng-datepicker.d.ts +5 -0
  31. package/src/lib/form/datepicker/tng-datepicker.d.ts.map +1 -0
  32. package/src/lib/form/datepicker/tng-datepicker.js +1948 -0
  33. package/src/lib/form/datepicker/tng-datepicker.js.map +1 -0
  34. package/src/lib/form/datepicker/tng-datepicker.overlay.d.ts +60 -0
  35. package/src/lib/form/datepicker/tng-datepicker.overlay.d.ts.map +1 -0
  36. package/src/lib/form/datepicker/tng-datepicker.overlay.js +275 -0
  37. package/src/lib/form/datepicker/tng-datepicker.overlay.js.map +1 -0
  38. package/src/lib/form/input/tng-input.d.ts +10 -10
  39. package/src/lib/form/input/tng-input.d.ts.map +1 -1
  40. package/src/lib/form/input/tng-input.js +28 -27
  41. package/src/lib/form/input/tng-input.js.map +1 -1
  42. package/src/lib/layout/grid/__tests__/tng-grid.test-harness.d.ts +32 -0
  43. package/src/lib/layout/grid/__tests__/tng-grid.test-harness.d.ts.map +1 -0
  44. package/src/lib/layout/grid/__tests__/tng-grid.test-harness.js +312 -0
  45. package/src/lib/layout/grid/__tests__/tng-grid.test-harness.js.map +1 -0
  46. package/src/lib/layout/grid/tng-grid.d.ts +144 -2
  47. package/src/lib/layout/grid/tng-grid.d.ts.map +1 -1
  48. package/src/lib/layout/grid/tng-grid.js +669 -2
  49. package/src/lib/layout/grid/tng-grid.js.map +1 -1
  50. package/src/lib/layout/tree/__tests__/tng-tree.test-harness.d.ts.map +1 -1
  51. package/src/lib/layout/tree/__tests__/tng-tree.test-harness.js +0 -1
  52. package/src/lib/layout/tree/__tests__/tng-tree.test-harness.js.map +1 -1
  53. package/src/lib/navigation/tabs/tng-tabs.d.ts +13 -6
  54. package/src/lib/navigation/tabs/tng-tabs.d.ts.map +1 -1
  55. package/src/lib/navigation/tabs/tng-tabs.js +77 -35
  56. package/src/lib/navigation/tabs/tng-tabs.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tng-input.js","sourceRoot":"","sources":["../../../../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M,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAChD,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAC7B,CAAC;IAES,qBAAqB;QAC7B,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,aAAa,CAC5C,oHAAoH,CACrH,CAAC;QACF,IACE,OAAO,YAAY,gBAAgB;YACnC,OAAO,YAAY,mBAAmB,EACtC,CAAC;YACD,OAAO,OAAO,CAAC;QACjB,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;uGAzKU,aAAa;2FAAb,aAAa,izCAQP,QAAQ,kEAGR,eAAe,mEAGf,gBAAgB,6EAhCvB;;;;;;;;;;;;;;;;GAgBT;;2FAEU,aAAa;kBArBzB,SAAS;mBAAC;oBACT,QAAQ,EAAE,kCAAkC;oBAC5C,QAAQ,EAAE,eAAe;oBACzB,QAAQ,EAAE;;;;;;;;;;;;;;;;GAgBT;iBACF;;sBASE,eAAe;uBAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;sBAG/C,eAAe;uBAAC,eAAe,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;sBAGtD,eAAe;uBAAC,gBAAgB,EAAE,EAAE,WAAW,EAAE,IAAI,EAAE;;sBAuCvD,WAAW;uBAAC,gBAAgB;;sBAG5B,WAAW;uBAAC,uBAAuB;;sBAKnC,WAAW;uBAAC,wBAAwB;;sBAKpC,WAAW;uBAAC,oBAAoB;;sBAahC,WAAW;uBAAC,mBAAmB;;sBAc/B,WAAW;uBAAC,oBAAoB;;sBAahC,WAAW;uBAAC,mBAAmB;;sBAK/B,YAAY;uBAAC,SAAS;;sBAKtB,YAAY;uBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {\n AfterContentInit,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n HostBinding,\n HostListener,\n OnDestroy,\n QueryList,\n booleanAttribute,\n inject,\n input,\n isDevMode,\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { TngUniqueIdService } from '../_shared/id';\n\ntype NullableBooleanInput = boolean | null | string | undefined;\n\nexport type TngInputType = 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url';\n\nexport function coerceTngInputNullableBoolean(value: NullableBooleanInput): boolean | null {\n if (value === undefined || value === null) return null;\n\n if (value === '' || value === true || value === 'true') return true;\n\n if (value === false || value === 'false') return false;\n\n return null;\n}\n\nfunction normalizeStringValue(value: string | null | undefined): string | null {\n if (value === undefined || value === null) return null;\n\n const normalized = value.trim();\n return normalized.length > 0 ? normalized : null;\n}\n\nfunction toAriaBoolean(value: boolean | null): 'false' | 'true' | null {\n if (value === null) return null;\n return value ? 'true' : 'false';\n}\n\nfunction hasProjectedContent(element: HTMLElement): boolean {\n return Array.from(element.childNodes).some((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n return true;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n return (node.textContent ?? '').trim().length > 0;\n }\n\n return false;\n });\n}\n\n@Directive({\n selector: 'input[tngInput], textarea[tngInput]',\n exportAs: 'tngInput',\n})\nexport class TngInput {\n private readonly elementRef = inject(ElementRef<HTMLInputElement | HTMLTextAreaElement>);\n private readonly idService = inject(TngUniqueIdService);\n\n public readonly hostElement = this.elementRef.nativeElement;\n private readonly initialAriaLabel = normalizeStringValue(this.hostElement.getAttribute('aria-label'));\n private readonly initialAriaLabelledby = normalizeStringValue(this.hostElement.getAttribute('aria-labelledby'));\n private readonly initialAriaDescribedBy = normalizeStringValue(\n this.hostElement.getAttribute('aria-describedby'),\n );\n\n private readonly generatedId = this.idService.nextId('tng-input');\n\n /** Canonical API for aria-describedby (whitespace normalized). */\n public readonly ariaDescribedBy = input<string | null>(null);\n\n public readonly ariaLabel = input<string | null>(null);\n public readonly ariaLabelledby = input<string | null>(null);\n\n /** If non-null, this value overrides native validity in `isInvalid()`. */\n public readonly ariaInvalid = input<boolean | null, NullableBooleanInput>(null, {\n transform: coerceTngInputNullableBoolean,\n });\n\n public readonly ariaRequired = input<boolean | null, NullableBooleanInput>(null, {\n transform: coerceTngInputNullableBoolean,\n });\n\n public readonly disabled = input<boolean, boolean | string>(false, { transform: booleanAttribute });\n public readonly readonly = input<boolean, boolean | string>(false, { transform: booleanAttribute });\n public readonly required = input<boolean, boolean | string>(false, { transform: booleanAttribute });\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input' as const;\n\n @HostBinding('attr.id')\n protected get idAttr(): string {\n const nativeId = normalizeStringValue(this.hostElement.getAttribute('id'));\n return nativeId ?? this.generatedId;\n }\n\n @HostBinding('attr.aria-label')\n protected get ariaLabelAttr(): string | null {\n const provided = normalizeStringValue(this.ariaLabel());\n if (provided !== null) return provided;\n\n return this.initialAriaLabel;\n }\n\n @HostBinding('attr.aria-labelledby')\n protected get ariaLabelledbyAttr(): string | null {\n const provided = normalizeStringValue(this.ariaLabelledby());\n if (provided !== null) return provided;\n\n return this.initialAriaLabelledby;\n }\n\n /**\n * If the consumer provided a native `aria-describedby` and the input is not set,\n * preserve it (do not clobber).\n */\n @HostBinding('attr.aria-describedby')\n protected get ariaDescribedByAttr(): string | null {\n const provided = normalizeStringValue(this.ariaDescribedBy());\n if (provided !== null) return provided;\n\n return this.initialAriaDescribedBy;\n }\n\n /**\n * Omit `aria-invalid` unless invalid. (Avoids noisy aria-invalid=\"false\" and\n * makes unit tests + bindings more stable.)\n */\n @HostBinding('attr.aria-invalid')\n protected get ariaInvalidAttr(): 'true' | null {\n return this.isInvalid() ? 'true' : null;\n }\n\n @HostBinding('attr.aria-required')\n protected get ariaRequiredAttr(): 'false' | 'true' | null {\n if (this.required()) return 'true';\n return toAriaBoolean(this.ariaRequired());\n }\n\n @HostBinding('attr.data-disabled')\n protected get dataDisabledAttr(): '' | null {\n return this.disabled() ? '' : null;\n }\n\n @HostBinding('attr.data-invalid')\n protected get dataInvalidAttr(): '' | null {\n return this.isInvalid() ? '' : null;\n }\n\n @HostBinding('attr.data-readonly')\n protected get dataReadonlyAttr(): '' | null {\n return this.readonly() ? '' : null;\n }\n\n @HostBinding('attr.disabled')\n protected get disabledAttr(): '' | null {\n return this.disabled() ? '' : null;\n }\n\n @HostBinding('attr.readonly')\n protected get readonlyAttr(): '' | null {\n return this.readonly() ? '' : null;\n }\n\n @HostBinding('attr.required')\n protected get requiredAttr(): '' | null {\n return this.required() ? '' : null;\n }\n\n public isInvalid(): boolean {\n const override = this.ariaInvalid();\n if (override !== null) return override;\n\n // jsdom may not fully implement validity; this is still correct for browsers.\n return this.hostElement.matches(':invalid');\n }\n}\n\n@Directive({\n selector: '[tngInputLeading]',\n exportAs: 'tngInputLeading',\n})\nexport class TngInputLeading {\n readonly hostElement = inject(ElementRef<HTMLElement>).nativeElement;\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input-leading' as const;\n}\n\n@Directive({\n selector: '[tngInputTrailing]',\n exportAs: 'tngInputTrailing',\n})\nexport class TngInputTrailing {\n readonly hostElement = inject(ElementRef<HTMLElement>).nativeElement;\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input-trailing' as const;\n}\n\n@Component({\n selector: 'tng-input-group, [tngInputGroup]',\n exportAs: 'tngInputGroup',\n template: `\n @if (hasLeadingSlot()) {\n <span class=\"tng-input-group-leading\" data-slot=\"input-group-leading\">\n <ng-content select=\"[tngInputLeading], [data-tng-input-leading-proxy]\"></ng-content>\n </span>\n }\n\n <span class=\"tng-input-group-control\" data-slot=\"input-group-control\">\n <ng-content select=\"input[tngInput], textarea[tngInput], [data-tng-input-control-proxy]\"></ng-content>\n </span>\n\n @if (hasTrailingSlot()) {\n <span class=\"tng-input-group-trailing\" data-slot=\"input-group-trailing\">\n <ng-content select=\"[tngInputTrailing], [data-tng-input-trailing-proxy]\"></ng-content>\n </span>\n }\n `,\n})\nexport class TngInputGroup implements AfterContentInit, OnDestroy {\n public readonly hasLeading = input<boolean | null>(null);\n public readonly hasTrailing = input<boolean | null>(null);\n public readonly disabled = input<boolean | null>(null);\n public readonly invalid = input<boolean | null>(null);\n public readonly readonly = input<boolean | null>(null);\n public readonly controlCount = input<number | null>(null);\n\n @ContentChildren(TngInput, { descendants: true })\n protected controls!: QueryList<TngInput>;\n\n @ContentChildren(TngInputLeading, { descendants: true })\n protected leadingSlots!: QueryList<TngInputLeading>;\n\n @ContentChildren(TngInputTrailing, { descendants: true })\n protected trailingSlots!: QueryList<TngInputTrailing>;\n\n private readonly hostElement = inject(ElementRef<HTMLElement>).nativeElement;\n\n private focused = false;\n\n private readonly destroyed$ = new Subject<void>();\n\n private validateSingleControl(): void {\n if (!isDevMode()) return;\n if (!this.controls) return;\n\n const queriedCount = this.controls.length;\n const domCount = this.hostElement.querySelectorAll(\n '[data-tng-input-control-proxy] input, [data-tng-input-control-proxy] textarea, input[tngInput], textarea[tngInput]',\n ).length;\n const count = this.controlCount() ?? (queriedCount > 0 ? queriedCount : domCount);\n if (count !== 1) {\n console.warn(\n `[tngInputGroup] Expected exactly 1 control (input/textarea with tngInput), but found ${count}.`,\n this.hostElement,\n );\n }\n }\n\n public ngAfterContentInit(): void {\n queueMicrotask(() => this.validateSingleControl());\n\n this.controls.changes\n .pipe(takeUntil(this.destroyed$))\n .subscribe(() => this.validateSingleControl());\n }\n\n public ngOnDestroy(): void {\n this.destroyed$.next();\n this.destroyed$.complete();\n }\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input-group' as const;\n\n @HostBinding('attr.data-has-leading')\n protected get dataHasLeading(): '' | null {\n return this.effectiveHasLeading() ? '' : null;\n }\n\n @HostBinding('attr.data-has-trailing')\n protected get dataHasTrailing(): '' | null {\n return this.effectiveHasTrailing() ? '' : null;\n }\n\n @HostBinding('attr.data-disabled')\n protected get dataDisabled(): '' | null {\n const override = this.disabled();\n if (override !== null) return override ? '' : null;\n\n const control = this.primaryControl();\n if (control !== null) return control.disabled() ? '' : null;\n\n const element = this.primaryControlElement();\n if (element === null) return null;\n return element.hasAttribute('disabled') ? '' : null;\n }\n\n @HostBinding('attr.data-invalid')\n protected get dataInvalid(): '' | null {\n const override = this.invalid();\n if (override !== null) return override ? '' : null;\n\n const control = this.primaryControl();\n if (control !== null) return control.isInvalid() ? '' : null;\n\n const element = this.primaryControlElement();\n if (element === null) return null;\n if (element.getAttribute('aria-invalid') === 'true') return '';\n return element.matches(':invalid') ? '' : null;\n }\n\n @HostBinding('attr.data-readonly')\n protected get dataReadonly(): '' | null {\n const override = this.readonly();\n if (override !== null) return override ? '' : null;\n\n const control = this.primaryControl();\n if (control !== null) return control.readonly() ? '' : null;\n\n const element = this.primaryControlElement();\n if (element === null) return null;\n return element.hasAttribute('readonly') ? '' : null;\n }\n\n @HostBinding('attr.data-focused')\n protected get dataFocused(): '' | null {\n return this.focused ? '' : null;\n }\n\n @HostListener('focusin')\n protected onFocusIn(): void {\n this.focused = true;\n }\n\n @HostListener('focusout', ['$event'])\n protected onFocusOut(event: FocusEvent): void {\n const nextTarget = event.relatedTarget;\n if (nextTarget instanceof Node && this.hostElement.contains(nextTarget)) return;\n\n this.focused = false;\n }\n\n protected hasLeadingSlot(): boolean {\n const proxy = this.hostElement.querySelector('[data-tng-input-leading-proxy]');\n if (proxy instanceof HTMLElement) return hasProjectedContent(proxy);\n\n const slots = this.leadingSlots?.toArray() ?? [];\n return slots.some((slot) => hasProjectedContent(slot.hostElement));\n }\n\n protected hasTrailingSlot(): boolean {\n const proxy = this.hostElement.querySelector('[data-tng-input-trailing-proxy]');\n if (proxy instanceof HTMLElement) return hasProjectedContent(proxy);\n\n const slots = this.trailingSlots?.toArray() ?? [];\n return slots.some((slot) => hasProjectedContent(slot.hostElement));\n }\n\n protected effectiveHasLeading(): boolean {\n const override = this.hasLeading();\n if (override !== null) return override;\n return this.hasLeadingSlot();\n }\n\n protected effectiveHasTrailing(): boolean {\n const override = this.hasTrailing();\n if (override !== null) return override;\n return this.hasTrailingSlot();\n }\n\n protected primaryControl(): TngInput | null {\n const controls = this.controls?.toArray() ?? [];\n return controls[0] ?? null;\n }\n\n protected primaryControlElement(): HTMLInputElement | HTMLTextAreaElement | null {\n const element = this.hostElement.querySelector(\n '[data-tng-input-control-proxy] input, [data-tng-input-control-proxy] textarea, input[tngInput], textarea[tngInput]',\n );\n if (\n element instanceof HTMLInputElement ||\n element instanceof HTMLTextAreaElement\n ) {\n return element;\n }\n\n return null;\n }\n}\n"]}
1
+ {"version":3,"file":"tng-input.js","sourceRoot":"","sources":["../../../../../../../../libs/tailng-ui/primitives/src/lib/form/input/tng-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EACT,eAAe,EACf,SAAS,EACT,UAAU,EACV,WAAW,EACX,YAAY,EAGZ,gBAAgB,EAChB,MAAM,EACN,KAAK,EACL,SAAS,GACV,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;;AAMnD,MAAM,UAAU,6BAA6B,CAAC,KAA2B;IACvE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvD,IAAI,KAAK,KAAK,EAAE,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,MAAM;QAAE,OAAO,IAAI,CAAC;IAEpE,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,OAAO;QAAE,OAAO,KAAK,CAAC;IAEvD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAgC;IAC5D,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAEvD,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC;IAChC,OAAO,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,C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BAAC,uBAAuB;;sBAKnC,WAAW;uBAAC,wBAAwB;;sBAKpC,WAAW;uBAAC,oBAAoB;;sBAahC,WAAW;uBAAC,mBAAmB;;sBAc/B,WAAW;uBAAC,oBAAoB;;sBAahC,WAAW;uBAAC,mBAAmB;;sBAK/B,YAAY;uBAAC,SAAS;;sBAKtB,YAAY;uBAAC,UAAU,EAAE,CAAC,QAAQ,CAAC","sourcesContent":["import {\n AfterContentInit,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n HostBinding,\n HostListener,\n OnDestroy,\n QueryList,\n booleanAttribute,\n inject,\n input,\n isDevMode,\n} from '@angular/core';\nimport { Subject } from 'rxjs';\nimport { takeUntil } from 'rxjs/operators';\n\nimport { TngUniqueIdService } from '../_shared/id';\n\ntype NullableBooleanInput = boolean | null | string | undefined;\n\nexport type TngInputType = 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url';\n\nexport function coerceTngInputNullableBoolean(value: NullableBooleanInput): boolean | null {\n if (value === undefined || value === null) return null;\n\n if (value === '' || value === true || value === 'true') return true;\n\n if (value === false || value === 'false') return false;\n\n return null;\n}\n\nfunction normalizeStringValue(value: string | null | undefined): string | null {\n if (value === undefined || value === null) return null;\n\n const normalized = value.trim();\n return normalized.length > 0 ? normalized : null;\n}\n\nfunction toAriaBoolean(value: boolean | null): 'false' | 'true' | null {\n if (value === null) return null;\n return value ? 'true' : 'false';\n}\n\nfunction hasProjectedContent(element: HTMLElement): boolean {\n return Array.from(element.childNodes).some((node) => {\n if (node.nodeType === Node.ELEMENT_NODE) {\n return true;\n }\n\n if (node.nodeType === Node.TEXT_NODE) {\n return (node.textContent ?? '').trim().length > 0;\n }\n\n return false;\n });\n}\n\n@Directive({\n selector: 'input[tngInput], textarea[tngInput]',\n exportAs: 'tngInput',\n})\nexport class TngInput {\n private readonly elementRef = inject(ElementRef<HTMLInputElement | HTMLTextAreaElement>);\n private readonly idService = inject(TngUniqueIdService);\n\n public readonly hostElement = this.elementRef.nativeElement;\n private readonly initialAriaLabel = normalizeStringValue(this.hostElement.getAttribute('aria-label'));\n private readonly initialAriaLabelledby = normalizeStringValue(this.hostElement.getAttribute('aria-labelledby'));\n private readonly initialAriaDescribedBy = normalizeStringValue(\n this.hostElement.getAttribute('aria-describedby'),\n );\n\n private readonly generatedId = this.idService.nextId('tng-input');\n\n /** Canonical API for aria-describedby (whitespace normalized). */\n public readonly ariaDescribedBy = input<string | null>(null);\n\n public readonly ariaLabel = input<string | null>(null);\n public readonly ariaLabelledby = input<string | null>(null);\n\n /** If non-null, this value overrides native validity in `isInvalid()`. */\n public readonly ariaInvalid = input<boolean | null, NullableBooleanInput>(null, {\n transform: coerceTngInputNullableBoolean,\n });\n\n public readonly ariaRequired = input<boolean | null, NullableBooleanInput>(null, {\n transform: coerceTngInputNullableBoolean,\n });\n\n public readonly disabled = input<boolean, boolean | string>(false, { transform: booleanAttribute });\n public readonly readonly = input<boolean, boolean | string>(false, { transform: booleanAttribute });\n public readonly required = input<boolean, boolean | string>(false, { transform: booleanAttribute });\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input' as const;\n\n @HostBinding('attr.id')\n protected get idAttr(): string {\n const nativeId = normalizeStringValue(this.hostElement.getAttribute('id'));\n return nativeId ?? this.generatedId;\n }\n\n @HostBinding('attr.aria-label')\n protected get ariaLabelAttr(): string | null {\n const provided = normalizeStringValue(this.ariaLabel());\n if (provided !== null) return provided;\n\n return this.initialAriaLabel;\n }\n\n @HostBinding('attr.aria-labelledby')\n protected get ariaLabelledbyAttr(): string | null {\n const provided = normalizeStringValue(this.ariaLabelledby());\n if (provided !== null) return provided;\n\n return this.initialAriaLabelledby;\n }\n\n /**\n * If the consumer provided a native `aria-describedby` and the input is not set,\n * preserve it (do not clobber).\n */\n @HostBinding('attr.aria-describedby')\n protected get ariaDescribedByAttr(): string | null {\n const provided = normalizeStringValue(this.ariaDescribedBy());\n if (provided !== null) return provided;\n\n return this.initialAriaDescribedBy;\n }\n\n /**\n * Omit `aria-invalid` unless invalid. (Avoids noisy aria-invalid=\"false\" and\n * makes unit tests + bindings more stable.)\n */\n @HostBinding('attr.aria-invalid')\n protected get ariaInvalidAttr(): 'true' | null {\n return this.isInvalid() ? 'true' : null;\n }\n\n @HostBinding('attr.aria-required')\n protected get ariaRequiredAttr(): 'false' | 'true' | null {\n if (this.required()) return 'true';\n return toAriaBoolean(this.ariaRequired());\n }\n\n @HostBinding('attr.data-disabled')\n protected get dataDisabledAttr(): '' | null {\n return this.disabled() ? '' : null;\n }\n\n @HostBinding('attr.data-invalid')\n protected get dataInvalidAttr(): '' | null {\n return this.isInvalid() ? '' : null;\n }\n\n @HostBinding('attr.data-readonly')\n protected get dataReadonlyAttr(): '' | null {\n return this.readonly() ? '' : null;\n }\n\n @HostBinding('attr.disabled')\n protected get disabledAttr(): '' | null {\n return this.disabled() ? '' : null;\n }\n\n @HostBinding('attr.readonly')\n protected get readonlyAttr(): '' | null {\n return this.readonly() ? '' : null;\n }\n\n @HostBinding('attr.required')\n protected get requiredAttr(): '' | null {\n return this.required() ? '' : null;\n }\n\n public isInvalid(): boolean {\n const override = this.ariaInvalid();\n if (override !== null) return override;\n\n // jsdom may not fully implement validity; this is still correct for browsers.\n return this.hostElement.matches(':invalid');\n }\n}\n\n@Directive({\n selector: '[tngPrefix], [tngInputLeading]',\n exportAs: 'tngPrefix',\n})\nexport class TngPrefix {\n readonly hostElement = inject(ElementRef<HTMLElement>).nativeElement;\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input-leading' as const;\n}\n\n@Directive({\n selector: '[tngSuffix], [tngInputTrailing]',\n exportAs: 'tngSuffix',\n})\nexport class TngSuffix {\n readonly hostElement = inject(ElementRef<HTMLElement>).nativeElement;\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input-trailing' as const;\n}\n\nexport { TngPrefix as TngInputLeading, TngSuffix as TngInputTrailing };\n\n@Component({\n selector: 'tng-input-group, [tngInputGroup]',\n exportAs: 'tngInputGroup',\n template: `\n @if (hasLeadingSlot()) {\n <span class=\"tng-input-group-leading\" data-slot=\"input-group-leading\">\n <ng-content select=\"[tngPrefix], [tngInputLeading], [data-tng-input-prefix-proxy]\"></ng-content>\n </span>\n }\n\n <span class=\"tng-input-group-control\" data-slot=\"input-group-control\">\n <ng-content select=\"input[tngInput], textarea[tngInput], [data-tng-input-control-proxy]\"></ng-content>\n </span>\n\n @if (hasTrailingSlot()) {\n <span class=\"tng-input-group-trailing\" data-slot=\"input-group-trailing\">\n <ng-content select=\"[tngSuffix], [tngInputTrailing], [data-tng-input-suffix-proxy]\"></ng-content>\n </span>\n }\n `,\n})\nexport class TngInputGroup implements AfterContentInit, OnDestroy {\n public readonly hasLeading = input<boolean | null>(null);\n public readonly hasTrailing = input<boolean | null>(null);\n public readonly disabled = input<boolean | null>(null);\n public readonly invalid = input<boolean | null>(null);\n public readonly readonly = input<boolean | null>(null);\n public readonly controlCount = input<number | null>(null);\n\n @ContentChildren(TngInput, { descendants: true })\n protected controls!: QueryList<TngInput>;\n\n @ContentChildren(TngPrefix, { descendants: true })\n protected prefixSlots!: QueryList<TngPrefix>;\n\n @ContentChildren(TngSuffix, { descendants: true })\n protected suffixSlots!: QueryList<TngSuffix>;\n\n private readonly hostElement = inject(ElementRef<HTMLElement>).nativeElement;\n\n private focused = false;\n\n private readonly destroyed$ = new Subject<void>();\n\n private validateSingleControl(): void {\n if (!isDevMode()) return;\n if (!this.controls) return;\n\n const queriedCount = this.controls.length;\n const domCount = this.hostElement.querySelectorAll(\n '[data-tng-input-control-proxy] input, [data-tng-input-control-proxy] textarea, input[tngInput], textarea[tngInput]',\n ).length;\n const count = this.controlCount() ?? (queriedCount > 0 ? queriedCount : domCount);\n if (count !== 1) {\n console.warn(\n `[tngInputGroup] Expected exactly 1 control (input/textarea with tngInput), but found ${count}.`,\n this.hostElement,\n );\n }\n }\n\n public ngAfterContentInit(): void {\n queueMicrotask(() => this.validateSingleControl());\n\n this.controls.changes\n .pipe(takeUntil(this.destroyed$))\n .subscribe(() => this.validateSingleControl());\n }\n\n public ngOnDestroy(): void {\n this.destroyed$.next();\n this.destroyed$.complete();\n }\n\n @HostBinding('attr.data-slot')\n protected readonly dataSlot = 'input-group' as const;\n\n @HostBinding('attr.data-has-leading')\n protected get dataHasLeading(): '' | null {\n return this.effectiveHasLeading() ? '' : null;\n }\n\n @HostBinding('attr.data-has-trailing')\n protected get dataHasTrailing(): '' | null {\n return this.effectiveHasTrailing() ? '' : null;\n }\n\n @HostBinding('attr.data-disabled')\n protected get dataDisabled(): '' | null {\n const override = this.disabled();\n if (override !== null) return override ? '' : null;\n\n const control = this.primaryControl();\n if (control !== null) return control.disabled() ? '' : null;\n\n const element = this.primaryControlElement();\n if (element === null) return null;\n return element.hasAttribute('disabled') ? '' : null;\n }\n\n @HostBinding('attr.data-invalid')\n protected get dataInvalid(): '' | null {\n const override = this.invalid();\n if (override !== null) return override ? '' : null;\n\n const control = this.primaryControl();\n if (control !== null) return control.isInvalid() ? '' : null;\n\n const element = this.primaryControlElement();\n if (element === null) return null;\n if (element.getAttribute('aria-invalid') === 'true') return '';\n return element.matches(':invalid') ? '' : null;\n }\n\n @HostBinding('attr.data-readonly')\n protected get dataReadonly(): '' | null {\n const override = this.readonly();\n if (override !== null) return override ? '' : null;\n\n const control = this.primaryControl();\n if (control !== null) return control.readonly() ? '' : null;\n\n const element = this.primaryControlElement();\n if (element === null) return null;\n return element.hasAttribute('readonly') ? '' : null;\n }\n\n @HostBinding('attr.data-focused')\n protected get dataFocused(): '' | null {\n return this.focused ? '' : null;\n }\n\n @HostListener('focusin')\n protected onFocusIn(): void {\n this.focused = true;\n }\n\n @HostListener('focusout', ['$event'])\n protected onFocusOut(event: FocusEvent): void {\n const nextTarget = event.relatedTarget;\n if (nextTarget instanceof Node && this.hostElement.contains(nextTarget)) return;\n\n this.focused = false;\n }\n\n protected hasLeadingSlot(): boolean {\n const proxy = this.hostElement.querySelector('[data-tng-input-prefix-proxy]');\n if (proxy instanceof HTMLElement) return hasProjectedContent(proxy);\n\n const slots = this.prefixSlots?.toArray() ?? [];\n return slots.some((slot) => hasProjectedContent(slot.hostElement));\n }\n\n protected hasTrailingSlot(): boolean {\n const proxy = this.hostElement.querySelector('[data-tng-input-suffix-proxy]');\n if (proxy instanceof HTMLElement) return hasProjectedContent(proxy);\n\n const slots = this.suffixSlots?.toArray() ?? [];\n return slots.some((slot) => hasProjectedContent(slot.hostElement));\n }\n\n protected effectiveHasLeading(): boolean {\n const override = this.hasLeading();\n if (override !== null) return override;\n return this.hasLeadingSlot();\n }\n\n protected effectiveHasTrailing(): boolean {\n const override = this.hasTrailing();\n if (override !== null) return override;\n return this.hasTrailingSlot();\n }\n\n protected primaryControl(): TngInput | null {\n const controls = this.controls?.toArray() ?? [];\n return controls[0] ?? null;\n }\n\n protected primaryControlElement(): HTMLInputElement | HTMLTextAreaElement | null {\n const element = this.hostElement.querySelector(\n '[data-tng-input-control-proxy] input, [data-tng-input-control-proxy] textarea, input[tngInput], textarea[tngInput]',\n );\n if (\n element instanceof HTMLInputElement ||\n element instanceof HTMLTextAreaElement\n ) {\n return element;\n }\n\n return null;\n }\n}\n"]}
@@ -0,0 +1,32 @@
1
+ import { type ComponentFixture } from '@angular/core/testing';
2
+ import type { DebugElement } from '@angular/core';
3
+ import { type TngGridActivateEvent, type TngGridCellValue, type TngGridFocusChangeEvent } from '../tng-grid';
4
+ import * as i0 from "@angular/core";
5
+ export declare class GridHarnessComponent {
6
+ ariaLabel: string;
7
+ ariaColcount: number | null;
8
+ ariaRowcount: number | null;
9
+ dir: 'ltr' | 'rtl';
10
+ focusRow: number | null | undefined;
11
+ focusCol: number | null | undefined;
12
+ selectionMode: 'none' | 'single';
13
+ value: TngGridCellValue | null | undefined;
14
+ defaultValue: TngGridCellValue | null | undefined;
15
+ wrap: boolean;
16
+ disableCell01: boolean;
17
+ readonly focusRowChanges: Array<number | null>;
18
+ readonly focusColChanges: Array<number | null>;
19
+ readonly focusEvents: TngGridFocusChangeEvent[];
20
+ readonly valueChanges: Array<TngGridCellValue | null>;
21
+ readonly activateEvents: TngGridActivateEvent[];
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<GridHarnessComponent, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<GridHarnessComponent, "ng-component", never, {}, {}, never, never, true, never>;
24
+ }
25
+ export declare function createGridHarnessFixture(overrides?: Partial<GridHarnessComponent>): Promise<ComponentFixture<GridHarnessComponent>>;
26
+ export declare function dispatchGridKeydown(element: HTMLElement, key: string, init?: KeyboardEventInit): KeyboardEvent;
27
+ export declare function getGrid(fixture: ComponentFixture<GridHarnessComponent>): HTMLElement;
28
+ export declare function getOutsideButton(fixture: ComponentFixture<GridHarnessComponent>): HTMLButtonElement;
29
+ export declare function getCell(fixture: ComponentFixture<GridHarnessComponent>, row: number, col: number): HTMLButtonElement;
30
+ export declare function getRow(fixture: ComponentFixture<GridHarnessComponent>, row: number): HTMLElement;
31
+ export declare function getCellDebugElement(fixture: ComponentFixture<GridHarnessComponent>, row: number, col: number): DebugElement;
32
+ //# sourceMappingURL=tng-grid.test-harness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tng-grid.test-harness.d.ts","sourceRoot":"","sources":["../../../../../../../../../libs/tailng-ui/primitives/src/lib/layout/grid/__tests__/tng-grid.test-harness.ts"],"names":[],"mappings":"AACA,OAAO,EAAW,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAE7B,MAAM,aAAa,CAAC;;AAErB,qBAyHa,oBAAoB;IACxB,SAAS,SAAkB;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAQ;IACnC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAQ;IACnC,GAAG,EAAE,KAAK,GAAG,KAAK,CAAS;IAC3B,QAAQ,EAAE,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oBAAoB,CAAC,EAC/C,GAAG,EAAE,MAAM,GACV,WAAW,CAEb;AAED,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,gBAAgB,CAAC,oBAAoB,CAAC,EAC/C,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,GACV,YAAY,CAOd"}
@@ -0,0 +1,312 @@
1
+ import { Component } from '@angular/core';
2
+ import { TestBed } from '@angular/core/testing';
3
+ import { By } from '@angular/platform-browser';
4
+ import { TngGrid, TngGridCell, TngGridRow, } from '../tng-grid';
5
+ import * as i0 from "@angular/core";
6
+ export class GridHarnessComponent {
7
+ ariaLabel = 'Harness grid';
8
+ ariaColcount = null;
9
+ ariaRowcount = null;
10
+ dir = 'ltr';
11
+ focusRow = undefined;
12
+ focusCol = undefined;
13
+ selectionMode = 'none';
14
+ value = undefined;
15
+ defaultValue = undefined;
16
+ wrap = false;
17
+ disableCell01 = true;
18
+ focusRowChanges = [];
19
+ focusColChanges = [];
20
+ focusEvents = [];
21
+ valueChanges = [];
22
+ activateEvents = [];
23
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: GridHarnessComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
24
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.1", type: GridHarnessComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: `
25
+ <div
26
+ tngGrid
27
+ [ariaLabel]="ariaLabel"
28
+ [ariaColcount]="ariaColcount"
29
+ [ariaRowcount]="ariaRowcount"
30
+ [dir]="dir"
31
+ [focusRow]="focusRow"
32
+ [focusCol]="focusCol"
33
+ [selectionMode]="selectionMode"
34
+ [value]="value"
35
+ [defaultValue]="defaultValue"
36
+ [wrap]="wrap"
37
+ (focusRowChange)="focusRowChanges.push($event)"
38
+ (focusColChange)="focusColChanges.push($event)"
39
+ (focusChange)="focusEvents.push($event)"
40
+ (valueChange)="valueChanges.push($event)"
41
+ (cellActivate)="activateEvents.push($event)"
42
+ data-testid="grid"
43
+ >
44
+ <div tngGridRow data-testid="row-0">
45
+ <button
46
+ type="button"
47
+ tngGridCell
48
+ data-testid="cell-0-0"
49
+ cellRole="columnheader"
50
+ [rowIndex]="0"
51
+ [colIndex]="0"
52
+ >
53
+ Header
54
+ </button>
55
+ <button
56
+ type="button"
57
+ tngGridCell
58
+ data-testid="cell-0-1"
59
+ [disabled]="disableCell01"
60
+ [rowIndex]="0"
61
+ [colIndex]="1"
62
+ >
63
+ Alpha
64
+ </button>
65
+ <button
66
+ type="button"
67
+ tngGridCell
68
+ data-testid="cell-0-2"
69
+ [rowIndex]="0"
70
+ [colIndex]="2"
71
+ >
72
+ Beta
73
+ </button>
74
+ </div>
75
+
76
+ <div tngGridRow data-testid="row-1">
77
+ <button
78
+ type="button"
79
+ tngGridCell
80
+ data-testid="cell-1-0"
81
+ [rowIndex]="1"
82
+ [colIndex]="0"
83
+ >
84
+ Gamma
85
+ </button>
86
+ <button
87
+ type="button"
88
+ tngGridCell
89
+ data-testid="cell-1-1"
90
+ [rowIndex]="1"
91
+ [colIndex]="1"
92
+ [rowSpan]="2"
93
+ [colSpan]="2"
94
+ >
95
+ Delta
96
+ </button>
97
+ <button
98
+ type="button"
99
+ tngGridCell
100
+ data-testid="cell-1-2"
101
+ [rowIndex]="1"
102
+ [colIndex]="2"
103
+ >
104
+ Epsilon
105
+ </button>
106
+ </div>
107
+
108
+ <div tngGridRow data-testid="row-2">
109
+ <button
110
+ type="button"
111
+ tngGridCell
112
+ data-testid="cell-2-0"
113
+ [rowIndex]="2"
114
+ [colIndex]="0"
115
+ >
116
+ Zeta
117
+ </button>
118
+ <button
119
+ type="button"
120
+ tngGridCell
121
+ data-testid="cell-2-1"
122
+ [rowIndex]="2"
123
+ [colIndex]="1"
124
+ >
125
+ Eta
126
+ </button>
127
+ <button
128
+ type="button"
129
+ tngGridCell
130
+ data-testid="cell-2-2"
131
+ [rowIndex]="2"
132
+ [colIndex]="2"
133
+ >
134
+ Theta
135
+ </button>
136
+ </div>
137
+ </div>
138
+
139
+ <button type="button" data-testid="outside-button">Outside</button>
140
+ `, isInline: true, dependencies: [{ kind: "directive", type: TngGrid, selector: "[tngGrid]", inputs: ["dir", "focusCol", "focusRow", "selectionMode", "value", "defaultValue", "wrap", "ariaLabel", "ariaColcount", "ariaRowcount"], outputs: ["focusRowChange", "focusColChange", "focusChange", "valueChange", "cellActivate"], exportAs: ["tngGrid"] }, { kind: "directive", type: TngGridRow, selector: "[tngGridRow]", exportAs: ["tngGridRow"] }, { kind: "directive", type: TngGridCell, selector: "[tngGridCell]", inputs: ["rowIndex", "colIndex", "rowSpan", "colSpan", "disabled", "selected", "cellRole"], exportAs: ["tngGridCell"] }] });
141
+ }
142
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: GridHarnessComponent, decorators: [{
143
+ type: Component,
144
+ args: [{
145
+ standalone: true,
146
+ imports: [TngGrid, TngGridRow, TngGridCell],
147
+ template: `
148
+ <div
149
+ tngGrid
150
+ [ariaLabel]="ariaLabel"
151
+ [ariaColcount]="ariaColcount"
152
+ [ariaRowcount]="ariaRowcount"
153
+ [dir]="dir"
154
+ [focusRow]="focusRow"
155
+ [focusCol]="focusCol"
156
+ [selectionMode]="selectionMode"
157
+ [value]="value"
158
+ [defaultValue]="defaultValue"
159
+ [wrap]="wrap"
160
+ (focusRowChange)="focusRowChanges.push($event)"
161
+ (focusColChange)="focusColChanges.push($event)"
162
+ (focusChange)="focusEvents.push($event)"
163
+ (valueChange)="valueChanges.push($event)"
164
+ (cellActivate)="activateEvents.push($event)"
165
+ data-testid="grid"
166
+ >
167
+ <div tngGridRow data-testid="row-0">
168
+ <button
169
+ type="button"
170
+ tngGridCell
171
+ data-testid="cell-0-0"
172
+ cellRole="columnheader"
173
+ [rowIndex]="0"
174
+ [colIndex]="0"
175
+ >
176
+ Header
177
+ </button>
178
+ <button
179
+ type="button"
180
+ tngGridCell
181
+ data-testid="cell-0-1"
182
+ [disabled]="disableCell01"
183
+ [rowIndex]="0"
184
+ [colIndex]="1"
185
+ >
186
+ Alpha
187
+ </button>
188
+ <button
189
+ type="button"
190
+ tngGridCell
191
+ data-testid="cell-0-2"
192
+ [rowIndex]="0"
193
+ [colIndex]="2"
194
+ >
195
+ Beta
196
+ </button>
197
+ </div>
198
+
199
+ <div tngGridRow data-testid="row-1">
200
+ <button
201
+ type="button"
202
+ tngGridCell
203
+ data-testid="cell-1-0"
204
+ [rowIndex]="1"
205
+ [colIndex]="0"
206
+ >
207
+ Gamma
208
+ </button>
209
+ <button
210
+ type="button"
211
+ tngGridCell
212
+ data-testid="cell-1-1"
213
+ [rowIndex]="1"
214
+ [colIndex]="1"
215
+ [rowSpan]="2"
216
+ [colSpan]="2"
217
+ >
218
+ Delta
219
+ </button>
220
+ <button
221
+ type="button"
222
+ tngGridCell
223
+ data-testid="cell-1-2"
224
+ [rowIndex]="1"
225
+ [colIndex]="2"
226
+ >
227
+ Epsilon
228
+ </button>
229
+ </div>
230
+
231
+ <div tngGridRow data-testid="row-2">
232
+ <button
233
+ type="button"
234
+ tngGridCell
235
+ data-testid="cell-2-0"
236
+ [rowIndex]="2"
237
+ [colIndex]="0"
238
+ >
239
+ Zeta
240
+ </button>
241
+ <button
242
+ type="button"
243
+ tngGridCell
244
+ data-testid="cell-2-1"
245
+ [rowIndex]="2"
246
+ [colIndex]="1"
247
+ >
248
+ Eta
249
+ </button>
250
+ <button
251
+ type="button"
252
+ tngGridCell
253
+ data-testid="cell-2-2"
254
+ [rowIndex]="2"
255
+ [colIndex]="2"
256
+ >
257
+ Theta
258
+ </button>
259
+ </div>
260
+ </div>
261
+
262
+ <button type="button" data-testid="outside-button">Outside</button>
263
+ `,
264
+ }]
265
+ }] });
266
+ export async function createGridHarnessFixture(overrides = {}) {
267
+ await TestBed.configureTestingModule({
268
+ imports: [GridHarnessComponent],
269
+ }).compileComponents();
270
+ const fixture = TestBed.createComponent(GridHarnessComponent);
271
+ Object.assign(fixture.componentInstance, overrides);
272
+ fixture.detectChanges();
273
+ return fixture;
274
+ }
275
+ export function dispatchGridKeydown(element, key, init = {}) {
276
+ const event = new KeyboardEvent('keydown', {
277
+ bubbles: true,
278
+ cancelable: true,
279
+ key,
280
+ ...init,
281
+ });
282
+ element.dispatchEvent(event);
283
+ return event;
284
+ }
285
+ export function getGrid(fixture) {
286
+ return queryByTestId(fixture, 'grid');
287
+ }
288
+ export function getOutsideButton(fixture) {
289
+ return queryByTestId(fixture, 'outside-button');
290
+ }
291
+ export function getCell(fixture, row, col) {
292
+ return queryByTestId(fixture, `cell-${row}-${col}`);
293
+ }
294
+ export function getRow(fixture, row) {
295
+ return queryByTestId(fixture, `row-${row}`);
296
+ }
297
+ export function getCellDebugElement(fixture, row, col) {
298
+ const de = fixture.debugElement.query(By.css(`[data-testid="cell-${row}-${col}"]`));
299
+ if (de === null) {
300
+ throw new Error(`Missing cell ${row}:${col}`);
301
+ }
302
+ return de;
303
+ }
304
+ function queryByTestId(fixture, testId) {
305
+ const hostElement = fixture.nativeElement;
306
+ const element = hostElement.querySelector(`[data-testid="${testId}"]`);
307
+ if (element === null) {
308
+ throw new Error(`Missing element with data-testid="${testId}"`);
309
+ }
310
+ return element;
311
+ }
312
+ //# sourceMappingURL=tng-grid.test-harness.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tng-grid.test-harness.js","sourceRoot":"","sources":["../../../../../../../../../libs/tailng-ui/primitives/src/lib/layout/grid/__tests__/tng-grid.test-harness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAyB,MAAM,uBAAuB,CAAC;AAEvE,OAAO,EAAE,EAAE,EAAE,MAAM,2BAA2B,CAAC;AAC/C,OAAO,EACL,OAAO,EACP,WAAW,EAIX,UAAU,GACX,MAAM,aAAa,CAAC;;AA2HrB,MAAM,OAAO,oBAAoB;IACxB,SAAS,GAAG,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I,KAAK,CAAC,gBAAgB,GAAG,IAAI,GAAG,EAAE,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,SAAS,aAAa,CACpB,OAA+C,EAC/C,MAAc;IAEd,MAAM,WAAW,GAAG,OAAO,CAAC,aAA4B,CAAC;IACzD,MAAM,OAAO,GAAG,WAAW,CAAC,aAAa,CAAc,iBAAiB,MAAM,IAAI,CAAC,CAAC;IACpF,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,qCAAqC,MAAM,GAAG,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC","sourcesContent":["import { Component } from '@angular/core';\nimport { TestBed, type ComponentFixture } from '@angular/core/testing';\nimport type { DebugElement } from '@angular/core';\nimport { By } from '@angular/platform-browser';\nimport {\n TngGrid,\n TngGridCell,\n type TngGridActivateEvent,\n type TngGridCellValue,\n type TngGridFocusChangeEvent,\n TngGridRow,\n} from '../tng-grid';\n\n@Component({\n standalone: true,\n imports: [TngGrid, TngGridRow, TngGridCell],\n template: `\n <div\n tngGrid\n [ariaLabel]=\"ariaLabel\"\n [ariaColcount]=\"ariaColcount\"\n [ariaRowcount]=\"ariaRowcount\"\n [dir]=\"dir\"\n [focusRow]=\"focusRow\"\n [focusCol]=\"focusCol\"\n [selectionMode]=\"selectionMode\"\n [value]=\"value\"\n [defaultValue]=\"defaultValue\"\n [wrap]=\"wrap\"\n (focusRowChange)=\"focusRowChanges.push($event)\"\n (focusColChange)=\"focusColChanges.push($event)\"\n (focusChange)=\"focusEvents.push($event)\"\n (valueChange)=\"valueChanges.push($event)\"\n (cellActivate)=\"activateEvents.push($event)\"\n data-testid=\"grid\"\n >\n <div tngGridRow data-testid=\"row-0\">\n <button\n type=\"button\"\n tngGridCell\n data-testid=\"cell-0-0\"\n cellRole=\"columnheader\"\n [rowIndex]=\"0\"\n [colIndex]=\"0\"\n >\n Header\n </button>\n <button\n type=\"button\"\n tngGridCell\n data-testid=\"cell-0-1\"\n [disabled]=\"disableCell01\"\n [rowIndex]=\"0\"\n [colIndex]=\"1\"\n >\n Alpha\n </button>\n <button\n type=\"button\"\n tngGridCell\n data-testid=\"cell-0-2\"\n [rowIndex]=\"0\"\n [colIndex]=\"2\"\n >\n Beta\n </button>\n </div>\n\n <div tngGridRow data-testid=\"row-1\">\n <button\n type=\"button\"\n tngGridCell\n data-testid=\"cell-1-0\"\n [rowIndex]=\"1\"\n [colIndex]=\"0\"\n >\n Gamma\n </button>\n <button\n type=\"button\"\n tngGridCell\n data-testid=\"cell-1-1\"\n [rowIndex]=\"1\"\n [colIndex]=\"1\"\n [rowSpan]=\"2\"\n [colSpan]=\"2\"\n >\n Delta\n </button>\n <button\n type=\"button\"\n tngGridCell\n data-testid=\"cell-1-2\"\n [rowIndex]=\"1\"\n [colIndex]=\"2\"\n >\n Epsilon\n </button>\n </div>\n\n <div tngGridRow data-testid=\"row-2\">\n <button\n type=\"button\"\n tngGridCell\n data-testid=\"cell-2-0\"\n [rowIndex]=\"2\"\n [colIndex]=\"0\"\n >\n Zeta\n </button>\n <button\n type=\"button\"\n tngGridCell\n data-testid=\"cell-2-1\"\n [rowIndex]=\"2\"\n [colIndex]=\"1\"\n >\n Eta\n </button>\n <button\n type=\"button\"\n tngGridCell\n data-testid=\"cell-2-2\"\n [rowIndex]=\"2\"\n [colIndex]=\"2\"\n >\n Theta\n </button>\n </div>\n </div>\n\n <button type=\"button\" data-testid=\"outside-button\">Outside</button>\n `,\n})\nexport class GridHarnessComponent {\n public ariaLabel = 'Harness grid';\n public ariaColcount: number | null = null;\n public ariaRowcount: number | null = null;\n public dir: 'ltr' | 'rtl' = 'ltr';\n public focusRow: number | null | undefined = undefined;\n public focusCol: number | null | undefined = undefined;\n public selectionMode: 'none' | 'single' = 'none';\n public value: TngGridCellValue | null | undefined = undefined;\n public defaultValue: TngGridCellValue | null | undefined = undefined;\n public wrap = false;\n public disableCell01 = true;\n\n public readonly focusRowChanges: Array<number | null> = [];\n public readonly focusColChanges: Array<number | null> = [];\n public readonly focusEvents: TngGridFocusChangeEvent[] = [];\n public readonly valueChanges: Array<TngGridCellValue | null> = [];\n public readonly activateEvents: TngGridActivateEvent[] = [];\n}\n\nexport async function createGridHarnessFixture(\n overrides: Partial<GridHarnessComponent> = {},\n): Promise<ComponentFixture<GridHarnessComponent>> {\n await TestBed.configureTestingModule({\n imports: [GridHarnessComponent],\n }).compileComponents();\n\n const fixture = TestBed.createComponent(GridHarnessComponent);\n Object.assign(fixture.componentInstance, overrides);\n fixture.detectChanges();\n return fixture;\n}\n\nexport function dispatchGridKeydown(\n element: HTMLElement,\n key: string,\n init: KeyboardEventInit = {},\n): KeyboardEvent {\n const event = new KeyboardEvent('keydown', {\n bubbles: true,\n cancelable: true,\n key,\n ...init,\n });\n element.dispatchEvent(event);\n return event;\n}\n\nexport function getGrid(fixture: ComponentFixture<GridHarnessComponent>): HTMLElement {\n return queryByTestId(fixture, 'grid');\n}\n\nexport function getOutsideButton(fixture: ComponentFixture<GridHarnessComponent>): HTMLButtonElement {\n return queryByTestId(fixture, 'outside-button') as HTMLButtonElement;\n}\n\nexport function getCell(\n fixture: ComponentFixture<GridHarnessComponent>,\n row: number,\n col: number,\n): HTMLButtonElement {\n return queryByTestId(fixture, `cell-${row}-${col}`) as HTMLButtonElement;\n}\n\nexport function getRow(\n fixture: ComponentFixture<GridHarnessComponent>,\n row: number,\n): HTMLElement {\n return queryByTestId(fixture, `row-${row}`);\n}\n\nexport function getCellDebugElement(\n fixture: ComponentFixture<GridHarnessComponent>,\n row: number,\n col: number,\n): DebugElement {\n const de = fixture.debugElement.query(By.css(`[data-testid=\"cell-${row}-${col}\"]`));\n if (de === null) {\n throw new Error(`Missing cell ${row}:${col}`);\n }\n\n return de;\n}\n\nfunction queryByTestId(\n fixture: ComponentFixture<GridHarnessComponent>,\n testId: string,\n): HTMLElement {\n const hostElement = fixture.nativeElement as HTMLElement;\n const element = hostElement.querySelector<HTMLElement>(`[data-testid=\"${testId}\"]`);\n if (element === null) {\n throw new Error(`Missing element with data-testid=\"${testId}\"`);\n }\n\n return element;\n}\n"]}
@@ -1,7 +1,149 @@
1
+ import type { OnDestroy, OnInit } from '@angular/core';
2
+ import { type TngGridCellPosition } from '@tailng-ui/cdk';
1
3
  import * as i0 from "@angular/core";
2
- export declare class TngGrid {
4
+ export type TngGridDirection = 'ltr' | 'rtl';
5
+ export type TngGridSelectionMode = 'none' | 'single';
6
+ export type TngGridCellRole = 'columnheader' | 'gridcell' | 'rowheader';
7
+ export type TngGridInteractionTrigger = 'keyboard' | 'pointer' | 'programmatic';
8
+ export type TngGridCellValue = Readonly<TngGridCellPosition>;
9
+ export type TngGridFocusChangeEvent = Readonly<{
10
+ col: number;
11
+ previousCol: number | null;
12
+ previousRow: number | null;
13
+ row: number;
14
+ trigger: TngGridInteractionTrigger;
15
+ }>;
16
+ export type TngGridActivateEvent = Readonly<{
17
+ col: number;
18
+ row: number;
19
+ trigger: Extract<TngGridInteractionTrigger, 'keyboard' | 'pointer'>;
20
+ }>;
21
+ type TngGridNullablePosition = TngGridCellValue | null;
22
+ export declare class TngGrid implements OnDestroy {
23
+ private readonly hostRef;
24
+ private readonly cells;
25
+ private readonly cellByKey;
26
+ private uncontrolledFocus;
27
+ private uncontrolledSelection;
28
+ private selectionInitialized;
29
+ private ariaLabelValue;
30
+ private ariaColcountValue;
31
+ private ariaRowcountValue;
32
+ private domFocusedKey;
33
+ private focusVisibleKey;
34
+ private lastActivatedKey;
35
+ private pendingFocusTrigger;
36
+ readonly dir: import("@angular/core").InputSignalWithTransform<TngGridDirection, unknown>;
37
+ readonly focusCol: import("@angular/core").InputSignalWithTransform<number | null | undefined, unknown>;
38
+ readonly focusRow: import("@angular/core").InputSignalWithTransform<number | null | undefined, unknown>;
39
+ readonly selectionMode: import("@angular/core").InputSignalWithTransform<TngGridSelectionMode, unknown>;
40
+ readonly value: import("@angular/core").InputSignalWithTransform<TngGridNullablePosition | undefined, unknown>;
41
+ readonly defaultValue: import("@angular/core").InputSignalWithTransform<TngGridNullablePosition | undefined, unknown>;
42
+ readonly wrap: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
43
+ readonly focusRowChange: import("@angular/core").OutputEmitterRef<number | null>;
44
+ readonly focusColChange: import("@angular/core").OutputEmitterRef<number | null>;
45
+ readonly focusChange: import("@angular/core").OutputEmitterRef<Readonly<{
46
+ col: number;
47
+ previousCol: number | null;
48
+ previousRow: number | null;
49
+ row: number;
50
+ trigger: TngGridInteractionTrigger;
51
+ }>>;
52
+ readonly valueChange: import("@angular/core").OutputEmitterRef<TngGridNullablePosition>;
53
+ readonly cellActivate: import("@angular/core").OutputEmitterRef<Readonly<{
54
+ col: number;
55
+ row: number;
56
+ trigger: Extract<TngGridInteractionTrigger, "keyboard" | "pointer">;
57
+ }>>;
58
+ set ariaLabel(value: string | null);
59
+ set ariaColcount(value: unknown);
60
+ set ariaRowcount(value: unknown);
3
61
  protected readonly dataSlot: "grid";
62
+ protected readonly role: "grid";
63
+ protected get ariaLabelAttr(): string | null;
64
+ protected get ariaColcountAttr(): string | null;
65
+ protected get ariaRowcountAttr(): string | null;
66
+ ngOnDestroy(): void;
67
+ registerCell(cell: TngGridCell): void;
68
+ unregisterCell(cell: TngGridCell): void;
69
+ isCellActivated(cell: TngGridCell): boolean;
70
+ isCellDisabled(cell: TngGridCell): boolean;
71
+ isCellFocusVisible(cell: TngGridCell): boolean;
72
+ isCellFocused(cell: TngGridCell): boolean;
73
+ isCellTabStop(cell: TngGridCell): boolean;
74
+ isCellSelected(cell: TngGridCell): boolean;
75
+ getCellTabIndex(cell: TngGridCell): string;
76
+ onCellClicked(cell: TngGridCell): void;
77
+ onCellFocused(cell: TngGridCell): void;
78
+ onCellPointerDown(cell: TngGridCell): void;
79
+ onCellSelectionRequest(cell: TngGridCell, trigger: Extract<TngGridInteractionTrigger, 'keyboard' | 'pointer'>): void;
80
+ protected onFocusOut(event: FocusEvent): void;
81
+ protected onKeyDown(event: KeyboardEvent): void;
82
+ private ensureFallbackFocus;
83
+ private ensureUncontrolledSelectionInitialized;
84
+ private getActiveCell;
85
+ private getComputedBounds;
86
+ private getFirstEnabledCell;
87
+ private getEnabledCells;
88
+ private getFocusValue;
89
+ private getNavigableCells;
90
+ private getSelectedValue;
91
+ private isFocusControlled;
92
+ private isSelectionControlled;
93
+ private moveFocus;
94
+ private requestFocus;
95
+ private requestSelection;
4
96
  static ɵfac: i0.ɵɵFactoryDeclaration<TngGrid, never>;
5
- static ɵdir: i0.ɵɵDirectiveDeclaration<TngGrid, "[tngGrid]", ["tngGrid"], {}, {}, never, never, true, never>;
97
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TngGrid, "[tngGrid]", ["tngGrid"], { "dir": { "alias": "dir"; "required": false; "isSignal": true; }; "focusCol": { "alias": "focusCol"; "required": false; "isSignal": true; }; "focusRow": { "alias": "focusRow"; "required": false; "isSignal": true; }; "selectionMode": { "alias": "selectionMode"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "defaultValue": { "alias": "defaultValue"; "required": false; "isSignal": true; }; "wrap": { "alias": "wrap"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; }; "ariaColcount": { "alias": "ariaColcount"; "required": false; }; "ariaRowcount": { "alias": "ariaRowcount"; "required": false; }; }, { "focusRowChange": "focusRowChange"; "focusColChange": "focusColChange"; "focusChange": "focusChange"; "valueChange": "valueChange"; "cellActivate": "cellActivate"; }, never, never, true, never>;
6
98
  }
99
+ export declare class TngGridRow {
100
+ protected readonly dataSlot: "grid-row";
101
+ protected readonly role: "row";
102
+ static ɵfac: i0.ɵɵFactoryDeclaration<TngGridRow, never>;
103
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TngGridRow, "[tngGridRow]", ["tngGridRow"], {}, {}, never, never, true, never>;
104
+ }
105
+ export declare class TngGridCell implements OnInit, OnDestroy {
106
+ private readonly hostRef;
107
+ private readonly grid;
108
+ readonly rowIndex: import("@angular/core").InputSignalWithTransform<number, unknown>;
109
+ readonly colIndex: import("@angular/core").InputSignalWithTransform<number, unknown>;
110
+ readonly rowSpan: import("@angular/core").InputSignalWithTransform<number, unknown>;
111
+ readonly colSpan: import("@angular/core").InputSignalWithTransform<number, unknown>;
112
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
113
+ readonly selected: import("@angular/core").InputSignalWithTransform<boolean | null, unknown>;
114
+ readonly cellRole: import("@angular/core").InputSignalWithTransform<TngGridCellRole, unknown>;
115
+ protected readonly dataSlot: "gridcell";
116
+ protected get roleAttr(): TngGridCellRole;
117
+ protected get tabIndexAttr(): string;
118
+ protected get ariaRowIndexAttr(): string;
119
+ protected get ariaColIndexAttr(): string;
120
+ protected get ariaRowSpanAttr(): string | null;
121
+ protected get ariaColSpanAttr(): string | null;
122
+ protected get ariaDisabledAttr(): string | null;
123
+ protected get ariaSelectedAttr(): string | null;
124
+ protected get dataRowIndexAttr(): string;
125
+ protected get dataColIndexAttr(): string;
126
+ protected get dataRowSpanAttr(): string | null;
127
+ protected get dataColSpanAttr(): string | null;
128
+ protected get dataDisabledAttr(): '' | null;
129
+ protected get dataSelectedAttr(): '' | null;
130
+ protected get dataFocusedAttr(): '' | null;
131
+ protected get dataFocusVisibleAttr(): '' | null;
132
+ protected get dataActivatedAttr(): '' | null;
133
+ ngOnInit(): void;
134
+ ngOnDestroy(): void;
135
+ cellKey(): string;
136
+ focusHost(): void;
137
+ getHostElement(): HTMLElement;
138
+ getValue(): TngGridCellValue;
139
+ isFocusVisible(): boolean;
140
+ matchesValue(value: TngGridCellValue): boolean;
141
+ protected onClick(): void;
142
+ protected onDoubleClick(): void;
143
+ protected onFocus(): void;
144
+ protected onPointerDown(): void;
145
+ static ɵfac: i0.ɵɵFactoryDeclaration<TngGridCell, never>;
146
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TngGridCell, "[tngGridCell]", ["tngGridCell"], { "rowIndex": { "alias": "rowIndex"; "required": true; "isSignal": true; }; "colIndex": { "alias": "colIndex"; "required": true; "isSignal": true; }; "rowSpan": { "alias": "rowSpan"; "required": false; "isSignal": true; }; "colSpan": { "alias": "colSpan"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "selected": { "alias": "selected"; "required": false; "isSignal": true; }; "cellRole": { "alias": "cellRole"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
147
+ }
148
+ export {};
7
149
  //# sourceMappingURL=tng-grid.d.ts.map