Options
All
  • Public
  • Public/Protected
  • All
Menu

Component to handle rendering of the tuples as well as Filter, Insert, Update, and Delete subcomponents

Hierarchy

  • Component<TableContentProps, TableContentState>
    • default

Index

Constructors

constructor

  • new default(props: TableContentProps): default
  • Parameters

    • props: TableContentProps

    Returns default

Properties

context

context: any

If using the new style context, re-declare this in your class to be the React.ContextType of your static contextType. Should be used with type annotation or static contextType.

static contextType = MyContext
// For TS pre-3.7:
context!: React.ContextType<typeof MyContext>
// For TS 3.7 and above:
declare context: React.ContextType<typeof MyContext>
see

https://reactjs.org/docs/context.html

Readonly props

props: Readonly<TableContentProps> & Readonly<{ children?: ReactNode }>

refs

refs: {}

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<TableContentState>

Optional Static contextType

contextType: Context<any>

If set, this.context will be set at runtime to the current value of the given Context.

Usage:

type MyContext = number
const Ctx = React.createContext<MyContext>(0)

class Foo extends React.Component {
  static contextType = Ctx
  context!: React.ContextType<typeof Ctx>
  render () {
    return <>My context's value: {this.context}</>;
  }
}
see

https://reactjs.org/docs/context.html#classcontexttype

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<TableContentProps>, nextContext: any): void

Optional UNSAFE_componentWillUpdate

  • UNSAFE_componentWillUpdate(nextProps: Readonly<TableContentProps>, nextState: Readonly<TableContentState>, nextContext: any): void

cellResizeMouseDown

  • cellResizeMouseDown(event: MouseEvent<HTMLDivElement, MouseEvent>, colIndex: number): void
  • Listens for when cell border is selected and stores the index of the column and mouse start position

    Parameters

    • event: MouseEvent<HTMLDivElement, MouseEvent>
    • colIndex: number

    Returns void

cellResizeMouseMove

  • cellResizeMouseMove(event: MouseEvent<HTMLDivElement, MouseEvent>): void
  • Updates the distance the user drags the table column divider

    Parameters

    • event: MouseEvent<HTMLDivElement, MouseEvent>

    Returns void

cellResizeMouseUp

  • cellResizeMouseUp(event: MouseEvent<HTMLDivElement, MouseEvent>): void
  • Listens for when user is done resizing the column, resets drag position stats

    Parameters

    • event: MouseEvent<HTMLDivElement, MouseEvent>

    Returns void

checkIfTableHasNonNullableBlobs

  • checkIfTableHasNonNullableBlobs(): boolean
  • Check if the current table has blob attributes

    Returns boolean

clearTupleSelection

  • clearTupleSelection(): void
  • Clears the staging once delete/update is successful and table content has been modified

    Returns void

Optional componentDidCatch

  • componentDidCatch(error: Error, errorInfo: ErrorInfo): void
  • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

    Parameters

    • error: Error
    • errorInfo: ErrorInfo

    Returns void

Optional componentDidMount

  • componentDidMount(): void
  • Called immediately after a component is mounted. Setting state here will trigger re-rendering.

    Returns void

componentDidUpdate

  • componentDidUpdate(prevProps: TableContentProps, prevState: TableContentState): void
  • Reset the table action sub menu selection upon a new table selection

    Parameters

    • prevProps: TableContentProps
    • prevState: TableContentState

    Returns void

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

  • componentWillReceiveProps(nextProps: Readonly<TableContentProps>, nextContext: any): void

Optional componentWillUnmount

  • componentWillUnmount(): void
  • Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as cancelled network requests, or cleaning up any DOM elements created in componentDidMount.

    Returns void

Optional componentWillUpdate

  • componentWillUpdate(nextProps: Readonly<TableContentProps>, nextState: Readonly<TableContentState>, nextContext: any): void

constructTupleReferenceArray

  • constructTupleReferenceArray(): RefObject<HTMLTableRowElement>[]
  • Helper function to construct the ReactRef arrays for the number of tuples shown per page

    Returns RefObject<HTMLTableRowElement>[]

    an Array of RefObject for each of the entry in the table on the current page

forceUpdate

  • forceUpdate(callback?: () => void): void
  • Parameters

    • Optional callback: () => void
        • (): void
        • Returns void

    Returns void

getCellWidth

  • getCellWidth(colIndex: number): { width: string } | { width: number }
  • Tells the element how to style width of the given table column index

    Parameters

    • colIndex: number

    Returns { width: string } | { width: number }

getCurrentTableActionMenuComponent

  • getCurrentTableActionMenuComponent(): Element
  • Switching return code based this.state.currentSelectedTableActionMenu. Mainly used in the render() function below

    Returns Element

