@neuravision/ng-construct 0.9.0 → 0.10.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neuravision/ng-construct",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "description": "Angular components for the Construct Design System",
5
5
  "keywords": [
6
6
  "angular",
@@ -1467,7 +1467,7 @@ declare class AfDropdownComponent {
1467
1467
  /** Trigger button size. */
1468
1468
  size: _angular_core.InputSignal<AfButtonSize>;
1469
1469
  /** Horizontal alignment of the menu relative to the trigger. */
1470
- align: _angular_core.InputSignal<"start" | "end">;
1470
+ align: _angular_core.InputSignal<"end" | "start">;
1471
1471
  /** Which side of the trigger the menu opens on. */
1472
1472
  side: _angular_core.InputSignal<"bottom" | "top">;
1473
1473
  /** Menu items. */
@@ -2429,6 +2429,199 @@ declare class AfComboboxComponent implements ControlValueAccessor {
2429
2429
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<AfComboboxComponent, "af-combobox", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "compareWith": { "alias": "compareWith"; "required": false; "isSignal": true; }; "comboboxId": { "alias": "comboboxId"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; }, never, never, true, never>;
2430
2430
  }
2431
2431
 
2432
+ /**
2433
+ * A single suggestion rendered by {@link AfAutocompleteComponent}.
2434
+ *
2435
+ * The component never filters or sorts these — the consumer supplies the
2436
+ * already-resolved, display-ordered list (remote search, client cache, …).
2437
+ * `id` is the stable identity used for tracking and DOM ids; `value` is the
2438
+ * payload handed back on selection.
2439
+ */
2440
+ interface AfAutocompleteOption<T = unknown> {
2441
+ /** Stable identity — used for `@for` tracking and the option's DOM id. */
2442
+ id: string;
2443
+ /** Payload emitted via {@link AfAutocompleteComponent.optionSelected}. */
2444
+ value: T;
2445
+ /** Primary text — the accessible name and the default visual label. */
2446
+ label: string;
2447
+ /** Optional secondary text shown beneath the label in the default row. */
2448
+ description?: string;
2449
+ /**
2450
+ * Optional group key. Consecutive options sharing a key render under one
2451
+ * heading (see {@link AfAutocompleteComponent.groupLabels}). Omit for
2452
+ * ungrouped options.
2453
+ */
2454
+ group?: string;
2455
+ /** When true the option is shown but cannot be highlighted or selected. */
2456
+ disabled?: boolean;
2457
+ }
2458
+ /** Template context exposed to a custom option template. */
2459
+ interface AfAutocompleteOptionContext {
2460
+ /** The option being rendered (also available as the implicit value). */
2461
+ $implicit: AfAutocompleteOption;
2462
+ /** Same as {@link $implicit}; named for readable `let-option="option"`. */
2463
+ option: AfAutocompleteOption;
2464
+ /** The current query text, e.g. for highlighting matched substrings. */
2465
+ query: string;
2466
+ }
2467
+ /**
2468
+ * Marks an `<ng-template>` as the custom row renderer for
2469
+ * {@link AfAutocompleteComponent}. Without it the component falls back to
2470
+ * rendering `label` + `description`.
2471
+ *
2472
+ * @example
2473
+ * <af-autocomplete [options]="opts">
2474
+ * <ng-template afAutocompleteOption let-option="option">
2475
+ * <af-avatar [name]="option.label" />
2476
+ * {{ option.label }}
2477
+ * </ng-template>
2478
+ * </af-autocomplete>
2479
+ */
2480
+ declare class AfAutocompleteOptionDirective {
2481
+ readonly template: TemplateRef<AfAutocompleteOptionContext>;
2482
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AfAutocompleteOptionDirective, never>;
2483
+ static ɵdir: _angular_core.ɵɵDirectiveDeclaration<AfAutocompleteOptionDirective, "ng-template[afAutocompleteOption]", never, {}, {}, never, never, true, never>;
2484
+ }
2485
+ /** Internal: an option paired with its flat index across all groups. */
2486
+ interface IndexedOption {
2487
+ option: AfAutocompleteOption;
2488
+ flatIndex: number;
2489
+ }
2490
+ /** Internal: a rendered group (label `undefined` => ungrouped, no heading). */
2491
+ interface DisplayGroup {
2492
+ key: string;
2493
+ label: string | undefined;
2494
+ items: IndexedOption[];
2495
+ }
2496
+ /**
2497
+ * Accessible async / remote autocomplete (typeahead) following the WAI-ARIA 1.2
2498
+ * combobox-with-listbox pattern.
2499
+ *
2500
+ * Unlike {@link AfComboboxComponent} — which owns a static option list and
2501
+ * filters it by label substring — this component is **external-filter only**:
2502
+ * the consumer owns fetching and filtering, then feeds the resolved results in
2503
+ * via `options` (and toggles `loading`). That makes it suitable for remote
2504
+ * search across multiple sources, where a hit may have matched on a field that
2505
+ * is not part of its visible label (e.g. a user matched by e-mail).
2506
+ *
2507
+ * It emits a selection **event** rather than binding a value, so the same box
2508
+ * can drive an action (apply a filter, navigate) while keeping the free text.
2509
+ *
2510
+ * Features: option groups with headings, a loading row, an empty row, rich
2511
+ * rows via {@link AfAutocompleteOptionDirective}, full keyboard support
2512
+ * (Arrow/Home/End/Enter/Escape/Tab) and screen-reader announcements.
2513
+ *
2514
+ * @example
2515
+ * <af-autocomplete
2516
+ * label="Search"
2517
+ * [(query)]="query"
2518
+ * [options]="results()"
2519
+ * [loading]="loading()"
2520
+ * [minChars]="2"
2521
+ * clearQueryOnSelect
2522
+ * (optionSelected)="apply($event)"
2523
+ * >
2524
+ * <ng-template afAutocompleteOption let-option="option">…</ng-template>
2525
+ * </af-autocomplete>
2526
+ */
2527
+ declare class AfAutocompleteComponent {
2528
+ private static nextId;
2529
+ /** Field label rendered above the input. */
2530
+ readonly label: _angular_core.InputSignal<string>;
2531
+ /** Placeholder text for the input. */
2532
+ readonly placeholder: _angular_core.InputSignal<string>;
2533
+ /** Hint text shown below the input (hidden while {@link error} is set). */
2534
+ readonly hint: _angular_core.InputSignal<string>;
2535
+ /** Error message — shows the error state and message. */
2536
+ readonly error: _angular_core.InputSignal<string>;
2537
+ /** Whether the field is required (renders the `*` indicator). */
2538
+ readonly required: _angular_core.InputSignalWithTransform<boolean, unknown>;
2539
+ /** Whether the input is disabled. */
2540
+ readonly disabled: _angular_core.ModelSignal<boolean>;
2541
+ /** Size variant. */
2542
+ readonly size: _angular_core.InputSignal<"sm" | "md" | "lg">;
2543
+ /**
2544
+ * The suggestions to display, already filtered and ordered by the consumer.
2545
+ * The component does not filter them.
2546
+ */
2547
+ readonly options: _angular_core.InputSignal<AfAutocompleteOption<unknown>[]>;
2548
+ /** Shows the loading row / spinner while a fetch is in flight. */
2549
+ readonly loading: _angular_core.InputSignalWithTransform<boolean, unknown>;
2550
+ /** Minimum trimmed query length before the listbox opens. */
2551
+ readonly minChars: _angular_core.InputSignal<number>;
2552
+ /** Text shown when a query is present but no options match. */
2553
+ readonly emptyText: _angular_core.InputSignal<string>;
2554
+ /** Text shown in the loading row. */
2555
+ readonly loadingText: _angular_core.InputSignal<string>;
2556
+ /** Whether re-focusing the input re-opens the listbox. */
2557
+ readonly openOnFocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
2558
+ /**
2559
+ * When true the panel stays closed while there are no options and no fetch
2560
+ * is in flight — instead of showing the empty row. Useful when the same box
2561
+ * also drives a side effect (e.g. a live text filter) so an empty suggestion
2562
+ * list should be silent rather than intrusive.
2563
+ */
2564
+ readonly hideOnEmpty: _angular_core.InputSignalWithTransform<boolean, unknown>;
2565
+ /** When true the query text is cleared after a selection (action-style use). */
2566
+ readonly clearQueryOnSelect: _angular_core.InputSignalWithTransform<boolean, unknown>;
2567
+ /** Render the leading search icon. */
2568
+ readonly showSearchIcon: _angular_core.InputSignalWithTransform<boolean, unknown>;
2569
+ /** Render the trailing clear (×) button when the query is non-empty. */
2570
+ readonly showClear: _angular_core.InputSignalWithTransform<boolean, unknown>;
2571
+ /** Accessible label for the clear button. */
2572
+ readonly clearAriaLabel: _angular_core.InputSignal<string>;
2573
+ /** Maps a group key to its display heading; falls back to the key itself. */
2574
+ readonly groupLabels: _angular_core.InputSignal<Record<string, string>>;
2575
+ /** Explicit group ordering by key; unlisted keys keep first-seen order. */
2576
+ readonly groupOrder: _angular_core.InputSignal<string[]>;
2577
+ /** Unique base id for the field's `id`/`aria` wiring. */
2578
+ readonly autocompleteId: _angular_core.InputSignal<string>;
2579
+ /** Two-way bound query text. The consumer debounces this and feeds `options`. */
2580
+ readonly query: _angular_core.ModelSignal<string>;
2581
+ /** Emitted when the user selects an enabled option. */
2582
+ readonly optionSelected: _angular_core.OutputEmitterRef<AfAutocompleteOption<unknown>>;
2583
+ protected readonly optionTemplate: _angular_core.Signal<AfAutocompleteOptionDirective | undefined>;
2584
+ protected readonly inputRef: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
2585
+ protected readonly isOpen: _angular_core.WritableSignal<boolean>;
2586
+ protected readonly highlightedIndex: _angular_core.WritableSignal<number>;
2587
+ get inputId(): string;
2588
+ get listboxId(): string;
2589
+ get hintId(): string;
2590
+ get errorId(): string;
2591
+ protected readonly rootClasses: _angular_core.Signal<string>;
2592
+ /** True once the trimmed query reaches {@link minChars}. */
2593
+ protected readonly hasMinChars: _angular_core.Signal<boolean>;
2594
+ /** Flat, display-ordered options used for keyboard navigation. */
2595
+ protected readonly flatOptions: _angular_core.Signal<AfAutocompleteOption<unknown>[]>;
2596
+ /** Options grouped for rendering, each paired with its flat index. */
2597
+ protected readonly displayGroups: _angular_core.Signal<DisplayGroup[]>;
2598
+ /** Whether the listbox is visually open. */
2599
+ protected readonly panelOpen: _angular_core.Signal<boolean>;
2600
+ /** Whether to render the "no results" row. */
2601
+ protected readonly showEmpty: _angular_core.Signal<boolean>;
2602
+ protected readonly activeDescendantId: _angular_core.Signal<string | null>;
2603
+ protected readonly statusMessage: _angular_core.Signal<string>;
2604
+ protected ariaDescribedBy(): string | null;
2605
+ protected optionDomId(flatIndex: number): string;
2606
+ protected groupLabelId(groupIndex: number): string;
2607
+ protected onInput(event: Event): void;
2608
+ protected onFocus(): void;
2609
+ /** Selects an enabled option: emits it, then clears or restores the text. */
2610
+ selectOption(option: AfAutocompleteOption): void;
2611
+ /** Clears the query text and closes the listbox. */
2612
+ clear(): void;
2613
+ /** Closes the listbox without changing the query. */
2614
+ close(): void;
2615
+ protected onKeydown(event: KeyboardEvent): void;
2616
+ protected onDocumentClick(event: MouseEvent): void;
2617
+ private moveHighlight;
2618
+ private firstEnabledIndex;
2619
+ private lastEnabledIndex;
2620
+ private scrollHighlightedIntoView;
2621
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<AfAutocompleteComponent, never>;
2622
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<AfAutocompleteComponent, "af-autocomplete", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "hint": { "alias": "hint"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "minChars": { "alias": "minChars"; "required": false; "isSignal": true; }; "emptyText": { "alias": "emptyText"; "required": false; "isSignal": true; }; "loadingText": { "alias": "loadingText"; "required": false; "isSignal": true; }; "openOnFocus": { "alias": "openOnFocus"; "required": false; "isSignal": true; }; "hideOnEmpty": { "alias": "hideOnEmpty"; "required": false; "isSignal": true; }; "clearQueryOnSelect": { "alias": "clearQueryOnSelect"; "required": false; "isSignal": true; }; "showSearchIcon": { "alias": "showSearchIcon"; "required": false; "isSignal": true; }; "showClear": { "alias": "showClear"; "required": false; "isSignal": true; }; "clearAriaLabel": { "alias": "clearAriaLabel"; "required": false; "isSignal": true; }; "groupLabels": { "alias": "groupLabels"; "required": false; "isSignal": true; }; "groupOrder": { "alias": "groupOrder"; "required": false; "isSignal": true; }; "autocompleteId": { "alias": "autocompleteId"; "required": false; "isSignal": true; }; "query": { "alias": "query"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "query": "queryChange"; "optionSelected": "optionSelected"; }, ["optionTemplate"], never, true, never>;
2623
+ }
2624
+
2432
2625
  interface AfFileValidationError {
2433
2626
  file: File;
2434
2627
  type: 'type' | 'size';
@@ -4438,5 +4631,5 @@ declare class AfFormatLabelPipe implements PipeTransform {
4438
4631
  static ɵpipe: _angular_core.ɵɵPipeDeclaration<AfFormatLabelPipe, "afFormatLabel", true>;
4439
4632
  }
4440
4633
 
4441
- export { AF_ACCORDION_I18N, AF_ALERT_I18N, AF_CHART_I18N, AF_CHART_PALETTE_SIZE, AF_INPUT_I18N, AF_SELECT_I18N, AF_SELECT_MENU_I18N, AF_TREE_I18N, AVATAR_SEED_PALETTE_SIZE, AfAccordionComponent, AfAccordionHarness, AfAccordionItemComponent, AfAccordionItemHarness, AfAlertComponent, AfAlertHarness, AfAppShellComponent, AfAppShellPageHeaderComponent, AfAppShellV2Component, AfAppShellV2ToolbarComponent, AfAvatarComponent, AfBadgeComponent, AfBadgeHarness, AfBannerComponent, AfBarChartComponent, AfBarChartHarness, AfBreadcrumbsComponent, AfButtonComponent, AfButtonHarness, AfCardComponent, AfCellDefDirective, AfChartDataTableComponent, AfCheckboxComponent, AfChipComponent, AfChipInputComponent, AfComboboxComponent, AfDataTableComponent, AfDatepickerComponent, AfDividerComponent, AfDonutChartComponent, AfDonutChartHarness, AfDrawerComponent, AfDropdownComponent, AfEmptyStateComponent, AfFieldComponent, AfFileUploadComponent, AfFormatLabelPipe, AfGaugeComponent, AfGaugeHarness, AfIconComponent, AfInputComponent, AfInputHarness, AfLineChartComponent, AfLineChartHarness, AfModalComponent, AfNavItemComponent, AfNavTabsComponent, AfNavbarComponent, AfPaginationComponent, AfPopoverComponent, AfPopoverTriggerDirective, AfProgressBarComponent, AfRadioComponent, AfRadioGroupComponent, AfSelectComponent, AfSelectHarness, AfSelectMenuComponent, AfSelectMenuHarness, AfSidebarComponent, AfSkeletonComponent, AfSkipLinkComponent, AfSliderComponent, AfSparklineComponent, AfSparklineHarness, AfSpinnerComponent, AfSwitchComponent, AfTabPanelComponent, AfTableBodyComponent, AfTableCellComponent, AfTableComponent, AfTableHeaderCellComponent, AfTableHeaderComponent, AfTableRowComponent, AfTabsComponent, AfTextareaComponent, AfToastContainerComponent, AfToastService, AfToggleGroupComponent, AfToolbarComponent, AfTooltipDirective, AfTreeComponent, AfTreeHarness, AfTreeNodeHarness };
4442
- export type { AfAccordionI18n, AfAlertI18n, AfAlertVariant, AfAvatarSize, AfAvatarStatus, AfBadgeVariant, AfBannerAppearance, AfBannerPosition, AfBannerVariant, AfBarLayout, AfBreadcrumb, AfButtonSize, AfButtonType, AfButtonVariant, AfCardElevation, AfCardPadding, AfChartDatum, AfChartI18n, AfChartSeries, AfChartStatus, AfChartTableModel, AfChipAppearance, AfChipSize, AfChipVariant, AfColumn, AfComboboxOption, AfDataRow, AfDataTableConfig, AfDateRange, AfDatepickerMode, AfDatepickerValueFormat, AfDatepickerView, AfDividerColor, AfDividerOrientation, AfDividerSpacing, AfDrawerPosition, AfDrawerSize, AfDropdownItem, AfEmptyStateSize, AfEmptyStateVariant, AfFileEntry, AfFileValidationError, AfGaugeThreshold, AfIconSize, AfInputI18n, AfInputType, AfNavTab, AfNavTabsSize, AfNavTabsVariant, AfNavbarSize, AfNavbarVariant, AfPopoverAlign, AfPopoverPosition, AfPopoverSize, AfProgressBarSize, AfProgressBarVariant, AfSelectI18n, AfSelectMenuI18n, AfSelectMenuOption, AfSelectOption, AfShellPanelState, AfShellSidebarState, AfSidebarMode, AfSkeletonVariant, AfSliderSize, AfSortDirection, AfSortState, AfSpinnerSize, AfTab, AfTableCellType, AfTableVariant, AfToast, AfToastVariant, AfToggleGroupSize, AfToggleItem, AfTooltipPosition, AfTreeI18n, TreeNode, TreeNodeTemplateContext, TreeSelectionMode, TreeToggleEvent };
4634
+ export { AF_ACCORDION_I18N, AF_ALERT_I18N, AF_CHART_I18N, AF_CHART_PALETTE_SIZE, AF_INPUT_I18N, AF_SELECT_I18N, AF_SELECT_MENU_I18N, AF_TREE_I18N, AVATAR_SEED_PALETTE_SIZE, AfAccordionComponent, AfAccordionHarness, AfAccordionItemComponent, AfAccordionItemHarness, AfAlertComponent, AfAlertHarness, AfAppShellComponent, AfAppShellPageHeaderComponent, AfAppShellV2Component, AfAppShellV2ToolbarComponent, AfAutocompleteComponent, AfAutocompleteOptionDirective, AfAvatarComponent, AfBadgeComponent, AfBadgeHarness, AfBannerComponent, AfBarChartComponent, AfBarChartHarness, AfBreadcrumbsComponent, AfButtonComponent, AfButtonHarness, AfCardComponent, AfCellDefDirective, AfChartDataTableComponent, AfCheckboxComponent, AfChipComponent, AfChipInputComponent, AfComboboxComponent, AfDataTableComponent, AfDatepickerComponent, AfDividerComponent, AfDonutChartComponent, AfDonutChartHarness, AfDrawerComponent, AfDropdownComponent, AfEmptyStateComponent, AfFieldComponent, AfFileUploadComponent, AfFormatLabelPipe, AfGaugeComponent, AfGaugeHarness, AfIconComponent, AfInputComponent, AfInputHarness, AfLineChartComponent, AfLineChartHarness, AfModalComponent, AfNavItemComponent, AfNavTabsComponent, AfNavbarComponent, AfPaginationComponent, AfPopoverComponent, AfPopoverTriggerDirective, AfProgressBarComponent, AfRadioComponent, AfRadioGroupComponent, AfSelectComponent, AfSelectHarness, AfSelectMenuComponent, AfSelectMenuHarness, AfSidebarComponent, AfSkeletonComponent, AfSkipLinkComponent, AfSliderComponent, AfSparklineComponent, AfSparklineHarness, AfSpinnerComponent, AfSwitchComponent, AfTabPanelComponent, AfTableBodyComponent, AfTableCellComponent, AfTableComponent, AfTableHeaderCellComponent, AfTableHeaderComponent, AfTableRowComponent, AfTabsComponent, AfTextareaComponent, AfToastContainerComponent, AfToastService, AfToggleGroupComponent, AfToolbarComponent, AfTooltipDirective, AfTreeComponent, AfTreeHarness, AfTreeNodeHarness };
4635
+ export type { AfAccordionI18n, AfAlertI18n, AfAlertVariant, AfAutocompleteOption, AfAutocompleteOptionContext, AfAvatarSize, AfAvatarStatus, AfBadgeVariant, AfBannerAppearance, AfBannerPosition, AfBannerVariant, AfBarLayout, AfBreadcrumb, AfButtonSize, AfButtonType, AfButtonVariant, AfCardElevation, AfCardPadding, AfChartDatum, AfChartI18n, AfChartSeries, AfChartStatus, AfChartTableModel, AfChipAppearance, AfChipSize, AfChipVariant, AfColumn, AfComboboxOption, AfDataRow, AfDataTableConfig, AfDateRange, AfDatepickerMode, AfDatepickerValueFormat, AfDatepickerView, AfDividerColor, AfDividerOrientation, AfDividerSpacing, AfDrawerPosition, AfDrawerSize, AfDropdownItem, AfEmptyStateSize, AfEmptyStateVariant, AfFileEntry, AfFileValidationError, AfGaugeThreshold, AfIconSize, AfInputI18n, AfInputType, AfNavTab, AfNavTabsSize, AfNavTabsVariant, AfNavbarSize, AfNavbarVariant, AfPopoverAlign, AfPopoverPosition, AfPopoverSize, AfProgressBarSize, AfProgressBarVariant, AfSelectI18n, AfSelectMenuI18n, AfSelectMenuOption, AfSelectOption, AfShellPanelState, AfShellSidebarState, AfSidebarMode, AfSkeletonVariant, AfSliderSize, AfSortDirection, AfSortState, AfSpinnerSize, AfTab, AfTableCellType, AfTableVariant, AfToast, AfToastVariant, AfToggleGroupSize, AfToggleItem, AfTooltipPosition, AfTreeI18n, TreeNode, TreeNodeTemplateContext, TreeSelectionMode, TreeToggleEvent };