@elliemae/ds-datagrids 2.2.0-next.3 → 2.3.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DSDataGrid.js +395 -635
- package/cjs/DSDataGrid.js.map +7 -0
- package/cjs/DataGridImpl.js +103 -128
- package/cjs/DataGridImpl.js.map +7 -0
- package/cjs/PaginatedDataGrid.js +68 -68
- package/cjs/PaginatedDataGrid.js.map +7 -0
- package/cjs/blockNames.js +39 -11
- package/cjs/blockNames.js.map +7 -0
- package/cjs/columns/IconColumn.js +78 -62
- package/cjs/columns/IconColumn.js.map +7 -0
- package/cjs/columns/NumberColumn.js +35 -5
- package/cjs/columns/NumberColumn.js.map +7 -0
- package/cjs/components/BodyCell.js +83 -80
- package/cjs/components/BodyCell.js.map +7 -0
- package/cjs/components/BodyList.js +52 -52
- package/cjs/components/BodyList.js.map +7 -0
- package/cjs/components/ColumnVisibilityMenuOption.js +53 -31
- package/cjs/components/ColumnVisibilityMenuOption.js.map +7 -0
- package/cjs/components/ColumnsOptionsMenuSection.js +59 -44
- package/cjs/components/ColumnsOptionsMenuSection.js.map +7 -0
- package/cjs/components/EmptyState.js +81 -50
- package/cjs/components/EmptyState.js.map +7 -0
- package/cjs/components/HeaderCell.js +64 -58
- package/cjs/components/HeaderCell.js.map +7 -0
- package/cjs/components/List.js +41 -29
- package/cjs/components/List.js.map +7 -0
- package/cjs/components/ListItem.js +43 -36
- package/cjs/components/ListItem.js.map +7 -0
- package/cjs/components/NoResults.js +55 -51
- package/cjs/components/NoResults.js.map +7 -0
- package/cjs/components/RowsLoader.js +42 -22
- package/cjs/components/RowsLoader.js.map +7 -0
- package/cjs/components/Table.js +78 -87
- package/cjs/components/Table.js.map +7 -0
- package/cjs/components/TableBody.js +61 -60
- package/cjs/components/TableBody.js.map +7 -0
- package/cjs/components/TableHeader.js +47 -30
- package/cjs/components/TableHeader.js.map +7 -0
- package/cjs/components/footer/addOptionalFooterComponents.js +53 -43
- package/cjs/components/footer/addOptionalFooterComponents.js.map +7 -0
- package/cjs/components/header/PrimaryControls.js +49 -35
- package/cjs/components/header/PrimaryControls.js.map +7 -0
- package/cjs/components/header/addOptionalHeaderComponents.js +54 -43
- package/cjs/components/header/addOptionalHeaderComponents.js.map +7 -0
- package/cjs/components/index.js +43 -17
- package/cjs/components/index.js.map +7 -0
- package/cjs/components/renderers/defaultClassedRenderers.js +64 -57
- package/cjs/components/renderers/defaultClassedRenderers.js.map +7 -0
- package/cjs/components/renderers/index.js +44 -17
- package/cjs/components/renderers/index.js.map +7 -0
- package/cjs/components/renderers/renderRowsLoader.js +39 -18
- package/cjs/components/renderers/renderRowsLoader.js.map +7 -0
- package/cjs/components/tableContext.js +36 -13
- package/cjs/components/tableContext.js.map +7 -0
- package/cjs/defaultPlugins.js +44 -12
- package/cjs/defaultPlugins.js.map +7 -0
- package/cjs/index.js +72 -67
- package/cjs/index.js.map +7 -0
- package/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +102 -114
- package/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +7 -0
- package/cjs/plugins/body-header-scroll-sync/index.js +35 -9
- package/cjs/plugins/body-header-scroll-sync/index.js.map +7 -0
- package/cjs/plugins/column-dnd/DndColumnsPlugin.js +107 -86
- package/cjs/plugins/column-dnd/DndColumnsPlugin.js.map +7 -0
- package/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +43 -27
- package/cjs/plugins/column-dnd/decorateGridWithDndColumns.js.map +7 -0
- package/cjs/plugins/column-dnd/index.js +35 -9
- package/cjs/plugins/column-dnd/index.js.map +7 -0
- package/cjs/plugins/column-sizing/ColumnSizingPlugin.js +59 -55
- package/cjs/plugins/column-sizing/ColumnSizingPlugin.js.map +7 -0
- package/cjs/plugins/column-sizing/columnMeasurerTransformer.js +48 -53
- package/cjs/plugins/column-sizing/columnMeasurerTransformer.js.map +7 -0
- package/cjs/plugins/column-sizing/ext-points/decorateColumn.js +40 -13
- package/cjs/plugins/column-sizing/ext-points/decorateColumn.js.map +7 -0
- package/cjs/plugins/column-sizing/ext-points/getTableProps.js +55 -54
- package/cjs/plugins/column-sizing/ext-points/getTableProps.js.map +7 -0
- package/cjs/plugins/column-sizing/getColumnNameFromProperty.js +37 -9
- package/cjs/plugins/column-sizing/getColumnNameFromProperty.js.map +7 -0
- package/cjs/plugins/column-sizing/index.js +35 -9
- package/cjs/plugins/column-sizing/index.js.map +7 -0
- package/cjs/plugins/column-sizing/useColumnSizeService.js +72 -86
- package/cjs/plugins/column-sizing/useColumnSizeService.js.map +7 -0
- package/cjs/plugins/column-sizing/useStylesheetHelpers.js +96 -199
- package/cjs/plugins/column-sizing/useStylesheetHelpers.js.map +7 -0
- package/cjs/plugins/column-sizing/utils.js +52 -29
- package/cjs/plugins/column-sizing/utils.js.map +7 -0
- package/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js +38 -16
- package/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +7 -0
- package/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +61 -56
- package/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +7 -0
- package/cjs/plugins/custom-cell-renderer/getRendererComponent.js +58 -60
- package/cjs/plugins/custom-cell-renderer/getRendererComponent.js.map +7 -0
- package/cjs/plugins/custom-cell-renderer/index.js +35 -9
- package/cjs/plugins/custom-cell-renderer/index.js.map +7 -0
- package/cjs/plugins/editable/EditableComponents/ComboBox.js +50 -53
- package/cjs/plugins/editable/EditableComponents/ComboBox.js.map +7 -0
- package/cjs/plugins/editable/EditableComponents/TextBox.js +56 -76
- package/cjs/plugins/editable/EditableComponents/TextBox.js.map +7 -0
- package/cjs/plugins/editable/EditableComponents/index.js +37 -11
- package/cjs/plugins/editable/EditableComponents/index.js.map +7 -0
- package/cjs/plugins/editable/EditablePlugin.js +60 -75
- package/cjs/plugins/editable/EditablePlugin.js.map +7 -0
- package/cjs/plugins/editable/decorateEditable.js +61 -98
- package/cjs/plugins/editable/decorateEditable.js.map +7 -0
- package/cjs/plugins/editable/getEditorComponent.js +70 -76
- package/cjs/plugins/editable/getEditorComponent.js.map +7 -0
- package/cjs/plugins/editable/index.js +38 -13
- package/cjs/plugins/editable/index.js.map +7 -0
- package/cjs/plugins/expandable-grid/ExpandableColumn.js +112 -144
- package/cjs/plugins/expandable-grid/ExpandableColumn.js.map +7 -0
- package/cjs/plugins/expandable-grid/ExpandablePlugin.js +118 -180
- package/cjs/plugins/expandable-grid/ExpandablePlugin.js.map +7 -0
- package/cjs/plugins/expandable-grid/ExpandedRow.js +117 -139
- package/cjs/plugins/expandable-grid/ExpandedRow.js.map +7 -0
- package/cjs/plugins/expandable-grid/ExpandedRowExtra.js +54 -52
- package/cjs/plugins/expandable-grid/ExpandedRowExtra.js.map +7 -0
- package/cjs/plugins/expandable-grid/index.js +37 -11
- package/cjs/plugins/expandable-grid/index.js.map +7 -0
- package/cjs/plugins/expandable-grid/useExpandGridState.js +45 -31
- package/cjs/plugins/expandable-grid/useExpandGridState.js.map +7 -0
- package/cjs/plugins/export-data/ExportDataPlugin.js +82 -116
- package/cjs/plugins/export-data/ExportDataPlugin.js.map +7 -0
- package/cjs/plugins/export-data/index.js +35 -12
- package/cjs/plugins/export-data/index.js.map +7 -0
- package/cjs/plugins/filterable/FilterablePlugin.js +54 -55
- package/cjs/plugins/filterable/FilterablePlugin.js.map +7 -0
- package/cjs/plugins/filterable/addFilterToColumn.js +40 -28
- package/cjs/plugins/filterable/addFilterToColumn.js.map +7 -0
- package/cjs/plugins/filterable/components/FilterableHeader.js +119 -107
- package/cjs/plugins/filterable/components/FilterableHeader.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +116 -116
- package/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +97 -73
- package/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +138 -132
- package/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +115 -119
- package/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js +35 -7
- package/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +7 -0
- package/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +46 -15
- package/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +7 -0
- package/cjs/plugins/filterable/filterableFormatter.js +61 -51
- package/cjs/plugins/filterable/filterableFormatter.js.map +7 -0
- package/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +60 -55
- package/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +7 -0
- package/cjs/plugins/filterable/filtering-helper/strategiesOperators.js +43 -22
- package/cjs/plugins/filterable/filtering-helper/strategiesOperators.js.map +7 -0
- package/cjs/plugins/filterable/helper.js +68 -79
- package/cjs/plugins/filterable/helper.js.map +7 -0
- package/cjs/plugins/filterable/index.js +35 -9
- package/cjs/plugins/filterable/index.js.map +7 -0
- package/cjs/plugins/filterable/useFilterableState.js +62 -66
- package/cjs/plugins/filterable/useFilterableState.js.map +7 -0
- package/cjs/plugins/grouping-by/GroupingByPlugin.js +40 -23
- package/cjs/plugins/grouping-by/GroupingByPlugin.js.map +7 -0
- package/cjs/plugins/grouping-grid/GroupingPlugin.js +86 -109
- package/cjs/plugins/grouping-grid/GroupingPlugin.js.map +7 -0
- package/cjs/plugins/grouping-grid/walkStrategy.js +46 -26
- package/cjs/plugins/grouping-grid/walkStrategy.js.map +7 -0
- package/cjs/plugins/index.js +68 -48
- package/cjs/plugins/index.js.map +7 -0
- package/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +64 -88
- package/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +7 -0
- package/cjs/plugins/infinite-scrolling/index.js +35 -9
- package/cjs/plugins/infinite-scrolling/index.js.map +7 -0
- package/cjs/plugins/pagination/PaginationPlugin.js +73 -90
- package/cjs/plugins/pagination/PaginationPlugin.js.map +7 -0
- package/cjs/plugins/pagination/components/Pagination.js +54 -35
- package/cjs/plugins/pagination/components/Pagination.js.map +7 -0
- package/cjs/plugins/pagination/components/Paginator.js +59 -44
- package/cjs/plugins/pagination/components/Paginator.js.map +7 -0
- package/cjs/plugins/pagination/components/PerPageDropdown.js +51 -63
- package/cjs/plugins/pagination/components/PerPageDropdown.js.map +7 -0
- package/cjs/plugins/pagination/helper.js +45 -24
- package/cjs/plugins/pagination/helper.js.map +7 -0
- package/cjs/plugins/pagination/index.js +35 -9
- package/cjs/plugins/pagination/index.js.map +7 -0
- package/cjs/plugins/pagination/usePaginationState.js +46 -38
- package/cjs/plugins/pagination/usePaginationState.js.map +7 -0
- package/cjs/plugins/resizable/ResizablePlugin.js +51 -55
- package/cjs/plugins/resizable/ResizablePlugin.js.map +7 -0
- package/cjs/plugins/resizable/decorateResizable.js +49 -53
- package/cjs/plugins/resizable/decorateResizable.js.map +7 -0
- package/cjs/plugins/resizable/index.js +35 -9
- package/cjs/plugins/resizable/index.js.map +7 -0
- package/cjs/plugins/resizable/useResizeHandle.js +56 -50
- package/cjs/plugins/resizable/useResizeHandle.js.map +7 -0
- package/cjs/plugins/resizable/utils.js +49 -28
- package/cjs/plugins/resizable/utils.js.map +7 -0
- package/cjs/plugins/row-dnd/DndRowsPlugin.js +103 -82
- package/cjs/plugins/row-dnd/DndRowsPlugin.js.map +7 -0
- package/cjs/plugins/row-dnd/index.js +35 -9
- package/cjs/plugins/row-dnd/index.js.map +7 -0
- package/cjs/plugins/selectable/SelectablePlugin.js +101 -134
- package/cjs/plugins/selectable/SelectablePlugin.js.map +7 -0
- package/cjs/plugins/selectable/addSelectableColumn.js +67 -68
- package/cjs/plugins/selectable/addSelectableColumn.js.map +7 -0
- package/cjs/plugins/selectable/helper.js +50 -39
- package/cjs/plugins/selectable/helper.js.map +7 -0
- package/cjs/plugins/selectable/index.js +35 -9
- package/cjs/plugins/selectable/index.js.map +7 -0
- package/cjs/plugins/selectable/selectableFormatter.js +83 -105
- package/cjs/plugins/selectable/selectableFormatter.js.map +7 -0
- package/cjs/plugins/selectable/useSelectableState.js +67 -94
- package/cjs/plugins/selectable/useSelectableState.js.map +7 -0
- package/cjs/plugins/sortable/SortablePlugin.js +62 -76
- package/cjs/plugins/sortable/SortablePlugin.js.map +7 -0
- package/cjs/plugins/sortable/checkIfSortable.js +37 -14
- package/cjs/plugins/sortable/checkIfSortable.js.map +7 -0
- package/cjs/plugins/sortable/index.js +35 -9
- package/cjs/plugins/sortable/index.js.map +7 -0
- package/cjs/plugins/sortable/sortHeaderFormatter.js +56 -50
- package/cjs/plugins/sortable/sortHeaderFormatter.js.map +7 -0
- package/cjs/plugins/sortable/sortTree.js +40 -47
- package/cjs/plugins/sortable/sortTree.js.map +7 -0
- package/cjs/plugins/sortable/sorter.js +140 -172
- package/cjs/plugins/sortable/sorter.js.map +7 -0
- package/cjs/plugins/sortable/useSortableState.js +53 -79
- package/cjs/plugins/sortable/useSortableState.js.map +7 -0
- package/cjs/plugins/toolbar/RowRenderer.js +75 -76
- package/cjs/plugins/toolbar/RowRenderer.js.map +7 -0
- package/cjs/plugins/toolbar/ToolbarPlugin.js +49 -33
- package/cjs/plugins/toolbar/ToolbarPlugin.js.map +7 -0
- package/cjs/plugins/toolbar/ToolbarTrigger.js +89 -70
- package/cjs/plugins/toolbar/ToolbarTrigger.js.map +7 -0
- package/cjs/plugins/toolbar/index.js +35 -9
- package/cjs/plugins/toolbar/index.js.map +7 -0
- package/cjs/plugins/virtualization/AutoHeightList.js +64 -52
- package/cjs/plugins/virtualization/AutoHeightList.js.map +7 -0
- package/cjs/plugins/virtualization/VirtualizationPlugin.js +86 -97
- package/cjs/plugins/virtualization/VirtualizationPlugin.js.map +7 -0
- package/cjs/plugins/virtualization/VirtualizedBody.js +139 -155
- package/cjs/plugins/virtualization/VirtualizedBody.js.map +7 -0
- package/cjs/plugins/virtualization/VirtualizedBodyRow.js +39 -17
- package/cjs/plugins/virtualization/VirtualizedBodyRow.js.map +7 -0
- package/cjs/plugins/virtualization/helper.js +35 -7
- package/cjs/plugins/virtualization/helper.js.map +7 -0
- package/cjs/plugins/virtualization/index.js +35 -9
- package/cjs/plugins/virtualization/index.js.map +7 -0
- package/cjs/renders/CellWithAddons.js +98 -50
- package/cjs/renders/CellWithAddons.js.map +7 -0
- package/cjs/renders/index.js +37 -11
- package/cjs/renders/index.js.map +7 -0
- package/cjs/renders/styled.js +78 -27
- package/cjs/renders/styled.js.map +7 -0
- package/cjs/rowSizes.js +44 -12
- package/cjs/rowSizes.js.map +7 -0
- package/cjs/utilities/DataGridUtilities.json +1315 -0
- package/cjs/utilities/getPluginsFromProps.js +67 -39
- package/cjs/utilities/getPluginsFromProps.js.map +7 -0
- package/cjs/utilities/getScrollbarSize.js +44 -25
- package/cjs/utilities/getScrollbarSize.js.map +7 -0
- package/cjs/utilities/normalizeData.js +44 -34
- package/cjs/utilities/normalizeData.js.map +7 -0
- package/esm/DSDataGrid.js +337 -597
- package/esm/DSDataGrid.js.map +7 -0
- package/esm/DataGridImpl.js +68 -113
- package/esm/DataGridImpl.js.map +7 -0
- package/esm/PaginatedDataGrid.js +39 -59
- package/esm/PaginatedDataGrid.js.map +7 -0
- package/esm/blockNames.js +10 -5
- package/esm/blockNames.js.map +7 -0
- package/esm/columns/IconColumn.js +49 -54
- package/esm/columns/IconColumn.js.map +7 -0
- package/esm/columns/NumberColumn.js +6 -3
- package/esm/columns/NumberColumn.js.map +7 -0
- package/esm/components/BodyCell.js +51 -68
- package/esm/components/BodyCell.js.map +7 -0
- package/esm/components/BodyList.js +23 -43
- package/esm/components/BodyList.js.map +7 -0
- package/esm/components/ColumnVisibilityMenuOption.js +24 -27
- package/esm/components/ColumnVisibilityMenuOption.js.map +7 -0
- package/esm/components/ColumnsOptionsMenuSection.js +30 -38
- package/esm/components/ColumnsOptionsMenuSection.js.map +7 -0
- package/esm/components/EmptyState.js +52 -40
- package/esm/components/EmptyState.js.map +7 -0
- package/esm/components/HeaderCell.js +33 -48
- package/esm/components/HeaderCell.js.map +7 -0
- package/esm/components/List.js +12 -23
- package/esm/components/List.js.map +7 -0
- package/esm/components/ListItem.js +14 -30
- package/esm/components/ListItem.js.map +7 -0
- package/esm/components/NoResults.js +26 -43
- package/esm/components/NoResults.js.map +7 -0
- package/esm/components/RowsLoader.js +13 -15
- package/esm/components/RowsLoader.js.map +7 -0
- package/esm/components/Table.js +45 -76
- package/esm/components/Table.js.map +7 -0
- package/esm/components/TableBody.js +32 -52
- package/esm/components/TableBody.js.map +7 -0
- package/esm/components/TableHeader.js +17 -23
- package/esm/components/TableHeader.js.map +7 -0
- package/esm/components/footer/addOptionalFooterComponents.js +24 -37
- package/esm/components/footer/addOptionalFooterComponents.js.map +7 -0
- package/esm/components/header/PrimaryControls.js +20 -29
- package/esm/components/header/PrimaryControls.js.map +7 -0
- package/esm/components/header/addOptionalHeaderComponents.js +25 -36
- package/esm/components/header/addOptionalHeaderComponents.js.map +7 -0
- package/esm/components/index.js +14 -5
- package/esm/components/index.js.map +7 -0
- package/esm/components/renderers/defaultClassedRenderers.js +41 -46
- package/esm/components/renderers/defaultClassedRenderers.js.map +7 -0
- package/esm/components/renderers/index.js +16 -5
- package/esm/components/renderers/index.js.map +7 -0
- package/esm/components/renderers/renderRowsLoader.js +10 -10
- package/esm/components/renderers/renderRowsLoader.js.map +7 -0
- package/esm/components/tableContext.js +7 -5
- package/esm/components/tableContext.js.map +7 -0
- package/esm/defaultPlugins.js +15 -8
- package/esm/defaultPlugins.js.map +7 -0
- package/esm/index.js +63 -27
- package/esm/index.js.map +7 -0
- package/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +71 -101
- package/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +7 -0
- package/esm/plugins/body-header-scroll-sync/index.js +6 -1
- package/esm/plugins/body-header-scroll-sync/index.js.map +7 -0
- package/esm/plugins/column-dnd/DndColumnsPlugin.js +69 -68
- package/esm/plugins/column-dnd/DndColumnsPlugin.js.map +7 -0
- package/esm/plugins/column-dnd/decorateGridWithDndColumns.js +16 -18
- package/esm/plugins/column-dnd/decorateGridWithDndColumns.js.map +7 -0
- package/esm/plugins/column-dnd/index.js +6 -1
- package/esm/plugins/column-dnd/index.js.map +7 -0
- package/esm/plugins/column-sizing/ColumnSizingPlugin.js +20 -37
- package/esm/plugins/column-sizing/ColumnSizingPlugin.js.map +7 -0
- package/esm/plugins/column-sizing/columnMeasurerTransformer.js +16 -42
- package/esm/plugins/column-sizing/columnMeasurerTransformer.js.map +7 -0
- package/esm/plugins/column-sizing/ext-points/decorateColumn.js +9 -7
- package/esm/plugins/column-sizing/ext-points/decorateColumn.js.map +7 -0
- package/esm/plugins/column-sizing/ext-points/getTableProps.js +23 -43
- package/esm/plugins/column-sizing/ext-points/getTableProps.js.map +7 -0
- package/esm/plugins/column-sizing/getColumnNameFromProperty.js +8 -7
- package/esm/plugins/column-sizing/getColumnNameFromProperty.js.map +7 -0
- package/esm/plugins/column-sizing/index.js +6 -1
- package/esm/plugins/column-sizing/index.js.map +7 -0
- package/esm/plugins/column-sizing/useColumnSizeService.js +34 -71
- package/esm/plugins/column-sizing/useColumnSizeService.js.map +7 -0
- package/esm/plugins/column-sizing/useStylesheetHelpers.js +64 -171
- package/esm/plugins/column-sizing/useStylesheetHelpers.js.map +7 -0
- package/esm/plugins/column-sizing/utils.js +23 -21
- package/esm/plugins/column-sizing/utils.js.map +7 -0
- package/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js +8 -7
- package/esm/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +7 -0
- package/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +28 -43
- package/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +7 -0
- package/esm/plugins/custom-cell-renderer/getRendererComponent.js +22 -44
- package/esm/plugins/custom-cell-renderer/getRendererComponent.js.map +7 -0
- package/esm/plugins/custom-cell-renderer/index.js +6 -1
- package/esm/plugins/custom-cell-renderer/index.js.map +7 -0
- package/esm/plugins/editable/EditableComponents/ComboBox.js +20 -46
- package/esm/plugins/editable/EditableComponents/ComboBox.js.map +7 -0
- package/esm/plugins/editable/EditableComponents/TextBox.js +26 -68
- package/esm/plugins/editable/EditableComponents/TextBox.js.map +7 -0
- package/esm/plugins/editable/EditableComponents/index.js +8 -2
- package/esm/plugins/editable/EditableComponents/index.js.map +7 -0
- package/esm/plugins/editable/EditablePlugin.js +27 -63
- package/esm/plugins/editable/EditablePlugin.js.map +7 -0
- package/esm/plugins/editable/decorateEditable.js +32 -68
- package/esm/plugins/editable/decorateEditable.js.map +7 -0
- package/esm/plugins/editable/getEditorComponent.js +39 -66
- package/esm/plugins/editable/getEditorComponent.js.map +7 -0
- package/esm/plugins/editable/index.js +9 -3
- package/esm/plugins/editable/index.js.map +7 -0
- package/esm/plugins/expandable-grid/ExpandableColumn.js +82 -133
- package/esm/plugins/expandable-grid/ExpandableColumn.js.map +7 -0
- package/esm/plugins/expandable-grid/ExpandablePlugin.js +81 -160
- package/esm/plugins/expandable-grid/ExpandablePlugin.js.map +7 -0
- package/esm/plugins/expandable-grid/ExpandedRow.js +86 -124
- package/esm/plugins/expandable-grid/ExpandedRow.js.map +7 -0
- package/esm/plugins/expandable-grid/ExpandedRowExtra.js +25 -44
- package/esm/plugins/expandable-grid/ExpandedRowExtra.js.map +7 -0
- package/esm/plugins/expandable-grid/index.js +8 -2
- package/esm/plugins/expandable-grid/index.js.map +7 -0
- package/esm/plugins/expandable-grid/useExpandGridState.js +14 -25
- package/esm/plugins/expandable-grid/useExpandGridState.js.map +7 -0
- package/esm/plugins/export-data/ExportDataPlugin.js +52 -103
- package/esm/plugins/export-data/ExportDataPlugin.js.map +7 -0
- package/esm/plugins/export-data/index.js +6 -1
- package/esm/plugins/export-data/index.js.map +7 -0
- package/esm/plugins/filterable/FilterablePlugin.js +22 -44
- package/esm/plugins/filterable/FilterablePlugin.js.map +7 -0
- package/esm/plugins/filterable/addFilterToColumn.js +11 -20
- package/esm/plugins/filterable/addFilterToColumn.js.map +7 -0
- package/esm/plugins/filterable/components/FilterableHeader.js +85 -95
- package/esm/plugins/filterable/components/FilterableHeader.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +83 -103
- package/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +68 -63
- package/esm/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +108 -116
- package/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js +84 -106
- package/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/defaultDateFormat.js +6 -3
- package/esm/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +7 -0
- package/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +16 -12
- package/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +7 -0
- package/esm/plugins/filterable/filterableFormatter.js +32 -45
- package/esm/plugins/filterable/filterableFormatter.js.map +7 -0
- package/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js +29 -44
- package/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +7 -0
- package/esm/plugins/filterable/filtering-helper/strategiesOperators.js +11 -13
- package/esm/plugins/filterable/filtering-helper/strategiesOperators.js.map +7 -0
- package/esm/plugins/filterable/helper.js +42 -62
- package/esm/plugins/filterable/helper.js.map +7 -0
- package/esm/plugins/filterable/index.js +6 -1
- package/esm/plugins/filterable/index.js.map +7 -0
- package/esm/plugins/filterable/useFilterableState.js +33 -54
- package/esm/plugins/filterable/useFilterableState.js.map +7 -0
- package/esm/plugins/grouping-by/GroupingByPlugin.js +10 -14
- package/esm/plugins/grouping-by/GroupingByPlugin.js.map +7 -0
- package/esm/plugins/grouping-grid/GroupingPlugin.js +53 -94
- package/esm/plugins/grouping-grid/GroupingPlugin.js.map +7 -0
- package/esm/plugins/grouping-grid/walkStrategy.js +17 -22
- package/esm/plugins/grouping-grid/walkStrategy.js.map +7 -0
- package/esm/plugins/index.js +39 -19
- package/esm/plugins/index.js.map +7 -0
- package/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js +31 -74
- package/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +7 -0
- package/esm/plugins/infinite-scrolling/index.js +6 -1
- package/esm/plugins/infinite-scrolling/index.js.map +7 -0
- package/esm/plugins/pagination/PaginationPlugin.js +42 -75
- package/esm/plugins/pagination/PaginationPlugin.js.map +7 -0
- package/esm/plugins/pagination/components/Pagination.js +25 -27
- package/esm/plugins/pagination/components/Pagination.js.map +7 -0
- package/esm/plugins/pagination/components/Paginator.js +29 -35
- package/esm/plugins/pagination/components/Paginator.js.map +7 -0
- package/esm/plugins/pagination/components/PerPageDropdown.js +22 -54
- package/esm/plugins/pagination/components/PerPageDropdown.js.map +7 -0
- package/esm/plugins/pagination/helper.js +16 -19
- package/esm/plugins/pagination/helper.js.map +7 -0
- package/esm/plugins/pagination/index.js +6 -1
- package/esm/plugins/pagination/index.js.map +7 -0
- package/esm/plugins/pagination/usePaginationState.js +15 -28
- package/esm/plugins/pagination/usePaginationState.js.map +7 -0
- package/esm/plugins/resizable/ResizablePlugin.js +20 -45
- package/esm/plugins/resizable/ResizablePlugin.js.map +7 -0
- package/esm/plugins/resizable/decorateResizable.js +19 -41
- package/esm/plugins/resizable/decorateResizable.js.map +7 -0
- package/esm/plugins/resizable/index.js +6 -1
- package/esm/plugins/resizable/index.js.map +7 -0
- package/esm/plugins/resizable/useResizeHandle.js +24 -39
- package/esm/plugins/resizable/useResizeHandle.js.map +7 -0
- package/esm/plugins/resizable/utils.js +20 -18
- package/esm/plugins/resizable/utils.js.map +7 -0
- package/esm/plugins/row-dnd/DndRowsPlugin.js +73 -71
- package/esm/plugins/row-dnd/DndRowsPlugin.js.map +7 -0
- package/esm/plugins/row-dnd/index.js +6 -1
- package/esm/plugins/row-dnd/index.js.map +7 -0
- package/esm/plugins/selectable/SelectablePlugin.js +64 -117
- package/esm/plugins/selectable/SelectablePlugin.js.map +7 -0
- package/esm/plugins/selectable/addSelectableColumn.js +39 -57
- package/esm/plugins/selectable/addSelectableColumn.js.map +7 -0
- package/esm/plugins/selectable/helper.js +19 -25
- package/esm/plugins/selectable/helper.js.map +7 -0
- package/esm/plugins/selectable/index.js +6 -1
- package/esm/plugins/selectable/index.js.map +7 -0
- package/esm/plugins/selectable/selectableFormatter.js +54 -97
- package/esm/plugins/selectable/selectableFormatter.js.map +7 -0
- package/esm/plugins/selectable/useSelectableState.js +34 -78
- package/esm/plugins/selectable/useSelectableState.js.map +7 -0
- package/esm/plugins/sortable/SortablePlugin.js +30 -43
- package/esm/plugins/sortable/SortablePlugin.js.map +7 -0
- package/esm/plugins/sortable/checkIfSortable.js +8 -9
- package/esm/plugins/sortable/checkIfSortable.js.map +7 -0
- package/esm/plugins/sortable/index.js +6 -1
- package/esm/plugins/sortable/index.js.map +7 -0
- package/esm/plugins/sortable/sortHeaderFormatter.js +27 -43
- package/esm/plugins/sortable/sortHeaderFormatter.js.map +7 -0
- package/esm/plugins/sortable/sortTree.js +13 -24
- package/esm/plugins/sortable/sortTree.js.map +7 -0
- package/esm/plugins/sortable/sorter.js +112 -163
- package/esm/plugins/sortable/sorter.js.map +7 -0
- package/esm/plugins/sortable/useSortableState.js +22 -49
- package/esm/plugins/sortable/useSortableState.js.map +7 -0
- package/esm/plugins/toolbar/RowRenderer.js +40 -61
- package/esm/plugins/toolbar/RowRenderer.js.map +7 -0
- package/esm/plugins/toolbar/ToolbarPlugin.js +19 -23
- package/esm/plugins/toolbar/ToolbarPlugin.js.map +7 -0
- package/esm/plugins/toolbar/ToolbarTrigger.js +59 -57
- package/esm/plugins/toolbar/ToolbarTrigger.js.map +7 -0
- package/esm/plugins/toolbar/index.js +6 -1
- package/esm/plugins/toolbar/index.js.map +7 -0
- package/esm/plugins/virtualization/AutoHeightList.js +30 -40
- package/esm/plugins/virtualization/AutoHeightList.js.map +7 -0
- package/esm/plugins/virtualization/VirtualizationPlugin.js +55 -84
- package/esm/plugins/virtualization/VirtualizationPlugin.js.map +7 -0
- package/esm/plugins/virtualization/VirtualizedBody.js +94 -132
- package/esm/plugins/virtualization/VirtualizedBody.js.map +7 -0
- package/esm/plugins/virtualization/VirtualizedBodyRow.js +10 -15
- package/esm/plugins/virtualization/VirtualizedBodyRow.js.map +7 -0
- package/esm/plugins/virtualization/helper.js +6 -3
- package/esm/plugins/virtualization/helper.js.map +7 -0
- package/esm/plugins/virtualization/index.js +6 -1
- package/esm/plugins/virtualization/index.js.map +7 -0
- package/esm/renders/CellWithAddons.js +69 -40
- package/esm/renders/CellWithAddons.js.map +7 -0
- package/esm/renders/index.js +8 -2
- package/esm/renders/index.js.map +7 -0
- package/esm/renders/styled.js +49 -16
- package/esm/renders/styled.js.map +7 -0
- package/esm/rowSizes.js +15 -6
- package/esm/rowSizes.js.map +7 -0
- package/esm/utilities/DataGridUtilities.json +1315 -0
- package/esm/utilities/getPluginsFromProps.js +25 -24
- package/esm/utilities/getPluginsFromProps.js.map +7 -0
- package/esm/utilities/getScrollbarSize.js +15 -21
- package/esm/utilities/getScrollbarSize.js.map +7 -0
- package/esm/utilities/normalizeData.js +15 -24
- package/esm/utilities/normalizeData.js.map +7 -0
- package/package.json +20 -20
- package/types/DSDataGrid.d.ts +2 -116
- package/types/DataGridImpl.d.ts +3 -2
- package/types/PaginatedDataGrid.d.ts +1 -2
- package/types/columns/IconColumn.d.ts +3 -2
- package/types/components/BodyCell.d.ts +13 -12
- package/types/components/ColumnVisibilityMenuOption.d.ts +2 -2
- package/types/components/ColumnsOptionsMenuSection.d.ts +1 -0
- package/types/components/HeaderCell.d.ts +10 -10
- package/types/components/NoResults.d.ts +2 -2
- package/types/components/RowsLoader.d.ts +2 -2
- package/types/components/Table.d.ts +6 -11
- package/types/components/TableBody.d.ts +3 -8
- package/types/components/TableHeader.d.ts +2 -1
- package/types/components/footer/addOptionalFooterComponents.d.ts +1 -0
- package/types/components/header/PrimaryControls.d.ts +1 -0
- package/types/components/header/addOptionalHeaderComponents.d.ts +1 -1
- package/types/components/renderers/index.d.ts +1 -1
- package/types/components/renderers/renderRowsLoader.d.ts +1 -1
- package/types/index.d.ts +7 -8
- package/types/plugins/body-header-scroll-sync/index.d.ts +1 -1
- package/types/plugins/column-dnd/index.d.ts +1 -1
- package/types/plugins/column-sizing/getColumnNameFromProperty.d.ts +2 -1
- package/types/plugins/column-sizing/index.d.ts +1 -1
- package/types/plugins/column-sizing/useColumnSizeService.d.ts +2 -1
- package/types/plugins/custom-cell-renderer/addCustomRendererToCell.d.ts +1 -0
- package/types/plugins/custom-cell-renderer/getRendererComponent.d.ts +1 -0
- package/types/plugins/custom-cell-renderer/index.d.ts +1 -1
- package/types/plugins/editable/EditableComponents/ComboBox.d.ts +3 -1
- package/types/plugins/editable/EditableComponents/TextBox.d.ts +3 -1
- package/types/plugins/editable/getEditorComponent.d.ts +1 -0
- package/types/plugins/editable/index.d.ts +2 -2
- package/types/plugins/expandable-grid/ExpandableColumn.d.ts +3 -2
- package/types/plugins/expandable-grid/ExpandedRow.d.ts +1 -0
- package/types/plugins/expandable-grid/ExpandedRowExtra.d.ts +1 -0
- package/types/plugins/expandable-grid/index.d.ts +2 -2
- package/types/plugins/export-data/index.d.ts +1 -1
- package/types/plugins/filterable/components/FilterableHeader.d.ts +15 -15
- package/types/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.d.ts +1 -0
- package/types/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.d.ts +1 -0
- package/types/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.d.ts +2 -1
- package/types/plugins/filterable/components/filterable-menus/TextFilterMenu.d.ts +1 -0
- package/types/plugins/filterable/components/filterable-menus/getFilterMenuByType.d.ts +2 -1
- package/types/plugins/filterable/filterableFormatter.d.ts +3 -2
- package/types/plugins/filterable/filtering-helper/filterRowsByQuery.d.ts +2 -1
- package/types/plugins/filterable/filtering-helper/strategiesOperators.d.ts +2 -2
- package/types/plugins/filterable/index.d.ts +1 -1
- package/types/plugins/index.d.ts +16 -16
- package/types/plugins/infinite-scrolling/index.d.ts +1 -1
- package/types/plugins/pagination/components/Paginator.d.ts +1 -0
- package/types/plugins/pagination/components/PerPageDropdown.d.ts +1 -0
- package/types/plugins/pagination/helper.d.ts +3 -2
- package/types/plugins/pagination/index.d.ts +1 -1
- package/types/plugins/resizable/index.d.ts +1 -1
- package/types/plugins/row-dnd/index.d.ts +1 -1
- package/types/plugins/selectable/index.d.ts +1 -1
- package/types/plugins/selectable/selectableFormatter.d.ts +1 -0
- package/types/plugins/sortable/index.d.ts +1 -1
- package/types/plugins/sortable/sortHeaderFormatter.d.ts +1 -0
- package/types/plugins/sortable/sortTree.d.ts +1 -0
- package/types/plugins/sortable/sorter.d.ts +1 -1
- package/types/plugins/toolbar/index.d.ts +1 -1
- package/types/plugins/virtualization/AutoHeightList.d.ts +1 -1
- package/types/plugins/virtualization/VirtualizedBody.d.ts +1 -0
- package/types/plugins/virtualization/VirtualizedBodyRow.d.ts +2 -2
- package/types/plugins/virtualization/index.d.ts +1 -1
- package/types/utilities/getPluginsFromProps.d.ts +2 -1
|
@@ -1,122 +1,51 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import getColumnFromProperty from './getColumnNameFromProperty.js';
|
|
8
|
-
import { getScrollbarWidth } from '../../utilities/getScrollbarSize.js';
|
|
9
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as stylesheet from "stylesheet-helpers";
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import { set } from "@elliemae/ds-utilities";
|
|
5
|
+
import { getColumnNameFromProperty } from "./getColumnNameFromProperty";
|
|
6
|
+
import { getScrollbarWidth } from "../../utilities/getScrollbarSize";
|
|
10
7
|
const SCROLLBAR_WIDTH = getScrollbarWidth();
|
|
11
|
-
const RowStylesheetHelper =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
} = stylesheet.create();
|
|
20
|
-
|
|
21
|
-
const update = width => {
|
|
22
|
-
const widths = typeof width === 'string' ? width : "".concat(width, "px");
|
|
23
|
-
stylesheet.updateProperties(window, styleSheet, className, width ? {
|
|
24
|
-
width: widths,
|
|
25
|
-
minWidth: widths,
|
|
26
|
-
maxWidth: widths
|
|
27
|
-
} : {
|
|
28
|
-
width: null,
|
|
29
|
-
minWidth: null,
|
|
30
|
-
maxWidth: null
|
|
31
|
-
});
|
|
32
|
-
const {
|
|
33
|
-
hasScroll
|
|
34
|
-
} = grid.getState();
|
|
35
|
-
const headerWidth = "".concat(width + (hasScroll ? SCROLLBAR_WIDTH : 0), "px");
|
|
36
|
-
stylesheet.updateProperties(window, styleSheet, "".concat(className, "-header"), width ? {
|
|
37
|
-
width: headerWidth,
|
|
38
|
-
minWidth: headerWidth,
|
|
39
|
-
maxWidth: headerWidth
|
|
40
|
-
} : {
|
|
41
|
-
width: null,
|
|
42
|
-
minWidth: null,
|
|
43
|
-
maxWidth: null
|
|
44
|
-
});
|
|
8
|
+
const RowStylesheetHelper = ({ grid, className }) => {
|
|
9
|
+
const { styleSheet, styleSheetElement } = stylesheet.create();
|
|
10
|
+
const update = (width) => {
|
|
11
|
+
const widths = typeof width === "string" ? width : `${width}px`;
|
|
12
|
+
stylesheet.updateProperties(window, styleSheet, className, width ? { width: widths, minWidth: widths, maxWidth: widths } : { width: null, minWidth: null, maxWidth: null });
|
|
13
|
+
const { hasScroll } = grid.getState();
|
|
14
|
+
const headerWidth = `${width + (hasScroll ? SCROLLBAR_WIDTH : 0)}px`;
|
|
15
|
+
stylesheet.updateProperties(window, styleSheet, `${className}-header`, width ? { width: headerWidth, minWidth: headerWidth, maxWidth: headerWidth } : { width: null, minWidth: null, maxWidth: null });
|
|
45
16
|
};
|
|
46
|
-
|
|
47
17
|
const remove = () => styleSheetElement.remove();
|
|
48
|
-
|
|
49
18
|
const getRowClassName = () => className;
|
|
50
|
-
|
|
51
19
|
return {
|
|
52
20
|
update,
|
|
53
21
|
remove,
|
|
54
22
|
getRowClassName
|
|
55
23
|
};
|
|
56
24
|
};
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
let {
|
|
60
|
-
globalId,
|
|
61
|
-
column,
|
|
62
|
-
isHeader = false,
|
|
63
|
-
getId
|
|
64
|
-
} = _ref2;
|
|
65
|
-
return "column-".concat(globalId, "-").concat(getId(column)).concat(isHeader ? '-header' : '');
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
function setWidth(_ref3) {
|
|
69
|
-
let {
|
|
70
|
-
styleSheet,
|
|
71
|
-
className,
|
|
72
|
-
width,
|
|
73
|
-
minWidth
|
|
74
|
-
} = _ref3;
|
|
25
|
+
const getColumnClassName = ({ globalId, column, isHeader = false, getId }) => `column-${globalId}-${getId(column)}${isHeader ? "-header" : ""}`;
|
|
26
|
+
function setWidth({ styleSheet, className, width, minWidth }) {
|
|
75
27
|
let widths;
|
|
76
|
-
if (typeof width ===
|
|
77
|
-
|
|
28
|
+
if (typeof width === "string")
|
|
29
|
+
widths = width;
|
|
30
|
+
if (typeof width === "number")
|
|
31
|
+
widths = `${width}px`;
|
|
78
32
|
let minWidths;
|
|
79
|
-
if (typeof minWidth ===
|
|
80
|
-
|
|
33
|
+
if (typeof minWidth === "string")
|
|
34
|
+
minWidths = minWidth;
|
|
35
|
+
if (typeof minWidth === "number")
|
|
36
|
+
minWidths = `${minWidth}px`;
|
|
81
37
|
stylesheet.updateProperties(window, styleSheet, className, {
|
|
82
|
-
width:
|
|
83
|
-
minWidth:
|
|
84
|
-
|
|
85
|
-
maxWidth: "".concat(widths || minWidths)
|
|
38
|
+
width: `${widths || minWidths}`,
|
|
39
|
+
minWidth: `${widths || minWidths}`,
|
|
40
|
+
maxWidth: `${widths || minWidths}`
|
|
86
41
|
});
|
|
87
42
|
}
|
|
88
|
-
|
|
89
|
-
function updateStyle(_ref4) {
|
|
90
|
-
let {
|
|
91
|
-
styleSheet,
|
|
92
|
-
className,
|
|
93
|
-
style
|
|
94
|
-
} = _ref4;
|
|
43
|
+
function updateStyle({ styleSheet, className, style }) {
|
|
95
44
|
stylesheet.updateProperties(window, styleSheet, className, style);
|
|
96
45
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
globalId,
|
|
101
|
-
getId = _ref6 => {
|
|
102
|
-
let {
|
|
103
|
-
property
|
|
104
|
-
} = _ref6;
|
|
105
|
-
return getColumnFromProperty(property);
|
|
106
|
-
}
|
|
107
|
-
} = _ref5;
|
|
108
|
-
const {
|
|
109
|
-
styleSheetElement,
|
|
110
|
-
styleSheet
|
|
111
|
-
} = stylesheet.create();
|
|
112
|
-
|
|
113
|
-
const updateBodyHeaderWidth = _ref7 => {
|
|
114
|
-
let {
|
|
115
|
-
className,
|
|
116
|
-
headerClassName,
|
|
117
|
-
width,
|
|
118
|
-
minWidth
|
|
119
|
-
} = _ref7;
|
|
46
|
+
function columnSizesHelperImpl({ globalId, getId = ({ property }) => getColumnNameFromProperty(property) }) {
|
|
47
|
+
const { styleSheetElement, styleSheet } = stylesheet.create();
|
|
48
|
+
const updateBodyHeaderWidth = ({ className, headerClassName, width, minWidth }) => {
|
|
120
49
|
setWidth({
|
|
121
50
|
styleSheet,
|
|
122
51
|
className,
|
|
@@ -131,24 +60,16 @@ function columnSizesHelperImpl(_ref5) {
|
|
|
131
60
|
isHeader: true
|
|
132
61
|
});
|
|
133
62
|
};
|
|
134
|
-
|
|
135
63
|
return {
|
|
136
64
|
decorateColumns: (columns, grid) => {
|
|
137
65
|
const {
|
|
138
|
-
props: {
|
|
139
|
-
minColumnWidth
|
|
140
|
-
}
|
|
66
|
+
props: { minColumnWidth }
|
|
141
67
|
} = grid.getInstance();
|
|
142
|
-
return columns.map(column => {
|
|
143
|
-
const cellClassName = getColumnClassName({
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
});
|
|
148
|
-
const headerClassName = "".concat(cellClassName, "-header");
|
|
149
|
-
set(column, 'header.props.className', headerClassName);
|
|
150
|
-
set(column, 'cell.props.className', cellClassName);
|
|
151
|
-
|
|
68
|
+
return columns.map((column) => {
|
|
69
|
+
const cellClassName = getColumnClassName({ globalId, getId, column });
|
|
70
|
+
const headerClassName = `${cellClassName}-header`;
|
|
71
|
+
set(column, "header.props.className", headerClassName);
|
|
72
|
+
set(column, "cell.props.className", cellClassName);
|
|
152
73
|
column.updateBodyHeaderWidth = (width, minWidth) => {
|
|
153
74
|
updateBodyHeaderWidth({
|
|
154
75
|
className: cellClassName,
|
|
@@ -157,7 +78,6 @@ function columnSizesHelperImpl(_ref5) {
|
|
|
157
78
|
minWidth
|
|
158
79
|
});
|
|
159
80
|
};
|
|
160
|
-
|
|
161
81
|
column.updateWidth = (width, minWidth) => {
|
|
162
82
|
setWidth({
|
|
163
83
|
styleSheet,
|
|
@@ -166,80 +86,53 @@ function columnSizesHelperImpl(_ref5) {
|
|
|
166
86
|
minWidth
|
|
167
87
|
});
|
|
168
88
|
};
|
|
169
|
-
|
|
170
|
-
column.updateStyle = style => updateStyle({
|
|
89
|
+
column.updateStyle = (style) => updateStyle({
|
|
171
90
|
styleSheet,
|
|
172
91
|
className: cellClassName,
|
|
173
92
|
style
|
|
174
93
|
});
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
resizedColumns
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
}];
|
|
94
|
+
column.headerHookEffects = [
|
|
95
|
+
() => {
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
const { resizedColumns } = grid.getInstance();
|
|
98
|
+
const resizedWidth = resizedColumns.current[column.uuid];
|
|
99
|
+
updateBodyHeaderWidth({
|
|
100
|
+
className: cellClassName,
|
|
101
|
+
headerClassName,
|
|
102
|
+
width: resizedWidth || column.width || minColumnWidth,
|
|
103
|
+
minWidth: resizedWidth || column.minWidth || minColumnWidth || column.width
|
|
104
|
+
});
|
|
105
|
+
}, [column.uuid]);
|
|
106
|
+
}
|
|
107
|
+
];
|
|
190
108
|
return column;
|
|
191
109
|
});
|
|
192
110
|
},
|
|
193
|
-
|
|
194
111
|
getColumnCellClassName(column) {
|
|
195
|
-
return getColumnClassName({
|
|
196
|
-
globalId,
|
|
197
|
-
getId,
|
|
198
|
-
column
|
|
199
|
-
});
|
|
112
|
+
return getColumnClassName({ globalId, getId, column });
|
|
200
113
|
},
|
|
201
|
-
|
|
202
114
|
getColumnHeaderClassName(column) {
|
|
203
|
-
return
|
|
204
|
-
globalId,
|
|
205
|
-
getId,
|
|
206
|
-
column
|
|
207
|
-
}), "-header");
|
|
115
|
+
return `${getColumnClassName({ globalId, getId, column })}-header`;
|
|
208
116
|
},
|
|
209
|
-
|
|
210
117
|
cleanup() {
|
|
211
118
|
styleSheetElement.remove();
|
|
212
119
|
}
|
|
213
|
-
|
|
214
120
|
};
|
|
215
121
|
}
|
|
216
|
-
|
|
217
122
|
function useStylesheetHelpers(grid) {
|
|
218
123
|
const {
|
|
219
|
-
props: {
|
|
220
|
-
bindColumnsSizeTo,
|
|
221
|
-
bindRowSizeTo
|
|
222
|
-
}
|
|
124
|
+
props: { bindColumnsSizeTo, bindRowSizeTo }
|
|
223
125
|
} = grid;
|
|
224
126
|
const [columnsStylesheet] = useState(() => columnSizesHelperImpl({
|
|
225
127
|
globalId: bindColumnsSizeTo || grid.uuid,
|
|
226
|
-
getId:
|
|
227
|
-
let {
|
|
228
|
-
uuid
|
|
229
|
-
} = _ref8;
|
|
230
|
-
return getColumnFromProperty(uuid);
|
|
231
|
-
}
|
|
128
|
+
getId: ({ uuid }) => getColumnNameFromProperty(uuid)
|
|
232
129
|
}));
|
|
233
|
-
const rowClassName =
|
|
234
|
-
const [rowsStylesheet] = useState(() => RowStylesheetHelper({
|
|
235
|
-
|
|
236
|
-
className: rowClassName
|
|
237
|
-
}));
|
|
238
|
-
return {
|
|
239
|
-
columnsStylesheet,
|
|
240
|
-
rowsStylesheet,
|
|
241
|
-
rowClassName
|
|
242
|
-
};
|
|
130
|
+
const rowClassName = `row-${bindRowSizeTo || grid.uuid}`;
|
|
131
|
+
const [rowsStylesheet] = useState(() => RowStylesheetHelper({ grid, className: rowClassName }));
|
|
132
|
+
return { columnsStylesheet, rowsStylesheet, rowClassName };
|
|
243
133
|
}
|
|
244
|
-
|
|
245
|
-
|
|
134
|
+
export {
|
|
135
|
+
RowStylesheetHelper,
|
|
136
|
+
useStylesheetHelpers
|
|
137
|
+
};
|
|
138
|
+
//# sourceMappingURL=useStylesheetHelpers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/column-sizing/useStylesheetHelpers.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-param-reassign */\n/* eslint-disable max-lines */\nimport * as stylesheet from 'stylesheet-helpers';\nimport { useState, useEffect } from 'react';\nimport { set } from '@elliemae/ds-utilities';\nimport { getColumnNameFromProperty } from './getColumnNameFromProperty';\nimport { getScrollbarWidth } from '../../utilities/getScrollbarSize';\n\nconst SCROLLBAR_WIDTH = getScrollbarWidth();\n\nexport const RowStylesheetHelper = ({ grid, className }) => {\n const { styleSheet, styleSheetElement } = stylesheet.create();\n const update = (width) => {\n const widths = typeof width === 'string' ? width : `${width}px`;\n stylesheet.updateProperties(\n window,\n styleSheet,\n className,\n width ? { width: widths, minWidth: widths, maxWidth: widths } : { width: null, minWidth: null, maxWidth: null },\n );\n const { hasScroll } = grid.getState();\n const headerWidth = `${width + (hasScroll ? SCROLLBAR_WIDTH : 0)}px`;\n stylesheet.updateProperties(\n window,\n styleSheet,\n `${className}-header`,\n width\n ? { width: headerWidth, minWidth: headerWidth, maxWidth: headerWidth }\n : { width: null, minWidth: null, maxWidth: null },\n );\n };\n const remove = () => styleSheetElement.remove();\n const getRowClassName = () => className;\n return {\n update,\n remove,\n getRowClassName,\n };\n};\n\nconst getColumnClassName = ({ globalId, column, isHeader = false, getId }) =>\n `column-${globalId}-${getId(column)}${isHeader ? '-header' : ''}`;\n\nfunction setWidth({ styleSheet, className, width, minWidth }) {\n let widths;\n if (typeof width === 'string') widths = width;\n if (typeof width === 'number') widths = `${width}px`;\n\n let minWidths;\n if (typeof minWidth === 'string') minWidths = minWidth;\n if (typeof minWidth === 'number') minWidths = `${minWidth}px`;\n\n stylesheet.updateProperties(window, styleSheet, className, {\n width: `${widths || minWidths}`,\n minWidth: `${widths || minWidths}`,\n // minWidth: `${minWidths || widths}`,\n maxWidth: `${widths || minWidths}`,\n });\n}\n\nfunction updateStyle({ styleSheet, className, style }) {\n stylesheet.updateProperties(window, styleSheet, className, style);\n}\n\nfunction columnSizesHelperImpl({ globalId, getId = ({ property }) => getColumnNameFromProperty(property) }) {\n const { styleSheetElement, styleSheet } = stylesheet.create();\n\n const updateBodyHeaderWidth = ({ className, headerClassName, width, minWidth }) => {\n setWidth({\n styleSheet,\n className,\n width,\n minWidth,\n });\n setWidth({\n styleSheet,\n className: headerClassName,\n width,\n minWidth,\n isHeader: true,\n });\n };\n\n return {\n decorateColumns: (columns, grid) => {\n const {\n props: { minColumnWidth },\n } = grid.getInstance();\n return columns.map((column) => {\n const cellClassName = getColumnClassName({ globalId, getId, column });\n const headerClassName = `${cellClassName}-header`;\n\n set(column, 'header.props.className', headerClassName);\n set(column, 'cell.props.className', cellClassName);\n\n column.updateBodyHeaderWidth = (width, minWidth) => {\n updateBodyHeaderWidth({\n className: cellClassName,\n headerClassName,\n width,\n minWidth,\n });\n };\n column.updateWidth = (width, minWidth) => {\n setWidth({\n styleSheet,\n className: cellClassName,\n width,\n minWidth,\n });\n };\n column.updateStyle = (style) =>\n updateStyle({\n styleSheet,\n className: cellClassName,\n style,\n });\n\n column.headerHookEffects = [\n () => {\n useEffect(() => {\n const { resizedColumns } = grid.getInstance();\n const resizedWidth = resizedColumns.current[column.uuid];\n updateBodyHeaderWidth({\n className: cellClassName,\n headerClassName,\n width: resizedWidth || column.width || minColumnWidth,\n minWidth: resizedWidth || column.minWidth || minColumnWidth || column.width,\n });\n }, [column.uuid]);\n },\n ];\n\n return column;\n });\n },\n getColumnCellClassName(column) {\n return getColumnClassName({ globalId, getId, column });\n },\n getColumnHeaderClassName(column) {\n return `${getColumnClassName({ globalId, getId, column })}-header`;\n },\n cleanup() {\n styleSheetElement.remove();\n },\n };\n}\n\nexport function useStylesheetHelpers(grid) {\n const {\n props: { bindColumnsSizeTo, bindRowSizeTo },\n } = grid;\n\n const [columnsStylesheet] = useState(() =>\n columnSizesHelperImpl({\n globalId: bindColumnsSizeTo || grid.uuid,\n getId: ({ uuid }) => getColumnNameFromProperty(uuid),\n }),\n );\n const rowClassName = `row-${bindRowSizeTo || grid.uuid}`;\n const [rowsStylesheet] = useState(() => RowStylesheetHelper({ grid, className: rowClassName }));\n\n return { columnsStylesheet, rowsStylesheet, rowClassName };\n}\n"],
|
|
5
|
+
"mappings": "AAAA;ACEA;AACA;AACA;AACA;AACA;AAEA,MAAM,kBAAkB;AAEjB,MAAM,sBAAsB,CAAC,EAAE,MAAM,gBAAgB;AAC1D,QAAM,EAAE,YAAY,sBAAsB,WAAW;AACrD,QAAM,SAAS,CAAC,UAAU;AACxB,UAAM,SAAS,OAAO,UAAU,WAAW,QAAQ,GAAG;AACtD,eAAW,iBACT,QACA,YACA,WACA,QAAQ,EAAE,OAAO,QAAQ,UAAU,QAAQ,UAAU,WAAW,EAAE,OAAO,MAAM,UAAU,MAAM,UAAU;AAE3G,UAAM,EAAE,cAAc,KAAK;AAC3B,UAAM,cAAc,GAAG,QAAS,aAAY,kBAAkB;AAC9D,eAAW,iBACT,QACA,YACA,GAAG,oBACH,QACI,EAAE,OAAO,aAAa,UAAU,aAAa,UAAU,gBACvD,EAAE,OAAO,MAAM,UAAU,MAAM,UAAU;AAAA;AAGjD,QAAM,SAAS,MAAM,kBAAkB;AACvC,QAAM,kBAAkB,MAAM;AAC9B,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA;AAAA;AAIJ,MAAM,qBAAqB,CAAC,EAAE,UAAU,QAAQ,WAAW,OAAO,YAChE,UAAU,YAAY,MAAM,UAAU,WAAW,YAAY;AAE/D,kBAAkB,EAAE,YAAY,WAAW,OAAO,YAAY;AAC5D,MAAI;AACJ,MAAI,OAAO,UAAU;AAAU,aAAS;AACxC,MAAI,OAAO,UAAU;AAAU,aAAS,GAAG;AAE3C,MAAI;AACJ,MAAI,OAAO,aAAa;AAAU,gBAAY;AAC9C,MAAI,OAAO,aAAa;AAAU,gBAAY,GAAG;AAEjD,aAAW,iBAAiB,QAAQ,YAAY,WAAW;AAAA,IACzD,OAAO,GAAG,UAAU;AAAA,IACpB,UAAU,GAAG,UAAU;AAAA,IAEvB,UAAU,GAAG,UAAU;AAAA;AAAA;AAI3B,qBAAqB,EAAE,YAAY,WAAW,SAAS;AACrD,aAAW,iBAAiB,QAAQ,YAAY,WAAW;AAAA;AAG7D,+BAA+B,EAAE,UAAU,QAAQ,CAAC,EAAE,eAAe,0BAA0B,aAAa;AAC1G,QAAM,EAAE,mBAAmB,eAAe,WAAW;AAErD,QAAM,wBAAwB,CAAC,EAAE,WAAW,iBAAiB,OAAO,eAAe;AACjF,aAAS;AAAA,MACP;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAEF,aAAS;AAAA,MACP;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,MACA,UAAU;AAAA;AAAA;AAId,SAAO;AAAA,IACL,iBAAiB,CAAC,SAAS,SAAS;AAClC,YAAM;AAAA,QACJ,OAAO,EAAE;AAAA,UACP,KAAK;AACT,aAAO,QAAQ,IAAI,CAAC,WAAW;AAC7B,cAAM,gBAAgB,mBAAmB,EAAE,UAAU,OAAO;AAC5D,cAAM,kBAAkB,GAAG;AAE3B,YAAI,QAAQ,0BAA0B;AACtC,YAAI,QAAQ,wBAAwB;AAEpC,eAAO,wBAAwB,CAAC,OAAO,aAAa;AAClD,gCAAsB;AAAA,YACpB,WAAW;AAAA,YACX;AAAA,YACA;AAAA,YACA;AAAA;AAAA;AAGJ,eAAO,cAAc,CAAC,OAAO,aAAa;AACxC,mBAAS;AAAA,YACP;AAAA,YACA,WAAW;AAAA,YACX;AAAA,YACA;AAAA;AAAA;AAGJ,eAAO,cAAc,CAAC,UACpB,YAAY;AAAA,UACV;AAAA,UACA,WAAW;AAAA,UACX;AAAA;AAGJ,eAAO,oBAAoB;AAAA,UACzB,MAAM;AACJ,sBAAU,MAAM;AACd,oBAAM,EAAE,mBAAmB,KAAK;AAChC,oBAAM,eAAe,eAAe,QAAQ,OAAO;AACnD,oCAAsB;AAAA,gBACpB,WAAW;AAAA,gBACX;AAAA,gBACA,OAAO,gBAAgB,OAAO,SAAS;AAAA,gBACvC,UAAU,gBAAgB,OAAO,YAAY,kBAAkB,OAAO;AAAA;AAAA,eAEvE,CAAC,OAAO;AAAA;AAAA;AAIf,eAAO;AAAA;AAAA;AAAA,IAGX,uBAAuB,QAAQ;AAC7B,aAAO,mBAAmB,EAAE,UAAU,OAAO;AAAA;AAAA,IAE/C,yBAAyB,QAAQ;AAC/B,aAAO,GAAG,mBAAmB,EAAE,UAAU,OAAO;AAAA;AAAA,IAElD,UAAU;AACR,wBAAkB;AAAA;AAAA;AAAA;AAKjB,8BAA8B,MAAM;AACzC,QAAM;AAAA,IACJ,OAAO,EAAE,mBAAmB;AAAA,MAC1B;AAEJ,QAAM,CAAC,qBAAqB,SAAS,MACnC,sBAAsB;AAAA,IACpB,UAAU,qBAAqB,KAAK;AAAA,IACpC,OAAO,CAAC,EAAE,WAAW,0BAA0B;AAAA;AAGnD,QAAM,eAAe,OAAO,iBAAiB,KAAK;AAClD,QAAM,CAAC,kBAAkB,SAAS,MAAM,oBAAoB,EAAE,MAAM,WAAW;AAE/E,SAAO,EAAE,mBAAmB,gBAAgB;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
4
|
-
import { get } from '@elliemae/ds-utilities';
|
|
5
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { get } from "@elliemae/ds-utilities";
|
|
6
3
|
function getScrollbarSizeFromHeaderAndBody(refs) {
|
|
7
|
-
const innerBodyOffsetWidth = get(refs, [
|
|
8
|
-
const headerOffsetWidth = get(refs, [
|
|
4
|
+
const innerBodyOffsetWidth = get(refs, ["innerBody", "current", "offsetWidth"]);
|
|
5
|
+
const headerOffsetWidth = get(refs, ["header", "current", "offsetWidth"]);
|
|
9
6
|
return headerOffsetWidth - innerBodyOffsetWidth;
|
|
10
7
|
}
|
|
11
|
-
const isScrollbarVisible = element => element.scrollHeight > element.clientHeight;
|
|
12
|
-
const getPercentageValue = percentString => {
|
|
13
|
-
if (typeof percentString !==
|
|
8
|
+
const isScrollbarVisible = (element) => element.scrollHeight > element.clientHeight;
|
|
9
|
+
const getPercentageValue = (percentString) => {
|
|
10
|
+
if (typeof percentString !== "string")
|
|
11
|
+
return null;
|
|
14
12
|
const result = percentString.match(/(\d+|\d*[.,]\d{1,2})/);
|
|
15
13
|
return result && Number(result[0]);
|
|
16
14
|
};
|
|
@@ -18,20 +16,24 @@ const getColumnWidthSize = (width, minWidth, column) => {
|
|
|
18
16
|
if (column.special) {
|
|
19
17
|
return column.width;
|
|
20
18
|
}
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
if (minWidth && minWidth > width)
|
|
20
|
+
return minWidth;
|
|
23
21
|
return width;
|
|
24
22
|
};
|
|
25
|
-
const calculateMinWidthForWrappedText = columns => {
|
|
23
|
+
const calculateMinWidthForWrappedText = (columns) => {
|
|
26
24
|
let longestWord = 0;
|
|
27
|
-
columns.forEach(
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const localLongestWord = label.split(' ').sort((a, b) => b.length - a.length)[0].length;
|
|
32
|
-
if (localLongestWord > longestWord) longestWord = localLongestWord;
|
|
25
|
+
columns.forEach(({ label }) => {
|
|
26
|
+
const localLongestWord = label.split(" ").sort((a, b) => b.length - a.length)[0].length;
|
|
27
|
+
if (localLongestWord > longestWord)
|
|
28
|
+
longestWord = localLongestWord;
|
|
33
29
|
});
|
|
34
30
|
return longestWord * 8.5;
|
|
35
31
|
};
|
|
36
|
-
|
|
37
|
-
|
|
32
|
+
export {
|
|
33
|
+
calculateMinWidthForWrappedText,
|
|
34
|
+
getColumnWidthSize,
|
|
35
|
+
getPercentageValue,
|
|
36
|
+
getScrollbarSizeFromHeaderAndBody,
|
|
37
|
+
isScrollbarVisible
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/column-sizing/utils.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { get } from '@elliemae/ds-utilities';\n\nexport function getScrollbarSizeFromHeaderAndBody(refs) {\n const innerBodyOffsetWidth = get(refs, ['innerBody', 'current', 'offsetWidth']);\n const headerOffsetWidth = get(refs, ['header', 'current', 'offsetWidth']);\n\n return headerOffsetWidth - innerBodyOffsetWidth;\n}\n\nexport const isScrollbarVisible = (element) => element.scrollHeight > element.clientHeight;\n\nexport const getPercentageValue = (percentString) => {\n if (typeof percentString !== 'string') return null;\n const result = percentString.match(/(\\d+|\\d*[.,]\\d{1,2})/);\n\n return result && Number(result[0]);\n};\n\nexport const getColumnWidthSize = (width, minWidth, column) => {\n if (column.special) {\n return column.width;\n }\n if (minWidth && minWidth > width) return minWidth;\n return width;\n};\n\nexport const calculateMinWidthForWrappedText = (columns) => {\n let longestWord = 0;\n\n columns.forEach(({ label }) => {\n const localLongestWord = label.split(' ').sort((a, b) => b.length - a.length)[0].length;\n if (localLongestWord > longestWord) longestWord = localLongestWord;\n });\n\n return longestWord * 8.5;\n};\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AAEO,2CAA2C,MAAM;AACtD,QAAM,uBAAuB,IAAI,MAAM,CAAC,aAAa,WAAW;AAChE,QAAM,oBAAoB,IAAI,MAAM,CAAC,UAAU,WAAW;AAE1D,SAAO,oBAAoB;AAAA;AAGtB,MAAM,qBAAqB,CAAC,YAAY,QAAQ,eAAe,QAAQ;AAEvE,MAAM,qBAAqB,CAAC,kBAAkB;AACnD,MAAI,OAAO,kBAAkB;AAAU,WAAO;AAC9C,QAAM,SAAS,cAAc,MAAM;AAEnC,SAAO,UAAU,OAAO,OAAO;AAAA;AAG1B,MAAM,qBAAqB,CAAC,OAAO,UAAU,WAAW;AAC7D,MAAI,OAAO,SAAS;AAClB,WAAO,OAAO;AAAA;AAEhB,MAAI,YAAY,WAAW;AAAO,WAAO;AACzC,SAAO;AAAA;AAGF,MAAM,kCAAkC,CAAC,YAAY;AAC1D,MAAI,cAAc;AAElB,UAAQ,QAAQ,CAAC,EAAE,YAAY;AAC7B,UAAM,mBAAmB,MAAM,MAAM,KAAK,KAAK,CAAC,GAAG,MAAM,EAAE,SAAS,EAAE,QAAQ,GAAG;AACjF,QAAI,mBAAmB;AAAa,oBAAc;AAAA;AAGpD,SAAO,cAAc;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { createInstancePlugin } from "@elliemae/ds-shared/createDataInstance/createInstancePlugin";
|
|
3
|
+
import { addCustomRendererToCell } from "./addCustomRendererToCell";
|
|
4
4
|
const decorateColumn = (column, grid) => addCustomRendererToCell(grid)(column);
|
|
5
|
-
|
|
6
|
-
const CustomRendererPlugin = createInstancePlugin('custom-renderer', {
|
|
5
|
+
const CustomRendererPlugin = createInstancePlugin("custom-renderer", {
|
|
7
6
|
decorateColumn
|
|
8
7
|
});
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
export {
|
|
9
|
+
CustomRendererPlugin
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=CustomRendererPlugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/custom-cell-renderer/CustomRendererPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createInstancePlugin } from '@elliemae/ds-shared/createDataInstance/createInstancePlugin';\nimport { addCustomRendererToCell } from './addCustomRendererToCell';\n\n// todo: this probably needs to go to the core\n\nconst decorateColumn = (column, grid) => addCustomRendererToCell(grid)(column);\n\nexport const CustomRendererPlugin = createInstancePlugin('custom-renderer', {\n decorateColumn,\n});\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AAIA,MAAM,iBAAiB,CAAC,QAAQ,SAAS,wBAAwB,MAAM;AAEhE,MAAM,uBAAuB,qBAAqB,mBAAmB;AAAA,EAC1E;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,63 +1,48 @@
|
|
|
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 { get, isFunction } from '@elliemae/ds-utilities';
|
|
8
|
-
import { appendCellFormatter } from '@elliemae/ds-shared/useDataGrid/initColumnDefinition';
|
|
9
|
-
import getRendererComponent from './getRendererComponent.js';
|
|
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; }
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { isFunction, get } from "@elliemae/ds-utilities";
|
|
3
|
+
import { appendCellFormatter } from "@elliemae/ds-shared/useDataGrid/initColumnDefinition";
|
|
4
|
+
import { getRendererComponent } from "./getRendererComponent";
|
|
14
5
|
const getRenderer = (renderer, grid, column) => (value, metaData) => {
|
|
15
6
|
const {
|
|
16
|
-
props: {
|
|
17
|
-
customHandlers,
|
|
18
|
-
parentRowData
|
|
19
|
-
}
|
|
7
|
+
props: { customHandlers, parentRowData }
|
|
20
8
|
} = grid.getInstance();
|
|
21
|
-
|
|
22
9
|
if (column && column.formatExpandable && value && value.props && value.props.children && value.props.children.length === 2) {
|
|
23
|
-
return [
|
|
24
|
-
value
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
parentRowData
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
10
|
+
return [
|
|
11
|
+
value.props.children[0],
|
|
12
|
+
renderer({
|
|
13
|
+
value: value.props.children[1],
|
|
14
|
+
metaData: { ...metaData, parentRowData },
|
|
15
|
+
customHandlers
|
|
16
|
+
})
|
|
17
|
+
];
|
|
31
18
|
}
|
|
32
|
-
|
|
33
19
|
return renderer({
|
|
34
20
|
value,
|
|
35
|
-
metaData:
|
|
36
|
-
parentRowData
|
|
37
|
-
}),
|
|
21
|
+
metaData: { ...metaData, parentRowData },
|
|
38
22
|
customHandlers
|
|
39
23
|
});
|
|
40
24
|
};
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
const customHeaderRenderer = get(column, ['header', 'customRenderer']);
|
|
47
|
-
if (!customRenderer && !customHeaderRenderer) return column;
|
|
48
|
-
|
|
25
|
+
const addCustomRendererToCell = (grid) => (column) => {
|
|
26
|
+
const { customRenderer } = column;
|
|
27
|
+
const customHeaderRenderer = get(column, ["header", "customRenderer"]);
|
|
28
|
+
if (!customRenderer && !customHeaderRenderer)
|
|
29
|
+
return column;
|
|
49
30
|
if (isFunction(customHeaderRenderer)) {
|
|
50
31
|
column.header.formatters.push(getRenderer(customHeaderRenderer, grid));
|
|
51
32
|
}
|
|
52
|
-
|
|
53
33
|
if (isFunction(customRenderer)) {
|
|
54
34
|
column = appendCellFormatter(getRenderer(customRenderer, grid, column), column);
|
|
55
35
|
} else {
|
|
56
|
-
if (!customRenderer)
|
|
36
|
+
if (!customRenderer)
|
|
37
|
+
return column;
|
|
57
38
|
column.cell.formatters.push((value, columnData) => getRendererComponent(grid, customRenderer, columnData));
|
|
58
39
|
}
|
|
59
|
-
|
|
60
40
|
return column;
|
|
61
41
|
};
|
|
62
|
-
|
|
63
|
-
export {
|
|
42
|
+
var addCustomRendererToCell_default = addCustomRendererToCell;
|
|
43
|
+
export {
|
|
44
|
+
addCustomRendererToCell,
|
|
45
|
+
addCustomRendererToCell_default as default,
|
|
46
|
+
getRenderer
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=addCustomRendererToCell.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/custom-cell-renderer/addCustomRendererToCell.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-statements */\nimport { isFunction, get } from '@elliemae/ds-utilities';\nimport { appendCellFormatter } from '@elliemae/ds-shared/useDataGrid/initColumnDefinition';\nimport { getRendererComponent } from './getRendererComponent';\n\nexport const getRenderer = (renderer, grid, column) => (value, metaData) => {\n const {\n props: { customHandlers, parentRowData },\n } = grid.getInstance();\n if (\n column &&\n column.formatExpandable &&\n value &&\n value.props &&\n value.props.children &&\n value.props.children.length === 2\n ) {\n return [\n value.props.children[0],\n renderer({\n value: value.props.children[1], // apply custom render only to the original value not the arrow\n metaData: { ...metaData, parentRowData },\n customHandlers,\n }),\n ];\n }\n return renderer({\n value,\n metaData: { ...metaData, parentRowData },\n customHandlers,\n });\n};\n\nconst addCustomRendererToCell = (grid) => (column) => {\n const { customRenderer } = column;\n const customHeaderRenderer = get(column, ['header', 'customRenderer']);\n if (!customRenderer && !customHeaderRenderer) return column;\n\n if (isFunction(customHeaderRenderer)) {\n column.header.formatters.push(getRenderer(customHeaderRenderer, grid));\n }\n\n if (isFunction(customRenderer)) {\n column = appendCellFormatter(getRenderer(customRenderer, grid, column), column);\n } else {\n if (!customRenderer) return column;\n column.cell.formatters.push((value, columnData) => getRendererComponent(grid, customRenderer, columnData));\n }\n\n return column;\n};\n\nexport { addCustomRendererToCell };\nexport default addCustomRendererToCell;\n"],
|
|
5
|
+
"mappings": "AAAA;ACCA;AACA;AACA;AAEO,MAAM,cAAc,CAAC,UAAU,MAAM,WAAW,CAAC,OAAO,aAAa;AAC1E,QAAM;AAAA,IACJ,OAAO,EAAE,gBAAgB;AAAA,MACvB,KAAK;AACT,MACE,UACA,OAAO,oBACP,SACA,MAAM,SACN,MAAM,MAAM,YACZ,MAAM,MAAM,SAAS,WAAW,GAChC;AACA,WAAO;AAAA,MACL,MAAM,MAAM,SAAS;AAAA,MACrB,SAAS;AAAA,QACP,OAAO,MAAM,MAAM,SAAS;AAAA,QAC5B,UAAU,KAAK,UAAU;AAAA,QACzB;AAAA;AAAA;AAAA;AAIN,SAAO,SAAS;AAAA,IACd;AAAA,IACA,UAAU,KAAK,UAAU;AAAA,IACzB;AAAA;AAAA;AAIJ,MAAM,0BAA0B,CAAC,SAAS,CAAC,WAAW;AACpD,QAAM,EAAE,mBAAmB;AAC3B,QAAM,uBAAuB,IAAI,QAAQ,CAAC,UAAU;AACpD,MAAI,CAAC,kBAAkB,CAAC;AAAsB,WAAO;AAErD,MAAI,WAAW,uBAAuB;AACpC,WAAO,OAAO,WAAW,KAAK,YAAY,sBAAsB;AAAA;AAGlE,MAAI,WAAW,iBAAiB;AAC9B,aAAS,oBAAoB,YAAY,gBAAgB,MAAM,SAAS;AAAA,SACnE;AACL,QAAI,CAAC;AAAgB,aAAO;AAC5B,WAAO,KAAK,WAAW,KAAK,CAAC,OAAO,eAAe,qBAAqB,MAAM,gBAAgB;AAAA;AAGhG,SAAO;AAAA;AAIT,IAAO,kCAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,22 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
|
-
import 'react';
|
|
9
|
-
import DSButton from '@elliemae/ds-button';
|
|
10
|
-
import { DSCheckbox, DSComboBox, DSRadio, DSTextBox, DSToggle } from '@elliemae/ds-form';
|
|
11
|
-
import DSDropdownMenu from '@elliemae/ds-dropdownmenu';
|
|
12
|
-
import * as index from '../../components/renderers/index.js';
|
|
13
|
-
import { jsx } from 'react/jsx-runtime';
|
|
14
|
-
|
|
15
|
-
const _excluded = ["type", "handlers"];
|
|
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; }
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import React2 from "react";
|
|
3
|
+
import { DSButton } from "@elliemae/ds-button";
|
|
4
|
+
import { DSCheckbox, DSComboBox, DSRadio, DSTextBox, DSToggle } from "@elliemae/ds-form";
|
|
5
|
+
import { DSDropdownMenu } from "@elliemae/ds-dropdownmenu";
|
|
6
|
+
import * as renderers from "../../components/renderers";
|
|
20
7
|
const components = {
|
|
21
8
|
DSButton,
|
|
22
9
|
DSCheckbox,
|
|
@@ -26,31 +13,22 @@ const components = {
|
|
|
26
13
|
DSToggle,
|
|
27
14
|
DSDropdownMenu
|
|
28
15
|
};
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
props
|
|
33
|
-
} = _ref2;
|
|
34
|
-
let {
|
|
35
|
-
rowData
|
|
36
|
-
} = _ref3;
|
|
37
|
-
|
|
38
|
-
let {
|
|
39
|
-
type = 'DSTextBox',
|
|
40
|
-
handlers
|
|
41
|
-
} = _ref,
|
|
42
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
43
|
-
|
|
44
|
-
const Component = components[type] || index[type];
|
|
45
|
-
const {
|
|
46
|
-
customHandlers,
|
|
47
|
-
rowKey
|
|
48
|
-
} = props;
|
|
16
|
+
const getRendererComponent = ({ props }, { type = "DSTextBox", handlers, ...rest }, { rowData }) => {
|
|
17
|
+
const Component = components[type] || renderers[type];
|
|
18
|
+
const { customHandlers, rowKey } = props;
|
|
49
19
|
const mappedHandlers = {};
|
|
50
|
-
Object.keys(handlers).forEach(key => {
|
|
51
|
-
mappedHandlers[handlers[key]] = () => typeof customHandlers[key] ===
|
|
20
|
+
Object.keys(handlers).forEach((key) => {
|
|
21
|
+
mappedHandlers[handlers[key]] = () => typeof customHandlers[key] === "function" ? customHandlers[key](rowData, rowData[rowKey]) : null;
|
|
52
22
|
});
|
|
53
|
-
return
|
|
23
|
+
return /* @__PURE__ */ React2.createElement(Component, {
|
|
24
|
+
...rowData,
|
|
25
|
+
...mappedHandlers,
|
|
26
|
+
...rest
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
var getRendererComponent_default = getRendererComponent;
|
|
30
|
+
export {
|
|
31
|
+
getRendererComponent_default as default,
|
|
32
|
+
getRendererComponent
|
|
54
33
|
};
|
|
55
|
-
|
|
56
|
-
export { getRendererComponent as default };
|
|
34
|
+
//# sourceMappingURL=getRendererComponent.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/custom-cell-renderer/getRendererComponent.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { DSButton } from '@elliemae/ds-button';\nimport { DSCheckbox, DSComboBox, DSRadio, DSTextBox, DSToggle } from '@elliemae/ds-form';\nimport { DSDropdownMenu } from '@elliemae/ds-dropdownmenu';\nimport * as renderers from '../../components/renderers';\n\nconst components = {\n DSButton,\n DSCheckbox,\n DSComboBox,\n DSRadio,\n DSTextBox,\n DSToggle,\n DSDropdownMenu,\n};\n\nconst getRendererComponent = ({ props }, { type = 'DSTextBox', handlers, ...rest }, { rowData }) => {\n const Component = components[type] || renderers[type];\n const { customHandlers, rowKey } = props;\n const mappedHandlers = {};\n\n Object.keys(handlers).forEach((key) => {\n mappedHandlers[handlers[key]] = () =>\n typeof customHandlers[key] === 'function' ? customHandlers[key](rowData, rowData[rowKey]) : null;\n });\n return <Component {...rowData} {...mappedHandlers} {...rest} />;\n};\n\nexport { getRendererComponent };\nexport default getRendererComponent;\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AAEA,MAAM,aAAa;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAGF,MAAM,uBAAuB,CAAC,EAAE,SAAS,EAAE,OAAO,aAAa,aAAa,QAAQ,EAAE,cAAc;AAClG,QAAM,YAAY,WAAW,SAAS,UAAU;AAChD,QAAM,EAAE,gBAAgB,WAAW;AACnC,QAAM,iBAAiB;AAEvB,SAAO,KAAK,UAAU,QAAQ,CAAC,QAAQ;AACrC,mBAAe,SAAS,QAAQ,MAC9B,OAAO,eAAe,SAAS,aAAa,eAAe,KAAK,SAAS,QAAQ,WAAW;AAAA;AAEhG,SAAO,qCAAC,WAAD;AAAA,OAAe;AAAA,OAAa;AAAA,OAAoB;AAAA;AAAA;AAIzD,IAAO,+BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/custom-cell-renderer/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "export { CustomRendererPlugin } from './CustomRendererPlugin';\n"],
|
|
5
|
+
"mappings": "AAAA;ACAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|