示例#1
0
 def __init__(self, report, text, placeholder, width, height, htmlCode,
              options, attrs, profile):
     super(Input, self).__init__(report,
                                 text,
                                 htmlCode=htmlCode,
                                 css_attrs={
                                     "width": width,
                                     "height": height,
                                     'box-sizing': 'border-box'
                                 },
                                 profile=profile,
                                 options=options)
     value = text['value'] if isinstance(text, dict) else text
     self.set_attrs(
         attrs={
             "placeholder": placeholder,
             "type": "text",
             "value": value,
             "spellcheck": False
         })
     self.set_attrs(attrs=attrs)
     self.__options, self.__focus = OptInputs.OptionsInput(self,
                                                           options), False
     if width[0] is None:
         self.style.css.min_width = Defaults.INPUTS_MIN_WIDTH
示例#2
0
 def __init__(self, report, text, placeholder, width, height, htmlCode,
              options, attrs, profile):
     if text is None:
         text = str(datetime.datetime.now()).split(" ")[1].split(".")[0]
     super(AutoComplete,
           self).__init__(report, text, placeholder, width, height,
                          htmlCode, options, attrs, profile)
     self.__options = OptInputs.OptionAutoComplete(self, options)
示例#3
0
 def __init__(self, report, text, placeholder, width, height, htmlCode,
              options, attrs, profile):
     if text is None:
         text = str(datetime.datetime.now()).split(" ")[1].split(".")[0]
     super(InputTime,
           self).__init__(report, text, placeholder, width, height,
                          htmlCode, options, attrs, profile)
     self.__options = OptInputs.OptionsTimePicker(self, options)
     self.style.css.background_color = report.theme.colors[0]
     self.style.css.line_height = Defaults.LINE_HEIGHT
     self.style.css.text_align = "center"
示例#4
0
 def __init__(self, report, text, width, rows, placeholder,
              background_color, htmlCode, options, profile):
     super(TextArea, self).__init__(report,
                                    text,
                                    htmlCode=htmlCode,
                                    css_attrs={
                                        "width": width,
                                        'box-sizing': 'border-box'
                                    },
                                    profile=profile)
     self.rows, self.backgroundColor = rows, background_color
     self.style.add_classes.input.textarea()
     self.set_attrs({"rows": rows, "placeholder": placeholder or ""})
     self.__options = OptInputs.OptionsTextarea(self, options)
示例#5
0
 def __init__(self, report, text, min, max, step, placeholder, width,
              height, htmlCode, options, attrs, profile):
     super(InputRange,
           self).__init__(report, text, placeholder, width, height,
                          htmlCode, options, attrs, profile)
     self.__options = OptInputs.OptionsInputRange(self, options)
     #
     self.input = report.ui.inputs.input(text,
                                         width=(None, "px"),
                                         placeholder=placeholder).css(
                                             {"vertical-align": 'middle'})
     self.append_child(self.input)
     #
     self.input.set_attrs(attrs={
         "type": "range",
         "min": min,
         "max": max,
         "step": step
     })
     if self.options.output:
         self.output = self._report.ui.inputs._output(text).css({
             "width":
             '15px',
             "text-align":
             'center',
             "margin-left":
             '2px',
             'color':
             self._report.theme.success[1]
         })
         self.append_child(self.output)
         self.input.set_attrs(
             attrs={
                 "oninput": "%s.value=this.value" % self.output.htmlCode
             })
     self.css({
         "display": 'inline-block',
         "vertical-align": 'middle',
         "line-height": '%spx' % Defaults.LINE_HEIGHT
     })
示例#6
0
 def __init__(self, report, text, placeholder, width, height, htmlCode,
              options, attrs, profile):
     super(InputInteger,
           self).__init__(report, text, placeholder, width, height,
                          htmlCode, options, attrs, profile)
     self.__options = OptInputs.OptionsInputInteger(self, options)
示例#7
0
 def __init__(self, report, records, placeholder, width, height, htmlCode,
              options, attrs, profile):
     super(InputDate,
           self).__init__(report, records, placeholder, width, height,
                          htmlCode, options, attrs, profile)
     self.__options = OptInputs.OptionsDatePicker(self, options)