@absoluteui/angular 0.0.0-stage → 0.13.2
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/LICENSE +201 -0
- package/NOTICE +5 -0
- package/README.md +196 -2
- package/SECURITY.md +102 -0
- package/dist/a11y/index.d.ts +85 -0
- package/dist/a11y/index.js +2 -0
- package/dist/accordion/index.d.ts +28 -0
- package/dist/accordion/index.js +2 -0
- package/dist/alert/index.d.ts +27 -0
- package/dist/alert/index.js +2 -0
- package/dist/avatar/index.d.ts +20 -0
- package/dist/avatar/index.js +2 -0
- package/dist/avatar-group/index.d.ts +18 -0
- package/dist/avatar-group/index.js +2 -0
- package/dist/badge/index.d.ts +18 -0
- package/dist/badge/index.js +2 -0
- package/dist/bar-chart/index.d.ts +45 -0
- package/dist/bar-chart/index.js +2 -0
- package/dist/bottom-sheet/index.d.ts +35 -0
- package/dist/bottom-sheet/index.js +2 -0
- package/dist/box-plot/index.d.ts +40 -0
- package/dist/box-plot/index.js +2 -0
- package/dist/breadcrumb/index.d.ts +22 -0
- package/dist/breadcrumb/index.js +2 -0
- package/dist/bullet-chart/index.d.ts +37 -0
- package/dist/bullet-chart/index.js +2 -0
- package/dist/business-calendar/index.d.ts +36 -0
- package/dist/business-calendar/index.js +2 -0
- package/dist/button/index.d.ts +53 -0
- package/dist/button/index.js +2 -0
- package/dist/button-group/index.d.ts +18 -0
- package/dist/button-group/index.js +2 -0
- package/dist/calendar/index.d.ts +44 -0
- package/dist/calendar/index.js +2 -0
- package/dist/calendar-heatmap/index.d.ts +42 -0
- package/dist/calendar-heatmap/index.js +2 -0
- package/dist/candlestick-chart/index.d.ts +45 -0
- package/dist/candlestick-chart/index.js +2 -0
- package/dist/card/index.d.ts +27 -0
- package/dist/card/index.js +2 -0
- package/dist/card/parts.d.ts +13 -0
- package/dist/card/parts.js +2 -0
- package/dist/carousel/index.d.ts +26 -0
- package/dist/carousel/index.js +2 -0
- package/dist/cascader/index.d.ts +53 -0
- package/dist/cascader/index.js +2 -0
- package/dist/chart-export/index.d.ts +15 -0
- package/dist/chart-export/index.js +2 -0
- package/dist/chat/index.d.ts +54 -0
- package/dist/chat/index.js +2 -0
- package/dist/checkbox/index.d.ts +38 -0
- package/dist/checkbox/index.js +2 -0
- package/dist/checkbox-group/index.d.ts +40 -0
- package/dist/checkbox-group/index.js +2 -0
- package/dist/code-viewer/index.d.ts +35 -0
- package/dist/code-viewer/index.js +2 -0
- package/dist/collapsible/index.d.ts +26 -0
- package/dist/collapsible/index.js +2 -0
- package/dist/color-picker/index.d.ts +50 -0
- package/dist/color-picker/index.js +2 -0
- package/dist/combo-chart/index.d.ts +45 -0
- package/dist/combo-chart/index.js +2 -0
- package/dist/combobox/index.d.ts +57 -0
- package/dist/combobox/index.js +2 -0
- package/dist/command-palette/index.d.ts +36 -0
- package/dist/command-palette/index.js +2 -0
- package/dist/config.d.ts +49 -0
- package/dist/config.js +2 -0
- package/dist/context-menu/index.d.ts +37 -0
- package/dist/context-menu/index.js +2 -0
- package/dist/dashboard/controller.d.ts +19 -0
- package/dist/dashboard/controller.js +2 -0
- package/dist/dashboard/index.d.ts +72 -0
- package/dist/dashboard/index.js +2 -0
- package/dist/dashboard-grid/catalog.d.ts +30 -0
- package/dist/dashboard-grid/catalog.js +2 -0
- package/dist/dashboard-grid/index.d.ts +41 -0
- package/dist/dashboard-grid/index.js +2 -0
- package/dist/dashboard-widget/index.d.ts +31 -0
- package/dist/dashboard-widget/index.js +2 -0
- package/dist/data-grid/index.d.ts +251 -0
- package/dist/data-grid/index.js +2 -0
- package/dist/data-table/column-chooser.d.ts +23 -0
- package/dist/data-table/column-chooser.js +2 -0
- package/dist/data-table/column.d.ts +82 -0
- package/dist/data-table/column.js +2 -0
- package/dist/data-table/index.d.ts +97 -0
- package/dist/data-table/index.js +2 -0
- package/dist/date-input/index.d.ts +42 -0
- package/dist/date-input/index.js +2 -0
- package/dist/date-picker/index.d.ts +53 -0
- package/dist/date-picker/index.js +2 -0
- package/dist/date-range-picker/index.d.ts +61 -0
- package/dist/date-range-picker/index.js +2 -0
- package/dist/date-time-picker/index.d.ts +56 -0
- package/dist/date-time-picker/index.js +2 -0
- package/dist/diagram/index.d.ts +72 -0
- package/dist/diagram/index.js +2 -0
- package/dist/dialog/index.d.ts +31 -0
- package/dist/dialog/index.js +2 -0
- package/dist/discussion/index.d.ts +65 -0
- package/dist/discussion/index.js +2 -0
- package/dist/drawer/index.d.ts +32 -0
- package/dist/drawer/index.js +2 -0
- package/dist/duration-picker/index.d.ts +43 -0
- package/dist/duration-picker/index.js +2 -0
- package/dist/empty-state/index.d.ts +22 -0
- package/dist/empty-state/index.js +2 -0
- package/dist/error-summary/index.d.ts +25 -0
- package/dist/error-summary/index.js +2 -0
- package/dist/fieldset/index.d.ts +21 -0
- package/dist/fieldset/index.js +2 -0
- package/dist/file-manager/index.d.ts +44 -0
- package/dist/file-manager/index.js +2 -0
- package/dist/file-upload/index.d.ts +52 -0
- package/dist/file-upload/index.js +2 -0
- package/dist/form/index.d.ts +43 -0
- package/dist/form/index.js +2 -0
- package/dist/form-builder/index.d.ts +32 -0
- package/dist/form-builder/index.js +2 -0
- package/dist/form-field/index.d.ts +37 -0
- package/dist/form-field/index.js +2 -0
- package/dist/forms/index.d.ts +9 -0
- package/dist/forms/index.js +2 -0
- package/dist/funnel-chart/index.d.ts +36 -0
- package/dist/funnel-chart/index.js +2 -0
- package/dist/gantt/index.d.ts +65 -0
- package/dist/gantt/index.js +2 -0
- package/dist/gauge/index.d.ts +28 -0
- package/dist/gauge/index.js +2 -0
- package/dist/heatmap/index.d.ts +40 -0
- package/dist/heatmap/index.js +2 -0
- package/dist/histogram/index.d.ts +42 -0
- package/dist/histogram/index.js +2 -0
- package/dist/hover-card/index.d.ts +30 -0
- package/dist/hover-card/index.js +2 -0
- package/dist/icon/index.d.ts +58 -0
- package/dist/icon/index.js +2 -0
- package/dist/image-viewer/index.d.ts +64 -0
- package/dist/image-viewer/index.js +2 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +2 -0
- package/dist/inline-message/index.d.ts +17 -0
- package/dist/inline-message/index.js +2 -0
- package/dist/internal/bridge.d.ts +214 -0
- package/dist/internal/bridge.js +2 -0
- package/dist/internal/config-keys.d.ts +2 -0
- package/dist/internal/config-keys.js +2 -0
- package/dist/internal/diagnostics.d.ts +26 -0
- package/dist/internal/diagnostics.js +2 -0
- package/dist/internal/form-errors.d.ts +17 -0
- package/dist/internal/form-errors.js +2 -0
- package/dist/internal/modal.d.ts +29 -0
- package/dist/internal/modal.js +2 -0
- package/dist/internal/overlay.d.ts +12 -0
- package/dist/internal/overlay.js +2 -0
- package/dist/internal/render.d.ts +19 -0
- package/dist/internal/render.js +2 -0
- package/dist/internal/server-dom.d.ts +11 -0
- package/dist/internal/server-dom.js +2 -0
- package/dist/internal/style-sheets.d.ts +57 -0
- package/dist/internal/style-sheets.js +2 -0
- package/dist/internal/styles.d.ts +17 -0
- package/dist/internal/styles.js +2 -0
- package/dist/kanban/index.d.ts +55 -0
- package/dist/kanban/index.js +2 -0
- package/dist/kbd/index.d.ts +16 -0
- package/dist/kbd/index.js +2 -0
- package/dist/layout/index.d.ts +39 -0
- package/dist/layout/index.js +2 -0
- package/dist/line-chart/index.d.ts +49 -0
- package/dist/line-chart/index.js +2 -0
- package/dist/masked-input/index.d.ts +50 -0
- package/dist/masked-input/index.js +2 -0
- package/dist/mention-input/index.d.ts +47 -0
- package/dist/mention-input/index.js +2 -0
- package/dist/menu/index.d.ts +30 -0
- package/dist/menu/index.js +2 -0
- package/dist/menu-bar/index.d.ts +25 -0
- package/dist/menu-bar/index.js +2 -0
- package/dist/month-picker/index.d.ts +53 -0
- package/dist/month-picker/index.js +2 -0
- package/dist/multi-select/index.d.ts +59 -0
- package/dist/multi-select/index.js +2 -0
- package/dist/network-graph/index.d.ts +51 -0
- package/dist/network-graph/index.js +2 -0
- package/dist/number-input/index.d.ts +44 -0
- package/dist/number-input/index.js +2 -0
- package/dist/org-chart/index.d.ts +76 -0
- package/dist/org-chart/index.js +2 -0
- package/dist/otp-input/index.d.ts +49 -0
- package/dist/otp-input/index.js +2 -0
- package/dist/overlay/index.d.ts +66 -0
- package/dist/overlay/index.js +2 -0
- package/dist/pagination/index.d.ts +29 -0
- package/dist/pagination/index.js +2 -0
- package/dist/password-input/index.d.ts +51 -0
- package/dist/password-input/index.js +2 -0
- package/dist/password-strength-meter/index.d.ts +26 -0
- package/dist/password-strength-meter/index.js +2 -0
- package/dist/pie-chart/index.d.ts +39 -0
- package/dist/pie-chart/index.js +2 -0
- package/dist/pivot-field-list/index.d.ts +27 -0
- package/dist/pivot-field-list/index.js +2 -0
- package/dist/pivot-grid/index.d.ts +54 -0
- package/dist/pivot-grid/index.js +2 -0
- package/dist/popover/index.d.ts +38 -0
- package/dist/popover/index.js +2 -0
- package/dist/progress-bar/index.d.ts +23 -0
- package/dist/progress-bar/index.js +2 -0
- package/dist/prompt-input/index.d.ts +65 -0
- package/dist/prompt-input/index.js +2 -0
- package/dist/quarter-picker/index.d.ts +53 -0
- package/dist/quarter-picker/index.js +2 -0
- package/dist/radar-chart/index.d.ts +38 -0
- package/dist/radar-chart/index.js +2 -0
- package/dist/radio-group/index.d.ts +38 -0
- package/dist/radio-group/index.js +2 -0
- package/dist/rating/index.d.ts +43 -0
- package/dist/rating/index.js +2 -0
- package/dist/recurrence-picker/index.d.ts +46 -0
- package/dist/recurrence-picker/index.js +2 -0
- package/dist/rich-text-editor/index.d.ts +75 -0
- package/dist/rich-text-editor/index.js +2 -0
- package/dist/router/index.d.ts +43 -0
- package/dist/router/index.js +2 -0
- package/dist/scatter-chart/index.d.ts +46 -0
- package/dist/scatter-chart/index.js +2 -0
- package/dist/schedule-picker/index.d.ts +44 -0
- package/dist/schedule-picker/index.js +2 -0
- package/dist/scheduler/index.d.ts +77 -0
- package/dist/scheduler/index.js +2 -0
- package/dist/schema-form/index.d.ts +39 -0
- package/dist/schema-form/index.js +2 -0
- package/dist/scroll-area/index.d.ts +18 -0
- package/dist/scroll-area/index.js +2 -0
- package/dist/select/index.d.ts +54 -0
- package/dist/select/index.js +2 -0
- package/dist/services.d.ts +70 -0
- package/dist/services.js +2 -0
- package/dist/session-warning-dialog/index.d.ts +36 -0
- package/dist/session-warning-dialog/index.js +2 -0
- package/dist/sidebar/index.d.ts +38 -0
- package/dist/sidebar/index.js +2 -0
- package/dist/signature-pad/index.d.ts +51 -0
- package/dist/signature-pad/index.js +2 -0
- package/dist/skeleton/index.d.ts +17 -0
- package/dist/skeleton/index.js +2 -0
- package/dist/slider/index.d.ts +39 -0
- package/dist/slider/index.js +2 -0
- package/dist/sortable-list/index.d.ts +22 -0
- package/dist/sortable-list/index.js +2 -0
- package/dist/sparkline/index.d.ts +25 -0
- package/dist/sparkline/index.js +2 -0
- package/dist/spinner/index.d.ts +18 -0
- package/dist/spinner/index.js +2 -0
- package/dist/splitter/index.d.ts +25 -0
- package/dist/splitter/index.js +2 -0
- package/dist/stat-card/index.d.ts +30 -0
- package/dist/stat-card/index.js +2 -0
- package/dist/stepper/index.d.ts +28 -0
- package/dist/stepper/index.js +2 -0
- package/dist/switch/index.d.ts +35 -0
- package/dist/switch/index.js +2 -0
- package/dist/tabs/index.d.ts +24 -0
- package/dist/tabs/index.js +2 -0
- package/dist/tag-group/index.d.ts +26 -0
- package/dist/tag-group/index.js +2 -0
- package/dist/templates/index.d.ts +160 -0
- package/dist/templates/index.js +2 -0
- package/dist/testing/index.d.ts +411 -0
- package/dist/testing/index.js +2 -0
- package/dist/text-input/index.d.ts +51 -0
- package/dist/text-input/index.js +2 -0
- package/dist/textarea/index.d.ts +47 -0
- package/dist/textarea/index.js +2 -0
- package/dist/time-picker/index.d.ts +52 -0
- package/dist/time-picker/index.js +2 -0
- package/dist/timeline/index.d.ts +37 -0
- package/dist/timeline/index.js +2 -0
- package/dist/toast/index.d.ts +23 -0
- package/dist/toast/index.js +2 -0
- package/dist/toggle-group/index.d.ts +26 -0
- package/dist/toggle-group/index.js +2 -0
- package/dist/tooltip/index.d.ts +22 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/tour/index.d.ts +39 -0
- package/dist/tour/index.js +2 -0
- package/dist/transfer-list/index.d.ts +44 -0
- package/dist/transfer-list/index.js +2 -0
- package/dist/tree-select/index.d.ts +56 -0
- package/dist/tree-select/index.js +2 -0
- package/dist/tree-view/index.d.ts +68 -0
- package/dist/tree-view/index.js +2 -0
- package/dist/treemap/index.d.ts +43 -0
- package/dist/treemap/index.js +2 -0
- package/dist/typography/index.d.ts +40 -0
- package/dist/typography/index.js +2 -0
- package/dist/upload-queue/index.d.ts +44 -0
- package/dist/upload-queue/index.js +2 -0
- package/dist/validation-message/index.d.ts +20 -0
- package/dist/validation-message/index.js +2 -0
- package/dist/virtual-list/index.d.ts +42 -0
- package/dist/virtual-list/index.js +2 -0
- package/dist/waterfall-chart/index.d.ts +40 -0
- package/dist/waterfall-chart/index.js +2 -0
- package/dist/year-picker/index.d.ts +52 -0
- package/dist/year-picker/index.js +2 -0
- package/package.json +586 -4
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Angular templates for AbsoluteUI render slots (docs/PLAN-R9-ANGULAR.md M3, D8).
|
|
3
|
+
* Put an `<ng-template>` with one of these directives inside the component:
|
|
4
|
+
*
|
|
5
|
+
* ```html
|
|
6
|
+
* <aui-data-table caption="People" [columns]="columns" [rows]="people" [rowId]="byId">
|
|
7
|
+
* <ng-template auiCell="name" [auiCellOf]="people" let-person>
|
|
8
|
+
* <app-avatar [user]="person" /> {{ person.name }}
|
|
9
|
+
* </ng-template>
|
|
10
|
+
* <ng-template auiRowDetail [auiRowDetailOf]="people" let-person>...</ng-template>
|
|
11
|
+
* </aui-data-table>
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* Each rendered template is a live embedded view (bindings, components, DI, change
|
|
15
|
+
* detection); it is destroyed when the component drops the node (row re-rendered,
|
|
16
|
+
* collapsed, removed, or the component destroyed). The optional `...Of` inputs only
|
|
17
|
+
* type the template context (`let-person` gets the element type of the bound array).
|
|
18
|
+
*/
|
|
19
|
+
import { TemplateRef, type InputSignal } from '@angular/core';
|
|
20
|
+
import type { DataTableGroup } from '@absoluteui/components/data-table';
|
|
21
|
+
import * as i0 from "@angular/core";
|
|
22
|
+
/** Context of a cell template: the row, and the column id. */
|
|
23
|
+
export interface AuiCellContext<Row> {
|
|
24
|
+
readonly $implicit: Row;
|
|
25
|
+
readonly row: Row;
|
|
26
|
+
readonly column: string;
|
|
27
|
+
}
|
|
28
|
+
/** Context of a row detail template. */
|
|
29
|
+
export interface AuiRowDetailContext<Row> {
|
|
30
|
+
readonly $implicit: Row;
|
|
31
|
+
readonly row: Row;
|
|
32
|
+
}
|
|
33
|
+
/** Context of an item template (Kanban card, Org Chart node, Scheduler event): the item and the component's render context. */
|
|
34
|
+
export interface AuiItemContext<Item, Extra = unknown> {
|
|
35
|
+
readonly $implicit: Item;
|
|
36
|
+
readonly item: Item;
|
|
37
|
+
readonly context: Extra;
|
|
38
|
+
}
|
|
39
|
+
/** Cell template for one column of `<aui-data-table>`: `<ng-template auiCell="name" let-row>`, or `<ng-template auiCell let-row>` inside `<aui-column>`. */
|
|
40
|
+
export declare class AuiCell<Row = unknown> {
|
|
41
|
+
/** Column id; leave it empty inside `<aui-column>`, which owns the template. */
|
|
42
|
+
readonly column: InputSignal<string>;
|
|
43
|
+
/** Types the context only: the rows bound to the table. */
|
|
44
|
+
readonly of: InputSignal<readonly Row[] | null | undefined>;
|
|
45
|
+
/** @internal Read by the component that renders the template. */
|
|
46
|
+
readonly template: TemplateRef<AuiCellContext<Row>>;
|
|
47
|
+
static ngTemplateContextGuard<Row>(_dir: AuiCell<Row>, _ctx: unknown): _ctx is AuiCellContext<Row>;
|
|
48
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuiCell<any>, never>;
|
|
49
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AuiCell<any>, "ng-template[auiCell]", never, { "column": { "alias": "auiCell"; "required": false; "isSignal": true; }; "of": { "alias": "auiCellOf"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
50
|
+
}
|
|
51
|
+
/** Row detail template of `<aui-data-table>` (expandable rows): `<ng-template auiRowDetail let-row>`. */
|
|
52
|
+
export declare class AuiRowDetail<Row = unknown> {
|
|
53
|
+
/** Types the context only: the rows bound to the table. */
|
|
54
|
+
readonly of: InputSignal<readonly Row[] | null | undefined>;
|
|
55
|
+
/** @internal Read by the component that renders the template. */
|
|
56
|
+
readonly template: TemplateRef<AuiRowDetailContext<Row>>;
|
|
57
|
+
static ngTemplateContextGuard<Row>(_dir: AuiRowDetail<Row>, _ctx: unknown): _ctx is AuiRowDetailContext<Row>;
|
|
58
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuiRowDetail<any>, never>;
|
|
59
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AuiRowDetail<any>, "ng-template[auiRowDetail]", never, { "of": { "alias": "auiRowDetailOf"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Item template: menu items (`button[auiMenu]`, `[auiContextMenu]`, `<aui-menu-bar>`), Kanban cards (`<aui-kanban>`), Org Chart nodes (`<aui-org-chart>`), Scheduler
|
|
63
|
+
* events (`<aui-scheduler>`): `<ng-template auiItem [auiItemOf]="cards" let-card let-ctx="context">`.
|
|
64
|
+
*/
|
|
65
|
+
export declare class AuiItem<Item = unknown> {
|
|
66
|
+
/** Types the context only: the items bound to the component. */
|
|
67
|
+
readonly of: InputSignal<readonly Item[] | null | undefined>;
|
|
68
|
+
/** @internal Read by the component that renders the template. */
|
|
69
|
+
readonly template: TemplateRef<AuiItemContext<Item>>;
|
|
70
|
+
static ngTemplateContextGuard<Item>(_dir: AuiItem<Item>, _ctx: unknown): _ctx is AuiItemContext<Item>;
|
|
71
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuiItem<any>, never>;
|
|
72
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AuiItem<any>, "ng-template[auiItem]", never, { "of": { "alias": "auiItemOf"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
73
|
+
}
|
|
74
|
+
/** Context of a selected item template: the selected option. */
|
|
75
|
+
export interface AuiSelectedItemContext<Item> {
|
|
76
|
+
readonly $implicit: Item;
|
|
77
|
+
readonly item: Item;
|
|
78
|
+
}
|
|
79
|
+
/** Content shown for the selected option of `<aui-select>`: `<ng-template auiSelectedItem let-option>`. */
|
|
80
|
+
export declare class AuiSelectedItem<Item = unknown> {
|
|
81
|
+
/** Types the context only: the options bound to the select. */
|
|
82
|
+
readonly of: InputSignal<readonly Item[] | null | undefined>;
|
|
83
|
+
/** @internal Read by the component that renders the template. */
|
|
84
|
+
readonly template: TemplateRef<AuiSelectedItemContext<Item>>;
|
|
85
|
+
static ngTemplateContextGuard<Item>(_dir: AuiSelectedItem<Item>, _ctx: unknown): _ctx is AuiSelectedItemContext<Item>;
|
|
86
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuiSelectedItem<any>, never>;
|
|
87
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AuiSelectedItem<any>, "ng-template[auiSelectedItem]", never, { "of": { "alias": "auiSelectedItemOf"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
88
|
+
}
|
|
89
|
+
/** Context of a header template: the column. */
|
|
90
|
+
export interface AuiHeaderContext {
|
|
91
|
+
readonly $implicit: string;
|
|
92
|
+
/** Column id. */
|
|
93
|
+
readonly column: string;
|
|
94
|
+
/** The column's header text (its accessible name). */
|
|
95
|
+
readonly header: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Header content of a `<aui-data-table>` column (decorative: the header text stays the
|
|
99
|
+
* accessible name): `<ng-template auiHeader="salary" let-header="header">`, or without an id inside `<aui-column>`.
|
|
100
|
+
*/
|
|
101
|
+
export declare class AuiHeader {
|
|
102
|
+
/** Column id; leave it empty inside `<aui-column>`. */
|
|
103
|
+
readonly column: InputSignal<string>;
|
|
104
|
+
/** @internal Read by the component that renders the template. */
|
|
105
|
+
readonly template: TemplateRef<AuiHeaderContext>;
|
|
106
|
+
static ngTemplateContextGuard(_dir: AuiHeader, _ctx: unknown): _ctx is AuiHeaderContext;
|
|
107
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuiHeader, never>;
|
|
108
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AuiHeader, "ng-template[auiHeader]", never, { "column": { "alias": "auiHeader"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
109
|
+
}
|
|
110
|
+
/** Empty state of `<aui-data-table>` (replaces `emptyMessage`): `<ng-template auiEmpty>`. */
|
|
111
|
+
export declare class AuiEmpty {
|
|
112
|
+
/** @internal Read by the component that renders the template. */
|
|
113
|
+
readonly template: TemplateRef<unknown>;
|
|
114
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuiEmpty, never>;
|
|
115
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AuiEmpty, "ng-template[auiEmpty]", never, {}, {}, never, never, true, never>;
|
|
116
|
+
}
|
|
117
|
+
/** Context of a group header template. */
|
|
118
|
+
export interface AuiGroupHeaderContext<Row> {
|
|
119
|
+
readonly $implicit: DataTableGroup<Row>;
|
|
120
|
+
readonly group: DataTableGroup<Row>;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Group header content of `<aui-data-table [groupBy]>` (decorative: the toggle keeps the
|
|
124
|
+
* default text as its name): `<ng-template auiGroupHeader [auiGroupHeaderOf]="rows" let-group>`.
|
|
125
|
+
*/
|
|
126
|
+
export declare class AuiGroupHeader<Row = unknown> {
|
|
127
|
+
/** Types the context only: the rows bound to the table. */
|
|
128
|
+
readonly of: InputSignal<readonly Row[] | null | undefined>;
|
|
129
|
+
/** @internal Read by the component that renders the template. */
|
|
130
|
+
readonly template: TemplateRef<AuiGroupHeaderContext<Row>>;
|
|
131
|
+
static ngTemplateContextGuard<Row>(_dir: AuiGroupHeader<Row>, _ctx: unknown): _ctx is AuiGroupHeaderContext<Row>;
|
|
132
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuiGroupHeader<any>, never>;
|
|
133
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AuiGroupHeader<any>, "ng-template[auiGroupHeader]", never, { "of": { "alias": "auiGroupHeaderOf"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
134
|
+
}
|
|
135
|
+
/** Context of an editor template: the value being edited and how to finish. */
|
|
136
|
+
export interface AuiEditorContext<Row> {
|
|
137
|
+
readonly $implicit: unknown;
|
|
138
|
+
readonly value: unknown;
|
|
139
|
+
readonly row: Row;
|
|
140
|
+
readonly column: string;
|
|
141
|
+
/** Validation message of the last commit, or null. */
|
|
142
|
+
readonly error: string | null;
|
|
143
|
+
commit(value: unknown): void;
|
|
144
|
+
cancel(): void;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Custom inline editor of an editable `<aui-data-table>` column: `<ng-template auiEditor let-value let-commit="commit" let-cancel="cancel">`
|
|
148
|
+
* inside `<aui-column editable>` (or `auiEditor="columnId"` at table level). Call `commit(value)` or `cancel()`.
|
|
149
|
+
*/
|
|
150
|
+
export declare class AuiEditor<Row = unknown> {
|
|
151
|
+
/** Column id; leave it empty inside `<aui-column>`. */
|
|
152
|
+
readonly column: InputSignal<string>;
|
|
153
|
+
/** Types the context only: the rows bound to the table. */
|
|
154
|
+
readonly of: InputSignal<readonly Row[] | null | undefined>;
|
|
155
|
+
/** @internal Read by the component that renders the template. */
|
|
156
|
+
readonly template: TemplateRef<AuiEditorContext<Row>>;
|
|
157
|
+
static ngTemplateContextGuard<Row>(_dir: AuiEditor<Row>, _ctx: unknown): _ctx is AuiEditorContext<Row>;
|
|
158
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuiEditor<any>, never>;
|
|
159
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AuiEditor<any>, "ng-template[auiEditor]", never, { "column": { "alias": "auiEditor"; "required": false; "isSignal": true; }; "of": { "alias": "auiEditorOf"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
160
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AbsoluteUI @absoluteui/angular v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
|
|
2
|
+
import{Directive as a,inject as r,input as t,TemplateRef as i}from"@angular/core";import*as e from"@angular/core";class o{column=t("",{...ngDevMode?{debugName:"column"}:{},alias:"auiCell"});of=t(void 0,{...ngDevMode?{debugName:"of"}:{},alias:"auiCellOf"});template=r(i);static ngTemplateContextGuard(n,s){return!0}static ɵfac=e.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:o,deps:[],target:e.ɵɵFactoryTarget.Directive});static ɵdir=e.ɵɵngDeclareDirective({minVersion:"17.1.0",version:"22.3.0",type:o,isStandalone:!0,selector:"ng-template[auiCell]",inputs:{column:{classPropertyName:"column",publicName:"auiCell",isSignal:!0,isRequired:!1,transformFunction:null},of:{classPropertyName:"of",publicName:"auiCellOf",isSignal:!0,isRequired:!1,transformFunction:null}},ngImport:e})}e.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:o,decorators:[{type:a,args:[{selector:"ng-template[auiCell]"}]}],propDecorators:{column:[{type:e.Input,args:[{isSignal:!0,alias:"auiCell",required:!1}]}],of:[{type:e.Input,args:[{isSignal:!0,alias:"auiCellOf",required:!1}]}]}});class l{of=t(void 0,{...ngDevMode?{debugName:"of"}:{},alias:"auiRowDetailOf"});template=r(i);static ngTemplateContextGuard(n,s){return!0}static ɵfac=e.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:l,deps:[],target:e.ɵɵFactoryTarget.Directive});static ɵdir=e.ɵɵngDeclareDirective({minVersion:"17.1.0",version:"22.3.0",type:l,isStandalone:!0,selector:"ng-template[auiRowDetail]",inputs:{of:{classPropertyName:"of",publicName:"auiRowDetailOf",isSignal:!0,isRequired:!1,transformFunction:null}},ngImport:e})}e.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:l,decorators:[{type:a,args:[{selector:"ng-template[auiRowDetail]"}]}],propDecorators:{of:[{type:e.Input,args:[{isSignal:!0,alias:"auiRowDetailOf",required:!1}]}]}});class c{of=t(void 0,{...ngDevMode?{debugName:"of"}:{},alias:"auiItemOf"});template=r(i);static ngTemplateContextGuard(n,s){return!0}static ɵfac=e.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:c,deps:[],target:e.ɵɵFactoryTarget.Directive});static ɵdir=e.ɵɵngDeclareDirective({minVersion:"17.1.0",version:"22.3.0",type:c,isStandalone:!0,selector:"ng-template[auiItem]",inputs:{of:{classPropertyName:"of",publicName:"auiItemOf",isSignal:!0,isRequired:!1,transformFunction:null}},ngImport:e})}e.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:c,decorators:[{type:a,args:[{selector:"ng-template[auiItem]"}]}],propDecorators:{of:[{type:e.Input,args:[{isSignal:!0,alias:"auiItemOf",required:!1}]}]}});class u{of=t(void 0,{...ngDevMode?{debugName:"of"}:{},alias:"auiSelectedItemOf"});template=r(i);static ngTemplateContextGuard(n,s){return!0}static ɵfac=e.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:u,deps:[],target:e.ɵɵFactoryTarget.Directive});static ɵdir=e.ɵɵngDeclareDirective({minVersion:"17.1.0",version:"22.3.0",type:u,isStandalone:!0,selector:"ng-template[auiSelectedItem]",inputs:{of:{classPropertyName:"of",publicName:"auiSelectedItemOf",isSignal:!0,isRequired:!1,transformFunction:null}},ngImport:e})}e.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:u,decorators:[{type:a,args:[{selector:"ng-template[auiSelectedItem]"}]}],propDecorators:{of:[{type:e.Input,args:[{isSignal:!0,alias:"auiSelectedItemOf",required:!1}]}]}});class p{column=t("",{...ngDevMode?{debugName:"column"}:{},alias:"auiHeader"});template=r(i);static ngTemplateContextGuard(n,s){return!0}static ɵfac=e.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:p,deps:[],target:e.ɵɵFactoryTarget.Directive});static ɵdir=e.ɵɵngDeclareDirective({minVersion:"17.1.0",version:"22.3.0",type:p,isStandalone:!0,selector:"ng-template[auiHeader]",inputs:{column:{classPropertyName:"column",publicName:"auiHeader",isSignal:!0,isRequired:!1,transformFunction:null}},ngImport:e})}e.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:p,decorators:[{type:a,args:[{selector:"ng-template[auiHeader]"}]}],propDecorators:{column:[{type:e.Input,args:[{isSignal:!0,alias:"auiHeader",required:!1}]}]}});class m{template=r(i);static ɵfac=e.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:m,deps:[],target:e.ɵɵFactoryTarget.Directive});static ɵdir=e.ɵɵngDeclareDirective({minVersion:"14.0.0",version:"22.3.0",type:m,isStandalone:!0,selector:"ng-template[auiEmpty]",ngImport:e})}e.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:m,decorators:[{type:a,args:[{selector:"ng-template[auiEmpty]"}]}]});class g{of=t(void 0,{...ngDevMode?{debugName:"of"}:{},alias:"auiGroupHeaderOf"});template=r(i);static ngTemplateContextGuard(n,s){return!0}static ɵfac=e.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:g,deps:[],target:e.ɵɵFactoryTarget.Directive});static ɵdir=e.ɵɵngDeclareDirective({minVersion:"17.1.0",version:"22.3.0",type:g,isStandalone:!0,selector:"ng-template[auiGroupHeader]",inputs:{of:{classPropertyName:"of",publicName:"auiGroupHeaderOf",isSignal:!0,isRequired:!1,transformFunction:null}},ngImport:e})}e.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:g,decorators:[{type:a,args:[{selector:"ng-template[auiGroupHeader]"}]}],propDecorators:{of:[{type:e.Input,args:[{isSignal:!0,alias:"auiGroupHeaderOf",required:!1}]}]}});class d{column=t("",{...ngDevMode?{debugName:"column"}:{},alias:"auiEditor"});of=t(void 0,{...ngDevMode?{debugName:"of"}:{},alias:"auiEditorOf"});template=r(i);static ngTemplateContextGuard(n,s){return!0}static ɵfac=e.ɵɵngDeclareFactory({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:d,deps:[],target:e.ɵɵFactoryTarget.Directive});static ɵdir=e.ɵɵngDeclareDirective({minVersion:"17.1.0",version:"22.3.0",type:d,isStandalone:!0,selector:"ng-template[auiEditor]",inputs:{column:{classPropertyName:"column",publicName:"auiEditor",isSignal:!0,isRequired:!1,transformFunction:null},of:{classPropertyName:"of",publicName:"auiEditorOf",isSignal:!0,isRequired:!1,transformFunction:null}},ngImport:e})}e.ɵɵngDeclareClassMetadata({minVersion:"12.0.0",version:"22.3.0",ngImport:e,type:d,decorators:[{type:a,args:[{selector:"ng-template[auiEditor]"}]}],propDecorators:{column:[{type:e.Input,args:[{isSignal:!0,alias:"auiEditor",required:!1}]}],of:[{type:e.Input,args:[{isSignal:!0,alias:"auiEditorOf",required:!1}]}]}});export{o as AuiCell,d as AuiEditor,m as AuiEmpty,g as AuiGroupHeader,p as AuiHeader,c as AuiItem,l as AuiRowDetail,u as AuiSelectedItem};
|
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @absoluteui/angular/testing (docs/PLAN-R9-ANGULAR.md M8, D9/D23): component harnesses on
|
|
3
|
+
* @angular/cdk/testing (optional peer). Harnesses act through the rendered DOM the way a user
|
|
4
|
+
* does (click, type, keys) and read what a user perceives (labels, text, ARIA state); they never
|
|
5
|
+
* reach the component controller.
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* const loader = TestbedHarnessEnvironment.loader(fixture);
|
|
9
|
+
* const email = await loader.getHarness(AuiTextInputHarness.with({ label: 'Email' }));
|
|
10
|
+
* await email.setValue('ada@example.com');
|
|
11
|
+
* // Dialogs render in the body layer: use the document root loader.
|
|
12
|
+
* const dialog = await TestbedHarnessEnvironment.documentRootLoader(fixture).getHarness(AuiDialogHarness);
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
import { ComponentHarness, HarnessPredicate, type BaseHarnessFilters, type ComponentHarnessConstructor, type TestElement } from '@angular/cdk/testing';
|
|
16
|
+
/** Filters for `AuiButtonHarness.with()`. */
|
|
17
|
+
export interface AuiButtonHarnessFilters extends BaseHarnessFilters {
|
|
18
|
+
/** Visible text (or accessible label of an icon-only button). */
|
|
19
|
+
text?: string | RegExp;
|
|
20
|
+
variant?: 'primary' | 'secondary' | 'outline' | 'ghost' | 'danger';
|
|
21
|
+
}
|
|
22
|
+
/** `button[auiButton]` and `a[auiButton]`. */
|
|
23
|
+
export declare class AuiButtonHarness extends ComponentHarness {
|
|
24
|
+
static hostSelector: string;
|
|
25
|
+
static with<T extends AuiButtonHarness>(this: ComponentHarnessConstructor<T>, options?: AuiButtonHarnessFilters): HarnessPredicate<T>;
|
|
26
|
+
/** Visible text, or the accessible label of an icon-only button. */
|
|
27
|
+
getText(): Promise<string>;
|
|
28
|
+
getVariant(): Promise<string | null>;
|
|
29
|
+
/** Native `disabled`, or `aria-disabled` (disabled links, loading). */
|
|
30
|
+
isDisabled(): Promise<boolean>;
|
|
31
|
+
isLoading(): Promise<boolean>;
|
|
32
|
+
isLink(): Promise<boolean>;
|
|
33
|
+
click(): Promise<void>;
|
|
34
|
+
focus(): Promise<void>;
|
|
35
|
+
}
|
|
36
|
+
/** Filters for the form field harnesses (`with({ label })`). */
|
|
37
|
+
export interface AuiFieldHarnessFilters extends BaseHarnessFilters {
|
|
38
|
+
/** Visible label (without the required marker). */
|
|
39
|
+
label?: string | RegExp;
|
|
40
|
+
}
|
|
41
|
+
/** Label, description, validation message, required and disabled state of a form field. */
|
|
42
|
+
export declare abstract class AuiFieldHarness extends ComponentHarness {
|
|
43
|
+
protected readonly labelElement: () => Promise<TestElement | null>;
|
|
44
|
+
protected readonly descriptionElement: () => Promise<TestElement | null>;
|
|
45
|
+
protected readonly errorElement: () => Promise<TestElement | null>;
|
|
46
|
+
/** The element that receives focus and carries `aria-invalid`/`disabled`. */
|
|
47
|
+
protected abstract control(): Promise<TestElement>;
|
|
48
|
+
getLabel(): Promise<string>;
|
|
49
|
+
getDescription(): Promise<string | null>;
|
|
50
|
+
/** The message shown to the user, or null. */
|
|
51
|
+
getErrorMessage(): Promise<string | null>;
|
|
52
|
+
isRequired(): Promise<boolean>;
|
|
53
|
+
isDisabled(): Promise<boolean>;
|
|
54
|
+
isInvalid(): Promise<boolean>;
|
|
55
|
+
focus(): Promise<void>;
|
|
56
|
+
/** Leaves the field (marks it touched). */
|
|
57
|
+
blur(): Promise<void>;
|
|
58
|
+
}
|
|
59
|
+
/** `<aui-text-input>`. */
|
|
60
|
+
export declare class AuiTextInputHarness extends AuiFieldHarness {
|
|
61
|
+
static hostSelector: string;
|
|
62
|
+
protected readonly input: () => Promise<TestElement>;
|
|
63
|
+
static with<T extends AuiTextInputHarness>(this: ComponentHarnessConstructor<T>, options?: AuiFieldHarnessFilters): HarnessPredicate<T>;
|
|
64
|
+
protected control(): Promise<TestElement>;
|
|
65
|
+
getValue(): Promise<string>;
|
|
66
|
+
/** Replaces the value by typing, as a user would (input events per key). */
|
|
67
|
+
setValue(value: string): Promise<void>;
|
|
68
|
+
getPlaceholder(): Promise<string>;
|
|
69
|
+
}
|
|
70
|
+
/** An option of a Select, as the harness reads it. */
|
|
71
|
+
export interface AuiSelectOption {
|
|
72
|
+
label: string;
|
|
73
|
+
disabled: boolean;
|
|
74
|
+
selected: boolean;
|
|
75
|
+
}
|
|
76
|
+
/** `<aui-select>`. The listbox renders inside the host. */
|
|
77
|
+
export declare class AuiSelectHarness extends AuiFieldHarness {
|
|
78
|
+
static hostSelector: string;
|
|
79
|
+
protected readonly trigger: () => Promise<TestElement>;
|
|
80
|
+
protected readonly valueElement: () => Promise<TestElement>;
|
|
81
|
+
protected readonly options: () => Promise<TestElement[]>;
|
|
82
|
+
static with<T extends AuiSelectHarness>(this: ComponentHarnessConstructor<T>, options?: AuiFieldHarnessFilters): HarnessPredicate<T>;
|
|
83
|
+
protected control(): Promise<TestElement>;
|
|
84
|
+
/** The selected option's label as shown, or the placeholder. */
|
|
85
|
+
getValueText(): Promise<string>;
|
|
86
|
+
isOpen(): Promise<boolean>;
|
|
87
|
+
open(): Promise<void>;
|
|
88
|
+
close(): Promise<void>;
|
|
89
|
+
/** Options (opens the listbox first). */
|
|
90
|
+
getOptions(): Promise<AuiSelectOption[]>;
|
|
91
|
+
/** Opens the listbox and chooses the first option whose label matches. */
|
|
92
|
+
selectOption(label: string | RegExp): Promise<void>;
|
|
93
|
+
}
|
|
94
|
+
/** `<aui-date-picker>`: typed segments and the calendar popup. */
|
|
95
|
+
export declare class AuiDatePickerHarness extends AuiFieldHarness {
|
|
96
|
+
#private;
|
|
97
|
+
static hostSelector: string;
|
|
98
|
+
protected readonly labelElement: () => Promise<TestElement | null>;
|
|
99
|
+
protected readonly descriptionElement: () => Promise<TestElement | null>;
|
|
100
|
+
protected readonly errorElement: () => Promise<TestElement | null>;
|
|
101
|
+
protected readonly group: () => Promise<TestElement>;
|
|
102
|
+
protected readonly segments: () => Promise<TestElement[]>;
|
|
103
|
+
protected readonly calendarButton: () => Promise<TestElement>;
|
|
104
|
+
protected readonly popup: () => Promise<TestElement>;
|
|
105
|
+
protected readonly heading: () => Promise<TestElement | null>;
|
|
106
|
+
protected readonly days: () => Promise<TestElement[]>;
|
|
107
|
+
static with<T extends AuiDatePickerHarness>(this: ComponentHarnessConstructor<T>, options?: AuiFieldHarnessFilters): HarnessPredicate<T>;
|
|
108
|
+
getLabel(): Promise<string>;
|
|
109
|
+
protected control(): Promise<TestElement>;
|
|
110
|
+
/** The typed segments in display order, e.g. ['08', '03', '2026'] in en-GB. */
|
|
111
|
+
getSegments(): Promise<string[]>;
|
|
112
|
+
/** Types a date into the segments by their accessible names (locale-independent). */
|
|
113
|
+
typeDate(date: {
|
|
114
|
+
year: number;
|
|
115
|
+
month: number;
|
|
116
|
+
day: number;
|
|
117
|
+
}): Promise<void>;
|
|
118
|
+
isCalendarOpen(): Promise<boolean>;
|
|
119
|
+
openCalendar(): Promise<void>;
|
|
120
|
+
/** The visible month heading, e.g. "November 2026". */
|
|
121
|
+
getCalendarMonth(): Promise<string>;
|
|
122
|
+
/** Accessible names of the days of the visible month (they name non-working days and holidays). */
|
|
123
|
+
getDayLabels(): Promise<string[]>;
|
|
124
|
+
isDayDisabled(day: number): Promise<boolean>;
|
|
125
|
+
/** Chooses a day of the visible month in the calendar. */
|
|
126
|
+
selectDay(day: number): Promise<void>;
|
|
127
|
+
nextMonth(): Promise<void>;
|
|
128
|
+
previousMonth(): Promise<void>;
|
|
129
|
+
}
|
|
130
|
+
/** Filters for `AuiTabsHarness.with()`. */
|
|
131
|
+
export interface AuiTabsHarnessFilters extends BaseHarnessFilters {
|
|
132
|
+
/** Accessible name of the tab list. */
|
|
133
|
+
label?: string | RegExp;
|
|
134
|
+
}
|
|
135
|
+
/** `<aui-tabs>`. */
|
|
136
|
+
export declare class AuiTabsHarness extends ComponentHarness {
|
|
137
|
+
#private;
|
|
138
|
+
static hostSelector: string;
|
|
139
|
+
protected readonly list: () => Promise<TestElement>;
|
|
140
|
+
protected readonly tabs: () => Promise<TestElement[]>;
|
|
141
|
+
protected readonly panels: () => Promise<TestElement[]>;
|
|
142
|
+
static with<T extends AuiTabsHarness>(this: ComponentHarnessConstructor<T>, options?: AuiTabsHarnessFilters): HarnessPredicate<T>;
|
|
143
|
+
getLabel(): Promise<string>;
|
|
144
|
+
getTabLabels(): Promise<string[]>;
|
|
145
|
+
getSelectedTabLabel(): Promise<string | null>;
|
|
146
|
+
isTabDisabled(label: string): Promise<boolean>;
|
|
147
|
+
selectTab(label: string): Promise<void>;
|
|
148
|
+
/** Text of the visible panel. */
|
|
149
|
+
getPanelText(): Promise<string>;
|
|
150
|
+
}
|
|
151
|
+
/** Filters for `AuiDialogHarness.with()`. */
|
|
152
|
+
export interface AuiDialogHarnessFilters extends BaseHarnessFilters {
|
|
153
|
+
title?: string | RegExp;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* An open AbsoluteUI dialog (`<aui-dialog>` or `AuiDialogService`). Dialogs render in the body
|
|
157
|
+
* layer: load it with `TestbedHarnessEnvironment.documentRootLoader(fixture)`.
|
|
158
|
+
*/
|
|
159
|
+
export declare class AuiDialogHarness extends ComponentHarness {
|
|
160
|
+
static hostSelector: string;
|
|
161
|
+
protected readonly titleElement: () => Promise<TestElement>;
|
|
162
|
+
protected readonly descriptionElement: () => Promise<TestElement | null>;
|
|
163
|
+
protected readonly bodyElement: () => Promise<TestElement>;
|
|
164
|
+
protected readonly actionButtons: () => Promise<TestElement[]>;
|
|
165
|
+
protected readonly closeButton: () => Promise<TestElement | null>;
|
|
166
|
+
static with<T extends AuiDialogHarness>(this: ComponentHarnessConstructor<T>, options?: AuiDialogHarnessFilters): HarnessPredicate<T>;
|
|
167
|
+
getTitle(): Promise<string>;
|
|
168
|
+
getDescription(): Promise<string | null>;
|
|
169
|
+
getBodyText(): Promise<string>;
|
|
170
|
+
/** `dialog` or `alertdialog`. */
|
|
171
|
+
getRole(): Promise<string>;
|
|
172
|
+
getActionLabels(): Promise<string[]>;
|
|
173
|
+
clickAction(label: string): Promise<void>;
|
|
174
|
+
/** Text of the element that has focus inside the dialog, or null. */
|
|
175
|
+
getFocusedText(): Promise<string | null>;
|
|
176
|
+
close(): Promise<void>;
|
|
177
|
+
pressEscape(): Promise<void>;
|
|
178
|
+
}
|
|
179
|
+
/** A column header of `<aui-data-table>`. */
|
|
180
|
+
export declare class AuiDataTableHeaderHarness extends ComponentHarness {
|
|
181
|
+
static hostSelector: string;
|
|
182
|
+
protected readonly sortButton: () => Promise<TestElement | null>;
|
|
183
|
+
getText(): Promise<string>;
|
|
184
|
+
isSortable(): Promise<boolean>;
|
|
185
|
+
/** The sort direction of the primary sort (`aria-sort`), or null. */
|
|
186
|
+
getSortDirection(): Promise<'ascending' | 'descending' | null>;
|
|
187
|
+
/** Activates the sort button (cycles ascending, descending, unsorted). */
|
|
188
|
+
sort(): Promise<void>;
|
|
189
|
+
}
|
|
190
|
+
/** A rendered data row of `<aui-data-table>`. */
|
|
191
|
+
export declare class AuiDataTableRowHarness extends ComponentHarness {
|
|
192
|
+
static hostSelector: string;
|
|
193
|
+
protected readonly cells: () => Promise<TestElement[]>;
|
|
194
|
+
protected readonly selectBox: () => Promise<TestElement | null>;
|
|
195
|
+
/** Cell texts in column order (selection and expander cells are empty strings). */
|
|
196
|
+
getCellTexts(): Promise<string[]>;
|
|
197
|
+
isSelected(): Promise<boolean>;
|
|
198
|
+
/** Toggles the row's selection control. */
|
|
199
|
+
toggleSelection(): Promise<void>;
|
|
200
|
+
isEditable(columnId: string): Promise<boolean>;
|
|
201
|
+
/** True while a cell editor is open in this row (for example after an invalid value). */
|
|
202
|
+
isEditing(): Promise<boolean>;
|
|
203
|
+
/** Opens a cell editor (the row is rebuilt: query the row again afterwards). No-op while one is open. */
|
|
204
|
+
startEdit(columnId: string): Promise<void>;
|
|
205
|
+
/** Replaces the open editor's text and commits with Enter (the row is rebuilt: query it again). */
|
|
206
|
+
commitEdit(value: string): Promise<void>;
|
|
207
|
+
}
|
|
208
|
+
/** Filters for `AuiDataTableHarness.with()`. */
|
|
209
|
+
export interface AuiDataTableHarnessFilters extends BaseHarnessFilters {
|
|
210
|
+
caption?: string | RegExp;
|
|
211
|
+
}
|
|
212
|
+
/** `<aui-data-table>`: rows are the rendered data rows of the current page (or virtual window). */
|
|
213
|
+
export declare class AuiDataTableHarness extends ComponentHarness {
|
|
214
|
+
static hostSelector: string;
|
|
215
|
+
protected readonly captionElement: () => Promise<TestElement>;
|
|
216
|
+
protected readonly searchInput: () => Promise<TestElement | null>;
|
|
217
|
+
static with<T extends AuiDataTableHarness>(this: ComponentHarnessConstructor<T>, options?: AuiDataTableHarnessFilters): HarnessPredicate<T>;
|
|
218
|
+
getCaption(): Promise<string>;
|
|
219
|
+
getHeaders(): Promise<AuiDataTableHeaderHarness[]>;
|
|
220
|
+
getHeaderTexts(): Promise<string[]>;
|
|
221
|
+
getHeader(text: string): Promise<AuiDataTableHeaderHarness>;
|
|
222
|
+
getRows(): Promise<AuiDataTableRowHarness[]>;
|
|
223
|
+
/** Cell texts of every rendered row. */
|
|
224
|
+
getCellTexts(): Promise<string[][]>;
|
|
225
|
+
/** The primary sort, or null. */
|
|
226
|
+
getSort(): Promise<{
|
|
227
|
+
column: string;
|
|
228
|
+
direction: 'ascending' | 'descending';
|
|
229
|
+
} | null>;
|
|
230
|
+
sortBy(header: string): Promise<void>;
|
|
231
|
+
/** Types into the search field and presses Enter, which applies it without the typing delay. */
|
|
232
|
+
search(text: string): Promise<void>;
|
|
233
|
+
/**
|
|
234
|
+
* Opens the editor of a cell (rendered row index, column id), replaces its text, and commits
|
|
235
|
+
* with Enter. Returns the message shown for an invalid value (the editor stays open), or null.
|
|
236
|
+
*/
|
|
237
|
+
editCell(rowIndex: number, columnId: string, value: string): Promise<string | null>;
|
|
238
|
+
/** The message of an open cell editor (invalid value), or null. */
|
|
239
|
+
getEditError(): Promise<string | null>;
|
|
240
|
+
/** Moves to another page through the pager. */
|
|
241
|
+
goToPage(target: 'next' | 'previous' | 'first' | 'last' | number): Promise<void>;
|
|
242
|
+
}
|
|
243
|
+
/** `<aui-checkbox>`. */
|
|
244
|
+
export declare class AuiCheckboxHarness extends AuiFieldHarness {
|
|
245
|
+
static hostSelector: string;
|
|
246
|
+
protected readonly input: () => Promise<TestElement>;
|
|
247
|
+
static with<T extends AuiCheckboxHarness>(this: ComponentHarnessConstructor<T>, options?: AuiFieldHarnessFilters): HarnessPredicate<T>;
|
|
248
|
+
protected control(): Promise<TestElement>;
|
|
249
|
+
isChecked(): Promise<boolean>;
|
|
250
|
+
isIndeterminate(): Promise<boolean>;
|
|
251
|
+
toggle(): Promise<void>;
|
|
252
|
+
check(): Promise<void>;
|
|
253
|
+
uncheck(): Promise<void>;
|
|
254
|
+
}
|
|
255
|
+
/** `<aui-switch>`. */
|
|
256
|
+
export declare class AuiSwitchHarness extends AuiFieldHarness {
|
|
257
|
+
static hostSelector: string;
|
|
258
|
+
protected readonly input: () => Promise<TestElement>;
|
|
259
|
+
static with<T extends AuiSwitchHarness>(this: ComponentHarnessConstructor<T>, options?: AuiFieldHarnessFilters): HarnessPredicate<T>;
|
|
260
|
+
protected control(): Promise<TestElement>;
|
|
261
|
+
isChecked(): Promise<boolean>;
|
|
262
|
+
toggle(): Promise<void>;
|
|
263
|
+
}
|
|
264
|
+
/** `<aui-radio-group>`. */
|
|
265
|
+
export declare class AuiRadioGroupHarness extends AuiFieldHarness {
|
|
266
|
+
#private;
|
|
267
|
+
static hostSelector: string;
|
|
268
|
+
protected readonly inputs: () => Promise<TestElement[]>;
|
|
269
|
+
protected readonly labels: () => Promise<TestElement[]>;
|
|
270
|
+
static with<T extends AuiRadioGroupHarness>(this: ComponentHarnessConstructor<T>, options?: AuiFieldHarnessFilters): HarnessPredicate<T>;
|
|
271
|
+
protected control(): Promise<TestElement>;
|
|
272
|
+
getOptionLabels(): Promise<string[]>;
|
|
273
|
+
/** Label of the checked option, or null. */
|
|
274
|
+
getCheckedLabel(): Promise<string | null>;
|
|
275
|
+
isOptionDisabled(label: string): Promise<boolean>;
|
|
276
|
+
select(label: string): Promise<void>;
|
|
277
|
+
}
|
|
278
|
+
/** `<aui-textarea>`. */
|
|
279
|
+
export declare class AuiTextareaHarness extends AuiFieldHarness {
|
|
280
|
+
static hostSelector: string;
|
|
281
|
+
protected readonly input: () => Promise<TestElement>;
|
|
282
|
+
static with<T extends AuiTextareaHarness>(this: ComponentHarnessConstructor<T>, options?: AuiFieldHarnessFilters): HarnessPredicate<T>;
|
|
283
|
+
protected control(): Promise<TestElement>;
|
|
284
|
+
getValue(): Promise<string>;
|
|
285
|
+
setValue(value: string): Promise<void>;
|
|
286
|
+
}
|
|
287
|
+
/** `<aui-number-input>`: typing and the spin button keys. */
|
|
288
|
+
export declare class AuiNumberInputHarness extends AuiFieldHarness {
|
|
289
|
+
static hostSelector: string;
|
|
290
|
+
protected readonly input: () => Promise<TestElement>;
|
|
291
|
+
static with<T extends AuiNumberInputHarness>(this: ComponentHarnessConstructor<T>, options?: AuiFieldHarnessFilters): HarnessPredicate<T>;
|
|
292
|
+
protected control(): Promise<TestElement>;
|
|
293
|
+
/** The text shown (formatted for the locale). */
|
|
294
|
+
getText(): Promise<string>;
|
|
295
|
+
/** The value as announced (`aria-valuenow`), or null when empty. */
|
|
296
|
+
getValue(): Promise<number | null>;
|
|
297
|
+
/** Types text and leaves the field, as a user would. */
|
|
298
|
+
setText(text: string): Promise<void>;
|
|
299
|
+
increment(): Promise<void>;
|
|
300
|
+
decrement(): Promise<void>;
|
|
301
|
+
}
|
|
302
|
+
/** `<aui-combobox>`: typing, options (static or loaded), choosing. */
|
|
303
|
+
export declare class AuiComboboxHarness extends AuiFieldHarness {
|
|
304
|
+
static hostSelector: string;
|
|
305
|
+
protected readonly labelElement: () => Promise<TestElement | null>;
|
|
306
|
+
protected readonly descriptionElement: () => Promise<TestElement | null>;
|
|
307
|
+
protected readonly errorElement: () => Promise<TestElement | null>;
|
|
308
|
+
protected readonly input: () => Promise<TestElement>;
|
|
309
|
+
protected readonly options: () => Promise<TestElement[]>;
|
|
310
|
+
static with<T extends AuiComboboxHarness>(this: ComponentHarnessConstructor<T>, options?: AuiFieldHarnessFilters): HarnessPredicate<T>;
|
|
311
|
+
getLabel(): Promise<string>;
|
|
312
|
+
protected control(): Promise<TestElement>;
|
|
313
|
+
getInputText(): Promise<string>;
|
|
314
|
+
isOpen(): Promise<boolean>;
|
|
315
|
+
/** Replaces the text by typing (filters the options or starts a load). */
|
|
316
|
+
type(text: string): Promise<void>;
|
|
317
|
+
/** Labels of the options shown. */
|
|
318
|
+
getOptionLabels(): Promise<string[]>;
|
|
319
|
+
/** Waits (up to `timeout` ms) until at least one option is shown: loads are debounced outside Angular's stability tracking. */
|
|
320
|
+
waitForOptions(timeout?: number): Promise<string[]>;
|
|
321
|
+
selectOption(label: string | RegExp): Promise<void>;
|
|
322
|
+
}
|
|
323
|
+
/** `<aui-multi-select>`: typing, toggling options, selected chips. */
|
|
324
|
+
export declare class AuiMultiSelectHarness extends AuiFieldHarness {
|
|
325
|
+
static hostSelector: string;
|
|
326
|
+
protected readonly labelElement: () => Promise<TestElement | null>;
|
|
327
|
+
protected readonly descriptionElement: () => Promise<TestElement | null>;
|
|
328
|
+
protected readonly errorElement: () => Promise<TestElement | null>;
|
|
329
|
+
protected readonly input: () => Promise<TestElement>;
|
|
330
|
+
protected readonly toggle: () => Promise<TestElement>;
|
|
331
|
+
protected readonly chipLabels: () => Promise<TestElement[]>;
|
|
332
|
+
protected readonly removeButtons: () => Promise<TestElement[]>;
|
|
333
|
+
protected readonly options: () => Promise<TestElement[]>;
|
|
334
|
+
static with<T extends AuiMultiSelectHarness>(this: ComponentHarnessConstructor<T>, options?: AuiFieldHarnessFilters): HarnessPredicate<T>;
|
|
335
|
+
getLabel(): Promise<string>;
|
|
336
|
+
protected control(): Promise<TestElement>;
|
|
337
|
+
isOpen(): Promise<boolean>;
|
|
338
|
+
open(): Promise<void>;
|
|
339
|
+
close(): Promise<void>;
|
|
340
|
+
/** Replaces the text by typing (filters the options or starts a load). */
|
|
341
|
+
type(text: string): Promise<void>;
|
|
342
|
+
/** Labels of the selected values (the chips), in selection order. */
|
|
343
|
+
getSelectedLabels(): Promise<string[]>;
|
|
344
|
+
/** Labels of the options shown (including "Select all" when enabled). */
|
|
345
|
+
getOptionLabels(): Promise<string[]>;
|
|
346
|
+
/** Toggles the option with this label (opens the list first). */
|
|
347
|
+
toggleOption(label: string | RegExp): Promise<void>;
|
|
348
|
+
/** Removes a selected value with its chip remove button (not available when read-only or disabled). */
|
|
349
|
+
removeValue(label: string): Promise<void>;
|
|
350
|
+
}
|
|
351
|
+
/** Filters for `AuiSidebarHarness.with()`. */
|
|
352
|
+
export interface AuiSidebarHarnessFilters extends BaseHarnessFilters {
|
|
353
|
+
label?: string | RegExp;
|
|
354
|
+
}
|
|
355
|
+
/** `<aui-sidebar>`. */
|
|
356
|
+
export declare class AuiSidebarHarness extends ComponentHarness {
|
|
357
|
+
#private;
|
|
358
|
+
static hostSelector: string;
|
|
359
|
+
protected readonly nav: () => Promise<TestElement>;
|
|
360
|
+
protected readonly items: () => Promise<TestElement[]>;
|
|
361
|
+
protected readonly toggleButton: () => Promise<TestElement | null>;
|
|
362
|
+
static with<T extends AuiSidebarHarness>(this: ComponentHarnessConstructor<T>, options?: AuiSidebarHarnessFilters): HarnessPredicate<T>;
|
|
363
|
+
getLabel(): Promise<string>;
|
|
364
|
+
/** Labels of the visible items (items of collapsed groups are hidden). */
|
|
365
|
+
getItemLabels(): Promise<string[]>;
|
|
366
|
+
/** Label of the current item (`aria-current="page"`), or null. */
|
|
367
|
+
getCurrentLabel(): Promise<string | null>;
|
|
368
|
+
/** Activates an item or toggles a group, as a click does. */
|
|
369
|
+
click(label: string): Promise<void>;
|
|
370
|
+
isGroupExpanded(label: string): Promise<boolean>;
|
|
371
|
+
isCollapsed(): Promise<boolean>;
|
|
372
|
+
/** The collapse button (inline mode, collapsible). */
|
|
373
|
+
toggleCollapsed(): Promise<void>;
|
|
374
|
+
}
|
|
375
|
+
/** `<aui-pagination>`. */
|
|
376
|
+
export declare class AuiPaginationHarness extends ComponentHarness {
|
|
377
|
+
static hostSelector: string;
|
|
378
|
+
protected readonly current: () => Promise<TestElement | null>;
|
|
379
|
+
protected readonly pageButtons: () => Promise<TestElement[]>;
|
|
380
|
+
getCurrentPage(): Promise<number | null>;
|
|
381
|
+
/** Page numbers shown as buttons (ellipses are not pages). */
|
|
382
|
+
getPageNumbers(): Promise<number[]>;
|
|
383
|
+
isDisabled(target: 'next' | 'previous' | 'first' | 'last'): Promise<boolean>;
|
|
384
|
+
goTo(target: 'next' | 'previous' | 'first' | 'last' | number): Promise<void>;
|
|
385
|
+
}
|
|
386
|
+
/** A menu item, as the harness reads it. */
|
|
387
|
+
export interface AuiMenuItem {
|
|
388
|
+
label: string;
|
|
389
|
+
disabled: boolean;
|
|
390
|
+
/** For checkbox and radio items; null for actions. */
|
|
391
|
+
checked: boolean | null;
|
|
392
|
+
hasSubmenu: boolean;
|
|
393
|
+
}
|
|
394
|
+
/** Filters for `AuiMenuHarness.with()`. */
|
|
395
|
+
export interface AuiMenuHarnessFilters extends BaseHarnessFilters {
|
|
396
|
+
/** Trigger text. */
|
|
397
|
+
triggerText?: string | RegExp;
|
|
398
|
+
}
|
|
399
|
+
/** `button[auiMenu]`: the trigger; the menu renders next to it, so items are read from the document. */
|
|
400
|
+
export declare class AuiMenuHarness extends ComponentHarness {
|
|
401
|
+
#private;
|
|
402
|
+
static hostSelector: string;
|
|
403
|
+
static with<T extends AuiMenuHarness>(this: ComponentHarnessConstructor<T>, options?: AuiMenuHarnessFilters): HarnessPredicate<T>;
|
|
404
|
+
isOpen(): Promise<boolean>;
|
|
405
|
+
open(): Promise<void>;
|
|
406
|
+
close(): Promise<void>;
|
|
407
|
+
/** Items of the top-level menu (opens it). */
|
|
408
|
+
getItems(): Promise<AuiMenuItem[]>;
|
|
409
|
+
/** Opens the menu and activates the item at `path` (submenus by their labels). */
|
|
410
|
+
select(...path: string[]): Promise<void>;
|
|
411
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/*! AbsoluteUI @absoluteui/angular v0.13.2 | (c) Kasadara Technology Solutions Pvt Ltd | Apache-2.0 | https://aui.kasadara.com/license/ */
|
|
2
|
+
import{ComponentHarness as o,HarnessPredicate as s,TestKey as c}from"@angular/cdk/testing";async function p(e){if(!e||await e.getProperty("hidden"))return null;const t=(await e.text()).trim();return t===""?null:t}async function d(e,t){return e?(await e.text({exclude:t})).trim():""}class x extends o{static hostSelector="button.aui-button, a.aui-button";static with(t={}){return new s(this,t).addOption("text",t.text,(a,i)=>s.stringMatches(a.getText(),i)).addOption("variant",t.variant,async(a,i)=>await a.getVariant()===i)}async getText(){const t=await this.host(),a=(await t.text()).trim();return a!==""?a:await t.getAttribute("aria-label")??""}async getVariant(){const t=await this.host();for(const a of["primary","secondary","outline","ghost","danger"])if(await t.hasClass("aui-button--".concat(a)))return a;return null}async isDisabled(){const t=await this.host();return await t.getProperty("disabled")||await t.getAttribute("aria-disabled")==="true"}async isLoading(){return await(await this.host()).getAttribute("data-loading")!==null}async isLink(){return(await this.host()).matchesSelector("a")}async click(){await(await this.host()).click()}async focus(){await(await this.host()).focus()}}class n extends o{labelElement=this.locatorForOptional(".aui-field__label");descriptionElement=this.locatorForOptional(".aui-field__description");errorElement=this.locatorForOptional(".aui-field__error");async getLabel(){return d(await this.labelElement(),".aui-field__required")}async getDescription(){return p(await this.descriptionElement())}async getErrorMessage(){return p(await this.errorElement())}async isRequired(){const t=await this.control();return await t.getAttribute("aria-required")==="true"||await t.getProperty("required")}async isDisabled(){const t=await this.control();return await t.getProperty("disabled")||await t.getAttribute("aria-disabled")==="true"}async isInvalid(){return await(await this.control()).getAttribute("aria-invalid")==="true"}async focus(){await(await this.control()).focus()}async blur(){await(await this.control()).blur()}}function l(e,t){return new s(e,t).addOption("label",t.label,(a,i)=>s.stringMatches(a.getLabel(),i))}class f extends n{static hostSelector="aui-text-input";input=this.locatorFor("input.aui-text-input__input");static with(t={}){return l(this,t)}control(){return this.input()}async getValue(){return(await this.input()).getProperty("value")}async setValue(t){const a=await this.input();await a.clear(),t!==""&&await a.sendKeys(t)}async getPlaceholder(){return await(await this.input()).getAttribute("placeholder")??""}}class A extends n{static hostSelector="aui-select";trigger=this.locatorFor('[role="combobox"]');valueElement=this.locatorFor(".aui-select__value");options=this.locatorForAll('[role="option"]');static with(t={}){return l(this,t)}control(){return this.trigger()}async getValueText(){return(await(await this.valueElement()).text()).trim()}async isOpen(){return await(await this.trigger()).getAttribute("aria-expanded")==="true"}async open(){await this.isOpen()||await(await this.trigger()).click()}async close(){await this.isOpen()&&await(await this.trigger()).sendKeys(c.ESCAPE)}async getOptions(){await this.open();const t=[];for(const a of await this.options())t.push({label:(await a.text({exclude:".aui-select__option-description"})).trim(),disabled:await a.getAttribute("aria-disabled")==="true",selected:await a.getAttribute("aria-selected")==="true"});return t}async selectOption(t){await this.open();for(const a of await this.options()){const i=(await a.text({exclude:".aui-select__option-description"})).trim();if(typeof t=="string"?i===t:t.test(i)){await a.click();return}}throw new Error("AuiSelectHarness: no option matches ".concat(String(t),"."))}}class E extends n{static hostSelector="aui-date-picker";labelElement=this.locatorForOptional(".aui-date-input__label");descriptionElement=this.locatorForOptional(".aui-date-input__description");errorElement=this.locatorForOptional(".aui-date-input__error");group=this.locatorFor(".aui-date-input__group");segments=this.locatorForAll("input.aui-date-input__segment");calendarButton=this.locatorFor("button.aui-date-picker__button");popup=this.locatorFor(".aui-date-picker__popup");heading=this.locatorForOptional(".aui-date-picker__popup .aui-calendar__heading");days=this.locatorForAll(".aui-date-picker__popup td.aui-calendar__day:not(.aui-calendar__day--empty):not(.aui-calendar__day--outside)");static with(t={}){return l(this,t)}async getLabel(){return d(await this.labelElement(),".aui-date-input__required, .aui-field__required")}async control(){const[t]=await this.segments();return t??this.group()}async getSegments(){return Promise.all((await this.segments()).map(t=>t.getProperty("value")))}async typeDate(t){const a={year:String(t.year),month:String(t.month).padStart(2,"0"),day:String(t.day).padStart(2,"0")};for(const i of await this.segments()){const r=(await i.getAttribute("aria-label")??"").toLowerCase(),u=a[r];u!==void 0&&(await i.clear(),await i.sendKeys(u))}await(await this.control()).blur()}async isCalendarOpen(){return!await(await this.popup()).getProperty("hidden")}async openCalendar(){await this.isCalendarOpen()||await(await this.calendarButton()).click()}async getCalendarMonth(){return await this.openCalendar(),(await(await this.heading())?.text())?.trim()??""}async getDayLabels(){return await this.openCalendar(),Promise.all((await this.days()).map(async t=>await t.getAttribute("aria-label")??""))}async isDayDisabled(t){return await(await this.#t(t)).getAttribute("aria-disabled")==="true"}async selectDay(t){await(await this.#t(t)).click()}async nextMonth(){await this.openCalendar(),await(await this.locatorFor('.aui-date-picker__popup button[aria-label="Next month"]')()).click()}async previousMonth(){await this.openCalendar(),await(await this.locatorFor('.aui-date-picker__popup button[aria-label="Previous month"]')()).click()}async#t(t){await this.openCalendar();for(const a of await this.days())if((await a.text()).trim()===String(t))return a;throw new Error("AuiDatePickerHarness: day ".concat(String(t)," is not in the visible month."))}}class F extends o{static hostSelector="aui-tabs";list=this.locatorFor('[role="tablist"]');tabs=this.locatorForAll('[role="tab"]');panels=this.locatorForAll('[role="tabpanel"]');static with(t={}){return new s(this,t).addOption("label",t.label,async(a,i)=>s.stringMatches(a.getLabel(),i))}async getLabel(){return await(await this.list()).getAttribute("aria-label")??""}async getTabLabels(){return Promise.all((await this.tabs()).map(async t=>(await t.text()).trim()))}async getSelectedTabLabel(){for(const t of await this.tabs())if(await t.getAttribute("aria-selected")==="true")return(await t.text()).trim();return null}async isTabDisabled(t){const a=await this.#t(t);return await a.getProperty("disabled")||await a.getAttribute("aria-disabled")==="true"}async selectTab(t){await(await this.#t(t)).click()}async getPanelText(){for(const t of await this.panels())if(!await t.getProperty("hidden"))return(await t.text()).trim();return""}async#t(t){for(const a of await this.tabs())if((await a.text()).trim()===t)return a;throw new Error('AuiTabsHarness: no tab "'.concat(t,'".'))}}class O extends o{static hostSelector="dialog.aui-dialog[open]";titleElement=this.locatorFor(".aui-dialog__title");descriptionElement=this.locatorForOptional(".aui-dialog__description");bodyElement=this.locatorFor(".aui-dialog__body");actionButtons=this.locatorForAll(".aui-dialog__footer button");closeButton=this.locatorForOptional("button.aui-dialog__close");static with(t={}){return new s(this,t).addOption("title",t.title,(a,i)=>s.stringMatches(a.getTitle(),i))}async getTitle(){return(await(await this.titleElement()).text()).trim()}async getDescription(){return p(await this.descriptionElement())}async getBodyText(){return(await(await this.bodyElement()).text()).trim()}async getRole(){return await(await this.host()).getAttribute("role")??"dialog"}async getActionLabels(){return Promise.all((await this.actionButtons()).map(async t=>(await t.text()).trim()))}async clickAction(t){for(const a of await this.actionButtons())if((await a.text()).trim()===t){await a.click();return}throw new Error('AuiDialogHarness: no action "'.concat(t,'".'))}async getFocusedText(){const t=await this.locatorForOptional(":focus")();return t?(await t.text()).trim():null}async close(){const t=await this.closeButton();if(!t)throw new Error("AuiDialogHarness: the dialog has no close button.");await t.click()}async pressEscape(){await(await this.host()).sendKeys(c.ESCAPE)}}const g=".aui-data-table__visually-hidden, .aui-data-table__sort-priority";class y extends o{static hostSelector="thead tr.aui-data-table__header-row > th";sortButton=this.locatorForOptional("button.aui-data-table__sort");async getText(){return(await(await this.host()).text({exclude:g})).trim()}async isSortable(){return await this.sortButton()!==null}async getSortDirection(){const t=await(await this.host()).getAttribute("aria-sort");return t==="ascending"||t==="descending"?t:null}async sort(){const t=await this.sortButton();if(!t)throw new Error("AuiDataTableHeaderHarness: the column is not sortable.");await t.click()}}class m extends o{static hostSelector="tbody tr.aui-data-table__row:not(.aui-data-table__skeleton-row)";cells=this.locatorForAll(":scope > th, :scope > td");selectBox=this.locatorForOptional("input[data-row-id]");async getCellTexts(){return Promise.all((await this.cells()).map(async t=>(await t.text({exclude:g})).trim()))}async isSelected(){return(await this.host()).hasClass("aui-data-table__row--selected")}async toggleSelection(){const t=await this.selectBox();if(!t)throw new Error("AuiDataTableRowHarness: the row has no selection control.");await t.click()}async isEditable(t){return await this.locatorForOptional('button.aui-data-table__edit[data-column="'.concat(t,'"]'))()!==null}async isEditing(){return await this.locatorForOptional(".aui-data-table__editor")()!==null}async startEdit(t){if(await this.isEditing())return;const a=await this.locatorForOptional('button.aui-data-table__edit[data-column="'.concat(t,'"]'))();if(!a)throw new Error('AuiDataTableRowHarness: column "'.concat(t,'" is not editable in this row.'));await a.click()}async commitEdit(t){const a=await this.locatorFor(".aui-data-table__editor input")();await a.clear(),t!==""&&await a.sendKeys(t),await a.sendKeys(c.ENTER)}}class S extends o{static hostSelector="aui-data-table";captionElement=this.locatorFor("caption");searchInput=this.locatorForOptional("input.aui-data-table__search-input");static with(t={}){return new s(this,t).addOption("caption",t.caption,(a,i)=>s.stringMatches(a.getCaption(),i))}async getCaption(){return(await(await this.captionElement()).text()).trim()}getHeaders(){return this.locatorForAll(y)()}async getHeaderTexts(){return Promise.all((await this.getHeaders()).map(t=>t.getText()))}async getHeader(t){for(const a of await this.getHeaders())if(await a.getText()===t)return a;throw new Error('AuiDataTableHarness: no column "'.concat(t,'".'))}getRows(){return this.locatorForAll(m)()}async getCellTexts(){return Promise.all((await this.getRows()).map(t=>t.getCellTexts()))}async getSort(){for(const t of await this.getHeaders()){const a=await t.getSortDirection();if(a)return{column:await t.getText(),direction:a}}return null}async sortBy(t){await(await this.getHeader(t)).sort()}async search(t){const a=await this.searchInput();if(!a)throw new Error("AuiDataTableHarness: the table is not searchable.");await a.clear(),t!==""&&await a.sendKeys(t),await a.sendKeys(c.ENTER)}async editCell(t,a,i){const r=(await this.getRows())[t];if(!r)throw new Error("AuiDataTableHarness: no row ".concat(String(t),"."));await r.startEdit(a);const u=(await this.getRows())[t];if(!u)throw new Error("AuiDataTableHarness: no row ".concat(String(t),"."));return await u.commitEdit(i),this.getEditError()}async getEditError(){return p(await this.locatorForOptional(".aui-data-table__edit-error")())}async goToPage(t){const a=typeof t=="number"?'.aui-data-table__pagination button[data-page="'.concat(String(t),'"]'):'.aui-data-table__pagination button[data-key="'.concat(t,'"]');await(await this.locatorFor(a)()).click()}}class k extends n{static hostSelector="aui-checkbox";input=this.locatorFor("input.aui-checkbox__input");static with(t={}){return l(this,t)}control(){return this.input()}async isChecked(){return(await this.input()).getProperty("checked")}async isIndeterminate(){return(await this.input()).getProperty("indeterminate")}async toggle(){await(await this.input()).click()}async check(){await this.isChecked()||await this.toggle()}async uncheck(){await this.isChecked()&&await this.toggle()}}class H extends n{static hostSelector="aui-switch";input=this.locatorFor("input.aui-switch__input");static with(t={}){return l(this,t)}control(){return this.input()}async isChecked(){return(await this.input()).getProperty("checked")}async toggle(){await(await this.input()).click()}}class T extends n{static hostSelector="aui-radio-group";inputs=this.locatorForAll("input.aui-radio-group__input");labels=this.locatorForAll(".aui-radio-group__option .aui-radio-group__label");static with(t={}){return l(this,t)}async control(){const[t]=await this.inputs();if(!t)throw new Error("AuiRadioGroupHarness: no options.");return t}async getOptionLabels(){return Promise.all((await this.labels()).map(async t=>(await t.text()).trim()))}async getCheckedLabel(){const t=await this.inputs(),a=await this.getOptionLabels();for(const[i,r]of t.entries())if(await r.getProperty("checked"))return a[i]??null;return null}async isOptionDisabled(t){return await(await this.#t(t)).getProperty("disabled")}async select(t){await(await this.#t(t)).click()}async#t(t){const a=await this.getOptionLabels(),i=(await this.inputs())[a.indexOf(t)];if(!i)throw new Error('AuiRadioGroupHarness: no option "'.concat(t,'".'));return i}}class P extends n{static hostSelector="aui-textarea";input=this.locatorFor("textarea.aui-textarea__input");static with(t={}){return l(this,t)}control(){return this.input()}async getValue(){return(await this.input()).getProperty("value")}async setValue(t){const a=await this.input();await a.clear(),t!==""&&await a.sendKeys(t)}}class C extends n{static hostSelector="aui-number-input";input=this.locatorFor('input[role="spinbutton"]');static with(t={}){return l(this,t)}control(){return this.input()}async getText(){return(await this.input()).getProperty("value")}async getValue(){const t=await(await this.input()).getAttribute("aria-valuenow");return t===null||t===""?null:Number(t)}async setText(t){const a=await this.input();await a.clear(),t!==""&&await a.sendKeys(t),await a.blur()}async increment(){await(await this.input()).sendKeys(c.UP_ARROW)}async decrement(){await(await this.input()).sendKeys(c.DOWN_ARROW)}}class D extends n{static hostSelector="aui-combobox";labelElement=this.locatorForOptional(".aui-combobox__label");descriptionElement=this.locatorForOptional(".aui-combobox__description");errorElement=this.locatorForOptional(".aui-combobox__error");input=this.locatorFor('input[role="combobox"]');options=this.locatorForAll('[role="option"]');static with(t={}){return l(this,t)}async getLabel(){return d(await this.labelElement(),".aui-combobox__required, .aui-field__required")}control(){return this.input()}async getInputText(){return(await this.input()).getProperty("value")}async isOpen(){return await(await this.input()).getAttribute("aria-expanded")==="true"}async type(t){const a=await this.input();await a.clear(),t!==""&&await a.sendKeys(t)}async getOptionLabels(){return Promise.all((await this.options()).map(async t=>(await t.text({exclude:".aui-combobox__option-description"})).trim()))}async waitForOptions(t=2e3){const a=Date.now()+t;for(;;){await this.forceStabilize();const i=await this.getOptionLabels();if(i.length>0||Date.now()>a)return i;await new Promise(r=>setTimeout(r,25))}}async selectOption(t){for(const a of await this.options()){const i=(await a.text({exclude:".aui-combobox__option-description"})).trim();if(typeof t=="string"?i===t:t.test(i)){await a.click();return}}throw new Error("AuiComboboxHarness: no option matches ".concat(String(t),"."))}}class L extends n{static hostSelector="aui-multi-select";labelElement=this.locatorForOptional(".aui-multi-select__label");descriptionElement=this.locatorForOptional(".aui-multi-select__description");errorElement=this.locatorForOptional(".aui-multi-select__error");input=this.locatorFor('input[role="combobox"]');toggle=this.locatorFor(".aui-multi-select__toggle");chipLabels=this.locatorForAll(".aui-multi-select__chip-label");removeButtons=this.locatorForAll(".aui-multi-select__remove");options=this.locatorForAll('[role="option"]');static with(t={}){return l(this,t)}async getLabel(){return d(await this.labelElement(),".aui-field__required")}control(){return this.input()}async isOpen(){return await(await this.input()).getAttribute("aria-expanded")==="true"}async open(){await this.isOpen()||await(await this.toggle()).click()}async close(){await this.isOpen()&&await(await this.input()).sendKeys(c.ESCAPE)}async type(t){const a=await this.input();await a.clear(),t!==""&&await a.sendKeys(t)}async getSelectedLabels(){return Promise.all((await this.chipLabels()).map(async t=>(await t.text()).trim()))}async getOptionLabels(){return Promise.all((await this.options()).map(async t=>(await t.text({exclude:".aui-multi-select__option-description"})).trim()))}async toggleOption(t){await this.open();for(const a of await this.options()){const i=(await a.text({exclude:".aui-multi-select__option-description"})).trim();if(typeof t=="string"?i===t:t.test(i)){await a.click();return}}throw new Error("AuiMultiSelectHarness: no option matches ".concat(String(t),"."))}async removeValue(t){const a=(await this.getSelectedLabels()).indexOf(t),i=a<0?void 0:(await this.removeButtons())[a];if(!i)throw new Error("AuiMultiSelectHarness: no removable selected value ".concat(t,"."));await i.click()}}class v extends o{static hostSelector="aui-sidebar";nav=this.locatorFor("nav.aui-sidebar__nav");items=this.locatorForAll(".aui-sidebar__item");toggleButton=this.locatorForOptional("button.aui-sidebar__toggle");static with(t={}){return new s(this,t).addOption("label",t.label,(a,i)=>s.stringMatches(a.getLabel(),i))}async getLabel(){return await(await this.nav()).getAttribute("aria-label")??""}async getItemLabels(){const t=[];for(const a of await this.items())await a.matchesSelector("[hidden] *")||t.push(await this.#t(a));return t}async getCurrentLabel(){for(const t of await this.items())if(await t.getAttribute("aria-current")==="page")return this.#t(t);return null}async click(t){await(await this.#a(t)).click()}async isGroupExpanded(t){return await(await this.#a(t)).getAttribute("aria-expanded")==="true"}async isCollapsed(){return(await this.host()).hasClass("aui-sidebar--collapsed")}async toggleCollapsed(){const t=await this.toggleButton();if(!t)throw new Error("AuiSidebarHarness: the sidebar is not collapsible.");await t.click()}async#t(t){return(await t.text({exclude:".aui-sidebar__icon"})).trim()}async#a(t){for(const a of await this.items())if(await this.#t(a)===t)return a;throw new Error('AuiSidebarHarness: no item "'.concat(t,'".'))}}class $ extends o{static hostSelector="aui-pagination";current=this.locatorForOptional('[aria-current="page"]');pageButtons=this.locatorForAll("button[data-page]");async getCurrentPage(){const t=await this.current(),a=t?await t.getAttribute("data-page"):null;return a===null?null:Number(a)}async getPageNumbers(){return Promise.all((await this.pageButtons()).map(async t=>Number(await t.getAttribute("data-page"))))}async isDisabled(t){const a=await this.locatorFor('button[data-key="'.concat(t,'"]'))();return await a.getProperty("disabled")||await a.getAttribute("aria-disabled")==="true"}async goTo(t){const a=typeof t=="number"?'button[data-page="'.concat(String(t),'"]'):'button[data-key="'.concat(t,'"]');await(await this.locatorFor(a)()).click()}}const b=".aui-menu__description, .aui-menu__shortcut, .aui-menu__custom";class R extends o{static hostSelector='button[aria-haspopup="menu"]';static with(t={}){return new s(this,t).addOption("triggerText",t.triggerText,async(a,i)=>s.stringMatches((await a.host()).text(),i))}async isOpen(){return await(await this.host()).getAttribute("aria-expanded")==="true"}async open(){await this.isOpen()||await(await this.host()).click()}async close(){await this.isOpen()&&await(await this.#a()).sendKeys(c.ESCAPE)}async getItems(){await this.open();const t=await this.#t(),a=await this.documentRootLocatorFactory().locatorForAll("#".concat(t,' > [role^="menuitem"], #').concat(t,' > .aui-menu__group > [role^="menuitem"]'))();return Promise.all(a.map(async i=>{const r=await i.getAttribute("aria-checked");return{label:(await i.text({exclude:b})).trim(),disabled:await i.getAttribute("aria-disabled")==="true",checked:r===null?null:r==="true",hasSubmenu:await i.getAttribute("aria-haspopup")==="menu"}}))}async select(...t){await this.open();let a=await this.#t();for(const[i,r]of t.entries()){const u=await this.documentRootLocatorFactory().locatorForAll("#".concat(a,' [role^="menuitem"]'))();let w=null;for(const h of u)(await h.text({exclude:b})).trim()===r&&(w=h);if(!w)throw new Error('AuiMenuHarness: no item "'.concat(r,'".'));if(await w.click(),i<t.length-1){const h=await w.getAttribute("aria-controls");if(!h)throw new Error('AuiMenuHarness: "'.concat(r,'" has no submenu.'));a=h}}}async#t(){const t=await(await this.host()).getAttribute("aria-controls");if(!t)throw new Error("AuiMenuHarness: the trigger controls no menu.");return t}async#a(){return this.documentRootLocatorFactory().locatorFor("#".concat(await this.#t()))()}}export{x as AuiButtonHarness,k as AuiCheckboxHarness,D as AuiComboboxHarness,S as AuiDataTableHarness,y as AuiDataTableHeaderHarness,m as AuiDataTableRowHarness,E as AuiDatePickerHarness,O as AuiDialogHarness,n as AuiFieldHarness,R as AuiMenuHarness,L as AuiMultiSelectHarness,C as AuiNumberInputHarness,$ as AuiPaginationHarness,T as AuiRadioGroupHarness,A as AuiSelectHarness,v as AuiSidebarHarness,H as AuiSwitchHarness,F as AuiTabsHarness,f as AuiTextInputHarness,P as AuiTextareaHarness};
|