dhxpyt.toolbar
1from .toolbar import Toolbar 2from .toolbar_config import ToolbarConfig, ButtonConfig, CustomHTMLConfig, InputConfig, SpacerConfig, SeparatorConfig, ImageButtonConfig, DatePickerConfig, TitleConfig, MenuItemConfig 3 4__all__ = [ 5 'Toolbar', 6 'ToolbarConfig', 7 'ButtonConfig', 8 'CustomHTMLConfig', 9 'InputConfig', 10 'SpacerConfig', 11 'SeparatorConfig', 12 'ImageButtonConfig', 13 'DatePickerConfig', 14 'TitleConfig', 15 'MenuItemConfig' 16]
14class Toolbar: 15 def __init__(self, config: ToolbarConfig = None, widget_parent: str = None): 16 """ 17 Initializes the Toolbar widget. 18 19 :param config: (Optional) The ToolbarConfig object containing the toolbar configuration. 20 :param widget_parent: (Optional) The ID of the HTML element where the toolbar will be attached. 21 """ 22 if config is None: 23 config = ToolbarConfig() 24 config_dict = config.to_dict() 25 # Create the Toolbar instance 26 self.toolbar = js.dhx.Toolbar.new(widget_parent, js.JSON.parse(json.dumps(config_dict))) 27 28 """ Toolbar API Functions """ 29 30 def destructor(self) -> None: 31 """Destroys the Toolbar instance and releases resources.""" 32 self.toolbar.destructor() 33 34 def disable(self, ids: Union[str, int, List[Union[str, int]]] = None) -> None: 35 """Disables and dims items of Toolbar.""" 36 self.toolbar.disable(ids) 37 38 def enable(self, ids: Union[str, int, List[Union[str, int]]] = None) -> None: 39 """Enables disabled items of Toolbar.""" 40 self.toolbar.enable(ids) 41 42 def get_selected(self) -> List[Union[str, int]]: 43 """Returns an array of IDs of selected items.""" 44 selected = self.toolbar.getSelected() 45 return [item for item in selected.to_py()] 46 47 def get_state(self, id: Union[str, int] = None) -> Union[str, bool, dict]: 48 """Gets current values/states of controls.""" 49 return self.toolbar.getState(id) 50 51 def hide(self, ids: Union[str, int, List[Union[str, int]]] = None) -> None: 52 """Hides items of Toolbar.""" 53 self.toolbar.hide(ids) 54 55 def is_disabled(self, id: Union[str, int]) -> bool: 56 """Checks whether an item of Toolbar is disabled.""" 57 return self.toolbar.isDisabled(id) 58 59 def is_selected(self, id: Union[str, int]) -> bool: 60 """Checks whether a specified Toolbar item is selected.""" 61 return self.toolbar.isSelected(id) 62 63 def paint(self) -> None: 64 """Repaints Toolbar on a page.""" 65 self.toolbar.paint() 66 67 def select(self, id: Union[str, int], unselect: bool = True) -> None: 68 """Selects a specified Toolbar item.""" 69 self.toolbar.select(id, unselect) 70 71 def set_focus(self, id: Union[str, int]) -> None: 72 """Sets focus on an Input control by its ID.""" 73 self.toolbar.setFocus(id) 74 75 def set_state(self, state: dict) -> None: 76 """Sets values/states of controls.""" 77 self.toolbar.setState(js.JSON.parse(json.dumps(state))) 78 79 def update_item(self, id, item_dict: str) -> None: 80 """Updates a toolbar item that is already on the toolbar""" 81 self.toolbar.data.update(id, js.JSON.parse(json.dumps(item_dict))) 82 83 def show(self, ids: Union[str, int, List[Union[str, int]]] = None) -> None: 84 """Shows items of Toolbar.""" 85 self.toolbar.show(ids) 86 87 def unselect(self, id: Union[str, int] = None) -> None: 88 """Unselects a selected Toolbar item.""" 89 self.toolbar.unselect(id) 90 91 """ Toolbar Event Handlers """ 92 93 def add_event_handler(self, event_name: str, handler: Callable) -> None: 94 """ 95 Adds an event handler for the specified event. 96 97 :param event_name: The name of the event. 98 :param handler: The handler function to attach. 99 """ 100 event_proxy = create_proxy(handler) 101 self.toolbar.events.on(event_name, event_proxy) 102 103 def on_after_hide(self, handler: Callable[[Any], None]) -> None: 104 """Fires after hiding a toolbar item.""" 105 self.add_event_handler('afterHide', handler) 106 107 def on_before_hide(self, handler: Callable[[Union[str, int], Any], Union[bool, None]]) -> None: 108 """Fires before hiding a toolbar item.""" 109 def event_handler(id, events): 110 result = handler(id, events) 111 if result is False: 112 return js.Boolean(False) 113 self.toolbar.events.on('beforeHide', create_proxy(event_handler)) 114 115 def on_click(self, handler: Callable[[Union[str, int], Any], None]) -> None: 116 """Fires after a click on a control.""" 117 def event_handler(id, events): 118 handler(id, events) 119 self.toolbar.events.on('click', create_proxy(event_handler)) 120 121 def on_input(self, handler: Callable[[str, str], None]) -> None: 122 """Fires on entering text into an input field.""" 123 self.add_event_handler('input', handler) 124 125 def on_input_blur(self, handler: Callable[[Union[str, int]], None]) -> None: 126 """Fires when a control is blurred.""" 127 self.add_event_handler('inputBlur', handler) 128 129 def on_input_change(self, handler: Callable[[Union[str, int], str], Any]) -> None: 130 """Fires on changing the value of an Input control.""" 131 self.add_event_handler('inputChange', handler) 132 133 def on_input_created(self, handler: Callable[[Union[str, int], Any], None]) -> None: 134 """Fires when a new input is created.""" 135 self.add_event_handler('inputCreated', handler) 136 137 def on_input_focus(self, handler: Callable[[Union[str, int]], None]) -> None: 138 """Fires when a control is focused.""" 139 self.add_event_handler('inputFocus', handler) 140 141 def on_keydown(self, handler: Callable[[Any, Optional[str]], None]) -> None: 142 """Fires when any key is pressed while a Toolbar control is in focus.""" 143 def event_handler(event, id=None): 144 handler(event, id) 145 self.toolbar.events.on('keydown', create_proxy(event_handler)) 146 147 def on_open_menu(self, handler: Callable[[Union[str, int]], None]) -> None: 148 """Fires when expanding a menu control.""" 149 self.add_event_handler('openMenu', handler)
15 def __init__(self, config: ToolbarConfig = None, widget_parent: str = None): 16 """ 17 Initializes the Toolbar widget. 18 19 :param config: (Optional) The ToolbarConfig object containing the toolbar configuration. 20 :param widget_parent: (Optional) The ID of the HTML element where the toolbar will be attached. 21 """ 22 if config is None: 23 config = ToolbarConfig() 24 config_dict = config.to_dict() 25 # Create the Toolbar instance 26 self.toolbar = js.dhx.Toolbar.new(widget_parent, js.JSON.parse(json.dumps(config_dict)))
Initializes the Toolbar widget.
Parameters
- config: (Optional) The ToolbarConfig object containing the toolbar configuration.
- widget_parent: (Optional) The ID of the HTML element where the toolbar will be attached.
30 def destructor(self) -> None: 31 """Destroys the Toolbar instance and releases resources.""" 32 self.toolbar.destructor()
Destroys the Toolbar instance and releases resources.
34 def disable(self, ids: Union[str, int, List[Union[str, int]]] = None) -> None: 35 """Disables and dims items of Toolbar.""" 36 self.toolbar.disable(ids)
Disables and dims items of Toolbar.
38 def enable(self, ids: Union[str, int, List[Union[str, int]]] = None) -> None: 39 """Enables disabled items of Toolbar.""" 40 self.toolbar.enable(ids)
Enables disabled items of Toolbar.
42 def get_selected(self) -> List[Union[str, int]]: 43 """Returns an array of IDs of selected items.""" 44 selected = self.toolbar.getSelected() 45 return [item for item in selected.to_py()]
Returns an array of IDs of selected items.
47 def get_state(self, id: Union[str, int] = None) -> Union[str, bool, dict]: 48 """Gets current values/states of controls.""" 49 return self.toolbar.getState(id)
Gets current values/states of controls.
51 def hide(self, ids: Union[str, int, List[Union[str, int]]] = None) -> None: 52 """Hides items of Toolbar.""" 53 self.toolbar.hide(ids)
Hides items of Toolbar.
55 def is_disabled(self, id: Union[str, int]) -> bool: 56 """Checks whether an item of Toolbar is disabled.""" 57 return self.toolbar.isDisabled(id)
Checks whether an item of Toolbar is disabled.
59 def is_selected(self, id: Union[str, int]) -> bool: 60 """Checks whether a specified Toolbar item is selected.""" 61 return self.toolbar.isSelected(id)
Checks whether a specified Toolbar item is selected.
67 def select(self, id: Union[str, int], unselect: bool = True) -> None: 68 """Selects a specified Toolbar item.""" 69 self.toolbar.select(id, unselect)
Selects a specified Toolbar item.
71 def set_focus(self, id: Union[str, int]) -> None: 72 """Sets focus on an Input control by its ID.""" 73 self.toolbar.setFocus(id)
Sets focus on an Input control by its ID.
75 def set_state(self, state: dict) -> None: 76 """Sets values/states of controls.""" 77 self.toolbar.setState(js.JSON.parse(json.dumps(state)))
Sets values/states of controls.
79 def update_item(self, id, item_dict: str) -> None: 80 """Updates a toolbar item that is already on the toolbar""" 81 self.toolbar.data.update(id, js.JSON.parse(json.dumps(item_dict)))
Updates a toolbar item that is already on the toolbar
83 def show(self, ids: Union[str, int, List[Union[str, int]]] = None) -> None: 84 """Shows items of Toolbar.""" 85 self.toolbar.show(ids)
Shows items of Toolbar.
87 def unselect(self, id: Union[str, int] = None) -> None: 88 """Unselects a selected Toolbar item.""" 89 self.toolbar.unselect(id)
Unselects a selected Toolbar item.
93 def add_event_handler(self, event_name: str, handler: Callable) -> None: 94 """ 95 Adds an event handler for the specified event. 96 97 :param event_name: The name of the event. 98 :param handler: The handler function to attach. 99 """ 100 event_proxy = create_proxy(handler) 101 self.toolbar.events.on(event_name, event_proxy)
Adds an event handler for the specified event.
Parameters
- event_name: The name of the event.
- handler: The handler function to attach.
103 def on_after_hide(self, handler: Callable[[Any], None]) -> None: 104 """Fires after hiding a toolbar item.""" 105 self.add_event_handler('afterHide', handler)
Fires after hiding a toolbar item.
107 def on_before_hide(self, handler: Callable[[Union[str, int], Any], Union[bool, None]]) -> None: 108 """Fires before hiding a toolbar item.""" 109 def event_handler(id, events): 110 result = handler(id, events) 111 if result is False: 112 return js.Boolean(False) 113 self.toolbar.events.on('beforeHide', create_proxy(event_handler))
Fires before hiding a toolbar item.
115 def on_click(self, handler: Callable[[Union[str, int], Any], None]) -> None: 116 """Fires after a click on a control.""" 117 def event_handler(id, events): 118 handler(id, events) 119 self.toolbar.events.on('click', create_proxy(event_handler))
Fires after a click on a control.
121 def on_input(self, handler: Callable[[str, str], None]) -> None: 122 """Fires on entering text into an input field.""" 123 self.add_event_handler('input', handler)
Fires on entering text into an input field.
125 def on_input_blur(self, handler: Callable[[Union[str, int]], None]) -> None: 126 """Fires when a control is blurred.""" 127 self.add_event_handler('inputBlur', handler)
Fires when a control is blurred.
129 def on_input_change(self, handler: Callable[[Union[str, int], str], Any]) -> None: 130 """Fires on changing the value of an Input control.""" 131 self.add_event_handler('inputChange', handler)
Fires on changing the value of an Input control.
133 def on_input_created(self, handler: Callable[[Union[str, int], Any], None]) -> None: 134 """Fires when a new input is created.""" 135 self.add_event_handler('inputCreated', handler)
Fires when a new input is created.
137 def on_input_focus(self, handler: Callable[[Union[str, int]], None]) -> None: 138 """Fires when a control is focused.""" 139 self.add_event_handler('inputFocus', handler)
Fires when a control is focused.
141 def on_keydown(self, handler: Callable[[Any, Optional[str]], None]) -> None: 142 """Fires when any key is pressed while a Toolbar control is in focus.""" 143 def event_handler(event, id=None): 144 handler(event, id) 145 self.toolbar.events.on('keydown', create_proxy(event_handler))
Fires when any key is pressed while a Toolbar control is in focus.
243class ToolbarConfig: 244 """ 245 Configuration class for the Toolbar widget. 246 """ 247 def __init__(self, 248 data: Optional[List[ControlConfig]] = None, 249 css: Optional[str] = None, 250 menuCss: Optional[str] = None, 251 navigationType: Optional[str] = "click"): 252 """ 253 Initializes the ToolbarConfig. 254 255 :param data: (Optional) List of control configurations to set into Toolbar. 256 :param css: (Optional) Adds style classes to Toolbar. 257 :param menuCss: (Optional) Adds style classes to all containers of Toolbar controls with nested items. 258 :param navigationType: (Optional) Defines the action that opens menu options ("click" or "pointer"). 259 """ 260 self.data = data 261 self.css = css 262 self.menuCss = menuCss 263 self.navigationType = navigationType 264 265 def to_dict(self) -> Dict[str, Any]: 266 """ 267 Converts the ToolbarConfig into a dictionary format. 268 """ 269 data_dicts = [item.to_dict() for item in self.data] if self.data else None 270 config_dict = { 271 'data': data_dicts, 272 'css': self.css, 273 'menuCss': self.menuCss, 274 'navigationType': self.navigationType 275 } 276 return {k: v for k, v in config_dict.items() if v is not None}
Configuration class for the Toolbar widget.
247 def __init__(self, 248 data: Optional[List[ControlConfig]] = None, 249 css: Optional[str] = None, 250 menuCss: Optional[str] = None, 251 navigationType: Optional[str] = "click"): 252 """ 253 Initializes the ToolbarConfig. 254 255 :param data: (Optional) List of control configurations to set into Toolbar. 256 :param css: (Optional) Adds style classes to Toolbar. 257 :param menuCss: (Optional) Adds style classes to all containers of Toolbar controls with nested items. 258 :param navigationType: (Optional) Defines the action that opens menu options ("click" or "pointer"). 259 """ 260 self.data = data 261 self.css = css 262 self.menuCss = menuCss 263 self.navigationType = navigationType
Initializes the ToolbarConfig.
Parameters
- data: (Optional) List of control configurations to set into Toolbar.
- css: (Optional) Adds style classes to Toolbar.
- menuCss: (Optional) Adds style classes to all containers of Toolbar controls with nested items.
- navigationType: (Optional) Defines the action that opens menu options ("click" or "pointer").
265 def to_dict(self) -> Dict[str, Any]: 266 """ 267 Converts the ToolbarConfig into a dictionary format. 268 """ 269 data_dicts = [item.to_dict() for item in self.data] if self.data else None 270 config_dict = { 271 'data': data_dicts, 272 'css': self.css, 273 'menuCss': self.menuCss, 274 'navigationType': self.navigationType 275 } 276 return {k: v for k, v in config_dict.items() if v is not None}
Converts the ToolbarConfig into a dictionary format.
10class ButtonConfig(ControlConfig): 11 def __init__(self, 12 id: Optional[str] = None, 13 value: Optional[str] = None, 14 circle: Optional[bool] = None, 15 color: Optional[str] = None, 16 count: Optional[int] = None, 17 countColor: Optional[str] = None, 18 full: Optional[bool] = None, 19 group: Optional[str] = None, 20 hotkey: Optional[str] = None, 21 html: Optional[str] = None, 22 icon: Optional[str] = None, 23 loading: Optional[bool] = None, 24 multiClick: Optional[bool] = None, 25 size: Optional[str] = None, 26 tooltip: Optional[str] = None, 27 view: Optional[str] = None, 28 css: Optional[str] = None, 29 disabled: Optional[bool] = None, 30 hidden: Optional[bool] = None): 31 self.type = "button" 32 self.id = id 33 self.value = value 34 self.circle = circle 35 self.color = color 36 self.count = count 37 self.countColor = countColor 38 self.full = full 39 self.group = group 40 self.hotkey = hotkey 41 self.html = html 42 self.icon = icon 43 self.loading = loading 44 self.multiClick = multiClick 45 self.size = size 46 self.tooltip = tooltip 47 self.view = view 48 self.css = css 49 self.disabled = disabled 50 self.hidden = hidden
11 def __init__(self, 12 id: Optional[str] = None, 13 value: Optional[str] = None, 14 circle: Optional[bool] = None, 15 color: Optional[str] = None, 16 count: Optional[int] = None, 17 countColor: Optional[str] = None, 18 full: Optional[bool] = None, 19 group: Optional[str] = None, 20 hotkey: Optional[str] = None, 21 html: Optional[str] = None, 22 icon: Optional[str] = None, 23 loading: Optional[bool] = None, 24 multiClick: Optional[bool] = None, 25 size: Optional[str] = None, 26 tooltip: Optional[str] = None, 27 view: Optional[str] = None, 28 css: Optional[str] = None, 29 disabled: Optional[bool] = None, 30 hidden: Optional[bool] = None): 31 self.type = "button" 32 self.id = id 33 self.value = value 34 self.circle = circle 35 self.color = color 36 self.count = count 37 self.countColor = countColor 38 self.full = full 39 self.group = group 40 self.hotkey = hotkey 41 self.html = html 42 self.icon = icon 43 self.loading = loading 44 self.multiClick = multiClick 45 self.size = size 46 self.tooltip = tooltip 47 self.view = view 48 self.css = css 49 self.disabled = disabled 50 self.hidden = hidden
53class CustomHTMLConfig(ControlConfig): 54 def __init__(self, 55 id: Optional[str] = None, 56 parent: Optional[str] = None, 57 html: Optional[str] = None, 58 css: Optional[str] = None, 59 hidden: Optional[bool] = None): 60 self.type = "customHTML" 61 self.id = id 62 self.parent = parent 63 self.html = html 64 self.css = css 65 self.hidden = hidden
54 def __init__(self, 55 id: Optional[str] = None, 56 parent: Optional[str] = None, 57 html: Optional[str] = None, 58 css: Optional[str] = None, 59 hidden: Optional[bool] = None): 60 self.type = "customHTML" 61 self.id = id 62 self.parent = parent 63 self.html = html 64 self.css = css 65 self.hidden = hidden
144class InputConfig(ControlConfig): 145 def __init__(self, 146 id: Optional[str] = None, 147 parent: Optional[str] = None, 148 value: Optional[str] = None, 149 autocomplete: Optional[bool] = False, 150 icon: Optional[str] = None, 151 label: Optional[str] = None, 152 placeholder: Optional[str] = None, 153 tooltip: Optional[str] = None, 154 css: Optional[str] = None, 155 disabled: Optional[bool] = None, 156 hidden: Optional[bool] = None, 157 width: Optional[Union[int, str]] = None): 158 self.type = "input" 159 self.id = id 160 self.parent = parent 161 self.value = value 162 self.autocomplete = autocomplete 163 self.icon = icon 164 self.label = label 165 self.placeholder = placeholder 166 self.tooltip = tooltip 167 self.css = css 168 self.disabled = disabled 169 self.hidden = hidden 170 self.width = width
145 def __init__(self, 146 id: Optional[str] = None, 147 parent: Optional[str] = None, 148 value: Optional[str] = None, 149 autocomplete: Optional[bool] = False, 150 icon: Optional[str] = None, 151 label: Optional[str] = None, 152 placeholder: Optional[str] = None, 153 tooltip: Optional[str] = None, 154 css: Optional[str] = None, 155 disabled: Optional[bool] = None, 156 hidden: Optional[bool] = None, 157 width: Optional[Union[int, str]] = None): 158 self.type = "input" 159 self.id = id 160 self.parent = parent 161 self.value = value 162 self.autocomplete = autocomplete 163 self.icon = icon 164 self.label = label 165 self.placeholder = placeholder 166 self.tooltip = tooltip 167 self.css = css 168 self.disabled = disabled 169 self.hidden = hidden 170 self.width = width
216class SpacerConfig(ControlConfig): 217 def __init__(self, id: Optional[str] = None): 218 self.type = "spacer" 219 self.id = id
210class SeparatorConfig(ControlConfig): 211 def __init__(self, id: Optional[str] = None): 212 self.type = "separator" 213 self.id = id
115class ImageButtonConfig(ControlConfig): 116 def __init__(self, 117 id: Optional[str] = None, 118 parent: Optional[str] = None, 119 src: Optional[str] = None, 120 count: Optional[int] = None, 121 countColor: Optional[str] = None, 122 group: Optional[str] = None, 123 hotkey: Optional[str] = None, 124 multiClick: Optional[bool] = None, 125 tooltip: Optional[str] = None, 126 css: Optional[str] = None, 127 disabled: Optional[bool] = None, 128 hidden: Optional[bool] = None): 129 self.type = "imageButton" 130 self.id = id 131 self.parent = parent 132 self.src = src 133 self.count = count 134 self.countColor = countColor 135 self.group = group 136 self.hotkey = hotkey 137 self.multiClick = multiClick 138 self.tooltip = tooltip 139 self.css = css 140 self.disabled = disabled 141 self.hidden = hidden
116 def __init__(self, 117 id: Optional[str] = None, 118 parent: Optional[str] = None, 119 src: Optional[str] = None, 120 count: Optional[int] = None, 121 countColor: Optional[str] = None, 122 group: Optional[str] = None, 123 hotkey: Optional[str] = None, 124 multiClick: Optional[bool] = None, 125 tooltip: Optional[str] = None, 126 css: Optional[str] = None, 127 disabled: Optional[bool] = None, 128 hidden: Optional[bool] = None): 129 self.type = "imageButton" 130 self.id = id 131 self.parent = parent 132 self.src = src 133 self.count = count 134 self.countColor = countColor 135 self.group = group 136 self.hotkey = hotkey 137 self.multiClick = multiClick 138 self.tooltip = tooltip 139 self.css = css 140 self.disabled = disabled 141 self.hidden = hidden
68class DatePickerConfig(ControlConfig): 69 def __init__(self, 70 id: Optional[str] = None, 71 parent: Optional[str] = None, 72 value: Optional[str] = None, 73 valueFormat: Optional[str] = None, 74 dateFormat: Optional[str] = "%d/%m/%y", 75 disabledDates: Optional[List[Dict[str, str]]] = None, 76 icon: Optional[str] = None, 77 label: Optional[str] = None, 78 mark: Optional[str] = None, 79 mode: Optional[str] = None, 80 placeholder: Optional[str] = None, 81 thisMonthOnly: Optional[bool] = None, 82 timeFormat: Optional[str] = None, 83 timePicker: Optional[bool] = None, 84 weekNumbers: Optional[bool] = None, 85 weekStart: Optional[int] = None, 86 css: Optional[str] = None, 87 disabled: Optional[bool] = None, 88 editable: Optional[bool] = None, 89 hidden: Optional[bool] = None, 90 width: Optional[Union[int, str]] = None): 91 self.type = "datePicker" 92 self.id = id 93 self.parent = parent 94 self.value = value 95 self.valueFormat = valueFormat 96 self.dateFormat = dateFormat 97 self.disabledDates = disabledDates 98 self.icon = icon 99 self.label = label 100 self.mark = mark 101 self.mode = mode 102 self.placeholder = placeholder 103 self.thisMonthOnly = thisMonthOnly 104 self.timeFormat = timeFormat 105 self.timePicker = timePicker 106 self.weekNumbers = weekNumbers 107 self.weekStart = weekStart 108 self.css = css 109 self.disabled = disabled 110 self.editable = editable 111 self.hidden = hidden 112 self.width = width
69 def __init__(self, 70 id: Optional[str] = None, 71 parent: Optional[str] = None, 72 value: Optional[str] = None, 73 valueFormat: Optional[str] = None, 74 dateFormat: Optional[str] = "%d/%m/%y", 75 disabledDates: Optional[List[Dict[str, str]]] = None, 76 icon: Optional[str] = None, 77 label: Optional[str] = None, 78 mark: Optional[str] = None, 79 mode: Optional[str] = None, 80 placeholder: Optional[str] = None, 81 thisMonthOnly: Optional[bool] = None, 82 timeFormat: Optional[str] = None, 83 timePicker: Optional[bool] = None, 84 weekNumbers: Optional[bool] = None, 85 weekStart: Optional[int] = None, 86 css: Optional[str] = None, 87 disabled: Optional[bool] = None, 88 editable: Optional[bool] = None, 89 hidden: Optional[bool] = None, 90 width: Optional[Union[int, str]] = None): 91 self.type = "datePicker" 92 self.id = id 93 self.parent = parent 94 self.value = value 95 self.valueFormat = valueFormat 96 self.dateFormat = dateFormat 97 self.disabledDates = disabledDates 98 self.icon = icon 99 self.label = label 100 self.mark = mark 101 self.mode = mode 102 self.placeholder = placeholder 103 self.thisMonthOnly = thisMonthOnly 104 self.timeFormat = timeFormat 105 self.timePicker = timePicker 106 self.weekNumbers = weekNumbers 107 self.weekStart = weekStart 108 self.css = css 109 self.disabled = disabled 110 self.editable = editable 111 self.hidden = hidden 112 self.width = width
222class TitleConfig(ControlConfig): 223 def __init__(self, 224 id: Optional[str] = None, 225 parent: Optional[str] = None, 226 value: Optional[str] = None, 227 html: Optional[str] = None, 228 tooltip: Optional[str] = None, 229 css: Optional[str] = None, 230 disabled: Optional[bool] = None, 231 hidden: Optional[bool] = None): 232 self.type = "title" 233 self.id = id 234 self.parent = parent 235 self.value = value 236 self.html = html 237 self.tooltip = tooltip 238 self.css = css 239 self.disabled = disabled 240 self.hidden = hidden
223 def __init__(self, 224 id: Optional[str] = None, 225 parent: Optional[str] = None, 226 value: Optional[str] = None, 227 html: Optional[str] = None, 228 tooltip: Optional[str] = None, 229 css: Optional[str] = None, 230 disabled: Optional[bool] = None, 231 hidden: Optional[bool] = None): 232 self.type = "title" 233 self.id = id 234 self.parent = parent 235 self.value = value 236 self.html = html 237 self.tooltip = tooltip 238 self.css = css 239 self.disabled = disabled 240 self.hidden = hidden
173class MenuItemConfig(ControlConfig): 174 def __init__(self, 175 id: Optional[str] = None, 176 parent: Optional[str] = None, 177 value: Optional[str] = None, 178 items: Optional[List['MenuItemConfig']] = None, 179 count: Optional[int] = None, 180 countColor: Optional[str] = None, 181 hotkey: Optional[str] = None, 182 html: Optional[str] = None, 183 icon: Optional[str] = None, 184 tooltip: Optional[str] = None, 185 css: Optional[str] = None, 186 disabled: Optional[bool] = None, 187 hidden: Optional[bool] = None): 188 self.type = "menuItem" 189 self.id = id 190 self.parent = parent 191 self.value = value 192 self.items = items 193 self.count = count 194 self.countColor = countColor 195 self.hotkey = hotkey 196 self.html = html 197 self.icon = icon 198 self.tooltip = tooltip 199 self.css = css 200 self.disabled = disabled 201 self.hidden = hidden 202 203 def to_dict(self) -> Dict[str, Any]: 204 config = {k: v for k, v in self.__dict__.items() if v is not None} 205 if self.items: 206 config['items'] = [item.to_dict() for item in self.items] 207 return config
174 def __init__(self, 175 id: Optional[str] = None, 176 parent: Optional[str] = None, 177 value: Optional[str] = None, 178 items: Optional[List['MenuItemConfig']] = None, 179 count: Optional[int] = None, 180 countColor: Optional[str] = None, 181 hotkey: Optional[str] = None, 182 html: Optional[str] = None, 183 icon: Optional[str] = None, 184 tooltip: Optional[str] = None, 185 css: Optional[str] = None, 186 disabled: Optional[bool] = None, 187 hidden: Optional[bool] = None): 188 self.type = "menuItem" 189 self.id = id 190 self.parent = parent 191 self.value = value 192 self.items = items 193 self.count = count 194 self.countColor = countColor 195 self.hotkey = hotkey 196 self.html = html 197 self.icon = icon 198 self.tooltip = tooltip 199 self.css = css 200 self.disabled = disabled 201 self.hidden = hidden