ngx-com 0.0.1 → 0.0.4
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.
- package/fesm2022/ngx-com-components-avatar.mjs +772 -0
- package/fesm2022/ngx-com-components-avatar.mjs.map +1 -0
- package/fesm2022/ngx-com-components-badge.mjs +138 -0
- package/fesm2022/ngx-com-components-badge.mjs.map +1 -0
- package/fesm2022/ngx-com-components-button.mjs +146 -0
- package/fesm2022/ngx-com-components-button.mjs.map +1 -0
- package/fesm2022/ngx-com-components-calendar.mjs +5046 -0
- package/fesm2022/ngx-com-components-calendar.mjs.map +1 -0
- package/fesm2022/ngx-com-components-card.mjs +590 -0
- package/fesm2022/ngx-com-components-card.mjs.map +1 -0
- package/fesm2022/ngx-com-components-checkbox.mjs +344 -0
- package/fesm2022/ngx-com-components-checkbox.mjs.map +1 -0
- package/fesm2022/ngx-com-components-collapsible.mjs +612 -0
- package/fesm2022/ngx-com-components-collapsible.mjs.map +1 -0
- package/fesm2022/ngx-com-components-confirm.mjs +562 -0
- package/fesm2022/ngx-com-components-confirm.mjs.map +1 -0
- package/fesm2022/ngx-com-components-dropdown-testing.mjs +255 -0
- package/fesm2022/ngx-com-components-dropdown-testing.mjs.map +1 -0
- package/fesm2022/ngx-com-components-dropdown.mjs +2692 -0
- package/fesm2022/ngx-com-components-dropdown.mjs.map +1 -0
- package/fesm2022/ngx-com-components-empty-state.mjs +382 -0
- package/fesm2022/ngx-com-components-empty-state.mjs.map +1 -0
- package/fesm2022/ngx-com-components-form-field.mjs +924 -0
- package/fesm2022/ngx-com-components-form-field.mjs.map +1 -0
- package/fesm2022/ngx-com-components-icon.mjs +183 -0
- package/fesm2022/ngx-com-components-icon.mjs.map +1 -0
- package/fesm2022/ngx-com-components-item.mjs +578 -0
- package/fesm2022/ngx-com-components-item.mjs.map +1 -0
- package/fesm2022/ngx-com-components-menu.mjs +1200 -0
- package/fesm2022/ngx-com-components-menu.mjs.map +1 -0
- package/fesm2022/ngx-com-components-paginator.mjs +823 -0
- package/fesm2022/ngx-com-components-paginator.mjs.map +1 -0
- package/fesm2022/ngx-com-components-popover.mjs +901 -0
- package/fesm2022/ngx-com-components-popover.mjs.map +1 -0
- package/fesm2022/ngx-com-components-radio.mjs +621 -0
- package/fesm2022/ngx-com-components-radio.mjs.map +1 -0
- package/fesm2022/ngx-com-components-segmented-control.mjs +538 -0
- package/fesm2022/ngx-com-components-segmented-control.mjs.map +1 -0
- package/fesm2022/ngx-com-components-sort.mjs +368 -0
- package/fesm2022/ngx-com-components-sort.mjs.map +1 -0
- package/fesm2022/ngx-com-components-spinner.mjs +189 -0
- package/fesm2022/ngx-com-components-spinner.mjs.map +1 -0
- package/fesm2022/ngx-com-components-tabs.mjs +1522 -0
- package/fesm2022/ngx-com-components-tabs.mjs.map +1 -0
- package/fesm2022/ngx-com-components-tooltip.mjs +625 -0
- package/fesm2022/ngx-com-components-tooltip.mjs.map +1 -0
- package/fesm2022/ngx-com-components.mjs +17 -0
- package/fesm2022/ngx-com-components.mjs.map +1 -0
- package/fesm2022/ngx-com-tokens.mjs +12 -0
- package/fesm2022/ngx-com-tokens.mjs.map +1 -0
- package/fesm2022/ngx-com-utils.mjs +601 -0
- package/fesm2022/ngx-com-utils.mjs.map +1 -0
- package/fesm2022/ngx-com.mjs +9 -23
- package/fesm2022/ngx-com.mjs.map +1 -1
- package/package.json +105 -1
- package/types/ngx-com-components-avatar.d.ts +409 -0
- package/types/ngx-com-components-badge.d.ts +97 -0
- package/types/ngx-com-components-button.d.ts +69 -0
- package/types/ngx-com-components-calendar.d.ts +1665 -0
- package/types/ngx-com-components-card.d.ts +373 -0
- package/types/ngx-com-components-checkbox.d.ts +116 -0
- package/types/ngx-com-components-collapsible.d.ts +379 -0
- package/types/ngx-com-components-confirm.d.ts +160 -0
- package/types/ngx-com-components-dropdown-testing.d.ts +116 -0
- package/types/ngx-com-components-dropdown.d.ts +938 -0
- package/types/ngx-com-components-empty-state.d.ts +269 -0
- package/types/ngx-com-components-form-field.d.ts +531 -0
- package/types/ngx-com-components-icon.d.ts +94 -0
- package/types/ngx-com-components-item.d.ts +336 -0
- package/types/ngx-com-components-menu.d.ts +479 -0
- package/types/ngx-com-components-paginator.d.ts +265 -0
- package/types/ngx-com-components-popover.d.ts +309 -0
- package/types/ngx-com-components-radio.d.ts +258 -0
- package/types/ngx-com-components-segmented-control.d.ts +274 -0
- package/types/ngx-com-components-sort.d.ts +133 -0
- package/types/ngx-com-components-spinner.d.ts +120 -0
- package/types/ngx-com-components-tabs.d.ts +396 -0
- package/types/ngx-com-components-tooltip.d.ts +200 -0
- package/types/ngx-com-components.d.ts +12 -0
- package/types/ngx-com-tokens.d.ts +7 -0
- package/types/ngx-com-utils.d.ts +424 -0
- package/types/ngx-com.d.ts +10 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-com-components-confirm.mjs","sources":["../../../projects/com/components/confirm/confirm.variants.ts","../../../projects/com/components/confirm/confirm.utils.ts","../../../projects/com/components/confirm/confirm-panel.component.ts","../../../projects/com/components/confirm/confirm.directive.ts","../../../projects/com/components/confirm/index.ts","../../../projects/com/components/confirm/ngx-com-components-confirm.ts"],"sourcesContent":["import { cva } from 'class-variance-authority';\n\n/**\n * CVA variants for the confirmation panel backdrop.\n *\n * @tokens `--color-background`\n */\nexport const confirmBackdropVariants: (props?: {\n visible?: boolean;\n}) => string = cva(\n [\n 'fixed',\n 'inset-0',\n 'z-50',\n 'bg-background/80',\n 'backdrop-blur-sm',\n ],\n {\n variants: {\n visible: {\n true: 'animate-in fade-in-0',\n false: 'animate-out fade-out-0',\n },\n },\n defaultVariants: {\n visible: true,\n },\n },\n);\n\n/**\n * CVA variants for the confirmation panel container.\n *\n * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`, `--shadow-lg`, `--radius-popover`\n */\nexport const confirmPanelVariants: (props?: {\n visible?: boolean;\n}) => string = cva(\n [\n 'com-confirm-panel',\n 'fixed',\n 'left-1/2',\n 'top-1/2',\n '-translate-x-1/2',\n '-translate-y-1/2',\n 'z-50',\n 'grid',\n 'w-full',\n 'max-w-lg',\n 'gap-4',\n 'border',\n 'border-border',\n 'bg-popover',\n 'text-popover-foreground',\n 'p-6',\n 'shadow-lg',\n 'rounded-popover',\n 'outline-none',\n ],\n {\n variants: {\n visible: {\n true: 'animate-in fade-in-0 zoom-in-95',\n false: 'animate-out fade-out-0 zoom-out-95',\n },\n },\n defaultVariants: {\n visible: true,\n },\n },\n);\n\n/**\n * CVA variants for the confirmation panel title.\n *\n * @tokens `--color-foreground`\n */\nexport const confirmTitleVariants: () => string = cva([\n 'text-lg',\n 'font-semibold',\n 'text-foreground',\n 'leading-none',\n 'tracking-tight',\n]);\n\n/**\n * CVA variants for the confirmation panel message.\n *\n * @tokens `--color-muted-foreground`\n */\nexport const confirmMessageVariants: () => string = cva([\n 'text-sm',\n 'text-muted-foreground',\n]);\n\n/**\n * CVA variants for the confirmation panel footer.\n */\nexport const confirmFooterVariants: () => string = cva([\n 'flex',\n 'flex-col-reverse',\n 'sm:flex-row',\n 'sm:justify-end',\n 'sm:space-x-2',\n]);\n","export { mergeClasses } from 'ngx-com/utils';\n\nlet confirmIdCounter = 0;\n\n/**\n * Generate a unique ID for a confirmation dialog title.\n */\nexport function generateConfirmTitleId(): string {\n return `confirm-title-${++confirmIdCounter}`;\n}\n\n/**\n * Generate a unique ID for a confirmation dialog description.\n */\nexport function generateConfirmDescriptionId(): string {\n return `confirm-desc-${++confirmIdCounter}`;\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n inject,\n signal,\n viewChild,\n} from '@angular/core';\nimport type { AfterViewInit, Signal, WritableSignal } from '@angular/core';\nimport { NgTemplateOutlet } from '@angular/common';\nimport { FocusTrapFactory, FocusTrap } from '@angular/cdk/a11y';\nimport { ComButton } from 'ngx-com/components/button';\nimport {\n confirmPanelVariants,\n confirmBackdropVariants,\n confirmTitleVariants,\n confirmMessageVariants,\n confirmFooterVariants,\n} from './confirm.variants';\nimport type { ConfirmTemplateContext, ConfirmPanelConfig } from './confirm.models';\nimport { mergeClasses } from './confirm.utils';\n\n/**\n * Internal confirmation panel component rendered inside the CDK overlay.\n * Receives configuration from the directive and manages the dialog UI.\n *\n * @internal Not exported in public API\n *\n * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`,\n * `--color-foreground`, `--color-muted-foreground`, `--shadow-lg`, `--radius-popover`\n */\n@Component({\n selector: 'com-confirm-panel',\n template: `\n @if (config()?.hasBackdrop) {\n <div\n [class]=\"backdropClasses()\"\n [attr.data-state]=\"visible() ? 'open' : 'closed'\"\n aria-hidden=\"true\"\n ></div>\n }\n <div\n #panelElement\n [class]=\"panelClasses()\"\n role=\"alertdialog\"\n aria-modal=\"true\"\n [attr.aria-labelledby]=\"config()?.title ? config()?.titleId : null\"\n [attr.aria-describedby]=\"config()?.descriptionId\"\n [attr.data-state]=\"visible() ? 'open' : 'closed'\"\n tabindex=\"-1\"\n >\n @if (config()?.customTemplate) {\n <ng-container\n [ngTemplateOutlet]=\"config()!.customTemplate!\"\n [ngTemplateOutletContext]=\"templateContext()\"\n />\n } @else {\n <div class=\"flex flex-col space-y-2\">\n @if (config()?.title) {\n <h2 [id]=\"config()?.titleId\" [class]=\"titleClasses()\">\n {{ config()?.title }}\n </h2>\n }\n <p [id]=\"config()?.descriptionId\" [class]=\"messageClasses()\">\n {{ config()?.message }}\n </p>\n </div>\n <div [class]=\"footerClasses()\">\n <button\n #cancelButton\n comButton\n variant=\"outline\"\n (click)=\"onCancel()\"\n type=\"button\"\n >\n {{ config()?.cancelLabel }}\n </button>\n <button\n comButton\n [color]=\"config()?.confirmColor ?? 'primary'\"\n (click)=\"onConfirm()\"\n type=\"button\"\n >\n {{ config()?.confirmLabel }}\n </button>\n </div>\n }\n </div>\n `,\n styles: `\n :host {\n display: contents;\n }\n\n /* Animation styles using Tailwind animate utilities */\n [data-state='open'] {\n --tw-enter-opacity: 0;\n --tw-enter-scale: 0.95;\n }\n\n [data-state='closed'] {\n --tw-exit-opacity: 0;\n --tw-exit-scale: 0.95;\n }\n\n @media (prefers-reduced-motion: reduce) {\n [data-state='open'],\n [data-state='closed'] {\n animation: none;\n }\n }\n `,\n imports: [NgTemplateOutlet, ComButton],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class ConfirmPanelComponent implements AfterViewInit {\n private readonly focusTrapFactory = inject(FocusTrapFactory);\n private focusTrap: FocusTrap | null = null;\n\n /** Reference to the panel element for focus trap. */\n private readonly panelElement = viewChild<ElementRef<HTMLElement>>('panelElement');\n\n /** Reference to the cancel button for initial focus. */\n private readonly cancelButton = viewChild<ElementRef<HTMLButtonElement>>('cancelButton');\n\n /** Panel configuration passed from the directive. */\n readonly config: WritableSignal<ConfirmPanelConfig | null> = signal(null);\n\n /** Whether the panel is visible (for animation state). */\n readonly visible: WritableSignal<boolean> = signal(false);\n\n /** Internal loading state for async operations. */\n readonly loading: WritableSignal<boolean> = signal(false);\n\n /** Function to confirm the action, set by directive. */\n readonly confirmFn: WritableSignal<() => void> = signal(() => {});\n\n /** Function to cancel the action, set by directive. */\n readonly cancelFn: WritableSignal<() => void> = signal(() => {});\n\n /** Computed template context for custom templates. */\n protected readonly templateContext: Signal<ConfirmTemplateContext> = computed(() => ({\n $implicit: this.config()?.message ?? '',\n title: this.config()?.title,\n confirm: () => this.onConfirm(),\n cancel: () => this.onCancel(),\n loading: this.loading(),\n setLoading: (value: boolean) => this.loading.set(value),\n }));\n\n /** Computed backdrop CSS classes. */\n protected readonly backdropClasses: Signal<string> = computed(() =>\n mergeClasses(confirmBackdropVariants({ visible: this.visible() })),\n );\n\n /** Computed panel CSS classes. */\n protected readonly panelClasses: Signal<string> = computed(() =>\n mergeClasses(confirmPanelVariants({ visible: this.visible() })),\n );\n\n /** Computed title CSS classes. */\n protected readonly titleClasses: Signal<string> = computed(() =>\n mergeClasses(confirmTitleVariants()),\n );\n\n /** Computed message CSS classes. */\n protected readonly messageClasses: Signal<string> = computed(() =>\n mergeClasses(confirmMessageVariants()),\n );\n\n /** Computed footer CSS classes. */\n protected readonly footerClasses: Signal<string> = computed(() =>\n mergeClasses(confirmFooterVariants()),\n );\n\n ngAfterViewInit(): void {\n this.setupFocusTrap();\n this.focusCancelButton();\n }\n\n /** Handle confirm button click. */\n protected onConfirm(): void {\n this.confirmFn()();\n }\n\n /** Handle cancel button click. */\n protected onCancel(): void {\n this.cancelFn()();\n }\n\n /** Clean up focus trap on destroy. */\n destroyFocusTrap(): void {\n this.focusTrap?.destroy();\n this.focusTrap = null;\n }\n\n private setupFocusTrap(): void {\n const panelEl = this.panelElement()?.nativeElement;\n if (panelEl) {\n this.focusTrap = this.focusTrapFactory.create(panelEl);\n this.focusTrap.focusInitialElementWhenReady();\n }\n }\n\n private focusCancelButton(): void {\n // Focus cancel button as safer default (prevents accidental confirmation)\n // Use setTimeout to ensure DOM is ready\n setTimeout(() => {\n const cancelBtn = this.cancelButton()?.nativeElement;\n if (cancelBtn) {\n cancelBtn.focus();\n }\n }, 0);\n }\n}\n","import {\n booleanAttribute,\n computed,\n DestroyRef,\n Directive,\n ElementRef,\n inject,\n Injector,\n input,\n output,\n PLATFORM_ID,\n signal,\n ViewContainerRef,\n} from '@angular/core';\nimport type {\n InputSignal,\n InputSignalWithTransform,\n OutputEmitterRef,\n Signal,\n TemplateRef,\n WritableSignal,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { Overlay, OverlayRef } from '@angular/cdk/overlay';\nimport { ComponentPortal } from '@angular/cdk/portal';\nimport { filter } from 'rxjs/operators';\nimport { ConfirmPanelComponent } from './confirm-panel.component';\nimport { generateConfirmTitleId, generateConfirmDescriptionId } from './confirm.utils';\nimport type { ConfirmColor, ConfirmTemplateContext, ConfirmPanelConfig } from './confirm.models';\n\n/**\n * Confirmation directive — intercepts clicks and displays a confirmation panel\n * before allowing the action to proceed.\n *\n * The directive acts as an output gate: it captures clicks, shows confirmation UI,\n * and emits `true` (confirmed) or `false` (cancelled) through its output.\n *\n * @tokens `--color-popover`, `--color-popover-foreground`, `--color-border`,\n * `--color-foreground`, `--color-muted-foreground`, `--color-background`,\n * `--shadow-lg`, `--radius-popover`\n *\n * @example Basic confirmation\n * ```html\n * <button comButton (comConfirm)=\"onDelete($event)\" confirmMessage=\"Delete this item?\">\n * Delete\n * </button>\n * ```\n *\n * @example Destructive action with warn styling\n * ```html\n * <button comButton color=\"warn\"\n * (comConfirm)=\"onPermanentDelete($event)\"\n * confirmTitle=\"Permanent Deletion\"\n * confirmMessage=\"This action cannot be undone.\"\n * confirmLabel=\"Delete Forever\"\n * confirmColor=\"warn\">\n * Delete Permanently\n * </button>\n * ```\n *\n * @example Custom template\n * ```html\n * <button comButton (comConfirm)=\"onAction($event)\" [confirmTpl]=\"customTpl\">\n * Action\n * </button>\n *\n * <ng-template #customTpl let-message let-confirm=\"confirm\" let-cancel=\"cancel\">\n * <div class=\"flex flex-col gap-4\">\n * <p>{{ message }}</p>\n * <div class=\"flex justify-end gap-2\">\n * <button comButton variant=\"ghost\" (click)=\"cancel()\">Cancel</button>\n * <button comButton (click)=\"confirm()\">Confirm</button>\n * </div>\n * </div>\n * </ng-template>\n * ```\n */\n@Directive({\n selector: '[comConfirm]',\n exportAs: 'comConfirm',\n host: {\n '[attr.aria-haspopup]': '\"dialog\"',\n '[attr.aria-expanded]': 'isOpen()',\n '(click)': 'onTriggerClick($event)',\n },\n})\nexport class ComConfirm {\n private readonly overlay = inject(Overlay);\n private readonly elementRef = inject<ElementRef<HTMLElement>>(ElementRef);\n private readonly viewContainerRef = inject(ViewContainerRef);\n private readonly injector = inject(Injector);\n private readonly destroyRef = inject(DestroyRef);\n private readonly platformId = inject(PLATFORM_ID);\n\n private overlayRef: OverlayRef | null = null;\n private panelInstance: ConfirmPanelComponent | null = null;\n private readonly titleId = generateConfirmTitleId();\n private readonly descriptionId = generateConfirmDescriptionId();\n\n /** Whether the confirmation panel is currently open. */\n protected readonly isOpen: WritableSignal<boolean> = signal(false);\n\n // ─── Content Inputs ───\n\n /** The confirmation message to display. */\n readonly confirmMessage: InputSignal<string> = input<string>('Are you sure?');\n\n /** Optional title for the confirmation dialog. */\n readonly confirmTitle: InputSignal<string | undefined> = input<string | undefined>(undefined);\n\n /** Label for the confirm button. */\n readonly confirmLabel: InputSignal<string> = input<string>('Confirm');\n\n /** Label for the cancel button. */\n readonly cancelLabel: InputSignal<string> = input<string>('Cancel');\n\n // ─── Styling Inputs ───\n\n /** Color variant for the confirm button. */\n readonly confirmColor: InputSignal<ConfirmColor> = input<ConfirmColor>('primary');\n\n // ─── Behavior Inputs ───\n\n /** When true, clicks pass through without showing confirmation. */\n readonly confirmDisabled: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n });\n\n /** Whether to show a backdrop behind the panel. */\n readonly confirmBackdrop: InputSignalWithTransform<boolean, unknown> = input(false, {\n transform: booleanAttribute,\n });\n\n /** Custom template for the panel content. */\n readonly confirmTpl: InputSignal<TemplateRef<ConfirmTemplateContext> | undefined> =\n input<TemplateRef<ConfirmTemplateContext> | undefined>(undefined);\n\n // ─── Output ───\n\n /**\n * Emits `true` when confirmed, `false` when cancelled or navigated away.\n * This is the main directive output — acts as an output gate for the action.\n */\n readonly comConfirm: OutputEmitterRef<boolean> = output<boolean>();\n\n // ─── Computed ───\n\n private readonly panelConfig: Signal<ConfirmPanelConfig> = computed(() => ({\n message: this.confirmMessage(),\n title: this.confirmTitle(),\n confirmLabel: this.confirmLabel(),\n cancelLabel: this.cancelLabel(),\n confirmColor: this.confirmColor(),\n hasBackdrop: this.confirmBackdrop(),\n customTemplate: this.confirmTpl(),\n titleId: this.titleId,\n descriptionId: this.descriptionId,\n }));\n\n constructor() {\n // Emit false and cleanup on destroy (navigation away)\n this.destroyRef.onDestroy(() => {\n if (this.isOpen()) {\n this.comConfirm.emit(false);\n }\n this.disposeOverlay();\n });\n }\n\n // ─── Public API ───\n\n /** Programmatically open the confirmation dialog. */\n open(): void {\n if (this.isOpen() || this.confirmDisabled()) return;\n this.createOverlay();\n this.attachPanel();\n }\n\n /** Programmatically close the confirmation dialog (emits false). */\n close(): void {\n if (!this.isOpen()) return;\n this.handleCancel();\n }\n\n // ─── Event Handlers ───\n\n protected onTriggerClick(event: Event): void {\n // If disabled, let the click pass through normally\n if (this.confirmDisabled()) return;\n\n // Intercept the click\n event.preventDefault();\n event.stopPropagation();\n\n this.open();\n }\n\n // ─── Overlay Management ───\n\n private createOverlay(): void {\n if (this.overlayRef) return;\n if (!isPlatformBrowser(this.platformId)) return;\n\n // Use GlobalPositionStrategy for centered modal\n const positionStrategy = this.overlay\n .position()\n .global()\n .centerHorizontally()\n .centerVertically();\n\n this.overlayRef = this.overlay.create({\n positionStrategy,\n scrollStrategy: this.overlay.scrollStrategies.block(),\n hasBackdrop: false, // We handle backdrop in the panel component\n panelClass: 'com-confirm-overlay',\n disposeOnNavigation: true,\n });\n }\n\n private attachPanel(): void {\n if (!this.overlayRef || this.overlayRef.hasAttached()) return;\n\n const portal = new ComponentPortal(ConfirmPanelComponent, this.viewContainerRef, this.injector);\n const componentRef = this.overlayRef.attach(portal);\n this.panelInstance = componentRef.instance;\n\n // Configure panel\n this.panelInstance.config.set(this.panelConfig());\n this.panelInstance.confirmFn.set(() => this.handleConfirm());\n this.panelInstance.cancelFn.set(() => this.handleCancel());\n\n // Subscribe to keyboard events (Escape to cancel)\n this.overlayRef\n .keydownEvents()\n .pipe(\n filter((event) => event.key === 'Escape'),\n takeUntilDestroyed(this.destroyRef),\n )\n .subscribe((event) => {\n event.preventDefault();\n event.stopPropagation();\n this.handleCancel();\n });\n\n // Subscribe to detachments (cleanup)\n this.overlayRef\n .detachments()\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe(() => {\n this.handleDetachment();\n });\n\n // Show panel after a microtask (allows initial styles to apply)\n requestAnimationFrame(() => {\n if (this.panelInstance) {\n this.panelInstance.visible.set(true);\n }\n });\n\n this.isOpen.set(true);\n }\n\n private handleConfirm(): void {\n if (!this.isOpen()) return;\n\n this.comConfirm.emit(true);\n this.closePanel();\n }\n\n private handleCancel(): void {\n if (!this.isOpen()) return;\n\n this.comConfirm.emit(false);\n this.closePanel();\n }\n\n private closePanel(): void {\n if (!this.panelInstance) return;\n\n // Trigger hide animation\n this.panelInstance.visible.set(false);\n\n // Wait for animation to complete before detaching\n setTimeout(() => {\n this.disposeOverlay();\n this.returnFocusToTrigger();\n }, 150); // Match animation duration\n }\n\n private handleDetachment(): void {\n this.isOpen.set(false);\n this.panelInstance?.destroyFocusTrap();\n this.panelInstance = null;\n }\n\n private disposeOverlay(): void {\n if (this.overlayRef) {\n this.panelInstance?.destroyFocusTrap();\n this.overlayRef.dispose();\n this.overlayRef = null;\n }\n this.panelInstance = null;\n this.isOpen.set(false);\n }\n\n private returnFocusToTrigger(): void {\n this.elementRef.nativeElement.focus();\n }\n}\n","// Public API for the confirm directive\n\n// Main directive\nexport { ComConfirm } from './confirm.directive';\n\n// Types and interfaces\nexport type { ConfirmTemplateContext, ConfirmColor } from './confirm.models';\n\n// Variants (for advanced customization)\nexport {\n confirmPanelVariants,\n confirmBackdropVariants,\n confirmTitleVariants,\n confirmMessageVariants,\n confirmFooterVariants,\n} from './confirm.variants';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AAEA;;;;AAIG;AACI,MAAM,uBAAuB,GAErB,GAAG,CAChB;IACE,OAAO;IACP,SAAS;IACT,MAAM;IACN,kBAAkB;IAClB,kBAAkB;CACnB,EACD;AACE,IAAA,QAAQ,EAAE;AACR,QAAA,OAAO,EAAE;AACP,YAAA,IAAI,EAAE,sBAAsB;AAC5B,YAAA,KAAK,EAAE,wBAAwB;AAChC,SAAA;AACF,KAAA;AACD,IAAA,eAAe,EAAE;AACf,QAAA,OAAO,EAAE,IAAI;AACd,KAAA;AACF,CAAA;AAGH;;;;AAIG;AACI,MAAM,oB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EAAA,QAAA,EAAA,CAAA,YAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAAV,UAAU,EAAA,UAAA,EAAA,CAAA;kBATtB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,QAAQ,EAAE,cAAc;AACxB,oBAAA,QAAQ,EAAE,YAAY;AACtB,oBAAA,IAAI,EAAE;AACJ,wBAAA,sBAAsB,EAAE,UAAU;AAClC,wBAAA,sBAAsB,EAAE,UAAU;AAClC,wBAAA,SAAS,EAAE,wBAAwB;AACpC,qBAAA;AACF,iBAAA;;;ACtFD;AAEA;;ACFA;;AAEG;;;;"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { ComponentHarness, HarnessPredicate, TestKey, parallel } from '@angular/cdk/testing';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Harness for interacting with a dropdown option in tests.
|
|
5
|
+
*/
|
|
6
|
+
class ComDropdownOptionHarness extends ComponentHarness {
|
|
7
|
+
static hostSelector = 'com-dropdown-option';
|
|
8
|
+
optionElement = this.locatorFor('[role="option"]');
|
|
9
|
+
/**
|
|
10
|
+
* Gets a HarnessPredicate for matching dropdown options.
|
|
11
|
+
* @param options Filter options.
|
|
12
|
+
*/
|
|
13
|
+
static with(options = {}) {
|
|
14
|
+
return new HarnessPredicate(ComDropdownOptionHarness, options)
|
|
15
|
+
.addOption('text', options.text, async (harness, text) => {
|
|
16
|
+
const optionText = await harness.getText();
|
|
17
|
+
return HarnessPredicate.stringMatches(optionText, text);
|
|
18
|
+
})
|
|
19
|
+
.addOption('selected', options.selected, async (harness, selected) => {
|
|
20
|
+
return (await harness.isSelected()) === selected;
|
|
21
|
+
})
|
|
22
|
+
.addOption('disabled', options.disabled, async (harness, disabled) => {
|
|
23
|
+
return (await harness.isDisabled()) === disabled;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/** Gets the option's text content. */
|
|
27
|
+
async getText() {
|
|
28
|
+
const el = await this.optionElement();
|
|
29
|
+
return el.text();
|
|
30
|
+
}
|
|
31
|
+
/** Whether the option is currently selected. */
|
|
32
|
+
async isSelected() {
|
|
33
|
+
const el = await this.optionElement();
|
|
34
|
+
return (await el.getAttribute('aria-selected')) === 'true';
|
|
35
|
+
}
|
|
36
|
+
/** Whether the option is disabled. */
|
|
37
|
+
async isDisabled() {
|
|
38
|
+
const el = await this.optionElement();
|
|
39
|
+
return (await el.getAttribute('aria-disabled')) === 'true';
|
|
40
|
+
}
|
|
41
|
+
/** Whether the option is active (keyboard focused). */
|
|
42
|
+
async isActive() {
|
|
43
|
+
const el = await this.optionElement();
|
|
44
|
+
return (await el.getAttribute('data-active')) === 'true';
|
|
45
|
+
}
|
|
46
|
+
/** Clicks the option to select it. */
|
|
47
|
+
async click() {
|
|
48
|
+
const el = await this.optionElement();
|
|
49
|
+
return el.click();
|
|
50
|
+
}
|
|
51
|
+
/** Hovers over the option. */
|
|
52
|
+
async hover() {
|
|
53
|
+
const el = await this.optionElement();
|
|
54
|
+
return el.hover();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Harness for interacting with a ComDropdown in tests.
|
|
59
|
+
*/
|
|
60
|
+
class ComDropdownHarness extends ComponentHarness {
|
|
61
|
+
static hostSelector = 'com-dropdown';
|
|
62
|
+
trigger = this.locatorFor('button[role="combobox"]');
|
|
63
|
+
panel = this.locatorForOptional('[role="listbox"]');
|
|
64
|
+
searchInput = this.locatorForOptional('com-dropdown-search input');
|
|
65
|
+
clearButton = this.locatorForOptional('button[aria-label="Clear selection"]');
|
|
66
|
+
/**
|
|
67
|
+
* Gets a HarnessPredicate for matching dropdowns.
|
|
68
|
+
* @param options Filter options.
|
|
69
|
+
*/
|
|
70
|
+
static with(options = {}) {
|
|
71
|
+
return new HarnessPredicate(ComDropdownHarness, options)
|
|
72
|
+
.addOption('placeholder', options.placeholder, async (harness, placeholder) => {
|
|
73
|
+
const text = await harness.getTriggerText();
|
|
74
|
+
return HarnessPredicate.stringMatches(text, placeholder);
|
|
75
|
+
})
|
|
76
|
+
.addOption('disabled', options.disabled, async (harness, disabled) => {
|
|
77
|
+
return (await harness.isDisabled()) === disabled;
|
|
78
|
+
})
|
|
79
|
+
.addOption('open', options.open, async (harness, open) => {
|
|
80
|
+
return (await harness.isOpen()) === open;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/** Gets the dropdown's trigger button text. */
|
|
84
|
+
async getTriggerText() {
|
|
85
|
+
const triggerEl = await this.trigger();
|
|
86
|
+
return triggerEl.text();
|
|
87
|
+
}
|
|
88
|
+
/** Whether the dropdown is currently open. */
|
|
89
|
+
async isOpen() {
|
|
90
|
+
const triggerEl = await this.trigger();
|
|
91
|
+
return (await triggerEl.getAttribute('aria-expanded')) === 'true';
|
|
92
|
+
}
|
|
93
|
+
/** Whether the dropdown is disabled. */
|
|
94
|
+
async isDisabled() {
|
|
95
|
+
const triggerEl = await this.trigger();
|
|
96
|
+
const disabled = await triggerEl.getAttribute('disabled');
|
|
97
|
+
return disabled !== null;
|
|
98
|
+
}
|
|
99
|
+
/** Whether the dropdown has a value selected. */
|
|
100
|
+
async hasValue() {
|
|
101
|
+
const clearBtn = await this.clearButton();
|
|
102
|
+
return clearBtn !== null;
|
|
103
|
+
}
|
|
104
|
+
/** Opens the dropdown if it's closed. */
|
|
105
|
+
async open() {
|
|
106
|
+
if (!(await this.isOpen())) {
|
|
107
|
+
await this.click();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
/** Closes the dropdown if it's open. */
|
|
111
|
+
async close() {
|
|
112
|
+
if (await this.isOpen()) {
|
|
113
|
+
await this.sendKeys(TestKey.ESCAPE);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
/** Clicks the dropdown trigger. */
|
|
117
|
+
async click() {
|
|
118
|
+
const triggerEl = await this.trigger();
|
|
119
|
+
return triggerEl.click();
|
|
120
|
+
}
|
|
121
|
+
/** Clears the current selection. */
|
|
122
|
+
async clear() {
|
|
123
|
+
const clearBtn = await this.clearButton();
|
|
124
|
+
if (clearBtn) {
|
|
125
|
+
return clearBtn.click();
|
|
126
|
+
}
|
|
127
|
+
throw new Error('Dropdown does not have a clearable selection');
|
|
128
|
+
}
|
|
129
|
+
/** Sends keyboard input to the dropdown. */
|
|
130
|
+
async sendKeys(...keys) {
|
|
131
|
+
const triggerEl = await this.trigger();
|
|
132
|
+
return triggerEl.sendKeys(...keys);
|
|
133
|
+
}
|
|
134
|
+
/** Gets all options in the dropdown. */
|
|
135
|
+
async getOptions(filters = {}) {
|
|
136
|
+
await this.open();
|
|
137
|
+
return this.locatorForAll(ComDropdownOptionHarness.with(filters))();
|
|
138
|
+
}
|
|
139
|
+
/** Gets an option by its text. */
|
|
140
|
+
async getOption(text) {
|
|
141
|
+
await this.open();
|
|
142
|
+
const options = await this.getOptions({ text });
|
|
143
|
+
return options[0] ?? null;
|
|
144
|
+
}
|
|
145
|
+
/** Selects an option by its text. */
|
|
146
|
+
async selectOption(text) {
|
|
147
|
+
const option = await this.getOption(text);
|
|
148
|
+
if (!option) {
|
|
149
|
+
throw new Error(`Could not find option with text: ${text}`);
|
|
150
|
+
}
|
|
151
|
+
return option.click();
|
|
152
|
+
}
|
|
153
|
+
/** Gets the currently selected option(s). */
|
|
154
|
+
async getSelectedOptions() {
|
|
155
|
+
await this.open();
|
|
156
|
+
return this.getOptions({ selected: true });
|
|
157
|
+
}
|
|
158
|
+
/** Whether the dropdown has a search input. */
|
|
159
|
+
async isSearchable() {
|
|
160
|
+
await this.open();
|
|
161
|
+
const input = await this.searchInput();
|
|
162
|
+
return input !== null;
|
|
163
|
+
}
|
|
164
|
+
/** Gets the current search query. */
|
|
165
|
+
async getSearchQuery() {
|
|
166
|
+
await this.open();
|
|
167
|
+
const input = await this.searchInput();
|
|
168
|
+
if (!input) {
|
|
169
|
+
throw new Error('Dropdown is not searchable');
|
|
170
|
+
}
|
|
171
|
+
return input.getProperty('value');
|
|
172
|
+
}
|
|
173
|
+
/** Types in the search input. */
|
|
174
|
+
async search(query) {
|
|
175
|
+
await this.open();
|
|
176
|
+
const input = await this.searchInput();
|
|
177
|
+
if (!input) {
|
|
178
|
+
throw new Error('Dropdown is not searchable');
|
|
179
|
+
}
|
|
180
|
+
await input.clear();
|
|
181
|
+
return input.sendKeys(query);
|
|
182
|
+
}
|
|
183
|
+
/** Clears the search input. */
|
|
184
|
+
async clearSearch() {
|
|
185
|
+
await this.open();
|
|
186
|
+
const input = await this.searchInput();
|
|
187
|
+
if (!input) {
|
|
188
|
+
throw new Error('Dropdown is not searchable');
|
|
189
|
+
}
|
|
190
|
+
return input.clear();
|
|
191
|
+
}
|
|
192
|
+
/** Gets the number of visible options. */
|
|
193
|
+
async getOptionsCount() {
|
|
194
|
+
const options = await this.getOptions();
|
|
195
|
+
return options.length;
|
|
196
|
+
}
|
|
197
|
+
/** Gets all option texts. */
|
|
198
|
+
async getOptionTexts() {
|
|
199
|
+
const options = await this.getOptions();
|
|
200
|
+
return parallel(() => options.map((opt) => opt.getText()));
|
|
201
|
+
}
|
|
202
|
+
/** Navigates to an option using keyboard. */
|
|
203
|
+
async navigateToOption(direction, times = 1) {
|
|
204
|
+
await this.open();
|
|
205
|
+
const key = direction === 'down' ? TestKey.DOWN_ARROW : TestKey.UP_ARROW;
|
|
206
|
+
for (let i = 0; i < times; i++) {
|
|
207
|
+
await this.sendKeys(key);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/** Selects the currently active option. */
|
|
211
|
+
async selectActiveOption() {
|
|
212
|
+
await this.sendKeys(TestKey.ENTER);
|
|
213
|
+
}
|
|
214
|
+
/** Gets the ID of the active descendant. */
|
|
215
|
+
async getActiveDescendantId() {
|
|
216
|
+
await this.open();
|
|
217
|
+
const triggerEl = await this.trigger();
|
|
218
|
+
return triggerEl.getAttribute('aria-activedescendant');
|
|
219
|
+
}
|
|
220
|
+
/** Gets the panel ID. */
|
|
221
|
+
async getPanelId() {
|
|
222
|
+
await this.open();
|
|
223
|
+
const panelEl = await this.panel();
|
|
224
|
+
return panelEl ? panelEl.getAttribute('id') : null;
|
|
225
|
+
}
|
|
226
|
+
/** Gets the aria-controls value from the trigger. */
|
|
227
|
+
async getAriaControls() {
|
|
228
|
+
const triggerEl = await this.trigger();
|
|
229
|
+
return triggerEl.getAttribute('aria-controls');
|
|
230
|
+
}
|
|
231
|
+
/** Focuses the dropdown trigger. */
|
|
232
|
+
async focus() {
|
|
233
|
+
const triggerEl = await this.trigger();
|
|
234
|
+
return triggerEl.focus();
|
|
235
|
+
}
|
|
236
|
+
/** Blurs the dropdown trigger. */
|
|
237
|
+
async blur() {
|
|
238
|
+
const triggerEl = await this.trigger();
|
|
239
|
+
return triggerEl.blur();
|
|
240
|
+
}
|
|
241
|
+
/** Whether the dropdown trigger is focused. */
|
|
242
|
+
async isFocused() {
|
|
243
|
+
const triggerEl = await this.trigger();
|
|
244
|
+
return triggerEl.isFocused();
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Testing utilities for the dropdown component
|
|
249
|
+
|
|
250
|
+
/**
|
|
251
|
+
* Generated bundle index. Do not edit.
|
|
252
|
+
*/
|
|
253
|
+
|
|
254
|
+
export { ComDropdownHarness, ComDropdownOptionHarness };
|
|
255
|
+
//# sourceMappingURL=ngx-com-components-dropdown-testing.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-com-components-dropdown-testing.mjs","sources":["../../../projects/com/components/dropdown/testing/dropdown.harness.ts","../../../projects/com/components/dropdown/testing/index.ts","../../../projects/com/components/dropdown/testing/ngx-com-components-dropdown-testing.ts"],"sourcesContent":["import {\n ComponentHarness,\n HarnessPredicate,\n TestKey,\n parallel,\n} from '@angular/cdk/testing';\nimport type { BaseHarnessFilters } from '@angular/cdk/testing';\n\n/** Harness filters for ComDropdownHarness. */\nexport interface ComDropdownHarnessFilters extends BaseHarnessFilters {\n /** Filter by the dropdown's placeholder text. */\n placeholder?: string | RegExp;\n /** Filter by whether the dropdown is disabled. */\n disabled?: boolean;\n /** Filter by whether the dropdown is open. */\n open?: boolean;\n}\n\n/** Harness filters for ComDropdownOptionHarness. */\nexport interface ComDropdownOptionHarnessFilters extends BaseHarnessFilters {\n /** Filter by the option's text. */\n text?: string | RegExp;\n /** Filter by whether the option is selected. */\n selected?: boolean;\n /** Filter by whether the option is disabled. */\n disabled?: boolean;\n}\n\n/**\n * Harness for interacting with a dropdown option in tests.\n */\nexport class ComDropdownOptionHarness extends ComponentHarness {\n static hostSelector = 'com-dropdown-option';\n\n private readonly optionElement = this.locatorFor('[role=\"option\"]');\n\n /**\n * Gets a HarnessPredicate for matching dropdown options.\n * @param options Filter options.\n */\n static with(options: ComDropdownOptionHarnessFilters = {}): HarnessPredicate<ComDropdownOptionHarness> {\n return new HarnessPredicate(ComDropdownOptionHarness, options)\n .addOption('text', options.text, async (harness, text) => {\n const optionText = await harness.getText();\n return HarnessPredicate.stringMatches(optionText, text);\n })\n .addOption('selected', options.selected, async (harness, selected) => {\n return (await harness.isSelected()) === selected;\n })\n .addOption('disabled', options.disabled, async (harness, disabled) => {\n return (await harness.isDisabled()) === disabled;\n });\n }\n\n /** Gets the option's text content. */\n async getText(): Promise<string> {\n const el = await this.optionElement();\n return el.text();\n }\n\n /** Whether the option is currently selected. */\n async isSelected(): Promise<boolean> {\n const el = await this.optionElement();\n return (await el.getAttribute('aria-selected')) === 'true';\n }\n\n /** Whether the option is disabled. */\n async isDisabled(): Promise<boolean> {\n const el = await this.optionElement();\n return (await el.getAttribute('aria-disabled')) === 'true';\n }\n\n /** Whether the option is active (keyboard focused). */\n async isActive(): Promise<boolean> {\n const el = await this.optionElement();\n return (await el.getAttribute('data-active')) === 'true';\n }\n\n /** Clicks the option to select it. */\n async click(): Promise<void> {\n const el = await this.optionElement();\n return el.click();\n }\n\n /** Hovers over the option. */\n async hover(): Promise<void> {\n const el = await this.optionElement();\n return el.hover();\n }\n}\n\n/**\n * Harness for interacting with a ComDropdown in tests.\n */\nexport class ComDropdownHarness extends ComponentHarness {\n static hostSelector = 'com-dropdown';\n\n private readonly trigger = this.locatorFor('button[role=\"combobox\"]');\n private readonly panel = this.locatorForOptional('[role=\"listbox\"]');\n private readonly searchInput = this.locatorForOptional('com-dropdown-search input');\n private readonly clearButton = this.locatorForOptional('button[aria-label=\"Clear selection\"]');\n\n /**\n * Gets a HarnessPredicate for matching dropdowns.\n * @param options Filter options.\n */\n static with(options: ComDropdownHarnessFilters = {}): HarnessPredicate<ComDropdownHarness> {\n return new HarnessPredicate(ComDropdownHarness, options)\n .addOption('placeholder', options.placeholder, async (harness, placeholder) => {\n const text = await harness.getTriggerText();\n return HarnessPredicate.stringMatches(text, placeholder);\n })\n .addOption('disabled', options.disabled, async (harness, disabled) => {\n return (await harness.isDisabled()) === disabled;\n })\n .addOption('open', options.open, async (harness, open) => {\n return (await harness.isOpen()) === open;\n });\n }\n\n /** Gets the dropdown's trigger button text. */\n async getTriggerText(): Promise<string> {\n const triggerEl = await this.trigger();\n return triggerEl.text();\n }\n\n /** Whether the dropdown is currently open. */\n async isOpen(): Promise<boolean> {\n const triggerEl = await this.trigger();\n return (await triggerEl.getAttribute('aria-expanded')) === 'true';\n }\n\n /** Whether the dropdown is disabled. */\n async isDisabled(): Promise<boolean> {\n const triggerEl = await this.trigger();\n const disabled = await triggerEl.getAttribute('disabled');\n return disabled !== null;\n }\n\n /** Whether the dropdown has a value selected. */\n async hasValue(): Promise<boolean> {\n const clearBtn = await this.clearButton();\n return clearBtn !== null;\n }\n\n /** Opens the dropdown if it's closed. */\n async open(): Promise<void> {\n if (!(await this.isOpen())) {\n await this.click();\n }\n }\n\n /** Closes the dropdown if it's open. */\n async close(): Promise<void> {\n if (await this.isOpen()) {\n await this.sendKeys(TestKey.ESCAPE);\n }\n }\n\n /** Clicks the dropdown trigger. */\n async click(): Promise<void> {\n const triggerEl = await this.trigger();\n return triggerEl.click();\n }\n\n /** Clears the current selection. */\n async clear(): Promise<void> {\n const clearBtn = await this.clearButton();\n if (clearBtn) {\n return clearBtn.click();\n }\n throw new Error('Dropdown does not have a clearable selection');\n }\n\n /** Sends keyboard input to the dropdown. */\n async sendKeys(...keys: (string | TestKey)[]): Promise<void> {\n const triggerEl = await this.trigger();\n return triggerEl.sendKeys(...keys);\n }\n\n /** Gets all options in the dropdown. */\n async getOptions(filters: ComDropdownOptionHarnessFilters = {}): Promise<ComDropdownOptionHarness[]> {\n await this.open();\n return this.locatorForAll(ComDropdownOptionHarness.with(filters))();\n }\n\n /** Gets an option by its text. */\n async getOption(text: string | RegExp): Promise<ComDropdownOptionHarness | null> {\n await this.open();\n const options = await this.getOptions({ text });\n return options[0] ?? null;\n }\n\n /** Selects an option by its text. */\n async selectOption(text: string | RegExp): Promise<void> {\n const option = await this.getOption(text);\n if (!option) {\n throw new Error(`Could not find option with text: ${text}`);\n }\n return option.click();\n }\n\n /** Gets the currently selected option(s). */\n async getSelectedOptions(): Promise<ComDropdownOptionHarness[]> {\n await this.open();\n return this.getOptions({ selected: true });\n }\n\n /** Whether the dropdown has a search input. */\n async isSearchable(): Promise<boolean> {\n await this.open();\n const input = await this.searchInput();\n return input !== null;\n }\n\n /** Gets the current search query. */\n async getSearchQuery(): Promise<string> {\n await this.open();\n const input = await this.searchInput();\n if (!input) {\n throw new Error('Dropdown is not searchable');\n }\n return input.getProperty<string>('value');\n }\n\n /** Types in the search input. */\n async search(query: string): Promise<void> {\n await this.open();\n const input = await this.searchInput();\n if (!input) {\n throw new Error('Dropdown is not searchable');\n }\n await input.clear();\n return input.sendKeys(query);\n }\n\n /** Clears the search input. */\n async clearSearch(): Promise<void> {\n await this.open();\n const input = await this.searchInput();\n if (!input) {\n throw new Error('Dropdown is not searchable');\n }\n return input.clear();\n }\n\n /** Gets the number of visible options. */\n async getOptionsCount(): Promise<number> {\n const options = await this.getOptions();\n return options.length;\n }\n\n /** Gets all option texts. */\n async getOptionTexts(): Promise<string[]> {\n const options = await this.getOptions();\n return parallel(() => options.map((opt) => opt.getText()));\n }\n\n /** Navigates to an option using keyboard. */\n async navigateToOption(direction: 'up' | 'down', times = 1): Promise<void> {\n await this.open();\n const key = direction === 'down' ? TestKey.DOWN_ARROW : TestKey.UP_ARROW;\n for (let i = 0; i < times; i++) {\n await this.sendKeys(key);\n }\n }\n\n /** Selects the currently active option. */\n async selectActiveOption(): Promise<void> {\n await this.sendKeys(TestKey.ENTER);\n }\n\n /** Gets the ID of the active descendant. */\n async getActiveDescendantId(): Promise<string | null> {\n await this.open();\n const triggerEl = await this.trigger();\n return triggerEl.getAttribute('aria-activedescendant');\n }\n\n /** Gets the panel ID. */\n async getPanelId(): Promise<string | null> {\n await this.open();\n const panelEl = await this.panel();\n return panelEl ? panelEl.getAttribute('id') : null;\n }\n\n /** Gets the aria-controls value from the trigger. */\n async getAriaControls(): Promise<string | null> {\n const triggerEl = await this.trigger();\n return triggerEl.getAttribute('aria-controls');\n }\n\n /** Focuses the dropdown trigger. */\n async focus(): Promise<void> {\n const triggerEl = await this.trigger();\n return triggerEl.focus();\n }\n\n /** Blurs the dropdown trigger. */\n async blur(): Promise<void> {\n const triggerEl = await this.trigger();\n return triggerEl.blur();\n }\n\n /** Whether the dropdown trigger is focused. */\n async isFocused(): Promise<boolean> {\n const triggerEl = await this.trigger();\n return triggerEl.isFocused();\n }\n}\n","// Testing utilities for the dropdown component\n\nexport {\n ComDropdownHarness,\n ComDropdownOptionHarness,\n} from './dropdown.harness';\n\nexport type {\n ComDropdownHarnessFilters,\n ComDropdownOptionHarnessFilters,\n} from './dropdown.harness';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;AA4BA;;AAEG;AACG,MAAO,wBAAyB,SAAQ,gBAAgB,CAAA;AAC5D,IAAA,OAAO,YAAY,GAAG,qBAAqB;AAE1B,IAAA,aAAa,GAAG,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC;AAEnE;;;AAGG;AACH,IAAA,OAAO,IAAI,CAAC,OAAA,GAA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