@planningcenter/tapestry 4.4.0-rc.3 → 4.4.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/DataTable/DataTable.d.ts.map +1 -1
- package/dist/components/DataTable/DataTable.js +4 -4
- package/dist/components/DataTable/DataTable.js.map +1 -1
- package/dist/components/DataTable/ViewSettingsToggle.d.ts +19 -0
- package/dist/components/DataTable/ViewSettingsToggle.d.ts.map +1 -0
- package/dist/components/DataTable/ViewSettingsToggle.js +32 -0
- package/dist/components/DataTable/ViewSettingsToggle.js.map +1 -0
- package/dist/components/internal/filterable-list-box/FilterableListBox.d.ts +95 -0
- package/dist/components/internal/filterable-list-box/FilterableListBox.d.ts.map +1 -0
- package/dist/components/internal/filterable-list-box/FilterableListBox.js +86 -0
- package/dist/components/internal/filterable-list-box/FilterableListBox.js.map +1 -0
- package/dist/components/internal/filterable-list-box/index.d.ts +4 -0
- package/dist/components/internal/filterable-list-box/index.d.ts.map +1 -0
- package/dist/components/page-header/index.js +1 -1
- package/dist/components/sidenav/index.js +1 -1
- package/dist/packages/tapestry-wc/dist/components/{p-B1UZ1E1N.js → p-8HUAbvqM.js} +3 -3
- package/dist/packages/tapestry-wc/dist/components/{p-B1UZ1E1N.js.map → p-8HUAbvqM.js.map} +1 -1
- package/dist/packages/tapestry-wc/dist/components/{p-BUCaDEmF.js → p-BUA1lBjE.js} +2 -2
- package/dist/packages/tapestry-wc/dist/components/{p-BUCaDEmF.js.map → p-BUA1lBjE.js.map} +1 -1
- package/dist/packages/tapestry-wc/dist/components/{p-BxWNubxA.js → p-BsYEHzfH.js} +3 -3
- package/dist/packages/tapestry-wc/dist/components/{p-BxWNubxA.js.map → p-BsYEHzfH.js.map} +1 -1
- package/dist/packages/tapestry-wc/dist/components/{p-Bh0Qdh7W.js → p-CHx6cgt5.js} +3 -3
- package/dist/packages/tapestry-wc/dist/components/{p-Bh0Qdh7W.js.map → p-CHx6cgt5.js.map} +1 -1
- package/dist/packages/tapestry-wc/dist/components/{p-xUNMH2lo.js → p-DpGMDplX.js} +2 -2
- package/dist/packages/tapestry-wc/dist/components/{p-xUNMH2lo.js.map → p-DpGMDplX.js.map} +1 -1
- package/dist/packages/tapestry-wc/dist/components/tds-page-header-nav.js +2 -2
- package/dist/packages/tapestry-wc/dist/components/tds-page-header-nav.js.map +1 -1
- package/dist/packages/tapestry-wc/dist/components/tds-page-header.js +3 -3
- package/dist/packages/tapestry-wc/dist/components/tds-page-header.js.map +1 -1
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav-item.js +3 -3
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav-item.js.map +1 -1
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav-responsive-header.js +2 -2
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav-responsive-header.js.map +1 -1
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav-section.js +3 -3
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav-section.js.map +1 -1
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav.js +5 -5
- package/dist/packages/tapestry-wc/dist/components/tds-sidenav.js.map +1 -1
- package/dist/reactRender.css +1489 -1231
- package/dist/reactRender.css.map +1 -1
- package/dist/reactRenderLegacy.css +1489 -1231
- package/dist/reactRenderLegacy.css.map +1 -1
- package/dist/unstable.css +685 -427
- package/dist/unstable.css.map +1 -1
- package/package.json +4 -4
- package/dist/components/DataTable/ColumnVisibilityToggle.d.ts +0 -17
- package/dist/components/DataTable/ColumnVisibilityToggle.d.ts.map +0 -1
- package/dist/components/DataTable/ColumnVisibilityToggle.js +0 -15
- package/dist/components/DataTable/ColumnVisibilityToggle.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTable.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAKpB,OAAO,KAAK,EAAE,+BAA+B,EAAE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;IACH,UAAU,CAAC,EAAE,SAAS,EAAE,CAAA;IACxB,wJAAwJ;IACxJ,kBAAkB,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;IACjD,+IAA+I;IAC/I,uBAAuB,CAAC,EAAE,MAAM,CAAA;IAChC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,2GAA2G;IAC3G,YAAY,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IAClC,4CAA4C;IAC5C,MAAM,CAAC,EAAE,IAAI,CAAA;IACb,0QAA0Q;IAC1Q,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,WAAW,EAAE,CAAA;IAC5B;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;OAKG;IACH,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B;AAID,KAAK,oBAAoB,GAAG,UAAU,GAAG,MAAM,CAAA;AAE/C,KAAK,uBAAuB,GAAG,KAAK,CAAA;AAEpC,MAAM,MAAM,qBAAqB,GAAG,+BAA+B,CACjE,cAAc,EACd,cAAc,EACd,oBAAoB,EACpB,uBAAuB,CACxB,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,SAAS;8fAmCnB,qBAAqB;;CAuTvB,CAAA"}
|
|
@@ -6,7 +6,6 @@ import { useId } from '../../utilities/useId.js';
|
|
|
6
6
|
import classNames from 'classnames';
|
|
7
7
|
import React__default, { useRef, useMemo, useState, useLayoutEffect } from 'react';
|
|
8
8
|
import { Table, TableHeader, Column, Checkbox, TableBody, Row, Cell } from 'react-aria-components/Table';
|
|
9
|
-
import { ColumnVisibilityToggle } from './ColumnVisibilityToggle.js';
|
|
10
9
|
import { prepareColumn } from './DataTableColumnTypes.js';
|
|
11
10
|
import { getRowKey } from './DataTableRow.js';
|
|
12
11
|
import { hasResultsCount, resolveResultNounLabel, ResultsCount } from './ResultsCount.js';
|
|
@@ -14,6 +13,7 @@ import { RowActions } from './RowActions.js';
|
|
|
14
13
|
import { TableActions } from './TableActions.js';
|
|
15
14
|
import { useColumnVisibility } from './useColumnVisibility.js';
|
|
16
15
|
import { useRowPressBoundary } from './useRowPressBoundary.js';
|
|
16
|
+
import { ViewSettingsToggle } from './ViewSettingsToggle.js';
|
|
17
17
|
|
|
18
18
|
const DEFAULT_ERROR_STATE = "Something went wrong.";
|
|
19
19
|
/**
|
|
@@ -112,8 +112,8 @@ const DataTable = ({ className, columns, currentPage = 1, data, disabledKeys, em
|
|
|
112
112
|
? `${resultNounLabel} table pagination`
|
|
113
113
|
: undefined;
|
|
114
114
|
const hasActions = (tableActions?.length ?? 0) > 0;
|
|
115
|
-
const
|
|
116
|
-
const showHeader = Boolean(resultNoun || hasActions ||
|
|
115
|
+
const hasViewSettingsToggle = hideableColumns.length > 0;
|
|
116
|
+
const showHeader = Boolean(resultNoun || hasActions || hasViewSettingsToggle);
|
|
117
117
|
const hasRowActions = (rowActions?.length ?? 0) > 0;
|
|
118
118
|
// A lone page has nothing to navigate to, so the paged controls stay out of
|
|
119
119
|
// the frame entirely rather than rendering a single inert page marker. The
|
|
@@ -132,7 +132,7 @@ const DataTable = ({ className, columns, currentPage = 1, data, disabledKeys, em
|
|
|
132
132
|
// paginated table's `data` doesn't.
|
|
133
133
|
totalCount: resultCount ?? data.length }),
|
|
134
134
|
hasActions && (React__default.createElement(TableActions, { actions: tableActions, resultNoun: resultNoun, selectedKeys: selectedKeys })),
|
|
135
|
-
|
|
135
|
+
hasViewSettingsToggle && (React__default.createElement(ViewSettingsToggle, { columns: hideableColumns, onColumnVisibilityChange: onColumnVisibilityChange, visibleColumnNames: visibleHideableColumns })))),
|
|
136
136
|
React__default.createElement("div", { ref: wrapperRef, className: "tds-data-table-scroll-wrapper" },
|
|
137
137
|
React__default.createElement("div", { ref: scrollRef, className: "tds-data-table-scroll" },
|
|
138
138
|
React__default.createElement(Table, { ...restProps, ...selectableProps, ...(ariaLabel ? { "aria-label": ariaLabel } : {}), ...(describedBy ? { "aria-describedby": describedBy } : {}), ...{ id: tableId }, className: combinedClassName,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTable.js","sources":["../../../src/components/DataTable/DataTable.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { LoadingSpinner } from \"@components/internal\"\nimport { Pagination } from \"@components/internal/pagination\"\nimport Icon from \"@utilities/Icon\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, {\n type ReactNode,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport {\n Cell,\n Checkbox,\n Column,\n type Key,\n Row,\n type Selection,\n type SortDescriptor,\n Table,\n TableBody,\n TableHeader,\n type TableProps as AriaTableProps,\n} from \"react-aria-components/Table\"\n\nimport { ColumnVisibilityToggle } from \"./ColumnVisibilityToggle\"\nimport type { DataTableColumn } from \"./DataTableColumn\"\nimport { prepareColumn, type PreparedColumn } from \"./DataTableColumnTypes\"\nimport { getRowKey } from \"./DataTableRow\"\nimport {\n hasResultsCount,\n resolveResultNounLabel,\n type ResultNoun,\n ResultsCount,\n} from \"./ResultsCount\"\nimport { type RowAction, RowActions } from \"./RowActions\"\nimport { type TableAction, TableActions } from \"./TableActions\"\nimport { useColumnVisibility } from \"./useColumnVisibility\"\nimport { useRowPressBoundary } from \"./useRowPressBoundary\"\n\nexport type { ResultNoun, RowAction, TableAction }\n\nexport type Sort = { column: string; direction: \"asc\" | \"desc\" }\n\nexport type DataTableLoadingState = \"error\" | \"idle\" | \"loading\"\n\nexport interface DataTableProps {\n /**\n * Columns define what data is displayed and how. Pass a stable reference\n * (e.g. a module constant or memoized value); columns are prepared per array\n * identity, so an inline array rebuilds each column's formatter every render.\n */\n columns: DataTableColumn[]\n /**\n * The 1-indexed current page. Only used by the default `\"paged\"` pagination,\n * where `totalPages` is set, and defaults to `1`.\n */\n currentPage?: number\n /** The array of rows to display. */\n data: unknown[]\n /**\n * Row keys that can't be selected. Keys are the values returned by `getRowId`\n * (or `row.id`, or the row's index) — the same keys used by `selectedKeys`.\n * Only selection is disabled: the row's checkbox renders disabled and \"select\n * all\" skips it, while the row itself stays clickable, navigable, and\n * focusable. Has no effect unless the table is `selectable`.\n */\n disabledKeys?: (number | string)[]\n /** Rendered in place of the table body when there is no data. */\n emptyState?: ReactNode\n /** Rendered in place of the table body when `loadingState` is `\"error\"`. */\n errorState?: ReactNode\n /** Returns a stable identity for each row. Defaults to `row.id`. */\n getRowId?: (row: unknown) => number | string\n /**\n * Returns a URL to navigate to when the row is clicked. Rows with a link\n * render as navigable elements (clickable, keyboard-focusable, and\n * openable in a new tab). Works alongside `onRowClick` and `selectable`.\n */\n getRowLink?: (row: unknown) => string\n /**\n * Whether a page exists after the current one. Only used by\n * `paginationType=\"indexed\"`, which has no page count to derive it from;\n * `false` (the default) disables the Next button.\n */\n hasNextPage?: boolean\n /**\n * Whether a page exists before the current one. Only used by\n * `paginationType=\"indexed\"`, which has no page count to derive it from;\n * `false` (the default) disables the Previous button.\n */\n hasPreviousPage?: boolean\n /**\n * An `id` for the table element. When omitted, a stable generated id is used\n * so the results count can be linked to the table via `aria-describedby`.\n */\n id?: string\n /**\n * Async loading state for the table body.\n * - `\"loading\"`: While `data` is empty, replaces the empty state with a\n * centered spinner.\n * - `\"error\"`: While `data` is empty, replaces the empty state with\n * `errorState` (or a default error message).\n * - `\"idle\"` (default): Normal rendering.\n */\n loadingState?: DataTableLoadingState\n /**\n * Called when the Next button is activated. Only used by\n * `paginationType=\"indexed\"`; load the following page's rows and pass them\n * back in through `data` in response.\n */\n onNextPageClick?: () => void\n /**\n * Called with the 1-indexed page the user navigated to. The table doesn't\n * page `data` itself — pass the rows for the new page back in through `data`\n * (and update `currentPage`) in response. Only used by the default `\"paged\"`\n * pagination; the indexed type has no page number to report.\n */\n onPageChange?: (page: number) => void\n /**\n * Called when the Previous button is activated. Only used by\n * `paginationType=\"indexed\"`; load the preceding page's rows and pass them\n * back in through `data` in response.\n */\n onPreviousPageClick?: () => void\n /**\n * Called with the row when it is clicked. Rows with a click handler render\n * as interactive elements (clickable and keyboard-focusable). When\n * `getRowLink` is also set, both run and the row navigates.\n */\n onRowClick?: (row: unknown) => void\n /**\n * Called when the set of selected rows changes. Always receives a plain\n * array of row keys — never React Aria's `\"all\"` sentinel, which is\n * resolved to the concrete keys of the loaded rows.\n */\n onSelectedChange?: (keys: (number | string)[]) => void\n /** Callback invoked when the sort state changes. */\n onSortChange?: (sort: Sort) => void\n /**\n * Called with the full ordered list of visible column names when the\n * visibility toggle changes. Always-visible columns are included, so the\n * value can be passed straight back as `visibleColumnNames`. Column\n * visibility is controlled, so the table only updates once\n * `visibleColumnNames` changes.\n */\n onVisibleColumnNamesChange?: (visibleColumnNames: string[]) => void\n /**\n * Which shape the page controls take, forwarded to the `Pagination` control's\n * `type`.\n * - `\"paged\"` (the default): a numbered run of pages. Driven by `totalPages`,\n * `currentPage`, and `onPageChange`, and rendered only once `totalPages` is\n * set and greater than `1`.\n * - `\"indexed\"`: a labeled Previous/Next pair, for a result set that can only\n * be stepped through — a cursor-paged API, say, which reports whether a\n * neighboring page exists but not how many there are. Driven by\n * `hasPreviousPage`/`hasNextPage` and `onPreviousPageClick`/\n * `onNextPageClick`; `totalPages` and `currentPage` play no part. With no\n * page count there's no threshold to hide the controls below, so they\n * always render — a single page of results shows both buttons disabled.\n */\n paginationType?: \"indexed\" | \"paged\"\n /**\n * Overrides the number shown by the `resultNoun` count, which otherwise\n * uses the length of `data`. Use this when the table renders only part of\n * the result set — a paginated or virtualized table — so the count reflects\n * the whole set. Has no effect unless `resultNoun` is set.\n */\n resultCount?: number\n /**\n * Displays the number of results (the length of `data`, or `resultCount`\n * when supplied) above the table, followed by a noun that matches the count.\n * Pass a string to use it as the singular noun and append `\"s\"` for the\n * plural (e.g. `\"result\"` → `\"results\"`), or a `[singular, plural]` tuple to\n * supply an irregular plural explicitly (e.g. `[\"person\", \"people\"]`). Pass\n * `true` to use `\"result\"`.\n * When `false` or omitted, no count is rendered. The count is formatted with\n * `Intl.NumberFormat` and the singular form is used only when the count is\n * exactly `1`. When the table is `selectable` and rows are selected, the\n * count instead reflects the selection as `\"{selected} of {total}\"`, e.g.\n * `\"2 of 100\"`, with a visually-hidden suffix naming the noun so assistive\n * tech reads the unambiguous `\"2 of 100 people selected\"`.\n * The count is linked to the table with `aria-describedby` so\n * screen readers announce it as a description of the table. When a string or\n * `[singular, plural]` tuple is provided, the noun also supplies the table's\n * `aria-label` in its plural form (e.g. `\"items\"` or `\"people\"`) unless an\n * `aria-label` is passed directly, which always takes precedence; `true`\n * never provides a label. The same plural noun also names the pagination\n * landmark (e.g. `\"people table pagination\"`), which otherwise falls back to\n * `\"Pagination\"`.\n */\n resultNoun?: ResultNoun\n /**\n * Displays a sticky column to the right that holds row-scoped actions.\n * Renders as a dropdown with 2+ actions or a single button with one. Each\n * action's `onAction` or `getHref` receives the row.\n */\n rowActions?: RowAction[]\n /** Ref to the scroll container the sticky header should track. Takes priority over `scrollContainerSelector`. Only used when `stickyHeader` is true. */\n scrollContainerRef?: React.RefObject<HTMLElement>\n /** CSS selector for the scroll container the sticky header should track. Only used when `stickyHeader` is true. Defaults to \".content-wrap\" */\n scrollContainerSelector?: string\n /**\n * Enables row selection via checkboxes, including a \"select all\" checkbox in\n * the header. Without a row action (`onRowClick` or `getRowLink`), pressing\n * anywhere in a row toggles the row selection.\n */\n selectable?: boolean\n /** The selected row keys. Keys are the values returned by `getRowId` (or `row.id`, or the row's index). */\n selectedKeys?: (number | string)[]\n /** The current sort state for the table. */\n sortBy?: Sort\n /** Enables a sticky header that tracks an outer scroll container. Progressive enhancement: Relies on `animation-timeline: scroll()`, which isn't supported in all browsers (e.g. Firefox) — the header scrolls with the table body instead of sticking in those cases. */\n stickyHeader?: boolean\n /**\n * Table actions rendered as an `IconButton` group directly after the results\n * count, above the table. Each entry becomes an icon button whose `callback`\n * receives the ids of the currently selected rows. Unlike the original RFC,\n * these are not gated on `selectable` — actions such as print or export can\n * operate without a row selection.\n */\n tableActions?: TableAction[]\n /**\n * The total number of pages in the result set. Setting it renders the page\n * controls below the table; leaving it unset renders no pagination at all.\n * A single page has nothing to navigate to, so the controls only render once\n * there are two or more pages. Only used by the default `\"paged\"` pagination\n * — an indexed result set has no page count, which is the reason to reach for\n * `paginationType=\"indexed\"` in the first place.\n *\n * The table displays whatever rows it is given — paging is the caller's job.\n * `data` should hold only the current page's rows, `resultCount` the size of\n * the whole result set, and `onPageChange` should load the next page.\n */\n totalPages?: number\n /**\n * The names of the columns currently visible. Only columns marked `hideable`\n * are affected — every other column stays visible. Omitting this leaves all\n * columns visible. Unknown names are ignored and display order always\n * follows `columns`.\n */\n visibleColumnNames?: string[]\n}\n\nconst DEFAULT_ERROR_STATE = \"Something went wrong.\"\n\ntype AriaTablePropsToOmit = \"children\" | \"slot\"\n\ntype AriaTablePropsToInclude = never\n\nexport type DataTableElementProps = CombineAriaPropsWithCustomProps<\n AriaTableProps,\n DataTableProps,\n AriaTablePropsToOmit,\n AriaTablePropsToInclude\n>\n\n/**\n * A table for displaying tabular data. Built on React Aria's `Table`.\n *\n * Each column declares a `type` that controls how its cell values are\n * formatted: `string`, `number`, `currency`, `date`, `datetime`, `boolean`,\n * `enum`, and `custom`. A column's `render` function always takes precedence\n * over the built-in type formatting.\n *\n * Setting `totalPages` renders page controls below the table; the table itself\n * never slices `data`, so `onPageChange` is where the caller loads the page.\n * `paginationType=\"indexed\"` swaps the numbered run for a labeled\n * Previous/Next pair, for a result set with no known page count.\n *\n * Filtering, presets, and other RFC features are not yet implemented.\n *\n * @component\n */\nexport const DataTable = ({\n className,\n columns,\n currentPage = 1,\n data,\n disabledKeys,\n emptyState,\n errorState,\n getRowId,\n getRowLink,\n hasNextPage = false,\n hasPreviousPage = false,\n id,\n loadingState = \"idle\",\n paginationType = \"paged\",\n resultCount,\n resultNoun,\n scrollContainerRef,\n scrollContainerSelector = \".content-wrap\",\n rowActions,\n selectable,\n selectedKeys: controlledSelectedKeys,\n stickyHeader,\n sortBy,\n tableActions,\n totalPages,\n visibleColumnNames,\n onNextPageClick,\n onPageChange,\n onPreviousPageClick,\n onRowClick,\n onSelectedChange,\n onSortChange,\n onVisibleColumnNamesChange,\n ...restProps\n}: DataTableElementProps) => {\n const hasRowPressAction = Boolean(onRowClick || getRowLink)\n const rowsAreInteractive = hasRowPressAction || Boolean(selectable)\n const combinedClassName = classNames(\"tds-data-table-grid\", className)\n const sortDescriptor = useSortDescriptor(sortBy)\n const { hasScrollContainer, wrapperRef } = useStickyHeader(\n stickyHeader,\n scrollContainerRef,\n scrollContainerSelector\n )\n const scrollRef = useRef<HTMLDivElement>(null)\n // A `Button` or `Link` in a cell keeps its presses to itself, so activating\n // one doesn't also press the row it's in.\n const cellBoundaryProps = useRowPressBoundary(scrollRef, rowsAreInteractive)\n\n // React Aria only invokes `renderEmptyState` when the collection is empty, so\n // the loading spinner and error message only take over the body while `data`\n // is empty; once rows exist they always render.\n const emptyStateContent = getEmptyStateContent({\n emptyState,\n errorState,\n loadingState,\n })\n const renderEmptyState = emptyStateContent\n ? () => emptyStateContent\n : undefined\n\n // Keyed on column names rather than the `columns` array identity so a fresh\n // `columns` literal each render doesn't rebuild every formatter. `columns` is\n // intentionally omitted from the deps.\n const columnKey = columns.map((c) => `${c.name}/${c.type}`).join(\"|\")\n const preparedColumns = useMemo<PreparedColumn[]>(\n () => columns.map(prepareColumn),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [columnKey]\n )\n\n const {\n hideableColumns,\n isColumnVisible,\n onColumnVisibilityChange,\n visibleHideableColumns,\n } = useColumnVisibility({\n columns,\n onVisibleColumnNamesChange,\n visibleColumnNames,\n })\n const visiblePreparedColumns = useMemo(\n () => preparedColumns.filter(({ column }) => isColumnVisible(column)),\n [preparedColumns, isColumnVisible]\n )\n\n // Selection is controlled when `selectedKeys` is provided; otherwise it's\n // tracked internally so the results count and table actions still reflect it.\n const isControlled = controlledSelectedKeys !== undefined\n const [internalSelectedKeys, setInternalSelectedKeys] = useState<\n (number | string)[]\n >([])\n const selectedKeys = isControlled\n ? controlledSelectedKeys\n : internalSelectedKeys\n\n // React Aria treats a row's own action as primary only while the selection is\n // empty: with checkbox selection, once any row is selected the table is in\n // selection mode and pressing anywhere in a row toggles its selection instead\n // of firing the action. Rows without an action always select on press. The\n // row's hover state previews the checkbox's hover state whenever a press would\n // select, so this has to track the selection rather than the props alone.\n const rowPressSelects =\n Boolean(selectable) && (!hasRowPressAction || selectedKeys.length > 0)\n\n const selectableProps = useSelectableProps({\n data,\n disabledKeys,\n getRowId,\n onSelectedChange: (keys) => {\n if (!isControlled) setInternalSelectedKeys(keys)\n onSelectedChange?.(keys)\n },\n selectable,\n selectedKeys,\n })\n\n // Associate the visible results count with the table so screen readers\n // announce it as a description of the table. `Table` doesn't support a real\n // `<caption>` (its children go through a collection builder), so we link the\n // count via `aria-describedby`, merging with any caller-supplied value.\n const stableId = useId()\n const tableId = id || `tds-data-table-${stableId}`\n const resultsCountId = `${tableId}-results-count`\n const describedBy = hasResultsCount(resultNoun)\n ? [restProps[\"aria-describedby\"], resultsCountId].filter(Boolean).join(\" \")\n : restProps[\"aria-describedby\"]\n\n // A caller-supplied `aria-label` always wins; otherwise the results noun\n // provides the table's accessible name so a label is present whenever a noun\n // is given. Array nouns are transformed to their plural form.\n const resultNounLabel = resolveResultNounLabel(resultNoun)\n const ariaLabel = restProps[\"aria-label\"] || resultNounLabel\n const paginationLabel = resultNounLabel\n ? `${resultNounLabel} table pagination`\n : undefined\n\n const hasActions = (tableActions?.length ?? 0) > 0\n const hasColumnVisibilityToggle = hideableColumns.length > 0\n const showHeader = Boolean(\n resultNoun || hasActions || hasColumnVisibilityToggle\n )\n const hasRowActions = (rowActions?.length ?? 0) > 0\n // A lone page has nothing to navigate to, so the paged controls stay out of\n // the frame entirely rather than rendering a single inert page marker. The\n // indexed type has no page count to measure against — stepping is the only\n // way through the set — so asking for it always renders the controls, and a\n // set that fits on one page shows both buttons disabled.\n const isIndexedPagination = paginationType === \"indexed\"\n const showPagination =\n isIndexedPagination || (totalPages !== undefined && totalPages > 1)\n\n return (\n <div\n className={classNames(\"tds-data-table\", {\n \"tds-data-table--sticky-header\": hasScrollContainer,\n })}\n >\n <div className=\"tds-data-table-frame\">\n {showHeader && (\n <div className=\"tds-data-table-frame-header\">\n <ResultsCount\n id={resultsCountId}\n resultNoun={resultNoun}\n selectable={selectable}\n selectedCount={selectedKeys.length}\n // An explicit `resultCount` covers the whole result set, which a\n // paginated table's `data` doesn't.\n totalCount={resultCount ?? data.length}\n />\n {hasActions && (\n <TableActions\n actions={tableActions!} // Safe to assert non-null here because of `hasActions`\n resultNoun={resultNoun}\n selectedKeys={selectedKeys}\n />\n )}\n {hasColumnVisibilityToggle && (\n <ColumnVisibilityToggle\n columns={hideableColumns}\n onChange={onColumnVisibilityChange}\n visibleColumnNames={visibleHideableColumns}\n />\n )}\n </div>\n )}\n <div ref={wrapperRef} className=\"tds-data-table-scroll-wrapper\">\n <div ref={scrollRef} className=\"tds-data-table-scroll\">\n <Table\n {...restProps}\n {...selectableProps}\n {...(ariaLabel ? { \"aria-label\": ariaLabel } : {})}\n {...(describedBy ? { \"aria-describedby\": describedBy } : {})}\n // RAC's `Table` forwards `id` to the underlying table element at\n // runtime (via `filterDOMProps({ global: true })`) but omits `id`\n // from its prop types, so spread it through a cast.\n {...({ id: tableId } as Partial<AriaTableProps>)}\n className={combinedClassName}\n // Pinned rather than exposed as a prop: `disabledKeys` only ever\n // turns off selection here, leaving the row clickable and\n // focusable. React Aria defaults this to \"all\", which would also\n // disable `onRowClick`/`getRowLink` and drop the row out of the\n // focus order, so it has to be set explicitly.\n disabledBehavior=\"selection\"\n disabledKeys={disabledKeys}\n sortDescriptor={sortDescriptor}\n onSortChange={(sort) => {\n onSortChange?.(serializeSort(sort))\n }}\n >\n <TableHeader className=\"tds-data-table-header\">\n {/*\n Rendered as a sibling before the `preparedColumns.map` below\n (not folded into it) so the map's `index` still starts at 0\n for the first *data* column — that's what keeps\n `isRowHeader={index === 0}` pointing at the first data\n column instead of this selection column.\n */}\n {selectable && (\n <Column className=\"tds-data-table-column tds-data-table-column--selectable\">\n <Checkbox\n slot=\"selection\"\n className=\"tds-data-table-selectable-checkbox\"\n />\n </Column>\n )}\n {visiblePreparedColumns.map(({ align, column }, index) => (\n <Column\n key={column.name}\n id={column.name}\n isRowHeader={index === 0}\n className={classNames(\"tds-data-table-column\", {\n [`tds-data-table-column--align-${align}`]:\n align !== \"start\",\n })}\n allowsSorting={column.sortable}\n >\n {column.hideLabel ? (\n <span className=\"tds-data-table-column-label--hidden\">\n {column.headerLabel}\n </span>\n ) : (\n column.headerLabel\n )}\n {column.sortable && (\n <Icon\n className=\"tds-data-table-column-icon tds-data-table-column-icon--sort\"\n symbol=\"general#up-caret\"\n aria-hidden={true}\n />\n )}\n </Column>\n ))}\n {hasRowActions && (\n <Column className=\"tds-data-table-column tds-data-table-column--actions\">\n <span className=\"tds-data-table-column-label--hidden\">\n Actions\n </span>\n </Column>\n )}\n </TableHeader>\n <TableBody\n className=\"tds-data-table-body\"\n renderEmptyState={renderEmptyState}\n >\n {data.map((row, rowIndex) => {\n const rowKey = getRowKey(row, rowIndex, getRowId)\n return (\n <Row\n key={rowKey}\n id={rowKey}\n href={getRowLink?.(row)}\n onAction={onRowClick ? () => onRowClick(row) : undefined}\n className={classNames(\"tds-data-table-row\", {\n \"tds-data-table-row--interactive\": rowsAreInteractive,\n \"tds-data-table-row--press-selects\": rowPressSelects,\n })}\n >\n {selectable && (\n <Cell className=\"tds-data-table-cell tds-data-table-cell--selectable\">\n <Checkbox\n slot=\"selection\"\n className=\"tds-data-table-selectable-checkbox\"\n />\n </Cell>\n )}\n {visiblePreparedColumns.map((prepared) => (\n <Cell\n key={prepared.column.name}\n {...cellBoundaryProps}\n data-pii={prepared.column.pii || undefined}\n className={classNames(\"tds-data-table-cell\", {\n [`tds-data-table-cell--align-${prepared.align}`]:\n prepared.align !== \"start\",\n \"tds-data-table-cell--numeric\": prepared.isNumeric,\n })}\n >\n {prepared.renderCell(row)}\n </Cell>\n ))}\n {hasRowActions && (\n <Cell\n {...cellBoundaryProps}\n className=\"tds-data-table-cell tds-data-table-cell--actions\"\n >\n <RowActions\n actions={rowActions!} // Safe to assert non-null here because of `hasRowActions`\n row={row}\n rowKey={rowKey}\n />\n </Cell>\n )}\n </Row>\n )\n })}\n </TableBody>\n </Table>\n </div>\n </div>\n {showPagination && (\n <div className=\"tds-data-table-frame-footer\">\n {/*\n `Pagination`'s two shapes are a discriminated union, so each is\n spelled out in full rather than assembled from one prop bag.\n */}\n {isIndexedPagination ? (\n <Pagination\n aria-label={paginationLabel}\n hasNextPage={hasNextPage}\n hasPreviousPage={hasPreviousPage}\n onNextPageClick={onNextPageClick}\n onPreviousPageClick={onPreviousPageClick}\n type=\"indexed\"\n />\n ) : (\n <Pagination\n aria-label={paginationLabel}\n currentPage={currentPage}\n onPageChange={onPageChange}\n totalPages={totalPages!}\n />\n )}\n </div>\n )}\n </div>\n </div>\n )\n}\n\nDataTable.displayName = \"DataTable\"\n\n/**\n * Resolves the content rendered in the table body's empty-state slot based on\n * `loadingState`, falling back to `emptyState`. Returns `null` when nothing\n * should render (idle with no `emptyState`).\n */\nfunction getEmptyStateContent({\n emptyState,\n errorState,\n loadingState,\n}: {\n emptyState: ReactNode\n errorState: ReactNode\n loadingState: DataTableLoadingState\n}): ReactNode {\n if (loadingState === \"loading\") {\n return (\n <div className=\"tds-data-table-loading\" role=\"status\">\n <span className=\"tds-data-table-cell-label--hidden\">Loading</span>\n <span className=\"tds-data-table-loading-spinner\" aria-hidden=\"true\">\n <LoadingSpinner />\n </span>\n </div>\n )\n }\n\n // Error and empty share the same container; they differ only in content.\n const content =\n loadingState === \"error\" ? (errorState ?? DEFAULT_ERROR_STATE) : emptyState\n if (content == null) return null\n\n return <div className=\"tds-data-table-empty\">{content}</div>\n}\n\nfunction useSortDescriptor(\n sortBy: Sort | undefined\n): SortDescriptor | undefined {\n return useMemo(() => {\n if (!sortBy) return undefined\n return deserializeSort(sortBy)\n }, [sortBy])\n}\n\nfunction deserializeSort(sort: Sort): SortDescriptor {\n if (sort.direction === \"desc\")\n return { column: sort.column, direction: \"descending\" }\n return { column: sort.column, direction: \"ascending\" }\n}\n\nfunction serializeSort(sort: SortDescriptor): Sort {\n if (sort.direction === \"descending\")\n return { column: sort.column as string, direction: \"desc\" }\n return { column: sort.column as string, direction: \"asc\" }\n}\n\n/**\n * Resolves the `<Table>` selection props, driving React Aria's `<Table>` off\n * the component's selection state. `onSelectedChange` always receives a plain\n * array of keys: React Aria's `\"all\"` selection sentinel (used for\n * infinite-loading collections, which this component doesn't have) is resolved\n * to the concrete keys of the currently loaded rows, minus any disabled ones —\n * React Aria's own \"select all\" skips disabled rows, so resolving `\"all\"` has to\n * skip them too.\n */\nfunction useSelectableProps({\n data,\n disabledKeys,\n getRowId,\n onSelectedChange,\n selectable,\n selectedKeys,\n}: {\n data: unknown[]\n disabledKeys: (number | string)[] | undefined\n getRowId: ((row: unknown) => number | string) | undefined\n onSelectedChange: (keys: (number | string)[]) => void\n selectable: boolean | undefined\n selectedKeys: (number | string)[]\n}): Pick<\n AriaTableProps,\n \"onSelectionChange\" | \"selectedKeys\" | \"selectionMode\"\n> {\n const selectedKeysSet = useMemo(\n () => new Set<Key>(selectedKeys),\n [selectedKeys]\n )\n const { rowKeys, rowOrder } = useMemo(() => {\n const rowKeys = data.map((row, index) => getRowKey(row, index, getRowId))\n return {\n rowKeys,\n rowOrder: new Map<Key, number>(rowKeys.map((key, index) => [key, index])),\n }\n }, [data, getRowId])\n\n if (!selectable) return { selectionMode: \"none\" }\n\n return {\n onSelectionChange: (keys: Selection) => {\n if (keys === \"all\") {\n const disabled = new Set<Key>(disabledKeys)\n onSelectedChange(rowKeys.filter((key) => !disabled.has(key)))\n return\n }\n // Keys not found in `rowOrder` (e.g. a previously selected row no longer\n // in `data`) sort to the end rather than being dropped.\n onSelectedChange(\n Array.from(keys).sort(\n (a, b) =>\n (rowOrder.get(a) ?? Infinity) - (rowOrder.get(b) ?? Infinity)\n )\n )\n },\n selectedKeys: selectedKeysSet,\n selectionMode: \"multiple\",\n }\n}\n\nfunction useStickyHeader(\n stickyHeader: boolean | undefined,\n scrollContainerRef: React.RefObject<HTMLElement> | undefined,\n scrollContainerSelector: string | undefined\n) {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const [hasScrollContainer, setHasScrollContainer] = useState(false)\n\n useLayoutEffect(() => {\n setHasScrollContainer(false)\n if (!stickyHeader) return\n if (typeof ResizeObserver === \"undefined\") return\n const wrapper = wrapperRef.current\n if (!wrapper) return\n\n const scrollContainer = getScrollContainer(\n scrollContainerRef,\n scrollContainerSelector,\n wrapper\n )\n if (!scrollContainer) return\n\n setHasScrollContainer(true)\n\n let thead: HTMLElement | null = null\n\n const resizeObserver = new ResizeObserver(() => {\n if (!thead) {\n thead = wrapper.querySelector<HTMLElement>(\".tds-data-table-header\")\n if (!thead) return\n scrollContainer.style.setProperty(\n \"scroll-timeline-name\",\n \"--_sticky-header-scroll\"\n )\n }\n\n const { top: wrapperTop, bottom: wrapperBottom } =\n wrapper.getBoundingClientRect()\n const { top: scrollContainerTop } =\n scrollContainer.getBoundingClientRect()\n // Derive headerTop from the untransformed wrapper to avoid reading the\n // scroll-driven translateY that getBoundingClientRect() includes on thead.\n const headerTop = wrapperTop + wrapper.clientTop\n const start = scrollContainer.scrollTop + (headerTop - scrollContainerTop)\n const max = Math.max(0, wrapperBottom - headerTop - thead.offsetHeight)\n wrapper.style.setProperty(\"--_sticky-header-scroll-start\", `${start}px`)\n wrapper.style.setProperty(\"--_sticky-header-scroll-max\", `${max}px`)\n })\n\n resizeObserver.observe(wrapper)\n resizeObserver.observe(scrollContainer)\n\n return () => {\n resizeObserver.disconnect()\n wrapper.style.removeProperty(\"--_sticky-header-scroll-start\")\n wrapper.style.removeProperty(\"--_sticky-header-scroll-max\")\n }\n }, [stickyHeader, scrollContainerRef, scrollContainerSelector])\n\n return { hasScrollContainer, wrapperRef }\n}\n\nfunction getScrollContainer(\n scrollContainerRef: React.RefObject<HTMLElement> | undefined,\n scrollContainerSelector: string | undefined,\n wrapper: HTMLElement\n): HTMLElement | undefined {\n const element =\n scrollContainerRef?.current ??\n getScrollContainerFromSelector(scrollContainerSelector, wrapper)\n if (element instanceof Window) return\n return element\n}\n\nfunction getScrollContainerFromSelector(\n scrollContainerSelector: string | undefined,\n wrapper: HTMLElement\n): HTMLElement | undefined {\n return scrollContainerSelector\n ? (wrapper.parentElement?.closest<HTMLElement>(scrollContainerSelector) ??\n undefined)\n : undefined\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;AAwPA,MAAM,mBAAmB,GAAG,uBAAuB;AAanD;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,SAAS,GAAG,CAAC,EACxB,SAAS,EACT,OAAO,EACP,WAAW,GAAG,CAAC,EACf,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,GAAG,KAAK,EACnB,eAAe,GAAG,KAAK,EACvB,EAAE,EACF,YAAY,GAAG,MAAM,EACrB,cAAc,GAAG,OAAO,EACxB,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,uBAAuB,GAAG,eAAe,EACzC,UAAU,EACV,UAAU,EACV,YAAY,EAAE,sBAAsB,EACpC,YAAY,EACZ,MAAM,EACN,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,0BAA0B,EAC1B,GAAG,SAAS,EACU,KAAI;IAC1B,MAAM,iBAAiB,GAAG,OAAO,CAAC,UAAU,IAAI,UAAU,CAAC;IAC3D,MAAM,kBAAkB,GAAG,iBAAiB,IAAI,OAAO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BAAkB,EAAE,UAAU,EAAE;AAC3C;AAEA,SAAS,kBAAkB,CACzB,kBAA4D,EAC5D,uBAA2C,EAC3C,OAAoB,EAAA;AAEpB,IAAA,MAAM,OAAO,GACX,kBAAkB,EAAE,OAAO;AAC3B,QAAA,8BAA8B,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAClE,IAAI,OAAO,YAAY,MAAM;QAAE;AAC/B,IAAA,OAAO,OAAO;AAChB;AAEA,SAAS,8BAA8B,CACrC,uBAA2C,EAC3C,OAAoB,EAAA;AAEpB,IAAA,OAAO;WACF,OAAO,CAAC,aAAa,EAAE,OAAO,CAAc,uBAAuB,CAAC;AACnE,YAAA,SAAS;UACX,SAAS;AACf;;;;"}
|
|
1
|
+
{"version":3,"file":"DataTable.js","sources":["../../../src/components/DataTable/DataTable.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { LoadingSpinner } from \"@components/internal\"\nimport { Pagination } from \"@components/internal/pagination\"\nimport Icon from \"@utilities/Icon\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, {\n type ReactNode,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport {\n Cell,\n Checkbox,\n Column,\n type Key,\n Row,\n type Selection,\n type SortDescriptor,\n Table,\n TableBody,\n TableHeader,\n type TableProps as AriaTableProps,\n} from \"react-aria-components/Table\"\n\nimport type { DataTableColumn } from \"./DataTableColumn\"\nimport { prepareColumn, type PreparedColumn } from \"./DataTableColumnTypes\"\nimport { getRowKey } from \"./DataTableRow\"\nimport {\n hasResultsCount,\n resolveResultNounLabel,\n type ResultNoun,\n ResultsCount,\n} from \"./ResultsCount\"\nimport { type RowAction, RowActions } from \"./RowActions\"\nimport { type TableAction, TableActions } from \"./TableActions\"\nimport { useColumnVisibility } from \"./useColumnVisibility\"\nimport { useRowPressBoundary } from \"./useRowPressBoundary\"\nimport { ViewSettingsToggle } from \"./ViewSettingsToggle\"\n\nexport type { ResultNoun, RowAction, TableAction }\n\nexport type Sort = { column: string; direction: \"asc\" | \"desc\" }\n\nexport type DataTableLoadingState = \"error\" | \"idle\" | \"loading\"\n\nexport interface DataTableProps {\n /**\n * Columns define what data is displayed and how. Pass a stable reference\n * (e.g. a module constant or memoized value); columns are prepared per array\n * identity, so an inline array rebuilds each column's formatter every render.\n */\n columns: DataTableColumn[]\n /**\n * The 1-indexed current page. Only used by the default `\"paged\"` pagination,\n * where `totalPages` is set, and defaults to `1`.\n */\n currentPage?: number\n /** The array of rows to display. */\n data: unknown[]\n /**\n * Row keys that can't be selected. Keys are the values returned by `getRowId`\n * (or `row.id`, or the row's index) — the same keys used by `selectedKeys`.\n * Only selection is disabled: the row's checkbox renders disabled and \"select\n * all\" skips it, while the row itself stays clickable, navigable, and\n * focusable. Has no effect unless the table is `selectable`.\n */\n disabledKeys?: (number | string)[]\n /** Rendered in place of the table body when there is no data. */\n emptyState?: ReactNode\n /** Rendered in place of the table body when `loadingState` is `\"error\"`. */\n errorState?: ReactNode\n /** Returns a stable identity for each row. Defaults to `row.id`. */\n getRowId?: (row: unknown) => number | string\n /**\n * Returns a URL to navigate to when the row is clicked. Rows with a link\n * render as navigable elements (clickable, keyboard-focusable, and\n * openable in a new tab). Works alongside `onRowClick` and `selectable`.\n */\n getRowLink?: (row: unknown) => string\n /**\n * Whether a page exists after the current one. Only used by\n * `paginationType=\"indexed\"`, which has no page count to derive it from;\n * `false` (the default) disables the Next button.\n */\n hasNextPage?: boolean\n /**\n * Whether a page exists before the current one. Only used by\n * `paginationType=\"indexed\"`, which has no page count to derive it from;\n * `false` (the default) disables the Previous button.\n */\n hasPreviousPage?: boolean\n /**\n * An `id` for the table element. When omitted, a stable generated id is used\n * so the results count can be linked to the table via `aria-describedby`.\n */\n id?: string\n /**\n * Async loading state for the table body.\n * - `\"loading\"`: While `data` is empty, replaces the empty state with a\n * centered spinner.\n * - `\"error\"`: While `data` is empty, replaces the empty state with\n * `errorState` (or a default error message).\n * - `\"idle\"` (default): Normal rendering.\n */\n loadingState?: DataTableLoadingState\n /**\n * Called when the Next button is activated. Only used by\n * `paginationType=\"indexed\"`; load the following page's rows and pass them\n * back in through `data` in response.\n */\n onNextPageClick?: () => void\n /**\n * Called with the 1-indexed page the user navigated to. The table doesn't\n * page `data` itself — pass the rows for the new page back in through `data`\n * (and update `currentPage`) in response. Only used by the default `\"paged\"`\n * pagination; the indexed type has no page number to report.\n */\n onPageChange?: (page: number) => void\n /**\n * Called when the Previous button is activated. Only used by\n * `paginationType=\"indexed\"`; load the preceding page's rows and pass them\n * back in through `data` in response.\n */\n onPreviousPageClick?: () => void\n /**\n * Called with the row when it is clicked. Rows with a click handler render\n * as interactive elements (clickable and keyboard-focusable). When\n * `getRowLink` is also set, both run and the row navigates.\n */\n onRowClick?: (row: unknown) => void\n /**\n * Called when the set of selected rows changes. Always receives a plain\n * array of row keys — never React Aria's `\"all\"` sentinel, which is\n * resolved to the concrete keys of the loaded rows.\n */\n onSelectedChange?: (keys: (number | string)[]) => void\n /** Callback invoked when the sort state changes. */\n onSortChange?: (sort: Sort) => void\n /**\n * Called with the full ordered list of visible column names when the\n * visibility toggle changes. Always-visible columns are included, so the\n * value can be passed straight back as `visibleColumnNames`. Column\n * visibility is controlled, so the table only updates once\n * `visibleColumnNames` changes.\n */\n onVisibleColumnNamesChange?: (visibleColumnNames: string[]) => void\n /**\n * Which shape the page controls take, forwarded to the `Pagination` control's\n * `type`.\n * - `\"paged\"` (the default): a numbered run of pages. Driven by `totalPages`,\n * `currentPage`, and `onPageChange`, and rendered only once `totalPages` is\n * set and greater than `1`.\n * - `\"indexed\"`: a labeled Previous/Next pair, for a result set that can only\n * be stepped through — a cursor-paged API, say, which reports whether a\n * neighboring page exists but not how many there are. Driven by\n * `hasPreviousPage`/`hasNextPage` and `onPreviousPageClick`/\n * `onNextPageClick`; `totalPages` and `currentPage` play no part. With no\n * page count there's no threshold to hide the controls below, so they\n * always render — a single page of results shows both buttons disabled.\n */\n paginationType?: \"indexed\" | \"paged\"\n /**\n * Overrides the number shown by the `resultNoun` count, which otherwise\n * uses the length of `data`. Use this when the table renders only part of\n * the result set — a paginated or virtualized table — so the count reflects\n * the whole set. Has no effect unless `resultNoun` is set.\n */\n resultCount?: number\n /**\n * Displays the number of results (the length of `data`, or `resultCount`\n * when supplied) above the table, followed by a noun that matches the count.\n * Pass a string to use it as the singular noun and append `\"s\"` for the\n * plural (e.g. `\"result\"` → `\"results\"`), or a `[singular, plural]` tuple to\n * supply an irregular plural explicitly (e.g. `[\"person\", \"people\"]`). Pass\n * `true` to use `\"result\"`.\n * When `false` or omitted, no count is rendered. The count is formatted with\n * `Intl.NumberFormat` and the singular form is used only when the count is\n * exactly `1`. When the table is `selectable` and rows are selected, the\n * count instead reflects the selection as `\"{selected} of {total}\"`, e.g.\n * `\"2 of 100\"`, with a visually-hidden suffix naming the noun so assistive\n * tech reads the unambiguous `\"2 of 100 people selected\"`.\n * The count is linked to the table with `aria-describedby` so\n * screen readers announce it as a description of the table. When a string or\n * `[singular, plural]` tuple is provided, the noun also supplies the table's\n * `aria-label` in its plural form (e.g. `\"items\"` or `\"people\"`) unless an\n * `aria-label` is passed directly, which always takes precedence; `true`\n * never provides a label. The same plural noun also names the pagination\n * landmark (e.g. `\"people table pagination\"`), which otherwise falls back to\n * `\"Pagination\"`.\n */\n resultNoun?: ResultNoun\n /**\n * Displays a sticky column to the right that holds row-scoped actions.\n * Renders as a dropdown with 2+ actions or a single button with one. Each\n * action's `onAction` or `getHref` receives the row.\n */\n rowActions?: RowAction[]\n /** Ref to the scroll container the sticky header should track. Takes priority over `scrollContainerSelector`. Only used when `stickyHeader` is true. */\n scrollContainerRef?: React.RefObject<HTMLElement>\n /** CSS selector for the scroll container the sticky header should track. Only used when `stickyHeader` is true. Defaults to \".content-wrap\" */\n scrollContainerSelector?: string\n /**\n * Enables row selection via checkboxes, including a \"select all\" checkbox in\n * the header. Without a row action (`onRowClick` or `getRowLink`), pressing\n * anywhere in a row toggles the row selection.\n */\n selectable?: boolean\n /** The selected row keys. Keys are the values returned by `getRowId` (or `row.id`, or the row's index). */\n selectedKeys?: (number | string)[]\n /** The current sort state for the table. */\n sortBy?: Sort\n /** Enables a sticky header that tracks an outer scroll container. Progressive enhancement: Relies on `animation-timeline: scroll()`, which isn't supported in all browsers (e.g. Firefox) — the header scrolls with the table body instead of sticking in those cases. */\n stickyHeader?: boolean\n /**\n * Table actions rendered as an `IconButton` group directly after the results\n * count, above the table. Each entry becomes an icon button whose `callback`\n * receives the ids of the currently selected rows. Unlike the original RFC,\n * these are not gated on `selectable` — actions such as print or export can\n * operate without a row selection.\n */\n tableActions?: TableAction[]\n /**\n * The total number of pages in the result set. Setting it renders the page\n * controls below the table; leaving it unset renders no pagination at all.\n * A single page has nothing to navigate to, so the controls only render once\n * there are two or more pages. Only used by the default `\"paged\"` pagination\n * — an indexed result set has no page count, which is the reason to reach for\n * `paginationType=\"indexed\"` in the first place.\n *\n * The table displays whatever rows it is given — paging is the caller's job.\n * `data` should hold only the current page's rows, `resultCount` the size of\n * the whole result set, and `onPageChange` should load the next page.\n */\n totalPages?: number\n /**\n * The names of the columns currently visible. Only columns marked `hideable`\n * are affected — every other column stays visible. Omitting this leaves all\n * columns visible. Unknown names are ignored and display order always\n * follows `columns`.\n */\n visibleColumnNames?: string[]\n}\n\nconst DEFAULT_ERROR_STATE = \"Something went wrong.\"\n\ntype AriaTablePropsToOmit = \"children\" | \"slot\"\n\ntype AriaTablePropsToInclude = never\n\nexport type DataTableElementProps = CombineAriaPropsWithCustomProps<\n AriaTableProps,\n DataTableProps,\n AriaTablePropsToOmit,\n AriaTablePropsToInclude\n>\n\n/**\n * A table for displaying tabular data. Built on React Aria's `Table`.\n *\n * Each column declares a `type` that controls how its cell values are\n * formatted: `string`, `number`, `currency`, `date`, `datetime`, `boolean`,\n * `enum`, and `custom`. A column's `render` function always takes precedence\n * over the built-in type formatting.\n *\n * Setting `totalPages` renders page controls below the table; the table itself\n * never slices `data`, so `onPageChange` is where the caller loads the page.\n * `paginationType=\"indexed\"` swaps the numbered run for a labeled\n * Previous/Next pair, for a result set with no known page count.\n *\n * Filtering, presets, and other RFC features are not yet implemented.\n *\n * @component\n */\nexport const DataTable = ({\n className,\n columns,\n currentPage = 1,\n data,\n disabledKeys,\n emptyState,\n errorState,\n getRowId,\n getRowLink,\n hasNextPage = false,\n hasPreviousPage = false,\n id,\n loadingState = \"idle\",\n paginationType = \"paged\",\n resultCount,\n resultNoun,\n scrollContainerRef,\n scrollContainerSelector = \".content-wrap\",\n rowActions,\n selectable,\n selectedKeys: controlledSelectedKeys,\n stickyHeader,\n sortBy,\n tableActions,\n totalPages,\n visibleColumnNames,\n onNextPageClick,\n onPageChange,\n onPreviousPageClick,\n onRowClick,\n onSelectedChange,\n onSortChange,\n onVisibleColumnNamesChange,\n ...restProps\n}: DataTableElementProps) => {\n const hasRowPressAction = Boolean(onRowClick || getRowLink)\n const rowsAreInteractive = hasRowPressAction || Boolean(selectable)\n const combinedClassName = classNames(\"tds-data-table-grid\", className)\n const sortDescriptor = useSortDescriptor(sortBy)\n const { hasScrollContainer, wrapperRef } = useStickyHeader(\n stickyHeader,\n scrollContainerRef,\n scrollContainerSelector\n )\n const scrollRef = useRef<HTMLDivElement>(null)\n // A `Button` or `Link` in a cell keeps its presses to itself, so activating\n // one doesn't also press the row it's in.\n const cellBoundaryProps = useRowPressBoundary(scrollRef, rowsAreInteractive)\n\n // React Aria only invokes `renderEmptyState` when the collection is empty, so\n // the loading spinner and error message only take over the body while `data`\n // is empty; once rows exist they always render.\n const emptyStateContent = getEmptyStateContent({\n emptyState,\n errorState,\n loadingState,\n })\n const renderEmptyState = emptyStateContent\n ? () => emptyStateContent\n : undefined\n\n // Keyed on column names rather than the `columns` array identity so a fresh\n // `columns` literal each render doesn't rebuild every formatter. `columns` is\n // intentionally omitted from the deps.\n const columnKey = columns.map((c) => `${c.name}/${c.type}`).join(\"|\")\n const preparedColumns = useMemo<PreparedColumn[]>(\n () => columns.map(prepareColumn),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [columnKey]\n )\n\n const {\n hideableColumns,\n isColumnVisible,\n onColumnVisibilityChange,\n visibleHideableColumns,\n } = useColumnVisibility({\n columns,\n onVisibleColumnNamesChange,\n visibleColumnNames,\n })\n const visiblePreparedColumns = useMemo(\n () => preparedColumns.filter(({ column }) => isColumnVisible(column)),\n [preparedColumns, isColumnVisible]\n )\n\n // Selection is controlled when `selectedKeys` is provided; otherwise it's\n // tracked internally so the results count and table actions still reflect it.\n const isControlled = controlledSelectedKeys !== undefined\n const [internalSelectedKeys, setInternalSelectedKeys] = useState<\n (number | string)[]\n >([])\n const selectedKeys = isControlled\n ? controlledSelectedKeys\n : internalSelectedKeys\n\n // React Aria treats a row's own action as primary only while the selection is\n // empty: with checkbox selection, once any row is selected the table is in\n // selection mode and pressing anywhere in a row toggles its selection instead\n // of firing the action. Rows without an action always select on press. The\n // row's hover state previews the checkbox's hover state whenever a press would\n // select, so this has to track the selection rather than the props alone.\n const rowPressSelects =\n Boolean(selectable) && (!hasRowPressAction || selectedKeys.length > 0)\n\n const selectableProps = useSelectableProps({\n data,\n disabledKeys,\n getRowId,\n onSelectedChange: (keys) => {\n if (!isControlled) setInternalSelectedKeys(keys)\n onSelectedChange?.(keys)\n },\n selectable,\n selectedKeys,\n })\n\n // Associate the visible results count with the table so screen readers\n // announce it as a description of the table. `Table` doesn't support a real\n // `<caption>` (its children go through a collection builder), so we link the\n // count via `aria-describedby`, merging with any caller-supplied value.\n const stableId = useId()\n const tableId = id || `tds-data-table-${stableId}`\n const resultsCountId = `${tableId}-results-count`\n const describedBy = hasResultsCount(resultNoun)\n ? [restProps[\"aria-describedby\"], resultsCountId].filter(Boolean).join(\" \")\n : restProps[\"aria-describedby\"]\n\n // A caller-supplied `aria-label` always wins; otherwise the results noun\n // provides the table's accessible name so a label is present whenever a noun\n // is given. Array nouns are transformed to their plural form.\n const resultNounLabel = resolveResultNounLabel(resultNoun)\n const ariaLabel = restProps[\"aria-label\"] || resultNounLabel\n const paginationLabel = resultNounLabel\n ? `${resultNounLabel} table pagination`\n : undefined\n\n const hasActions = (tableActions?.length ?? 0) > 0\n const hasViewSettingsToggle = hideableColumns.length > 0\n const showHeader = Boolean(resultNoun || hasActions || hasViewSettingsToggle)\n const hasRowActions = (rowActions?.length ?? 0) > 0\n // A lone page has nothing to navigate to, so the paged controls stay out of\n // the frame entirely rather than rendering a single inert page marker. The\n // indexed type has no page count to measure against — stepping is the only\n // way through the set — so asking for it always renders the controls, and a\n // set that fits on one page shows both buttons disabled.\n const isIndexedPagination = paginationType === \"indexed\"\n const showPagination =\n isIndexedPagination || (totalPages !== undefined && totalPages > 1)\n\n return (\n <div\n className={classNames(\"tds-data-table\", {\n \"tds-data-table--sticky-header\": hasScrollContainer,\n })}\n >\n <div className=\"tds-data-table-frame\">\n {showHeader && (\n <div className=\"tds-data-table-frame-header\">\n <ResultsCount\n id={resultsCountId}\n resultNoun={resultNoun}\n selectable={selectable}\n selectedCount={selectedKeys.length}\n // An explicit `resultCount` covers the whole result set, which a\n // paginated table's `data` doesn't.\n totalCount={resultCount ?? data.length}\n />\n {hasActions && (\n <TableActions\n actions={tableActions!} // Safe to assert non-null here because of `hasActions`\n resultNoun={resultNoun}\n selectedKeys={selectedKeys}\n />\n )}\n {hasViewSettingsToggle && (\n <ViewSettingsToggle\n columns={hideableColumns}\n onColumnVisibilityChange={onColumnVisibilityChange}\n visibleColumnNames={visibleHideableColumns}\n />\n )}\n </div>\n )}\n <div ref={wrapperRef} className=\"tds-data-table-scroll-wrapper\">\n <div ref={scrollRef} className=\"tds-data-table-scroll\">\n <Table\n {...restProps}\n {...selectableProps}\n {...(ariaLabel ? { \"aria-label\": ariaLabel } : {})}\n {...(describedBy ? { \"aria-describedby\": describedBy } : {})}\n // RAC's `Table` forwards `id` to the underlying table element at\n // runtime (via `filterDOMProps({ global: true })`) but omits `id`\n // from its prop types, so spread it through a cast.\n {...({ id: tableId } as Partial<AriaTableProps>)}\n className={combinedClassName}\n // Pinned rather than exposed as a prop: `disabledKeys` only ever\n // turns off selection here, leaving the row clickable and\n // focusable. React Aria defaults this to \"all\", which would also\n // disable `onRowClick`/`getRowLink` and drop the row out of the\n // focus order, so it has to be set explicitly.\n disabledBehavior=\"selection\"\n disabledKeys={disabledKeys}\n sortDescriptor={sortDescriptor}\n onSortChange={(sort) => {\n onSortChange?.(serializeSort(sort))\n }}\n >\n <TableHeader className=\"tds-data-table-header\">\n {/*\n Rendered as a sibling before the `preparedColumns.map` below\n (not folded into it) so the map's `index` still starts at 0\n for the first *data* column — that's what keeps\n `isRowHeader={index === 0}` pointing at the first data\n column instead of this selection column.\n */}\n {selectable && (\n <Column className=\"tds-data-table-column tds-data-table-column--selectable\">\n <Checkbox\n slot=\"selection\"\n className=\"tds-data-table-selectable-checkbox\"\n />\n </Column>\n )}\n {visiblePreparedColumns.map(({ align, column }, index) => (\n <Column\n key={column.name}\n id={column.name}\n isRowHeader={index === 0}\n className={classNames(\"tds-data-table-column\", {\n [`tds-data-table-column--align-${align}`]:\n align !== \"start\",\n })}\n allowsSorting={column.sortable}\n >\n {column.hideLabel ? (\n <span className=\"tds-data-table-column-label--hidden\">\n {column.headerLabel}\n </span>\n ) : (\n column.headerLabel\n )}\n {column.sortable && (\n <Icon\n className=\"tds-data-table-column-icon tds-data-table-column-icon--sort\"\n symbol=\"general#up-caret\"\n aria-hidden={true}\n />\n )}\n </Column>\n ))}\n {hasRowActions && (\n <Column className=\"tds-data-table-column tds-data-table-column--actions\">\n <span className=\"tds-data-table-column-label--hidden\">\n Actions\n </span>\n </Column>\n )}\n </TableHeader>\n <TableBody\n className=\"tds-data-table-body\"\n renderEmptyState={renderEmptyState}\n >\n {data.map((row, rowIndex) => {\n const rowKey = getRowKey(row, rowIndex, getRowId)\n return (\n <Row\n key={rowKey}\n id={rowKey}\n href={getRowLink?.(row)}\n onAction={onRowClick ? () => onRowClick(row) : undefined}\n className={classNames(\"tds-data-table-row\", {\n \"tds-data-table-row--interactive\": rowsAreInteractive,\n \"tds-data-table-row--press-selects\": rowPressSelects,\n })}\n >\n {selectable && (\n <Cell className=\"tds-data-table-cell tds-data-table-cell--selectable\">\n <Checkbox\n slot=\"selection\"\n className=\"tds-data-table-selectable-checkbox\"\n />\n </Cell>\n )}\n {visiblePreparedColumns.map((prepared) => (\n <Cell\n key={prepared.column.name}\n {...cellBoundaryProps}\n data-pii={prepared.column.pii || undefined}\n className={classNames(\"tds-data-table-cell\", {\n [`tds-data-table-cell--align-${prepared.align}`]:\n prepared.align !== \"start\",\n \"tds-data-table-cell--numeric\": prepared.isNumeric,\n })}\n >\n {prepared.renderCell(row)}\n </Cell>\n ))}\n {hasRowActions && (\n <Cell\n {...cellBoundaryProps}\n className=\"tds-data-table-cell tds-data-table-cell--actions\"\n >\n <RowActions\n actions={rowActions!} // Safe to assert non-null here because of `hasRowActions`\n row={row}\n rowKey={rowKey}\n />\n </Cell>\n )}\n </Row>\n )\n })}\n </TableBody>\n </Table>\n </div>\n </div>\n {showPagination && (\n <div className=\"tds-data-table-frame-footer\">\n {/*\n `Pagination`'s two shapes are a discriminated union, so each is\n spelled out in full rather than assembled from one prop bag.\n */}\n {isIndexedPagination ? (\n <Pagination\n aria-label={paginationLabel}\n hasNextPage={hasNextPage}\n hasPreviousPage={hasPreviousPage}\n onNextPageClick={onNextPageClick}\n onPreviousPageClick={onPreviousPageClick}\n type=\"indexed\"\n />\n ) : (\n <Pagination\n aria-label={paginationLabel}\n currentPage={currentPage}\n onPageChange={onPageChange}\n totalPages={totalPages!}\n />\n )}\n </div>\n )}\n </div>\n </div>\n )\n}\n\nDataTable.displayName = \"DataTable\"\n\n/**\n * Resolves the content rendered in the table body's empty-state slot based on\n * `loadingState`, falling back to `emptyState`. Returns `null` when nothing\n * should render (idle with no `emptyState`).\n */\nfunction getEmptyStateContent({\n emptyState,\n errorState,\n loadingState,\n}: {\n emptyState: ReactNode\n errorState: ReactNode\n loadingState: DataTableLoadingState\n}): ReactNode {\n if (loadingState === \"loading\") {\n return (\n <div className=\"tds-data-table-loading\" role=\"status\">\n <span className=\"tds-data-table-cell-label--hidden\">Loading</span>\n <span className=\"tds-data-table-loading-spinner\" aria-hidden=\"true\">\n <LoadingSpinner />\n </span>\n </div>\n )\n }\n\n // Error and empty share the same container; they differ only in content.\n const content =\n loadingState === \"error\" ? (errorState ?? DEFAULT_ERROR_STATE) : emptyState\n if (content == null) return null\n\n return <div className=\"tds-data-table-empty\">{content}</div>\n}\n\nfunction useSortDescriptor(\n sortBy: Sort | undefined\n): SortDescriptor | undefined {\n return useMemo(() => {\n if (!sortBy) return undefined\n return deserializeSort(sortBy)\n }, [sortBy])\n}\n\nfunction deserializeSort(sort: Sort): SortDescriptor {\n if (sort.direction === \"desc\")\n return { column: sort.column, direction: \"descending\" }\n return { column: sort.column, direction: \"ascending\" }\n}\n\nfunction serializeSort(sort: SortDescriptor): Sort {\n if (sort.direction === \"descending\")\n return { column: sort.column as string, direction: \"desc\" }\n return { column: sort.column as string, direction: \"asc\" }\n}\n\n/**\n * Resolves the `<Table>` selection props, driving React Aria's `<Table>` off\n * the component's selection state. `onSelectedChange` always receives a plain\n * array of keys: React Aria's `\"all\"` selection sentinel (used for\n * infinite-loading collections, which this component doesn't have) is resolved\n * to the concrete keys of the currently loaded rows, minus any disabled ones —\n * React Aria's own \"select all\" skips disabled rows, so resolving `\"all\"` has to\n * skip them too.\n */\nfunction useSelectableProps({\n data,\n disabledKeys,\n getRowId,\n onSelectedChange,\n selectable,\n selectedKeys,\n}: {\n data: unknown[]\n disabledKeys: (number | string)[] | undefined\n getRowId: ((row: unknown) => number | string) | undefined\n onSelectedChange: (keys: (number | string)[]) => void\n selectable: boolean | undefined\n selectedKeys: (number | string)[]\n}): Pick<\n AriaTableProps,\n \"onSelectionChange\" | \"selectedKeys\" | \"selectionMode\"\n> {\n const selectedKeysSet = useMemo(\n () => new Set<Key>(selectedKeys),\n [selectedKeys]\n )\n const { rowKeys, rowOrder } = useMemo(() => {\n const rowKeys = data.map((row, index) => getRowKey(row, index, getRowId))\n return {\n rowKeys,\n rowOrder: new Map<Key, number>(rowKeys.map((key, index) => [key, index])),\n }\n }, [data, getRowId])\n\n if (!selectable) return { selectionMode: \"none\" }\n\n return {\n onSelectionChange: (keys: Selection) => {\n if (keys === \"all\") {\n const disabled = new Set<Key>(disabledKeys)\n onSelectedChange(rowKeys.filter((key) => !disabled.has(key)))\n return\n }\n // Keys not found in `rowOrder` (e.g. a previously selected row no longer\n // in `data`) sort to the end rather than being dropped.\n onSelectedChange(\n Array.from(keys).sort(\n (a, b) =>\n (rowOrder.get(a) ?? Infinity) - (rowOrder.get(b) ?? Infinity)\n )\n )\n },\n selectedKeys: selectedKeysSet,\n selectionMode: \"multiple\",\n }\n}\n\nfunction useStickyHeader(\n stickyHeader: boolean | undefined,\n scrollContainerRef: React.RefObject<HTMLElement> | undefined,\n scrollContainerSelector: string | undefined\n) {\n const wrapperRef = useRef<HTMLDivElement>(null)\n const [hasScrollContainer, setHasScrollContainer] = useState(false)\n\n useLayoutEffect(() => {\n setHasScrollContainer(false)\n if (!stickyHeader) return\n if (typeof ResizeObserver === \"undefined\") return\n const wrapper = wrapperRef.current\n if (!wrapper) return\n\n const scrollContainer = getScrollContainer(\n scrollContainerRef,\n scrollContainerSelector,\n wrapper\n )\n if (!scrollContainer) return\n\n setHasScrollContainer(true)\n\n let thead: HTMLElement | null = null\n\n const resizeObserver = new ResizeObserver(() => {\n if (!thead) {\n thead = wrapper.querySelector<HTMLElement>(\".tds-data-table-header\")\n if (!thead) return\n scrollContainer.style.setProperty(\n \"scroll-timeline-name\",\n \"--_sticky-header-scroll\"\n )\n }\n\n const { top: wrapperTop, bottom: wrapperBottom } =\n wrapper.getBoundingClientRect()\n const { top: scrollContainerTop } =\n scrollContainer.getBoundingClientRect()\n // Derive headerTop from the untransformed wrapper to avoid reading the\n // scroll-driven translateY that getBoundingClientRect() includes on thead.\n const headerTop = wrapperTop + wrapper.clientTop\n const start = scrollContainer.scrollTop + (headerTop - scrollContainerTop)\n const max = Math.max(0, wrapperBottom - headerTop - thead.offsetHeight)\n wrapper.style.setProperty(\"--_sticky-header-scroll-start\", `${start}px`)\n wrapper.style.setProperty(\"--_sticky-header-scroll-max\", `${max}px`)\n })\n\n resizeObserver.observe(wrapper)\n resizeObserver.observe(scrollContainer)\n\n return () => {\n resizeObserver.disconnect()\n wrapper.style.removeProperty(\"--_sticky-header-scroll-start\")\n wrapper.style.removeProperty(\"--_sticky-header-scroll-max\")\n }\n }, [stickyHeader, scrollContainerRef, scrollContainerSelector])\n\n return { hasScrollContainer, wrapperRef }\n}\n\nfunction getScrollContainer(\n scrollContainerRef: React.RefObject<HTMLElement> | undefined,\n scrollContainerSelector: string | undefined,\n wrapper: HTMLElement\n): HTMLElement | undefined {\n const element =\n scrollContainerRef?.current ??\n getScrollContainerFromSelector(scrollContainerSelector, wrapper)\n if (element instanceof Window) return\n return element\n}\n\nfunction getScrollContainerFromSelector(\n scrollContainerSelector: string | undefined,\n wrapper: HTMLElement\n): HTMLElement | undefined {\n return scrollContainerSelector\n ? (wrapper.parentElement?.closest<HTMLElement>(scrollContainerSelector) ??\n undefined)\n : undefined\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;AAwPA,MAAM,mBAAmB,GAAG,uBAAuB;AAanD;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,SAAS,GAAG,CAAC,EACxB,SAAS,EACT,OAAO,EACP,WAAW,GAAG,CAAC,EACf,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,QAAQ,EACR,UAAU,EACV,WAAW,GAAG,KAAK,EACnB,eAAe,GAAG,KAAK,EACvB,EAAE,EACF,YAAY,GAAG,MAAM,EACrB,cAAc,GAAG,OAAO,EACxB,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,uBAAuB,GAAG,eAAe,EACzC,UAAU,EACV,UAAU,EACV,YAAY,EAAE,sBAAsB,EACp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AAA,OAAO,MAAK;YACV,cAAc,CAAC,UAAU,EAAE;AAC3B,YAAA,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,+BAA+B,CAAC;AAC7D,YAAA,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,6BAA6B,CAAC;AAC7D,QAAA,CAAC;IACH,CAAC,EAAE,CAAC,YAAY,EAAE,kBAAkB,EAAE,uBAAuB,CAAC,CAAC;AAE/D,IAAA,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE;AAC3C;AAEA,SAAS,kBAAkB,CACzB,kBAA4D,EAC5D,uBAA2C,EAC3C,OAAoB,EAAA;AAEpB,IAAA,MAAM,OAAO,GACX,kBAAkB,EAAE,OAAO;AAC3B,QAAA,8BAA8B,CAAC,uBAAuB,EAAE,OAAO,CAAC;IAClE,IAAI,OAAO,YAAY,MAAM;QAAE;AAC/B,IAAA,OAAO,OAAO;AAChB;AAEA,SAAS,8BAA8B,CACrC,uBAA2C,EAC3C,OAAoB,EAAA;AAEpB,IAAA,OAAO;WACF,OAAO,CAAC,aAAa,EAAE,OAAO,CAAc,uBAAuB,CAAC;AACnE,YAAA,SAAS;UACX,SAAS;AACf;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { DataTableColumn } from "./DataTableColumn";
|
|
3
|
+
export interface ViewSettingsToggleProps {
|
|
4
|
+
/** The columns opted into visibility toggling via `hideable`. */
|
|
5
|
+
columns: DataTableColumn[];
|
|
6
|
+
onColumnVisibilityChange: (visibleColumnNames: string[]) => void;
|
|
7
|
+
visibleColumnNames: string[];
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A trigger + popover for table view settings. Today it only holds column
|
|
11
|
+
* visibility (via `FilterableListBox`), but the panel is meant to grow to
|
|
12
|
+
* include other view-related settings (e.g. a Table/Card display toggle, a
|
|
13
|
+
* Compact View switch) as siblings inside the same dialog.
|
|
14
|
+
*/
|
|
15
|
+
export declare function ViewSettingsToggle({ columns, onColumnVisibilityChange, visibleColumnNames, }: ViewSettingsToggleProps): React.JSX.Element;
|
|
16
|
+
export declare namespace ViewSettingsToggle {
|
|
17
|
+
var displayName: string;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=ViewSettingsToggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewSettingsToggle.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/ViewSettingsToggle.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD,MAAM,WAAW,uBAAuB;IACtC,iEAAiE;IACjE,OAAO,EAAE,eAAe,EAAE,CAAA;IAC1B,wBAAwB,EAAE,CAAC,kBAAkB,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAChE,kBAAkB,EAAE,MAAM,EAAE,CAAA;CAC7B;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,OAAO,EACP,wBAAwB,EACxB,kBAAkB,GACnB,EAAE,uBAAuB,qBAuCzB;yBA3Ce,kBAAkB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import '../button/ActionsDropdownIconButton.js';
|
|
2
|
+
import '../button/Button.js';
|
|
3
|
+
import '../button/DropdownButton.js';
|
|
4
|
+
import '../button/DropdownIconButton.js';
|
|
5
|
+
import { IconButton } from '../button/IconButton.js';
|
|
6
|
+
import '../button/LoadingButton.js';
|
|
7
|
+
import '../button/PageHeaderActionsDropdownButton.js';
|
|
8
|
+
import { FilterableListBox, FilterableListBoxItem } from '../internal/filterable-list-box/FilterableListBox.js';
|
|
9
|
+
import Icon from '../../utilities/Icon.js';
|
|
10
|
+
import React__default from 'react';
|
|
11
|
+
import { DialogTrigger, Pressable, Popover, Dialog } from 'react-aria-components/Popover';
|
|
12
|
+
import { Tooltip } from '../internal/tooltip/Tooltip.js';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A trigger + popover for table view settings. Today it only holds column
|
|
16
|
+
* visibility (via `FilterableListBox`), but the panel is meant to grow to
|
|
17
|
+
* include other view-related settings (e.g. a Table/Card display toggle, a
|
|
18
|
+
* Compact View switch) as siblings inside the same dialog.
|
|
19
|
+
*/
|
|
20
|
+
function ViewSettingsToggle({ columns, onColumnVisibilityChange, visibleColumnNames, }) {
|
|
21
|
+
return (React__default.createElement("div", { className: "tds-data-table-view-settings-toggle" },
|
|
22
|
+
React__default.createElement(DialogTrigger, null,
|
|
23
|
+
React__default.createElement(Tooltip, { content: "View settings", placement: "bottom end" },
|
|
24
|
+
React__default.createElement(Pressable, null,
|
|
25
|
+
React__default.createElement(IconButton, { "aria-label": "View settings", className: "tds-data-table-popover-trigger", icon: React__default.createElement(Icon, { "aria-hidden": true, symbol: "general#faders" }) }))),
|
|
26
|
+
React__default.createElement(Popover, { className: "tds-data-table-popover", placement: "bottom end" },
|
|
27
|
+
React__default.createElement(Dialog, null, columns.length > 0 && (React__default.createElement(FilterableListBox, { hideLabel: true, items: columns, label: "Column visibility", onSelectionChange: (keys) => onColumnVisibilityChange(keys), placeholder: "Search columns", selectedKeys: visibleColumnNames, selectionMode: "multiple" }, (column) => (React__default.createElement(FilterableListBoxItem, { id: column.name }, column.headerLabel)))))))));
|
|
28
|
+
}
|
|
29
|
+
ViewSettingsToggle.displayName = "ViewSettingsToggle";
|
|
30
|
+
|
|
31
|
+
export { ViewSettingsToggle };
|
|
32
|
+
//# sourceMappingURL=ViewSettingsToggle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewSettingsToggle.js","sources":["../../../src/components/DataTable/ViewSettingsToggle.tsx"],"sourcesContent":["import { IconButton } from \"@components/button\"\nimport {\n FilterableListBox,\n FilterableListBoxItem,\n} from \"@components/internal/filterable-list-box\"\nimport Icon from \"@utilities/Icon\"\nimport React from \"react\"\nimport {\n Dialog,\n DialogTrigger,\n Popover,\n Pressable,\n} from \"react-aria-components/Popover\"\n\nimport { Tooltip } from \"../internal/tooltip/Tooltip\"\nimport type { DataTableColumn } from \"./DataTableColumn\"\n\nexport interface ViewSettingsToggleProps {\n /** The columns opted into visibility toggling via `hideable`. */\n columns: DataTableColumn[]\n onColumnVisibilityChange: (visibleColumnNames: string[]) => void\n visibleColumnNames: string[]\n}\n\n/**\n * A trigger + popover for table view settings. Today it only holds column\n * visibility (via `FilterableListBox`), but the panel is meant to grow to\n * include other view-related settings (e.g. a Table/Card display toggle, a\n * Compact View switch) as siblings inside the same dialog.\n */\nexport function ViewSettingsToggle({\n columns,\n onColumnVisibilityChange,\n visibleColumnNames,\n}: ViewSettingsToggleProps) {\n return (\n <div className=\"tds-data-table-view-settings-toggle\">\n <DialogTrigger>\n <Tooltip content=\"View settings\" placement=\"bottom end\">\n <Pressable>\n <IconButton\n aria-label=\"View settings\"\n className=\"tds-data-table-popover-trigger\"\n icon={<Icon aria-hidden symbol=\"general#faders\" />}\n />\n </Pressable>\n </Tooltip>\n <Popover className=\"tds-data-table-popover\" placement=\"bottom end\">\n <Dialog>\n {columns.length > 0 && (\n <FilterableListBox\n hideLabel\n items={columns}\n label=\"Column visibility\"\n onSelectionChange={(keys) =>\n onColumnVisibilityChange(keys as string[])\n }\n placeholder=\"Search columns\"\n selectedKeys={visibleColumnNames}\n selectionMode=\"multiple\"\n >\n {(column) => (\n <FilterableListBoxItem id={column.name}>\n {column.headerLabel}\n </FilterableListBoxItem>\n )}\n </FilterableListBox>\n )}\n </Dialog>\n </Popover>\n </DialogTrigger>\n </div>\n )\n}\n\nViewSettingsToggle.displayName = \"ViewSettingsToggle\"\n"],"names":["React"],"mappings":";;;;;;;;;;;;;AAwBA;;;;;AAKG;AACG,SAAU,kBAAkB,CAAC,EACjC,OAAO,EACP,wBAAwB,EACxB,kBAAkB,GACM,EAAA;AACxB,IAAA,QACEA,cAAA,CAAA,aAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAC,qCAAqC,EAAA;AAClD,QAAAA,cAAA,CAAA,aAAA,CAAC,aAAa,EAAA,IAAA;YACZA,cAAA,CAAA,aAAA,CAAC,OAAO,IAAC,OAAO,EAAC,eAAe,EAAC,SAAS,EAAC,YAAY,EAAA;AACrD,gBAAAA,cAAA,CAAA,aAAA,CAAC,SAAS,EAAA,IAAA;AACR,oBAAAA,cAAA,CAAA,aAAA,CAAC,UAAU,EAAA,EAAA,YAAA,EACE,eAAe,EAC1B,SAAS,EAAC,gCAAgC,EAC1C,IAAI,EAAEA,cAAA,CAAA,aAAA,CAAC,IAAI,yBAAa,MAAM,EAAC,gBAAgB,EAAA,CAAG,EAAA,CAClD,CACQ,CACJ;YACVA,cAAA,CAAA,aAAA,CAAC,OAAO,IAAC,SAAS,EAAC,wBAAwB,EAAC,SAAS,EAAC,YAAY,EAAA;AAChE,gBAAAA,cAAA,CAAA,aAAA,CAAC,MAAM,EAAA,IAAA,EACJ,OAAO,CAAC,MAAM,GAAG,CAAC,KACjBA,6BAAC,iBAAiB,EAAA,EAChB,SAAS,EAAA,IAAA,EACT,KAAK,EAAE,OAAO,EACd,KAAK,EAAC,mBAAmB,EACzB,iBAAiB,EAAE,CAAC,IAAI,KACtB,wBAAwB,CAAC,IAAgB,CAAC,EAE5C,WAAW,EAAC,gBAAgB,EAC5B,YAAY,EAAE,kBAAkB,EAChC,aAAa,EAAC,UAAU,EAAA,EAEvB,CAAC,MAAM,MACNA,6BAAC,qBAAqB,EAAA,EAAC,EAAE,EAAE,MAAM,CAAC,IAAI,EAAA,EACnC,MAAM,CAAC,WAAW,CACG,CACzB,CACiB,CACrB,CACM,CACD,CACI,CACZ;AAEV;AAEA,kBAAkB,CAAC,WAAW,GAAG,oBAAoB;;;;"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
import type { CombineAriaPropsWithCustomProps } from "../../../utilities/reactAriaProps";
|
|
3
|
+
import React, { type HTMLAttributes, type ReactElement, type ReactNode } from "react";
|
|
4
|
+
import { type Key, type ListBoxItemProps } from "react-aria-components/ListBox";
|
|
5
|
+
export interface FilterableListBoxProps<T extends object = object> {
|
|
6
|
+
/**
|
|
7
|
+
* `FilterableListBoxItem` elements (static), or a render function paired
|
|
8
|
+
* with `items` (dynamic collection) — matches `ComboBox`'s own
|
|
9
|
+
* dynamic-collection convention.
|
|
10
|
+
*/
|
|
11
|
+
children: ReactNode | ((item: T) => ReactElement);
|
|
12
|
+
/** Initial uncontrolled search query. */
|
|
13
|
+
defaultInputValue?: string;
|
|
14
|
+
/** Initial selection for the uncontrolled convenience mode. */
|
|
15
|
+
defaultSelectedKeys?: Key[];
|
|
16
|
+
/** Disables the search input, the clear button, and item selection. */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Items that cannot be selected, deselected, or focused. */
|
|
19
|
+
disabledKeys?: Key[];
|
|
20
|
+
/** If `true`, visually hides `label` (it remains in the DOM). */
|
|
21
|
+
hideLabel?: boolean;
|
|
22
|
+
/** Dynamic collection data. Pair with a function `children`. */
|
|
23
|
+
items?: Iterable<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Label for the search input. Also supplies the accessible name for the
|
|
26
|
+
* list.
|
|
27
|
+
*/
|
|
28
|
+
label: string;
|
|
29
|
+
/**
|
|
30
|
+
* Fired immediately on every selection change. Always a plain,
|
|
31
|
+
* collection-ordered array — never a `Set`, never React Aria's `"all"`
|
|
32
|
+
* sentinel.
|
|
33
|
+
*/
|
|
34
|
+
onSelectionChange?: (keys: Key[]) => void;
|
|
35
|
+
/** Placeholder text for the search input. */
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
/** Content to display when there are no items in the list. Defaults to "No results". */
|
|
38
|
+
renderEmptyState?: ReactNode | (() => ReactNode);
|
|
39
|
+
/** Controlled selection. Presence of this prop makes the component controlled. */
|
|
40
|
+
selectedKeys?: Key[];
|
|
41
|
+
/** Default `"multiple"`. The checkbox visual only renders in `"multiple"` mode. */
|
|
42
|
+
selectionMode?: "multiple" | "single";
|
|
43
|
+
}
|
|
44
|
+
export type FilterableListBoxElementProps<T extends object = object> = Omit<HTMLAttributes<HTMLDivElement>, keyof FilterableListBoxProps<T> | "aria-labelledby"> & FilterableListBoxProps<T>;
|
|
45
|
+
/**
|
|
46
|
+
* A search input paired with a persistently visible, selectable list of
|
|
47
|
+
* caller-supplied options — single- or multi-select (`selectionMode`).
|
|
48
|
+
* Unlike `ComboBox`, the input is a pure filter: it never holds the value,
|
|
49
|
+
* and the list never collapses.
|
|
50
|
+
*
|
|
51
|
+
* Collections can be either static (`FilterableListBoxItem` children) or
|
|
52
|
+
* dynamic (`items` paired with a function child).
|
|
53
|
+
*
|
|
54
|
+
* @component
|
|
55
|
+
*/
|
|
56
|
+
export declare function FilterableListBox<T extends object = object>({ children, className, defaultInputValue, defaultSelectedKeys, disabled, disabledKeys, hideLabel, id, items, label, onSelectionChange, placeholder, renderEmptyState, selectedKeys, selectionMode, ...restProps }: FilterableListBoxElementProps<T>): React.JSX.Element;
|
|
57
|
+
export declare namespace FilterableListBox {
|
|
58
|
+
var displayName: string;
|
|
59
|
+
}
|
|
60
|
+
interface FilterableListBoxItemPropsWithTextChildren {
|
|
61
|
+
/** Plain-text item content. Also supplies `textValue` automatically. */
|
|
62
|
+
children: string;
|
|
63
|
+
/** Disables the item. */
|
|
64
|
+
disabled?: boolean;
|
|
65
|
+
textValue?: never;
|
|
66
|
+
}
|
|
67
|
+
type FilterableListBoxItemNodeChildren = Exclude<ReactNode, Iterable<ReactNode> | string>;
|
|
68
|
+
interface FilterableListBoxItemPropsWithNodeChildren {
|
|
69
|
+
/** Item content. */
|
|
70
|
+
children: FilterableListBoxItemNodeChildren;
|
|
71
|
+
/** Disables the item. */
|
|
72
|
+
disabled?: boolean;
|
|
73
|
+
/** Required — `children` isn't plain text. */
|
|
74
|
+
textValue: string;
|
|
75
|
+
}
|
|
76
|
+
export type FilterableListBoxItemProps = FilterableListBoxItemPropsWithNodeChildren | FilterableListBoxItemPropsWithTextChildren;
|
|
77
|
+
type AriaListBoxItemPropsToInclude = "onAction" | "value";
|
|
78
|
+
export type FilterableListBoxItemElementProps<T extends object = object> = CombineAriaPropsWithCustomProps<ListBoxItemProps<T>, FilterableListBoxItemProps, never, AriaListBoxItemPropsToInclude>;
|
|
79
|
+
/**
|
|
80
|
+
* A selectable option within a {@link FilterableListBox}. Renders as a
|
|
81
|
+
* listbox item with a decorative checkbox visual (shown only in
|
|
82
|
+
* `selectionMode="multiple"`).
|
|
83
|
+
*
|
|
84
|
+
* Provide an `id` (or `key` when rendering from a collection) to identify
|
|
85
|
+
* the option, and `textValue` when the visible children are not plain text
|
|
86
|
+
* so filtering and screen readers have a stable label to use.
|
|
87
|
+
*
|
|
88
|
+
* @component
|
|
89
|
+
*/
|
|
90
|
+
export declare function FilterableListBoxItem<T extends object>({ children, className, disabled, textValue, ...restProps }: FilterableListBoxItemElementProps<T>): React.JSX.Element;
|
|
91
|
+
export declare namespace FilterableListBoxItem {
|
|
92
|
+
var displayName: string;
|
|
93
|
+
}
|
|
94
|
+
export {};
|
|
95
|
+
//# sourceMappingURL=FilterableListBox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterableListBox.d.ts","sourceRoot":"","sources":["../../../../src/components/internal/filterable-list-box/FilterableListBox.tsx"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAIpB,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAA;AAGhF,OAAO,KAAK,EAAE,EAEZ,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EAEf,MAAM,OAAO,CAAA;AAUd,OAAO,EACL,KAAK,GAAG,EAGR,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAA;AA2BtC,MAAM,WAAW,sBAAsB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM;IAC/D;;;;OAIG;IACH,QAAQ,EAAE,SAAS,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC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,aAA0B,EAC1B,GAAG,SAAS,EACb,EAAE,6BAA6B,CAAC,CAAC,CAAC,qBAmElC;yBApFe,iBAAiB;;;AAwFjC,UAAU,0CAA0C;IAClD,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAA;IAChB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,KAAK,CAAA;CAClB;AAID,KAAK,iCAAiC,GAAG,OAAO,CAC9C,SAAS,EACT,QAAQ,CAAC,SAAS,CAAC,GAAG,MAAM,CAC7B,CAAA;AAED,UAAU,0CAA0C;IAClD,oBAAoB;IACpB,QAAQ,EAAE,iCAAiC,CAAA;IAC3C,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,MAAM,MAAM,0BAA0B,GAClC,0CAA0C,GAC1C,0CAA0C,CAAA;AAE9C,KAAK,6BAA6B,GAAG,UAAU,GAAG,OAAO,CAAA;AAEzD,MAAM,MAAM,iCAAiC,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,IACrE,+BAA+B,CAC7B,gBAAgB,CAAC,CAAC,CAAC,EACnB,0BAA0B,EAC1B,KAAK,EACL,6BAA6B,CAC9B,CAAA;AAEH;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,EAAE,EACtD,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,SAAS,EACT,GAAG,SAAS,EACb,EAAE,iCAAiC,CAAC,CAAC,CAAC,qBAgBtC;yBAtBe,qBAAqB"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import '../../button/ActionsDropdownIconButton.js';
|
|
2
|
+
import '../../button/Button.js';
|
|
3
|
+
import '../../button/DropdownButton.js';
|
|
4
|
+
import '../../button/DropdownIconButton.js';
|
|
5
|
+
import { IconButton } from '../../button/IconButton.js';
|
|
6
|
+
import '../../button/LoadingButton.js';
|
|
7
|
+
import '../../button/PageHeaderActionsDropdownButton.js';
|
|
8
|
+
import Icon from '../../../utilities/Icon.js';
|
|
9
|
+
import { useId } from '../../../utilities/useId.js';
|
|
10
|
+
import classNames from 'classnames';
|
|
11
|
+
import React__default, { createContext, useContext } from 'react';
|
|
12
|
+
import { useFilter } from 'react-aria/useFilter';
|
|
13
|
+
import { Autocomplete } from 'react-aria-components/Autocomplete';
|
|
14
|
+
import { ButtonContext } from 'react-aria-components/Button';
|
|
15
|
+
import { Input } from 'react-aria-components/Input';
|
|
16
|
+
import { Label } from 'react-aria-components/Label';
|
|
17
|
+
import { ListBox, ListBoxItem } from 'react-aria-components/ListBox';
|
|
18
|
+
import { SearchField } from 'react-aria-components/SearchField';
|
|
19
|
+
|
|
20
|
+
const FilterableListBoxDisabledContext = createContext(false);
|
|
21
|
+
function resolveEmptyState(value) {
|
|
22
|
+
return typeof value === "function" ? value() : value;
|
|
23
|
+
}
|
|
24
|
+
// `SearchField` delivers its clear-button props via RAC's `ButtonContext`,
|
|
25
|
+
// which only RAC's own `<Button>` reads automatically — this bridges it onto
|
|
26
|
+
// `IconButton`. Must render inside `<SearchField>` for the context to apply.
|
|
27
|
+
function ClearButton() {
|
|
28
|
+
const { onPress } = (useContext(ButtonContext) ?? {});
|
|
29
|
+
return (React__default.createElement(IconButton, { "aria-label": "Clear search", className: "tds-filterable-list-box-search-clear-button", icon: React__default.createElement(Icon, { "aria-hidden": true, symbol: "general#x" }), kind: "neutral-inline", onClick: () => onPress?.({}), tabIndex: -1 }));
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A search input paired with a persistently visible, selectable list of
|
|
33
|
+
* caller-supplied options — single- or multi-select (`selectionMode`).
|
|
34
|
+
* Unlike `ComboBox`, the input is a pure filter: it never holds the value,
|
|
35
|
+
* and the list never collapses.
|
|
36
|
+
*
|
|
37
|
+
* Collections can be either static (`FilterableListBoxItem` children) or
|
|
38
|
+
* dynamic (`items` paired with a function child).
|
|
39
|
+
*
|
|
40
|
+
* @component
|
|
41
|
+
*/
|
|
42
|
+
function FilterableListBox({ children, className, defaultInputValue, defaultSelectedKeys, disabled, disabledKeys, hideLabel, id, items, label, onSelectionChange, placeholder = "Search", renderEmptyState = "No results", selectedKeys, selectionMode = "multiple", ...restProps }) {
|
|
43
|
+
const stableId = useId();
|
|
44
|
+
const panelId = id || `tds-filterable-list-box-${stableId}`;
|
|
45
|
+
const labelId = `${panelId}-label`;
|
|
46
|
+
const { contains } = useFilter({ sensitivity: "base" });
|
|
47
|
+
const handleSelectionChange = (keys) => {
|
|
48
|
+
if (keys === "all")
|
|
49
|
+
return;
|
|
50
|
+
onSelectionChange?.([...keys]);
|
|
51
|
+
};
|
|
52
|
+
return (React__default.createElement("div", { ...restProps, "aria-labelledby": labelId, className: classNames("tds-filterable-list-box", className), id: panelId, role: "group" },
|
|
53
|
+
React__default.createElement(Autocomplete, { defaultInputValue: defaultInputValue, filter: contains },
|
|
54
|
+
React__default.createElement(SearchField, { className: "tds-filterable-list-box-search-field", isDisabled: disabled },
|
|
55
|
+
React__default.createElement("div", { className: "tds-filterable-list-box-header" },
|
|
56
|
+
React__default.createElement(Label, { className: classNames("tds-filterable-list-box-label", {
|
|
57
|
+
"tds-filterable-list-box-label--hidden": hideLabel,
|
|
58
|
+
}), id: labelId }, label)),
|
|
59
|
+
React__default.createElement("div", { className: "tds-filterable-list-box-search-control" },
|
|
60
|
+
React__default.createElement(Input, { className: "tds-filterable-list-box-search-input", placeholder: placeholder }),
|
|
61
|
+
React__default.createElement(ClearButton, null))),
|
|
62
|
+
React__default.createElement(FilterableListBoxDisabledContext.Provider, { value: !!disabled },
|
|
63
|
+
React__default.createElement(ListBox, { "aria-labelledby": labelId, className: "tds-filterable-list-box-list", defaultSelectedKeys: defaultSelectedKeys, disabledKeys: disabledKeys, escapeKeyBehavior: "none", items: items, onSelectionChange: handleSelectionChange, renderEmptyState: () => (React__default.createElement("div", { className: "tds-filterable-list-box-empty-state" }, resolveEmptyState(renderEmptyState))), selectedKeys: selectedKeys, selectionMode: selectionMode }, children)))));
|
|
64
|
+
}
|
|
65
|
+
FilterableListBox.displayName = "FilterableListBox";
|
|
66
|
+
/**
|
|
67
|
+
* A selectable option within a {@link FilterableListBox}. Renders as a
|
|
68
|
+
* listbox item with a decorative checkbox visual (shown only in
|
|
69
|
+
* `selectionMode="multiple"`).
|
|
70
|
+
*
|
|
71
|
+
* Provide an `id` (or `key` when rendering from a collection) to identify
|
|
72
|
+
* the option, and `textValue` when the visible children are not plain text
|
|
73
|
+
* so filtering and screen readers have a stable label to use.
|
|
74
|
+
*
|
|
75
|
+
* @component
|
|
76
|
+
*/
|
|
77
|
+
function FilterableListBoxItem({ children, className, disabled, textValue, ...restProps }) {
|
|
78
|
+
const isGroupDisabled = useContext(FilterableListBoxDisabledContext);
|
|
79
|
+
return (React__default.createElement(ListBoxItem, { ...restProps, className: classNames("tds-filterable-list-box-item", className), isDisabled: disabled || isGroupDisabled, textValue: textValue ?? (typeof children === "string" ? children : undefined) },
|
|
80
|
+
React__default.createElement("span", { "aria-hidden": true, className: "tds-filterable-list-box-item-checkbox" }),
|
|
81
|
+
React__default.createElement("span", { className: "tds-filterable-list-box-item-label" }, children)));
|
|
82
|
+
}
|
|
83
|
+
FilterableListBoxItem.displayName = "FilterableListBoxItem";
|
|
84
|
+
|
|
85
|
+
export { FilterableListBox, FilterableListBoxItem };
|
|
86
|
+
//# sourceMappingURL=FilterableListBox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterableListBox.js","sources":["../../../../src/components/internal/filterable-list-box/FilterableListBox.tsx"],"sourcesContent":["import \"./index.css\"\n\nimport { IconButton } from \"@components/button\"\nimport Icon from \"@utilities/Icon\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, {\n createContext,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n useContext,\n} from \"react\"\nimport { useFilter } from \"react-aria/useFilter\"\nimport { Autocomplete } from \"react-aria-components/Autocomplete\"\nimport {\n ButtonContext,\n type ButtonProps as AriaButtonProps,\n type PressEvent,\n} from \"react-aria-components/Button\"\nimport { Input } from \"react-aria-components/Input\"\nimport { Label } from \"react-aria-components/Label\"\nimport {\n type Key,\n ListBox,\n ListBoxItem,\n type ListBoxItemProps,\n} from \"react-aria-components/ListBox\"\nimport { SearchField } from \"react-aria-components/SearchField\"\n\nconst FilterableListBoxDisabledContext = createContext(false)\n\nfunction resolveEmptyState(value: ReactNode | (() => ReactNode)): ReactNode {\n return typeof value === \"function\" ? value() : value\n}\n\n// `SearchField` delivers its clear-button props via RAC's `ButtonContext`,\n// which only RAC's own `<Button>` reads automatically — this bridges it onto\n// `IconButton`. Must render inside `<SearchField>` for the context to apply.\nfunction ClearButton() {\n const { onPress } = (useContext(ButtonContext) ?? {}) as AriaButtonProps\n\n return (\n <IconButton\n aria-label=\"Clear search\"\n className=\"tds-filterable-list-box-search-clear-button\"\n icon={<Icon aria-hidden symbol=\"general#x\" />}\n kind=\"neutral-inline\"\n onClick={() => onPress?.({} as PressEvent)}\n tabIndex={-1}\n />\n )\n}\n\nexport interface FilterableListBoxProps<T extends object = object> {\n /**\n * `FilterableListBoxItem` elements (static), or a render function paired\n * with `items` (dynamic collection) — matches `ComboBox`'s own\n * dynamic-collection convention.\n */\n children: ReactNode | ((item: T) => ReactElement)\n /** Initial uncontrolled search query. */\n defaultInputValue?: string\n /** Initial selection for the uncontrolled convenience mode. */\n defaultSelectedKeys?: Key[]\n /** Disables the search input, the clear button, and item selection. */\n disabled?: boolean\n /** Items that cannot be selected, deselected, or focused. */\n disabledKeys?: Key[]\n /** If `true`, visually hides `label` (it remains in the DOM). */\n hideLabel?: boolean\n /** Dynamic collection data. Pair with a function `children`. */\n items?: Iterable<T>\n /**\n * Label for the search input. Also supplies the accessible name for the\n * list.\n */\n label: string\n /**\n * Fired immediately on every selection change. Always a plain,\n * collection-ordered array — never a `Set`, never React Aria's `\"all\"`\n * sentinel.\n */\n onSelectionChange?: (keys: Key[]) => void\n /** Placeholder text for the search input. */\n placeholder?: string\n /** Content to display when there are no items in the list. Defaults to \"No results\". */\n renderEmptyState?: ReactNode | (() => ReactNode)\n /** Controlled selection. Presence of this prop makes the component controlled. */\n selectedKeys?: Key[]\n /** Default `\"multiple\"`. The checkbox visual only renders in `\"multiple\"` mode. */\n selectionMode?: \"multiple\" | \"single\"\n}\n\nexport type FilterableListBoxElementProps<T extends object = object> = Omit<\n HTMLAttributes<HTMLDivElement>,\n keyof FilterableListBoxProps<T> | \"aria-labelledby\"\n> &\n FilterableListBoxProps<T>\n\n/**\n * A search input paired with a persistently visible, selectable list of\n * caller-supplied options — single- or multi-select (`selectionMode`).\n * Unlike `ComboBox`, the input is a pure filter: it never holds the value,\n * and the list never collapses.\n *\n * Collections can be either static (`FilterableListBoxItem` children) or\n * dynamic (`items` paired with a function child).\n *\n * @component\n */\nexport function FilterableListBox<T extends object = object>({\n children,\n className,\n defaultInputValue,\n defaultSelectedKeys,\n disabled,\n disabledKeys,\n hideLabel,\n id,\n items,\n label,\n onSelectionChange,\n placeholder = \"Search\",\n renderEmptyState = \"No results\",\n selectedKeys,\n selectionMode = \"multiple\",\n ...restProps\n}: FilterableListBoxElementProps<T>) {\n const stableId = useId()\n const panelId = id || `tds-filterable-list-box-${stableId}`\n const labelId = `${panelId}-label`\n\n const { contains } = useFilter({ sensitivity: \"base\" })\n\n const handleSelectionChange = (keys: \"all\" | Set<Key>) => {\n if (keys === \"all\") return\n onSelectionChange?.([...keys])\n }\n\n return (\n <div\n {...restProps}\n aria-labelledby={labelId}\n className={classNames(\"tds-filterable-list-box\", className)}\n id={panelId}\n role=\"group\"\n >\n <Autocomplete defaultInputValue={defaultInputValue} filter={contains}>\n <SearchField\n className=\"tds-filterable-list-box-search-field\"\n isDisabled={disabled}\n >\n <div className=\"tds-filterable-list-box-header\">\n <Label\n className={classNames(\"tds-filterable-list-box-label\", {\n \"tds-filterable-list-box-label--hidden\": hideLabel,\n })}\n id={labelId}\n >\n {label}\n </Label>\n </div>\n <div className=\"tds-filterable-list-box-search-control\">\n <Input\n className=\"tds-filterable-list-box-search-input\"\n placeholder={placeholder}\n />\n <ClearButton />\n </div>\n </SearchField>\n\n <FilterableListBoxDisabledContext.Provider value={!!disabled}>\n <ListBox\n aria-labelledby={labelId}\n className=\"tds-filterable-list-box-list\"\n defaultSelectedKeys={defaultSelectedKeys}\n disabledKeys={disabledKeys}\n escapeKeyBehavior=\"none\"\n items={items}\n onSelectionChange={handleSelectionChange}\n renderEmptyState={() => (\n <div className=\"tds-filterable-list-box-empty-state\">\n {resolveEmptyState(renderEmptyState)}\n </div>\n )}\n selectedKeys={selectedKeys}\n selectionMode={selectionMode}\n >\n {children}\n </ListBox>\n </FilterableListBoxDisabledContext.Provider>\n </Autocomplete>\n </div>\n )\n}\n\nFilterableListBox.displayName = \"FilterableListBox\"\n\ninterface FilterableListBoxItemPropsWithTextChildren {\n /** Plain-text item content. Also supplies `textValue` automatically. */\n children: string\n /** Disables the item. */\n disabled?: boolean\n textValue?: never\n}\n\n// A plain string is structurally `Iterable<string>`, so `Iterable<ReactNode>`\n// must be excluded too, not just `string`.\ntype FilterableListBoxItemNodeChildren = Exclude<\n ReactNode,\n Iterable<ReactNode> | string\n>\n\ninterface FilterableListBoxItemPropsWithNodeChildren {\n /** Item content. */\n children: FilterableListBoxItemNodeChildren\n /** Disables the item. */\n disabled?: boolean\n /** Required — `children` isn't plain text. */\n textValue: string\n}\n\nexport type FilterableListBoxItemProps =\n | FilterableListBoxItemPropsWithNodeChildren\n | FilterableListBoxItemPropsWithTextChildren\n\ntype AriaListBoxItemPropsToInclude = \"onAction\" | \"value\"\n\nexport type FilterableListBoxItemElementProps<T extends object = object> =\n CombineAriaPropsWithCustomProps<\n ListBoxItemProps<T>,\n FilterableListBoxItemProps,\n never,\n AriaListBoxItemPropsToInclude\n >\n\n/**\n * A selectable option within a {@link FilterableListBox}. Renders as a\n * listbox item with a decorative checkbox visual (shown only in\n * `selectionMode=\"multiple\"`).\n *\n * Provide an `id` (or `key` when rendering from a collection) to identify\n * the option, and `textValue` when the visible children are not plain text\n * so filtering and screen readers have a stable label to use.\n *\n * @component\n */\nexport function FilterableListBoxItem<T extends object>({\n children,\n className,\n disabled,\n textValue,\n ...restProps\n}: FilterableListBoxItemElementProps<T>) {\n const isGroupDisabled = useContext(FilterableListBoxDisabledContext)\n\n return (\n <ListBoxItem\n {...restProps}\n className={classNames(\"tds-filterable-list-box-item\", className)}\n isDisabled={disabled || isGroupDisabled}\n textValue={\n textValue ?? (typeof children === \"string\" ? children : undefined)\n }\n >\n <span aria-hidden className=\"tds-filterable-list-box-item-checkbox\" />\n <span className=\"tds-filterable-list-box-item-label\">{children}</span>\n </ListBoxItem>\n )\n}\n\nFilterableListBoxItem.displayName = \"FilterableListBoxItem\"\n"],"names":["React"],"mappings":";;;;;;;;;;;;;;;;;;;AA+BA,MAAM,gCAAgC,GAAG,aAAa,CAAC,KAAK,CAAC;AAE7D,SAAS,iBAAiB,CAAC,KAAoC,EAAA;AAC7D,IAAA,OAAO,OAAO,KAAK,KAAK,UAAU,GAAG,KAAK,EAAE,GAAG,KAAK;AACtD;AAEA;AACA;AACA;AACA,SAAS,WAAW,GAAA;AAClB,IAAA,MAAM,EAAE,OAAO,EAAE,IAAI,UAAU,CAAC,aAAa,CAAC,IAAI,EAAE,CAAoB;AAExE,IAAA,QACEA,cAAA,CAAA,aAAA,CAAC,UAAU,kBACE,cAAc,EACzB,SAAS,EAAC,6CAA6C,EACvD,IAAI,EAAEA,cAAA,CAAA,aAAA,CAAC,IAAI,yBAAa,MAAM,EAAC,WAAW,EAAA,CAAG,EAC7C,IAAI,EAAC,gBAAgB,EACrB,OAAO,EAAE,MAAM,OAAO,GAAG,EAAgB,CAAC,EAC1C,QAAQ,EAAE,EAAE,EAAA,CACZ;AAEN;AAgDA;;;;;;;;;;AAUG;SACa,iBAA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CAAC,8BAA8B,EAAE,SAAS,CAAC,EAChE,UAAU,EAAE,QAAQ,IAAI,eAAe,EACvC,SAAS,EACP,SAAS,KAAK,OAAO,QAAQ,KAAK,QAAQ,GAAG,QAAQ,GAAG,SAAS,CAAC,EAAA;QAGpEA,cAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAA,aAAA,EAAA,IAAA,EAAkB,SAAS,EAAC,uCAAuC,EAAA,CAAG;QACtEA,cAAA,CAAA,aAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAC,oCAAoC,EAAA,EAAE,QAAQ,CAAQ,CAC1D;AAElB;AAEA,qBAAqB,CAAC,WAAW,GAAG,uBAAuB;;;;"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "./index.css";
|
|
2
|
+
export type { FilterableListBoxElementProps, FilterableListBoxItemElementProps, FilterableListBoxItemProps, FilterableListBoxProps, } from "./FilterableListBox";
|
|
3
|
+
export { FilterableListBox, FilterableListBoxItem } from "./FilterableListBox";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/internal/filterable-list-box/index.ts"],"names":[],"mappings":"AAAA,OAAO,aAAa,CAAA;AAEpB,YAAY,EACV,6BAA6B,EAC7B,iCAAiC,EACjC,0BAA0B,EAC1B,sBAAsB,GACvB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './tds-scroll-to-selected-in-unordered-list.js';
|
|
2
|
-
import '../../packages/tapestry-wc/dist/components/p-
|
|
2
|
+
import '../../packages/tapestry-wc/dist/components/p-DpGMDplX.js';
|
|
3
3
|
import { defineCustomElement } from '../../packages/tapestry-wc/dist/components/tds-page-header.js';
|
|
4
4
|
import { defineCustomElement as defineCustomElement$1 } from '../../packages/tapestry-wc/dist/components/tds-page-header-nav.js';
|
|
5
5
|
import 'classnames';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '../../packages/tapestry-wc/dist/components/p-
|
|
1
|
+
import '../../packages/tapestry-wc/dist/components/p-DpGMDplX.js';
|
|
2
2
|
import { defineCustomElement } from '../../packages/tapestry-wc/dist/components/tds-sidenav.js';
|
|
3
3
|
import { defineCustomElement as defineCustomElement$1 } from '../../packages/tapestry-wc/dist/components/tds-sidenav-item.js';
|
|
4
4
|
import { defineCustomElement as defineCustomElement$3 } from '../../packages/tapestry-wc/dist/components/tds-sidenav-responsive-header.js';
|