@file:Suppress("UNCHECKED_CAST", "USELESS_CAST", "INAPPLICABLE_JVM_NAME", "UNUSED_ANONYMOUS_PARAMETER")
package uni.UNIABF0653;
import io.dcloud.uniapp.*;
import io.dcloud.uniapp.extapi.*;
import io.dcloud.uniapp.framework.*;
import io.dcloud.uniapp.runtime.*;
import io.dcloud.uniapp.vue.*;
import io.dcloud.uniapp.vue.shared.*;
import io.dcloud.unicloud.*;
import io.dcloud.uts.*;
import io.dcloud.uts.Map;
import io.dcloud.uts.Set;
import io.dcloud.uts.UTSAndroid;
import kotlinx.coroutines.CoroutineScope;
import kotlinx.coroutines.Deferred;
import kotlinx.coroutines.Dispatchers;
import kotlinx.coroutines.async;
open class GenUniModulesUniEasyinputComponentsUniEasyinputUniEasyinput : VueComponent {
    constructor(__ins: ComponentInternalInstance) : super(__ins) {
        onCreated(fun() {
            this.init();
            if (this.form && this.formItem) {
                this.`$watch`(fun(): Any? {
                    return this.formItem.errMsg;
                }
                , fun(newVal) {
                    this.localMsg = newVal;
                }
                );
            }
        }
        , __ins);
        onMounted(fun() {
            this.`$nextTick`(fun(){
                this.focused = this.focus;
                this.focusShow = this.focus;
            }
            );
        }
        , __ins);
        this.`$watch`(fun(): Any? {
            return this.value;
        }
        , fun(newVal: Any) {
            if (newVal == null) {
                this.`val` = "";
                return;
            }
            this.`val` = newVal;
        }
        );
        this.`$watch`(fun(): Any? {
            return this.modelValue;
        }
        , fun(newVal: Any) {
            if (newVal == null) {
                this.`val` = "";
                return;
            }
            this.`val` = newVal;
        }
        );
        this.`$watch`(fun(): Any? {
            return this.focus;
        }
        , fun(newVal: Boolean) {
            this.`$nextTick`(fun(){
                this.focused = this.focus;
                this.focusShow = this.focus;
            }
            );
        }
        );
    }
    @Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE")
    override fun `$render`(): Any? {
        val _ctx = this;
        val _cache = this.`$`.renderCache;
        val _component_uni_icons = resolveEasyComponent("uni-icons", GenUniModulesUniIconsComponentsUniIconsUniIconsClass);
        return createElementVNode("view", utsMapOf("class" to normalizeClass(utsArrayOf(
            "uni-easyinput",
            utsMapOf("uni-easyinput-error" to _ctx.msg)
        )), "style" to normalizeStyle(_ctx.boxStyle)), utsArrayOf(
            createElementVNode("view", utsMapOf("class" to normalizeClass(utsArrayOf(
                "uni-easyinput__content",
                _ctx.inputContentClass
            )), "style" to normalizeStyle(_ctx.inputContentStyle)), utsArrayOf(
                if (isTrue(_ctx.prefixIcon)) {
                    createVNode(_component_uni_icons, utsMapOf("key" to 0, "class" to "content-clear-icon", "type" to _ctx.prefixIcon, "color" to "#c0c4cc", "onClick" to fun(){
                        _ctx.onClickIcon("prefix");
                    }, "size" to "22"), null, 8, utsArrayOf(
                        "type",
                        "onClick"
                    ));
                } else {
                    createCommentVNode("v-if", true);
                }
                ,
                renderSlot(_ctx.`$slots`, "left"),
                if (_ctx.type === "textarea") {
                    createElementVNode("textarea", utsMapOf("key" to 1, "class" to normalizeClass(utsArrayOf(
                        "uni-easyinput__content-textarea",
                        utsMapOf("input-padding" to _ctx.inputBorder)
                    )), "name" to _ctx.name, "value" to _ctx.`val`, "placeholder" to _ctx.placeholder, "placeholderStyle" to _ctx.placeholderStyle, "disabled" to _ctx.disabled, "placeholder-class" to "uni-easyinput__placeholder-class", "maxlength" to _ctx.inputMaxlength, "focus" to _ctx.focused, "autoHeight" to _ctx.autoHeight, "cursor-spacing" to _ctx.cursorSpacing, "adjust-position" to _ctx.adjustPosition, "onInput" to _ctx.onInput, "onBlur" to _ctx._Blur, "onFocus" to _ctx._Focus, "onConfirm" to _ctx.onConfirm, "onKeyboardheightchange" to _ctx.onkeyboardheightchange), null, 42, utsArrayOf(
                        "name",
                        "value",
                        "placeholder",
                        "placeholderStyle",
                        "disabled",
                        "maxlength",
                        "focus",
                        "autoHeight",
                        "cursor-spacing",
                        "adjust-position",
                        "onInput",
                        "onBlur",
                        "onFocus",
                        "onConfirm",
                        "onKeyboardheightchange"
                    ));
                } else {
                    createElementVNode("input", utsMapOf("key" to 2, "type" to if (_ctx.type === "password") {
                        "text";
                    } else {
                        _ctx.type;
                    }
                    , "class" to "uni-easyinput__content-input", "style" to normalizeStyle(_ctx.inputStyle), "name" to _ctx.name, "value" to _ctx.`val`, "password" to (!_ctx.showPassword && _ctx.type === "password"), "placeholder" to _ctx.placeholder, "placeholderStyle" to _ctx.placeholderStyle, "placeholder-class" to "uni-easyinput__placeholder-class", "disabled" to _ctx.disabled, "maxlength" to _ctx.inputMaxlength, "focus" to _ctx.focused, "confirmType" to _ctx.confirmType, "cursor-spacing" to _ctx.cursorSpacing, "adjust-position" to _ctx.adjustPosition, "onFocus" to _ctx._Focus, "onBlur" to _ctx._Blur, "onInput" to _ctx.onInput, "onConfirm" to _ctx.onConfirm, "onKeyboardheightchange" to _ctx.onkeyboardheightchange), null, 44, utsArrayOf(
                        "type",
                        "name",
                        "value",
                        "password",
                        "placeholder",
                        "placeholderStyle",
                        "disabled",
                        "maxlength",
                        "focus",
                        "confirmType",
                        "cursor-spacing",
                        "adjust-position",
                        "onFocus",
                        "onBlur",
                        "onInput",
                        "onConfirm",
                        "onKeyboardheightchange"
                    ));
                }
                ,
                if (isTrue(_ctx.type === "password" && _ctx.passwordIcon)) {
                    createElementVNode(Fragment, utsMapOf("key" to 3), utsArrayOf(
                        if (isTrue(_ctx.isVal)) {
                            createVNode(_component_uni_icons, utsMapOf("key" to 0, "class" to normalizeClass(utsArrayOf(
                                "content-clear-icon",
                                utsMapOf("is-textarea-icon" to (_ctx.type === "textarea"))
                            )), "type" to if (_ctx.showPassword) {
                                "eye-slash-filled";
                            } else {
                                "eye-filled";
                            }, "size" to 22, "color" to if (_ctx.focusShow) {
                                _ctx.primaryColor;
                            } else {
                                "#c0c4cc";
                            }, "onClick" to _ctx.onEyes), null, 8, utsArrayOf(
                                "class",
                                "type",
                                "color",
                                "onClick"
                            ));
                        } else {
                            createCommentVNode("v-if", true);
                        }
                    ), 64);
                } else {
                    createCommentVNode("v-if", true);
                }
                ,
                if (isTrue(_ctx.suffixIcon)) {
                    createElementVNode(Fragment, utsMapOf("key" to 4), utsArrayOf(
                        if (isTrue(_ctx.suffixIcon)) {
                            createVNode(_component_uni_icons, utsMapOf("key" to 0, "class" to "content-clear-icon", "type" to _ctx.suffixIcon, "color" to "#c0c4cc", "onClick" to fun(){
                                _ctx.onClickIcon("suffix");
                            }, "size" to "22"), null, 8, utsArrayOf(
                                "type",
                                "onClick"
                            ));
                        } else {
                            createCommentVNode("v-if", true);
                        }
                    ), 64);
                } else {
                    createElementVNode(Fragment, utsMapOf("key" to 5), utsArrayOf(
                        if (isTrue(_ctx.clearable && _ctx.isVal && !_ctx.disabled && _ctx.type !== "textarea")) {
                            createVNode(_component_uni_icons, utsMapOf("key" to 0, "class" to normalizeClass(utsArrayOf(
                                "content-clear-icon",
                                utsMapOf("is-textarea-icon" to (_ctx.type === "textarea"))
                            )), "type" to "clear", "size" to _ctx.clearSize, "color" to if (_ctx.msg) {
                                "#dd524d";
                            } else {
                                if (_ctx.focusShow) {
                                    _ctx.primaryColor;
                                } else {
                                    "#c0c4cc";
                                };
                            }, "onClick" to _ctx.onClear), null, 8, utsArrayOf(
                                "class",
                                "size",
                                "color",
                                "onClick"
                            ));
                        } else {
                            createCommentVNode("v-if", true);
                        }
                    ), 64);
                }
                ,
                renderSlot(_ctx.`$slots`, "right")
            ), 6)
        ), 6);
    }
    open var name: String? by `$props`;
    open var value: Any? by `$props`;
    open var modelValue: Any? by `$props`;
    open var type: String by `$props`;
    open var clearable: Boolean by `$props`;
    open var autoHeight: Boolean by `$props`;
    open var placeholder: String by `$props`;
    open var placeholderStyle: String? by `$props`;
    open var focus: Boolean by `$props`;
    open var disabled: Boolean by `$props`;
    open var maxlength: Any by `$props`;
    open var confirmType: String by `$props`;
    open var clearSize: Any by `$props`;
    open var inputBorder: Boolean by `$props`;
    open var prefixIcon: String by `$props`;
    open var suffixIcon: String by `$props`;
    open var trim: Any by `$props`;
    open var cursorSpacing: Number by `$props`;
    open var passwordIcon: Boolean by `$props`;
    open var adjustPosition: Boolean by `$props`;
    open var primaryColor: String by `$props`;
    open var styles: Any? by `$props`;
    open var errorMessage: Any by `$props`;
    open var focused: Boolean by `$data`;
    open var `val`: String by `$data`;
    open var showMsg: String by `$data`;
    open var border: Boolean by `$data`;
    open var isFirstBorder: Boolean by `$data`;
    open var showClearIcon: Boolean by `$data`;
    open var showPassword: Boolean by `$data`;
    open var focusShow: Boolean by `$data`;
    open var localMsg: String by `$data`;
    open var isEnter: Boolean by `$data`;
    open var isVal: Boolean by `$data`;
    open var inputMaxlength: Number by `$data`;
    open var boxStyle: String by `$data`;
    open var inputContentClass: String by `$data`;
    open var inputContentStyle: String by `$data`;
    open var inputStyle: String by `$data`;
    @Suppress("USELESS_CAST")
    override fun data(): Map<String, Any?> {
        return utsMapOf("focused" to false, "val" to "", "showMsg" to "", "border" to false, "isFirstBorder" to false, "showClearIcon" to false, "showPassword" to false, "focusShow" to false, "localMsg" to "", "isEnter" to false, "isVal" to computed<Boolean>(fun(): Boolean {
            val kVal = this.`val`;
            if (kVal || kVal === 0) {
                return true;
            }
            return false;
        }
        ), "inputMaxlength" to computed<Number>(fun(): Number {
            return Number(this.maxlength);
        }
        ), "boxStyle" to computed<String>(fun(): String {
            return "color:" + (if (this.inputBorder && this.msg) {
                "#e43d33";
            } else {
                this.styles.color;
            }
            ) + ";";
        }
        ), "inputContentClass" to computed<String>(fun(): String {
            return obj2strClass(let {
                object : UTSJSONObject() {
                    var `is-input-border` = it.inputBorder
                    var `is-input-error-border` = it.inputBorder && it.msg
                    var `is-textarea` = it.type === "textarea"
                    var `is-disabled` = it.disabled
                    var `is-focused` = it.focusShow
                }
            });
        }
        ), "inputContentStyle" to computed<String>(fun(): String {
            val focusColor = if (this.focusShow) {
                this.primaryColor;
            } else {
                this.styles.borderColor;
            }
            ;
            val borderColor = if (this.inputBorder && this.msg) {
                "#dd524d";
            } else {
                focusColor;
            }
            ;
            return obj2strStyle(let {
                object : UTSJSONObject() {
                    var `border-color` = borderColor || "#e5e5e5"
                    var `background-color` = if (it.disabled) {
                        it.styles.disableColor;
                    } else {
                        it.styles.backgroundColor;
                    }
                }
            });
        }
        ), "inputStyle" to computed<String>(fun(): String {
            val paddingRight = if (this.type === "password" || this.clearable || this.prefixIcon) {
                "";
            } else {
                "10px";
            }
            ;
            return obj2strStyle(let {
                object : UTSJSONObject() {
                    var `padding-right` = paddingRight
                    var `padding-left` = if (it.prefixIcon) {
                        "";
                    } else {
                        "10px";
                    }
                }
            });
        }
        ));
    }
    override fun `$initMethods`() {
        this.init = fun() {
            if (this.value || this.value === 0) {
                this.`val` = this.value;
            } else if (this.modelValue || this.modelValue === 0 || this.modelValue === "") {
                this.`val` = this.modelValue;
            } else {
                this.`val` = "";
            }
        }
        ;
        this.onClickIcon = fun(type) {
            this.`$emit`("iconClick", type);
        }
        ;
        this.onEyes = fun() {
            this.showPassword = !this.showPassword;
            this.`$emit`("eyes", this.showPassword);
        }
        ;
        this.onInput = fun(event) {
            var value = event.detail.value;
            if (this.trim) {
                if (UTSAndroid.`typeof`( this.trim) === "boolean" && this.trim) {
                    value = this.trimStr(value);
                }
                if (UTSAndroid.`typeof`( this.trim) === "string") {
                    value = this.trimStr(value, this.trim);
                }
            }
            if (this.errMsg) {
                this.errMsg = "";
            }
            this.`val` = value;
            this.`$emit`("input", value);
            this.`$emit`("update:modelValue", value);
        }
        ;
        this.onFocus = fun() {
            this.`$nextTick`(fun(){
                this.focused = true;
            }
            );
            this.`$emit`("focus", null);
        }
        ;
        this._Focus = fun(event) {
            this.focusShow = true;
            this.`$emit`("focus", event);
        }
        ;
        this.onBlur = fun() {
            this.focused = false;
            this.`$emit`("blur", null);
        }
        ;
        this._Blur = fun(event) {
            var value = event.detail.value;
            this.focusShow = false;
            this.`$emit`("blur", event);
            if (this.isEnter === false) {
                this.`$emit`("change", this.`val`);
            }
            if (this.form && this.formItem) {
                val validateTrigger = this.form.validateTrigger;
                if (validateTrigger === "blur") {
                    this.formItem.onFieldChange();
                }
            }
        }
        ;
        this.onConfirm = fun(e) {
            this.`$emit`("confirm", this.`val`);
            this.isEnter = true;
            this.`$emit`("change", this.`val`);
            this.`$nextTick`(fun(){
                this.isEnter = false;
            }
            );
        }
        ;
        this.onClear = fun(event) {
            this.`val` = "";
            this.`$emit`("input", "");
            this.`$emit`("update:modelValue", "");
            this.`$emit`("clear");
        }
        ;
        this.onkeyboardheightchange = fun(event) {
            this.`$emit`("keyboardheightchange", event);
        }
        ;
    }
    open lateinit var init: () -> Unit;
    open lateinit var onClickIcon: (type) -> Unit;
    open lateinit var onEyes: () -> Unit;
    open lateinit var onInput: (event) -> Unit;
    open lateinit var onFocus: () -> Unit;
    open lateinit var _Focus: (event) -> Unit;
    open lateinit var onBlur: () -> Unit;
    open lateinit var _Blur: (event) -> Unit;
    open lateinit var onConfirm: (e) -> Unit;
    open lateinit var onClear: (event) -> Unit;
    open lateinit var onkeyboardheightchange: (event) -> Unit;
    open var trimStr = fun(str, pos: String = "both"): Any {
        if (pos === "both") {
            return str.trim();
        } else if (pos === "left") {
            return str.trimLeft();
        } else if (pos === "right") {
            return str.trimRight();
        } else if (pos === "start") {
            return str.trimStart();
        } else if (pos === "end") {
            return str.trimEnd();
        } else if (pos === "all") {
            return str.replace(UTSRegExp("\\s+", "g"), "");
        } else if (pos === "none") {
            return str;
        }
        return str;
    }
    ;
    companion object {
        var name = "uni-easyinput";
        val styles: Map<String, Map<String, Map<String, Any>>> by lazy {
            normalizeCssStyles(utsArrayOf(
                styles0
            ))
        };
        val styles0: Map<String, Map<String, Map<String, Any>>>
            get() {
                return utsMapOf("uni-easyinput" to padStyleMapOf(utsMapOf("width" to "100%", "flex" to 1, "position" to "relative", "textAlign" to "left", "color" to "#333333", "fontSize" to 14)), "uni-easyinput__content" to padStyleMapOf(utsMapOf("flex" to 1, "width" to "100%", "display" to "flex", "boxSizing" to "border-box", "flexDirection" to "row", "alignItems" to "center", "borderColor" to "#ffffff", "transitionProperty" to "borderColor", "transitionDuration" to "0.3s")), "uni-easyinput__content-input" to padStyleMapOf(utsMapOf("width" to "auto", "position" to "relative", "overflow" to "hidden", "flex" to 1, "lineHeight" to 1, "fontSize" to 14, "height" to 35)), "uni-easyinput__placeholder-class" to utsMapOf("" to utsMapOf("color" to "#999999", "fontSize" to 12), ".is-input-error-border " to utsMapOf("color" to "#f29e99"), ".is-disabled " to utsMapOf("color" to "#d5d5d5", "fontSize" to 12)), "is-textarea" to padStyleMapOf(utsMapOf("alignItems" to "flex-start")), "is-textarea-icon" to padStyleMapOf(utsMapOf("marginTop" to 5)), "uni-easyinput__content-textarea" to padStyleMapOf(utsMapOf("position" to "relative", "overflow" to "hidden", "flex" to 1, "lineHeight" to 1.5, "fontSize" to 14, "marginTop" to 6, "marginRight" to 6, "marginBottom" to 6, "marginLeft" to 0, "height" to 80, "minHeight" to 80, "width" to "auto")), "input-padding" to padStyleMapOf(utsMapOf("paddingLeft" to 10)), "content-clear-icon" to padStyleMapOf(utsMapOf("paddingTop" to 0, "paddingRight" to 5, "paddingBottom" to 0, "paddingLeft" to 5)), "label-icon" to padStyleMapOf(utsMapOf("marginRight" to 5, "marginTop" to -1)), "is-input-border" to padStyleMapOf(utsMapOf("display" to "flex", "boxSizing" to "border-box", "flexDirection" to "row", "alignItems" to "center", "borderWidth" to 1, "borderStyle" to "solid", "borderColor" to "#dcdfe6", "borderRadius" to 4)), "uni-error-message" to padStyleMapOf(utsMapOf("position" to "absolute", "bottom" to -17, "left" to 0, "lineHeight" to "12px", "color" to "#e43d33", "fontSize" to 12, "textAlign" to "left")), "uni-error-msg--boeder" to padStyleMapOf(utsMapOf("position" to "relative", "bottom" to 0, "lineHeight" to "22px")), "is-input-error-border" to padStyleMapOf(utsMapOf("borderColor" to "#e43d33")), "uni-easyinput--border" to padStyleMapOf(utsMapOf("marginBottom" to 0, "paddingTop" to 10, "paddingRight" to 15, "paddingBottom" to 10, "paddingLeft" to 15, "borderTopWidth" to 1, "borderTopStyle" to "solid", "borderTopColor" to "#eeeeee")), "uni-easyinput-error" to padStyleMapOf(utsMapOf("paddingBottom" to 0)), "is-first-border" to padStyleMapOf(utsMapOf("borderWidth" to "medium", "borderStyle" to "none", "borderColor" to "#000000")), "is-disabled" to padStyleMapOf(utsMapOf("backgroundColor" to "#f7f6f6", "color" to "#d5d5d5")), "@TRANSITION" to utsMapOf("uni-easyinput__content" to utsMapOf("property" to "borderColor", "duration" to "0.3s")));
            }
        var inheritAttrs = true;
        var inject: Map<String, Map<String, Any?>> = utsMapOf();
        var emits: Map<String, Any?> = utsMapOf("click" to null, "iconClick" to null, "update:modelValue" to null, "input" to null, "focus" to null, "blur" to null, "confirm" to null, "clear" to null, "eyes" to null, "change" to null, "keyboardheightchange" to null);
        var props = normalizePropsOptions(utsMapOf("name" to utsMapOf("type" to "String"), "value" to utsMapOf("type" to utsArrayOf(
            "Number",
            "String"
        )), "modelValue" to utsMapOf("type" to utsArrayOf(
            "Number",
            "String"
        )), "type" to utsMapOf("type" to "String", "default" to "text"), "clearable" to utsMapOf("type" to "Boolean", "default" to true), "autoHeight" to utsMapOf("type" to "Boolean", "default" to false), "placeholder" to utsMapOf("type" to "String", "default" to " "), "placeholderStyle" to utsMapOf("type" to "String"), "focus" to utsMapOf("type" to "Boolean", "default" to false), "disabled" to utsMapOf("type" to "Boolean", "default" to false), "maxlength" to utsMapOf("type" to utsArrayOf(
            "Number",
            "String"
        ), "default" to 140), "confirmType" to utsMapOf("type" to "String", "default" to "done"), "clearSize" to utsMapOf("type" to utsArrayOf(
            "Number",
            "String"
        ), "default" to 24), "inputBorder" to utsMapOf("type" to "Boolean", "default" to true), "prefixIcon" to utsMapOf("type" to "String", "default" to ""), "suffixIcon" to utsMapOf("type" to "String", "default" to ""), "trim" to utsMapOf("type" to utsArrayOf(
            "Boolean",
            "String"
        ), "default" to false), "cursorSpacing" to utsMapOf("type" to "Number", "default" to 0), "passwordIcon" to utsMapOf("type" to "Boolean", "default" to true), "adjustPosition" to utsMapOf("type" to "Boolean", "default" to true), "primaryColor" to utsMapOf("type" to "String", "default" to "#2979ff"), "styles" to utsMapOf("default" to fun() {
            return object : UTSJSONObject() {
                var color = "#333"
                var backgroundColor = "#fff"
                var disableColor = "#F7F6F6"
                var borderColor = "#e5e5e5"
            };
        }
        ), "errorMessage" to utsMapOf("type" to utsArrayOf(
            "String",
            "Boolean"
        ), "default" to "")));
        var propsNeedCastKeys = utsArrayOf(
            "type",
            "clearable",
            "autoHeight",
            "placeholder",
            "focus",
            "disabled",
            "maxlength",
            "confirmType",
            "clearSize",
            "inputBorder",
            "prefixIcon",
            "suffixIcon",
            "trim",
            "cursorSpacing",
            "passwordIcon",
            "adjustPosition",
            "primaryColor",
            "errorMessage"
        );
        var components: Map<String, CreateVueComponent> = utsMapOf();
    }
}
