@elliemae/ds-datagrids 2.2.0-alpha.1 → 2.2.0-alpha.5
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/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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/selectableFormatter.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable indent */\n/* eslint-disable jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events,react/display-name */\nimport React, { forwardRef, useEffect, useRef } from 'react';\nimport { isFunction } from '@elliemae/ds-utilities';\nimport { DSCheckbox, DSRadio } from '@elliemae/ds-form';\n\nconst SelectableWrapper = ({ className, children }) => (\n <div className={className} onClick={(e) => e.stopPropagation()}>\n {children}\n </div>\n);\n\nconst SelectableComponent = React.memo(\n forwardRef(\n ({ className, isMultiSelect, isHeader, onSelect, isSelected, value }, ref) => {\n const SelectComponent = isMultiSelect || isHeader ? DSCheckbox : DSRadio;\n\n return (\n <SelectableWrapper className={className}>\n <SelectComponent\n checked={isSelected}\n data-testid=\"column-selectable-component\"\n innerRef={ref}\n onChange={onSelect}\n tabIndex={-1}\n value={value}\n />\n </SelectableWrapper>\n );\n },\n (prev, next) => next.isScrolling,\n ),\n);\n\nconst selectableFormatter =\n ({ isMultiSelect = false, renderer, className, isHeader, onSelect }, grid) =>\n (valueRender, extraParams) => {\n const { registerFocus } = extraParams;\n const ref = useRef();\n const {\n props: { rowKey },\n state: { selection },\n shiftPressed,\n lastSelectedRow,\n } = grid.getInstance();\n const { rowData, isScrolling } = extraParams;\n\n useEffect(() => {\n if (registerFocus) registerFocus(ref.current);\n }, [ref.current]);\n\n const isSelected = isHeader ? selection.selectAll : !!selection.selectedRows[rowData[rowKey]];\n\n const handleSelect = isHeader\n ? () => onSelect(!isSelected)\n : () => onSelect(rowData[rowKey], extraParams.rowIndex, shiftPressed, lastSelectedRow);\n\n if (isFunction(renderer)) {\n return (\n <SelectableWrapper className={className}>\n {renderer({\n rowData: {},\n ...extraParams,\n value: isSelected,\n isHeader,\n onSelect: handleSelect,\n })}\n </SelectableWrapper>\n );\n }\n\n return (\n <SelectableComponent\n ref={ref}\n className={className}\n isMultiSelect={isMultiSelect}\n isScrolling={isScrolling}\n isSelected={isSelected}\n onSelect={handleSelect}\n value={!isHeader ? rowData[rowKey] : 'header-select-all'}\n />\n );\n };\n\nexport { selectableFormatter };\nexport default selectableFormatter;\n"],
|
|
5
|
+
"mappings": "AAAA;ACGA;AACA;AACA;AAEA,MAAM,oBAAoB,CAAC,EAAE,WAAW,eACtC,qCAAC,OAAD;AAAA,EAAK;AAAA,EAAsB,SAAS,CAAC,MAAM,EAAE;AAAA,GAC1C;AAIL,MAAM,sBAAsB,OAAM,KAChC,WACE,CAAC,EAAE,WAAW,eAAe,UAAU,UAAU,YAAY,SAAS,QAAQ;AAC5E,QAAM,kBAAkB,iBAAiB,WAAW,aAAa;AAEjE,SACE,qCAAC,mBAAD;AAAA,IAAmB;AAAA,KACjB,qCAAC,iBAAD;AAAA,IACE,SAAS;AAAA,IACT,eAAY;AAAA,IACZ,UAAU;AAAA,IACV,UAAU;AAAA,IACV,UAAU;AAAA,IACV;AAAA;AAAA,GAKR,CAAC,MAAM,SAAS,KAAK;AAIzB,MAAM,sBACJ,CAAC,EAAE,gBAAgB,OAAO,UAAU,WAAW,UAAU,YAAY,SACrE,CAAC,aAAa,gBAAgB;AAC5B,QAAM,EAAE,kBAAkB;AAC1B,QAAM,MAAM;AACZ,QAAM;AAAA,IACJ,OAAO,EAAE;AAAA,IACT,OAAO,EAAE;AAAA,IACT;AAAA,IACA;AAAA,MACE,KAAK;AACT,QAAM,EAAE,SAAS,gBAAgB;AAEjC,YAAU,MAAM;AACd,QAAI;AAAe,oBAAc,IAAI;AAAA,KACpC,CAAC,IAAI;AAER,QAAM,aAAa,WAAW,UAAU,YAAY,CAAC,CAAC,UAAU,aAAa,QAAQ;AAErF,QAAM,eAAe,WACjB,MAAM,SAAS,CAAC,cAChB,MAAM,SAAS,QAAQ,SAAS,YAAY,UAAU,cAAc;AAExE,MAAI,WAAW,WAAW;AACxB,WACE,qCAAC,mBAAD;AAAA,MAAmB;AAAA,OAChB,SAAS;AAAA,MACR,SAAS;AAAA,SACN;AAAA,MACH,OAAO;AAAA,MACP;AAAA,MACA,UAAU;AAAA;AAAA;AAMlB,SACE,qCAAC,qBAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,UAAU;AAAA,IACV,OAAO,CAAC,WAAW,QAAQ,UAAU;AAAA;AAAA;AAM7C,IAAO,8BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,28 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
import 'core-js/modules/esnext.iterator.map.js';
|
|
10
|
-
import 'core-js/modules/esnext.async-iterator.reduce.js';
|
|
11
|
-
import 'core-js/modules/esnext.iterator.reduce.js';
|
|
12
|
-
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
13
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
14
|
-
import { useDerivedStateFromProps, hashArray, toggleInObject, omit } from '@elliemae/ds-utilities';
|
|
15
|
-
import { toggleSelectAll, checkAllRowsSelected, toggleSingleSelectable } from './helper.js';
|
|
16
|
-
|
|
17
|
-
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; }
|
|
18
|
-
|
|
19
|
-
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; }
|
|
20
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useDerivedStateFromProps } from "@elliemae/ds-utilities";
|
|
3
|
+
import { toggleInObject, hashArray, omit } from "@elliemae/ds-utilities";
|
|
4
|
+
import {
|
|
5
|
+
checkAllRowsSelected,
|
|
6
|
+
toggleSelectAll,
|
|
7
|
+
toggleSingleSelectable
|
|
8
|
+
} from "./helper";
|
|
21
9
|
function deriveSelectedStateFromPropsOnUpdate(rows) {
|
|
22
|
-
return
|
|
23
|
-
let nextProp = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
24
|
-
let prevProp = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
25
|
-
|
|
10
|
+
return (nextProp = {}, prevProp = {}) => {
|
|
26
11
|
if (nextProp.selectAll !== prevProp.selectAll) {
|
|
27
12
|
const nextSelectedRows = nextProp.selectAll ? toggleSelectAll(rows, true) : hashArray(nextProp.selectedRows || []);
|
|
28
13
|
return {
|
|
@@ -30,87 +15,57 @@ function deriveSelectedStateFromPropsOnUpdate(rows) {
|
|
|
30
15
|
selectAll: checkAllRowsSelected(rows, Object.keys(nextSelectedRows))
|
|
31
16
|
};
|
|
32
17
|
}
|
|
33
|
-
|
|
34
18
|
return {
|
|
35
19
|
selectedRows: hashArray(nextProp.selectedRows || []),
|
|
36
20
|
selectAll: checkAllRowsSelected(rows, Object.keys(nextProp.selectedRows))
|
|
37
21
|
};
|
|
38
22
|
};
|
|
39
23
|
}
|
|
40
|
-
|
|
41
24
|
function useSelectableState(grid) {
|
|
42
25
|
const {
|
|
43
|
-
props: {
|
|
44
|
-
rowKey = 'id',
|
|
45
|
-
selectedRows,
|
|
46
|
-
selectAll,
|
|
47
|
-
selectable,
|
|
48
|
-
onSelectRow,
|
|
49
|
-
onSelectAll
|
|
50
|
-
},
|
|
26
|
+
props: { rowKey = "id", selectedRows, selectAll, selectable, onSelectRow, onSelectAll },
|
|
51
27
|
rows,
|
|
52
28
|
setLastSelectedRow
|
|
53
29
|
} = grid.getInstance();
|
|
54
|
-
const multiple = selectable ===
|
|
55
|
-
const [selection, setSelectedRowsState] = useDerivedStateFromProps({
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}); // ACTIONS
|
|
61
|
-
|
|
62
|
-
const handleSelectRow = function (id, index) {
|
|
63
|
-
let shift = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
64
|
-
let lastSelectedRow = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
|
65
|
-
setSelectedRowsState(prevState => {
|
|
66
|
-
const {
|
|
67
|
-
rows: nextRows
|
|
68
|
-
} = grid.getInstance();
|
|
69
|
-
const wasSelected = Object.keys(prevState.selectedRows).some( // we need to match softly as the id may be a number
|
|
70
|
-
// eslint-disable-next-line eqeqeq
|
|
71
|
-
elem => elem == id);
|
|
30
|
+
const multiple = selectable === "multi";
|
|
31
|
+
const [selection, setSelectedRowsState] = useDerivedStateFromProps({ selectedRows, selectAll }, { onUpdate: deriveSelectedStateFromPropsOnUpdate(rows) });
|
|
32
|
+
const handleSelectRow = (id, index, shift = false, lastSelectedRow = null) => {
|
|
33
|
+
setSelectedRowsState((prevState) => {
|
|
34
|
+
const { rows: nextRows } = grid.getInstance();
|
|
35
|
+
const wasSelected = Object.keys(prevState.selectedRows).some((elem) => elem == id);
|
|
72
36
|
let nextSelectedRows = multiple ? toggleInObject(prevState.selectedRows, id, true) : toggleSingleSelectable(prevState.selectedRows, id);
|
|
73
|
-
setLastSelectedRow({
|
|
74
|
-
index,
|
|
75
|
-
mode: wasSelected ? 'deselect' : 'select'
|
|
76
|
-
});
|
|
77
|
-
|
|
37
|
+
setLastSelectedRow({ index, mode: wasSelected ? "deselect" : "select" });
|
|
78
38
|
if (shift && lastSelectedRow) {
|
|
79
39
|
const prevSmallest = lastSelectedRow.index < index + 1;
|
|
80
40
|
const sliceStart = prevSmallest ? lastSelectedRow.index : index;
|
|
81
41
|
const sliceEnd = prevSmallest ? index + 1 : lastSelectedRow.index + 1;
|
|
82
|
-
const rowSegment = nextRows.slice(sliceStart, sliceEnd).map(row => row[rowKey]);
|
|
83
|
-
|
|
84
|
-
if (lastSelectedRow.mode === 'deselect') {
|
|
42
|
+
const rowSegment = nextRows.slice(sliceStart, sliceEnd).map((row) => row[rowKey]);
|
|
43
|
+
if (lastSelectedRow.mode === "deselect") {
|
|
85
44
|
nextSelectedRows = omit(prevState.selectedRows, rowSegment);
|
|
86
45
|
} else {
|
|
87
|
-
const selectedSegment = rowSegment.reduce((o, key) =>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
46
|
+
const selectedSegment = rowSegment.reduce((o, key) => ({ ...o, [key]: true }), {});
|
|
47
|
+
nextSelectedRows = {
|
|
48
|
+
...prevState.selectedRows,
|
|
49
|
+
...selectedSegment
|
|
50
|
+
};
|
|
91
51
|
}
|
|
92
52
|
}
|
|
93
|
-
|
|
94
53
|
const nextState = {
|
|
95
54
|
selectedRows: nextSelectedRows,
|
|
96
55
|
selectAll: checkAllRowsSelected(nextRows, Object.keys(nextSelectedRows))
|
|
97
56
|
};
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
onSelectRow(nextRows.filter(row => nextState.selectedRows[row[rowKey]]), nextState.selectAll, index);
|
|
57
|
+
if (index !== null && index !== void 0) {
|
|
58
|
+
onSelectRow(nextRows.filter((row) => nextState.selectedRows[row[rowKey]]), nextState.selectAll, index);
|
|
101
59
|
}
|
|
102
|
-
|
|
103
60
|
return nextState;
|
|
104
61
|
});
|
|
105
62
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
63
|
+
const handleSelectAll = (checked) => {
|
|
64
|
+
if (!multiple)
|
|
65
|
+
return;
|
|
109
66
|
setLastSelectedRow(null);
|
|
110
67
|
setSelectedRowsState(() => {
|
|
111
|
-
const {
|
|
112
|
-
composedRows: nextRows
|
|
113
|
-
} = grid.getInstance();
|
|
68
|
+
const { composedRows: nextRows } = grid.getInstance();
|
|
114
69
|
const nextState = {
|
|
115
70
|
selectAll: checked,
|
|
116
71
|
selectedRows: toggleSelectAll(nextRows, checked)
|
|
@@ -120,7 +75,6 @@ function useSelectableState(grid) {
|
|
|
120
75
|
return nextState;
|
|
121
76
|
});
|
|
122
77
|
};
|
|
123
|
-
|
|
124
78
|
return {
|
|
125
79
|
actions: {
|
|
126
80
|
selectRow: handleSelectRow,
|
|
@@ -131,5 +85,7 @@ function useSelectableState(grid) {
|
|
|
131
85
|
}
|
|
132
86
|
};
|
|
133
87
|
}
|
|
134
|
-
|
|
135
|
-
|
|
88
|
+
export {
|
|
89
|
+
useSelectableState
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=useSelectableState.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/useSelectableState.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { useDerivedStateFromProps } from '@elliemae/ds-utilities';\nimport { toggleInObject, hashArray, omit } from '@elliemae/ds-utilities';\nimport {\n checkAllRowsSelected,\n toggleSelectAll,\n toggleSingleSelectable,\n} from './helper';\n\nfunction deriveSelectedStateFromPropsOnUpdate(rows) {\n return (nextProp = {}, prevProp = {}) => {\n if (nextProp.selectAll !== prevProp.selectAll) {\n const nextSelectedRows = nextProp.selectAll\n ? toggleSelectAll(rows, true)\n : hashArray(nextProp.selectedRows || []);\n return {\n selectedRows: nextSelectedRows,\n selectAll: checkAllRowsSelected(rows, Object.keys(nextSelectedRows)),\n };\n }\n return {\n selectedRows: hashArray(nextProp.selectedRows || []),\n selectAll: checkAllRowsSelected(rows, Object.keys(nextProp.selectedRows)),\n };\n };\n}\n\nexport function useSelectableState(grid) {\n const {\n props: { rowKey = 'id', selectedRows, selectAll, selectable, onSelectRow, onSelectAll },\n rows,\n setLastSelectedRow,\n } = grid.getInstance();\n\n const multiple = selectable === 'multi';\n const [selection, setSelectedRowsState] = useDerivedStateFromProps(\n { selectedRows, selectAll },\n { onUpdate: deriveSelectedStateFromPropsOnUpdate(rows) },\n );\n\n // ACTIONS\n const handleSelectRow = (\n id,\n index,\n shift = false,\n lastSelectedRow = null,\n // eslint-disable-next-line max-params\n ) => {\n setSelectedRowsState((prevState) => {\n const { rows: nextRows } = grid.getInstance();\n const wasSelected = Object.keys(prevState.selectedRows).some(\n // we need to match softly as the id may be a number\n // eslint-disable-next-line eqeqeq\n (elem) => elem == id,\n );\n let nextSelectedRows = multiple\n ? toggleInObject(prevState.selectedRows, id, true)\n : toggleSingleSelectable(prevState.selectedRows, id);\n setLastSelectedRow({ index, mode: wasSelected ? 'deselect' : 'select' });\n if (shift && lastSelectedRow) {\n const prevSmallest = lastSelectedRow.index < index + 1;\n const sliceStart = prevSmallest ? lastSelectedRow.index : index;\n const sliceEnd = prevSmallest ? index + 1 : lastSelectedRow.index + 1;\n const rowSegment = nextRows.slice(sliceStart, sliceEnd).map((row) => row[rowKey]);\n if (lastSelectedRow.mode === 'deselect') {\n nextSelectedRows = omit(prevState.selectedRows, rowSegment);\n } else {\n const selectedSegment = rowSegment.reduce((o, key) => ({ ...o, [key]: true }), {});\n nextSelectedRows = {\n ...prevState.selectedRows,\n ...selectedSegment,\n };\n }\n }\n\n const nextState = {\n selectedRows: nextSelectedRows,\n selectAll: checkAllRowsSelected(nextRows, Object.keys(nextSelectedRows)),\n };\n if (index !== null && index !== undefined) {\n onSelectRow(\n nextRows.filter((row) => nextState.selectedRows[row[rowKey]]),\n nextState.selectAll,\n index,\n );\n }\n\n return nextState;\n });\n };\n\n const handleSelectAll = (checked) => {\n if (!multiple) return;\n setLastSelectedRow(null);\n setSelectedRowsState(() => {\n const { composedRows: nextRows } = grid.getInstance();\n\n const nextState = {\n selectAll: checked,\n selectedRows: toggleSelectAll(nextRows, checked),\n };\n\n onSelectAll(nextState.selectAll);\n onSelectRow(checked ? nextRows : [], nextState.selectAll);\n\n return nextState;\n });\n };\n\n return {\n actions: {\n selectRow: handleSelectRow,\n selectAll: handleSelectAll,\n },\n state: {\n selection,\n },\n };\n}\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AAMA,8CAA8C,MAAM;AAClD,SAAO,CAAC,WAAW,IAAI,WAAW,OAAO;AACvC,QAAI,SAAS,cAAc,SAAS,WAAW;AAC7C,YAAM,mBAAmB,SAAS,YAC9B,gBAAgB,MAAM,QACtB,UAAU,SAAS,gBAAgB;AACvC,aAAO;AAAA,QACL,cAAc;AAAA,QACd,WAAW,qBAAqB,MAAM,OAAO,KAAK;AAAA;AAAA;AAGtD,WAAO;AAAA,MACL,cAAc,UAAU,SAAS,gBAAgB;AAAA,MACjD,WAAW,qBAAqB,MAAM,OAAO,KAAK,SAAS;AAAA;AAAA;AAAA;AAK1D,4BAA4B,MAAM;AACvC,QAAM;AAAA,IACJ,OAAO,EAAE,SAAS,MAAM,cAAc,WAAW,YAAY,aAAa;AAAA,IAC1E;AAAA,IACA;AAAA,MACE,KAAK;AAET,QAAM,WAAW,eAAe;AAChC,QAAM,CAAC,WAAW,wBAAwB,yBACxC,EAAE,cAAc,aAChB,EAAE,UAAU,qCAAqC;AAInD,QAAM,kBAAkB,CACtB,IACA,OACA,QAAQ,OACR,kBAAkB,SAEf;AACH,yBAAqB,CAAC,cAAc;AAClC,YAAM,EAAE,MAAM,aAAa,KAAK;AAChC,YAAM,cAAc,OAAO,KAAK,UAAU,cAAc,KAGtD,CAAC,SAAS,QAAQ;AAEpB,UAAI,mBAAmB,WACnB,eAAe,UAAU,cAAc,IAAI,QAC3C,uBAAuB,UAAU,cAAc;AACnD,yBAAmB,EAAE,OAAO,MAAM,cAAc,aAAa;AAC7D,UAAI,SAAS,iBAAiB;AAC5B,cAAM,eAAe,gBAAgB,QAAQ,QAAQ;AACrD,cAAM,aAAa,eAAe,gBAAgB,QAAQ;AAC1D,cAAM,WAAW,eAAe,QAAQ,IAAI,gBAAgB,QAAQ;AACpE,cAAM,aAAa,SAAS,MAAM,YAAY,UAAU,IAAI,CAAC,QAAQ,IAAI;AACzE,YAAI,gBAAgB,SAAS,YAAY;AACvC,6BAAmB,KAAK,UAAU,cAAc;AAAA,eAC3C;AACL,gBAAM,kBAAkB,WAAW,OAAO,CAAC,GAAG,QAAS,MAAK,IAAI,MAAM,SAAS;AAC/E,6BAAmB;AAAA,eACd,UAAU;AAAA,eACV;AAAA;AAAA;AAAA;AAKT,YAAM,YAAY;AAAA,QAChB,cAAc;AAAA,QACd,WAAW,qBAAqB,UAAU,OAAO,KAAK;AAAA;AAExD,UAAI,UAAU,QAAQ,UAAU,QAAW;AACzC,oBACE,SAAS,OAAO,CAAC,QAAQ,UAAU,aAAa,IAAI,WACpD,UAAU,WACV;AAAA;AAIJ,aAAO;AAAA;AAAA;AAIX,QAAM,kBAAkB,CAAC,YAAY;AACnC,QAAI,CAAC;AAAU;AACf,uBAAmB;AACnB,yBAAqB,MAAM;AACzB,YAAM,EAAE,cAAc,aAAa,KAAK;AAExC,YAAM,YAAY;AAAA,QAChB,WAAW;AAAA,QACX,cAAc,gBAAgB,UAAU;AAAA;AAG1C,kBAAY,UAAU;AACtB,kBAAY,UAAU,WAAW,IAAI,UAAU;AAE/C,aAAO;AAAA;AAAA;AAIX,SAAO;AAAA,IACL,SAAS;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA;AAAA,IAEb,OAAO;AAAA,MACL;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,39 +1,33 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as sortabular from "sortabular";
|
|
3
|
+
import { compose, isEmpty, orderBy } from "@elliemae/ds-utilities";
|
|
4
|
+
import {
|
|
5
|
+
appendHeaderFormatter,
|
|
6
|
+
mergeClassNameToColumnHeader
|
|
7
|
+
} from "@elliemae/ds-shared/useDataGrid/initColumnDefinition";
|
|
8
|
+
import { createInstancePlugin } from "@elliemae/ds-shared/createDataInstance/createInstancePlugin";
|
|
9
|
+
import { sortHeaderFormatter } from "./sortHeaderFormatter";
|
|
10
|
+
import { useSortableState } from "./useSortableState";
|
|
11
|
+
import { sorter, sorterGroups } from "./sorter";
|
|
9
12
|
const decorateColumn = (column, grid) => {
|
|
10
13
|
const {
|
|
11
|
-
props: {
|
|
12
|
-
isSortableColumnActive = col => col.sortable,
|
|
13
|
-
groupedRows
|
|
14
|
-
}
|
|
14
|
+
props: { isSortableColumnActive = (col) => col.sortable, groupedRows }
|
|
15
15
|
} = grid;
|
|
16
|
-
if (groupedRows)
|
|
17
|
-
|
|
16
|
+
if (groupedRows)
|
|
17
|
+
return column;
|
|
18
|
+
if (!isSortableColumnActive(column))
|
|
19
|
+
return column;
|
|
18
20
|
const formatter = sortHeaderFormatter(sortabular.sort({
|
|
19
21
|
getSortingColumns: () => grid.getState().sortingColumns || [],
|
|
20
22
|
onSort: grid.actions.sort,
|
|
21
23
|
strategy: sortabular.strategies.byProperty
|
|
22
24
|
}), grid);
|
|
23
|
-
return compose(appendHeaderFormatter(formatter), mergeClassNameToColumnHeader(
|
|
25
|
+
return compose(appendHeaderFormatter(formatter), mergeClassNameToColumnHeader("with-sortable"))(column);
|
|
24
26
|
};
|
|
25
|
-
|
|
26
27
|
const composeRows = (rows, grid) => {
|
|
27
28
|
const {
|
|
28
|
-
state: {
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
props: {
|
|
32
|
-
isDataSorted,
|
|
33
|
-
groupedRows,
|
|
34
|
-
groupedBy,
|
|
35
|
-
sortEmptyLast
|
|
36
|
-
},
|
|
29
|
+
state: { sortingColumns },
|
|
30
|
+
props: { isDataSorted, groupedRows, groupedBy, sortEmptyLast },
|
|
37
31
|
rows: rowsData,
|
|
38
32
|
composedRows,
|
|
39
33
|
decoratedColumns
|
|
@@ -43,40 +37,33 @@ const composeRows = (rows, grid) => {
|
|
|
43
37
|
sortingColumns: !isEmpty(sortingColumns) && sortingColumns,
|
|
44
38
|
sort: orderBy,
|
|
45
39
|
emptyLast: sortEmptyLast
|
|
46
|
-
};
|
|
47
|
-
|
|
40
|
+
};
|
|
48
41
|
if (groupedRows && !groupedBy) {
|
|
49
42
|
return !isDataSorted ? sorterGroups(sortingConfig)(composedRows, rowsData, groupedBy) : rows;
|
|
50
43
|
}
|
|
51
|
-
|
|
52
44
|
return !isDataSorted ? sorter(sortingConfig)(rows) : rows;
|
|
53
45
|
};
|
|
54
|
-
|
|
55
|
-
const SortablePlugin = createInstancePlugin('sortable', {
|
|
46
|
+
const SortablePlugin = createInstancePlugin("sortable", {
|
|
56
47
|
registerStateHook: useSortableState,
|
|
57
48
|
decorateColumn,
|
|
58
49
|
composeRows,
|
|
59
|
-
|
|
60
50
|
registerHotKeys(grid) {
|
|
61
51
|
return {
|
|
62
|
-
key:
|
|
63
|
-
handler:
|
|
64
|
-
let {
|
|
65
|
-
cellIndex
|
|
66
|
-
} = _ref;
|
|
52
|
+
key: "ctrl+s",
|
|
53
|
+
handler: ({ cellIndex }) => {
|
|
67
54
|
const {
|
|
68
|
-
actions: {
|
|
69
|
-
sort
|
|
70
|
-
},
|
|
55
|
+
actions: { sort },
|
|
71
56
|
decoratedColumns
|
|
72
57
|
} = grid.getInstance();
|
|
73
58
|
const column = decoratedColumns[cellIndex];
|
|
74
|
-
if (!column)
|
|
59
|
+
if (!column)
|
|
60
|
+
return;
|
|
75
61
|
sort(column.property);
|
|
76
62
|
}
|
|
77
63
|
};
|
|
78
64
|
}
|
|
79
|
-
|
|
80
65
|
});
|
|
81
|
-
|
|
82
|
-
|
|
66
|
+
export {
|
|
67
|
+
SortablePlugin
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=SortablePlugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/SortablePlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import * as sortabular from 'sortabular';\nimport { compose, isEmpty, orderBy } from '@elliemae/ds-utilities';\nimport {\n appendHeaderFormatter,\n mergeClassNameToColumnHeader,\n} from '@elliemae/ds-shared/useDataGrid/initColumnDefinition';\nimport { createInstancePlugin } from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';\nimport { sortHeaderFormatter } from './sortHeaderFormatter';\nimport { useSortableState } from './useSortableState';\nimport { sorter, sorterGroups } from './sorter';\n\nconst decorateColumn = (column, grid) => {\n const {\n props: { isSortableColumnActive = (col) => col.sortable, groupedRows },\n } = grid;\n\n if (groupedRows) return column;\n if (!isSortableColumnActive(column)) return column;\n\n const formatter = sortHeaderFormatter(\n sortabular.sort({\n getSortingColumns: () => grid.getState().sortingColumns || [],\n onSort: grid.actions.sort,\n strategy: sortabular.strategies.byProperty,\n }),\n grid,\n );\n\n return compose(appendHeaderFormatter(formatter), mergeClassNameToColumnHeader('with-sortable'))(column);\n};\n\nconst composeRows = (rows, grid) => {\n const {\n state: { sortingColumns },\n props: { isDataSorted, groupedRows, groupedBy, sortEmptyLast },\n rows: rowsData,\n composedRows,\n decoratedColumns,\n } = grid.getInstance();\n\n const sortingConfig = {\n columns: decoratedColumns,\n sortingColumns: !isEmpty(sortingColumns) && sortingColumns,\n sort: orderBy,\n emptyLast: sortEmptyLast,\n };\n\n // TODO: 1572 FIX\n if (groupedRows && !groupedBy) {\n return !isDataSorted ? sorterGroups(sortingConfig)(composedRows, rowsData, groupedBy) : rows;\n }\n\n return !isDataSorted ? sorter(sortingConfig)(rows) : rows;\n};\n\nexport const SortablePlugin = createInstancePlugin('sortable', {\n registerStateHook: useSortableState,\n decorateColumn,\n composeRows,\n registerHotKeys(grid) {\n return {\n key: 'ctrl+s',\n handler: ({ cellIndex }) => {\n const {\n actions: { sort },\n decoratedColumns,\n } = grid.getInstance();\n const column = decoratedColumns[cellIndex];\n if (!column) return;\n sort(column.property);\n },\n };\n },\n});\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAAA;AAAA;AAAA;AAIA;AACA;AACA;AACA;AAEA,MAAM,iBAAiB,CAAC,QAAQ,SAAS;AACvC,QAAM;AAAA,IACJ,OAAO,EAAE,yBAAyB,CAAC,QAAQ,IAAI,UAAU;AAAA,MACvD;AAEJ,MAAI;AAAa,WAAO;AACxB,MAAI,CAAC,uBAAuB;AAAS,WAAO;AAE5C,QAAM,YAAY,oBAChB,WAAW,KAAK;AAAA,IACd,mBAAmB,MAAM,KAAK,WAAW,kBAAkB;AAAA,IAC3D,QAAQ,KAAK,QAAQ;AAAA,IACrB,UAAU,WAAW,WAAW;AAAA,MAElC;AAGF,SAAO,QAAQ,sBAAsB,YAAY,6BAA6B,kBAAkB;AAAA;AAGlG,MAAM,cAAc,CAAC,MAAM,SAAS;AAClC,QAAM;AAAA,IACJ,OAAO,EAAE;AAAA,IACT,OAAO,EAAE,cAAc,aAAa,WAAW;AAAA,IAC/C,MAAM;AAAA,IACN;AAAA,IACA;AAAA,MACE,KAAK;AAET,QAAM,gBAAgB;AAAA,IACpB,SAAS;AAAA,IACT,gBAAgB,CAAC,QAAQ,mBAAmB;AAAA,IAC5C,MAAM;AAAA,IACN,WAAW;AAAA;AAIb,MAAI,eAAe,CAAC,WAAW;AAC7B,WAAO,CAAC,eAAe,aAAa,eAAe,cAAc,UAAU,aAAa;AAAA;AAG1F,SAAO,CAAC,eAAe,OAAO,eAAe,QAAQ;AAAA;AAGhD,MAAM,iBAAiB,qBAAqB,YAAY;AAAA,EAC7D,mBAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EACA,gBAAgB,MAAM;AACpB,WAAO;AAAA,MACL,KAAK;AAAA,MACL,SAAS,CAAC,EAAE,gBAAgB;AAC1B,cAAM;AAAA,UACJ,SAAS,EAAE;AAAA,UACX;AAAA,YACE,KAAK;AACT,cAAM,SAAS,iBAAiB;AAChC,YAAI,CAAC;AAAQ;AACb,aAAK,OAAO;AAAA;AAAA;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/* eslint-disable no-loops/no-loops */
|
|
1
|
+
import * as React from "react";
|
|
4
2
|
const checkIfSortable = (column, rows) => {
|
|
5
3
|
for (let index = 0; index < rows.length; index++) {
|
|
6
4
|
const element = rows[index][column];
|
|
7
|
-
|
|
8
|
-
if (!(element === null || element === undefined)) {
|
|
9
|
-
// PUI-6452
|
|
5
|
+
if (!(element === null || element === void 0)) {
|
|
10
6
|
return true;
|
|
11
7
|
}
|
|
12
8
|
}
|
|
13
|
-
|
|
14
9
|
return false;
|
|
15
10
|
};
|
|
16
|
-
|
|
17
|
-
export {
|
|
11
|
+
var checkIfSortable_default = checkIfSortable;
|
|
12
|
+
export {
|
|
13
|
+
checkIfSortable,
|
|
14
|
+
checkIfSortable_default as default
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=checkIfSortable.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/checkIfSortable.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-plusplus */\n/* eslint-disable no-loops/no-loops */\nexport const checkIfSortable = (column, rows) => {\n for (let index = 0; index < rows.length; index++) {\n const element = rows[index][column];\n if (!(element === null || element === undefined)) {\n // PUI-6452\n return true;\n }\n }\n return false;\n};\n\nexport default checkIfSortable;\n"],
|
|
5
|
+
"mappings": "AAAA;ACEO,MAAM,kBAAkB,CAAC,QAAQ,SAAS;AAC/C,WAAS,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;AAChD,UAAM,UAAU,KAAK,OAAO;AAC5B,QAAI,CAAE,aAAY,QAAQ,YAAY,SAAY;AAEhD,aAAO;AAAA;AAAA;AAGX,SAAO;AAAA;AAGT,IAAO,0BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { SortablePlugin } from './SortablePlugin';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,53 +1,37 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { aggregatedClasses } from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const SortHeader = /*#__PURE__*/React.memo(_ref => {
|
|
11
|
-
let {
|
|
12
|
-
value,
|
|
13
|
-
onClick,
|
|
14
|
-
sortState
|
|
15
|
-
} = _ref;
|
|
16
|
-
const sortIndicator = sortState === 'asc' ? _ArrowheadUp || (_ArrowheadUp = /*#__PURE__*/_jsx(ArrowheadUp, {
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { aggregatedClasses } from "@elliemae/ds-classnames";
|
|
4
|
+
import { ArrowheadDown, ArrowheadUp } from "@elliemae/ds-icons";
|
|
5
|
+
const blockName = "data-grid-sort-header";
|
|
6
|
+
const SortHeaderContainer = aggregatedClasses("div")(blockName);
|
|
7
|
+
const iconColor = ["brand-primary", 800];
|
|
8
|
+
const SortHeader = React2.memo(({ value, onClick, sortState }) => {
|
|
9
|
+
const sortIndicator = sortState === "asc" ? /* @__PURE__ */ React2.createElement(ArrowheadUp, {
|
|
17
10
|
color: iconColor
|
|
18
|
-
})
|
|
11
|
+
}) : /* @__PURE__ */ React2.createElement(ArrowheadDown, {
|
|
19
12
|
color: iconColor
|
|
20
|
-
})
|
|
21
|
-
return
|
|
22
|
-
onClick
|
|
23
|
-
},
|
|
13
|
+
});
|
|
14
|
+
return /* @__PURE__ */ React2.createElement(SortHeaderContainer, {
|
|
15
|
+
onClick
|
|
16
|
+
}, /* @__PURE__ */ React2.createElement("span", {
|
|
24
17
|
className: "header-value"
|
|
25
|
-
},
|
|
18
|
+
}, value), sortState && sortIndicator);
|
|
26
19
|
});
|
|
27
|
-
|
|
28
|
-
const sortHeaderFormatter = (sortable, grid) => (value, _ref2) => {
|
|
29
|
-
let {
|
|
30
|
-
columnIndex,
|
|
31
|
-
property
|
|
32
|
-
} = _ref2;
|
|
20
|
+
const sortHeaderFormatter = (sortable, grid) => (value, { columnIndex, property }) => {
|
|
33
21
|
const {
|
|
34
|
-
state: {
|
|
35
|
-
sortingColumns
|
|
36
|
-
}
|
|
22
|
+
state: { sortingColumns }
|
|
37
23
|
} = grid.getInstance();
|
|
38
|
-
const {
|
|
24
|
+
const { onClick, className } = sortable(value, { columnIndex, property });
|
|
25
|
+
return /* @__PURE__ */ React2.createElement(SortHeader, {
|
|
26
|
+
className,
|
|
39
27
|
onClick,
|
|
40
|
-
className
|
|
41
|
-
} = sortable(value, {
|
|
42
|
-
columnIndex,
|
|
43
|
-
property
|
|
44
|
-
});
|
|
45
|
-
return /*#__PURE__*/_jsx(SortHeader, {
|
|
46
|
-
className: className,
|
|
47
|
-
onClick: onClick,
|
|
48
28
|
sortState: sortingColumns[property] && sortingColumns[property].direction,
|
|
49
|
-
value
|
|
29
|
+
value
|
|
50
30
|
});
|
|
51
31
|
};
|
|
52
|
-
|
|
53
|
-
export {
|
|
32
|
+
var sortHeaderFormatter_default = sortHeaderFormatter;
|
|
33
|
+
export {
|
|
34
|
+
sortHeaderFormatter_default as default,
|
|
35
|
+
sortHeaderFormatter
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=sortHeaderFormatter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/sortHeaderFormatter.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { ArrowheadDown, ArrowheadUp } from '@elliemae/ds-icons';\n\nconst blockName = 'data-grid-sort-header';\n\nconst SortHeaderContainer = aggregatedClasses('div')(blockName);\n\nconst iconColor = ['brand-primary', 800];\n\nconst SortHeader = React.memo(({ value, onClick, sortState }) => {\n const sortIndicator = sortState === 'asc' ? <ArrowheadUp color={iconColor} /> : <ArrowheadDown color={iconColor} />;\n return (\n <SortHeaderContainer onClick={onClick}>\n <span className=\"header-value\">{value}</span>\n {sortState && sortIndicator}\n </SortHeaderContainer>\n );\n});\n\nconst sortHeaderFormatter =\n (sortable, grid) =>\n (value, { columnIndex, property }) => {\n const {\n state: { sortingColumns },\n } = grid.getInstance();\n const { onClick, className } = sortable(value, { columnIndex, property });\n return (\n <SortHeader\n className={className}\n onClick={onClick}\n sortState={sortingColumns[property] && sortingColumns[property].direction}\n value={value}\n />\n );\n };\n\nexport { sortHeaderFormatter };\nexport default sortHeaderFormatter;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAEA,MAAM,YAAY;AAElB,MAAM,sBAAsB,kBAAkB,OAAO;AAErD,MAAM,YAAY,CAAC,iBAAiB;AAEpC,MAAM,aAAa,OAAM,KAAK,CAAC,EAAE,OAAO,SAAS,gBAAgB;AAC/D,QAAM,gBAAgB,cAAc,QAAQ,qCAAC,aAAD;AAAA,IAAa,OAAO;AAAA,OAAgB,qCAAC,eAAD;AAAA,IAAe,OAAO;AAAA;AACtG,SACE,qCAAC,qBAAD;AAAA,IAAqB;AAAA,KACnB,qCAAC,QAAD;AAAA,IAAM,WAAU;AAAA,KAAgB,QAC/B,aAAa;AAAA;AAKpB,MAAM,sBACJ,CAAC,UAAU,SACX,CAAC,OAAO,EAAE,aAAa,eAAe;AACpC,QAAM;AAAA,IACJ,OAAO,EAAE;AAAA,MACP,KAAK;AACT,QAAM,EAAE,SAAS,cAAc,SAAS,OAAO,EAAE,aAAa;AAC9D,SACE,qCAAC,YAAD;AAAA,IACE;AAAA,IACA;AAAA,IACA,WAAW,eAAe,aAAa,eAAe,UAAU;AAAA,IAChE;AAAA;AAAA;AAMR,IAAO,8BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,26 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
8
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
9
|
-
import * as sortabular from 'sortabular';
|
|
10
|
-
|
|
11
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
12
|
-
|
|
13
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
|
-
|
|
15
|
-
const deepSorting = function (sortConfig) {
|
|
16
|
-
let rows = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
17
|
-
return sortabular.sorter(sortConfig)(rows.map(row => row.children && row.children.length ? _objectSpread(_objectSpread({}, row), {}, {
|
|
18
|
-
children: deepSorting(sortConfig, row.children)
|
|
19
|
-
}) : row));
|
|
20
|
-
};
|
|
21
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as sort from "sortabular";
|
|
3
|
+
const deepSorting = (sortConfig, rows = []) => sort.sorter(sortConfig)(rows.map((row) => row.children && row.children.length ? {
|
|
4
|
+
...row,
|
|
5
|
+
children: deepSorting(sortConfig, row.children)
|
|
6
|
+
} : row));
|
|
22
7
|
function sortTree(sortConfig) {
|
|
23
|
-
return rows => deepSorting(sortConfig, rows);
|
|
8
|
+
return (rows) => deepSorting(sortConfig, rows);
|
|
24
9
|
}
|
|
25
|
-
|
|
26
|
-
export {
|
|
10
|
+
var sortTree_default = sortTree;
|
|
11
|
+
export {
|
|
12
|
+
sortTree_default as default,
|
|
13
|
+
sortTree
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=sortTree.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/sortTree.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import * as sort from 'sortabular';\n\nconst deepSorting = (sortConfig, rows = []) =>\n sort.sorter(sortConfig)(\n rows.map(row =>\n row.children && row.children.length\n ? {\n ...row,\n children: deepSorting(sortConfig, row.children),\n }\n : row,\n ),\n );\nfunction sortTree(sortConfig) {\n return rows => deepSorting(sortConfig, rows);\n}\n\nexport { sortTree };\nexport default sortTree;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEA,MAAM,cAAc,CAAC,YAAY,OAAO,OACtC,KAAK,OAAO,YACV,KAAK,IAAI,SACP,IAAI,YAAY,IAAI,SAAS,SACzB;AAAA,KACK;AAAA,EACH,UAAU,YAAY,YAAY,IAAI;AAAA,IAExC;AAGV,kBAAkB,YAAY;AAC5B,SAAO,UAAQ,YAAY,YAAY;AAAA;AAIzC,IAAO,mBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|