Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Global Exports

Runtime exports of Tesler UI.

Can be imported as:

import {entityName} from '@tesler-ui/core'

Index

Actions

Components

Epics

Hooks

Other

Tesler API Endpoints

Type Guards

Utils

Widgets

Actions

AnyAction

AnyAction: AnyOfMap<ActionsMap> | { payload?: any; type: " UNKNOWN ACTION " }

Any of the core actions

AnyOfMap

AnyOfMap<A>: A[keyof A]

TODO: Move to interfaces

Type parameters

  • A

uActionTypesMap

uActionTypesMap<A>: {[ key in keyof A]: key }

TODO: Move to interfaces

Type parameters

  • A

uActionsMap

uActionsMap<A>: {[ key in keyof A]: Action<key, A[key]> }

TODO: Move to interfaces

Type parameters

  • A

Const $do

$do: uActionCreators<ActionPayloadTypes> = ...

Const coreActions

Const needSaveAction

  • needSaveAction(action: string): boolean
  • Checks if need to perform autosave on specified action type call

    Parameters

    • action: string

    Returns boolean

Components

Const ActionLink

ActionLink: NamedExoticComponent<IActionLinkProps> = ...

Const CheckboxPicker

CheckboxPicker: ConnectedComponent<FC<CheckboxPickerProps>, Pick<CheckboxPickerProps, "bcName" | "fieldName" | "fieldLabel" | "cursor" | "readonly" | "value"> & CheckboxPickerOwnProps> = ...

ColumnTitle

ColumnTitle: FunctionComponent<ColumnTitle>
param

Const DashboardLayout

DashboardLayout: MemoExoticComponent<(props: DashboardLayoutProps) => Element> = ...

Const DatePickerField

DatePickerField: NamedExoticComponent<IDatePickerFieldProps> = ...

Const DevToolsPanel

DevToolsPanel: NamedExoticComponent<DevToolsPanelProps> = ...

Const Dictionary

Dictionary: NamedExoticComponent<DictionaryProps> = ...

Const ErrorPopup

ErrorPopup: ConnectedComponent<FunctionComponent<ErrorPopupProps>, Pick<ErrorPopupProps, "title" | "className" | "error" | "onClose">> = ...

Const Field

Field: ConnectedComponent<FunctionComponent<FieldProps>, Pick<FieldProps, "bcName" | "cursor" | "readonly" | "widgetName" | "className" | "widgetFieldMeta" | "suffixClassName" | "disableDrillDown" | "forceFocus" | "forcedValue" | "historyMode" | "tooltipPlacement" | "customProps" | "disableHoverError"> & FieldOwnProps> = ...

Const FilterField

FilterField: NamedExoticComponent<ColumnFilterControlProps> = ...

Const Link

Link: FunctionComponent<LinkProps> = ...
param

Const ModalInvoke

ModalInvoke: ConnectedComponent<FunctionComponent<ModalInvokeProps>, Pick<ModalInvokeProps, "className">> = ...

Const MultiValueListRecord

MultiValueListRecord: ConnectedComponent<FunctionComponent<MultiValueListRecordProps>, Pick<MultiValueListRecordProps, "multivalueSingleValue" | "isFloat">> = ...

Const MultivalueField

MultivalueField: ConnectedComponent<FunctionComponent<MultivalueFieldProps>, Pick<MultivalueFieldProps, "bcName" | "widgetName" | "popupRowMetaDone" | "defaultValue" | "widgetFieldMeta" | "disabled" | "metaError" | "placeholder"> & MultivalueFieldOwnProps> = ...

Const MultivalueHover

MultivalueHover: NamedExoticComponent<MultivalueHoverProps> = ...

Const MultivalueList

MultivalueList: NamedExoticComponent<MultivalueListProps> = ...

Const MultivalueTag

MultivalueTag: NamedExoticComponent<MultivalueTagProps> = ...

Const NumberInput

NumberInput: NamedExoticComponent<NumberInputProps> = ...

Const Pagination

Pagination: NamedExoticComponent<PaginationAllProps> = ...

Const PickListField

PickListField: ConnectedComponent<FunctionComponent<IPickListWidgetInputProps>, Pick<IPickListWidgetInputProps, "bcName" | "meta" | "cursor" | "value" | "widgetName" | "className" | "popupRowMetaDone" | "disabled" | "metaError" | "placeholder" | "onDrillDown" | "parentBCName" | "pickMap" | "readOnly" | "backgroundColor">> = ...

Const Popup

Popup: NamedExoticComponent<PopupProps> = ...

Const RadioButton

RadioButton: NamedExoticComponent<RadioButtonProps> = ...

Const SearchHighlight

SearchHighlight: NamedExoticComponent<SearchHighlightProps> = ...

Const TableLikeWidgetTypes

TableLikeWidgetTypes: readonly List[] = ...

Different widget types that are considered tables in nature for purposes of applying some shared features. For example, autofocus on missing required field should work for tables but not forms.

TODO: Make extension point

Const TemplatedTitle

TemplatedTitle: ConnectedComponent<FunctionComponent<TemplatedTitleProps>, Pick<TemplatedTitleProps, "title" | "widgetName" | "container"> & TemplatedTitleOwnProps> = ...

Const TextArea

TextArea: NamedExoticComponent<TextAreaProps> = ...

Const View

View: ConnectedComponent<FunctionComponent<ViewProps>, Pick<ViewProps, "customWidgets" | "skipWidgetTypes" | "customSpinner" | "card" | "customLayout" | "customFields">> = ...

Const Widget

