MCPcopy
hub / github.com/palantir/blueprint / MutableTable

Class MutableTable

packages/table-dev-app/src/mutableTable.tsx:309–1198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

307
308// eslint-disable-next-line @typescript-eslint/ban-types
309export class MutableTable extends React.Component<{}, IMutableTableState> {
310 private store = new DenseGridMutableStore<any>();
311
312 private tableInstance: Table;
313 private stateStore: LocalStore<IMutableTableState>;
314
315 private refHandlers = {
316 table: (ref: Table) => (this.tableInstance = ref),
317 };
318
319 public constructor(props: any, context?: any) {
320 super(props, context);
321 this.stateStore = new LocalStore<IMutableTableState>("BP_TABLE_MUTABLE_TABLE_DEV_PREVIEW", true);
322 this.state = this.stateStore.getWithDefaults(DEFAULT_STATE);
323 }
324
325 // React Lifecycle
326 // ===============
327
328 public render() {
329 const layoutBoundary = this.state.enableLayoutBoundary;
330 return (
331 <div className="container">
332 <SlowLayoutStack
333 depth={SLOW_LAYOUT_STACK_DEPTH}
334 enabled={this.state.enableSlowLayout}
335 rootClassName={classNames("table", { "is-inline": this.state.showInline })}
336 branchClassName={"layout-passthrough-fill"}
337 >
338 <div className={layoutBoundary ? "layout-boundary" : "layout-passthrough-fill"}>
339 {this.renderTable()}
340 </div>
341 </SlowLayoutStack>
342 {this.renderSidebar()}
343 </div>
344 );
345 }
346
347 public componentWillMount() {
348 this.resetCellContent();
349 }
350
351 public componentDidMount() {
352 this.syncFocusStyle();
353 }
354
355 // eslint-disable-next-line @typescript-eslint/ban-types
356 public componentWillUpdate(_nextProps: {}, nextState: IMutableTableState) {
357 if (
358 nextState.cellContent !== this.state.cellContent ||
359 nextState.numRows !== this.state.numRows ||
360 nextState.numCols !== this.state.numCols
361 ) {
362 this.resetCellContent(nextState);
363 }
364 }
365
366 public componentDidUpdate() {

Callers

nothing calls this directly

Calls 15

getColumnNameMethod · 0.80
addColumnBeforeMethod · 0.80
addColumnAfterMethod · 0.80
removeColumnMethod · 0.80
addRowBeforeMethod · 0.80
addRowAfterMethod · 0.80
removeRowMethod · 0.80
reorderColumnsMethod · 0.80
reorderRowsMethod · 0.80
setColumnNameMethod · 0.80
cellMethod · 0.80
rowMethod · 0.80

Tested by

no test coverage detected