@elliemae/ds-datagrids 2.2.0-alpha.3 → 3.0.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DSDataGrid.js +635 -395
- package/cjs/DataGridImpl.js +128 -103
- package/cjs/PaginatedDataGrid.js +68 -68
- package/cjs/blockNames.js +11 -39
- package/cjs/columns/IconColumn.js +62 -78
- package/cjs/columns/NumberColumn.js +5 -35
- package/cjs/components/BodyCell.js +80 -83
- package/cjs/components/BodyList.js +52 -52
- package/cjs/components/ColumnVisibilityMenuOption.js +31 -53
- package/cjs/components/ColumnsOptionsMenuSection.js +44 -59
- package/cjs/components/EmptyState.js +50 -81
- package/cjs/components/HeaderCell.js +58 -64
- package/cjs/components/List.js +29 -41
- package/cjs/components/ListItem.js +36 -43
- package/cjs/components/NoResults.js +51 -55
- package/cjs/components/RowsLoader.js +22 -42
- package/cjs/components/Table.js +87 -78
- package/cjs/components/TableBody.js +60 -61
- package/cjs/components/TableHeader.js +30 -47
- package/cjs/components/footer/addOptionalFooterComponents.js +43 -53
- package/cjs/components/header/PrimaryControls.js +35 -49
- package/cjs/components/header/addOptionalHeaderComponents.js +43 -54
- package/cjs/components/index.js +17 -43
- package/cjs/components/renderers/defaultClassedRenderers.js +57 -64
- package/cjs/components/renderers/index.js +17 -44
- package/cjs/components/renderers/renderRowsLoader.js +18 -39
- package/cjs/components/tableContext.js +13 -36
- package/cjs/defaultPlugins.js +12 -44
- package/cjs/index.js +67 -72
- package/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +114 -102
- package/cjs/plugins/body-header-scroll-sync/index.js +9 -35
- package/cjs/plugins/column-dnd/DndColumnsPlugin.js +86 -107
- package/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +27 -43
- package/cjs/plugins/column-dnd/index.js +9 -35
- package/cjs/plugins/column-sizing/ColumnSizingPlugin.js +55 -59
- package/cjs/plugins/column-sizing/columnMeasurerTransformer.js +53 -48
- package/cjs/plugins/column-sizing/ext-points/decorateColumn.js +13 -40
- package/cjs/plugins/column-sizing/ext-points/getTableProps.js +54 -55
- package/cjs/plugins/column-sizing/getColumnNameFromProperty.js +9 -37
- package/cjs/plugins/column-sizing/index.js +9 -35
- package/cjs/plugins/column-sizing/useColumnSizeService.js +86 -72
- package/cjs/plugins/column-sizing/useStylesheetHelpers.js +199 -96
- package/cjs/plugins/column-sizing/utils.js +29 -52
- package/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js +16 -38
- package/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +56 -61
- package/cjs/plugins/custom-cell-renderer/getRendererComponent.js +60 -58
- package/cjs/plugins/custom-cell-renderer/index.js +9 -35
- package/cjs/plugins/editable/EditableComponents/ComboBox.js +53 -50
- package/cjs/plugins/editable/EditableComponents/TextBox.js +76 -56
- package/cjs/plugins/editable/EditableComponents/index.js +11 -37
- package/cjs/plugins/editable/EditablePlugin.js +75 -60
- package/cjs/plugins/editable/decorateEditable.js +98 -61
- package/cjs/plugins/editable/getEditorComponent.js +76 -70
- package/cjs/plugins/editable/index.js +13 -38
- package/cjs/plugins/expandable-grid/ExpandableColumn.js +144 -112
- package/cjs/plugins/expandable-grid/ExpandablePlugin.js +180 -118
- package/cjs/plugins/expandable-grid/ExpandedRow.js +139 -117
- package/cjs/plugins/expandable-grid/ExpandedRowExtra.js +52 -54
- package/cjs/plugins/expandable-grid/index.js +11 -37
- package/cjs/plugins/expandable-grid/useExpandGridState.js +31 -45
- package/cjs/plugins/export-data/ExportDataPlugin.js +116 -82
- package/cjs/plugins/export-data/index.js +12 -35
- package/cjs/plugins/filterable/FilterablePlugin.js +55 -54
- package/cjs/plugins/filterable/addFilterToColumn.js +28 -40
- package/cjs/plugins/filterable/components/FilterableHeader.js +107 -119
- package/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +116 -116
- package/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +73 -97
- package/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +132 -138
- package/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +119 -115
- package/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js +7 -35
- package/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +15 -46
- package/cjs/plugins/filterable/filterableFormatter.js +51 -61
- package/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +55 -60
- package/cjs/plugins/filterable/filtering-helper/strategiesOperators.js +22 -43
- package/cjs/plugins/filterable/helper.js +79 -68
- package/cjs/plugins/filterable/index.js +9 -35
- package/cjs/plugins/filterable/useFilterableState.js +66 -62
- package/cjs/plugins/grouping-by/GroupingByPlugin.js +23 -40
- package/cjs/plugins/grouping-grid/GroupingPlugin.js +109 -86
- package/cjs/plugins/grouping-grid/walkStrategy.js +26 -46
- package/cjs/plugins/index.js +48 -68
- package/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +88 -64
- package/cjs/plugins/infinite-scrolling/index.js +9 -35
- package/cjs/plugins/pagination/PaginationPlugin.js +90 -73
- package/cjs/plugins/pagination/components/Pagination.js +35 -54
- package/cjs/plugins/pagination/components/Paginator.js +44 -59
- package/cjs/plugins/pagination/components/PerPageDropdown.js +63 -51
- package/cjs/plugins/pagination/helper.js +24 -45
- package/cjs/plugins/pagination/index.js +9 -35
- package/cjs/plugins/pagination/usePaginationState.js +38 -46
- package/cjs/plugins/resizable/ResizablePlugin.js +55 -51
- package/cjs/plugins/resizable/decorateResizable.js +53 -49
- package/cjs/plugins/resizable/index.js +9 -35
- package/cjs/plugins/resizable/useResizeHandle.js +50 -56
- package/cjs/plugins/resizable/utils.js +28 -49
- package/cjs/plugins/row-dnd/DndRowsPlugin.js +82 -103
- package/cjs/plugins/row-dnd/index.js +9 -35
- package/cjs/plugins/selectable/SelectablePlugin.js +134 -101
- package/cjs/plugins/selectable/addSelectableColumn.js +68 -67
- package/cjs/plugins/selectable/helper.js +39 -50
- package/cjs/plugins/selectable/index.js +9 -35
- package/cjs/plugins/selectable/selectableFormatter.js +105 -83
- package/cjs/plugins/selectable/useSelectableState.js +94 -67
- package/cjs/plugins/sortable/SortablePlugin.js +76 -62
- package/cjs/plugins/sortable/checkIfSortable.js +14 -37
- package/cjs/plugins/sortable/index.js +9 -35
- package/cjs/plugins/sortable/sortHeaderFormatter.js +50 -56
- package/cjs/plugins/sortable/sortTree.js +47 -40
- package/cjs/plugins/sortable/sorter.js +172 -140
- package/cjs/plugins/sortable/useSortableState.js +79 -53
- package/cjs/plugins/toolbar/RowRenderer.js +76 -75
- package/cjs/plugins/toolbar/ToolbarPlugin.js +33 -49
- package/cjs/plugins/toolbar/ToolbarTrigger.js +70 -89
- package/cjs/plugins/toolbar/index.js +9 -35
- package/cjs/plugins/virtualization/AutoHeightList.js +52 -64
- package/cjs/plugins/virtualization/VirtualizationPlugin.js +97 -86
- package/cjs/plugins/virtualization/VirtualizedBody.js +155 -139
- package/cjs/plugins/virtualization/VirtualizedBodyRow.js +17 -39
- package/cjs/plugins/virtualization/helper.js +7 -35
- package/cjs/plugins/virtualization/index.js +9 -35
- package/cjs/renders/CellWithAddons.js +50 -98
- package/cjs/renders/index.js +11 -37
- package/cjs/renders/styled.js +27 -78
- package/cjs/rowSizes.js +12 -44
- package/cjs/utilities/getPluginsFromProps.js +39 -67
- package/cjs/utilities/getScrollbarSize.js +25 -44
- package/cjs/utilities/normalizeData.js +34 -44
- package/esm/DSDataGrid.js +597 -337
- package/esm/DataGridImpl.js +113 -68
- package/esm/PaginatedDataGrid.js +59 -39
- package/esm/blockNames.js +5 -10
- package/esm/columns/IconColumn.js +54 -49
- package/esm/columns/NumberColumn.js +3 -6
- package/esm/components/BodyCell.js +68 -51
- package/esm/components/BodyList.js +43 -23
- package/esm/components/ColumnVisibilityMenuOption.js +27 -24
- package/esm/components/ColumnsOptionsMenuSection.js +38 -30
- package/esm/components/EmptyState.js +40 -52
- package/esm/components/HeaderCell.js +48 -33
- package/esm/components/List.js +23 -12
- package/esm/components/ListItem.js +30 -14
- package/esm/components/NoResults.js +43 -26
- package/esm/components/RowsLoader.js +15 -13
- package/esm/components/Table.js +76 -45
- package/esm/components/TableBody.js +52 -32
- package/esm/components/TableHeader.js +23 -17
- package/esm/components/footer/addOptionalFooterComponents.js +37 -24
- package/esm/components/header/PrimaryControls.js +29 -20
- package/esm/components/header/addOptionalHeaderComponents.js +36 -25
- package/esm/components/index.js +5 -14
- package/esm/components/renderers/defaultClassedRenderers.js +46 -41
- package/esm/components/renderers/index.js +5 -16
- package/esm/components/renderers/renderRowsLoader.js +10 -10
- package/esm/components/tableContext.js +5 -7
- package/esm/defaultPlugins.js +8 -15
- package/esm/index.js +27 -63
- package/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +101 -71
- package/esm/plugins/body-header-scroll-sync/index.js +1 -6
- package/esm/plugins/column-dnd/DndColumnsPlugin.js +68 -69
- package/esm/plugins/column-dnd/decorateGridWithDndColumns.js +18 -16
- package/esm/plugins/column-dnd/index.js +1 -6
- package/esm/plugins/column-sizing/ColumnSizingPlugin.js +37 -20
- package/esm/plugins/column-sizing/columnMeasurerTransformer.js +42 -16
- package/esm/plugins/column-sizing/ext-points/decorateColumn.js +7 -9
- package/esm/plugins/column-sizing/ext-points/getTableProps.js +43 -23
- package/esm/plugins/column-sizing/getColumnNameFromProperty.js +7 -8
- package/esm/plugins/column-sizing/index.js +1 -6
- package/esm/plugins/column-sizing/useColumnSizeService.js +71 -34
- package/esm/plugins/column-sizing/useStylesheetHelpers.js +171 -64
- package/esm/plugins/column-sizing/utils.js +21 -23
- package/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js +7 -8
- package/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +43 -28
- package/esm/plugins/custom-cell-renderer/getRendererComponent.js +44 -22
- package/esm/plugins/custom-cell-renderer/index.js +1 -6
- package/esm/plugins/editable/EditableComponents/ComboBox.js +46 -20
- package/esm/plugins/editable/EditableComponents/TextBox.js +68 -26
- package/esm/plugins/editable/EditableComponents/index.js +2 -8
- package/esm/plugins/editable/EditablePlugin.js +63 -27
- package/esm/plugins/editable/decorateEditable.js +68 -32
- package/esm/plugins/editable/getEditorComponent.js +66 -39
- package/esm/plugins/editable/index.js +3 -9
- package/esm/plugins/expandable-grid/ExpandableColumn.js +133 -82
- package/esm/plugins/expandable-grid/ExpandablePlugin.js +160 -81
- package/esm/plugins/expandable-grid/ExpandedRow.js +124 -86
- package/esm/plugins/expandable-grid/ExpandedRowExtra.js +44 -25
- package/esm/plugins/expandable-grid/index.js +2 -8
- package/esm/plugins/expandable-grid/useExpandGridState.js +25 -14
- package/esm/plugins/export-data/ExportDataPlugin.js +103 -52
- package/esm/plugins/export-data/index.js +1 -6
- package/esm/plugins/filterable/FilterablePlugin.js +44 -22
- package/esm/plugins/filterable/addFilterToColumn.js +20 -11
- package/esm/plugins/filterable/components/FilterableHeader.js +95 -85
- package/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +103 -83
- package/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +63 -68
- package/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +116 -108
- package/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js +106 -84
- package/esm/plugins/filterable/components/filterable-menus/defaultDateFormat.js +3 -6
- package/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +12 -16
- package/esm/plugins/filterable/filterableFormatter.js +45 -32
- package/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js +44 -29
- package/esm/plugins/filterable/filtering-helper/strategiesOperators.js +13 -11
- package/esm/plugins/filterable/helper.js +62 -42
- package/esm/plugins/filterable/index.js +1 -6
- package/esm/plugins/filterable/useFilterableState.js +54 -33
- package/esm/plugins/grouping-by/GroupingByPlugin.js +14 -10
- package/esm/plugins/grouping-grid/GroupingPlugin.js +94 -53
- package/esm/plugins/grouping-grid/walkStrategy.js +22 -17
- package/esm/plugins/index.js +19 -39
- package/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js +74 -31
- package/esm/plugins/infinite-scrolling/index.js +1 -6
- package/esm/plugins/pagination/PaginationPlugin.js +75 -42
- package/esm/plugins/pagination/components/Pagination.js +27 -25
- package/esm/plugins/pagination/components/Paginator.js +35 -29
- package/esm/plugins/pagination/components/PerPageDropdown.js +54 -22
- package/esm/plugins/pagination/helper.js +19 -16
- package/esm/plugins/pagination/index.js +1 -6
- package/esm/plugins/pagination/usePaginationState.js +28 -15
- package/esm/plugins/resizable/ResizablePlugin.js +45 -20
- package/esm/plugins/resizable/decorateResizable.js +41 -19
- package/esm/plugins/resizable/index.js +1 -6
- package/esm/plugins/resizable/useResizeHandle.js +39 -24
- package/esm/plugins/resizable/utils.js +18 -20
- package/esm/plugins/row-dnd/DndRowsPlugin.js +71 -73
- package/esm/plugins/row-dnd/index.js +1 -6
- package/esm/plugins/selectable/SelectablePlugin.js +117 -64
- package/esm/plugins/selectable/addSelectableColumn.js +57 -39
- package/esm/plugins/selectable/helper.js +25 -19
- package/esm/plugins/selectable/index.js +1 -6
- package/esm/plugins/selectable/selectableFormatter.js +97 -54
- package/esm/plugins/selectable/useSelectableState.js +78 -34
- package/esm/plugins/sortable/SortablePlugin.js +43 -30
- package/esm/plugins/sortable/checkIfSortable.js +9 -8
- package/esm/plugins/sortable/index.js +1 -6
- package/esm/plugins/sortable/sortHeaderFormatter.js +43 -27
- package/esm/plugins/sortable/sortTree.js +24 -13
- package/esm/plugins/sortable/sorter.js +163 -112
- package/esm/plugins/sortable/useSortableState.js +49 -22
- package/esm/plugins/toolbar/RowRenderer.js +61 -40
- package/esm/plugins/toolbar/ToolbarPlugin.js +23 -19
- package/esm/plugins/toolbar/ToolbarTrigger.js +57 -59
- package/esm/plugins/toolbar/index.js +1 -6
- package/esm/plugins/virtualization/AutoHeightList.js +40 -30
- package/esm/plugins/virtualization/VirtualizationPlugin.js +84 -55
- package/esm/plugins/virtualization/VirtualizedBody.js +132 -94
- package/esm/plugins/virtualization/VirtualizedBodyRow.js +15 -10
- package/esm/plugins/virtualization/helper.js +3 -6
- package/esm/plugins/virtualization/index.js +1 -6
- package/esm/renders/CellWithAddons.js +40 -69
- package/esm/renders/index.js +2 -8
- package/esm/renders/styled.js +16 -49
- package/esm/rowSizes.js +6 -15
- package/esm/utilities/getPluginsFromProps.js +24 -25
- package/esm/utilities/getScrollbarSize.js +21 -15
- package/esm/utilities/normalizeData.js +24 -15
- package/package.json +20 -20
- package/types/DSDataGrid.d.ts +1 -1
- package/types/DataGridImpl.d.ts +2 -3
- package/types/PaginatedDataGrid.d.ts +2 -1
- package/types/columns/IconColumn.d.ts +2 -3
- package/types/components/BodyCell.d.ts +12 -13
- package/types/components/ColumnVisibilityMenuOption.d.ts +2 -2
- package/types/components/ColumnsOptionsMenuSection.d.ts +0 -1
- package/types/components/HeaderCell.d.ts +10 -10
- package/types/components/NoResults.d.ts +2 -2
- package/types/components/RowsLoader.d.ts +2 -2
- package/types/components/Table.d.ts +11 -6
- package/types/components/TableBody.d.ts +8 -3
- package/types/components/TableHeader.d.ts +1 -2
- package/types/components/footer/addOptionalFooterComponents.d.ts +0 -1
- package/types/components/header/PrimaryControls.d.ts +0 -1
- package/types/components/header/addOptionalHeaderComponents.d.ts +1 -1
- package/types/components/renderers/index.d.ts +1 -1
- package/types/components/renderers/renderRowsLoader.d.ts +1 -1
- package/types/index.d.ts +8 -7
- package/types/plugins/body-header-scroll-sync/index.d.ts +1 -1
- package/types/plugins/column-dnd/index.d.ts +1 -1
- package/types/plugins/column-sizing/getColumnNameFromProperty.d.ts +1 -2
- package/types/plugins/column-sizing/index.d.ts +1 -1
- package/types/plugins/column-sizing/useColumnSizeService.d.ts +1 -2
- package/types/plugins/custom-cell-renderer/addCustomRendererToCell.d.ts +0 -1
- package/types/plugins/custom-cell-renderer/getRendererComponent.d.ts +0 -1
- package/types/plugins/custom-cell-renderer/index.d.ts +1 -1
- package/types/plugins/editable/EditableComponents/ComboBox.d.ts +1 -3
- package/types/plugins/editable/EditableComponents/TextBox.d.ts +1 -3
- package/types/plugins/editable/getEditorComponent.d.ts +0 -1
- package/types/plugins/editable/index.d.ts +2 -2
- package/types/plugins/expandable-grid/ExpandableColumn.d.ts +2 -3
- package/types/plugins/expandable-grid/ExpandedRow.d.ts +0 -1
- package/types/plugins/expandable-grid/ExpandedRowExtra.d.ts +0 -1
- package/types/plugins/expandable-grid/index.d.ts +2 -2
- package/types/plugins/export-data/index.d.ts +1 -1
- package/types/plugins/filterable/components/FilterableHeader.d.ts +15 -15
- package/types/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.d.ts +0 -1
- package/types/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.d.ts +0 -1
- package/types/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.d.ts +1 -2
- package/types/plugins/filterable/components/filterable-menus/TextFilterMenu.d.ts +0 -1
- package/types/plugins/filterable/components/filterable-menus/getFilterMenuByType.d.ts +1 -2
- package/types/plugins/filterable/filterableFormatter.d.ts +2 -3
- package/types/plugins/filterable/filtering-helper/filterRowsByQuery.d.ts +1 -2
- package/types/plugins/filterable/filtering-helper/strategiesOperators.d.ts +2 -2
- package/types/plugins/filterable/index.d.ts +1 -1
- package/types/plugins/index.d.ts +16 -16
- package/types/plugins/infinite-scrolling/index.d.ts +1 -1
- package/types/plugins/pagination/components/Paginator.d.ts +0 -1
- package/types/plugins/pagination/components/PerPageDropdown.d.ts +0 -1
- package/types/plugins/pagination/helper.d.ts +2 -3
- package/types/plugins/pagination/index.d.ts +1 -1
- package/types/plugins/resizable/index.d.ts +1 -1
- package/types/plugins/row-dnd/index.d.ts +1 -1
- package/types/plugins/selectable/index.d.ts +1 -1
- package/types/plugins/selectable/selectableFormatter.d.ts +0 -1
- package/types/plugins/sortable/index.d.ts +1 -1
- package/types/plugins/sortable/sortHeaderFormatter.d.ts +0 -1
- package/types/plugins/sortable/sortTree.d.ts +0 -1
- package/types/plugins/sortable/sorter.d.ts +1 -1
- package/types/plugins/toolbar/index.d.ts +1 -1
- package/types/plugins/virtualization/AutoHeightList.d.ts +1 -1
- package/types/plugins/virtualization/VirtualizedBody.d.ts +0 -1
- package/types/plugins/virtualization/VirtualizedBodyRow.d.ts +2 -2
- package/types/plugins/virtualization/index.d.ts +1 -1
- package/types/utilities/getPluginsFromProps.d.ts +1 -2
- package/cjs/DSDataGrid.js.map +0 -7
- package/cjs/DataGridImpl.js.map +0 -7
- package/cjs/PaginatedDataGrid.js.map +0 -7
- package/cjs/blockNames.js.map +0 -7
- package/cjs/columns/IconColumn.js.map +0 -7
- package/cjs/columns/NumberColumn.js.map +0 -7
- package/cjs/components/BodyCell.js.map +0 -7
- package/cjs/components/BodyList.js.map +0 -7
- package/cjs/components/ColumnVisibilityMenuOption.js.map +0 -7
- package/cjs/components/ColumnsOptionsMenuSection.js.map +0 -7
- package/cjs/components/EmptyState.js.map +0 -7
- package/cjs/components/HeaderCell.js.map +0 -7
- package/cjs/components/List.js.map +0 -7
- package/cjs/components/ListItem.js.map +0 -7
- package/cjs/components/NoResults.js.map +0 -7
- package/cjs/components/RowsLoader.js.map +0 -7
- package/cjs/components/Table.js.map +0 -7
- package/cjs/components/TableBody.js.map +0 -7
- package/cjs/components/TableHeader.js.map +0 -7
- package/cjs/components/footer/addOptionalFooterComponents.js.map +0 -7
- package/cjs/components/header/PrimaryControls.js.map +0 -7
- package/cjs/components/header/addOptionalHeaderComponents.js.map +0 -7
- package/cjs/components/index.js.map +0 -7
- package/cjs/components/renderers/defaultClassedRenderers.js.map +0 -7
- package/cjs/components/renderers/index.js.map +0 -7
- package/cjs/components/renderers/renderRowsLoader.js.map +0 -7
- package/cjs/components/tableContext.js.map +0 -7
- package/cjs/defaultPlugins.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +0 -7
- package/cjs/plugins/body-header-scroll-sync/index.js.map +0 -7
- package/cjs/plugins/column-dnd/DndColumnsPlugin.js.map +0 -7
- package/cjs/plugins/column-dnd/decorateGridWithDndColumns.js.map +0 -7
- package/cjs/plugins/column-dnd/index.js.map +0 -7
- package/cjs/plugins/column-sizing/ColumnSizingPlugin.js.map +0 -7
- package/cjs/plugins/column-sizing/columnMeasurerTransformer.js.map +0 -7
- package/cjs/plugins/column-sizing/ext-points/decorateColumn.js.map +0 -7
- package/cjs/plugins/column-sizing/ext-points/getTableProps.js.map +0 -7
- package/cjs/plugins/column-sizing/getColumnNameFromProperty.js.map +0 -7
- package/cjs/plugins/column-sizing/index.js.map +0 -7
- package/cjs/plugins/column-sizing/useColumnSizeService.js.map +0 -7
- package/cjs/plugins/column-sizing/useStylesheetHelpers.js.map +0 -7
- package/cjs/plugins/column-sizing/utils.js.map +0 -7
- package/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +0 -7
- package/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +0 -7
- package/cjs/plugins/custom-cell-renderer/getRendererComponent.js.map +0 -7
- package/cjs/plugins/custom-cell-renderer/index.js.map +0 -7
- package/cjs/plugins/editable/EditableComponents/ComboBox.js.map +0 -7
- package/cjs/plugins/editable/EditableComponents/TextBox.js.map +0 -7
- package/cjs/plugins/editable/EditableComponents/index.js.map +0 -7
- package/cjs/plugins/editable/EditablePlugin.js.map +0 -7
- package/cjs/plugins/editable/decorateEditable.js.map +0 -7
- package/cjs/plugins/editable/getEditorComponent.js.map +0 -7
- package/cjs/plugins/editable/index.js.map +0 -7
- package/cjs/plugins/expandable-grid/ExpandableColumn.js.map +0 -7
- package/cjs/plugins/expandable-grid/ExpandablePlugin.js.map +0 -7
- package/cjs/plugins/expandable-grid/ExpandedRow.js.map +0 -7
- package/cjs/plugins/expandable-grid/ExpandedRowExtra.js.map +0 -7
- package/cjs/plugins/expandable-grid/index.js.map +0 -7
- package/cjs/plugins/expandable-grid/useExpandGridState.js.map +0 -7
- package/cjs/plugins/export-data/ExportDataPlugin.js.map +0 -7
- package/cjs/plugins/export-data/index.js.map +0 -7
- package/cjs/plugins/filterable/FilterablePlugin.js.map +0 -7
- package/cjs/plugins/filterable/addFilterToColumn.js.map +0 -7
- package/cjs/plugins/filterable/components/FilterableHeader.js.map +0 -7
- package/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +0 -7
- package/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +0 -7
- package/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +0 -7
- package/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +0 -7
- package/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +0 -7
- package/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +0 -7
- package/cjs/plugins/filterable/filterableFormatter.js.map +0 -7
- package/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +0 -7
- package/cjs/plugins/filterable/filtering-helper/strategiesOperators.js.map +0 -7
- package/cjs/plugins/filterable/helper.js.map +0 -7
- package/cjs/plugins/filterable/index.js.map +0 -7
- package/cjs/plugins/filterable/useFilterableState.js.map +0 -7
- package/cjs/plugins/grouping-by/GroupingByPlugin.js.map +0 -7
- package/cjs/plugins/grouping-grid/GroupingPlugin.js.map +0 -7
- package/cjs/plugins/grouping-grid/walkStrategy.js.map +0 -7
- package/cjs/plugins/index.js.map +0 -7
- package/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +0 -7
- package/cjs/plugins/infinite-scrolling/index.js.map +0 -7
- package/cjs/plugins/pagination/PaginationPlugin.js.map +0 -7
- package/cjs/plugins/pagination/components/Pagination.js.map +0 -7
- package/cjs/plugins/pagination/components/Paginator.js.map +0 -7
- package/cjs/plugins/pagination/components/PerPageDropdown.js.map +0 -7
- package/cjs/plugins/pagination/helper.js.map +0 -7
- package/cjs/plugins/pagination/index.js.map +0 -7
- package/cjs/plugins/pagination/usePaginationState.js.map +0 -7
- package/cjs/plugins/resizable/ResizablePlugin.js.map +0 -7
- package/cjs/plugins/resizable/decorateResizable.js.map +0 -7
- package/cjs/plugins/resizable/index.js.map +0 -7
- package/cjs/plugins/resizable/useResizeHandle.js.map +0 -7
- package/cjs/plugins/resizable/utils.js.map +0 -7
- package/cjs/plugins/row-dnd/DndRowsPlugin.js.map +0 -7
- package/cjs/plugins/row-dnd/index.js.map +0 -7
- package/cjs/plugins/selectable/SelectablePlugin.js.map +0 -7
- package/cjs/plugins/selectable/addSelectableColumn.js.map +0 -7
- package/cjs/plugins/selectable/helper.js.map +0 -7
- package/cjs/plugins/selectable/index.js.map +0 -7
- package/cjs/plugins/selectable/selectableFormatter.js.map +0 -7
- package/cjs/plugins/selectable/useSelectableState.js.map +0 -7
- package/cjs/plugins/sortable/SortablePlugin.js.map +0 -7
- package/cjs/plugins/sortable/checkIfSortable.js.map +0 -7
- package/cjs/plugins/sortable/index.js.map +0 -7
- package/cjs/plugins/sortable/sortHeaderFormatter.js.map +0 -7
- package/cjs/plugins/sortable/sortTree.js.map +0 -7
- package/cjs/plugins/sortable/sorter.js.map +0 -7
- package/cjs/plugins/sortable/useSortableState.js.map +0 -7
- package/cjs/plugins/toolbar/RowRenderer.js.map +0 -7
- package/cjs/plugins/toolbar/ToolbarPlugin.js.map +0 -7
- package/cjs/plugins/toolbar/ToolbarTrigger.js.map +0 -7
- package/cjs/plugins/toolbar/index.js.map +0 -7
- package/cjs/plugins/virtualization/AutoHeightList.js.map +0 -7
- package/cjs/plugins/virtualization/VirtualizationPlugin.js.map +0 -7
- package/cjs/plugins/virtualization/VirtualizedBody.js.map +0 -7
- package/cjs/plugins/virtualization/VirtualizedBodyRow.js.map +0 -7
- package/cjs/plugins/virtualization/helper.js.map +0 -7
- package/cjs/plugins/virtualization/index.js.map +0 -7
- package/cjs/renders/CellWithAddons.js.map +0 -7
- package/cjs/renders/index.js.map +0 -7
- package/cjs/renders/styled.js.map +0 -7
- package/cjs/rowSizes.js.map +0 -7
- package/cjs/utilities/DataGridUtilities.json +0 -1315
- package/cjs/utilities/getPluginsFromProps.js.map +0 -7
- package/cjs/utilities/getScrollbarSize.js.map +0 -7
- package/cjs/utilities/normalizeData.js.map +0 -7
- package/esm/DSDataGrid.js.map +0 -7
- package/esm/DataGridImpl.js.map +0 -7
- package/esm/PaginatedDataGrid.js.map +0 -7
- package/esm/blockNames.js.map +0 -7
- package/esm/columns/IconColumn.js.map +0 -7
- package/esm/columns/NumberColumn.js.map +0 -7
- package/esm/components/BodyCell.js.map +0 -7
- package/esm/components/BodyList.js.map +0 -7
- package/esm/components/ColumnVisibilityMenuOption.js.map +0 -7
- package/esm/components/ColumnsOptionsMenuSection.js.map +0 -7
- package/esm/components/EmptyState.js.map +0 -7
- package/esm/components/HeaderCell.js.map +0 -7
- package/esm/components/List.js.map +0 -7
- package/esm/components/ListItem.js.map +0 -7
- package/esm/components/NoResults.js.map +0 -7
- package/esm/components/RowsLoader.js.map +0 -7
- package/esm/components/Table.js.map +0 -7
- package/esm/components/TableBody.js.map +0 -7
- package/esm/components/TableHeader.js.map +0 -7
- package/esm/components/footer/addOptionalFooterComponents.js.map +0 -7
- package/esm/components/header/PrimaryControls.js.map +0 -7
- package/esm/components/header/addOptionalHeaderComponents.js.map +0 -7
- package/esm/components/index.js.map +0 -7
- package/esm/components/renderers/defaultClassedRenderers.js.map +0 -7
- package/esm/components/renderers/index.js.map +0 -7
- package/esm/components/renderers/renderRowsLoader.js.map +0 -7
- package/esm/components/tableContext.js.map +0 -7
- package/esm/defaultPlugins.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +0 -7
- package/esm/plugins/body-header-scroll-sync/index.js.map +0 -7
- package/esm/plugins/column-dnd/DndColumnsPlugin.js.map +0 -7
- package/esm/plugins/column-dnd/decorateGridWithDndColumns.js.map +0 -7
- package/esm/plugins/column-dnd/index.js.map +0 -7
- package/esm/plugins/column-sizing/ColumnSizingPlugin.js.map +0 -7
- package/esm/plugins/column-sizing/columnMeasurerTransformer.js.map +0 -7
- package/esm/plugins/column-sizing/ext-points/decorateColumn.js.map +0 -7
- package/esm/plugins/column-sizing/ext-points/getTableProps.js.map +0 -7
- package/esm/plugins/column-sizing/getColumnNameFromProperty.js.map +0 -7
- package/esm/plugins/column-sizing/index.js.map +0 -7
- package/esm/plugins/column-sizing/useColumnSizeService.js.map +0 -7
- package/esm/plugins/column-sizing/useStylesheetHelpers.js.map +0 -7
- package/esm/plugins/column-sizing/utils.js.map +0 -7
- package/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +0 -7
- package/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +0 -7
- package/esm/plugins/custom-cell-renderer/getRendererComponent.js.map +0 -7
- package/esm/plugins/custom-cell-renderer/index.js.map +0 -7
- package/esm/plugins/editable/EditableComponents/ComboBox.js.map +0 -7
- package/esm/plugins/editable/EditableComponents/TextBox.js.map +0 -7
- package/esm/plugins/editable/EditableComponents/index.js.map +0 -7
- package/esm/plugins/editable/EditablePlugin.js.map +0 -7
- package/esm/plugins/editable/decorateEditable.js.map +0 -7
- package/esm/plugins/editable/getEditorComponent.js.map +0 -7
- package/esm/plugins/editable/index.js.map +0 -7
- package/esm/plugins/expandable-grid/ExpandableColumn.js.map +0 -7
- package/esm/plugins/expandable-grid/ExpandablePlugin.js.map +0 -7
- package/esm/plugins/expandable-grid/ExpandedRow.js.map +0 -7
- package/esm/plugins/expandable-grid/ExpandedRowExtra.js.map +0 -7
- package/esm/plugins/expandable-grid/index.js.map +0 -7
- package/esm/plugins/expandable-grid/useExpandGridState.js.map +0 -7
- package/esm/plugins/export-data/ExportDataPlugin.js.map +0 -7
- package/esm/plugins/export-data/index.js.map +0 -7
- package/esm/plugins/filterable/FilterablePlugin.js.map +0 -7
- package/esm/plugins/filterable/addFilterToColumn.js.map +0 -7
- package/esm/plugins/filterable/components/FilterableHeader.js.map +0 -7
- package/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +0 -7
- package/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +0 -7
- package/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +0 -7
- package/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +0 -7
- package/esm/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +0 -7
- package/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +0 -7
- package/esm/plugins/filterable/filterableFormatter.js.map +0 -7
- package/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +0 -7
- package/esm/plugins/filterable/filtering-helper/strategiesOperators.js.map +0 -7
- package/esm/plugins/filterable/helper.js.map +0 -7
- package/esm/plugins/filterable/index.js.map +0 -7
- package/esm/plugins/filterable/useFilterableState.js.map +0 -7
- package/esm/plugins/grouping-by/GroupingByPlugin.js.map +0 -7
- package/esm/plugins/grouping-grid/GroupingPlugin.js.map +0 -7
- package/esm/plugins/grouping-grid/walkStrategy.js.map +0 -7
- package/esm/plugins/index.js.map +0 -7
- package/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +0 -7
- package/esm/plugins/infinite-scrolling/index.js.map +0 -7
- package/esm/plugins/pagination/PaginationPlugin.js.map +0 -7
- package/esm/plugins/pagination/components/Pagination.js.map +0 -7
- package/esm/plugins/pagination/components/Paginator.js.map +0 -7
- package/esm/plugins/pagination/components/PerPageDropdown.js.map +0 -7
- package/esm/plugins/pagination/helper.js.map +0 -7
- package/esm/plugins/pagination/index.js.map +0 -7
- package/esm/plugins/pagination/usePaginationState.js.map +0 -7
- package/esm/plugins/resizable/ResizablePlugin.js.map +0 -7
- package/esm/plugins/resizable/decorateResizable.js.map +0 -7
- package/esm/plugins/resizable/index.js.map +0 -7
- package/esm/plugins/resizable/useResizeHandle.js.map +0 -7
- package/esm/plugins/resizable/utils.js.map +0 -7
- package/esm/plugins/row-dnd/DndRowsPlugin.js.map +0 -7
- package/esm/plugins/row-dnd/index.js.map +0 -7
- package/esm/plugins/selectable/SelectablePlugin.js.map +0 -7
- package/esm/plugins/selectable/addSelectableColumn.js.map +0 -7
- package/esm/plugins/selectable/helper.js.map +0 -7
- package/esm/plugins/selectable/index.js.map +0 -7
- package/esm/plugins/selectable/selectableFormatter.js.map +0 -7
- package/esm/plugins/selectable/useSelectableState.js.map +0 -7
- package/esm/plugins/sortable/SortablePlugin.js.map +0 -7
- package/esm/plugins/sortable/checkIfSortable.js.map +0 -7
- package/esm/plugins/sortable/index.js.map +0 -7
- package/esm/plugins/sortable/sortHeaderFormatter.js.map +0 -7
- package/esm/plugins/sortable/sortTree.js.map +0 -7
- package/esm/plugins/sortable/sorter.js.map +0 -7
- package/esm/plugins/sortable/useSortableState.js.map +0 -7
- package/esm/plugins/toolbar/RowRenderer.js.map +0 -7
- package/esm/plugins/toolbar/ToolbarPlugin.js.map +0 -7
- package/esm/plugins/toolbar/ToolbarTrigger.js.map +0 -7
- package/esm/plugins/toolbar/index.js.map +0 -7
- package/esm/plugins/virtualization/AutoHeightList.js.map +0 -7
- package/esm/plugins/virtualization/VirtualizationPlugin.js.map +0 -7
- package/esm/plugins/virtualization/VirtualizedBody.js.map +0 -7
- package/esm/plugins/virtualization/VirtualizedBodyRow.js.map +0 -7
- package/esm/plugins/virtualization/helper.js.map +0 -7
- package/esm/plugins/virtualization/index.js.map +0 -7
- package/esm/renders/CellWithAddons.js.map +0 -7
- package/esm/renders/index.js.map +0 -7
- package/esm/renders/styled.js.map +0 -7
- package/esm/rowSizes.js.map +0 -7
- package/esm/utilities/DataGridUtilities.json +0 -1315
- package/esm/utilities/getPluginsFromProps.js.map +0 -7
- package/esm/utilities/getScrollbarSize.js.map +0 -7
- package/esm/utilities/normalizeData.js.map +0 -7
|
@@ -1,63 +1,96 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
3
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
6
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
7
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
8
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
9
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
10
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
11
|
+
import React, { useMemo } from 'react';
|
|
12
|
+
import { mergeRefs } from '@elliemae/ds-utilities';
|
|
13
|
+
import FocusGridManager from '@elliemae/ds-shared/FocusGroup/FocusGrid';
|
|
14
|
+
import createInstancePlugin from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';
|
|
15
|
+
import paginate from './helper.js';
|
|
16
|
+
import { usePaginationState } from './usePaginationState.js';
|
|
17
|
+
import NoResults from '../../components/NoResults.js';
|
|
18
|
+
import { jsx } from 'react/jsx-runtime';
|
|
19
|
+
|
|
20
|
+
const _excluded = ["component", "rows", "rowRenderer", "noResultsPlaceholder", "innerRef", "innerBodyRef", "isPlaceholderActive"];
|
|
21
|
+
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
+
|
|
9
26
|
const composeRows = (rows, grid) => {
|
|
10
27
|
const {
|
|
11
|
-
state: {
|
|
12
|
-
|
|
28
|
+
state: {
|
|
29
|
+
pagination
|
|
30
|
+
},
|
|
31
|
+
props: {
|
|
32
|
+
groupedRows
|
|
33
|
+
}
|
|
13
34
|
} = grid.getInstance();
|
|
14
|
-
if (groupedRows)
|
|
15
|
-
|
|
35
|
+
if (groupedRows) return rows; // disable pagination with grouping
|
|
36
|
+
|
|
16
37
|
if (groupedRows) {
|
|
17
|
-
const filterIds = rows.map(
|
|
18
|
-
return paginate(rows.filter(
|
|
19
|
-
...r,
|
|
38
|
+
const filterIds = rows.map(r => r.id);
|
|
39
|
+
return paginate(rows.filter(c => filterIds.includes(c.id)).map(r => _objectSpread(_objectSpread({}, r), {}, {
|
|
20
40
|
_isGroup: r.isGroup
|
|
21
41
|
})), pagination);
|
|
22
42
|
}
|
|
43
|
+
|
|
23
44
|
return paginate(rows, pagination);
|
|
24
45
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
46
|
+
|
|
47
|
+
const Body = /*#__PURE__*/React.memo(_ref => {
|
|
48
|
+
let {
|
|
49
|
+
component: Component,
|
|
50
|
+
rows,
|
|
51
|
+
rowRenderer,
|
|
52
|
+
noResultsPlaceholder,
|
|
53
|
+
innerRef,
|
|
54
|
+
innerBodyRef,
|
|
55
|
+
// depends on body-header-scroll-sync
|
|
56
|
+
isPlaceholderActive = false
|
|
57
|
+
} = _ref,
|
|
58
|
+
otherBodyProps = _objectWithoutProperties(_ref, _excluded);
|
|
59
|
+
|
|
60
|
+
return /*#__PURE__*/jsx(Component, _objectSpread(_objectSpread({}, otherBodyProps), {}, {
|
|
61
|
+
innerRef: mergeRefs(innerRef),
|
|
62
|
+
children: !isPlaceholderActive ? rows.map((row, index) => rowRenderer(row, {
|
|
63
|
+
index,
|
|
64
|
+
rowIndex: index
|
|
65
|
+
}, {})) : /*#__PURE__*/_jsx(NoResults, {
|
|
66
|
+
innerRef: innerRef,
|
|
67
|
+
rowRenderer: rowRenderer
|
|
68
|
+
}, void 0, noResultsPlaceholder)
|
|
69
|
+
}));
|
|
70
|
+
});
|
|
71
|
+
|
|
41
72
|
const decorateRenderers = (renderers, grid) => {
|
|
42
73
|
const BodyWrapper = renderers.body.wrapper;
|
|
43
|
-
renderers.body.wrapper = useMemo(() =>
|
|
44
|
-
const {
|
|
45
|
-
return /* @__PURE__ */ React2.createElement(FocusGrid, {
|
|
74
|
+
renderers.body.wrapper = useMemo(() => props => {
|
|
75
|
+
const {
|
|
46
76
|
hotKeys,
|
|
77
|
+
shouldRefocus,
|
|
78
|
+
state
|
|
79
|
+
} = grid.getInstance();
|
|
80
|
+
return /*#__PURE__*/_jsx(FocusGridManager, {
|
|
81
|
+
hotKeys: hotKeys,
|
|
47
82
|
shouldRefocus: false
|
|
48
|
-
},
|
|
49
|
-
...props,
|
|
83
|
+
}, void 0, /*#__PURE__*/jsx(Body, _objectSpread(_objectSpread({}, props), {}, {
|
|
50
84
|
component: BodyWrapper
|
|
51
|
-
}));
|
|
85
|
+
})));
|
|
52
86
|
}, []);
|
|
53
87
|
return renderers;
|
|
54
88
|
};
|
|
55
|
-
|
|
89
|
+
|
|
90
|
+
const PaginationPlugin = createInstancePlugin('pagination', {
|
|
56
91
|
registerStateHook: usePaginationState,
|
|
57
92
|
decorateRenderers,
|
|
58
93
|
composeRows
|
|
59
94
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=PaginationPlugin.js.map
|
|
95
|
+
|
|
96
|
+
export { PaginationPlugin };
|
|
@@ -1,34 +1,36 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { aggregatedClasses } from
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
4
|
+
import Paginator from './Paginator.js';
|
|
5
|
+
import PerPageDropdown from './PerPageDropdown.js';
|
|
6
|
+
|
|
7
|
+
const PaginationControls = aggregatedClasses('div')('data-grid', 'controls-pagination');
|
|
8
|
+
|
|
9
|
+
const Pagination = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
paginated,
|
|
12
|
+
pagination = {},
|
|
13
|
+
onPerPage,
|
|
14
|
+
onPageSelect,
|
|
15
|
+
paginationStep = 5,
|
|
16
|
+
maxPerPage = 10,
|
|
17
|
+
minPerPage = 5
|
|
18
|
+
} = _ref;
|
|
19
|
+
const {
|
|
20
|
+
perPage
|
|
21
|
+
} = pagination;
|
|
22
|
+
if (pagination && pagination.conditionalPagination === true && paginated.amount === 1) return null;
|
|
23
|
+
return paginated.amount > 0 ? /*#__PURE__*/_jsx(PaginationControls, {}, void 0, /*#__PURE__*/_jsx(PerPageDropdown, {
|
|
20
24
|
max: maxPerPage,
|
|
21
25
|
min: minPerPage,
|
|
22
26
|
onChange: onPerPage,
|
|
23
27
|
step: paginationStep,
|
|
24
28
|
value: perPage
|
|
25
|
-
}),
|
|
29
|
+
}), /*#__PURE__*/_jsx(Paginator, {
|
|
26
30
|
onSelect: onPageSelect,
|
|
27
31
|
pages: paginated.amount,
|
|
28
|
-
pagination
|
|
32
|
+
pagination: pagination
|
|
29
33
|
})) : null;
|
|
30
34
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=Pagination.js.map
|
|
35
|
+
|
|
36
|
+
export { Pagination };
|
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import ReactPagify from
|
|
4
|
-
import segmentize from
|
|
5
|
-
import { aggregatedClasses } from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
1
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'react';
|
|
3
|
+
import ReactPagify from 'react-pagify';
|
|
4
|
+
import segmentize from 'segmentize';
|
|
5
|
+
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
6
|
+
|
|
7
|
+
var _ReactPagify$Segment, _ReactPagify$Ellipsis, _ReactPagify$Segment2, _ReactPagify$Segment3, _ReactPagify$Segment4, _ReactPagify$Ellipsis2, _ReactPagify$Segment5;
|
|
8
|
+
const blockName = 'data-grid';
|
|
9
|
+
const PaginationContainer = aggregatedClasses('div')(blockName, 'pagination');
|
|
10
|
+
const PagifyContext = aggregatedClasses(ReactPagify === null || ReactPagify === void 0 ? void 0 : ReactPagify.Context)(blockName, 'pagify-pagination');
|
|
11
|
+
|
|
12
|
+
const Paginator = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
pagination,
|
|
15
|
+
pages,
|
|
16
|
+
onSelect,
|
|
17
|
+
labelPrevious = 'Previous',
|
|
18
|
+
labelNext = 'Next'
|
|
19
|
+
} = _ref;
|
|
10
20
|
const prevPage = pagination.page - 1;
|
|
11
21
|
const nextPage = pagination.page + 1;
|
|
12
|
-
return
|
|
13
|
-
onSelect:
|
|
22
|
+
return /*#__PURE__*/_jsx(PaginationContainer, {}, void 0, /*#__PURE__*/_jsx(PagifyContext, {
|
|
23
|
+
onSelect: page => page !== pagination.page && onSelect(page),
|
|
14
24
|
segments: segmentize({
|
|
15
25
|
page: pagination.page,
|
|
16
26
|
pages,
|
|
@@ -18,36 +28,32 @@ const Paginator = ({ pagination, pages, onSelect, labelPrevious = "Previous", la
|
|
|
18
28
|
endPages: 1,
|
|
19
29
|
sidePages: 1
|
|
20
30
|
})
|
|
21
|
-
},
|
|
22
|
-
className: pagination.page <= 1 ?
|
|
31
|
+
}, void 0, /*#__PURE__*/_jsx(ReactPagify.Button, {
|
|
32
|
+
className: pagination.page <= 1 ? 'button-disabled' : '',
|
|
23
33
|
page: prevPage
|
|
24
|
-
}, labelPrevious),
|
|
34
|
+
}, void 0, labelPrevious), _ReactPagify$Segment || (_ReactPagify$Segment = /*#__PURE__*/_jsx(ReactPagify.Segment, {
|
|
25
35
|
field: "beginPages"
|
|
26
|
-
}),
|
|
36
|
+
})), _ReactPagify$Ellipsis || (_ReactPagify$Ellipsis = /*#__PURE__*/_jsx(ReactPagify.Ellipsis, {
|
|
27
37
|
className: "ellipsis",
|
|
28
38
|
nextField: "previousPages",
|
|
29
39
|
previousField: "beginPages"
|
|
30
|
-
}),
|
|
40
|
+
})), _ReactPagify$Segment2 || (_ReactPagify$Segment2 = /*#__PURE__*/_jsx(ReactPagify.Segment, {
|
|
31
41
|
field: "previousPages"
|
|
32
|
-
}),
|
|
42
|
+
})), _ReactPagify$Segment3 || (_ReactPagify$Segment3 = /*#__PURE__*/_jsx(ReactPagify.Segment, {
|
|
33
43
|
className: "selected",
|
|
34
44
|
field: "centerPage"
|
|
35
|
-
}),
|
|
45
|
+
})), _ReactPagify$Segment4 || (_ReactPagify$Segment4 = /*#__PURE__*/_jsx(ReactPagify.Segment, {
|
|
36
46
|
field: "nextPages"
|
|
37
|
-
}),
|
|
47
|
+
})), _ReactPagify$Ellipsis2 || (_ReactPagify$Ellipsis2 = /*#__PURE__*/_jsx(ReactPagify.Ellipsis, {
|
|
38
48
|
className: "ellipsis",
|
|
39
49
|
nextField: "endPages",
|
|
40
50
|
previousField: "nextPages"
|
|
41
|
-
}),
|
|
51
|
+
})), _ReactPagify$Segment5 || (_ReactPagify$Segment5 = /*#__PURE__*/_jsx(ReactPagify.Segment, {
|
|
42
52
|
field: "endPages"
|
|
43
|
-
}),
|
|
44
|
-
className: pagination.page >= pages ?
|
|
53
|
+
})), /*#__PURE__*/_jsx(ReactPagify.Button, {
|
|
54
|
+
className: pagination.page >= pages ? 'button-disabled' : '',
|
|
45
55
|
page: nextPage
|
|
46
|
-
}, labelNext)));
|
|
56
|
+
}, void 0, labelNext)));
|
|
47
57
|
};
|
|
48
|
-
|
|
49
|
-
export {
|
|
50
|
-
Paginator,
|
|
51
|
-
Paginator_default as default
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=Paginator.js.map
|
|
58
|
+
|
|
59
|
+
export { Paginator as default };
|
|
@@ -1,39 +1,71 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
9
|
+
import 'core-js/modules/esnext.async-iterator.map.js';
|
|
10
|
+
import 'core-js/modules/esnext.iterator.map.js';
|
|
11
|
+
import 'react';
|
|
12
|
+
import memoizeOne from 'memoize-one';
|
|
13
|
+
import { range } from '@elliemae/ds-utilities';
|
|
14
|
+
import { DSComboBox, components } from '@elliemae/ds-form';
|
|
15
|
+
import { jsxs } from 'react/jsx-runtime';
|
|
16
|
+
|
|
17
|
+
var _span;
|
|
18
|
+
|
|
19
|
+
const _excluded = ["children"];
|
|
20
|
+
|
|
21
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
22
|
+
|
|
23
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
24
|
+
|
|
25
|
+
const SingleValue = _ref => {
|
|
26
|
+
let {
|
|
27
|
+
children
|
|
28
|
+
} = _ref,
|
|
29
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
30
|
+
|
|
31
|
+
return /*#__PURE__*/jsxs(components.SingleValue, _objectSpread(_objectSpread({}, props), {}, {
|
|
32
|
+
children: [children, " ", _span || (_span = /*#__PURE__*/_jsx("span", {}, void 0, "per page"))]
|
|
33
|
+
}));
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const generateOption = value => ({
|
|
10
37
|
value,
|
|
11
38
|
label: value
|
|
12
39
|
});
|
|
13
|
-
|
|
40
|
+
|
|
41
|
+
const getOptions = memoizeOne((step, min, max) => {
|
|
14
42
|
const options = range(min, max + step, step).map(generateOption);
|
|
15
43
|
return min === 0 ? options.slice(1, options.length) : options;
|
|
16
44
|
});
|
|
17
|
-
|
|
45
|
+
|
|
46
|
+
function PerPageDropdown(_ref2) {
|
|
47
|
+
let {
|
|
48
|
+
min = 0,
|
|
49
|
+
max = 100,
|
|
50
|
+
step = 5,
|
|
51
|
+
value = 0,
|
|
52
|
+
onChange = () => null
|
|
53
|
+
} = _ref2;
|
|
18
54
|
const options = getOptions(step, min, max);
|
|
19
|
-
return
|
|
55
|
+
return /*#__PURE__*/_jsx(DSComboBox, {
|
|
20
56
|
className: "per-page-dropdown",
|
|
21
57
|
components: {
|
|
22
58
|
SingleValue
|
|
23
59
|
},
|
|
24
60
|
containerProps: {
|
|
25
|
-
|
|
61
|
+
'data-testid': 'per-page-dropdown'
|
|
26
62
|
},
|
|
27
63
|
maxOptions: 10,
|
|
28
|
-
onChange,
|
|
29
|
-
options,
|
|
64
|
+
onChange: onChange,
|
|
65
|
+
options: options,
|
|
30
66
|
searchable: false,
|
|
31
|
-
value
|
|
67
|
+
value: value
|
|
32
68
|
});
|
|
33
69
|
}
|
|
34
|
-
|
|
35
|
-
export {
|
|
36
|
-
PerPageDropdown,
|
|
37
|
-
PerPageDropdown_default as default
|
|
38
|
-
};
|
|
39
|
-
//# sourceMappingURL=PerPageDropdown.js.map
|
|
70
|
+
|
|
71
|
+
export { PerPageDropdown as default };
|
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (number > max)
|
|
4
|
-
|
|
5
|
-
if (number < min)
|
|
6
|
-
return min;
|
|
1
|
+
const parsePerPageNumber = function (number, max) {
|
|
2
|
+
let min = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
3
|
+
if (number > max) return max;
|
|
4
|
+
if (number < min) return min;
|
|
7
5
|
return number;
|
|
8
6
|
};
|
|
9
|
-
|
|
7
|
+
function paginate(rows, _ref) {
|
|
8
|
+
let {
|
|
9
|
+
page,
|
|
10
|
+
perPage = 1,
|
|
11
|
+
amountOfPages: amount,
|
|
12
|
+
totalRows
|
|
13
|
+
} = _ref;
|
|
14
|
+
|
|
15
|
+
// return if pagination state is controlled
|
|
10
16
|
if (amount && totalRows) {
|
|
11
17
|
return {
|
|
12
18
|
amount,
|
|
13
19
|
rows,
|
|
14
20
|
page
|
|
15
21
|
};
|
|
16
|
-
}
|
|
22
|
+
} // adapt to zero indexed logic
|
|
23
|
+
|
|
24
|
+
|
|
17
25
|
const p = page - 1 || 0;
|
|
18
26
|
const amountOfPages = perPage ? Math.ceil(rows.length / (perPage > 0 ? perPage : 1)) : 1;
|
|
19
27
|
const startPage = p < amountOfPages ? p : 0;
|
|
@@ -23,11 +31,6 @@ const paginate = (rows, { page, perPage = 1, amountOfPages: amount, totalRows })
|
|
|
23
31
|
allRows: rows,
|
|
24
32
|
page: startPage
|
|
25
33
|
};
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
helper_default as default,
|
|
30
|
-
paginate,
|
|
31
|
-
parsePerPageNumber
|
|
32
|
-
};
|
|
33
|
-
//# sourceMappingURL=helper.js.map
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export { paginate as default, parsePerPageNumber };
|
|
@@ -1,6 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
8
|
+
import { useDerivedStateFromProps } from '@elliemae/ds-utilities';
|
|
9
|
+
import { parsePerPageNumber } from './helper.js';
|
|
10
|
+
|
|
11
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
+
|
|
13
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
14
|
function usePaginationState(grid) {
|
|
5
15
|
const {
|
|
6
16
|
minPerPage = 0,
|
|
@@ -13,12 +23,16 @@ function usePaginationState(grid) {
|
|
|
13
23
|
},
|
|
14
24
|
groupedRows
|
|
15
25
|
} = grid.props;
|
|
16
|
-
const {
|
|
26
|
+
const {
|
|
27
|
+
composedRows,
|
|
28
|
+
rows
|
|
29
|
+
} = grid.getInstance();
|
|
17
30
|
const [pagination, setPagination] = useDerivedStateFromProps(paginationProp);
|
|
18
|
-
|
|
31
|
+
|
|
32
|
+
const onPerPage = perPageNumber => {
|
|
19
33
|
const parsedPerPageNumber = parsePerPageNumber(perPageNumber, maxPerPage, minPerPage);
|
|
20
34
|
const actualNumber = parsedPerPageNumber ? parseInt(parsedPerPageNumber, 10) : 0;
|
|
21
|
-
setPagination(
|
|
35
|
+
setPagination(prevPagination => {
|
|
22
36
|
onPerPageChange(actualNumber);
|
|
23
37
|
return {
|
|
24
38
|
page: prevPagination.page,
|
|
@@ -26,17 +40,18 @@ function usePaginationState(grid) {
|
|
|
26
40
|
};
|
|
27
41
|
});
|
|
28
42
|
};
|
|
29
|
-
|
|
43
|
+
|
|
44
|
+
const onPageSelect = page => {
|
|
30
45
|
const length = groupedRows ? composedRows.length : rows.length;
|
|
31
|
-
setPagination(
|
|
46
|
+
setPagination(prevPagination => {
|
|
32
47
|
const pages = Math.ceil(length / prevPagination.perPage);
|
|
33
48
|
onPageChange(page);
|
|
34
|
-
return {
|
|
35
|
-
...prevPagination,
|
|
49
|
+
return _objectSpread(_objectSpread({}, prevPagination), {}, {
|
|
36
50
|
page: Math.min(Math.max(page, 1), pages)
|
|
37
|
-
};
|
|
51
|
+
});
|
|
38
52
|
});
|
|
39
53
|
};
|
|
54
|
+
|
|
40
55
|
return {
|
|
41
56
|
state: {
|
|
42
57
|
pagination
|
|
@@ -47,7 +62,5 @@ function usePaginationState(grid) {
|
|
|
47
62
|
}
|
|
48
63
|
};
|
|
49
64
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
};
|
|
53
|
-
//# sourceMappingURL=usePaginationState.js.map
|
|
65
|
+
|
|
66
|
+
export { usePaginationState };
|
|
@@ -1,55 +1,80 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
4
|
+
import { runAll } from '@elliemae/ds-utilities';
|
|
5
|
+
import createInstancePlugin from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';
|
|
6
|
+
import { addResizableToColumn, resizableFormatter } from './decorateResizable.js';
|
|
7
|
+
|
|
5
8
|
const noop = () => null;
|
|
6
|
-
|
|
9
|
+
|
|
10
|
+
const DELTA_LAST_COLUMN = 25; // eslint-disable-next-line no-unused-vars
|
|
11
|
+
|
|
7
12
|
const decorateColumn = (column, grid, index) => {
|
|
8
13
|
const {
|
|
9
14
|
onResizeEnd = noop,
|
|
10
15
|
onResizeStart = noop,
|
|
11
16
|
minColumnWidth = 90,
|
|
12
|
-
isColumnResizeActive =
|
|
17
|
+
isColumnResizeActive = col => col.resizable && !col.expandableColumn,
|
|
13
18
|
onColumnResize
|
|
14
19
|
} = grid.props;
|
|
15
|
-
const {
|
|
16
|
-
|
|
20
|
+
const {
|
|
21
|
+
decoratedColumns
|
|
22
|
+
} = grid.getInstance(); // need to do this because the decorated columns which the index in the function call
|
|
23
|
+
// could be different from the final decorated columns because a plugin could add a
|
|
24
|
+
// column afterwards
|
|
25
|
+
|
|
26
|
+
const colIndex = decoratedColumns.findIndex(col => col.property === column.property);
|
|
17
27
|
const isLast = colIndex === decoratedColumns.length - 1;
|
|
18
|
-
if (!isColumnResizeActive(column))
|
|
19
|
-
return column;
|
|
28
|
+
if (!isColumnResizeActive(column)) return column;
|
|
20
29
|
return addResizableToColumn(column, resizableFormatter({
|
|
21
30
|
onDragStart: () => {
|
|
22
31
|
grid.isDragging.current = true;
|
|
23
32
|
grid.disableEvents();
|
|
24
33
|
onResizeStart();
|
|
25
|
-
onColumnResize(
|
|
34
|
+
onColumnResize('onResizeStart', {
|
|
35
|
+
column
|
|
36
|
+
});
|
|
26
37
|
},
|
|
27
38
|
onDrag: (width, increasing) => {
|
|
28
|
-
const {
|
|
39
|
+
const {
|
|
40
|
+
resizedColumns,
|
|
41
|
+
refs
|
|
42
|
+
} = grid.getInstance();
|
|
43
|
+
|
|
29
44
|
if (isLast && increasing) {
|
|
30
45
|
const thisCol = resizedColumns.current[column.uuid] || 0;
|
|
31
46
|
width = Math.max(thisCol + DELTA_LAST_COLUMN, width);
|
|
32
47
|
}
|
|
48
|
+
|
|
33
49
|
column.updateBodyHeaderWidth(width, width);
|
|
34
50
|
grid.updateRowWidth();
|
|
51
|
+
|
|
35
52
|
if (isLast && increasing) {
|
|
53
|
+
// TODO: Move this to packages/ds-shared/src/ScrollSync/ScrollSync.js
|
|
54
|
+
// It isn't watching the scrollLeft so you have to move both at the same time
|
|
36
55
|
refs.header.current.scrollLeft += DELTA_LAST_COLUMN;
|
|
37
56
|
refs.body.current.scrollLeft += DELTA_LAST_COLUMN;
|
|
38
57
|
}
|
|
39
58
|
},
|
|
40
59
|
onDragEnd: (width, increasing, extraData) => {
|
|
41
|
-
const {
|
|
60
|
+
const {
|
|
61
|
+
resizedColumns
|
|
62
|
+
} = grid.getInstance();
|
|
63
|
+
|
|
42
64
|
if (isLast && increasing) {
|
|
43
65
|
const thisCol = resizedColumns.current[column.uuid] || 0;
|
|
44
66
|
width = Math.max(thisCol + DELTA_LAST_COLUMN, width);
|
|
45
67
|
}
|
|
68
|
+
|
|
46
69
|
resizedColumns.current[column.uuid] = width;
|
|
47
70
|
grid.isDragging.current = false;
|
|
48
71
|
grid.enableEvents();
|
|
72
|
+
|
|
49
73
|
try {
|
|
50
74
|
const total = grid.getInstance().refs.body.current.scrollWidth;
|
|
51
75
|
const sum = Object.keys(grid.resizedColumns.current).reduce((p, n) => grid.resizedColumns.current[n] + p, 0);
|
|
52
76
|
const lastKey = grid.decoratedColumns[grid.columns.length - 1].uuid;
|
|
77
|
+
|
|
53
78
|
if (sum < total) {
|
|
54
79
|
const lastCol = grid.getInstance().columnSizeService.columns[lastKey];
|
|
55
80
|
lastCol.updateWidth(grid.resizedColumns.current[lastKey] + total - sum);
|
|
@@ -57,9 +82,10 @@ const decorateColumn = (column, grid, index) => {
|
|
|
57
82
|
grid.getInstance().columnSizeService.updateMissingWidths(total);
|
|
58
83
|
}
|
|
59
84
|
} catch (error) {
|
|
60
|
-
console.error(
|
|
85
|
+
console.error('Unexpected error in the addResizableToColumn trying to use the remaining grid space to the last column', error);
|
|
61
86
|
}
|
|
62
|
-
|
|
87
|
+
|
|
88
|
+
onColumnResize('onResizeEnd', {
|
|
63
89
|
column,
|
|
64
90
|
width,
|
|
65
91
|
extraData
|
|
@@ -71,10 +97,9 @@ const decorateColumn = (column, grid, index) => {
|
|
|
71
97
|
isLast
|
|
72
98
|
}));
|
|
73
99
|
};
|
|
74
|
-
|
|
100
|
+
|
|
101
|
+
const ResizablePlugin = createInstancePlugin('resizable', {
|
|
75
102
|
decorateColumn
|
|
76
103
|
});
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
};
|
|
80
|
-
//# sourceMappingURL=ResizablePlugin.js.map
|
|
104
|
+
|
|
105
|
+
export { ResizablePlugin };
|