@elliemae/ds-datagrids 2.2.0 → 2.3.0-alpha.3
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 +395 -635
- package/cjs/DSDataGrid.js.map +7 -0
- package/cjs/DataGridImpl.js +103 -128
- package/cjs/DataGridImpl.js.map +7 -0
- package/cjs/PaginatedDataGrid.js +68 -68
- package/cjs/PaginatedDataGrid.js.map +7 -0
- package/cjs/blockNames.js +39 -11
- package/cjs/blockNames.js.map +7 -0
- package/cjs/columns/IconColumn.js +78 -62
- package/cjs/columns/IconColumn.js.map +7 -0
- package/cjs/columns/NumberColumn.js +35 -5
- package/cjs/columns/NumberColumn.js.map +7 -0
- package/cjs/components/BodyCell.js +83 -80
- package/cjs/components/BodyCell.js.map +7 -0
- package/cjs/components/BodyList.js +52 -52
- package/cjs/components/BodyList.js.map +7 -0
- package/cjs/components/ColumnVisibilityMenuOption.js +53 -31
- package/cjs/components/ColumnVisibilityMenuOption.js.map +7 -0
- package/cjs/components/ColumnsOptionsMenuSection.js +59 -44
- package/cjs/components/ColumnsOptionsMenuSection.js.map +7 -0
- package/cjs/components/EmptyState.js +81 -50
- package/cjs/components/EmptyState.js.map +7 -0
- package/cjs/components/HeaderCell.js +64 -58
- package/cjs/components/HeaderCell.js.map +7 -0
- package/cjs/components/List.js +41 -29
- package/cjs/components/List.js.map +7 -0
- package/cjs/components/ListItem.js +43 -36
- package/cjs/components/ListItem.js.map +7 -0
- package/cjs/components/NoResults.js +55 -51
- package/cjs/components/NoResults.js.map +7 -0
- package/cjs/components/RowsLoader.js +42 -22
- package/cjs/components/RowsLoader.js.map +7 -0
- package/cjs/components/Table.js +78 -87
- package/cjs/components/Table.js.map +7 -0
- package/cjs/components/TableBody.js +61 -60
- package/cjs/components/TableBody.js.map +7 -0
- package/cjs/components/TableHeader.js +47 -30
- package/cjs/components/TableHeader.js.map +7 -0
- package/cjs/components/footer/addOptionalFooterComponents.js +53 -43
- package/cjs/components/footer/addOptionalFooterComponents.js.map +7 -0
- package/cjs/components/header/PrimaryControls.js +49 -35
- package/cjs/components/header/PrimaryControls.js.map +7 -0
- package/cjs/components/header/addOptionalHeaderComponents.js +54 -43
- package/cjs/components/header/addOptionalHeaderComponents.js.map +7 -0
- package/cjs/components/index.js +43 -17
- package/cjs/components/index.js.map +7 -0
- package/cjs/components/renderers/defaultClassedRenderers.js +64 -57
- package/cjs/components/renderers/defaultClassedRenderers.js.map +7 -0
- package/cjs/components/renderers/index.js +44 -17
- package/cjs/components/renderers/index.js.map +7 -0
- package/cjs/components/renderers/renderRowsLoader.js +39 -18
- package/cjs/components/renderers/renderRowsLoader.js.map +7 -0
- package/cjs/components/tableContext.js +36 -13
- package/cjs/components/tableContext.js.map +7 -0
- package/cjs/defaultPlugins.js +44 -12
- package/cjs/defaultPlugins.js.map +7 -0
- package/cjs/index.js +72 -67
- package/cjs/index.js.map +7 -0
- package/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +102 -114
- package/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +7 -0
- package/cjs/plugins/body-header-scroll-sync/index.js +35 -9
- package/cjs/plugins/body-header-scroll-sync/index.js.map +7 -0
- package/cjs/plugins/column-dnd/DndColumnsPlugin.js +107 -86
- package/cjs/plugins/column-dnd/DndColumnsPlugin.js.map +7 -0
- package/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +43 -27
- package/cjs/plugins/column-dnd/decorateGridWithDndColumns.js.map +7 -0
- package/cjs/plugins/column-dnd/index.js +35 -9
- package/cjs/plugins/column-dnd/index.js.map +7 -0
- package/cjs/plugins/column-sizing/ColumnSizingPlugin.js +59 -55
- package/cjs/plugins/column-sizing/ColumnSizingPlugin.js.map +7 -0
- package/cjs/plugins/column-sizing/columnMeasurerTransformer.js +48 -53
- package/cjs/plugins/column-sizing/columnMeasurerTransformer.js.map +7 -0
- package/cjs/plugins/column-sizing/ext-points/decorateColumn.js +40 -13
- package/cjs/plugins/column-sizing/ext-points/decorateColumn.js.map +7 -0
- package/cjs/plugins/column-sizing/ext-points/getTableProps.js +55 -54
- package/cjs/plugins/column-sizing/ext-points/getTableProps.js.map +7 -0
- package/cjs/plugins/column-sizing/getColumnNameFromProperty.js +37 -9
- package/cjs/plugins/column-sizing/getColumnNameFromProperty.js.map +7 -0
- package/cjs/plugins/column-sizing/index.js +35 -9
- package/cjs/plugins/column-sizing/index.js.map +7 -0
- package/cjs/plugins/column-sizing/useColumnSizeService.js +72 -86
- package/cjs/plugins/column-sizing/useColumnSizeService.js.map +7 -0
- package/cjs/plugins/column-sizing/useStylesheetHelpers.js +96 -199
- package/cjs/plugins/column-sizing/useStylesheetHelpers.js.map +7 -0
- package/cjs/plugins/column-sizing/utils.js +52 -29
- package/cjs/plugins/column-sizing/utils.js.map +7 -0
- package/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js +38 -16
- package/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +7 -0
- package/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +61 -56
- package/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +7 -0
- package/cjs/plugins/custom-cell-renderer/getRendererComponent.js +58 -60
- package/cjs/plugins/custom-cell-renderer/getRendererComponent.js.map +7 -0
- package/cjs/plugins/custom-cell-renderer/index.js +35 -9
- package/cjs/plugins/custom-cell-renderer/index.js.map +7 -0
- package/cjs/plugins/editable/EditableComponents/ComboBox.js +50 -53
- package/cjs/plugins/editable/EditableComponents/ComboBox.js.map +7 -0
- package/cjs/plugins/editable/EditableComponents/TextBox.js +56 -76
- package/cjs/plugins/editable/EditableComponents/TextBox.js.map +7 -0
- package/cjs/plugins/editable/EditableComponents/index.js +37 -11
- package/cjs/plugins/editable/EditableComponents/index.js.map +7 -0
- package/cjs/plugins/editable/EditablePlugin.js +60 -75
- package/cjs/plugins/editable/EditablePlugin.js.map +7 -0
- package/cjs/plugins/editable/decorateEditable.js +61 -98
- package/cjs/plugins/editable/decorateEditable.js.map +7 -0
- package/cjs/plugins/editable/getEditorComponent.js +70 -76
- package/cjs/plugins/editable/getEditorComponent.js.map +7 -0
- package/cjs/plugins/editable/index.js +38 -13
- package/cjs/plugins/editable/index.js.map +7 -0
- package/cjs/plugins/expandable-grid/ExpandableColumn.js +112 -144
- package/cjs/plugins/expandable-grid/ExpandableColumn.js.map +7 -0
- package/cjs/plugins/expandable-grid/ExpandablePlugin.js +118 -180
- package/cjs/plugins/expandable-grid/ExpandablePlugin.js.map +7 -0
- package/cjs/plugins/expandable-grid/ExpandedRow.js +117 -139
- package/cjs/plugins/expandable-grid/ExpandedRow.js.map +7 -0
- package/cjs/plugins/expandable-grid/ExpandedRowExtra.js +54 -52
- package/cjs/plugins/expandable-grid/ExpandedRowExtra.js.map +7 -0
- package/cjs/plugins/expandable-grid/index.js +37 -11
- package/cjs/plugins/expandable-grid/index.js.map +7 -0
- package/cjs/plugins/expandable-grid/useExpandGridState.js +45 -31
- package/cjs/plugins/expandable-grid/useExpandGridState.js.map +7 -0
- package/cjs/plugins/export-data/ExportDataPlugin.js +82 -116
- package/cjs/plugins/export-data/ExportDataPlugin.js.map +7 -0
- package/cjs/plugins/export-data/index.js +35 -12
- package/cjs/plugins/export-data/index.js.map +7 -0
- package/cjs/plugins/filterable/FilterablePlugin.js +54 -55
- package/cjs/plugins/filterable/FilterablePlugin.js.map +7 -0
- package/cjs/plugins/filterable/addFilterToColumn.js +40 -28
- package/cjs/plugins/filterable/addFilterToColumn.js.map +7 -0
- package/cjs/plugins/filterable/components/FilterableHeader.js +119 -107
- package/cjs/plugins/filterable/components/FilterableHeader.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +116 -116
- package/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +97 -73
- package/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +138 -132
- package/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +115 -119
- package/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js +35 -7
- package/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +46 -15
- package/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +7 -0
- package/cjs/plugins/filterable/filterableFormatter.js +61 -51
- package/cjs/plugins/filterable/filterableFormatter.js.map +7 -0
- package/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +60 -55
- package/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +7 -0
- package/cjs/plugins/filterable/filtering-helper/strategiesOperators.js +43 -22
- package/cjs/plugins/filterable/filtering-helper/strategiesOperators.js.map +7 -0
- package/cjs/plugins/filterable/helper.js +68 -79
- package/cjs/plugins/filterable/helper.js.map +7 -0
- package/cjs/plugins/filterable/index.js +35 -9
- package/cjs/plugins/filterable/index.js.map +7 -0
- package/cjs/plugins/filterable/useFilterableState.js +62 -66
- package/cjs/plugins/filterable/useFilterableState.js.map +7 -0
- package/cjs/plugins/grouping-by/GroupingByPlugin.js +40 -23
- package/cjs/plugins/grouping-by/GroupingByPlugin.js.map +7 -0
- package/cjs/plugins/grouping-grid/GroupingPlugin.js +86 -109
- package/cjs/plugins/grouping-grid/GroupingPlugin.js.map +7 -0
- package/cjs/plugins/grouping-grid/walkStrategy.js +46 -26
- package/cjs/plugins/grouping-grid/walkStrategy.js.map +7 -0
- package/cjs/plugins/index.js +68 -48
- package/cjs/plugins/index.js.map +7 -0
- package/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +64 -88
- package/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +7 -0
- package/cjs/plugins/infinite-scrolling/index.js +35 -9
- package/cjs/plugins/infinite-scrolling/index.js.map +7 -0
- package/cjs/plugins/pagination/PaginationPlugin.js +73 -90
- package/cjs/plugins/pagination/PaginationPlugin.js.map +7 -0
- package/cjs/plugins/pagination/components/Pagination.js +54 -35
- package/cjs/plugins/pagination/components/Pagination.js.map +7 -0
- package/cjs/plugins/pagination/components/Paginator.js +59 -44
- package/cjs/plugins/pagination/components/Paginator.js.map +7 -0
- package/cjs/plugins/pagination/components/PerPageDropdown.js +51 -63
- package/cjs/plugins/pagination/components/PerPageDropdown.js.map +7 -0
- package/cjs/plugins/pagination/helper.js +45 -24
- package/cjs/plugins/pagination/helper.js.map +7 -0
- package/cjs/plugins/pagination/index.js +35 -9
- package/cjs/plugins/pagination/index.js.map +7 -0
- package/cjs/plugins/pagination/usePaginationState.js +46 -38
- package/cjs/plugins/pagination/usePaginationState.js.map +7 -0
- package/cjs/plugins/resizable/ResizablePlugin.js +51 -55
- package/cjs/plugins/resizable/ResizablePlugin.js.map +7 -0
- package/cjs/plugins/resizable/decorateResizable.js +49 -53
- package/cjs/plugins/resizable/decorateResizable.js.map +7 -0
- package/cjs/plugins/resizable/index.js +35 -9
- package/cjs/plugins/resizable/index.js.map +7 -0
- package/cjs/plugins/resizable/useResizeHandle.js +56 -50
- package/cjs/plugins/resizable/useResizeHandle.js.map +7 -0
- package/cjs/plugins/resizable/utils.js +49 -28
- package/cjs/plugins/resizable/utils.js.map +7 -0
- package/cjs/plugins/row-dnd/DndRowsPlugin.js +103 -82
- package/cjs/plugins/row-dnd/DndRowsPlugin.js.map +7 -0
- package/cjs/plugins/row-dnd/index.js +35 -9
- package/cjs/plugins/row-dnd/index.js.map +7 -0
- package/cjs/plugins/selectable/SelectablePlugin.js +101 -134
- package/cjs/plugins/selectable/SelectablePlugin.js.map +7 -0
- package/cjs/plugins/selectable/addSelectableColumn.js +67 -68
- package/cjs/plugins/selectable/addSelectableColumn.js.map +7 -0
- package/cjs/plugins/selectable/helper.js +50 -39
- package/cjs/plugins/selectable/helper.js.map +7 -0
- package/cjs/plugins/selectable/index.js +35 -9
- package/cjs/plugins/selectable/index.js.map +7 -0
- package/cjs/plugins/selectable/selectableFormatter.js +83 -105
- package/cjs/plugins/selectable/selectableFormatter.js.map +7 -0
- package/cjs/plugins/selectable/useSelectableState.js +67 -94
- package/cjs/plugins/selectable/useSelectableState.js.map +7 -0
- package/cjs/plugins/sortable/SortablePlugin.js +62 -76
- package/cjs/plugins/sortable/SortablePlugin.js.map +7 -0
- package/cjs/plugins/sortable/checkIfSortable.js +37 -14
- package/cjs/plugins/sortable/checkIfSortable.js.map +7 -0
- package/cjs/plugins/sortable/index.js +35 -9
- package/cjs/plugins/sortable/index.js.map +7 -0
- package/cjs/plugins/sortable/sortHeaderFormatter.js +56 -50
- package/cjs/plugins/sortable/sortHeaderFormatter.js.map +7 -0
- package/cjs/plugins/sortable/sortTree.js +40 -47
- package/cjs/plugins/sortable/sortTree.js.map +7 -0
- package/cjs/plugins/sortable/sorter.js +140 -172
- package/cjs/plugins/sortable/sorter.js.map +7 -0
- package/cjs/plugins/sortable/useSortableState.js +53 -79
- package/cjs/plugins/sortable/useSortableState.js.map +7 -0
- package/cjs/plugins/toolbar/RowRenderer.js +75 -76
- package/cjs/plugins/toolbar/RowRenderer.js.map +7 -0
- package/cjs/plugins/toolbar/ToolbarPlugin.js +49 -33
- package/cjs/plugins/toolbar/ToolbarPlugin.js.map +7 -0
- package/cjs/plugins/toolbar/ToolbarTrigger.js +89 -70
- package/cjs/plugins/toolbar/ToolbarTrigger.js.map +7 -0
- package/cjs/plugins/toolbar/index.js +35 -9
- package/cjs/plugins/toolbar/index.js.map +7 -0
- package/cjs/plugins/virtualization/AutoHeightList.js +64 -52
- package/cjs/plugins/virtualization/AutoHeightList.js.map +7 -0
- package/cjs/plugins/virtualization/VirtualizationPlugin.js +86 -97
- package/cjs/plugins/virtualization/VirtualizationPlugin.js.map +7 -0
- package/cjs/plugins/virtualization/VirtualizedBody.js +139 -155
- package/cjs/plugins/virtualization/VirtualizedBody.js.map +7 -0
- package/cjs/plugins/virtualization/VirtualizedBodyRow.js +39 -17
- package/cjs/plugins/virtualization/VirtualizedBodyRow.js.map +7 -0
- package/cjs/plugins/virtualization/helper.js +35 -7
- package/cjs/plugins/virtualization/helper.js.map +7 -0
- package/cjs/plugins/virtualization/index.js +35 -9
- package/cjs/plugins/virtualization/index.js.map +7 -0
- package/cjs/renders/CellWithAddons.js +98 -50
- package/cjs/renders/CellWithAddons.js.map +7 -0
- package/cjs/renders/index.js +37 -11
- package/cjs/renders/index.js.map +7 -0
- package/cjs/renders/styled.js +78 -27
- package/cjs/renders/styled.js.map +7 -0
- package/cjs/rowSizes.js +44 -12
- package/cjs/rowSizes.js.map +7 -0
- package/cjs/utilities/DataGridUtilities.json +1315 -0
- package/cjs/utilities/getPluginsFromProps.js +67 -39
- package/cjs/utilities/getPluginsFromProps.js.map +7 -0
- package/cjs/utilities/getScrollbarSize.js +44 -25
- package/cjs/utilities/getScrollbarSize.js.map +7 -0
- package/cjs/utilities/normalizeData.js +44 -34
- package/cjs/utilities/normalizeData.js.map +7 -0
- package/esm/DSDataGrid.js +337 -597
- package/esm/DSDataGrid.js.map +7 -0
- package/esm/DataGridImpl.js +68 -113
- package/esm/DataGridImpl.js.map +7 -0
- package/esm/PaginatedDataGrid.js +39 -59
- package/esm/PaginatedDataGrid.js.map +7 -0
- package/esm/blockNames.js +10 -5
- package/esm/blockNames.js.map +7 -0
- package/esm/columns/IconColumn.js +49 -54
- package/esm/columns/IconColumn.js.map +7 -0
- package/esm/columns/NumberColumn.js +6 -3
- package/esm/columns/NumberColumn.js.map +7 -0
- package/esm/components/BodyCell.js +51 -68
- package/esm/components/BodyCell.js.map +7 -0
- package/esm/components/BodyList.js +23 -43
- package/esm/components/BodyList.js.map +7 -0
- package/esm/components/ColumnVisibilityMenuOption.js +24 -27
- package/esm/components/ColumnVisibilityMenuOption.js.map +7 -0
- package/esm/components/ColumnsOptionsMenuSection.js +30 -38
- package/esm/components/ColumnsOptionsMenuSection.js.map +7 -0
- package/esm/components/EmptyState.js +52 -40
- package/esm/components/EmptyState.js.map +7 -0
- package/esm/components/HeaderCell.js +33 -48
- package/esm/components/HeaderCell.js.map +7 -0
- package/esm/components/List.js +12 -23
- package/esm/components/List.js.map +7 -0
- package/esm/components/ListItem.js +14 -30
- package/esm/components/ListItem.js.map +7 -0
- package/esm/components/NoResults.js +26 -43
- package/esm/components/NoResults.js.map +7 -0
- package/esm/components/RowsLoader.js +13 -15
- package/esm/components/RowsLoader.js.map +7 -0
- package/esm/components/Table.js +45 -76
- package/esm/components/Table.js.map +7 -0
- package/esm/components/TableBody.js +32 -52
- package/esm/components/TableBody.js.map +7 -0
- package/esm/components/TableHeader.js +17 -23
- package/esm/components/TableHeader.js.map +7 -0
- package/esm/components/footer/addOptionalFooterComponents.js +24 -37
- package/esm/components/footer/addOptionalFooterComponents.js.map +7 -0
- package/esm/components/header/PrimaryControls.js +20 -29
- package/esm/components/header/PrimaryControls.js.map +7 -0
- package/esm/components/header/addOptionalHeaderComponents.js +25 -36
- package/esm/components/header/addOptionalHeaderComponents.js.map +7 -0
- package/esm/components/index.js +14 -5
- package/esm/components/index.js.map +7 -0
- package/esm/components/renderers/defaultClassedRenderers.js +41 -46
- package/esm/components/renderers/defaultClassedRenderers.js.map +7 -0
- package/esm/components/renderers/index.js +16 -5
- package/esm/components/renderers/index.js.map +7 -0
- package/esm/components/renderers/renderRowsLoader.js +10 -10
- package/esm/components/renderers/renderRowsLoader.js.map +7 -0
- package/esm/components/tableContext.js +7 -5
- package/esm/components/tableContext.js.map +7 -0
- package/esm/defaultPlugins.js +15 -8
- package/esm/defaultPlugins.js.map +7 -0
- package/esm/index.js +63 -27
- package/esm/index.js.map +7 -0
- package/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +71 -101
- package/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +7 -0
- package/esm/plugins/body-header-scroll-sync/index.js +6 -1
- package/esm/plugins/body-header-scroll-sync/index.js.map +7 -0
- package/esm/plugins/column-dnd/DndColumnsPlugin.js +69 -68
- package/esm/plugins/column-dnd/DndColumnsPlugin.js.map +7 -0
- package/esm/plugins/column-dnd/decorateGridWithDndColumns.js +16 -18
- package/esm/plugins/column-dnd/decorateGridWithDndColumns.js.map +7 -0
- package/esm/plugins/column-dnd/index.js +6 -1
- package/esm/plugins/column-dnd/index.js.map +7 -0
- package/esm/plugins/column-sizing/ColumnSizingPlugin.js +20 -37
- package/esm/plugins/column-sizing/ColumnSizingPlugin.js.map +7 -0
- package/esm/plugins/column-sizing/columnMeasurerTransformer.js +16 -42
- package/esm/plugins/column-sizing/columnMeasurerTransformer.js.map +7 -0
- package/esm/plugins/column-sizing/ext-points/decorateColumn.js +9 -7
- package/esm/plugins/column-sizing/ext-points/decorateColumn.js.map +7 -0
- package/esm/plugins/column-sizing/ext-points/getTableProps.js +23 -43
- package/esm/plugins/column-sizing/ext-points/getTableProps.js.map +7 -0
- package/esm/plugins/column-sizing/getColumnNameFromProperty.js +8 -7
- package/esm/plugins/column-sizing/getColumnNameFromProperty.js.map +7 -0
- package/esm/plugins/column-sizing/index.js +6 -1
- package/esm/plugins/column-sizing/index.js.map +7 -0
- package/esm/plugins/column-sizing/useColumnSizeService.js +34 -71
- package/esm/plugins/column-sizing/useColumnSizeService.js.map +7 -0
- package/esm/plugins/column-sizing/useStylesheetHelpers.js +64 -171
- package/esm/plugins/column-sizing/useStylesheetHelpers.js.map +7 -0
- package/esm/plugins/column-sizing/utils.js +23 -21
- package/esm/plugins/column-sizing/utils.js.map +7 -0
- package/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js +8 -7
- package/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +7 -0
- package/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +28 -43
- package/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +7 -0
- package/esm/plugins/custom-cell-renderer/getRendererComponent.js +22 -44
- package/esm/plugins/custom-cell-renderer/getRendererComponent.js.map +7 -0
- package/esm/plugins/custom-cell-renderer/index.js +6 -1
- package/esm/plugins/custom-cell-renderer/index.js.map +7 -0
- package/esm/plugins/editable/EditableComponents/ComboBox.js +20 -46
- package/esm/plugins/editable/EditableComponents/ComboBox.js.map +7 -0
- package/esm/plugins/editable/EditableComponents/TextBox.js +26 -68
- package/esm/plugins/editable/EditableComponents/TextBox.js.map +7 -0
- package/esm/plugins/editable/EditableComponents/index.js +8 -2
- package/esm/plugins/editable/EditableComponents/index.js.map +7 -0
- package/esm/plugins/editable/EditablePlugin.js +27 -63
- package/esm/plugins/editable/EditablePlugin.js.map +7 -0
- package/esm/plugins/editable/decorateEditable.js +32 -68
- package/esm/plugins/editable/decorateEditable.js.map +7 -0
- package/esm/plugins/editable/getEditorComponent.js +39 -66
- package/esm/plugins/editable/getEditorComponent.js.map +7 -0
- package/esm/plugins/editable/index.js +9 -3
- package/esm/plugins/editable/index.js.map +7 -0
- package/esm/plugins/expandable-grid/ExpandableColumn.js +82 -133
- package/esm/plugins/expandable-grid/ExpandableColumn.js.map +7 -0
- package/esm/plugins/expandable-grid/ExpandablePlugin.js +81 -160
- package/esm/plugins/expandable-grid/ExpandablePlugin.js.map +7 -0
- package/esm/plugins/expandable-grid/ExpandedRow.js +86 -124
- package/esm/plugins/expandable-grid/ExpandedRow.js.map +7 -0
- package/esm/plugins/expandable-grid/ExpandedRowExtra.js +25 -44
- package/esm/plugins/expandable-grid/ExpandedRowExtra.js.map +7 -0
- package/esm/plugins/expandable-grid/index.js +8 -2
- package/esm/plugins/expandable-grid/index.js.map +7 -0
- package/esm/plugins/expandable-grid/useExpandGridState.js +14 -25
- package/esm/plugins/expandable-grid/useExpandGridState.js.map +7 -0
- package/esm/plugins/export-data/ExportDataPlugin.js +52 -103
- package/esm/plugins/export-data/ExportDataPlugin.js.map +7 -0
- package/esm/plugins/export-data/index.js +6 -1
- package/esm/plugins/export-data/index.js.map +7 -0
- package/esm/plugins/filterable/FilterablePlugin.js +22 -44
- package/esm/plugins/filterable/FilterablePlugin.js.map +7 -0
- package/esm/plugins/filterable/addFilterToColumn.js +11 -20
- package/esm/plugins/filterable/addFilterToColumn.js.map +7 -0
- package/esm/plugins/filterable/components/FilterableHeader.js +85 -95
- package/esm/plugins/filterable/components/FilterableHeader.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +83 -103
- package/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +68 -63
- package/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +108 -116
- package/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js +84 -106
- package/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/defaultDateFormat.js +6 -3
- package/esm/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +16 -12
- package/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +7 -0
- package/esm/plugins/filterable/filterableFormatter.js +32 -45
- package/esm/plugins/filterable/filterableFormatter.js.map +7 -0
- package/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js +29 -44
- package/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +7 -0
- package/esm/plugins/filterable/filtering-helper/strategiesOperators.js +11 -13
- package/esm/plugins/filterable/filtering-helper/strategiesOperators.js.map +7 -0
- package/esm/plugins/filterable/helper.js +42 -62
- package/esm/plugins/filterable/helper.js.map +7 -0
- package/esm/plugins/filterable/index.js +6 -1
- package/esm/plugins/filterable/index.js.map +7 -0
- package/esm/plugins/filterable/useFilterableState.js +33 -54
- package/esm/plugins/filterable/useFilterableState.js.map +7 -0
- package/esm/plugins/grouping-by/GroupingByPlugin.js +10 -14
- package/esm/plugins/grouping-by/GroupingByPlugin.js.map +7 -0
- package/esm/plugins/grouping-grid/GroupingPlugin.js +53 -94
- package/esm/plugins/grouping-grid/GroupingPlugin.js.map +7 -0
- package/esm/plugins/grouping-grid/walkStrategy.js +17 -22
- package/esm/plugins/grouping-grid/walkStrategy.js.map +7 -0
- package/esm/plugins/index.js +39 -19
- package/esm/plugins/index.js.map +7 -0
- package/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js +31 -74
- package/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +7 -0
- package/esm/plugins/infinite-scrolling/index.js +6 -1
- package/esm/plugins/infinite-scrolling/index.js.map +7 -0
- package/esm/plugins/pagination/PaginationPlugin.js +42 -75
- package/esm/plugins/pagination/PaginationPlugin.js.map +7 -0
- package/esm/plugins/pagination/components/Pagination.js +25 -27
- package/esm/plugins/pagination/components/Pagination.js.map +7 -0
- package/esm/plugins/pagination/components/Paginator.js +29 -35
- package/esm/plugins/pagination/components/Paginator.js.map +7 -0
- package/esm/plugins/pagination/components/PerPageDropdown.js +22 -54
- package/esm/plugins/pagination/components/PerPageDropdown.js.map +7 -0
- package/esm/plugins/pagination/helper.js +16 -19
- package/esm/plugins/pagination/helper.js.map +7 -0
- package/esm/plugins/pagination/index.js +6 -1
- package/esm/plugins/pagination/index.js.map +7 -0
- package/esm/plugins/pagination/usePaginationState.js +15 -28
- package/esm/plugins/pagination/usePaginationState.js.map +7 -0
- package/esm/plugins/resizable/ResizablePlugin.js +20 -45
- package/esm/plugins/resizable/ResizablePlugin.js.map +7 -0
- package/esm/plugins/resizable/decorateResizable.js +19 -41
- package/esm/plugins/resizable/decorateResizable.js.map +7 -0
- package/esm/plugins/resizable/index.js +6 -1
- package/esm/plugins/resizable/index.js.map +7 -0
- package/esm/plugins/resizable/useResizeHandle.js +24 -39
- package/esm/plugins/resizable/useResizeHandle.js.map +7 -0
- package/esm/plugins/resizable/utils.js +20 -18
- package/esm/plugins/resizable/utils.js.map +7 -0
- package/esm/plugins/row-dnd/DndRowsPlugin.js +73 -71
- package/esm/plugins/row-dnd/DndRowsPlugin.js.map +7 -0
- package/esm/plugins/row-dnd/index.js +6 -1
- package/esm/plugins/row-dnd/index.js.map +7 -0
- package/esm/plugins/selectable/SelectablePlugin.js +64 -117
- package/esm/plugins/selectable/SelectablePlugin.js.map +7 -0
- package/esm/plugins/selectable/addSelectableColumn.js +39 -57
- package/esm/plugins/selectable/addSelectableColumn.js.map +7 -0
- package/esm/plugins/selectable/helper.js +19 -25
- package/esm/plugins/selectable/helper.js.map +7 -0
- package/esm/plugins/selectable/index.js +6 -1
- package/esm/plugins/selectable/index.js.map +7 -0
- package/esm/plugins/selectable/selectableFormatter.js +54 -97
- package/esm/plugins/selectable/selectableFormatter.js.map +7 -0
- package/esm/plugins/selectable/useSelectableState.js +34 -78
- package/esm/plugins/selectable/useSelectableState.js.map +7 -0
- package/esm/plugins/sortable/SortablePlugin.js +30 -43
- package/esm/plugins/sortable/SortablePlugin.js.map +7 -0
- package/esm/plugins/sortable/checkIfSortable.js +8 -9
- package/esm/plugins/sortable/checkIfSortable.js.map +7 -0
- package/esm/plugins/sortable/index.js +6 -1
- package/esm/plugins/sortable/index.js.map +7 -0
- package/esm/plugins/sortable/sortHeaderFormatter.js +27 -43
- package/esm/plugins/sortable/sortHeaderFormatter.js.map +7 -0
- package/esm/plugins/sortable/sortTree.js +13 -24
- package/esm/plugins/sortable/sortTree.js.map +7 -0
- package/esm/plugins/sortable/sorter.js +112 -163
- package/esm/plugins/sortable/sorter.js.map +7 -0
- package/esm/plugins/sortable/useSortableState.js +22 -49
- package/esm/plugins/sortable/useSortableState.js.map +7 -0
- package/esm/plugins/toolbar/RowRenderer.js +40 -61
- package/esm/plugins/toolbar/RowRenderer.js.map +7 -0
- package/esm/plugins/toolbar/ToolbarPlugin.js +19 -23
- package/esm/plugins/toolbar/ToolbarPlugin.js.map +7 -0
- package/esm/plugins/toolbar/ToolbarTrigger.js +59 -57
- package/esm/plugins/toolbar/ToolbarTrigger.js.map +7 -0
- package/esm/plugins/toolbar/index.js +6 -1
- package/esm/plugins/toolbar/index.js.map +7 -0
- package/esm/plugins/virtualization/AutoHeightList.js +30 -40
- package/esm/plugins/virtualization/AutoHeightList.js.map +7 -0
- package/esm/plugins/virtualization/VirtualizationPlugin.js +55 -84
- package/esm/plugins/virtualization/VirtualizationPlugin.js.map +7 -0
- package/esm/plugins/virtualization/VirtualizedBody.js +94 -132
- package/esm/plugins/virtualization/VirtualizedBody.js.map +7 -0
- package/esm/plugins/virtualization/VirtualizedBodyRow.js +10 -15
- package/esm/plugins/virtualization/VirtualizedBodyRow.js.map +7 -0
- package/esm/plugins/virtualization/helper.js +6 -3
- package/esm/plugins/virtualization/helper.js.map +7 -0
- package/esm/plugins/virtualization/index.js +6 -1
- package/esm/plugins/virtualization/index.js.map +7 -0
- package/esm/renders/CellWithAddons.js +69 -40
- package/esm/renders/CellWithAddons.js.map +7 -0
- package/esm/renders/index.js +8 -2
- package/esm/renders/index.js.map +7 -0
- package/esm/renders/styled.js +49 -16
- package/esm/renders/styled.js.map +7 -0
- package/esm/rowSizes.js +15 -6
- package/esm/rowSizes.js.map +7 -0
- package/esm/utilities/DataGridUtilities.json +1315 -0
- package/esm/utilities/getPluginsFromProps.js +25 -24
- package/esm/utilities/getPluginsFromProps.js.map +7 -0
- package/esm/utilities/getScrollbarSize.js +15 -21
- package/esm/utilities/getScrollbarSize.js.map +7 -0
- package/esm/utilities/normalizeData.js +15 -24
- package/esm/utilities/normalizeData.js.map +7 -0
- package/package.json +20 -20
- package/types/DSDataGrid.d.ts +1 -1
- package/types/DataGridImpl.d.ts +3 -2
- package/types/PaginatedDataGrid.d.ts +1 -2
- package/types/columns/IconColumn.d.ts +3 -2
- package/types/components/BodyCell.d.ts +13 -12
- package/types/components/ColumnVisibilityMenuOption.d.ts +2 -2
- package/types/components/ColumnsOptionsMenuSection.d.ts +1 -0
- 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 +6 -11
- package/types/components/TableBody.d.ts +3 -8
- package/types/components/TableHeader.d.ts +2 -1
- package/types/components/footer/addOptionalFooterComponents.d.ts +1 -0
- package/types/components/header/PrimaryControls.d.ts +1 -0
- 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 +7 -8
- 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 +2 -1
- package/types/plugins/column-sizing/index.d.ts +1 -1
- package/types/plugins/column-sizing/useColumnSizeService.d.ts +2 -1
- package/types/plugins/custom-cell-renderer/addCustomRendererToCell.d.ts +1 -0
- package/types/plugins/custom-cell-renderer/getRendererComponent.d.ts +1 -0
- package/types/plugins/custom-cell-renderer/index.d.ts +1 -1
- package/types/plugins/editable/EditableComponents/ComboBox.d.ts +3 -1
- package/types/plugins/editable/EditableComponents/TextBox.d.ts +3 -1
- package/types/plugins/editable/getEditorComponent.d.ts +1 -0
- package/types/plugins/editable/index.d.ts +2 -2
- package/types/plugins/expandable-grid/ExpandableColumn.d.ts +3 -2
- package/types/plugins/expandable-grid/ExpandedRow.d.ts +1 -0
- package/types/plugins/expandable-grid/ExpandedRowExtra.d.ts +1 -0
- 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 +1 -0
- package/types/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.d.ts +1 -0
- package/types/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.d.ts +2 -1
- package/types/plugins/filterable/components/filterable-menus/TextFilterMenu.d.ts +1 -0
- package/types/plugins/filterable/components/filterable-menus/getFilterMenuByType.d.ts +2 -1
- package/types/plugins/filterable/filterableFormatter.d.ts +3 -2
- package/types/plugins/filterable/filtering-helper/filterRowsByQuery.d.ts +2 -1
- 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 +1 -0
- package/types/plugins/pagination/components/PerPageDropdown.d.ts +1 -0
- package/types/plugins/pagination/helper.d.ts +3 -2
- 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 +1 -0
- package/types/plugins/sortable/index.d.ts +1 -1
- package/types/plugins/sortable/sortHeaderFormatter.d.ts +1 -0
- package/types/plugins/sortable/sortTree.d.ts +1 -0
- 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 +1 -0
- package/types/plugins/virtualization/VirtualizedBodyRow.d.ts +2 -2
- package/types/plugins/virtualization/index.d.ts +1 -1
- package/types/utilities/getPluginsFromProps.d.ts +2 -1
|
@@ -1,96 +1,63 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
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
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useMemo } from "react";
|
|
3
|
+
import { mergeRefs } from "@elliemae/ds-utilities";
|
|
4
|
+
import { FocusGrid } from "@elliemae/ds-shared/FocusGroup/FocusGrid";
|
|
5
|
+
import { createInstancePlugin } from "@elliemae/ds-shared/createDataInstance/createInstancePlugin";
|
|
6
|
+
import { paginate } from "./helper";
|
|
7
|
+
import { usePaginationState } from "./usePaginationState";
|
|
8
|
+
import { NoResults } from "../../components/NoResults";
|
|
26
9
|
const composeRows = (rows, grid) => {
|
|
27
10
|
const {
|
|
28
|
-
state: {
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
props: {
|
|
32
|
-
groupedRows
|
|
33
|
-
}
|
|
11
|
+
state: { pagination },
|
|
12
|
+
props: { groupedRows }
|
|
34
13
|
} = grid.getInstance();
|
|
35
|
-
if (groupedRows)
|
|
36
|
-
|
|
14
|
+
if (groupedRows)
|
|
15
|
+
return rows;
|
|
37
16
|
if (groupedRows) {
|
|
38
|
-
const filterIds = rows.map(r => r.id);
|
|
39
|
-
return paginate(rows.filter(c => filterIds.includes(c.id)).map(r =>
|
|
17
|
+
const filterIds = rows.map((r) => r.id);
|
|
18
|
+
return paginate(rows.filter((c) => filterIds.includes(c.id)).map((r) => ({
|
|
19
|
+
...r,
|
|
40
20
|
_isGroup: r.isGroup
|
|
41
21
|
})), pagination);
|
|
42
22
|
}
|
|
43
|
-
|
|
44
23
|
return paginate(rows, pagination);
|
|
45
24
|
};
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
25
|
+
const Body = React2.memo(({
|
|
26
|
+
component: Component,
|
|
27
|
+
rows,
|
|
28
|
+
rowRenderer,
|
|
29
|
+
noResultsPlaceholder,
|
|
30
|
+
innerRef,
|
|
31
|
+
innerBodyRef,
|
|
32
|
+
isPlaceholderActive = false,
|
|
33
|
+
...otherBodyProps
|
|
34
|
+
}) => /* @__PURE__ */ React2.createElement(Component, {
|
|
35
|
+
...otherBodyProps,
|
|
36
|
+
innerRef: mergeRefs(innerRef)
|
|
37
|
+
}, !isPlaceholderActive ? rows.map((row, index) => rowRenderer(row, { index, rowIndex: index }, {})) : /* @__PURE__ */ React2.createElement(NoResults, {
|
|
38
|
+
innerRef,
|
|
39
|
+
rowRenderer
|
|
40
|
+
}, noResultsPlaceholder)));
|
|
72
41
|
const decorateRenderers = (renderers, grid) => {
|
|
73
42
|
const BodyWrapper = renderers.body.wrapper;
|
|
74
|
-
renderers.body.wrapper = useMemo(() => props => {
|
|
75
|
-
const {
|
|
43
|
+
renderers.body.wrapper = useMemo(() => (props) => {
|
|
44
|
+
const { hotKeys, shouldRefocus, state } = grid.getInstance();
|
|
45
|
+
return /* @__PURE__ */ React2.createElement(FocusGrid, {
|
|
76
46
|
hotKeys,
|
|
77
|
-
shouldRefocus,
|
|
78
|
-
state
|
|
79
|
-
} = grid.getInstance();
|
|
80
|
-
return /*#__PURE__*/_jsx(FocusGridManager, {
|
|
81
|
-
hotKeys: hotKeys,
|
|
82
47
|
shouldRefocus: false
|
|
83
|
-
},
|
|
48
|
+
}, /* @__PURE__ */ React2.createElement(Body, {
|
|
49
|
+
...props,
|
|
84
50
|
component: BodyWrapper
|
|
85
|
-
}))
|
|
51
|
+
}));
|
|
86
52
|
}, []);
|
|
87
53
|
return renderers;
|
|
88
54
|
};
|
|
89
|
-
|
|
90
|
-
const PaginationPlugin = createInstancePlugin('pagination', {
|
|
55
|
+
const PaginationPlugin = createInstancePlugin("pagination", {
|
|
91
56
|
registerStateHook: usePaginationState,
|
|
92
57
|
decorateRenderers,
|
|
93
58
|
composeRows
|
|
94
59
|
});
|
|
95
|
-
|
|
96
|
-
|
|
60
|
+
export {
|
|
61
|
+
PaginationPlugin
|
|
62
|
+
};
|
|
63
|
+
//# sourceMappingURL=PaginationPlugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/PaginationPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/display-name */\nimport React, { useMemo } from 'react';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport { FocusGrid } from '@elliemae/ds-shared/FocusGroup/FocusGrid';\nimport { createInstancePlugin } from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';\nimport { paginate } from './helper';\nimport { usePaginationState } from './usePaginationState';\nimport { NoResults } from '../../components/NoResults';\n\nconst composeRows = (rows, grid) => {\n const {\n state: { pagination },\n props: { groupedRows },\n } = grid.getInstance();\n if (groupedRows) return rows; // disable pagination with grouping\n if (groupedRows) {\n const filterIds = rows.map((r) => r.id);\n return paginate(\n rows\n .filter((c) => filterIds.includes(c.id))\n .map((r) => ({\n ...r,\n _isGroup: r.isGroup,\n })),\n pagination,\n );\n }\n\n return paginate(rows, pagination);\n};\n\nconst Body = React.memo(\n ({\n component: Component,\n rows,\n rowRenderer,\n noResultsPlaceholder,\n innerRef,\n innerBodyRef, // depends on body-header-scroll-sync\n isPlaceholderActive = false,\n ...otherBodyProps\n }) => (\n <Component {...otherBodyProps} innerRef={mergeRefs(innerRef)}>\n {!isPlaceholderActive ? (\n rows.map((row, index) => rowRenderer(row, { index, rowIndex: index }, {}))\n ) : (\n <NoResults innerRef={innerRef} rowRenderer={rowRenderer}>\n {noResultsPlaceholder}\n </NoResults>\n )}\n </Component>\n ),\n);\n\nconst decorateRenderers = (renderers, grid) => {\n const BodyWrapper = renderers.body.wrapper;\n renderers.body.wrapper = useMemo(\n () => (props) => {\n const { hotKeys, shouldRefocus, state } = grid.getInstance();\n return (\n <FocusGrid hotKeys={hotKeys} shouldRefocus={false}>\n <Body {...props} component={BodyWrapper} />\n </FocusGrid>\n );\n },\n [],\n );\n return renderers;\n};\n\nexport const PaginationPlugin = createInstancePlugin('pagination', {\n registerStateHook: usePaginationState,\n decorateRenderers,\n composeRows,\n});\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,cAAc,CAAC,MAAM,SAAS;AAClC,QAAM;AAAA,IACJ,OAAO,EAAE;AAAA,IACT,OAAO,EAAE;AAAA,MACP,KAAK;AACT,MAAI;AAAa,WAAO;AACxB,MAAI,aAAa;AACf,UAAM,YAAY,KAAK,IAAI,CAAC,MAAM,EAAE;AACpC,WAAO,SACL,KACG,OAAO,CAAC,MAAM,UAAU,SAAS,EAAE,KACnC,IAAI,CAAC,MAAO;AAAA,SACR;AAAA,MACH,UAAU,EAAE;AAAA,SAEhB;AAAA;AAIJ,SAAO,SAAS,MAAM;AAAA;AAGxB,MAAM,OAAO,OAAM,KACjB,CAAC;AAAA,EACC,WAAW;AAAA,EACX;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,sBAAsB;AAAA,KACnB;AAAA,MAEH,qCAAC,WAAD;AAAA,KAAe;AAAA,EAAgB,UAAU,UAAU;AAAA,GAChD,CAAC,sBACA,KAAK,IAAI,CAAC,KAAK,UAAU,YAAY,KAAK,EAAE,OAAO,UAAU,SAAS,OAEtE,qCAAC,WAAD;AAAA,EAAW;AAAA,EAAoB;AAAA,GAC5B;AAOX,MAAM,oBAAoB,CAAC,WAAW,SAAS;AAC7C,QAAM,cAAc,UAAU,KAAK;AACnC,YAAU,KAAK,UAAU,QACvB,MAAM,CAAC,UAAU;AACf,UAAM,EAAE,SAAS,eAAe,UAAU,KAAK;AAC/C,WACE,qCAAC,WAAD;AAAA,MAAW;AAAA,MAAkB,eAAe;AAAA,OAC1C,qCAAC,MAAD;AAAA,SAAU;AAAA,MAAO,WAAW;AAAA;AAAA,KAIlC;AAEF,SAAO;AAAA;AAGF,MAAM,mBAAmB,qBAAqB,cAAc;AAAA,EACjE,mBAAmB;AAAA,EACnB;AAAA,EACA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,36 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { aggregatedClasses } from
|
|
4
|
-
import Paginator from
|
|
5
|
-
import PerPageDropdown from
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
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, {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
4
|
+
import { Paginator } from "./Paginator";
|
|
5
|
+
import { PerPageDropdown } from "./PerPageDropdown";
|
|
6
|
+
const PaginationControls = aggregatedClasses("div")("data-grid", "controls-pagination");
|
|
7
|
+
const Pagination = ({
|
|
8
|
+
paginated,
|
|
9
|
+
pagination = {},
|
|
10
|
+
onPerPage,
|
|
11
|
+
onPageSelect,
|
|
12
|
+
paginationStep = 5,
|
|
13
|
+
maxPerPage = 10,
|
|
14
|
+
minPerPage = 5
|
|
15
|
+
}) => {
|
|
16
|
+
const { perPage } = pagination;
|
|
17
|
+
if (pagination && pagination.conditionalPagination === true && paginated.amount === 1)
|
|
18
|
+
return null;
|
|
19
|
+
return paginated.amount > 0 ? /* @__PURE__ */ React2.createElement(PaginationControls, null, /* @__PURE__ */ React2.createElement(PerPageDropdown, {
|
|
24
20
|
max: maxPerPage,
|
|
25
21
|
min: minPerPage,
|
|
26
22
|
onChange: onPerPage,
|
|
27
23
|
step: paginationStep,
|
|
28
24
|
value: perPage
|
|
29
|
-
}),
|
|
25
|
+
}), /* @__PURE__ */ React2.createElement(Paginator, {
|
|
30
26
|
onSelect: onPageSelect,
|
|
31
27
|
pages: paginated.amount,
|
|
32
|
-
pagination
|
|
28
|
+
pagination
|
|
33
29
|
})) : null;
|
|
34
30
|
};
|
|
35
|
-
|
|
36
|
-
|
|
31
|
+
export {
|
|
32
|
+
Pagination
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=Pagination.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/pagination/components/Pagination.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { Paginator } from './Paginator';\nimport { PerPageDropdown } from './PerPageDropdown';\n\nconst PaginationControls = aggregatedClasses('div')(\n 'data-grid',\n 'controls-pagination',\n);\n\nconst Pagination = ({\n paginated,\n pagination = {},\n onPerPage,\n onPageSelect,\n paginationStep = 5,\n maxPerPage = 10,\n minPerPage = 5,\n}) => {\n const { perPage } = pagination;\n if (\n pagination &&\n pagination.conditionalPagination === true &&\n paginated.amount === 1\n )\n return null;\n return paginated.amount > 0 ? (\n <PaginationControls>\n <PerPageDropdown\n max={maxPerPage}\n min={minPerPage}\n onChange={onPerPage}\n step={paginationStep}\n value={perPage}\n />\n <Paginator\n onSelect={onPageSelect}\n pages={paginated.amount}\n pagination={pagination}\n />\n </PaginationControls>\n ) : null;\n};\n\nexport { Pagination };\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,qBAAqB,kBAAkB,OAC3C,aACA;AAGF,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA,iBAAiB;AAAA,EACjB,aAAa;AAAA,EACb,aAAa;AAAA,MACT;AACJ,QAAM,EAAE,YAAY;AACpB,MACE,cACA,WAAW,0BAA0B,QACrC,UAAU,WAAW;AAErB,WAAO;AACT,SAAO,UAAU,SAAS,IACxB,qCAAC,oBAAD,MACE,qCAAC,iBAAD;AAAA,IACE,KAAK;AAAA,IACL,KAAK;AAAA,IACL,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,MAET,qCAAC,WAAD;AAAA,IACE,UAAU;AAAA,IACV,OAAO,UAAU;AAAA,IACjB;AAAA,QAGF;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,26 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import ReactPagify from
|
|
4
|
-
import segmentize from
|
|
5
|
-
import { aggregatedClasses } from
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
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;
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import ReactPagify from "react-pagify";
|
|
4
|
+
import segmentize from "segmentize";
|
|
5
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
6
|
+
const blockName = "data-grid";
|
|
7
|
+
const PaginationContainer = aggregatedClasses("div")(blockName, "pagination");
|
|
8
|
+
const PagifyContext = aggregatedClasses(ReactPagify?.Context)(blockName, "pagify-pagination");
|
|
9
|
+
const Paginator = ({ pagination, pages, onSelect, labelPrevious = "Previous", labelNext = "Next" }) => {
|
|
20
10
|
const prevPage = pagination.page - 1;
|
|
21
11
|
const nextPage = pagination.page + 1;
|
|
22
|
-
return
|
|
23
|
-
onSelect: page => page !== pagination.page && onSelect(page),
|
|
12
|
+
return /* @__PURE__ */ React2.createElement(PaginationContainer, null, /* @__PURE__ */ React2.createElement(PagifyContext, {
|
|
13
|
+
onSelect: (page) => page !== pagination.page && onSelect(page),
|
|
24
14
|
segments: segmentize({
|
|
25
15
|
page: pagination.page,
|
|
26
16
|
pages,
|
|
@@ -28,32 +18,36 @@ const Paginator = _ref => {
|
|
|
28
18
|
endPages: 1,
|
|
29
19
|
sidePages: 1
|
|
30
20
|
})
|
|
31
|
-
},
|
|
32
|
-
className: pagination.page <= 1 ?
|
|
21
|
+
}, /* @__PURE__ */ React2.createElement(ReactPagify.Button, {
|
|
22
|
+
className: pagination.page <= 1 ? "button-disabled" : "",
|
|
33
23
|
page: prevPage
|
|
34
|
-
},
|
|
24
|
+
}, labelPrevious), /* @__PURE__ */ React2.createElement(ReactPagify.Segment, {
|
|
35
25
|
field: "beginPages"
|
|
36
|
-
})
|
|
26
|
+
}), /* @__PURE__ */ React2.createElement(ReactPagify.Ellipsis, {
|
|
37
27
|
className: "ellipsis",
|
|
38
28
|
nextField: "previousPages",
|
|
39
29
|
previousField: "beginPages"
|
|
40
|
-
})
|
|
30
|
+
}), /* @__PURE__ */ React2.createElement(ReactPagify.Segment, {
|
|
41
31
|
field: "previousPages"
|
|
42
|
-
})
|
|
32
|
+
}), /* @__PURE__ */ React2.createElement(ReactPagify.Segment, {
|
|
43
33
|
className: "selected",
|
|
44
34
|
field: "centerPage"
|
|
45
|
-
})
|
|
35
|
+
}), /* @__PURE__ */ React2.createElement(ReactPagify.Segment, {
|
|
46
36
|
field: "nextPages"
|
|
47
|
-
})
|
|
37
|
+
}), /* @__PURE__ */ React2.createElement(ReactPagify.Ellipsis, {
|
|
48
38
|
className: "ellipsis",
|
|
49
39
|
nextField: "endPages",
|
|
50
40
|
previousField: "nextPages"
|
|
51
|
-
})
|
|
41
|
+
}), /* @__PURE__ */ React2.createElement(ReactPagify.Segment, {
|
|
52
42
|
field: "endPages"
|
|
53
|
-
})
|
|
54
|
-
className: pagination.page >= pages ?
|
|
43
|
+
}), /* @__PURE__ */ React2.createElement(ReactPagify.Button, {
|
|
44
|
+
className: pagination.page >= pages ? "button-disabled" : "",
|
|
55
45
|
page: nextPage
|
|
56
|
-
},
|
|
46
|
+
}, labelNext)));
|
|
57
47
|
};
|
|
58
|
-
|
|
59
|
-
export {
|
|
48
|
+
var Paginator_default = Paginator;
|
|
49
|
+
export {
|
|
50
|
+
Paginator,
|
|
51
|
+
Paginator_default as default
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=Paginator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/pagination/components/Paginator.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable @typescript-eslint/no-unsafe-assignment */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport React from 'react';\nimport ReactPagify from 'react-pagify';\nimport segmentize from 'segmentize';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\n\nconst blockName = 'data-grid';\n\nconst PaginationContainer = aggregatedClasses('div')(blockName, 'pagination');\nconst PagifyContext = aggregatedClasses(ReactPagify?.Context)(blockName, 'pagify-pagination');\n\nconst Paginator = ({ pagination, pages, onSelect, labelPrevious = 'Previous', labelNext = 'Next' }) => {\n const prevPage = pagination.page - 1;\n const nextPage = pagination.page + 1;\n return (\n <PaginationContainer>\n <PagifyContext\n onSelect={(page) => page !== pagination.page && onSelect(page)}\n segments={segmentize({\n page: pagination.page,\n pages,\n beginPages: 1,\n endPages: 1,\n sidePages: 1,\n })}\n >\n <ReactPagify.Button className={pagination.page <= 1 ? 'button-disabled' : ''} page={prevPage}>\n {labelPrevious}\n </ReactPagify.Button>\n\n <ReactPagify.Segment field=\"beginPages\" />\n\n <ReactPagify.Ellipsis className=\"ellipsis\" nextField=\"previousPages\" previousField=\"beginPages\" />\n\n <ReactPagify.Segment field=\"previousPages\" />\n <ReactPagify.Segment className=\"selected\" field=\"centerPage\" />\n <ReactPagify.Segment field=\"nextPages\" />\n\n <ReactPagify.Ellipsis className=\"ellipsis\" nextField=\"endPages\" previousField=\"nextPages\" />\n\n <ReactPagify.Segment field=\"endPages\" />\n\n <ReactPagify.Button className={pagination.page >= pages ? 'button-disabled' : ''} page={nextPage}>\n {labelNext}\n </ReactPagify.Button>\n </PagifyContext>\n </PaginationContainer>\n );\n};\n\nexport { Paginator };\nexport default Paginator;\n"],
|
|
5
|
+
"mappings": "AAAA;ACEA;AACA;AACA;AACA;AAEA,MAAM,YAAY;AAElB,MAAM,sBAAsB,kBAAkB,OAAO,WAAW;AAChE,MAAM,gBAAgB,kBAAkB,aAAa,SAAS,WAAW;AAEzE,MAAM,YAAY,CAAC,EAAE,YAAY,OAAO,UAAU,gBAAgB,YAAY,YAAY,aAAa;AACrG,QAAM,WAAW,WAAW,OAAO;AACnC,QAAM,WAAW,WAAW,OAAO;AACnC,SACE,qCAAC,qBAAD,MACE,qCAAC,eAAD;AAAA,IACE,UAAU,CAAC,SAAS,SAAS,WAAW,QAAQ,SAAS;AAAA,IACzD,UAAU,WAAW;AAAA,MACnB,MAAM,WAAW;AAAA,MACjB;AAAA,MACA,YAAY;AAAA,MACZ,UAAU;AAAA,MACV,WAAW;AAAA;AAAA,KAGb,qCAAC,YAAY,QAAb;AAAA,IAAoB,WAAW,WAAW,QAAQ,IAAI,oBAAoB;AAAA,IAAI,MAAM;AAAA,KACjF,gBAGH,qCAAC,YAAY,SAAb;AAAA,IAAqB,OAAM;AAAA,MAE3B,qCAAC,YAAY,UAAb;AAAA,IAAsB,WAAU;AAAA,IAAW,WAAU;AAAA,IAAgB,eAAc;AAAA,MAEnF,qCAAC,YAAY,SAAb;AAAA,IAAqB,OAAM;AAAA,MAC3B,qCAAC,YAAY,SAAb;AAAA,IAAqB,WAAU;AAAA,IAAW,OAAM;AAAA,MAChD,qCAAC,YAAY,SAAb;AAAA,IAAqB,OAAM;AAAA,MAE3B,qCAAC,YAAY,UAAb;AAAA,IAAsB,WAAU;AAAA,IAAW,WAAU;AAAA,IAAW,eAAc;AAAA,MAE9E,qCAAC,YAAY,SAAb;AAAA,IAAqB,OAAM;AAAA,MAE3B,qCAAC,YAAY,QAAb;AAAA,IAAoB,WAAW,WAAW,QAAQ,QAAQ,oBAAoB;AAAA,IAAI,MAAM;AAAA,KACrF;AAAA;AAQX,IAAO,oBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,71 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 => ({
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import memoize from "memoize-one";
|
|
4
|
+
import { range } from "@elliemae/ds-utilities";
|
|
5
|
+
import { DSComboBox, components } from "@elliemae/ds-form";
|
|
6
|
+
const SingleValue = ({ children, ...props }) => /* @__PURE__ */ React2.createElement(components.SingleValue, {
|
|
7
|
+
...props
|
|
8
|
+
}, children, " ", /* @__PURE__ */ React2.createElement("span", null, "per page"));
|
|
9
|
+
const generateOption = (value) => ({
|
|
37
10
|
value,
|
|
38
11
|
label: value
|
|
39
12
|
});
|
|
40
|
-
|
|
41
|
-
const getOptions = memoizeOne((step, min, max) => {
|
|
13
|
+
const getOptions = memoize((step, min, max) => {
|
|
42
14
|
const options = range(min, max + step, step).map(generateOption);
|
|
43
15
|
return min === 0 ? options.slice(1, options.length) : options;
|
|
44
16
|
});
|
|
45
|
-
|
|
46
|
-
function PerPageDropdown(_ref2) {
|
|
47
|
-
let {
|
|
48
|
-
min = 0,
|
|
49
|
-
max = 100,
|
|
50
|
-
step = 5,
|
|
51
|
-
value = 0,
|
|
52
|
-
onChange = () => null
|
|
53
|
-
} = _ref2;
|
|
17
|
+
function PerPageDropdown({ min = 0, max = 100, step = 5, value = 0, onChange = () => null }) {
|
|
54
18
|
const options = getOptions(step, min, max);
|
|
55
|
-
return
|
|
19
|
+
return /* @__PURE__ */ React2.createElement(DSComboBox, {
|
|
56
20
|
className: "per-page-dropdown",
|
|
57
21
|
components: {
|
|
58
22
|
SingleValue
|
|
59
23
|
},
|
|
60
24
|
containerProps: {
|
|
61
|
-
|
|
25
|
+
"data-testid": "per-page-dropdown"
|
|
62
26
|
},
|
|
63
27
|
maxOptions: 10,
|
|
64
|
-
onChange
|
|
65
|
-
options
|
|
28
|
+
onChange,
|
|
29
|
+
options,
|
|
66
30
|
searchable: false,
|
|
67
|
-
value
|
|
31
|
+
value
|
|
68
32
|
});
|
|
69
33
|
}
|
|
70
|
-
|
|
71
|
-
export {
|
|
34
|
+
var PerPageDropdown_default = PerPageDropdown;
|
|
35
|
+
export {
|
|
36
|
+
PerPageDropdown,
|
|
37
|
+
PerPageDropdown_default as default
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=PerPageDropdown.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/pagination/components/PerPageDropdown.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport memoize from 'memoize-one';\nimport { range } from '@elliemae/ds-utilities';\nimport { DSComboBox, components } from '@elliemae/ds-form';\n\nconst SingleValue = ({ children, ...props }) => (\n <components.SingleValue {...props}>\n {children} <span>per page</span>\n </components.SingleValue>\n);\n\nconst generateOption = (value) => ({\n value,\n label: value,\n});\nconst getOptions = memoize((step, min, max) => {\n const options = range(min, max + step, step).map(generateOption);\n return min === 0 ? options.slice(1, options.length) : options;\n});\n\nfunction PerPageDropdown({ min = 0, max = 100, step = 5, value = 0, onChange = () => null }) {\n const options = getOptions(step, min, max);\n return (\n <DSComboBox\n className=\"per-page-dropdown\"\n components={{\n SingleValue,\n }}\n containerProps={{\n 'data-testid': 'per-page-dropdown',\n }}\n maxOptions={10}\n onChange={onChange}\n options={options}\n searchable={false}\n value={value}\n />\n );\n}\n\nexport { PerPageDropdown };\nexport default PerPageDropdown;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,cAAc,CAAC,EAAE,aAAa,YAClC,qCAAC,WAAW,aAAZ;AAAA,KAA4B;AAAA,GACzB,UAAS,KAAC,qCAAC,QAAD,MAAM;AAIrB,MAAM,iBAAiB,CAAC,UAAW;AAAA,EACjC;AAAA,EACA,OAAO;AAAA;AAET,MAAM,aAAa,QAAQ,CAAC,MAAM,KAAK,QAAQ;AAC7C,QAAM,UAAU,MAAM,KAAK,MAAM,MAAM,MAAM,IAAI;AACjD,SAAO,QAAQ,IAAI,QAAQ,MAAM,GAAG,QAAQ,UAAU;AAAA;AAGxD,yBAAyB,EAAE,MAAM,GAAG,MAAM,KAAK,OAAO,GAAG,QAAQ,GAAG,WAAW,MAAM,QAAQ;AAC3F,QAAM,UAAU,WAAW,MAAM,KAAK;AACtC,SACE,qCAAC,YAAD;AAAA,IACE,WAAU;AAAA,IACV,YAAY;AAAA,MACV;AAAA;AAAA,IAEF,gBAAgB;AAAA,MACd,eAAe;AAAA;AAAA,IAEjB,YAAY;AAAA,IACZ;AAAA,IACA;AAAA,IACA,YAAY;AAAA,IACZ;AAAA;AAAA;AAMN,IAAO,0BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,27 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (number > max)
|
|
4
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
const parsePerPageNumber = (number, max, min = 1) => {
|
|
3
|
+
if (number > max)
|
|
4
|
+
return max;
|
|
5
|
+
if (number < min)
|
|
6
|
+
return min;
|
|
5
7
|
return number;
|
|
6
8
|
};
|
|
7
|
-
|
|
8
|
-
let {
|
|
9
|
-
page,
|
|
10
|
-
perPage = 1,
|
|
11
|
-
amountOfPages: amount,
|
|
12
|
-
totalRows
|
|
13
|
-
} = _ref;
|
|
14
|
-
|
|
15
|
-
// return if pagination state is controlled
|
|
9
|
+
const paginate = (rows, { page, perPage = 1, amountOfPages: amount, totalRows }) => {
|
|
16
10
|
if (amount && totalRows) {
|
|
17
11
|
return {
|
|
18
12
|
amount,
|
|
19
13
|
rows,
|
|
20
14
|
page
|
|
21
15
|
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
}
|
|
25
17
|
const p = page - 1 || 0;
|
|
26
18
|
const amountOfPages = perPage ? Math.ceil(rows.length / (perPage > 0 ? perPage : 1)) : 1;
|
|
27
19
|
const startPage = p < amountOfPages ? p : 0;
|
|
@@ -31,6 +23,11 @@ function paginate(rows, _ref) {
|
|
|
31
23
|
allRows: rows,
|
|
32
24
|
page: startPage
|
|
33
25
|
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export {
|
|
26
|
+
};
|
|
27
|
+
var helper_default = paginate;
|
|
28
|
+
export {
|
|
29
|
+
helper_default as default,
|
|
30
|
+
paginate,
|
|
31
|
+
parsePerPageNumber
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=helper.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/helper.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export const parsePerPageNumber = (number, max, min = 1) => {\n if (number > max) return max;\n if (number < min) return min;\n return number;\n};\n\nexport const paginate = (\n rows,\n { page, perPage = 1, amountOfPages: amount, totalRows },\n) => {\n // return if pagination state is controlled\n if (amount && totalRows) {\n return {\n amount,\n rows,\n page,\n };\n }\n // adapt to zero indexed logic\n const p = page - 1 || 0;\n\n const amountOfPages = perPage\n ? Math.ceil(rows.length / (perPage > 0 ? perPage : 1))\n : 1;\n const startPage = p < amountOfPages ? p : 0;\n\n return {\n amount: amountOfPages,\n rows: perPage\n ? rows.slice(startPage * perPage, startPage * perPage + perPage)\n : rows,\n allRows: rows,\n page: startPage,\n };\n};\n\nexport default paginate;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAO,MAAM,qBAAqB,CAAC,QAAQ,KAAK,MAAM,MAAM;AAC1D,MAAI,SAAS;AAAK,WAAO;AACzB,MAAI,SAAS;AAAK,WAAO;AACzB,SAAO;AAAA;AAGF,MAAM,WAAW,CACtB,MACA,EAAE,MAAM,UAAU,GAAG,eAAe,QAAQ,gBACzC;AAEH,MAAI,UAAU,WAAW;AACvB,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAIJ,QAAM,IAAI,OAAO,KAAK;AAEtB,QAAM,gBAAgB,UAClB,KAAK,KAAK,KAAK,SAAU,WAAU,IAAI,UAAU,MACjD;AACJ,QAAM,YAAY,IAAI,gBAAgB,IAAI;AAE1C,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,MAAM,UACF,KAAK,MAAM,YAAY,SAAS,YAAY,UAAU,WACtD;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA;AAAA;AAIV,IAAO,iBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { PaginationPlugin } from './PaginationPlugin';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
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; }
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useDerivedStateFromProps } from "@elliemae/ds-utilities";
|
|
3
|
+
import { parsePerPageNumber } from "./helper";
|
|
14
4
|
function usePaginationState(grid) {
|
|
15
5
|
const {
|
|
16
6
|
minPerPage = 0,
|
|
@@ -23,16 +13,12 @@ function usePaginationState(grid) {
|
|
|
23
13
|
},
|
|
24
14
|
groupedRows
|
|
25
15
|
} = grid.props;
|
|
26
|
-
const {
|
|
27
|
-
composedRows,
|
|
28
|
-
rows
|
|
29
|
-
} = grid.getInstance();
|
|
16
|
+
const { composedRows, rows } = grid.getInstance();
|
|
30
17
|
const [pagination, setPagination] = useDerivedStateFromProps(paginationProp);
|
|
31
|
-
|
|
32
|
-
const onPerPage = perPageNumber => {
|
|
18
|
+
const onPerPage = (perPageNumber) => {
|
|
33
19
|
const parsedPerPageNumber = parsePerPageNumber(perPageNumber, maxPerPage, minPerPage);
|
|
34
20
|
const actualNumber = parsedPerPageNumber ? parseInt(parsedPerPageNumber, 10) : 0;
|
|
35
|
-
setPagination(prevPagination => {
|
|
21
|
+
setPagination((prevPagination) => {
|
|
36
22
|
onPerPageChange(actualNumber);
|
|
37
23
|
return {
|
|
38
24
|
page: prevPagination.page,
|
|
@@ -40,18 +26,17 @@ function usePaginationState(grid) {
|
|
|
40
26
|
};
|
|
41
27
|
});
|
|
42
28
|
};
|
|
43
|
-
|
|
44
|
-
const onPageSelect = page => {
|
|
29
|
+
const onPageSelect = (page) => {
|
|
45
30
|
const length = groupedRows ? composedRows.length : rows.length;
|
|
46
|
-
setPagination(prevPagination => {
|
|
31
|
+
setPagination((prevPagination) => {
|
|
47
32
|
const pages = Math.ceil(length / prevPagination.perPage);
|
|
48
33
|
onPageChange(page);
|
|
49
|
-
return
|
|
34
|
+
return {
|
|
35
|
+
...prevPagination,
|
|
50
36
|
page: Math.min(Math.max(page, 1), pages)
|
|
51
|
-
}
|
|
37
|
+
};
|
|
52
38
|
});
|
|
53
39
|
};
|
|
54
|
-
|
|
55
40
|
return {
|
|
56
41
|
state: {
|
|
57
42
|
pagination
|
|
@@ -62,5 +47,7 @@ function usePaginationState(grid) {
|
|
|
62
47
|
}
|
|
63
48
|
};
|
|
64
49
|
}
|
|
65
|
-
|
|
66
|
-
|
|
50
|
+
export {
|
|
51
|
+
usePaginationState
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=usePaginationState.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/usePaginationState.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useDerivedStateFromProps } from '@elliemae/ds-utilities';\nimport { parsePerPageNumber } from './helper';\n\nexport function usePaginationState(grid) {\n const {\n minPerPage = 0,\n maxPerPage = 50,\n onPerPageChange = () => null,\n onPageChange = () => null,\n pagination: paginationProp = {\n page: 1,\n perPage: 10,\n },\n groupedRows,\n } = grid.props;\n const { composedRows, rows } = grid.getInstance();\n const [pagination, setPagination] = useDerivedStateFromProps(paginationProp);\n\n const onPerPage = (perPageNumber) => {\n const parsedPerPageNumber = parsePerPageNumber(perPageNumber, maxPerPage, minPerPage);\n const actualNumber = parsedPerPageNumber ? parseInt(parsedPerPageNumber, 10) : 0;\n\n setPagination((prevPagination) => {\n onPerPageChange(actualNumber);\n return {\n page: prevPagination.page,\n perPage: actualNumber,\n };\n });\n };\n\n const onPageSelect = (page) => {\n const length = groupedRows ? composedRows.length : rows.length;\n setPagination((prevPagination) => {\n const pages = Math.ceil(length / prevPagination.perPage);\n onPageChange(page);\n return {\n ...prevPagination,\n page: Math.min(Math.max(page, 1), pages),\n };\n });\n };\n\n return {\n state: {\n pagination,\n },\n actions: {\n onPerPage,\n onPageSelect,\n },\n };\n}\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEO,4BAA4B,MAAM;AACvC,QAAM;AAAA,IACJ,aAAa;AAAA,IACb,aAAa;AAAA,IACb,kBAAkB,MAAM;AAAA,IACxB,eAAe,MAAM;AAAA,IACrB,YAAY,iBAAiB;AAAA,MAC3B,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX;AAAA,MACE,KAAK;AACT,QAAM,EAAE,cAAc,SAAS,KAAK;AACpC,QAAM,CAAC,YAAY,iBAAiB,yBAAyB;AAE7D,QAAM,YAAY,CAAC,kBAAkB;AACnC,UAAM,sBAAsB,mBAAmB,eAAe,YAAY;AAC1E,UAAM,eAAe,sBAAsB,SAAS,qBAAqB,MAAM;AAE/E,kBAAc,CAAC,mBAAmB;AAChC,sBAAgB;AAChB,aAAO;AAAA,QACL,MAAM,eAAe;AAAA,QACrB,SAAS;AAAA;AAAA;AAAA;AAKf,QAAM,eAAe,CAAC,SAAS;AAC7B,UAAM,SAAS,cAAc,aAAa,SAAS,KAAK;AACxD,kBAAc,CAAC,mBAAmB;AAChC,YAAM,QAAQ,KAAK,KAAK,SAAS,eAAe;AAChD,mBAAa;AACb,aAAO;AAAA,WACF;AAAA,QACH,MAAM,KAAK,IAAI,KAAK,IAAI,MAAM,IAAI;AAAA;AAAA;AAAA;AAKxC,SAAO;AAAA,IACL,OAAO;AAAA,MACL;AAAA;AAAA,IAEF,SAAS;AAAA,MACP;AAAA,MACA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|