Esempio n. 1
0
    def timer(self,
              minutes,
              text="",
              width=(None, "%"),
              height=(None, "px"),
              align=None,
              options=None,
              htmlCode=None,
              profile=None):
        """
    Description:
    ------------

    Usage::


    Attributes:
    ----------
    :param minutes:
    :param text: String. Optional. The value to be displayed to the timer
    :param width: Tuple. Optional. A tuple with the integer for the component width and its unit
    :param height: Tuple. Optional. A tuple with the integer for the component height and its unit
    :param align: String. The text-align property within this component
    :param options: Dictionary. Optional. Specific Python options available for this component
    :param htmlCode: String. Optional. An identifier for this component (on both Python and Javascript side)
    :param profile: Optional. A flag to set the component performance storage
    """
        width = Arguments.size(width, unit="%")
        height = Arguments.size(height, unit="px")
        html_timer = html.HtmlDates.Timer(self.context.rptObj, minutes, text,
                                          width, height, align, options,
                                          htmlCode, profile)
        return html_timer
Esempio n. 2
0
  def console(self, content="", width=(100, "%"), height=(200, "px"), htmlCode=None, options=None, profile=None):
    """
    Description:
    ------------

    Underlying HTML Objects:

      - :class:`epyk.core.html.HtmlTextEditor.Console`

    Templates:

        https://github.com/epykure/epyk-templates/blob/master/locals/components/checkbox.py

    Attributes:
    ----------
    :param content:
    :param width:
    :param height:
    :param htmlCode:
    :param options:
    :param profile:
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    dflt_options = {"markdown": False, "timestamp": True}
    if options is not None:
      dflt_options.update(options)
    html_div = html.HtmlTextEditor.Console(self.context.rptObj, content, width, height, htmlCode, None, dflt_options, profile)
    html_div.css({"border": "1px solid %s" % html_div._report.theme.greys[4], "background": html_div._report.theme.greys[2],
                  'padding': '5px'})
    return html_div
Esempio n. 3
0
  def markdown(self, text="", width=(90, '%'), height=(100, '%'), htmlCode=None, options=None, profile=None):
    """
    Description:
    ------------

    Usage::

      rptObj.ui.inputs.editor()

    Underlying HTML Objects:

      - :class:`epyk.core.html.HtmlTextEditor.Editor`

    Templates:

      https://github.com/epykure/epyk-templates/blob/master/locals/components/markdown.py

    Attributes:
    ----------
    :param text:
    :param width:
    :param height:
    :param htmlCode:
    :param options:
    :param profile:
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="%")
    dflt_options = {"markdown": True}
    if options is not None:
      dflt_options.update(options)
    md = html.HtmlTextEditor.MarkdownReader(self.context.rptObj, text, width, height, htmlCode, dflt_options, profile)
    return md
Esempio n. 4
0
    def select(self,
               text="Loading...",
               width=(None, "%"),
               height=(None, "%"),
               options=None,
               profile=None):
        """
    https://github.com/material-components/material-components-web/tree/master/packages/mdc-linear-progress

    Attributes:
    ----------
    :param text:
    :param width:
    :param height:
    :param options:
    :param profile:
    """
        width = Arguments.size(width, unit="px")
        height = Arguments.size(height, unit="px")
        html_but = HtmlMdcForms.Select(self.page, text, None, options or {},
                                       profile, {
                                           "width": width,
                                           "height": height
                                       })
        return html_but
Esempio n. 5
0
  def delta(self, rec=None, width=(200, 'px'), height=(80, 'px'), options=None, helper=None, profile=None):
    """
    Description:
    ------------

    Usage::

      rptObj.ui.rich.delta({'number': 100, 'prevNumber': 60, 'thresold1': 100, 'thresold2': 50}, helper="test")

    Underlying HTML Objects:

      - :class:`epyk.core.html.HtmlTextComp.Delta`

    Attributes:
    ----------
    :param rec:
    :param width: Optional. A tuple with the integer for the component width and its unit
    :param height: Optional. A tuple with the integer for the component height and its unit
    :param helper: Optional. A tooltip helper
    :param profile: Optional. A flag to set the component performance storage
    """
    width = Arguments.size(width, unit="px")
    height = Arguments.size(height, unit="px")
    dflt_options = {"digits": 0, 'thousand_sep': ",", 'decimal_sep': ".",
                    'red': self.context.rptObj.theme.danger[1], 'green': self.context.rptObj.theme.success[1],
                    'orange': self.context.rptObj.theme.warning[1]}
    if options is not None:
      dflt_options.update(options)
    html_delta = html.HtmlTextComp.Delta(self.context.rptObj, rec or {}, width, height, dflt_options, helper, profile)
    return html_delta
