Skip to content

taipy-gui module

taipy-gui JS module API

taipy-gui JS module API / Exports

Table of contents

Interfaces

Type Aliases

Variables

Functions

Type Aliases

LoV

Ƭ LoV: LoVElt[]

A series of LoV elements.


LoVElt

Ƭ LoVElt: [string, stringIcon, LoVElt[]?]

A LoV (list of value) element.

Each LoVElt holds:

  • Its identifier as a string;
  • Its label (or icon) as a stringIcon;
  • Potential child elements as an array of LoVElts.

RowType

Ƭ RowType: Record\<string, RowValue>

The definition of a table row.

A row definition associates a name (a string) to a type (a RowValue).


RowValue

Ƭ RowValue: string | number | boolean | null

A cell value type.

Variables

Context

Const Context: Context\<Store>

The Taipy-specific React context.

The type of this variable is React.Context<Store>.

Functions

createRequestDataUpdateAction

createRequestDataUpdateAction(name, id, context, columns, pageKey, payload, allData?, library?): Action

Create a request data update Action that will be used to update the Context.

This action will provoke the invocation of the get_data() method of the backend library. That invocation generates an update of the elements holding the data named name on the front-end.

Parameters
Name Type Default value Description
name undefined | string undefined The name of the variable holding the requested data as received as a property.
id undefined | string undefined The identifier of the visual element.
context undefined | string undefined The execution context.
columns string[] undefined The list of the columns needed by the element that emitted this action.
pageKey string undefined The unique identifier of the data that will be received from this action.
payload Record\<string, unknown> undefined The payload (specific to the type of component ie table, chart...).
allData boolean false The flag indicating if all the data is requested.
library? string undefined The name of the extension library.
Returns

Action

The action fed to the reducer.


createRequestUpdateAction

createRequestUpdateAction(id, context, names, forceRefresh?): Action

Create a request update Action that will be used to update the Context.

This action will generate an update of the elements holding the variables named names on the front-end.

Parameters
Name Type Default value Description
id undefined | string undefined The identifier of the visual element.
context undefined | string undefined The execution context.
names string[] undefined The names of the requested variables as received in updateVarName and/or updateVars properties.
forceRefresh boolean false Should Taipy re-evaluate the variables or use the current values
Returns

Action

The action fed to the reducer.


createSendActionNameAction

createSendActionNameAction(name, context, value, ...args): Action

Create an action Action that will be used to update Context.

This action will trigger the invocation of the on_action Python function on the backend, providing all the parameters as a payload.

Parameters
Name Type Description
name undefined | string The name of the action function on the backend.
context undefined | string The execution context.
value unknown The value associated with the action. This can be an object or any type of value.
...args unknown[] Additional information associated to the action.
Returns

Action

The action fed to the reducer.


createSendUpdateAction

createSendUpdateAction(name?, value, context, onChange?, propagate?, relName?): Action

Create a send update Action that will be used to update Context.

This action will update the variable name (if propagate is true) and trigger the invocation of the on_change Python function on the backend.

Parameters
Name Type Default value Description
name string "" The name of the variable holding the requested data as received as a property.
value unknown undefined The new value for the variable named name.
context undefined | string undefined The execution context.
onChange? string undefined The name of the on_change Python function to invoke on the backend (default is "on_change").
propagate boolean true A flag indicating that the variable should be automatically updated on the backend.
relName? string undefined The name of the related variable (for example the lov when a lov value is updated).
Returns

Action

The action fed to the reducer.


getUpdateVar

getUpdateVar(updateVars, name): undefined | string

Extracts the backend name of a property.

Parameters
Name Type Description
updateVars string The value held by the property updateVars.
name string The name of a bound property.
Returns

undefined | string

The backend-generated variable name.


useClassNames

useClassNames(libClassName?, dynamicClassName?, className?): string

A React hook to manage classNames (dynamic and static). cf. useDynamicProperty

Parameters
Name Type Description
libClassName? string The default static className.
dynamicClassName? string The bound className.
className? string The default user set className.
Returns

string

The complete list of applicable classNames.


useDispatch

useDispatch(): Dispatch\<Action>

A React hook that returns the dispatch function.

The dispatch function allows to send Actions to the Store and initiate backend\ communications.

Returns

Dispatch\<Action>

The dispatch function.


useDispatchRequestUpdateOnFirstRender

useDispatchRequestUpdateOnFirstRender(dispatch, id?, context?, updateVars?, varName?, forceRefresh?): void

A React hook that requests an update for every dynamic property of the element.

Parameters
Name Type Description
dispatch Dispatch\<Action> The React dispatcher associated to Context.
id? string The identifier of the element.
context? string The execution context.
updateVars? string The content of the property updateVars.
varName? string The default property backend provided variable (through property updateVarName).
forceRefresh? boolean Should Taipy re-evaluate the variables or use the current values.
Returns

void


useDynamicProperty

useDynamicProperty\<T>(value, defaultValue, defaultStatic): T

A React hook to manage a dynamic scalar property.

A dynamic scalar property is defined by a default property and a bound property.

Type parameters
Name Description
T The dynamic property type.
Parameters
Name Type Description
value T The bound value.
defaultValue T The default value.
defaultStatic T The default static value.
Returns

T

The latest updated value.


useLovListMemo

useLovListMemo(lov, defaultLov, tree?): LovItem[]

A React hook that returns a LoV list from the LoV default value and the LoV bound value.

Parameters
Name Type Default value Description
lov undefined | LoV undefined The bound lov value.
defaultLov string undefined The JSON-stringified default LoV value.
tree boolean false This flag indicates if the LoV list is a tree or a flat list (default is false).
Returns

LovItem[]

A list of LoV items.


useModule

useModule(): undefined | string

A React hook that returns the page module.

The module Needs to be added to all Actions to allow for the correct execution of backend functions.

Returns

undefined | string

The page module.