# Path: aisikl/components/component.py
# def is_true(value):
#     return value == 'true' or value == True
# 
# Path: aisikl/components/textinput.py
# class TextInput(TextControl):
#     pass


from .component import is_true
from .textinput import TextInput



class TextField(TextInput):
    def __init__(self, dialog, id, type, parent_id, properties, element):
        super().__init__(dialog, id, type, parent_id, properties, element)
        self.label_display = element.get('labeldisplay')
        self.value = element.get('value', '')
        if element.get('type') == 'password':
            self.type = 'password'
        else:
            self.type = element.get('xtype')
        self.suggestions_enabled = properties.get('suggestionsEnabled', False)
        self.suggestions_multi_value_enabled = properties.get('suggestionsMultiValueEnabled', True)
        self.tool_tip_changed = False

    def _ais_setLabelDisplay(self, value):
        self.label_display = value
    def _ais_setText(self, value):
        self.value = value
        self.update_value_interactives('change')
    def _ais_setType(self, value):
        self.type = value
    def _ais_setSuggestionsEnabled(self, value):
        self.suggestions_enabled = is_true(value)
    def _ais_setSuggestionsMultiValueEnabled(self, value):

# Path: aisikl/components/component.py
# def is_true(value):
#     return value == 'true' or value == True
# 
# Path: aisikl/components/textinput.py
# class TextInput(TextControl):
#     pass


# Path: aisikl/components/textfield.py
from .component import is_true
from .textinput import TextInput




class TextField(TextInput):
    def __init__(self, dialog, id, type, parent_id, properties, element):
        super().__init__(dialog, id, type, parent_id, properties, element)
        self.label_display = element.get('labeldisplay')
        self.value = element.get('value', '')
        if element.get('type') == 'password':
            self.type = 'password'
        else:
            self.type = element.get('xtype')
        self.suggestions_enabled = properties.get('suggestionsEnabled', False)
        self.suggestions_multi_value_enabled = properties.get('suggestionsMultiValueEnabled', True)
        self.tool_tip_changed = False

    def _ais_setLabelDisplay(self, value):
        self.label_display = value
    def _ais_setText(self, value):
        self.value = value
        self.update_value_interactives('change')
    def _ais_setType(self, value):
        self.type = value
    def _ais_setSuggestionsEnabled(self, value):
        self.suggestions_enabled = is_true(value)
    def _ais_setSuggestionsMultiValueEnabled(self, value):

        self.suggestions_multi_value_enabled = is_true(value)