Esempio n. 6
0
    def room(self,
             img,
             htmlCode=None,
             width=(60, 'px'),
             height=(60, 'px'),
             options=None,
             profile=False):
        """
    Description:
    ------------

    Attributes:
    ----------
    :param img: String. The image path on the server or locally to be used
    :param htmlCode: String. Optional. The id for this component
    :param width: Tuple. Optional. A tuple with the integer for the component width and its unit
    :param height: Tuple. Optional. A tuple with the integer for the component height and its unit
    :param options: Dictionary. Optional. Specific Python options available for this component
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage
    """
        width = Arguments.size(width, unit="px")
        height = Arguments.size(height, unit="px")
        dflt_options = {"dated": True, 'markdown': True}
        if options is not None:
            dflt_options.update(options)
        return html.HtmlNetwork.Room(self.context.rptObj, img, width, height,
                                     htmlCode, dflt_options, profile)
Esempio n. 7
0
    def navbar(self,
               text="Loading...",
               width=(None, "%"),
               height=(None, "%"),
               options=None,
               profile=None):
        """
    https://github.com/material-components/material-components-web/tree/master/packages/mdc-top-app-bar#regular-top-app-bar

    Attributes:
    ----------
    :param text:
    :param width:
    :param height:
    :param options:
    :param profile:
    """
        self.page.cssImport.add("material-icons")
        width = Arguments.size(width, unit="px")
        height = Arguments.size(height, unit="px")
        html_but = HtmlMdcForms.TopAppBar(self.page, text, None, options or {},
                                          profile, {
                                              "width": width,
                                              "height": height
                                          })
        return html_but
Esempio n. 8
0
  def squares(self, data=None, width=('auto', ""), height=(None, 'px'), html_code: str = None, helper: str = None,
              options: dict = None, profile: Union[bool, dict] = None):
    """
    Description:
    ------------

    Usage::

      page.ui.lists.squares(["A", "B"])

    Underlying HTML Objects:

      - :class:`epyk.core.html.HtmlList.List`

    Related Pages:

      https://www.w3schools.com/cssref/pr_list-style-type.asp

    Attributes:
    ----------
    :param data:
    :param width: Tuple. Optional. A tuple with the integer for the component width and its unit
    :param height: Tuple. Optional. A tuple with the integer for the component height and its unit
    :param html_code: String. Optional. An identifier for this component (on both Python and Javascript side)
    :param helper: String. Optional. A tooltip helper
    :param options: Dictionary. Optional. Specific Python options available for this component
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    html_list = self.items(data, width, height, options, html_code, profile, helper)
    html_list.style.css.list_style_type = "square"
    html_list.style.css.margin_left = 20
    html.Html.set_component_skin(html_list)
    return html_list
Esempio n. 9
0
  def tree(self, data=None, width=('auto', ""), height=(None, 'px'), html_code: str = None,
           helper: str = None, options: dict = None, profile: Union[bool, dict] = None):
    """
    Description:
    ------------

    Usage::

      data = [{"label": 'test', 'items': [{"label": 'child 1', 'color': 'red'}]}]
      page.ui.lists.tree(data)

    Underlying HTML Objects:

      - :class:`epyk.core.html.HtmlTrees.Tree`

    ----------
    :param data:
    :param width: Tuple. Optional. A tuple with the integer for the component width and its unit
    :param height: Tuple. Optional. A tuple with the integer for the component height and its unit
    :param html_code: String. Optional. An identifier for this component (on both Python and Javascript side)
    :param helper: String. Optional. A tooltip helper
    :param options: Dictionary. Optional. Specific Python options available for this component
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    html_tree = html.HtmlTrees.Tree(self.page, data or [], width, height, html_code, helper, options, profile)
    html.Html.set_component_skin(html_tree)
    return html_tree
