@planningcenter/tapestry 4.15.0-rc.1 → 4.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (121) hide show
  1. package/dist/components/DataTable/ActiveFilterInstance.d.ts +6 -0
  2. package/dist/components/DataTable/ActiveFilterInstance.d.ts.map +1 -1
  3. package/dist/components/DataTable/ActiveFilterInstance.js +13 -0
  4. package/dist/components/DataTable/ActiveFilterInstance.js.map +1 -1
  5. package/dist/components/DataTable/CollectionEditorsLazy.d.ts +1 -1
  6. package/dist/components/DataTable/CollectionEditorsLazy.d.ts.map +1 -1
  7. package/dist/components/DataTable/CollectionEditorsLazy.js +2 -2
  8. package/dist/components/DataTable/CollectionEditorsLazy.js.map +1 -1
  9. package/dist/components/DataTable/CollectionEditorsShared.d.ts +4 -8
  10. package/dist/components/DataTable/CollectionEditorsShared.d.ts.map +1 -1
  11. package/dist/components/DataTable/CollectionEditorsShared.js +2 -2
  12. package/dist/components/DataTable/CollectionEditorsShared.js.map +1 -1
  13. package/dist/components/DataTable/CollectionEditorsStatic.d.ts +4 -5
  14. package/dist/components/DataTable/CollectionEditorsStatic.d.ts.map +1 -1
  15. package/dist/components/DataTable/CollectionEditorsStatic.js +9 -9
  16. package/dist/components/DataTable/CollectionEditorsStatic.js.map +1 -1
  17. package/dist/components/DataTable/DataTable.d.ts +27 -5
  18. package/dist/components/DataTable/DataTable.d.ts.map +1 -1
  19. package/dist/components/DataTable/DataTable.js +13 -2
  20. package/dist/components/DataTable/DataTable.js.map +1 -1
  21. package/dist/components/DataTable/DataTableRow.d.ts +2 -0
  22. package/dist/components/DataTable/DataTableRow.d.ts.map +1 -1
  23. package/dist/components/DataTable/DataTableRow.js.map +1 -1
  24. package/dist/components/DataTable/RowActions.d.ts +7 -3
  25. package/dist/components/DataTable/RowActions.d.ts.map +1 -1
  26. package/dist/components/DataTable/RowActions.js +7 -2
  27. package/dist/components/DataTable/RowActions.js.map +1 -1
  28. package/dist/components/DataTable/collectionFilter.js +1 -1
  29. package/dist/components/DataTable/collectionFilter.js.map +1 -1
  30. package/dist/components/DataTable/dateFilter.js +5 -5
  31. package/dist/components/DataTable/dateFilter.js.map +1 -1
  32. package/dist/components/DataTable/dayFilter.js +4 -3
  33. package/dist/components/DataTable/dayFilter.js.map +1 -1
  34. package/dist/components/DataTable/index.d.ts +1 -1
  35. package/dist/components/DataTable/index.d.ts.map +1 -1
  36. package/dist/components/DataTable/numberFilter.js +3 -2
  37. package/dist/components/DataTable/numberFilter.js.map +1 -1
  38. package/dist/components/DataTable/scopedFilter.js +5 -1
  39. package/dist/components/DataTable/scopedFilter.js.map +1 -1
  40. package/dist/components/DataTable/textFilter.js +1 -1
  41. package/dist/components/DataTable/textFilter.js.map +1 -1
  42. package/dist/components/button/ActionsDropdownIconButton.js +2 -2
  43. package/dist/components/button/ActionsDropdownIconButton.js.map +1 -1
  44. package/dist/components/button/BaseButton.js +4 -4
  45. package/dist/components/button/BaseButton.js.map +1 -1
  46. package/dist/components/button/Button.js +2 -2
  47. package/dist/components/button/Button.js.map +1 -1
  48. package/dist/components/button/DropdownButton.js +3 -3
  49. package/dist/components/button/DropdownButton.js.map +1 -1
  50. package/dist/components/button/DropdownIconButton.js +2 -2
  51. package/dist/components/button/DropdownIconButton.js.map +1 -1
  52. package/dist/components/button/IconButton.js +4 -4
  53. package/dist/components/button/IconButton.js.map +1 -1
  54. package/dist/components/button/LoadingButton.js +2 -2
  55. package/dist/components/button/LoadingButton.js.map +1 -1
  56. package/dist/components/button/PageHeaderActionsDropdownButton.js +3 -3
  57. package/dist/components/button/PageHeaderActionsDropdownButton.js.map +1 -1
  58. package/dist/components/combo-box/ComboBox.js +31 -31
  59. package/dist/components/combo-box/ComboBox.js.map +1 -1
  60. package/dist/components/date-picker/DatePicker.js +42 -42
  61. package/dist/components/date-picker/DatePicker.js.map +1 -1
  62. package/dist/components/dropdown/Dropdown.js +13 -13
  63. package/dist/components/dropdown/Dropdown.js.map +1 -1
  64. package/dist/components/field/Field.js +5 -5
  65. package/dist/components/field/Field.js.map +1 -1
  66. package/dist/components/internal/LoadingSpinner.js +2 -2
  67. package/dist/components/internal/LoadingSpinner.js.map +1 -1
  68. package/dist/components/internal/tooltip/Tooltip.js +8 -8
  69. package/dist/components/internal/tooltip/Tooltip.js.map +1 -1
  70. package/dist/components/link/BaseLink.js +3 -3
  71. package/dist/components/link/BaseLink.js.map +1 -1
  72. package/dist/components/link/IconLink.js +4 -4
  73. package/dist/components/link/IconLink.js.map +1 -1
  74. package/dist/components/link/Link.js +2 -2
  75. package/dist/components/link/Link.js.map +1 -1
  76. package/dist/components/number-stepper/NumberStepper.js +11 -11
  77. package/dist/components/number-stepper/NumberStepper.js.map +1 -1
  78. package/dist/components/page-header/PageHeader.js +10 -10
  79. package/dist/components/page-header/PageHeader.js.map +1 -1
  80. package/dist/components/search-input/SearchInput.js +6 -6
  81. package/dist/components/search-input/SearchInput.js.map +1 -1
  82. package/dist/components/select/Select.js +6 -6
  83. package/dist/components/select/Select.js.map +1 -1
  84. package/dist/components/select/SelectNative.js +6 -6
  85. package/dist/components/select/SelectNative.js.map +1 -1
  86. package/dist/components/select/SelectOptions.js +9 -9
  87. package/dist/components/select/SelectOptions.js.map +1 -1
  88. package/dist/components/select/SelectPopover.js +14 -14
  89. package/dist/components/select/SelectPopover.js.map +1 -1
  90. package/dist/components/sidenav/Sidenav.js +6 -6
  91. package/dist/components/sidenav/Sidenav.js.map +1 -1
  92. package/dist/components/sidenav/SidenavItem.js +2 -2
  93. package/dist/components/sidenav/SidenavItem.js.map +1 -1
  94. package/dist/components/sidenav/SidenavSection.js +7 -7
  95. package/dist/components/sidenav/SidenavSection.js.map +1 -1
  96. package/dist/components/sidenav/private/SidenavResponsiveHeader.js +6 -6
  97. package/dist/components/sidenav/private/SidenavResponsiveHeader.js.map +1 -1
  98. package/dist/components/sidenav/private/withSlotChildrenAsActions.js +7 -7
  99. package/dist/components/sidenav/private/withSlotChildrenAsActions.js.map +1 -1
  100. package/dist/components/time-field/TimeField.js +8 -8
  101. package/dist/components/time-field/TimeField.js.map +1 -1
  102. package/dist/packages/tapestry-render/dist/buildComponent-DzY2PDMT.js +4 -4
  103. package/dist/packages/tapestry-render/dist/buildComponent-DzY2PDMT.js.map +1 -1
  104. package/dist/reactRender.css +180 -141
  105. package/dist/reactRender.css.map +1 -1
  106. package/dist/reactRenderLegacy.css +180 -141
  107. package/dist/reactRenderLegacy.css.map +1 -1
  108. package/dist/tapestryMount.css +180 -141
  109. package/dist/tapestryMount.css.map +1 -1
  110. package/dist/tapestryMountLegacy.css +180 -141
  111. package/dist/tapestryMountLegacy.css.map +1 -1
  112. package/dist/unstable.css +45 -6
  113. package/dist/unstable.css.map +1 -1
  114. package/dist/utilities/Icon.js +2 -2
  115. package/dist/utilities/Icon.js.map +1 -1
  116. package/dist/utilities/buttonLinkShared.js +2 -2
  117. package/dist/utilities/buttonLinkShared.js.map +1 -1
  118. package/dist/utilities/locale.js +34 -5
  119. package/dist/utilities/locale.js.map +1 -1
  120. package/docs/components/DataTable.md +23 -5
  121. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"DataTable.js","sources":["../../../src/components/DataTable/DataTable.tsx"],"sourcesContent":["import \"./index.css\"\nimport \"./filters.css\"\n\nimport { LoadingAnnouncement, LoadingSpinner } from \"@components/internal\"\nimport { Pagination } from \"@components/internal/pagination\"\nimport Icon from \"@utilities/Icon\"\nimport { useTapestryLocale } from \"@utilities/locale\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, {\n type ReactNode,\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport {\n Cell,\n Checkbox,\n Column,\n Row,\n type SortDescriptor,\n Table,\n TableBody,\n TableHeader,\n type TableProps as AriaTableProps,\n} from \"react-aria-components/Table\"\n\nimport { ActiveFilters } from \"./ActiveFilters\"\nimport type { DataTableColumn } from \"./DataTableColumn\"\nimport { prepareColumn, type PreparedColumn } from \"./DataTableColumnTypes\"\nimport { getRowKey } from \"./DataTableRow\"\nimport { FiltersProvider } from \"./FilterContext\"\nimport { FilterControls } from \"./FilterControls\"\nimport { useFilterOpenRequest } from \"./FilterOpenRequest\"\nimport type { ActiveFilter, FilterNode } from \"./FilterTypes\"\nimport { usePendingFilters } from \"./PendingFilterContext\"\nimport {\n hasResultsCount,\n resolveResultNounLabel,\n type ResultNoun,\n ResultsCount,\n} from \"./ResultsCount\"\nimport { type RowAction, RowActions } from \"./RowActions\"\nimport { SelectAllBanner } from \"./SelectAllBanner\"\nimport { type TableAction, TableActions } from \"./TableActions\"\nimport { TableSearch } from \"./TableSearch\"\nimport { useActiveView } from \"./useActiveView\"\nimport { useColumnVisibility } from \"./useColumnVisibility\"\nimport {\n type DataTableSelection,\n DataTableSelectionContext,\n useDataTableSelection,\n} from \"./useDataTableSelection\"\nimport { useResultsAnnouncement } from \"./useResultsAnnouncement\"\nimport { useRowPressBoundary } from \"./useRowPressBoundary\"\nimport { useSavedViewsState } from \"./useSavedViewsState\"\nimport { useSaveStatus } from \"./useSaveStatus\"\nimport { useSearchFilter } from \"./useSearchFilter\"\nimport { useShelfExpanded } from \"./useShelfExpanded\"\nimport {\n initialView,\n isViewEditable,\n isViewModified,\n type SavedView,\n type StaticView,\n type View,\n withoutSearch,\n} from \"./views\"\nimport { ViewsBar } from \"./ViewsBar\"\nimport { ViewSettingsToggle } from \"./ViewSettingsToggle\"\n\nexport type { DataTableSelection, ResultNoun, RowAction, TableAction }\n\n/**\n * A PCO API order string: the column name for ascending (`\"lastName\"`), or\n * the name prefixed with a hyphen for descending (`\"-lastName\"`).\n */\nexport type Sort = string\n\nexport type DataTableLoadingState = \"error\" | \"idle\" | \"loading\"\n\ninterface DataTableBaseProps {\n activeFilters?: ActiveFilter[]\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 /**\n * The filter tree shown in the \"Add filter\" popover. Renders the filter\n * controls in the header when set; omit to leave filtering off entirely.\n * `q` is reserved for the search, so no filter can use it as its name.\n */\n filters?: FilterNode[]\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 * The id of the default view. Defaults to `\"initial\"`. The table doesn't\n * apply it; it's selected on mount when the initial `activeFilters` (apart\n * from the search), sort, and visible columns match it. Otherwise the first\n * matching view is selected, or none. Later changes are ignored.\n */\n initialDefaultViewId?: NonNullable<View[\"id\"]>\n /**\n * Named sets of filters, sort, and visible columns the user can apply, shown\n * in array order. Can't use the id `\"initial\"`, which is reserved for the\n * initial view. Later changes are ignored; remount with a new `key` to start\n * from fresh views. In a Rails app, load them with tapestry-rails'\n * `SavedView.on_table(...).data_table_props` and save changes with\n * `useSavedViewsClient`.\n */\n initialSavedViews?: SavedView[]\n /**\n * Async loading state for the table body.\n * - `\"loading\"`: While `data` is empty, replaces the empty state with a\n * centered spinner. While `data` has rows, keeps them on screen with a\n * spinner over them until new `data` arrives, so a search doesn't blank\n * the table. When requests can overlap, apply only the latest response.\n * Set it while any request is in flight, so screen reader users hear\n * the new count when it ends. Keep `\"idle\"` for a refresh the user did\n * not start, such as polling, or the count is announced again.\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 active filters change.\n * Provides an argument with the updated active filters array.\n */\n onActiveFiltersChange?: (activeFilters: ActiveFilter[]) => void\n /**\n * Called with the id of the view the user sets as the default, or\n * `\"initial\"` once the default view is deleted. Without it, the Set as\n * default action is hidden; on the default view it's disabled and reads\n * \"Default view\". The table shows the new default right away, and puts the\n * previous one back if the promise rejects, unless the user has set another\n * default since.\n */\n onDefaultViewIdChange?: (id: NonNullable<View[\"id\"]>) => Promise<void> | void\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 * Also called with `1`, right after `onActiveFiltersChange` or\n * `onSortChange`, when the user changes the filters, search, sort, or view\n * away from the first page. Load from state set by all three, not inside\n * each callback, or the same change loads twice. Update `currentPage` when\n * it's called, not once the page loads, or a change made while a page is\n * loading won't go back to page 1.\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 with the new view when the user saves the current filters, sort,\n * and columns as a view, or duplicates a view. Without it, views can't be\n * created or duplicated. Return the saved view with its new id, or a promise\n * of it; that view is selected once it's passed back in `savedViews`, unless\n * it was duplicated from the manage views modal. A callback that returns\n * nothing doesn't type check, so resolve to the view after refetching, e.g.\n * `(view) => api.create(view).then(async (saved) => { await refetch(); return saved })`.\n */\n onSavedViewCreate?: (\n savedView: Omit<SavedView, \"id\">\n ) => Promise<SavedView> | SavedView\n /**\n * Called with the view once the user confirms deleting it, from the context\n * menu or the manage views modal. Without it, views can't be deleted. The\n * table removes the view right away, and puts it back in its place if the\n * promise rejects. Deleting the default view resets the default to\n * `\"initial\"`, which is restored too.\n */\n onSavedViewDelete?: (savedView: SavedView) => Promise<void> | void\n /**\n * Called when the user moves a saved view, with the saved view it now comes\n * after, or `null` when it's first. Save the new position and return a\n * promise. The table moves the view right away, and moves it back if the\n * promise rejects. Without it, the manage views modal has no drag handles.\n */\n onSavedViewReorder?: (\n savedView: SavedView,\n after: SavedView | null\n ) => Promise<void> | void\n /**\n * Called with the updated view, matched by `id`. Return the saved view, or a\n * promise of it. The table shows the change right away, then swaps in the\n * returned view, or puts the old one back if the promise rejects, unless\n * the view has changed again since. Without it, view names are read only.\n */\n onSavedViewUpdate?: (savedView: SavedView) => Promise<SavedView> | SavedView\n /** Callback invoked when the sort state changes. */\n onSortChange?: (sort: Sort) => void\n /**\n * Called with the visible column names, in `columns` order, when the\n * visibility toggle changes or a view is applied. Always-visible columns\n * are included and unknown names are dropped, so the value can be passed\n * straight back as `visibleColumnNames`. Column visibility is controlled,\n * so the table only updates once `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 * The table can't go back to the first page itself, so reset the cursor\n * when the filters or sort change.\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. It also sizes an all-pages selection when\n * `canSelectAllPages` is true, including the count used by table actions and\n * the select-all banner. Without a result count, the banner isn't offered\n * because the table can't accurately describe the all-pages selection.\n * It also sets the count announced to screen reader users after a filter\n * change or a load. Without it, a paginated table announces only the current page,\n * e.g. `\"25 results on this page\"`.\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 * Displays a search input above the table. The query is kept in\n * `activeFilters` as a `q` filter and reported through\n * `onActiveFiltersChange` once typing pauses. It isn't saved with\n * views, and applying a view leaves it alone.\n */\n searchable?: boolean\n /**\n * Enables row selection via checkboxes, including a \"select all\" checkbox in\n * the header for the loaded page. Without a row action (`onRowClick` or\n * `getRowLink`), pressing anywhere in a row toggles the row selection.\n */\n selectable?: boolean\n /** The current sort state for the table. */\n sortBy?: Sort\n /**\n * Read-only views from the app, listed before the saved views. Ids must not\n * overlap with `initialSavedViews`. Unless one has the id `\"initial\"`, an\n * \"All\" view is added first. Omit both `staticViews` and `initialSavedViews`\n * to hide the views bar.\n */\n staticViews?: StaticView[]\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 * The number of disabled rows across the whole result set. Used to size an\n * all-pages selection when disabled rows exist on unloaded pages. Replaces\n * the count inferred from `disabledKeys` rather than adding to it. Values are\n * clamped to the result count, and zero is used as supplied.\n */\n totalDisabledCount?: number\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. The\n * table goes back to page 1 through `onPageChange` when the user changes the\n * filters, search, sort, or view; when the app changes them itself, it sets\n * `currentPage` too.\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. Once it's set, a hideable column it doesn't name is\n * hidden, so a column added later stays hidden in a stored value until the\n * user shows it. Unknown names are ignored and display order always follows\n * `columns`.\n */\n visibleColumnNames?: string[]\n}\n\ninterface DataTableExplicitSelectionProps {\n /** Keeps selection values as arrays of row keys. */\n canSelectAllPages?: false\n /**\n * Called with the selected row keys whenever selection changes. Called with\n * `[]` when the user changes a filter or the search, so actions never apply\n * to rows the new filters hide.\n */\n onSelectedChange?: (keys: (number | string)[]) => void\n /** The selected row keys. */\n selectedKeys?: (number | string)[]\n /** Table actions whose callbacks receive the selected row keys. */\n tableActions?: TableAction[]\n}\n\ninterface DataTableAllPagesSelectionProps {\n /**\n * Enables tagged selection values that can represent every page plus\n * exclusions. Explicit arrays and the header checkbox remain page-scoped.\n * When `resultCount` proves more selectable results exist, selecting the\n * loaded page reveals a banner that widens the selection to every page or\n * clears it again. This works with both paged and indexed pagination.\n */\n canSelectAllPages: true\n /**\n * Called with the current explicit or all-pages selection. Called with `[]`\n * when the user changes a filter or the search, so actions never apply to\n * rows the new filters hide.\n */\n onSelectedChange?: (selection: DataTableSelection) => void\n /**\n * The current explicit or all-pages selection. Use\n * `{ keys: \"all\", excludedKeys: [] }` for every selectable result; a bare\n * `\"all\"` value is not accepted.\n */\n selectedKeys?: DataTableSelection\n /** Table actions whose callbacks receive the current selection. */\n tableActions?: TableAction<DataTableSelection>[]\n}\n\nexport type DataTableProps = DataTableBaseProps &\n (DataTableAllPagesSelectionProps | DataTableExplicitSelectionProps)\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 activeFilters = [],\n filters = [],\n ...props\n}: DataTableElementProps) => (\n <FiltersProvider activeFilters={activeFilters} filters={filters}>\n <DataTableInner\n {...props}\n activeFilters={activeFilters}\n filters={filters}\n />\n </FiltersProvider>\n)\n\nconst DataTableInner = ({\n activeFilters = [],\n className,\n canSelectAllPages,\n columns,\n currentPage = 1,\n data,\n disabledKeys,\n emptyState,\n errorState,\n filters = [],\n getRowId,\n getRowLink,\n hasNextPage = false,\n hasPreviousPage = false,\n id,\n initialDefaultViewId = \"initial\",\n initialSavedViews,\n loadingState = \"idle\",\n paginationType = \"paged\",\n resultCount,\n resultNoun,\n scrollContainerRef,\n scrollContainerSelector = \".content-wrap\",\n rowActions,\n searchable,\n selectable,\n selectedKeys: controlledSelectedKeys,\n staticViews: staticViewsProp,\n stickyHeader,\n sortBy,\n tableActions,\n totalDisabledCount,\n totalPages,\n visibleColumnNames,\n onActiveFiltersChange = () => {},\n onDefaultViewIdChange: onDefaultViewIdChangeProp,\n onNextPageClick,\n onPageChange,\n onPreviousPageClick,\n onRowClick,\n onSavedViewCreate: onSavedViewCreateProp,\n onSavedViewDelete: onSavedViewDeleteProp,\n onSavedViewReorder,\n onSavedViewUpdate: onSavedViewUpdateProp,\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 // With rows on screen, loading keeps them in place under a spinner instead.\n const showLoadingOverlay = loadingState === \"loading\" && data.length > 0\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 locale = useTapestryLocale()\n const preparedColumns = useMemo<PreparedColumn[]>(\n () => columns.map((column) => prepareColumn(column, locale)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [columnKey, locale]\n )\n\n const {\n currentVisibleColumnNames,\n hideableColumns,\n isColumnVisible,\n onColumnVisibilityChange,\n resolveVisibleColumnNames,\n visibleHideableColumns,\n } = useColumnVisibility({\n columns,\n onVisibleColumnNamesChange,\n visibleColumnNames,\n })\n\n const staticViews = useMemo(\n () => staticViewsProp?.map(withoutSearch),\n [staticViewsProp]\n )\n const {\n defaultViewId,\n isReordering: isSavedViewReordering,\n onCreate: onSavedViewCreate,\n onDelete: onSavedViewDelete,\n onReorder: onSavedViewMove,\n onSetDefault: onDefaultViewIdChange,\n onUpdate: onSavedViewUpdate,\n savedViews,\n } = useSavedViewsState({\n initialDefaultViewId,\n initialSavedViews,\n onCreate: onSavedViewCreateProp,\n onDelete: onSavedViewDeleteProp,\n onReorder: onSavedViewReorder,\n onSetDefault: onDefaultViewIdChangeProp,\n onUpdate: onSavedViewUpdateProp,\n })\n const hasInitialView = staticViews?.some(({ id }) => id === initialView.id)\n const staticViewsWithInitial = hasInitialView\n ? (staticViews ?? [])\n : [initialView, ...(staticViews ?? [])]\n const views = [...staticViewsWithInitial, ...(savedViews ?? [])]\n\n const visiblePreparedColumns = useMemo(\n () => preparedColumns.filter(({ column }) => isColumnVisible(column)),\n [preparedColumns, isColumnVisible]\n )\n\n // The row header names each row for assistive tech. Avatars are decorative,\n // so it goes to the first visible column that isn't one, or to the first\n // column when every visible column is an avatar.\n const rowHeaderColumn =\n visiblePreparedColumns.find(({ column }) => column.type !== \"avatar\") ??\n visiblePreparedColumns[0]\n\n const selectionModel = useDataTableSelection({\n canSelectAllPages,\n data,\n disabledKeys,\n getRowId,\n hasRowPressAction,\n onSelectedChange,\n resultCount,\n selectable,\n selectedKeys: controlledSelectedKeys,\n totalDisabledCount,\n })\n const {\n commitSelection,\n headerCheckboxProps,\n rowPressSelects,\n selectedCount,\n selection,\n tableProps: selectionProps,\n totalCount,\n } = selectionModel\n\n // Selected rows a filter hides would still be acted on, so any filter or\n // search change the user makes clears the selection.\n const changeActiveFiltersClearingSelection = (\n activeFilters: ActiveFilter[]\n ) => {\n const hasSelection = !Array.isArray(selection) || selection.length > 0\n if (hasSelection) commitSelection([])\n onActiveFiltersChange(activeFilters)\n }\n\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 // A filter, search, or sort change from the table makes the current page\n // meaningless, so it goes back to the first page. Changes the app makes to\n // `activeFilters` or `sortBy` itself, including on mount, don't. The indexed\n // type has no page number, so the app resets its own cursor.\n const resetPage = () => {\n if (!isIndexedPagination && currentPage !== 1) onPageChange?.(1)\n }\n\n const announcedActiveFiltersChange = useResultsAnnouncement({\n isPageCount: showPagination && resultCount === undefined,\n loadingState,\n onActiveFiltersChange: (activeFilters) => {\n changeActiveFiltersClearingSelection(activeFilters)\n resetPage()\n },\n resultNoun,\n totalCount,\n })\n\n const {\n chipFilters,\n clearFilters,\n onChipFiltersChange,\n onSearchChange,\n searchQuery,\n } = useSearchFilter(activeFilters, announcedActiveFiltersChange)\n\n // Shared by the views bar and the filters shelf, so a save from the\n // shelf shows its status in the bar.\n const saveStatus = useSaveStatus()\n\n // The view being applied, until the table's state matches it, so its actions\n // don't flash in before the app passes the view's filters back.\n const [applyingView, setApplyingView] = useState<View>()\n\n // Search isn't part of a view, so applying one keeps the current search.\n const applyView = (view: View) => {\n setApplyingView(view)\n onChipFiltersChange(view.activeFilters)\n if (view.sort) onSortChange?.(view.sort)\n if (view.visibleColumnNames) {\n onColumnVisibilityChange(view.visibleColumnNames)\n }\n }\n\n // What a view saves from the table. Visible columns are saved even when no\n // column can be hidden, so a hideable column added later stays out of the\n // view. Sort is left out when there isn't one.\n const currentState = {\n activeFilters: chipFilters,\n ...(sortBy && { sort: sortBy }),\n visibleColumnNames: currentVisibleColumnNames,\n }\n\n // Compares a view against the table by the columns it shows today, so a\n // view that names a column that's gone, or leaves out an always-visible\n // one, still matches.\n const isModified = (view: View) =>\n isViewModified(\n view.visibleColumnNames\n ? {\n ...view,\n visibleColumnNames: resolveVisibleColumnNames(\n view.visibleColumnNames\n ),\n }\n : view,\n currentState\n )\n\n // Opens on the default view only when the table's state matches it, so a\n // table seeded from elsewhere, such as the URL, shows the view it's in.\n const { activeView, select, selectWhenSaved } = useActiveView(views, () => {\n const defaultView = views.find(({ id }) => id === defaultViewId)\n if (defaultView && !isModified(defaultView)) return defaultView\n return views.find((view) => !isModified(view))\n })\n\n if (applyingView && !isModified(applyingView)) setApplyingView(undefined)\n\n // A filter, sort, or column edit also ends applying, so the actions still\n // show when the table can't match a view, such as an app that doesn't apply\n // the view's sort or columns.\n const changeChipFilters = (filters: ActiveFilter[]) => {\n setApplyingView(undefined)\n onChipFiltersChange(filters)\n }\n\n const changeColumnVisibility = (names: string[]) => {\n setApplyingView(undefined)\n onColumnVisibilityChange(names)\n }\n\n // Only a user-created view can be saved over. Pending filters aren't applied\n // yet, so they don't count as changes.\n const isActiveSavedViewModified =\n activeView !== undefined &&\n activeView.id !== applyingView?.id &&\n isViewEditable(activeView, savedViews ?? []) &&\n isModified(activeView)\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 const searchLabel = ariaLabel ? `Search ${ariaLabel}` : \"Search table\"\n\n const hasActions = (tableActions?.length ?? 0) > 0\n const hasFilters = (filters.length ?? 0) > 0\n const hasViewSettingsToggle = hideableColumns.length > 0\n const hasTrailingControls = searchable || hasFilters || hasViewSettingsToggle\n const hasResults = hasResultsCount(resultNoun) || hasActions\n const showHeader = hasResults || Boolean(hasTrailingControls)\n const hasRowActions = (rowActions?.length ?? 0) > 0\n const { pendingFilters } = usePendingFilters()\n const hasEditableFilters = chipFilters.length + pendingFilters.length > 0\n // A modified view's actions live in the shelf, so it shows them even\n // without filters, such as after a column or sort change.\n const hasShelfContent = hasEditableFilters || isActiveSavedViewModified\n // Where focus goes once the shelf's actions are gone in a table without\n // filters, since it has no Add filter.\n const rootRef = useRef<HTMLDivElement>(null)\n const focusSelectedView = useCallback(() => {\n rootRef.current\n ?.querySelector<HTMLElement>(\n '.tds-data-table-views [role=\"option\"][aria-selected=\"true\"]'\n )\n ?.focus()\n }, [])\n const { filterOpenRequest } = useFilterOpenRequest()\n const [isShelfExpanded, toggleShelf] = useShelfExpanded(\n chipFilters.length + pendingFilters.length,\n pendingFilters.length,\n filterOpenRequest,\n isActiveSavedViewModified\n )\n // Keeps collapsed shelf content out of tab order/a11y tree. Needs a string,\n // not a boolean — `inert` isn't in `@types/react@18` or recognized by\n // react-dom as a boolean attribute before React 19.\n const shelfInertProps = { inert: isShelfExpanded ? undefined : \"\" } as {\n inert?: string\n }\n return (\n <div\n ref={rootRef}\n className={classNames(\"tds-data-table\", {\n \"tds-data-table--sticky-header\": hasScrollContainer,\n })}\n >\n {(Array.isArray(staticViews) || Array.isArray(savedViews)) && (\n <ViewsBar\n activeView={activeView}\n currentState={currentState}\n defaultViewId={defaultViewId}\n isReordering={isSavedViewReordering}\n saveStatus={saveStatus}\n savedViews={savedViews ?? []}\n select={select}\n selectWhenSaved={selectWhenSaved}\n staticViews={staticViewsWithInitial}\n onApply={applyView}\n onCreate={onSavedViewCreate}\n onDelete={onSavedViewDelete}\n onReorder={onSavedViewMove}\n onSetDefault={onDefaultViewIdChange}\n onUpdate={onSavedViewUpdate}\n />\n )}\n <div className=\"tds-data-table-frame\">\n <DataTableSelectionContext.Provider value={selectionModel}>\n {showHeader && (\n <div className=\"tds-data-table-frame-header\">\n <div className=\"tds-data-table-frame-header-content\">\n {hasResults && (\n <div className=\"tds-data-table-frame-header-results\">\n <ResultsCount\n id={resultsCountId}\n resultNoun={resultNoun}\n selectable={selectable}\n selectedCount={selectedCount}\n totalCount={totalCount}\n />\n {hasActions && (\n <TableActions\n actions={\n tableActions as TableAction<DataTableSelection>[]\n }\n resultNoun={resultNoun}\n />\n )}\n </div>\n )}\n {hasTrailingControls && (\n <div className=\"tds-data-table-frame-header-controls\">\n {searchable && (\n <TableSearch\n label={searchLabel}\n tableId={tableId}\n value={searchQuery}\n onChange={onSearchChange}\n />\n )}\n {hasFilters && (\n <FilterControls\n activeFilters={chipFilters}\n filters={filters}\n isShelfExpanded={isShelfExpanded}\n onToggleShelf={toggleShelf}\n />\n )}\n {hasViewSettingsToggle && (\n <ViewSettingsToggle\n columns={hideableColumns}\n onColumnVisibilityChange={changeColumnVisibility}\n visibleColumnNames={visibleHideableColumns}\n />\n )}\n </div>\n )}\n </div>\n </div>\n )}\n {(hasFilters || hasShelfContent) && (\n <div\n className={classNames(\"tds-data-table-filters-shelf\", {\n \"tds-data-table-filters-shelf--collapsed\": !isShelfExpanded,\n })}\n {...shelfInertProps}\n >\n <div className=\"tds-data-table-filters\">\n {hasShelfContent && (\n <ActiveFilters\n activeFilters={chipFilters}\n activeSavedView={\n isActiveSavedViewModified ? activeView : undefined\n }\n currentState={currentState}\n focusSelectedView={focusSelectedView}\n hasFilters={hasFilters}\n saveStatus={saveStatus}\n selectSavedViewWhenSaved={selectWhenSaved}\n onActiveFiltersChange={changeChipFilters}\n onClear={clearFilters}\n onSavedViewApply={applyView}\n onSavedViewCreate={onSavedViewCreate}\n onSavedViewUpdate={onSavedViewUpdate}\n />\n )}\n </div>\n </div>\n )}\n <SelectAllBanner resultNoun={resultNoun} />\n </DataTableSelectionContext.Provider>\n <div ref={wrapperRef} className=\"tds-data-table-scroll-wrapper\">\n <div\n ref={scrollRef}\n className=\"tds-data-table-scroll\"\n // Set here because RAC's `Table` doesn't forward `aria-busy`.\n aria-busy={showLoadingOverlay || undefined}\n >\n <Table\n {...restProps}\n {...selectionProps}\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 setApplyingView(undefined)\n onSortChange?.(serializeSort(sort))\n resetPage()\n }}\n >\n <TableHeader className=\"tds-data-table-header\">\n {selectable && (\n <Column className=\"tds-data-table-column tds-data-table-column--selectable\">\n {headerCheckboxProps ? (\n <Checkbox\n {...headerCheckboxProps}\n aria-label=\"Select all\"\n slot={null}\n className=\"tds-data-table-selectable-checkbox\"\n />\n ) : (\n <Checkbox\n slot=\"selection\"\n className=\"tds-data-table-selectable-checkbox\"\n />\n )}\n </Column>\n )}\n {visiblePreparedColumns.map(({ align, column }) => (\n <Column\n key={column.name}\n id={column.name}\n isRowHeader={column === rowHeaderColumn?.column}\n className={classNames(\"tds-data-table-column\", {\n [`tds-data-table-column--align-${align}`]:\n align !== \"start\",\n \"tds-data-table-column--avatar\": column.type === \"avatar\",\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 // A press fires the link/action only until something\n // is selected; after that it toggles selection.\n \"tds-data-table-row--has-action\":\n hasRowPressAction && !rowPressSelects,\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--avatar\":\n prepared.column.type === \"avatar\",\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 {showLoadingOverlay && (\n <div className=\"tds-data-table-loading-overlay\">\n <span className=\"tds-data-table-loading-label--hidden\">\n Loading\n </span>\n <span\n className=\"tds-data-table-loading-spinner\"\n aria-hidden=\"true\"\n >\n <LoadingSpinner />\n </span>\n <LoadingAnnouncement message=\"Loading\" />\n </div>\n )}\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\">\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 <LoadingAnnouncement message=\"Loading\" />\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.startsWith(\"-\"))\n return { column: sort.slice(1), direction: \"descending\" }\n return { column: sort, direction: \"ascending\" }\n}\n\nfunction serializeSort(sort: SortDescriptor): Sort {\n const column = String(sort.column)\n return sort.direction === \"descending\" ? `-${column}` : column\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 // The banner moves the wrapper without changing its size.\n if (wrapper.parentElement) resizeObserver.observe(wrapper.parentElement)\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6aA,MAAM,mBAAmB,GAAG,uBAAuB;AAanD;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,SAAS,GAAG,CAAC,EACxB,aAAa,GAAG,EAAE,EAClB,OAAO,GAAG,EAAE,EACZ,GAAG,KAAK,EACc,MACtBA,cAAA,CAAA,aAAA,CAAC,eAAe,EAAA,EAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAA;AAC7D,IAAAA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAA,GACT,KAAK,EACT,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAAA,CAChB,CACc;AAGpB,MAAM,cAAc,GAAG,CAAC,EACtB,aAAa,GAAG,EAAE,EAClB,SAAS,EACT,iBAAiB,EACjB,OAAO,EACP,WAAW,GAAG,CAAC,EACf,IAAI,EACJ,YAAY,EACZ,UAAU,EACV,UAAU,EACV,OAAO,GAAG,EAAE,EACZ,QAAQ,EACR,UAAU,EACV,WAAW,GAAG,KAAK,EACnB,eAAe,GAAG,KAAK,EACvB,EAAE,EACF,oBAAoB,GAAG,SAAS,EAChC,iBAAiB,EACjB,YA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index.css\"\nimport \"./filters.css\"\n\nimport { LoadingAnnouncement, LoadingSpinner } from \"@components/internal\"\nimport { Pagination } from \"@components/internal/pagination\"\nimport Icon from \"@utilities/Icon\"\nimport { useTapestryLocale } from \"@utilities/locale\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport { useId } from \"@utilities/useId\"\nimport classNames from \"classnames\"\nimport React, {\n type ReactNode,\n useCallback,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport {\n Cell,\n Checkbox,\n Column,\n Row,\n type SortDescriptor,\n Table,\n TableBody,\n TableHeader,\n type TableProps as AriaTableProps,\n} from \"react-aria-components/Table\"\n\nimport { ActiveFilters } from \"./ActiveFilters\"\nimport type { DataTableColumn } from \"./DataTableColumn\"\nimport { prepareColumn, type PreparedColumn } from \"./DataTableColumnTypes\"\nimport { type DataTableRowAppearance, getRowKey } from \"./DataTableRow\"\nimport { FiltersProvider } from \"./FilterContext\"\nimport { FilterControls } from \"./FilterControls\"\nimport { useFilterOpenRequest } from \"./FilterOpenRequest\"\nimport type { ActiveFilter, FilterNode } from \"./FilterTypes\"\nimport { usePendingFilters } from \"./PendingFilterContext\"\nimport {\n hasResultsCount,\n resolveResultNounLabel,\n type ResultNoun,\n ResultsCount,\n} from \"./ResultsCount\"\nimport { type RowAction, RowActions } from \"./RowActions\"\nimport { SelectAllBanner } from \"./SelectAllBanner\"\nimport { type TableAction, TableActions } from \"./TableActions\"\nimport { TableSearch } from \"./TableSearch\"\nimport { useActiveView } from \"./useActiveView\"\nimport { useColumnVisibility } from \"./useColumnVisibility\"\nimport {\n type DataTableSelection,\n DataTableSelectionContext,\n useDataTableSelection,\n} from \"./useDataTableSelection\"\nimport { useResultsAnnouncement } from \"./useResultsAnnouncement\"\nimport { useRowPressBoundary } from \"./useRowPressBoundary\"\nimport { useSavedViewsState } from \"./useSavedViewsState\"\nimport { useSaveStatus } from \"./useSaveStatus\"\nimport { useSearchFilter } from \"./useSearchFilter\"\nimport { useShelfExpanded } from \"./useShelfExpanded\"\nimport {\n initialView,\n isViewEditable,\n isViewModified,\n type SavedView,\n type StaticView,\n type View,\n withoutSearch,\n} from \"./views\"\nimport { ViewsBar } from \"./ViewsBar\"\nimport { ViewSettingsToggle } from \"./ViewSettingsToggle\"\n\nexport type {\n DataTableRowAppearance,\n DataTableSelection,\n ResultNoun,\n RowAction,\n TableAction,\n}\n\n/**\n * A PCO API order string: the column name for ascending (`\"lastName\"`), or\n * the name prefixed with a hyphen for descending (`\"-lastName\"`).\n */\nexport type Sort = string\n\nexport type DataTableLoadingState = \"error\" | \"idle\" | \"loading\"\n\ninterface DataTableBaseProps {\n activeFilters?: ActiveFilter[]\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 /**\n * The filter tree shown in the \"Add filter\" popover. Renders the filter\n * controls in the header when set; omit to leave filtering off entirely.\n * `q` is reserved for the search, so no filter can use it as its name.\n */\n filters?: FilterNode[]\n /**\n * Returns one of a fixed set of looks for the row, or `undefined` for the\n * default. Called on every render, so the appearance can depend on state\n * outside the row, such as a date picked elsewhere on the page. A row has\n * one appearance at a time; return the one that matters most.\n * - `\"reveal\"`: something outside the table points to the row. A highlight\n * plays when the row's appearance changes to `\"reveal\"`, then fades.\n * - `\"flagged\"`: the row needs attention. A persistent tint.\n * - `\"new\"`: the row was recently added. A persistent tint.\n * - `\"muted\"`: the row is less relevant. Subdued text.\n *\n * Reveal sits above selection and hover, which sit above flagged and new.\n * Color can't be the only signal, so flagged and new rows also need a\n * visible indicator in a cell, such as an icon or badge. A reveal doesn't\n * move focus; announce reveals that matter, such as \"3 events on November 9\".\n */\n getRowAppearance?: (row: unknown) => DataTableRowAppearance | undefined\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 * The id of the default view. Defaults to `\"initial\"`. The table doesn't\n * apply it; it's selected on mount when the initial `activeFilters` (apart\n * from the search), sort, and visible columns match it. Otherwise the first\n * matching view is selected, or none. Later changes are ignored.\n */\n initialDefaultViewId?: NonNullable<View[\"id\"]>\n /**\n * Named sets of filters, sort, and visible columns the user can apply, shown\n * in array order. Can't use the id `\"initial\"`, which is reserved for the\n * initial view. Later changes are ignored; remount with a new `key` to start\n * from fresh views. In a Rails app, load them with tapestry-rails'\n * `SavedView.on_table(...).data_table_props` and save changes with\n * `useSavedViewsClient`.\n */\n initialSavedViews?: SavedView[]\n /**\n * Async loading state for the table body.\n * - `\"loading\"`: While `data` is empty, replaces the empty state with a\n * centered spinner. While `data` has rows, keeps them on screen with a\n * spinner over them until new `data` arrives, so a search doesn't blank\n * the table. When requests can overlap, apply only the latest response.\n * Set it while any request is in flight, so screen reader users hear\n * the new count when it ends. Keep `\"idle\"` for a refresh the user did\n * not start, such as polling, or the count is announced again.\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 active filters change.\n * Provides an argument with the updated active filters array.\n */\n onActiveFiltersChange?: (activeFilters: ActiveFilter[]) => void\n /**\n * Called with the id of the view the user sets as the default, or\n * `\"initial\"` once the default view is deleted. Without it, the Set as\n * default action is hidden; on the default view it's disabled and reads\n * \"Default view\". The table shows the new default right away, and puts the\n * previous one back if the promise rejects, unless the user has set another\n * default since.\n */\n onDefaultViewIdChange?: (id: NonNullable<View[\"id\"]>) => Promise<void> | void\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 * Also called with `1`, right after `onActiveFiltersChange` or\n * `onSortChange`, when the user changes the filters, search, sort, or view\n * away from the first page. Load from state set by all three, not inside\n * each callback, or the same change loads twice. Update `currentPage` when\n * it's called, not once the page loads, or a change made while a page is\n * loading won't go back to page 1.\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 with the new view when the user saves the current filters, sort,\n * and columns as a view, or duplicates a view. Without it, views can't be\n * created or duplicated. Return the saved view with its new id, or a promise\n * of it; that view is selected once it's passed back in `savedViews`, unless\n * it was duplicated from the manage views modal. A callback that returns\n * nothing doesn't type check, so resolve to the view after refetching, e.g.\n * `(view) => api.create(view).then(async (saved) => { await refetch(); return saved })`.\n */\n onSavedViewCreate?: (\n savedView: Omit<SavedView, \"id\">\n ) => Promise<SavedView> | SavedView\n /**\n * Called with the view once the user confirms deleting it, from the context\n * menu or the manage views modal. Without it, views can't be deleted. The\n * table removes the view right away, and puts it back in its place if the\n * promise rejects. Deleting the default view resets the default to\n * `\"initial\"`, which is restored too.\n */\n onSavedViewDelete?: (savedView: SavedView) => Promise<void> | void\n /**\n * Called when the user moves a saved view, with the saved view it now comes\n * after, or `null` when it's first. Save the new position and return a\n * promise. The table moves the view right away, and moves it back if the\n * promise rejects. Without it, the manage views modal has no drag handles.\n */\n onSavedViewReorder?: (\n savedView: SavedView,\n after: SavedView | null\n ) => Promise<void> | void\n /**\n * Called with the updated view, matched by `id`. Return the saved view, or a\n * promise of it. The table shows the change right away, then swaps in the\n * returned view, or puts the old one back if the promise rejects, unless\n * the view has changed again since. Without it, view names are read only.\n */\n onSavedViewUpdate?: (savedView: SavedView) => Promise<SavedView> | SavedView\n /** Callback invoked when the sort state changes. */\n onSortChange?: (sort: Sort) => void\n /**\n * Called with the visible column names, in `columns` order, when the\n * visibility toggle changes or a view is applied. Always-visible columns\n * are included and unknown names are dropped, so the value can be passed\n * straight back as `visibleColumnNames`. Column visibility is controlled,\n * so the table only updates once `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 * The table can't go back to the first page itself, so reset the cursor\n * when the filters or sort change.\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. It also sizes an all-pages selection when\n * `canSelectAllPages` is true, including the count used by table actions and\n * the select-all banner. Without a result count, the banner isn't offered\n * because the table can't accurately describe the all-pages selection.\n * It also sets the count announced to screen reader users after a filter\n * change or a load. Without it, a paginated table announces only the current page,\n * e.g. `\"25 results on this page\"`.\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. Every\n * row renders the same control, even when `hidden` leaves a row with one\n * action. Each 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 * Displays a search input above the table. The query is kept in\n * `activeFilters` as a `q` filter and reported through\n * `onActiveFiltersChange` once typing pauses. It isn't saved with\n * views, and applying a view leaves it alone.\n */\n searchable?: boolean\n /**\n * Enables row selection via checkboxes, including a \"select all\" checkbox in\n * the header for the loaded page. Without a row action (`onRowClick` or\n * `getRowLink`), pressing anywhere in a row toggles the row selection.\n */\n selectable?: boolean\n /** The current sort state for the table. */\n sortBy?: Sort\n /**\n * Read-only views from the app, listed before the saved views. Ids must not\n * overlap with `initialSavedViews`. Unless one has the id `\"initial\"`, an\n * \"All\" view is added first. A table that opens filtered should pass those\n * filters as a view with the id `\"initial\"`, which replaces \"All\" and is the\n * default. Once the table's filters, sort, or visible columns differ from a\n * static view, it isn't shown as selected; picking it again reapplies it.\n * Omit both `staticViews` and `initialSavedViews` to hide the views bar.\n */\n staticViews?: StaticView[]\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 * The number of disabled rows across the whole result set. Used to size an\n * all-pages selection when disabled rows exist on unloaded pages. Replaces\n * the count inferred from `disabledKeys` rather than adding to it. Values are\n * clamped to the result count, and zero is used as supplied.\n */\n totalDisabledCount?: number\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. The\n * table goes back to page 1 through `onPageChange` when the user changes the\n * filters, search, sort, or view; when the app changes them itself, it sets\n * `currentPage` too.\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. Once it's set, a hideable column it doesn't name is\n * hidden, so a column added later stays hidden in a stored value until the\n * user shows it. Unknown names are ignored and display order always follows\n * `columns`.\n */\n visibleColumnNames?: string[]\n}\n\ninterface DataTableExplicitSelectionProps {\n /** Keeps selection values as arrays of row keys. */\n canSelectAllPages?: false\n /**\n * Called with the selected row keys whenever selection changes. Called with\n * `[]` when the user changes a filter or the search, so actions never apply\n * to rows the new filters hide.\n */\n onSelectedChange?: (keys: (number | string)[]) => void\n /** The selected row keys. */\n selectedKeys?: (number | string)[]\n /** Table actions whose callbacks receive the selected row keys. */\n tableActions?: TableAction[]\n}\n\ninterface DataTableAllPagesSelectionProps {\n /**\n * Enables tagged selection values that can represent every page plus\n * exclusions. Explicit arrays and the header checkbox remain page-scoped.\n * When `resultCount` proves more selectable results exist, selecting the\n * loaded page reveals a banner that widens the selection to every page or\n * clears it again. This works with both paged and indexed pagination.\n */\n canSelectAllPages: true\n /**\n * Called with the current explicit or all-pages selection. Called with `[]`\n * when the user changes a filter or the search, so actions never apply to\n * rows the new filters hide.\n */\n onSelectedChange?: (selection: DataTableSelection) => void\n /**\n * The current explicit or all-pages selection. Use\n * `{ keys: \"all\", excludedKeys: [] }` for every selectable result; a bare\n * `\"all\"` value is not accepted.\n */\n selectedKeys?: DataTableSelection\n /** Table actions whose callbacks receive the current selection. */\n tableActions?: TableAction<DataTableSelection>[]\n}\n\nexport type DataTableProps = DataTableBaseProps &\n (DataTableAllPagesSelectionProps | DataTableExplicitSelectionProps)\n\nconst DEFAULT_ERROR_STATE = \"Something went wrong.\"\n\nconst ROW_APPEARANCES = new Set<string>([\"flagged\", \"muted\", \"new\", \"reveal\"])\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 activeFilters = [],\n filters = [],\n ...props\n}: DataTableElementProps) => (\n <FiltersProvider activeFilters={activeFilters} filters={filters}>\n <DataTableInner\n {...props}\n activeFilters={activeFilters}\n filters={filters}\n />\n </FiltersProvider>\n)\n\nconst DataTableInner = ({\n activeFilters = [],\n className,\n canSelectAllPages,\n columns,\n currentPage = 1,\n data,\n disabledKeys,\n emptyState,\n errorState,\n filters = [],\n getRowAppearance,\n getRowId,\n getRowLink,\n hasNextPage = false,\n hasPreviousPage = false,\n id,\n initialDefaultViewId = \"initial\",\n initialSavedViews,\n loadingState = \"idle\",\n paginationType = \"paged\",\n resultCount,\n resultNoun,\n scrollContainerRef,\n scrollContainerSelector = \".content-wrap\",\n rowActions,\n searchable,\n selectable,\n selectedKeys: controlledSelectedKeys,\n staticViews: staticViewsProp,\n stickyHeader,\n sortBy,\n tableActions,\n totalDisabledCount,\n totalPages,\n visibleColumnNames,\n onActiveFiltersChange = () => {},\n onDefaultViewIdChange: onDefaultViewIdChangeProp,\n onNextPageClick,\n onPageChange,\n onPreviousPageClick,\n onRowClick,\n onSavedViewCreate: onSavedViewCreateProp,\n onSavedViewDelete: onSavedViewDeleteProp,\n onSavedViewReorder,\n onSavedViewUpdate: onSavedViewUpdateProp,\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 // With rows on screen, loading keeps them in place under a spinner instead.\n const showLoadingOverlay = loadingState === \"loading\" && data.length > 0\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 locale = useTapestryLocale()\n const preparedColumns = useMemo<PreparedColumn[]>(\n () => columns.map((column) => prepareColumn(column, locale)),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [columnKey, locale]\n )\n\n const {\n currentVisibleColumnNames,\n hideableColumns,\n isColumnVisible,\n onColumnVisibilityChange,\n resolveVisibleColumnNames,\n visibleHideableColumns,\n } = useColumnVisibility({\n columns,\n onVisibleColumnNamesChange,\n visibleColumnNames,\n })\n\n const staticViews = useMemo(\n () => staticViewsProp?.map(withoutSearch),\n [staticViewsProp]\n )\n const {\n defaultViewId,\n isReordering: isSavedViewReordering,\n onCreate: onSavedViewCreate,\n onDelete: onSavedViewDelete,\n onReorder: onSavedViewMove,\n onSetDefault: onDefaultViewIdChange,\n onUpdate: onSavedViewUpdate,\n savedViews,\n } = useSavedViewsState({\n initialDefaultViewId,\n initialSavedViews,\n onCreate: onSavedViewCreateProp,\n onDelete: onSavedViewDeleteProp,\n onReorder: onSavedViewReorder,\n onSetDefault: onDefaultViewIdChangeProp,\n onUpdate: onSavedViewUpdateProp,\n })\n const hasInitialView = staticViews?.some(({ id }) => id === initialView.id)\n const staticViewsWithInitial = hasInitialView\n ? (staticViews ?? [])\n : [initialView, ...(staticViews ?? [])]\n const views = [...staticViewsWithInitial, ...(savedViews ?? [])]\n\n const visiblePreparedColumns = useMemo(\n () => preparedColumns.filter(({ column }) => isColumnVisible(column)),\n [preparedColumns, isColumnVisible]\n )\n\n // The row header names each row for assistive tech. Avatars are decorative,\n // so it goes to the first visible column that isn't one, or to the first\n // column when every visible column is an avatar.\n const rowHeaderColumn =\n visiblePreparedColumns.find(({ column }) => column.type !== \"avatar\") ??\n visiblePreparedColumns[0]\n\n const selectionModel = useDataTableSelection({\n canSelectAllPages,\n data,\n disabledKeys,\n getRowId,\n hasRowPressAction,\n onSelectedChange,\n resultCount,\n selectable,\n selectedKeys: controlledSelectedKeys,\n totalDisabledCount,\n })\n const {\n commitSelection,\n headerCheckboxProps,\n rowPressSelects,\n selectedCount,\n selection,\n tableProps: selectionProps,\n totalCount,\n } = selectionModel\n\n // Selected rows a filter hides would still be acted on, so any filter or\n // search change the user makes clears the selection.\n const changeActiveFiltersClearingSelection = (\n activeFilters: ActiveFilter[]\n ) => {\n const hasSelection = !Array.isArray(selection) || selection.length > 0\n if (hasSelection) commitSelection([])\n onActiveFiltersChange(activeFilters)\n }\n\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 // A filter, search, or sort change from the table makes the current page\n // meaningless, so it goes back to the first page. Changes the app makes to\n // `activeFilters` or `sortBy` itself, including on mount, don't. The indexed\n // type has no page number, so the app resets its own cursor.\n const resetPage = () => {\n if (!isIndexedPagination && currentPage !== 1) onPageChange?.(1)\n }\n\n const announcedActiveFiltersChange = useResultsAnnouncement({\n isPageCount: showPagination && resultCount === undefined,\n loadingState,\n onActiveFiltersChange: (activeFilters) => {\n changeActiveFiltersClearingSelection(activeFilters)\n resetPage()\n },\n resultNoun,\n totalCount,\n })\n\n const {\n chipFilters,\n clearFilters,\n onChipFiltersChange,\n onSearchChange,\n searchQuery,\n } = useSearchFilter(activeFilters, announcedActiveFiltersChange)\n\n // Shared by the views bar and the filters shelf, so a save from the\n // shelf shows its status in the bar.\n const saveStatus = useSaveStatus()\n\n // The view being applied, until the table's state matches it, so its actions\n // don't flash in before the app passes the view's filters back.\n const [applyingView, setApplyingView] = useState<View>()\n\n // Search isn't part of a view, so applying one keeps the current search.\n const applyView = (view: View) => {\n setApplyingView(view)\n onChipFiltersChange(view.activeFilters)\n if (view.sort) onSortChange?.(view.sort)\n if (view.visibleColumnNames) {\n onColumnVisibilityChange(view.visibleColumnNames)\n }\n }\n\n // What a view saves from the table. Visible columns are saved even when no\n // column can be hidden, so a hideable column added later stays out of the\n // view. Sort is left out when there isn't one.\n const currentState = {\n activeFilters: chipFilters,\n ...(sortBy && { sort: sortBy }),\n visibleColumnNames: currentVisibleColumnNames,\n }\n\n // Compares a view against the table by the columns it shows today, so a\n // view that names a column that's gone, or leaves out an always-visible\n // one, still matches.\n const isModified = (view: View) =>\n isViewModified(\n view.visibleColumnNames\n ? {\n ...view,\n visibleColumnNames: resolveVisibleColumnNames(\n view.visibleColumnNames\n ),\n }\n : view,\n currentState\n )\n\n // Opens on the default view only when the table's state matches it, so a\n // table seeded from elsewhere, such as the URL, shows the view it's in.\n const { activeView, select, selectWhenSaved } = useActiveView(views, () => {\n const defaultView = views.find(({ id }) => id === defaultViewId)\n if (defaultView && !isModified(defaultView)) return defaultView\n return views.find((view) => !isModified(view))\n })\n\n if (applyingView && !isModified(applyingView)) setApplyingView(undefined)\n\n // A filter, sort, or column edit also ends applying, so the actions still\n // show when the table can't match a view, such as an app that doesn't apply\n // the view's sort or columns.\n const changeChipFilters = (filters: ActiveFilter[]) => {\n setApplyingView(undefined)\n onChipFiltersChange(filters)\n }\n\n const changeColumnVisibility = (names: string[]) => {\n setApplyingView(undefined)\n onColumnVisibilityChange(names)\n }\n\n // Only a user-created view can be saved over. Pending filters aren't applied\n // yet, so they don't count as changes.\n const isActiveSavedViewModified =\n activeView !== undefined &&\n activeView.id !== applyingView?.id &&\n isViewEditable(activeView, savedViews ?? []) &&\n isModified(activeView)\n\n // A changed system view has no Update or Discard, so the bar stops showing it\n // as selected. Picking it again, such as after Clear filters, reapplies it.\n const selectedView =\n activeView &&\n (activeView.id === applyingView?.id ||\n isViewEditable(activeView, savedViews ?? []) ||\n !isModified(activeView))\n ? activeView\n : undefined\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 const searchLabel = ariaLabel ? `Search ${ariaLabel}` : \"Search table\"\n\n const hasActions = (tableActions?.length ?? 0) > 0\n const hasFilters = (filters.length ?? 0) > 0\n const hasViewSettingsToggle = hideableColumns.length > 0\n const hasTrailingControls = searchable || hasFilters || hasViewSettingsToggle\n const hasResults = hasResultsCount(resultNoun) || hasActions\n const showHeader = hasResults || Boolean(hasTrailingControls)\n const hasRowActions = (rowActions?.length ?? 0) > 0\n const { pendingFilters } = usePendingFilters()\n const hasEditableFilters = chipFilters.length + pendingFilters.length > 0\n // A modified view's actions live in the shelf, so it shows them even\n // without filters, such as after a column or sort change.\n const hasShelfContent = hasEditableFilters || isActiveSavedViewModified\n // Where focus goes once the shelf's actions are gone in a table without\n // filters, since it has no Add filter.\n const rootRef = useRef<HTMLDivElement>(null)\n const focusSelectedView = useCallback(() => {\n rootRef.current\n ?.querySelector<HTMLElement>(\n '.tds-data-table-views [role=\"option\"][aria-selected=\"true\"]'\n )\n ?.focus()\n }, [])\n const { filterOpenRequest } = useFilterOpenRequest()\n const [isShelfExpanded, toggleShelf] = useShelfExpanded(\n chipFilters.length + pendingFilters.length,\n pendingFilters.length,\n filterOpenRequest,\n isActiveSavedViewModified\n )\n // Keeps collapsed shelf content out of tab order/a11y tree. Needs a string,\n // not a boolean — `inert` isn't in `@types/react@18` or recognized by\n // react-dom as a boolean attribute before React 19.\n const shelfInertProps = { inert: isShelfExpanded ? undefined : \"\" } as {\n inert?: string\n }\n return (\n <div\n ref={rootRef}\n className={classNames(\"tds-data-table\", {\n \"tds-data-table--sticky-header\": hasScrollContainer,\n })}\n >\n {(Array.isArray(staticViews) || Array.isArray(savedViews)) && (\n <ViewsBar\n activeView={selectedView}\n currentState={currentState}\n defaultViewId={defaultViewId}\n isReordering={isSavedViewReordering}\n saveStatus={saveStatus}\n savedViews={savedViews ?? []}\n select={select}\n selectWhenSaved={selectWhenSaved}\n staticViews={staticViewsWithInitial}\n onApply={applyView}\n onCreate={onSavedViewCreate}\n onDelete={onSavedViewDelete}\n onReorder={onSavedViewMove}\n onSetDefault={onDefaultViewIdChange}\n onUpdate={onSavedViewUpdate}\n />\n )}\n <div className=\"tds-data-table-frame\">\n <DataTableSelectionContext.Provider value={selectionModel}>\n {showHeader && (\n <div className=\"tds-data-table-frame-header\">\n <div className=\"tds-data-table-frame-header-content\">\n {hasResults && (\n <div className=\"tds-data-table-frame-header-results\">\n <ResultsCount\n id={resultsCountId}\n resultNoun={resultNoun}\n selectable={selectable}\n selectedCount={selectedCount}\n totalCount={totalCount}\n />\n {hasActions && (\n <TableActions\n actions={\n tableActions as TableAction<DataTableSelection>[]\n }\n resultNoun={resultNoun}\n />\n )}\n </div>\n )}\n {hasTrailingControls && (\n <div className=\"tds-data-table-frame-header-controls\">\n {searchable && (\n <TableSearch\n label={searchLabel}\n tableId={tableId}\n value={searchQuery}\n onChange={onSearchChange}\n />\n )}\n {hasFilters && (\n <FilterControls\n activeFilters={chipFilters}\n filters={filters}\n isShelfExpanded={isShelfExpanded}\n onToggleShelf={toggleShelf}\n />\n )}\n {hasViewSettingsToggle && (\n <ViewSettingsToggle\n columns={hideableColumns}\n onColumnVisibilityChange={changeColumnVisibility}\n visibleColumnNames={visibleHideableColumns}\n />\n )}\n </div>\n )}\n </div>\n </div>\n )}\n {(hasFilters || hasShelfContent) && (\n <div\n className={classNames(\"tds-data-table-filters-shelf\", {\n \"tds-data-table-filters-shelf--collapsed\": !isShelfExpanded,\n })}\n {...shelfInertProps}\n >\n <div className=\"tds-data-table-filters\">\n {hasShelfContent && (\n <ActiveFilters\n activeFilters={chipFilters}\n activeSavedView={\n isActiveSavedViewModified ? activeView : undefined\n }\n currentState={currentState}\n focusSelectedView={focusSelectedView}\n hasFilters={hasFilters}\n saveStatus={saveStatus}\n selectSavedViewWhenSaved={selectWhenSaved}\n onActiveFiltersChange={changeChipFilters}\n onClear={clearFilters}\n onSavedViewApply={applyView}\n onSavedViewCreate={onSavedViewCreate}\n onSavedViewUpdate={onSavedViewUpdate}\n />\n )}\n </div>\n </div>\n )}\n <SelectAllBanner resultNoun={resultNoun} />\n </DataTableSelectionContext.Provider>\n <div ref={wrapperRef} className=\"tds-data-table-scroll-wrapper\">\n <div\n ref={scrollRef}\n className=\"tds-data-table-scroll\"\n // Set here because RAC's `Table` doesn't forward `aria-busy`.\n aria-busy={showLoadingOverlay || undefined}\n >\n <Table\n {...restProps}\n {...selectionProps}\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 setApplyingView(undefined)\n onSortChange?.(serializeSort(sort))\n resetPage()\n }}\n >\n <TableHeader className=\"tds-data-table-header\">\n {selectable && (\n <Column className=\"tds-data-table-column tds-data-table-column--selectable\">\n {headerCheckboxProps ? (\n <Checkbox\n {...headerCheckboxProps}\n aria-label=\"Select all\"\n slot={null}\n className=\"tds-data-table-selectable-checkbox\"\n />\n ) : (\n <Checkbox\n slot=\"selection\"\n className=\"tds-data-table-selectable-checkbox\"\n />\n )}\n </Column>\n )}\n {visiblePreparedColumns.map(({ align, column }) => (\n <Column\n key={column.name}\n id={column.name}\n isRowHeader={column === rowHeaderColumn?.column}\n className={classNames(\"tds-data-table-column\", {\n [`tds-data-table-column--align-${align}`]:\n align !== \"start\",\n \"tds-data-table-column--avatar\": column.type === \"avatar\",\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 const appearance = getRowAppearance?.(row)\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 // A press fires the link/action only until something\n // is selected; after that it toggles selection.\n \"tds-data-table-row--has-action\":\n hasRowPressAction && !rowPressSelects,\n \"tds-data-table-row--interactive\": rowsAreInteractive,\n \"tds-data-table-row--press-selects\": rowPressSelects,\n [`tds-data-table-row--${appearance}`]:\n appearance && ROW_APPEARANCES.has(appearance),\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--avatar\":\n prepared.column.type === \"avatar\",\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 {showLoadingOverlay && (\n <div className=\"tds-data-table-loading-overlay\">\n <span className=\"tds-data-table-loading-label--hidden\">\n Loading\n </span>\n <span\n className=\"tds-data-table-loading-spinner\"\n aria-hidden=\"true\"\n >\n <LoadingSpinner />\n </span>\n <LoadingAnnouncement message=\"Loading\" />\n </div>\n )}\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\">\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 <LoadingAnnouncement message=\"Loading\" />\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.startsWith(\"-\"))\n return { column: sort.slice(1), direction: \"descending\" }\n return { column: sort, direction: \"ascending\" }\n}\n\nfunction serializeSort(sort: SortDescriptor): Sort {\n const column = String(sort.column)\n return sort.direction === \"descending\" ? `-${column}` : column\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 // The banner moves the wrapper without changing its size.\n if (wrapper.parentElement) resizeObserver.observe(wrapper.parentElement)\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwcA,MAAM,mBAAmB,GAAG,uBAAuB;AAEnD,MAAM,eAAe,GAAG,IAAI,GAAG,CAAS,CAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,CAAC;AAa9E;;;;;;;;;;;;;;;;AAgBG;AACI,MAAM,SAAS,GAAG,CAAC,EACxB,aAAa,GAAG,EAAE,EAClB,OAAO,GAAG,EAAE,EACZ,GAAG,KAAK,EACc,MACtBA,cAAA,CAAA,aAAA,CAAC,eAAe,EAAA,EAAC,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAA;AAC7D,IAAAA,cAAA,CAAA,aAAA,CAAC,cAAc,EAAA,EAAA,GACT,KAAK,EACT,aAAa,EAAE,aAAa,EAC5B,OAAO,EAAE,OAAO,EAAA,CAChB,CACc;AAGpB,MAAM,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;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;;;;"}
