Example #1
0
  def content(self) -> JsHtml.ContentFormatters:
    """
    Description:
    ------------

    """
    if self.component._jsStyles['type'] in ['bar']:
      return JsHtml.ContentFormatters(self.page, 'event.sparklines[0].getCurrentRegionFields()[0].value')

    return JsHtml.ContentFormatters(self.page, 'event.sparklines[0].getCurrentRegionFields().y')
Example #2
0
    def content(self):
        """
    Description:
    ------------

    """
        if self._src._jsStyles['type'] in ['bar']:
            return JsHtml.ContentFormatters(
                self._report,
                'event.sparklines[0].getCurrentRegionFields()[0].value')

        return JsHtml.ContentFormatters(
            self._report, 'event.sparklines[0].getCurrentRegionFields().y')
Example #3
0
  def content(self) -> JsHtml.ContentFormatters:
    """
    Description:
    ------------

    """
    return JsHtml.ContentFormatters(self.page, '%s.val()' % self.component.input.dom.jquery.varId)
Example #4
0
  def min_select(self) -> JsHtml.ContentFormatters:
    """
    Description:
    ------------
    Get the minimum value selected for range slider, returns the value otherwise.
    """
    if self.component.options.range:
      if self.component.options.range == "min":
        return JsHtml.ContentFormatters(self.page, '%s.slider("option", "min")' % self.component.dom.jquery.varId)

      if self.component.options.range == "max":
        return JsHtml.ContentFormatters(self.page, '%s.slider("value")' % self.component.dom.jquery.varId)

      return JsHtml.ContentFormatters(self.page, '%s.slider("values")[0]' % self.component.dom.jquery.varId)

    return self.content
Example #5
0
  def content(self) -> JsHtml.ContentFormatters:
    """
    Description:
    ------------

    """
    return JsHtml.ContentFormatters(self.page, '%s.progressbar("value")' % self.component.dom.jquery.varId)
Example #6
0
 def content(self):
   """
   Description:
   -----------
   Return the content of the component
   """
   return JsHtml.ContentFormatters(self._report, "%s.innerHTML" % self.varName)
Example #7
0
 def content(self):
     """
 Description:
 ------------
 Common function to get the component content.
 """
     return JsHtml.ContentFormatters(self.page, "%s.checked" % self.varName)
Example #8
0
  def content(self):
    """
    Description:
    -----------

    """
    return JsHtml.ContentFormatters(self.page, "%s.getValue()" % self.component.editorId)
Example #9
0
  def content(self):
    """
    Description:
    -----------

    """
    return JsHtml.ContentFormatters(self.page, "%s.value" % self.varName)
Example #10
0
 def content(self):
     """
 Description:
 ------------
 """
     return JsHtml.ContentFormatters(
         self.page, "%s.checked" % self.component.checkbox.dom.varName)
Example #11
0
 def format(self):
     """
 Description:
 ------------
 Specific formatters for the HTML components
 """
     return JsHtml.Formatters(self._report, self.content.toStr())
Example #12
0
 def format(self) -> JsHtml.Formatters:
   """
   Description:
   ------------
   Specific formatters for the HTML components.
   """
   return JsHtml.Formatters(self.page, self.content.toStr())
Example #13
0
 def content(self):
     """
 Description:
 ------------
 Get the current index in the tiny slider.
 """
     return JsHtml.ContentFormatters(
         self.page, "%s.getInfo().index" % self.component.jsonId)
Example #14
0
 def content(self):
     """
 Description:
 ------------
 Get the current index in the tiny slider
 """
     return JsHtml.ContentFormatters(
         self._report, "%s.getInfo().index" % self._src.jsonId)
Example #15
0
    def value(self):
        if self._src._jsStyles['type'] in ['bar']:
            return JsHtml.ContentFormatters(
                self._report,
                'event.sparklines[0].getCurrentRegionFields()[0].value')

        return JsObjects.JsNumber.JsNumber(
            "event.sparklines[0].getCurrentRegionFields().y", isPyData=False)
Example #16
0
  def content(self) -> JsHtml.ContentFormatters:
    """
    Description:
    ------------

    """
    return JsHtml.ContentFormatters(
      self.page, 'new Date(%s.slider("value") * 1000).toISOString().split("T")[0]' % self.component.dom.jquery.varId)
Example #17
0
    def content(self):
        """
    Description:
    ------------

    """
        return JsHtml.ContentFormatters(
            self._report, '%s.slider("values")' % self._src.dom.jquery.varId)
Example #18
0
 def content(self):
     """
 Description:
 ------------
 The Javascript value of the component. This returned only a value corresponding to the state of the component
 """
     return JsHtml.ContentFormatters(self._report,
                                     "%s.dataset.level" % self.varName)
Example #19
0
 def content(self) -> JsHtml.ContentFormatters:
     """
 Description:
 ------------
 The Javascript value of the component. This returned only a value corresponding to the state of the component.
 """
     return JsHtml.ContentFormatters(
         self.page, "JSON.stringify(%s.json)" % self.component.jsonId)
Example #20
0
 def content(self) -> JsHtml.ContentFormatters:
     """
 Description:
 ------------
 The Javascript value of the component. This returned only a value corresponding to the state of the component.
 """
     return JsHtml.ContentFormatters(
         self.page, "%s.getAttribute('data-current_slide')" % self.varName)
Example #21
0
    def content(self):
        """
    Description:
    ------------

    """
        return JsHtml.ContentFormatters(
            self._report, '%s.val()' % self._src.input.dom.jquery.varId)
Example #22
0
 def content(self):
     """
 Description:
 ------------
 Common function to get the component content.
 """
     return JsHtml.ContentFormatters(
         self.page, "%s.value" % self.querySelector("input").varId)
Example #23
0
    def content(self):
        """
    Description:
    -----------

    """
        return JsHtml.ContentFormatters(
            self.page, "%s.getData()" % self.component.tableId)
Example #24
0
  def content(self):
    """
    Description:
    ------------
    Get the selected content from the Select component

    """
    return JsHtml.ContentFormatters(self._report, "%s.val()" % self.jquery.varId)
Example #25
0
 def content(self):
   """
   Description:
   ------------
   Get the selected content from the Select component
   """
   # the option variable is coming from the Tick class to get the icon details
   return JsHtml.ContentFormatters(self._report, "%s.classList.contains('%s')" % (self._src.icon.dom.varName, self.options['true'].split(" ")[-1]))
Example #26
0
 def content(self):
   """
   Description:
   ------------
   Get the selected content from the Select component
   """
   # the option variable is coming from the Tick class to get the icon details
   return JsHtml.ContentFormatters(self._report, "%s.querySelector('input:checked').getAttribute('data-content')" % self._src.dom.varName)
Example #27
0
    def content(self):
        """
    Description:
    -----------

    """
        return JsHtml.ContentFormatters(self._report,
                                        "%s.getData()" % self._src.tableId)
Example #28
0
    def content(self):
        """
    Description:
    ------------

    """
        return JsHtml.ContentFormatters(
            self._report, '%s.dateSelected' % self._src.js.varName)
Example #29
0
 def all(self):
     return JsHtml.ContentFormatters(
         self.page, '''
     (function(dom){var values = []; dom.childNodes.forEach( function(dom, k){  
         const item = dom.querySelector('[name=value]');
         if (item != null){
           values.push(dom.querySelector('[name=value]').innerHTML)
         }
     }); return values})(%s)''' % self.varName)
Example #30
0
    def content(self):
        """
    Description:
    -----------

    :return:
    """
        return JsHtml.ContentFormatters(self._report,
                                        "%s.value" % self.varName)