Widget: ConnectedComponent<FunctionComponent<WidgetProps>, Pick<WidgetProps, "meta" | "customWidgets" | "customSpinner" | "card" | "children"> & WidgetOwnProps> = ...

Const Provider

  • Provider<ClientState, ClientActions>(props: ProviderProps<ClientState, ClientActions>): Element
  • Type parameters

    • ClientState: Partial<Store>

    • ClientActions: Action<any, ClientActions>

    Parameters

    • props: ProviderProps<ClientState, ClientActions>

    Returns Element

Const TreeVirtualized

  • TreeVirtualized<T>(props: TreeVirtualizedProps<T>): Element

Epics

apiErrorImpl

bcCancelCreateDataEpicImpl

  • bcCancelCreateDataEpicImpl(action: ActionsMap["sendOperation"], store: Store<Store, AnyAction>): Observable<AnyAction>
  • Default implementation for bcCancelCreateDataEpic epic

    Sends cancel-create custom operation with record's pending changes and vstamp; Dispatches sendOperationSuccess and bcChangeCursors to drop cursors, also processPostInvoke if received postActions in response.

    On error dispatches bcDeleteDataFail.

    Parameters

    • action: ActionsMap["sendOperation"]

      sendOperation with cancel-create role

    • store: Store<Store, AnyAction>

      Store instance

    Returns Observable<AnyAction>

bcFetchRowMetaRequestImpl

  • bcFetchRowMetaRequestImpl(action: ActionsMap["bcFetchRowMeta"], store: Store<Store, AnyAction>, actionObservable: ActionsObservable<AnyAction>): Observable<AnyAction>
  • Default implementation for bcFetchRowMetaRequest epic

    Access row-meta API endpoint for business component; response will contain information about operations available for row and additional information about row fields.

    On success, bcFetchRowMetaSuccess action dispatched to store received row meta. On failure, console.error called and bcFetchRowMetaFail action dispatched to drop fetching state.

    If any action from cancelRequestActionTypes array dispatched while this epic is in progress, this epic will be cancelled and bcFetchRowMetaFail action will be dispatched.

    Parameters

    • action: ActionsMap["bcFetchRowMeta"]
    • store: Store<Store, AnyAction>

      Store instance

    • actionObservable: ActionsObservable<AnyAction>

      Root epic to cancel

    Returns Observable<AnyAction>

bcNewDataEpicImpl

  • Default implementation for bcNewDataEpic epic

    Access row-meta-new API endpoint for business component endpoint; response will contain row meta where currentValue of id field will contain an id for newly created record.

    bcNewDataSuccess action dispatched with new data item draft (vstamp = -1). bcFetchRowMetaSuccess action dispatched to set BC cursor to this new id. changeDataItem action dispatched to add this new item to pending changes. processPostInvoke dispatched to handle possible post invokes.

    In case of an error message is logged as warning and bcNewDataFail action dispatched.

    Parameters

    • action: ActionsMap["sendOperation"]

      sendOperation with create role

    • store: Store<Store, AnyAction>

      Store instance

    Returns Observable<AnyAction>

bcSaveDataImpl

  • Default implementation for bcSaveData epic

    Post record's pending changes to save data API endpoint. Pending changes for fields disabled through row meta are not send; pleace notice that fields are disabled by default.

    On success following actions are dispatched:

    On failure, console.error called and bcSaveDataFail action dispatched.

    If there was a onSuccessAction callback provided in action payload (and widget option disableNotification was not set) then a notification will be shown on failure with suggestion to cancel pending changes and a button that fires bcCancelPendingChanges

    Parameters

    Returns Observable<AnyAction>

