@elliemae/ds-data-table 3.70.0-next.6 → 3.70.0-next.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js +15 -3
- package/dist/cjs/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js.map +3 -3
- package/dist/cjs/addons/Editables/index.js.map +1 -1
- package/dist/cjs/addons/Filters/Components/SelectFilter/BaseSelectFilter.js.map +2 -2
- package/dist/cjs/addons/Filters/Components/SelectFilter/BaseSelectFilterV2.js.map +2 -2
- package/dist/cjs/configs/constants.js +4 -0
- package/dist/cjs/configs/constants.js.map +2 -2
- package/dist/cjs/configs/useAutocalculated/index.js +15 -1
- package/dist/cjs/configs/useAutocalculated/index.js.map +2 -2
- package/dist/cjs/configs/useStore/useStore.js +46 -0
- package/dist/cjs/configs/useStore/useStore.js.map +2 -2
- package/dist/cjs/constants/index.js +1 -0
- package/dist/cjs/constants/index.js.map +2 -2
- package/dist/cjs/exported-related/FilterBar/PillsFromDataTableFilters.js +2 -1
- package/dist/cjs/exported-related/FilterBar/PillsFromDataTableFilters.js.map +2 -2
- package/dist/cjs/exported-related/FilterPopover/FilterPopoverV2.js +14 -8
- package/dist/cjs/exported-related/FilterPopover/FilterPopoverV2.js.map +2 -2
- package/dist/cjs/exported-related/FilterPopover/index.js +31 -7
- package/dist/cjs/exported-related/FilterPopover/index.js.map +2 -2
- package/dist/cjs/package.json +1 -4
- package/dist/cjs/parts/Cells/Cell.js +1 -1
- package/dist/cjs/parts/Cells/Cell.js.map +2 -2
- package/dist/cjs/parts/Cells/CellFactory.js +1 -1
- package/dist/cjs/parts/Cells/CellFactory.js.map +2 -2
- package/dist/cjs/parts/FilterBar/FiltersBar.js +2 -1
- package/dist/cjs/parts/FilterBar/FiltersBar.js.map +2 -2
- package/dist/cjs/parts/Headers/HeaderCell.js +13 -24
- package/dist/cjs/parts/Headers/HeaderCell.js.map +2 -2
- package/dist/cjs/parts/Headers/HeaderCellTitle.js +24 -4
- package/dist/cjs/parts/Headers/HeaderCellTitle.js.map +2 -2
- package/dist/cjs/parts/Headers/HeaderResizer.js +40 -18
- package/dist/cjs/parts/Headers/HeaderResizer.js.map +2 -2
- package/dist/cjs/{exported-related/FilterPopover/useOnClickOutside.js → parts/Headers/buildScreenReaderInstructions.js} +33 -30
- package/dist/cjs/parts/Headers/buildScreenReaderInstructions.js.map +7 -0
- package/dist/cjs/parts/Headers/index.js +15 -7
- package/dist/cjs/parts/Headers/index.js.map +2 -2
- package/dist/cjs/parts/Headers/useHeaderCellHandlers.js +44 -8
- package/dist/cjs/parts/Headers/useHeaderCellHandlers.js.map +2 -2
- package/dist/cjs/parts/Headers/useHeaderResizer.js +13 -3
- package/dist/cjs/parts/Headers/useHeaderResizer.js.map +2 -2
- package/dist/cjs/parts/HoC/withDnDSortableColumnContext.js +3 -1
- package/dist/cjs/parts/HoC/withDnDSortableColumnContext.js.map +2 -2
- package/dist/cjs/parts/VirtualRowsList.js +2 -0
- package/dist/cjs/parts/VirtualRowsList.js.map +2 -2
- package/dist/cjs/react-desc-prop-types.js +10 -3
- package/dist/cjs/react-desc-prop-types.js.map +2 -2
- package/dist/cjs/styled.js +55 -52
- package/dist/cjs/styled.js.map +2 -2
- package/dist/esm/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js +15 -3
- package/dist/esm/addons/Columns/ColumnSelectMultiple/ColumnSelectMultiple.js.map +2 -2
- package/dist/esm/addons/Editables/index.js.map +1 -1
- package/dist/esm/addons/Filters/Components/SelectFilter/BaseSelectFilter.js.map +2 -2
- package/dist/esm/addons/Filters/Components/SelectFilter/BaseSelectFilterV2.js.map +2 -2
- package/dist/esm/configs/constants.js +4 -0
- package/dist/esm/configs/constants.js.map +2 -2
- package/dist/esm/configs/useAutocalculated/index.js +15 -1
- package/dist/esm/configs/useAutocalculated/index.js.map +2 -2
- package/dist/esm/configs/useStore/useStore.js +46 -0
- package/dist/esm/configs/useStore/useStore.js.map +2 -2
- package/dist/esm/constants/index.js +1 -0
- package/dist/esm/constants/index.js.map +2 -2
- package/dist/esm/exported-related/FilterBar/PillsFromDataTableFilters.js +2 -1
- package/dist/esm/exported-related/FilterBar/PillsFromDataTableFilters.js.map +2 -2
- package/dist/esm/exported-related/FilterPopover/FilterPopoverV2.js +15 -9
- package/dist/esm/exported-related/FilterPopover/FilterPopoverV2.js.map +2 -2
- package/dist/esm/exported-related/FilterPopover/index.js +31 -7
- package/dist/esm/exported-related/FilterPopover/index.js.map +2 -2
- package/dist/esm/package.json +1 -4
- package/dist/esm/parts/Cells/Cell.js +1 -1
- package/dist/esm/parts/Cells/Cell.js.map +2 -2
- package/dist/esm/parts/Cells/CellFactory.js +1 -1
- package/dist/esm/parts/Cells/CellFactory.js.map +2 -2
- package/dist/esm/parts/FilterBar/FiltersBar.js +2 -1
- package/dist/esm/parts/FilterBar/FiltersBar.js.map +2 -2
- package/dist/esm/parts/Headers/HeaderCell.js +13 -24
- package/dist/esm/parts/Headers/HeaderCell.js.map +2 -2
- package/dist/esm/parts/Headers/HeaderCellTitle.js +24 -4
- package/dist/esm/parts/Headers/HeaderCellTitle.js.map +2 -2
- package/dist/esm/parts/Headers/HeaderResizer.js +41 -19
- package/dist/esm/parts/Headers/HeaderResizer.js.map +2 -2
- package/dist/esm/parts/Headers/buildScreenReaderInstructions.js +33 -0
- package/dist/esm/parts/Headers/buildScreenReaderInstructions.js.map +7 -0
- package/dist/esm/parts/Headers/index.js +15 -7
- package/dist/esm/parts/Headers/index.js.map +2 -2
- package/dist/esm/parts/Headers/useHeaderCellHandlers.js +44 -8
- package/dist/esm/parts/Headers/useHeaderCellHandlers.js.map +2 -2
- package/dist/esm/parts/Headers/useHeaderResizer.js +14 -4
- package/dist/esm/parts/Headers/useHeaderResizer.js.map +2 -2
- package/dist/esm/parts/HoC/withDnDSortableColumnContext.js +3 -1
- package/dist/esm/parts/HoC/withDnDSortableColumnContext.js.map +2 -2
- package/dist/esm/parts/VirtualRowsList.js +2 -0
- package/dist/esm/parts/VirtualRowsList.js.map +2 -2
- package/dist/esm/react-desc-prop-types.js +10 -3
- package/dist/esm/react-desc-prop-types.js.map +2 -2
- package/dist/esm/styled.js +13 -10
- package/dist/esm/styled.js.map +2 -2
- package/dist/types/TruncatedTooltipText.d.ts +1 -1
- package/dist/types/addons/Editables/index.d.ts +1 -1
- package/dist/types/configs/constants.d.ts +2 -0
- package/dist/types/constants/index.d.ts +4 -0
- package/dist/types/exported-related/Skeleton/SkeletonCell.d.ts +2 -1
- package/dist/types/exported-related/Skeleton/SkeletonHeaderCell.d.ts +2 -1
- package/dist/types/parts/Headers/HeaderCellGroup.d.ts +1 -1
- package/dist/types/parts/Headers/buildScreenReaderInstructions.d.ts +19 -0
- package/dist/types/parts/Headers/useHeaderResizer.d.ts +1 -0
- package/dist/types/parts/HoC/withConditionalDnDSortableContext.d.ts +1 -1
- package/dist/types/parts/HoC/withDnDSortableColumnContext.d.ts +1 -1
- package/dist/types/parts/HoC/withDnDSortableRowContext.d.ts +1 -1
- package/dist/types/parts/Loader.d.ts +1 -1
- package/dist/types/parts/Row.d.ts +1 -1
- package/dist/types/parts/SkeletonTable.d.ts +1 -1
- package/dist/types/parts/TableContent.d.ts +2 -1
- package/dist/types/parts/VirtualRowsList.d.ts +2 -1
- package/dist/types/react-desc-prop-types.d.ts +11 -0
- package/dist/types/styled.d.ts +2 -1
- package/package.json +34 -34
- package/skills/ds-data-table-slots/SKILL.md +11 -3
- package/dist/cjs/exported-related/FilterPopover/useOnClickOutside.js.map +0 -7
- package/dist/esm/exported-related/FilterPopover/useOnClickOutside.js +0 -30
- package/dist/esm/exported-related/FilterPopover/useOnClickOutside.js.map +0 -7
- package/dist/types/exported-related/FilterPopover/useOnClickOutside.d.ts +0 -1
- package/dist/types/tests/DSDataTable.exports.test.d.ts +0 -1
- package/dist/types/tests/DSDataTable.get-owner-props-arguments-slots.test.d.ts +0 -1
- package/dist/types/tests/a11y/aria-label-customization.test.d.ts +0 -1
- package/dist/types/tests/a11y/aria-level.test.d.ts +0 -1
- package/dist/types/tests/a11y/internally-printed-ids.A11y.test.d.ts +0 -1
- package/dist/types/tests/a11y/number-of-cells-and-columnheader.test.d.ts +0 -1
- package/dist/types/tests/a11y/out-of-the-box-filters.A11y.test.d.ts +0 -1
- package/dist/types/tests/callbacks/editableCell.events.test.d.ts +0 -1
- package/dist/types/tests/callbacks/header.events.test.d.ts +0 -1
- package/dist/types/tests/callbacks/pagination.events.test.d.ts +0 -1
- package/dist/types/tests/callbacks/row.events.test.d.ts +0 -1
- package/dist/types/tests/data-testid/DSDataTable.data-testid.test.d.ts +0 -1
- package/dist/types/tests/data-testid/Renderers.d.ts +0 -36
- package/dist/types/tests/filters/DSDatatable.PUI-17318.test.d.ts +0 -1
- package/dist/types/tests/filters/combobox-filter.test.d.ts +0 -1
- package/dist/types/tests/filters/currency-range-filter-PUI-12735.test.d.ts +0 -1
- package/dist/types/tests/filters/free-text-search-filter.test.d.ts +0 -1
- package/dist/types/tests/keyboard/dragAndDropColumns.test.d.ts +0 -1
- package/dist/types/tests/keyboard/dragAndDropRows.test.d.ts +0 -1
- package/dist/types/tests/keyboard/expandable.test.d.ts +0 -1
- package/dist/types/tests/keyboard/grouped.test.d.ts +0 -1
- package/dist/types/tests/keyboard/masterDetails.test.d.ts +0 -1
- package/dist/types/tests/keyboard/navigation.test.d.ts +0 -1
- package/dist/types/tests/keyboard/selectMultiple.test.d.ts +0 -1
- package/dist/types/tests/keyboard/selectSingle.test.d.ts +0 -1
- package/dist/types/tests/keyboard/sort.test.d.ts +0 -1
- package/dist/types/tests/playwright/DSDataTable.ControlledFilterTestRenderer.d.ts +0 -2
- package/dist/types/tests/playwright/DSDataTable.ControlledHiddenPanelTestRenderer.d.ts +0 -1
- package/dist/types/tests/playwright/DSDataTable.ControlledSortTestRenderer.d.ts +0 -2
- package/dist/types/tests/playwright/DSDataTable.slot-contracts-dynamic.test.playwright.d.ts +0 -1
- package/dist/types/tests/playwright/DSDataTable.test.playwright.d.ts +0 -1
- package/dist/types/tests/playwright/DSDataTableDropIndicatorTestRenderer.d.ts +0 -1
- package/dist/types/tests/playwright/GenericExampleTable.d.ts +0 -1
- package/dist/types/tests/render/cellStyle.test.d.ts +0 -1
- package/dist/types/tests/render/empty-state.test.d.ts +0 -1
- package/dist/types/tests/render/selectMultiple.test.d.ts +0 -1
- package/dist/types/tests/render/toolbar.test.d.ts +0 -1
- package/dist/types/tests/utils/index.d.ts +0 -65
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../src/constants/index.ts"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport { legacyDataTestIds } from './legacyToBeDeprecated.js';\n\nexport const DSDataTableName = 'DSDatatable';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const DATA_TABLE_SLOTS = {\n ROOT: 'root',\n CONTENT_WRAPPER: 'content-wrapper',\n TABLE_WRAPPER: 'table-wrapper',\n PAGINATION_WRAPPER: 'pagination-wrapper',\n TABLE_CONTENT_WRAPPER: 'table-content-wrapper',\n VIRTUAL_LIST_WRAPPER: 'virtual-list-wrapper',\n HEAD_WRAPPER: 'head-wrapper',\n HEAD_TR: 'head-tr',\n HEAD_TH: 'head-th',\n HEAD_RIGHT_ICONS_WRAPPER: 'head-right-icons-wrapper',\n HEADER_CELL_WRAPPER: 'header-cell-wrapper',\n EMPTY_HEADER: 'empty-header',\n RESIZER: 'resizer',\n ACTION_CELL: 'action-cell',\n EXPAND_CELL_CONTAINER: 'expand-cell-container',\n SINGLE_CELL_CONTAINER: 'single-cell-container',\n DRAG_AND_DROP_GRIPPER: 'drag-and-drop-gripper',\n TEXT_EDITABLE_CELL_INPUT: 'text-editable-cell-input',\n FILTER_POPOVER_BUTTON: 'filter-popover-button',\n FILTER_POPOVER_CONTENT: 'filter-popover-content',\n DROP_INDICATOR: 'drop-indicator',\n CELL: 'cell',\n CELL_CONTENT: 'cell-content',\n PENCIL_ICON: 'pencil-icon',\n EDITABLE_CONTAINER: 'editable-container',\n FULLSIZE_GRID: 'fullsize-grid',\n ROW: 'row',\n GROUP_HEADER_CONTAINER: 'group-header-container',\n GROUP_HEADER_TITLE: 'header-title',\n CELL_CONTAINER: 'cells-container',\n TOOLBAR_WRAPPER: 'toolbar-wrapper',\n TOOLBAR_BUTTONS_WRAPPER: 'toolbar-buttons-wrapper',\n TOOLBAR_BUTTON: 'toolbar-button',\n TOOLBAR_POSITION: 'toolbar-position',\n EMPTY_STATE_WRAPPER: 'empty-state-wrapper',\n WARNING_ICON: 'warning-icon',\n EMPTY_PRIMARY_MESSAGE: 'empty-primary-message',\n EMPTY_SECONDARY_MESSAGE: 'empty-secondary-message',\n EMPTY_BUTTON: 'empty-button',\n CENTER_CONTENT_FLEX_WRAPPER: 'center-content-flex-wrapper',\n LOADER_WRAPPER: 'loader-wrapper',\n FILTER_BAR_WRAPPER: 'filter-bar-wrapper',\n FREE_TEXT_SEARCH_FILTER: 'free-text-search-filter',\n FREE_TEXT_SEARCH_WRAPPER: 'free-text-search-wrapper',\n FILTER_POPOVER: 'filter-popover',\n FILTER_BAR_MENU_BUTTON: 'filter-bar-menu-button',\n FILTER_POPOVER_FOOTER: 'filter-popover-footer',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const DATA_TABLE_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSDataTableName, DATA_TABLE_SLOTS),\n /**\n * These data-testid were defined in src/configs/constants.tsx\n * but they were never exposed to consumers in the index.ts file.\n * We are exposing them here for backward compatibility, as they are the ones used in the component implementation.\n *\n */\n ...legacyDataTestIds,\n /**\n * As there is a mix of hardcoded data-testid and the ones auto generated by slot definitions\n * we are overriding the auto generated ones with the hardcoded values for consistency.\n */\n CONTENT_WRAPPER: legacyDataTestIds.DATA_TABLE_CONTENT_WRAPPER,\n TABLE_WRAPPER: legacyDataTestIds.DATA_TABLE_TABLE,\n CELL_CONTAINER: legacyDataTestIds.DATA_TABLE_ROW_CONTENT,\n DRAG_AND_DROP_GRIPPER: legacyDataTestIds.DATA_TABLE_DRAG_HANDLE,\n FREE_TEXT_SEARCH_FILTER: legacyDataTestIds.DATA_TABLE_FILTER_FREE_TEXT_SEARCH,\n FILTER_POPOVER_BUTTON: legacyDataTestIds.DATA_TABLE_FILTER_BUTTON,\n HEAD_TH: legacyDataTestIds.DATA_TABLE_HEADER,\n CELL: legacyDataTestIds.DATA_TABLE_CELL,\n FULLSIZE_GRID: legacyDataTestIds.DATA_TABLE_ROW,\n ROOT: legacyDataTestIds.DATA_TABLE_WRAPPER,\n VIRTUAL_LIST_WRAPPER: legacyDataTestIds.DATA_TABLE_SCROLLABLE_CONTAINER,\n GROUP_HEADER_CONTAINER: legacyDataTestIds.DATA_TABLE_ROW_GROUP_HEADER,\n FILTER_BAR_MENU_BUTTON: legacyDataTestIds.DATA_TABLE_FILTER_BAR_DD_MENU_BUTTON,\n // This one does not exist in the legacy list, but it was hardcoded in the component definition\n EXPAND_CELL_CONTAINER: 'data-table-row-expand-cell',\n};\n\n// Legacy exports before Dimsum Compliance Task\nexport const DSDataTableSlots = DATA_TABLE_SLOTS;\nexport const DSDataTableDataTestIds = DATA_TABLE_DATA_TESTID;\n"],
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AACxC,SAAS,yBAAyB;AAE3B,MAAM,kBAAkB;AAGxB,MAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,cAAc;AAAA,EACd,SAAS;AAAA,EACT,SAAS;AAAA,EACT,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,wBAAwB,kBAAkB;AAAA;AAAA,EAE1C,uBAAuB;AACzB;AAGO,MAAM,mBAAmB;AACzB,MAAM,yBAAyB;",
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { slotObjectToDataTestIds } from '@elliemae/ds-system';\nimport { legacyDataTestIds } from './legacyToBeDeprecated.js';\n\nexport const DSDataTableName = 'DSDatatable';\n\n// we are naming this with the ${component_name}_slots convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const DATA_TABLE_SLOTS = {\n ROOT: 'root',\n CONTENT_WRAPPER: 'content-wrapper',\n TABLE_WRAPPER: 'table-wrapper',\n PAGINATION_WRAPPER: 'pagination-wrapper',\n TABLE_CONTENT_WRAPPER: 'table-content-wrapper',\n VIRTUAL_LIST_WRAPPER: 'virtual-list-wrapper',\n HEAD_WRAPPER: 'head-wrapper',\n HEAD_TR: 'head-tr',\n HEAD_TH: 'head-th',\n HEAD_RIGHT_ICONS_WRAPPER: 'head-right-icons-wrapper',\n HEADER_CELL_WRAPPER: 'header-cell-wrapper',\n EMPTY_HEADER: 'empty-header',\n RESIZER: 'resizer',\n ACTION_CELL: 'action-cell',\n EXPAND_CELL_CONTAINER: 'expand-cell-container',\n GLOBAL_CHECKBOX_CONTAINER: 'global-checkbox-container',\n SINGLE_CELL_CONTAINER: 'single-cell-container',\n DRAG_AND_DROP_GRIPPER: 'drag-and-drop-gripper',\n TEXT_EDITABLE_CELL_INPUT: 'text-editable-cell-input',\n FILTER_POPOVER_BUTTON: 'filter-popover-button',\n FILTER_POPOVER_CONTENT: 'filter-popover-content',\n DROP_INDICATOR: 'drop-indicator',\n CELL: 'cell',\n CELL_CONTENT: 'cell-content',\n PENCIL_ICON: 'pencil-icon',\n EDITABLE_CONTAINER: 'editable-container',\n FULLSIZE_GRID: 'fullsize-grid',\n ROW: 'row',\n GROUP_HEADER_CONTAINER: 'group-header-container',\n GROUP_HEADER_TITLE: 'header-title',\n CELL_CONTAINER: 'cells-container',\n TOOLBAR_WRAPPER: 'toolbar-wrapper',\n TOOLBAR_BUTTONS_WRAPPER: 'toolbar-buttons-wrapper',\n TOOLBAR_BUTTON: 'toolbar-button',\n TOOLBAR_POSITION: 'toolbar-position',\n EMPTY_STATE_WRAPPER: 'empty-state-wrapper',\n WARNING_ICON: 'warning-icon',\n EMPTY_PRIMARY_MESSAGE: 'empty-primary-message',\n EMPTY_SECONDARY_MESSAGE: 'empty-secondary-message',\n EMPTY_BUTTON: 'empty-button',\n CENTER_CONTENT_FLEX_WRAPPER: 'center-content-flex-wrapper',\n LOADER_WRAPPER: 'loader-wrapper',\n FILTER_BAR_WRAPPER: 'filter-bar-wrapper',\n FREE_TEXT_SEARCH_FILTER: 'free-text-search-filter',\n FREE_TEXT_SEARCH_WRAPPER: 'free-text-search-wrapper',\n FILTER_POPOVER: 'filter-popover',\n FILTER_BAR_MENU_BUTTON: 'filter-bar-menu-button',\n FILTER_POPOVER_FOOTER: 'filter-popover-footer',\n} as const;\n\n// we are naming this with the ${component_name}_data_testid convention to namespace & avoid errors on duplicate exports variables in aggregators\nexport const DATA_TABLE_DATA_TESTID = {\n ...slotObjectToDataTestIds(DSDataTableName, DATA_TABLE_SLOTS),\n /**\n * These data-testid were defined in src/configs/constants.tsx\n * but they were never exposed to consumers in the index.ts file.\n * We are exposing them here for backward compatibility, as they are the ones used in the component implementation.\n *\n */\n ...legacyDataTestIds,\n /**\n * As there is a mix of hardcoded data-testid and the ones auto generated by slot definitions\n * we are overriding the auto generated ones with the hardcoded values for consistency.\n */\n CONTENT_WRAPPER: legacyDataTestIds.DATA_TABLE_CONTENT_WRAPPER,\n TABLE_WRAPPER: legacyDataTestIds.DATA_TABLE_TABLE,\n CELL_CONTAINER: legacyDataTestIds.DATA_TABLE_ROW_CONTENT,\n DRAG_AND_DROP_GRIPPER: legacyDataTestIds.DATA_TABLE_DRAG_HANDLE,\n FREE_TEXT_SEARCH_FILTER: legacyDataTestIds.DATA_TABLE_FILTER_FREE_TEXT_SEARCH,\n FILTER_POPOVER_BUTTON: legacyDataTestIds.DATA_TABLE_FILTER_BUTTON,\n HEAD_TH: legacyDataTestIds.DATA_TABLE_HEADER,\n CELL: legacyDataTestIds.DATA_TABLE_CELL,\n FULLSIZE_GRID: legacyDataTestIds.DATA_TABLE_ROW,\n ROOT: legacyDataTestIds.DATA_TABLE_WRAPPER,\n VIRTUAL_LIST_WRAPPER: legacyDataTestIds.DATA_TABLE_SCROLLABLE_CONTAINER,\n GROUP_HEADER_CONTAINER: legacyDataTestIds.DATA_TABLE_ROW_GROUP_HEADER,\n FILTER_BAR_MENU_BUTTON: legacyDataTestIds.DATA_TABLE_FILTER_BAR_DD_MENU_BUTTON,\n // This one does not exist in the legacy list, but it was hardcoded in the component definition\n EXPAND_CELL_CONTAINER: 'data-table-row-expand-cell',\n};\n\n// Legacy exports before Dimsum Compliance Task\nexport const DSDataTableSlots = DATA_TABLE_SLOTS;\nexport const DSDataTableDataTestIds = DATA_TABLE_DATA_TESTID;\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,+BAA+B;AACxC,SAAS,yBAAyB;AAE3B,MAAM,kBAAkB;AAGxB,MAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,iBAAiB;AAAA,EACjB,eAAe;AAAA,EACf,oBAAoB;AAAA,EACpB,uBAAuB;AAAA,EACvB,sBAAsB;AAAA,EACtB,cAAc;AAAA,EACd,SAAS;AAAA,EACT,SAAS;AAAA,EACT,0BAA0B;AAAA,EAC1B,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,SAAS;AAAA,EACT,aAAa;AAAA,EACb,uBAAuB;AAAA,EACvB,2BAA2B;AAAA,EAC3B,uBAAuB;AAAA,EACvB,uBAAuB;AAAA,EACvB,0BAA0B;AAAA,EAC1B,uBAAuB;AAAA,EACvB,wBAAwB;AAAA,EACxB,gBAAgB;AAAA,EAChB,MAAM;AAAA,EACN,cAAc;AAAA,EACd,aAAa;AAAA,EACb,oBAAoB;AAAA,EACpB,eAAe;AAAA,EACf,KAAK;AAAA,EACL,wBAAwB;AAAA,EACxB,oBAAoB;AAAA,EACpB,gBAAgB;AAAA,EAChB,iBAAiB;AAAA,EACjB,yBAAyB;AAAA,EACzB,gBAAgB;AAAA,EAChB,kBAAkB;AAAA,EAClB,qBAAqB;AAAA,EACrB,cAAc;AAAA,EACd,uBAAuB;AAAA,EACvB,yBAAyB;AAAA,EACzB,cAAc;AAAA,EACd,6BAA6B;AAAA,EAC7B,gBAAgB;AAAA,EAChB,oBAAoB;AAAA,EACpB,yBAAyB;AAAA,EACzB,0BAA0B;AAAA,EAC1B,gBAAgB;AAAA,EAChB,wBAAwB;AAAA,EACxB,uBAAuB;AACzB;AAGO,MAAM,yBAAyB;AAAA,EACpC,GAAG,wBAAwB,iBAAiB,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO5D,GAAG;AAAA;AAAA;AAAA;AAAA;AAAA,EAKH,iBAAiB,kBAAkB;AAAA,EACnC,eAAe,kBAAkB;AAAA,EACjC,gBAAgB,kBAAkB;AAAA,EAClC,uBAAuB,kBAAkB;AAAA,EACzC,yBAAyB,kBAAkB;AAAA,EAC3C,uBAAuB,kBAAkB;AAAA,EACzC,SAAS,kBAAkB;AAAA,EAC3B,MAAM,kBAAkB;AAAA,EACxB,eAAe,kBAAkB;AAAA,EACjC,MAAM,kBAAkB;AAAA,EACxB,sBAAsB,kBAAkB;AAAA,EACxC,wBAAwB,kBAAkB;AAAA,EAC1C,wBAAwB,kBAAkB;AAAA;AAAA,EAE1C,uBAAuB;AACzB;AAGO,MAAM,mBAAmB;AACzB,MAAM,yBAAyB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -43,7 +43,8 @@ const PillsFromDataTableFilters = ({
|
|
|
43
43
|
return refs;
|
|
44
44
|
}, [filters.length]);
|
|
45
45
|
return /* @__PURE__ */ jsx(Fragment, { children: filters.map(({ id: column, type, value }, index) => {
|
|
46
|
-
const
|
|
46
|
+
const matchedColumn = columns.find((col) => col.accessor === column);
|
|
47
|
+
const columnHeader = matchedColumn?.pillLabel || matchedColumn?.Header;
|
|
47
48
|
let Component = () => null;
|
|
48
49
|
const filterType = type;
|
|
49
50
|
if (customPillRenderers?.[column]) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/FilterBar/PillsFromDataTableFilters.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport React, { useMemo } from 'react';\nimport {\n DateRangePill,\n DateSwitcherPill,\n FreeTextSearchPillPill,\n MultiSelectPill,\n NumberRangePill,\n SelectPill,\n SingleDatePill,\n} from '../../parts/FilterBar/components/index.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { FILTER_TYPES } from '../FilterTypes.js';\n\nconst pillRenderMapper = {\n [FILTER_TYPES.SELECT]: SelectPill,\n [FILTER_TYPES.SELECT_V2]: SelectPill,\n [FILTER_TYPES.MULTI_SELECT]: MultiSelectPill,\n [FILTER_TYPES.MULTI_SELECT_V2]: MultiSelectPill,\n [FILTER_TYPES.SINGLE_DATE]: SingleDatePill,\n [FILTER_TYPES.SINGLE_DATE_V2]: SingleDatePill,\n [FILTER_TYPES.DATE_RANGE]: DateRangePill,\n [FILTER_TYPES.DATE_RANGE_V2]: DateRangePill,\n [FILTER_TYPES.DATE_SWITCHER]: DateSwitcherPill,\n [FILTER_TYPES.DATE_SWITCHER_V2]: DateSwitcherPill,\n [FILTER_TYPES.NUMBER_RANGE]: NumberRangePill,\n [FILTER_TYPES.NUMBER_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.FREE_TEXT_SEARCH]: FreeTextSearchPillPill,\n [FILTER_TYPES.FREE_TEXT_SEARCH_V2]: FreeTextSearchPillPill,\n} as const;\n\ninterface PillsFromDataTableFiltersProps {\n filters: DSDataTableT.Filter[];\n columns: DSDataTableT.Column[];\n onFiltersChange: (filters: DSDataTableT.Filter[]) => void;\n onPillRemove?: (remove: () => void) => void;\n customPillRenderers?: Record<string, React.ComponentType<DSDataTableT.FilterPillProps<unknown>>>;\n customPillRenderer?: React.ComponentType<DSDataTableT.FilterPillProps<unknown>>;\n}\n\nexport const PillsFromDataTableFilters: React.FC<PillsFromDataTableFiltersProps> = ({\n filters,\n columns,\n\n onFiltersChange,\n onPillRemove,\n customPillRenderers,\n customPillRenderer,\n}) => {\n const pillRefs = useMemo(() => {\n const refs: React.RefObject<HTMLElement>[] = [];\n for (let i = 0; i < filters.length; i += 1) refs.push(React.createRef());\n return refs;\n }, [filters.length]);\n return (\n <>\n {filters.map(({ id: column, type, value }, index) => {\n const
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACyDnB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport React, { useMemo } from 'react';\nimport {\n DateRangePill,\n DateSwitcherPill,\n FreeTextSearchPillPill,\n MultiSelectPill,\n NumberRangePill,\n SelectPill,\n SingleDatePill,\n} from '../../parts/FilterBar/components/index.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { FILTER_TYPES } from '../FilterTypes.js';\n\nconst pillRenderMapper = {\n [FILTER_TYPES.SELECT]: SelectPill,\n [FILTER_TYPES.SELECT_V2]: SelectPill,\n [FILTER_TYPES.MULTI_SELECT]: MultiSelectPill,\n [FILTER_TYPES.MULTI_SELECT_V2]: MultiSelectPill,\n [FILTER_TYPES.SINGLE_DATE]: SingleDatePill,\n [FILTER_TYPES.SINGLE_DATE_V2]: SingleDatePill,\n [FILTER_TYPES.DATE_RANGE]: DateRangePill,\n [FILTER_TYPES.DATE_RANGE_V2]: DateRangePill,\n [FILTER_TYPES.DATE_SWITCHER]: DateSwitcherPill,\n [FILTER_TYPES.DATE_SWITCHER_V2]: DateSwitcherPill,\n [FILTER_TYPES.NUMBER_RANGE]: NumberRangePill,\n [FILTER_TYPES.NUMBER_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.FREE_TEXT_SEARCH]: FreeTextSearchPillPill,\n [FILTER_TYPES.FREE_TEXT_SEARCH_V2]: FreeTextSearchPillPill,\n} as const;\n\ninterface PillsFromDataTableFiltersProps {\n filters: DSDataTableT.Filter[];\n columns: DSDataTableT.Column[];\n onFiltersChange: (filters: DSDataTableT.Filter[]) => void;\n onPillRemove?: (remove: () => void) => void;\n customPillRenderers?: Record<string, React.ComponentType<DSDataTableT.FilterPillProps<unknown>>>;\n customPillRenderer?: React.ComponentType<DSDataTableT.FilterPillProps<unknown>>;\n}\n\nexport const PillsFromDataTableFilters: React.FC<PillsFromDataTableFiltersProps> = ({\n filters,\n columns,\n\n onFiltersChange,\n onPillRemove,\n customPillRenderers,\n customPillRenderer,\n}) => {\n const pillRefs = useMemo(() => {\n const refs: React.RefObject<HTMLElement>[] = [];\n for (let i = 0; i < filters.length; i += 1) refs.push(React.createRef());\n return refs;\n }, [filters.length]);\n return (\n <>\n {filters.map(({ id: column, type, value }, index) => {\n const matchedColumn = columns.find((col) => col.accessor === column);\n const columnHeader = matchedColumn?.pillLabel || matchedColumn?.Header;\n let Component:\n | TypescriptHelpersT.ObjectValues<typeof pillRenderMapper>\n | React.ComponentType<DSDataTableT.FilterPillProps<unknown>> = () => null;\n\n const filterType = type;\n if (customPillRenderers?.[column]) {\n Component = customPillRenderers[column];\n } else if (customPillRenderer) {\n Component = customPillRenderer;\n } else if (filterType in pillRenderMapper) {\n Component = pillRenderMapper[filterType as keyof typeof pillRenderMapper];\n }\n\n return (\n <Component\n key={column}\n columnHeader={typeof columnHeader === 'string' ? columnHeader : column}\n column={column}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n value={value as any}\n filters={filters}\n onFiltersChange={onFiltersChange}\n innerRef={pillRefs[index]}\n onPillRemove={onPillRemove}\n />\n );\n })}\n </>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACyDnB,mBAkBM,WAlBN;AAxDJ,OAAOA,UAAS,eAAe;AAC/B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,oBAAoB;AAE7B,MAAM,mBAAmB;AAAA,EACvB,CAAC,aAAa,MAAM,GAAG;AAAA,EACvB,CAAC,aAAa,SAAS,GAAG;AAAA,EAC1B,CAAC,aAAa,YAAY,GAAG;AAAA,EAC7B,CAAC,aAAa,eAAe,GAAG;AAAA,EAChC,CAAC,aAAa,WAAW,GAAG;AAAA,EAC5B,CAAC,aAAa,cAAc,GAAG;AAAA,EAC/B,CAAC,aAAa,UAAU,GAAG;AAAA,EAC3B,CAAC,aAAa,aAAa,GAAG;AAAA,EAC9B,CAAC,aAAa,aAAa,GAAG;AAAA,EAC9B,CAAC,aAAa,gBAAgB,GAAG;AAAA,EACjC,CAAC,aAAa,YAAY,GAAG;AAAA,EAC7B,CAAC,aAAa,eAAe,GAAG;AAAA,EAChC,CAAC,aAAa,cAAc,GAAG;AAAA,EAC/B,CAAC,aAAa,iBAAiB,GAAG;AAAA,EAClC,CAAC,aAAa,gBAAgB,GAAG;AAAA,EACjC,CAAC,aAAa,mBAAmB,GAAG;AACtC;AAWO,MAAM,4BAAsE,CAAC;AAAA,EAClF;AAAA,EACA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,WAAW,QAAQ,MAAM;AAC7B,UAAM,OAAuC,CAAC;AAC9C,aAAS,IAAI,GAAG,IAAI,QAAQ,QAAQ,KAAK,EAAG,MAAK,KAAKA,OAAM,UAAU,CAAC;AACvE,WAAO;AAAA,EACT,GAAG,CAAC,QAAQ,MAAM,CAAC;AACnB,SACE,gCACG,kBAAQ,IAAI,CAAC,EAAE,IAAI,QAAQ,MAAM,MAAM,GAAG,UAAU;AACnD,UAAM,gBAAgB,QAAQ,KAAK,CAAC,QAAQ,IAAI,aAAa,MAAM;AACnE,UAAM,eAAe,eAAe,aAAa,eAAe;AAChE,QAAI,YAE6D,MAAM;AAEvE,UAAM,aAAa;AACnB,QAAI,sBAAsB,MAAM,GAAG;AACjC,kBAAY,oBAAoB,MAAM;AAAA,IACxC,WAAW,oBAAoB;AAC7B,kBAAY;AAAA,IACd,WAAW,cAAc,kBAAkB;AACzC,kBAAY,iBAAiB,UAA2C;AAAA,IAC1E;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QAEC,cAAc,OAAO,iBAAiB,WAAW,eAAe;AAAA,QAChE;AAAA,QAEA;AAAA,QACA;AAAA,QACA;AAAA,QACA,UAAU,SAAS,KAAK;AAAA,QACxB;AAAA;AAAA,MARK;AAAA,IASP;AAAA,EAEJ,CAAC,GACH;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -4,12 +4,11 @@ import { DSButtonV3 } from "@elliemae/ds-button-v2";
|
|
|
4
4
|
import { useFloatingContext } from "@elliemae/ds-floating-context";
|
|
5
5
|
import { useFocusTrap } from "@elliemae/ds-hooks-focus-trap";
|
|
6
6
|
import { mergeRefs } from "@elliemae/ds-system";
|
|
7
|
-
import { useCallback,
|
|
7
|
+
import { useCallback, useRef, useState } from "react";
|
|
8
8
|
import { usePropsStore } from "../../configs/useStore/createInternalAndPropsContext.js";
|
|
9
9
|
import { DATA_TABLE_DATA_TESTID } from "../../constants/index.js";
|
|
10
10
|
import { useGetFilterHandlers } from "./useGetFilterHandlers.js";
|
|
11
11
|
import { useGetFilterVisibility } from "./useGetFilterVisibility.js";
|
|
12
|
-
import { useOnClickOutside } from "./useOnClickOutside.js";
|
|
13
12
|
import { FilterButton, PopperContent, StyledDSDialogFooter, StyledFloatingWrapper } from "./styled.js";
|
|
14
13
|
const FilterPopoverV2 = (props) => {
|
|
15
14
|
const {
|
|
@@ -26,6 +25,7 @@ const FilterPopoverV2 = (props) => {
|
|
|
26
25
|
onFilterReset
|
|
27
26
|
} = props;
|
|
28
27
|
const getOwnerProps = usePropsStore((store) => store.get);
|
|
28
|
+
const virtualListRef = usePropsStore((state) => state.virtualListRef);
|
|
29
29
|
const getOwnerPropsArguments = useCallback(
|
|
30
30
|
() => ({
|
|
31
31
|
columnId: column.id
|
|
@@ -45,20 +45,26 @@ const FilterPopoverV2 = (props) => {
|
|
|
45
45
|
context
|
|
46
46
|
} = useFloatingContext({
|
|
47
47
|
externallyControlledIsOpen: isMenuOpen,
|
|
48
|
+
externalReferenceElement: columnReference,
|
|
48
49
|
placement: "bottom-end",
|
|
49
50
|
withoutAnimation: true,
|
|
50
|
-
customOffset: [0, 0]
|
|
51
|
+
customOffset: [0, 0],
|
|
52
|
+
onClickOutside: handleClickOutsideMenu,
|
|
53
|
+
/**
|
|
54
|
+
* PUI-17187: same fix as FilterPopover/index.tsx (V1) — see the full rationale there,
|
|
55
|
+
* including why `withoutPortal: true` was tried and rejected (breaks any filter whose
|
|
56
|
+
* content is larger than the table, e.g. DateRangeFilter's calendar, because withoutPortal
|
|
57
|
+
* makes the popover a literal DOM descendant of the table's overflow:auto container, which
|
|
58
|
+
* unconditionally CSS-clips oversized content — position math cannot override that).
|
|
59
|
+
* boundaryElement keeps the portal and only changes the clipping math, with a per-axis
|
|
60
|
+
* fallback to the viewport when the content doesn't fit the boundary.
|
|
61
|
+
*/
|
|
62
|
+
boundaryElement: virtualListRef.current
|
|
51
63
|
});
|
|
52
|
-
useOnClickOutside(isMenuOpen ? refs.floating : null, handleClickOutsideMenu);
|
|
53
64
|
const handleOnKeyDown = useFocusTrap({
|
|
54
65
|
firstElementRef,
|
|
55
66
|
lastElementRef
|
|
56
67
|
});
|
|
57
|
-
useEffect(() => {
|
|
58
|
-
if (columnReference) {
|
|
59
|
-
refs.setReference(columnReference);
|
|
60
|
-
}
|
|
61
|
-
}, [columnReference, refs]);
|
|
62
68
|
return (
|
|
63
69
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
64
70
|
/* @__PURE__ */ jsxs(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/FilterPopover/FilterPopoverV2.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSButtonV3 } from '@elliemae/ds-button-v2';\n\nimport { useFloatingContext } from '@elliemae/ds-floating-context';\nimport { useFocusTrap } from '@elliemae/ds-hooks-focus-trap';\n\nimport { mergeRefs } from '@elliemae/ds-system';\nimport React, { useCallback,
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DSButtonV3 } from '@elliemae/ds-button-v2';\n\nimport { useFloatingContext } from '@elliemae/ds-floating-context';\nimport { useFocusTrap } from '@elliemae/ds-hooks-focus-trap';\n\nimport { mergeRefs } from '@elliemae/ds-system';\nimport React, { useCallback, useRef, useState } from 'react';\n\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport { DATA_TABLE_DATA_TESTID } from '../../constants/index.js';\nimport type { FilterPopoverV2Props } from './types.js';\nimport { useGetFilterHandlers } from './useGetFilterHandlers.js';\nimport { useGetFilterVisibility } from './useGetFilterVisibility.js';\nimport { FilterButton, PopperContent, StyledDSDialogFooter, StyledFloatingWrapper } from './styled.js';\n\nexport const FilterPopoverV2: React.ComponentType<FilterPopoverV2Props> = (props: FilterPopoverV2Props) => {\n const {\n column,\n customStyles,\n reduxHeader,\n menuContent,\n ariaLabel,\n triggerIcon,\n innerRef,\n columnReference,\n firstElementRef,\n onFilterSubmit,\n onFilterReset,\n } = props;\n\n const getOwnerProps = usePropsStore((store) => store.get);\n const virtualListRef = usePropsStore((state) => state.virtualListRef);\n\n const getOwnerPropsArguments = useCallback(\n () => ({\n columnId: column.id,\n }),\n [column.id],\n );\n\n const [buttonReference, setButtonReference] = useState<HTMLButtonElement | null>(null);\n\n const [isButtonFocused, setIsButtonFocused] = useState(false);\n const { isIconVisible, isMenuOpen } = useGetFilterVisibility(reduxHeader);\n\n const { handleTriggerClick, handleClickOutsideMenu, handleMenuOnKeyDown, handleTriggerOnFocus, handleTriggerOnBlur } =\n useGetFilterHandlers(props, isMenuOpen, buttonReference, setIsButtonFocused);\n\n const lastElementRef = useRef<HTMLButtonElement>(null);\n const boundaryRef = useRef<HTMLDivElement | null>(null);\n\n const {\n floatingStyles,\n isOpen: isFloatingOpen,\n refs,\n context,\n } = useFloatingContext({\n externallyControlledIsOpen: isMenuOpen,\n externalReferenceElement: columnReference,\n placement: 'bottom-end',\n withoutAnimation: true,\n customOffset: [0, 0],\n onClickOutside: handleClickOutsideMenu,\n /**\n * PUI-17187: same fix as FilterPopover/index.tsx (V1) \u2014 see the full rationale there,\n * including why `withoutPortal: true` was tried and rejected (breaks any filter whose\n * content is larger than the table, e.g. DateRangeFilter's calendar, because withoutPortal\n * makes the popover a literal DOM descendant of the table's overflow:auto container, which\n * unconditionally CSS-clips oversized content \u2014 position math cannot override that).\n * boundaryElement keeps the portal and only changes the clipping math, with a per-axis\n * fallback to the viewport when the content doesn't fit the boundary.\n */\n boundaryElement: virtualListRef.current,\n });\n const handleOnKeyDown = useFocusTrap({\n firstElementRef,\n lastElementRef,\n });\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div\n // This is here to prevent propagation, and not trigger the sort functionality\n onClick={(e) => e.stopPropagation()}\n onKeyDown={handleMenuOnKeyDown}\n >\n <FilterButton\n hide={!isIconVisible}\n data-testid={DATA_TABLE_DATA_TESTID.FILTER_POPOVER_BUTTON}\n getOwnerProps={getOwnerProps}\n >\n <DSButtonV3\n buttonType=\"icon\"\n size=\"s\"\n onClick={handleTriggerClick}\n onKeyDown={handleMenuOnKeyDown}\n onFocus={handleTriggerOnFocus}\n onBlur={handleTriggerOnBlur}\n innerRef={mergeRefs(isIconVisible && setButtonReference, innerRef)}\n tabIndex={reduxHeader?.withTabStops ? 0 : -1}\n aria-label={ariaLabel}\n aria-hidden={!isButtonFocused}\n data-testid={DATA_TABLE_DATA_TESTID.DATA_TABLE_FILTER_BUTTON_ELEMENT}\n >\n {triggerIcon}\n </DSButtonV3>\n </FilterButton>\n {refs.reference && (\n <StyledFloatingWrapper\n innerRef={refs.setFloating}\n isOpen={isFloatingOpen}\n floatingStyles={{\n ...floatingStyles,\n ...customStyles,\n minWidth: 'min-content',\n }}\n context={context}\n data-testid={DATA_TABLE_DATA_TESTID.DATA_TABLE_FILTER_MENU_CONTENT}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n aria-label={`Filter by ${column.Header as string}`}\n role=\"dialog\"\n >\n <PopperContent getOwnerProps={getOwnerProps} onKeyDown={handleOnKeyDown} innerRef={boundaryRef}>\n <form onSubmit={onFilterSubmit}>\n {menuContent}\n <StyledDSDialogFooter>\n <DSButtonV3 onClick={onFilterReset} buttonType=\"outline\" size=\"s\">\n Reset\n </DSButtonV3>\n <DSButtonV3 type=\"submit\" innerRef={lastElementRef} size=\"s\">\n Apply\n </DSButtonV3>\n </StyledDSDialogFooter>\n </form>\n </PopperContent>\n </StyledFloatingWrapper>\n )}\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC2Ff,cAmCM,YAnCN;AA3FR,SAAS,kBAAkB;AAE3B,SAAS,0BAA0B;AACnC,SAAS,oBAAoB;AAE7B,SAAS,iBAAiB;AAC1B,SAAgB,aAAa,QAAQ,gBAAgB;AAErD,SAAS,qBAA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} from "../../configs/constants.js";
|
|
|
9
9
|
import { usePropsStore } from "../../configs/useStore/createInternalAndPropsContext.js";
|
|
10
10
|
import { useGetFilterHandlers } from "./useGetFilterHandlers.js";
|
|
11
11
|
import { useGetFilterVisibility } from "./useGetFilterVisibility.js";
|
|
12
|
-
import { useOnClickOutside } from "./useOnClickOutside.js";
|
|
13
12
|
import { FilterButton, PopperContent, StyledFloatingWrapper } from "./styled.js";
|
|
14
13
|
const FilterPopover = (props) => {
|
|
15
14
|
const {
|
|
@@ -26,6 +25,7 @@ const FilterPopover = (props) => {
|
|
|
26
25
|
} = props;
|
|
27
26
|
const filters = usePropsStore((state) => state.filters);
|
|
28
27
|
const getOwnerProps = usePropsStore((store) => store.get);
|
|
28
|
+
const virtualListRef = usePropsStore((state) => state.virtualListRef);
|
|
29
29
|
const getOwnerPropsArguments = useCallback(
|
|
30
30
|
() => ({
|
|
31
31
|
columnId: column.id
|
|
@@ -37,6 +37,7 @@ const FilterPopover = (props) => {
|
|
|
37
37
|
const [isButtonFocused, setIsButtonFocused] = useState(false);
|
|
38
38
|
const { handleTriggerClick, handleClickOutsideMenu, handleMenuOnKeyDown, handleTriggerOnFocus, handleTriggerOnBlur } = useGetFilterHandlers(props, isMenuOpen, buttonReference, setIsButtonFocused);
|
|
39
39
|
const floatingOffset = useMemo(() => columnReference ? [0, 1] : [5, 4], [columnReference]);
|
|
40
|
+
const externalReferenceElement = columnReference || buttonReference;
|
|
40
41
|
const {
|
|
41
42
|
refs,
|
|
42
43
|
floatingStyles,
|
|
@@ -45,19 +46,42 @@ const FilterPopover = (props) => {
|
|
|
45
46
|
forceUpdatePosition
|
|
46
47
|
} = useFloatingContext({
|
|
47
48
|
externallyControlledIsOpen: isMenuOpen,
|
|
49
|
+
externalReferenceElement,
|
|
48
50
|
placement: "bottom-end",
|
|
49
51
|
customOffset: floatingOffset,
|
|
50
52
|
withoutAnimation: true,
|
|
51
|
-
placementOrderPreference: ["bottom-end", "top-end"]
|
|
53
|
+
placementOrderPreference: ["bottom-end", "top-end"],
|
|
54
|
+
onClickOutside: handleClickOutsideMenu,
|
|
55
|
+
/**
|
|
56
|
+
* PUI-17187: the filter trigger lives inside DataTable's own horizontally-scrollable
|
|
57
|
+
* container (virtualListRef, overflow: auto). Without a boundary, computePosition only
|
|
58
|
+
* clips against the browser viewport, so once the column scrolls near the table's own edge
|
|
59
|
+
* the popover keeps tracking the trigger's raw (partially clipped) screen position and
|
|
60
|
+
* spills past the table's visible bounds, into the rest of the page.
|
|
61
|
+
*
|
|
62
|
+
* Why not `withoutPortal: true` instead (it also derives a clipping boundary — see
|
|
63
|
+
* getClippingParent — which would resolve to this same scroll container automatically, no
|
|
64
|
+
* explicit boundaryElement needed): withoutPortal renders the popover as a literal DOM
|
|
65
|
+
* descendant of that overflow:auto container instead of portaling it to <body>. The browser
|
|
66
|
+
* then clips ANY content exceeding the container's bounds unconditionally — CSS overflow
|
|
67
|
+
* clipping is not something position math can override. That breaks any filter whose content
|
|
68
|
+
* is taller/wider than the table itself: confirmed regression via this exact change during
|
|
69
|
+
* development — DateRangeFilter's dual-calendar popover (in a 300px-tall table) got its
|
|
70
|
+
* inputs pushed outside the actual browser viewport entirely, failing the existing
|
|
71
|
+
* `DSDataTable - FilterPopover focus trap` Playwright CT tests (clicks on
|
|
72
|
+
* ds-controlled-date-time-picker-month-input timed out as "outside of the viewport").
|
|
73
|
+
*
|
|
74
|
+
* boundaryElement keeps the portal (so oversized content still escapes fully into the page,
|
|
75
|
+
* unclipped, exactly as before) and only changes computePosition's clipping *math*, with a
|
|
76
|
+
* per-axis fallback to the plain viewport when the floating content doesn't fit the boundary
|
|
77
|
+
* on that axis (see getBoundaryConstrainedRect) — small popovers (this one) get clamped to
|
|
78
|
+
* the table; oversized ones (DateRangeFilter's calendar) are unaffected.
|
|
79
|
+
*/
|
|
80
|
+
boundaryElement: virtualListRef.current
|
|
52
81
|
});
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
const ref = columnReference || buttonReference;
|
|
55
|
-
if (ref) refs.setReference(ref);
|
|
56
|
-
}, [columnReference, buttonReference, refs]);
|
|
57
82
|
useEffect(() => {
|
|
58
83
|
void forceUpdatePosition();
|
|
59
84
|
}, [filters, forceUpdatePosition]);
|
|
60
|
-
useOnClickOutside(isMenuOpen ? refs.floating : null, handleClickOutsideMenu);
|
|
61
85
|
const popoverContentRef = useRef(null);
|
|
62
86
|
const handleOnKeyDown = useFocusTrap({
|
|
63
87
|
firstElementRef,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/exported-related/FilterPopover/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable import/no-cycle */\n/* eslint-disable no-void */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { useFocusTrap } from '@elliemae/ds-hooks-focus-trap';\nimport { useFloatingContext } from '@elliemae/ds-floating-context';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport type { FilterPopoverProps } from './types.js';\nimport { useGetFilterHandlers } from './useGetFilterHandlers.js';\nimport { useGetFilterVisibility } from './useGetFilterVisibility.js';\nimport {
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable import/no-cycle */\n/* eslint-disable no-void */\n/* eslint-disable jsx-a11y/no-static-element-interactions */\nimport { DSButtonV2 } from '@elliemae/ds-button-v2';\nimport { useFocusTrap } from '@elliemae/ds-hooks-focus-trap';\nimport { useFloatingContext } from '@elliemae/ds-floating-context';\nimport { mergeRefs } from '@elliemae/ds-system';\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport type { FilterPopoverProps } from './types.js';\nimport { useGetFilterHandlers } from './useGetFilterHandlers.js';\nimport { useGetFilterVisibility } from './useGetFilterVisibility.js';\nimport { FilterButton, PopperContent, StyledFloatingWrapper } from './styled.js';\n\nexport const FilterPopover: React.ComponentType<FilterPopoverProps> = (props: FilterPopoverProps) => {\n const {\n column,\n customStyles,\n reduxHeader,\n menuContent,\n ariaLabel,\n triggerIcon,\n innerRef,\n columnReference,\n firstElementRef,\n lastElementRef,\n } = props;\n\n const filters = usePropsStore((state) => state.filters);\n const getOwnerProps = usePropsStore((store) => store.get);\n const virtualListRef = usePropsStore((state) => state.virtualListRef);\n\n const getOwnerPropsArguments = useCallback(\n () => ({\n columnId: column.id,\n }),\n [column.id],\n );\n\n const { isIconVisible, isMenuOpen } = useGetFilterVisibility(reduxHeader);\n\n const [buttonReference, setButtonReference] = useState<HTMLButtonElement | null>(null);\n const [isButtonFocused, setIsButtonFocused] = useState(false);\n\n const { handleTriggerClick, handleClickOutsideMenu, handleMenuOnKeyDown, handleTriggerOnFocus, handleTriggerOnBlur } =\n useGetFilterHandlers(props, isMenuOpen, buttonReference, setIsButtonFocused);\n\n const floatingOffset = useMemo<[number, number]>(() => (columnReference ? [0, 1] : [5, 4]), [columnReference]);\n\n const externalReferenceElement = columnReference || buttonReference;\n\n const {\n refs,\n floatingStyles,\n context,\n isOpen: isFloatingOpen,\n forceUpdatePosition,\n } = useFloatingContext({\n externallyControlledIsOpen: isMenuOpen,\n externalReferenceElement,\n placement: 'bottom-end',\n customOffset: floatingOffset,\n withoutAnimation: true,\n placementOrderPreference: ['bottom-end', 'top-end'],\n onClickOutside: handleClickOutsideMenu,\n /**\n * PUI-17187: the filter trigger lives inside DataTable's own horizontally-scrollable\n * container (virtualListRef, overflow: auto). Without a boundary, computePosition only\n * clips against the browser viewport, so once the column scrolls near the table's own edge\n * the popover keeps tracking the trigger's raw (partially clipped) screen position and\n * spills past the table's visible bounds, into the rest of the page.\n *\n * Why not `withoutPortal: true` instead (it also derives a clipping boundary \u2014 see\n * getClippingParent \u2014 which would resolve to this same scroll container automatically, no\n * explicit boundaryElement needed): withoutPortal renders the popover as a literal DOM\n * descendant of that overflow:auto container instead of portaling it to <body>. The browser\n * then clips ANY content exceeding the container's bounds unconditionally \u2014 CSS overflow\n * clipping is not something position math can override. That breaks any filter whose content\n * is taller/wider than the table itself: confirmed regression via this exact change during\n * development \u2014 DateRangeFilter's dual-calendar popover (in a 300px-tall table) got its\n * inputs pushed outside the actual browser viewport entirely, failing the existing\n * `DSDataTable - FilterPopover focus trap` Playwright CT tests (clicks on\n * ds-controlled-date-time-picker-month-input timed out as \"outside of the viewport\").\n *\n * boundaryElement keeps the portal (so oversized content still escapes fully into the page,\n * unclipped, exactly as before) and only changes computePosition's clipping *math*, with a\n * per-axis fallback to the plain viewport when the floating content doesn't fit the boundary\n * on that axis (see getBoundaryConstrainedRect) \u2014 small popovers (this one) get clamped to\n * the table; oversized ones (DateRangeFilter's calendar) are unaffected.\n */\n boundaryElement: virtualListRef.current,\n });\n\n // When the filter bar changes height, re-compute the floating position\n useEffect(() => {\n void forceUpdatePosition();\n }, [filters, forceUpdatePosition]);\n\n const popoverContentRef = useRef<HTMLDivElement>(null);\n const handleOnKeyDown = useFocusTrap({\n firstElementRef,\n lastElementRef,\n });\n\n return (\n <div\n // This is here to prevent propagation, and not trigger the sort functionality\n onClick={(e) => e.stopPropagation()}\n onKeyDown={handleMenuOnKeyDown}\n >\n <FilterButton\n hide={!isIconVisible}\n data-testid={DATA_TESTID.DATA_TABLE_FILTER_BUTTON}\n getOwnerProps={getOwnerProps}\n >\n <DSButtonV2\n buttonType=\"icon\"\n size=\"s\"\n onClick={handleTriggerClick}\n onFocus={handleTriggerOnFocus}\n onBlur={handleTriggerOnBlur}\n innerRef={mergeRefs(isIconVisible && setButtonReference, innerRef)}\n tabIndex={reduxHeader?.withTabStops ? 0 : -1}\n aria-label={ariaLabel}\n aria-hidden={!isButtonFocused}\n data-testid={DATA_TESTID.DATA_TABLE_FILTER_BUTTON_ELEMENT}\n >\n {triggerIcon}\n </DSButtonV2>\n </FilterButton>\n {(columnReference || buttonReference) && (\n <StyledFloatingWrapper\n innerRef={refs.setFloating}\n isOpen={isFloatingOpen}\n floatingStyles={{\n ...floatingStyles,\n ...customStyles,\n minWidth: column.ref?.current?.offsetWidth ?? '0px',\n }}\n context={context}\n data-testid={DATA_TESTID.DATA_TABLE_FILTER_MENU_CONTENT}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n role=\"dialog\"\n aria-label={`Filter by ${column.Header as string}`}\n >\n <PopperContent getOwnerProps={getOwnerProps} innerRef={popoverContentRef} onKeyDown={handleOnKeyDown}>\n {menuContent}\n </PopperContent>\n </StyledFloatingWrapper>\n )}\n </div>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC0GnB,SAUI,KAVJ;AAvGJ,SAAS,kBAAkB;AAC3B,SAAS,oBAAoB;AAC7B,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAC1B,SAAgB,aAAa,WAAW,SAAS,QAAQ,gBAAgB;AACzE,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AACvC,SAAS,cAAc,eAAe,6BAA6B;AAE5D,MAAM,gBAAyD,CAAC,UAA8B;AACnG,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,IAAI;AAEJ,QAAM,UAAU,cAAc,CAAC,UAAU,MAAM,OAAO;AACtD,QAAM,gBAAgB,cAAc,CAAC,UAAU,MAAM,GAAG;AACxD,QAAM,iBAAiB,cAAc,CAAC,UAAU,MA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A,MAClC,WAAW;AAAA,MAEX;AAAA;AAAA,UAAC;AAAA;AAAA,YACC,MAAM,CAAC;AAAA,YACP,eAAa,YAAY;AAAA,YACzB;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACC,YAAW;AAAA,gBACX,MAAK;AAAA,gBACL,SAAS;AAAA,gBACT,SAAS;AAAA,gBACT,QAAQ;AAAA,gBACR,UAAU,UAAU,iBAAiB,oBAAoB,QAAQ;AAAA,gBACjE,UAAU,aAAa,eAAe,IAAI;AAAA,gBAC1C,cAAY;AAAA,gBACZ,eAAa,CAAC;AAAA,gBACd,eAAa,YAAY;AAAA,gBAExB;AAAA;AAAA,YACH;AAAA;AAAA,QACF;AAAA,SACE,mBAAmB,oBACnB;AAAA,UAAC;AAAA;AAAA,YACC,UAAU,KAAK;AAAA,YACf,QAAQ;AAAA,YACR,gBAAgB;AAAA,cACd,GAAG;AAAA,cACH,GAAG;AAAA,cACH,UAAU,OAAO,KAAK,SAAS,eAAe;AAAA,YAChD;AAAA,YACA;AAAA,YACA,eAAa,YAAY;AAAA,YACzB;AAAA,YACA;AAAA,YACA,MAAK;AAAA,YACL,cAAY,aAAa,OAAO,MAAgB;AAAA,YAEhD,8BAAC,iBAAc,eAA8B,UAAU,mBAAmB,WAAW,iBAClF,uBACH;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Grid } from "@elliemae/ds-grid";
|
|
4
|
-
import { TruncatedTooltipText } from "../../TruncatedTooltipText.js";
|
|
5
4
|
import React2, { memo, useContext, useMemo } from "react";
|
|
6
5
|
import { expandRowColumn } from "../../addons/Columns/index.js";
|
|
7
6
|
import { outOfTheBoxEditables } from "../../addons/Editables/index.js";
|
|
8
7
|
import { DATA_TESTID } from "../../configs/constants.js";
|
|
9
8
|
import { usePropsStore } from "../../configs/useStore/createInternalAndPropsContext.js";
|
|
10
9
|
import { StyledCell, StyledCellContent } from "../../styled.js";
|
|
10
|
+
import { TruncatedTooltipText } from "../../TruncatedTooltipText.js";
|
|
11
11
|
import { SortableItemContext } from "../HoC/SortableItemContext.js";
|
|
12
12
|
import { useCellStyle } from "./useCellStyle.js";
|
|
13
13
|
const PureStandardCell = memo(({ cellStyle, children, column, getOwnerProps, getOwnerPropsArguments }) => /* @__PURE__ */ jsx(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Cells/Cell.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { Grid } from '@elliemae/ds-grid';\nimport
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACqBrB,cAuEM,YAvEN;AApBF,SAAS,YAAY;AACrB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { Grid } from '@elliemae/ds-grid';\nimport React, { memo, useContext, useMemo, type PropsWithChildren } from 'react';\nimport { expandRowColumn } from '../../addons/Columns/index.js';\nimport { outOfTheBoxEditables } from '../../addons/Editables/index.js';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { StyledCell, StyledCellContent } from '../../styled.js';\nimport { TruncatedTooltipText } from '../../TruncatedTooltipText.js';\nimport { SortableItemContext } from '../HoC/SortableItemContext.js';\nimport { useCellStyle } from './useCellStyle.js';\n\nconst PureStandardCell = memo<\n PropsWithChildren<{\n cellStyle: React.CSSProperties;\n column: DSDataTableT.InternalColumn;\n getOwnerProps: DSDataTableT.GetOwnerPropsT;\n getOwnerPropsArguments: () => DSDataTableT.Cell;\n }>\n>(({ cellStyle, children, column, getOwnerProps, getOwnerPropsArguments }) => (\n <StyledCell\n column={column}\n style={cellStyle}\n role=\"cell\"\n data-testid={DATA_TESTID.DATA_TABLE_CELL}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {children}\n </StyledCell>\n));\n\ninterface CellProps {\n cell: DSDataTableT.Cell;\n column: DSDataTableT.InternalColumn;\n row: DSDataTableT.InternalRow;\n isRowSelected: boolean;\n shouldAddExpandCell: boolean;\n isDragOverlay: boolean;\n}\n\nconst Cell: React.ComponentType<CellProps> = ({\n cell,\n column,\n row,\n isRowSelected,\n shouldAddExpandCell,\n isDragOverlay,\n}) => {\n const cellRendererProps = usePropsStore((state) => state.cellRendererProps);\n const disabledRows = usePropsStore((state) => state.disabledRows);\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = React.useCallback(() => cell, [cell]);\n const isDisabledRow = disabledRows[row.uid];\n\n const { draggableProps } = useContext(SortableItemContext);\n\n const [appliedTextWrap, cellStyle] = useCellStyle(column, shouldAddExpandCell);\n\n const cellProps = useMemo(\n () => ({\n ...cellRendererProps,\n cell,\n row,\n isRowSelected,\n draggableProps,\n isDragOverlay,\n role: 'cell',\n cellStyle,\n column,\n isDisabledRow,\n }),\n [cellRendererProps, cell, row, isRowSelected, draggableProps, isDragOverlay, cellStyle, column, isDisabledRow],\n );\n\n const CellComponent = cell.render;\n\n const textValue = useMemo(\n () =>\n appliedTextWrap === 'truncate' ? (\n // @ts-expect-error - data-table typescript is broken\n <TruncatedTooltipText value={<CellComponent {...cellProps} />} />\n ) : (\n // @ts-expect-error - data-table typescript is broken\n <CellComponent {...cellProps} />\n ),\n [CellComponent, appliedTextWrap, cellProps],\n );\n const pureCellContent = useMemo(() => {\n if (shouldAddExpandCell) {\n return (\n <Grid cols={['min-content', 'auto']} alignItems=\"center\" height=\"100%\">\n {/* @ts-expect-error - data-table typescript is broken */}\n {shouldAddExpandCell && expandRowColumn.Cell && <expandRowColumn.Cell {...cellProps} />}\n {textValue}\n </Grid>\n );\n }\n return textValue;\n }, [cellProps, shouldAddExpandCell, textValue]);\n const DefaultCellContentJSX = useMemo(\n () => (\n <StyledCellContent getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {pureCellContent}\n </StyledCellContent>\n ),\n [getOwnerProps, getOwnerPropsArguments, pureCellContent],\n );\n\n const EditableContentJSX = useMemo(() => {\n if (typeof column.editable === 'string') {\n const { EditableComponent } = outOfTheBoxEditables?.[column.editable] ?? {};\n // @ts-expect-error - data-table typescript is broken\n if (EditableComponent) return <EditableComponent {...cellProps} DefaultCellRender={DefaultCellContentJSX} />;\n }\n if (typeof column.editable === 'function')\n // @ts-expect-error - data-table typescript is broken\n return column.editable({\n DefaultCellRender: DefaultCellContentJSX,\n ...cellProps,\n }) as JSX.Element;\n\n return null;\n }, [DefaultCellContentJSX, cellProps, column]);\n\n return (\n <PureStandardCell {...cellProps} getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {column.editable && !disabledRows[row.uid] ? EditableContentJSX : DefaultCellContentJSX}\n </PureStandardCell>\n );\n};\n\nexport { Cell };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACqBrB,cAuEM,YAvEN;AApBF,SAAS,YAAY;AACrB,OAAOA,UAAS,MAAM,YAAY,eAAuC;AACzE,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,SAAS,YAAY,yBAAyB;AAC9C,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AACpC,SAAS,oBAAoB;AAE7B,MAAM,mBAAmB,KAOvB,CAAC,EAAE,WAAW,UAAU,QAAQ,eAAe,uBAAuB,MACtE;AAAA,EAAC;AAAA;AAAA,IACC;AAAA,IACA,OAAO;AAAA,IACP,MAAK;AAAA,IACL,eAAa,Y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AAW;AAAA,QACpF;AAAA,SACH;AAAA,IAEJ;AACA,WAAO;AAAA,EACT,GAAG,CAAC,WAAW,qBAAqB,SAAS,CAAC;AAC9C,QAAM,wBAAwB;AAAA,IAC5B,MACE,oBAAC,qBAAkB,eAA8B,wBAC9C,2BACH;AAAA,IAEF,CAAC,eAAe,wBAAwB,eAAe;AAAA,EACzD;AAEA,QAAM,qBAAqB,QAAQ,MAAM;AACvC,QAAI,OAAO,OAAO,aAAa,UAAU;AACvC,YAAM,EAAE,kBAAkB,IAAI,uBAAuB,OAAO,QAAQ,KAAK,CAAC;AAE1E,UAAI,kBAAmB,QAAO,oBAAC,qBAAmB,GAAG,WAAW,mBAAmB,uBAAuB;AAAA,IAC5G;AACA,QAAI,OAAO,OAAO,aAAa;AAE7B,aAAO,OAAO,SAAS;AAAA,QACrB,mBAAmB;AAAA,QACnB,GAAG;AAAA,MACL,CAAC;AAEH,WAAO;AAAA,EACT,GAAG,CAAC,uBAAuB,WAAW,MAAM,CAAC;AAE7C,SACE,oBAAC,oBAAkB,GAAG,WAAW,eAA8B,wBAC5D,iBAAO,YAAY,CAAC,aAAa,IAAI,GAAG,IAAI,qBAAqB,uBACpE;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { TruncatedTooltipText } from "../../TruncatedTooltipText.js";
|
|
4
3
|
import React2, { memo, useContext, useMemo } from "react";
|
|
5
4
|
import { expandRowColumn } from "../../addons/Columns/index.js";
|
|
6
5
|
import { outOfTheBoxEditables } from "../../addons/Editables/index.js";
|
|
7
6
|
import { DATA_TESTID } from "../../configs/constants.js";
|
|
8
7
|
import { usePropsStore } from "../../configs/useStore/createInternalAndPropsContext.js";
|
|
9
8
|
import { StyledCell, StyledCellContent } from "../../styled.js";
|
|
9
|
+
import { TruncatedTooltipText } from "../../TruncatedTooltipText.js";
|
|
10
10
|
import { SortableItemContext } from "../HoC/SortableItemContext.js";
|
|
11
11
|
import { useCellStyle } from "./useCellStyle.js";
|
|
12
12
|
const PureStandardCell = memo(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/Cells/CellFactory.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACkBjB;AAjBN,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { memo, useContext, useMemo, type PropsWithChildren } from 'react';\nimport { expandRowColumn } from '../../addons/Columns/index.js';\nimport { outOfTheBoxEditables } from '../../addons/Editables/index.js';\nimport { DATA_TESTID } from '../../configs/constants.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { StyledCell, StyledCellContent } from '../../styled.js';\nimport { TruncatedTooltipText } from '../../TruncatedTooltipText.js';\nimport { SortableItemContext } from '../HoC/SortableItemContext.js';\nimport { useCellStyle } from './useCellStyle.js';\n\nconst PureStandardCell = memo<PropsWithChildren<DSDataTableT.CellProps>>(\n ({ column, cell, shouldAddExpandCell, cellIsNextToExpander, row, children }) => {\n const cellStyle = useCellStyle(column, shouldAddExpandCell, cellIsNextToExpander, row)[1];\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = React.useCallback(() => cell, [cell]);\n return (\n <StyledCell\n column={column}\n style={cellStyle}\n role=\"cell\"\n data-testid={DATA_TESTID.DATA_TABLE_CELL}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n >\n {children}\n </StyledCell>\n );\n },\n);\n\nconst TruncableCellContent = memo((props: DSDataTableT.CellProps) => {\n const { cell, column } = props;\n const { render: CellComponent } = cell;\n\n const textWrap = usePropsStore((state) => state.textWrap);\n const appliedTextWrap = column.textWrap || textWrap;\n if (appliedTextWrap === 'truncate') {\n return <TruncatedTooltipText value={<CellComponent {...props} />} />;\n }\n return <CellComponent {...props} />;\n});\n\nconst ExpandableCellContent = memo(\n (props: DSDataTableT.CellProps) => expandRowColumn.Cell && <expandRowColumn.Cell {...props} />,\n);\n\nconst DefaultCellContent = memo(\n (\n props: DSDataTableT.CellProps & {\n getOwnerProps: DSDataTableT.GetOwnerPropsT;\n getOwnerPropsArguments: () => DSDataTableT.Cell;\n },\n ) => {\n const { shouldAddExpandCell, getOwnerProps, getOwnerPropsArguments } = props;\n\n return (\n <StyledCellContent getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments}>\n {shouldAddExpandCell ? <ExpandableCellContent {...props} /> : <TruncableCellContent {...props} />}\n </StyledCellContent>\n );\n },\n);\n\nconst EditableCell = memo(\n (\n props: DSDataTableT.CellProps & {\n getOwnerProps: DSDataTableT.GetOwnerPropsT;\n getOwnerPropsArguments: () => DSDataTableT.Cell;\n },\n ) => {\n const { getOwnerProps, getOwnerPropsArguments, ...restProps } = props;\n const { column } = restProps;\n const DefaultCellContentJSX = (\n <DefaultCellContent\n {...restProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n );\n\n if (typeof column.editable === 'string') {\n const { EditableComponent } = outOfTheBoxEditables?.[column.editable] ?? {};\n // @ts-expect-error - data-table typescript is broken\n if (EditableComponent) return <EditableComponent {...restProps} DefaultCellRender={DefaultCellContentJSX} />;\n }\n if (typeof column.editable === 'function') {\n const ColumnEditableRenderProps = column.editable as React.ComponentType<\n DSDataTableT.CellProps & { DefaultCellRender: JSX.Element }\n >;\n return <ColumnEditableRenderProps {...restProps} DefaultCellRender={DefaultCellContentJSX} />;\n }\n\n return null;\n },\n);\n\ninterface CellFactoryProps {\n cell: DSDataTableT.Cell;\n column: DSDataTableT.InternalColumn;\n row: DSDataTableT.InternalRow;\n isRowSelected: boolean;\n shouldAddExpandCell: boolean;\n cellIsNextToExpander: boolean;\n isDragOverlay: boolean;\n}\n\nconst CellFactory: React.ComponentType<CellFactoryProps> = (props) => {\n const { column, row, cell } = props;\n const cellRendererProps = usePropsStore((state) => state.cellRendererProps);\n const disabledRows = usePropsStore((state) => state.disabledRows);\n const domIdAffix = usePropsStore((state) => state.domIdAffix);\n const getOwnerProps = usePropsStore((store) => store.get);\n const getOwnerPropsArguments = React.useCallback(() => cell, [cell]);\n\n const isDisabledRow = disabledRows[row.uid];\n\n const { draggableProps } = useContext(SortableItemContext);\n\n const cellProps: DSDataTableT.CellProps = useMemo(\n () => ({\n ...cellRendererProps,\n ...props,\n role: 'cell',\n draggableProps,\n isDisabledRow,\n domIdAffix,\n }),\n [cellRendererProps, props, draggableProps, isDisabledRow, domIdAffix],\n );\n\n return (\n <PureStandardCell {...cellProps}>\n {column.editable && !disabledRows[row.uid] ? (\n <EditableCell {...cellProps} getOwnerProps={getOwnerProps} getOwnerPropsArguments={getOwnerPropsArguments} />\n ) : (\n <DefaultCellContent\n {...cellProps}\n getOwnerProps={getOwnerProps}\n getOwnerPropsArguments={getOwnerPropsArguments}\n />\n )}\n </PureStandardCell>\n );\n};\n\nexport { CellFactory };\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACkBjB;AAjBN,OAAOA,UAAS,MAAM,YAAY,eAAuC;AACzE,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,mBAAmB;AAC5B,SAAS,qBAAqB;AAE9B,SAAS,YAAY,yBAAyB;AAC9C,SAAS,4BAA4B;AACrC,SAAS,2BAA2B;AACpC,SAAS,oBAAoB;AAE7B,MAAM,mBAAmB;AAAA,EACvB,CAAC,EAAE,QAAQ,MAAM,qBAAqB,sBAAsB,KAAK,SAAS,MAAM;AAC9E,UAAM,YAAY,aAAa,QAAQ,qBAAqB,sBAAsB,GAAG,EA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
|
89
89
|
getOwnerProps,
|
|
90
90
|
children: [
|
|
91
91
|
filters.map(({ id: column, type, value }, index) => {
|
|
92
|
-
const
|
|
92
|
+
const matchedColumn = visibleColumns.find((col) => col.accessor === column);
|
|
93
|
+
const columnHeader = matchedColumn?.pillLabel || matchedColumn?.Header;
|
|
93
94
|
let Component = () => null;
|
|
94
95
|
const filterType = type;
|
|
95
96
|
if (filterType in pillRenderMapper) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/parts/FilterBar/FiltersBar.tsx"],
|
|
4
|
-
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { FILTER_TYPES } from '../../exported-related/index.js';\nimport {\n SelectPill,\n MultiSelectPill,\n SingleDatePill,\n DateRangePill,\n NumberRangePill,\n DateSwitcherPill,\n FreeTextSearchPillPill,\n} from './components/index.js';\nimport { StyledWrapper } from './styled.js';\nimport { DeprecatedDropdown } from './DeprecatedDropdown.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\n\nconst pillRenderMapper = {\n [FILTER_TYPES.SELECT]: SelectPill,\n [FILTER_TYPES.SELECT_V2]: SelectPill,\n [FILTER_TYPES.MULTI_SELECT]: MultiSelectPill,\n [FILTER_TYPES.MULTI_SELECT_V2]: MultiSelectPill,\n [FILTER_TYPES.SINGLE_DATE]: SingleDatePill,\n [FILTER_TYPES.SINGLE_DATE_V2]: SingleDatePill,\n [FILTER_TYPES.DATE_RANGE]: DateRangePill,\n [FILTER_TYPES.DATE_RANGE_V2]: DateRangePill,\n [FILTER_TYPES.DATE_SWITCHER]: DateSwitcherPill,\n [FILTER_TYPES.DATE_SWITCHER_V2]: DateSwitcherPill,\n [FILTER_TYPES.NUMBER_RANGE]: NumberRangePill,\n [FILTER_TYPES.NUMBER_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.FREE_TEXT_SEARCH]: FreeTextSearchPillPill,\n [FILTER_TYPES.FREE_TEXT_SEARCH_V2]: FreeTextSearchPillPill,\n} as const;\n\nexport const FiltersBar: React.ComponentType = () => {\n const width = usePropsStore((state) => state.width);\n const filterBarProps = usePropsStore((state) => state.filterBarProps);\n const onFiltersChange = usePropsStore((state) => state.onFiltersChange);\n const filters = usePropsStore((state) => state.filters);\n const visibleColumns = usePropsStore((state) => state.visibleColumns);\n const getOwnerProps = usePropsStore((store) => store.get);\n\n const [isOpen, setIsOpen] = useState(false);\n\n const pillGroupRefs = useMemo(() => {\n const refs: React.RefObject<HTMLElement>[] = [];\n for (let i = 0; i < filters.length; i += 1) refs.push(React.createRef());\n return refs;\n }, [filters.length]);\n\n const dropdownMenuRef = useRef<HTMLButtonElement | null>(null);\n\n const {\n filterBarAddonRenderer: FilterBarAddonRenderer,\n onClearAllFiltersClick,\n onDropdownMenuToggle,\n onDropdownMenuClickOutside,\n onDropdownMenuTriggerClick,\n isDropdownMenuOpen,\n } = filterBarProps || {};\n\n const removeAllFilters = useCallback(() => {\n onFiltersChange([]);\n onClearAllFiltersClick?.();\n setIsOpen(false);\n }, [onFiltersChange, onClearAllFiltersClick]);\n\n const onFilterBarClose = useCallback(() => {\n onDropdownMenuToggle?.(false, 'onClose');\n dropdownMenuRef.current?.focus();\n setIsOpen(false);\n }, [onDropdownMenuToggle]);\n\n const onFilterBarOpen = useCallback(() => {\n onDropdownMenuToggle?.(true, 'onOpen');\n setIsOpen(true);\n }, [onDropdownMenuToggle]);\n\n const onFilterBarOnClickOutside = useCallback(() => {\n onDropdownMenuToggle?.(false, 'onClickOutside');\n onDropdownMenuClickOutside?.();\n setIsOpen(false);\n }, [onDropdownMenuClickOutside, onDropdownMenuToggle]);\n\n const onTriggerClick = useCallback(() => {\n onDropdownMenuTriggerClick?.();\n onFilterBarOpen();\n }, [onDropdownMenuTriggerClick, onFilterBarOpen]);\n\n const finalIsOpen = useMemo(() => {\n if (typeof isDropdownMenuOpen === 'boolean') return isDropdownMenuOpen;\n return isOpen;\n }, [isDropdownMenuOpen, isOpen]);\n\n return (\n <StyledWrapper\n width={width}\n /**\n * PUI-17317 - [DataTable] No announcement is made when a filter is added or removed\n * https://jira.elliemae.io/browse/PUI-17317\n *\n * ## Problem\n * Screen reader users received no feedback when filters were added or removed.\n * The attempted fix \u2014 placing `aria-live=\"polite\"` + `aria-relevant=\"additions removals\"`\n * on this wrapper \u2014 was unreliable across screen readers and, when it did fire,\n * produced meaningless announcements by concatenating the pill label with its\n * remove-button aria-label, e.g.:\n * \"React Dev Remove React Dev from Position\"\n *\n * WCAG recommends contextual messages like \"Filter applied: Currency = USD\".\n * That level of specificity cannot be achieved automatically through aria attributes alone.\n *\n * ## Decision\n * `aria-live` / `aria-relevant` were removed from this component.\n * The responsibility for announcing filter changes is delegated to the consumer,\n * who has access to the full filter state and can compose meaningful messages like:\n *\n * e.g: Multi Select Filter\n *\n * - \"Filter added: Position: React dev\"\n * - \"Filter updated: Position: React dev, Fullstack dev\"\n * - \"Filter removed: Position: React dev, Fullstack dev\"\n */\n /*\n aria-live=\"polite\"\n aria-relevant=\"additions removals\" \n */\n gutter=\"xs\"\n getOwnerProps={getOwnerProps}\n >\n {filters.map(({ id: column, type, value }, index) => {\n const
|
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACiGnB,
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { type TypescriptHelpersT } from '@elliemae/ds-typescript-helpers';\nimport { FILTER_TYPES } from '../../exported-related/index.js';\nimport {\n SelectPill,\n MultiSelectPill,\n SingleDatePill,\n DateRangePill,\n NumberRangePill,\n DateSwitcherPill,\n FreeTextSearchPillPill,\n} from './components/index.js';\nimport { StyledWrapper } from './styled.js';\nimport { DeprecatedDropdown } from './DeprecatedDropdown.js';\nimport type { DSDataTableT } from '../../react-desc-prop-types.js';\nimport { usePropsStore } from '../../configs/useStore/createInternalAndPropsContext.js';\n\nconst pillRenderMapper = {\n [FILTER_TYPES.SELECT]: SelectPill,\n [FILTER_TYPES.SELECT_V2]: SelectPill,\n [FILTER_TYPES.MULTI_SELECT]: MultiSelectPill,\n [FILTER_TYPES.MULTI_SELECT_V2]: MultiSelectPill,\n [FILTER_TYPES.SINGLE_DATE]: SingleDatePill,\n [FILTER_TYPES.SINGLE_DATE_V2]: SingleDatePill,\n [FILTER_TYPES.DATE_RANGE]: DateRangePill,\n [FILTER_TYPES.DATE_RANGE_V2]: DateRangePill,\n [FILTER_TYPES.DATE_SWITCHER]: DateSwitcherPill,\n [FILTER_TYPES.DATE_SWITCHER_V2]: DateSwitcherPill,\n [FILTER_TYPES.NUMBER_RANGE]: NumberRangePill,\n [FILTER_TYPES.NUMBER_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE]: NumberRangePill,\n [FILTER_TYPES.CURRENCY_RANGE_V2]: NumberRangePill,\n [FILTER_TYPES.FREE_TEXT_SEARCH]: FreeTextSearchPillPill,\n [FILTER_TYPES.FREE_TEXT_SEARCH_V2]: FreeTextSearchPillPill,\n} as const;\n\nexport const FiltersBar: React.ComponentType = () => {\n const width = usePropsStore((state) => state.width);\n const filterBarProps = usePropsStore((state) => state.filterBarProps);\n const onFiltersChange = usePropsStore((state) => state.onFiltersChange);\n const filters = usePropsStore((state) => state.filters);\n const visibleColumns = usePropsStore((state) => state.visibleColumns);\n const getOwnerProps = usePropsStore((store) => store.get);\n\n const [isOpen, setIsOpen] = useState(false);\n\n const pillGroupRefs = useMemo(() => {\n const refs: React.RefObject<HTMLElement>[] = [];\n for (let i = 0; i < filters.length; i += 1) refs.push(React.createRef());\n return refs;\n }, [filters.length]);\n\n const dropdownMenuRef = useRef<HTMLButtonElement | null>(null);\n\n const {\n filterBarAddonRenderer: FilterBarAddonRenderer,\n onClearAllFiltersClick,\n onDropdownMenuToggle,\n onDropdownMenuClickOutside,\n onDropdownMenuTriggerClick,\n isDropdownMenuOpen,\n } = filterBarProps || {};\n\n const removeAllFilters = useCallback(() => {\n onFiltersChange([]);\n onClearAllFiltersClick?.();\n setIsOpen(false);\n }, [onFiltersChange, onClearAllFiltersClick]);\n\n const onFilterBarClose = useCallback(() => {\n onDropdownMenuToggle?.(false, 'onClose');\n dropdownMenuRef.current?.focus();\n setIsOpen(false);\n }, [onDropdownMenuToggle]);\n\n const onFilterBarOpen = useCallback(() => {\n onDropdownMenuToggle?.(true, 'onOpen');\n setIsOpen(true);\n }, [onDropdownMenuToggle]);\n\n const onFilterBarOnClickOutside = useCallback(() => {\n onDropdownMenuToggle?.(false, 'onClickOutside');\n onDropdownMenuClickOutside?.();\n setIsOpen(false);\n }, [onDropdownMenuClickOutside, onDropdownMenuToggle]);\n\n const onTriggerClick = useCallback(() => {\n onDropdownMenuTriggerClick?.();\n onFilterBarOpen();\n }, [onDropdownMenuTriggerClick, onFilterBarOpen]);\n\n const finalIsOpen = useMemo(() => {\n if (typeof isDropdownMenuOpen === 'boolean') return isDropdownMenuOpen;\n return isOpen;\n }, [isDropdownMenuOpen, isOpen]);\n\n return (\n <StyledWrapper\n width={width}\n /**\n * PUI-17317 - [DataTable] No announcement is made when a filter is added or removed\n * https://jira.elliemae.io/browse/PUI-17317\n *\n * ## Problem\n * Screen reader users received no feedback when filters were added or removed.\n * The attempted fix \u2014 placing `aria-live=\"polite\"` + `aria-relevant=\"additions removals\"`\n * on this wrapper \u2014 was unreliable across screen readers and, when it did fire,\n * produced meaningless announcements by concatenating the pill label with its\n * remove-button aria-label, e.g.:\n * \"React Dev Remove React Dev from Position\"\n *\n * WCAG recommends contextual messages like \"Filter applied: Currency = USD\".\n * That level of specificity cannot be achieved automatically through aria attributes alone.\n *\n * ## Decision\n * `aria-live` / `aria-relevant` were removed from this component.\n * The responsibility for announcing filter changes is delegated to the consumer,\n * who has access to the full filter state and can compose meaningful messages like:\n *\n * e.g: Multi Select Filter\n *\n * - \"Filter added: Position: React dev\"\n * - \"Filter updated: Position: React dev, Fullstack dev\"\n * - \"Filter removed: Position: React dev, Fullstack dev\"\n */\n /*\n aria-live=\"polite\"\n aria-relevant=\"additions removals\" \n */\n gutter=\"xs\"\n getOwnerProps={getOwnerProps}\n >\n {filters.map(({ id: column, type, value }, index) => {\n const matchedColumn = visibleColumns.find((col) => col.accessor === column);\n const columnHeader = matchedColumn?.pillLabel || matchedColumn?.Header;\n let Component:\n | TypescriptHelpersT.ObjectValues<typeof pillRenderMapper>\n | React.ComponentType<DSDataTableT.FilterPillProps<unknown>> = () => null;\n\n const filterType = type;\n if (filterType in pillRenderMapper) {\n Component = pillRenderMapper[filterType as keyof typeof pillRenderMapper];\n } else if (filterBarProps?.customPillRenderer) {\n Component = filterBarProps.customPillRenderer;\n }\n return (\n <Component\n key={column}\n columnHeader={typeof columnHeader === 'string' ? columnHeader : column}\n column={column}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment\n value={value as any}\n filters={filters}\n onFiltersChange={onFiltersChange}\n prevRef={pillGroupRefs[index - 1]}\n innerRef={pillGroupRefs[index]}\n nextRef={pillGroupRefs[index + 1] ?? dropdownMenuRef}\n />\n );\n })}\n {FilterBarAddonRenderer ? (\n <FilterBarAddonRenderer innerRef={dropdownMenuRef} />\n ) : (\n <DeprecatedDropdown\n finalIsOpen={finalIsOpen}\n onFilterBarClose={onFilterBarClose}\n onFilterBarOnClickOutside={onFilterBarOnClickOutside}\n removeAllFilters={removeAllFilters}\n filterBarProps={filterBarProps}\n dropdownMenuRef={dropdownMenuRef}\n onTriggerClick={onTriggerClick}\n />\n )}\n </StyledWrapper>\n );\n};\n"],
|
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACiG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C;AAAA,gBAAQ,IAAI,CAAC,EAAE,IAAI,QAAQ,MAAM,MAAM,GAAG,UAAU;AACnD,gBAAM,gBAAgB,eAAe,KAAK,CAAC,QAAQ,IAAI,aAAa,MAAM;AAC1E,gBAAM,eAAe,eAAe,aAAa,eAAe;AAChE,cAAI,YAE6D,MAAM;AAEvE,gBAAM,aAAa;AACnB,cAAI,cAAc,kBAAkB;AAClC,wBAAY,iBAAiB,UAA2C;AAAA,UAC1E,WAAW,gBAAgB,oBAAoB;AAC7C,wBAAY,eAAe;AAAA,UAC7B;AACA,iBACE;AAAA,YAAC;AAAA;AAAA,cAEC,cAAc,OAAO,iBAAiB,WAAW,eAAe;AAAA,cAChE;AAAA,cAEA;AAAA,cACA;AAAA,cACA;AAAA,cACA,SAAS,cAAc,QAAQ,CAAC;AAAA,cAChC,UAAU,cAAc,KAAK;AAAA,cAC7B,SAAS,cAAc,QAAQ,CAAC,KAAK;AAAA;AAAA,YAThC;AAAA,UAUP;AAAA,QAEJ,CAAC;AAAA,QACA,yBACC,oBAAC,0BAAuB,UAAU,iBAAiB,IAEnD;AAAA,UAAC;AAAA;AAAA,YACC;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA,YACA;AAAA;AAAA,QACF;AAAA;AAAA;AAAA,EAEJ;AAEJ;",
|
|
6
6
|
"names": ["React"]
|
|
7
7
|
}
|
|
@@ -12,23 +12,9 @@ import { useHeaderCellHandlers } from "./useHeaderCellHandlers.js";
|
|
|
12
12
|
import { useHeaderCellConfig } from "./useHeaderCellConfig.js";
|
|
13
13
|
import { DATA_TESTID } from "../../configs/constants.js";
|
|
14
14
|
import { HeaderCellTitle } from "./HeaderCellTitle.js";
|
|
15
|
+
import { buildScreenReaderInstructions } from "./buildScreenReaderInstructions.js";
|
|
15
16
|
import { useInternalStore, usePropsStore } from "../../configs/useStore/createInternalAndPropsContext.js";
|
|
16
|
-
const
|
|
17
|
-
colSpan,
|
|
18
|
-
draggable,
|
|
19
|
-
filterable,
|
|
20
|
-
sortable
|
|
21
|
-
}) => {
|
|
22
|
-
const preffix = colSpan === 1 ? "" : "Column Group. ";
|
|
23
|
-
if (!draggable && !filterable && !sortable) return preffix;
|
|
24
|
-
let message = sortable ? "You can sort the data ascendingly/descendingly by this column. Use the up / down arrows keys to do so" : "";
|
|
25
|
-
if (draggable && filterable) {
|
|
26
|
-
message = `This column is draggable and filterable. To enable these interactions press the enter key. ${message}`;
|
|
27
|
-
} else if (draggable || filterable) {
|
|
28
|
-
message = `This column is ${draggable ? "draggable" : "filterable"}. To enable this interaction press the enter key. ${message}`;
|
|
29
|
-
}
|
|
30
|
-
return `${preffix}${message}`;
|
|
31
|
-
};
|
|
17
|
+
const HIDDEN_STYLE = { display: "none" };
|
|
32
18
|
const HeaderCell = (props) => {
|
|
33
19
|
const { column, isDragOverlay, colSpan } = props;
|
|
34
20
|
const disabledRows = usePropsStore((state) => state.disabledRows);
|
|
@@ -113,7 +99,7 @@ const HeaderCell = (props) => {
|
|
|
113
99
|
handleSort
|
|
114
100
|
]);
|
|
115
101
|
const DnDHandleComponent = useMemo(
|
|
116
|
-
() => /* @__PURE__ */ jsx(Grid, { mr: "2px", alignItems: "
|
|
102
|
+
() => /* @__PURE__ */ jsx(Grid, { mr: "2px", height: "fit-content", py: "2px", mt: "2px", alignItems: "flex-start", style: { position: "relative" }, children: /* @__PURE__ */ jsx(StyledFocusWithin, { hideFocus: isDragging, children: /* @__PURE__ */ jsx(
|
|
117
103
|
DragHandle,
|
|
118
104
|
{
|
|
119
105
|
innerRef: dragHandleRef,
|
|
@@ -127,7 +113,14 @@ const HeaderCell = (props) => {
|
|
|
127
113
|
[column.id, disabledRows, domIdAffix, isDragOverlay, isDragging, reduxHeader?.withTabStops]
|
|
128
114
|
);
|
|
129
115
|
const screenReaderInstructionsId = `sr-${column.id}-instructions-${domIdAffix}`.replace(/ /g, "");
|
|
130
|
-
|
|
116
|
+
const instructions = buildScreenReaderInstructions({
|
|
117
|
+
colSpan,
|
|
118
|
+
draggable: dragAndDropColumns && column.disableDnD !== true,
|
|
119
|
+
filterable: hasFilter,
|
|
120
|
+
sortable: column.canSort ?? false,
|
|
121
|
+
resizable: shouldShowResize
|
|
122
|
+
});
|
|
123
|
+
const headTh = /* @__PURE__ */ jsxs(
|
|
131
124
|
StyledHeadTh,
|
|
132
125
|
{
|
|
133
126
|
column,
|
|
@@ -151,15 +144,11 @@ const HeaderCell = (props) => {
|
|
|
151
144
|
rightIcons,
|
|
152
145
|
shouldShowResize && /* @__PURE__ */ jsx(HeaderResizer, { column, innerRef: resizeHandlerRef, isReachable: reduxHeader?.withTabStops ?? false })
|
|
153
146
|
] }),
|
|
154
|
-
/* @__PURE__ */ jsx("span", { id: screenReaderInstructionsId, style:
|
|
155
|
-
colSpan,
|
|
156
|
-
draggable: dragAndDropColumns && column.disableDnD !== true,
|
|
157
|
-
filterable: hasFilter,
|
|
158
|
-
sortable: column.canSort ?? false
|
|
159
|
-
}) })
|
|
147
|
+
/* @__PURE__ */ jsx("span", { id: screenReaderInstructionsId, style: HIDDEN_STYLE, children: instructions })
|
|
160
148
|
]
|
|
161
149
|
}
|
|
162
150
|
);
|
|
151
|
+
return headTh;
|
|
163
152
|
};
|
|
164
153
|
export {
|
|
165
154
|
HeaderCell
|