| 24 | import Markdown from 'dash-table/utils/Markdown'; |
| 25 | |
| 26 | export default class CellFactory { |
| 27 | private get props() { |
| 28 | return this.propsFn(); |
| 29 | } |
| 30 | |
| 31 | constructor( |
| 32 | private readonly propsFn: () => ICellFactoryProps, |
| 33 | private readonly cellContents = derivedCellContents(propsFn), |
| 34 | private readonly cellDropdowns = derivedDropdowns(), |
| 35 | private readonly cellOperations = derivedCellOperations(), |
| 36 | private readonly dataPartialStyles = derivedPartialDataStyles(), |
| 37 | private readonly dataStyles = derivedDataStyles(), |
| 38 | private readonly dataOpStyles = derivedDataOpStyles(), |
| 39 | private readonly cellWrappers = derivedCellWrappers(propsFn), |
| 40 | private readonly relevantStyles = derivedRelevantCellStyles() |
| 41 | ) {} |
| 42 | |
| 43 | private getMarkdown = memoizeOne( |
| 44 | (options: IMarkdownOptions) => new Markdown(options) |
| 45 | ); |
| 46 | |
| 47 | public createCells( |
| 48 | dataEdges: IEdgesMatrices | undefined, |
| 49 | dataOpEdges: IEdgesMatrices | undefined |
| 50 | ) { |
| 51 | const { |
| 52 | active_cell, |
| 53 | applyFocus, |
| 54 | dropdown_conditional, |
| 55 | dropdown, |
| 56 | data, |
| 57 | dropdown_data, |
| 58 | id, |
| 59 | is_focused, |
| 60 | loading_state, |
| 61 | markdown_options, |
| 62 | row_deletable, |
| 63 | row_selectable, |
| 64 | selected_cells, |
| 65 | selected_rows, |
| 66 | setProps, |
| 67 | style_cell, |
| 68 | style_cell_conditional, |
| 69 | style_data, |
| 70 | style_data_conditional, |
| 71 | virtualized, |
| 72 | visibleColumns |
| 73 | } = this.props; |
| 74 | |
| 75 | const relevantStyles = this.relevantStyles( |
| 76 | style_cell, |
| 77 | style_data, |
| 78 | style_cell_conditional, |
| 79 | style_data_conditional |
| 80 | ); |
| 81 | |
| 82 | const partialCellStyles = this.dataPartialStyles( |
| 83 | visibleColumns, |
nothing calls this directly
no test coverage detected
searching dependent graphs…