Esempio n. 10
0
  def box(self, records=None, width=(100, "%"), height=(None, "%"), options: dict = None, html_code: str = None,
          profile: Union[bool, dict] = None, helper: str = None):
    """
    Description:
    ------------
    Special list configuration for a list of box with a title with a text and a list of icons

    Usage::

      page.ui.lists

    Templates:

      https://github.com/epykure/epyk-templates/blob/master/locals/components/list_box.py

    Attributes:
    ----------
    :param records:
    :param width: Tuple. Optional. A tuple with the integer for the component width and its unit
    :param height: Tuple. Optional. A tuple with the integer for the component height and its unit
    :param options: Dictionary. Optional. Specific Python options available for this component
    :param html_code: String. Optional. An identifier for this component (on both Python and Javascript side)
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage
    :param helper: String. Optional. A tooltip helper
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="%")
    dflt_options = {"items_type": 'box'}
    if options is not None:
      dflt_options.update(options)
    html_item = html.HtmlList.Items(self.page, records, width, height, dflt_options, html_code, profile, helper)
    html_item.css({"list-style-type": 'none'})
    html_item.style.css.padding_left = '15px'
    html.Html.set_component_skin(html_item)
    return html_item
Esempio n. 11
0
  def numbers(self, data=None, width=('auto', ""), height=(None, 'px'), html_code: str = None, options: dict = None,
              profile: Union[bool, dict] = None, helper: str = None):
    """
    Description:
    ------------

    Usage::

      page.ui.lists.numbers(["A", "B"])

    Underlying HTML Objects:

      - :class:`epyk.core.html.HtmlList.List`

    Related Pages:

      https://www.w3schools.com/html/html_lists.asp
      https://www.w3.org/wiki/CSS/Properties/list-style-type
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    html_list = self.items(data, width, height, options, html_code, profile, helper)
    html_list.style.css.list_style_type = "decimal"
    html_list.style.css.margin_left = 20
    html.Html.set_component_skin(html_list)
    return html_list