getPrimaryKeys

  • getPrimaryKeys(): string[]
  • Function to get the list of primary attributes for rendering

    Returns string[]

getSecondaryKeys

  • getSecondaryKeys(): string[]
  • Function to get the list of secondary attributes for rendering

    Returns string[]

getShowWarningComponent

  • getShowWarningComponent(): Element
  • Warning that pops up to prevent user from staging multiple entries for delete/update

    Returns Element

Optional getSnapshotBeforeUpdate

  • getSnapshotBeforeUpdate(prevProps: Readonly<TableContentProps>, prevState: Readonly<TableContentState>): any
  • Runs before React applies the result of render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before render causes changes to it.

    Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.

    Parameters

    • prevProps: Readonly<TableContentProps>
    • prevState: Readonly<TableContentState>

    Returns any

getTableActionButtons

  • getTableActionButtons(): Element
  • Handle button rednering with disable feature for Insert Update or Delete based on the table type and return the buttons accordingly

    Returns Element

goBackwardAPage

  • goBackwardAPage(): void
  • Call back function for goBackwardAPage button

    Returns void

goForwardAPage

  • goForwardAPage(): void
  • Call back function for goForwardAPage button

    Returns void

goToFirstPage

  • goToFirstPage(): void
  • Call back function for goToFirstPage button

    Returns void

goToLastPage

  • goToLastPage(): void
  • Call back function for goToLastPage button

    Returns void

handleActionWaitTime

  • handleActionWaitTime(isWaiting: boolean): void
  • Call back for subcomponents to set loading animation

    Parameters

    • isWaiting: boolean

    Returns void

handleCheckedEntry

  • handleCheckedEntry(event: ChangeEvent<HTMLInputElement>, tupleIndex: number): void
  • Function to stage the selected table entries for insert/update/delete process For insert, this will be used for the entry-copy-autofill feature requested. Datatype included in the selectedTableEntry but should we format datatype to DJ style here or right before making the API call?

    Parameters

    • event: ChangeEvent<HTMLInputElement>
    • tupleIndex: number

    Returns void

handleNumberOfTuplesPerPageChange

  • handleNumberOfTuplesPerPageChange(event: ChangeEvent<HTMLInputElement>): void
  • Call back for when the user change the number of tupples to show per page

    Parameters

    • event: ChangeEvent<HTMLInputElement>

      Value should be the number in string format

    Returns void

render

  • render(): Element
  • Returns Element

setCurrentTableActionMenu

  • setCurrentTableActionMenu(tableActionMenu: TableActionType): void
  • Function to handle the hiding/showing of the sub menus including dealing with switching between the table actions sub menu

    Parameters

    • tableActionMenu: TableActionType

      The tableActionMenu that was clicked on

    Returns void

setNewHeaderWidths

  • setNewHeaderWidths(difference: number): void
  • Function to set the new adjusted width (TODO: fix to make sure the fix is for each column using reference)

    Parameters

    • difference: number

      // the distance the user dragged the column divider handle

    Returns void

setState

  • setState<K>(state: null | TableContentState | ((prevState: Readonly<TableContentState>, props: Readonly<TableContentProps>) => null | TableContentState | Pick<TableContentState, K>) | Pick<TableContentState, K>, callback?: () => void): void
  • Type parameters

    • K: "currentSelectedTableActionMenu" | "hideTableActionMenu" | "selectedTupleIndex" | "selectedTuple" | "showWarning" | "isDisabledCheckbox" | "dragStart" | "resizeIndex" | "isWaiting" | "newHeaderWidths" | "initialTableColWidths" | "headerRowReference" | "tuplesReference"

    Parameters

    • state: null | TableContentState | ((prevState: Readonly<TableContentState>, props: Readonly<TableContentProps>) => null | TableContentState | Pick<TableContentState, K>) | Pick<TableContentState, K>
    • Optional callback: () => void
        • (): void
        • Returns void

    Returns void

Optional shouldComponentUpdate

  • shouldComponentUpdate(nextProps: Readonly<TableContentProps>, nextState: Readonly<TableContentState>, nextContext: any): boolean
  • Called to determine whether the change in props and state should trigger a re-render.

    Component always returns true. PureComponent implements a shallow comparison on props and state and returns true if any props or states have changed.

    If false is returned, Component#render, componentWillUpdate and componentDidUpdate will not be called.

    Parameters

    • nextProps: Readonly<TableContentProps>
    • nextState: Readonly<TableContentState>
    • nextContext: any

    Returns boolean

tableActionEnumToString

  • tableActionEnumToString(currentTableActionType: TableActionType): "" | "Insert" | "Update" | "Delete"
  • Converts the current table action type to string for proper rendering on loading popup text

    Parameters

    • currentTableActionType: TableActionType

    Returns "" | "Insert" | "Update" | "Delete"

Generated using TypeDoc