@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,231 +1,152 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
|
|
14
|
-
import { useMemo, useRef, useEffect } from 'react';
|
|
15
|
-
import { cx, isFunction } from '@elliemae/ds-utilities';
|
|
16
|
-
import { VariableSizeList } from 'react-window';
|
|
17
|
-
import { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';
|
|
18
|
-
import DSButton from '@elliemae/ds-button';
|
|
19
|
-
import createInstancePlugin from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';
|
|
20
|
-
import { appendCellFormatter } from '@elliemae/ds-shared/useDataGrid/initColumnDefinition';
|
|
21
|
-
import ExpandedRow from './ExpandedRow.js';
|
|
22
|
-
import ExpandedRowExtra from './ExpandedRowExtra.js';
|
|
23
|
-
import { RowSizes } from '../../rowSizes.js';
|
|
24
|
-
import { useExpandGridState } from './useExpandGridState.js';
|
|
25
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
26
|
-
|
|
27
|
-
const _excluded = ["isExpanded"];
|
|
28
|
-
|
|
29
|
-
var _ArrowheadDown, _ArrowheadRight;
|
|
30
|
-
|
|
31
|
-
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; }
|
|
32
|
-
|
|
33
|
-
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; }
|
|
34
|
-
|
|
35
|
-
const getExpandedRowSizeBySubrows = _ref => {
|
|
36
|
-
let {
|
|
37
|
-
totalAmount,
|
|
38
|
-
amountVisible,
|
|
39
|
-
isShowingAll,
|
|
40
|
-
size = 36
|
|
41
|
-
} = _ref;
|
|
42
|
-
return isShowingAll ? size * (totalAmount + 1) - 6 : size * (amountVisible + 1) + 32;
|
|
43
|
-
};
|
|
44
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useEffect, useMemo, useRef } from "react";
|
|
3
|
+
import { cx, isFunction } from "@elliemae/ds-utilities";
|
|
4
|
+
import { VariableSizeList } from "react-window";
|
|
5
|
+
import { ArrowheadDown, ArrowheadRight } from "@elliemae/ds-icons";
|
|
6
|
+
import { DSButton } from "@elliemae/ds-button";
|
|
7
|
+
import { createInstancePlugin } from "@elliemae/ds-shared/createDataInstance/createInstancePlugin";
|
|
8
|
+
import { appendCellFormatter } from "@elliemae/ds-shared/useDataGrid/initColumnDefinition";
|
|
9
|
+
import { ExpandedRow } from "./ExpandedRow";
|
|
10
|
+
import { ExpandedRowExtra } from "./ExpandedRowExtra";
|
|
11
|
+
import { RowSizes } from "../../rowSizes";
|
|
12
|
+
import { useExpandGridState } from "./useExpandGridState";
|
|
13
|
+
const getExpandedRowSizeBySubrows = ({ totalAmount, amountVisible, isShowingAll, size = 36 }) => isShowingAll ? size * (totalAmount + 1) - 6 : size * (amountVisible + 1) + 32;
|
|
45
14
|
const ExpandedRows = {
|
|
46
15
|
SingleColumn: ExpandedRow,
|
|
47
16
|
Master: ExpandedRowExtra
|
|
48
17
|
};
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
const isExpandableSingleColumn = columns => columns.some(column => column.expandableColumn);
|
|
53
|
-
|
|
54
|
-
const ExpandablePlugin = createInstancePlugin('expandable', {
|
|
18
|
+
const createExpandedRow = (type) => ExpandedRows[type] || ExpandedRows.Master;
|
|
19
|
+
const isExpandableSingleColumn = (columns) => columns.some((column) => column.expandableColumn);
|
|
20
|
+
const ExpandablePlugin = createInstancePlugin("expandable", {
|
|
55
21
|
registerStateHook: useExpandGridState,
|
|
56
|
-
|
|
57
22
|
decorateGrid(grid) {
|
|
58
|
-
const {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
} = grid.getInstance();
|
|
62
|
-
const detailColumns = useMemo(() => decoratedColumns.map(column => _objectSpread(_objectSpread({}, column), {}, {
|
|
23
|
+
const { decoratedColumns, columns } = grid.getInstance();
|
|
24
|
+
const detailColumns = useMemo(() => decoratedColumns.map((column) => ({
|
|
25
|
+
...column,
|
|
63
26
|
customRenderer: column.detailCustomRenderer
|
|
64
|
-
})).filter(col => !col.expandableColumn), [columns]);
|
|
27
|
+
})).filter((col) => !col.expandableColumn), [columns]);
|
|
65
28
|
return {
|
|
66
29
|
detailColumns
|
|
67
30
|
};
|
|
68
31
|
},
|
|
69
|
-
|
|
70
32
|
decorateColumns(columns, grid) {
|
|
71
|
-
if (isExpandableSingleColumn(columns))
|
|
72
|
-
|
|
73
|
-
const firstColumnIndex = columns.findIndex(column => column.isUserColumn);
|
|
33
|
+
if (isExpandableSingleColumn(columns))
|
|
34
|
+
return columns;
|
|
35
|
+
const firstColumnIndex = columns.findIndex((column) => column.isUserColumn);
|
|
74
36
|
const firstColumn = columns[firstColumnIndex];
|
|
75
37
|
firstColumn.formatExpandable = true;
|
|
76
|
-
return [
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
toggleExpand
|
|
84
|
-
}
|
|
85
|
-
} = grid.getInstance();
|
|
86
|
-
/*
|
|
87
|
-
* should return only 2 elements ../custom-cell-renderer/addCustomRendererToCell.js
|
|
88
|
-
* getRenderer it's checking that length to apply the custom render to value only
|
|
89
|
-
*/
|
|
90
|
-
|
|
91
|
-
return /*#__PURE__*/jsxs(Fragment, {
|
|
92
|
-
children: [/*#__PURE__*/_jsx(DSButton, {
|
|
38
|
+
return [
|
|
39
|
+
...columns.slice(0, firstColumnIndex),
|
|
40
|
+
appendCellFormatter((value, { isExpanded, rowData }) => {
|
|
41
|
+
const {
|
|
42
|
+
actions: { toggleExpand }
|
|
43
|
+
} = grid.getInstance();
|
|
44
|
+
return /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(DSButton, {
|
|
93
45
|
buttonType: "text",
|
|
94
46
|
className: "expandable-arrow",
|
|
95
|
-
icon: isExpanded ?
|
|
96
|
-
onClick: e => {
|
|
47
|
+
icon: isExpanded ? /* @__PURE__ */ React2.createElement(ArrowheadDown, null) : /* @__PURE__ */ React2.createElement(ArrowheadRight, null),
|
|
48
|
+
onClick: (e) => {
|
|
97
49
|
e.stopPropagation();
|
|
98
50
|
toggleExpand(rowData);
|
|
99
51
|
},
|
|
100
52
|
size: "s"
|
|
101
|
-
}), value
|
|
102
|
-
})
|
|
103
|
-
|
|
53
|
+
}), value);
|
|
54
|
+
}, firstColumn),
|
|
55
|
+
...columns.slice(firstColumnIndex + 1)
|
|
56
|
+
];
|
|
104
57
|
},
|
|
105
|
-
|
|
106
58
|
getBodyProps(bodyProps, grid) {
|
|
107
59
|
const {
|
|
108
60
|
composedRows: rows,
|
|
109
61
|
props: {
|
|
110
62
|
rowKey,
|
|
111
63
|
getChildrenRows,
|
|
112
|
-
rowSize =
|
|
113
|
-
subrowSize =
|
|
64
|
+
rowSize = "normal",
|
|
65
|
+
subrowSize = "normal",
|
|
114
66
|
getExpandedRowMinSize,
|
|
115
67
|
getExpandedRowSize,
|
|
116
68
|
expandableSubrowsVisible
|
|
117
69
|
},
|
|
118
|
-
state: {
|
|
119
|
-
expandedRows
|
|
120
|
-
}
|
|
70
|
+
state: { expandedRows }
|
|
121
71
|
} = grid.getInstance();
|
|
122
72
|
const rowSizePx = RowSizes[rowSize];
|
|
123
73
|
const subrowSizePx = RowSizes[subrowSize];
|
|
124
74
|
const listRef = useRef();
|
|
125
75
|
useEffect(() => {
|
|
126
|
-
if (listRef.current)
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
const getItemSize = index => {
|
|
76
|
+
if (listRef.current)
|
|
77
|
+
listRef.current.resetAfterIndex(0, true);
|
|
78
|
+
});
|
|
79
|
+
const getItemSize = (index) => {
|
|
130
80
|
const rowData = rows[index];
|
|
131
81
|
const key = rowData[rowKey];
|
|
132
|
-
const children = getChildrenRows({
|
|
133
|
-
|
|
134
|
-
});
|
|
135
|
-
const expandedSize = getExpandedRowSize ? getExpandedRowSize(index, {
|
|
136
|
-
rowData
|
|
137
|
-
}) // https://jira.elliemae.io/browse/PUI-1659
|
|
138
|
-
: getExpandedRowSizeBySubrows({
|
|
82
|
+
const children = getChildrenRows({ rowData });
|
|
83
|
+
const expandedSize = getExpandedRowSize ? getExpandedRowSize(index, { rowData }) : getExpandedRowSizeBySubrows({
|
|
139
84
|
totalAmount: children.length,
|
|
140
85
|
amountVisible: children.length > expandableSubrowsVisible ? expandableSubrowsVisible : children.length,
|
|
141
86
|
isShowingAll: children.length < expandableSubrowsVisible || expandedRows[key] && expandedRows[key].showAllRows,
|
|
142
87
|
size: subrowSizePx
|
|
143
88
|
});
|
|
144
|
-
const expandedMinSize = isFunction(getExpandedRowMinSize) && getExpandedRowMinSize(index);
|
|
145
|
-
|
|
89
|
+
const expandedMinSize = isFunction(getExpandedRowMinSize) && getExpandedRowMinSize(index);
|
|
146
90
|
return expandedRows[key] ? expandedMinSize > expandedSize ? expandedMinSize : expandedSize : rowSizePx;
|
|
147
91
|
};
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
className: cx(bodyProps.className,
|
|
92
|
+
return {
|
|
93
|
+
...bodyProps,
|
|
94
|
+
className: cx(bodyProps.className, "expandable"),
|
|
151
95
|
listComponent: VariableSizeList,
|
|
152
|
-
listProps: {
|
|
153
|
-
|
|
154
|
-
itemSize: getItemSize
|
|
155
|
-
}
|
|
156
|
-
});
|
|
96
|
+
listProps: { ref: listRef, itemSize: getItemSize }
|
|
97
|
+
};
|
|
157
98
|
},
|
|
158
|
-
|
|
159
99
|
decorateRenderers(renderers, grid) {
|
|
160
100
|
const Row = renderers.body.row;
|
|
161
|
-
const Cell = renderers.body.cell;
|
|
162
|
-
|
|
101
|
+
const Cell = renderers.body.cell;
|
|
163
102
|
renderers.body.row = useMemo(() => {
|
|
164
|
-
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return _ref3 => {
|
|
169
|
-
let {
|
|
170
|
-
isExpanded
|
|
171
|
-
} = _ref3,
|
|
172
|
-
rowProps = _objectWithoutProperties(_ref3, _excluded);
|
|
173
|
-
|
|
103
|
+
const expandedRowType = isExpandableSingleColumn(grid.decoratedColumns) ? "SingleColumn" : "Master";
|
|
104
|
+
const ExpandedRowComponent = createExpandedRow(expandedRowType);
|
|
105
|
+
return ({ isExpanded, ...rowProps }) => {
|
|
174
106
|
if (isExpanded) {
|
|
175
107
|
const {
|
|
176
|
-
props: {
|
|
177
|
-
detailColumns,
|
|
178
|
-
getChildrenRows,
|
|
179
|
-
renderRowDetails
|
|
180
|
-
},
|
|
108
|
+
props: { detailColumns, getChildrenRows, renderRowDetails },
|
|
181
109
|
composedRows
|
|
182
|
-
} = grid.getInstance();
|
|
183
|
-
|
|
110
|
+
} = grid.getInstance();
|
|
184
111
|
const rowData = composedRows[rowProps.index] ? composedRows[rowProps.index] : rowProps.rowData;
|
|
185
|
-
return
|
|
112
|
+
return /* @__PURE__ */ React2.createElement(ExpandedRowComponent, {
|
|
186
113
|
cellComponent: Cell,
|
|
187
|
-
detailColumns
|
|
114
|
+
detailColumns,
|
|
188
115
|
parentGrid: grid,
|
|
189
|
-
renderRowDetails
|
|
116
|
+
renderRowDetails,
|
|
190
117
|
rowComponent: Row,
|
|
191
|
-
rowData
|
|
192
|
-
rowProps:
|
|
118
|
+
rowData,
|
|
119
|
+
rowProps: {
|
|
193
120
|
rowData,
|
|
194
|
-
isExpanded
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}, void 0, rowProps.children);
|
|
121
|
+
isExpanded,
|
|
122
|
+
...rowProps
|
|
123
|
+
},
|
|
124
|
+
rows: getChildrenRows({ rowData })
|
|
125
|
+
}, rowProps.children);
|
|
200
126
|
}
|
|
201
|
-
|
|
202
|
-
|
|
127
|
+
return /* @__PURE__ */ React2.createElement(Row, {
|
|
128
|
+
...rowProps
|
|
129
|
+
});
|
|
203
130
|
};
|
|
204
131
|
}, []);
|
|
205
132
|
return renderers;
|
|
206
133
|
},
|
|
207
|
-
|
|
208
|
-
getRowProps(rowProps, grid, _ref4) {
|
|
209
|
-
let {
|
|
210
|
-
rowData
|
|
211
|
-
} = _ref4;
|
|
134
|
+
getRowProps(rowProps, grid, { rowData }) {
|
|
212
135
|
const {
|
|
213
|
-
props: {
|
|
214
|
-
|
|
215
|
-
},
|
|
216
|
-
state: {
|
|
217
|
-
expandedRows
|
|
218
|
-
}
|
|
136
|
+
props: { rowKey },
|
|
137
|
+
state: { expandedRows }
|
|
219
138
|
} = grid.getInstance();
|
|
220
139
|
const key = rowData[rowKey];
|
|
221
140
|
const isExpanded = !!expandedRows[key];
|
|
222
|
-
return
|
|
223
|
-
|
|
141
|
+
return {
|
|
142
|
+
...rowProps,
|
|
143
|
+
className: cx(rowProps.className, Object.keys(expandedRows).length > 0 && "expandable-row", isExpanded && "expanded"),
|
|
224
144
|
isExpanded,
|
|
225
145
|
showAllRows: expandedRows[key] && expandedRows[key].showAllRows
|
|
226
|
-
}
|
|
146
|
+
};
|
|
227
147
|
}
|
|
228
|
-
|
|
229
148
|
});
|
|
230
|
-
|
|
231
|
-
|
|
149
|
+
export {
|
|
150
|
+
ExpandablePlugin
|
|
151
|
+
};
|
|
152
|
+
//# sourceMappingURL=ExpandablePlugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/ExpandablePlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useEffect, useMemo, useRef } from 'react';\nimport { cx, isFunction } from '@elliemae/ds-utilities';\nimport { VariableSizeList } from 'react-window';\nimport { ArrowheadDown, ArrowheadRight } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { createInstancePlugin } from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';\nimport { appendCellFormatter } from '@elliemae/ds-shared/useDataGrid/initColumnDefinition';\nimport { ExpandedRow } from './ExpandedRow';\nimport { ExpandedRowExtra } from './ExpandedRowExtra';\nimport { RowSizes } from '../../rowSizes';\nimport { useExpandGridState } from './useExpandGridState';\n\nconst getExpandedRowSizeBySubrows = ({ totalAmount, amountVisible, isShowingAll, size = 36 }) =>\n isShowingAll ? size * (totalAmount + 1) - 6 : size * (amountVisible + 1) + 32;\n\nconst ExpandedRows = {\n SingleColumn: ExpandedRow,\n Master: ExpandedRowExtra,\n};\n\nconst createExpandedRow = (type) => ExpandedRows[type] || ExpandedRows.Master;\n\nconst isExpandableSingleColumn = (columns) => columns.some((column) => column.expandableColumn);\n\nexport const ExpandablePlugin = createInstancePlugin('expandable', {\n registerStateHook: useExpandGridState,\n decorateGrid(grid) {\n const { decoratedColumns, columns } = grid.getInstance();\n const detailColumns = useMemo(\n () =>\n decoratedColumns\n .map((column) => ({\n ...column,\n customRenderer: column.detailCustomRenderer,\n }))\n .filter((col) => !col.expandableColumn),\n [columns],\n );\n return {\n detailColumns,\n };\n },\n\n decorateColumns(columns, grid) {\n if (isExpandableSingleColumn(columns)) return columns;\n // get first column from user\n const firstColumnIndex = columns.findIndex((column) => column.isUserColumn);\n const firstColumn = columns[firstColumnIndex];\n firstColumn.formatExpandable = true;\n\n return [\n ...columns.slice(0, firstColumnIndex),\n appendCellFormatter((value, { isExpanded, rowData }) => {\n const {\n actions: { toggleExpand },\n } = grid.getInstance();\n /*\n * should return only 2 elements ../custom-cell-renderer/addCustomRendererToCell.js\n * getRenderer it's checking that length to apply the custom render to value only\n */\n return (\n <>\n <DSButton\n buttonType=\"text\"\n className=\"expandable-arrow\"\n icon={isExpanded ? <ArrowheadDown /> : <ArrowheadRight />}\n onClick={(e) => {\n e.stopPropagation();\n toggleExpand(rowData);\n }}\n size=\"s\"\n />\n {value}\n </>\n );\n }, firstColumn),\n ...columns.slice(firstColumnIndex + 1),\n ];\n },\n\n getBodyProps(bodyProps, grid) {\n const {\n composedRows: rows,\n props: {\n rowKey,\n getChildrenRows,\n rowSize = 'normal',\n subrowSize = 'normal',\n getExpandedRowMinSize,\n getExpandedRowSize,\n expandableSubrowsVisible,\n },\n state: { expandedRows },\n } = grid.getInstance();\n const rowSizePx = RowSizes[rowSize];\n const subrowSizePx = RowSizes[subrowSize];\n const listRef = useRef();\n\n useEffect(() => {\n if (listRef.current) listRef.current.resetAfterIndex(0, true);\n });\n\n // implementation of expandable row single column with aggregation\n const getItemSize = (index) => {\n const rowData = rows[index];\n const key = rowData[rowKey];\n const children = getChildrenRows({ rowData });\n\n const expandedSize = getExpandedRowSize\n ? getExpandedRowSize(index, { rowData }) // https://jira.elliemae.io/browse/PUI-1659\n : getExpandedRowSizeBySubrows({\n totalAmount: children.length,\n amountVisible: children.length > expandableSubrowsVisible ? expandableSubrowsVisible : children.length,\n isShowingAll:\n children.length < expandableSubrowsVisible || (expandedRows[key] && expandedRows[key].showAllRows),\n size: subrowSizePx,\n });\n\n const expandedMinSize = isFunction(getExpandedRowMinSize) && getExpandedRowMinSize(index);\n\n // eslint-disable-next-line no-nested-ternary\n return expandedRows[key] ? (expandedMinSize > expandedSize ? expandedMinSize : expandedSize) : rowSizePx;\n };\n\n return {\n ...bodyProps,\n className: cx(bodyProps.className, 'expandable'),\n listComponent: VariableSizeList,\n listProps: { ref: listRef, itemSize: getItemSize },\n };\n },\n\n decorateRenderers(renderers, grid) {\n const Row = renderers.body.row;\n const Cell = renderers.body.cell;\n\n // eslint-disable-next-line react/display-name\n renderers.body.row = useMemo(() => {\n // todo: the expandable grid should be created from another specific grid component\n const expandedRowType = isExpandableSingleColumn(grid.decoratedColumns) ? 'SingleColumn' : 'Master';\n const ExpandedRowComponent = createExpandedRow(expandedRowType);\n // eslint-disable-next-line react/display-name\n return ({ isExpanded, ...rowProps }) => {\n if (isExpanded) {\n const {\n props: { detailColumns, getChildrenRows, renderRowDetails },\n composedRows,\n } = grid.getInstance();\n // https://jira.elliemae.io/browse/PUI-1667\n const rowData = composedRows[rowProps.index] ? composedRows[rowProps.index] : rowProps.rowData;\n return (\n <ExpandedRowComponent\n cellComponent={Cell}\n detailColumns={detailColumns}\n parentGrid={grid}\n renderRowDetails={renderRowDetails}\n rowComponent={Row}\n rowData={rowData}\n rowProps={{\n rowData,\n isExpanded,\n ...rowProps,\n }}\n rows={getChildrenRows({ rowData })}\n >\n {rowProps.children}\n </ExpandedRowComponent>\n );\n }\n return <Row {...rowProps} />;\n };\n }, []);\n\n return renderers;\n },\n\n getRowProps(rowProps, grid, { rowData }) {\n const {\n props: { rowKey },\n state: { expandedRows },\n } = grid.getInstance();\n const key = rowData[rowKey];\n const isExpanded = !!expandedRows[key];\n return {\n ...rowProps,\n className: cx(\n rowProps.className,\n Object.keys(expandedRows).length > 0 && 'expandable-row',\n isExpanded && 'expanded',\n ),\n isExpanded,\n showAllRows: expandedRows[key] && expandedRows[key].showAllRows,\n };\n },\n});\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,8BAA8B,CAAC,EAAE,aAAa,eAAe,cAAc,OAAO,SACtF,eAAe,OAAQ,eAAc,KAAK,IAAI,OAAQ,iBAAgB,KAAK;AAE7E,MAAM,eAAe;AAAA,EACnB,cAAc;AAAA,EACd,QAAQ;AAAA;AAGV,MAAM,oBAAoB,CAAC,SAAS,aAAa,SAAS,aAAa;AAEvE,MAAM,2BAA2B,CAAC,YAAY,QAAQ,KAAK,CAAC,WAAW,OAAO;AAEvE,MAAM,mBAAmB,qBAAqB,cAAc;AAAA,EACjE,mBAAmB;AAAA,EACnB,aAAa,MAAM;AACjB,UAAM,EAAE,kBAAkB,YAAY,KAAK;AAC3C,UAAM,gBAAgB,QACpB,MACE,iBACG,IAAI,CAAC,WAAY;AAAA,SACb;AAAA,MACH,gBAAgB,OAAO;AAAA,QAExB,OAAO,CAAC,QAAQ,CAAC,IAAI,mBAC1B,CAAC;AAEH,WAAO;AAAA,MACL;AAAA;AAAA;AAAA,EAIJ,gBAAgB,SAAS,MAAM;AAC7B,QAAI,yBAAyB;AAAU,aAAO;AAE9C,UAAM,mBAAmB,QAAQ,UAAU,CAAC,WAAW,OAAO;AAC9D,UAAM,cAAc,QAAQ;AAC5B,gBAAY,mBAAmB;AAE/B,WAAO;AAAA,MACL,GAAG,QAAQ,MAAM,GAAG;AAAA,MACpB,oBAAoB,CAAC,OAAO,EAAE,YAAY,cAAc;AACtD,cAAM;AAAA,UACJ,SAAS,EAAE;AAAA,YACT,KAAK;AAKT,eACE,4DACE,qCAAC,UAAD;AAAA,UACE,YAAW;AAAA,UACX,WAAU;AAAA,UACV,MAAM,aAAa,qCAAC,eAAD,QAAoB,qCAAC,gBAAD;AAAA,UACvC,SAAS,CAAC,MAAM;AACd,cAAE;AACF,yBAAa;AAAA;AAAA,UAEf,MAAK;AAAA,YAEN;AAAA,SAGJ;AAAA,MACH,GAAG,QAAQ,MAAM,mBAAmB;AAAA;AAAA;AAAA,EAIxC,aAAa,WAAW,MAAM;AAC5B,UAAM;AAAA,MACJ,cAAc;AAAA,MACd,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA,UAAU;AAAA,QACV,aAAa;AAAA,QACb;AAAA,QACA;AAAA,QACA;AAAA;AAAA,MAEF,OAAO,EAAE;AAAA,QACP,KAAK;AACT,UAAM,YAAY,SAAS;AAC3B,UAAM,eAAe,SAAS;AAC9B,UAAM,UAAU;AAEhB,cAAU,MAAM;AACd,UAAI,QAAQ;AAAS,gBAAQ,QAAQ,gBAAgB,GAAG;AAAA;AAI1D,UAAM,cAAc,CAAC,UAAU;AAC7B,YAAM,UAAU,KAAK;AACrB,YAAM,MAAM,QAAQ;AACpB,YAAM,WAAW,gBAAgB,EAAE;AAEnC,YAAM,eAAe,qBACjB,mBAAmB,OAAO,EAAE,aAC5B,4BAA4B;AAAA,QAC1B,aAAa,SAAS;AAAA,QACtB,eAAe,SAAS,SAAS,2BAA2B,2BAA2B,SAAS;AAAA,QAChG,cACE,SAAS,SAAS,4BAA6B,aAAa,QAAQ,aAAa,KAAK;AAAA,QACxF,MAAM;AAAA;AAGZ,YAAM,kBAAkB,WAAW,0BAA0B,sBAAsB;AAGnF,aAAO,aAAa,OAAQ,kBAAkB,eAAe,kBAAkB,eAAgB;AAAA;AAGjG,WAAO;AAAA,SACF;AAAA,MACH,WAAW,GAAG,UAAU,WAAW;AAAA,MACnC,eAAe;AAAA,MACf,WAAW,EAAE,KAAK,SAAS,UAAU;AAAA;AAAA;AAAA,EAIzC,kBAAkB,WAAW,MAAM;AACjC,UAAM,MAAM,UAAU,KAAK;AAC3B,UAAM,OAAO,UAAU,KAAK;AAG5B,cAAU,KAAK,MAAM,QAAQ,MAAM;AAEjC,YAAM,kBAAkB,yBAAyB,KAAK,oBAAoB,iBAAiB;AAC3F,YAAM,uBAAuB,kBAAkB;AAE/C,aAAO,CAAC,EAAE,eAAe,eAAe;AACtC,YAAI,YAAY;AACd,gBAAM;AAAA,YACJ,OAAO,EAAE,eAAe,iBAAiB;AAAA,YACzC;AAAA,cACE,KAAK;AAET,gBAAM,UAAU,aAAa,SAAS,SAAS,aAAa,SAAS,SAAS,SAAS;AACvF,iBACE,qCAAC,sBAAD;AAAA,YACE,eAAe;AAAA,YACf;AAAA,YACA,YAAY;AAAA,YACZ;AAAA,YACA,cAAc;AAAA,YACd;AAAA,YACA,UAAU;AAAA,cACR;AAAA,cACA;AAAA,iBACG;AAAA;AAAA,YAEL,MAAM,gBAAgB,EAAE;AAAA,aAEvB,SAAS;AAAA;AAIhB,eAAO,qCAAC,KAAD;AAAA,aAAS;AAAA;AAAA;AAAA,OAEjB;AAEH,WAAO;AAAA;AAAA,EAGT,YAAY,UAAU,MAAM,EAAE,WAAW;AACvC,UAAM;AAAA,MACJ,OAAO,EAAE;AAAA,MACT,OAAO,EAAE;AAAA,QACP,KAAK;AACT,UAAM,MAAM,QAAQ;AACpB,UAAM,aAAa,CAAC,CAAC,aAAa;AAClC,WAAO;AAAA,SACF;AAAA,MACH,WAAW,GACT,SAAS,WACT,OAAO,KAAK,cAAc,SAAS,KAAK,kBACxC,cAAc;AAAA,MAEhB;AAAA,MACA,aAAa,aAAa,QAAQ,aAAa,KAAK;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,143 +1,105 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
import TableBody from '../../components/TableBody.js';
|
|
22
|
-
import Table from '../../components/Table.js';
|
|
23
|
-
import { ColumnSizingPlugin } from '../column-sizing/ColumnSizingPlugin.js';
|
|
24
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
25
|
-
|
|
26
|
-
var _TableBody, _DSSeparator;
|
|
27
|
-
|
|
28
|
-
const _excluded = ["instanceRef"],
|
|
29
|
-
_excluded2 = ["showAllRows"];
|
|
30
|
-
|
|
31
|
-
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; }
|
|
32
|
-
|
|
33
|
-
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; }
|
|
34
|
-
const DetailGrid = deferComponentRender(_ref => {
|
|
35
|
-
let {
|
|
36
|
-
parentGrid,
|
|
37
|
-
parentRowData,
|
|
38
|
-
rows
|
|
39
|
-
} = _ref;
|
|
40
|
-
|
|
41
|
-
const _parentGrid$props = parentGrid.props,
|
|
42
|
-
parentProps = _objectWithoutProperties(_parentGrid$props, _excluded);
|
|
43
|
-
|
|
44
|
-
const grid = useDataGrid(_objectSpread(_objectSpread({
|
|
45
|
-
uuid: parentGrid.getInstance().uuid
|
|
46
|
-
}, parentProps), {}, {
|
|
47
|
-
columns: parentGrid.getInstance().decoratedColumns.filter(col => !col.expandableColumn).map(c => _objectSpread(_objectSpread({}, c), {}, {
|
|
48
|
-
expandableColumn: false
|
|
49
|
-
})),
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { DSSeparator } from "@elliemae/ds-separator";
|
|
4
|
+
import { DSButton } from "@elliemae/ds-button";
|
|
5
|
+
import styled from "styled-components";
|
|
6
|
+
import { get } from "@elliemae/ds-utilities";
|
|
7
|
+
import { deferComponentRender } from "@elliemae/ds-shared/defer-render-hoc";
|
|
8
|
+
import { useDataGrid } from "@elliemae/ds-shared/useDataGrid";
|
|
9
|
+
import { PaginationPlugin } from "../pagination";
|
|
10
|
+
import { BodyCell } from "../../components/BodyCell";
|
|
11
|
+
import { defaultRenderers } from "../../components/renderers";
|
|
12
|
+
import { TableBody } from "../../components/TableBody";
|
|
13
|
+
import { Table } from "../../components/Table";
|
|
14
|
+
import { ColumnSizingPlugin } from "../column-sizing";
|
|
15
|
+
const DetailGrid = deferComponentRender(({ parentGrid, parentRowData, rows }) => {
|
|
16
|
+
const { instanceRef, ...parentProps } = parentGrid.props;
|
|
17
|
+
const grid = useDataGrid({
|
|
18
|
+
uuid: parentGrid.getInstance().uuid,
|
|
19
|
+
...parentProps,
|
|
20
|
+
columns: parentGrid.getInstance().decoratedColumns.filter((col) => !col.expandableColumn).map((c) => ({ ...c, expandableColumn: false })),
|
|
50
21
|
rows,
|
|
51
22
|
plugins: [ColumnSizingPlugin, PaginationPlugin],
|
|
52
23
|
renderers: defaultRenderers,
|
|
53
24
|
bindColumnsSizeTo: parentGrid.uuid,
|
|
54
|
-
numRowsVisible:
|
|
25
|
+
numRowsVisible: "all",
|
|
55
26
|
paginated: true,
|
|
56
27
|
pagination: {
|
|
57
28
|
perPage: rows.length,
|
|
58
29
|
conditionalPagination: true
|
|
59
30
|
},
|
|
60
31
|
parentRowData
|
|
61
|
-
})
|
|
62
|
-
return
|
|
63
|
-
|
|
64
|
-
}));
|
|
32
|
+
});
|
|
33
|
+
return /* @__PURE__ */ React2.createElement(Table, {
|
|
34
|
+
...grid
|
|
35
|
+
}, /* @__PURE__ */ React2.createElement(TableBody, null));
|
|
65
36
|
}, null);
|
|
66
|
-
const DetailsWrapper =
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
37
|
+
const DetailsWrapper = styled.span`
|
|
38
|
+
flex: 1;
|
|
39
|
+
width: ${(props) => props.width}px;
|
|
40
|
+
`;
|
|
41
|
+
const DetailGridWrapper = styled.div`
|
|
42
|
+
display: flex;
|
|
43
|
+
height: calc(100% - ${(props) => props.allRowsVisible ? 18 : 60}px);
|
|
44
|
+
width: ${(props) => props.expandableGridDetailWidth}px;
|
|
45
|
+
margin: 12px 0;
|
|
46
|
+
`;
|
|
47
|
+
function ExpandedRow({
|
|
48
|
+
parentGrid,
|
|
49
|
+
detailColumns,
|
|
50
|
+
rowData,
|
|
51
|
+
rows,
|
|
52
|
+
rowProps,
|
|
53
|
+
cellComponent: CellComponent,
|
|
54
|
+
rowComponent: RowComponent
|
|
55
|
+
}) {
|
|
83
56
|
const {
|
|
84
57
|
decoratedColumns,
|
|
85
|
-
actions: {
|
|
86
|
-
|
|
87
|
-
},
|
|
88
|
-
state: {
|
|
89
|
-
expandedRows
|
|
90
|
-
},
|
|
58
|
+
actions: { toggleShowAllRows },
|
|
59
|
+
state: { expandedRows },
|
|
91
60
|
props: {
|
|
92
61
|
rowKey,
|
|
93
|
-
showMoreRowsText =
|
|
94
|
-
showLessRowsText =
|
|
62
|
+
showMoreRowsText = "SHOW ALL ROWS",
|
|
63
|
+
showLessRowsText = "SHOW LESS ROWS",
|
|
95
64
|
expandableSubrowsVisible
|
|
96
65
|
},
|
|
97
|
-
columnSizeService: {
|
|
98
|
-
expandableGridDetailWidth
|
|
99
|
-
}
|
|
66
|
+
columnSizeService: { expandableGridDetailWidth }
|
|
100
67
|
} = parentGrid.getInstance();
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
onClick: e => {
|
|
133
|
-
e.stopPropagation();
|
|
134
|
-
toggleShowAllRows(rowData);
|
|
135
|
-
},
|
|
136
|
-
style: {
|
|
137
|
-
marginBottom: '10px'
|
|
138
|
-
}
|
|
139
|
-
}))]
|
|
140
|
-
}));
|
|
68
|
+
const { showAllRows, ...restRowProps } = rowProps;
|
|
69
|
+
return /* @__PURE__ */ React2.createElement(RowComponent, {
|
|
70
|
+
...restRowProps
|
|
71
|
+
}, /* @__PURE__ */ React2.createElement(BodyCell, {
|
|
72
|
+
column: decoratedColumns[0],
|
|
73
|
+
columnIndex: 0,
|
|
74
|
+
component: CellComponent,
|
|
75
|
+
grid: parentGrid,
|
|
76
|
+
rowProps: { rowData, ...rowProps }
|
|
77
|
+
}), /* @__PURE__ */ React2.createElement(DetailsWrapper, {
|
|
78
|
+
width: expandableGridDetailWidth
|
|
79
|
+
}, /* @__PURE__ */ React2.createElement(DetailGridWrapper, {
|
|
80
|
+
allRowsVisible: rows.length < expandableSubrowsVisible || get(expandedRows, [rowKey, "showAllRows"]),
|
|
81
|
+
expandableGridDetailWidth
|
|
82
|
+
}, /* @__PURE__ */ React2.createElement(DSSeparator, {
|
|
83
|
+
dashed: true,
|
|
84
|
+
orientation: "vertical"
|
|
85
|
+
}), /* @__PURE__ */ React2.createElement(DetailGrid, {
|
|
86
|
+
detailColumns,
|
|
87
|
+
parentGrid: parentGrid.getInstance(),
|
|
88
|
+
parentRowData: rowData,
|
|
89
|
+
rows: showAllRows ? rows : (rows || []).slice(0, expandableSubrowsVisible)
|
|
90
|
+
})), rows.length > expandableSubrowsVisible && /* @__PURE__ */ React2.createElement(DSButton, {
|
|
91
|
+
buttonType: "text",
|
|
92
|
+
labelText: showAllRows ? showLessRowsText : showMoreRowsText,
|
|
93
|
+
onClick: (e) => {
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
toggleShowAllRows(rowData);
|
|
96
|
+
},
|
|
97
|
+
style: { marginBottom: "10px" }
|
|
98
|
+
})));
|
|
141
99
|
}
|
|
142
|
-
|
|
143
|
-
export {
|
|
100
|
+
var ExpandedRow_default = ExpandedRow;
|
|
101
|
+
export {
|
|
102
|
+
ExpandedRow,
|
|
103
|
+
ExpandedRow_default as default
|
|
104
|
+
};
|
|
105
|
+
//# sourceMappingURL=ExpandedRow.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/expandable-grid/ExpandedRow.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable max-lines */\nimport React from 'react';\nimport { DSSeparator } from '@elliemae/ds-separator';\nimport { DSButton } from '@elliemae/ds-button';\nimport styled from 'styled-components';\nimport { get } from '@elliemae/ds-utilities';\nimport { deferComponentRender } from '@elliemae/ds-shared/defer-render-hoc';\nimport { useDataGrid } from '@elliemae/ds-shared/useDataGrid';\nimport { PaginationPlugin } from '../pagination';\nimport { BodyCell } from '../../components/BodyCell';\nimport { defaultRenderers } from '../../components/renderers';\nimport { TableBody } from '../../components/TableBody';\nimport { Table } from '../../components/Table';\nimport { ColumnSizingPlugin } from '../column-sizing';\n\nconst DetailGrid = deferComponentRender(({ parentGrid, parentRowData, rows }) => {\n const { instanceRef, ...parentProps } = parentGrid.props;\n const grid = useDataGrid({\n uuid: parentGrid.getInstance().uuid,\n ...parentProps,\n columns: parentGrid\n .getInstance()\n .decoratedColumns.filter((col) => !col.expandableColumn)\n .map((c) => ({ ...c, expandableColumn: false })),\n rows,\n plugins: [ColumnSizingPlugin, PaginationPlugin],\n renderers: defaultRenderers,\n bindColumnsSizeTo: parentGrid.uuid,\n numRowsVisible: 'all',\n paginated: true,\n pagination: {\n perPage: rows.length,\n conditionalPagination: true,\n },\n parentRowData,\n });\n\n return (\n <Table {...grid}>\n <TableBody />\n </Table>\n );\n}, null);\n\nconst DetailsWrapper = styled.span`\n flex: 1;\n width: ${(props) => props.width}px;\n`;\n\nconst DetailGridWrapper = styled.div`\n display: flex;\n height: calc(100% - ${(props) => (props.allRowsVisible ? 18 : 60)}px);\n width: ${(props) => props.expandableGridDetailWidth}px;\n margin: 12px 0;\n`;\n\nfunction ExpandedRow({\n parentGrid,\n detailColumns,\n rowData,\n rows,\n rowProps,\n cellComponent: CellComponent,\n rowComponent: RowComponent,\n}) {\n const {\n decoratedColumns,\n actions: { toggleShowAllRows },\n state: { expandedRows },\n props: {\n rowKey,\n showMoreRowsText = 'SHOW ALL ROWS',\n showLessRowsText = 'SHOW LESS ROWS',\n expandableSubrowsVisible,\n },\n columnSizeService: { expandableGridDetailWidth },\n } = parentGrid.getInstance();\n\n const { showAllRows, ...restRowProps } = rowProps;\n return (\n <RowComponent {...restRowProps}>\n <BodyCell\n column={decoratedColumns[0]}\n columnIndex={0}\n component={CellComponent}\n grid={parentGrid}\n rowProps={{ rowData, ...rowProps }}\n />\n <DetailsWrapper width={expandableGridDetailWidth}>\n <DetailGridWrapper\n allRowsVisible={rows.length < expandableSubrowsVisible || get(expandedRows, [rowKey, 'showAllRows'])}\n expandableGridDetailWidth={expandableGridDetailWidth}\n >\n <DSSeparator dashed orientation=\"vertical\" />\n <DetailGrid\n detailColumns={detailColumns}\n parentGrid={parentGrid.getInstance()}\n parentRowData={rowData}\n rows={showAllRows ? rows : (rows || []).slice(0, expandableSubrowsVisible)}\n />\n </DetailGridWrapper>\n {rows.length > expandableSubrowsVisible && (\n <DSButton\n buttonType=\"text\"\n labelText={showAllRows ? showLessRowsText : showMoreRowsText}\n onClick={(e) => {\n e.stopPropagation();\n toggleShowAllRows(rowData);\n }}\n style={{ marginBottom: '10px' }}\n />\n )}\n </DetailsWrapper>\n </RowComponent>\n );\n}\n\nexport { ExpandedRow };\nexport default ExpandedRow;\n"],
|
|
5
|
+
"mappings": "AAAA;ACEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA,MAAM,aAAa,qBAAqB,CAAC,EAAE,YAAY,eAAe,WAAW;AAC/E,QAAM,EAAE,gBAAgB,gBAAgB,WAAW;AACnD,QAAM,OAAO,YAAY;AAAA,IACvB,MAAM,WAAW,cAAc;AAAA,OAC5B;AAAA,IACH,SAAS,WACN,cACA,iBAAiB,OAAO,CAAC,QAAQ,CAAC,IAAI,kBACtC,IAAI,CAAC,MAAO,MAAK,GAAG,kBAAkB;AAAA,IACzC;AAAA,IACA,SAAS,CAAC,oBAAoB;AAAA,IAC9B,WAAW;AAAA,IACX,mBAAmB,WAAW;AAAA,IAC9B,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,YAAY;AAAA,MACV,SAAS,KAAK;AAAA,MACd,uBAAuB;AAAA;AAAA,IAEzB;AAAA;AAGF,SACE,qCAAC,OAAD;AAAA,OAAW;AAAA,KACT,qCAAC,WAAD;AAAA,GAGH;AAEH,MAAM,iBAAiB,OAAO;AAAA;AAAA,WAEnB,CAAC,UAAU,MAAM;AAAA;AAG5B,MAAM,oBAAoB,OAAO;AAAA;AAAA,wBAET,CAAC,UAAW,MAAM,iBAAiB,KAAK;AAAA,WACrD,CAAC,UAAU,MAAM;AAAA;AAAA;AAI5B,qBAAqB;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,cAAc;AAAA,GACb;AACD,QAAM;AAAA,IACJ;AAAA,IACA,SAAS,EAAE;AAAA,IACX,OAAO,EAAE;AAAA,IACT,OAAO;AAAA,MACL;AAAA,MACA,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB;AAAA;AAAA,IAEF,mBAAmB,EAAE;AAAA,MACnB,WAAW;AAEf,QAAM,EAAE,gBAAgB,iBAAiB;AACzC,SACE,qCAAC,cAAD;AAAA,OAAkB;AAAA,KAChB,qCAAC,UAAD;AAAA,IACE,QAAQ,iBAAiB;AAAA,IACzB,aAAa;AAAA,IACb,WAAW;AAAA,IACX,MAAM;AAAA,IACN,UAAU,EAAE,YAAY;AAAA,MAE1B,qCAAC,gBAAD;AAAA,IAAgB,OAAO;AAAA,KACrB,qCAAC,mBAAD;AAAA,IACE,gBAAgB,KAAK,SAAS,4BAA4B,IAAI,cAAc,CAAC,QAAQ;AAAA,IACrF;AAAA,KAEA,qCAAC,aAAD;AAAA,IAAa,QAAM;AAAA,IAAC,aAAY;AAAA,MAChC,qCAAC,YAAD;AAAA,IACE;AAAA,IACA,YAAY,WAAW;AAAA,IACvB,eAAe;AAAA,IACf,MAAM,cAAc,OAAQ,SAAQ,IAAI,MAAM,GAAG;AAAA,OAGpD,KAAK,SAAS,4BACb,qCAAC,UAAD;AAAA,IACE,YAAW;AAAA,IACX,WAAW,cAAc,mBAAmB;AAAA,IAC5C,SAAS,CAAC,MAAM;AACd,QAAE;AACF,wBAAkB;AAAA;AAAA,IAEpB,OAAO,EAAE,cAAc;AAAA;AAAA;AASnC,IAAO,sBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|