lino_react.react.renderer

(This module’s source code is available here.)

Functions

find(itter, target[, key])

Returns the index of an element in a callable which can be use a key function

Classes

Renderer(plugin)

.

lino_react.react.renderer.find(itter, target, key=None)

Returns the index of an element in a callable which can be use a key function

class lino_react.react.renderer.Renderer(plugin)

Bases: lino.core.renderer.JsRenderer, lino.core.renderer_mixins.JsCacheRenderer

. An JS renderer that uses the react Javascript framework.

write_lino_js(f)
Parameters

f – File object

Returns

1

get_request_url(ar, *args, **kw)

Used for turn requests into urls

action_call_on_instance(obj, ar, ba, request_kwargs={}, **status)

Note that ba.actor may differ from ar.actor when defined on a different actor. Remember e.g. the “Must read eID card” action button in eid_info of newcomers.NewClients (20140422).

Obj

The database object

Ar

The action request

Ba

The bound action

Request_kwargs

keyword arguments to forwarded to the child action request

Any kwyword other arguments are forwarded to ar2js().

get_action_icon(action)

Uses an internal mapping for icon names to convert existing icons into react-usable. :param action: :return: str: a icon name for either prime-react or icon8

ar2js(ar, obj, **status)

Implements lino.core.renderer.HtmlRenderer.ar2js().

py2js_converter(v)

Additional converting logic for serializing Python values to json.

goto_instance(ar, obj, detail_action=None, **kw)

Ask the client to display a detail window on the given record. The client might ignore this if Lino does not know a detail window.

This calls obj.get_detail_action.

request_handler(ar, *args, **kw)

Generates js string for action button calls.

show_menu(ar, mnu, level=1)

Render the given menu as an HTML element. Used for writing test cases.

lino_js_parts_chunked(actorId)

Like lino_js_parts, but for actor_level data