OptList Module

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.OptList.OptionsItems(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property badge

Get the badge style

property checked

Check default value for radio and check lists

property checked_key

The key in the data with the boolean to check / uncheck an item.

Usages:

its = page.ui.lists.items(["menu %s" % i for i in range(10)])
its.options.checked_key = "selected"
property click

Option property to defined click event on list items. By default this is None.

property delete

Add a delete icon

property delete_icon

Set the delete icon

property delete_position

Set the position and CSS attributes of the delete icon

property delimiter

Value used to aggregate and split string values

property draggable

Property to defined JavaScript draggable events to the list items. By default items are not draggable.

property group

Set the group name for radio boxes

property icon

Check default value for radio and check lists

property info_icon

Set the delete icon

property inline

inline property for the items

property items_space

Keep the LI margin between the items.

property items_type

Change the type of items in the dynamic list.

property label

A text label use in the design of some components.

property li_height

List Item line height CSS Style

property li_style

List Item CSS Style

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 max_selected

Set a max selected item for a normal list.

Usages:

its = page.ui.lists.items(["menu %s" % i for i in range(10)])
its.options.max_selected = 2
its.select_type()
its.click([])
property prefix
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 style

Item CSS Style

property style_select

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

property text_click

Expand the click event to the label for check and radio components. This is a way to define if the click event should be done on the full component or not.

class epyk.core.html.options.OptList.OptionsLi(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property delete
property item_type
property li_class
property li_css
property max
property source
class epyk.core.html.options.OptList.OptionsListBrackets(component: HtmlModel, attrs: Optional[dict] = None, options: Optional[dict] = None, js_tree: Optional[dict] = None, page: Optional[PageModel] = None)
property centerConnectors

route connectors between matches instead of seats.

Related Pages:

Prop flag:

Boolean.

property dir

Related Pages:

Prop value:

String.

property disableHighlight

Related Pages:

Prop flag:

Boolean.

property matchMargin

Related Pages:

Prop num:

String.

onMatchClick(js_funcs, profile=None)
Parameters:
  • js_funcs

  • profile

onMatchHover(js_funcs, profile=None)
Parameters:
  • js_funcs

  • profile

property roundMargin

Related Pages:

Prop num:

String.

save(js_funcs, profile=None)
Parameters:
  • js_funcs

  • profile

property scoreWidth

Related Pages:

Prop num:

String.

property skipConsolationRound

Related Pages:

Prop flag:

Boolean.

property skipGrandFinalComeback

Related Pages:

Prop flag:

Boolean.

property skipSecondaryFinal

Related Pages:

Prop flag:

Boolean.

property teamWidth

Related Pages:

Prop num:

String.

property userData

Related Pages:

Prop value:

String.

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

Dictionary. All the CSS attributes to add the any items

Type:

prop css

property category_css

Dictionary. All the CSS attributes to add the any items

Type:

prop css

property delete

Display the deleted icon on the different items

Prop attrs:

Dictionary or False. The deleted icon properties

property draggable

Set the component draggable and define JavaScript events

Prop js_funcs:

String. The JavaScript functions.

property icon_css

Dictionary. All the CSS attributes to add the any items

Type:

prop css

property item_css

Dictionary. All the CSS attributes to add the any items

Type:

prop css

property max_height

Max height property for the filter tags container. This will then display a show all and reduce button if the size if above this value.

Prop int css:

All the CSS attributes to add the any items

property value_css

Dictionary. All the CSS attributes to add the any items

Type:

prop css

property visible

Dictionary. All the CSS attributes to add the any items

Type:

prop css