Esempio n. 12
0
  def items(self, records=None, width=(100, "%"), height=("auto", ""), options: dict = None,
            html_code: str = None, profile: Union[bool, dict] = None, helper: str = None):
    """
    Description:
    ------------

    Usage::

      page.ui.lists

    Templates:

      https://github.com/epykure/epyk-templates/blob/master/locals/components/list.py
      https://github.com/epykure/epyk-templates/blob/master/locals/components/list_custom.py
      https://github.com/epykure/epyk-templates/blob/master/locals/components/list_filter.py

    Attributes:
    ----------
    :param records: List. Optional. The list of dictionaries with the input data.
    :param width: Tuple. Optional. A tuple with the integer for the component width and its unit
    :param height: Tuple. Optional. A tuple with the integer for the component height and its unit
    :param options: Dictionary. Optional. Specific Python options available for this component
    :param html_code: String. Optional. An identifier for this component (on both Python and Javascript side)
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage
    :param helper: String. Optional. A tooltip helper
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    dft_options = {"items_type": 'text'}
    if options is not None:
      dft_options.update(options)
    html_item = html.HtmlList.Items(self.page, records or [], width, height, dft_options, html_code, profile, helper)
    html_item.css({"list-style-type": 'none'})
    html.Html.set_component_skin(html_item)
    return html_item
Esempio n. 13
0
    def youtube(self,
                video_id=None,
                width=(100, "%"),
                height=(None, "px"),
                align="center",
                htmlCode=None,
                profile=None,
                options=None):
        """
    Description:
    ------------
    Get teh picture used by youtube

    Attributes:
    ----------
    :param video_id:
    :param width: Optional. Tuple. The component width in pixel or percentage
    :param height: Optional. Tuple. The component height in pixel or percentage
    :param align: String. Optional. A string with the horizontal position of the component
    :param htmlCode: String. Optional. An identifier for this component (on both Python and Javascript side)
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage
    :param options: Dictionary. Optional. Specific Python options available for this component
    """
        return self.img("0.jpg", "http://img.youtube.com/vi/%s" % video_id,
                        Arguments.size(width), Arguments.size(height, 'px'),
                        align, htmlCode, profile, options)
Esempio n. 14
0
    def img(self,
            image=None,
            path=None,
            width=(100, "%"),
            height=(None, "px"),
            align="center",
            htmlCode=None,
            profile=None,
            tooltip=None,
            options=None):
        """
    Description:
    ------------
    Add an HTML image to the page. The path can be defined either in a absolute or relative format.

    Tip: The absolute format does not work on servers. It is recommended to use relative starting to the root of the server

    Usage::

      rptObj.ui.img("epykIcon.PNG", path=r"../../../static/images", height=(50, "px"))


    Underlying HTML Objects:

      - :class:`epyk.core.html.HtmlImage.Image`

    Related Pages:

      https://www.w3schools.com/bootstrap/bootstrap_ref_css_images.asp
      https://www.w3schools.com/cssref/css3_pr_border-radius.asp

    Templates:

      https://github.com/epykure/epyk-templates/blob/master/locals/components/image.py

    Attributes:
    ----------
    :param image: String. The image file name
    :param path: Optional. String. The image file path
    :param width: Optional. Tuple. The component width in pixel or percentage
    :param height: Optional. Tuple. The component height in pixel or percentage
    :param align: String. Optional. A string with the horizontal position of the component
    :param htmlCode: String. Optional. An identifier for this component (on both Python and Javascript side)
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage
    :param tooltip: String. Optional. A string with the value of the tooltip
    :param options: Optional. Specific Python options available for this component
    """
        width = Arguments.size(width, unit="%")
        height = Arguments.size(height, unit="px")
        if height[0] not in [None, 'auto'] and width[1] == '%':
            width = ("auto", '')
        html_image = html.HtmlImage.Image(
            self.context.rptObj, self.context.rptObj.py.encode_html(image),
            self.context.rptObj.py.encode_html(path), align, htmlCode, width,
            height, profile, options or {})
        if tooltip is not None:
            html_image.tooltip(tooltip)
        if width[0] is None:
            html_image.style.css.max_width = '100%'
        return html_image
Esempio n. 15
0
  def table(self, components=None, width=(100, '%'), height=(None, 'px'), helper: str = None, options=None,
            profile: Union[bool, dict] = None):
    """
    Description:
    ------------
    table layout for HTML components.

    :tags:
    :categories:

    Usage::

      row = page.ui.layouts.table()

    Underlying HTML Objects:

      - :class:`epyk.core.html.HtmlContainer.Table`

    Templates:


    Attributes:
    ----------
    :param components: List. The different HTML objects to be added to the component.
    :param width: Tuple. Optional. A tuple with the integer for the component width and its unit.
    :param height: Tuple. Optional. A tuple with the integer for the component height and its unit.
    :param helper: String. Optional. A tooltip helper.
    :param options: Dictionary. Optional. Specific Python options available for this component.
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage.
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    html_row = html.HtmlContainer.Table(self.page, components, width, height, helper, options, profile)
    html.Html.set_component_skin(html_row)
    return html_row
Esempio n. 16
0
  def brackets(self, records=None, width=(100, "%"), height=(550, 'px'), options: dict = None,
               profile: Union[bool, dict] = None):
    """
    Description:
    ------------

    Usage::

      page.ui.lists

    Attributes:
    ----------
    :param records:
    :param width: Tuple. Optional. A tuple with the integer for the component width and its unit
    :param height: Tuple. Optional. A tuple with the integer for the component height and its unit
    :param options: Dictionary. Optional. Specific Python options available for this component
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    dfp_options = {}
    if options is not None:
      dfp_options.update(options)
    component = html.HtmlList.ListTournaments(self.page, records, width, height, dfp_options, profile)
    html.Html.set_component_skin(component)
    return component
Esempio n. 17
0
  def iframe(self, url: str = "", width=(100, "%"), height=(100, "%"), helper: str = None,
             profile: Union[bool, dict] = None):
    """
    Description:
    ------------
    Add a iframe component to the page.

    :tags:
    :categories:

    Usage::

      page.ui.layouts.iframe("http://www.google.com")

    Underlying HTML Objects:

      - :class:`epyk.core.html.HtmlContainer.IFrame`

    Templates:

    Attributes:
    ----------
    :param url: String. Optional. The link to the underlying page.
    :param width: Tuple. Optional. A tuple with the integer for the component width and its unit.
    :param height: Tuple. Optional. A tuple with the integer for the component height and its unit.
    :param helper: String. Optional. A tooltip helper.
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage.
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="%")
    component = html.HtmlContainer.IFrame(self.page, url, width, height, helper, profile)
    html.Html.set_component_skin(component)
    return component
