1.11.0 • Published 5 years ago

react-criteria-table v1.11.0

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

React Criteria Table

React Criteria Table is a wrapper for React Table (https://react-table.js.org), which is designed to extend base functional.

React Criteria Table is use context (https://reactjs.org/docs/context.html).

Usage

<CriteriaTableController>
   <CriteriaTable 
        cacheKey="tableOne" 
        onFetchData={(state: Partial<CriteriaTableState>) => /*do requests here*/
        onDefaults={(state: CriteriaTableState) => () => ([
            {id: "name", show: true },
            {id: "surName", show: true },
            {id: "birthDate", show: false }
        ])}
    />
   <CriteriaTableSettings activeTableKey="tableOne"/>
</CriteriaTableController>
  • cacheKey is identifier of table. Is also used to save data to local storage
  • activeTableKey is define, which of table settings must be displayed
  • onFetchData is callback, of React Table onFetchData (https://react-table.js.org/#/story/readme)
  • onDefaults is callback, that called on ComponentWillMount and initialize saved data and default data
Interfaces

ConditionType : "=" | "<>" | ">" | "<" | "!=" | ">=" | "<=" | "like" | "in"

Condition: ConditionType, string, string | number | boolean

CriteriaTableState:

  • cancelToken?: CancelTokenSource(https://github.com/axios/axios#cancellation)
  • queries?: Array<Condition>
  • data: {
    • list: Array<any>
    • count: number
    • total: any }
  • sorted?: Array<{ id: string, desc: boolean }>
  • pageSize?: number
  • pages?: number
  • page?: number
1.11.0

5 years ago

1.9.5

6 years ago

1.9.4

6 years ago

1.9.2

6 years ago

1.9.1

6 years ago

1.8.1

6 years ago

1.8.0

6 years ago

1.7.0

6 years ago

1.6.1

6 years ago

1.6.0

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago