@elliemae/ds-datagrids 2.2.0-next.4 → 2.3.0-alpha.2
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 +2 -116
- 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,12 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import { groupBy } from 'lodash';
|
|
5
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { createInstancePlugin } from "@elliemae/ds-shared/createDataInstance/createInstancePlugin";
|
|
3
|
+
import { groupBy } from "lodash";
|
|
6
4
|
const groupedByData = (groupedBy, composedRows) => {
|
|
7
5
|
const grouped = groupBy(composedRows, groupedBy);
|
|
8
6
|
return Object.keys(grouped).map((c, key) => ({
|
|
9
|
-
id:
|
|
7
|
+
id: `grouped-by-${groupedBy}-${key}`,
|
|
10
8
|
key: groupedBy,
|
|
11
9
|
value: c,
|
|
12
10
|
children: grouped[c],
|
|
@@ -14,19 +12,17 @@ const groupedByData = (groupedBy, composedRows) => {
|
|
|
14
12
|
isGroup: true
|
|
15
13
|
}));
|
|
16
14
|
};
|
|
17
|
-
|
|
18
|
-
const GroupingByPlugin = createInstancePlugin('groupedByRows', {
|
|
15
|
+
const GroupingByPlugin = createInstancePlugin("groupedByRows", {
|
|
19
16
|
decorateGrid(grid) {
|
|
20
17
|
const {
|
|
21
18
|
composedRows,
|
|
22
|
-
props: {
|
|
23
|
-
groupedBy
|
|
24
|
-
}
|
|
19
|
+
props: { groupedBy }
|
|
25
20
|
} = grid.getInstance();
|
|
26
21
|
grid.composedRows = groupedBy ? groupedByData(groupedBy, composedRows) : composedRows;
|
|
27
22
|
return grid;
|
|
28
23
|
}
|
|
29
|
-
|
|
30
24
|
});
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
export {
|
|
26
|
+
GroupingByPlugin
|
|
27
|
+
};
|
|
28
|
+
//# sourceMappingURL=GroupingByPlugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-by/GroupingByPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createInstancePlugin } from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';\nimport { groupBy } from 'lodash';\n\nconst groupedByData = (groupedBy, composedRows) => {\n const grouped = groupBy(composedRows, groupedBy);\n return Object.keys(grouped).map((c, key) => ({\n id: `grouped-by-${groupedBy}-${key}`,\n key: groupedBy,\n value: c,\n children: grouped[c],\n _isGroup: true,\n isGroup: true,\n }));\n};\n\nexport const GroupingByPlugin = createInstancePlugin('groupedByRows', {\n decorateGrid(grid) {\n const {\n composedRows,\n props: { groupedBy },\n } = grid.getInstance();\n grid.composedRows = groupedBy\n ? groupedByData(groupedBy, composedRows)\n : composedRows;\n return grid;\n },\n});\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEA,MAAM,gBAAgB,CAAC,WAAW,iBAAiB;AACjD,QAAM,UAAU,QAAQ,cAAc;AACtC,SAAO,OAAO,KAAK,SAAS,IAAI,CAAC,GAAG,QAAS;AAAA,IAC3C,IAAI,cAAc,aAAa;AAAA,IAC/B,KAAK;AAAA,IACL,OAAO;AAAA,IACP,UAAU,QAAQ;AAAA,IAClB,UAAU;AAAA,IACV,SAAS;AAAA;AAAA;AAIN,MAAM,mBAAmB,qBAAqB,iBAAiB;AAAA,EACpE,aAAa,MAAM;AACjB,UAAM;AAAA,MACJ;AAAA,MACA,OAAO,EAAE;AAAA,QACP,KAAK;AACT,SAAK,eAAe,YAChB,cAAc,WAAW,gBACzB;AACJ,WAAO;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,65 +1,39 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import { useMemo } from 'react';
|
|
14
|
-
import createInstancePlugin from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';
|
|
15
|
-
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
16
|
-
import { VariableSizeList } from 'react-window';
|
|
17
|
-
import { walkTreeStrategy } from './walkStrategy.js';
|
|
18
|
-
import { RowSizes } from '../../rowSizes.js';
|
|
19
|
-
import { dataGridBlockName } from '../../blockNames.js';
|
|
20
|
-
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
21
|
-
|
|
22
|
-
const _excluded = ["isExpanded"];
|
|
23
|
-
|
|
24
|
-
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; }
|
|
25
|
-
|
|
26
|
-
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; }
|
|
27
|
-
const blockName = "".concat(dataGridBlockName, "-group-row-header");
|
|
28
|
-
const GroupRowHeaderWrapper = aggregatedClasses('div')(blockName);
|
|
29
|
-
const GroupRowHeaderTitle = aggregatedClasses('div')(blockName, 'title');
|
|
30
|
-
const GroupingPlugin = createInstancePlugin('groupedRows', {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useMemo } from "react";
|
|
3
|
+
import { createInstancePlugin } from "@elliemae/ds-shared/createDataInstance/createInstancePlugin";
|
|
4
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
5
|
+
import { VariableSizeList } from "react-window";
|
|
6
|
+
import { walkTreeStrategy } from "./walkStrategy";
|
|
7
|
+
import { RowSizes } from "../../rowSizes";
|
|
8
|
+
import { dataGridBlockName } from "../../blockNames";
|
|
9
|
+
const blockName = `${dataGridBlockName}-group-row-header`;
|
|
10
|
+
const GroupRowHeaderWrapper = aggregatedClasses("div")(blockName);
|
|
11
|
+
const GroupRowHeaderTitle = aggregatedClasses("div")(blockName, "title");
|
|
12
|
+
const GroupingPlugin = createInstancePlugin("groupedRows", {
|
|
31
13
|
decorateGrid(grid) {
|
|
32
|
-
const {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
} = grid.getInstance(); // eslint-disable-next-line react-hooks/rules-of-hooks
|
|
36
|
-
|
|
37
|
-
const detailColumns = useMemo(() => columns.map(column => _objectSpread(_objectSpread({}, column), {}, {
|
|
14
|
+
const { columns, composedRows } = grid.getInstance();
|
|
15
|
+
const detailColumns = useMemo(() => columns.map((column) => ({
|
|
16
|
+
...column,
|
|
38
17
|
customRenderer: column.detailCustomRenderer
|
|
39
|
-
})).filter(col => !col.expandableColumn), [columns]);
|
|
18
|
+
})).filter((col) => !col.expandableColumn), [columns]);
|
|
40
19
|
const flatRows = [];
|
|
41
20
|
walkTreeStrategy({
|
|
42
21
|
data: composedRows,
|
|
43
|
-
cb: n => flatRows.push(n)
|
|
22
|
+
cb: (n) => flatRows.push(n)
|
|
44
23
|
});
|
|
45
24
|
return {
|
|
46
25
|
detailColumns,
|
|
47
26
|
composedRows: flatRows
|
|
48
27
|
};
|
|
49
28
|
},
|
|
50
|
-
|
|
51
29
|
getBodyProps(bodyProps, grid) {
|
|
52
|
-
const {
|
|
53
|
-
|
|
54
|
-
} = grid.getInstance(); // implementation of expandable row single column with aggregation
|
|
55
|
-
|
|
56
|
-
const getItemSize = index => {
|
|
30
|
+
const { composedRows: rows } = grid.getInstance();
|
|
31
|
+
const getItemSize = (index) => {
|
|
57
32
|
const rowData = rows[index];
|
|
58
|
-
if (!rowData)
|
|
33
|
+
if (!rowData)
|
|
34
|
+
return RowSizes.normal;
|
|
59
35
|
return rowData._isGroup || rowData.isGroup ? RowSizes.compact : RowSizes.normal;
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
|
|
36
|
+
};
|
|
63
37
|
const getListHeight = () => {
|
|
64
38
|
const size = rows.reduce((h, r) => {
|
|
65
39
|
const rowHeight = r._isGroup || r.isGroup ? RowSizes.compact : RowSizes.normal;
|
|
@@ -67,72 +41,57 @@ const GroupingPlugin = createInstancePlugin('groupedRows', {
|
|
|
67
41
|
}, 0);
|
|
68
42
|
return size;
|
|
69
43
|
};
|
|
70
|
-
|
|
71
|
-
|
|
44
|
+
return {
|
|
45
|
+
...bodyProps,
|
|
72
46
|
getListHeight,
|
|
73
47
|
listComponent: VariableSizeList,
|
|
74
|
-
listProps: {
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
});
|
|
48
|
+
listProps: { itemSize: getItemSize }
|
|
49
|
+
};
|
|
78
50
|
},
|
|
79
|
-
|
|
80
51
|
composeRows: (rows, grid) => {
|
|
81
52
|
const {
|
|
82
53
|
composedRows,
|
|
83
|
-
props: {
|
|
84
|
-
rowKey
|
|
85
|
-
}
|
|
54
|
+
props: { rowKey }
|
|
86
55
|
} = grid.getInstance();
|
|
87
|
-
|
|
88
56
|
if (Array.isArray(rows)) {
|
|
89
|
-
const filterIds = rows.map(r => r.data[rowKey]);
|
|
90
|
-
return composedRows.filter(c => filterIds.includes(c.data[rowKey])).map(r =>
|
|
91
|
-
|
|
57
|
+
const filterIds = rows.map((r) => r.data[rowKey]);
|
|
58
|
+
return composedRows.filter((c) => filterIds.includes(c.data[rowKey])).map((r) => ({
|
|
59
|
+
...r.data,
|
|
60
|
+
children: Array.isArray(r.data.children) ? r.data.children.filter((c) => filterIds.includes(c[rowKey])) : r.data.children,
|
|
92
61
|
_isGroup: r.isGroup
|
|
93
|
-
})).filter(g => g.children ===
|
|
62
|
+
})).filter((g) => g.children === void 0 || g.children.length > 0);
|
|
94
63
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
allRows: rows.allRows.map(r =>
|
|
64
|
+
return {
|
|
65
|
+
...rows,
|
|
66
|
+
allRows: rows.allRows.map((r) => ({
|
|
67
|
+
...r.data,
|
|
98
68
|
_isGroup: r.isGroup
|
|
99
69
|
})),
|
|
100
|
-
rows: rows.rows.map(r =>
|
|
70
|
+
rows: rows.rows.map((r) => ({
|
|
71
|
+
...r.data,
|
|
101
72
|
_isGroup: r.isGroup
|
|
102
73
|
}))
|
|
103
|
-
}
|
|
74
|
+
};
|
|
104
75
|
},
|
|
105
|
-
|
|
106
76
|
decorateRenderers(renderers, grid) {
|
|
107
|
-
const Row = renderers.body.row;
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
// eslint-disable-next-line react/prop-types
|
|
111
|
-
_ref => {
|
|
112
|
-
let rowProps = _objectWithoutProperties(_ref, _excluded);
|
|
113
|
-
|
|
114
|
-
const {
|
|
115
|
-
composedRows
|
|
116
|
-
} = grid.getInstance(); // // https://jira.elliemae.io/browse/PUI-1667
|
|
117
|
-
|
|
77
|
+
const Row = renderers.body.row;
|
|
78
|
+
renderers.body.row = useMemo(() => ({ isExpanded, ...rowProps }) => {
|
|
79
|
+
const { composedRows } = grid.getInstance();
|
|
118
80
|
const node = composedRows[rowProps.index] ? composedRows[rowProps.index] : rowProps.rowData;
|
|
119
|
-
const {
|
|
120
|
-
groupedRowsRenderHeader
|
|
121
|
-
} = grid.props; // eslint-disable-next-line no-underscore-dangle
|
|
122
|
-
|
|
81
|
+
const { groupedRowsRenderHeader } = grid.props;
|
|
123
82
|
if (node && node._isGroup) {
|
|
124
|
-
return
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}))
|
|
128
|
-
});
|
|
83
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(GroupRowHeaderWrapper, {
|
|
84
|
+
...rowProps
|
|
85
|
+
}, /* @__PURE__ */ React2.createElement(GroupRowHeaderTitle, null, groupedRowsRenderHeader ? groupedRowsRenderHeader(node) : "Group")));
|
|
129
86
|
}
|
|
130
|
-
|
|
131
|
-
|
|
87
|
+
return /* @__PURE__ */ React2.createElement(Row, {
|
|
88
|
+
...rowProps
|
|
89
|
+
});
|
|
132
90
|
}, []);
|
|
133
91
|
return renderers;
|
|
134
92
|
}
|
|
135
|
-
|
|
136
93
|
});
|
|
137
|
-
|
|
138
|
-
|
|
94
|
+
export {
|
|
95
|
+
GroupingPlugin
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=GroupingPlugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-grid/GroupingPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable no-underscore-dangle */\nimport React, { useMemo } from 'react';\nimport { createInstancePlugin } from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { VariableSizeList } from 'react-window';\nimport { walkTreeStrategy } from './walkStrategy';\nimport { RowSizes } from '../../rowSizes';\nimport { dataGridBlockName } from '../../blockNames';\n\nconst blockName = `${dataGridBlockName}-group-row-header`;\nconst GroupRowHeaderWrapper = aggregatedClasses('div')(blockName);\nconst GroupRowHeaderTitle = aggregatedClasses('div')(blockName, 'title');\n\nexport const GroupingPlugin = createInstancePlugin('groupedRows', {\n decorateGrid(grid) {\n const { columns, composedRows } = grid.getInstance();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const detailColumns = useMemo(\n () =>\n columns\n .map((column) => ({\n ...column,\n customRenderer: column.detailCustomRenderer,\n }))\n .filter((col) => !col.expandableColumn),\n [columns],\n );\n const flatRows = [];\n walkTreeStrategy({\n data: composedRows,\n cb: (n) => flatRows.push(n),\n });\n return {\n detailColumns,\n composedRows: flatRows,\n };\n },\n getBodyProps(bodyProps, grid) {\n const { composedRows: rows } = grid.getInstance();\n // implementation of expandable row single column with aggregation\n const getItemSize = (index) => {\n const rowData = rows[index];\n if (!rowData) return RowSizes.normal;\n return rowData._isGroup || rowData.isGroup\n ? RowSizes.compact\n : RowSizes.normal;\n };\n // eslint-disable-next-line no-unused-vars\n const getListHeight = () => {\n const size = rows.reduce((h, r) => {\n const rowHeight =\n r._isGroup || r.isGroup ? RowSizes.compact : RowSizes.normal;\n return h + rowHeight;\n }, 0);\n return size;\n };\n return {\n ...bodyProps,\n getListHeight,\n listComponent: VariableSizeList,\n listProps: { itemSize: getItemSize },\n };\n },\n composeRows: (rows, grid) => {\n const {\n composedRows,\n props: { rowKey },\n } = grid.getInstance();\n\n if (Array.isArray(rows)) {\n const filterIds = rows.map((r) => r.data[rowKey]);\n return composedRows\n .filter((c) => filterIds.includes(c.data[rowKey]))\n .map((r) => ({\n ...r.data,\n children: Array.isArray(r.data.children)\n ? r.data.children.filter((c) => filterIds.includes(c[rowKey]))\n : r.data.children,\n _isGroup: r.isGroup,\n }))\n .filter((g) => g.children === undefined || g.children.length > 0);\n }\n return {\n ...rows,\n allRows: rows.allRows.map((r) => ({\n ...r.data,\n _isGroup: r.isGroup,\n })),\n rows: rows.rows.map((r) => ({\n ...r.data,\n _isGroup: r.isGroup,\n })),\n };\n },\n decorateRenderers(renderers, grid) {\n const Row = renderers.body.row;\n // eslint-disable-next-line react-hooks/rules-of-hooks\n renderers.body.row = useMemo(\n () =>\n // eslint-disable-next-line react/display-name\n // eslint-disable-next-line react/prop-types\n ({ isExpanded, ...rowProps }) => {\n const { composedRows } = grid.getInstance();\n // // https://jira.elliemae.io/browse/PUI-1667\n const node = composedRows[rowProps.index]\n ? composedRows[rowProps.index]\n : rowProps.rowData;\n const { groupedRowsRenderHeader } = grid.props;\n // eslint-disable-next-line no-underscore-dangle\n if (node && node._isGroup) {\n return (\n <>\n <GroupRowHeaderWrapper {...rowProps}>\n <GroupRowHeaderTitle>\n {groupedRowsRenderHeader\n ? groupedRowsRenderHeader(node)\n : 'Group'}\n </GroupRowHeaderTitle>\n </GroupRowHeaderWrapper>\n </>\n );\n }\n return <Row {...rowProps} />;\n },\n [],\n );\n\n return renderers;\n },\n});\n"],
|
|
5
|
+
"mappings": "AAAA;ACEA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,YAAY,GAAG;AACrB,MAAM,wBAAwB,kBAAkB,OAAO;AACvD,MAAM,sBAAsB,kBAAkB,OAAO,WAAW;AAEzD,MAAM,iBAAiB,qBAAqB,eAAe;AAAA,EAChE,aAAa,MAAM;AACjB,UAAM,EAAE,SAAS,iBAAiB,KAAK;AAEvC,UAAM,gBAAgB,QACpB,MACE,QACG,IAAI,CAAC,WAAY;AAAA,SACb;AAAA,MACH,gBAAgB,OAAO;AAAA,QAExB,OAAO,CAAC,QAAQ,CAAC,IAAI,mBAC1B,CAAC;AAEH,UAAM,WAAW;AACjB,qBAAiB;AAAA,MACf,MAAM;AAAA,MACN,IAAI,CAAC,MAAM,SAAS,KAAK;AAAA;AAE3B,WAAO;AAAA,MACL;AAAA,MACA,cAAc;AAAA;AAAA;AAAA,EAGlB,aAAa,WAAW,MAAM;AAC5B,UAAM,EAAE,cAAc,SAAS,KAAK;AAEpC,UAAM,cAAc,CAAC,UAAU;AAC7B,YAAM,UAAU,KAAK;AACrB,UAAI,CAAC;AAAS,eAAO,SAAS;AAC9B,aAAO,QAAQ,YAAY,QAAQ,UAC/B,SAAS,UACT,SAAS;AAAA;AAGf,UAAM,gBAAgB,MAAM;AAC1B,YAAM,OAAO,KAAK,OAAO,CAAC,GAAG,MAAM;AACjC,cAAM,YACJ,EAAE,YAAY,EAAE,UAAU,SAAS,UAAU,SAAS;AACxD,eAAO,IAAI;AAAA,SACV;AACH,aAAO;AAAA;AAET,WAAO;AAAA,SACF;AAAA,MACH;AAAA,MACA,eAAe;AAAA,MACf,WAAW,EAAE,UAAU;AAAA;AAAA;AAAA,EAG3B,aAAa,CAAC,MAAM,SAAS;AAC3B,UAAM;AAAA,MACJ;AAAA,MACA,OAAO,EAAE;AAAA,QACP,KAAK;AAET,QAAI,MAAM,QAAQ,OAAO;AACvB,YAAM,YAAY,KAAK,IAAI,CAAC,MAAM,EAAE,KAAK;AACzC,aAAO,aACJ,OAAO,CAAC,MAAM,UAAU,SAAS,EAAE,KAAK,UACxC,IAAI,CAAC,MAAO;AAAA,WACR,EAAE;AAAA,QACL,UAAU,MAAM,QAAQ,EAAE,KAAK,YAC3B,EAAE,KAAK,SAAS,OAAO,CAAC,MAAM,UAAU,SAAS,EAAE,YACnD,EAAE,KAAK;AAAA,QACX,UAAU,EAAE;AAAA,UAEb,OAAO,CAAC,MAAM,EAAE,aAAa,UAAa,EAAE,SAAS,SAAS;AAAA;AAEnE,WAAO;AAAA,SACF;AAAA,MACH,SAAS,KAAK,QAAQ,IAAI,CAAC,MAAO;AAAA,WAC7B,EAAE;AAAA,QACL,UAAU,EAAE;AAAA;AAAA,MAEd,MAAM,KAAK,KAAK,IAAI,CAAC,MAAO;AAAA,WACvB,EAAE;AAAA,QACL,UAAU,EAAE;AAAA;AAAA;AAAA;AAAA,EAIlB,kBAAkB,WAAW,MAAM;AACjC,UAAM,MAAM,UAAU,KAAK;AAE3B,cAAU,KAAK,MAAM,QACnB,MAGE,CAAC,EAAE,eAAe,eAAe;AAC/B,YAAM,EAAE,iBAAiB,KAAK;AAE9B,YAAM,OAAO,aAAa,SAAS,SAC/B,aAAa,SAAS,SACtB,SAAS;AACb,YAAM,EAAE,4BAA4B,KAAK;AAEzC,UAAI,QAAQ,KAAK,UAAU;AACzB,eACE,4DACE,qCAAC,uBAAD;AAAA,aAA2B;AAAA,WACzB,qCAAC,qBAAD,MACG,0BACG,wBAAwB,QACxB;AAAA;AAMd,aAAO,qCAAC,KAAD;AAAA,WAAS;AAAA;AAAA,OAEpB;AAGF,WAAO;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import * as React from "react";
|
|
3
2
|
function getPath(parentNode, index, childrenKey) {
|
|
4
|
-
if (!parentNode)
|
|
3
|
+
if (!parentNode)
|
|
4
|
+
return [index];
|
|
5
5
|
return [...parentNode.path, childrenKey, index];
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
cb
|
|
17
|
-
} = _ref;
|
|
18
|
-
|
|
19
|
-
// eslint-disable-next-line no-loops/no-loops,no-plusplus
|
|
7
|
+
function walkTreeStrategy({
|
|
8
|
+
data,
|
|
9
|
+
childrenKey = "children",
|
|
10
|
+
level = 0,
|
|
11
|
+
getId = (item) => item.id,
|
|
12
|
+
parentNode,
|
|
13
|
+
shouldWalkChildren = () => true,
|
|
14
|
+
cb
|
|
15
|
+
}) {
|
|
20
16
|
for (let i = 0; i < data.length; i++) {
|
|
21
17
|
const currLevel = level + 1;
|
|
22
18
|
const children = data[i][childrenKey];
|
|
@@ -30,13 +26,10 @@ function walkTreeStrategy(_ref) {
|
|
|
30
26
|
nestingLevel: currLevel,
|
|
31
27
|
parentNode: parentNode || {
|
|
32
28
|
isGroup: true,
|
|
33
|
-
data: {
|
|
34
|
-
children: data
|
|
35
|
-
}
|
|
29
|
+
data: { children: data }
|
|
36
30
|
}
|
|
37
31
|
};
|
|
38
32
|
cb(node);
|
|
39
|
-
|
|
40
33
|
if (shouldWalkChildren(node) && children && children.length) {
|
|
41
34
|
walkTreeStrategy({
|
|
42
35
|
data: children,
|
|
@@ -48,5 +41,7 @@ function walkTreeStrategy(_ref) {
|
|
|
48
41
|
}
|
|
49
42
|
}
|
|
50
43
|
}
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
export {
|
|
45
|
+
walkTreeStrategy
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=walkStrategy.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-grid/walkStrategy.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "function getPath(parentNode, index, childrenKey) {\n if (!parentNode) return [index];\n return [...parentNode.path, childrenKey, index];\n}\n\nexport function walkTreeStrategy({\n data,\n childrenKey = 'children',\n level = 0,\n getId = item => item.id,\n parentNode,\n shouldWalkChildren = () => true,\n cb,\n}) {\n // eslint-disable-next-line no-loops/no-loops,no-plusplus\n for (let i = 0; i < data.length; i++) {\n const currLevel = level + 1;\n const children = data[i][childrenKey];\n const isGroup = children && !!children.length;\n const node = {\n index: i,\n id: getId(data[i]),\n data: data[i],\n path: getPath(parentNode, i, childrenKey),\n isGroup,\n nestingLevel: currLevel,\n parentNode: parentNode || {\n isGroup: true,\n data: { children: data },\n },\n };\n cb(node);\n if (shouldWalkChildren(node) && children && children.length) {\n walkTreeStrategy({\n data: children,\n level: currLevel,\n parentNode: node,\n shouldWalkChildren,\n cb,\n });\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA,iBAAiB,YAAY,OAAO,aAAa;AAC/C,MAAI,CAAC;AAAY,WAAO,CAAC;AACzB,SAAO,CAAC,GAAG,WAAW,MAAM,aAAa;AAAA;AAGpC,0BAA0B;AAAA,EAC/B;AAAA,EACA,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,QAAQ,UAAQ,KAAK;AAAA,EACrB;AAAA,EACA,qBAAqB,MAAM;AAAA,EAC3B;AAAA,GACC;AAED,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,YAAY,QAAQ;AAC1B,UAAM,WAAW,KAAK,GAAG;AACzB,UAAM,UAAU,YAAY,CAAC,CAAC,SAAS;AACvC,UAAM,OAAO;AAAA,MACX,OAAO;AAAA,MACP,IAAI,MAAM,KAAK;AAAA,MACf,MAAM,KAAK;AAAA,MACX,MAAM,QAAQ,YAAY,GAAG;AAAA,MAC7B;AAAA,MACA,cAAc;AAAA,MACd,YAAY,cAAc;AAAA,QACxB,SAAS;AAAA,QACT,MAAM,EAAE,UAAU;AAAA;AAAA;AAGtB,OAAG;AACH,QAAI,mBAAmB,SAAS,YAAY,SAAS,QAAQ;AAC3D,uBAAiB;AAAA,QACf,MAAM;AAAA,QACN,OAAO;AAAA,QACP,YAAY;AAAA,QACZ;AAAA,QACA;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/esm/plugins/index.js
CHANGED
|
@@ -1,19 +1,39 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export {
|
|
19
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { BodyHeaderScrollSyncPlugin } from "./body-header-scroll-sync";
|
|
3
|
+
import { DndColumnsPlugin } from "./column-dnd";
|
|
4
|
+
import { ColumnSizingPlugin } from "./column-sizing";
|
|
5
|
+
import { CustomRendererPlugin } from "./custom-cell-renderer";
|
|
6
|
+
import { EditablePlugin, ComboBox, TextBox } from "./editable";
|
|
7
|
+
import { ExpandableColumn, ExpandablePlugin } from "./expandable-grid";
|
|
8
|
+
import { FilterablePlugin } from "./filterable";
|
|
9
|
+
import { InfiniteScrollPlugin } from "./infinite-scrolling";
|
|
10
|
+
import { PaginationPlugin } from "./pagination";
|
|
11
|
+
import { ResizablePlugin } from "./resizable";
|
|
12
|
+
import { DndRowsPlugin } from "./row-dnd";
|
|
13
|
+
import { SelectablePlugin } from "./selectable";
|
|
14
|
+
import { SortablePlugin } from "./sortable";
|
|
15
|
+
import { ToolbarPlugin } from "./toolbar";
|
|
16
|
+
import { ExportDataPlugin } from "./export-data";
|
|
17
|
+
import { VirtualizationPlugin } from "./virtualization";
|
|
18
|
+
export {
|
|
19
|
+
BodyHeaderScrollSyncPlugin,
|
|
20
|
+
ColumnSizingPlugin,
|
|
21
|
+
ComboBox,
|
|
22
|
+
CustomRendererPlugin,
|
|
23
|
+
DndColumnsPlugin,
|
|
24
|
+
DndRowsPlugin,
|
|
25
|
+
EditablePlugin,
|
|
26
|
+
ExpandableColumn,
|
|
27
|
+
ExpandablePlugin,
|
|
28
|
+
ExportDataPlugin,
|
|
29
|
+
FilterablePlugin,
|
|
30
|
+
InfiniteScrollPlugin,
|
|
31
|
+
PaginationPlugin,
|
|
32
|
+
ResizablePlugin,
|
|
33
|
+
SelectablePlugin,
|
|
34
|
+
SortablePlugin,
|
|
35
|
+
TextBox,
|
|
36
|
+
ToolbarPlugin,
|
|
37
|
+
VirtualizationPlugin
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../scripts/build/transpile/react-shim.js", "../../../src/plugins/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { BodyHeaderScrollSyncPlugin } from './body-header-scroll-sync';\nexport { DndColumnsPlugin } from './column-dnd';\nexport { ColumnSizingPlugin } from './column-sizing';\nexport { CustomRendererPlugin } from './custom-cell-renderer';\nexport { EditablePlugin, ComboBox, TextBox } from './editable';\nexport { ExpandableColumn, ExpandablePlugin } from './expandable-grid';\nexport { FilterablePlugin } from './filterable';\nexport { InfiniteScrollPlugin } from './infinite-scrolling';\nexport { PaginationPlugin } from './pagination';\nexport { ResizablePlugin } from './resizable';\nexport { DndRowsPlugin } from './row-dnd';\nexport { SelectablePlugin } from './selectable';\nexport { SortablePlugin } from './sortable';\nexport { ToolbarPlugin } from './toolbar';\nexport { ExportDataPlugin } from './export-data';\nexport { VirtualizationPlugin } from './virtualization';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,114 +1,71 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
6
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
7
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
8
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
9
|
-
import { useRef, useState, useEffect } from 'react';
|
|
10
|
-
import createInstancePlugin from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';
|
|
11
|
-
|
|
12
|
-
const _excluded = ["children"];
|
|
13
|
-
|
|
14
|
-
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; }
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
|
|
18
|
-
const registerStateHook = grid => {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useRef, useEffect, useState } from "react";
|
|
3
|
+
import { createInstancePlugin } from "@elliemae/ds-shared/createDataInstance/createInstancePlugin";
|
|
4
|
+
const registerStateHook = (grid) => {
|
|
19
5
|
const {
|
|
20
|
-
props: {
|
|
21
|
-
|
|
22
|
-
onInfiniteScrolling = () => null
|
|
23
|
-
},
|
|
24
|
-
actions: {
|
|
25
|
-
updateRows
|
|
26
|
-
}
|
|
6
|
+
props: { getData, onInfiniteScrolling = () => null },
|
|
7
|
+
actions: { updateRows }
|
|
27
8
|
} = grid;
|
|
28
9
|
const loading = useRef(false);
|
|
29
|
-
|
|
30
|
-
const addMoreData = function () {
|
|
31
|
-
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
10
|
+
const addMoreData = (data = []) => {
|
|
32
11
|
loading.current = false;
|
|
33
|
-
updateRows(prevRows => prevRows.concat(data || []));
|
|
12
|
+
updateRows((prevRows) => prevRows.concat(data || []));
|
|
34
13
|
};
|
|
35
|
-
|
|
36
|
-
const doLoadData = async currentRows => {
|
|
14
|
+
const doLoadData = async (currentRows) => {
|
|
37
15
|
loading.current = true;
|
|
38
16
|
return Promise.resolve(getData(currentRows)).then(addMoreData);
|
|
39
17
|
};
|
|
40
|
-
|
|
41
|
-
const loadMoreData = currentRows => {
|
|
18
|
+
const loadMoreData = (currentRows) => {
|
|
42
19
|
onInfiniteScrolling(currentRows);
|
|
43
|
-
if (loading.current || !getData)
|
|
20
|
+
if (loading.current || !getData)
|
|
21
|
+
return;
|
|
44
22
|
doLoadData(currentRows);
|
|
45
23
|
};
|
|
46
|
-
|
|
47
24
|
return {
|
|
48
25
|
actions: {
|
|
49
26
|
loadMoreData
|
|
50
27
|
}
|
|
51
28
|
};
|
|
52
29
|
};
|
|
53
|
-
|
|
54
|
-
const
|
|
55
|
-
let props = _objectWithoutProperties(_ref, _excluded);
|
|
56
|
-
|
|
57
|
-
const {
|
|
58
|
-
loadMoreData
|
|
59
|
-
} = grid.getInstance().actions;
|
|
30
|
+
const getBodyProps = ({ children, ...props }, grid) => {
|
|
31
|
+
const { loadMoreData } = grid.getInstance().actions;
|
|
60
32
|
const [bodyNode, setBodyRef] = useState();
|
|
61
33
|
const prevScroll = useRef();
|
|
62
34
|
prevScroll.current = 0;
|
|
63
|
-
|
|
64
35
|
const handleBodyScroll = (event, s) => {
|
|
65
|
-
const {
|
|
66
|
-
|
|
67
|
-
} =
|
|
68
|
-
const {
|
|
69
|
-
scrollHeight,
|
|
70
|
-
scrollTop,
|
|
71
|
-
offsetHeight,
|
|
72
|
-
scrollLeft
|
|
73
|
-
} = target;
|
|
74
|
-
const {
|
|
75
|
-
composedRows
|
|
76
|
-
} = grid.getInstance(); // prevent horizontal scroll triggering infinite scrolling callbacks
|
|
77
|
-
|
|
36
|
+
const { target } = event;
|
|
37
|
+
const { scrollHeight, scrollTop, offsetHeight, scrollLeft } = target;
|
|
38
|
+
const { composedRows } = grid.getInstance();
|
|
78
39
|
if (prevScroll.current !== scrollLeft) {
|
|
79
40
|
prevScroll.current = scrollLeft;
|
|
80
41
|
return;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
if (bodyNode !== target) return;
|
|
85
|
-
|
|
42
|
+
}
|
|
43
|
+
if (bodyNode !== target)
|
|
44
|
+
return;
|
|
86
45
|
if (scrollTop + offsetHeight >= scrollHeight - 1) {
|
|
87
46
|
loadMoreData(composedRows);
|
|
88
47
|
}
|
|
89
48
|
};
|
|
90
|
-
|
|
91
49
|
useEffect(() => {
|
|
92
50
|
if (bodyNode) {
|
|
93
|
-
bodyNode.addEventListener(
|
|
51
|
+
bodyNode.addEventListener("scroll", handleBodyScroll);
|
|
94
52
|
}
|
|
95
|
-
|
|
96
53
|
return () => {
|
|
97
54
|
if (bodyNode) {
|
|
98
|
-
bodyNode.removeEventListener(
|
|
55
|
+
bodyNode.removeEventListener("scroll", handleBodyScroll);
|
|
99
56
|
}
|
|
100
57
|
};
|
|
101
58
|
}, [bodyNode]);
|
|
102
|
-
return
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
});
|
|
59
|
+
return {
|
|
60
|
+
...props,
|
|
61
|
+
listProps: { outerRef: setBodyRef }
|
|
62
|
+
};
|
|
107
63
|
};
|
|
108
|
-
|
|
109
|
-
const InfiniteScrollPlugin = createInstancePlugin('infinite-scroll', {
|
|
64
|
+
const InfiniteScrollPlugin = createInstancePlugin("infinite-scroll", {
|
|
110
65
|
registerStateHook,
|
|
111
66
|
getBodyProps
|
|
112
67
|
});
|
|
113
|
-
|
|
114
|
-
|
|
68
|
+
export {
|
|
69
|
+
InfiniteScrollPlugin
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=InfiniteScrollPlugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/infinite-scrolling/InfiniteScrollPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useRef, useEffect, useState } from 'react';\nimport { createInstancePlugin } from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';\n\n// TODO: EXPORT A SEPARATED INFINITE LOADER GRID\n\nconst registerStateHook = (grid) => {\n const {\n props: { getData, onInfiniteScrolling = () => null },\n actions: { updateRows },\n } = grid;\n\n const loading = useRef(false);\n\n const addMoreData = (data = []) => {\n loading.current = false;\n updateRows((prevRows) => prevRows.concat(data || []));\n };\n\n const doLoadData = async (currentRows) => {\n loading.current = true;\n return Promise.resolve(getData(currentRows)).then(addMoreData);\n };\n\n const loadMoreData = (currentRows) => {\n onInfiniteScrolling(currentRows);\n if (loading.current || !getData) return;\n doLoadData(currentRows);\n };\n\n return {\n actions: {\n loadMoreData,\n },\n };\n};\n\nconst getBodyProps = ({ children, ...props }, grid) => {\n const { loadMoreData } = grid.getInstance().actions;\n\n const [bodyNode, setBodyRef] = useState();\n const prevScroll = useRef();\n prevScroll.current = 0;\n\n const handleBodyScroll = (event, s) => {\n const { target } = event;\n const { scrollHeight, scrollTop, offsetHeight, scrollLeft } = target;\n const { composedRows } = grid.getInstance();\n // prevent horizontal scroll triggering infinite scrolling callbacks\n if (prevScroll.current !== scrollLeft) {\n prevScroll.current = scrollLeft;\n return;\n }\n // todo: clean this. Better approach using another component for the infinite scroll\n if (bodyNode !== target) return;\n if (scrollTop + offsetHeight >= scrollHeight - 1) {\n loadMoreData(composedRows);\n }\n };\n\n useEffect(() => {\n if (bodyNode) {\n bodyNode.addEventListener('scroll', handleBodyScroll);\n }\n return () => {\n if (bodyNode) {\n bodyNode.removeEventListener('scroll', handleBodyScroll);\n }\n };\n }, [bodyNode]);\n\n return {\n ...props,\n listProps: { outerRef: setBodyRef },\n };\n};\n\nexport const InfiniteScrollPlugin = createInstancePlugin('infinite-scroll', {\n registerStateHook,\n getBodyProps,\n});\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAIA,MAAM,oBAAoB,CAAC,SAAS;AAClC,QAAM;AAAA,IACJ,OAAO,EAAE,SAAS,sBAAsB,MAAM;AAAA,IAC9C,SAAS,EAAE;AAAA,MACT;AAEJ,QAAM,UAAU,OAAO;AAEvB,QAAM,cAAc,CAAC,OAAO,OAAO;AACjC,YAAQ,UAAU;AAClB,eAAW,CAAC,aAAa,SAAS,OAAO,QAAQ;AAAA;AAGnD,QAAM,aAAa,OAAO,gBAAgB;AACxC,YAAQ,UAAU;AAClB,WAAO,QAAQ,QAAQ,QAAQ,cAAc,KAAK;AAAA;AAGpD,QAAM,eAAe,CAAC,gBAAgB;AACpC,wBAAoB;AACpB,QAAI,QAAQ,WAAW,CAAC;AAAS;AACjC,eAAW;AAAA;AAGb,SAAO;AAAA,IACL,SAAS;AAAA,MACP;AAAA;AAAA;AAAA;AAKN,MAAM,eAAe,CAAC,EAAE,aAAa,SAAS,SAAS;AACrD,QAAM,EAAE,iBAAiB,KAAK,cAAc;AAE5C,QAAM,CAAC,UAAU,cAAc;AAC/B,QAAM,aAAa;AACnB,aAAW,UAAU;AAErB,QAAM,mBAAmB,CAAC,OAAO,MAAM;AACrC,UAAM,EAAE,WAAW;AACnB,UAAM,EAAE,cAAc,WAAW,cAAc,eAAe;AAC9D,UAAM,EAAE,iBAAiB,KAAK;AAE9B,QAAI,WAAW,YAAY,YAAY;AACrC,iBAAW,UAAU;AACrB;AAAA;AAGF,QAAI,aAAa;AAAQ;AACzB,QAAI,YAAY,gBAAgB,eAAe,GAAG;AAChD,mBAAa;AAAA;AAAA;AAIjB,YAAU,MAAM;AACd,QAAI,UAAU;AACZ,eAAS,iBAAiB,UAAU;AAAA;AAEtC,WAAO,MAAM;AACX,UAAI,UAAU;AACZ,iBAAS,oBAAoB,UAAU;AAAA;AAAA;AAAA,KAG1C,CAAC;AAEJ,SAAO;AAAA,OACF;AAAA,IACH,WAAW,EAAE,UAAU;AAAA;AAAA;AAIpB,MAAM,uBAAuB,qBAAqB,mBAAmB;AAAA,EAC1E;AAAA,EACA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/infinite-scrolling/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { InfiniteScrollPlugin } from './InfiniteScrollPlugin';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|