Esempio n. 18
0
  def sql(self, text="", color=None, width=(90, '%'), height=(200, 'px'), htmlCode=None, options=None, helper=None, profile=None):
    """
    Description:
    ------------
    SQL Text editor

    Underlying HTML Objects:

      - :class:`epyk.core.html.HtmlTextEditor.Code`

    Related Pages:

      https://codemirror.net/index.html

    Usage::


    Attributes:
    ----------
    :param text: String. The text
    :param color: String. The color code
    :param width: Tuple. The with details in the format(value, unit)
    :param height: Tuple. The height details in the format(value, unit)
    :param htmlCode: String. The unique component ID
    :param options: Dictionary. The object properties
    :param helper: String. Optional. The helper message
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    dflt_options = {"lineNumbers": True, 'mode': 'sql', 'matchBrackets': True, 'styleActiveLine': True, 'autoRefresh': True}
    if options is not None:
      dflt_options.update(options)
    html_code = html.HtmlTextEditor.Code(self.context.rptObj, text, color, width, height, htmlCode, dflt_options, helper, profile)
    return html_code
Esempio n. 19
0
    def bot(self,
            htmlCode,
            width=(100, '%'),
            height=(200, 'px'),
            profile=None,
            options=None):
        """
    Description:
    ------------

    Underlying HTML Objects:

      - :class:`epyk.core.html.HtmlMessaging.Bot`

    Templates:

      https://github.com/epykure/epyk-templates/blob/master/locals/components/bot.py

    Attributes:
    ----------
    :param htmlCode: String. Optional. An identifier for this component (on both Python and Javascript side)
    :param width:
    :param width: Tuple. Optional. A tuple with the integer for the component width and its unit
    :param height: Tuple. Optional. A tuple with the integer for the component height and its unit
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage
    :param options: Dictionary. Optional. Specific Python options available for this component
    """
        width = Arguments.size(width, unit="%")
        height = Arguments.size(height, unit="px")
        dflt_options = {'readonly': False, 'markdown': True, 'dated': True}
        if options is not None:
            dflt_options.update(options)
        return html.HtmlNetwork.Bot(self.context.rptObj, width, height,
                                    htmlCode, dflt_options, profile)
Esempio n. 20
0
    def navbar(self,
               values=None,
               html_code=None,
               width=(100, "%"),
               height=(None, "%"),
               profile=None,
               options=None):
        """
    Description:
    -----------

    Attributes:
    ----------
    :param values:
    :param html_code:
    :param width:
    :param height:
    :param profile:
    :param options:
    """
        width = Arguments.size(width, unit="px")
        height = Arguments.size(height, unit="px")
        component = HtmlBsWidgets.BsNavBar(self.page, None, html_code, options
                                           or {}, profile, {
                                               "width": width,
                                               "height": height
                                           })
        component.attr["aria-labelledby"] = "offcanvasLabel"
        component.attr["tabindex"] = "-1"
        component.add_to_header(self.page.web.bs.offcanvas.dismiss(component))
        if values is not None:
            for v in values:
                component.add_to_body(v)
        return component
Esempio n. 21
0
    def text(self,
             text="Loading...",
             width=(None, "%"),
             height=(None, "%"),
             options=None,
             profile=None):
        """

    Attributes:
    ----------
    :param text:
    :param width:
    :param height:
    :param options:
    :param profile:
    """
        width = Arguments.size(width, unit="px")
        height = Arguments.size(height, unit="px")
        html_but = HtmlMdcForms.Text(self.page, text, None, options or {},
                                     profile, {
                                         "width": width,
                                         "height": height
                                     })
        if options is not None and options.get("large"):
            html_but.attr["class"].add("ms-Spinner--large")
        return html_but
Esempio n. 22
0
  def json(self, data=None, width=(None, '%'), height=(100, '%'), options=None, profile=None):
    """
    Description:
    ------------
    HTML component to display a Json

    Related Pages:

      https://github.com/mohsen1/json-formatter-js

    Attributes:
    ----------
    :param data: Dictionary. The Json object to be display
    :param width: Tuple. Optional. A tuple with the integer for the component width and its unit
    :param height: Tuple. Optional. A tuple with the integer for the component height and its unit
    :param options: Dictionary. Optional. Specific Python options available for this component
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage
    """
    data = data or {}
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    h_json = html.HtmlOthers.HtmlJson(self.rptObj, data, width, height, options, profile)
    if height[1] != '%':
      h_json.style.css.overflow = 'auto'
    return h_json
Esempio n. 23
0
  def timeseries(self, record=None, y_columns=None, x_axis=None, profile=None, options=None, width=(100, "%"),
                 height=(330, "px"), html_code=None):
    """
    Description:
    ------------
    Display a line chart from ChartJs.

    :tags:
    :categories:

    Usage::

    Related Pages:

      https://www.chartjs.org/samples/latest/scales/logarithmic/line.html

    Attributes:
    ----------
    :param record: List. Optional. The list of dictionaries with the input data.
    :param y_columns: List. Optional. The columns corresponding to keys in the dictionaries in the record.
    :param x_axis: String. Optional. The column corresponding to a key in the dictionaries in the record.
    :param profile: Boolean | Dictionary. Optional. A flag to set the component performance storage.
    :param width: Tuple. Optional. The width of the component in the page, default (100, '%').
    :param height: Tuple. Optional. The height of the component in the page, default (330, "px").
    :param options: Dictionary. Optional. Specific Python options available for this component.
    :param html_code: String. Optional. An identifier for this component (on both Python and Javascript side).
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    line = self.line(record, y_columns, x_axis, profile, width, height, options, html_code)
    return line
