@bitforgehq/ui 0.3.0 → 0.3.1
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/CHANGELOG.md +482 -0
- package/README.md +17 -11
- package/ai/MANIFEST.index.json +288 -0
- package/ai/MANIFEST.json +8716 -3926
- package/ai/REFERENCE.index.json +413 -0
- package/ai/REFERENCE.json +4710 -2047
- package/ai/UI_GUIDE.md +185 -57
- package/ai/components/back-button.md +42 -2
- package/ai/components/badge.md +17 -7
- package/ai/components/bar-chart.md +188 -0
- package/ai/components/breadcrumb-item.md +121 -0
- package/ai/components/breadcrumb.md +277 -0
- package/ai/components/button.md +82 -15
- package/ai/components/calendar.md +300 -0
- package/ai/components/card.md +63 -2
- package/ai/components/chart-card.md +283 -0
- package/ai/components/combobox.md +411 -0
- package/ai/components/date-input.md +396 -0
- package/ai/components/datetime-input.md +215 -0
- package/ai/components/description-item.md +111 -0
- package/ai/components/description-list.md +160 -0
- package/ai/components/donut-chart.md +169 -0
- package/ai/components/header.md +67 -2
- package/ai/components/icon-button.md +74 -16
- package/ai/components/icon.md +63 -7
- package/ai/components/line-chart.md +234 -0
- package/ai/components/list.md +70 -6
- package/ai/components/menu.md +5 -0
- package/ai/components/multi-combobox.md +257 -0
- package/ai/components/nav-group.md +178 -0
- package/ai/components/nav-item.md +210 -0
- package/ai/components/page-header.md +237 -0
- package/ai/components/pagination.md +173 -0
- package/ai/components/popover.md +250 -0
- package/ai/components/side-panel.md +391 -0
- package/ai/components/sidebar.md +363 -0
- package/ai/components/skeleton.md +215 -0
- package/ai/components/sparkline.md +188 -0
- package/ai/components/stat.md +233 -0
- package/ai/components/tab-group.md +226 -0
- package/ai/components/tab-panel.md +163 -0
- package/ai/components/table.md +568 -0
- package/ai/components/tabs.md +42 -2
- package/ai/components/theme-menu-button.md +182 -0
- package/ai/components/theme-switch.md +170 -0
- package/ai/components/time-input.md +240 -0
- package/ai/components/toolbar.md +289 -0
- package/ai/components/tooltip.md +230 -0
- package/ai/components/top-nav.md +159 -0
- package/ai/reference/bf-badge-appearance.md +36 -0
- package/ai/reference/bf-badge-variant.md +1 -1
- package/ai/reference/bf-bar-chart-orientation.md +27 -0
- package/ai/reference/bf-button-appearance.md +36 -0
- package/ai/reference/bf-button-variant.md +1 -1
- package/ai/reference/bf-calendar-disabled-date.md +23 -0
- package/ai/reference/bf-calendar-harness.md +51 -0
- package/ai/reference/bf-calendar-weekday.md +31 -0
- package/ai/reference/bf-chart-card-heading-level.md +26 -0
- package/ai/reference/bf-chart-curve.md +28 -0
- package/ai/reference/bf-chart-harness.md +51 -0
- package/ai/reference/bf-chart-legend-position.md +30 -0
- package/ai/reference/bf-chart-series.md +23 -0
- package/ai/reference/bf-chart-value-format.md +23 -0
- package/ai/reference/bf-color-scheme-service.md +30 -0
- package/ai/reference/bf-color-scheme.md +31 -0
- package/ai/reference/bf-combobox-filter.md +27 -0
- package/ai/reference/bf-combobox-harness.md +89 -0
- package/ai/reference/bf-combobox-option.md +33 -0
- package/ai/reference/bf-compare-with.md +2 -0
- package/ai/reference/bf-date-input-harness.md +67 -0
- package/ai/reference/bf-date-input-picker.md +27 -0
- package/ai/reference/bf-date-time-input-harness.md +76 -0
- package/ai/reference/bf-date-time-input-picker.md +27 -0
- package/ai/reference/bf-description-list-layout.md +26 -0
- package/ai/reference/bf-donut-slice.md +22 -0
- package/ai/reference/bf-labels.md +67 -20
- package/ai/reference/bf-menu-button-variant.md +1 -0
- package/ai/reference/bf-menu-placement.md +1 -0
- package/ai/reference/bf-overlay-options.md +28 -27
- package/ai/reference/bf-overlay-placement.md +34 -0
- package/ai/reference/bf-overlay-position.md +1 -1
- package/ai/reference/bf-overlay-service.md +5 -3
- package/ai/reference/bf-page-header-heading-level.md +26 -0
- package/ai/reference/bf-pagination-harness.md +61 -0
- package/ai/reference/bf-platform-service.md +17 -15
- package/ai/reference/bf-popover-harness.md +42 -0
- package/ai/reference/bf-popover-placement.md +28 -0
- package/ai/reference/bf-popover-trigger-directive.md +56 -0
- package/ai/reference/bf-side-panel-config.md +35 -0
- package/ai/reference/bf-side-panel-harness.md +34 -0
- package/ai/reference/bf-side-panel-ref.md +44 -0
- package/ai/reference/bf-side-panel-service.md +43 -0
- package/ai/reference/bf-side-panel-template-context.md +32 -0
- package/ai/reference/bf-side-panel-width.md +28 -0
- package/ai/reference/bf-size.md +12 -0
- package/ai/reference/bf-skeleton-shape.md +28 -0
- package/ai/reference/bf-stat-trend-intent.md +27 -0
- package/ai/reference/bf-stat-trend.md +27 -0
- package/ai/reference/bf-stat-variant.md +26 -0
- package/ai/reference/bf-tab-group-harness.md +44 -0
- package/ai/reference/bf-table-align.md +26 -0
- package/ai/reference/bf-table-cell-context.md +24 -0
- package/ai/reference/bf-table-cell-directive.md +22 -0
- package/ai/reference/bf-table-column.md +28 -0
- package/ai/reference/bf-table-harness.md +77 -0
- package/ai/reference/bf-table-row-key.md +21 -0
- package/ai/reference/bf-table-sort-direction.md +26 -0
- package/ai/reference/bf-table-sort.md +27 -0
- package/ai/reference/bf-theme.md +5 -4
- package/ai/reference/bf-time-input-harness.md +67 -0
- package/ai/reference/bf-time-input-hour-cycle.md +27 -0
- package/ai/reference/bf-time-input-picker.md +27 -0
- package/ai/reference/bf-tooltip-directive.md +43 -0
- package/ai/reference/bf-tooltip-harness.md +43 -0
- package/ai/reference/bf-tooltip-placement.md +28 -0
- package/ai/reference/bf_color_scheme_storage.md +20 -0
- package/ai/reference/bf_side_panel_data.md +17 -0
- package/ai/reference/bf_theme_storage.md +3 -1
- package/ai/reference/provide-bf-color-scheme.md +20 -0
- package/ai/reference/provide-bf-labels.md +12 -4
- package/ai/reference/slide-in-from-end.md +24 -0
- package/ai/reference/slide-out-to-end.md +24 -0
- package/fesm2022/bitforgehq-ui-charts.mjs +3045 -0
- package/fesm2022/bitforgehq-ui-charts.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui-icons.mjs +107 -3
- package/fesm2022/bitforgehq-ui-icons.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-mobile.mjs +14 -59
- package/fesm2022/bitforgehq-ui-mobile.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-overlay.mjs +6436 -33
- package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-testing.mjs +618 -1
- package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui.mjs +5092 -153
- package/fesm2022/bitforgehq-ui.mjs.map +1 -1
- package/llms-full.txt +25177 -14398
- package/llms.txt +95 -1
- package/package.json +7 -3
- package/theme.css +101 -0
- package/types/bitforgehq-ui-charts.d.ts +967 -0
- package/types/bitforgehq-ui-icons.d.ts +13 -1
- package/types/bitforgehq-ui-mobile.d.ts +25 -18
- package/types/bitforgehq-ui-overlay.d.ts +1844 -7
- package/types/bitforgehq-ui-testing.d.ts +748 -1
- package/types/bitforgehq-ui.d.ts +2136 -44
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EnvironmentProviders } from "@angular/core";
|
|
2
|
-
import { provideBfDefaults, provideBfLabels } from "@bitforgehq/ui";
|
|
2
|
+
import { BfTableSort, provideBfDefaults, provideBfLabels } from "@bitforgehq/ui";
|
|
3
3
|
import { BaseHarnessFilters, ComponentHarness, HarnessPredicate, LocatorFactory } from "@angular/cdk/testing";
|
|
4
4
|
/**
|
|
5
5
|
* Options of `installBfJsdomShims()`.
|
|
@@ -492,4 +492,751 @@ export declare class BfDesktopToastHarness extends ComponentHarness {
|
|
|
492
492
|
/** Presses `Escape` inside the toast, which dismisses it with `'dismiss'`. */
|
|
493
493
|
pressEscape(): Promise<void>;
|
|
494
494
|
}
|
|
495
|
+
/**
|
|
496
|
+
* Harness for `bf-table`. It works by column header text and row position, so a test never needs
|
|
497
|
+
* the column keys or the row keys (except `getSort()`, which returns the column's `key`, as the
|
|
498
|
+
* `sort` model holds it).
|
|
499
|
+
*
|
|
500
|
+
* @example
|
|
501
|
+
* const tasks = await loader.getHarness(BfTableHarness.with({ label: 'Tasks' }));
|
|
502
|
+
* await tasks.sortBy('Title');
|
|
503
|
+
* expect(await tasks.getCellText(0, 'Title')).toBe('Atlas rebrand');
|
|
504
|
+
* @summary Test harness for the data table: reads rows and cells, sorts and selects rows
|
|
505
|
+
* @since 0.3.1
|
|
506
|
+
*/
|
|
507
|
+
export declare class BfTableHarness extends ComponentHarness {
|
|
508
|
+
/** The host element's selector. */
|
|
509
|
+
static hostSelector: string;
|
|
510
|
+
private readonly caption;
|
|
511
|
+
private readonly headers;
|
|
512
|
+
private readonly rows;
|
|
513
|
+
private readonly selectAllBox;
|
|
514
|
+
private readonly rowBoxes;
|
|
515
|
+
/**
|
|
516
|
+
* A predicate for a table with the given label.
|
|
517
|
+
* @param filters The label (text or pattern) and the CDK's selector and ancestor filters.
|
|
518
|
+
* @returns The predicate for `getHarness()` and friends.
|
|
519
|
+
*/
|
|
520
|
+
static with(filters?: BfHarnessFilters): HarnessPredicate<BfTableHarness>;
|
|
521
|
+
/**
|
|
522
|
+
* The table's name, its visually hidden caption.
|
|
523
|
+
* @returns The label text, `''` without one.
|
|
524
|
+
*/
|
|
525
|
+
getLabel(): Promise<string>;
|
|
526
|
+
/**
|
|
527
|
+
* The number of body rows; `0` while the empty slot shows.
|
|
528
|
+
* @returns The row count.
|
|
529
|
+
*/
|
|
530
|
+
getRowCount(): Promise<number>;
|
|
531
|
+
/**
|
|
532
|
+
* The column headers' text, in order, without the selection column.
|
|
533
|
+
* @returns The header labels.
|
|
534
|
+
*/
|
|
535
|
+
getHeaderLabels(): Promise<string[]>;
|
|
536
|
+
/**
|
|
537
|
+
* The text of one cell.
|
|
538
|
+
* @param row The row's position, from 0.
|
|
539
|
+
* @param column The column's header text.
|
|
540
|
+
* @returns The cell's text.
|
|
541
|
+
*/
|
|
542
|
+
getCellText(row: number, column: string): Promise<string>;
|
|
543
|
+
/**
|
|
544
|
+
* Clicks a sortable column's header, as a user would: ascending first, then descending.
|
|
545
|
+
* Throws for an unknown or unsortable column.
|
|
546
|
+
* @param column The column's header text.
|
|
547
|
+
*/
|
|
548
|
+
sortBy(column: string): Promise<void>;
|
|
549
|
+
/**
|
|
550
|
+
* The sorted column (its `key`) and direction, from `aria-sort`.
|
|
551
|
+
* @returns The sort, `null` while no column is sorted.
|
|
552
|
+
*/
|
|
553
|
+
getSort(): Promise<BfTableSort | null>;
|
|
554
|
+
/**
|
|
555
|
+
* Checks one row's checkbox, as a user would; a selected row stays selected. Throws when the
|
|
556
|
+
* table is not selectable or the row does not exist.
|
|
557
|
+
* @param index The row's position, from 0.
|
|
558
|
+
*/
|
|
559
|
+
selectRow(index: number): Promise<void>;
|
|
560
|
+
/**
|
|
561
|
+
* Checks the header checkbox, as a user would, so every row is selected. Throws when the table
|
|
562
|
+
* is not selectable.
|
|
563
|
+
*/
|
|
564
|
+
selectAll(): Promise<void>;
|
|
565
|
+
/**
|
|
566
|
+
* The number of selected rows (checked row checkboxes).
|
|
567
|
+
* @returns The count.
|
|
568
|
+
*/
|
|
569
|
+
getSelectedCount(): Promise<number>;
|
|
570
|
+
private check;
|
|
571
|
+
private columnIndex;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Harness for `bf-pagination`. It reads the current page and the page count as numbers, so a test
|
|
575
|
+
* never parses the "Page 3 of 12" text, and clicks the buttons as a user would.
|
|
576
|
+
*
|
|
577
|
+
* @example
|
|
578
|
+
* const pages = await loader.getHarness(BfPaginationHarness.with({ label: 'Invoice pages' }));
|
|
579
|
+
* await pages.next();
|
|
580
|
+
* expect(await pages.getCurrentPage()).toBe(2);
|
|
581
|
+
* @summary Test harness for pagination: reads the current page and moves between pages
|
|
582
|
+
* @since 0.3.1
|
|
583
|
+
*/
|
|
584
|
+
export declare class BfPaginationHarness extends ComponentHarness {
|
|
585
|
+
/** The host element's selector. */
|
|
586
|
+
static hostSelector: string;
|
|
587
|
+
private readonly nav;
|
|
588
|
+
private readonly previousButton;
|
|
589
|
+
private readonly nextButton;
|
|
590
|
+
private readonly pages;
|
|
591
|
+
/**
|
|
592
|
+
* A predicate for a pagination with the given label.
|
|
593
|
+
* @param filters The label (text or pattern) and the CDK's selector and ancestor filters.
|
|
594
|
+
* @returns The predicate for `getHarness()` and friends.
|
|
595
|
+
*/
|
|
596
|
+
static with(filters?: BfHarnessFilters): HarnessPredicate<BfPaginationHarness>;
|
|
597
|
+
/**
|
|
598
|
+
* The navigation's accessible name (`label`, else "Pagination").
|
|
599
|
+
* @returns The label text.
|
|
600
|
+
*/
|
|
601
|
+
getLabel(): Promise<string>;
|
|
602
|
+
/**
|
|
603
|
+
* The page shown as current, 1-based.
|
|
604
|
+
* @returns The current page.
|
|
605
|
+
*/
|
|
606
|
+
getCurrentPage(): Promise<number>;
|
|
607
|
+
/**
|
|
608
|
+
* The number of pages in effect (`pageCount`, else `total` over `pageSize`, at least 1).
|
|
609
|
+
* @returns The page count.
|
|
610
|
+
*/
|
|
611
|
+
getPageCount(): Promise<number>;
|
|
612
|
+
/**
|
|
613
|
+
* The page numbers the row shows right now, in order, without the gaps; empty when compact.
|
|
614
|
+
* @returns The visible page numbers.
|
|
615
|
+
*/
|
|
616
|
+
getVisiblePages(): Promise<number[]>;
|
|
617
|
+
/**
|
|
618
|
+
* Clicks the button of this page, as a user would. Throws when the row does not show it (behind
|
|
619
|
+
* a gap, or in a compact pagination).
|
|
620
|
+
* @param page The 1-based page to go to.
|
|
621
|
+
*/
|
|
622
|
+
goTo(page: number): Promise<void>;
|
|
623
|
+
/** Clicks Next. Throws on the last page, where the button is disabled. */
|
|
624
|
+
next(): Promise<void>;
|
|
625
|
+
/** Clicks Previous. Throws on the first page, where the button is disabled. */
|
|
626
|
+
previous(): Promise<void>;
|
|
627
|
+
/**
|
|
628
|
+
* Whether Previous is disabled (on the first page).
|
|
629
|
+
* @returns True on the first page.
|
|
630
|
+
*/
|
|
631
|
+
isPreviousDisabled(): Promise<boolean>;
|
|
632
|
+
/**
|
|
633
|
+
* Whether Next is disabled (on the last page).
|
|
634
|
+
* @returns True on the last page.
|
|
635
|
+
*/
|
|
636
|
+
isNextDisabled(): Promise<boolean>;
|
|
637
|
+
/** Clicks an arrow button, unless it is disabled. */
|
|
638
|
+
private press;
|
|
639
|
+
}
|
|
640
|
+
/**
|
|
641
|
+
* Harness for `bf-tab-group`. It works by tab label, so a test never needs the panel values.
|
|
642
|
+
*
|
|
643
|
+
* @example
|
|
644
|
+
* const tabs = await loader.getHarness(BfTabGroupHarness.with({ label: 'Project' }));
|
|
645
|
+
* await tabs.selectTab('Activity');
|
|
646
|
+
* expect(await tabs.getPanelText()).toContain('No activity yet');
|
|
647
|
+
* @summary Test harness for the tab group: reads its tabs and panel and selects a tab
|
|
648
|
+
* @since 0.3.1
|
|
649
|
+
*/
|
|
650
|
+
export declare class BfTabGroupHarness extends ComponentHarness {
|
|
651
|
+
/** The host element's selector. */
|
|
652
|
+
static hostSelector: string;
|
|
653
|
+
private readonly list;
|
|
654
|
+
private readonly tabs;
|
|
655
|
+
private readonly tabLabels;
|
|
656
|
+
private readonly panel;
|
|
657
|
+
/**
|
|
658
|
+
* A predicate for a tab group with the given label.
|
|
659
|
+
* @param filters The label (text or pattern) and the CDK's selector and ancestor filters.
|
|
660
|
+
* @returns The predicate for `getHarness()` and friends.
|
|
661
|
+
*/
|
|
662
|
+
static with(filters?: BfHarnessFilters): HarnessPredicate<BfTabGroupHarness>;
|
|
663
|
+
/**
|
|
664
|
+
* The tablist's accessible name (`label`, else the `tabGroup` label).
|
|
665
|
+
* @returns The label text.
|
|
666
|
+
*/
|
|
667
|
+
getLabel(): Promise<string>;
|
|
668
|
+
/**
|
|
669
|
+
* The tabs' labels, in order (without their badges).
|
|
670
|
+
* @returns The tab labels.
|
|
671
|
+
*/
|
|
672
|
+
getTabLabels(): Promise<string[]>;
|
|
673
|
+
/**
|
|
674
|
+
* The selected tab's label, `null` when the group has no tabs.
|
|
675
|
+
* @returns The label text or `null`.
|
|
676
|
+
*/
|
|
677
|
+
getSelectedLabel(): Promise<string | null>;
|
|
678
|
+
/**
|
|
679
|
+
* Clicks the tab with this label, as a user would. Throws for an unknown label, and for a
|
|
680
|
+
* disabled tab (a user's click would do nothing).
|
|
681
|
+
* @param label The tab's label.
|
|
682
|
+
*/
|
|
683
|
+
selectTab(label: string): Promise<void>;
|
|
684
|
+
/**
|
|
685
|
+
* The text of the panel shown.
|
|
686
|
+
* @returns The panel's text, `''` when no panel shows.
|
|
687
|
+
*/
|
|
688
|
+
getPanelText(): Promise<string>;
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Harness for `bf-side-panel`, the panel `BfSidePanelService` opens. Side panels render in the
|
|
692
|
+
* CDK overlay container outside the tested component, so get it through
|
|
693
|
+
* `TestbedHarnessEnvironment.documentRootLoader(fixture)`.
|
|
694
|
+
*
|
|
695
|
+
* @example
|
|
696
|
+
* const panel = await TestbedHarnessEnvironment.documentRootLoader(fixture).getHarness(
|
|
697
|
+
* BfSidePanelHarness.with({ label: 'INV-204' }),
|
|
698
|
+
* );
|
|
699
|
+
* await panel.close();
|
|
700
|
+
* expect(await panel.isOpen()).toBe(false);
|
|
701
|
+
* @summary Test harness for a side panel: its title, its close button and its state
|
|
702
|
+
* @since 0.3.1
|
|
703
|
+
*/
|
|
704
|
+
export declare class BfSidePanelHarness extends ComponentHarness {
|
|
705
|
+
/** The host element's selector. */
|
|
706
|
+
static hostSelector: string;
|
|
707
|
+
private readonly title;
|
|
708
|
+
private readonly closeButton;
|
|
709
|
+
/**
|
|
710
|
+
* A predicate for a side panel with the given title.
|
|
711
|
+
* @param filters The title (text or pattern) and the CDK's selector and ancestor filters.
|
|
712
|
+
* @returns The predicate for `getHarness()` and friends.
|
|
713
|
+
*/
|
|
714
|
+
static with(filters?: BfHarnessFilters): HarnessPredicate<BfSidePanelHarness>;
|
|
715
|
+
/**
|
|
716
|
+
* The title heading.
|
|
717
|
+
* @returns The title, `''` without one.
|
|
718
|
+
*/
|
|
719
|
+
getTitle(): Promise<string>;
|
|
720
|
+
/** Clicks the close button (×), which closes the side panel with no result. */
|
|
721
|
+
close(): Promise<void>;
|
|
722
|
+
/**
|
|
723
|
+
* Whether the side panel is open: its overlay pane is in the page and not sliding out. The pane
|
|
724
|
+
* is found by the panel's own `data-bf-side-panel-id`.
|
|
725
|
+
* @returns True while the panel is open, false once closing or closed, or outside the service.
|
|
726
|
+
*/
|
|
727
|
+
isOpen(): Promise<boolean>;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Harness for `bf-calendar`. It works with ISO dates ('YYYY-MM-DD'), as the calendar's value
|
|
731
|
+
* does, and drives it as a user would: `selectDate()` jumps to another month through the month
|
|
732
|
+
* and year views, then clicks the day.
|
|
733
|
+
*
|
|
734
|
+
* @example
|
|
735
|
+
* const due = await loader.getHarness(BfCalendarHarness.with({ label: 'Due date' }));
|
|
736
|
+
* await due.selectDate('2026-11-03');
|
|
737
|
+
* expect(await due.getSelected()).toBe('2026-11-03');
|
|
738
|
+
* @summary Test harness for the calendar: reads the month and picks a date by ISO string
|
|
739
|
+
* @since 0.3.1
|
|
740
|
+
*/
|
|
741
|
+
export declare class BfCalendarHarness extends ComponentHarness {
|
|
742
|
+
/** The host element's selector. */
|
|
743
|
+
static hostSelector: string;
|
|
744
|
+
private readonly group;
|
|
745
|
+
private readonly liveTitle;
|
|
746
|
+
private readonly titleButton;
|
|
747
|
+
private readonly previousButton;
|
|
748
|
+
private readonly nextButton;
|
|
749
|
+
private readonly selectedDay;
|
|
750
|
+
private readonly dayGrid;
|
|
751
|
+
/**
|
|
752
|
+
* A predicate for a calendar with the given label.
|
|
753
|
+
* @param filters The label (text or pattern) and the CDK's selector and ancestor filters.
|
|
754
|
+
* @returns The predicate for `getHarness()` and friends.
|
|
755
|
+
*/
|
|
756
|
+
static with(filters?: BfHarnessFilters): HarnessPredicate<BfCalendarHarness>;
|
|
757
|
+
/**
|
|
758
|
+
* The calendar's accessible name (`label`, else `ariaLabel`); it is not rendered visibly.
|
|
759
|
+
* @returns The label text, `''` without one.
|
|
760
|
+
*/
|
|
761
|
+
getLabel(): Promise<string>;
|
|
762
|
+
/**
|
|
763
|
+
* The shown month and year as the header writes them, in the calendar's locale.
|
|
764
|
+
* @returns The month label, such as "October 2026".
|
|
765
|
+
*/
|
|
766
|
+
getMonthLabel(): Promise<string>;
|
|
767
|
+
/**
|
|
768
|
+
* The picked date while it is in the shown month.
|
|
769
|
+
* @returns The ISO date, or `null` when none is picked or it is in another month.
|
|
770
|
+
*/
|
|
771
|
+
getSelected(): Promise<string | null>;
|
|
772
|
+
/** Clicks the next-month button. Throws when it is disabled (the month is past `max`). */
|
|
773
|
+
nextMonth(): Promise<void>;
|
|
774
|
+
/** Clicks the previous-month button. Throws when it is disabled (the month is before `min`). */
|
|
775
|
+
previousMonth(): Promise<void>;
|
|
776
|
+
/**
|
|
777
|
+
* Picks a date as a user would: when it is in another month, opens the month view, then the
|
|
778
|
+
* year view, clicks its year and month, then clicks the day. Throws for an invalid date, one
|
|
779
|
+
* the views do not list, and a disabled date or calendar.
|
|
780
|
+
* @param iso The ISO date to pick, such as '2026-11-03'.
|
|
781
|
+
*/
|
|
782
|
+
selectDate(iso: string): Promise<void>;
|
|
783
|
+
private jumpTo;
|
|
784
|
+
private clickNav;
|
|
785
|
+
}
|
|
786
|
+
/** The elements that take keyboard focus, as the overlay core counts them. Internal. */
|
|
787
|
+
declare const FOCUSABLE: string;
|
|
788
|
+
/**
|
|
789
|
+
* Harness for an element with a `[bfTooltip]`. The tooltip renders in the CDK overlay container
|
|
790
|
+
* only while it shows, so `show()` focuses the element (the tooltip shows at once on keyboard
|
|
791
|
+
* focus; a 500 ms hover would need real time) and `getText()` reads the `bf-tooltip` its control
|
|
792
|
+
* is described by. Its `label` filter matches the element's accessible name (`aria-label`, else
|
|
793
|
+
* its text). Under a coarse pointer no tooltip shows.
|
|
794
|
+
*
|
|
795
|
+
* @example
|
|
796
|
+
* const copy = await loader.getHarness(BfTooltipHarness.with({ label: 'Copy link' }));
|
|
797
|
+
* expect(await copy.getText()).toBe('Copy link');
|
|
798
|
+
* @summary Test harness for a tooltip: shows it, reads its text and whether it shows
|
|
799
|
+
* @since 0.3.1
|
|
800
|
+
*/
|
|
801
|
+
export declare class BfTooltipHarness extends ComponentHarness {
|
|
802
|
+
/** The host element's selector: the attribute the tooltip directive puts on its host. */
|
|
803
|
+
static hostSelector: string;
|
|
804
|
+
private readonly inner;
|
|
805
|
+
/**
|
|
806
|
+
* A predicate for an element with a tooltip and the given accessible name.
|
|
807
|
+
* @param filters The name (text or pattern) and the CDK's selector and ancestor filters.
|
|
808
|
+
* @returns The predicate for `getHarness()` and friends.
|
|
809
|
+
*/
|
|
810
|
+
static with(filters?: BfHarnessFilters): HarnessPredicate<BfTooltipHarness>;
|
|
811
|
+
/**
|
|
812
|
+
* The element's accessible name: its control's `aria-label`, else its text.
|
|
813
|
+
* @returns The name.
|
|
814
|
+
*/
|
|
815
|
+
getLabel(): Promise<string>;
|
|
816
|
+
/** Shows the tooltip by focusing the element (or the first control inside it). */
|
|
817
|
+
show(): Promise<void>;
|
|
818
|
+
/** Hides the tooltip by moving focus off the element. */
|
|
819
|
+
hide(): Promise<void>;
|
|
820
|
+
/**
|
|
821
|
+
* Whether the tooltip shows.
|
|
822
|
+
* @returns True while it shows.
|
|
823
|
+
*/
|
|
824
|
+
isOpen(): Promise<boolean>;
|
|
825
|
+
/**
|
|
826
|
+
* The tooltip's text, showing it first when it is hidden.
|
|
827
|
+
* @returns The text; throws when no tooltip shows (an empty text or a coarse pointer).
|
|
828
|
+
*/
|
|
829
|
+
getText(): Promise<string>;
|
|
830
|
+
/** The element the tooltip describes: the host when it takes focus, else its first control. */
|
|
831
|
+
private control;
|
|
832
|
+
/** The shown `bf-tooltip` among the ids the control is described by, or `null`. */
|
|
833
|
+
private tooltip;
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Harness for an element with a `[bfPopoverTriggerFor]` and the `bf-popover` it opens, which
|
|
837
|
+
* renders in the CDK overlay container while open (found through the trigger's
|
|
838
|
+
* `aria-controls`). Its `label` filter matches the trigger's accessible name (`aria-label`, else
|
|
839
|
+
* its text).
|
|
840
|
+
*
|
|
841
|
+
* @example
|
|
842
|
+
* const filters = await loader.getHarness(BfPopoverHarness.with({ label: 'Filters' }));
|
|
843
|
+
* await filters.open();
|
|
844
|
+
* expect(await filters.getPanelText()).toContain('Status');
|
|
845
|
+
* @summary Test harness for a popover: opens and closes it and reads its panel
|
|
846
|
+
* @since 0.3.1
|
|
847
|
+
*/
|
|
848
|
+
export declare class BfPopoverHarness extends ComponentHarness {
|
|
849
|
+
/** The host element's selector: the attribute the popover trigger directive puts on its host. */
|
|
850
|
+
static hostSelector: string;
|
|
851
|
+
private readonly inner;
|
|
852
|
+
/**
|
|
853
|
+
* A predicate for a popover trigger with the given accessible name.
|
|
854
|
+
* @param filters The name (text or pattern) and the CDK's selector and ancestor filters.
|
|
855
|
+
* @returns The predicate for `getHarness()` and friends.
|
|
856
|
+
*/
|
|
857
|
+
static with(filters?: BfHarnessFilters): HarnessPredicate<BfPopoverHarness>;
|
|
858
|
+
/**
|
|
859
|
+
* The trigger's accessible name: its control's `aria-label`, else its text.
|
|
860
|
+
* @returns The name.
|
|
861
|
+
*/
|
|
862
|
+
getLabel(): Promise<string>;
|
|
863
|
+
/** Opens the popover with a click; does nothing while it is open. */
|
|
864
|
+
open(): Promise<void>;
|
|
865
|
+
/** Closes the popover with `Escape`, as a user would; does nothing while it is closed. */
|
|
866
|
+
close(): Promise<void>;
|
|
867
|
+
/**
|
|
868
|
+
* Whether the popover is open (`aria-expanded`).
|
|
869
|
+
* @returns True while open.
|
|
870
|
+
*/
|
|
871
|
+
isOpen(): Promise<boolean>;
|
|
872
|
+
/**
|
|
873
|
+
* The open panel's text, opening it first when it is closed.
|
|
874
|
+
* @returns The text; throws when the panel cannot open (a disabled trigger).
|
|
875
|
+
*/
|
|
876
|
+
getPanelText(): Promise<string>;
|
|
877
|
+
/** The element that carries the ARIA state: the host, or its first control. */
|
|
878
|
+
private control;
|
|
879
|
+
/** The open panel, or `null`. */
|
|
880
|
+
private panel;
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Harness for `bf-combobox` and `bf-multi-combobox`. Its option list renders in the CDK overlay
|
|
884
|
+
* container while open (found through the input's `aria-controls`); it works by option label, so a
|
|
885
|
+
* test never needs the option values. Its `label` filter matches the visible label, else the
|
|
886
|
+
* `aria-label`.
|
|
887
|
+
*
|
|
888
|
+
* @example
|
|
889
|
+
* const assignee = await loader.getHarness(BfComboboxHarness.with({ label: 'Assignee' }));
|
|
890
|
+
* await assignee.type('gra');
|
|
891
|
+
* await assignee.selectOption('Grace Hopper');
|
|
892
|
+
* expect(await assignee.getValueText()).toBe('Grace Hopper');
|
|
893
|
+
* @summary Test harness for the comboboxes: types, reads and picks options and tags
|
|
894
|
+
* @since 0.3.1
|
|
895
|
+
*/
|
|
896
|
+
export declare class BfComboboxHarness extends ComponentHarness {
|
|
897
|
+
/** The host element's selector: either combobox. */
|
|
898
|
+
static hostSelector: string;
|
|
899
|
+
private readonly input;
|
|
900
|
+
private readonly label;
|
|
901
|
+
private readonly chips;
|
|
902
|
+
private readonly removeButtons;
|
|
903
|
+
/**
|
|
904
|
+
* A predicate for a combobox with the given label.
|
|
905
|
+
* @param filters The label (text or pattern) and the CDK's selector and ancestor filters.
|
|
906
|
+
* @returns The predicate for `getHarness()` and friends.
|
|
907
|
+
*/
|
|
908
|
+
static with(filters?: BfHarnessFilters): HarnessPredicate<BfComboboxHarness>;
|
|
909
|
+
/**
|
|
910
|
+
* The visible label without the required mark, else the `aria-label`.
|
|
911
|
+
* @returns The label text.
|
|
912
|
+
*/
|
|
913
|
+
getLabel(): Promise<string>;
|
|
914
|
+
/** Opens the option list with a click into the field; does nothing while it is open. */
|
|
915
|
+
open(): Promise<void>;
|
|
916
|
+
/** Closes the option list with `Escape`, as a user would; does nothing while it is closed. */
|
|
917
|
+
close(): Promise<void>;
|
|
918
|
+
/**
|
|
919
|
+
* Whether the option list is open (`aria-expanded`).
|
|
920
|
+
* @returns True while open.
|
|
921
|
+
*/
|
|
922
|
+
isOpen(): Promise<boolean>;
|
|
923
|
+
/**
|
|
924
|
+
* Replaces the field's text with `query`, key by key as a user types; the list opens filtered.
|
|
925
|
+
* @param query The text to type.
|
|
926
|
+
*/
|
|
927
|
+
type(query: string): Promise<void>;
|
|
928
|
+
/**
|
|
929
|
+
* The labels of the listed options, in order, opening the list first when it is closed.
|
|
930
|
+
* @returns The option labels; empty when nothing matches.
|
|
931
|
+
*/
|
|
932
|
+
getOptionLabels(): Promise<string[]>;
|
|
933
|
+
/**
|
|
934
|
+
* Picks the listed option with this label with a click, opening the list first when it is
|
|
935
|
+
* closed. Throws for an unknown or disabled option.
|
|
936
|
+
* @param label The option's label.
|
|
937
|
+
*/
|
|
938
|
+
selectOption(label: string): Promise<void>;
|
|
939
|
+
/**
|
|
940
|
+
* The field's text: the picked option's label on a `bf-combobox` (or the text being typed), the
|
|
941
|
+
* typed text on a `bf-multi-combobox` (its picks are tags, see `getChipLabels()`).
|
|
942
|
+
* @returns The input's value.
|
|
943
|
+
*/
|
|
944
|
+
getValueText(): Promise<string>;
|
|
945
|
+
/**
|
|
946
|
+
* The labels of a `bf-multi-combobox`'s tags, in order; empty for a `bf-combobox`.
|
|
947
|
+
* @returns The tag labels.
|
|
948
|
+
*/
|
|
949
|
+
getChipLabels(): Promise<string[]>;
|
|
950
|
+
/**
|
|
951
|
+
* Removes the tag with this label with its remove button. Throws for an unknown tag or one
|
|
952
|
+
* without a remove button (a disabled or read-only field).
|
|
953
|
+
* @param label The tag's label.
|
|
954
|
+
*/
|
|
955
|
+
removeChip(label: string): Promise<void>;
|
|
956
|
+
/**
|
|
957
|
+
* Whether the field is disabled.
|
|
958
|
+
* @returns True when disabled.
|
|
959
|
+
*/
|
|
960
|
+
isDisabled(): Promise<boolean>;
|
|
961
|
+
/** Focuses the input. */
|
|
962
|
+
focus(): Promise<void>;
|
|
963
|
+
/** Blurs the input, which closes the list and marks a bound form field touched. */
|
|
964
|
+
blur(): Promise<void>;
|
|
965
|
+
/** The text of a tag's label. */
|
|
966
|
+
private chipLabel;
|
|
967
|
+
/** The listed options and their label elements, from the listbox the input controls. */
|
|
968
|
+
private options;
|
|
969
|
+
}
|
|
970
|
+
/**
|
|
971
|
+
* Harness for `bf-date-input`. It reads and types the field as a user sees it (in its locale's
|
|
972
|
+
* order) and picks a date through the calendar popover with `BfCalendarHarness`.
|
|
973
|
+
*
|
|
974
|
+
* @example
|
|
975
|
+
* const due = await loader.getHarness(BfDateInputHarness.with({ label: 'Due date' }));
|
|
976
|
+
* await due.setValue('14/10/2026');
|
|
977
|
+
* await due.pickDate('2026-11-03');
|
|
978
|
+
* expect(await due.getValue()).toBe('03/11/2026');
|
|
979
|
+
* @summary Test harness for the date input: types a date or picks one in its calendar
|
|
980
|
+
* @since 0.3.1
|
|
981
|
+
*/
|
|
982
|
+
export declare class BfDateInputHarness extends ComponentHarness {
|
|
983
|
+
/** The host element's selector. */
|
|
984
|
+
static hostSelector: string;
|
|
985
|
+
private readonly group;
|
|
986
|
+
private readonly nativeInput;
|
|
987
|
+
private readonly segments;
|
|
988
|
+
private readonly label;
|
|
989
|
+
private readonly trigger;
|
|
990
|
+
/**
|
|
991
|
+
* A predicate for a date input with the given label.
|
|
992
|
+
* @param filters The label (text or pattern) and the CDK's selector and ancestor filters.
|
|
993
|
+
* @returns The predicate for `getHarness()` and friends.
|
|
994
|
+
*/
|
|
995
|
+
static with(filters?: BfHarnessFilters): HarnessPredicate<BfDateInputHarness>;
|
|
996
|
+
/**
|
|
997
|
+
* The visible label without the required mark, else the field's `aria-label`.
|
|
998
|
+
* @returns The label text.
|
|
999
|
+
*/
|
|
1000
|
+
getLabel(): Promise<string>;
|
|
1001
|
+
/**
|
|
1002
|
+
* The field's text as the locale shows it ("14/10/2026"); the ISO value in native mode.
|
|
1003
|
+
* @returns The text, `''` while every part is empty.
|
|
1004
|
+
*/
|
|
1005
|
+
getValue(): Promise<string>;
|
|
1006
|
+
/**
|
|
1007
|
+
* Types a date as a user would: clears the field, then types each run of digits (or letters)
|
|
1008
|
+
* into the next part in the field's order, such as "14/10/2026" in an en-GB field. In native mode it sets the
|
|
1009
|
+
* platform input to the ISO value.
|
|
1010
|
+
* @param text The date as the field shows it.
|
|
1011
|
+
*/
|
|
1012
|
+
setValue(text: string): Promise<void>;
|
|
1013
|
+
/** Clears every part with `Backspace`, as a user would. */
|
|
1014
|
+
clear(): Promise<void>;
|
|
1015
|
+
/**
|
|
1016
|
+
* Whether the field shows its error state (`aria-invalid` on its parts or native input).
|
|
1017
|
+
* @returns True while invalid.
|
|
1018
|
+
*/
|
|
1019
|
+
isInvalid(): Promise<boolean>;
|
|
1020
|
+
/**
|
|
1021
|
+
* Whether the field is disabled.
|
|
1022
|
+
* @returns True while disabled.
|
|
1023
|
+
*/
|
|
1024
|
+
isDisabled(): Promise<boolean>;
|
|
1025
|
+
/** Opens the calendar popover with a click on its button; throws when the field has none or it is disabled. */
|
|
1026
|
+
openPicker(): Promise<void>;
|
|
1027
|
+
/**
|
|
1028
|
+
* Whether the calendar popover is open (`aria-expanded` on its button).
|
|
1029
|
+
* @returns True while open.
|
|
1030
|
+
*/
|
|
1031
|
+
isPickerOpen(): Promise<boolean>;
|
|
1032
|
+
/**
|
|
1033
|
+
* Picks a date in the calendar as a user would: opens the popover (when closed), then picks the
|
|
1034
|
+
* day through the calendar's harness, which closes it.
|
|
1035
|
+
* @param iso The ISO date to pick, such as '2026-11-03'.
|
|
1036
|
+
*/
|
|
1037
|
+
pickDate(iso: string): Promise<void>;
|
|
1038
|
+
private elements;
|
|
1039
|
+
}
|
|
1040
|
+
/**
|
|
1041
|
+
* Harness for `bf-time-input`. It reads and types the field as a user sees it and picks a time
|
|
1042
|
+
* from the popover list.
|
|
1043
|
+
*
|
|
1044
|
+
* @example
|
|
1045
|
+
* const start = await loader.getHarness(BfTimeInputHarness.with({ label: 'Start' }));
|
|
1046
|
+
* await start.setValue('09:30');
|
|
1047
|
+
* await start.pickTime('14:00');
|
|
1048
|
+
* expect(await start.getValue()).toBe('14:00');
|
|
1049
|
+
* @summary Test harness for the time input: types a time or picks one from its list
|
|
1050
|
+
* @since 0.3.1
|
|
1051
|
+
*/
|
|
1052
|
+
export declare class BfTimeInputHarness extends ComponentHarness {
|
|
1053
|
+
/** The host element's selector. */
|
|
1054
|
+
static hostSelector: string;
|
|
1055
|
+
private readonly group;
|
|
1056
|
+
private readonly nativeInput;
|
|
1057
|
+
private readonly segments;
|
|
1058
|
+
private readonly label;
|
|
1059
|
+
private readonly trigger;
|
|
1060
|
+
/**
|
|
1061
|
+
* A predicate for a time input with the given label.
|
|
1062
|
+
* @param filters The label (text or pattern) and the CDK's selector and ancestor filters.
|
|
1063
|
+
* @returns The predicate for `getHarness()` and friends.
|
|
1064
|
+
*/
|
|
1065
|
+
static with(filters?: BfHarnessFilters): HarnessPredicate<BfTimeInputHarness>;
|
|
1066
|
+
/**
|
|
1067
|
+
* The visible label without the required mark, else the field's `aria-label`.
|
|
1068
|
+
* @returns The label text.
|
|
1069
|
+
*/
|
|
1070
|
+
getLabel(): Promise<string>;
|
|
1071
|
+
/**
|
|
1072
|
+
* The field's text as the locale shows it ("14:30" or "02:30 PM"); the ISO value in native mode.
|
|
1073
|
+
* @returns The text, `''` while every part is empty.
|
|
1074
|
+
*/
|
|
1075
|
+
getValue(): Promise<string>;
|
|
1076
|
+
/**
|
|
1077
|
+
* Types a time as a user would: clears the field, then types each run of digits (or letters)
|
|
1078
|
+
* into the next part in the field's order, such as "2:30 PM" in a 12-hour field. In native mode it sets the
|
|
1079
|
+
* platform input to the ISO value.
|
|
1080
|
+
* @param text The time as the field shows it.
|
|
1081
|
+
*/
|
|
1082
|
+
setValue(text: string): Promise<void>;
|
|
1083
|
+
/** Clears every part with `Backspace`, as a user would. */
|
|
1084
|
+
clear(): Promise<void>;
|
|
1085
|
+
/**
|
|
1086
|
+
* Whether the field shows its error state (`aria-invalid` on its parts or native input).
|
|
1087
|
+
* @returns True while invalid.
|
|
1088
|
+
*/
|
|
1089
|
+
isInvalid(): Promise<boolean>;
|
|
1090
|
+
/**
|
|
1091
|
+
* Whether the field is disabled.
|
|
1092
|
+
* @returns True while disabled.
|
|
1093
|
+
*/
|
|
1094
|
+
isDisabled(): Promise<boolean>;
|
|
1095
|
+
/** Opens the list of times with a click on its button; throws when the field has none or it is disabled. */
|
|
1096
|
+
openPicker(): Promise<void>;
|
|
1097
|
+
/**
|
|
1098
|
+
* Whether the list of times is open (`aria-expanded` on its button).
|
|
1099
|
+
* @returns True while open.
|
|
1100
|
+
*/
|
|
1101
|
+
isPickerOpen(): Promise<boolean>;
|
|
1102
|
+
/**
|
|
1103
|
+
* Picks a time in the list as a user would: opens the list (when closed), then clicks the
|
|
1104
|
+
* time, which closes it. Throws for a time the list does not hold (off the `step`) or disables.
|
|
1105
|
+
* @param time The ISO time to pick, such as '14:30'.
|
|
1106
|
+
*/
|
|
1107
|
+
pickTime(time: string): Promise<void>;
|
|
1108
|
+
private elements;
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* Harness for `bf-datetime-input`. It reads and types the field as a user sees it and picks the
|
|
1112
|
+
* date in the popover's calendar and the time in its list.
|
|
1113
|
+
*
|
|
1114
|
+
* @example
|
|
1115
|
+
* const meeting = await loader.getHarness(BfDateTimeInputHarness.with({ label: 'Meeting' }));
|
|
1116
|
+
* await meeting.pickDate('2026-10-14');
|
|
1117
|
+
* await meeting.pickTime('09:30');
|
|
1118
|
+
* expect(await meeting.getValue()).toBe('14/10/2026, 09:30');
|
|
1119
|
+
* @summary Test harness for the date and time input: types or picks a date and time
|
|
1120
|
+
* @since 0.3.1
|
|
1121
|
+
*/
|
|
1122
|
+
export declare class BfDateTimeInputHarness extends ComponentHarness {
|
|
1123
|
+
/** The host element's selector. */
|
|
1124
|
+
static hostSelector: string;
|
|
1125
|
+
private readonly group;
|
|
1126
|
+
private readonly nativeInput;
|
|
1127
|
+
private readonly segments;
|
|
1128
|
+
private readonly label;
|
|
1129
|
+
private readonly trigger;
|
|
1130
|
+
/**
|
|
1131
|
+
* A predicate for a date and time input with the given label.
|
|
1132
|
+
* @param filters The label (text or pattern) and the CDK's selector and ancestor filters.
|
|
1133
|
+
* @returns The predicate for `getHarness()` and friends.
|
|
1134
|
+
*/
|
|
1135
|
+
static with(filters?: BfHarnessFilters): HarnessPredicate<BfDateTimeInputHarness>;
|
|
1136
|
+
/**
|
|
1137
|
+
* The visible label without the required mark, else the field's `aria-label`.
|
|
1138
|
+
* @returns The label text.
|
|
1139
|
+
*/
|
|
1140
|
+
getLabel(): Promise<string>;
|
|
1141
|
+
/**
|
|
1142
|
+
* The field's text as the locale shows it ("14/10/2026, 09:30"); the ISO value in native mode.
|
|
1143
|
+
* @returns The text, `''` while every part is empty.
|
|
1144
|
+
*/
|
|
1145
|
+
getValue(): Promise<string>;
|
|
1146
|
+
/**
|
|
1147
|
+
* Types a date and time as a user would: clears the field, then types each run of digits (or letters)
|
|
1148
|
+
* into the next part in the field's order, such as "14/10/2026, 09:30" in an en-GB field. In native mode it sets the
|
|
1149
|
+
* platform input to the ISO value.
|
|
1150
|
+
* @param text The date and time as the field shows it.
|
|
1151
|
+
*/
|
|
1152
|
+
setValue(text: string): Promise<void>;
|
|
1153
|
+
/** Clears every part with `Backspace`, as a user would. */
|
|
1154
|
+
clear(): Promise<void>;
|
|
1155
|
+
/**
|
|
1156
|
+
* Whether the field shows its error state (`aria-invalid` on its parts or native input).
|
|
1157
|
+
* @returns True while invalid.
|
|
1158
|
+
*/
|
|
1159
|
+
isInvalid(): Promise<boolean>;
|
|
1160
|
+
/**
|
|
1161
|
+
* Whether the field is disabled.
|
|
1162
|
+
* @returns True while disabled.
|
|
1163
|
+
*/
|
|
1164
|
+
isDisabled(): Promise<boolean>;
|
|
1165
|
+
/** Opens the popover with a click on its button; throws when the field has none or it is disabled. */
|
|
1166
|
+
openPicker(): Promise<void>;
|
|
1167
|
+
/**
|
|
1168
|
+
* Whether the popover is open (`aria-expanded` on its button).
|
|
1169
|
+
* @returns True while open.
|
|
1170
|
+
*/
|
|
1171
|
+
isPickerOpen(): Promise<boolean>;
|
|
1172
|
+
/**
|
|
1173
|
+
* Picks a date in the calendar as a user would: opens the popover (when closed), then picks the
|
|
1174
|
+
* day through the calendar's harness. The popover stays open, with focus on its time list.
|
|
1175
|
+
* @param iso The ISO date to pick, such as '2026-11-03'.
|
|
1176
|
+
*/
|
|
1177
|
+
pickDate(iso: string): Promise<void>;
|
|
1178
|
+
/**
|
|
1179
|
+
* Picks a time in the list as a user would: opens the popover (when closed), then clicks the
|
|
1180
|
+
* time, which closes it. Throws for a time the list does not hold (off the `step`) or disables.
|
|
1181
|
+
* @param time The ISO time to pick, such as '14:30'.
|
|
1182
|
+
*/
|
|
1183
|
+
pickTime(time: string): Promise<void>;
|
|
1184
|
+
private elements;
|
|
1185
|
+
}
|
|
1186
|
+
/**
|
|
1187
|
+
* Harness for the `@bitforgehq/ui/charts` charts (`bf-line-chart`, `bf-bar-chart`,
|
|
1188
|
+
* `bf-donut-chart`). It works through what a user sees: the legend's series names, its toggle
|
|
1189
|
+
* buttons and the Show data table, so a test never reads the SVG.
|
|
1190
|
+
*
|
|
1191
|
+
* @example
|
|
1192
|
+
* const chart = await loader.getHarness(BfChartHarness.with({ label: 'Revenue' }));
|
|
1193
|
+
* await chart.toggleSeries('Store');
|
|
1194
|
+
* expect(await chart.showData()).toContainEqual(['Mar', '15', '11']);
|
|
1195
|
+
* @summary Test harness for the charts: reads the series, toggles one and reads the data table
|
|
1196
|
+
* @since 0.3.1
|
|
1197
|
+
*/
|
|
1198
|
+
export declare class BfChartHarness extends ComponentHarness {
|
|
1199
|
+
/** The host element's selector. */
|
|
1200
|
+
static hostSelector: string;
|
|
1201
|
+
private readonly figure;
|
|
1202
|
+
private readonly legendButtons;
|
|
1203
|
+
private readonly dataToggle;
|
|
1204
|
+
private readonly headCells;
|
|
1205
|
+
private readonly bodyCells;
|
|
1206
|
+
/**
|
|
1207
|
+
* A predicate for a chart with the given label.
|
|
1208
|
+
* @param filters The label (text or pattern) and the CDK's selector and ancestor filters.
|
|
1209
|
+
* @returns The predicate for `getHarness()` and friends.
|
|
1210
|
+
*/
|
|
1211
|
+
static with(filters?: BfHarnessFilters): HarnessPredicate<BfChartHarness>;
|
|
1212
|
+
/**
|
|
1213
|
+
* The figure's accessible name (`label`, else the chart card's title, else the `chart` label).
|
|
1214
|
+
* @returns The label text.
|
|
1215
|
+
*/
|
|
1216
|
+
getLabel(): Promise<string>;
|
|
1217
|
+
/**
|
|
1218
|
+
* The series (or slice) names in the legend, in order; empty for a chart of one series, which
|
|
1219
|
+
* draws no legend.
|
|
1220
|
+
* @returns The names.
|
|
1221
|
+
*/
|
|
1222
|
+
getSeriesNames(): Promise<string[]>;
|
|
1223
|
+
/**
|
|
1224
|
+
* Whether the legend shows the series (or slice) with this name.
|
|
1225
|
+
* @param name The series name.
|
|
1226
|
+
* @returns `true` while it is drawn.
|
|
1227
|
+
*/
|
|
1228
|
+
isSeriesShown(name: string): Promise<boolean>;
|
|
1229
|
+
/**
|
|
1230
|
+
* Clicks the legend button of the series (or slice) with this name, as a user would, to hide
|
|
1231
|
+
* or show it. Throws for an unknown name.
|
|
1232
|
+
* @param name The series name.
|
|
1233
|
+
*/
|
|
1234
|
+
toggleSeries(name: string): Promise<void>;
|
|
1235
|
+
/**
|
|
1236
|
+
* Opens the Show data table (if it is closed) and reads it.
|
|
1237
|
+
* @returns One array per category (or slice): its name, then its formatted values.
|
|
1238
|
+
*/
|
|
1239
|
+
showData(): Promise<string[][]>;
|
|
1240
|
+
private legendButton;
|
|
1241
|
+
}
|
|
495
1242
|
export type { BfHarnessFilters, BfJsdomShimOptions, BfTestingOptions };
|