HtmlTextComp Module
- class epyk.core.html.HtmlTextComp.BlockText(page: PageModel, record: list, color: Optional[str], border: str, width: tuple, height: tuple, helper: Optional[str], options: Optional[dict], profile: Optional[Union[bool, dict]])
- property options: OptionsText
Property to set all the possible object for a button.
- Return type:
- class epyk.core.html.HtmlTextComp.Composite(page: PageModel, schema, width, height, html_code, options, profile, helper)
- click(js_funcs: Union[list, str], profile: Optional[Union[bool, dict]] = None, source_event: Optional[str] = None, on_ready: bool = False)
The onclick event occurs when the user clicks on an element.
Usage:
div = page.ui.div() div.click([ page.js.alert("This is a test") ])
Related Pages:
- Parameters:
js_funcs – A Javascript Python function
profile – Optional. Set to true to get the profile for the function on the Javascript console
source_event – Optional. The source target for the event
on_ready – Optional. Specify if the event needs to be trigger when the page is loaded
- property dom: JsHtmlRich
Return all the Javascript functions defined for an HTML Component. Those functions will use plain javascript by default.
This is the only flexible component in which this DOM object can be changed.
- Returns:
A Javascript Dom object
- property options: OptionsComposite
Property to the component options. Options can either impact the Python side or the Javascript builder.
Python can pass some options to the JavaScript layer.
- set_builder(builder: str)
Change the default builder definition.
This method can be used to externalise the JavaScript expression to dedicated modules. If nothing is defined the default one defined in the class property _js__builder__ will be used.
Usage:
page = pk.Page() page.properties.js.add_text(''' function NewButton(htmlObj, data, options){ htmlObj.style.color = "red"; htmlObj.innerHTML = data} ''') page.properties.js.set_constructor("NewButton") btn = page.ui.button("click") btn.set_builder("NewButton") btn2 = page.ui.button("click 2") btn.click([btn.build("Clicked"), btn2.build("Clicked")])
- Parameters:
name – The builder name (alias but also function name)
all_components – Apply the builder change to all components generated from this class
- property style: ClassHtmlEmpty
Property to the CSS Style of the component.
- class epyk.core.html.HtmlTextComp.ContentsTable(page: PageModel, title, width, height, html_code, options, profile)
- add_category(text: str, level: Optional[int] = None, options: Optional[dict] = None, html_code_content: str = 'content')
Add a bespoke title to the page without click event.
- Parameters:
text – The text visible on the page
level – Optional. The depth for the title in the document
options – Optional. The options for the title component
html_code_content – Optional. The Html code of the component Content table
- add_title(component: Html, level: Optional[int] = None, css: Optional[dict] = None, position: str = 'before', options: Optional[dict] = None, html_code_content: str = 'content')
Add a bespoke title to the page.
- Parameters:
component – An HTML component
level – Optional. The depth for the title in the document
css – Optional. The CSS style for the link
position – Optional. The position in the content table (append or prepend)
options – Optional. The options for the title component
html_code_content – Optional. The Html code of the component Content table
- add_url(component: Html, url: str, level: Optional[int] = None, options: Optional[dict] = None, html_code_content: str = 'content')
Add a bespoke link to the content table. Those links can redirect to external pages.
- Parameters:
component – An HTML component
url – The url link with component clicked
level – Optional. The depth for the title in the document
options – Optional. The options for the title component
html_code_content – Optional. The Html code of the component Content table
- anchor(text: str, level: int = 0, anchor: str = '#', options: Optional[dict] = None)
Add link to the content table.
Related Pages:
- Parameters:
text – The link label
level – Optional. The depth of the link in the document tree
anchor – Optional. The internal reference to another component in the page
options – Optional. The component options for the link
- move()
- property options: OptContents
Property to set all the possible object for the content menu on the page. This object can be defined only once on the page.
- property style: ContentTable
Property to the CSS Style of the component.
- class epyk.core.html.HtmlTextComp.Delta(page: PageModel, records, components, width, height, options, helper, profile)
- property options: OptionsNumberDelta
Property to set all the possible object for a button.
- Return type:
- class epyk.core.html.HtmlTextComp.Formula(page: PageModel, text, width, height, color, html_code, helper, options, profile)
- property js: Mathjax
Return all the Javascript functions defined for an HTML Component. Those functions will use plain javascript by default.
Related Pages:
- Returns:
A Javascript Dom object
- Return type:
JsMathjax.Mathjax
- property style: ClsFormula
Property to the CSS Style of the component.
- class epyk.core.html.HtmlTextComp.Number(page: PageModel, number, components, label, width, height, profile, options, helper)
- build(data=None, options: Optional[dict] = None, profile: Optional[Union[bool, dict]] = None, component_id: Optional[str] = None, dataflows: Optional[List[dict]] = None, **kwargs)
Return the JavaScript fragment to refresh the component content.
Usage:
dt = page.ui.rich.update() page.ui.button("Update").click([dt.refresh()])
- Parameters:
data – Optional. Component data
options – Optional. Specific Python options available for this component
profile – Optional. A flag to set the component performance storage
component_id – Optional. The object reference ID
dataflows – Chain of data transformations
- click(js_funcs: Union[list, str], profile: Optional[Union[bool, dict]] = None, source_event: Optional[str] = None, on_ready: bool = False)
The onclick event occurs when the user clicks on an element.
Usage:
div = page.ui.div() div.click([ page.js.alert("This is a test") ])
Related Pages:
- Parameters:
js_funcs – A Javascript Python function
profile – Optional. Set to true to get the profile for the function on the Javascript console
source_event – Optional. The source target for the event
on_ready – Optional. Specify if the event needs to be trigger when the page is loaded
- class epyk.core.html.HtmlTextComp.SearchResult(page: PageModel, records, width, height, options, profile)
- class epyk.core.html.HtmlTextComp.Status(page: PageModel, status, width, height, html_code, profile, options)
- property options: OptionsStatus
Property to the component options. Options can either impact the Python side or the Javascript builder.
Python can pass some options to the JavaScript layer.
- class epyk.core.html.HtmlTextComp.TextWithBorder(page: PageModel, record: list, width: tuple, height: tuple, align: Optional[str], helper: Optional[str], options: Optional[dict], profile: Optional[Union[bool, dict]])
- property options: OptionsText
Property to the component options. Options can either impact the Python side or the Javascript builder.
Python can pass some options to the JavaScript layer.
- Return type:
- class epyk.core.html.HtmlTextComp.TrafficLight(page: PageModel, color, label, height, tooltip, helper, options, profile)
- click(js_funcs: Union[list, str], profile: Optional[Union[bool, dict]] = None, source_event: Optional[str] = None, on_ready: bool = False)
Add a click event to the HTML component.
- Parameters:
js_funcs – Javascript functions
profile – Optional. A flag to set the component performance storage
source_event – Optional. The JavaScript DOM source for the event (can be a sug item)
on_ready – Optional. Specify if the event needs to be trigger when the page is loaded
- colors(green: Optional[str] = None, red: Optional[str] = None, neutral: Optional[str] = None)
Set the 3 colors of the traffic light.
- Parameters:
green – Optional. The color used in case of result true
red – Optional. The color used in case of result false
neutral – Optional. The color used in case of null
- Returns:
self to allow the chains.
- property dom: JsHtmlBackground
Return all the Javascript functions defined for an HTML Component. Those functions will use plain javascript by default.
- Returns:
A Javascript Dom object
- resolve(js_funcs: Union[list, str], profile: Optional[Union[bool, dict]] = None)
Turn a error warning to a green one.
- Parameters:
js_funcs – Javascript functions
profile – Optional. A flag to set the component performance storage
- class epyk.core.html.HtmlTextComp.UpDown(page: PageModel, record: dict, components: List[Html], color: Optional[str], label: Optional[str], width: tuple, height: tuple, options: Optional[dict], helper: Optional[str], profile: Optional[Union[bool, dict]])
- click(js_funcs: Union[list, str], profile: Optional[Union[bool, dict]] = None, source_event: Optional[str] = None, on_ready: bool = False)
Add a click event to the HTML component.
- Parameters:
js_funcs (Union[list, str]) – Javascript functions.
profile (Optional[Union[bool, dict]]) – Optional. A flag to set the component performance storage.
source_event (Optional[str]) – Optional. The source target for the event.
on_ready (bool) – Optional. Specify if the event needs to be trigger when the page is loaded.
- property options: OptionsNumberMoves
Property to the component options. Options can either impact the Python side or the Javascript builder.
Python can pass some options to the JavaScript layer.
Usage:
move = page.ui.numbers.move(100, 60, height=120, helper="Show delta with yesterday") move.options.digits_percent = 4
- Return type: