1- from typing import Any
1+ from typing import Any , ClassVar , Final
22
33import click
4+ from click_web .web_click_types import EmailParamType , PasswordParamType , TextAreaParamType
45
56class FieldId :
6- SEPARATOR : str
7+ SEPARATOR : ClassVar [str ]
8+ command_index : int
9+ param_index : int
10+ param_type : str
11+ click_type : str
12+ nargs : int
13+ form_type : str
14+ name : str
15+ key : str
716
817 def __init__ (
918 self ,
@@ -22,7 +31,11 @@ class FieldId:
2231class NotSupported (ValueError ): ...
2332
2433class BaseInput :
25- param_type_cls : type | None
34+ param_type_cls : type [click .types .ParamType ] | None
35+ ctx : click .Context
36+ param : click .Parameter
37+ command_index : int
38+ param_index : int
2639 def __init__ (self , ctx : click .Context , param : click .Parameter , command_index : int , param_index : int ) -> None : ...
2740 def is_supported (self ) -> bool : ...
2841 @property
@@ -32,18 +45,37 @@ class BaseInput:
3245 def _to_cmd_line_name (self , name : str ) -> str : ...
3346 def _build_name (self , name : str ): ...
3447
35- class ChoiceInput (BaseInput ): ...
36- class FlagInput (BaseInput ): ...
37- class IntInput (BaseInput ): ...
38- class FloatInput (BaseInput ): ...
39- class FolderInput (BaseInput ): ...
40- class FileInput (BaseInput ): ...
41- class EmailInput (BaseInput ): ...
42- class PasswordInput (BaseInput ): ...
43- class TextAreaInput (BaseInput ): ...
44- class DefaultInput (BaseInput ): ...
45-
46- INPUT_TYPES : list [type ]
47- _DEFAULT_INPUT : list [type ]
48+ class ChoiceInput (BaseInput ):
49+ param_type_cls : type [click .Choice ]
50+
51+ class FlagInput (BaseInput ):
52+ param_type_cls : None
53+
54+ class IntInput (BaseInput ):
55+ param_type_cls : type [click .types .IntParamType ]
56+
57+ class FloatInput (BaseInput ):
58+ param_type_cls : type [click .types .FloatParamType ]
59+
60+ class FolderInput (BaseInput ):
61+ param_type_cls : None
62+
63+ class FileInput (BaseInput ):
64+ param_type_cls : None
65+
66+ class EmailInput (BaseInput ):
67+ param_type_cls : type [EmailParamType ]
68+
69+ class PasswordInput (BaseInput ):
70+ param_type_cls : type [PasswordParamType ]
71+
72+ class TextAreaInput (BaseInput ):
73+ param_type_cls : type [TextAreaParamType ]
74+
75+ class DefaultInput (BaseInput ):
76+ param_type_cls : type [click .ParamType ]
77+
78+ INPUT_TYPES : Final [list [type [BaseInput ]]]
79+ _DEFAULT_INPUT : Final [list [type [DefaultInput ]]]
4880
4981def get_input_field (ctx : click .Context , param : click .Parameter , command_index , param_index ) -> dict [str , Any ]: ...
0 commit comments