bcSelectDepthRecordImpl

  • bcSelectDepthRecordImpl(action: ActionsMap["bcSelectDepthRecord"]): Observable<AnyAction>
  • Set a cursor when expanding a record in hierarchy widgets builded around single business components and fetch the data for children of expanded record.

    bcChangeDepthCursor action is dispatched to set the cursor for expanded record; only one expanded record is allowed per hierarchy depth level.

    bcFetchDataRequest action is dispatched to fetch children data for expanded record. `ignorePageLimit`` is set as there are no controls for navigating between data pages in nested levels of hierarchy so instead all records are fetched.

    TODO: There is no apparent reason why widgetName is empty; probably will be mandatory and replace bcName in 2.0.0.

    deprecated

    Do not use; TODO: Will be removed in 2.0.0

    Parameters

    Returns Observable<AnyAction>

drillDownImpl

fileUploadConfirmImpl

  • fileUploadConfirmImpl(action: ActionsMap["bulkUploadFiles"], store: Store<Store, AnyAction>): Observable<AnyAction>
  • Default implementation for fileUploadConfirm epic

    It sends customAction request for file-upload-save endpoint with bulkIds data containing ids of uploaded files. On success it fires sendOperationSuccess, bcForceUpdate and closeViewPopup actions to refresh business component and close popup.

    It also launces postOperationRoutine to handle pre and post invokes.

    Parameters

    • action: ActionsMap["bulkUploadFiles"]

      removeMultivalueTag

    • store: Store<Store, AnyAction>

      Store instance

    Returns Observable<AnyAction>

handleRouterImpl

  • handleRouterImpl(action: ActionsMap["handleRouter"], store: Store<Store>): Observable<never>
  • Default implementation for handleRouter epic.

    If server routing is used, this epic will send a requst to Tesler API router endpoint. It writes a console error if request fails.

    Parameters

    • action: ActionsMap["handleRouter"]

      This epic will fire on handleRouter action

    • store: Store<Store>

      Redux store instance

    Returns Observable<never>

    Default implementation does not throw any additional actions

httpError401Impl

httpError409Impl

httpError418Impl

httpError500Impl

httpErrorDefaultImpl

loginDoneImpl

  • loginDoneImpl(action: ActionsMap["loginDone"], store: Store<Store>): Observable<AnyAction>

processPostInvokeImpl

  • processPostInvokeImpl(action: ActionsMap["processPostInvoke"], store: Store<Store, AnyAction>): Observable<AnyAction>

removeMultivalueTagImpl

  • removeMultivalueTagImpl(action: ActionsMap["removeMultivalueTag"], store: Store<Store, AnyAction>): Observable<AnyAction>
  • Default implementation for removeMultivalueTag epic

    For full hierarchies it fires changeDataItem action to remove value from source record

    With hierarchyGroupDeselection widget option, parent removal also remove children; removing last child will also remove the parent.

    With hierarchyTraverse widget option, descendants are used instead of children.

    When parent should be removed with both option, removeMultivalueTag with updated removedItem will fire instead of changeDataItem.

    For non-full hierarchies two changeDataItem actions will fire, first to drop _associate flag of remove item and second to update value of soure record. Widget options are not tested for non-full hierarchies.

    Parameters

    • action: ActionsMap["removeMultivalueTag"]

      removeMultivalueTag

    • store: Store<Store, AnyAction>

      Store instance

    Returns Observable<AnyAction>

selectScreenImpl

  • selectScreenImpl(action: ActionsMap["selectScreen"], store: Store<Store>): Observable<AnyAction>

selectViewFailImpl

selectViewImpl

  • selectViewImpl(action: ActionsMap["selectView"], store: Store<Store, AnyAction>): Action<"bcFetchDataRequest", { bcName?: string; depth?: number; ignorePageLimit?: boolean; keepDelta?: boolean; widgetName: string }>[]
  • Default implementation for selectView epic.

    Schedules data fetch for every widget on the view

    After selecting a view, this epic schedules a data fetch for every widget present on the view. If business componenet for the widget has a parent, then root ancestor BC is scheduled for data fetch instead and data for its descendants will be scheduled after ancestor data fetch resolved.

    see

    {@link src/epics/data/bcFetchDataEpic.ts} for details how descendants resolved

    Parameters

    • action: ActionsMap["selectView"]

      selectView action

    • store: Store<Store, AnyAction>

      Store instance

    Returns Action<"bcFetchDataRequest", { bcName?: string; depth?: number; ignorePageLimit?: boolean; keepDelta?: boolean; widgetName: string }>[]

sendOperationAssociateImpl

  • sendOperationAssociateImpl(action: ActionsMap["sendOperation"], store: Store<Store>): Action<"showViewPopup", { active?: boolean; assocValueKey?: string; associateFieldKey?: string; bcName: string; calleeBCName?: string; calleeWidgetName?: string; isFilter?: boolean; type?: PopupType; widgetName?: string }>
  • Default implementation for sendOperationAssociate epic.

    Opens a popup with associate component.

    Parameters

    • action: ActionsMap["sendOperation"]

      This epic will fire on userDrillDown action

    • store: Store<Store>

      Redux store instance

    Returns Action<"showViewPopup", { active?: boolean; assocValueKey?: string; associateFieldKey?: string; bcName: string; calleeBCName?: string; calleeWidgetName?: string; isFilter?: boolean; type?: PopupType; widgetName?: string }>

    showViewPopup for ${bcName}Assoc

sendOperationEpicImpl

  • sendOperationEpicImpl(action: ActionsMap["sendOperation"], store: Store<Store, AnyAction>): Observable<AnyAction>

showAssocPopupEpicImpl

  • showAssocPopupEpicImpl(action: ActionsMap["showViewPopup"], store: Store<Store, AnyAction>): Observable<AnyAction>

showFileUploadPopupImpl

  • showFileUploadPopupImpl(action: ActionsMap["sendOperation"]): Observable<AnyAction>
  • Default implementation for showFileUploadPopupImpl epic

    Fires bcChangeCursors and showFileUploadPopup to drop the cursors and show file upload popup.

    Parameters

    • action: ActionsMap["sendOperation"]

      sendOperation

    Returns Observable<AnyAction>

userDrillDownImpl

  • userDrillDownImpl(action: ActionsMap["userDrillDown"], store: Store<Store>): Observable<AnyAction>

Hooks

useAssocRecords

  • useAssocRecords<T>(data: T[], pendingChanges: Record<string, PendingDataItem>, isRadio?: boolean): T[]

useDebounce

  • useDebounce<T>(value: T, delay: number): T
  • Allows to ignore frequently changing values by returning only the last one received until specified delay.

    Type parameters

    • T

    Parameters

    • value: T

      Frequently changing value

    • delay: number

      Delay until the next change

    Returns T

useDrillDownUrl

  • useDrillDownUrl(bcName: string, fieldMeta: WidgetFieldBase, cursor: string): string | null
  • description

    Allows to override drilldown url from field data by drillDownKey. Checking order allows to disable drilldown link, for example if object is removed.

    Parameters

    • bcName: string

      bcName passed to field

    • fieldMeta: WidgetFieldBase

      widget field meta

    • cursor: string

      field ID

    Returns string | null

useFlatFormFields

useRowMenu

  • useRowMenu(): readonly MutableRefObject<RowOperationsButtonInstance>[]
  • Handles interactions between <RowOperationsButton /> and antd <Table />

    Initializes references to both components and prepares a hover configuration for table.

    Returns readonly MutableRefObject<RowOperationsButtonInstance>[]

    A tuple of three values:

    • operationsRef - assign this reference to <RowOperationsButton />
    • parentRef - assign this reference to common parent of <RowOperationsButton /> and <Table />
    • handleRowHover - onMouseEnter/onMouseLeave pair for antd <Table onRow /> property

useViewTabs

  • useViewTabs(depth: number): { hidden?: boolean; selected: boolean; title: string; url: string; viewName: string }[]
  • Returns an array of tabs for specified level of navigation

    Parameters

    • depth: number

      1 for top level navigation; 2, 3, 4 for SecondLevelMenu, ThirdLevelMenu and FourthLevelMenu

    Returns { hidden?: boolean; selected: boolean; title: string; url: string; viewName: string }[]

useWidgetOperations

Other

NavigationTabs

NavigationTabs: MemoExoticComponent<(__namedParameters: NavigationTabsProps) => Element>

NavigationTabsWidget

NavigationTabsWidget: MemoExoticComponent<(__namedParameters: NavigationTabsWidgetProps) => Element>

RowOperationsButton

RowOperationsButton: ForwardRefExoticComponent<RowOperationsButtonProps & RefAttributes<RowOperationsButtonInstance>>

ViewNavigationWidget

ViewNavigationWidget: MemoExoticComponent<(props: ViewNavigationWidgetProps) => Element>

Const RowOperationsMenu

RowOperationsMenu: React.FC<RowOperationsMenuProps> = ...

Menu with available record operations

On operation selection dispatches sendOperation

param

Component properties

Const connect

  • connect(): InferableComponentEnhancerWithProps<DispatchProp<AnyAction>, {}>
  • connect<TStateProps, no_dispatch, TOwnProps, State>(mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>): InferableComponentEnhancerWithProps<TStateProps & DispatchProp<AnyAction>, TOwnProps>
  • connect<no_state, TDispatchProps, TOwnProps>(mapStateToProps: null, mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps, TOwnProps>): InferableComponentEnhancerWithProps<TDispatchProps, TOwnProps>
  • connect<no_state, TDispatchProps, TOwnProps>(mapStateToProps: null, mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>): InferableComponentEnhancerWithProps<ResolveThunks<TDispatchProps>, TOwnProps>
  • connect<TStateProps, TDispatchProps, TOwnProps, State>(mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>, mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps, TOwnProps>): InferableComponentEnhancerWithProps<TStateProps & TDispatchProps, TOwnProps>
  • connect<TStateProps, TDispatchProps, TOwnProps, State>(mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>, mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>): InferableComponentEnhancerWithProps<TStateProps & ResolveThunks<TDispatchProps>, TOwnProps>
  • connect<no_state, no_dispatch, TOwnProps, TMergedProps>(mapStateToProps: null, mapDispatchToProps: null, mergeProps: MergeProps<undefined, undefined, TOwnProps, TMergedProps>): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>
  • connect<TStateProps, no_dispatch, TOwnProps, TMergedProps, State>(mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>, mapDispatchToProps: null, mergeProps: MergeProps<TStateProps, undefined, TOwnProps, TMergedProps>): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>
  • connect<no_state, TDispatchProps, TOwnProps, TMergedProps>(mapStateToProps: null, mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>, mergeProps: MergeProps<undefined, TDispatchProps, TOwnProps, TMergedProps>): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>
  • connect<TStateProps, no_dispatch, TOwnProps, State>(mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>, mapDispatchToProps: null, mergeProps: null, options: Options<State, TStateProps, TOwnProps, {}>): InferableComponentEnhancerWithProps<DispatchProp<AnyAction> & TStateProps, TOwnProps>
  • connect<TStateProps, TDispatchProps, TOwnProps>(mapStateToProps: null, mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps, TOwnProps>, mergeProps: null, options: Options<{}, TStateProps, TOwnProps, {}>): InferableComponentEnhancerWithProps<TDispatchProps, TOwnProps>
  • connect<TStateProps, TDispatchProps, TOwnProps>(mapStateToProps: null, mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>, mergeProps: null, options: Options<{}, TStateProps, TOwnProps, {}>): InferableComponentEnhancerWithProps<ResolveThunks<TDispatchProps>, TOwnProps>
  • connect<TStateProps, TDispatchProps, TOwnProps, State>(mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>, mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps, TOwnProps>, mergeProps: null, options: Options<State, TStateProps, TOwnProps, {}>): InferableComponentEnhancerWithProps<TStateProps & TDispatchProps, TOwnProps>
  • connect<TStateProps, TDispatchProps, TOwnProps, State>(mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>, mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>, mergeProps: null, options: Options<State, TStateProps, TOwnProps, {}>): InferableComponentEnhancerWithProps<TStateProps & ResolveThunks<TDispatchProps>, TOwnProps>
  • connect<TStateProps, TDispatchProps, TOwnProps, TMergedProps, State>(mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>, mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>, mergeProps: MergeProps<TStateProps, TDispatchProps, TOwnProps, TMergedProps>, options?: Options<State, TStateProps, TOwnProps, TMergedProps>): InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>
  • The connect function. See {@type Connect} for details.

    Returns InferableComponentEnhancerWithProps<DispatchProp<AnyAction>, {}>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • TStateProps = {}

    • no_dispatch = {}

    • TOwnProps = {}

    • State = DefaultRootState

    Parameters

    • mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>

    Returns InferableComponentEnhancerWithProps<TStateProps & DispatchProp<AnyAction>, TOwnProps>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • no_state = {}

    • TDispatchProps = {}

    • TOwnProps = {}

    Parameters

    • mapStateToProps: null
    • mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps, TOwnProps>

    Returns InferableComponentEnhancerWithProps<TDispatchProps, TOwnProps>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • no_state = {}

    • TDispatchProps = {}

    • TOwnProps = {}

    Parameters

    • mapStateToProps: null
    • mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>

    Returns InferableComponentEnhancerWithProps<ResolveThunks<TDispatchProps>, TOwnProps>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • TStateProps = {}

    • TDispatchProps = {}

    • TOwnProps = {}

    • State = DefaultRootState

    Parameters

    • mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>
    • mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps, TOwnProps>

    Returns InferableComponentEnhancerWithProps<TStateProps & TDispatchProps, TOwnProps>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • TStateProps = {}

    • TDispatchProps = {}

    • TOwnProps = {}

    • State = DefaultRootState

    Parameters

    • mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>
    • mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>

    Returns InferableComponentEnhancerWithProps<TStateProps & ResolveThunks<TDispatchProps>, TOwnProps>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • no_state = {}

    • no_dispatch = {}

    • TOwnProps = {}

    • TMergedProps = {}

    Parameters

    • mapStateToProps: null
    • mapDispatchToProps: null
    • mergeProps: MergeProps<undefined, undefined, TOwnProps, TMergedProps>

    Returns InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • TStateProps = {}

    • no_dispatch = {}

    • TOwnProps = {}

    • TMergedProps = {}

    • State = DefaultRootState

    Parameters

    • mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>
    • mapDispatchToProps: null
    • mergeProps: MergeProps<TStateProps, undefined, TOwnProps, TMergedProps>

    Returns InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • no_state = {}

    • TDispatchProps = {}

    • TOwnProps = {}

    • TMergedProps = {}

    Parameters

    • mapStateToProps: null
    • mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>
    • mergeProps: MergeProps<undefined, TDispatchProps, TOwnProps, TMergedProps>

    Returns InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • TStateProps = {}

    • no_dispatch = {}

    • TOwnProps = {}

    • State = DefaultRootState

    Parameters

    • mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>
    • mapDispatchToProps: null
    • mergeProps: null
    • options: Options<State, TStateProps, TOwnProps, {}>

    Returns InferableComponentEnhancerWithProps<DispatchProp<AnyAction> & TStateProps, TOwnProps>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • TStateProps = {}

    • TDispatchProps = {}

    • TOwnProps = {}

    Parameters

    • mapStateToProps: null
    • mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps, TOwnProps>
    • mergeProps: null
    • options: Options<{}, TStateProps, TOwnProps, {}>

    Returns InferableComponentEnhancerWithProps<TDispatchProps, TOwnProps>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • TStateProps = {}

    • TDispatchProps = {}

    • TOwnProps = {}

    Parameters

    • mapStateToProps: null
    • mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>
    • mergeProps: null
    • options: Options<{}, TStateProps, TOwnProps, {}>

    Returns InferableComponentEnhancerWithProps<ResolveThunks<TDispatchProps>, TOwnProps>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • TStateProps = {}

    • TDispatchProps = {}

    • TOwnProps = {}

    • State = DefaultRootState

    Parameters

    • mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>
    • mapDispatchToProps: MapDispatchToPropsNonObject<TDispatchProps, TOwnProps>
    • mergeProps: null
    • options: Options<State, TStateProps, TOwnProps, {}>

    Returns InferableComponentEnhancerWithProps<TStateProps & TDispatchProps, TOwnProps>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • TStateProps = {}

    • TDispatchProps = {}

    • TOwnProps = {}

    • State = DefaultRootState

    Parameters

    • mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>
    • mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>
    • mergeProps: null
    • options: Options<State, TStateProps, TOwnProps, {}>

    Returns InferableComponentEnhancerWithProps<TStateProps & ResolveThunks<TDispatchProps>, TOwnProps>

  • The connect function. See {@type Connect} for details.

    Type parameters

    • TStateProps = {}

    • TDispatchProps = {}

    • TOwnProps = {}

    • TMergedProps = {}

    • State = DefaultRootState

    Parameters

    • mapStateToProps: MapStateToPropsParam<TStateProps, TOwnProps, State>
    • mapDispatchToProps: MapDispatchToPropsParam<TDispatchProps, TOwnProps>
    • mergeProps: MergeProps<TStateProps, TDispatchProps, TOwnProps, TMergedProps>
    • Optional options: Options<State, TStateProps, TOwnProps, TMergedProps>

    Returns InferableComponentEnhancerWithProps<TMergedProps, TOwnProps>

useTranslation

  • useTranslation(ns?: Namespace, options?: UseTranslationOptions): UseTranslationResponse
  • Parameters

    • Optional ns: Namespace
    • Optional options: UseTranslationOptions

    Returns UseTranslationResponse

Tesler API Endpoints

associate

  • associate(screenName: string, bcUrl: string, data: AssociatedItem[] | Record<string, AssociatedItem[]>, params?: GetParamsMap): Observable<any>
  • Request to save an association (many-to-many relation)

    • When request doest specify bcUrl, request body should have an array of records with a flag to set or drop an association.
    • When request does not specify bcUrl, request body should have a dictionary where key is bcUrl for business component and value is an array of records with associate flag

    Parameters

    • screenName: string

      Screen name

    • bcUrl: string

      Business component cursors hierarchy

    • data: AssociatedItem[] | Record<string, AssociatedItem[]>

      An array of records or a dictionary

    • Optional params: GetParamsMap

    Returns Observable<any>

customAction

  • Request for a custom operation

    Parameters

    • screenName: string

      Screen name

    • bcUrl: string

      Business component cursors hierarchy

    • data: Record<string, any>

      Changed fields

    • context: ApiCallContext

      Call context

    • Optional params: GetParamsMap

    Returns Observable<{ postActions?: OperationPostInvokeAny[]; preInvoke?: OperationPreInvoke; record: DataItem }>

deleteBcData

  • Request to delete a data record

    Parameters

    • screenName: string

      Screen name

    • bcUrl: string

      Business component cursors hierarchy

    • context: ApiCallContext

      Call context

    • Optional params: GetParamsMap

    Returns Observable<{ postActions?: OperationPostInvokeAny[]; preInvoke?: OperationPreInvoke; record: DataItem }>

fetchBcData

  • fetchBcData(screenName: string, bcUrl: string, params?: GetParamsMap, cancelToken?: CancelToken): Observable<BcDataResponse>
  • Send request for BC data

    Parameters

    • screenName: string
    • bcUrl: string
    • params: GetParamsMap = ...
    • Optional cancelToken: CancelToken

    Returns Observable<BcDataResponse>

fetchBcDataAll

  • fetchBcDataAll(screenName: string, bcUrl: string, params?: GetParamsMap): Observable<DataItem[]>
  • TODO

    Parameters

    • screenName: string
    • bcUrl: string
    • params: GetParamsMap = ...

    Returns Observable<DataItem[]>

fetchRowMeta

  • fetchRowMeta(screenName: string, bcUrl: string, params?: GetParamsMap, cancelToken?: CancelToken): Observable<RowMeta>
  • Send request for row-meta

    Parameters

    • screenName: string
    • bcUrl: string
    • Optional params: GetParamsMap
    • Optional cancelToken: CancelToken

    Returns Observable<RowMeta>

getRmByForceActive

  • getRmByForceActive(screenName: string, bcUrl: string, data: PendingDataItem & { vstamp: number }, params?: GetParamsMap): Observable<RowMeta>
  • Request row meta with preview of force-active changes

    Parameters

    • screenName: string

      Screen name

    • bcUrl: string

      Business component cursors hierarchy

    • data: PendingDataItem & { vstamp: number }

      Changed fields

    • Optional params: GetParamsMap

    Returns Observable<RowMeta>

loginByRoleRequest

  • loginByRoleRequest(role: string): Observable<unknown>
  • Request for role switching

    Parameters

    • role: string

      Code of new role

    Returns Observable<unknown>

newBcData

  • newBcData(screenName: string, bcUrl: string, context: ApiCallContext, params?: GetParamsMap): Observable<{ postActions?: OperationPostInvokeAny[]; row: RowMeta }>
  • Request to create a new data record

    Parameters

    • screenName: string

      Screen name

    • bcUrl: string

      Business component cursors hierarchy

    • context: ApiCallContext
    • Optional params: GetParamsMap

    Returns Observable<{ postActions?: OperationPostInvokeAny[]; row: RowMeta }>

refreshMeta

  • refreshMeta(): Observable<unknown>
  • Request for refresh screens, views and widgets meta

    Returns Observable<unknown>

saveBcData

Type Guards

isViewNavigationCategory

  • isViewNavigationCategory(item: any): item is ViewNavigationCategory
  • deprecated

    ViewNavigationCategory will be deleted in 2.0.0

    Parameters

    • item: any

    Returns item is ViewNavigationCategory

isViewNavigationGroup

  • isViewNavigationGroup(item: MenuItem): item is ViewNavigationGroup
  • Returns MenuItem if it is ViewNavigationGroup

    Parameters

    • item: MenuItem

      to be identified as group

    Returns item is ViewNavigationGroup

isViewNavigationItem

  • isViewNavigationItem(item: MenuItem): item is ViewNavigationItem
  • Returns MenuItem if it is ViewNavigationItem

    Parameters

    • item: MenuItem

      to be identified as view

    Returns item is ViewNavigationItem

isWidgetFieldBlock

Utils

Const axiosForApi

axiosForApi: { delete: <ResponsePayload>(path: string, callContext?: ApiCallContext) => Promise<AxiosResponse<ResponsePayload>>; get: <ResponsePayload>(path: string, config: AxiosRequestConfig, callContext?: ApiCallContext) => Promise<AxiosResponse<ResponsePayload>>; post: <ResponsePayload>(path: string, data: any, config?: AxiosRequestConfig, callContext?: ApiCallContext) => Promise<AxiosResponse<ResponsePayload>>; put: <ResponsePayload>(path: string, data: any, callContext?: ApiCallContext) => Promise<AxiosResponse<ResponsePayload>> } = ...

Type declaration

  • delete: <ResponsePayload>(path: string, callContext?: ApiCallContext) => Promise<AxiosResponse<ResponsePayload>>
      • <ResponsePayload>(path: string, callContext?: ApiCallContext): Promise<AxiosResponse<ResponsePayload>>
      • Type parameters

        • ResponsePayload

        Parameters

        • path: string
        • Optional callContext: ApiCallContext

        Returns Promise<AxiosResponse<ResponsePayload>>

  • get: <ResponsePayload>(path: string, config: AxiosRequestConfig, callContext?: ApiCallContext) => Promise<AxiosResponse<ResponsePayload>>
      • <ResponsePayload>(path: string, config: AxiosRequestConfig, callContext?: ApiCallContext): Promise<AxiosResponse<ResponsePayload>>
      • Type parameters

        • ResponsePayload

        Parameters

        • path: string
        • config: AxiosRequestConfig
        • Optional callContext: ApiCallContext

        Returns Promise<AxiosResponse<ResponsePayload>>

  • post: <ResponsePayload>(path: string, data: any, config?: AxiosRequestConfig, callContext?: ApiCallContext) => Promise<AxiosResponse<ResponsePayload>>
      • <ResponsePayload>(path: string, data: any, config?: AxiosRequestConfig, callContext?: ApiCallContext): Promise<AxiosResponse<ResponsePayload>>
      • Type parameters

        • ResponsePayload

        Parameters

        • path: string
        • data: any
        • Optional config: AxiosRequestConfig
        • Optional callContext: ApiCallContext

        Returns Promise<AxiosResponse<ResponsePayload>>

  • put: <ResponsePayload>(path: string, data: any, callContext?: ApiCallContext) => Promise<AxiosResponse<ResponsePayload>>
      • <ResponsePayload>(path: string, data: any, callContext?: ApiCallContext): Promise<AxiosResponse<ResponsePayload>>
      • Type parameters

        • ResponsePayload

        Parameters

        • path: string
        • data: any
        • Optional callContext: ApiCallContext

        Returns Promise<AxiosResponse<ResponsePayload>>

Const historyObj

historyObj: History<any> = ...

Global instance

Let store

store: Store<Store> = null

autosaveRoutine

  • autosaveRoutine(action: AnyAction, store: MiddlewareAPI<Dispatch<AnyAction>, Store>, next: Dispatch): AnyAction
  • Performs mechanism of autosave

    Parameters

    • action: AnyAction
    • store: MiddlewareAPI<Dispatch<AnyAction>, Store>
    • next: Dispatch

    Returns AnyAction

Const axiosDelete

  • axiosDelete<ResponsePayload>(path: string, callContext?: ApiCallContext): Observable<ResponsePayload>
  • HTTP DELETE axios request wrapped into RxJS Observable. Can be interrupted by redirectOccured function.

    Type parameters

    • ResponsePayload

      Response payload type

    Parameters

    • path: string

      Endpoint url

    • Optional callContext: ApiCallContext

      Call context

    Returns Observable<ResponsePayload>

Const axiosGet

  • axiosGet<ResponsePayload>(path: string, config?: AxiosRequestConfig, callContext?: ApiCallContext): Observable<ResponsePayload>
  • HTTP GET axios request wrapped into RxJS Observable. Can be interrupted by redirectOccured function.

    Type parameters

    • ResponsePayload

      Response payload type

    Parameters

    • path: string

      Endpoint url

    • config: AxiosRequestConfig = ...
    • Optional callContext: ApiCallContext

      Call context

    Returns Observable<ResponsePayload>

Const axiosPost

  • axiosPost<ResponsePayload>(path: string, data: any, config?: AxiosRequestConfig, callContext?: ApiCallContext): Observable<ResponsePayload>
  • HTTP POST axios request wrapped into RxJS Observable. Can be interrupted by redirectOccured function.

    Type parameters

    • ResponsePayload

      Response payload type

    Parameters

    • path: string

      Endpoint url

    • data: any
    • config: AxiosRequestConfig = ...
    • Optional callContext: ApiCallContext

      Call context

    Returns Observable<ResponsePayload>

Const axiosPut

  • axiosPut<ResponsePayload>(path: string, data: any, callContext?: ApiCallContext): Observable<ResponsePayload>
  • HTTP PUT axios request wrapped into RxJS Observable. Can be interrupted by redirectOccured function.

    Type parameters

    • ResponsePayload

      Response payload type

    Parameters

    • path: string

      Endpoint url

    • data: any
    • Optional callContext: ApiCallContext

      Call context

    Returns Observable<ResponsePayload>

buildBcUrl

  • buildBcUrl(bcName: string, includeSelf?: boolean, store?: Store): string
  • Forms a string representation of business components hierarchy with respect to business components ancestors and their corresponding cursors

    Parameters

    • bcName: string

      Business component name

    • includeSelf: boolean = false

      If result hierarchy should include target bc or only ancestors

    • Optional store: Store

    Returns string

Const buildLocation

  • buildLocation(): (route: Route) => string

buildUrl

  • buildUrl(literals: TemplateStringsArray, ...placeholders: (string | number)[]): string
  • TODO

    Parameters

    • literals: TemplateStringsArray
    • Rest ...placeholders: (string | number)[]

    Returns string

changeLocation

  • changeLocation(href: string): void

combineReducers

  • Combines a dictionary of reducers for different slices of the store into one root reducer.

    Effectively works like default redux combineReducers but provides access to the store via the third argument to allow reducers read only access to other slices (simplifies callbacks, epics and actions' payloads).

    Type parameters

    • State

    Parameters

    Returns Reducer<State, AnyAction>

createActionCreators

  • createActionCreators<A>(actionObj: A): uActionCreators<A>

createActionTypes

flattenOperations

getFilters

  • getFilters(filters: BcFilter[]): Record<string, string>
  • Maps an input array of BcFilter objects into a dictionary of GET-request params

    Name of the param formed as field name and filter type, separated by dot, e.g. ${filter.fieldName}.${filter.type}

    Value of the param is:

    • for non-array values, stringified filter value
    • for array values, a comma-separated list of stringified elements with each element enclosed in double quotes
    see

    parseFilters Reverse function

    Parameters

    • filters: BcFilter[]

      Filters for business components

    Returns Record<string, string>

    Dictionary of query-params for GET-request

getIncludedOperations

getLocaleProviderInstance

  • getLocaleProviderInstance(): i18n

getSorters

  • getSorters(sorters: BcSorter[]): Record<string, string>
  • Maps an input array of business component sorters into a dictionary of query params for Tesler API, where values are field names and keys follows the template: _sort.${index}.${item.direction}

    Parameters

    • sorters: BcSorter[]

      Array of business component sorters

    Returns Record<string, string>

    Dictionary of query-params for GET-request

getStoreInstance

  • getStoreInstance(): Store<Store, AnyAction>

matchOperationRole

  • Check if an operation matches a specified role directly by type or by actionRole field.

    If operation role is unavailable due to the store lacking an appropriate row meta, only role is checked.

    Parameters

    • role: OperationTypeCrud | "none" | string

      Expected operation role or 'none' if operation shouldn't match any crud role

    • payload: ActionPayloadTypes["sendOperation"]

      sendOperation action payload

    • store: Store

      Store instance

    Returns boolean

parseBcCursors

  • parseBcCursors(bcPath: string): Record<string, string>
  • Parses a business component hierarchy url into a dictionary of business components and their cursors.

    Parameters

    • bcPath: string

      Business component hierarchy url, e.g. bcName1/cursor1/bcName2/cursor2

    Returns Record<string, string>

parseFilters

  • parseFilters(defaultFilters: string): BcFilter[]
  • Function for parsing filters from string into BcFilter type

    see

    getFilters Reverse function

    Parameters

    • defaultFilters: string

      string representation of filters

    Returns BcFilter[]

Const parseLocation

  • parseLocation(): (loc: Location<any>) => Route

parseSorters

  • parseSorters(sorters: string): BcSorter[]
  • Parse sorter string into separate sorter objects. String representation of sorters is url based: "_sort.{order}.{direction}={fieldKey}&_sort.{order}.{direction}"

    Parameters

    • sorters: string

      string representation of sorters

    Returns BcSorter[]

Widgets

Const AssocListPopup

AssocListPopup: ConnectedComponent<FunctionComponent<IAssocListProps & IAssocListActions>, Pick<IAssocListProps & IAssocListActions, "widget" | "footer" | "style" | "title" | "mask" | "widgetName" | "className" | "onOk" | "prefixCls" | "size" | "components" | "bodyStyle" | "disablePagination" | "showed" | "onOkHandler" | "onCancelHandler" | "defaultOkText" | "defaultCancelText" | "visible" | "confirmLoading" | "closable" | "afterClose" | "centered" | "width" | "okText" | "okType" | "cancelText" | "maskClosable" | "forceRender" | "okButtonProps" | "cancelButtonProps" | "destroyOnClose" | "wrapClassName" | "maskTransitionName" | "transitionName" | "getContainer" | "zIndex" | "maskStyle" | "keyboard" | "wrapProps" | "closeIcon"> & IAssocListOwnProps> = ...

Const FlatTree

FlatTree: NamedExoticComponent<FlatTreeProps> = ...

Const FlatTreePopup

FlatTreePopup: NamedExoticComponent<FlatTreePopupProps> = ...

Const FormWidget

FormWidget: ConnectedComponent<FunctionComponent<FormWidgetProps>, Pick<FormWidgetProps, "meta"> & FormWidgetOwnProps> = ...

Const PickListPopup

PickListPopup: ConnectedComponent<FunctionComponent<PickListPopupProps & PickListPopupActions>, Pick<PickListPopupProps & PickListPopupActions, "widget" | "footer" | "style" | "title" | "mask" | "widgetName" | "className" | "onOk" | "onCancel" | "prefixCls" | "size" | "components" | "bodyStyle" | "disablePagination" | "showed" | "onOkHandler" | "onCancelHandler" | "defaultOkText" | "defaultCancelText" | "visible" | "confirmLoading" | "closable" | "afterClose" | "centered" | "width" | "okText" | "okType" | "cancelText" | "maskClosable" | "forceRender" | "okButtonProps" | "cancelButtonProps" | "destroyOnClose" | "wrapClassName" | "maskTransitionName" | "transitionName" | "getContainer" | "zIndex" | "maskStyle" | "keyboard" | "wrapProps" | "closeIcon" | "disableScroll"> & PickListPopupOwnProps> = ...

Const TableWidget

TableWidget: ConnectedComponent<FunctionComponent<TableWidgetProps>, Pick<TableWidgetProps, "footer" | "header" | "meta" | "style" | "title" | "onChange" | "children" | "loading" | "widgetName" | "className" | "rowSelection" | "prefixCls" | "dropdownPrefixCls" | "pagination" | "size" | "dataSource" | "components" | "columns" | "rowKey" | "rowClassName" | "expandedRowRender" | "defaultExpandAllRows" | "defaultExpandedRowKeys" | "expandedRowKeys" | "expandIcon" | "expandIconAsCell" | "expandIconColumnIndex" | "expandRowByClick" | "onExpandedRowsChange" | "onExpand" | "locale" | "indentSize" | "onRowClick" | "onRow" | "onHeaderRow" | "useFixedHeader" | "bordered" | "showHeader" | "scroll" | "childrenColumnName" | "bodyStyle" | "tableLayout" | "sortDirections" | "getPopupContainer" | "operations" | "metaInProgress" | "onOperationClick" | "onSelectRow" | "columnTitleComponent" | "showRowActions" | "allowEdit" | "paginationMode" | "disablePagination" | "disableDots" | "controlColumns"> & TableWidgetOwnProps> = ...

Const TextWidget

TextWidget: React.FunctionComponent<TextWidgetOwnProps> = ...
param

Generated using TypeDoc