@elliemae/ds-datagrids 3.0.0-alpha.0 → 3.0.0-alpha.1
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/DataGridImpl.js +56 -23
- package/dist/cjs/DataGridImpl.js.map +1 -1
- package/dist/cjs/PaginatedDataGrid.js +56 -19
- package/dist/cjs/PaginatedDataGrid.js.map +1 -1
- package/dist/cjs/components/BodyCell.js +33 -11
- package/dist/cjs/components/BodyCell.js.map +1 -1
- package/dist/cjs/components/BodyList.js +47 -12
- package/dist/cjs/components/BodyList.js.map +1 -1
- package/dist/cjs/components/HeaderCell.js +17 -6
- package/dist/cjs/components/HeaderCell.js.map +1 -1
- package/dist/cjs/components/List.js +15 -3
- package/dist/cjs/components/List.js.map +1 -1
- package/dist/cjs/components/ListItem.js +17 -4
- package/dist/cjs/components/ListItem.js.map +1 -1
- package/dist/cjs/components/NoResults.js +33 -4
- package/dist/cjs/components/NoResults.js.map +1 -1
- package/dist/cjs/components/Table.js +27 -15
- package/dist/cjs/components/Table.js.map +1 -1
- package/dist/cjs/components/TableBody.js +52 -21
- package/dist/cjs/components/TableBody.js.map +1 -1
- package/dist/cjs/components/TableHeader.js +20 -6
- package/dist/cjs/components/TableHeader.js.map +1 -1
- package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +81 -34
- package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +1 -1
- package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js +22 -9
- package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/columnMeasurerTransformer.js +19 -3
- package/dist/cjs/plugins/column-sizing/columnMeasurerTransformer.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/ext-points/getTableProps.js +19 -3
- package/dist/cjs/plugins/column-sizing/ext-points/getTableProps.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/useColumnSizeService.js +18 -1
- package/dist/cjs/plugins/column-sizing/useColumnSizeService.js.map +1 -1
- package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +19 -2
- package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +1 -1
- package/dist/cjs/plugins/custom-cell-renderer/getRendererComponent.js +29 -6
- package/dist/cjs/plugins/custom-cell-renderer/getRendererComponent.js.map +1 -1
- package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js +19 -3
- package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js.map +1 -1
- package/dist/cjs/plugins/editable/EditableComponents/TextBox.js +21 -4
- package/dist/cjs/plugins/editable/EditableComponents/TextBox.js.map +1 -1
- package/dist/cjs/plugins/editable/decorateEditable.js +31 -5
- package/dist/cjs/plugins/editable/decorateEditable.js.map +1 -1
- package/dist/cjs/plugins/editable/getEditorComponent.js +36 -13
- package/dist/cjs/plugins/editable/getEditorComponent.js.map +1 -1
- package/dist/cjs/plugins/expandable-grid/ExpandableColumn.js +55 -16
- package/dist/cjs/plugins/expandable-grid/ExpandableColumn.js.map +1 -1
- package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js +40 -16
- package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js.map +1 -1
- package/dist/cjs/plugins/expandable-grid/ExpandedRow.js +39 -14
- package/dist/cjs/plugins/expandable-grid/ExpandedRow.js.map +1 -1
- package/dist/cjs/plugins/expandable-grid/ExpandedRowExtra.js +19 -3
- package/dist/cjs/plugins/expandable-grid/ExpandedRowExtra.js.map +1 -1
- package/dist/cjs/plugins/export-data/ExportDataPlugin.js +15 -4
- package/dist/cjs/plugins/export-data/ExportDataPlugin.js.map +1 -1
- package/dist/cjs/plugins/filterable/addFilterToColumn.js +18 -1
- package/dist/cjs/plugins/filterable/addFilterToColumn.js.map +1 -1
- package/dist/cjs/plugins/filterable/components/FilterableHeader.js +17 -4
- package/dist/cjs/plugins/filterable/components/FilterableHeader.js.map +1 -1
- package/dist/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +36 -10
- package/dist/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +1 -1
- package/dist/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +21 -6
- package/dist/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +1 -1
- package/dist/cjs/plugins/filterable/helper.js +19 -3
- package/dist/cjs/plugins/filterable/helper.js.map +1 -1
- package/dist/cjs/plugins/filterable/useFilterableState.js +22 -8
- package/dist/cjs/plugins/filterable/useFilterableState.js.map +1 -1
- package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js +41 -21
- package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js.map +1 -1
- package/dist/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +33 -4
- package/dist/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +1 -1
- package/dist/cjs/plugins/pagination/PaginationPlugin.js +57 -21
- package/dist/cjs/plugins/pagination/PaginationPlugin.js.map +1 -1
- package/dist/cjs/plugins/pagination/components/PerPageDropdown.js +30 -3
- package/dist/cjs/plugins/pagination/components/PerPageDropdown.js.map +1 -1
- package/dist/cjs/plugins/pagination/usePaginationState.js +19 -3
- package/dist/cjs/plugins/pagination/usePaginationState.js.map +1 -1
- package/dist/cjs/plugins/resizable/decorateResizable.js +19 -3
- package/dist/cjs/plugins/resizable/decorateResizable.js.map +1 -1
- package/dist/cjs/plugins/row-dnd/DndRowsPlugin.js +24 -12
- package/dist/cjs/plugins/row-dnd/DndRowsPlugin.js.map +1 -1
- package/dist/cjs/plugins/selectable/addSelectableColumn.js +51 -14
- package/dist/cjs/plugins/selectable/addSelectableColumn.js.map +1 -1
- package/dist/cjs/plugins/selectable/helper.js +18 -2
- package/dist/cjs/plugins/selectable/helper.js.map +1 -1
- package/dist/cjs/plugins/selectable/selectableFormatter.js +21 -4
- package/dist/cjs/plugins/selectable/selectableFormatter.js.map +1 -1
- package/dist/cjs/plugins/selectable/useSelectableState.js +19 -5
- package/dist/cjs/plugins/selectable/useSelectableState.js.map +1 -1
- package/dist/cjs/plugins/sortable/sortTree.js +19 -3
- package/dist/cjs/plugins/sortable/sortTree.js.map +1 -1
- package/dist/cjs/plugins/sortable/sorter.js +19 -9
- package/dist/cjs/plugins/sortable/sorter.js.map +1 -1
- package/dist/cjs/plugins/sortable/useSortableState.js +19 -3
- package/dist/cjs/plugins/sortable/useSortableState.js.map +1 -1
- package/dist/cjs/plugins/toolbar/RowRenderer.js +23 -9
- package/dist/cjs/plugins/toolbar/RowRenderer.js.map +1 -1
- package/dist/cjs/plugins/toolbar/ToolbarTrigger.js +19 -3
- package/dist/cjs/plugins/toolbar/ToolbarTrigger.js.map +1 -1
- package/dist/cjs/plugins/virtualization/AutoHeightList.js +51 -14
- package/dist/cjs/plugins/virtualization/AutoHeightList.js.map +1 -1
- package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js +22 -8
- package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js.map +1 -1
- package/dist/cjs/plugins/virtualization/VirtualizedBody.js +22 -7
- package/dist/cjs/plugins/virtualization/VirtualizedBody.js.map +1 -1
- package/dist/cjs/utilities/normalizeData.js +19 -3
- package/dist/cjs/utilities/normalizeData.js.map +1 -1
- package/dist/esm/DataGridImpl.js +58 -23
- package/dist/esm/DataGridImpl.js.map +1 -1
- package/dist/esm/PaginatedDataGrid.js +58 -19
- package/dist/esm/PaginatedDataGrid.js.map +1 -1
- package/dist/esm/components/BodyCell.js +35 -11
- package/dist/esm/components/BodyCell.js.map +1 -1
- package/dist/esm/components/BodyList.js +49 -12
- package/dist/esm/components/BodyList.js.map +1 -1
- package/dist/esm/components/HeaderCell.js +19 -6
- package/dist/esm/components/HeaderCell.js.map +1 -1
- package/dist/esm/components/List.js +17 -3
- package/dist/esm/components/List.js.map +1 -1
- package/dist/esm/components/ListItem.js +19 -4
- package/dist/esm/components/ListItem.js.map +1 -1
- package/dist/esm/components/NoResults.js +35 -4
- package/dist/esm/components/NoResults.js.map +1 -1
- package/dist/esm/components/Table.js +29 -15
- package/dist/esm/components/Table.js.map +1 -1
- package/dist/esm/components/TableBody.js +54 -21
- package/dist/esm/components/TableBody.js.map +1 -1
- package/dist/esm/components/TableHeader.js +22 -6
- package/dist/esm/components/TableHeader.js.map +1 -1
- package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +83 -34
- package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +1 -1
- package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js +24 -9
- package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js.map +1 -1
- package/dist/esm/plugins/column-sizing/columnMeasurerTransformer.js +21 -3
- package/dist/esm/plugins/column-sizing/columnMeasurerTransformer.js.map +1 -1
- package/dist/esm/plugins/column-sizing/ext-points/getTableProps.js +21 -3
- package/dist/esm/plugins/column-sizing/ext-points/getTableProps.js.map +1 -1
- package/dist/esm/plugins/column-sizing/useColumnSizeService.js +20 -1
- package/dist/esm/plugins/column-sizing/useColumnSizeService.js.map +1 -1
- package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +21 -2
- package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +1 -1
- package/dist/esm/plugins/custom-cell-renderer/getRendererComponent.js +31 -6
- package/dist/esm/plugins/custom-cell-renderer/getRendererComponent.js.map +1 -1
- package/dist/esm/plugins/editable/EditableComponents/ComboBox.js +21 -3
- package/dist/esm/plugins/editable/EditableComponents/ComboBox.js.map +1 -1
- package/dist/esm/plugins/editable/EditableComponents/TextBox.js +23 -4
- package/dist/esm/plugins/editable/EditableComponents/TextBox.js.map +1 -1
- package/dist/esm/plugins/editable/decorateEditable.js +33 -5
- package/dist/esm/plugins/editable/decorateEditable.js.map +1 -1
- package/dist/esm/plugins/editable/getEditorComponent.js +38 -13
- package/dist/esm/plugins/editable/getEditorComponent.js.map +1 -1
- package/dist/esm/plugins/expandable-grid/ExpandableColumn.js +57 -16
- package/dist/esm/plugins/expandable-grid/ExpandableColumn.js.map +1 -1
- package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js +42 -16
- package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js.map +1 -1
- package/dist/esm/plugins/expandable-grid/ExpandedRow.js +41 -14
- package/dist/esm/plugins/expandable-grid/ExpandedRow.js.map +1 -1
- package/dist/esm/plugins/expandable-grid/ExpandedRowExtra.js +21 -3
- package/dist/esm/plugins/expandable-grid/ExpandedRowExtra.js.map +1 -1
- package/dist/esm/plugins/export-data/ExportDataPlugin.js +17 -4
- package/dist/esm/plugins/export-data/ExportDataPlugin.js.map +1 -1
- package/dist/esm/plugins/filterable/addFilterToColumn.js +20 -1
- package/dist/esm/plugins/filterable/addFilterToColumn.js.map +1 -1
- package/dist/esm/plugins/filterable/components/FilterableHeader.js +19 -4
- package/dist/esm/plugins/filterable/components/FilterableHeader.js.map +1 -1
- package/dist/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js +38 -10
- package/dist/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +1 -1
- package/dist/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js +23 -6
- package/dist/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +1 -1
- package/dist/esm/plugins/filterable/helper.js +21 -3
- package/dist/esm/plugins/filterable/helper.js.map +1 -1
- package/dist/esm/plugins/filterable/useFilterableState.js +24 -8
- package/dist/esm/plugins/filterable/useFilterableState.js.map +1 -1
- package/dist/esm/plugins/grouping-grid/GroupingPlugin.js +43 -21
- package/dist/esm/plugins/grouping-grid/GroupingPlugin.js.map +1 -1
- package/dist/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js +35 -4
- package/dist/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +1 -1
- package/dist/esm/plugins/pagination/PaginationPlugin.js +59 -21
- package/dist/esm/plugins/pagination/PaginationPlugin.js.map +1 -1
- package/dist/esm/plugins/pagination/components/PerPageDropdown.js +32 -3
- package/dist/esm/plugins/pagination/components/PerPageDropdown.js.map +1 -1
- package/dist/esm/plugins/pagination/usePaginationState.js +21 -3
- package/dist/esm/plugins/pagination/usePaginationState.js.map +1 -1
- package/dist/esm/plugins/resizable/decorateResizable.js +21 -3
- package/dist/esm/plugins/resizable/decorateResizable.js.map +1 -1
- package/dist/esm/plugins/row-dnd/DndRowsPlugin.js +26 -12
- package/dist/esm/plugins/row-dnd/DndRowsPlugin.js.map +1 -1
- package/dist/esm/plugins/selectable/addSelectableColumn.js +53 -14
- package/dist/esm/plugins/selectable/addSelectableColumn.js.map +1 -1
- package/dist/esm/plugins/selectable/helper.js +20 -2
- package/dist/esm/plugins/selectable/helper.js.map +1 -1
- package/dist/esm/plugins/selectable/selectableFormatter.js +23 -4
- package/dist/esm/plugins/selectable/selectableFormatter.js.map +1 -1
- package/dist/esm/plugins/selectable/useSelectableState.js +21 -5
- package/dist/esm/plugins/selectable/useSelectableState.js.map +1 -1
- package/dist/esm/plugins/sortable/sortTree.js +21 -3
- package/dist/esm/plugins/sortable/sortTree.js.map +1 -1
- package/dist/esm/plugins/sortable/sorter.js +21 -9
- package/dist/esm/plugins/sortable/sorter.js.map +1 -1
- package/dist/esm/plugins/sortable/useSortableState.js +21 -3
- package/dist/esm/plugins/sortable/useSortableState.js.map +1 -1
- package/dist/esm/plugins/toolbar/RowRenderer.js +25 -9
- package/dist/esm/plugins/toolbar/RowRenderer.js.map +1 -1
- package/dist/esm/plugins/toolbar/ToolbarTrigger.js +21 -3
- package/dist/esm/plugins/toolbar/ToolbarTrigger.js.map +1 -1
- package/dist/esm/plugins/virtualization/AutoHeightList.js +53 -14
- package/dist/esm/plugins/virtualization/AutoHeightList.js.map +1 -1
- package/dist/esm/plugins/virtualization/VirtualizationPlugin.js +24 -8
- package/dist/esm/plugins/virtualization/VirtualizationPlugin.js.map +1 -1
- package/dist/esm/plugins/virtualization/VirtualizedBody.js +24 -7
- package/dist/esm/plugins/virtualization/VirtualizedBody.js.map +1 -1
- package/dist/esm/utilities/normalizeData.js +21 -3
- package/dist/esm/utilities/normalizeData.js.map +1 -1
- package/package.json +20 -19
- package/dist/types/DSDataGrid.d.ts +0 -863
- package/dist/types/DataGridImpl.d.ts +0 -13
- package/dist/types/PaginatedDataGrid.d.ts +0 -15
- package/dist/types/blockNames.d.ts +0 -4
- package/dist/types/columns/IconColumn.d.ts +0 -36
- package/dist/types/columns/NumberColumn.d.ts +0 -4
- package/dist/types/components/BodyCell.d.ts +0 -34
- package/dist/types/components/BodyList.d.ts +0 -12
- package/dist/types/components/ColumnVisibilityMenuOption.d.ts +0 -15
- package/dist/types/components/ColumnsOptionsMenuSection.d.ts +0 -9
- package/dist/types/components/EmptyState.d.ts +0 -7
- package/dist/types/components/HeaderCell.d.ts +0 -19
- package/dist/types/components/List.d.ts +0 -3
- package/dist/types/components/ListItem.d.ts +0 -3
- package/dist/types/components/NoResults.d.ts +0 -8
- package/dist/types/components/RowsLoader.d.ts +0 -5
- package/dist/types/components/Table.d.ts +0 -8
- package/dist/types/components/TableBody.d.ts +0 -4
- package/dist/types/components/TableHeader.d.ts +0 -4
- package/dist/types/components/footer/addOptionalFooterComponents.d.ts +0 -7
- package/dist/types/components/header/PrimaryControls.d.ts +0 -6
- package/dist/types/components/header/addOptionalHeaderComponents.d.ts +0 -11
- package/dist/types/components/index.d.ts +0 -5
- package/dist/types/components/renderers/defaultClassedRenderers.d.ts +0 -11
- package/dist/types/components/renderers/index.d.ts +0 -15
- package/dist/types/components/renderers/renderRowsLoader.d.ts +0 -2
- package/dist/types/components/tableContext.d.ts +0 -2
- package/dist/types/components/tests/ColumnVisibilityMenu.test.d.ts +0 -1
- package/dist/types/defaultPlugins.d.ts +0 -1
- package/dist/types/index.d.ts +0 -9
- package/dist/types/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.d.ts +0 -1
- package/dist/types/plugins/body-header-scroll-sync/index.d.ts +0 -1
- package/dist/types/plugins/column-dnd/DndColumnsPlugin.d.ts +0 -1
- package/dist/types/plugins/column-dnd/decorateGridWithDndColumns.d.ts +0 -2
- package/dist/types/plugins/column-dnd/index.d.ts +0 -1
- package/dist/types/plugins/column-sizing/ColumnSizingPlugin.d.ts +0 -1
- package/dist/types/plugins/column-sizing/columnMeasurerTransformer.d.ts +0 -6
- package/dist/types/plugins/column-sizing/ext-points/decorateColumn.d.ts +0 -1
- package/dist/types/plugins/column-sizing/ext-points/getTableProps.d.ts +0 -10
- package/dist/types/plugins/column-sizing/getColumnNameFromProperty.d.ts +0 -2
- package/dist/types/plugins/column-sizing/index.d.ts +0 -1
- package/dist/types/plugins/column-sizing/useColumnSizeService.d.ts +0 -18
- package/dist/types/plugins/column-sizing/useStylesheetHelpers.d.ts +0 -22
- package/dist/types/plugins/column-sizing/utils.d.ts +0 -5
- package/dist/types/plugins/custom-cell-renderer/CustomRendererPlugin.d.ts +0 -1
- package/dist/types/plugins/custom-cell-renderer/addCustomRendererToCell.d.ts +0 -4
- package/dist/types/plugins/custom-cell-renderer/getRendererComponent.d.ts +0 -12
- package/dist/types/plugins/custom-cell-renderer/index.d.ts +0 -1
- package/dist/types/plugins/editable/EditableComponents/ComboBox.d.ts +0 -12
- package/dist/types/plugins/editable/EditableComponents/TextBox.d.ts +0 -24
- package/dist/types/plugins/editable/EditableComponents/index.d.ts +0 -2
- package/dist/types/plugins/editable/EditablePlugin.d.ts +0 -1
- package/dist/types/plugins/editable/decorateEditable.d.ts +0 -7
- package/dist/types/plugins/editable/getEditorComponent.d.ts +0 -7
- package/dist/types/plugins/editable/index.d.ts +0 -2
- package/dist/types/plugins/expandable-grid/ExpandableColumn.d.ts +0 -29
- package/dist/types/plugins/expandable-grid/ExpandablePlugin.d.ts +0 -1
- package/dist/types/plugins/expandable-grid/ExpandedRow.d.ts +0 -12
- package/dist/types/plugins/expandable-grid/ExpandedRowExtra.d.ts +0 -10
- package/dist/types/plugins/expandable-grid/index.d.ts +0 -2
- package/dist/types/plugins/expandable-grid/tests/ExpandablePlugin.test.d.ts +0 -1
- package/dist/types/plugins/expandable-grid/useExpandGridState.d.ts +0 -14
- package/dist/types/plugins/export-data/ExportDataPlugin.d.ts +0 -4
- package/dist/types/plugins/export-data/index.d.ts +0 -1
- package/dist/types/plugins/filterable/FilterablePlugin.d.ts +0 -1
- package/dist/types/plugins/filterable/addFilterToColumn.d.ts +0 -1
- package/dist/types/plugins/filterable/components/FilterableHeader.d.ts +0 -29
- package/dist/types/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.d.ts +0 -31
- package/dist/types/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.d.ts +0 -28
- package/dist/types/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.d.ts +0 -31
- package/dist/types/plugins/filterable/components/filterable-menus/TextFilterMenu.d.ts +0 -36
- package/dist/types/plugins/filterable/components/filterable-menus/defaultDateFormat.d.ts +0 -1
- package/dist/types/plugins/filterable/components/filterable-menus/getFilterMenuByType.d.ts +0 -2
- package/dist/types/plugins/filterable/filterableFormatter.d.ts +0 -12
- package/dist/types/plugins/filterable/filtering-helper/filterRowsByQuery.d.ts +0 -3
- package/dist/types/plugins/filterable/filtering-helper/strategiesOperators.d.ts +0 -2
- package/dist/types/plugins/filterable/helper.d.ts +0 -22
- package/dist/types/plugins/filterable/index.d.ts +0 -1
- package/dist/types/plugins/filterable/useFilterableState.d.ts +0 -18
- package/dist/types/plugins/grouping-by/GroupingByPlugin.d.ts +0 -1
- package/dist/types/plugins/grouping-grid/GroupingPlugin.d.ts +0 -1
- package/dist/types/plugins/grouping-grid/walkStrategy.d.ts +0 -9
- package/dist/types/plugins/index.d.ts +0 -16
- package/dist/types/plugins/infinite-scrolling/InfiniteScrollPlugin.d.ts +0 -1
- package/dist/types/plugins/infinite-scrolling/index.d.ts +0 -1
- package/dist/types/plugins/pagination/PaginationPlugin.d.ts +0 -1
- package/dist/types/plugins/pagination/components/Pagination.d.ts +0 -11
- package/dist/types/plugins/pagination/components/Paginator.d.ts +0 -10
- package/dist/types/plugins/pagination/components/PerPageDropdown.d.ts +0 -10
- package/dist/types/plugins/pagination/helper.d.ts +0 -18
- package/dist/types/plugins/pagination/index.d.ts +0 -1
- package/dist/types/plugins/pagination/usePaginationState.d.ts +0 -9
- package/dist/types/plugins/resizable/ResizablePlugin.d.ts +0 -1
- package/dist/types/plugins/resizable/decorateResizable.d.ts +0 -4
- package/dist/types/plugins/resizable/index.d.ts +0 -1
- package/dist/types/plugins/resizable/useResizeHandle.d.ts +0 -13
- package/dist/types/plugins/resizable/utils.d.ts +0 -3
- package/dist/types/plugins/row-dnd/DndRowsPlugin.d.ts +0 -1
- package/dist/types/plugins/row-dnd/index.d.ts +0 -1
- package/dist/types/plugins/selectable/SelectablePlugin.d.ts +0 -1
- package/dist/types/plugins/selectable/addSelectableColumn.d.ts +0 -30
- package/dist/types/plugins/selectable/helper.d.ts +0 -5
- package/dist/types/plugins/selectable/index.d.ts +0 -1
- package/dist/types/plugins/selectable/selectableFormatter.d.ts +0 -10
- package/dist/types/plugins/selectable/useSelectableState.d.ts +0 -9
- package/dist/types/plugins/sortable/SortablePlugin.d.ts +0 -1
- package/dist/types/plugins/sortable/checkIfSortable.d.ts +0 -2
- package/dist/types/plugins/sortable/index.d.ts +0 -1
- package/dist/types/plugins/sortable/sortHeaderFormatter.d.ts +0 -7
- package/dist/types/plugins/sortable/sortTree.d.ts +0 -3
- package/dist/types/plugins/sortable/sorter.d.ts +0 -12
- package/dist/types/plugins/sortable/useSortableState.d.ts +0 -8
- package/dist/types/plugins/toolbar/RowRenderer.d.ts +0 -11
- package/dist/types/plugins/toolbar/ToolbarPlugin.d.ts +0 -1
- package/dist/types/plugins/toolbar/ToolbarTrigger.d.ts +0 -8
- package/dist/types/plugins/toolbar/index.d.ts +0 -1
- package/dist/types/plugins/virtualization/AutoHeightList.d.ts +0 -3
- package/dist/types/plugins/virtualization/VirtualizationPlugin.d.ts +0 -1
- package/dist/types/plugins/virtualization/VirtualizedBody.d.ts +0 -33
- package/dist/types/plugins/virtualization/VirtualizedBodyRow.d.ts +0 -8
- package/dist/types/plugins/virtualization/helper.d.ts +0 -1
- package/dist/types/plugins/virtualization/index.d.ts +0 -1
- package/dist/types/renders/CellWithAddons.d.ts +0 -52
- package/dist/types/renders/index.d.ts +0 -2
- package/dist/types/renders/styled.d.ts +0 -4
- package/dist/types/rowSizes.d.ts +0 -11
- package/dist/types/stories/datagrids-export.stories.d.ts +0 -1
- package/dist/types/stories/datagrids-selectable-multi.stories.d.ts +0 -1
- package/dist/types/tests/DataGrid-Columns.test.d.ts +0 -1
- package/dist/types/tests/DataGrid-Editable.test.d.ts +0 -1
- package/dist/types/tests/DataGrid-Export.test.d.ts +0 -1
- package/dist/types/tests/DataGrid-Filter-helper.test.d.ts +0 -1
- package/dist/types/tests/DataGrid-Filterable-Dates.test.d.ts +0 -1
- package/dist/types/tests/DataGrid-Filterable-State.test.d.ts +0 -1
- package/dist/types/tests/DataGrid-RowDnd.test.d.ts +0 -1
- package/dist/types/tests/DataGrid-Selectable.test.d.ts +0 -1
- package/dist/types/tests/DataGrid-Sortable.test.d.ts +0 -1
- package/dist/types/tests/DataGrid-Toolbar.test.d.ts +0 -1
- package/dist/types/tests/DataGrid-Virtualization.test.d.ts +0 -1
- package/dist/types/tests/DataGrids-ColumnSizing.test.d.ts +0 -1
- package/dist/types/tests/DataGrids-ConditionalPagination.test.d.ts +0 -1
- package/dist/types/tests/DataGrids-Rows.test.d.ts +0 -1
- package/dist/types/tests/DataGrids.test.d.ts +0 -1
- package/dist/types/utilities/getPluginsFromProps.d.ts +0 -2
- package/dist/types/utilities/getScrollbarSize.d.ts +0 -1
- package/dist/types/utilities/normalizeData.d.ts +0 -3
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
7
24
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
25
|
var __export = (target, all) => {
|
|
9
26
|
for (var name in all)
|
|
@@ -189,19 +206,17 @@ const VirtualizedBody = (props) => {
|
|
|
189
206
|
key: rows[renderedIndexes[0] + index][rowKey],
|
|
190
207
|
style: getRowStyle(rows[renderedIndexes[0] + index], renderedIndexes[0] + index, rowHeight)
|
|
191
208
|
}));
|
|
192
|
-
const wrapperStyle = {
|
|
193
|
-
height: "100%"
|
|
194
|
-
|
|
195
|
-
};
|
|
209
|
+
const wrapperStyle = __spreadValues({
|
|
210
|
+
height: "100%"
|
|
211
|
+
}, import_helper.isSafari ? wrapperSafari : wrapperGeneric);
|
|
196
212
|
const bodyStyle = {
|
|
197
213
|
height: getHeight(),
|
|
198
214
|
willChange: "transform",
|
|
199
215
|
backfaceVisibility: "hidden"
|
|
200
216
|
};
|
|
201
|
-
return /* @__PURE__ */ import_react.default.createElement(Component, {
|
|
202
|
-
...props,
|
|
217
|
+
return /* @__PURE__ */ import_react.default.createElement(Component, __spreadProps(__spreadValues({}, props), {
|
|
203
218
|
innerRef
|
|
204
|
-
}, !isPlaceholderActive ? /* @__PURE__ */ import_react.default.createElement("div", {
|
|
219
|
+
}), !isPlaceholderActive ? /* @__PURE__ */ import_react.default.createElement("div", {
|
|
205
220
|
className: "virtualized-body-wrapper",
|
|
206
221
|
style: wrapperStyle,
|
|
207
222
|
ref: (elem) => {
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/plugins/virtualization/VirtualizedBody.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport React, { useEffect, useState, useCallback, useRef, useLayoutEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport { mergeRefs, debounce, isNaN } from '@elliemae/ds-utilities';\nimport { NoResults } from '../../components/NoResults';\nimport { VirtualizedBodyRow } from './VirtualizedBodyRow';\nimport { RowSizes } from '../../rowSizes';\nimport { isSafari } from './helper';\n\nconst wrapperSafari = {};\nconst wrapperGeneric = { overflowY: 'auto', overflowX: 'visible' };\n\nconst VirtualizedBody = (props) => {\n const {\n autoScrollToId,\n columns,\n component: Component,\n expandable,\n innerRef,\n innerBody,\n isPlaceholderActive,\n listProps,\n noResultsPlaceholder,\n overscanCount,\n rows,\n rowHeight: defaultRowHeight,\n rowKey,\n rowRenderer,\n rowSize,\n setHasScroll,\n filters, // hack to reset the scrollTop to 0 if filters change\n } = props;\n const rowHeight = defaultRowHeight || RowSizes[rowSize];\n const [scrollTop, setScrollTop] = useState(0);\n const [visibleHeight, setVisibleHeight] = useState(0);\n const [hasScrollBar, setHasScrollBar] = useState(false);\n const rowStyleCache = useRef({});\n const [renderedIndexes, setRenderedIndexes] = useState([0, 30]);\n\n const getCalculatedHeightBetweenIndexes = (start, end) => {\n const { itemSize = () => rowHeight } = listProps;\n if (expandable) {\n return rows\n .slice(start, end)\n .map((_, idx) => idx)\n .map((idx) => itemSize(idx))\n .reduce((acc, curr) => acc + curr, 0);\n }\n return (end - start) * rowHeight;\n };\n\n const generateRowPositionMap = () => rows.map((row, idx) => getCalculatedHeightBetweenIndexes(0, idx));\n\n const rowPositionMap = useRef(generateRowPositionMap());\n const [virtualizedBodyRef, setVirtualizedBodyRef] = useState(null);\n const handlerRef = useRef();\n\n const autoScrollTo = useCallback(\n (scrollHeight) => {\n const { itemSize = () => rowHeight } = listProps;\n const idx = rows.findIndex((item) => item[rowKey] === autoScrollToId);\n let val = rowPositionMap.current[idx] || 0;\n const lastPositionIdx = rowPositionMap.current.length - 1;\n let lastPosition = 0;\n if (lastPositionIdx > -1) {\n lastPosition = rowPositionMap.current[lastPositionIdx] - scrollHeight + itemSize(lastPositionIdx);\n }\n if (lastPosition < val) {\n val = lastPosition;\n }\n if (virtualizedBodyRef) {\n if (idx > -1) {\n setScrollTop(val);\n virtualizedBodyRef.scrollTop = val;\n }\n }\n },\n [rows, virtualizedBodyRef],\n );\n\n useEffect(() => {\n autoScrollTo(visibleHeight);\n }, [autoScrollToId, visibleHeight]);\n\n const handler = useCallback(\n debounce(({ target }) => {\n // Update coordinates\n setScrollTop(target.scrollTop || 0);\n }, 100),\n [setScrollTop],\n );\n\n useEffect(() => {\n setScrollTop(0);\n }, [filters]);\n\n useEffect(() => {\n handlerRef.current = handler;\n }, [handler]);\n\n useLayoutEffect(() => {\n let top = Math.ceil(scrollTop / rowHeight);\n let bot = Math.ceil((scrollTop + visibleHeight) / rowHeight);\n if (expandable) {\n // updateMapperFirst\n rowPositionMap.current = generateRowPositionMap();\n top = rowPositionMap.current.findIndex((item) => item > scrollTop);\n bot = rowPositionMap.current.findIndex((item) => item > scrollTop + visibleHeight);\n if (bot === -1) bot = rowPositionMap.current.length;\n }\n let upperBound = top - 1 - overscanCount;\n let lowerBound = bot - 1 + overscanCount;\n if (upperBound < 0) {\n upperBound = 0;\n }\n if (lowerBound - upperBound < overscanCount) {\n lowerBound = upperBound + overscanCount;\n }\n if (lowerBound > rows.length) {\n lowerBound = rows.length;\n }\n setHasScrollBar(visibleHeight < getHeight());\n setHasScroll(visibleHeight < getHeight());\n setRenderedIndexes([upperBound, lowerBound]);\n }, [visibleHeight, scrollTop, rows]);\n\n useLayoutEffect(() => {\n if (virtualizedBodyRef) {\n const parsedVisibleHeight = parseFloat(\n window.getComputedStyle(virtualizedBodyRef, null).getPropertyValue('height'),\n );\n // eslint-disable-next-line no-restricted-globals\n if (!isNaN(parsedVisibleHeight)) {\n setVisibleHeight(parsedVisibleHeight);\n autoScrollTo(parsedVisibleHeight);\n }\n }\n }, [rows, virtualizedBodyRef]);\n\n useEffect(() => {\n if (virtualizedBodyRef) {\n const eventListener = (event) => handlerRef.current(event);\n virtualizedBodyRef.addEventListener('scroll', eventListener);\n\n return () => {\n virtualizedBodyRef.removeEventListener('scroll', eventListener);\n };\n }\n return () => null;\n }, [virtualizedBodyRef]);\n\n const getHeight = () => {\n let returnHeight = 0;\n if (expandable) {\n returnHeight = getCalculatedHeightBetweenIndexes(0, rows.length) + 8;\n } else {\n returnHeight = rows.length * rowHeight + 8;\n }\n // if (visibleHeight > returnHeight) {\n // return visibleHeight;\n // }\n if (virtualizedBodyRef && virtualizedBodyRef.scrollHeight > virtualizedBodyRef.clientHeight) {\n return returnHeight + 10;\n }\n return returnHeight;\n };\n\n const getRowStyle = (row, index, specificRowHeight) => {\n const { itemSize } = listProps;\n\n if (!expandable && rowStyleCache.current[index]) {\n return rowStyleCache.current[index];\n }\n rowStyleCache.current[index] = {\n height: itemSize ? itemSize(index) : specificRowHeight,\n left: 0,\n right: 0,\n top: getCalculatedHeightBetweenIndexes(0, index),\n position: 'absolute',\n };\n return rowStyleCache.current[index];\n };\n\n const generateRenderedRows = () =>\n rows.slice(renderedIndexes[0], renderedIndexes[1] + 1).map((_, index) => (\n <VirtualizedBodyRow\n data={{\n rows,\n columns,\n rowKey,\n renderer: { rowRenderer },\n }}\n index={renderedIndexes[0] + index}\n key={rows[renderedIndexes[0] + index][rowKey]}\n style={getRowStyle(rows[renderedIndexes[0] + index], renderedIndexes[0] + index, rowHeight)}\n ></VirtualizedBodyRow>\n ));\n\n const wrapperStyle = {\n height: '100%',\n ...(isSafari ? wrapperSafari : wrapperGeneric),\n };\n const bodyStyle = {\n height: getHeight(),\n willChange: 'transform',\n backfaceVisibility: 'hidden',\n };\n\n return (\n <Component {...props} innerRef={innerRef}>\n {!isPlaceholderActive ? (\n <div\n className=\"virtualized-body-wrapper\"\n style={wrapperStyle}\n ref={(elem) => {\n if (elem) {\n if (isSafari) {\n setVirtualizedBodyRef(elem.parentElement);\n // eslint-disable-next-line no-param-reassign\n elem.parentElement.scrollTop = scrollTop;\n mergeRefs(listProps.outerRef)(elem.parentElement);\n } else {\n setVirtualizedBodyRef(elem);\n mergeRefs(listProps.outerRef)(elem);\n }\n }\n }}\n >\n <div\n data-testid=\"virtualized-body\"\n className={`virtualized-body${hasScrollBar ? ' with-scrollbar' : ''}`}\n style={bodyStyle}\n ref={(r) => {\n mergeRefs(innerBody)(r);\n }}\n >\n {generateRenderedRows()}\n </div>\n </div>\n ) : (\n <NoResults innerRef={innerRef} rowRenderer={rowRenderer}>\n {noResultsPlaceholder}\n </NoResults>\n )}\n </Component>\n );\n};\n\nVirtualizedBody.defaultProps = {\n rows: [],\n overscanCount: 10,\n};\n\nVirtualizedBody.propTypes = {\n autoScrollToId: PropTypes.number,\n columns: PropTypes.arrayOf(PropTypes.shape({})),\n component: PropTypes.element,\n expandable: PropTypes.bool,\n filters: PropTypes.any,\n innerRef: PropTypes.any,\n innerBody: PropTypes.any,\n isPlaceholderActive: PropTypes.bool,\n listProps: PropTypes.shape({\n itemSize: PropTypes.func,\n outerRef: PropTypes.any,\n }),\n noResultsPlaceholder: PropTypes.oneOf([PropTypes.string, PropTypes.element]),\n overscanCount: PropTypes.number,\n rows: PropTypes.arrayOf(PropTypes.shape({})),\n rowHeight: PropTypes.number,\n rowKey: PropTypes.string,\n rowRenderer: PropTypes.element,\n rowSize: PropTypes.any,\n setHasScroll: PropTypes.func,\n};\n\nexport { VirtualizedBody };\nexport default VirtualizedBody;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADEvB,mBAAiF;AACjF,wBAAsB;AACtB,0BAA2C;AAC3C,uBAA0B;AAC1B,gCAAmC;AACnC,sBAAyB;AACzB,oBAAyB;AAEzB,MAAM,gBAAgB;AACtB,MAAM,iBAAiB,EAAE,WAAW,QAAQ,WAAW;AAEvD,MAAM,kBAAkB,CAAC,UAAU;AACjC,QAAM;AAAA,IACJ;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MACE;AACJ,QAAM,YAAY,oBAAoB,yBAAS;AAC/C,QAAM,CAAC,WAAW,gBAAgB,2BAAS;AAC3C,QAAM,CAAC,eAAe,oBAAoB,2BAAS;AACnD,QAAM,CAAC,cAAc,mBAAmB,2BAAS;AACjD,QAAM,gBAAgB,yBAAO;AAC7B,QAAM,CAAC,iBAAiB,sBAAsB,2BAAS,CAAC,GAAG;AAE3D,QAAM,oCAAoC,CAAC,OAAO,QAAQ;AACxD,UAAM,EAAE,WAAW,MAAM,cAAc;AACvC,QAAI,YAAY;AACd,aAAO,KACJ,MAAM,OAAO,KACb,IAAI,CAAC,GAAG,QAAQ,KAChB,IAAI,CAAC,QAAQ,SAAS,MACtB,OAAO,C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AAe;AAAA;AAGjB,gBAAgB,YAAY;AAAA,EAC1B,gBAAgB,0BAAU;AAAA,EAC1B,SAAS,0BAAU,QAAQ,0BAAU,MAAM;AAAA,EAC3C,WAAW,0BAAU;AAAA,EACrB,YAAY,0BAAU;AAAA,EACtB,SAAS,0BAAU;AAAA,EACnB,UAAU,0BAAU;AAAA,EACpB,WAAW,0BAAU;AAAA,EACrB,qBAAqB,0BAAU;AAAA,EAC/B,WAAW,0BAAU,MAAM;AAAA,IACzB,UAAU,0BAAU;AAAA,IACpB,UAAU,0BAAU;AAAA;AAAA,EAEtB,sBAAsB,0BAAU,MAAM,CAAC,0BAAU,QAAQ,0BAAU;AAAA,EACnE,eAAe,0BAAU;AAAA,EACzB,MAAM,0BAAU,QAAQ,0BAAU,MAAM;AAAA,EACxC,WAAW,0BAAU;AAAA,EACrB,QAAQ,0BAAU;AAAA,EAClB,aAAa,0BAAU;AAAA,EACvB,SAAS,0BAAU;AAAA,EACnB,cAAc,0BAAU;AAAA;AAI1B,IAAO,0BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
var __create = Object.create;
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
8
|
var __getProtoOf = Object.getPrototypeOf;
|
|
6
9
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
7
24
|
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
8
25
|
var __export = (target, all) => {
|
|
9
26
|
for (var name in all)
|
|
@@ -38,11 +55,10 @@ const normalizeRows = (rows) => rows.map((row) => {
|
|
|
38
55
|
});
|
|
39
56
|
const normalizeColumns = (columns) => columns.map((column) => {
|
|
40
57
|
const { property } = column;
|
|
41
|
-
return {
|
|
42
|
-
...column,
|
|
58
|
+
return __spreadProps(__spreadValues({}, column), {
|
|
43
59
|
originalProperty: column.property,
|
|
44
60
|
property: normalizeText(property)
|
|
45
|
-
};
|
|
61
|
+
});
|
|
46
62
|
});
|
|
47
63
|
const normalizeText = (text) => text.replace(/\s+/g, "");
|
|
48
64
|
module.exports = __toCommonJS(normalizeData_exports);
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/utilities/normalizeData.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
|
|
4
4
|
"sourcesContent": ["export const normalizeRows = rows =>\n rows.map(row => {\n Object.keys(row).forEach(key => (row[normalizeText(key)] = row[key]));\n return row;\n });\n\nexport const normalizeColumns = columns =>\n columns.map(column => {\n const { property } = column;\n return {\n ...column,\n originalProperty: column.property,\n property: normalizeText(property),\n };\n });\n\nexport const normalizeText = text => text.replace(/\\s+/g, '');\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
-
"mappings": "
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAhB,MAAM,gBAAgB,UAC3B,KAAK,IAAI,SAAO;AACd,SAAO,KAAK,KAAK,QAAQ,SAAQ,IAAI,cAAc,QAAQ,IAAI;AAC/D,SAAO;AAAA;AAGJ,MAAM,mBAAmB,aAC9B,QAAQ,IAAI,YAAU;AACpB,QAAM,EAAE,aAAa;AACrB,SAAO,iCACF,SADE;AAAA,IAEL,kBAAkB,OAAO;AAAA,IACzB,UAAU,cAAc;AAAA;AAAA;AAIvB,MAAM,gBAAgB,UAAQ,KAAK,QAAQ,QAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/dist/esm/DataGridImpl.js
CHANGED
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
1
32
|
import * as React from "react";
|
|
2
33
|
import React2, { useMemo } from "react";
|
|
3
34
|
import { isFunction } from "@elliemae/ds-shared/utils";
|
|
@@ -20,16 +51,24 @@ const isFluid = ({ autoHeight, paginated, numRowsVisible }) => {
|
|
|
20
51
|
return false;
|
|
21
52
|
return !numRowsVisible;
|
|
22
53
|
};
|
|
23
|
-
const DataGridImpl = ({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
54
|
+
const DataGridImpl = (_a) => {
|
|
55
|
+
var _b = _a, {
|
|
56
|
+
className,
|
|
57
|
+
renderers,
|
|
58
|
+
columns,
|
|
59
|
+
rows,
|
|
60
|
+
containerProps,
|
|
61
|
+
plugins: pluginsProp,
|
|
62
|
+
normalizeDataKeys
|
|
63
|
+
} = _b, otherProps = __objRest(_b, [
|
|
64
|
+
"className",
|
|
65
|
+
"renderers",
|
|
66
|
+
"columns",
|
|
67
|
+
"rows",
|
|
68
|
+
"containerProps",
|
|
69
|
+
"plugins",
|
|
70
|
+
"normalizeDataKeys"
|
|
71
|
+
]);
|
|
33
72
|
const {
|
|
34
73
|
noResultsPlaceholder = /* @__PURE__ */ React2.createElement(EmptyState, null),
|
|
35
74
|
noColumnsPlaceholder = "Please select one of more columns in order for data to be displayed.",
|
|
@@ -56,22 +95,20 @@ const DataGridImpl = ({
|
|
|
56
95
|
});
|
|
57
96
|
if (rowsIds.length !== rowsIdsSet.size)
|
|
58
97
|
throw new Error("Repeated id: each row must have an unique id");
|
|
59
|
-
const plugins = getPluginsFromProps({
|
|
60
|
-
...otherProps,
|
|
98
|
+
const plugins = getPluginsFromProps(__spreadProps(__spreadValues({}, otherProps), {
|
|
61
99
|
virtualized: (!paginated || groupedRows) && !wrapText,
|
|
62
100
|
paginated: paginated && !groupedRows || wrapText,
|
|
63
101
|
sortable: sortable && !groupedRows
|
|
64
|
-
});
|
|
102
|
+
}));
|
|
65
103
|
if (normalizeDataKeys) {
|
|
66
104
|
normalizeRows(rows);
|
|
67
105
|
}
|
|
68
|
-
const grid = useDataGrid({
|
|
106
|
+
const grid = useDataGrid(__spreadValues({
|
|
69
107
|
columns,
|
|
70
108
|
rows,
|
|
71
109
|
renderers: defaultRenderers,
|
|
72
|
-
plugins: [...plugins, ...pluginsProp, ...defaultPlugins]
|
|
73
|
-
|
|
74
|
-
});
|
|
110
|
+
plugins: [...plugins, ...pluginsProp, ...defaultPlugins]
|
|
111
|
+
}, otherProps));
|
|
75
112
|
const noColumnsVisible = useMemo(() => {
|
|
76
113
|
const visibleUserColumns = grid.columns.filter((column) => column.visible || typeof column.visible === "undefined");
|
|
77
114
|
return visibleUserColumns.length === 0;
|
|
@@ -85,7 +122,7 @@ const DataGridImpl = ({
|
|
|
85
122
|
const { pagination } = otherProps;
|
|
86
123
|
const conditionalPagination = pagination && pagination.conditionalPagination === true && rows.length <= otherProps.pagination.perPage;
|
|
87
124
|
const usePagination = paginated && !conditionalPagination;
|
|
88
|
-
return /* @__PURE__ */ React2.createElement(DatagridWrapper, {
|
|
125
|
+
return /* @__PURE__ */ React2.createElement(DatagridWrapper, __spreadValues({
|
|
89
126
|
className: `${className} ds-row-size-${rowSize}`,
|
|
90
127
|
classProps: {
|
|
91
128
|
fluidHeight: isFluid({
|
|
@@ -94,12 +131,10 @@ const DataGridImpl = ({
|
|
|
94
131
|
paginated: usePagination
|
|
95
132
|
})
|
|
96
133
|
},
|
|
97
|
-
style: { height }
|
|
98
|
-
|
|
99
|
-
}, addOptionalHeaderComponents({ grid }), /* @__PURE__ */ React2.createElement(Table, {
|
|
100
|
-
...grid,
|
|
134
|
+
style: { height }
|
|
135
|
+
}, containerProps), addOptionalHeaderComponents({ grid }), /* @__PURE__ */ React2.createElement(Table, __spreadProps(__spreadValues({}, grid), {
|
|
101
136
|
onDefaultFiltersLoad
|
|
102
|
-
}, showHeader && /* @__PURE__ */ React2.createElement(TableHeader, null), showRowsLoader ? rowsLoaderRenderer() : /* @__PURE__ */ React2.createElement(TableBody, {
|
|
137
|
+
}), showHeader && /* @__PURE__ */ React2.createElement(TableHeader, null), showRowsLoader ? rowsLoaderRenderer() : /* @__PURE__ */ React2.createElement(TableBody, {
|
|
103
138
|
isPlaceholderActive: noColumnsVisible || grid.composedRows.rows && grid.composedRows.rows.length === 0 || grid.composedRows.length === 0,
|
|
104
139
|
noResultsPlaceholder: bodyPlaceholder
|
|
105
140
|
})), addOptionalFooterComponents({
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/DataGridImpl.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useMemo } from 'react';\nimport { isFunction } from '@elliemae/ds-shared/utils';\nimport { useDataGrid } from '@elliemae/ds-shared/useDataGrid';\nimport { Table } from './components/Table';\nimport { TableBody } from './components/TableBody';\nimport { TableHeader } from './components/TableHeader';\nimport { defaultRenderers, renderRowsLoader } from './components/renderers';\nimport { DatagridWrapper } from './components/renderers/defaultClassedRenderers';\nimport { addOptionalFooterComponents } from './components/footer/addOptionalFooterComponents';\nimport { addOptionalHeaderComponents } from './components/header/addOptionalHeaderComponents';\nimport { EmptyState } from './components/EmptyState';\nimport { getPluginsFromProps } from './utilities/getPluginsFromProps';\nimport { defaultPlugins } from './defaultPlugins';\nimport { normalizeRows } from './utilities/normalizeData';\n\nconst isFluid = ({ autoHeight, paginated, numRowsVisible }) => {\n if (autoHeight) return false;\n if (paginated) return false;\n return !numRowsVisible;\n};\n\nconst DataGridImpl = ({\n className,\n renderers,\n columns,\n rows,\n containerProps,\n plugins: pluginsProp,\n normalizeDataKeys,\n ...otherProps\n}) => {\n const {\n noResultsPlaceholder = <EmptyState />,\n noColumnsPlaceholder = 'Please select one of more columns in order for data to be displayed.',\n noResultsRender,\n paginated,\n height,\n showHeader,\n showRowsLoader,\n rowsLoaderRenderer = renderRowsLoader,\n groupedRows,\n sortable,\n rowSize,\n wrapText,\n onDefaultFiltersLoad,\n rowKey,\n } = otherProps;\n\n const idKey = rowKey || 'id';\n const rowsIdsSet = new Set();\n const rowsIds = rows.map((row) => {\n if (row[idKey] === undefined)\n throw new Error('Missing id: each row must have an unique id');\n rowsIdsSet.add(row[idKey]);\n return row[idKey];\n });\n if (rowsIds.length !== rowsIdsSet.size)\n throw new Error('Repeated id: each row must have an unique id');\n\n const plugins = getPluginsFromProps({\n ...otherProps,\n virtualized: (!paginated || groupedRows) && !wrapText,\n paginated: (paginated && !groupedRows) || wrapText,\n sortable: sortable && !groupedRows,\n });\n\n if (normalizeDataKeys) {\n normalizeRows(rows);\n }\n\n const grid = useDataGrid({\n columns,\n rows,\n renderers: defaultRenderers,\n plugins: [...plugins, ...pluginsProp, ...defaultPlugins],\n ...otherProps,\n });\n\n const noColumnsVisible = useMemo(() => {\n const visibleUserColumns = grid.columns.filter(\n (column) => column.visible || typeof column.visible === 'undefined',\n );\n return visibleUserColumns.length === 0;\n }, [grid.columns]);\n\n const bodyPlaceholder = useMemo(() => {\n if (noColumnsVisible) {\n return noColumnsPlaceholder;\n }\n return isFunction(noResultsRender)\n ? noResultsRender()\n : noResultsPlaceholder;\n }, [noResultsPlaceholder, noColumnsPlaceholder, noColumnsVisible]);\n\n const { pagination } = otherProps;\n const conditionalPagination =\n pagination &&\n pagination.conditionalPagination === true &&\n rows.length <= otherProps.pagination.perPage;\n const usePagination = paginated && !conditionalPagination;\n return (\n <DatagridWrapper\n className={`${className} ds-row-size-${rowSize}`}\n classProps={{\n fluidHeight: isFluid({\n autoHeight: otherProps.autoHeight,\n numRowsVisible: otherProps.numRowsVisible,\n paginated: usePagination,\n }),\n }}\n style={{ height }}\n {...containerProps}\n >\n {addOptionalHeaderComponents({ grid })}\n <Table {...grid} onDefaultFiltersLoad={onDefaultFiltersLoad}>\n {showHeader && <TableHeader />}\n {showRowsLoader ? (\n rowsLoaderRenderer()\n ) : (\n <TableBody\n isPlaceholderActive={\n noColumnsVisible ||\n (grid.composedRows.rows && grid.composedRows.rows.length === 0) ||\n grid.composedRows.length === 0\n }\n noResultsPlaceholder={bodyPlaceholder}\n />\n )}\n </Table>\n {addOptionalFooterComponents({\n grid,\n rows: grid.composedRows,\n })}\n </DatagridWrapper>\n );\n};\n\nexport { DataGridImpl };\n\nexport default DataGridImpl;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,UAAU,CAAC,EAAE,YAAY,WAAW,qBAAqB;AAC7D,MAAI;AAAY,WAAO;AACvB,MAAI;AAAW,WAAO;AACtB,SAAO,CAAC;AAAA;AAGV,MAAM,eAAe,CAAC;
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,UAAU,CAAC,EAAE,YAAY,WAAW,qBAAqB;AAC7D,MAAI;AAAY,WAAO;AACvB,MAAI;AAAW,WAAO;AACtB,SAAO,CAAC;AAAA;AAGV,MAAM,eAAe,CAAC,OAShB;AATgB,eACpB;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,SAAS;AAAA,IACT;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AE,eAAe;AACvB,QAAM,wBACJ,cACA,WAAW,0BAA0B,QACrC,KAAK,UAAU,WAAW,WAAW;AACvC,QAAM,gBAAgB,aAAa,CAAC;AACpC,SACE,qCAAC,iBAAD;AAAA,IACE,WAAW,GAAG,yBAAyB;AAAA,IACvC,YAAY;AAAA,MACV,aAAa,QAAQ;AAAA,QACnB,YAAY,WAAW;AAAA,QACvB,gBAAgB,WAAW;AAAA,QAC3B,WAAW;AAAA;AAAA;AAAA,IAGf,OAAO,EAAE;AAAA,KACL,iBAEH,4BAA4B,EAAE,SAC/B,qCAAC,OAAD,iCAAW,OAAX;AAAA,IAAiB;AAAA,MACd,cAAc,qCAAC,aAAD,OACd,iBACC,uBAEA,qCAAC,WAAD;AAAA,IACE,qBACE,oBACC,KAAK,aAAa,QAAQ,KAAK,aAAa,KAAK,WAAW,KAC7D,KAAK,aAAa,WAAW;AAAA,IAE/B,sBAAsB;AAAA,OAI3B,4BAA4B;AAAA,IAC3B;AAAA,IACA,MAAM,KAAK;AAAA;AAAA;AAQnB,IAAO,uBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,34 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
1
32
|
import * as React from "react";
|
|
2
33
|
import React2 from "react";
|
|
3
34
|
import { useDataGrid } from "@elliemae/ds-shared/src/useDataGrid/useDataGrid";
|
|
@@ -7,30 +38,38 @@ import { DatagridWrapper } from "./components/renderers/defaultClassedRenderers"
|
|
|
7
38
|
import { addOptionalHeaderComponents } from "./components/header/addOptionalHeaderComponents";
|
|
8
39
|
import { getPluginsFromProps } from "./utilities/getPluginsFromProps";
|
|
9
40
|
import { Pagination } from "./plugins/pagination/components/Pagination";
|
|
10
|
-
function PaginatedDataGrid({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
41
|
+
function PaginatedDataGrid(_a) {
|
|
42
|
+
var _b = _a, {
|
|
43
|
+
columns,
|
|
44
|
+
rows,
|
|
45
|
+
showRowsLoader,
|
|
46
|
+
noResultsPlaceholder,
|
|
47
|
+
rowsLoaderRenderer = renderRowsLoader,
|
|
48
|
+
maxPerPage,
|
|
49
|
+
minPerPage,
|
|
50
|
+
onPageSelect,
|
|
51
|
+
onPerPage,
|
|
52
|
+
pagination
|
|
53
|
+
} = _b, otherProps = __objRest(_b, [
|
|
54
|
+
"columns",
|
|
55
|
+
"rows",
|
|
56
|
+
"showRowsLoader",
|
|
57
|
+
"noResultsPlaceholder",
|
|
58
|
+
"rowsLoaderRenderer",
|
|
59
|
+
"maxPerPage",
|
|
60
|
+
"minPerPage",
|
|
61
|
+
"onPageSelect",
|
|
62
|
+
"onPerPage",
|
|
63
|
+
"pagination"
|
|
64
|
+
]);
|
|
23
65
|
const plugins = getPluginsFromProps(otherProps, { infiniteScrolling: true });
|
|
24
|
-
const grid = useDataGrid({
|
|
25
|
-
...otherProps,
|
|
66
|
+
const grid = useDataGrid(__spreadProps(__spreadValues({}, otherProps), {
|
|
26
67
|
columns,
|
|
27
68
|
rows,
|
|
28
69
|
renderers: defaultRenderers,
|
|
29
70
|
plugins
|
|
30
|
-
});
|
|
31
|
-
return /* @__PURE__ */ React2.createElement(DatagridWrapper, null, addOptionalHeaderComponents({ grid }), /* @__PURE__ */ React2.createElement(Table, {
|
|
32
|
-
...grid
|
|
33
|
-
}, /* @__PURE__ */ React2.createElement(Table.Header, null), showRowsLoader ? rowsLoaderRenderer() : /* @__PURE__ */ React2.createElement(Table.Body, {
|
|
71
|
+
}));
|
|
72
|
+
return /* @__PURE__ */ React2.createElement(DatagridWrapper, null, addOptionalHeaderComponents({ grid }), /* @__PURE__ */ React2.createElement(Table, __spreadValues({}, grid), /* @__PURE__ */ React2.createElement(Table.Header, null), showRowsLoader ? rowsLoaderRenderer() : /* @__PURE__ */ React2.createElement(Table.Body, {
|
|
34
73
|
rows: grid.composedRows.rows || grid.composedRows
|
|
35
74
|
})), /* @__PURE__ */ React2.createElement(Pagination, {
|
|
36
75
|
maxPerPage,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../scripts/build/transpile/react-shim.js", "../../src/PaginatedDataGrid.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { useDataGrid } from '@elliemae/ds-shared/src/useDataGrid/useDataGrid';\nimport { Table } from './components/Table';\nimport { defaultRenderers, renderRowsLoader } from './components/renderers';\nimport { DatagridWrapper } from './components/renderers/defaultClassedRenderers';\nimport { addOptionalHeaderComponents } from './components/header/addOptionalHeaderComponents';\nimport { getPluginsFromProps } from './utilities/getPluginsFromProps';\nimport { Pagination } from './plugins/pagination/components/Pagination';\n\nfunction PaginatedDataGrid({\n columns,\n rows,\n showRowsLoader,\n noResultsPlaceholder,\n rowsLoaderRenderer = renderRowsLoader,\n maxPerPage,\n minPerPage,\n onPageSelect,\n onPerPage,\n pagination,\n ...otherProps\n}) {\n const plugins = getPluginsFromProps(otherProps, { infiniteScrolling: true });\n const grid = useDataGrid({\n ...otherProps,\n columns,\n rows,\n renderers: defaultRenderers,\n plugins,\n });\n\n return (\n <DatagridWrapper>\n {addOptionalHeaderComponents({ grid })}\n <Table {...grid}>\n <Table.Header />\n {showRowsLoader ? (\n rowsLoaderRenderer()\n ) : (\n <Table.Body rows={grid.composedRows.rows || grid.composedRows} />\n )}\n </Table>\n <Pagination\n maxPerPage={maxPerPage}\n minPerPage={minPerPage}\n onPageSelect={onPageSelect}\n onPerPage={onPerPage}\n paginated={rows}\n pagination={pagination}\n />\n </DatagridWrapper>\n );\n}\n\nexport default PaginatedDataGrid;\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,2BAA2B;
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,2BAA2B,IAYxB;AAZwB,eACzB;AAAA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,qBAAqB;AAAA,IACrB;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MAVyB,IAWtB,uBAXsB,IAWtB;AAAA,IAVH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,QAAM,UAAU,oBAAoB,YAAY,EAAE,mBAAmB;AACrE,QAAM,OAAO,YAAY,iCACpB,aADoB;AAAA,IAEvB;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA;AAGF,SACE,qCAAC,iBAAD,MACG,4BAA4B,EAAE,SAC/B,qCAAC,OAAD,mBAAW,OACT,qCAAC,MAAM,QAAP,OACC,iBACC,uBAEA,qCAAC,MAAM,MAAP;AAAA,IAAY,MAAM,KAAK,aAAa,QAAQ,KAAK;AAAA,OAGrD,qCAAC,YAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,WAAW;AAAA,IACX;AAAA;AAAA;AAMR,IAAO,4BAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
var __objRest = (source, exclude) => {
|
|
18
|
+
var target = {};
|
|
19
|
+
for (var prop in source)
|
|
20
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
21
|
+
target[prop] = source[prop];
|
|
22
|
+
if (source != null && __getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
24
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
25
|
+
target[prop] = source[prop];
|
|
26
|
+
}
|
|
27
|
+
return target;
|
|
28
|
+
};
|
|
1
29
|
import * as React from "react";
|
|
2
30
|
import React2, { useEffect, useContext, useRef, useCallback } from "react";
|
|
3
31
|
import PropTypes from "prop-types";
|
|
@@ -5,7 +33,7 @@ import { FocusGridContext } from "@elliemae/ds-shared/FocusGroup/FocusGrid";
|
|
|
5
33
|
import { evaluateFormatters, evaluateTransforms } from "@elliemae/ds-shared/createDataInstance/utils";
|
|
6
34
|
import { DSTruncatedTooltipText } from "@elliemae/ds-truncated-tooltip-text";
|
|
7
35
|
const BodyCell = ({ component: Component, classProps, rowProps, column, columnIndex, rowIndex, grid }) => {
|
|
8
|
-
const { rowData, rowKey, isScrolling,
|
|
36
|
+
const _a = rowProps, { rowData, rowKey, isScrolling } = _a, extraRowProps = __objRest(_a, ["rowData", "rowKey", "isScrolling"]);
|
|
9
37
|
const { property, cell, props } = column;
|
|
10
38
|
const evaluatedProperty = property || cell && cell.property;
|
|
11
39
|
const ref = useRef(null);
|
|
@@ -22,7 +50,7 @@ const BodyCell = ({ component: Component, classProps, rowProps, column, columnIn
|
|
|
22
50
|
fixedFormatters = [],
|
|
23
51
|
scrollingFormatters = []
|
|
24
52
|
} = cell || {};
|
|
25
|
-
const extraParameters = {
|
|
53
|
+
const extraParameters = __spreadValues({
|
|
26
54
|
columnIndex,
|
|
27
55
|
property: evaluatedProperty,
|
|
28
56
|
column,
|
|
@@ -30,23 +58,19 @@ const BodyCell = ({ component: Component, classProps, rowProps, column, columnIn
|
|
|
30
58
|
rowIndex,
|
|
31
59
|
rowKey,
|
|
32
60
|
isScrolling,
|
|
33
|
-
registerFocus
|
|
34
|
-
|
|
35
|
-
};
|
|
61
|
+
registerFocus
|
|
62
|
+
}, extraRowProps);
|
|
36
63
|
const withTooltip = (v) => classProps && classProps.wrapText ? v : /* @__PURE__ */ React2.createElement(DSTruncatedTooltipText, {
|
|
37
64
|
value: v
|
|
38
65
|
});
|
|
39
66
|
const value = rowData[`_${evaluatedProperty}`] || rowData[evaluatedProperty];
|
|
40
67
|
const transformed = evaluateTransforms(transforms, value, extraParameters);
|
|
41
|
-
return /* @__PURE__ */ React2.createElement(Component, {
|
|
68
|
+
return /* @__PURE__ */ React2.createElement(Component, __spreadValues(__spreadValues(__spreadValues({
|
|
42
69
|
ref,
|
|
43
70
|
"data-testid": `column-${property}`,
|
|
44
71
|
tabIndex: -1,
|
|
45
|
-
classProps
|
|
46
|
-
|
|
47
|
-
...cell && cell.props,
|
|
48
|
-
...transformed
|
|
49
|
-
}, transformed.children || evaluateFormatters(!isScrolling ? [withTooltip, ...formatters, ...fixedFormatters] : [...scrollingFormatters, ...fixedFormatters], value, extraParameters, grid));
|
|
72
|
+
classProps
|
|
73
|
+
}, props), cell && cell.props), transformed), transformed.children || evaluateFormatters(!isScrolling ? [withTooltip, ...formatters, ...fixedFormatters] : [...scrollingFormatters, ...fixedFormatters], value, extraParameters, grid));
|
|
50
74
|
};
|
|
51
75
|
BodyCell.propTypes = {
|
|
52
76
|
component: PropTypes.element,
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/BodyCell.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useEffect, useContext, useRef, useCallback } from 'react';\nimport PropTypes from 'prop-types';\nimport { FocusGridContext } from '@elliemae/ds-shared/FocusGroup/FocusGrid';\nimport { evaluateFormatters, evaluateTransforms } from '@elliemae/ds-shared/createDataInstance/utils';\nimport { DSTruncatedTooltipText } from '@elliemae/ds-truncated-tooltip-text';\n\nconst BodyCell = ({ component: Component, classProps, rowProps, column, columnIndex, rowIndex, grid }) => {\n const { rowData, rowKey, isScrolling, ...extraRowProps } = rowProps;\n const { property, cell, props } = column;\n const evaluatedProperty = property || (cell && cell.property);\n\n const ref = useRef(null);\n const { register } = useContext(FocusGridContext);\n\n const registerFocus = useCallback((node) => {\n register(node, rowIndex, columnIndex);\n }, []);\n\n useEffect(() => {\n registerFocus(ref.current);\n }, [ref.current]);\n\n const {\n transforms = [],\n formatters = [],\n fixedFormatters = [], // useful for the toolbar trigger at the last column\n scrollingFormatters = [],\n } = cell || {};\n\n const extraParameters = {\n columnIndex,\n property: evaluatedProperty,\n column,\n rowData,\n rowIndex,\n rowKey,\n isScrolling, // improve performance on scroll rendering a lightweight component instead\n registerFocus,\n ...extraRowProps,\n };\n const withTooltip = (v) => (classProps && classProps.wrapText ? v : <DSTruncatedTooltipText value={v} />);\n const value = rowData[`_${evaluatedProperty}`] || rowData[evaluatedProperty];\n const transformed = evaluateTransforms(transforms, value, extraParameters);\n return (\n <Component\n ref={ref}\n data-testid={`column-${property}`}\n tabIndex={-1}\n classProps={classProps}\n {...props}\n {...(cell && cell.props)}\n {...transformed}\n >\n {transformed.children ||\n evaluateFormatters(\n !isScrolling\n ? [withTooltip, ...formatters, ...fixedFormatters]\n : [...scrollingFormatters, ...fixedFormatters],\n value,\n extraParameters,\n grid,\n )}\n </Component>\n );\n};\n\nBodyCell.propTypes = {\n component: PropTypes.element,\n classProps: PropTypes.shape({\n wrapText: PropTypes.bool,\n }),\n rowProps: PropTypes.shape({\n rowData: PropTypes.shape({}),\n rowKey: PropTypes.string,\n isScrolling: PropTypes.bool,\n }),\n column: PropTypes.shape({\n property: PropTypes.string,\n cell: PropTypes.any,\n props: PropTypes.shape({}),\n }),\n columnInd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AA,IACV;AAAA,KACI,QACC,QAAQ,KAAK,QACd,cAEH,YAAY,YACX,mBACE,CAAC,cACG,CAAC,aAAa,GAAG,YAAY,GAAG,mBAChC,CAAC,GAAG,qBAAqB,GAAG,kBAChC,OACA,iBACA;AAAA;AAMV,SAAS,YAAY;AAAA,EACnB,WAAW,UAAU;AAAA,EACrB,YAAY,UAAU,MAAM;AAAA,IAC1B,UAAU,UAAU;AAAA;AAAA,EAEtB,UAAU,UAAU,MAAM;AAAA,IACxB,SAAS,UAAU,MAAM;AAAA,IACzB,QAAQ,UAAU;AAAA,IAClB,aAAa,UAAU;AAAA;AAAA,EAEzB,QAAQ,UAAU,MAAM;AAAA,IACtB,UAAU,UAAU;AAAA,IACpB,MAAM,UAAU;AAAA,IAChB,OAAO,UAAU,MAAM;AAAA;AAAA,EAEzB,aAAa,UAAU;AAAA,EACvB,UAAU,UAAU;AAAA,EACpB,MAAM,UAAU;AAAA;AAIlB,IAAO,mBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,19 +1,56 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
1
32
|
import * as React from "react";
|
|
2
33
|
import React2 from "react";
|
|
3
34
|
import { NoResults } from "./NoResults";
|
|
4
|
-
function BodyWrapperDefaultRenderer({
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
35
|
+
function BodyWrapperDefaultRenderer(_a) {
|
|
36
|
+
var _b = _a, {
|
|
37
|
+
component: Component,
|
|
38
|
+
rows,
|
|
39
|
+
rowRenderer,
|
|
40
|
+
noResultsPlaceholder,
|
|
41
|
+
innerRef,
|
|
42
|
+
innerBodyRef
|
|
43
|
+
} = _b, otherBodyProps = __objRest(_b, [
|
|
44
|
+
"component",
|
|
45
|
+
"rows",
|
|
46
|
+
"rowRenderer",
|
|
47
|
+
"noResultsPlaceholder",
|
|
48
|
+
"innerRef",
|
|
49
|
+
"innerBodyRef"
|
|
50
|
+
]);
|
|
51
|
+
return /* @__PURE__ */ React2.createElement(Component, __spreadProps(__spreadValues({}, otherBodyProps), {
|
|
15
52
|
innerRef
|
|
16
|
-
}, rows.length ? rows.map((row, index) => rowRenderer(row, { index }, {})) : /* @__PURE__ */ React2.createElement(NoResults, {
|
|
53
|
+
}), rows.length ? rows.map((row, index) => rowRenderer(row, { index }, {})) : /* @__PURE__ */ React2.createElement(NoResults, {
|
|
17
54
|
innerRef,
|
|
18
55
|
rowRenderer
|
|
19
56
|
}, noResultsPlaceholder));
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/components/BodyList.tsx"],
|
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { NoResults } from './NoResults';\n\nfunction BodyWrapperDefaultRenderer({\n component: Component,\n rows,\n rowRenderer,\n noResultsPlaceholder,\n innerRef,\n innerBodyRef,\n ...otherBodyProps\n}) {\n return (\n <Component {...otherBodyProps} innerRef={innerRef}>\n {rows.length ? (\n rows.map((row, index) => rowRenderer(row, { index }, {}))\n ) : (\n <NoResults innerRef={innerRef} rowRenderer={rowRenderer}>\n {noResultsPlaceholder}\n </NoResults>\n )}\n </Component>\n );\n}\n\nexport default React.memo(BodyWrapperDefaultRenderer);\n"],
|
|
5
|
-
"mappings": "AAAA;ACAA;AACA;AAEA,oCAAoC;AAAA,
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;ACAA;AACA;AAEA,oCAAoC,IAQjC;AARiC,eAClC;AAAA,eAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,MANkC,IAO/B,2BAP+B,IAO/B;AAAA,IANH;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAGA,SACE,qCAAC,WAAD,iCAAe,iBAAf;AAAA,IAA+B;AAAA,MAC5B,KAAK,SACJ,KAAK,IAAI,CAAC,KAAK,UAAU,YAAY,KAAK,EAAE,SAAS,OAErD,qCAAC,WAAD;AAAA,IAAW;AAAA,IAAoB;AAAA,KAC5B;AAAA;AAOX,IAAO,mBAAQ,OAAM,KAAK;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
1
17
|
import * as React from "react";
|
|
2
18
|
import React2 from "react";
|
|
3
19
|
import PropTypes from "prop-types";
|
|
@@ -22,15 +38,12 @@ const HeaderCell = ({ column, columnIndex, component: Component, classProps, gri
|
|
|
22
38
|
const transformedProps = evaluateTransforms(transforms, value, extraParameters);
|
|
23
39
|
const formattedValue = evaluateFormatters(formatters, value, extraParameters);
|
|
24
40
|
const testId = column.headerDataId || "data-grid-header__cell";
|
|
25
|
-
return /* @__PURE__ */ React2.createElement(Component, {
|
|
41
|
+
return /* @__PURE__ */ React2.createElement(Component, __spreadValues(__spreadValues(__spreadValues({
|
|
26
42
|
key: `${evaluatedProperty}-header`,
|
|
27
43
|
"data-testid": testId,
|
|
28
44
|
index: columnIndex,
|
|
29
|
-
classProps
|
|
30
|
-
|
|
31
|
-
...header && header.props,
|
|
32
|
-
...transformedProps
|
|
33
|
-
}, transformedProps.children || formattedValue);
|
|
45
|
+
classProps
|
|
46
|
+
}, props), header && header.props), transformedProps), transformedProps.children || formattedValue);
|
|
34
47
|
};
|
|
35
48
|
HeaderCell.propTypes = {
|
|
36
49
|
column: PropTypes.any,
|