@@ -1,2 +1,4 @@
1
+ /** One of a fixed set of looks a row can take. See `getRowAppearance`. */
2
+ export type DataTableRowAppearance = "flagged" | "muted" | "new" | "reveal";
1
3
  export declare function getRowKey(row: unknown, index: number, getRowId?: (row: unknown) => number | string): number | string;
2
4
  //# sourceMappingURL=DataTableRow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableRow.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableRow.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CACvB,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,GAAG,MAAM,GAC3C,MAAM,GAAG,MAAM,CAIjB"}
1
+ {"version":3,"file":"DataTableRow.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableRow.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,CAAA;AAE3E,wBAAgB,SAAS,CACvB,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,MAAM,GAAG,MAAM,GAC3C,MAAM,GAAG,MAAM,CAIjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"DataTableRow.js","sources":["../../../src/components/DataTable/DataTableRow.ts"],"sourcesContent":["export function getRowKey(\n row: unknown,\n index: number,\n getRowId?: (row: unknown) => number | string\n): number | string {\n if (getRowId) return getRowId(row)\n const id = (row as Record<string, unknown>)?.id\n return typeof id === \"number\" || typeof id === \"string\" ? id : index\n}\n"],"names":[],"mappings":"SAAgB,SAAS,CACvB,GAAY,EACZ,KAAa,EACb,QAA4C,EAAA;AAE5C,IAAA,IAAI,QAAQ;AAAE,QAAA,OAAO,QAAQ,CAAC,GAAG,CAAC;AAClC,IAAA,MAAM,EAAE,GAAI,GAA+B,EAAE,EAAE;AAC/C,IAAA,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAQ,GAAG,EAAE,GAAG,KAAK;AACtE;;;;"}
1
+ {"version":3,"file":"DataTableRow.js","sources":["../../../src/components/DataTable/DataTableRow.ts"],"sourcesContent":["/** One of a fixed set of looks a row can take. See `getRowAppearance`. */\nexport type DataTableRowAppearance = \"flagged\" | \"muted\" | \"new\" | \"reveal\"\n\nexport function getRowKey(\n row: unknown,\n index: number,\n getRowId?: (row: unknown) => number | string\n): number | string {\n if (getRowId) return getRowId(row)\n const id = (row as Record<string, unknown>)?.id\n return typeof id === \"number\" || typeof id === \"string\" ? id : index\n}\n"],"names":[],"mappings":"SAGgB,SAAS,CACvB,GAAY,EACZ,KAAa,EACb,QAA4C,EAAA;AAE5C,IAAA,IAAI,QAAQ;AAAE,QAAA,OAAO,QAAQ,CAAC,GAAG,CAAC;AAClC,IAAA,MAAM,EAAE,GAAI,GAA+B,EAAE,EAAE;AAC/C,IAAA,OAAO,OAAO,EAAE,KAAK,QAAQ,IAAI,OAAO,EAAE,KAAK,QAAQ,GAAG,EAAE,GAAG,KAAK;AACtE;;;;"}
@@ -8,8 +8,10 @@ type RowActionBase = {
8
8
  */
9
9
  dataHookId?: string;
10
10
  /**
11
- * Whether the action is hidden. Pass a function to vary it per row — e.g.
12
- * hiding an action for a specific row.
11
+ * Whether the action is hidden. Use `true` to hide it on every row — e.g.
12
+ * a permission the current user lacks. Pass a function only when it
13
+ * depends on the row; a function counts toward the dropdown-or-button
14
+ * choice even if it hides the action on every row.
13
15
  */
14
16
  hidden?: boolean | ((row: unknown) => boolean);
15
17
  /**
@@ -72,7 +74,9 @@ export interface RowActionsProps {
72
74
  rowKey: number | string;
73
75
  }
74
76
  /**
75
- * An "Actions" dropdown with 2+ actions, or a single button or link with one.
77
+ * An "Actions" dropdown with 2+ row actions, or a single button or link with
78
+ * one. The choice comes from the `rowActions` list, not the row's visible
79
+ * actions, so every row renders the same control.
76
80
  */
77
81
  export declare const RowActions: ({ actions, row, rowKey }: RowActionsProps) => React.JSX.Element | null;
78
82
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"RowActions.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/RowActions.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,qDAAqD;AACrD,KAAK,aAAa,GAAG;IACnB;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,GAAG,CAAC,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,CAAA;IAC9C;;;OAGG;IACH,IAAI,CAAC,EAAE,aAAa,GAAG,YAAY,CAAA;IACnC;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,iFAAiF;AACjF,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG;IAC1C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C7B,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,kDAAkD;IAClD,OAAO,EAAE,IAAI,CAAA;IACb,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,OAAO,CAAC,EAAE,KAAK,CAAA;IACf,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,CAAA;AAED,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,aAAa,GAAG,aAAa,CAAA;AAExE,MAAM,WAAW,eAAe;IAC9B,iCAAiC;IACjC,OAAO,EAAE,SAAS,EAAE,CAAA;IACpB,8EAA8E;IAC9E,GAAG,EAAE,OAAO,CAAA;IACZ;;;OAGG;IACH,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CACxB;AAYD;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,0BAA0B,eAAe,6BAsFnE,CAAA"}
@@ -18,14 +18,19 @@ const ROW_ACTION_SINGLE_KIND_MAP = {
18
18
  "staff-only": "staff-only",
19
19
  };
