This repository was archived by the owner on Mar 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_input.py
More file actions
64 lines (49 loc) · 1.62 KB
/
_input.py
File metadata and controls
64 lines (49 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""PytSite Widget2 Plugin Input Widgets
"""
__author__ = 'Oleksandr Shepetko'
__email__ = 'a@shepetko.com'
__license__ = 'MIT'
from ._widget import Widget
class Input(Widget):
"""Base Input
"""
def __init__(self, uid: str = None, **kwargs):
super().__init__(uid, **kwargs)
self._props.update({
'autoComplete': kwargs.get('autocomplete', 'on'),
'autoFocus': kwargs.get('autofocus', False),
'disabled': kwargs.get('disabled', False),
'form': kwargs.get('form'),
'list': kwargs.get('list'),
'name': kwargs.get('name', self.uid),
'readOnly': kwargs.get('readonly', False),
'required': kwargs.get('required', False),
'tabIndex': kwargs.get('tabindex'),
'type': kwargs.get('type', 'hidden'),
})
class Hidden(Input):
"""Hidden Input
"""
def __init__(self, uid: str = None, **kwargs):
super().__init__(uid, type='hidden', **kwargs)
class Text(Input):
"""Text Input
"""
def __init__(self, uid: str = None, **kwargs):
"""Init
"""
super().__init__(uid, type='text', **kwargs)
self._props.update({
'append': kwargs.get('append'),
'inputmask': kwargs.get('inputmask'),
'maxLength': kwargs.get('max_length'),
'minLength': kwargs.get('min_length'),
'prepend': kwargs.get('prepend'),
})
class Submit(Input):
"""Submit Input
"""
def __init__(self, uid: str = None, **kwargs):
"""Init.
"""
super().__init__(uid, type='submit', **kwargs)