@elliemae/ds-datagrids 2.2.0-next.3 → 2.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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,166 +1,115 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (!
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
return
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (emptyLast) {
|
|
45
|
-
actualSortFunction = (innerData, innerColumnIndexList, innerOrderList) => {
|
|
46
|
-
const sortedData = sort(innerData, innerColumnIndexList, innerOrderList);
|
|
47
|
-
const keys = Object.keys(sortingColumns);
|
|
48
|
-
const withData = sortedData.filter(r => keys.some(key => !!r[key]));
|
|
49
|
-
const withoutData = sortedData.filter(r => keys.some(key => !r[key]));
|
|
50
|
-
return [...withData, ...withoutData];
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
Object.keys(sortingColumns).forEach(sortingColumnKey => {
|
|
55
|
-
const realColumn = columns.find(column => column.property === sortingColumnKey);
|
|
56
|
-
if (!realColumn) return;
|
|
57
|
-
|
|
58
|
-
const columnSorter = realColumn.sort || function resolveValue(row) {
|
|
59
|
-
const {
|
|
60
|
-
property,
|
|
61
|
-
sortBy
|
|
62
|
-
} = realColumn;
|
|
63
|
-
const value = row[sortBy || property]; // Pick resolved value by convention
|
|
64
|
-
|
|
65
|
-
const resolvedValue = get(row, "_".concat(property), value);
|
|
66
|
-
|
|
67
|
-
if (realColumn.type === 'DateTime') {
|
|
68
|
-
return moment(resolvedValue);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return typeof resolvedValue === 'string' ? resolvedValue.toLowerCase() : resolvedValue;
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const sortingColumn = sortingColumns[sortingColumnKey];
|
|
75
|
-
columnIndexList[sortingColumn.position] = columnSorter;
|
|
76
|
-
orderList[sortingColumn.position] = sortingColumn.direction;
|
|
77
|
-
});
|
|
78
|
-
return actualSortFunction(data, columnIndexList, orderList);
|
|
79
|
-
};
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { get } from "@elliemae/ds-utilities";
|
|
3
|
+
import moment from "moment";
|
|
4
|
+
const sorter = ({ columns, sortingColumns, sort, emptyLast } = {}) => (data) => {
|
|
5
|
+
if (!columns) {
|
|
6
|
+
throw new Error('sort.sorter - Missing "columns" argument!');
|
|
7
|
+
}
|
|
8
|
+
if (!sort) {
|
|
9
|
+
throw new Error('sort.sorter - Missing "sort" argument!');
|
|
10
|
+
}
|
|
11
|
+
if (!sortingColumns) {
|
|
12
|
+
return data;
|
|
13
|
+
}
|
|
14
|
+
const columnIndexList = new Array(sortingColumns.length);
|
|
15
|
+
const orderList = new Array(sortingColumns.length);
|
|
16
|
+
let actualSortFunction = sort;
|
|
17
|
+
if (emptyLast) {
|
|
18
|
+
actualSortFunction = (innerData, innerColumnIndexList, innerOrderList) => {
|
|
19
|
+
const sortedData = sort(innerData, innerColumnIndexList, innerOrderList);
|
|
20
|
+
const keys = Object.keys(sortingColumns);
|
|
21
|
+
const withData = sortedData.filter((r) => keys.some((key) => !!r[key]));
|
|
22
|
+
const withoutData = sortedData.filter((r) => keys.some((key) => !r[key]));
|
|
23
|
+
return [...withData, ...withoutData];
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
Object.keys(sortingColumns).forEach((sortingColumnKey) => {
|
|
27
|
+
const realColumn = columns.find((column) => column.property === sortingColumnKey);
|
|
28
|
+
if (!realColumn)
|
|
29
|
+
return;
|
|
30
|
+
const columnSorter = realColumn.sort || function resolveValue(row) {
|
|
31
|
+
const { property, sortBy } = realColumn;
|
|
32
|
+
const value = row[sortBy || property];
|
|
33
|
+
const resolvedValue = get(row, `_${property}`, value);
|
|
34
|
+
if (realColumn.type === "DateTime") {
|
|
35
|
+
return moment(resolvedValue);
|
|
36
|
+
}
|
|
37
|
+
return typeof resolvedValue === "string" ? resolvedValue.toLowerCase() : resolvedValue;
|
|
38
|
+
};
|
|
39
|
+
const sortingColumn = sortingColumns[sortingColumnKey];
|
|
40
|
+
columnIndexList[sortingColumn.position] = columnSorter;
|
|
41
|
+
orderList[sortingColumn.position] = sortingColumn.direction;
|
|
42
|
+
});
|
|
43
|
+
return actualSortFunction(data, columnIndexList, orderList);
|
|
80
44
|
};
|
|
81
|
-
const sorterGroups =
|
|
82
|
-
|
|
83
|
-
columns
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
Object.keys(sortingColumns).forEach(sortingColumnKey => {
|
|
116
|
-
const realColumn = columns.find(column => column.property === sortingColumnKey);
|
|
117
|
-
if (!realColumn) return;
|
|
118
|
-
|
|
119
|
-
const columnSorter = realColumn.sort || function resolveValue(row) {
|
|
120
|
-
const {
|
|
121
|
-
property,
|
|
122
|
-
sortBy
|
|
123
|
-
} = realColumn;
|
|
124
|
-
const value = row[sortBy || property]; // Pick resolved value by convention
|
|
125
|
-
|
|
126
|
-
const resolvedValue = get(row, "_".concat(property), value);
|
|
127
|
-
|
|
128
|
-
if (realColumn.type === 'DateTime') {
|
|
129
|
-
return moment(resolvedValue);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
return typeof resolvedValue === 'string' ? resolvedValue.toLowerCase() : resolvedValue;
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
const sortingColumn = sortingColumns[sortingColumnKey];
|
|
136
|
-
columnIndexList[sortingColumn.position] = columnSorter;
|
|
137
|
-
orderList[sortingColumn.position] = sortingColumn.direction;
|
|
138
|
-
});
|
|
139
|
-
const groups = {};
|
|
140
|
-
const preserveData = {};
|
|
141
|
-
data.forEach(c => {
|
|
142
|
-
preserveData[c.id] = _objectSpread({}, c);
|
|
143
|
-
});
|
|
144
|
-
rowsData.forEach(group => {
|
|
145
|
-
groups[group.id] = {
|
|
146
|
-
children: actualSortFunction(group.children.map(c => _objectSpread({
|
|
147
|
-
parentNode: preserveData[c.id].parentNode,
|
|
148
|
-
data: c
|
|
149
|
-
}, c)), columnIndexList, orderList) // sort internally
|
|
150
|
-
|
|
151
|
-
};
|
|
152
|
-
});
|
|
153
|
-
const sorted = actualSortFunction(data.map(r => _objectSpread(_objectSpread({}, r.data), r)), columnIndexList, orderList); // sort global
|
|
154
|
-
|
|
155
|
-
let ssortGlobal = [];
|
|
156
|
-
sorted.filter(s => !s.isGroup).forEach(sr => {
|
|
157
|
-
if (groups[sr.parentNode.id]) {
|
|
158
|
-
ssortGlobal = [...ssortGlobal, preserveData[sr.parentNode.id], ...groups[sr.parentNode.id].children];
|
|
159
|
-
delete groups[sr.parentNode.id];
|
|
45
|
+
const sorterGroups = ({ columns, sortingColumns, sort, emptyLast } = {}) => (data, rowsData) => {
|
|
46
|
+
if (!columns) {
|
|
47
|
+
throw new Error('sort.sorter - Missing "columns" argument!');
|
|
48
|
+
}
|
|
49
|
+
if (!sort) {
|
|
50
|
+
throw new Error('sort.sorter - Missing "sort" argument!');
|
|
51
|
+
}
|
|
52
|
+
if (!sortingColumns) {
|
|
53
|
+
return data;
|
|
54
|
+
}
|
|
55
|
+
const columnIndexList = new Array(sortingColumns.length);
|
|
56
|
+
const orderList = new Array(sortingColumns.length);
|
|
57
|
+
let actualSortFunction = sort;
|
|
58
|
+
if (emptyLast) {
|
|
59
|
+
actualSortFunction = (innerData, innerColumnIndexList, innerOrderList) => {
|
|
60
|
+
const sortedData = sort(innerData, innerColumnIndexList, innerOrderList);
|
|
61
|
+
const keys = Object.keys(sortingColumns);
|
|
62
|
+
const withData = sortedData.filter((r) => keys.some((key) => !!r[key]));
|
|
63
|
+
const withoutData = sortedData.filter((r) => keys.some((key) => !r[key]));
|
|
64
|
+
return [...withData, ...withoutData];
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
Object.keys(sortingColumns).forEach((sortingColumnKey) => {
|
|
68
|
+
const realColumn = columns.find((column) => column.property === sortingColumnKey);
|
|
69
|
+
if (!realColumn)
|
|
70
|
+
return;
|
|
71
|
+
const columnSorter = realColumn.sort || function resolveValue(row) {
|
|
72
|
+
const { property, sortBy } = realColumn;
|
|
73
|
+
const value = row[sortBy || property];
|
|
74
|
+
const resolvedValue = get(row, `_${property}`, value);
|
|
75
|
+
if (realColumn.type === "DateTime") {
|
|
76
|
+
return moment(resolvedValue);
|
|
160
77
|
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
78
|
+
return typeof resolvedValue === "string" ? resolvedValue.toLowerCase() : resolvedValue;
|
|
79
|
+
};
|
|
80
|
+
const sortingColumn = sortingColumns[sortingColumnKey];
|
|
81
|
+
columnIndexList[sortingColumn.position] = columnSorter;
|
|
82
|
+
orderList[sortingColumn.position] = sortingColumn.direction;
|
|
83
|
+
});
|
|
84
|
+
const groups = {};
|
|
85
|
+
const preserveData = {};
|
|
86
|
+
data.forEach((c) => {
|
|
87
|
+
preserveData[c.id] = { ...c };
|
|
88
|
+
});
|
|
89
|
+
rowsData.forEach((group) => {
|
|
90
|
+
groups[group.id] = {
|
|
91
|
+
children: actualSortFunction(group.children.map((c) => ({
|
|
92
|
+
parentNode: preserveData[c.id].parentNode,
|
|
93
|
+
data: c,
|
|
94
|
+
...c
|
|
95
|
+
})), columnIndexList, orderList)
|
|
96
|
+
};
|
|
97
|
+
});
|
|
98
|
+
const sorted = actualSortFunction(data.map((r) => ({
|
|
99
|
+
...r.data,
|
|
100
|
+
...r
|
|
101
|
+
})), columnIndexList, orderList);
|
|
102
|
+
let ssortGlobal = [];
|
|
103
|
+
sorted.filter((s) => !s.isGroup).forEach((sr) => {
|
|
104
|
+
if (groups[sr.parentNode.id]) {
|
|
105
|
+
ssortGlobal = [...ssortGlobal, preserveData[sr.parentNode.id], ...groups[sr.parentNode.id].children];
|
|
106
|
+
delete groups[sr.parentNode.id];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
return ssortGlobal;
|
|
110
|
+
};
|
|
111
|
+
export {
|
|
112
|
+
sorter,
|
|
113
|
+
sorterGroups
|
|
164
114
|
};
|
|
165
|
-
|
|
166
|
-
export { sorter, sorterGroups };
|
|
115
|
+
//# sourceMappingURL=sorter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/sorter.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable max-statements */\nimport { get } from '@elliemae/ds-utilities';\nimport moment from 'moment';\n\nexport const sorter =\n ({ columns, sortingColumns, sort, emptyLast } = {}) =>\n (data) => {\n if (!columns) {\n throw new Error('sort.sorter - Missing \"columns\" argument!');\n }\n\n if (!sort) {\n throw new Error('sort.sorter - Missing \"sort\" argument!');\n }\n\n if (!sortingColumns) {\n return data;\n }\n const columnIndexList = new Array(sortingColumns.length);\n const orderList = new Array(sortingColumns.length);\n\n let actualSortFunction = sort;\n if (emptyLast) {\n actualSortFunction = (innerData, innerColumnIndexList, innerOrderList) => {\n const sortedData = sort(innerData, innerColumnIndexList, innerOrderList);\n\n const keys = Object.keys(sortingColumns);\n\n const withData = sortedData.filter((r) => keys.some((key) => !!r[key]));\n const withoutData = sortedData.filter((r) => keys.some((key) => !r[key]));\n\n return [...withData, ...withoutData];\n };\n }\n\n Object.keys(sortingColumns).forEach((sortingColumnKey) => {\n const realColumn = columns.find((column) => column.property === sortingColumnKey);\n if (!realColumn) return;\n const columnSorter =\n realColumn.sort ||\n function resolveValue(row) {\n const { property, sortBy } = realColumn;\n const value = row[sortBy || property];\n // Pick resolved value by convention\n const resolvedValue = get(row, `_${property}`, value);\n\n if (realColumn.type === 'DateTime') {\n return moment(resolvedValue);\n }\n\n return typeof resolvedValue === 'string' ? resolvedValue.toLowerCase() : resolvedValue;\n };\n\n const sortingColumn = sortingColumns[sortingColumnKey];\n\n columnIndexList[sortingColumn.position] = columnSorter;\n\n orderList[sortingColumn.position] = sortingColumn.direction;\n });\n return actualSortFunction(data, columnIndexList, orderList);\n };\n\nexport const sorterGroups =\n ({ columns, sortingColumns, sort, emptyLast } = {}) =>\n (data, rowsData) => {\n if (!columns) {\n throw new Error('sort.sorter - Missing \"columns\" argument!');\n }\n\n if (!sort) {\n throw new Error('sort.sorter - Missing \"sort\" argument!');\n }\n\n if (!sortingColumns) {\n return data;\n }\n\n const columnIndexList = new Array(sortingColumns.length);\n const orderList = new Array(sortingColumns.length);\n\n let actualSortFunction = sort;\n if (emptyLast) {\n actualSortFunction = (innerData, innerColumnIndexList, innerOrderList) => {\n const sortedData = sort(innerData, innerColumnIndexList, innerOrderList);\n\n const keys = Object.keys(sortingColumns);\n\n const withData = sortedData.filter((r) => keys.some((key) => !!r[key]));\n const withoutData = sortedData.filter((r) => keys.some((key) => !r[key]));\n\n return [...withData, ...withoutData];\n };\n }\n\n Object.keys(sortingColumns).forEach((sortingColumnKey) => {\n const realColumn = columns.find((column) => column.property === sortingColumnKey);\n if (!realColumn) return;\n const columnSorter =\n realColumn.sort ||\n function resolveValue(row) {\n const { property, sortBy } = realColumn;\n const value = row[sortBy || property];\n // Pick resolved value by convention\n const resolvedValue = get(row, `_${property}`, value);\n\n if (realColumn.type === 'DateTime') {\n return moment(resolvedValue);\n }\n\n return typeof resolvedValue === 'string' ? resolvedValue.toLowerCase() : resolvedValue;\n };\n\n const sortingColumn = sortingColumns[sortingColumnKey];\n\n columnIndexList[sortingColumn.position] = columnSorter;\n\n orderList[sortingColumn.position] = sortingColumn.direction;\n });\n\n const groups = {};\n const preserveData = {};\n data.forEach((c) => {\n preserveData[c.id] = { ...c };\n });\n\n rowsData.forEach((group) => {\n groups[group.id] = {\n children: actualSortFunction(\n group.children.map((c) => ({\n parentNode: preserveData[c.id].parentNode,\n data: c,\n ...c,\n })),\n columnIndexList,\n orderList,\n ), // sort internally\n };\n });\n\n const sorted = actualSortFunction(\n data.map((r) => ({\n ...r.data,\n ...r,\n })),\n columnIndexList,\n orderList,\n ); // sort global\n let ssortGlobal = [];\n sorted\n .filter((s) => !s.isGroup)\n .forEach((sr) => {\n if (groups[sr.parentNode.id]) {\n ssortGlobal = [...ssortGlobal, preserveData[sr.parentNode.id], ...groups[sr.parentNode.id].children];\n delete groups[sr.parentNode.id];\n }\n });\n return ssortGlobal;\n };\n"],
|
|
5
|
+
"mappings": "AAAA;ACEA;AACA;AAEO,MAAM,SACX,CAAC,EAAE,SAAS,gBAAgB,MAAM,cAAc,OAChD,CAAC,SAAS;AACR,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM;AAAA;AAGlB,MAAI,CAAC,MAAM;AACT,UAAM,IAAI,MAAM;AAAA;AAGlB,MAAI,CAAC,gBAAgB;AACnB,WAAO;AAAA;AAET,QAAM,kBAAkB,IAAI,MAAM,eAAe;AACjD,QAAM,YAAY,IAAI,MAAM,eAAe;AAE3C,MAAI,qBAAqB;AACzB,MAAI,WAAW;AACb,yBAAqB,CAAC,WAAW,sBAAsB,mBAAmB;AACxE,YAAM,aAAa,KAAK,WAAW,sBAAsB;AAEzD,YAAM,OAAO,OAAO,KAAK;AAEzB,YAAM,WAAW,WAAW,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE;AACjE,YAAM,cAAc,WAAW,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,QAAQ,CAAC,EAAE;AAEnE,aAAO,CAAC,GAAG,UAAU,GAAG;AAAA;AAAA;AAI5B,SAAO,KAAK,gBAAgB,QAAQ,CAAC,qBAAqB;AACxD,UAAM,aAAa,QAAQ,KAAK,CAAC,WAAW,OAAO,aAAa;AAChE,QAAI,CAAC;AAAY;AACjB,UAAM,eACJ,WAAW,QACX,sBAAsB,KAAK;AACzB,YAAM,EAAE,UAAU,WAAW;AAC7B,YAAM,QAAQ,IAAI,UAAU;AAE5B,YAAM,gBAAgB,IAAI,KAAK,IAAI,YAAY;AAE/C,UAAI,WAAW,SAAS,YAAY;AAClC,eAAO,OAAO;AAAA;AAGhB,aAAO,OAAO,kBAAkB,WAAW,cAAc,gBAAgB;AAAA;AAG7E,UAAM,gBAAgB,eAAe;AAErC,oBAAgB,cAAc,YAAY;AAE1C,cAAU,cAAc,YAAY,cAAc;AAAA;AAEpD,SAAO,mBAAmB,MAAM,iBAAiB;AAAA;AAG9C,MAAM,eACX,CAAC,EAAE,SAAS,gBAAgB,MAAM,cAAc,OAChD,CAAC,MAAM,aAAa;AAClB,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM;AAAA;AAGlB,MAAI,CAAC,MAAM;AACT,UAAM,IAAI,MAAM;AAAA;AAGlB,MAAI,CAAC,gBAAgB;AACnB,WAAO;AAAA;AAGT,QAAM,kBAAkB,IAAI,MAAM,eAAe;AACjD,QAAM,YAAY,IAAI,MAAM,eAAe;AAE3C,MAAI,qBAAqB;AACzB,MAAI,WAAW;AACb,yBAAqB,CAAC,WAAW,sBAAsB,mBAAmB;AACxE,YAAM,aAAa,KAAK,WAAW,sBAAsB;AAEzD,YAAM,OAAO,OAAO,KAAK;AAEzB,YAAM,WAAW,WAAW,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE;AACjE,YAAM,cAAc,WAAW,OAAO,CAAC,MAAM,KAAK,KAAK,CAAC,QAAQ,CAAC,EAAE;AAEnE,aAAO,CAAC,GAAG,UAAU,GAAG;AAAA;AAAA;AAI5B,SAAO,KAAK,gBAAgB,QAAQ,CAAC,qBAAqB;AACxD,UAAM,aAAa,QAAQ,KAAK,CAAC,WAAW,OAAO,aAAa;AAChE,QAAI,CAAC;AAAY;AACjB,UAAM,eACJ,WAAW,QACX,sBAAsB,KAAK;AACzB,YAAM,EAAE,UAAU,WAAW;AAC7B,YAAM,QAAQ,IAAI,UAAU;AAE5B,YAAM,gBAAgB,IAAI,KAAK,IAAI,YAAY;AAE/C,UAAI,WAAW,SAAS,YAAY;AAClC,eAAO,OAAO;AAAA;AAGhB,aAAO,OAAO,kBAAkB,WAAW,cAAc,gBAAgB;AAAA;AAG7E,UAAM,gBAAgB,eAAe;AAErC,oBAAgB,cAAc,YAAY;AAE1C,cAAU,cAAc,YAAY,cAAc;AAAA;AAGpD,QAAM,SAAS;AACf,QAAM,eAAe;AACrB,OAAK,QAAQ,CAAC,MAAM;AAClB,iBAAa,EAAE,MAAM,KAAK;AAAA;AAG5B,WAAS,QAAQ,CAAC,UAAU;AAC1B,WAAO,MAAM,MAAM;AAAA,MACjB,UAAU,mBACR,MAAM,SAAS,IAAI,CAAC,MAAO;AAAA,QACzB,YAAY,aAAa,EAAE,IAAI;AAAA,QAC/B,MAAM;AAAA,WACH;AAAA,WAEL,iBACA;AAAA;AAAA;AAKN,QAAM,SAAS,mBACb,KAAK,IAAI,CAAC,MAAO;AAAA,OACZ,EAAE;AAAA,OACF;AAAA,OAEL,iBACA;AAEF,MAAI,cAAc;AAClB,SACG,OAAO,CAAC,MAAM,CAAC,EAAE,SACjB,QAAQ,CAAC,OAAO;AACf,QAAI,OAAO,GAAG,WAAW,KAAK;AAC5B,oBAAc,CAAC,GAAG,aAAa,aAAa,GAAG,WAAW,KAAK,GAAG,OAAO,GAAG,WAAW,IAAI;AAC3F,aAAO,OAAO,GAAG,WAAW;AAAA;AAAA;AAGlC,SAAO;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,71 +1,44 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import 'core-js/modules/esnext.iterator.find.js';
|
|
6
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
7
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
10
|
-
import * as sortabular from 'sortabular/dist/index.js';
|
|
11
|
-
import useDerivedStateFromProps from '@elliemae/ds-utilities/hooks/useDerivedStateFromProps';
|
|
12
|
-
import { checkIfSortable } from './checkIfSortable.js';
|
|
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; }
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as sortabular from "sortabular/dist/index.js";
|
|
3
|
+
import { useDerivedStateFromProps } from "@elliemae/ds-utilities";
|
|
4
|
+
import { checkIfSortable } from "./checkIfSortable";
|
|
17
5
|
function useSortableState(grid) {
|
|
18
|
-
const {
|
|
19
|
-
onSort,
|
|
20
|
-
sortingColumns: sortingColumnsProp,
|
|
21
|
-
pagination
|
|
22
|
-
} = grid.props;
|
|
6
|
+
const { onSort, sortingColumns: sortingColumnsProp, pagination } = grid.props;
|
|
23
7
|
const [sortingColumns, setSortingColumns] = useDerivedStateFromProps(sortingColumnsProp);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const {
|
|
28
|
-
composedRows = {},
|
|
29
|
-
props
|
|
30
|
-
} = grid.getInstance();
|
|
31
|
-
const {
|
|
32
|
-
allRows,
|
|
33
|
-
rows
|
|
34
|
-
} = composedRows;
|
|
8
|
+
const handleSort = (selectedColumn) => {
|
|
9
|
+
const { composedRows = {}, props } = grid.getInstance();
|
|
10
|
+
const { allRows, rows } = composedRows;
|
|
35
11
|
const serverSidePagination = pagination && composedRows.amount !== (composedRows.rows && composedRows.rows.length);
|
|
36
|
-
|
|
37
12
|
if (props.serverSideData || serverSidePagination || checkIfSortable(selectedColumn, allRows || rows || composedRows)) {
|
|
38
|
-
setSortingColumns(prevSortingColumns => {
|
|
13
|
+
setSortingColumns((prevSortingColumns) => {
|
|
39
14
|
const nextSortingColumns = sortabular.byColumn({
|
|
40
15
|
sortingColumns: prevSortingColumns,
|
|
41
16
|
sortingOrder: {
|
|
42
|
-
FIRST:
|
|
43
|
-
asc:
|
|
44
|
-
desc:
|
|
17
|
+
FIRST: "asc",
|
|
18
|
+
asc: "desc",
|
|
19
|
+
desc: "asc"
|
|
45
20
|
},
|
|
46
21
|
selectedColumn
|
|
47
22
|
});
|
|
48
|
-
const {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
columnSorted = _objectSpread(_objectSpread({}, columnSorted), {}, {
|
|
23
|
+
const { columns } = grid.getInstance();
|
|
24
|
+
let columnSorted = columns.find((col) => col.property === selectedColumn);
|
|
25
|
+
columnSorted = {
|
|
26
|
+
...columnSorted,
|
|
53
27
|
originalProperty: columnSorted.property
|
|
54
|
-
}
|
|
28
|
+
};
|
|
55
29
|
onSort(nextSortingColumns, selectedColumn, columnSorted);
|
|
56
30
|
return nextSortingColumns;
|
|
57
31
|
});
|
|
58
32
|
}
|
|
59
33
|
};
|
|
60
|
-
|
|
61
34
|
return {
|
|
62
|
-
state: {
|
|
63
|
-
sortingColumns
|
|
64
|
-
},
|
|
35
|
+
state: { sortingColumns },
|
|
65
36
|
actions: {
|
|
66
37
|
sort: handleSort
|
|
67
38
|
}
|
|
68
39
|
};
|
|
69
40
|
}
|
|
70
|
-
|
|
71
|
-
|
|
41
|
+
export {
|
|
42
|
+
useSortableState
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=useSortableState.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/useSortableState.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import * as sortabular from 'sortabular/dist/index.js';\nimport { useDerivedStateFromProps } from '@elliemae/ds-utilities';\nimport { checkIfSortable } from './checkIfSortable';\n\nexport function useSortableState(grid) {\n const { onSort, sortingColumns: sortingColumnsProp, pagination } = grid.props;\n\n const [sortingColumns, setSortingColumns] = useDerivedStateFromProps(\n sortingColumnsProp,\n );\n\n const handleSort = selectedColumn => {\n // support for pagination\n const { composedRows = {}, props } = grid.getInstance();\n const { allRows, rows } = composedRows;\n const serverSidePagination =\n pagination &&\n composedRows.amount !== (composedRows.rows && composedRows.rows.length);\n if (\n props.serverSideData ||\n serverSidePagination ||\n checkIfSortable(selectedColumn, allRows || rows || composedRows)\n ) {\n setSortingColumns(prevSortingColumns => {\n const nextSortingColumns = sortabular.byColumn({\n sortingColumns: prevSortingColumns,\n sortingOrder: {\n FIRST: 'asc',\n asc: 'desc',\n desc: 'asc',\n },\n selectedColumn,\n });\n const { columns } = grid.getInstance();\n let columnSorted = columns.find(col => col.property === selectedColumn);\n columnSorted = {\n ...columnSorted,\n originalProperty: columnSorted.property,\n };\n onSort(nextSortingColumns, selectedColumn, columnSorted);\n return nextSortingColumns;\n });\n }\n };\n\n return {\n state: { sortingColumns },\n actions: {\n sort: handleSort,\n },\n };\n}\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAEO,0BAA0B,MAAM;AACrC,QAAM,EAAE,QAAQ,gBAAgB,oBAAoB,eAAe,KAAK;AAExE,QAAM,CAAC,gBAAgB,qBAAqB,yBAC1C;AAGF,QAAM,aAAa,oBAAkB;AAEnC,UAAM,EAAE,eAAe,IAAI,UAAU,KAAK;AAC1C,UAAM,EAAE,SAAS,SAAS;AAC1B,UAAM,uBACJ,cACA,aAAa,WAAY,cAAa,QAAQ,aAAa,KAAK;AAClE,QACE,MAAM,kBACN,wBACA,gBAAgB,gBAAgB,WAAW,QAAQ,eACnD;AACA,wBAAkB,wBAAsB;AACtC,cAAM,qBAAqB,WAAW,SAAS;AAAA,UAC7C,gBAAgB;AAAA,UAChB,cAAc;AAAA,YACZ,OAAO;AAAA,YACP,KAAK;AAAA,YACL,MAAM;AAAA;AAAA,UAER;AAAA;AAEF,cAAM,EAAE,YAAY,KAAK;AACzB,YAAI,eAAe,QAAQ,KAAK,SAAO,IAAI,aAAa;AACxD,uBAAe;AAAA,aACV;AAAA,UACH,kBAAkB,aAAa;AAAA;AAEjC,eAAO,oBAAoB,gBAAgB;AAC3C,eAAO;AAAA;AAAA;AAAA;AAKb,SAAO;AAAA,IACL,OAAO,EAAE;AAAA,IACT,SAAS;AAAA,MACP,MAAM;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,88 +1,67 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
9
|
-
import { useRef, useState, useEffect } from 'react';
|
|
10
|
-
import { isEmpty } from 'lodash';
|
|
11
|
-
import { omit } from '@elliemae/ds-utilities';
|
|
12
|
-
import { ToolbarTrigger } from './ToolbarTrigger.js';
|
|
13
|
-
import { RowSizes } from '../../rowSizes.js';
|
|
14
|
-
import { jsx } from 'react/jsx-runtime';
|
|
15
|
-
|
|
16
|
-
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; }
|
|
17
|
-
|
|
18
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useEffect, useRef, useState } from "react";
|
|
3
|
+
import PropTypes from "prop-types";
|
|
4
|
+
import { isEmpty } from "lodash";
|
|
5
|
+
import { omit } from "@elliemae/ds-utilities";
|
|
6
|
+
import { ToolbarTrigger } from "./ToolbarTrigger";
|
|
7
|
+
import { RowSizes } from "../../rowSizes";
|
|
19
8
|
const RowRenderer = (Row, grid) => {
|
|
20
|
-
const Wrapped = props => {
|
|
9
|
+
const Wrapped = (props) => {
|
|
21
10
|
const ref = useRef();
|
|
11
|
+
const { rowData = {}, index, rowIndex, style } = props;
|
|
22
12
|
const {
|
|
23
|
-
|
|
24
|
-
index,
|
|
25
|
-
rowIndex,
|
|
26
|
-
style
|
|
27
|
-
} = props;
|
|
28
|
-
const {
|
|
29
|
-
props: {
|
|
30
|
-
wrapText
|
|
31
|
-
}
|
|
13
|
+
props: { wrapText }
|
|
32
14
|
} = grid.getInstance();
|
|
33
15
|
const [popStyle, setPopStyle] = useState({});
|
|
34
16
|
const [rowStyle, setRowStyle] = useState(style);
|
|
35
17
|
const gridInstance = grid.getInstance();
|
|
36
|
-
const {
|
|
37
|
-
refs,
|
|
38
|
-
isRowDragging
|
|
39
|
-
} = gridInstance;
|
|
18
|
+
const { refs, isRowDragging } = gridInstance;
|
|
40
19
|
const [hasVerticalScrollBar, setHasVerticalScrollBar] = useState(refs.body.current && refs.body.current.offsetWidth > refs.body.current.clientWidth);
|
|
41
20
|
useEffect(() => {
|
|
42
|
-
const shouldOmit = isRowDragging ? [
|
|
43
|
-
setPopStyle(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
21
|
+
const shouldOmit = isRowDragging ? ["top"] : [];
|
|
22
|
+
setPopStyle({
|
|
23
|
+
...popStyle,
|
|
24
|
+
...{ top: style && !isRowDragging ? style.top : "0" }
|
|
25
|
+
});
|
|
47
26
|
if (style) {
|
|
48
|
-
// style defined means it has virtualization
|
|
49
27
|
setHasVerticalScrollBar(true);
|
|
50
28
|
} else {
|
|
51
29
|
setHasVerticalScrollBar(false);
|
|
52
30
|
}
|
|
53
|
-
|
|
54
31
|
setRowStyle(omit(style || {
|
|
55
|
-
height: !wrapText ? RowSizes[gridInstance.props.rowSize] :
|
|
56
|
-
position:
|
|
32
|
+
height: !wrapText ? RowSizes[gridInstance.props.rowSize] : "auto",
|
|
33
|
+
position: "relative"
|
|
57
34
|
}, [shouldOmit]));
|
|
58
35
|
}, [style, isRowDragging]);
|
|
59
|
-
return
|
|
36
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
60
37
|
className: "row-renderer-fixed-height",
|
|
61
38
|
style: {
|
|
62
|
-
height: !wrapText ? RowSizes[gridInstance.props.rowSize] :
|
|
63
|
-
position: style ?
|
|
64
|
-
|
|
39
|
+
height: !wrapText ? RowSizes[gridInstance.props.rowSize] : "auto",
|
|
40
|
+
position: style ? "auto" : "relative"
|
|
65
41
|
}
|
|
66
|
-
},
|
|
67
|
-
ref
|
|
68
|
-
|
|
42
|
+
}, /* @__PURE__ */ React2.createElement(Row, {
|
|
43
|
+
ref,
|
|
44
|
+
...props,
|
|
69
45
|
style: rowStyle
|
|
70
|
-
})
|
|
71
|
-
className:
|
|
72
|
-
style:
|
|
73
|
-
},
|
|
74
|
-
grid
|
|
75
|
-
rowData: {
|
|
76
|
-
rowData,
|
|
77
|
-
index,
|
|
78
|
-
rowIndex
|
|
79
|
-
},
|
|
46
|
+
}), isEmpty(rowData) && !rowData.index && !rowData.rowIndex ? null : /* @__PURE__ */ React2.createElement("div", {
|
|
47
|
+
className: `toolbar-trigger-container ${style ? "move" : "stay"}`,
|
|
48
|
+
style: { ...popStyle }
|
|
49
|
+
}, /* @__PURE__ */ React2.createElement(ToolbarTrigger, {
|
|
50
|
+
grid,
|
|
51
|
+
rowData: { rowData, index, rowIndex },
|
|
80
52
|
hasScrollBar: hasVerticalScrollBar,
|
|
81
53
|
rowRef: ref
|
|
82
54
|
})));
|
|
83
55
|
};
|
|
84
|
-
|
|
56
|
+
Wrapped.propTypes = {
|
|
57
|
+
rowData: PropTypes.any,
|
|
58
|
+
index: PropTypes.number,
|
|
59
|
+
rowIndex: PropTypes.number,
|
|
60
|
+
style: PropTypes.any
|
|
61
|
+
};
|
|
85
62
|
return Wrapped;
|
|
86
63
|
};
|
|
87
|
-
|
|
88
|
-
|
|
64
|
+
export {
|
|
65
|
+
RowRenderer
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=RowRenderer.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/RowRenderer.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react-hooks/rules-of-hooks */\n/* eslint-disable max-statements */\n/* eslint-disable react/prop-types */\nimport React, { useEffect, useRef, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { isEmpty } from 'lodash';\nimport { omit } from '@elliemae/ds-utilities';\nimport { ToolbarTrigger } from './ToolbarTrigger';\nimport { RowSizes } from '../../rowSizes';\n\nexport const RowRenderer = (Row, grid) => {\n const Wrapped = (props) => {\n const ref = useRef();\n const { rowData = {}, index, rowIndex, style } = props;\n const {\n props: { wrapText },\n } = grid.getInstance();\n const [popStyle, setPopStyle] = useState({});\n const [rowStyle, setRowStyle] = useState(style);\n const gridInstance = grid.getInstance();\n const { refs, isRowDragging } = gridInstance;\n const [hasVerticalScrollBar, setHasVerticalScrollBar] = useState(\n refs.body.current && refs.body.current.offsetWidth > refs.body.current.clientWidth,\n );\n\n useEffect(() => {\n const shouldOmit = isRowDragging ? ['top'] : [];\n setPopStyle({\n ...popStyle,\n ...{ top: style && !isRowDragging ? style.top : '0' },\n });\n if (style) {\n // style defined means it has virtualization\n setHasVerticalScrollBar(true);\n } else {\n setHasVerticalScrollBar(false);\n }\n setRowStyle(\n omit(\n style || {\n height: !wrapText ? RowSizes[gridInstance.props.rowSize] : 'auto',\n position: 'relative',\n },\n [shouldOmit],\n ),\n );\n }, [style, isRowDragging]);\n return (\n <div\n className=\"row-renderer-fixed-height\"\n style={{\n height: !wrapText ? RowSizes[gridInstance.props.rowSize] : 'auto',\n position: style ? 'auto' : 'relative',\n // top: isDragging ? rowStyle.top - RowSizes[gridInstance.props.rowSize] : 'auto',\n }}\n >\n <Row ref={ref} {...props} style={rowStyle} />\n {isEmpty(rowData) && !rowData.index && !rowData.rowIndex ? null : (\n <div className={`toolbar-trigger-container ${style ? 'move' : 'stay'}`} style={{ ...popStyle }}>\n <ToolbarTrigger\n grid={grid}\n rowData={{ rowData, index, rowIndex }}\n hasScrollBar={hasVerticalScrollBar}\n rowRef={ref}\n />\n </div>\n )}\n </div>\n );\n };\n\n Wrapped.propTypes = {\n rowData: PropTypes.any,\n index: PropTypes.number,\n rowIndex: PropTypes.number,\n style: PropTypes.any,\n };\n\n return Wrapped;\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACGA;AACA;AACA;AACA;AACA;AACA;AAEO,MAAM,cAAc,CAAC,KAAK,SAAS;AACxC,QAAM,UAAU,CAAC,UAAU;AACzB,UAAM,MAAM;AACZ,UAAM,EAAE,UAAU,IAAI,OAAO,UAAU,UAAU;AACjD,UAAM;AAAA,MACJ,OAAO,EAAE;AAAA,QACP,KAAK;AACT,UAAM,CAAC,UAAU,eAAe,SAAS;AACzC,UAAM,CAAC,UAAU,eAAe,SAAS;AACzC,UAAM,eAAe,KAAK;AAC1B,UAAM,EAAE,MAAM,kBAAkB;AAChC,UAAM,CAAC,sBAAsB,2BAA2B,SACtD,KAAK,KAAK,WAAW,KAAK,KAAK,QAAQ,cAAc,KAAK,KAAK,QAAQ;AAGzE,cAAU,MAAM;AACd,YAAM,aAAa,gBAAgB,CAAC,SAAS;AAC7C,kBAAY;AAAA,WACP;AAAA,WACA,EAAE,KAAK,SAAS,CAAC,gBAAgB,MAAM,MAAM;AAAA;AAElD,UAAI,OAAO;AAET,gCAAwB;AAAA,aACnB;AACL,gCAAwB;AAAA;AAE1B,kBACE,KACE,SAAS;AAAA,QACP,QAAQ,CAAC,WAAW,SAAS,aAAa,MAAM,WAAW;AAAA,QAC3D,UAAU;AAAA,SAEZ,CAAC;AAAA,OAGJ,CAAC,OAAO;AACX,WACE,qCAAC,OAAD;AAAA,MACE,WAAU;AAAA,MACV,OAAO;AAAA,QACL,QAAQ,CAAC,WAAW,SAAS,aAAa,MAAM,WAAW;AAAA,QAC3D,UAAU,QAAQ,SAAS;AAAA;AAAA,OAI7B,qCAAC,KAAD;AAAA,MAAK;AAAA,SAAc;AAAA,MAAO,OAAO;AAAA,QAChC,QAAQ,YAAY,CAAC,QAAQ,SAAS,CAAC,QAAQ,WAAW,OACzD,qCAAC,OAAD;AAAA,MAAK,WAAW,6BAA6B,QAAQ,SAAS;AAAA,MAAU,OAAO,KAAK;AAAA,OAClF,qCAAC,gBAAD;AAAA,MACE;AAAA,MACA,SAAS,EAAE,SAAS,OAAO;AAAA,MAC3B,cAAc;AAAA,MACd,QAAQ;AAAA;AAAA;AAQpB,UAAQ,YAAY;AAAA,IAClB,SAAS,UAAU;AAAA,IACnB,OAAO,UAAU;AAAA,IACjB,UAAU,UAAU;AAAA,IACpB,OAAO,UAAU;AAAA;AAGnB,SAAO;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { jsxs, Fragment } from 'react/jsx-runtime';
|
|
8
|
-
|
|
9
|
-
const decorateColumns = columns => {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { createInstancePlugin } from "@elliemae/ds-shared/createDataInstance/createInstancePlugin";
|
|
4
|
+
import { appendCellFormatter } from "@elliemae/ds-shared/useDataGrid/initColumnDefinition";
|
|
5
|
+
import { RowRenderer } from "./RowRenderer";
|
|
6
|
+
const decorateColumns = (columns) => {
|
|
10
7
|
const lastColumn = columns[columns.length - 1];
|
|
11
|
-
return [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
maxWidth: 34,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})], lastColumn, 'fixedFormatters')];
|
|
8
|
+
return [
|
|
9
|
+
...columns.slice(0, -1),
|
|
10
|
+
appendCellFormatter([
|
|
11
|
+
(value) => /* @__PURE__ */ React2.createElement(React2.Fragment, null, value, /* @__PURE__ */ React2.createElement("div", {
|
|
12
|
+
style: { width: 34, maxWidth: 34, overflow: "hidden" }
|
|
13
|
+
}))
|
|
14
|
+
], lastColumn, "fixedFormatters")
|
|
15
|
+
];
|
|
20
16
|
};
|
|
21
|
-
|
|
22
17
|
const decorateRenderers = (renderers, grid) => {
|
|
23
18
|
const Row = renderers.body.row;
|
|
24
19
|
renderers.body.row = RowRenderer(Row, grid);
|
|
25
20
|
return renderers;
|
|
26
21
|
};
|
|
27
|
-
|
|
28
|
-
const ToolbarPlugin = createInstancePlugin('toolbar', {
|
|
22
|
+
const ToolbarPlugin = createInstancePlugin("toolbar", {
|
|
29
23
|
decorateRenderers,
|
|
30
24
|
decorateColumns
|
|
31
25
|
});
|
|
32
|
-
|
|
33
|
-
|
|
26
|
+
export {
|
|
27
|
+
ToolbarPlugin
|
|
28
|
+
};
|
|
29
|
+
//# sourceMappingURL=ToolbarPlugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/toolbar/ToolbarPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { createInstancePlugin } from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';\nimport { appendCellFormatter } from '@elliemae/ds-shared/useDataGrid/initColumnDefinition';\nimport { RowRenderer } from './RowRenderer';\n\nconst decorateColumns = (columns) => {\n const lastColumn = columns[columns.length - 1];\n return [\n ...columns.slice(0, -1),\n appendCellFormatter(\n [\n (value) => (\n <>\n {value}\n <div style={{ width: 34, maxWidth: 34, overflow: 'hidden' }} />\n </>\n ),\n ],\n lastColumn,\n 'fixedFormatters',\n ),\n ];\n};\n\nconst decorateRenderers = (renderers, grid) => {\n const Row = renderers.body.row;\n renderers.body.row = RowRenderer(Row, grid);\n return renderers;\n};\n\nexport const ToolbarPlugin = createInstancePlugin('toolbar', {\n decorateRenderers,\n decorateColumns,\n});\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AAEA,MAAM,kBAAkB,CAAC,YAAY;AACnC,QAAM,aAAa,QAAQ,QAAQ,SAAS;AAC5C,SAAO;AAAA,IACL,GAAG,QAAQ,MAAM,GAAG;AAAA,IACpB,oBACE;AAAA,MACE,CAAC,UACC,4DACG,OACD,qCAAC,OAAD;AAAA,QAAK,OAAO,EAAE,OAAO,IAAI,UAAU,IAAI,UAAU;AAAA;AAAA,OAIvD,YACA;AAAA;AAAA;AAKN,MAAM,oBAAoB,CAAC,WAAW,SAAS;AAC7C,QAAM,MAAM,UAAU,KAAK;AAC3B,YAAU,KAAK,MAAM,YAAY,KAAK;AACtC,SAAO;AAAA;AAGF,MAAM,gBAAgB,qBAAqB,WAAW;AAAA,EAC3D;AAAA,EACA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|