Esempio n. 24
0
  def slideshow(self, components=None, width=(100, "%"), height=('auto', ""), options=None, profile=None):
    """
    Description:
    ------------
    SlideShow component for pictures from the tiny-slider library.
    More details regarding this library here: https://github.com/ganlanyuan/tiny-slider

    Usage::

    Related Pages:

      https://github.com/ganlanyuan/tiny-slider
      http://ganlanyuan.github.io/tiny-slider/demo/

    Attributes:
    ----------
    :param components: List. With the different components
    :param width: Optional. Tuple. The component width in pixel or percentage
    :param height: Optional. Tuple. The component height in pixel
    :param options: Dictionary. Optional. Specific Python options available for this component
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage
    """
    width = Arguments.size(width)
    height = Arguments.size(height, "px")
    html_i = html.HtmlImage.SlideShow(self.rptObj, components or [], width, height, options or {}, profile)
    return html_i
Esempio n. 25
0
  def update(self, label=None, color=None, width=(100, "%"), height=(None, "px"), htmlCode=None, profile=None):
    """
    Description:
    ------------
    Last Update time component

    Usage::

      rptObj.ui.rich.update("Last update: ")

    Underlying HTML Objects:

      - :class:`epyk.core.html.HtmlDates.LastUpdated`

    Related Pages:

        https://github.com/epykure/epyk-templates/blob/master/locals/components/calendar.py

    Attributes:
    ----------
    :param label: The label to be displayed close to the date. Default Last Update
    :param color: Optional. The color code for the font
    :param width: Optional. Integer for the component width
    :param height: Optional. Integer for the component height
    :param htmlCode: Optional. The component identifier code (for both Python and Javascript)
    :param profile: Optional. A flag to set the component performance storage
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    html_dt = html.HtmlDates.LastUpdated(self.context.rptObj, label, color, width, height, htmlCode, profile)
    return html_dt
Esempio n. 26
0
  def qrcode(self, data=None, width=(None, '%'), height=(100, '%'), options=None, profile=None):
    """
    Description:
    ------------
    HTML component to display a QR Code from a string

    Related Pages:

      https://davidshimjs.github.io/qrcodejs/

    TODO: Add options

    Attributes:
    ----------
    :param data: String. The value to be converted to QR Code
    :param width: Tuple. Optional. A tuple with the integer for the component width and its unit
    :param height: Tuple. Optional. A tuple with the integer for the component height and its unit
    :param options: Dictionary. Optional. Specific Python options available for this component
    :param profile: Boolean or Dictionary. Optional. A flag to set the component performance storage
    """
    data = data or {}
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    h_qrcode = html.HtmlOthers.HtmlQRCode(self.rptObj, data, width, height, options, profile)
    if height[1] != '%':
      h_qrcode.style.css.overflow = 'auto'
    return h_qrcode
Esempio n. 27
0
  def composite(self, schema, width=(None, "%"), height=(None, "px"), htmlCode=None, helper=None, options=None, profile=None):
    """
    Description:
    ------------
    Composite bespoke object.

    This obhect will be built based on its schema. No specific CSS Style and class will be added to this object.
    The full definition will be done in the nested dictionary schema.

    Example
    schema = {'type': 'div', 'css': {}, 'class': , 'attrs': {} 'arias': {},  'children': [
        {'type': : {...}}
        ...
    ]}

    Attributes:
    ----------
    :param schema:
    :param width:
    :param height:
    :param htmlCode:
    :param helper:
    :param options:
    :param profile:
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    html_help = html.HtmlTextComp.Composite(self.context.rptObj, schema, width=width, height=height, htmlCode=htmlCode, profile=profile, options=options or {}, helper=helper)
    return html_help
