@gravitee/graphene-core 3.44.0 → 3.44.1-feat-found-397-data-table-test-ids.a98a6f0

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/USAGE_GUIDE.md CHANGED
@@ -680,7 +680,7 @@ Use **name-column-as-link**: the primary identifier column (always leftmost) is
680
680
  - Destructive actions go last in the menu, after a `DropdownMenuSeparator`.
681
681
  - Name the ⋮ button after its row: ``aria-label={`Actions for ${entity.name}`}``.
682
682
  - A destructive action asks for confirmation in a `Dialog` before it runs, then reports the outcome in a toast (`toast` from `@gravitee/graphene-core`, shown by the app's `Toaster`). When the dialog closes, give the focus back to the ⋮ if the user cancelled. Once the entity is deleted, its row and ⋮ go: move the focus to the search field, as Reset does. See `EntityActionsMenu.tsx` and `DeleteEntityDialog.tsx` in the list page snippet.
683
- - Key the rows by entity (`tableOptions={{ getRowId: (entity) => entity.id }}`), so that a removed row never hands its focused ⋮ to the next entity. Not with `selectionMode="multi"` for now: `onSelectionChange` still maps the selection by row index.
683
+ - Key the rows by entity (`tableOptions={{ getRowId: (entity) => entity.id }}`), so that a removed row never hands its focused ⋮ to the next entity.
684
684
 
685
685
  #### Column ordering
686
686
 
@@ -1009,8 +1009,8 @@ Every interactive base component exports a matching `xHarness` factory — `Butt
1009
1009
  A few cases worth remembering:
1010
1010
 
1011
1011
  - **`RadioGroup` exposes two harnesses** — `radioGroupHarness` (group-level: `select(value)`, `getValue`, `getOptions`) and `radioHarness` (single radio: `select`, `isSelected`, `getValue`).
1012
- - **`Table` returns a row sub-harness** — `tableHarness().getRow(matcher)` returns a `TableRowHarness` exposing `getCells`, `getCellText(header)`, `getCellElement(header)`. The cell element is the hook to scope another harness inside a specific row (see the **Tables** section below).
1013
- - **`DataTable` is composed but exported via `/testing`** — most harnesses are for base primitives, but `dataTableHarness` is exposed because it adds sorting, selection, empty/loading state on top of the inner `<Table>`. Its rows extend `TableRowHarness` with `isSelected`, `select`, `unselect`.
1012
+ - **`Table` returns a row sub-harness** — `tableHarness().getRow(matcher)` returns a `TableRowHarness` exposing `getTestId`, `getCells`, `getCellText(header)`, `getCellElement(header)`. The matcher is a position (from 0), the row's text (a string or a RegExp), or `{ testId }`, an exact match on the row's `data-testid`; `queryRow` takes the text or `{ testId }` and returns `null` when no row matches. The cell element is the hook to scope another harness inside a specific row (see the **Tables** section below).
1013
+ - **`DataTable` is composed but exported via `/testing`** — most harnesses are for base primitives, but `dataTableHarness` is exposed because it adds sorting, selection, empty/loading state on top of the inner `<Table>`. Its rows extend `TableRowHarness` with `isSelected`, `select`, `unselect`, and its `getRow` / `queryRow` take the same matchers: `dataTableHarness().getRow({ testId: 'apis-row-<apiId>' })` picks the row of a `DataTable` with `data-testid="apis"` and `getRowId`.
1014
1014
  - **`PasswordInput` is composed but exported via `/testing`** — `passwordInputHarness` wraps the inner `<input>` and its reveal toggle so you don't have to know the internal `data-slot`. Adds `toggle()`, `isMasked()`, `isRevealed()`, `hasToggle()`, `getToggleLabel()`, `isToggleDisabled()` on top of the usual `type`/`getValue`/`isDisabled`.
1015
1015
  - **`PageHeader` is composed and static, but exported via `/testing`**: `pageHeaderHarness` finds the header through its page `<h1>` (`name` matches the title) and exposes `getTitle`, `getDescription`, `hasActions`, `getActions` (a scope for `buttonHarness`) and `getContent`, so you don't have to know its internal `data-slot`s.
1016
1016
  - **`SearchField` is composed but exported via `/testing`**: `searchFieldHarness` finds the field by its `searchbox` role (`name` matches its `aria-label`) and adds `clear()`, which clicks the "Clear search" button, and `hasClearButton()` to `type`, `focus`, `getValue`, `getPlaceholder`, `isDisabled` and `getElement`. Its actions do not pause between keystrokes, so they also run under fake timers (see **Search field** for the Vitest caveat).
@@ -1052,7 +1052,7 @@ The platform e2e suite selects elements by `data-testid` only. These are the rul
1052
1052
 
1053
1053
  **Rules**
1054
1054
 
1055
- - **One attribute.** The test id is the `data-testid` attribute, on every component, base and composed. There is no `testId` or `testIdPrefix` prop, and no `data-test`, `data-cy` or `id` alias.
1055
+ - **One attribute.** The test id is the `data-testid` attribute, on every component, base and composed. There is no `testId` or `testIdPrefix` prop, and no `data-test`, `data-cy` or `id` alias. The one exception is toasts (below).
1056
1056
  - **Your id wins.** The id you pass always wins. An element you compose yourself (a `DialogClose`, a `SelectItem`, a `Button` placed in a slot such as `actions` or `children`) keeps your own id.
1057
1057
  - **No default ids.** Graphene never sets an id when you pass none. The one exception is `PolicyStudio` (below).
1058
1058
  - **Where the id lands.**
@@ -1095,6 +1095,29 @@ The components that derive ids from yours. A part exists only when you pass an i
1095
1095
  | `SearchField` | `${id}-clear` | Clear button, while the field has text |
1096
1096
  | `CopyableText` | `${id}-value` | Displayed value |
1097
1097
  | `CopyableText` | `${id}-tooltip` | Tooltip content, while the tooltip is open |
1098
+ | `DataTablePagination` | `${id}-previous` | Previous page button |
1099
+ | `DataTablePagination` | `${id}-next` | Next page button |
1100
+ | `DataTablePagination` | `${id}-range` | Range text ("11-20 of 42") |
1101
+ | `DataTablePagination` | `${id}-page-size` | Page size trigger, with `onPageSizeChange` |
1102
+ | `DataTablePagination` | `${id}-page-size-content` | Page size list, with `onPageSizeChange`, while the list is open |
1103
+ | `DataTablePagination` | `${id}-page-size-option-<n>` | Page size option `n`, with `onPageSizeChange`, while the list is open |
1104
+ | `CopyableCell` | `${id}-copy` | Copy button, when the cell has a value |
1105
+ | `DataTable` | `${id}-table` | Table wrapper, with `aria-busy="true"` while loading |
1106
+ | `DataTable` | `${id}-row-<rowId>` | Body row `<tr>`, by TanStack's `row.id` (see below) |
1107
+ | `DataTable` | `${id}-row-<rowId>-select` | Row checkbox, with `selectionMode="multi"` |
1108
+ | `DataTable` | `${id}-select-all` | Header checkbox, with `selectionMode="multi"` |
1109
+ | `DataTable` | `${id}-header-<columnId>` | Header cell `<th>`, by `column.id` verbatim; the selection column is `_select`, with `selectionMode="multi"` |
1110
+ | `DataTable` | `${id}-header-<columnId>-sort` | Sort button of a `DataTableColumnHeader` that has no id of its own |
1111
+ | `DataTable` | `${id}-header-<columnId>-resize` | Resize handle, with `enableColumnResizing` |
1112
+ | `DataTable` | `${id}-empty` | Empty row, when there is no row and `loading` is off |
1113
+ | `DataTable` | `${id}-bulk-actions` | Bulk actions wrapper, with `bulkActions` |
1114
+ | `DataTable` | `${id}-view` | View menu button, with `enableColumnVisibility`; its parts are those of `DataTableViewOptions` |
1115
+ | `DataTable` | `${id}-pagination` | Pagination, with `pagination`; its parts are those of `DataTablePagination` |
1116
+ | `DataTableColumnHeader` | `${id}-sort` | Sort button, when the column can sort |
1117
+ | `DataTableViewOptions` | `${id}-content` | Menu content, while the menu is open |
1118
+ | `DataTableViewOptions` | `${id}-column-<columnId>` | Column item, by `column.id` verbatim, while the menu is open |
1119
+ | `DataTableViewOptions` | `${id}-search` | Search field, with `searchable`, while the panel is open |
1120
+ | `DataTableViewOptions` | `${id}-clear` | Clear button, with `searchable`, while the search field has text |
1098
1121
  | `ElCheatSheetTrigger` | `${id}-content` | Popover content, while the popover is open |
1099
1122
  | `ElCheatSheetTrigger` | `${id}-copy-<key>` | Copy button of an example: `plan-level`, `path-prefix` or `attribute-lookup` |
1100
1123
  | `CodeEditor` | `${id}-loading` | Skeleton, while Monaco loads |
@@ -1113,11 +1136,13 @@ The components that derive ids from yours. A part exists only when you pass an i
1113
1136
 
1114
1137
  `JsonSchemaForm` renders no element of its own, so its id is only a prefix. A field at the root path is `${id}`, and its error `${id}-error`.
1115
1138
 
1139
+ The `DataTable` row key is TanStack's `row.id`: pass `tableOptions={{ getRowId: (entity) => entity.id }}` for a stable key. Without `getRowId`, the key is the row's index in `data`, which is not a contract. `DataTableColumnHeader` takes the prefix of its header cell, `${tableId}-header-<columnId>`, unless you give it an id of its own. Keys are verbatim, never escaped: a `getRowId` result must not end with `-select`, and a column id must not end with `-sort` or `-resize`, or two elements share one id (row `a`'s checkbox and a row `a-select` are both `${tableId}-row-a-select`). Use the record's own id, not a display label.
1140
+
1116
1141
  The `Calendar` day keys are dates as react-day-picker formats them: they assume react-day-picker's default `numerals` (`latn`) and no `dateLib` override (Gregorian calendar); the `locale` doesn't change them. The dropdown keys are positions: navigating or picking a month doesn't change them. A `Calendar` part you replace through `components` gets no id. Replacing `MonthCaption` also drops the `month` and `year` ids, even though the dropdowns still render.
1117
1142
 
1118
1143
  **Exception: toasts**
1119
1144
 
1120
- A toast is created by a function call, so pass `toast(message, { testId })`. Sonner renders it as `data-testid` on the toast element. It is the only entry point that is not the `data-testid` attribute. Sonner's built-in close and action buttons can't be tagged.
1145
+ A toast is created by a function call, so pass `toast(message, { testId })`. Sonner renders it as `data-testid` on the toast element (`li[data-sonner-toast]`). It is the only entry point that is not the `data-testid` attribute. Sonner's built-in close and action buttons can't be tagged. `Toaster` has no target: a `data-testid` on it reaches no element.
1121
1146
 
1122
1147
  **Exception: `PolicyStudio`**
1123
1148
 
@@ -1,6 +1,12 @@
1
1
  import { HarnessQuery } from '../../testing/harnessQuery';
2
+ /** A body row by text (a string is a substring of the row's text, or a RegExp) or by its exact `data-testid`. */
3
+ type TableRowMatcher = string | RegExp | {
4
+ readonly testId: string;
5
+ };
2
6
  interface TableRowHarness {
3
7
  readonly getElement: () => HTMLTableRowElement;
8
+ /** The row's `data-testid`, or `null` when it has none. */
9
+ readonly getTestId: () => string | null;
4
10
  readonly getCells: () => string[];
5
11
  readonly getCellText: (header: string | RegExp) => string;
6
12
  readonly getCellElement: (header: string | RegExp) => HTMLTableCellElement;
@@ -9,8 +15,13 @@ interface TableHarness {
9
15
  readonly getElement: () => HTMLTableElement;
10
16
  readonly getHeaders: () => string[];
11
17
  readonly getRowCount: () => number;
12
- readonly getRow: (matcher: number | string | RegExp) => TableRowHarness;
13
- readonly queryRow: (matcher: string | RegExp) => TableRowHarness | null;
18
+ /**
19
+ * A body row by position (from 0), by text (a string is a substring of the row's text), or by
20
+ * `{ testId }`, an exact match on the row's `data-testid`. Throws when none matches.
21
+ */
22
+ readonly getRow: (matcher: number | TableRowMatcher) => TableRowHarness;
23
+ /** A body row by text or by `{ testId }`, as `getRow`, or `null` when none matches. */
24
+ readonly queryRow: (matcher: TableRowMatcher) => TableRowHarness | null;
14
25
  readonly getRows: () => TableRowHarness[];
15
26
  }
16
27
  declare function headerMatches(th: HTMLTableCellElement, matcher: string | RegExp): boolean;
@@ -19,5 +30,5 @@ declare function getOwnHeaderCells(table: HTMLTableElement): HTMLTableCellElemen
19
30
  declare function getOwnBodyRows(table: HTMLTableElement): HTMLTableRowElement[];
20
31
  declare function tableHarness(query?: HarnessQuery): TableHarness;
21
32
  export { describeHeaders, getOwnBodyRows, getOwnHeaderCells, headerMatches, tableHarness };
22
- export type { TableHarness, TableRowHarness };
33
+ export type { TableHarness, TableRowHarness, TableRowMatcher };
23
34
  //# sourceMappingURL=Table.harness.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Table.harness.d.ts","sourceRoot":"","sources":["../../../src/base/Table/Table.harness.tsx"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAEnG,UAAU,eAAe;IACvB,QAAQ,CAAC,UAAU,EAAE,MAAM,mBAAmB,CAAC;IAC/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,KAAK,MAAM,CAAC;IAC1D,QAAQ,CAAC,cAAc,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,KAAK,oBAAoB,CAAC;CAC5E;AAED,UAAU,YAAY;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,MAAM,MAAM,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,KAAK,eAAe,CAAC;IACxE,QAAQ,CAAC,QAAQ,EAAE,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AAE,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,KAAK,oBAAoB,CAAC;CAC5E;AAED,UAAU,YAAY;IACpB,QAAQ,CAAC,UAAU,EAAE,MAAM,gBAAgB,CAAC;IAC5C,QAAQ,CAAC,UAAU,EAAE,MAAM,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,WAAW,EAAE,MAAM,MAAM,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,eAAe,KAAK,eAAe,CAAC;IACxE,uFAAuF;IACvF,QAAQ,CAAC,QAAQ,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,eAAe,GAAG,IAAI,CAAC;IACxE,QAAQ,CAAC,OAAO,EAAE,MAAM,eAAe,EAAE,CAAC;CAC3C;AAID,iBAAS,aAAa,CAAC,EAAE,EAAE,oBAAoB,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAKlF;AAED,iBAAS,eAAe,CAAC,OAAO,EAAE,SAAS,oBAAoB,EAAE,GAAG,MAAM,CAUzE;AAMD,iBAAS,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,oBAAoB,EAAE,CAM1E;AAED,iBAAS,cAAc,CAAC,KAAK,EAAE,gBAAgB,GAAG,mBAAmB,EAAE,CAItE;AAkCD,iBAAS,YAAY,CAAC,KAAK,GAAE,YAAiB,GAAG,YAAY,CAqD5D;AAED,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,CAAC;AAC3F,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,CAAC"}
@@ -2,6 +2,7 @@ import { Column } from '@tanstack/react-table';
2
2
  interface ColumnOptionProps<TData> {
3
3
  readonly column: Column<TData>;
4
4
  readonly onToggle: (column: Column<TData>) => void;
5
+ readonly 'data-testid'?: string;
5
6
  }
6
7
  /**
7
8
  * One column of the searchable panel: an option that carries its own state (`aria-checked`, shown as
@@ -10,7 +11,7 @@ interface ColumnOptionProps<TData> {
10
11
  * announce reliably. The DOM ids come from `useId()`, never from the column id: TanStack derives that
11
12
  * id from a text header when the column declares none, and a space would break the id references.
12
13
  */
13
- declare function ColumnOption<TData>({ column, onToggle }: ColumnOptionProps<TData>): import("react").JSX.Element;
14
+ declare function ColumnOption<TData>({ column, onToggle, 'data-testid': testId }: ColumnOptionProps<TData>): import("react").JSX.Element;
14
15
  export { ColumnOption };
15
16
  export type { ColumnOptionProps };
16
17
  //# sourceMappingURL=ColumnOption.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColumnOption.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTable/ColumnOption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAMpD,UAAU,iBAAiB,CAAC,KAAK;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;CACpD;AAED;;;;;;GAMG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,iBAAiB,CAAC,KAAK,CAAC,+BAqB1E;AAED,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
1
+ {"version":3,"file":"ColumnOption.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTable/ColumnOption.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAMpD,UAAU,iBAAiB,CAAC,KAAK;IAC/B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IACnD,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;;;;GAMG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,iBAAiB,CAAC,KAAK,CAAC,+BAsBjG;AAED,OAAO,EAAE,YAAY,EAAE,CAAC;AACxB,YAAY,EAAE,iBAAiB,EAAE,CAAC"}
@@ -88,8 +88,16 @@ interface DataTableProps<TData> {
88
88
  readonly serverSide?: boolean;
89
89
  /** Escape hatch for advanced `@tanstack/react-table` options (e.g. `meta`, `initialState`). */
90
90
  readonly tableOptions?: Partial<TableOptions<TData>>;
91
+ /**
92
+ * Test id of the root `<div>`. The table's parts derive from it: `${id}-table` (the `aria-busy` wrapper),
93
+ * `${id}-row-<rowId>` and `${id}-row-<rowId>-select`, `${id}-select-all`, `${id}-header-<columnId>` with its
94
+ * `-sort` and `-resize`, `${id}-empty`, `${id}-bulk-actions`, and the View menu and pagination under
95
+ * `${id}-view` and `${id}-pagination`. `rowId` is TanStack's `row.id`: pass `tableOptions.getRowId` for a
96
+ * stable key, since it is the row index otherwise.
97
+ */
98
+ readonly 'data-testid'?: string;
91
99
  }
92
- declare function DataTable<TData>({ columns: userColumns, data, selectionMode, onSelectionChange, bulkActions, sorting: sortingProp, onSortingChange: onSortingChangeProp, emptyMessage, enableColumnVisibility, columnVisibilityOptions, enableColumnResizing, stickyHeader, loading: loadingProp, loadingDelay, skeletonCount, className, 'aria-label': ariaLabel, toolbar, pagination, footer, serverSide, tableOptions, }: DataTableProps<TData>): import("react").JSX.Element;
100
+ declare function DataTable<TData>({ columns: userColumns, data, selectionMode, onSelectionChange, bulkActions, sorting: sortingProp, onSortingChange: onSortingChangeProp, emptyMessage, enableColumnVisibility, columnVisibilityOptions, enableColumnResizing, stickyHeader, loading: loadingProp, loadingDelay, skeletonCount, className, 'aria-label': ariaLabel, toolbar, pagination, footer, serverSide, tableOptions, 'data-testid': testId, }: DataTableProps<TData>): import("react").JSX.Element;
93
101
  export { DataTable };
94
102
  export type { DataTablePaginationConfig, DataTableProps };
95
103
  //# sourceMappingURL=DataTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTable/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,SAAS,EAMd,KAAK,UAAU,EAEf,KAAK,OAAO,EAEZ,KAAK,YAAY,EACjB,KAAK,YAAY,EAGlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAC;AAM1F,OAAO,EAAE,KAAK,gCAAgC,EAAwB,MAAM,wBAAwB,CAAC;AAErG,OAAO,QAAQ,uBAAuB,CAAC;IAGrC,UAAU,UAAU,CAAC,KAAK,SAAS,OAAO,EAAE,MAAM;QAChD;;;WAGG;QACH,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;;WAGG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB;;;WAGG;QACH,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;CACF;AAeD,UAAU,yBAAyB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,iCAAiC;IACjC,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CACrC;AAED,UAAU,cAAc,CAAC,KAAK;IAC5B,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE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AAC;AACrB,YAAY,EAAE,yBAAyB,EAAE,cAAc,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import { TableRowHarness } from '../../base/Table/Table.harness';
1
+ import { TableRowHarness, TableRowMatcher } from '../../base/Table/Table.harness';
2
2
  import { HarnessQuery } from '../../testing/harnessQuery';
3
3
  interface DataTableRowHarness extends TableRowHarness {
4
4
  readonly isSelected: () => boolean;
@@ -9,8 +9,10 @@ interface DataTableHarness {
9
9
  readonly getElement: () => HTMLTableElement;
10
10
  readonly getHeaders: () => string[];
11
11
  readonly getRowCount: () => number;
12
- readonly getRow: (matcher: number | string | RegExp) => DataTableRowHarness;
13
- readonly queryRow: (matcher: string | RegExp) => DataTableRowHarness | null;
12
+ /** As `tableHarness().getRow`: by position, by text or by `{ testId }`. */
13
+ readonly getRow: (matcher: number | TableRowMatcher) => DataTableRowHarness;
14
+ /** As `tableHarness().queryRow`: by text or by `{ testId }`, or `null`. */
15
+ readonly queryRow: (matcher: TableRowMatcher) => DataTableRowHarness | null;
14
16
  readonly getRows: () => DataTableRowHarness[];
15
17
  readonly sortBy: (header: string | RegExp) => Promise<void>;
16
18
  readonly getSortDirection: (header: string | RegExp) => 'ascending' | 'descending' | 'none' | null;
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.harness.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTable/DataTable.harness.tsx"],"names":[],"mappings":"AAEA,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,8CAA8C,CAAC;AAEjF,UAAU,mBAAoB,SAAQ,eAAe;IACnD,QAAQ,CAAC,UAAU,EAAE,MAAM,OAAO,CAAC;IACnC,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,QAAQ,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,UAAU,gBAAgB;IACxB,Q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AClC,QAAQ,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC;CACjC;AAWD,iBAAS,gBAAgB,CAAC,KAAK,GAAE,YAAiB,GAAG,gBAAgB,CAuEpE;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC;AAC5B,YAAY,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,CAAC"}
@@ -2,8 +2,14 @@ import { Column } from '@tanstack/react-table';
2
2
  interface DataTableColumnHeaderProps<TData, TValue> extends React.ComponentProps<'div'> {
3
3
  readonly column: Column<TData, TValue>;
4
4
  readonly title: string;
5
+ /**
6
+ * Test id of the root `<div>`; the sort button gets `${id}-sort`. Without one, in a `DataTable` that has an id, the
7
+ * sort button gets `${tableId}-header-<columnId>-sort` and the root none: the `<th>` already carries
8
+ * `${tableId}-header-<columnId>`.
9
+ */
10
+ readonly 'data-testid'?: string;
5
11
  }
6
- declare function DataTableColumnHeader<TData, TValue>({ column, title, className, ...props }: DataTableColumnHeaderProps<TData, TValue>): import("react").JSX.Element;
12
+ declare function DataTableColumnHeader<TData, TValue>({ column, title, className, 'data-testid': testId, ...props }: DataTableColumnHeaderProps<TData, TValue>): import("react").JSX.Element;
7
13
  export { DataTableColumnHeader };
8
14
  export type { DataTableColumnHeaderProps };
9
15
  //# sourceMappingURL=DataTableColumnHeader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableColumnHeader.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTable/DataTableColumnHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAKpD,UAAU,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAE,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACrF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,iBAAS,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,EAC5C,MAAM,EACN,KAAK,EACL,SAAS,EACT,GAAG,KAAK,EACT,EAAE,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAC,+BA8B3C;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACjC,YAAY,EAAE,0BAA0B,EAAE,CAAC"}
1
+ {"version":3,"file":"DataTableColumnHeader.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTable/DataTableColumnHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAQpD,UAAU,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAE,SAAQ,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC;IACrF,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACvC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,iBAAS,qBAAqB,CAAC,KAAK,EAAE,MAAM,EAAE,EAC5C,MAAM,EACN,KAAK,EACL,SAAS,EACT,aAAa,EAAE,MAAM,EACrB,GAAG,KAAK,EACT,EAAE,0BAA0B,CAAC,KAAK,EAAE,MAAM,CAAC,+BAkC3C;AAED,OAAO,EAAE,qBAAqB,EAAE,CAAC;AACjC,YAAY,EAAE,0BAA0B,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * The `data-testid` of the `DataTable` whose header renders a `DataTableColumnHeader`, so that the header derives its
3
+ * sort button's id from the table's. `undefined` when the table has none: a nested table never inherits an outer id.
4
+ */
5
+ declare const DataTableTestIdContext: import('react').Context<string | undefined>;
6
+ export { DataTableTestIdContext };
7
+ //# sourceMappingURL=DataTableTestIdContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DataTableTestIdContext.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTable/DataTableTestIdContext.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,QAAA,MAAM,sBAAsB,6CAA+C,CAAC;AAE5E,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
@@ -14,8 +14,13 @@ interface DataTableColumnVisibilityOptions {
14
14
  }
15
15
  interface DataTableViewOptionsProps<TData> extends DataTableColumnVisibilityOptions {
16
16
  readonly table: Table<TData>;
17
+ /**
18
+ * Test id of the View button. The menu content gets `${id}-content` and each column `${id}-column-<columnId>`;
19
+ * with `searchable`, the search field `${id}-search` and its clear button `${id}-clear`.
20
+ */
21
+ readonly 'data-testid'?: string;
17
22
  }
18
- declare function DataTableViewOptions<TData>({ table, searchable, searchPlaceholder, }: DataTableViewOptionsProps<TData>): import("react").JSX.Element;
23
+ declare function DataTableViewOptions<TData>({ table, searchable, searchPlaceholder, 'data-testid': testId, }: DataTableViewOptionsProps<TData>): import("react").JSX.Element;
19
24
  export { DataTableViewOptions };
20
25
  export type { DataTableColumnVisibilityOptions, DataTableViewOptionsProps };
21
26
  //# sourceMappingURL=DataTableViewOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableViewOptions.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTable/DataTableViewOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAgBnD,UAAU,gCAAgC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,UAAU,yBAAyB,CAAC,KAAK,CAAE,SAAQ,gCAAgC;IACjF,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;CAC9B;AAED,iBAAS,oBAAoB,CAAC,KAAK,EAAE,EACnC,KAAK,EACL,UAAkB,EAClB,iBAAuC,GACxC,EAAE,yBAAyB,CAAC,KAAK,CAAC,+BA2ClC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAChC,YAAY,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,CAAC"}
1
+ {"version":3,"file":"DataTableViewOptions.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTable/DataTableViewOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAiBnD,UAAU,gCAAgC;IACxC;;;;OAIG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;CACrC;AAED,UAAU,yBAAyB,CAAC,KAAK,CAAE,SAAQ,gCAAgC;IACjF,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,iBAAS,oBAAoB,CAAC,KAAK,EAAE,EACnC,KAAK,EACL,UAAkB,EAClB,iBAAuC,EACvC,aAAa,EAAE,MAAM,GACtB,EAAE,yBAAyB,CAAC,KAAK,CAAC,+BA4ClC;AAED,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAChC,YAAY,EAAE,gCAAgC,EAAE,yBAAyB,EAAE,CAAC"}
@@ -2,6 +2,8 @@ import { Column } from '@tanstack/react-table';
2
2
  interface DataTableViewOptionsSearchProps<TData> {
3
3
  readonly columns: readonly Column<TData>[];
4
4
  readonly placeholder: string;
5
+ /** Test id of the View button, from `DataTableViewOptions`: the panel's parts derive from it. */
6
+ readonly 'data-testid'?: string;
5
7
  }
6
8
  /**
7
9
  * The searchable View menu: a popover with a search field over the columns, grouped by section. A
@@ -10,7 +12,7 @@ interface DataTableViewOptionsSearchProps<TData> {
10
12
  * to the trigger; the arrow keys move between columns and Enter toggles the highlighted one. Each
11
13
  * column is a `ColumnOption`.
12
14
  */
13
- declare function DataTableViewOptionsSearch<TData>({ columns, placeholder }: DataTableViewOptionsSearchProps<TData>): import("react").JSX.Element;
15
+ declare function DataTableViewOptionsSearch<TData>({ columns, placeholder, 'data-testid': testId, }: DataTableViewOptionsSearchProps<TData>): import("react").JSX.Element;
14
16
  export { DataTableViewOptionsSearch };
15
17
  export type { DataTableViewOptionsSearchProps };
16
18
  //# sourceMappingURL=DataTableViewOptionsSearch.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableViewOptionsSearch.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTable/DataTableViewOptionsSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAUpD,UAAU,+BAA+B,CAAC,KAAK;IAC7C,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IAC3C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAaD;;;;;;GAMG;AACH,iBAAS,0BAA0B,CAAC,KAAK,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,EAAE,+BAA+B,CAAC,KAAK,CAAC,+BAmE1G;AAED,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,YAAY,EAAE,+BAA+B,EAAE,CAAC"}
1
+ {"version":3,"file":"DataTableViewOptionsSearch.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTable/DataTableViewOptionsSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAWpD,UAAU,+BAA+B,CAAC,KAAK;IAC7C,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;IAC3C,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,iGAAiG;IACjG,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAaD;;;;;;GAMG;AACH,iBAAS,0BAA0B,CAAC,KAAK,EAAE,EACzC,OAAO,EACP,WAAW,EACX,aAAa,EAAE,MAAM,GACtB,EAAE,+BAA+B,CAAC,KAAK,CAAC,+BA+ExC;AAED,OAAO,EAAE,0BAA0B,EAAE,CAAC;AACtC,YAAY,EAAE,+BAA+B,EAAE,CAAC"}
@@ -1,38 +1,44 @@
1
1
  import { ReactNode } from 'react';
2
- /**
3
- * Shared cell renderers for DataTable columns.
4
- * Use these in `ColumnDef.cell` to maintain consistent column styling across all tables.
5
- */
6
2
  interface DateCellProps {
7
3
  /** ISO date string or Date object */
8
4
  readonly value: string | Date | null | undefined;
9
5
  /** Display format: 'relative' shows "2h ago", 'absolute' shows full date. @default 'relative' */
10
6
  readonly format?: 'relative' | 'absolute';
7
+ /** Test id of the cell's root element, the `—` placeholder included. */
8
+ readonly 'data-testid'?: string;
11
9
  }
12
- declare function DateCell({ value, format }: DateCellProps): import("react").JSX.Element;
10
+ declare function DateCell({ value, format, 'data-testid': testId }: DateCellProps): import("react").JSX.Element;
13
11
  interface BadgeCellProps {
14
12
  readonly value: string | null | undefined;
15
13
  readonly variant?: 'default' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning' | 'highlight';
16
14
  readonly icon?: ReactNode;
15
+ /** Test id of the cell's root element, the `—` placeholder included. */
16
+ readonly 'data-testid'?: string;
17
17
  }
18
- declare function BadgeCell({ value, variant, icon }: BadgeCellProps): import("react").JSX.Element;
18
+ declare function BadgeCell({ value, variant, icon, 'data-testid': testId }: BadgeCellProps): import("react").JSX.Element;
19
19
  interface MonoCellProps {
20
20
  readonly value: string | null | undefined;
21
21
  /** Maximum visible characters before truncation. @default 32 */
22
22
  readonly maxLength?: number;
23
+ /** Test id of the cell's root element, the `—` placeholder included. */
24
+ readonly 'data-testid'?: string;
23
25
  }
24
- declare function MonoCell({ value, maxLength }: MonoCellProps): import("react").JSX.Element;
26
+ declare function MonoCell({ value, maxLength, 'data-testid': testId }: MonoCellProps): import("react").JSX.Element;
25
27
  interface CopyableCellProps {
26
28
  readonly value: string | null | undefined;
27
29
  /** Maximum visible characters before truncation. @default 24 */
28
30
  readonly maxLength?: number;
31
+ /** Test id of the cell's root element, the `—` placeholder included; the copy button gets `${id}-copy`. */
32
+ readonly 'data-testid'?: string;
29
33
  }
30
- declare function CopyableCell({ value, maxLength }: CopyableCellProps): import("react").JSX.Element;
34
+ declare function CopyableCell({ value, maxLength, 'data-testid': testId }: CopyableCellProps): import("react").JSX.Element;
31
35
  interface TruncatedCellProps {
32
36
  readonly value: string | null | undefined;
33
37
  readonly className?: string;
38
+ /** Test id of the cell's root element, the `—` placeholder included. */
39
+ readonly 'data-testid'?: string;
34
40
  }
35
- declare function TruncatedCell({ value, className }: TruncatedCellProps): import("react").JSX.Element;
41
+ declare function TruncatedCell({ value, className, 'data-testid': testId }: TruncatedCellProps): import("react").JSX.Element;
36
42
  export { BadgeCell, CopyableCell, DateCell, MonoCell, TruncatedCell };
37
43
  export type { BadgeCellProps, CopyableCellProps, DateCellProps, MonoCellProps, TruncatedCellProps };
38
44
  //# sourceMappingURL=cells.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cells.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTable/cells.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAQvC;;;GAGG;AAIH,UAAU,aAAa;IACrB,qCAAqC;IACrC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,SAAS,CAAC;IACjD,iGAAiG;IACjG,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CAC3C;AA2BD,iBAAS,QAAQ,CAAC,EAAE,KAAK,EAAE,MAAmB,EAAE,EAAE,aAAa,+BAqB9D;AAID,UAAU,cAAc;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,OAAO,CAA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1C,gEAAgE;IAChE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,2GAA2G;IAC3G,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,iBAAS,YAAY,CAAC,EAAE,KAAK,EAAE,SAAc,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,iBAAiB,+BA2CxF;AAID,UAAU,kBAAkB;IAC1B,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;CACjC;AAED,iBAAS,aAAa,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,EAAE,kBAAkB,+BAmBrF;AAED,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AACtE,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAC"}
@@ -7,8 +7,13 @@ interface DataTablePaginationProps {
7
7
  readonly onPageChange: (page: number) => void;
8
8
  readonly onPageSizeChange?: (pageSize: number) => void;
9
9
  readonly children?: ReactNode;
10
+ /**
11
+ * Test id of the root `<div>`. `${id}-previous`, `${id}-next` and `${id}-range` derive from it, and with
12
+ * `onPageSizeChange` `${id}-page-size`, `${id}-page-size-content` and `${id}-page-size-option-<n>`.
13
+ */
14
+ readonly 'data-testid'?: string;
10
15
  }
11
- declare function DataTablePagination({ page, pageSize, totalCount, pageSizeOptions, onPageChange, onPageSizeChange, children, }: DataTablePaginationProps): import("react").JSX.Element;
16
+ declare function DataTablePagination({ page, pageSize, totalCount, pageSizeOptions, onPageChange, onPageSizeChange, children, 'data-testid': testId, }: DataTablePaginationProps): import("react").JSX.Element;
12
17
  export { DataTablePagination };
13
18
  export type { DataTablePaginationProps };
14
19
  //# sourceMappingURL=DataTablePagination.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataTablePagination.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTablePagination/DataTablePagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,UAAU,wBAAwB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,QAAQ,CAAC,gBAAgB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACvD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B;AAED,iBAAS,mBAAmB,CAAC,EAC3B,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,eAAsC,EACtC,YAAY,EACZ,gBAAgB,EAChB,QAAQ,GACT,EAAE,wBAAwB,+BAoD1B;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,wBAAwB,EAAE,CAAC"}
1
+ {"version":3,"file":"DataTablePagination.d.ts","sourceRoot":"","sources":["../../../src/composed/DataTablePagination/DataTablePagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,UAAU,wBAAwB;IAChC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,EAA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