Options
All
  • Public
  • Public/Protected
  • All
Menu

Class for listing, sorting, and serachinng for tables in tableList

Hierarchy

  • Component<TableListProps, TableListState>
    • default

Index

Constructors

constructor

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

    • props: TableListProps

    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<TableListProps> & Readonly<{ children?: ReactNode }>

refs

refs: {}

Type declaration

  • [key: string]: ReactInstance

state

state: Readonly<TableListState>

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<TableListProps>, nextContext: any): void

Optional UNSAFE_componentWillUpdate

  • UNSAFE_componentWillUpdate(nextProps: Readonly<TableListProps>, nextState: Readonly<TableListState>, nextContext: any): void

changeTableSortMode

  • changeTableSortMode(event: ChangeEvent<HTMLSelectElement>): Promise<void>
  • Due to the assumtion that schemaList is initally in alphabetical ascending order and that there is only two option to sort the list that is ascending and decensding with ascending by default, we can take advantage by this by just simply fliping the list when the user change between the two sort mode. We also need to change the selected schema index accordingly which is simply just lengtOfArray - currentIndex - 1

    Parameters

    • event: ChangeEvent<HTMLSelectElement>

    Returns Promise<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: TableListProps, prevState: TableListState): void
  • Handles the construction of the tableList for rendering based on if the tableListDict from props change or not

    Parameters

    • prevProps: TableListProps
    • prevState: TableListState

    Returns void

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

  • componentWillReceiveProps(nextProps: Readonly<TableListProps>, 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<TableListProps>, nextState: Readonly<TableListState>, nextContext: any): void

forceUpdate

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

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

    Returns void

Optional getSnapshotBeforeUpdate

  • getSnapshotBeforeUpdate(prevProps: Readonly<TableListProps>, prevState: Readonly<TableListState>): 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<TableListProps>
    • prevState: Readonly<TableListState>

    Returns any

onSearchStringChange

  • onSearchStringChange(event: ChangeEvent<HTMLInputElement>): void
  • Call back for Table Search box input OnChange

    Parameters

    • event: ChangeEvent<HTMLInputElement>

    Returns void

parseTableEntry

  • parseTableEntry(tableList: ParentTableListEntry[], tableNames: string[], tableType: default, partTableDict: Record<string, PartTableListEntry[]>): void
  • Given a list of parent table names, check if there is any partTables that belong to it, if so attach it then push to tableList, otherwise just push

    Parameters

    • tableList: ParentTableListEntry[]
    • tableNames: string[]
    • tableType: default
    • partTableDict: Record<string, PartTableListEntry[]>

    Returns void

render

  • render(): Element
  • Returns Element

restrictTableListBySeachString

  • restrictTableListBySeachString(searchString: string): void
  • Apply the restriction string by looping through the table list and copying the entries that match the condition to restrictTableList

    Parameters

    • searchString: string

      String to restrict the table's name by

    Returns void

setState

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

    • K: "searchString" | "currentSort" | "viewAllPartTables" | "hidePartTable" | "tableList" | "restrictedTableList" | "currentTableSortMode"

    Parameters

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

    Returns void

Optional shouldComponentUpdate

  • shouldComponentUpdate(nextProps: Readonly<TableListProps>, nextState: Readonly<TableListState>, 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<TableListProps>
    • nextState: Readonly<TableListState>
    • nextContext: any

    Returns boolean

sortTableList

  • sortTableList(tableList: ParentTableListEntry[], sortMode: TableSortMode): ParentTableListEntry[]
  • Sort the given the tableList by one one of the avaliable sortMode listed in TableSortMode

    Parameters

    • tableList: ParentTableListEntry[]

      The array of ParentTableListEntry to be sorted

    • sortMode: TableSortMode

      One of the supported TableSortMode entry

    Returns ParentTableListEntry[]

    A sorted table list

toggleAllPartTableView

  • toggleAllPartTableView(): void
  • Call back for toggle the visability of part tables in tablelist

    Returns void

toggleEachPartTableView

  • toggleEachPartTableView(event: MouseEvent<HTMLDivElement, MouseEvent>, table: TableListEntry): void
  • Call back for hiding parts tables of a specific parent table

    Parameters

    • event: MouseEvent<HTMLDivElement, MouseEvent>

      HTML on click event from button

    • table: TableListEntry

      Table object that the part table view should be hidden or shown

    Returns void

Generated using TypeDoc