Esempio n. 28
0
    def select(self,
               records=None,
               html_code=None,
               selected=None,
               width=(100, "%"),
               height=(None, "%"),
               profile=None,
               multiple=False,
               options=None):
        """
    Description:
    -----------
    HTML Select component.

    Usage::

      select = page.web.bs.lists.select([
        {"value": "value 1"},
        {"value": "value 2"},
        {"value": "value 3", "selected": True},
      ], multiple=True)

      select = page.web.bs.lists.select(selected="value 2")
      data = ["value 1", "value 2", "value 3"]
      select.data = select.parsers.from_list(data)

    Related Pages:

      https://getbootstrap.com/docs/5.1/forms/select/

    Attributes:
    ----------
    :param records: List. Optional. The list of dictionaries with the input data.
    :param html_code: String. Optional. An identifier for this component (on both Python and Javascript side).
    :param selected: String. Optional. The selected value or values.
    :param width: Tuple. Optional. Integer for the component width.
    :param height: Tuple. Optional. Integer for the component height.
    :param profile: Boolean | Dictionary. Optional. A flag to set the component performance storage.
    :param multiple: Boolean. Optional. To set if the component can handle multiple selections.
    :param options: Dictionary. Optional. Specific Python options available for this component.
    """
        width = Arguments.size(width, unit="px")
        height = Arguments.size(height, unit="px")
        html_but = HtmlBsForms.BsSelect(self.page, [], html_code, options
                                        or {}, profile, {
                                            "width": width,
                                            "height": height
                                        })
        html_but.init_selected = selected
        if records is not None:
            for rec in records:
                if selected is not None:
                    if rec["value"] == selected:
                        rec["selected"] = True
                html_but.add_option(rec["value"],
                                    rec.get("name", rec["value"]),
                                    selected=rec.get("selected", False))
        if multiple:
            html_but.attr["multiple"] = True
        return html_but
Esempio n. 29
0
  def nav(self, width=(100, '%'), height=(100, '%'), options=None, profile=None, helper=None):
    """
    Description:
    ------------

    :tags:
    :categories:

    Usage::

    Templates:

      https://github.com/epykure/epyk-templates/blob/master/locals/components/bars.py

    Attributes:
    ----------
    :param width: Tuple. Optional. A tuple with the integer for the component width and its unit.
    :param height: Tuple. Optional. A tuple with the integer for the component height and its unit.
    :param options: Optional. A dictionary with the components properties.
    :param profile: Optional. A flag to set the component performance storage.
    :param helper: String. Optional. A tooltip helper.
    """
    width = Arguments.size(width, unit="%")
    height = Arguments.size(height, unit="px")
    dflt_options = {"position": 'top'}
    if options is not None:
      dflt_options.update(options)
    h_drawer = html.HtmlMenu.PanelsBar(self.page, width, height, dflt_options, helper, profile)
    html.Html.set_component_skin(h_drawer)
    return h_drawer
Esempio n. 30
0
    def inputs(self,
               data=None,
               width: Union[tuple, int] = (100, "%"),
               height: Union[tuple, int] = (None, 'px'),
               html_code: str = None,
               helper: str = None,
               options: dict = None,
               profile: Union[dict, bool] = None):
        """
    Description:
    ------------

    Usage::

    Underlying HTML Objects:

      - :class:`epyk.core.html.HtmlTrees.TreeInput`

    Attributes:
    ----------
    :param data:
    :param width:
    :param height:
    :param html_code:
    :param helper:
    :param options:
    :param profile:
    """
        width = Arguments.size(width, unit="%")
        height = Arguments.size(height, unit="px")
        html_tree = html.HtmlTrees.TreeInput(self.page, data or [], width,
                                             height, html_code, helper, options
                                             or {}, profile)
        html.Html.set_component_skin(html_tree)
        return html_tree