@elliemae/ds-datagrids 3.16.0-next.11 → 3.16.0-next.13
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/DSDataGrid.js +143 -0
- package/dist/cjs/DSDataGrid.js.map +1 -1
- package/dist/cjs/DataGridImpl.js +4 -0
- package/dist/cjs/DataGridImpl.js.map +1 -1
- package/dist/cjs/PaginatedDataGrid.js +4 -0
- package/dist/cjs/PaginatedDataGrid.js.map +1 -1
- package/dist/cjs/blockNames.js +4 -0
- package/dist/cjs/blockNames.js.map +1 -1
- package/dist/cjs/columns/IconColumn.js +4 -0
- package/dist/cjs/columns/IconColumn.js.map +1 -1
- package/dist/cjs/columns/NumberColumn.js +4 -0
- package/dist/cjs/columns/NumberColumn.js.map +1 -1
- package/dist/cjs/components/BodyCell.js +6 -0
- package/dist/cjs/components/BodyCell.js.map +1 -1
- package/dist/cjs/components/BodyList.js +4 -0
- package/dist/cjs/components/BodyList.js.map +1 -1
- package/dist/cjs/components/ColumnVisibilityMenuOption.js +4 -0
- package/dist/cjs/components/ColumnVisibilityMenuOption.js.map +1 -1
- package/dist/cjs/components/ColumnsOptionsMenuSection.js +5 -0
- package/dist/cjs/components/ColumnsOptionsMenuSection.js.map +1 -1
- package/dist/cjs/components/EmptyState.js +4 -0
- package/dist/cjs/components/EmptyState.js.map +1 -1
- package/dist/cjs/components/HeaderCell.js +4 -0
- package/dist/cjs/components/HeaderCell.js.map +1 -1
- package/dist/cjs/components/List.js +4 -0
- package/dist/cjs/components/List.js.map +1 -1
- package/dist/cjs/components/ListItem.js +4 -0
- package/dist/cjs/components/ListItem.js.map +1 -1
- package/dist/cjs/components/NoResults.js +4 -0
- package/dist/cjs/components/NoResults.js.map +1 -1
- package/dist/cjs/components/RowsLoader.js +4 -0
- package/dist/cjs/components/RowsLoader.js.map +1 -1
- package/dist/cjs/components/Table.js +4 -0
- package/dist/cjs/components/Table.js.map +1 -1
- package/dist/cjs/components/TableBody.js +4 -0
- package/dist/cjs/components/TableBody.js.map +1 -1
- package/dist/cjs/components/TableHeader.js +4 -0
- package/dist/cjs/components/TableHeader.js.map +1 -1
- package/dist/cjs/components/footer/addOptionalFooterComponents.js +4 -0
- package/dist/cjs/components/footer/addOptionalFooterComponents.js.map +1 -1
- package/dist/cjs/components/header/PrimaryControls.js +4 -0
- package/dist/cjs/components/header/PrimaryControls.js.map +1 -1
- package/dist/cjs/components/header/addOptionalHeaderComponents.js +4 -0
- package/dist/cjs/components/header/addOptionalHeaderComponents.js.map +1 -1
- package/dist/cjs/components/index.js +4 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/components/renderers/defaultClassedRenderers.js +4 -0
- package/dist/cjs/components/renderers/defaultClassedRenderers.js.map +1 -1
- package/dist/cjs/components/renderers/index.js +4 -0
- package/dist/cjs/components/renderers/index.js.map +1 -1
- package/dist/cjs/components/renderers/renderRowsLoader.js +4 -0
- package/dist/cjs/components/renderers/renderRowsLoader.js.map +1 -1
- package/dist/cjs/components/tableContext.js +4 -0
- package/dist/cjs/components/tableContext.js.map +1 -1
- package/dist/cjs/defaultPlugins.js +4 -0
- package/dist/cjs/defaultPlugins.js.map +1 -1
- package/dist/cjs/index.js +4 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js +4 -0
- package/dist/cjs/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +1 -1
- package/dist/cjs/plugins/body-header-scroll-sync/index.js +4 -0
- package/dist/cjs/plugins/body-header-scroll-sync/index.js.map +1 -1
- package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js +4 -0
- package/dist/cjs/plugins/column-dnd/DndColumnsPlugin.js.map +1 -1
- package/dist/cjs/plugins/column-dnd/decorateGridWithDndColumns.js +4 -0
- package/dist/cjs/plugins/column-dnd/decorateGridWithDndColumns.js.map +1 -1
- package/dist/cjs/plugins/column-dnd/index.js +4 -0
- package/dist/cjs/plugins/column-dnd/index.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/ColumnSizingPlugin.js +4 -0
- package/dist/cjs/plugins/column-sizing/ColumnSizingPlugin.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/columnMeasurerTransformer.js +4 -0
- package/dist/cjs/plugins/column-sizing/columnMeasurerTransformer.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/ext-points/decorateColumn.js +4 -0
- package/dist/cjs/plugins/column-sizing/ext-points/decorateColumn.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/ext-points/getTableProps.js +4 -0
- package/dist/cjs/plugins/column-sizing/ext-points/getTableProps.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/getColumnNameFromProperty.js +4 -0
- package/dist/cjs/plugins/column-sizing/getColumnNameFromProperty.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/index.js +4 -0
- package/dist/cjs/plugins/column-sizing/index.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/useColumnSizeService.js +4 -0
- package/dist/cjs/plugins/column-sizing/useColumnSizeService.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/useStylesheetHelpers.js +5 -0
- package/dist/cjs/plugins/column-sizing/useStylesheetHelpers.js.map +1 -1
- package/dist/cjs/plugins/column-sizing/utils.js +4 -0
- package/dist/cjs/plugins/column-sizing/utils.js.map +1 -1
- package/dist/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js +4 -0
- package/dist/cjs/plugins/custom-cell-renderer/CustomRendererPlugin.js.map +1 -1
- package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js +5 -0
- package/dist/cjs/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +1 -1
- package/dist/cjs/plugins/custom-cell-renderer/getRendererComponent.js +4 -0
- package/dist/cjs/plugins/custom-cell-renderer/getRendererComponent.js.map +1 -1
- package/dist/cjs/plugins/custom-cell-renderer/index.js +4 -0
- package/dist/cjs/plugins/custom-cell-renderer/index.js.map +1 -1
- package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js +4 -0
- package/dist/cjs/plugins/editable/EditableComponents/ComboBox.js.map +1 -1
- package/dist/cjs/plugins/editable/EditableComponents/TextBox.js +4 -0
- package/dist/cjs/plugins/editable/EditableComponents/TextBox.js.map +1 -1
- package/dist/cjs/plugins/editable/EditableComponents/index.js +4 -0
- package/dist/cjs/plugins/editable/EditableComponents/index.js.map +1 -1
- package/dist/cjs/plugins/editable/EditablePlugin.js +4 -0
- package/dist/cjs/plugins/editable/EditablePlugin.js.map +1 -1
- package/dist/cjs/plugins/editable/decorateEditable.js +4 -0
- package/dist/cjs/plugins/editable/decorateEditable.js.map +1 -1
- package/dist/cjs/plugins/editable/getEditorComponent.js +4 -0
- package/dist/cjs/plugins/editable/getEditorComponent.js.map +1 -1
- package/dist/cjs/plugins/editable/index.js +4 -0
- package/dist/cjs/plugins/editable/index.js.map +1 -1
- package/dist/cjs/plugins/expandable-grid/ExpandableColumn.js +4 -0
- package/dist/cjs/plugins/expandable-grid/ExpandableColumn.js.map +1 -1
- package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js +4 -0
- package/dist/cjs/plugins/expandable-grid/ExpandablePlugin.js.map +1 -1
- package/dist/cjs/plugins/expandable-grid/ExpandedRow.js +4 -0
- package/dist/cjs/plugins/expandable-grid/ExpandedRow.js.map +1 -1
- package/dist/cjs/plugins/expandable-grid/ExpandedRowExtra.js +4 -0
- package/dist/cjs/plugins/expandable-grid/ExpandedRowExtra.js.map +1 -1
- package/dist/cjs/plugins/expandable-grid/index.js +4 -0
- package/dist/cjs/plugins/expandable-grid/index.js.map +1 -1
- package/dist/cjs/plugins/expandable-grid/useExpandGridState.js +4 -0
- package/dist/cjs/plugins/expandable-grid/useExpandGridState.js.map +1 -1
- package/dist/cjs/plugins/export-data/ExportDataPlugin.js +4 -0
- package/dist/cjs/plugins/export-data/ExportDataPlugin.js.map +1 -1
- package/dist/cjs/plugins/export-data/index.js +4 -0
- package/dist/cjs/plugins/export-data/index.js.map +1 -1
- package/dist/cjs/plugins/filterable/FilterablePlugin.js +4 -0
- package/dist/cjs/plugins/filterable/FilterablePlugin.js.map +1 -1
- package/dist/cjs/plugins/filterable/addFilterToColumn.js +4 -0
- package/dist/cjs/plugins/filterable/addFilterToColumn.js.map +1 -1
- package/dist/cjs/plugins/filterable/components/FilterableHeader.js +4 -0
- package/dist/cjs/plugins/filterable/components/FilterableHeader.js.map +1 -1
- package/dist/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +5 -0
- package/dist/cjs/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +1 -1
- package/dist/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js +4 -0
- package/dist/cjs/plugins/filterable/components/filterable-menus/SingleDateFilterMenu.js.map +1 -1
- package/dist/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +5 -0
- package/dist/cjs/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +1 -1
- package/dist/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js +4 -0
- package/dist/cjs/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +1 -1
- package/dist/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js +4 -0
- package/dist/cjs/plugins/filterable/components/filterable-menus/defaultDateFormat.js.map +1 -1
- package/dist/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js +4 -0
- package/dist/cjs/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +1 -1
- package/dist/cjs/plugins/filterable/filterableFormatter.js +4 -0
- package/dist/cjs/plugins/filterable/filterableFormatter.js.map +1 -1
- package/dist/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js +4 -0
- package/dist/cjs/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +1 -1
- package/dist/cjs/plugins/filterable/filtering-helper/strategiesOperators.js +4 -0
- package/dist/cjs/plugins/filterable/filtering-helper/strategiesOperators.js.map +1 -1
- package/dist/cjs/plugins/filterable/helper.js +4 -0
- package/dist/cjs/plugins/filterable/helper.js.map +1 -1
- package/dist/cjs/plugins/filterable/index.js +4 -0
- package/dist/cjs/plugins/filterable/index.js.map +1 -1
- package/dist/cjs/plugins/filterable/useFilterableState.js +4 -0
- package/dist/cjs/plugins/filterable/useFilterableState.js.map +1 -1
- package/dist/cjs/plugins/grouping-by/GroupingByPlugin.js +4 -0
- package/dist/cjs/plugins/grouping-by/GroupingByPlugin.js.map +1 -1
- package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js +16 -8
- package/dist/cjs/plugins/grouping-grid/GroupingPlugin.js.map +1 -1
- package/dist/cjs/plugins/grouping-grid/walkStrategy.js +4 -0
- package/dist/cjs/plugins/grouping-grid/walkStrategy.js.map +1 -1
- package/dist/cjs/plugins/index.js +4 -0
- package/dist/cjs/plugins/index.js.map +1 -1
- package/dist/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js +4 -0
- package/dist/cjs/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +1 -1
- package/dist/cjs/plugins/infinite-scrolling/index.js +4 -0
- package/dist/cjs/plugins/infinite-scrolling/index.js.map +1 -1
- package/dist/cjs/plugins/pagination/PaginationPlugin.js +5 -0
- package/dist/cjs/plugins/pagination/PaginationPlugin.js.map +1 -1
- package/dist/cjs/plugins/pagination/components/Pagination.js +4 -0
- package/dist/cjs/plugins/pagination/components/Pagination.js.map +1 -1
- package/dist/cjs/plugins/pagination/components/Paginator.js +4 -0
- package/dist/cjs/plugins/pagination/components/Paginator.js.map +1 -1
- package/dist/cjs/plugins/pagination/components/PerPageDropdown.js +4 -0
- package/dist/cjs/plugins/pagination/components/PerPageDropdown.js.map +1 -1
- package/dist/cjs/plugins/pagination/helper.js +4 -0
- package/dist/cjs/plugins/pagination/helper.js.map +1 -1
- package/dist/cjs/plugins/pagination/index.js +4 -0
- package/dist/cjs/plugins/pagination/index.js.map +1 -1
- package/dist/cjs/plugins/pagination/usePaginationState.js +4 -0
- package/dist/cjs/plugins/pagination/usePaginationState.js.map +1 -1
- package/dist/cjs/plugins/resizable/ResizablePlugin.js +4 -0
- package/dist/cjs/plugins/resizable/ResizablePlugin.js.map +1 -1
- package/dist/cjs/plugins/resizable/decorateResizable.js +4 -0
- package/dist/cjs/plugins/resizable/decorateResizable.js.map +1 -1
- package/dist/cjs/plugins/resizable/index.js +4 -0
- package/dist/cjs/plugins/resizable/index.js.map +1 -1
- package/dist/cjs/plugins/resizable/useResizeHandle.js +8 -1
- package/dist/cjs/plugins/resizable/useResizeHandle.js.map +1 -1
- package/dist/cjs/plugins/resizable/utils.js +4 -0
- package/dist/cjs/plugins/resizable/utils.js.map +1 -1
- package/dist/cjs/plugins/row-dnd/DndRowsPlugin.js +5 -0
- package/dist/cjs/plugins/row-dnd/DndRowsPlugin.js.map +1 -1
- package/dist/cjs/plugins/row-dnd/index.js +4 -0
- package/dist/cjs/plugins/row-dnd/index.js.map +1 -1
- package/dist/cjs/plugins/selectable/SelectablePlugin.js +4 -0
- package/dist/cjs/plugins/selectable/SelectablePlugin.js.map +1 -1
- package/dist/cjs/plugins/selectable/addSelectableColumn.js +6 -0
- package/dist/cjs/plugins/selectable/addSelectableColumn.js.map +1 -1
- package/dist/cjs/plugins/selectable/helper.js +4 -0
- package/dist/cjs/plugins/selectable/helper.js.map +1 -1
- package/dist/cjs/plugins/selectable/index.js +4 -0
- package/dist/cjs/plugins/selectable/index.js.map +1 -1
- package/dist/cjs/plugins/selectable/selectableFormatter.js +4 -0
- package/dist/cjs/plugins/selectable/selectableFormatter.js.map +1 -1
- package/dist/cjs/plugins/selectable/useSelectableState.js +6 -0
- package/dist/cjs/plugins/selectable/useSelectableState.js.map +1 -1
- package/dist/cjs/plugins/sortable/SortablePlugin.js +4 -0
- package/dist/cjs/plugins/sortable/SortablePlugin.js.map +1 -1
- package/dist/cjs/plugins/sortable/checkIfSortable.js +4 -0
- package/dist/cjs/plugins/sortable/checkIfSortable.js.map +1 -1
- package/dist/cjs/plugins/sortable/index.js +4 -0
- package/dist/cjs/plugins/sortable/index.js.map +1 -1
- package/dist/cjs/plugins/sortable/sortHeaderFormatter.js +4 -0
- package/dist/cjs/plugins/sortable/sortHeaderFormatter.js.map +1 -1
- package/dist/cjs/plugins/sortable/sortTree.js +4 -0
- package/dist/cjs/plugins/sortable/sortTree.js.map +1 -1
- package/dist/cjs/plugins/sortable/sorter.js +5 -0
- package/dist/cjs/plugins/sortable/sorter.js.map +1 -1
- package/dist/cjs/plugins/sortable/useSortableState.js +4 -0
- package/dist/cjs/plugins/sortable/useSortableState.js.map +1 -1
- package/dist/cjs/plugins/toolbar/RowRenderer.js +5 -0
- package/dist/cjs/plugins/toolbar/RowRenderer.js.map +1 -1
- package/dist/cjs/plugins/toolbar/ToolbarPlugin.js +4 -0
- package/dist/cjs/plugins/toolbar/ToolbarPlugin.js.map +1 -1
- package/dist/cjs/plugins/toolbar/ToolbarTrigger.js +5 -0
- package/dist/cjs/plugins/toolbar/ToolbarTrigger.js.map +1 -1
- package/dist/cjs/plugins/toolbar/index.js +4 -0
- package/dist/cjs/plugins/toolbar/index.js.map +1 -1
- package/dist/cjs/plugins/virtualization/AutoHeightList.js +4 -0
- package/dist/cjs/plugins/virtualization/AutoHeightList.js.map +1 -1
- package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js +6 -0
- package/dist/cjs/plugins/virtualization/VirtualizationPlugin.js.map +1 -1
- package/dist/cjs/plugins/virtualization/VirtualizedBody.js +5 -0
- package/dist/cjs/plugins/virtualization/VirtualizedBody.js.map +1 -1
- package/dist/cjs/plugins/virtualization/VirtualizedBodyRow.js +5 -0
- package/dist/cjs/plugins/virtualization/VirtualizedBodyRow.js.map +1 -1
- package/dist/cjs/plugins/virtualization/helper.js +4 -0
- package/dist/cjs/plugins/virtualization/helper.js.map +1 -1
- package/dist/cjs/plugins/virtualization/index.js +4 -0
- package/dist/cjs/plugins/virtualization/index.js.map +1 -1
- package/dist/cjs/renders/CellWithAddons.js +14 -0
- package/dist/cjs/renders/CellWithAddons.js.map +1 -1
- package/dist/cjs/renders/index.js +4 -0
- package/dist/cjs/renders/index.js.map +1 -1
- package/dist/cjs/renders/styled.js +4 -0
- package/dist/cjs/renders/styled.js.map +1 -1
- package/dist/cjs/rowSizes.js +4 -0
- package/dist/cjs/rowSizes.js.map +1 -1
- package/dist/cjs/utilities/getPluginsFromProps.js +4 -0
- package/dist/cjs/utilities/getPluginsFromProps.js.map +1 -1
- package/dist/cjs/utilities/getScrollbarSize.js +4 -0
- package/dist/cjs/utilities/getScrollbarSize.js.map +1 -1
- package/dist/cjs/utilities/normalizeData.js +4 -0
- package/dist/cjs/utilities/normalizeData.js.map +1 -1
- package/dist/esm/DSDataGrid.js +139 -0
- package/dist/esm/DSDataGrid.js.map +1 -1
- package/dist/esm/DataGridImpl.js.map +1 -1
- package/dist/esm/PaginatedDataGrid.js.map +1 -1
- package/dist/esm/columns/IconColumn.js.map +1 -1
- package/dist/esm/components/BodyCell.js +2 -0
- package/dist/esm/components/BodyCell.js.map +1 -1
- package/dist/esm/components/BodyList.js.map +1 -1
- package/dist/esm/components/ColumnsOptionsMenuSection.js +1 -0
- package/dist/esm/components/ColumnsOptionsMenuSection.js.map +1 -1
- package/dist/esm/components/EmptyState.js.map +1 -1
- package/dist/esm/components/NoResults.js.map +1 -1
- package/dist/esm/components/Table.js.map +1 -1
- package/dist/esm/components/TableBody.js.map +1 -1
- package/dist/esm/plugins/body-header-scroll-sync/BodyHeaderScrollSyncPlugin.js.map +1 -1
- package/dist/esm/plugins/column-dnd/DndColumnsPlugin.js.map +1 -1
- package/dist/esm/plugins/column-sizing/columnMeasurerTransformer.js.map +1 -1
- package/dist/esm/plugins/column-sizing/useColumnSizeService.js.map +1 -1
- package/dist/esm/plugins/column-sizing/useStylesheetHelpers.js +1 -0
- package/dist/esm/plugins/column-sizing/useStylesheetHelpers.js.map +1 -1
- package/dist/esm/plugins/column-sizing/utils.js.map +1 -1
- package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js +1 -0
- package/dist/esm/plugins/custom-cell-renderer/addCustomRendererToCell.js.map +1 -1
- package/dist/esm/plugins/custom-cell-renderer/getRendererComponent.js.map +1 -1
- package/dist/esm/plugins/editable/EditablePlugin.js.map +1 -1
- package/dist/esm/plugins/editable/decorateEditable.js.map +1 -1
- package/dist/esm/plugins/editable/getEditorComponent.js.map +1 -1
- package/dist/esm/plugins/expandable-grid/ExpandableColumn.js.map +1 -1
- package/dist/esm/plugins/expandable-grid/ExpandablePlugin.js.map +1 -1
- package/dist/esm/plugins/expandable-grid/ExpandedRow.js.map +1 -1
- package/dist/esm/plugins/expandable-grid/useExpandGridState.js.map +1 -1
- package/dist/esm/plugins/export-data/ExportDataPlugin.js.map +1 -1
- package/dist/esm/plugins/filterable/FilterablePlugin.js.map +1 -1
- package/dist/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js +1 -0
- package/dist/esm/plugins/filterable/components/filterable-menus/DateRangeFilterMenu.js.map +1 -1
- package/dist/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js +1 -0
- package/dist/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map +1 -1
- package/dist/esm/plugins/filterable/components/filterable-menus/TextFilterMenu.js.map +1 -1
- package/dist/esm/plugins/filterable/components/filterable-menus/getFilterMenuByType.js.map +1 -1
- package/dist/esm/plugins/filterable/filtering-helper/filterRowsByQuery.js.map +1 -1
- package/dist/esm/plugins/filterable/filtering-helper/strategiesOperators.js.map +1 -1
- package/dist/esm/plugins/filterable/helper.js.map +1 -1
- package/dist/esm/plugins/grouping-by/GroupingByPlugin.js.map +1 -1
- package/dist/esm/plugins/grouping-grid/GroupingPlugin.js +12 -8
- package/dist/esm/plugins/grouping-grid/GroupingPlugin.js.map +1 -1
- package/dist/esm/plugins/grouping-grid/walkStrategy.js.map +1 -1
- package/dist/esm/plugins/infinite-scrolling/InfiniteScrollPlugin.js.map +1 -1
- package/dist/esm/plugins/pagination/PaginationPlugin.js +1 -0
- package/dist/esm/plugins/pagination/PaginationPlugin.js.map +1 -1
- package/dist/esm/plugins/pagination/components/PerPageDropdown.js.map +1 -1
- package/dist/esm/plugins/resizable/ResizablePlugin.js.map +1 -1
- package/dist/esm/plugins/resizable/useResizeHandle.js +4 -1
- package/dist/esm/plugins/resizable/useResizeHandle.js.map +1 -1
- package/dist/esm/plugins/row-dnd/DndRowsPlugin.js +1 -0
- package/dist/esm/plugins/row-dnd/DndRowsPlugin.js.map +1 -1
- package/dist/esm/plugins/selectable/SelectablePlugin.js.map +1 -1
- package/dist/esm/plugins/selectable/addSelectableColumn.js +2 -0
- package/dist/esm/plugins/selectable/addSelectableColumn.js.map +1 -1
- package/dist/esm/plugins/selectable/helper.js.map +1 -1
- package/dist/esm/plugins/selectable/selectableFormatter.js.map +1 -1
- package/dist/esm/plugins/selectable/useSelectableState.js +2 -0
- package/dist/esm/plugins/selectable/useSelectableState.js.map +1 -1
- package/dist/esm/plugins/sortable/SortablePlugin.js.map +1 -1
- package/dist/esm/plugins/sortable/checkIfSortable.js.map +1 -1
- package/dist/esm/plugins/sortable/sortHeaderFormatter.js.map +1 -1
- package/dist/esm/plugins/sortable/sorter.js +1 -0
- package/dist/esm/plugins/sortable/sorter.js.map +1 -1
- package/dist/esm/plugins/toolbar/RowRenderer.js +1 -0
- package/dist/esm/plugins/toolbar/RowRenderer.js.map +1 -1
- package/dist/esm/plugins/toolbar/ToolbarPlugin.js.map +1 -1
- package/dist/esm/plugins/toolbar/ToolbarTrigger.js +1 -0
- package/dist/esm/plugins/toolbar/ToolbarTrigger.js.map +1 -1
- package/dist/esm/plugins/virtualization/AutoHeightList.js.map +1 -1
- package/dist/esm/plugins/virtualization/VirtualizationPlugin.js +2 -0
- package/dist/esm/plugins/virtualization/VirtualizationPlugin.js.map +1 -1
- package/dist/esm/plugins/virtualization/VirtualizedBody.js +1 -0
- package/dist/esm/plugins/virtualization/VirtualizedBody.js.map +1 -1
- package/dist/esm/plugins/virtualization/VirtualizedBodyRow.js +1 -0
- package/dist/esm/plugins/virtualization/VirtualizedBodyRow.js.map +1 -1
- package/dist/esm/renders/CellWithAddons.js +10 -0
- package/dist/esm/renders/CellWithAddons.js.map +1 -1
- package/dist/esm/renders/styled.js.map +1 -1
- package/dist/esm/utilities/getPluginsFromProps.js.map +1 -1
- package/dist/esm/utilities/normalizeData.js.map +1 -1
- package/package.json +24 -24
package/dist/esm/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.js.map
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/SingleRangeSwitcherMenu.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport {\n DSControlledDateTimePicker,\n DSControlledDateRangePicker,\n DSControlledCheckbox,\n} from '@elliemae/ds-controlled-form';\nimport { DSPopper, PopperPositions as Position } from '@elliemae/ds-popper';\nimport { DatePicker2 } from '@elliemae/ds-icons';\nimport { DSButton } from '@elliemae/ds-button';\nimport { Grid } from '@elliemae/ds-grid';\nimport moment from 'moment';\nimport { styled } from '@elliemae/ds-system';\nimport { DEFAULT_DATE_FORMAT } from './defaultDateFormat.js';\n\nconst StyledGridWrapper = styled(Grid)`\n .notCurrentMonth {\n opacity: ${(props) => (props.enableOutsideDays ? '1' : '0')};\n pointer-events: ${(props) => (props.enableOutsideDays ? 'auto' : 'none')};\n }\n`;\n\n// eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-empty-function\nconst noop = (...args) => {};\n\nconst SingleRangeSwitcherContainer = ({ onChange = noop, enableOutsideDays }) => {\n const [startDate, setStartDate] = useState('');\n const [endDate, setEndDate] = useState('');\n\n // For some reason it worked like this\n const [lastChangeWasPicker, setLastChangeWasPicker] = useState(false);\n\n const [isDateRange, setIsDateRange] = useState(false);\n\n useEffect(() => {\n const startMoment = moment(startDate);\n const endMoment = moment(endDate);\n if (\n lastChangeWasPicker &&\n startDate &&\n !startDate.includes('_') &&\n endDate &&\n !endDate.includes('_') &&\n endMoment.diff(startMoment) >= 0\n ) {\n onChange({ startDate: startMoment, endDate: endMoment });\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [startDate, endDate, lastChangeWasPicker]);\n\n return (\n <StyledGridWrapper\n data-testid=\"date-single-range__wrapper\"\n style={{\n backgroundColor: 'white',\n boxShadow: '0 6px 20px 0 rgb(0 0 0 / 24%)',\n width: '261px',\n display: 'grid',\n justifyContent: 'center',\n }}\n cols={['100%']}\n enableOutsideDays={enableOutsideDays}\n onKeyDown={(e) => e.code === 'Enter' && setLastChangeWasPicker(true)}\n >\n <Grid gutter=\"xxs\" alignItems=\"center\" p=\"xxs\">\n <DSControlledCheckbox\n checked={isDateRange}\n name=\"Date range\"\n label=\"Range\"\n id=\"date-range-switcher-id-internal\"\n onChange={() => {\n setIsDateRange(!isDateRange);\n setStartDate('');\n setEndDate('');\n }}\n />\n <div style={{ width: 'fit-content' }}>\n {isDateRange ? (\n <DSControlledDateRangePicker\n fromDate={startDate}\n onFromDateChange={(_start) => {\n setStartDate(_start);\n setLastChangeWasPicker(false);\n }}\n toDate={endDate}\n onToDateChange={(_end) => {\n setEndDate(_end);\n setLastChangeWasPicker(false);\n }}\n type=\"date-range-inputs\"\n />\n ) : (\n <DSControlledDateTimePicker\n date={startDate}\n onDateChange={(_date) => {\n setLastChangeWasPicker(false);\n setStartDate(_date);\n setEndDate(_date);\n }}\n type=\"date-inputs\"\n />\n )}\n </div>\n </Grid>\n <Grid>\n {isDateRange ? (\n <DSControlledDateRangePicker\n fromDate={startDate}\n onFromDateChange={(_start) => {\n setStartDate(_start);\n setLastChangeWasPicker(true);\n }}\n toDate={endDate}\n onToDateChange={(_end) => {\n setEndDate(_end);\n setLastChangeWasPicker(true);\n }}\n type=\"date-range-picker-controller-only\"\n />\n ) : (\n <DSControlledDateTimePicker\n date={startDate}\n onDateChange={(_date) => {\n setLastChangeWasPicker(true);\n setStartDate(_date);\n setEndDate(_date);\n }}\n type=\"date-picker-controller-only\"\n />\n )}\n </Grid>\n </StyledGridWrapper>\n );\n};\n\nSingleRangeSwitcherContainer.propTypes = {\n onChange: PropTypes.func,\n enableOutsideDays: PropTypes.bool,\n};\n\nconst formatRangeDate = ({ startDate, endDate }, format = DEFAULT_DATE_FORMAT) => {\n const sameDay = startDate.isSame(endDate, 'day');\n if (sameDay) return `${endDate.format(format)}`;\n return `${startDate.format(format)} - ${endDate.format(format)}`;\n};\n\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nconst SingleRangeSwitcherMenu = ({\n column,\n className,\n isMenuOpened = false,\n onOpenMenu = noop,\n placement = Position.BOTTOM_END,\n onAddFilter = noop,\n dateFormatter = formatRangeDate,\n enableOutsideDays = true,\n menuProps,\n}): JSX.Element => (\n <DSPopper\n contentComponent={\n <div className={className}>\n <SingleRangeSwitcherContainer\n enableOutsideDays={enableOutsideDays}\n onChange={({ startDate, endDate }) => {\n startDate.startOf('day');\n endDate.endOf('day');\n onAddFilter(\n {\n group: column.property,\n label: column.label,\n value: dateFormatter({ startDate, endDate }, column.format),\n type: 'date', // todo: create constants for filter types\n filterParams: { start: startDate, end: endDate },\n transformRowValue: (value) => moment(value, column.dateFormat || DEFAULT_DATE_FORMAT),\n operator: 'range',\n },\n column,\n );\n onOpenMenu(false);\n }}\n />\n </div>\n }\n isOpen={isMenuOpened}\n onOpen={onOpenMenu}\n placement={placement}\n showArrow={false}\n triggerComponent={\n <DSButton\n buttonType=\"text\"\n icon={<DatePicker2 />}\n onClick={() => (!isMenuOpened ? onOpenMenu(true) : onOpenMenu(false))}\n size=\"s\"\n />\n }\n zIndex={menuProps.zIndex}\n />\n);\n\nSingleRangeSwitcherMenu.propTypes = {\n column: PropTypes.any,\n className: PropTypes.string,\n isMenuOpened: PropTypes.bool,\n onOpenMenu: PropTypes.func,\n placement: PropTypes.string,\n onAddFilter: PropTypes.func,\n dateFormatter: PropTypes.any,\n enableOutsideDays: PropTypes.bool,\n menuProps: PropTypes.any,\n};\n\nexport { SingleRangeSwitcherMenu };\nexport default SingleRangeSwitcherMenu;\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACiEjB,SACE,KADF;AAhEN,SAAgB,WAAW,gBAAgB;AAC3C,OAAO,eAAe;AACtB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU,mBAAmB,gBAAgB;AACtD,SAAS,mBAAmB;AAC5B,SAAS,gBAAgB;AACzB,SAAS,YAAY;AACrB,OAAO,YAAY;AACnB,SAAS,cAAc;AACvB,SAAS,2BAA2B;AAEpC,MAAM,oBAAoB,OAAO,IAAI;AAAA;AAAA,eAEtB,CAAC,UAAW,MAAM,oBAAoB,MAAM;AAAA,sBACrC,CAAC,UAAW,MAAM,oBAAoB,SAAS;AAAA;AAAA;AAKrE,MAAM,OAAO,IAAI,SAAS;AAAC;AAE3B,MAAM,+BAA+B,CAAC,EAAE,WAAW,MAAM,kBAAkB,MAAM;AAC/E,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,EAAE;AAC7C,QAAM,CAAC,SAAS,UAAU,IAAI,SAAS,EAAE;AAGzC,QAAM,CAAC,qBAAqB,sBAAsB,IAAI,SAAS,KAAK;AAEpE,QAAM,CAAC,aAAa,cAAc,IAAI,SAAS,KAAK;AAEpD,YAAU,MAAM;AACd,UAAM,cAAc,OAAO,SAAS;AACpC,UAAM,YAAY,OAAO,OAAO;AAChC,QACE,uBACA,aACA,CAAC,UAAU,SAAS,GAAG,KACvB,WACA,CAAC,QAAQ,SAAS,GAAG,KACrB,UAAU,KAAK,WAAW,KAAK,GAC/B;AACA,eAAS,EAAE,WAAW,aAAa,SAAS,UAAU,CAAC;AAAA,IACzD;AAAA,EAEF,GAAG,CAAC,WAAW,SAAS,mBAAmB,CAAC;AAE5C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAY;AAAA,MACZ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", "../../../../../../src/plugins/filterable/components/filterable-menus/TextFilterMenu.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport React, { useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { compact } from 'lodash';\nimport { DSDropdownMenu } from '@elliemae/ds-dropdownmenu';\nimport { DSButton } from '@elliemae/ds-button';\nimport { PopperPositions as Position } from '@elliemae/ds-popper';\nimport { Menu, MenuCombobox } from '@elliemae/ds-menu';\nimport { SearchSmall } from '@elliemae/ds-icons';\n\nconst TextFilterMenu = ({\n column,\n menuStyle = {},\n className,\n filters = [],\n isMenuOpened = false,\n onOpenMenu = () => null,\n onClose = () => null,\n placement = Position.BOTTOM_END,\n menuProps = {},\n onAddFilter = () => null,\n onRemoveFilter = () => null,\n maxOptions = 10,\n isMulti = false,\n}) => {\n const { options, ...otherMenuProps } = menuProps;\n\n const generateOption = (option, idx) => <Menu.ItemCheckbox key={idx} label={option.label} name={option.id} />;\n\n const renderOptions = (arr) => arr.map(generateOption);\n\n const filtersForColumn = filters.filter((f) => f.group === column.property);\n\n const initialSelectedOptions = filtersForColumn.map((f) => f.value);\n\n const [selected, setSelected] = useState(initialSelectedOptions);\n\n React.useEffect(() => {\n const filtersForColumn2 = filters.filter((f) => f.group === column.property);\n setSelected(filtersForColumn2.map((f) => f.value));\n }, [filters]);\n\n const filterGroup = column.searchBy || column.property;\n\n const onCloseMulti = () => {\n let nextFilters = [...filters];\n const shouldRemove = [];\n // if selected doesn't includes item, then we have to remove the filter\n // but given that we are maintaining state here and updating the grid state\n // is not implemented on useFilterableState, we have to do this in 2 traverses\n // as doing it in one gives trouble when removing and adding at the same time.\n initialSelectedOptions.forEach((item) => {\n if (!selected.includes(item)) {\n nextFilters = nextFilters.filter((filter) => !(filter.group === filterGroup && filter.value === item));\n shouldRemove.push({ group: filterGroup, pill: { value: item } });\n }\n });\n shouldRemove.forEach((removedFilter) => {\n onRemoveFilter({\n ...removedFilter,\n nextFilters,\n });\n });\n selected.forEach((item) => {\n // if initialSelectedOptions includes item, then we do nothing\n if (!initialSelectedOptions.includes(item)) {\n onAddFilter(\n {\n group: filterGroup,\n label: column.label,\n value: item,\n operator: column?.filter?.operator || 'contains',\n transformRowValue: column.valueTransformation,\n },\n column,\n );\n }\n });\n onClose();\n };\n\n return (\n <DSDropdownMenu\n closeMenuOnItemSelection\n contentStyle={menuStyle}\n customMenu={\n isMulti ? (\n <Menu containerProps={{ id: 'text-filter-menu-multiple' }} className=\"dg-multiple-filter\" visible>\n <Menu.SelectionGroup\n active={selected}\n onSelect={(newValues) => {\n setSelected(newValues);\n }}\n focusOnOpen\n multi\n searchable\n >\n {renderOptions(options)}\n </Menu.SelectionGroup>\n </Menu>\n ) : (\n <MenuCombobox\n {...otherMenuProps}\n className={className}\n dropdownFilterOptions={{\n ...column.dropdownFilterOptions,\n maxOptions,\n }}\n maxWidth={column.filterMenuMaxWidth}\n minWidth={column.filterMenuMinWidth}\n onSelectMenuItem={(selectedValue) => {\n if (selectedValue) {\n onAddFilter(\n {\n group: column.searchBy || column.property,\n label: column.label,\n value: selectedValue,\n operator: column?.filter?.operator || 'contains',\n transformRowValue: column.valueTransformation,\n },\n column,\n );\n onOpenMenu(false);\n }\n }}\n />\n )\n }\n isOpen={isMenuOpened}\n maxWidth={column.filterMenuMaxWidth}\n menuProps={menuProps}\n minWidth={column.filterMenuMinWidth}\n onOpenMenu={onOpenMenu}\n onClose={isMulti ? onCloseMulti : onClose}\n options={compact(options)}\n placement={placement}\n triggerComponent={\n <DSButton\n buttonType=\"text\"\n icon={<SearchSmall />}\n onClick={() => (isMenuOpened ? onOpenMenu(false) : onOpenMenu(true))}\n size=\"s\"\n />\n }\n />\n );\n};\n\nTextFilterMenu.propTypes = {\n column: PropTypes.any,\n menuStyle: PropTypes.shape({}),\n className: PropTypes.string,\n filters: PropTypes.arrayOf(PropTypes.shape({})),\n isMenuOpened: PropTypes.bool,\n onOpenMenu: PropTypes.func,\n onClose: PropTypes.func,\n placement: PropTypes.string,\n menuProps: PropTypes.shape({}),\n onAddFilter: PropTypes.func,\n onRemoveFilter: PropTypes.func,\n maxOptions: PropTypes.number,\n isMulti: PropTypes.bool,\n};\n\nexport { TextFilterMenu };\nexport default TextFilterMenu;\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC2BmB;AA1B1C,OAAOA,UAAS,gBAAgB;AAChC,OAAO,eAAe;AACtB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,mBAAmB,gBAAgB;AAC5C,SAAS,MAAM,oBAAoB;AACnC,SAAS,mBAAmB;AAE5B,MAAM,iBAAiB,CAAC;AAAA,EACtB;AAAA,EACA,YAAY,CAAC;AAAA,EACb;AAAA,EACA,UAAU,CAAC;AAAA,EACX,eAAe;AAAA,EACf,aAAa,MAAM;AAAA,EACnB,UAAU,MAAM;AAAA,EAChB,YAAY,SAAS;AAAA,EACrB,YAAY,CAAC;AAAA,EACb,cAAc,MAAM;AAAA,EACpB,iBAAiB,MAAM;AAAA,EACvB,aAAa;AAAA,EACb,UAAU;AACZ,MAAM;AACJ,QAAM,EAAE,
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC2BmB;AA1B1C,OAAOA,UAAS,gBAAgB;AAChC,OAAO,eAAe;AACtB,SAAS,eAAe;AACxB,SAAS,sBAAsB;AAC/B,SAAS,gBAAgB;AACzB,SAAS,mBAAmB,gBAAgB;AAC5C,SAAS,MAAM,oBAAoB;AACnC,SAAS,mBAAmB;AAE5B,MAAM,iBAAiB,CAAC;AAAA,EACtB;AAAA,EACA,YAAY,CAAC;AAAA,EACb;AAAA,EACA,UAAU,CAAC;AAAA,EACX,eAAe;AAAA,EACf,aAAa,MAAM;AAAA,EACnB,UAAU,MAAM;AAAA,EAChB,YAAY,SAAS;AAAA,EACrB,YAAY,CAAC;AAAA,EACb,cAAc,MAAM;AAAA,EACpB,iBAAiB,MAAM;AAAA,EACvB,aAAa;AA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W;AAAA,UACX,MAAM,oBAAC,eAAY;AAAA,UACnB,SAAS,MAAO,eAAe,WAAW,KAAK,IAAI,WAAW,IAAI;AAAA,UAClE,MAAK;AAAA;AAAA,MACP;AAAA;AAAA,EAEJ;AAEJ;AAEA,eAAe,YAAY;AAAA,EACzB,QAAQ,UAAU;AAAA,EAClB,WAAW,UAAU,MAAM,CAAC,CAAC;AAAA,EAC7B,WAAW,UAAU;AAAA,EACrB,SAAS,UAAU,QAAQ,UAAU,MAAM,CAAC,CAAC,CAAC;AAAA,EAC9C,cAAc,UAAU;AAAA,EACxB,YAAY,UAAU;AAAA,EACtB,SAAS,UAAU;AAAA,EACnB,WAAW,UAAU;AAAA,EACrB,WAAW,UAAU,MAAM,CAAC,CAAC;AAAA,EAC7B,aAAa,UAAU;AAAA,EACvB,gBAAgB,UAAU;AAAA,EAC1B,YAAY,UAAU;AAAA,EACtB,SAAS,UAAU;AACrB;AAGA,IAAO,yBAAQ;",
|
6
6
|
"names": ["React"]
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../../src/plugins/filterable/components/filterable-menus/getFilterMenuByType.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { DateRangeFilterMenu } from './DateRangeFilterMenu.js';\nimport { SingleDateFilterMenu } from './SingleDateFilterMenu.js'; // implement\nimport { SingleRangeSwitcherMenu } from './SingleRangeSwitcherMenu.js'; // implement\nimport { TextFilterMenu } from './TextFilterMenu.js';\n\nconst ComponentTypes = {\n 'date-range': DateRangeFilterMenu,\n 'single-date': SingleDateFilterMenu,\n 'date-switcher': SingleRangeSwitcherMenu,\n string: TextFilterMenu,\n};\n\nexport const getFilterMenuByType = (type) => ComponentTypes[type] || ComponentTypes.string;\n\nexport default getFilterMenuByType;\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,2BAA2B;AACpC,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AACxC,SAAS,sBAAsB;AAE/B,MAAM,iBAAiB;AAAA,EACrB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,QAAQ;AACV;AAEO,MAAM,sBAAsB,CAAC,SAAS,eAAe,
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,2BAA2B;AACpC,SAAS,4BAA4B;AACrC,SAAS,+BAA+B;AACxC,SAAS,sBAAsB;AAE/B,MAAM,iBAAiB;AAAA,EACrB,cAAc;AAAA,EACd,eAAe;AAAA,EACf,iBAAiB;AAAA,EACjB,QAAQ;AACV;AAEO,MAAM,sBAAsB,CAAC,SAAS,eAAe,IAAI,KAAK,eAAe;AAEpF,IAAO,8BAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/filterable/filtering-helper/filterRowsByQuery.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isFunction } from '@elliemae/ds-utilities';\nimport { strategiesOperators } from './strategiesOperators.js';\n\nconst getRuleStrategyOperator = (rule) => rule.strategy || strategiesOperators(rule.operator);\n\nconst executeFilterStrategy = (rule, row) => {\n const { value, field, transform, transformRowValue } = rule;\n if (field === 'all') return Object.values(row).some((colValue) => strategiesOperators('contains')(colValue, value));\n const rowValue = row[field];\n const transformedValue = isFunction(transform) ? transform(value) : value;\n const transformedRowValue = isFunction(transformRowValue) ? transformRowValue(rowValue) : rowValue;\n\n const filterStrategy = getRuleStrategyOperator(rule);\n return filterStrategy(transformedRowValue, transformedValue);\n};\n\nconst filterByRules =\n (rules, condition = 'AND') =>\n (row) =>\n condition === 'AND'\n ? rules.reduce(\n (isFiltered, rule) =>\n rule.rules && rule.rules.length\n ? isFiltered && filterByRules(rule.rules, rule.condition)(row)\n : isFiltered && executeFilterStrategy(rule, row),\n true,\n )\n : rules.some((rule) =>\n rule.rules && rule.rules.length\n ? filterByRules(rule.rules, rule.condition)(row)\n : executeFilterStrategy(rule, row),\n );\n\nexport function filterRowsByQueryGroup(rows, query, composedRows) {\n if (query && query.rules && query.rules.length === 0) return rows;\n const newRows = [];\n const parentMap = {};\n composedRows.forEach((parentRow) => {\n if (parentRow.isGroup) {\n newRows.push({\n ...parentRow,\n _filtered: true,\n });\n } else if (!parentRow.isGroup && filterByRules(query.rules, query.condition)(parentRow.data)) {\n newRows.push({\n ...parentRow,\n _filtered: true,\n });\n parentMap[parentRow.parentNode.id] = true;\n }\n });\n\n return newRows.filter((r) => {\n if (r.isGroup && !parentMap[r.id]) return false;\n return true;\n });\n}\n\nexport const filterRowsByQuery = (rows, query) => rows.filter(filterByRules(query.rules, query.condition));\n\nexport default filterRowsByQuery;\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AAEpC,MAAM,0BAA0B,CAAC,SAAS,KAAK,YAAY,oBAAoB,KAAK,QAAQ;AAE5F,MAAM,wBAAwB,CAAC,MAAM,QAAQ;AAC3C,QAAM,EAAE,OAAO,OAAO,WAAW,kBAAkB,IAAI;AACvD,MAAI,UAAU;AAAO,WAAO,OAAO,OAAO,GAAG,EAAE,KAAK,CAAC,aAAa,oBAAoB,UAAU,EAAE,UAAU,KAAK,CAAC;AAClH,QAAM,WAAW,IAAI;
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,kBAAkB;AAC3B,SAAS,2BAA2B;AAEpC,MAAM,0BAA0B,CAAC,SAAS,KAAK,YAAY,oBAAoB,KAAK,QAAQ;AAE5F,MAAM,wBAAwB,CAAC,MAAM,QAAQ;AAC3C,QAAM,EAAE,OAAO,OAAO,WAAW,kBAAkB,IAAI;AACvD,MAAI,UAAU;AAAO,WAAO,OAAO,OAAO,GAAG,EAAE,KAAK,CAAC,aAAa,o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1C,WAAO;AAAA,EACT,CAAC;AACH;AAEO,MAAM,oBAAoB,CAAC,MAAM,UAAU,KAAK,OAAO,cAAc,MAAM,OAAO,MAAM,SAAS,CAAC;AAEzG,IAAO,4BAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/filterable/filtering-helper/strategiesOperators.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import compare from 'comparejs';\n\nexport const strategiesOperators = (op) =>\n ({\n range: (rowValue, { start, end }) => start <= rowValue && end >= rowValue,\n equal: (value1, value2) => compare.id(value1, value2),\n greaterThan: compare.gt,\n lessThan: compare.lt,\n contains: (rowValue, value) => String(rowValue).toLowerCase().indexOf(String(value).toLowerCase()) !== -1,\n }[op] || compare.id);\n\nexport default strategiesOperators;\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAO,aAAa;AAEb,MAAM,sBAAsB,CAAC,QACjC;AAAA,EACC,OAAO,CAAC,UAAU,EAAE,OAAO,IAAI,MAAM,SAAS,YAAY,OAAO;AAAA,EACjE,OAAO,CAAC,QAAQ,WAAW,QAAQ,GAAG,QAAQ,MAAM;AAAA,EACpD,aAAa,QAAQ;AAAA,EACrB,UAAU,QAAQ;AAAA,EAClB,UAAU,CAAC,UAAU,UAAU,OAAO,QAAQ,EAAE,YAAY,EAAE,QAAQ,OAAO,KAAK,EAAE,YAAY,CAAC,MAAM;AACzG,GAAE,
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,OAAO,aAAa;AAEb,MAAM,sBAAsB,CAAC,QACjC;AAAA,EACC,OAAO,CAAC,UAAU,EAAE,OAAO,IAAI,MAAM,SAAS,YAAY,OAAO;AAAA,EACjE,OAAO,CAAC,QAAQ,WAAW,QAAQ,GAAG,QAAQ,MAAM;AAAA,EACpD,aAAa,QAAQ;AAAA,EACrB,UAAU,QAAQ;AAAA,EAClB,UAAU,CAAC,UAAU,UAAU,OAAO,QAAQ,EAAE,YAAY,EAAE,QAAQ,OAAO,KAAK,EAAE,YAAY,CAAC,MAAM;AACzG,GAAE,EAAE,KAAK,QAAQ;AAEnB,IAAO,8BAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/filterable/helper.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { isFunction, uniqBy, get, groupBy, property } from '@elliemae/ds-utilities';\n\nexport const getFilterLabel = (column, value) => (column.filterLabels ? column.filterLabels[value] || value : value);\n\nexport const getFilterLabels = (column, rows) =>\n uniqBy(rows, property(column.searchBy || column.property))\n .map((row) => {\n const value = get(row, column.searchBy || column.property);\n if (value === undefined) return {};\n const rowColumnValue = String(get(row, column.searchBy || column.property));\n if (isFunction(column.valueTransformation)) {\n const nextValue = column.valueTransformation(rowColumnValue);\n return { id: nextValue, label: nextValue };\n }\n const label = getFilterLabel(column, rowColumnValue);\n return { id: rowColumnValue || label, label };\n })\n .filter((row) => row.id)\n .filter((row) => {\n if (row.id.startsWith) return !row.id.startsWith('grouped-by');\n return true;\n });\n\nexport const getFilterLabelsGroup = (column, rows) => {\n let flat = [];\n rows.forEach((r) => {\n if (r.children) {\n flat = [...flat, ...r.children];\n }\n });\n return getFilterLabels(column, flat);\n};\n\nexport function getFilterValue(filter, column) {\n const { value } = filter;\n\n if (!column) return value;\n\n const { filterOptions, filterLabels } = column;\n\n if (filterOptions) {\n const foundOption = column.filterOptions.filter((option) => option.id === value)[0];\n if (foundOption) return foundOption.label;\n return value;\n }\n if (filterLabels) {\n return filterLabels[value];\n }\n\n return value;\n}\n\nexport function buildFilterArray(newFilter, filters) {\n // if (newFilter.type && newFilter.type === 'date') return [...filters.slice(1), newFilter]\n return uniqBy([...filters, newFilter], (v) => [v.group, v.value].join());\n}\n\nexport const groupFilters = (filters) => filters.filter((filter) => !filter.fixed);\n\nfunction parseFilterToRule(filter) {\n return {\n ...filter,\n value: filter.filterParams || filter.value,\n field: filter.group,\n };\n}\n\nexport function parseFiltersToQuery(filters) {\n const groupedFilters = groupBy(groupFilters(filters), (filter) => filter.group);\n return Object.keys(groupedFilters).reduce(\n (queryResult, field) => {\n const filter = groupedFilters[field];\n if (Array.isArray(filter) && filter.length > 1) {\n // create query group with 'OR' condition\n queryResult.rules.push({\n condition: 'OR',\n rules: filter.map(parseFilterToRule),\n });\n } else {\n queryResult.rules.push(parseFilterToRule(filter[0]));\n }\n return queryResult;\n },\n { condition: 'AND', rules: [] },\n );\n}\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,QAAQ,KAAK,SAAS,gBAAgB;AAEpD,MAAM,iBAAiB,CAAC,QAAQ,UAAW,OAAO,eAAe,OAAO,aAAa,
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,YAAY,QAAQ,KAAK,SAAS,gBAAgB;AAEpD,MAAM,iBAAiB,CAAC,QAAQ,UAAW,OAAO,eAAe,OAAO,aAAa,KAAK,KAAK,QAAQ;AAEvG,MAAM,kBAAkB,CAAC,QAAQ,SACtC,OAAO,MAAM,SAAS,OAAO,YAAY,OAAO,QAAQ,CAAC,EACtD,IAAI,CAAC,QAAQ;AACZ,QAAM,QAAQ,IAAI,KAAK,OAAO,YAAY,OAAO,QAAQ;AACzD,MAAI,UAAU;AAAW,WAAO,CAAC;AACjC,QAAM,iBAAiB,OAAO,IAAI,KAAK,OAAO,YAAY,OAAO,QAAQ,CAAC;AAC1E,MAAI,WAAW,OAAO,mBAAmB,GAAG;AAC1C,UAAM,YAAY,OAAO,oBAAoB,cAAc;AAC3D,WAAO,EAAE,IAAI,WAAW,OAAO,UAAU;AAAA,EAC3C;AACA,QAAM,QAAQ,eAAe,QAAQ,cAAc;AACn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W,OAAO,KAAK;AAC9E,SAAO,OAAO,KAAK,cAAc,EAAE;AAAA,IACjC,CAAC,aAAa,UAAU;AACtB,YAAM,SAAS,eAAe,KAAK;AACnC,UAAI,MAAM,QAAQ,MAAM,KAAK,OAAO,SAAS,GAAG;AAE9C,oBAAY,MAAM,KAAK;AAAA,UACrB,WAAW;AAAA,UACX,OAAO,OAAO,IAAI,iBAAiB;AAAA,QACrC,CAAC;AAAA,MACH,OAAO;AACL,oBAAY,MAAM,KAAK,kBAAkB,OAAO,CAAC,CAAC,CAAC;AAAA,MACrD;AACA,aAAO;AAAA,IACT;AAAA,IACA,EAAE,WAAW,OAAO,OAAO,CAAC,EAAE;AAAA,EAChC;AACF;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-by/GroupingByPlugin.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { createInstancePlugin } from '@elliemae/ds-shared';\nimport { groupBy } from 'lodash';\n\nconst groupedByData = (groupedBy, composedRows) => {\n const grouped = groupBy(composedRows, groupedBy);\n return Object.keys(grouped).map((c, key) => ({\n id: `grouped-by-${groupedBy}-${key}`,\n key: groupedBy,\n value: c,\n children: grouped[c],\n _isGroup: true,\n isGroup: true,\n }));\n};\n\nexport const GroupingByPlugin = createInstancePlugin('groupedByRows', {\n decorateGrid(grid) {\n const {\n composedRows,\n props: { groupedBy },\n } = grid.getInstance();\n grid.composedRows = groupedBy ? groupedByData(groupedBy, composedRows) : composedRows;\n return grid;\n },\n});\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,4BAA4B;AACrC,SAAS,eAAe;AAExB,MAAM,gBAAgB,CAAC,WAAW,iBAAiB;AACjD,QAAM,UAAU,QAAQ,cAAc,SAAS;AAC/C,SAAO,OAAO,KAAK,OAAO,EAAE,IAAI,CAAC,GAAG,SAAS;AAAA,IAC3C,IAAI,cAAc,aAAa;AAAA,IAC/B,KAAK;AAAA,IACL,OAAO;AAAA,IACP,UAAU,QAAQ;AAAA,
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,4BAA4B;AACrC,SAAS,eAAe;AAExB,MAAM,gBAAgB,CAAC,WAAW,iBAAiB;AACjD,QAAM,UAAU,QAAQ,cAAc,SAAS;AAC/C,SAAO,OAAO,KAAK,OAAO,EAAE,IAAI,CAAC,GAAG,SAAS;AAAA,IAC3C,IAAI,cAAc,aAAa;AAAA,IAC/B,KAAK;AAAA,IACL,OAAO;AAAA,IACP,UAAU,QAAQ,CAAC;AAAA,IACnB,UAAU;AAAA,IACV,SAAS;AAAA,EACX,EAAE;AACJ;AAEO,MAAM,mBAAmB,qBAAqB,iBAAiB;AAAA,EACpE,aAAa,MAAM;AACjB,UAAM;AAAA,MACJ;AAAA,MACA,OAAO,EAAE,UAAU;AAAA,IACrB,IAAI,KAAK,YAAY;AACrB,SAAK,eAAe,YAAY,cAAc,WAAW,YAAY,IAAI;AACzE,WAAO;AAAA,EACT;AACF,CAAC;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -80,15 +80,19 @@ const GroupingPlugin = createInstancePlugin("groupedRows", {
|
|
80
80
|
decorateRenderers(renderers, grid) {
|
81
81
|
const Row = renderers.body.row;
|
82
82
|
renderers.body.row = useMemo(
|
83
|
-
() =>
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
83
|
+
() => (
|
84
|
+
// eslint-disable-next-line react/display-name
|
85
|
+
// eslint-disable-next-line react/prop-types
|
86
|
+
function({ isExpanded, ...rowProps }) {
|
87
|
+
const { composedRows } = grid.getInstance();
|
88
|
+
const node = composedRows[rowProps.index] ? composedRows[rowProps.index] : rowProps.rowData;
|
89
|
+
const { groupedRowsRenderHeader } = grid.props;
|
90
|
+
if (node && node._isGroup) {
|
91
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(GroupRowHeaderWrapper, { ...rowProps, children: /* @__PURE__ */ jsx(GroupRowHeaderTitle, { children: groupedRowsRenderHeader ? groupedRowsRenderHeader(node) : "Group" }) }) });
|
92
|
+
}
|
93
|
+
return /* @__PURE__ */ jsx(Row, { ...rowProps });
|
89
94
|
}
|
90
|
-
|
91
|
-
},
|
95
|
+
),
|
92
96
|
[]
|
93
97
|
);
|
94
98
|
return renderers;
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-grid/GroupingPlugin.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\n/* eslint-disable no-underscore-dangle */\nimport React, { useMemo } from 'react';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { VariableSizeList } from 'react-window';\nimport { walkTreeStrategy } from './walkStrategy.js';\nimport { RowSizes } from '../../rowSizes.js';\nimport { dataGridBlockName } from '../../blockNames.js';\n\nconst blockName = `${dataGridBlockName}-group-row-header`;\nconst GroupRowHeaderWrapper = aggregatedClasses('div')(blockName);\nconst GroupRowHeaderTitle = aggregatedClasses('div')(blockName, 'title');\n\nexport const GroupingPlugin = createInstancePlugin('groupedRows', {\n decorateGrid(grid) {\n const { columns, composedRows } = grid.getInstance();\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const detailColumns = useMemo(\n () =>\n columns\n .map((column) => ({\n ...column,\n customRenderer: column.detailCustomRenderer,\n }))\n .filter((col) => !col.expandableColumn),\n [columns],\n );\n const flatRows = [];\n walkTreeStrategy({\n data: composedRows,\n cb: (n) => flatRows.push(n),\n });\n return {\n detailColumns,\n composedRows: flatRows,\n };\n },\n getBodyProps(bodyProps, grid) {\n const { composedRows: rows } = grid.getInstance();\n // implementation of expandable row single column with aggregation\n const getItemSize = (index) => {\n const rowData = rows[index];\n if (!rowData) return RowSizes.normal;\n return rowData._isGroup || rowData.isGroup ? RowSizes.compact : RowSizes.normal;\n };\n // eslint-disable-next-line no-unused-vars\n const getListHeight = () => {\n const size = rows.reduce((h, r) => {\n const rowHeight = r._isGroup || r.isGroup ? RowSizes.compact : RowSizes.normal;\n return h + rowHeight;\n }, 0);\n return size;\n };\n return {\n ...bodyProps,\n getListHeight,\n listComponent: VariableSizeList,\n listProps: { itemSize: getItemSize },\n };\n },\n composeRows: (rows, grid) => {\n const {\n composedRows,\n props: { rowKey },\n } = grid.getInstance();\n\n if (Array.isArray(rows)) {\n const filterIds = rows.map((r) => r.data[rowKey]);\n return composedRows\n .filter((c) => filterIds.includes(c.data[rowKey]))\n .map((r) => ({\n ...r.data,\n children: Array.isArray(r.data.children)\n ? r.data.children.filter((c) => filterIds.includes(c[rowKey]))\n : r.data.children,\n _isGroup: r.isGroup,\n }))\n .filter((g) => g.children === undefined || g.children.length > 0);\n }\n return {\n ...rows,\n allRows: rows.allRows.map((r) => ({\n ...r.data,\n _isGroup: r.isGroup,\n })),\n rows: rows.rows.map((r) => ({\n ...r.data,\n _isGroup: r.isGroup,\n })),\n };\n },\n decorateRenderers(renderers, grid) {\n const Row = renderers.body.row;\n // eslint-disable-next-line react-hooks/rules-of-hooks\n renderers.body.row = useMemo(\n () =>\n // eslint-disable-next-line react/display-name\n // eslint-disable-next-line react/prop-types\n function ({ isExpanded, ...rowProps }) {\n const { composedRows } = grid.getInstance();\n // // https://jira.elliemae.io/browse/PUI-1667\n const node = composedRows[rowProps.index] ? composedRows[rowProps.index] : rowProps.rowData;\n const { groupedRowsRenderHeader } = grid.props;\n // eslint-disable-next-line no-underscore-dangle\n if (node && node._isGroup) {\n return (\n <>\n <GroupRowHeaderWrapper {...rowProps}>\n <GroupRowHeaderTitle>\n {groupedRowsRenderHeader ? groupedRowsRenderHeader(node) : 'Group'}\n </GroupRowHeaderTitle>\n </GroupRowHeaderWrapper>\n </>\n );\n }\n return <Row {...row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I,SAC7D,GACF,GACF;AAAA,UAEJ;AACA,iBAAO,oBAAC,OAAK,GAAG,UAAU;AAAA,QAC5B;AAAA;AAAA,MACF,CAAC;AAAA,IACH;AAEA,WAAO;AAAA,EACT;AACF,CAAC;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/grouping-grid/walkStrategy.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "function getPath(parentNode, index, childrenKey) {\n if (!parentNode) return [index];\n return [...parentNode.path, childrenKey, index];\n}\n\nexport function walkTreeStrategy({\n data,\n childrenKey = 'children',\n level = 0,\n getId = (item) => item.id,\n parentNode,\n shouldWalkChildren = () => true,\n cb,\n}) {\n // eslint-disable-next-line no-loops/no-loops,no-plusplus\n for (let i = 0; i < data.length; i++) {\n const currLevel = level + 1;\n const children = data[i][childrenKey];\n const isGroup = children && !!children.length;\n const node = {\n index: i,\n id: getId(data[i]),\n data: data[i],\n path: getPath(parentNode, i, childrenKey),\n isGroup,\n nestingLevel: currLevel,\n parentNode: parentNode || {\n isGroup: true,\n data: { children: data },\n },\n };\n cb(node);\n if (shouldWalkChildren(node) && children && children.length) {\n walkTreeStrategy({\n data: children,\n level: currLevel,\n parentNode: node,\n shouldWalkChildren,\n cb,\n });\n }\n }\n}\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,YAAY,OAAO,aAAa;AAC/C,MAAI,CAAC;AAAY,WAAO,CAAC,KAAK;AAC9B,SAAO,CAAC,GAAG,WAAW,MAAM,aAAa,KAAK;AAChD;AAEO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,QAAQ,CAAC,SAAS,KAAK;AAAA,EACvB;AAAA,EACA,qBAAqB,MAAM;AAAA,EAC3B;AACF,GAAG;AAED,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,YAAY,QAAQ;AAC1B,UAAM,WAAW,KAAK,
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,YAAY,OAAO,aAAa;AAC/C,MAAI,CAAC;AAAY,WAAO,CAAC,KAAK;AAC9B,SAAO,CAAC,GAAG,WAAW,MAAM,aAAa,KAAK;AAChD;AAEO,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA,cAAc;AAAA,EACd,QAAQ;AAAA,EACR,QAAQ,CAAC,SAAS,KAAK;AAAA,EACvB;AAAA,EACA,qBAAqB,MAAM;AAAA,EAC3B;AACF,GAAG;AAED,WAAS,IAAI,GAAG,IAAI,KAAK,QAAQ,KAAK;AACpC,UAAM,YAAY,QAAQ;AAC1B,UAAM,WAAW,KAAK,CAAC,EAAE,WAAW;AACpC,UAAM,UAAU,YAAY,CAAC,CAAC,SAAS;AACvC,UAAM,OAAO;AAAA,MACX,OAAO;AAAA,MACP,IAAI,MAAM,KAAK,CAAC,CAAC;AAAA,MACjB,MAAM,KAAK,CAAC;AAAA,MACZ,MAAM,QAAQ,YAAY,GAAG,WAAW;AAAA,MACxC;AAAA,MACA,cAAc;AAAA,MACd,YAAY,cAAc;AAAA,QACxB,SAAS;AAAA,QACT,MAAM,EAAE,UAAU,KAAK;AAAA,MACzB;AAAA,IACF;AACA,OAAG,IAAI;AACP,QAAI,mBAAmB,IAAI,KAAK,YAAY,SAAS,QAAQ;AAC3D,uBAAiB;AAAA,QACf,MAAM;AAAA,QACN,OAAO;AAAA,QACP,YAAY;AAAA,QACZ;AAAA,QACA;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACF;AACF;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/infinite-scrolling/InfiniteScrollPlugin.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { useRef, useEffect, useState } from 'react';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\n\n// TODO: EXPORT A SEPARATED INFINITE LOADER GRID\n\nconst registerStateHook = (grid) => {\n const {\n props: { getData, onInfiniteScrolling = () => null },\n actions: { updateRows },\n } = grid;\n\n const loading = useRef(false);\n\n const addMoreData = (data = []) => {\n loading.current = false;\n updateRows((prevRows) => prevRows.concat(data || []));\n };\n\n const doLoadData = async (currentRows) => {\n loading.current = true;\n return Promise.resolve(getData(currentRows)).then(addMoreData);\n };\n\n const loadMoreData = (currentRows) => {\n onInfiniteScrolling(currentRows);\n if (loading.current || !getData) return;\n doLoadData(currentRows);\n };\n\n return {\n actions: {\n loadMoreData,\n },\n };\n};\n\nconst getBodyProps = ({ children, ...props }, grid) => {\n const { loadMoreData } = grid.getInstance().actions;\n\n const [bodyNode, setBodyRef] = useState();\n const prevScroll = useRef();\n prevScroll.current = 0;\n\n const handleBodyScroll = (event, s) => {\n const { target } = event;\n const { scrollHeight, scrollTop, offsetHeight, scrollLeft } = target;\n const { composedRows } = grid.getInstance();\n // prevent horizontal scroll triggering infinite scrolling callbacks\n if (prevScroll.current !== scrollLeft) {\n prevScroll.current = scrollLeft;\n return;\n }\n // todo: clean this. Better approach using another component for the infinite scroll\n if (bodyNode !== target) return;\n if (scrollTop + offsetHeight >= scrollHeight - 1) {\n loadMoreData(composedRows);\n }\n };\n\n useEffect(() => {\n if (bodyNode) {\n bodyNode.addEventListener('scroll', handleBodyScroll);\n }\n return () => {\n if (bodyNode) {\n bodyNode.removeEventListener('scroll', handleBodyScroll);\n }\n };\n }, [bodyNode]);\n\n return {\n ...props,\n listProps: { outerRef: setBodyRef },\n };\n};\n\nexport const InfiniteScrollPlugin = createInstancePlugin('infinite-scroll', {\n registerStateHook,\n getBodyProps,\n});\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,QAAQ,WAAW,gBAA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e,CAAC,gBAAgB;AACpC,wBAAoB,WAAW;AAC/B,QAAI,QAAQ,WAAW,CAAC;AAAS;AACjC,eAAW,WAAW;AAAA,EACxB;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,MACP;AAAA,IACF;AAAA,EACF;AACF;AAEA,MAAM,eAAe,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,SAAS;AACrD,QAAM,EAAE,aAAa,IAAI,KAAK,YAAY,EAAE;AAE5C,QAAM,CAAC,UAAU,UAAU,IAAI,SAAS;AACxC,QAAM,aAAa,OAAO;AAC1B,aAAW,UAAU;AAErB,QAAM,mBAAmB,CAAC,OAAO,MAAM;AACrC,UAAM,EAAE,OAAO,IAAI;AACnB,UAAM,EAAE,cAAc,WAAW,cAAc,WAAW,IAAI;AAC9D,UAAM,EAAE,aAAa,IAAI,KAAK,YAAY;AAE1C,QAAI,WAAW,YAAY,YAAY;AACrC,iBAAW,UAAU;AACrB;AAAA,IACF;AAEA,QAAI,aAAa;AAAQ;AACzB,QAAI,YAAY,gBAAgB,eAAe,GAAG;AAChD,mBAAa,YAAY;AAAA,IAC3B;AAAA,EACF;AAEA,YAAU,MAAM;AACd,QAAI,UAAU;AACZ,eAAS,iBAAiB,UAAU,gBAAgB;AAAA,IACtD;AACA,WAAO,MAAM;AACX,UAAI,UAAU;AACZ,iBAAS,oBAAoB,UAAU,gBAAgB;AAAA,MACzD;AAAA,IACF;AAAA,EACF,GAAG,CAAC,QAAQ,CAAC;AAEb,SAAO;AAAA,IACL,GAAG;AAAA,IACH,WAAW,EAAE,UAAU,WAAW;AAAA,EACpC;AACF;AAEO,MAAM,uBAAuB,qBAAqB,mBAAmB;AAAA,EAC1E;AAAA,EACA;AACF,CAAC;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -33,6 +33,7 @@ const Body = React2.memo(
|
|
33
33
|
noResultsPlaceholder,
|
34
34
|
innerRef,
|
35
35
|
innerBodyRef,
|
36
|
+
// depends on body-header-scroll-sync
|
36
37
|
isPlaceholderActive = false,
|
37
38
|
...otherBodyProps
|
38
39
|
}) => /* @__PURE__ */ jsx(Component, { ...otherBodyProps, innerRef: mergeRefs(innerRef), children: !isPlaceholderActive ? rows.map((row, index) => rowRenderer(row, { index, rowIndex: index }, {})) : /* @__PURE__ */ jsx(NoResults, { innerRef, rowRenderer, children: noResultsPlaceholder }) })
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/pagination/PaginationPlugin.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/display-name */\nimport React, { useMemo } from 'react';\nimport { mergeRefs } from '@elliemae/ds-utilities';\nimport { createInstancePlugin, FocusGrid } from '@elliemae/ds-shared';\nimport { paginate } from './helper.js';\nimport { usePaginationState } from './usePaginationState.js';\nimport { NoResults } from '../../components/NoResults.js';\n\nconst composeRows = (rows, grid) => {\n const {\n state: { pagination },\n props: { groupedRows },\n } = grid.getInstance();\n if (groupedRows) return rows; // disable pagination with grouping\n if (groupedRows) {\n const filterIds = rows.map((r) => r.id);\n return paginate(\n rows\n .filter((c) => filterIds.includes(c.id))\n .map((r) => ({\n ...r,\n _isGroup: r.isGroup,\n })),\n pagination,\n );\n }\n\n return paginate(rows, pagination);\n};\n\nconst Body = React.memo(\n ({\n component: Component,\n rows,\n rowRenderer,\n noResultsPlaceholder,\n innerRef,\n innerBodyRef, // depends on body-header-scroll-sync\n isPlaceholderActive = false,\n ...otherBodyProps\n }) => (\n <Component {...otherBodyProps} innerRef={mergeRefs(innerRef)}>\n {!isPlaceholderActive ? (\n rows.map((row, index) => rowRenderer(row, { index, rowIndex: index }, {}))\n ) : (\n <NoResults innerRef={innerRef} rowRenderer={rowRenderer}>\n {noResultsPlaceholder}\n </NoResults>\n )}\n </Component>\n ),\n);\n\nconst decorateRenderers = (renderers, grid) => {\n const BodyWrapper = renderers.body.wrapper;\n renderers.body.wrapper = useMemo(\n () =>\n function (props) {\n const { hotKeys, shouldRefocus, state } = grid.getInstance();\n return (\n <FocusGrid hotKeys={hotKeys} shouldRefocus={false}>\n <Body {...props} component={BodyWrapper} />\n </FocusGrid>\n );\n },\n [],\n );\n return renderers;\n};\n\nexport const PaginationPlugin = createInstancePlugin('pagination', {\n registerStateHook: usePaginationState,\n decorateRenderers,\n composeRows,\n});\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;AC6Cf;AA5CR,OAAOA,UAAS,eAAe;AAC/B,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB,iBAAiB;AAChD,SAAS,gBAAgB;AACzB,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAE1B,MAAM,cAAc,CAAC,MAAM,SAAS;AAClC,QAAM;AAAA,IACJ,OAAO,EAAE,WAAW;AAAA,IACpB,OAAO,EAAE,YAAY;AAAA,EACvB,IAAI,KAAK,YAAY;AACrB,MAAI;AAAa,WAAO;AACxB,MAAI,aAAa;AACf,UAAM,YAAY,KAAK,IAAI,CAAC,MAAM,EAAE,EAAE;AACtC,WAAO;AAAA,MACL,KACG,OAAO,CAAC,MAAM,UAAU,SAAS,EAAE,EAAE,CAAC,EACtC,IAAI,CAAC,OAAO;AAAA,QACX,GAAG;AAAA,QACH,UAAU,EAAE;AAAA,MACd,EAAE;AAAA,MACJ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,SAAS,MAAM,UAAU;AAClC;AAEA,MAAM,OAAOA,OAAM;AAAA,EACjB,CAAC;AAAA,IACC,WAAW;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,sBAAsB;AAAA,
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;AC6Cf;AA5CR,OAAOA,UAAS,eAAe;AAC/B,SAAS,iBAAiB;AAC1B,SAAS,sBAAsB,iBAAiB;AAChD,SAAS,gBAAgB;AACzB,SAAS,0BAA0B;AACnC,SAAS,iBAAiB;AAE1B,MAAM,cAA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,CAAC;",
|
6
6
|
"names": ["React"]
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../../scripts/build/transpile/react-shim.js", "../../../../../src/plugins/pagination/components/PerPageDropdown.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport memoize from 'memoize-one';\nimport { range } from '@elliemae/ds-utilities';\nimport { DSComboBox, components } from '@elliemae/ds-form';\n\nconst SingleValue = ({ children, ...props }) => (\n <components.SingleValue {...props}>\n {children} <span>per page</span>\n </components.SingleValue>\n);\n\nconst generateOption = (value) => ({\n value,\n label: value,\n});\nconst getOptions = memoize((step, min, max) => {\n const options = range(min, max + step, step).map(generateOption);\n return min === 0 ? options.slice(1, options.length) : options;\n});\n\nconst PerPageDropdown = ({ min = 0, max = 100, step = 5, value = 0, onChange = () => null }) => {\n const options = getOptions(step, min, max);\n return (\n <DSComboBox\n className=\"per-page-dropdown\"\n components={{\n SingleValue,\n }}\n containerProps={{\n 'data-testid': 'per-page-dropdown',\n }}\n maxOptions={10}\n onChange={onChange}\n options={options}\n searchable={false}\n value={value}\n />\n );\n};\n\nexport { PerPageDropdown };\nexport default PerPageDropdown;\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACMrB,SACa,KADb;AALF,OAAO,aAAa;AACpB,SAAS,aAAa;AACtB,SAAS,YAAY,kBAAkB;AAEvC,MAAM,cAAc,CAAC,EAAE,
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACMrB,SACa,KADb;AALF,OAAO,aAAa;AACpB,SAAS,aAAa;AACtB,SAAS,YAAY,kBAAkB;AAEvC,MAAM,cAAc,CAAC,EAAE,UAAU,GAAG,MAAM,MACxC,qBAAC,WAAW,aAAX,EAAwB,GAAG,OACzB;AAAA;AAAA,EAAS;AAAA,EAAC,oBAAC,UAAK,sBAAQ;AAAA,GAC3B;AAGF,MAAM,iBAAiB,CAAC,WAAW;AAAA,EACjC;AAAA,EACA,OAAO;AACT;AACA,MAAM,aAAa,QAAQ,CAAC,MAAM,KAAK,QAAQ;AAC7C,QAAM,UAAU,MAAM,KAAK,MAAM,MAAM,IAAI,EAAE,IAAI,cAAc;AAC/D,SAAO,QAAQ,IAAI,QAAQ,MAAM,GAAG,QAAQ,MAAM,IAAI;AACxD,CAAC;AAED,MAAM,kBAAkB,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,OAAO,GAAG,QAAQ,GAAG,WAAW,MAAM,KAAK,MAAM;AAC9F,QAAM,UAAU,WAAW,MAAM,KAAK,GAAG;AACzC,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAU;AAAA,MACV,YAAY;AAAA,QACV;AAAA,MACF;AAAA,MACA,gBAAgB;AAAA,QACd,eAAe;AAAA,MACjB;AAAA,MACA,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ;AAAA;AAAA,EACF;AAEJ;AAGA,IAAO,0BAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/ResizablePlugin.tsx"],
|
4
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';\nimport { addResizableToColumn, resizableFormatter } from './decorateResizable.js';\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,YAAY,WAAW;ACEvB,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC,SAAS,sBAAsB,0BAA0B;AAEzD,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,EACF,IAAI,KAAK;AAET,QAAM,EAAE,iBAAiB,IAAI,KAAK,YAAY;AAI9C,QAAM,WAAW,iBAAiB,UAAU,CAAC,QAAQ,IAAI,aAAa,OAAO,QAAQ;AACrF,QAAM,SAAS,aAAa,iBAAiB,SAAS;AAEtD,MAAI,CAAC,qBAAqB,MAAM;AAAG,WAAO;AAC1C,SAAO;AAAA,IACL;AAAA,IACA,mBAAmB;AAAA,MACjB,aAAa,MAAM;AACjB,aAAK,WAAW,UAAU;AAC1B,aAAK,cAAc;AACnB,sBAAc;AACd,uBAAe,iBAAiB,EAAE,OAAO,CAAC;AAAA,MAC5C;AAAA,MACA,QAAQ,CAAC,OAAO,eAAe;AAC7B,cAAM,EAAE,gBAAgB,KAAK,IAAI,KAAK,YAAY;AAClD,YAAI,UAAU,YAAY;AACxB,gBAAM,UAAU,eAAe,QAAQ,OAAO,
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC,SAAS,sBAAsB,0BAA0B;AAEzD,MAAM,OAAO,MAAM;AAEnB,MAAM,oBAAoB;AAG1B,MAAM,iBAAiB,CAAC,QAAQ,M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AAClB,YAAI;AACF,gBAAM,QAAQ,KAAK,YAAY,EAAE,KAAK,KAAK,QAAQ;AACnD,gBAAM,MAAM,OAAO,KAAK,KAAK,eAAe,OAAO,EAAE,OAAO,CAAC,GAAG,MAAM,KAAK,eAAe,QAAQ,CAAC,IAAI,GAAG,CAAC;AAC3G,gBAAM,UAAU,KAAK,iBAAiB,KAAK,QAAQ,SAAS,CAAC,EAAE;AAC/D,cAAI,MAAM,OAAO;AACf,kBAAM,UAAU,KAAK,YAAY,EAAE,kBAAkB,QAAQ,OAAO;AACpE,oBAAQ,YAAY,KAAK,eAAe,QAAQ,OAAO,IAAI,QAAQ,GAAG;AACtE,oBAAQ,sBAAsB,KAAK,eAAe,QAAQ,OAAO,IAAI,QAAQ,GAAG;AAChF,iBAAK,YAAY,EAAE,kBAAkB,oBAAoB,KAAK;AAAA,UAChE;AAAA,QACF,SAAS,OAAP;AACA,kBAAQ;AAAA,YACN;AAAA,YACA;AAAA,UACF;AAAA,QACF;AAEA,uBAAe,eAAe;AAAA,UAC5B;AAAA,UACA;AAAA,UACA;AAAA,QACF,CAAC;AACD,eAAO,WAAW,EAAE,OAAO,SAAS;AACpC,aAAK,eAAe;AAAA,MACtB;AAAA,MACA,WAAW,OAAO,YAAY,mBAAmB,SAAS,oBAAoB;AAAA,MAC9E;AAAA,IACF,CAAC;AAAA,EACH;AACF;AAEO,MAAM,kBAAkB,qBAAqB,aAAa;AAAA,EAC/D;AACF,CAAC;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -30,7 +30,10 @@ const useResizeHandle = ({ onDragStart, onDrag, onDragEnd, minWidth = 10, isLast
|
|
30
30
|
startWidth.current = containerRef.current.offsetWidth;
|
31
31
|
triggerMove(onDragStart, event);
|
32
32
|
};
|
33
|
-
const HandleComponent = ({ className = "resize-handle" }) =>
|
33
|
+
const HandleComponent = ({ className = "resize-handle" }) => (
|
34
|
+
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
35
|
+
/* @__PURE__ */ jsx("div", { className, onMouseDown })
|
36
|
+
);
|
34
37
|
return {
|
35
38
|
containerRef,
|
36
39
|
Handle: HandleComponent
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/resizable/useResizeHandle.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React, { useCallback, useRef } from 'react';\n\nexport const useResizeHandle = ({ onDragStart, onDrag, onDragEnd, minWidth = 10, isLast = false }) => {\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(Math.max(startWidth.current - startX.current + event.clientX, minWidth), increasing, {});\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,YAAY,WAAW;AC4CnB;AA5CJ,SAA6B,cAAc;AAEpC,MAAM,kBAAkB,CAAC,EAAE,aAAa,QAAQ,WAAW,WAAW,IAAI,SAAS,MAAM,MAAM;AACpG,QAAM,SAAS,OAAO;AACtB,QAAM,aAAa,OAAO;AAC1B,QAAM,eAAe,OAAO;AAE5B,QAAM,c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AAAA,EAC3B;AAEA,QAAM,YAAY,CAAC,UAAU;AAC3B,UAAM,gBAAgB;AACtB,UAAM,eAAe;AAErB,gBAAY,WAAW,KAAK;AAE5B,aAAS,oBAAoB,aAAa,WAAW;AACrD,aAAS,oBAAoB,WAAW,SAAS;AAAA,EACnD;AAEA,QAAM,cAAc,CAAC,UAAU;AAC7B,UAAM,gBAAgB;AACtB,UAAM,eAAe;AAErB,aAAS,iBAAiB,aAAa,WAAW;AAClD,aAAS,iBAAiB,WAAW,SAAS;AAE9C,WAAO,UAAU,MAAM;AACvB,eAAW,UAAU,aAAa,QAAQ;AAE1C,gBAAY,aAAa,KAAK;AAAA,EAChC;AAEA,QAAM,kBAAkB,CAAC,EAAE,YAAY,gBAAgB;AAAA;AAAA,IAErD,oBAAC,SAAI,WAAsB,aAA0B;AAAA;AAGvD,SAAO;AAAA,IACL;AAAA,IACA,QAAQ;AAAA,EACV;AACF;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -74,6 +74,7 @@ const getBodyProps = (props, grid) => {
|
|
74
74
|
lockAxis: "y",
|
75
75
|
useDragHandle: true,
|
76
76
|
helperClass: "row-drag-helper",
|
77
|
+
// a promise is needed, since sortable it's mounted before it's container
|
77
78
|
getContainer: () => new Promise((resolve) => {
|
78
79
|
setTimeout(() => {
|
79
80
|
resolve(grid.refs.innerBody.current || grid.refs.body.current);
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/row-dnd/DndRowsPlugin.tsx"],
|
4
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, createInstancePlugin } from '@elliemae/ds-shared';\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,YAAY,WAAW;ACoCiB,SAoBhC,UApBgC;AAlCxC,SAAgB,eAAe;AAC/B,SAAS,iBAAiB,mBAAmB,sBAAsB;AACnE,SAAS,uBAAuB;AAChC,SAAS,YAAY;AACrB,SAAS,qBAAqB,4BAA4B;AAG1D,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;AACF;AAEA,MAAM,aAAa,eAAe,MAAM,oBAAC,mBAAgB,WAAU,eAAc,CAAE;AAEnF,MAAM,mBAAmB,CAAC,EAAE,UAAU,UAAU,MAAM,OAAO;AAAA,EAC3D,aAAa;AAAA,EACb,aAAa;AAAA,EACb,WAAW,UAAU,SAAY,WAAW;AAC9C;AAEA,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,EACX;AACA,SAAO;AAAA,IACL;AAAA,MACE,MACE,gCACE,8BAAC,cAAW,GACd;AAAA,MAEF;AAAA,IACF;AAAA,IACA,GAAG;AAAA,EACL;AACF;AAEA,MAAM,eA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AAY,CAAC,SAAS;AACpB,gBAAU,iBAAiB,IAAI,CAAC;AAAA,IAClC;AAAA,IACA,UAAU;AAAA,IACV,eAAe;AAAA,IACf,aAAa;AAAA;AAAA,IAEb,cAAc,MACZ,IAAI,QAAQ,CAAC,YAAY;AACvB,iBAAW,MAAM;AACf,gBAAQ,KAAK,KAAK,UAAU,WAAW,KAAK,KAAK,KAAK,OAAO;AAAA,MAC/D,GAAG,GAAG;AAAA,IACR,CAAC;AAAA,EACL;AACF;AAEA,MAAM,oBAAoB,CAAC,cAAc;AACvC,QAAM,eAAe,UAAU,KAAK;AACpC,QAAM,uBAAuB,UAAU,KAAK;AAE5C,QAAM,MAAM,QAAQ,MAAM,gBAAgB,YAAY,GAAG,CAAC,CAAC;AAE3D,QAAM,cAAc;AAAA,IAClB,MAAM,kBAAkB,CAAC,UAAU,oBAAC,wBAAsB,GAAG,KAAK,OAAO,UAAU,GAAG,CAAE;AAAA,IACxF,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL,GAAG;AAAA,IACH,MAAM;AAAA,MACJ,GAAG,UAAU;AAAA,MACb,SAAS;AAAA,MACT,KAAK;AAAA,IACP;AAAA,EACF;AACF;AAEO,MAAM,gBAAgB,qBAAqB,YAAY;AAAA,EAC5D;AAAA,EACA;AAAA,EACA;AACF,CAAC;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/SelectablePlugin.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react-hooks/rules-of-hooks */\n/* eslint-disable max-lines */\nimport { useEffect, useState, useCallback } from 'react';\nimport cx from 'obj-str';\nimport { isFunction } from '@elliemae/ds-utilities';\nimport { createInstancePlugin } from '@elliemae/ds-shared';\nimport { selectionColumnCreator } from './addSelectableColumn.js';\nimport { useSelectableState } from './useSelectableState.js';\nimport { selectMultipleRow, selectSingleRow } from './helper.js';\n\n// DECORATORS\nconst decorateColumns = (columns, grid) => {\n const {\n props: {\n selectable,\n multiSelectFilterLabel,\n multiSelectFilterOptions,\n multiSelectFilterLabels,\n multiSelectComponent,\n },\n actions: { selectAll: handleSelectAll, selectRow: handleSelectRow },\n state: { selection },\n } = grid;\n\n const createSelectionColumn = selectionColumnCreator({\n grid,\n multiple: selectable === 'multi',\n selectAll: selection.selectAll,\n onSelectAll: handleSelectAll,\n onSelectRow: handleSelectRow,\n multiSelectFilterLabel,\n multiSelectFilterOptions,\n multiSelectFilterLabels,\n multiSelectComponent,\n });\n\n const { showSelectColumn, selectionColumnDefinition } = grid.props;\n\n if (showSelectColumn) {\n const selectionColumn = createSelectionColumn(selectionColumnDefinition);\n return [selectionColumn, ...columns];\n }\n return columns;\n};\n\nconst getRowProps = (rowProps, grid, { rowData }) => {\n const {\n props: { showSelectHighlight, showSelectColumn, rowKey },\n actions: { selectRow },\n } = grid.getInstance();\n\n const { _index } = rowData;\n const isSelected = rowData['metaData.selected'];\n\n if (!showSelectColumn) {\n rowProps.onClick = () => selectRow(rowData[rowKey], _index);\n }\n\n rowProps.className = cx({\n [rowProps.className]: true,\n selected: isSelected,\n 'select-highlight': showSelectHighlight && isSelected,\n });\n\n return rowProps;\n};\n\nconst composeRows = (rows, grid) => {\n const {\n props: { isRowSelected, multiple, rowKey },\n state: { selection },\n } = grid.getInstance();\n\n const selectionPredicate = (row) =>\n isFunction(isRowSelected) ? isRowSelected(row) : !!selection.selectedRows[row[rowKey]];\n\n return multiple ? selectMultipleRow(rows, selectionPredicate) : selectSingleRow(rows, selectionPredicate);\n};\n\nconst decorateGrid = (grid) => {\n // const handler = useRef();\n const {\n props: { isRowSelected, rowKey },\n actions: { selectRow },\n state: { selection },\n } = grid.getInstance();\n const [shiftPressed, setShiftPressed] = useState(false);\n const [lastSelectedRow, setLastSelectedRow] = useState(null);\n\n const selectRowHandler = useCallback(\n (rowData, index) => () => selectRow(rowData[rowKey], index, shiftPressed),\n [isRowSelected, selection, shiftPressed],\n );\n\n useEffect(() => {\n const keyDownListener = (event) => {\n if (\n event.key === 'Shift' &&\n event.target.tagName.toLowerCase() !== 'input' &&\n event.target.parentNode.className !== 'em-ds-combobox__input'\n ) {\n setShiftPressed(true);\n }\n };\n const keyUpListener = (event) => {\n if (\n event.key === 'Shift' &&\n event.target.tagName.toLowerCase() !== 'input' &&\n event.target.parentNode.className !== 'em-ds-combobox__input'\n ) {\n setShiftPressed(false);\n }\n };\n window.addEventListener('keydown', keyDownListener);\n window.addEventListener('keyup', keyUpListener);\n return () => {\n window.removeEventListener('keydown', keyDownListener);\n window.removeEventListener('keyup', keyUpListener);\n };\n });\n\n return {\n shiftPressed,\n selectRowHandler,\n setLastSelectedRow,\n lastSelectedRow,\n };\n};\n\nexport const SelectablePlugin = createInstancePlugin('selectable', {\n decorateGrid,\n registerStateHook: useSelectableState,\n decorateColumns,\n getRowProps,\n composeRows,\n registerHotKeys(grid) {\n return [\n {\n key: 'space',\n handler: ({ rowIndex }) => {\n const {\n composedRows,\n props: { rowKey },\n actions: { selectRow },\n } = grid.getInstance();\n const rows = composedRows.rows || composedRows;\n const row = rows[rowIndex];\n if (!row) return;\n selectRow(row[rowKey], rowIndex);\n },\n },\n {\n key: 'ctrl+a',\n handler: () => {\n const {\n state: { selection },\n actions: { selectAll },\n } = grid.getInstance();\n\n selectAll(!selection.selectAll);\n },\n },\n ];\n },\n});\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEvB,SAAS,WAAW,UAAU,mBAAmB;AACjD,OAAO,QAAQ;AACf,SAAS,kBAAkB;AAC3B,SAAS,4BAA4B;AACrC,SAAS,8BAA8B;AACvC,SAAS,0BAA0B;AACnC,SAAS,mBAAmB,uBAAuB;AAGnD,MAAM,kBAAkB,CAAC,SAAS,SAAS;AACzC,QAAM;AAAA,IACJ,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;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AK,QAAQ;AACzB,cAAI,CAAC;AAAK;AACV,oBAAU,IAAI,MAAM,GAAG,QAAQ;AAAA,QACjC;AAAA,MACF;AAAA,MACA;AAAA,QACE,KAAK;AAAA,QACL,SAAS,MAAM;AACb,gBAAM;AAAA,YACJ,OAAO,EAAE,UAAU;AAAA,YACnB,SAAS,EAAE,UAAU;AAAA,UACvB,IAAI,KAAK,YAAY;AAErB,oBAAU,CAAC,UAAU,SAAS;AAAA,QAChC;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -8,10 +8,12 @@ function selectionColumnCreator({
|
|
8
8
|
onSelectRow,
|
9
9
|
onSelectAll,
|
10
10
|
multiple,
|
11
|
+
// backward compatibility: later this needed to be passed through column definition
|
11
12
|
multiSelectFilterLabel,
|
12
13
|
multiSelectFilterOptions,
|
13
14
|
multiSelectFilterLabels,
|
14
15
|
multiSelectComponent
|
16
|
+
// favor selectionComponent
|
15
17
|
}) {
|
16
18
|
const {
|
17
19
|
props: { rowKey }
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/addSelectableColumn.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { appendCellFormatter, appendHeaderFormatter } from '@elliemae/ds-shared';\nimport { selectableFormatter } from './selectableFormatter.js';\n\nexport function selectionColumnCreator({\n grid,\n selectAll,\n selectionComponent,\n onSelectRow,\n onSelectAll,\n multiple,\n\n // backward compatibility: later this needed to be passed through column definition\n multiSelectFilterLabel,\n multiSelectFilterOptions,\n multiSelectFilterLabels,\n multiSelectComponent, // favor selectionComponent\n}) {\n const {\n props: { rowKey },\n } = grid;\n\n return ({\n visible = true,\n isDataColumn = false,\n width = 40,\n minWidth,\n cellRenderer,\n headerCellRenderer,\n customRenderer,\n header,\n ...column\n } = {}) => {\n let selectionColumn = {\n ...column,\n property: 'metaData.selected',\n filterLabel: multiSelectFilterLabel,\n filterOptions: multiSelectFilterOptions,\n filterLabels: multiSelectFilterLabels,\n visible,\n width,\n minWidth: minWidth || width,\n isDataColumn,\n };\n selectionColumn = appendCellFormatter(\n selectableFormatter(\n {\n isMultiSelect: multiple,\n renderer: selectionComponent || multiSelectComponent,\n onSelect: onSelectRow,\n },\n grid,\n ),\n )(selectionColumn);\n\n if (multiple) {\n selectionColumn = appendHeaderFormatter(\n selectableFormatter(\n {\n rowKey,\n selectAll,\n isMultiSelect: true,\n isHeader: true,\n className: 'multi-select-wrapper',\n renderer: selectionComponent || multiSelectComponent,\n onSelect: onSelectAll,\n },\n grid,\n ),\n )(selectionColumn);\n }\n return selectionColumn;\n };\n}\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB,6BAA6B;AAC3D,SAAS,2BAA2B;AAE7B,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAG;AACD,QAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,EAClB,IAAI;AAEJ,SAAO,CAAC;AAAA,IACN,UAAU;AAAA,IACV,eAAe;AAAA,IACf,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,qBAAqB,6BAA6B;AAC3D,SAAS,2BAA2B;AAE7B,SAAS,uBAAuB;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AACF,GAAG;AACD,QAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,EAClB,IAAI;AAEJ,SAAO,CAAC;AAAA,IACN,UAAU;AAAA,IACV,eAAe;AAAA,IACf,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG;AAAA,EACL,IAAI,CAAC,MAAM;AACT,QAAI,kBAAkB;AAAA,MACpB,GAAG;AAAA,MACH,UAAU;AAAA,MACV,aAAa;AAAA,MACb,eAAe;AAAA,MACf,cAAc;AAAA,MACd;AAAA,MACA;AAAA,MACA,UAAU,YAAY;AAAA,MACtB;AAAA,IACF;AACA,sBAAkB;AAAA,MAChB;AAAA,QACE;AAAA,UACE,eAAe;AAAA,UACf,UAAU,sBAAsB;AAAA,UAChC,UAAU;AAAA,QACZ;AAAA,QACA;AAAA,MACF;AAAA,IACF,EAAE,eAAe;AAEjB,QAAI,UAAU;AACZ,wBAAkB;AAAA,QAChB;AAAA,UACE;AAAA,YACE;AAAA,YACA;AAAA,YACA,eAAe;AAAA,YACf,UAAU;AAAA,YACV,WAAW;AAAA,YACX,UAAU,sBAAsB;AAAA,YAChC,UAAU;AAAA,UACZ;AAAA,UACA;AAAA,QACF;AAAA,MACF,EAAE,eAAe;AAAA,IACnB;AACA,WAAO;AAAA,EACT;AACF;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/helper.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import { toggleInObject } from '@elliemae/ds-utilities';\n\nexport const checkAllRowsSelected = (rows, selectedRows) => {\n if (rows.length && selectedRows.length === rows.length) return true;\n if (selectedRows.length) return 'mixed';\n return false;\n};\n\nexport const toggleSelectAll = (rows, checked) =>\n !checked ? {} : rows.reduce((nextSelRows, row) => toggleInObject(nextSelRows, row.id, true), {});\n\nexport const toggleSingleSelectable = (selectedRows, id) => (!selectedRows[id] ? toggleInObject({}, id, true) : {});\n\nconst mergeSelectedToMetaData = (selected) => (row) => ({\n ...row,\n 'metaData.selected': selected,\n});\n\nexport const selectSingleRow = (rows, filter) => rows.map((row) => mergeSelectedToMetaData(filter(row))(row));\n\nexport const selectMultipleRow = (rows, isRowSelectedPredicate) =>\n rows.map((row) => mergeSelectedToMetaData(isRowSelectedPredicate(row))(row));\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sBAAsB;AAExB,MAAM,uBAAuB,CAAC,MAAM,iBAAiB;AAC1D,MAAI,KAAK,UAAU,aAAa,WAAW,KAAK;AAAQ,WAAO;AAC/D,MAAI,aAAa;AAAQ,WAAO;AAChC,SAAO;AACT;AAEO,MAAM,kBAAkB,CAAC,MAAM,YACpC,CAAC,UAAU,CAAC,IAAI,KAAK,OAAO,CAAC,aAAa,QAAQ,eAAe,aAAa,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC;AAE1F,MAAM,yBAAyB,CAAC,cAAc,OAAQ,CAAC,aAAa,
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACAvB,SAAS,sBAAsB;AAExB,MAAM,uBAAuB,CAAC,MAAM,iBAAiB;AAC1D,MAAI,KAAK,UAAU,aAAa,WAAW,KAAK;AAAQ,WAAO;AAC/D,MAAI,aAAa;AAAQ,WAAO;AAChC,SAAO;AACT;AAEO,MAAM,kBAAkB,CAAC,MAAM,YACpC,CAAC,UAAU,CAAC,IAAI,KAAK,OAAO,CAAC,aAAa,QAAQ,eAAe,aAAa,IAAI,IAAI,IAAI,GAAG,CAAC,CAAC;AAE1F,MAAM,yBAAyB,CAAC,cAAc,OAAQ,CAAC,aAAa,EAAE,IAAI,eAAe,CAAC,GAAG,IAAI,IAAI,IAAI,CAAC;AAEjH,MAAM,0BAA0B,CAAC,aAAa,CAAC,SAAS;AAAA,EACtD,GAAG;AAAA,EACH,qBAAqB;AACvB;AAEO,MAAM,kBAAkB,CAAC,MAAM,WAAW,KAAK,IAAI,CAAC,QAAQ,wBAAwB,OAAO,GAAG,CAAC,EAAE,GAAG,CAAC;AAErG,MAAM,oBAAoB,CAAC,MAAM,2BACtC,KAAK,IAAI,CAAC,QAAQ,wBAAwB,uBAAuB,GAAG,CAAC,EAAE,GAAG,CAAC;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/selectableFormatter.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable react/prop-types */\n/* eslint-disable indent */\n/* eslint-disable jsx-a11y/no-static-element-interactions,jsx-a11y/click-events-have-key-events,react/display-name */\nimport React, { forwardRef, useEffect, useRef } from 'react';\nimport { isFunction } from '@elliemae/ds-utilities';\nimport { DSCheckbox, DSRadio } from '@elliemae/ds-form';\n\nconst SelectableWrapper = ({ className, children }) => (\n <div className={className} onClick={(e) => e.stopPropagation()}>\n {children}\n </div>\n);\n\nconst SelectableComponent = React.memo(\n forwardRef(\n ({ className, isMultiSelect, isHeader, onSelect, isSelected, value }, ref) => {\n const SelectComponent = isMultiSelect || isHeader ? DSCheckbox : DSRadio;\n\n return (\n <SelectableWrapper className={className}>\n <SelectComponent\n checked={isSelected}\n data-testid=\"column-selectable-component\"\n innerRef={ref}\n onChange={onSelect}\n tabIndex={-1}\n value={value}\n />\n </SelectableWrapper>\n );\n },\n (prev, next) => next.isScrolling,\n ),\n);\n\nconst selectableFormatter = ({ isMultiSelect = false, renderer, className, isHeader, onSelect }, grid) =>\n function (valueRender, extraParams) {\n const { registerFocus } = extraParams;\n const ref = useRef();\n const {\n props: { rowKey },\n state: { selection },\n shiftPressed,\n lastSelectedRow,\n } = grid.getInstance();\n const { rowData, isScrolling } = extraParams;\n\n useEffect(() => {\n if (registerFocus) registerFocus(ref.current);\n }, [ref.current]);\n\n const isSelected = isHeader ? selection.selectAll : !!selection.selectedRows[rowData[rowKey]];\n\n const handleSelect = isHeader\n ? () => onSelect(!isSelected)\n : () => onSelect(rowData[rowKey], extraParams.rowIndex, shiftPressed, lastSelectedRow);\n\n if (isFunction(renderer)) {\n return (\n <SelectableWrapper className={className}>\n {renderer({\n rowData: {},\n ...extraParams,\n value: isSelected,\n isHeader,\n onSelect: handleSelect,\n })}\n </SelectableWrapper>\n );\n }\n\n return (\n <SelectableComponent\n ref={ref}\n className={className}\n isMultiSelect={isMultiSelect}\n isScrolling={isScrolling}\n isSelected={isSelected}\n onSelect={handleSelect}\n value={!isHeader ? rowData[rowKey] : 'header-select-all'}\n />\n );\n };\n\nexport { selectableFormatter };\nexport default selectableFormatter;\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACQrB;AALF,OAAOA,UAAS,YAAY,WAAW,cAAc;AACrD,SAAS,kBAAkB;AAC3B,SAAS,YAAY,eAAe;AAEpC,MAAM,oBAAoB,CAAC,EAAE,WAAW,SAAS,MAC/C,oBAAC,SAAI,WAAsB,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAC1D,UACH;AAGF,MAAM,sBAAsBA,OAAM;AAAA,EAChC;AAAA,IACE,CAAC,EAAE,WAAW,eAAe,UAAU,UAAU,YAAY,MAAM,GAAG,QAAQ;AAC5E,YAAM,kBAAkB,iBAAiB,WAAW,aAAa;AAEjE,aACE,oBAAC,qBAAkB,WACjB;AAAA,QAAC;AAAA;AAAA,UACC,SAAS;AAAA,UACT,eAAY;AAAA,UACZ,UAAU;AAAA,UACV,UAAU;AAAA,UACV,UAAU;AAAA,UACV;AAAA;AAAA,MACF,GACF;AAAA,IAEJ;AAAA,IACA,CAAC,MAAM,SAAS,KAAK;AAAA,EACvB;AACF;AAEA,MAAM,sBAAsB,CAAC,EAAE,gBAAgB,OAAO,UAAU,WAAW,UAAU,SAAS,GAAG,SAC/F,SAAU,aAAa,aAAa;AAClC,QAAM,EAAE,cAAc,IAAI;AAC1B,QAAM,MAAM,OAAO;AACnB,QAAM;AAAA,IACJ,OAAO,EAAE,OAAO;AAAA,IAChB,OAAO,EAAE,UA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QAAI;AAAe,oBAAc,IAAI,OAAO;AAAA,EAC9C,GAAG,CAAC,IAAI,OAAO,CAAC;AAEhB,QAAM,aAAa,WAAW,UAAU,YAAY,CAAC,CAAC,UAAU,aAAa,QAAQ,MAAM,CAAC;AAE5F,QAAM,eAAe,WACjB,MAAM,SAAS,CAAC,UAAU,IAC1B,MAAM,SAAS,QAAQ,MAAM,GAAG,YAAY,UAAU,cAAc,eAAe;AAEvF,MAAI,WAAW,QAAQ,GAAG;AACxB,WACE,oBAAC,qBAAkB,WAChB,mBAAS;AAAA,MACR,SAAS,CAAC;AAAA,MACV,GAAG;AAAA,MACH,OAAO;AAAA,MACP;AAAA,MACA,UAAU;AAAA,IACZ,CAAC,GACH;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,UAAU;AAAA,MACV,OAAO,CAAC,WAAW,QAAQ,MAAM,IAAI;AAAA;AAAA,EACvC;AAEJ;AAGF,IAAO,8BAAQ;",
|
6
6
|
"names": ["React"]
|
7
7
|
}
|
@@ -32,6 +32,8 @@ function useSelectableState(grid) {
|
|
32
32
|
setSelectedRowsState((prevState) => {
|
33
33
|
const { rows: nextRows } = grid.getInstance();
|
34
34
|
const wasSelected = Object.keys(prevState.selectedRows).some(
|
35
|
+
// we need to match softly as the id may be a number
|
36
|
+
// eslint-disable-next-line eqeqeq
|
35
37
|
(elem) => elem == id
|
36
38
|
);
|
37
39
|
let nextSelectedRows = multiple ? toggleInObject(prevState.selectedRows, id, true) : toggleSingleSelectable(prevState.selectedRows, id);
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/selectable/useSelectableState.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable max-lines */\nimport { useDerivedStateFromProps } from '@elliemae/ds-utilities';\nimport { toggleInObject, hashArray, omit } from '@elliemae/ds-utilities';\nimport { checkAllRowsSelected, toggleSelectAll, toggleSingleSelectable } from './helper.js';\n\nfunction deriveSelectedStateFromPropsOnUpdate(rows) {\n return (nextProp = {}, prevProp = {}) => {\n if (nextProp.selectAll !== prevProp.selectAll) {\n const nextSelectedRows = nextProp.selectAll\n ? toggleSelectAll(rows, true)\n : hashArray(nextProp.selectedRows || []);\n return {\n selectedRows: nextSelectedRows,\n selectAll: checkAllRowsSelected(rows, Object.keys(nextSelectedRows)),\n };\n }\n return {\n selectedRows: hashArray(nextProp.selectedRows || []),\n selectAll: checkAllRowsSelected(rows, Object.keys(nextProp.selectedRows)),\n };\n };\n}\n\nexport function useSelectableState(grid) {\n const {\n props: { rowKey = 'id', selectedRows, selectAll, selectable, onSelectRow, onSelectAll },\n rows,\n setLastSelectedRow,\n } = grid.getInstance();\n\n const multiple = selectable === 'multi';\n const [selection, setSelectedRowsState] = useDerivedStateFromProps(\n { selectedRows, selectAll },\n { onUpdate: deriveSelectedStateFromPropsOnUpdate(rows) },\n );\n\n // ACTIONS\n const handleSelectRow = (\n id,\n index,\n shift = false,\n lastSelectedRow = null,\n // eslint-disable-next-line max-params\n ) => {\n setSelectedRowsState((prevState) => {\n const { rows: nextRows } = grid.getInstance();\n const wasSelected = Object.keys(prevState.selectedRows).some(\n // we need to match softly as the id may be a number\n // eslint-disable-next-line eqeqeq\n (elem) => elem == id,\n );\n let nextSelectedRows = multiple\n ? toggleInObject(prevState.selectedRows, id, true)\n : toggleSingleSelectable(prevState.selectedRows, id);\n setLastSelectedRow({ index, mode: wasSelected ? 'deselect' : 'select' });\n if (shift && lastSelectedRow) {\n const prevSmallest = lastSelectedRow.index < index + 1;\n const sliceStart = prevSmallest ? lastSelectedRow.index : index;\n const sliceEnd = prevSmallest ? index + 1 : lastSelectedRow.index + 1;\n const rowSegment = nextRows.slice(sliceStart, sliceEnd).map((row) => row[rowKey]);\n if (lastSelectedRow.mode === 'deselect') {\n nextSelectedRows = omit(prevState.selectedRows, rowSegment);\n } else {\n const selectedSegment = rowSegment.reduce((o, key) => ({ ...o, [key]: true }), {});\n nextSelectedRows = {\n ...prevState.selectedRows,\n ...selectedSegment,\n };\n }\n }\n\n const nextState = {\n selectedRows: nextSelectedRows,\n selectAll: checkAllRowsSelected(nextRows, Object.keys(nextSelectedRows)),\n };\n if (index !== null && index !== undefined) {\n onSelectRow(\n nextRows.filter((row) => nextState.selectedRows[row[rowKey]]),\n nextState.selectAll,\n index,\n );\n }\n\n return nextState;\n });\n };\n\n const handleSelectAll = (checked) => {\n if (!multiple) return;\n setLastSelectedRow(null);\n setSelectedRowsState(() => {\n const { composedRows: nextRows } = grid.getInstance();\n\n const nextState = {\n selectAll: checked,\n selectedRows: toggleSelectAll(nextRows, checked),\n };\n\n onSelectAll(nextState.selectAll);\n onSelectRow(checked ? nextRows : [], nextState.selectAll);\n\n return nextState;\n });\n };\n\n return {\n actions: {\n selectRow: handleSelectRow,\n selectAll: handleSelectAll,\n },\n state: {\n selection,\n },\n };\n}\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACCvB,SAAS,gCAAgC;AACzC,SAAS,gBAAgB,WAAW,YAAY;AAChD,SAAS,sBAAsB,iBAAiB,8BAA8B;AAE9E,SAAS,qCAAqC,MAAM;AAClD,SAAO,CAAC,WAAW,CAAC,GAAG,WAAW,CAAC,MAAM;AACvC,QAAI,SAAS,cAAc,SAAS,WAAW;AAC7C,YAAM,mBAAmB,SAAS,YAC9B,gBAAgB,MAAM,IAAI,IAC1B,UAAU,SAAS,gBAAgB,CAAC,CAAC;AACzC,aAAO;AAAA,QACL,cAAc;AAAA,QACd,WAAW,qBAAqB,MAAM,OAAO,KAAK,gBAAgB,CAAC;AAAA,MACrE;AAAA,IACF;AACA,WAAO;AAAA,MACL,cAAc,UAAU,SAAS,gBAAgB,CAAC,CAAC;AAAA,MACnD,WAAW,qBAAqB,MAAM,OAAO,KAAK,SAAS,YAAY,CAAC;AAAA,I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Q,IAAI,MAAM,CAAC;AAChF,YAAI,gBAAgB,SAAS,YAAY;AACvC,6BAAmB,KAAK,UAAU,cAAc,UAAU;AAAA,QAC5D,OAAO;AACL,gBAAM,kBAAkB,WAAW,OAAO,CAAC,GAAG,SAAS,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,KAAK,IAAI,CAAC,CAAC;AACjF,6BAAmB;AAAA,YACjB,GAAG,UAAU;AAAA,YACb,GAAG;AAAA,UACL;AAAA,QACF;AAAA,MACF;AAEA,YAAM,YAAY;AAAA,QAChB,cAAc;AAAA,QACd,WAAW,qBAAqB,UAAU,OAAO,KAAK,gBAAgB,CAAC;AAAA,MACzE;AACA,UAAI,UAAU,QAAQ,UAAU,QAAW;AACzC;AAAA,UACE,SAAS,OAAO,CAAC,QAAQ,UAAU,aAAa,IAAI,MAAM,CAAC,CAAC;AAAA,UAC5D,UAAU;AAAA,UACV;AAAA,QACF;AAAA,MACF;AAEA,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,QAAM,kBAAkB,CAAC,YAAY;AACnC,QAAI,CAAC;AAAU;AACf,uBAAmB,IAAI;AACvB,yBAAqB,MAAM;AACzB,YAAM,EAAE,cAAc,SAAS,IAAI,KAAK,YAAY;AAEpD,YAAM,YAAY;AAAA,QAChB,WAAW;AAAA,QACX,cAAc,gBAAgB,UAAU,OAAO;AAAA,MACjD;AAEA,kBAAY,UAAU,SAAS;AAC/B,kBAAY,UAAU,WAAW,CAAC,GAAG,UAAU,SAAS;AAExD,aAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL,SAAS;AAAA,MACP,WAAW;AAAA,MACX,WAAW;AAAA,IACb;AAAA,IACA,OAAO;AAAA,MACL;AAAA,IACF;AAAA,EACF;AACF;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/SortablePlugin.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import * as sortabular from 'sortabular';\nimport { compose, isEmpty, orderBy } from '@elliemae/ds-utilities';\nimport { createInstancePlugin, appendHeaderFormatter, mergeClassNameToColumnHeader } from '@elliemae/ds-shared';\nimport { sortHeaderFormatter } from './sortHeaderFormatter.js';\nimport { useSortableState } from './useSortableState.js';\nimport { sorter, sorterGroups } from './sorter.js';\n\nconst decorateColumn = (column, grid) => {\n const {\n props: { isSortableColumnActive = (col) => col.sortable, groupedRows },\n } = grid;\n\n if (groupedRows) return column;\n if (!isSortableColumnActive(column)) return column;\n\n const formatter = sortHeaderFormatter(\n sortabular.sort({\n getSortingColumns: () => grid.getState().sortingColumns || [],\n onSort: grid.actions.sort,\n strategy: sortabular.strategies.byProperty,\n }),\n grid,\n );\n\n return compose(appendHeaderFormatter(formatter), mergeClassNameToColumnHeader('with-sortable'))(column);\n};\n\nconst composeRows = (rows, grid) => {\n const {\n state: { sortingColumns },\n props: { isDataSorted, groupedRows, groupedBy, sortEmptyLast },\n rows: rowsData,\n composedRows,\n decoratedColumns,\n } = grid.getInstance();\n\n const sortingConfig = {\n columns: decoratedColumns,\n sortingColumns: !isEmpty(sortingColumns) && sortingColumns,\n sort: orderBy,\n emptyLast: sortEmptyLast,\n };\n\n // TODO: 1572 FIX\n if (groupedRows && !groupedBy) {\n return !isDataSorted ? sorterGroups(sortingConfig)(composedRows, rowsData, groupedBy) : rows;\n }\n\n return !isDataSorted ? sorter(sortingConfig)(rows) : rows;\n};\n\nexport const SortablePlugin = createInstancePlugin('sortable', {\n registerStateHook: useSortableState,\n decorateColumn,\n composeRows,\n registerHotKeys(grid) {\n return {\n key: 'ctrl+s',\n handler: ({ cellIndex }) => {\n const {\n actions: { sort },\n decoratedColumns,\n } = grid.getInstance();\n const column = decoratedColumns[cellIndex];\n if (!column) return;\n sort(column.property);\n },\n };\n },\n});\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW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WAAW;AAC7B,WAAO,CAAC,eAAe,aAAa,aAAa,EAAE,cAAc,UAAU,SAAS,IAAI;AAAA,EAC1F;AAEA,SAAO,CAAC,eAAe,OAAO,aAAa,EAAE,IAAI,IAAI;AACvD;AAEO,MAAM,iBAAiB,qBAAqB,YAAY;AAAA,EAC7D,mBAAmB;AAAA,EACnB;AAAA,EACA;AAAA,EACA,gBAAgB,MAAM;AACpB,WAAO;AAAA,MACL,KAAK;AAAA,MACL,SAAS,CAAC,EAAE,UAAU,MAAM;AAC1B,cAAM;AAAA,UACJ,SAAS,EAAE,KAAK;AAAA,UAChB;AAAA,QACF,IAAI,KAAK,YAAY;AACrB,cAAM,SAAS,iBAAiB,SAAS;AACzC,YAAI,CAAC;AAAQ;AACb,aAAK,OAAO,QAAQ;AAAA,MACtB;AAAA,IACF;AAAA,EACF;AACF,CAAC;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/checkIfSortable.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "/* eslint-disable no-plusplus */\n/* eslint-disable no-loops/no-loops */\nexport const checkIfSortable = (column, rows) => {\n for (let index = 0; index < rows.length; index++) {\n const element = rows[index][column];\n if (!(element === null || element === undefined)) {\n // PUI-6452\n return true;\n }\n }\n return false;\n};\n\nexport default checkIfSortable;\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACEhB,MAAM,kBAAkB,CAAC,QAAQ,SAAS;AAC/C,WAAS,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;AAChD,UAAM,UAAU,KAAK,
|
5
|
+
"mappings": "AAAA,YAAY,WAAW;ACEhB,MAAM,kBAAkB,CAAC,QAAQ,SAAS;AAC/C,WAAS,QAAQ,GAAG,QAAQ,KAAK,QAAQ,SAAS;AAChD,UAAM,UAAU,KAAK,KAAK,EAAE,MAAM;AAClC,QAAI,EAAE,YAAY,QAAQ,YAAY,SAAY;AAEhD,aAAO;AAAA,IACT;AAAA,EACF;AACA,SAAO;AACT;AAEA,IAAO,0BAAQ;",
|
6
6
|
"names": []
|
7
7
|
}
|
@@ -2,6 +2,6 @@
|
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["../../../../../../scripts/build/transpile/react-shim.js", "../../../../src/plugins/sortable/sortHeaderFormatter.tsx"],
|
4
4
|
"sourcesContent": ["import * as React from 'react';\nexport { React };\n", "import React from 'react';\nimport { aggregatedClasses } from '@elliemae/ds-classnames';\nimport { ArrowheadDown, ArrowheadUp } from '@elliemae/ds-icons';\n\nconst blockName = 'data-grid-sort-header';\n\nconst SortHeaderContainer = aggregatedClasses('div')(blockName);\n\nconst iconColor = ['brand-primary', 800];\n\nconst SortHeader = React.memo(({ value, onClick, sortState }) => {\n const sortIndicator = sortState === 'asc' ? <ArrowheadUp color={iconColor} /> : <ArrowheadDown color={iconColor} />;\n return (\n <SortHeaderContainer onClick={onClick}>\n <span className=\"header-value\">{value}</span>\n {sortState && sortIndicator}\n </SortHeaderContainer>\n );\n});\n\nconst sortHeaderFormatter =\n (sortable, grid) =>\n (value, { columnIndex, property }) => {\n const {\n state: { sortingColumns },\n } = grid.getInstance();\n const { onClick, className } = sortable(value, { columnIndex, property });\n return (\n <SortHeader\n className={className}\n onClick={onClick}\n sortState={sortingColumns[property] && sortingColumns[property].direction}\n value={value}\n />\n );\n };\n\nexport { sortHeaderFormatter };\nexport default sortHeaderFormatter;\n"],
|
5
|
-
"mappings": "AAAA,YAAY,WAAW;ACWuB,cAE1C,YAF0C;AAX9C,OAAOA,YAAW;AAClB,SAAS,yBAAyB;AAClC,SAAS,eAAe,mBAAmB;AAE3C,MAAM,YAAY;AAElB,MAAM,sBAAsB,kBAAkB,KAAK,EAAE,SAAS;AAE9D,MAAM,YAAY,CAAC,iBAAiB,GAAG;AAEvC,MAAM,aAAaA,OAAM,KAAK,CAAC,EAAE,O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