@elliemae/ds-datagrids 2.2.1 → 2.3.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DSDataGrid.js +395 -635
- package/cjs/DSDataGrid.js.map +7 -0
- package/cjs/DataGridImpl.js +103 -128
- package/cjs/DataGridImpl.js.map +7 -0
- package/cjs/PaginatedDataGrid.js +68 -68
- package/cjs/PaginatedDataGrid.js.map +7 -0
- package/cjs/blockNames.js +39 -11
- package/cjs/blockNames.js.map +7 -0
- package/cjs/columns/IconColumn.js +78 -62
- package/cjs/columns/IconColumn.js.map +7 -0
- package/cjs/columns/NumberColumn.js +35 -5
- package/cjs/columns/NumberColumn.js.map +7 -0
- package/cjs/components/BodyCell.js +83 -80
- package/cjs/components/BodyCell.js.map +7 -0
- package/cjs/components/BodyList.js +52 -52
- package/cjs/components/BodyList.js.map +7 -0
- package/cjs/components/ColumnVisibilityMenuOption.js +53 -31
- package/cjs/components/ColumnVisibilityMenuOption.js.map +7 -0
- package/cjs/components/ColumnsOptionsMenuSection.js +59 -44
- package/cjs/components/ColumnsOptionsMenuSection.js.map +7 -0
- package/cjs/components/EmptyState.js +81 -50
- package/cjs/components/EmptyState.js.map +7 -0
- package/cjs/components/HeaderCell.js +64 -58
- package/cjs/components/HeaderCell.js.map +7 -0
- package/cjs/components/List.js +41 -29
- package/cjs/components/List.js.map +7 -0
- package/cjs/components/ListItem.js +43 -36
- package/cjs/components/ListItem.js.map +7 -0
- package/cjs/components/NoResults.js +55 -51
- package/cjs/components/NoResults.js.map +7 -0
- package/cjs/components/RowsLoader.js +42 -22
- package/cjs/components/RowsLoader.js.map +7 -0
- package/cjs/components/Table.js +78 -87
- package/cjs/components/Table.js.map +7 -0
- package/cjs/components/TableBody.js +61 -60
- package/cjs/components/TableBody.js.map +7 -0
- package/cjs/components/TableHeader.js +47 -30
- package/cjs/components/TableHeader.js.map +7 -0
- package/cjs/components/footer/addOptionalFooterComponents.js +53 -43
- package/cjs/components/footer/addOptionalFooterComponents.js.map +7 -0
- package/cjs/components/header/PrimaryControls.js +49 -35
- package/cjs/components/header/PrimaryControls.js.map +7 -0
- package/cjs/components/header/addOptionalHeaderComponents.js +54 -43
- package/cjs/components/header/addOptionalHeaderComponents.js.map +7 -0
- package/cjs/components/index.js +43 -17
- package/cjs/components/index.js.map +7 -0
- package/cjs/components/renderers/defaultClassedRenderers.js +64 -57
- package/cjs/components/renderers/defaultClassedRenderers.js.map +7 -0
- package/cjs/components/renderers/index.js +44 -17
- package/cjs/components/renderers/index.js.map +7 -0
- package/cjs/components/renderers/renderRowsLoader.js +39 -18
- package/cjs/components/renderers/renderRowsLoader.js.map +7 -0
- package/cjs/components/tableContext.js +36 -13
- package/cjs/components/tableContext.js.map +7 -0
- package/cjs/defaultPlugins.js +44 -12
- package/cjs/defaultPlugins.js.map +7 -0
- package/cjs/index.js +72 -67
- package/cjs/index.js.map +7 -0
- package/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +102 -114
- package/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +7 -0
- package/cjs/plugins/body-header-scroll-sync/index.js +35 -9
- package/cjs/plugins/body-header-scroll-sync/index.js.map +7 -0
- package/cjs/plugins/column-dnd/DndColumnsPlugin.js +107 -86
- package/cjs/plugins/column-dnd/DndColumnsPlugin.js.map +7 -0
- package/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +43 -27
- package/cjs/plugins/column-dnd/decorateGridWithDndColumns.js.map +7 -0
- package/cjs/plugins/column-dnd/index.js +35 -9
- package/cjs/plugins/column-dnd/index.js.map +7 -0
- package/cjs/plugins/column-sizing/ColumnSizingPlugin.js +59 -55
- package/cjs/plugins/column-sizing/ColumnSizingPlugin.js.map +7 -0
- package/cjs/plugins/column-sizing/columnMeasurerTransformer.js +48 -53
- package/cjs/plugins/column-sizing/columnMeasurerTransformer.js.map +7 -0
- package/cjs/plugins/column-sizing/ext-points/decorateColumn.js +40 -13
- package/cjs/plugins/column-sizing/ext-points/decorateColumn.js.map +7 -0
- package/cjs/plugins/column-sizing/ext-points/getTableProps.js +55 -54
- package/cjs/plugins/column-sizing/ext-points/getTableProps.js.map +7 -0
- package/cjs/plugins/column-sizing/getColumnNameFromProperty.js +37 -9
- package/cjs/plugins/column-sizing/getColumnNameFromProperty.js.map +7 -0
- package/cjs/plugins/column-sizing/index.js +35 -9
- package/cjs/plugins/column-sizing/index.js.map +7 -0
- package/cjs/plugins/column-sizing/useColumnSizeService.js +72 -86
- package/cjs/plugins/column-sizing/useColumnSizeService.js.map +7 -0
- package/cjs/plugins/column-sizing/useStylesheetHelpers.js +96 -199
- package/cjs/plugins/column-sizing/useStylesheetHelpers.js.map +7 -0
- package/cjs/plugins/column-sizing/utils.js +52 -29
- package/cjs/plugins/column-sizing/utils.js.map +7 -0
- package/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js +38 -16
- package/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +7 -0
- package/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +61 -56
- package/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +7 -0
- package/cjs/plugins/custom-cell-renderer/getRendererComponent.js +58 -60
- package/cjs/plugins/custom-cell-renderer/getRendererComponent.js.map +7 -0
- package/cjs/plugins/custom-cell-renderer/index.js +35 -9
- package/cjs/plugins/custom-cell-renderer/index.js.map +7 -0
- package/cjs/plugins/editable/EditableComponents/ComboBox.js +50 -53
- package/cjs/plugins/editable/EditableComponents/ComboBox.js.map +7 -0
- package/cjs/plugins/editable/EditableComponents/TextBox.js +56 -76
- package/cjs/plugins/editable/EditableComponents/TextBox.js.map +7 -0
- package/cjs/plugins/editable/EditableComponents/index.js +37 -11
- package/cjs/plugins/editable/EditableComponents/index.js.map +7 -0
- package/cjs/plugins/editable/EditablePlugin.js +60 -75
- package/cjs/plugins/editable/EditablePlugin.js.map +7 -0
- package/cjs/plugins/editable/decorateEditable.js +61 -98
- package/cjs/plugins/editable/decorateEditable.js.map +7 -0
- package/cjs/plugins/editable/getEditorComponent.js +70 -76
- package/cjs/plugins/editable/getEditorComponent.js.map +7 -0
- package/cjs/plugins/editable/index.js +38 -13
- package/cjs/plugins/editable/index.js.map +7 -0
- package/cjs/plugins/expandable-grid/ExpandableColumn.js +112 -144
- package/cjs/plugins/expandable-grid/ExpandableColumn.js.map +7 -0
- package/cjs/plugins/expandable-grid/ExpandablePlugin.js +118 -180
- package/cjs/plugins/expandable-grid/ExpandablePlugin.js.map +7 -0
- package/cjs/plugins/expandable-grid/ExpandedRow.js +117 -139
- package/cjs/plugins/expandable-grid/ExpandedRow.js.map +7 -0
- package/cjs/plugins/expandable-grid/ExpandedRowExtra.js +54 -52
- package/cjs/plugins/expandable-grid/ExpandedRowExtra.js.map +7 -0
- package/cjs/plugins/expandable-grid/index.js +37 -11
- package/cjs/plugins/expandable-grid/index.js.map +7 -0
- package/cjs/plugins/expandable-grid/useExpandGridState.js +45 -31
- package/cjs/plugins/expandable-grid/useExpandGridState.js.map +7 -0
- package/cjs/plugins/export-data/ExportDataPlugin.js +82 -116
- package/cjs/plugins/export-data/ExportDataPlugin.js.map +7 -0
- package/cjs/plugins/export-data/index.js +35 -12
- package/cjs/plugins/export-data/index.js.map +7 -0
- package/cjs/plugins/filterable/FilterablePlugin.js +54 -55
- package/cjs/plugins/filterable/FilterablePlugin.js.map +7 -0
- package/cjs/plugins/filterable/addFilterToColumn.js +40 -28
- package/cjs/plugins/filterable/addFilterToColumn.js.map +7 -0
- package/cjs/plugins/filterable/components/FilterableHeader.js +119 -107
- package/cjs/plugins/filterable/components/FilterableHeader.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +116 -116
- package/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +97 -73
- package/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +138 -132
- package/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +115 -119
- package/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js +35 -7
- package/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +46 -15
- package/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +7 -0
- package/cjs/plugins/filterable/filterableFormatter.js +61 -51
- package/cjs/plugins/filterable/filterableFormatter.js.map +7 -0
- package/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +60 -55
- package/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +7 -0
- package/cjs/plugins/filterable/filtering-helper/strategiesOperators.js +43 -22
- package/cjs/plugins/filterable/filtering-helper/strategiesOperators.js.map +7 -0
- package/cjs/plugins/filterable/helper.js +68 -79
- package/cjs/plugins/filterable/helper.js.map +7 -0
- package/cjs/plugins/filterable/index.js +35 -9
- package/cjs/plugins/filterable/index.js.map +7 -0
- package/cjs/plugins/filterable/useFilterableState.js +62 -66
- package/cjs/plugins/filterable/useFilterableState.js.map +7 -0
- package/cjs/plugins/grouping-by/GroupingByPlugin.js +40 -23
- package/cjs/plugins/grouping-by/GroupingByPlugin.js.map +7 -0
- package/cjs/plugins/grouping-grid/GroupingPlugin.js +86 -109
- package/cjs/plugins/grouping-grid/GroupingPlugin.js.map +7 -0
- package/cjs/plugins/grouping-grid/walkStrategy.js +46 -26
- package/cjs/plugins/grouping-grid/walkStrategy.js.map +7 -0
- package/cjs/plugins/index.js +68 -48
- package/cjs/plugins/index.js.map +7 -0
- package/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +64 -88
- package/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +7 -0
- package/cjs/plugins/infinite-scrolling/index.js +35 -9
- package/cjs/plugins/infinite-scrolling/index.js.map +7 -0
- package/cjs/plugins/pagination/PaginationPlugin.js +73 -90
- package/cjs/plugins/pagination/PaginationPlugin.js.map +7 -0
- package/cjs/plugins/pagination/components/Pagination.js +54 -35
- package/cjs/plugins/pagination/components/Pagination.js.map +7 -0
- package/cjs/plugins/pagination/components/Paginator.js +59 -44
- package/cjs/plugins/pagination/components/Paginator.js.map +7 -0
- package/cjs/plugins/pagination/components/PerPageDropdown.js +51 -63
- package/cjs/plugins/pagination/components/PerPageDropdown.js.map +7 -0
- package/cjs/plugins/pagination/helper.js +45 -24
- package/cjs/plugins/pagination/helper.js.map +7 -0
- package/cjs/plugins/pagination/index.js +35 -9
- package/cjs/plugins/pagination/index.js.map +7 -0
- package/cjs/plugins/pagination/usePaginationState.js +46 -38
- package/cjs/plugins/pagination/usePaginationState.js.map +7 -0
- package/cjs/plugins/resizable/ResizablePlugin.js +51 -55
- package/cjs/plugins/resizable/ResizablePlugin.js.map +7 -0
- package/cjs/plugins/resizable/decorateResizable.js +49 -53
- package/cjs/plugins/resizable/decorateResizable.js.map +7 -0
- package/cjs/plugins/resizable/index.js +35 -9
- package/cjs/plugins/resizable/index.js.map +7 -0
- package/cjs/plugins/resizable/useResizeHandle.js +56 -50
- package/cjs/plugins/resizable/useResizeHandle.js.map +7 -0
- package/cjs/plugins/resizable/utils.js +49 -28
- package/cjs/plugins/resizable/utils.js.map +7 -0
- package/cjs/plugins/row-dnd/DndRowsPlugin.js +103 -82
- package/cjs/plugins/row-dnd/DndRowsPlugin.js.map +7 -0
- package/cjs/plugins/row-dnd/index.js +35 -9
- package/cjs/plugins/row-dnd/index.js.map +7 -0
- package/cjs/plugins/selectable/SelectablePlugin.js +101 -134
- package/cjs/plugins/selectable/SelectablePlugin.js.map +7 -0
- package/cjs/plugins/selectable/addSelectableColumn.js +67 -68
- package/cjs/plugins/selectable/addSelectableColumn.js.map +7 -0
- package/cjs/plugins/selectable/helper.js +50 -39
- package/cjs/plugins/selectable/helper.js.map +7 -0
- package/cjs/plugins/selectable/index.js +35 -9
- package/cjs/plugins/selectable/index.js.map +7 -0
- package/cjs/plugins/selectable/selectableFormatter.js +83 -105
- package/cjs/plugins/selectable/selectableFormatter.js.map +7 -0
- package/cjs/plugins/selectable/useSelectableState.js +67 -94
- package/cjs/plugins/selectable/useSelectableState.js.map +7 -0
- package/cjs/plugins/sortable/SortablePlugin.js +62 -76
- package/cjs/plugins/sortable/SortablePlugin.js.map +7 -0
- package/cjs/plugins/sortable/checkIfSortable.js +37 -14
- package/cjs/plugins/sortable/checkIfSortable.js.map +7 -0
- package/cjs/plugins/sortable/index.js +35 -9
- package/cjs/plugins/sortable/index.js.map +7 -0
- package/cjs/plugins/sortable/sortHeaderFormatter.js +56 -50
- package/cjs/plugins/sortable/sortHeaderFormatter.js.map +7 -0
- package/cjs/plugins/sortable/sortTree.js +40 -47
- package/cjs/plugins/sortable/sortTree.js.map +7 -0
- package/cjs/plugins/sortable/sorter.js +140 -172
- package/cjs/plugins/sortable/sorter.js.map +7 -0
- package/cjs/plugins/sortable/useSortableState.js +53 -79
- package/cjs/plugins/sortable/useSortableState.js.map +7 -0
- package/cjs/plugins/toolbar/RowRenderer.js +75 -76
- package/cjs/plugins/toolbar/RowRenderer.js.map +7 -0
- package/cjs/plugins/toolbar/ToolbarPlugin.js +49 -33
- package/cjs/plugins/toolbar/ToolbarPlugin.js.map +7 -0
- package/cjs/plugins/toolbar/ToolbarTrigger.js +89 -70
- package/cjs/plugins/toolbar/ToolbarTrigger.js.map +7 -0
- package/cjs/plugins/toolbar/index.js +35 -9
- package/cjs/plugins/toolbar/index.js.map +7 -0
- package/cjs/plugins/virtualization/AutoHeightList.js +64 -52
- package/cjs/plugins/virtualization/AutoHeightList.js.map +7 -0
- package/cjs/plugins/virtualization/VirtualizationPlugin.js +86 -97
- package/cjs/plugins/virtualization/VirtualizationPlugin.js.map +7 -0
- package/cjs/plugins/virtualization/VirtualizedBody.js +139 -155
- package/cjs/plugins/virtualization/VirtualizedBody.js.map +7 -0
- package/cjs/plugins/virtualization/VirtualizedBodyRow.js +39 -17
- package/cjs/plugins/virtualization/VirtualizedBodyRow.js.map +7 -0
- package/cjs/plugins/virtualization/helper.js +35 -7
- package/cjs/plugins/virtualization/helper.js.map +7 -0
- package/cjs/plugins/virtualization/index.js +35 -9
- package/cjs/plugins/virtualization/index.js.map +7 -0
- package/cjs/renders/CellWithAddons.js +98 -50
- package/cjs/renders/CellWithAddons.js.map +7 -0
- package/cjs/renders/index.js +37 -11
- package/cjs/renders/index.js.map +7 -0
- package/cjs/renders/styled.js +78 -27
- package/cjs/renders/styled.js.map +7 -0
- package/cjs/rowSizes.js +44 -12
- package/cjs/rowSizes.js.map +7 -0
- package/cjs/utilities/DataGridUtilities.json +1315 -0
- package/cjs/utilities/getPluginsFromProps.js +67 -39
- package/cjs/utilities/getPluginsFromProps.js.map +7 -0
- package/cjs/utilities/getScrollbarSize.js +44 -25
- package/cjs/utilities/getScrollbarSize.js.map +7 -0
- package/cjs/utilities/normalizeData.js +44 -34
- package/cjs/utilities/normalizeData.js.map +7 -0
- package/esm/DSDataGrid.js +337 -597
- package/esm/DSDataGrid.js.map +7 -0
- package/esm/DataGridImpl.js +68 -113
- package/esm/DataGridImpl.js.map +7 -0
- package/esm/PaginatedDataGrid.js +39 -59
- package/esm/PaginatedDataGrid.js.map +7 -0
- package/esm/blockNames.js +10 -5
- package/esm/blockNames.js.map +7 -0
- package/esm/columns/IconColumn.js +49 -54
- package/esm/columns/IconColumn.js.map +7 -0
- package/esm/columns/NumberColumn.js +6 -3
- package/esm/columns/NumberColumn.js.map +7 -0
- package/esm/components/BodyCell.js +51 -68
- package/esm/components/BodyCell.js.map +7 -0
- package/esm/components/BodyList.js +23 -43
- package/esm/components/BodyList.js.map +7 -0
- package/esm/components/ColumnVisibilityMenuOption.js +24 -27
- package/esm/components/ColumnVisibilityMenuOption.js.map +7 -0
- package/esm/components/ColumnsOptionsMenuSection.js +30 -38
- package/esm/components/ColumnsOptionsMenuSection.js.map +7 -0
- package/esm/components/EmptyState.js +52 -40
- package/esm/components/EmptyState.js.map +7 -0
- package/esm/components/HeaderCell.js +33 -48
- package/esm/components/HeaderCell.js.map +7 -0
- package/esm/components/List.js +12 -23
- package/esm/components/List.js.map +7 -0
- package/esm/components/ListItem.js +14 -30
- package/esm/components/ListItem.js.map +7 -0
- package/esm/components/NoResults.js +26 -43
- package/esm/components/NoResults.js.map +7 -0
- package/esm/components/RowsLoader.js +13 -15
- package/esm/components/RowsLoader.js.map +7 -0
- package/esm/components/Table.js +45 -76
- package/esm/components/Table.js.map +7 -0
- package/esm/components/TableBody.js +32 -52
- package/esm/components/TableBody.js.map +7 -0
- package/esm/components/TableHeader.js +17 -23
- package/esm/components/TableHeader.js.map +7 -0
- package/esm/components/footer/addOptionalFooterComponents.js +24 -37
- package/esm/components/footer/addOptionalFooterComponents.js.map +7 -0
- package/esm/components/header/PrimaryControls.js +20 -29
- package/esm/components/header/PrimaryControls.js.map +7 -0
- package/esm/components/header/addOptionalHeaderComponents.js +25 -36
- package/esm/components/header/addOptionalHeaderComponents.js.map +7 -0
- package/esm/components/index.js +14 -5
- package/esm/components/index.js.map +7 -0
- package/esm/components/renderers/defaultClassedRenderers.js +41 -46
- package/esm/components/renderers/defaultClassedRenderers.js.map +7 -0
- package/esm/components/renderers/index.js +16 -5
- package/esm/components/renderers/index.js.map +7 -0
- package/esm/components/renderers/renderRowsLoader.js +10 -10
- package/esm/components/renderers/renderRowsLoader.js.map +7 -0
- package/esm/components/tableContext.js +7 -5
- package/esm/components/tableContext.js.map +7 -0
- package/esm/defaultPlugins.js +15 -8
- package/esm/defaultPlugins.js.map +7 -0
- package/esm/index.js +63 -27
- package/esm/index.js.map +7 -0
- package/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +71 -101
- package/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +7 -0
- package/esm/plugins/body-header-scroll-sync/index.js +6 -1
- package/esm/plugins/body-header-scroll-sync/index.js.map +7 -0
- package/esm/plugins/column-dnd/DndColumnsPlugin.js +69 -68
- package/esm/plugins/column-dnd/DndColumnsPlugin.js.map +7 -0
- package/esm/plugins/column-dnd/decorateGridWithDndColumns.js +16 -18
- package/esm/plugins/column-dnd/decorateGridWithDndColumns.js.map +7 -0
- package/esm/plugins/column-dnd/index.js +6 -1
- package/esm/plugins/column-dnd/index.js.map +7 -0
- package/esm/plugins/column-sizing/ColumnSizingPlugin.js +20 -37
- package/esm/plugins/column-sizing/ColumnSizingPlugin.js.map +7 -0
- package/esm/plugins/column-sizing/columnMeasurerTransformer.js +16 -42
- package/esm/plugins/column-sizing/columnMeasurerTransformer.js.map +7 -0
- package/esm/plugins/column-sizing/ext-points/decorateColumn.js +9 -7
- package/esm/plugins/column-sizing/ext-points/decorateColumn.js.map +7 -0
- package/esm/plugins/column-sizing/ext-points/getTableProps.js +23 -43
- package/esm/plugins/column-sizing/ext-points/getTableProps.js.map +7 -0
- package/esm/plugins/column-sizing/getColumnNameFromProperty.js +8 -7
- package/esm/plugins/column-sizing/getColumnNameFromProperty.js.map +7 -0
- package/esm/plugins/column-sizing/index.js +6 -1
- package/esm/plugins/column-sizing/index.js.map +7 -0
- package/esm/plugins/column-sizing/useColumnSizeService.js +34 -71
- package/esm/plugins/column-sizing/useColumnSizeService.js.map +7 -0
- package/esm/plugins/column-sizing/useStylesheetHelpers.js +64 -171
- package/esm/plugins/column-sizing/useStylesheetHelpers.js.map +7 -0
- package/esm/plugins/column-sizing/utils.js +23 -21
- package/esm/plugins/column-sizing/utils.js.map +7 -0
- package/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js +8 -7
- package/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +7 -0
- package/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +28 -43
- package/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +7 -0
- package/esm/plugins/custom-cell-renderer/getRendererComponent.js +22 -44
- package/esm/plugins/custom-cell-renderer/getRendererComponent.js.map +7 -0
- package/esm/plugins/custom-cell-renderer/index.js +6 -1
- package/esm/plugins/custom-cell-renderer/index.js.map +7 -0
- package/esm/plugins/editable/EditableComponents/ComboBox.js +20 -46
- package/esm/plugins/editable/EditableComponents/ComboBox.js.map +7 -0
- package/esm/plugins/editable/EditableComponents/TextBox.js +26 -68
- package/esm/plugins/editable/EditableComponents/TextBox.js.map +7 -0
- package/esm/plugins/editable/EditableComponents/index.js +8 -2
- package/esm/plugins/editable/EditableComponents/index.js.map +7 -0
- package/esm/plugins/editable/EditablePlugin.js +27 -63
- package/esm/plugins/editable/EditablePlugin.js.map +7 -0
- package/esm/plugins/editable/decorateEditable.js +32 -68
- package/esm/plugins/editable/decorateEditable.js.map +7 -0
- package/esm/plugins/editable/getEditorComponent.js +39 -66
- package/esm/plugins/editable/getEditorComponent.js.map +7 -0
- package/esm/plugins/editable/index.js +9 -3
- package/esm/plugins/editable/index.js.map +7 -0
- package/esm/plugins/expandable-grid/ExpandableColumn.js +82 -133
- package/esm/plugins/expandable-grid/ExpandableColumn.js.map +7 -0
- package/esm/plugins/expandable-grid/ExpandablePlugin.js +81 -160
- package/esm/plugins/expandable-grid/ExpandablePlugin.js.map +7 -0
- package/esm/plugins/expandable-grid/ExpandedRow.js +86 -124
- package/esm/plugins/expandable-grid/ExpandedRow.js.map +7 -0
- package/esm/plugins/expandable-grid/ExpandedRowExtra.js +25 -44
- package/esm/plugins/expandable-grid/ExpandedRowExtra.js.map +7 -0
- package/esm/plugins/expandable-grid/index.js +8 -2
- package/esm/plugins/expandable-grid/index.js.map +7 -0
- package/esm/plugins/expandable-grid/useExpandGridState.js +14 -25
- package/esm/plugins/expandable-grid/useExpandGridState.js.map +7 -0
- package/esm/plugins/export-data/ExportDataPlugin.js +52 -103
- package/esm/plugins/export-data/ExportDataPlugin.js.map +7 -0
- package/esm/plugins/export-data/index.js +6 -1
- package/esm/plugins/export-data/index.js.map +7 -0
- package/esm/plugins/filterable/FilterablePlugin.js +22 -44
- package/esm/plugins/filterable/FilterablePlugin.js.map +7 -0
- package/esm/plugins/filterable/addFilterToColumn.js +11 -20
- package/esm/plugins/filterable/addFilterToColumn.js.map +7 -0
- package/esm/plugins/filterable/components/FilterableHeader.js +85 -95
- package/esm/plugins/filterable/components/FilterableHeader.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +83 -103
- package/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +68 -63
- package/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +108 -116
- package/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js +84 -106
- package/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/defaultDateFormat.js +6 -3
- package/esm/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +16 -12
- package/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +7 -0
- package/esm/plugins/filterable/filterableFormatter.js +32 -45
- package/esm/plugins/filterable/filterableFormatter.js.map +7 -0
- package/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js +29 -44
- package/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +7 -0
- package/esm/plugins/filterable/filtering-helper/strategiesOperators.js +11 -13
- package/esm/plugins/filterable/filtering-helper/strategiesOperators.js.map +7 -0
- package/esm/plugins/filterable/helper.js +42 -62
- package/esm/plugins/filterable/helper.js.map +7 -0
- package/esm/plugins/filterable/index.js +6 -1
- package/esm/plugins/filterable/index.js.map +7 -0
- package/esm/plugins/filterable/useFilterableState.js +33 -54
- package/esm/plugins/filterable/useFilterableState.js.map +7 -0
- package/esm/plugins/grouping-by/GroupingByPlugin.js +10 -14
- package/esm/plugins/grouping-by/GroupingByPlugin.js.map +7 -0
- package/esm/plugins/grouping-grid/GroupingPlugin.js +53 -94
- package/esm/plugins/grouping-grid/GroupingPlugin.js.map +7 -0
- package/esm/plugins/grouping-grid/walkStrategy.js +17 -22
- package/esm/plugins/grouping-grid/walkStrategy.js.map +7 -0
- package/esm/plugins/index.js +39 -19
- package/esm/plugins/index.js.map +7 -0
- package/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js +31 -74
- package/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +7 -0
- package/esm/plugins/infinite-scrolling/index.js +6 -1
- package/esm/plugins/infinite-scrolling/index.js.map +7 -0
- package/esm/plugins/pagination/PaginationPlugin.js +42 -75
- package/esm/plugins/pagination/PaginationPlugin.js.map +7 -0
- package/esm/plugins/pagination/components/Pagination.js +25 -27
- package/esm/plugins/pagination/components/Pagination.js.map +7 -0
- package/esm/plugins/pagination/components/Paginator.js +29 -35
- package/esm/plugins/pagination/components/Paginator.js.map +7 -0
- package/esm/plugins/pagination/components/PerPageDropdown.js +22 -54
- package/esm/plugins/pagination/components/PerPageDropdown.js.map +7 -0
- package/esm/plugins/pagination/helper.js +16 -19
- package/esm/plugins/pagination/helper.js.map +7 -0
- package/esm/plugins/pagination/index.js +6 -1
- package/esm/plugins/pagination/index.js.map +7 -0
- package/esm/plugins/pagination/usePaginationState.js +15 -28
- package/esm/plugins/pagination/usePaginationState.js.map +7 -0
- package/esm/plugins/resizable/ResizablePlugin.js +20 -45
- package/esm/plugins/resizable/ResizablePlugin.js.map +7 -0
- package/esm/plugins/resizable/decorateResizable.js +19 -41
- package/esm/plugins/resizable/decorateResizable.js.map +7 -0
- package/esm/plugins/resizable/index.js +6 -1
- package/esm/plugins/resizable/index.js.map +7 -0
- package/esm/plugins/resizable/useResizeHandle.js +24 -39
- package/esm/plugins/resizable/useResizeHandle.js.map +7 -0
- package/esm/plugins/resizable/utils.js +20 -18
- package/esm/plugins/resizable/utils.js.map +7 -0
- package/esm/plugins/row-dnd/DndRowsPlugin.js +73 -71
- package/esm/plugins/row-dnd/DndRowsPlugin.js.map +7 -0
- package/esm/plugins/row-dnd/index.js +6 -1
- package/esm/plugins/row-dnd/index.js.map +7 -0
- package/esm/plugins/selectable/SelectablePlugin.js +64 -117
- package/esm/plugins/selectable/SelectablePlugin.js.map +7 -0
- package/esm/plugins/selectable/addSelectableColumn.js +39 -57
- package/esm/plugins/selectable/addSelectableColumn.js.map +7 -0
- package/esm/plugins/selectable/helper.js +19 -25
- package/esm/plugins/selectable/helper.js.map +7 -0
- package/esm/plugins/selectable/index.js +6 -1
- package/esm/plugins/selectable/index.js.map +7 -0
- package/esm/plugins/selectable/selectableFormatter.js +54 -97
- package/esm/plugins/selectable/selectableFormatter.js.map +7 -0
- package/esm/plugins/selectable/useSelectableState.js +34 -78
- package/esm/plugins/selectable/useSelectableState.js.map +7 -0
- package/esm/plugins/sortable/SortablePlugin.js +30 -43
- package/esm/plugins/sortable/SortablePlugin.js.map +7 -0
- package/esm/plugins/sortable/checkIfSortable.js +8 -9
- package/esm/plugins/sortable/checkIfSortable.js.map +7 -0
- package/esm/plugins/sortable/index.js +6 -1
- package/esm/plugins/sortable/index.js.map +7 -0
- package/esm/plugins/sortable/sortHeaderFormatter.js +27 -43
- package/esm/plugins/sortable/sortHeaderFormatter.js.map +7 -0
- package/esm/plugins/sortable/sortTree.js +13 -24
- package/esm/plugins/sortable/sortTree.js.map +7 -0
- package/esm/plugins/sortable/sorter.js +112 -163
- package/esm/plugins/sortable/sorter.js.map +7 -0
- package/esm/plugins/sortable/useSortableState.js +22 -49
- package/esm/plugins/sortable/useSortableState.js.map +7 -0
- package/esm/plugins/toolbar/RowRenderer.js +40 -61
- package/esm/plugins/toolbar/RowRenderer.js.map +7 -0
- package/esm/plugins/toolbar/ToolbarPlugin.js +19 -23
- package/esm/plugins/toolbar/ToolbarPlugin.js.map +7 -0
- package/esm/plugins/toolbar/ToolbarTrigger.js +59 -57
- package/esm/plugins/toolbar/ToolbarTrigger.js.map +7 -0
- package/esm/plugins/toolbar/index.js +6 -1
- package/esm/plugins/toolbar/index.js.map +7 -0
- package/esm/plugins/virtualization/AutoHeightList.js +30 -40
- package/esm/plugins/virtualization/AutoHeightList.js.map +7 -0
- package/esm/plugins/virtualization/VirtualizationPlugin.js +55 -84
- package/esm/plugins/virtualization/VirtualizationPlugin.js.map +7 -0
- package/esm/plugins/virtualization/VirtualizedBody.js +94 -132
- package/esm/plugins/virtualization/VirtualizedBody.js.map +7 -0
- package/esm/plugins/virtualization/VirtualizedBodyRow.js +10 -15
- package/esm/plugins/virtualization/VirtualizedBodyRow.js.map +7 -0
- package/esm/plugins/virtualization/helper.js +6 -3
- package/esm/plugins/virtualization/helper.js.map +7 -0
- package/esm/plugins/virtualization/index.js +6 -1
- package/esm/plugins/virtualization/index.js.map +7 -0
- package/esm/renders/CellWithAddons.js +69 -40
- package/esm/renders/CellWithAddons.js.map +7 -0
- package/esm/renders/index.js +8 -2
- package/esm/renders/index.js.map +7 -0
- package/esm/renders/styled.js +49 -16
- package/esm/renders/styled.js.map +7 -0
- package/esm/rowSizes.js +15 -6
- package/esm/rowSizes.js.map +7 -0
- package/esm/utilities/DataGridUtilities.json +1315 -0
- package/esm/utilities/getPluginsFromProps.js +25 -24
- package/esm/utilities/getPluginsFromProps.js.map +7 -0
- package/esm/utilities/getScrollbarSize.js +15 -21
- package/esm/utilities/getScrollbarSize.js.map +7 -0
- package/esm/utilities/normalizeData.js +15 -24
- package/esm/utilities/normalizeData.js.map +7 -0
- package/package.json +20 -20
- package/types/DSDataGrid.d.ts +1 -1
- package/types/DataGridImpl.d.ts +3 -2
- package/types/PaginatedDataGrid.d.ts +1 -2
- package/types/columns/IconColumn.d.ts +3 -2
- package/types/components/BodyCell.d.ts +13 -12
- package/types/components/ColumnVisibilityMenuOption.d.ts +2 -2
- package/types/components/ColumnsOptionsMenuSection.d.ts +1 -0
- package/types/components/HeaderCell.d.ts +10 -10
- package/types/components/NoResults.d.ts +2 -2
- package/types/components/RowsLoader.d.ts +2 -2
- package/types/components/Table.d.ts +6 -11
- package/types/components/TableBody.d.ts +3 -8
- package/types/components/TableHeader.d.ts +2 -1
- package/types/components/footer/addOptionalFooterComponents.d.ts +1 -0
- package/types/components/header/PrimaryControls.d.ts +1 -0
- package/types/components/header/addOptionalHeaderComponents.d.ts +1 -1
- package/types/components/renderers/index.d.ts +1 -1
- package/types/components/renderers/renderRowsLoader.d.ts +1 -1
- package/types/index.d.ts +7 -8
- package/types/plugins/body-header-scroll-sync/index.d.ts +1 -1
- package/types/plugins/column-dnd/index.d.ts +1 -1
- package/types/plugins/column-sizing/getColumnNameFromProperty.d.ts +2 -1
- package/types/plugins/column-sizing/index.d.ts +1 -1
- package/types/plugins/column-sizing/useColumnSizeService.d.ts +2 -1
- package/types/plugins/custom-cell-renderer/addCustomRendererToCell.d.ts +1 -0
- package/types/plugins/custom-cell-renderer/getRendererComponent.d.ts +1 -0
- package/types/plugins/custom-cell-renderer/index.d.ts +1 -1
- package/types/plugins/editable/EditableComponents/ComboBox.d.ts +3 -1
- package/types/plugins/editable/EditableComponents/TextBox.d.ts +3 -1
- package/types/plugins/editable/getEditorComponent.d.ts +1 -0
- package/types/plugins/editable/index.d.ts +2 -2
- package/types/plugins/expandable-grid/ExpandableColumn.d.ts +3 -2
- package/types/plugins/expandable-grid/ExpandedRow.d.ts +1 -0
- package/types/plugins/expandable-grid/ExpandedRowExtra.d.ts +1 -0
- package/types/plugins/expandable-grid/index.d.ts +2 -2
- package/types/plugins/export-data/index.d.ts +1 -1
- package/types/plugins/filterable/components/FilterableHeader.d.ts +15 -15
- package/types/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.d.ts +1 -0
- package/types/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.d.ts +1 -0
- package/types/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.d.ts +2 -1
- package/types/plugins/filterable/components/filterable-menus/TextFilterMenu.d.ts +1 -0
- package/types/plugins/filterable/components/filterable-menus/getFilterMenuByType.d.ts +2 -1
- package/types/plugins/filterable/filterableFormatter.d.ts +3 -2
- package/types/plugins/filterable/filtering-helper/filterRowsByQuery.d.ts +2 -1
- package/types/plugins/filterable/filtering-helper/strategiesOperators.d.ts +2 -2
- package/types/plugins/filterable/index.d.ts +1 -1
- package/types/plugins/index.d.ts +16 -16
- package/types/plugins/infinite-scrolling/index.d.ts +1 -1
- package/types/plugins/pagination/components/Paginator.d.ts +1 -0
- package/types/plugins/pagination/components/PerPageDropdown.d.ts +1 -0
- package/types/plugins/pagination/helper.d.ts +3 -2
- package/types/plugins/pagination/index.d.ts +1 -1
- package/types/plugins/resizable/index.d.ts +1 -1
- package/types/plugins/row-dnd/index.d.ts +1 -1
- package/types/plugins/selectable/index.d.ts +1 -1
- package/types/plugins/selectable/selectableFormatter.d.ts +1 -0
- package/types/plugins/sortable/index.d.ts +1 -1
- package/types/plugins/sortable/sortHeaderFormatter.d.ts +1 -0
- package/types/plugins/sortable/sortTree.d.ts +1 -0
- package/types/plugins/sortable/sorter.d.ts +1 -1
- package/types/plugins/toolbar/index.d.ts +1 -1
- package/types/plugins/virtualization/AutoHeightList.d.ts +1 -1
- package/types/plugins/virtualization/VirtualizedBody.d.ts +1 -0
- package/types/plugins/virtualization/VirtualizedBodyRow.d.ts +2 -2
- package/types/plugins/virtualization/index.d.ts +1 -1
- package/types/utilities/getPluginsFromProps.d.ts +2 -1
|
@@ -1,80 +1,55 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import createInstancePlugin from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';
|
|
6
|
-
import { addResizableToColumn, resizableFormatter } from './decorateResizable.js';
|
|
7
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { runAll } from "@elliemae/ds-utilities";
|
|
3
|
+
import { createInstancePlugin } from "@elliemae/ds-shared/createDataInstance/createInstancePlugin";
|
|
4
|
+
import { addResizableToColumn, resizableFormatter } from "./decorateResizable";
|
|
8
5
|
const noop = () => null;
|
|
9
|
-
|
|
10
|
-
const DELTA_LAST_COLUMN = 25; // eslint-disable-next-line no-unused-vars
|
|
11
|
-
|
|
6
|
+
const DELTA_LAST_COLUMN = 25;
|
|
12
7
|
const decorateColumn = (column, grid, index) => {
|
|
13
8
|
const {
|
|
14
9
|
onResizeEnd = noop,
|
|
15
10
|
onResizeStart = noop,
|
|
16
11
|
minColumnWidth = 90,
|
|
17
|
-
isColumnResizeActive = col => col.resizable && !col.expandableColumn,
|
|
12
|
+
isColumnResizeActive = (col) => col.resizable && !col.expandableColumn,
|
|
18
13
|
onColumnResize
|
|
19
14
|
} = grid.props;
|
|
20
|
-
const {
|
|
21
|
-
|
|
22
|
-
} = grid.getInstance(); // need to do this because the decorated columns which the index in the function call
|
|
23
|
-
// could be different from the final decorated columns because a plugin could add a
|
|
24
|
-
// column afterwards
|
|
25
|
-
|
|
26
|
-
const colIndex = decoratedColumns.findIndex(col => col.property === column.property);
|
|
15
|
+
const { decoratedColumns } = grid.getInstance();
|
|
16
|
+
const colIndex = decoratedColumns.findIndex((col) => col.property === column.property);
|
|
27
17
|
const isLast = colIndex === decoratedColumns.length - 1;
|
|
28
|
-
if (!isColumnResizeActive(column))
|
|
18
|
+
if (!isColumnResizeActive(column))
|
|
19
|
+
return column;
|
|
29
20
|
return addResizableToColumn(column, resizableFormatter({
|
|
30
21
|
onDragStart: () => {
|
|
31
22
|
grid.isDragging.current = true;
|
|
32
23
|
grid.disableEvents();
|
|
33
24
|
onResizeStart();
|
|
34
|
-
onColumnResize(
|
|
35
|
-
column
|
|
36
|
-
});
|
|
25
|
+
onColumnResize("onResizeStart", { column });
|
|
37
26
|
},
|
|
38
27
|
onDrag: (width, increasing) => {
|
|
39
|
-
const {
|
|
40
|
-
resizedColumns,
|
|
41
|
-
refs
|
|
42
|
-
} = grid.getInstance();
|
|
43
|
-
|
|
28
|
+
const { resizedColumns, refs } = grid.getInstance();
|
|
44
29
|
if (isLast && increasing) {
|
|
45
30
|
const thisCol = resizedColumns.current[column.uuid] || 0;
|
|
46
31
|
width = Math.max(thisCol + DELTA_LAST_COLUMN, width);
|
|
47
32
|
}
|
|
48
|
-
|
|
49
33
|
column.updateBodyHeaderWidth(width, width);
|
|
50
34
|
grid.updateRowWidth();
|
|
51
|
-
|
|
52
35
|
if (isLast && increasing) {
|
|
53
|
-
// TODO: Move this to packages/ds-shared/src/ScrollSync/ScrollSync.js
|
|
54
|
-
// It isn't watching the scrollLeft so you have to move both at the same time
|
|
55
36
|
refs.header.current.scrollLeft += DELTA_LAST_COLUMN;
|
|
56
37
|
refs.body.current.scrollLeft += DELTA_LAST_COLUMN;
|
|
57
38
|
}
|
|
58
39
|
},
|
|
59
40
|
onDragEnd: (width, increasing, extraData) => {
|
|
60
|
-
const {
|
|
61
|
-
resizedColumns
|
|
62
|
-
} = grid.getInstance();
|
|
63
|
-
|
|
41
|
+
const { resizedColumns } = grid.getInstance();
|
|
64
42
|
if (isLast && increasing) {
|
|
65
43
|
const thisCol = resizedColumns.current[column.uuid] || 0;
|
|
66
44
|
width = Math.max(thisCol + DELTA_LAST_COLUMN, width);
|
|
67
45
|
}
|
|
68
|
-
|
|
69
46
|
resizedColumns.current[column.uuid] = width;
|
|
70
47
|
grid.isDragging.current = false;
|
|
71
48
|
grid.enableEvents();
|
|
72
|
-
|
|
73
49
|
try {
|
|
74
50
|
const total = grid.getInstance().refs.body.current.scrollWidth;
|
|
75
51
|
const sum = Object.keys(grid.resizedColumns.current).reduce((p, n) => grid.resizedColumns.current[n] + p, 0);
|
|
76
52
|
const lastKey = grid.decoratedColumns[grid.columns.length - 1].uuid;
|
|
77
|
-
|
|
78
53
|
if (sum < total) {
|
|
79
54
|
const lastCol = grid.getInstance().columnSizeService.columns[lastKey];
|
|
80
55
|
lastCol.updateWidth(grid.resizedColumns.current[lastKey] + total - sum);
|
|
@@ -82,10 +57,9 @@ const decorateColumn = (column, grid, index) => {
|
|
|
82
57
|
grid.getInstance().columnSizeService.updateMissingWidths(total);
|
|
83
58
|
}
|
|
84
59
|
} catch (error) {
|
|
85
|
-
console.error(
|
|
60
|
+
console.error("Unexpected error in the addResizableToColumn trying to use the remaining grid space to the last column", error);
|
|
86
61
|
}
|
|
87
|
-
|
|
88
|
-
onColumnResize('onResizeEnd', {
|
|
62
|
+
onColumnResize("onResizeEnd", {
|
|
89
63
|
column,
|
|
90
64
|
width,
|
|
91
65
|
extraData
|
|
@@ -97,9 +71,10 @@ const decorateColumn = (column, grid, index) => {
|
|
|
97
71
|
isLast
|
|
98
72
|
}));
|
|
99
73
|
};
|
|
100
|
-
|
|
101
|
-
const ResizablePlugin = createInstancePlugin('resizable', {
|
|
74
|
+
const ResizablePlugin = createInstancePlugin("resizable", {
|
|
102
75
|
decorateColumn
|
|
103
76
|
});
|
|
104
|
-
|
|
105
|
-
|
|
77
|
+
export {
|
|
78
|
+
ResizablePlugin
|
|
79
|
+
};
|
|
80
|
+
//# sourceMappingURL=ResizablePlugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/ResizablePlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-param-reassign */\n/* eslint-disable max-statements */\nimport { runAll } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';\nimport { addResizableToColumn, resizableFormatter } from './decorateResizable';\n\nconst noop = () => null;\n\nconst DELTA_LAST_COLUMN = 25;\n\n// eslint-disable-next-line no-unused-vars\nconst decorateColumn = (column, grid, index) => {\n const {\n onResizeEnd = noop,\n onResizeStart = noop,\n minColumnWidth = 90,\n isColumnResizeActive = (col) => col.resizable && !col.expandableColumn,\n onColumnResize,\n } = grid.props;\n\n const { decoratedColumns } = grid.getInstance();\n // need to do this because the decorated columns which the index in the function call\n // could be different from the final decorated columns because a plugin could add a\n // column afterwards\n const colIndex = decoratedColumns.findIndex((col) => col.property === column.property);\n const isLast = colIndex === decoratedColumns.length - 1;\n\n if (!isColumnResizeActive(column)) return column;\n return addResizableToColumn(\n column,\n resizableFormatter({\n onDragStart: () => {\n grid.isDragging.current = true;\n grid.disableEvents();\n onResizeStart();\n onColumnResize('onResizeStart', { column });\n },\n onDrag: (width, increasing) => {\n const { resizedColumns, refs } = grid.getInstance();\n if (isLast && increasing) {\n const thisCol = resizedColumns.current[column.uuid] || 0;\n width = Math.max(thisCol + DELTA_LAST_COLUMN, width);\n }\n column.updateBodyHeaderWidth(width, width);\n grid.updateRowWidth();\n if (isLast && increasing) {\n // TODO: Move this to packages/ds-shared/src/ScrollSync/ScrollSync.js\n // It isn't watching the scrollLeft so you have to move both at the same time\n refs.header.current.scrollLeft += DELTA_LAST_COLUMN;\n refs.body.current.scrollLeft += DELTA_LAST_COLUMN;\n }\n },\n onDragEnd: (width, increasing, extraData) => {\n const { resizedColumns } = grid.getInstance();\n if (isLast && increasing) {\n const thisCol = resizedColumns.current[column.uuid] || 0;\n width = Math.max(thisCol + DELTA_LAST_COLUMN, width);\n }\n resizedColumns.current[column.uuid] = width;\n\n grid.isDragging.current = false;\n grid.enableEvents();\n try {\n const total = grid.getInstance().refs.body.current.scrollWidth;\n const sum = Object.keys(grid.resizedColumns.current).reduce((p, n) => grid.resizedColumns.current[n] + p, 0);\n const lastKey = grid.decoratedColumns[grid.columns.length - 1].uuid;\n if (sum < total) {\n const lastCol = grid.getInstance().columnSizeService.columns[lastKey];\n lastCol.updateWidth(grid.resizedColumns.current[lastKey] + total - sum);\n lastCol.updateBodyHeaderWidth(grid.resizedColumns.current[lastKey] + total - sum);\n grid.getInstance().columnSizeService.updateMissingWidths(total);\n }\n } catch (error) {\n console.error(\n 'Unexpected error in the addResizableToColumn trying to use the remaining grid space to the last column',\n error,\n );\n }\n\n onColumnResize('onResizeEnd', {\n column,\n width,\n extraData,\n });\n runAll(onResizeEnd)(width, extraData);\n grid.updateRowWidth();\n },\n minWidth: (column.minWidth || minColumnWidth) - (isLast ? DELTA_LAST_COLUMN : 0),\n isLast,\n }),\n );\n};\n\nexport const ResizablePlugin = createInstancePlugin('resizable', {\n decorateColumn,\n});\n"],
|
|
5
|
+
"mappings": "AAAA;ACEA;AACA;AACA;AAEA,MAAM,OAAO,MAAM;AAEnB,MAAM,oBAAoB;AAG1B,MAAM,iBAAiB,CAAC,QAAQ,MAAM,UAAU;AAC9C,QAAM;AAAA,IACJ,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,uBAAuB,CAAC,QAAQ,IAAI,aAAa,CAAC,IAAI;AAAA,IACtD;AAAA,MACE,KAAK;AAET,QAAM,EAAE,qBAAqB,KAAK;AAIlC,QAAM,WAAW,iBAAiB,UAAU,CAAC,QAAQ,IAAI,aAAa,OAAO;AAC7E,QAAM,SAAS,aAAa,iBAAiB,SAAS;AAEtD,MAAI,CAAC,qBAAqB;AAAS,WAAO;AAC1C,SAAO,qBACL,QACA,mBAAmB;AAAA,IACjB,aAAa,MAAM;AACjB,WAAK,WAAW,UAAU;AAC1B,WAAK;AACL;AACA,qBAAe,iBAAiB,EAAE;AAAA;AAAA,IAEpC,QAAQ,CAAC,OAAO,eAAe;AAC7B,YAAM,EAAE,gBAAgB,SAAS,KAAK;AACtC,UAAI,UAAU,YAAY;AACxB,cAAM,UAAU,eAAe,QAAQ,OAAO,SAAS;AACvD,gBAAQ,KAAK,IAAI,UAAU,mBAAmB;AAAA;AAEhD,aAAO,sBAAsB,OAAO;AACpC,WAAK;AACL,UAAI,UAAU,YAAY;AAGxB,aAAK,OAAO,QAAQ,cAAc;AAClC,aAAK,KAAK,QAAQ,cAAc;AAAA;AAAA;AAAA,IAGpC,WAAW,CAAC,OAAO,YAAY,cAAc;AAC3C,YAAM,EAAE,mBAAmB,KAAK;AAChC,UAAI,UAAU,YAAY;AACxB,cAAM,UAAU,eAAe,QAAQ,OAAO,SAAS;AACvD,gBAAQ,KAAK,IAAI,UAAU,mBAAmB;AAAA;AAEhD,qBAAe,QAAQ,OAAO,QAAQ;AAEtC,WAAK,WAAW,UAAU;AAC1B,WAAK;AACL,UAAI;AACF,cAAM,QAAQ,KAAK,cAAc,KAAK,KAAK,QAAQ;AACnD,cAAM,MAAM,OAAO,KAAK,KAAK,eAAe,SAAS,OAAO,CAAC,GAAG,MAAM,KAAK,eAAe,QAAQ,KAAK,GAAG;AAC1G,cAAM,UAAU,KAAK,iBAAiB,KAAK,QAAQ,SAAS,GAAG;AAC/D,YAAI,MAAM,OAAO;AACf,gBAAM,UAAU,KAAK,cAAc,kBAAkB,QAAQ;AAC7D,kBAAQ,YAAY,KAAK,eAAe,QAAQ,WAAW,QAAQ;AACnE,kBAAQ,sBAAsB,KAAK,eAAe,QAAQ,WAAW,QAAQ;AAC7E,eAAK,cAAc,kBAAkB,oBAAoB;AAAA;AAAA,eAEpD,OAAP;AACA,gBAAQ,MACN,0GACA;AAAA;AAIJ,qBAAe,eAAe;AAAA,QAC5B;AAAA,QACA;AAAA,QACA;AAAA;AAEF,aAAO,aAAa,OAAO;AAC3B,WAAK;AAAA;AAAA,IAEP,UAAW,QAAO,YAAY,kBAAmB,UAAS,oBAAoB;AAAA,IAC9E;AAAA;AAAA;AAKC,MAAM,kBAAkB,qBAAqB,aAAa;AAAA,EAC/D;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,49 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
-
import React from 'react';
|
|
9
|
-
import { appendHeaderFormatter } from '@elliemae/ds-shared/useDataGrid/initColumnDefinition';
|
|
10
|
-
import { useResizeHandle } from './useResizeHandle.js';
|
|
11
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
12
|
-
|
|
13
|
-
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; }
|
|
14
|
-
|
|
15
|
-
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; }
|
|
16
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { appendHeaderFormatter } from "@elliemae/ds-shared/useDataGrid/initColumnDefinition";
|
|
4
|
+
import { useResizeHandle } from "./useResizeHandle";
|
|
17
5
|
const addResizableToColumn = (column, formatter) => appendHeaderFormatter(formatter, column);
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
let {
|
|
21
|
-
value,
|
|
22
|
-
onDrag,
|
|
23
|
-
onDragEnd,
|
|
24
|
-
onDragStart,
|
|
25
|
-
minWidth,
|
|
26
|
-
handleClassName
|
|
27
|
-
} = _ref;
|
|
28
|
-
const {
|
|
29
|
-
containerRef,
|
|
30
|
-
Handle
|
|
31
|
-
} = useResizeHandle({
|
|
6
|
+
const ResizableWrapper = React2.memo(({ value, onDrag, onDragEnd, onDragStart, minWidth, handleClassName }) => {
|
|
7
|
+
const { containerRef, Handle } = useResizeHandle({
|
|
32
8
|
onDrag,
|
|
33
9
|
onDragEnd,
|
|
34
10
|
onDragStart,
|
|
35
11
|
minWidth,
|
|
36
12
|
handleClassName
|
|
37
13
|
});
|
|
38
|
-
return
|
|
14
|
+
return /* @__PURE__ */ React2.createElement("div", {
|
|
39
15
|
ref: containerRef,
|
|
40
|
-
className: "resize-container"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
16
|
+
className: "resize-container"
|
|
17
|
+
}, value, /* @__PURE__ */ React2.createElement(Handle, null));
|
|
18
|
+
});
|
|
19
|
+
const resizableFormatter = (options) => (value) => /* @__PURE__ */ React2.createElement(ResizableWrapper, {
|
|
20
|
+
...options,
|
|
21
|
+
value
|
|
22
|
+
});
|
|
23
|
+
export {
|
|
24
|
+
addResizableToColumn,
|
|
25
|
+
resizableFormatter
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=decorateResizable.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/decorateResizable.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { appendHeaderFormatter } from '@elliemae/ds-shared/useDataGrid/initColumnDefinition';\nimport { useResizeHandle } from './useResizeHandle';\n\nconst addResizableToColumn = (column, formatter) =>\n appendHeaderFormatter(formatter, column);\n\nconst ResizableWrapper = React.memo(\n ({ value, onDrag, onDragEnd, onDragStart, minWidth, handleClassName }) => {\n const { containerRef, Handle } = useResizeHandle({\n onDrag,\n onDragEnd,\n onDragStart,\n minWidth,\n handleClassName,\n });\n return (\n <div ref={containerRef} className=\"resize-container\">\n {value}\n <Handle />\n </div>\n );\n },\n);\n\n// eslint-disable-next-line react/display-name\nconst resizableFormatter = options => value => (\n <ResizableWrapper {...options} value={value} />\n);\n\nexport { addResizableToColumn, resizableFormatter };\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AAEA,MAAM,uBAAuB,CAAC,QAAQ,cACpC,sBAAsB,WAAW;AAEnC,MAAM,mBAAmB,OAAM,KAC7B,CAAC,EAAE,OAAO,QAAQ,WAAW,aAAa,UAAU,sBAAsB;AACxE,QAAM,EAAE,cAAc,WAAW,gBAAgB;AAAA,IAC/C;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA;AAEF,SACE,qCAAC,OAAD;AAAA,IAAK,KAAK;AAAA,IAAc,WAAU;AAAA,KAC/B,OACD,qCAAC,QAAD;AAAA;AAOR,MAAM,qBAAqB,aAAW,WACpC,qCAAC,kBAAD;AAAA,KAAsB;AAAA,EAAS;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { ResizablePlugin } from './ResizablePlugin';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,65 +1,50 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useRef } from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
isLast = false
|
|
11
|
-
} = _ref;
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useRef } from "react";
|
|
3
|
+
const useResizeHandle = ({
|
|
4
|
+
onDragStart,
|
|
5
|
+
onDrag,
|
|
6
|
+
onDragEnd,
|
|
7
|
+
minWidth = 10,
|
|
8
|
+
isLast = false
|
|
9
|
+
}) => {
|
|
12
10
|
const startX = useRef();
|
|
13
11
|
const startWidth = useRef();
|
|
14
12
|
const containerRef = useRef();
|
|
15
|
-
|
|
16
13
|
const triggerMove = (handler, event) => {
|
|
17
14
|
const increasing = startX.current - event.clientX < 0;
|
|
18
15
|
handler(Math.max(startWidth.current - startX.current + event.clientX, minWidth), increasing, {});
|
|
19
16
|
};
|
|
20
|
-
|
|
21
|
-
const onMouseMove = event => {
|
|
17
|
+
const onMouseMove = (event) => {
|
|
22
18
|
event.stopPropagation();
|
|
23
19
|
event.preventDefault();
|
|
24
20
|
triggerMove(onDrag, event);
|
|
25
21
|
};
|
|
26
|
-
|
|
27
|
-
const onMouseUp = event => {
|
|
22
|
+
const onMouseUp = (event) => {
|
|
28
23
|
event.stopPropagation();
|
|
29
24
|
event.preventDefault();
|
|
30
25
|
triggerMove(onDragEnd, event);
|
|
31
|
-
document.removeEventListener(
|
|
32
|
-
document.removeEventListener(
|
|
26
|
+
document.removeEventListener("mousemove", onMouseMove);
|
|
27
|
+
document.removeEventListener("mouseup", onMouseUp);
|
|
33
28
|
};
|
|
34
|
-
|
|
35
|
-
const onMouseDown = event => {
|
|
29
|
+
const onMouseDown = (event) => {
|
|
36
30
|
event.stopPropagation();
|
|
37
31
|
event.preventDefault();
|
|
38
|
-
document.addEventListener(
|
|
39
|
-
document.addEventListener(
|
|
32
|
+
document.addEventListener("mousemove", onMouseMove);
|
|
33
|
+
document.addEventListener("mouseup", onMouseUp);
|
|
40
34
|
startX.current = event.clientX;
|
|
41
35
|
startWidth.current = containerRef.current.offsetWidth;
|
|
42
36
|
triggerMove(onDragStart, event);
|
|
43
37
|
};
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
} = _ref2;
|
|
49
|
-
return (
|
|
50
|
-
/*#__PURE__*/
|
|
51
|
-
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
52
|
-
_jsx("div", {
|
|
53
|
-
className: className,
|
|
54
|
-
onMouseDown: onMouseDown
|
|
55
|
-
})
|
|
56
|
-
);
|
|
57
|
-
};
|
|
58
|
-
|
|
38
|
+
const HandleComponent = ({ className = "resize-handle" }) => /* @__PURE__ */ React2.createElement("div", {
|
|
39
|
+
className,
|
|
40
|
+
onMouseDown
|
|
41
|
+
});
|
|
59
42
|
return {
|
|
60
43
|
containerRef,
|
|
61
44
|
Handle: HandleComponent
|
|
62
45
|
};
|
|
63
46
|
};
|
|
64
|
-
|
|
65
|
-
|
|
47
|
+
export {
|
|
48
|
+
useResizeHandle
|
|
49
|
+
};
|
|
50
|
+
//# sourceMappingURL=useResizeHandle.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/useResizeHandle.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useRef } from 'react';\n\nexport const useResizeHandle = ({\n onDragStart,\n onDrag,\n onDragEnd,\n minWidth = 10,\n isLast = false,\n}) => {\n const startX = useRef();\n const startWidth = useRef();\n const containerRef = useRef();\n\n const triggerMove = (handler, event) => {\n const increasing = startX.current - event.clientX < 0;\n handler(\n Math.max(startWidth.current - startX.current + event.clientX, minWidth),\n increasing,\n {},\n );\n };\n\n const onMouseMove = event => {\n event.stopPropagation();\n event.preventDefault();\n\n triggerMove(onDrag, event);\n };\n\n const onMouseUp = event => {\n event.stopPropagation();\n event.preventDefault();\n\n triggerMove(onDragEnd, event);\n\n document.removeEventListener('mousemove', onMouseMove);\n document.removeEventListener('mouseup', onMouseUp);\n };\n\n const onMouseDown = event => {\n event.stopPropagation();\n event.preventDefault();\n\n document.addEventListener('mousemove', onMouseMove);\n document.addEventListener('mouseup', onMouseUp);\n\n startX.current = event.clientX;\n startWidth.current = containerRef.current.offsetWidth;\n\n triggerMove(onDragStart, event);\n };\n\n const HandleComponent = ({ className = 'resize-handle' }) => (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div className={className} onMouseDown={onMouseDown} />\n );\n\n return {\n containerRef,\n Handle: HandleComponent,\n };\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,MAAM,kBAAkB,CAAC;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA,WAAW;AAAA,EACX,SAAS;AAAA,MACL;AACJ,QAAM,SAAS;AACf,QAAM,aAAa;AACnB,QAAM,eAAe;AAErB,QAAM,cAAc,CAAC,SAAS,UAAU;AACtC,UAAM,aAAa,OAAO,UAAU,MAAM,UAAU;AACpD,YACE,KAAK,IAAI,WAAW,UAAU,OAAO,UAAU,MAAM,SAAS,WAC9D,YACA;AAAA;AAIJ,QAAM,cAAc,WAAS;AAC3B,UAAM;AACN,UAAM;AAEN,gBAAY,QAAQ;AAAA;AAGtB,QAAM,YAAY,WAAS;AACzB,UAAM;AACN,UAAM;AAEN,gBAAY,WAAW;AAEvB,aAAS,oBAAoB,aAAa;AAC1C,aAAS,oBAAoB,WAAW;AAAA;AAG1C,QAAM,cAAc,WAAS;AAC3B,UAAM;AACN,UAAM;AAEN,aAAS,iBAAiB,aAAa;AACvC,aAAS,iBAAiB,WAAW;AAErC,WAAO,UAAU,MAAM;AACvB,eAAW,UAAU,aAAa,QAAQ;AAE1C,gBAAY,aAAa;AAAA;AAG3B,QAAM,kBAAkB,CAAC,EAAE,YAAY,sBAErC,qCAAC,OAAD;AAAA,IAAK;AAAA,IAAsB;AAAA;AAG7B,SAAO;AAAA,IACL;AAAA,IACA,QAAQ;AAAA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { parseInt } from
|
|
3
|
-
import memoizeOne from
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
let minWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
9
|
-
const parsedPercentatge = parseInt(percentage.replace('%', ''));
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { parseInt } from "@elliemae/ds-utilities";
|
|
3
|
+
import memoizeOne from "memoize-one";
|
|
4
|
+
const isPercentNumber = (stringNumber) => typeof stringNumber === "string" && stringNumber.indexOf("%") !== -1;
|
|
5
|
+
const isPxNumber = (stringNumber) => typeof stringNumber === "string" && stringNumber.indexOf("px") !== -1;
|
|
6
|
+
const translatePercentageToPx = memoizeOne((totalWidth, percentage, minWidth = 0) => {
|
|
7
|
+
const parsedPercentatge = parseInt(percentage.replace("%", ""));
|
|
10
8
|
const width = totalWidth * parsedPercentatge / 100;
|
|
11
9
|
return width > minWidth ? width : minWidth;
|
|
12
10
|
});
|
|
13
|
-
const translateStringPxToNumberPx = memoizeOne(pxNumber => parseInt(pxNumber.replace(
|
|
14
|
-
memoizeOne((totalWidth, pxWidth) =>
|
|
15
|
-
memoizeOne(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (
|
|
19
|
-
|
|
11
|
+
const translateStringPxToNumberPx = memoizeOne((pxNumber) => parseInt(pxNumber.replace("%", "")));
|
|
12
|
+
const translatePxToPercentage = memoizeOne((totalWidth, pxWidth) => `${pxWidth / totalWidth * 100}%`);
|
|
13
|
+
const getWidth = memoizeOne((gridWidth, width = 0, minWidth) => {
|
|
14
|
+
if (isPercentNumber(width))
|
|
15
|
+
return translatePercentageToPx(gridWidth, width, minWidth);
|
|
16
|
+
if (isPxNumber(width))
|
|
17
|
+
return translateStringPxToNumberPx(width);
|
|
20
18
|
return width;
|
|
21
19
|
});
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
export {
|
|
21
|
+
isPercentNumber,
|
|
22
|
+
isPxNumber,
|
|
23
|
+
translatePercentageToPx
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/utils.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { parseInt } from '@elliemae/ds-utilities';\nimport memoizeOne from 'memoize-one';\n\nexport const isPercentNumber = (stringNumber) => typeof stringNumber === 'string' && stringNumber.indexOf('%') !== -1;\nexport const isPxNumber = (stringNumber) => typeof stringNumber === 'string' && stringNumber.indexOf('px') !== -1;\n\nexport const translatePercentageToPx = memoizeOne((totalWidth, percentage, minWidth = 0) => {\n const parsedPercentatge = parseInt(percentage.replace('%', ''));\n const width = (totalWidth * parsedPercentatge) / 100;\n return width > minWidth ? width : minWidth;\n});\n\nconst translateStringPxToNumberPx = memoizeOne((pxNumber) => parseInt(pxNumber.replace('%', '')));\nconst translatePxToPercentage = memoizeOne((totalWidth, pxWidth) => `${(pxWidth / totalWidth) * 100}%`);\n\nconst getWidth = memoizeOne((gridWidth, width = 0, minWidth) => {\n if (isPercentNumber(width)) return translatePercentageToPx(gridWidth, width, minWidth);\n if (isPxNumber(width)) return translateStringPxToNumberPx(width);\n return width;\n});\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAEO,MAAM,kBAAkB,CAAC,iBAAiB,OAAO,iBAAiB,YAAY,aAAa,QAAQ,SAAS;AAC5G,MAAM,aAAa,CAAC,iBAAiB,OAAO,iBAAiB,YAAY,aAAa,QAAQ,UAAU;AAExG,MAAM,0BAA0B,WAAW,CAAC,YAAY,YAAY,WAAW,MAAM;AAC1F,QAAM,oBAAoB,SAAS,WAAW,QAAQ,KAAK;AAC3D,QAAM,QAAS,aAAa,oBAAqB;AACjD,SAAO,QAAQ,WAAW,QAAQ;AAAA;AAGpC,MAAM,8BAA8B,WAAW,CAAC,aAAa,SAAS,SAAS,QAAQ,KAAK;AAC5F,MAAM,0BAA0B,WAAW,CAAC,YAAY,YAAY,GAAI,UAAU,aAAc;AAEhG,MAAM,WAAW,WAAW,CAAC,WAAW,QAAQ,GAAG,aAAa;AAC9D,MAAI,gBAAgB;AAAQ,WAAO,wBAAwB,WAAW,OAAO;AAC7E,MAAI,WAAW;AAAQ,WAAO,4BAA4B;AAC1D,SAAO;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,105 +1,107 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2, { useMemo } from "react";
|
|
3
|
+
import { SortableElement, SortableContainer, SortableHandle } from "react-sortable-hoc";
|
|
4
|
+
import { GripperVertical } from "@elliemae/ds-icons";
|
|
5
|
+
import { omit } from "@elliemae/ds-utilities";
|
|
6
|
+
import { appendCellFormatter } from "@elliemae/ds-shared/useDataGrid/initColumnDefinition";
|
|
7
|
+
import { createInstancePlugin } from "@elliemae/ds-shared/createDataInstance/createInstancePlugin";
|
|
8
|
+
const keysToOmit = [
|
|
9
|
+
"axis",
|
|
10
|
+
"contentWindow",
|
|
11
|
+
"disableAutoscroll",
|
|
12
|
+
"distance",
|
|
13
|
+
"getContainer",
|
|
14
|
+
"getHelperDimensions",
|
|
15
|
+
"helperClass",
|
|
16
|
+
"helperContainer",
|
|
17
|
+
"hideSortableGhost",
|
|
18
|
+
"keyboardSortingTransitionDuration",
|
|
19
|
+
"lockAxis",
|
|
20
|
+
"lockOffset",
|
|
21
|
+
"lockToContainerEdges",
|
|
22
|
+
"onSortEnd",
|
|
23
|
+
"onSortMove",
|
|
24
|
+
"onSortOver",
|
|
25
|
+
"onSortStart",
|
|
26
|
+
"pressDelay",
|
|
27
|
+
"pressThreshold",
|
|
28
|
+
"shouldCancelStart",
|
|
29
|
+
"transitionDuration",
|
|
30
|
+
"updateBeforeSortStart",
|
|
31
|
+
"useDragHandle",
|
|
32
|
+
"useWindowAsScrollContainer"
|
|
33
|
+
];
|
|
34
|
+
const DragHandle = SortableHandle(() => /* @__PURE__ */ React2.createElement(GripperVertical, {
|
|
24
35
|
className: "drag-handle"
|
|
25
|
-
}))
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
} = _ref;
|
|
33
|
-
return {
|
|
34
|
-
sourceIndex: oldIndex,
|
|
35
|
-
targetIndex: newIndex,
|
|
36
|
-
fromIndex: index === undefined ? oldIndex : index
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const decorateColumns = columns => {
|
|
36
|
+
}));
|
|
37
|
+
const translateDnDData = ({ oldIndex, newIndex, index }) => ({
|
|
38
|
+
sourceIndex: oldIndex,
|
|
39
|
+
targetIndex: newIndex,
|
|
40
|
+
fromIndex: index === void 0 ? oldIndex : index
|
|
41
|
+
});
|
|
42
|
+
const decorateColumns = (columns) => {
|
|
41
43
|
const dragColumn = {
|
|
42
|
-
property:
|
|
43
|
-
label:
|
|
44
|
+
property: "drag",
|
|
45
|
+
label: "",
|
|
44
46
|
visible: true,
|
|
45
47
|
width: 24,
|
|
46
48
|
minWidth: 24,
|
|
47
49
|
special: true
|
|
48
50
|
};
|
|
49
|
-
return [
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
return [
|
|
52
|
+
appendCellFormatter(() => /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement(DragHandle, null)), dragColumn),
|
|
53
|
+
...columns
|
|
54
|
+
];
|
|
52
55
|
};
|
|
53
|
-
|
|
54
56
|
const getBodyProps = (props, grid) => {
|
|
55
|
-
const {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
} = grid.props;
|
|
60
|
-
return _objectSpread(_objectSpread({}, props), {}, {
|
|
61
|
-
onSortEnd: data => {
|
|
57
|
+
const { onMoveRowEnd, onReorder, onMoveRowStart } = grid.props;
|
|
58
|
+
return {
|
|
59
|
+
...props,
|
|
60
|
+
onSortEnd: (data) => {
|
|
62
61
|
grid.enableEvents();
|
|
63
62
|
grid.setIsRowDragging(false);
|
|
64
63
|
onMoveRowEnd(translateDnDData(data));
|
|
65
64
|
},
|
|
66
|
-
onSortStart:
|
|
65
|
+
onSortStart: (...args) => {
|
|
67
66
|
grid.disableEvents();
|
|
68
67
|
grid.setIsRowDragging(true);
|
|
69
|
-
onMoveRowStart(...
|
|
68
|
+
onMoveRowStart(...args);
|
|
70
69
|
},
|
|
71
|
-
onSortOver: data => {
|
|
70
|
+
onSortOver: (data) => {
|
|
72
71
|
onReorder(translateDnDData(data));
|
|
73
72
|
},
|
|
74
|
-
lockAxis:
|
|
73
|
+
lockAxis: "y",
|
|
75
74
|
useDragHandle: true,
|
|
76
|
-
helperClass:
|
|
77
|
-
|
|
78
|
-
getContainer: () => new Promise(resolve => {
|
|
75
|
+
helperClass: "row-drag-helper",
|
|
76
|
+
getContainer: () => new Promise((resolve) => {
|
|
79
77
|
setTimeout(() => {
|
|
80
78
|
resolve(grid.refs.innerBody.current || grid.refs.body.current);
|
|
81
79
|
}, 100);
|
|
82
80
|
})
|
|
83
|
-
}
|
|
81
|
+
};
|
|
84
82
|
};
|
|
85
|
-
|
|
86
|
-
const decorateRenderers = renderers => {
|
|
83
|
+
const decorateRenderers = (renderers) => {
|
|
87
84
|
const RowComponent = renderers.body.row;
|
|
88
85
|
const BodyWrapperComponent = renderers.body.wrapper;
|
|
89
86
|
const Row = useMemo(() => SortableElement(RowComponent), []);
|
|
90
|
-
const BodyWrapper = useMemo(() => SortableContainer(props =>
|
|
91
|
-
|
|
92
|
-
|
|
87
|
+
const BodyWrapper = useMemo(() => SortableContainer((props) => /* @__PURE__ */ React2.createElement(BodyWrapperComponent, {
|
|
88
|
+
...omit(props, keysToOmit)
|
|
89
|
+
})), []);
|
|
90
|
+
return {
|
|
91
|
+
...renderers,
|
|
92
|
+
body: {
|
|
93
|
+
...renderers.body,
|
|
93
94
|
wrapper: BodyWrapper,
|
|
94
95
|
row: Row
|
|
95
|
-
}
|
|
96
|
-
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
97
98
|
};
|
|
98
|
-
|
|
99
|
-
const DndRowsPlugin = createInstancePlugin('dnd-rows', {
|
|
99
|
+
const DndRowsPlugin = createInstancePlugin("dnd-rows", {
|
|
100
100
|
decorateColumns,
|
|
101
101
|
getBodyProps,
|
|
102
102
|
decorateRenderers
|
|
103
103
|
});
|
|
104
|
-
|
|
105
|
-
|
|
104
|
+
export {
|
|
105
|
+
DndRowsPlugin
|
|
106
|
+
};
|
|
107
|
+
//# sourceMappingURL=DndRowsPlugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/row-dnd/DndRowsPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable react-hooks/rules-of-hooks */\nimport React, { useMemo } from 'react';\nimport { SortableElement, SortableContainer, SortableHandle } from 'react-sortable-hoc';\nimport { GripperVertical } from '@elliemae/ds-icons';\nimport { omit } from '@elliemae/ds-utilities';\nimport { appendCellFormatter } from '@elliemae/ds-shared/useDataGrid/initColumnDefinition';\nimport { createInstancePlugin } from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';\n\n// todo: remove once it's fixed in react-sortable-hoc library\nconst keysToOmit = [\n 'axis',\n 'contentWindow',\n 'disableAutoscroll',\n 'distance',\n 'getContainer',\n 'getHelperDimensions',\n 'helperClass',\n 'helperContainer',\n 'hideSortableGhost',\n 'keyboardSortingTransitionDuration',\n 'lockAxis',\n 'lockOffset',\n 'lockToContainerEdges',\n 'onSortEnd',\n 'onSortMove',\n 'onSortOver',\n 'onSortStart',\n 'pressDelay',\n 'pressThreshold',\n 'shouldCancelStart',\n 'transitionDuration',\n 'updateBeforeSortStart',\n 'useDragHandle',\n 'useWindowAsScrollContainer',\n];\n\nconst DragHandle = SortableHandle(() => <GripperVertical className=\"drag-handle\" />);\n\nconst translateDnDData = ({ oldIndex, newIndex, index }) => ({\n sourceIndex: oldIndex,\n targetIndex: newIndex,\n fromIndex: index === undefined ? oldIndex : index,\n});\n\nconst decorateColumns = (columns) => {\n const dragColumn = {\n property: 'drag',\n label: '',\n visible: true,\n width: 24,\n minWidth: 24,\n special: true,\n };\n return [\n appendCellFormatter(\n () => (\n <>\n <DragHandle />\n </>\n ),\n dragColumn,\n ),\n ...columns,\n ];\n};\n\nconst getBodyProps = (props, grid) => {\n const { onMoveRowEnd, onReorder, onMoveRowStart } = grid.props;\n return {\n ...props,\n onSortEnd: (data) => {\n grid.enableEvents();\n grid.setIsRowDragging(false);\n onMoveRowEnd(translateDnDData(data));\n },\n onSortStart: (...args) => {\n grid.disableEvents();\n grid.setIsRowDragging(true);\n onMoveRowStart(...args);\n },\n onSortOver: (data) => {\n onReorder(translateDnDData(data));\n },\n lockAxis: 'y',\n useDragHandle: true,\n helperClass: 'row-drag-helper',\n // a promise is needed, since sortable it's mounted before it's container\n getContainer: () =>\n new Promise((resolve) => {\n setTimeout(() => {\n resolve(grid.refs.innerBody.current || grid.refs.body.current);\n }, 100);\n }),\n };\n};\n\nconst decorateRenderers = (renderers) => {\n const RowComponent = renderers.body.row;\n const BodyWrapperComponent = renderers.body.wrapper;\n\n const Row = useMemo(() => SortableElement(RowComponent), []);\n\n const BodyWrapper = useMemo(\n () => SortableContainer((props) => <BodyWrapperComponent {...omit(props, keysToOmit)} />),\n [],\n );\n\n return {\n ...renderers,\n body: {\n ...renderers.body,\n wrapper: BodyWrapper,\n row: Row,\n },\n };\n};\n\nexport const DndRowsPlugin = createInstancePlugin('dnd-rows', {\n decorateColumns,\n getBodyProps,\n decorateRenderers,\n});\n"],
|
|
5
|
+
"mappings": "AAAA;ACEA;AACA;AACA;AACA;AACA;AACA;AAGA,MAAM,aAAa;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAGF,MAAM,aAAa,eAAe,MAAM,qCAAC,iBAAD;AAAA,EAAiB,WAAU;AAAA;AAEnE,MAAM,mBAAmB,CAAC,EAAE,UAAU,UAAU,YAAa;AAAA,EAC3D,aAAa;AAAA,EACb,aAAa;AAAA,EACb,WAAW,UAAU,SAAY,WAAW;AAAA;AAG9C,MAAM,kBAAkB,CAAC,YAAY;AACnC,QAAM,aAAa;AAAA,IACjB,UAAU;AAAA,IACV,OAAO;AAAA,IACP,SAAS;AAAA,IACT,OAAO;AAAA,IACP,UAAU;AAAA,IACV,SAAS;AAAA;AAEX,SAAO;AAAA,IACL,oBACE,MACE,4DACE,qCAAC,YAAD,QAGJ;AAAA,IAEF,GAAG;AAAA;AAAA;AAIP,MAAM,eAAe,CAAC,OAAO,SAAS;AACpC,QAAM,EAAE,cAAc,WAAW,mBAAmB,KAAK;AACzD,SAAO;AAAA,OACF;AAAA,IACH,WAAW,CAAC,SAAS;AACnB,WAAK;AACL,WAAK,iBAAiB;AACtB,mBAAa,iBAAiB;AAAA;AAAA,IAEhC,aAAa,IAAI,SAAS;AACxB,WAAK;AACL,WAAK,iBAAiB;AACtB,qBAAe,GAAG;AAAA;AAAA,IAEpB,YAAY,CAAC,SAAS;AACpB,gBAAU,iBAAiB;AAAA;AAAA,IAE7B,UAAU;AAAA,IACV,eAAe;AAAA,IACf,aAAa;AAAA,IAEb,cAAc,MACZ,IAAI,QAAQ,CAAC,YAAY;AACvB,iBAAW,MAAM;AACf,gBAAQ,KAAK,KAAK,UAAU,WAAW,KAAK,KAAK,KAAK;AAAA,SACrD;AAAA;AAAA;AAAA;AAKX,MAAM,oBAAoB,CAAC,cAAc;AACvC,QAAM,eAAe,UAAU,KAAK;AACpC,QAAM,uBAAuB,UAAU,KAAK;AAE5C,QAAM,MAAM,QAAQ,MAAM,gBAAgB,eAAe;AAEzD,QAAM,cAAc,QAClB,MAAM,kBAAkB,CAAC,UAAU,qCAAC,sBAAD;AAAA,OAA0B,KAAK,OAAO;AAAA,OACzE;AAGF,SAAO;AAAA,OACF;AAAA,IACH,MAAM;AAAA,SACD,UAAU;AAAA,MACb,SAAS;AAAA,MACT,KAAK;AAAA;AAAA;AAAA;AAKJ,MAAM,gBAAgB,qBAAqB,YAAY;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/row-dnd/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { DndRowsPlugin } from './DndRowsPlugin';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|