20
20
  /**
21
- * An "Actions" dropdown with 2+ actions, or a single button or link with one.
21
+ * An "Actions" dropdown with 2+ row actions, or a single button or link with
22
+ * one. The choice comes from the `rowActions` list, not the row's visible
23
+ * actions, so every row renders the same control.
22
24
  */
23
25
  const RowActions = ({ actions, row, rowKey }) => {
26
+ // Dividers aren't actions, and `hidden: true` hides an action for every
27
+ // row, so neither counts. A `hidden` function varies per row, so it does.
28
+ const rowActionCount = actions.filter((action) => !action.divider && action.hidden !== true).length;
24
29
  const visibleActions = trimDividers(actions.filter((action) => action.divider || !resolveHidden(action.hidden, row)));
25
30
  if (visibleActions.length === 0) {
26
31
  return null;
27
32
  }
28
- if (visibleActions.length === 1 && !visibleActions[0].divider) {
33
+ if (rowActionCount === 1) {
29
34
  const [action] = visibleActions;
30
35
  const { label } = action;
31
36
  const hookProps = dataHookProps("row-action", action.dataHookId);
@@ -1 +1 @@
1
- {"version":3,"file":"RowActions.js","sources":["../../../src/components/DataTable/RowActions.tsx"],"sourcesContent":["import {\n ActionsDropdownIconButton,\n Button,\n type ButtonElementProps,\n} from \"@components/button\"\nimport {\n Dropdown,\n DropdownAction,\n DropdownLink,\n DropdownMenu,\n DropdownSeparator,\n DropdownTrigger,\n} from \"@components/dropdown\"\nimport { Link } from \"@components/link\"\nimport { dataHookProps } from \"@utilities/dataHooks\"\nimport React from \"react\"\n\n/** Fields shared by every non-divider row action. */\ntype RowActionBase = {\n /**\n * Sets `data-hook-id` on the action, with `data-hook-type=\"row-action\"`, for\n * analytics and test tools to target. Use a stable id, not the label, so\n * copy edits and translations don't break selectors.\n */\n dataHookId?: string\n /**\n * Whether the action is hidden. Pass a function to vary it per row — e.g.\n * hiding an action for a specific row.\n */\n hidden?: boolean | ((row: unknown) => boolean)\n /**\n * Applies destructive or staff-only visual treatment. Defaults to neutral\n * styling when unset.\n */\n kind?: \"destructive\" | \"staff-only\"\n /**\n * Label shown in the dropdown menu item, or as the button or link text\n * when it's the only action.\n */\n label: string\n}\n\n/** A row action rendered as a dropdown item (or a button if only one action). */\nexport type RowActionItem = RowActionBase & {\n /**\n * Whether the action is disabled. Pass a function to vary it per row —\n * e.g. disabling an action for a specific row.\n */\n disabled?: boolean | ((row: unknown) => boolean)\n divider?: never\n external?: never\n getHref?: never\n /** Called with the row when the action is triggered. */\n onAction: (row: unknown) => void\n}\n\n/** A row action that navigates to a URL instead of triggering a callback. */\nexport type RowActionLink = RowActionBase & {\n disabled?: never\n divider?: never\n /** If `true`, opens the link in a new tab with `rel=\"noreferrer noopener\"`. */\n external?: boolean\n /** Returns the row's destination URL. */\n getHref: (row: unknown) => string\n onAction?: never\n}\n\n/** A visual separator between actions. Every other property is ignored. */\nexport type RowActionDivider = {\n dataHookId?: never\n disabled?: never\n /** Renders a visual separator between actions. */\n divider: true\n external?: never\n getHref?: never\n hidden?: never\n kind?: never\n label?: never\n onAction?: never\n}\n\nexport type RowAction = RowActionDivider | RowActionItem | RowActionLink\n\nexport interface RowActionsProps {\n /** The row actions to render. */\n actions: RowAction[]\n /** The row passed to each action's `onAction` or `getHref` when triggered. */\n row: unknown\n /**\n * The row's unique key, used to namespace each menu item's `id` so it\n * doesn't collide with the same action rendered for a different row.\n */\n rowKey: number | string\n}\n\n/** Maps a row action's `kind` to the `kind` used for the single-action trigger. */\nconst ROW_ACTION_SINGLE_KIND_MAP: Record<\n NonNullable<RowActionBase[\"kind\"]> | \"default\",\n ButtonElementProps[\"kind\"]\n> = {\n default: \"secondary\",\n destructive: \"secondary-delete\",\n \"staff-only\": \"staff-only\",\n}\n\n/**\n * An \"Actions\" dropdown with 2+ actions, or a single button or link with one.\n */\nexport const RowActions = ({ actions, row, rowKey }: RowActionsProps) => {\n const visibleActions = trimDividers(\n actions.filter(\n (action) => action.divider || !resolveHidden(action.hidden, row)\n )\n )\n\n if (visibleActions.length === 0) {\n return null\n }\n\n if (visibleActions.length === 1 && !visibleActions[0].divider) {\n const [action] = visibleActions as [RowActionItem | RowActionLink]\n const { label } = action\n const hookProps = dataHookProps(\"row-action\", action.dataHookId)\n const kind = ROW_ACTION_SINGLE_KIND_MAP[action.kind ?? \"default\"]\n if (action.getHref) {\n return (\n <Link\n {...hookProps}\n external={action.external}\n href={action.getHref(row)}\n kind={kind}\n label={label}\n />\n )\n }\n return (\n <Button\n {...hookProps}\n disabled={resolveDisabled(action.disabled, row)}\n kind={kind}\n label={label}\n onClick={() => action.onAction(row)}\n />\n )\n }\n\n return (\n <Dropdown>\n <DropdownTrigger>\n <ActionsDropdownIconButton />\n </DropdownTrigger>\n <DropdownMenu placement=\"bottom end\">\n {visibleActions.map((action, index) => {\n if (action.divider) {\n return <DropdownSeparator key={`${rowKey}-divider-${index}`} />\n }\n const itemKey = `${rowKey}-action-${index}`\n const destructive = action.kind === \"destructive\"\n const staffOnly = action.kind === \"staff-only\"\n const hookProps = dataHookProps(\"row-action\", action.dataHookId)\n return action.getHref ? (\n <DropdownLink\n {...hookProps}\n key={itemKey}\n id={itemKey}\n destructive={destructive}\n external={action.external}\n href={action.getHref(row)}\n staffOnly={staffOnly}\n >\n {action.label}\n </DropdownLink>\n ) : (\n <DropdownAction\n {...hookProps}\n key={itemKey}\n id={itemKey}\n destructive={destructive}\n disabled={resolveDisabled(action.disabled, row)}\n staffOnly={staffOnly}\n onAction={() => action.onAction(row)}\n >\n {action.label}\n </DropdownAction>\n )\n })}\n </DropdownMenu>\n </Dropdown>\n )\n}\n\nfunction resolveDisabled(\n disabled: RowActionItem[\"disabled\"],\n row: unknown\n): boolean | undefined {\n return typeof disabled === \"function\" ? disabled(row) : disabled\n}\n\nfunction resolveHidden(hidden: RowActionBase[\"hidden\"], row: unknown): boolean {\n return typeof hidden === \"function\" ? hidden(row) : Boolean(hidden)\n}\n\n/**\n * Drops a divider left without a visible action on one side (from hiding an\n * adjacent action), and collapses consecutive dividers into one, so a\n * divider only ever separates two visible actions.\n */\nfunction trimDividers(actions: RowAction[]): RowAction[] {\n const result: RowAction[] = []\n\n for (const action of actions) {\n if (action.divider && (result.length === 0 || result.at(-1)?.divider)) {\n continue\n }\n result.push(action)\n }\n\n if (result.at(-1)?.divider) {\n result.pop()\n }\n\n return result\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;AA+FA;AACA,MAAM,0BAA0B,GAG5B;AACF,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,WAAW,EAAE,kBAAkB;AAC/B,IAAA,YAAY,EAAE,YAAY;CAC3B;AAED;;AAEG;AACI,MAAM,UAAU,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAmB,KAAI;AACtE,IAAA,MAAM,cAAc,GAAG,YAAY,CACjC,OAAO,CAAC,MAAM,CACZ,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,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EZ,IAAA,OAAO,OAAO,QAAQ,KAAK,UAAU,GAAG,QAAQ,CAAC,GAAG,CAAC,GAAG,QAAQ;AAClE;AAEA,SAAS,aAAa,CAAC,MAA+B,EAAE,GAAY,EAAA;AAClE,IAAA,OAAO,OAAO,MAAM,KAAK,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC;AACrE;AAEA;;;;AAIG;AACH,SAAS,YAAY,CAAC,OAAoB,EAAA;IACxC,MAAM,MAAM,GAAgB,EAAE;AAE9B,IAAA,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,IAAI,MAAM,CAAC,OAAO,KAAK,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE;YACrE;QACF;AACA,QAAA,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;IACrB;IAEA,IAAI,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE;QAC1B,MAAM,CAAC,GAAG,EAAE;IACd;AAEA,IAAA,OAAO,MAAM;AACf;;;;"}
1
+ {"version":3,"file":"RowActions.js","sources":["../../../src/components/DataTable/RowActions.tsx"],"sourcesContent":["import {\n ActionsDropdownIconButton,\n Button,\n type ButtonElementProps,\n} from \"@components/button\"\nimport {\n Dropdown,\n DropdownAction,\n DropdownLink,\n DropdownMenu,\n DropdownSeparator,\n DropdownTrigger,\n} from \"@components/dropdown\"\nimport { Link } from \"@components/link\"\nimport { dataHookProps } from \"@utilities/dataHooks\"\nimport React from \"react\"\n\n/** Fields shared by every non-divider row action. */\ntype RowActionBase = {\n /**\n * Sets `data-hook-id` on the action, with `data-hook-type=\"row-action\"`, for\n * analytics and test tools to target. Use a stable id, not the label, so\n * copy edits and translations don't break selectors.\n */\n dataHookId?: string\n /**\n * Whether the action is hidden. Use `true` to hide it on every row — e.g.\n * a permission the current user lacks. Pass a function only when it\n * depends on the row; a function counts toward the dropdown-or-button\n * choice even if it hides the action on every row.\n */\n hidden?: boolean | ((row: unknown) => boolean)\n /**\n * Applies destructive or staff-only visual treatment. Defaults to neutral\n * styling when unset.\n */\n kind?: \"destructive\" | \"staff-only\"\n /**\n * Label shown in the dropdown menu item, or as the button or link text\n * when it's the only action.\n */\n label: string\n}\n\n/** A row action rendered as a dropdown item (or a button if only one action). */\nexport type RowActionItem = RowActionBase & {\n /**\n * Whether the action is disabled. Pass a function to vary it per row —\n * e.g. disabling an action for a specific row.\n */\n disabled?: boolean | ((row: unknown) => boolean)\n divider?: never\n external?: never\n getHref?: never\n /** Called with the row when the action is triggered. */\n onAction: (row: unknown) => void\n}\n\n/** A row action that navigates to a URL instead of triggering a callback. */\nexport type RowActionLink = RowActionBase & {\n disabled?: never\n divider?: never\n /** If `true`, opens the link in a new tab with `rel=\"noreferrer noopener\"`. */\n external?: boolean\n /** Returns the row's destination URL. */\n getHref: (row: unknown) => string\n onAction?: never\n}\n\n/** A visual separator between actions. Every other property is ignored. */\nexport type RowActionDivider = {\n dataHookId?: never\n disabled?: never\n /** Renders a visual separator between actions. */\n divider: true\n external?: never\n getHref?: never\n hidden?: never\n kind?: never\n label?: never\n onAction?: never\n}\n\nexport type RowAction = RowActionDivider | RowActionItem | RowActionLink\n\nexport interface RowActionsProps {\n /** The row actions to render. */\n actions: RowAction[]\n /** The row passed to each action's `onAction` or `getHref` when triggered. */\n row: unknown\n /**\n * The row's unique key, used to namespace each menu item's `id` so it\n * doesn't collide with the same action rendered for a different row.\n */\n rowKey: number | string\n}\n\n/** Maps a row action's `kind` to the `kind` used for the single-action trigger. */\nconst ROW_ACTION_SINGLE_KIND_MAP: Record<\n NonNullable<RowActionBase[\"kind\"]> | \"default\",\n ButtonElementProps[\"kind\"]\n> = {\n default: \"secondary\",\n destructive: \"secondary-delete\",\n \"staff-only\": \"staff-only\",\n}\n\n/**\n * An \"Actions\" dropdown with 2+ row actions, or a single button or link with\n * one. The choice comes from the `rowActions` list, not the row's visible\n * actions, so every row renders the same control.\n */\nexport const RowActions = ({ actions, row, rowKey }: RowActionsProps) => {\n // Dividers aren't actions, and `hidden: true` hides an action for every\n // row, so neither counts. A `hidden` function varies per row, so it does.\n const rowActionCount = actions.filter(\n (action) => !action.divider && action.hidden !== true\n ).length\n const visibleActions = trimDividers(\n actions.filter(\n (action) => action.divider || !resolveHidden(action.hidden, row)\n )\n )\n\n if (visibleActions.length === 0) {\n return null\n }\n\n if (rowActionCount === 1) {\n const [action] = visibleActions as [RowActionItem | RowActionLink]\n const { label } = action\n const hookProps = dataHookProps(\"row-action\", action.dataHookId)\n const kind = ROW_ACTION_SINGLE_KIND_MAP[action.kind ?? \"default\"]\n if (action.getHref) {\n return (\n <Link\n {...hookProps}\n external={action.external}\n href={action.getHref(row)}\n kind={kind}\n label={label}\n />\n )\n }\n return (\n <Button\n {...hookProps}\n disabled={resolveDisabled(action.disabled, row)}\n kind={kind}\n label={label}\n onClick={() => action.onAction(row)}\n />\n )\n }\n\n return (\n <Dropdown>\n <DropdownTrigger>\n <ActionsDropdownIconButton />\n </DropdownTrigger>\n <DropdownMenu placement=\"bottom end\">\n {visibleActions.map((action, index) => {\n if (action.divider) {\n return <DropdownSeparator key={`${rowKey}-divider-${index}`} />\n }\n const itemKey = `${rowKey}-action-${index}`\n const destructive = action.kind === \"destructive\"\n const staffOnly = action.kind === \"staff-only\"\n const hookProps = dataHookProps(\"row-action\", action.dataHookId)\n return action.getHref ? (\n <DropdownLink\n {...hookProps}\n key={itemKey}\n id={itemKey}\n destructive={destructive}\n external={action.external}\n href={action.getHref(row)}\n staffOnly={staffOnly}\n >\n {action.label}\n </DropdownLink>\n ) : (\n <DropdownAction\n {...hookProps}\n key={itemKey}\n id={itemKey}\n destructive={destructive}\n disabled={resolveDisabled(action.disabled, row)}\n staffOnly={staffOnly}\n onAction={() => action.onAction(row)}\n >\n {action.label}\n </DropdownAction>\n )\n })}\n </DropdownMenu>\n </Dropdown>\n )\n}\n\nfunction resolveDisabled(\n disabled: RowActionItem[\"disabled\"],\n row: unknown\n): boolean | undefined {\n return typeof disabled === \"function\" ? disabled(row) : disabled\n}\n\nfunction resolveHidden(hidden: RowActionBase[\"hidden\"], row: unknown): boolean {\n return typeof hidden === \"function\" ? hidden(row) : Boolean(hidden)\n}\n\n/**\n * Drops a divider left without a visible action on one side (from hiding an\n * adjacent action), and collapses consecutive dividers into one, so a\n * divider only ever separates two visible actions.\n */\nfunction trimDividers(actions: RowAction[]): RowAction[] {\n const result: RowAction[] = []\n\n for (const action of actions) {\n if (action.divider && (result.length === 0 || result.at(-1)?.divider)) {\n continue\n }\n result.push(action)\n }\n\n if (result.at(-1)?.divider) {\n result.pop()\n }\n\n return result\n}\n"],"names":["React"],"mappings":";;;;;;;;;;;;;AAiGA;AACA,MAAM,0BAA0B,GAG5B;AACF,IAAA,OAAO,EAAE,WAAW;AACpB,IAAA,WAAW,EAAE,kBAAkB;AAC/B,IAAA,YAAY,EAAE,YAAY;CAC3B;AAED;;;;AAIG;AACI,MAAM,UAAU,GAAG,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAmB,KAAI;;;IAGtE,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CACnC,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,MAAM,KAAK,IAAI,CACtD,CAAC,MAAM;AACR,IAAA,MAAM,cAAc,GAAG,YAAY,CACjC,OAAO,CAAC,MAAM,CACZ,CAAC,MAAM,KAAK,MAAM,CAAC,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CACjE,CACF;AAED,IAAA,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,EAAE;AAC/B,QAAA,OAAO,IAAI;IACb;AAEA,IAAA,IAAI,cAAc,KAAK,CAAC,EAAE;AACxB,QAAA,MAAM,CAAC,MAAM,CAAC,GAAG,cAAiD;AAClE,QAAA,MAAM,EAAE,KAAK,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,EAAA;IACxC,MAAM,MAAM,GAAgB,EAAE;AAE9B,IAAA,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;QAC5B,IAAI,MAAM,CAAC,OAAO,KAAK,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE;YACrE;QACF;AACA,QAAA,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC;IACrB;IAEA,IAAI,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,OAAO,EAAE;QAC1B,MAAM,CAAC,GAAG,EAAE;IACd;AAEA,IAAA,OAAO,MAAM;AACf;;;;"}
@@ -58,7 +58,7 @@ class CollectionActiveFilterInstance extends ActiveFilterInstance {
58
58
  const Editor = hasLazyOptions
59
59
  ? CollectionFilterEditorLazy
60
60
  : CollectionFilterEditorStatic;
61
- return (React__default.createElement(Editor, { config: this.config, onChange: onChange, operator: this.operator, value: this.value, label: this.label, filter: this.filter, scope: this.scope }));
61
+ return (React__default.createElement(Editor, { config: this.config, onChange: onChange, editorLabel: this.editorLabel, value: this.value, label: this.label, filter: this.filter, scope: this.scope }));
62
62
  }
63
63
  }
64
64
 
@@ -1 +1 @@
1
- {"version":3,"file":"collectionFilter.js","sources":["../../../src/components/DataTable/collectionFilter.tsx"],"sourcesContent":["import React from \"react\"\n\nimport { ActiveFilterInstance } from \"./ActiveFilterInstance\"\nimport { CollectionFilterEditorLazy } from \"./CollectionEditorsLazy\"\nimport type {\n CollectionFilterValue,\n CollectionOptions,\n} from \"./CollectionEditorsShared\"\nimport { CollectionFilterEditorStatic } from \"./CollectionEditorsStatic\"\nimport type {\n ActiveFilter,\n ActiveFilterLabel,\n FilterChange,\n FilterItemConfig,\n FilterNodeItem,\n Operator,\n} from \"./FilterTypes\"\nimport { resolveOperators } from \"./resolveOperators\"\n\n// A type alias (not an interface) so it satisfies `Select`'s `data-*` index signature.\nexport type CollectionOption = {\n label: string\n value: string\n}\n\nexport type CollectionDisplay = \"checkboxes\" | \"combobox\" | \"radios\" | \"select\"\n\nexport const COLLECTION_IS = {\n inputType: { type: \"collection\" },\n label: \"is\",\n name: \"eq\",\n} as const satisfies Operator\nexport const COLLECTION_NOT = {\n inputType: { type: \"collection\" },\n label: \"is not\",\n name: \"not\",\n} as const satisfies Operator\n\nconst ALL_COLLECTION_OPERATORS = [COLLECTION_IS, COLLECTION_NOT]\nconst DEFAULT_COLLECTION_OPERATORS = [COLLECTION_IS]\n\nexport type CollectionOperatorName =\n (typeof ALL_COLLECTION_OPERATORS)[number][\"name\"]\n\nexport type CollectionActiveFilter = ActiveFilter<\n CollectionFilterValue | undefined,\n CollectionOperatorName\n>\n\nexport type CollectionFilterConfig =\n FilterItemConfig<CollectionOperatorName> & {\n /** How the editor presents the options. Defaults to `select`. */\n display?: CollectionDisplay\n /** Allows picking more than one option. Only supported with the `combobox` display; `checkboxes` always allows multiple and `radios` never does. */\n multiple?: boolean\n /** The choices, or a function that loads them. A function receives the combobox's search query and, inside a `scopedFilter`, the chosen scope. */\n options: CollectionOptions\n } & (\n | { display?: Exclude<CollectionDisplay, \"combobox\">; multiple?: never }\n | { display: \"combobox\"; multiple?: boolean }\n )\n\nexport function collectionFilter({\n display = \"select\",\n excludes,\n includes,\n multiple: multipleCombobox = false,\n options,\n ...config\n}: CollectionFilterConfig): FilterNodeItem {\n const multiple = display === \"checkboxes\" || multipleCombobox\n const filter: FilterNodeItem = {\n ...config,\n createActiveFilterInstance: (activeFilter, operator) =>\n new CollectionActiveFilterInstance(\n filter,\n operator,\n activeFilter.value as CollectionFilterValue,\n activeFilter.label,\n activeFilter.scope,\n { display, multiple, options }\n ),\n operators: resolveOperators(ALL_COLLECTION_OPERATORS, {\n default: DEFAULT_COLLECTION_OPERATORS,\n excludes,\n includes,\n }),\n }\n return filter\n}\n\nclass CollectionActiveFilterInstance extends ActiveFilterInstance<CollectionFilterValue> {\n constructor(\n filter: FilterNodeItem,\n operator: FilterNodeItem[\"operators\"][number],\n value: CollectionFilterValue,\n private readonly label: ActiveFilterLabel,\n private readonly scope: string | undefined,\n private readonly config: {\n display: CollectionDisplay\n multiple: boolean\n options: CollectionOptions\n }\n ) {\n super(filter, operator, value)\n this.label = label\n }\n\n get valueCount() {\n return [this.value].flat().length\n }\n\n formatValue() {\n if (this.label) return [this.label].flat().join(\", \")\n const values = Array.isArray(this.value) ? this.value : [this.value]\n if (typeof this.config.options === \"function\") return \"\"\n return values\n .map(\n (value) =>\n (this.config.options as CollectionOption[]).find(\n (option) => option.value === value\n )?.label ?? value\n )\n .join(\", \")\n }\n\n renderEditor(onChange: FilterChange) {\n const hasLazyOptions = typeof this.config.options === \"function\"\n const Editor = hasLazyOptions\n ? CollectionFilterEditorLazy\n : CollectionFilterEditorStatic\n\n return (\n <Editor\n config={this.config}\n onChange={onChange}\n operator={this.operator}\n value={this.value}\n label={this.label}\n filter={this.filter}\n scope={this.scope}\n />\n )\n }\n}\n"],"names":["React"],"mappings":";;;;;;AA2BO,MAAM,aAAa,GAAG;AAC3B,IAAA,SAAS,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AACjC,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,IAAI,EAAE,IAAI;;AAEL,MAAM,cAAc,GAAG;AAC5B,IAAA,SAAS,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AACjC,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,IAAI,EAAE,KAAK;;AAGb,MAAM,wBAAwB,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC;AAChE,MAAM,4BAA4B,GAAG,CAAC,aAAa,CAAC;AAuB9C,SAAU,gBAAgB,CAAC,EAC/B,OAAO,GAAG,QAAQ,EAClB,QAAQ,EACR,QAAQ,EACR,QAAQ,EAAE,gBAAgB,GAAG,KAAK,EAClC,OAAO,EACP,GAAG,MAAM,EACc,EAAA;AACvB,IAAA,MAAM,QAAQ,GAAG,OAAO,KAAK,YAAY,IAAI,gBAAgB;AAC7D,IAA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OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,UAAU;AAAE,YAAA,OAAO,EAAE;AACxD,QAAA,OAAO;AACJ,aAAA,GAAG,CACF,CAAC,KAAK,KACH,IAAI,CAAC,MAAM,CAAC,OAA8B,CAAC,IAAI,CAC9C,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,KAAK,KAAK,CACnC,EAAE,KAAK,IAAI,KAAK;aAEpB,IAAI,CAAC,IAAI,CAAC;IACf;AAEA,IAAA,YAAY,CAAC,QAAsB,EAAA;QACjC,MAAM,cAAc,GAAG,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,UAAU;QAChE,MAAM,MAAM,GAAG;AACb,cAAE;cACA,4BAA4B;QAEhC,QACEA,6BAAC,MAAM,EAAA,EACL,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAA,CACjB;IAEN;AACD;;;;"}
1
+ {"version":3,"file":"collectionFilter.js","sources":["../../../src/components/DataTable/collectionFilter.tsx"],"sourcesContent":["import React from \"react\"\n\nimport { ActiveFilterInstance } from \"./ActiveFilterInstance\"\nimport { CollectionFilterEditorLazy } from \"./CollectionEditorsLazy\"\nimport type {\n CollectionFilterValue,\n CollectionOptions,\n} from \"./CollectionEditorsShared\"\nimport { CollectionFilterEditorStatic } from \"./CollectionEditorsStatic\"\nimport type {\n ActiveFilter,\n ActiveFilterLabel,\n FilterChange,\n FilterItemConfig,\n FilterNodeItem,\n Operator,\n} from \"./FilterTypes\"\nimport { resolveOperators } from \"./resolveOperators\"\n\n// A type alias (not an interface) so it satisfies `Select`'s `data-*` index signature.\nexport type CollectionOption = {\n label: string\n value: string\n}\n\nexport type CollectionDisplay = \"checkboxes\" | \"combobox\" | \"radios\" | \"select\"\n\nexport const COLLECTION_IS = {\n inputType: { type: \"collection\" },\n label: \"is\",\n name: \"eq\",\n} as const satisfies Operator\nexport const COLLECTION_NOT = {\n inputType: { type: \"collection\" },\n label: \"is not\",\n name: \"not\",\n} as const satisfies Operator\n\nconst ALL_COLLECTION_OPERATORS = [COLLECTION_IS, COLLECTION_NOT]\nconst DEFAULT_COLLECTION_OPERATORS = [COLLECTION_IS]\n\nexport type CollectionOperatorName =\n (typeof ALL_COLLECTION_OPERATORS)[number][\"name\"]\n\nexport type CollectionActiveFilter = ActiveFilter<\n CollectionFilterValue | undefined,\n CollectionOperatorName\n>\n\nexport type CollectionFilterConfig =\n FilterItemConfig<CollectionOperatorName> & {\n /** How the editor presents the options. Defaults to `select`. */\n display?: CollectionDisplay\n /** Allows picking more than one option. Only supported with the `combobox` display; `checkboxes` always allows multiple and `radios` never does. */\n multiple?: boolean\n /** The choices, or a function that loads them. A function receives the combobox's search query and, inside a `scopedFilter`, the chosen scope. */\n options: CollectionOptions\n } & (\n | { display?: Exclude<CollectionDisplay, \"combobox\">; multiple?: never }\n | { display: \"combobox\"; multiple?: boolean }\n )\n\nexport function collectionFilter({\n display = \"select\",\n excludes,\n includes,\n multiple: multipleCombobox = false,\n options,\n ...config\n}: CollectionFilterConfig): FilterNodeItem {\n const multiple = display === \"checkboxes\" || multipleCombobox\n const filter: FilterNodeItem = {\n ...config,\n createActiveFilterInstance: (activeFilter, operator) =>\n new CollectionActiveFilterInstance(\n filter,\n operator,\n activeFilter.value as CollectionFilterValue,\n activeFilter.label,\n activeFilter.scope,\n { display, multiple, options }\n ),\n operators: resolveOperators(ALL_COLLECTION_OPERATORS, {\n default: DEFAULT_COLLECTION_OPERATORS,\n excludes,\n includes,\n }),\n }\n return filter\n}\n\nclass CollectionActiveFilterInstance extends ActiveFilterInstance<CollectionFilterValue> {\n constructor(\n filter: FilterNodeItem,\n operator: FilterNodeItem[\"operators\"][number],\n value: CollectionFilterValue,\n private readonly label: ActiveFilterLabel,\n private readonly scope: string | undefined,\n private readonly config: {\n display: CollectionDisplay\n multiple: boolean\n options: CollectionOptions\n }\n ) {\n super(filter, operator, value)\n this.label = label\n }\n\n get valueCount() {\n return [this.value].flat().length\n }\n\n formatValue() {\n if (this.label) return [this.label].flat().join(\", \")\n const values = Array.isArray(this.value) ? this.value : [this.value]\n if (typeof this.config.options === \"function\") return \"\"\n return values\n .map(\n (value) =>\n (this.config.options as CollectionOption[]).find(\n (option) => option.value === value\n )?.label ?? value\n )\n .join(\", \")\n }\n\n renderEditor(onChange: FilterChange) {\n const hasLazyOptions = typeof this.config.options === \"function\"\n const Editor = hasLazyOptions\n ? CollectionFilterEditorLazy\n : CollectionFilterEditorStatic\n\n return (\n <Editor\n config={this.config}\n onChange={onChange}\n editorLabel={this.editorLabel}\n value={this.value}\n label={this.label}\n filter={this.filter}\n scope={this.scope}\n />\n )\n }\n}\n"],"names":["React"],"mappings":";;;;;;AA2BO,MAAM,aAAa,GAAG;AAC3B,IAAA,SAAS,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AACjC,IAAA,KAAK,EAAE,IAAI;AACX,IAAA,IAAI,EAAE,IAAI;;AAEL,MAAM,cAAc,GAAG;AAC5B,IAAA,SAAS,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE;AACjC,IAAA,KAAK,EAAE,QAAQ;AACf,IAAA,IAAI,EAAE,KAAK;;AAGb,MAAM,wBAAwB,GAAG,CAAC,aAAa,EAAE,cAAc,CAAC;AAChE,MAAM,4BAA4B,GAAG,CAAC,aAAa,CAAC;AAuB9C,SAAU,gBAAgB,CAAC,EAC/B,OAAO,GAAG,QAAQ,EAClB,QAAQ,EACR,QAAQ,EACR,QAAQ,EAAE,gBAAgB,GAAG,KAAK,EAClC,OAAO,EACP,GAAG,MAAM,EACc,EAAA;AACvB,IAAA,MAAM,QAAQ,GAAG,OAAO,KAAK,YAAY,IAAI,gBAAgB;AAC7D,I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I,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,UAAU;AAAE,YAAA,OAAO,EAAE;AACxD,QAAA,OAAO;AACJ,aAAA,GAAG,CACF,CAAC,KAAK,KACH,IAAI,CAAC,MAAM,CAAC,OAA8B,CAAC,IAAI,CAC9C,CAAC,MAAM,KAAK,MAAM,CAAC,KAAK,KAAK,KAAK,CACnC,EAAE,KAAK,IAAI,KAAK;aAEpB,IAAI,CAAC,IAAI,CAAC;IACf;AAEA,IAAA,YAAY,CAAC,QAAsB,EAAA;QACjC,MAAM,cAAc,GAAG,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,UAAU;QAChE,MAAM,MAAM,GAAG;AACb,cAAE;cACA,4BAA4B;QAEhC,QACEA,6BAAC,MAAM,EAAA,EACL,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,IAAI,CAAC,WAAW,EAC7B,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAA,CACjB;IAEN;AACD;;;;"}
@@ -120,12 +120,12 @@ class DateActiveFilterInstance extends ActiveFilterInstance {
120
120
  renderEditor(onChange) {
121
121
  if (this.isPreset)
122
122
  return null;
123
- const { label } = this.operator;
123
+ const label = this.editorLabel;
124
124
  if (this.operator.inputType.type === "date-range") {
125
125
  const range = Array.isArray(this.value)
126
126
  ? this.value
127
127
  : [this.value, this.value];
128
- return (React__default.createElement(DateRangeEditor, { label: label, max: this.limits.max, min: this.limits.min, value: range, onCommit: (value) => {
128
+ return (React__default.createElement(DateRangeEditor, { labels: this.rangeEditorLabels, max: this.limits.max, min: this.limits.min, value: range, onCommit: (value) => {
129
129
  const complete = value.length === 2 && value.every((v) => v !== undefined);
130
130
  onChange({ value }, { complete });
131
131
  } }));
@@ -134,13 +134,13 @@ class DateActiveFilterInstance extends ActiveFilterInstance {
134
134
  return (React__default.createElement(DateEditorPicker, { defaultValue: single, label: label, limits: this.limits, onCommit: (value) => onChange({ value }, { complete: value !== undefined }) }));
135
135
  }
136
136
  }
137
- function DateRangeEditor({ label, max, min, onCommit, value: [start, end], }) {
137
+ function DateRangeEditor({ labels: [startLabel, endLabel], max, min, onCommit, value: [start, end], }) {
138
138
  const startLimits = { max: earlier(max, end), min };
139
139
  const endLimits = { max, min: later(min, start) };
140
140
  return (React__default.createElement(Flex, { align: "center", gap: 1 },
141
- React__default.createElement(DateEditorPicker, { defaultValue: start, label: `${label} from`, limits: startLimits, onCommit: (date) => onCommit([date, end]) }),
141
+ React__default.createElement(DateEditorPicker, { defaultValue: start, label: startLabel, limits: startLimits, onCommit: (date) => onCommit([date, end]) }),
142
142
  React__default.createElement("div", null, "and"),
143
- React__default.createElement(DateEditorPicker, { defaultValue: end, label: `${label} to`, limits: endLimits, onCommit: (date) => onCommit([start, date]) })));
143
+ React__default.createElement(DateEditorPicker, { defaultValue: end, label: endLabel, limits: endLimits, onCommit: (date) => onCommit([start, date]) })));
144
144
  }
145
145
  /**
146
146
  * Commits only when the field loses focus or the calendar closes, once the