OptText Module

class epyk.core.html.options.OptText.OptBreadCrumb(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property delimiter

Set the delimiter for the breadcrumb categories.

Prop value:

String. The delimiter. Default /.

property height

Set the height for the breadcrumb items.

Prop number:

Integer. The height in pixel. Default 0.

set_style(name: str)

Set the breadcrumb to a predefined style. Do not hesitate to share on Github if you think that a new configuration should be promoted to the package.

Parameters:

name – String. The predefined style.

property style_selected

Set the style for the selected item. This style will be added on top of the common CSS style.

Related Pages:

Prop values:

Dictionary. The CSS styles.

class epyk.core.html.options.OptText.OptContents(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property manual

Define the way the content table is updated.

class epyk.core.html.options.OptText.OptSearchResult(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property currPage

Related Pages:

property dsc

Related Pages:

property grey

Related Pages:

Related Pages:

property pageNumber

Related Pages:

property title

Related Pages:

property url

Related Pages:

property visited

Related Pages:

property white

Related Pages:

class epyk.core.html.options.Options(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property builder

Add a JavaScript Builder function to the options.

This will be used to automatically map the Python component to its corresponding JavaScript builder function used by the build method.

Usage:

but = page.ui.button()
but.options.builder = "Button"
Prop value:

The JavaScript builder function name.

property config_default

The default value for the configuration in case of template.

Default value is an empty string.

Usage:

component.options.config_default = {"value": "test"}
config_html()

Return the HTML options used by the python and passed to the HTML.

Those options will not be available in the JavaScript layer and they are only defined either to build the HTML from Python or to set some HTML properties.

The returned dictionary is a copy so it can be changed or used in other processes. To change the internal component property, the options property should be used.

config_js(attrs: Optional[dict] = None)

Return the JavaScript options used by the builders functions.

Builder functions can be defined in the framework or external from the various packages.

The returned dictionary is a copy so it can be changed or used in other processes. To change the internal component property, the options property should be used.

Parameters:

attrs – Optional. The extra or overridden options

custom_config(name: str, value: Any, js_type: bool = False)

Add a custom JavaScript configuration.

Usage:

chart = page.ui.charts.apex.scatter()
chart.options.chart.zoom.custom_config("test", False)
Parameters:
  • name – The key to be added to the attributes

  • value – String or JString. The value of the defined attributes

  • js_type – Optional. Specify if the parameter is a JavaScript fragment

details()

Retrieve the defined properties details.

This function will return a dictionary with all the component attributes (required and optional) ones. It will provide the full available description of those components.

Usage:

but = page.ui.button()
pprint.pprint(but.options.details(), indent=4)
from_json(vals: dict, schema: Optional[dict] = None)

Load the option schema for a component from a json string.

TODO: add more feature to handle functions and enumeration

Parameters:
  • vals – The input schema

  • schema – The full object schema

has_attribute(cls_obj, name: Optional[str] = None)

Add an extra sub layer to the data structure.

The key in the object representation will be the function name.

Parameters:
  • cls_obj – Class. The sub data class used in the structure definition

  • name – The sub attribute name

isJsContent(property_name: str)

Check if the content of a property is defined to always be a JavaScript fragment.

Thus the framework will not convert it to a Json content.

Usage:

div = page.ui.div()
print(div.options.isJsContent("inline"))
Parameters:

property_name – The property name

property managed

Boolean flag to set if the component needs to be added to the page.

If set to False the component has to be managed manually in the page.

Usage:

but = page.ui.button()
but.options.managed = False
Prop bool:

Flag to specify if this component is automatically managed by the page

optional()

Return all options not added to the HTML component by default.

Those are options which will impact either the Python or the JavaScript builders.

To get the full definition of options the details method should be used.

Usage:

but = page.ui.button()
pprint.pprint(but.options.optional(), indent=4)
property profile

Boolean flag to set if extra logs need to be displayed.

This could help in debugging, default is the page verbose flag (default is false).

Usage:

but = page.ui.button()
but.options.verbose = True
Prop flag:

Flag to display / hide warning logs generated by the framework.

required()

Return all the mandatory / required options with the default values.

Those options are added by the framework to provide a default for the HTML components but they can be changed.

System options are also added to this category as they are always available in any HTML components.

To get the full definition of options the details method should be used.

Usage:

but = page.ui.button()
pprint.pprint(but.options.required(), indent=4)
set_attrs(vals: dict)

Set the object internal attributes.

Parameters:

vals – All the attributes to be added to the component

property style

Change some CSS attributes to the internal HTML component.

Related Pages:

Prop values:

The CSS attributes.

update_config(attrs: dict)

Update the option configuration.

Parameters:

attrs – The attributes to set

property verbose

Boolean flag to set if extra logs need to be displayed.

This could help in debugging, default is the page verbose flag (default is false).

Usage:

but = page.ui.button()
but.options.verbose = True
Prop flag:

Boolean. Flag to display / hide warning logs generated by the framework.

class epyk.core.html.options.OptText.OptionsComposite(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property reset_class
class epyk.core.html.options.OptText.OptionsConsole(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property timestamp
class epyk.core.html.options.OptText.OptionsHighlights(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property close

Related Pages:

property close_css

Related Pages:

property markdown

Showdown is a Javascript Markdown to HTML converter, based on the original works by John Gruber. Showdown can be used client side (in the browser) or server side (with NodeJs).

Related Pages:

property reset

Related Pages:

property showdown

Showdown is a Javascript Markdown to HTML converter, based on the original works by John Gruber. Showdown can be used client side (in the browser) or server side (with NodeJs).

Related Pages:

property href

The href attribute specifies the URL of the page the link goes to.

Related Pages:

property target

The target attribute specifies where to open the linked document.

Related Pages:

property url

The href attribute specifies the URL of the page the link goes to.

Related Pages:

class epyk.core.html.options.OptText.OptionsNumber(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property decimal_sep

decimal point separator.

Related Pages:

property digits

decimal point separator.

Related Pages:

property format

%s = symbol, %v = value/number.

Related Pages:

Type:

controls output

property label

The label attached to a number component.

Prop text:

String. The value.

property symbol

default currency symbol is ‘’.

Related Pages:

property thousand_sep

thousands separator.

Related Pages:

class epyk.core.html.options.OptText.OptionsNumberDelta(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property previous_label

Set the label displayed before the previous value in the component.

property threshold1

The first threshold.

property threshold2

The second threshold (smaller than the first one).

class epyk.core.html.options.OptText.OptionsNumberMoves(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property css

The label attached to a number component.

Prop attrs:

Dictionary. The CSS attributes.

property font_size

The font size used by the percentage and difference.

Related Pages:

property rotate

Related Pages:

https://www.w3schools.com/cssref/css3_pr_transform.asp

class epyk.core.html.options.OptText.OptionsStatus(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property background
property change_menu
property color
property states
class epyk.core.html.options.OptText.OptionsText(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property editable

Set the content of the component editable.

Related Pages:

property font_size

Related Pages:

property green

Related Pages:

property html_encode

Encode Python content to HTML format.

property limit_char

Related Pages:

property markdown

Showdown is a Javascript Markdown to HTML converter, based on the original works by John Gruber. Showdown can be used client side (in the browser) or server side (with NodeJs).

Related Pages:

property multiline

Replace the Python to the HTML tag <br/>.

property orange

Related Pages:

property red

Related Pages:

property reset

Related Pages:

property showdown

Showdown is a Javascript Markdown to HTML converter, based on the original works by John Gruber. Showdown can be used client side (in the browser) or server side (with NodeJs).

Related Pages:

property spellcheck

The spellcheck attribute specifies whether the element is to have its spelling and grammar checked or not.

Related Pages:

property style_select

Internal CSS class name to be used when the component is selected.

class epyk.core.html.options.OptText.OptionsTitle(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property content_table

Related Pages: