@file:Suppress("UNCHECKED_CAST", "USELESS_CAST", "INAPPLICABLE_JVM_NAME", "UNUSED_ANONYMOUS_PARAMETER", "SENSELESS_COMPARISON", "NAME_SHADOWING", "UNNECESSARY_NOT_NULL_ASSERTION")
package uni.UNIHelloUniAppX
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 kotlin.properties.Delegates
open class GenPagesUniUiIndexBarIndexBar : BasePage {
    constructor(__ins: ComponentInternalInstance, __renderer: String?) : super(__ins, __renderer) {
        onLoad(fun(_: OnLoadOptions) {
            stat_instance.onLoad(this)
        }
        , __ins)
        onPageShow(fun() {
            stat_instance.onShow(this)
        }
        , __ins)
        onPageHide(fun() {
            stat_instance.onHide(this)
        }
        , __ins)
        onUnload(fun() {
            stat_instance.onUnload(this)
        }
        , __ins)
    }
    open var data: Data__12
        get() {
            return unref(this.`$exposed`["data"]) as Data__12
        }
        set(value) {
            setRefValue(this.`$exposed`, "data", value)
        }
    open var toggleStyle: () -> Unit
        get() {
            return unref(this.`$exposed`["toggleStyle"]) as () -> Unit
        }
        set(value) {
            setRefValue(this.`$exposed`, "toggleStyle", value)
        }
    open var toggleIndexs: () -> Unit
        get() {
            return unref(this.`$exposed`["toggleIndexs"]) as () -> Unit
        }
        set(value) {
            setRefValue(this.`$exposed`, "toggleIndexs", value)
        }
    open var onSelect: (index: String) -> Unit
        get() {
            return unref(this.`$exposed`["onSelect"]) as (index: String) -> Unit
        }
        set(value) {
            setRefValue(this.`$exposed`, "onSelect", value)
        }
    companion object {
        @Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE")
        var setup: (__props: GenPagesUniUiIndexBarIndexBar, __setupCtx: SetupContext) -> Any? = fun(__props, __setupCtx): Any? {
            val __expose = __setupCtx.expose
            val __ins = getCurrentInstance()!!
            val _ctx = __ins.proxy as GenPagesUniUiIndexBarIndexBar
            val _cache = __ins.renderCache
            val defaultIndexs = cityGroups.map(fun(g): String {
                return g.index
            }
            ).join("\n")
            val customIndexs = "☆\nA\nB\nC\nD\nE\nF\nG\nH\nI\nJ\nK\nL\nM\nN\nO\nP\nQ\nR\nS\nT\nU\nV\nW\nX\nY\nZ\n#"
            val data = reactive<Data__12>(Data__12(useCustomStyle = false, useCustomIndexs = false, indexViewID = ""))
            val currentIndexs = computed(fun(): String {
                return if (data.useCustomIndexs) {
                    customIndexs
                } else {
                    defaultIndexs
                }
            }
            )
            val listRef = ref<UniListViewElement?>(null)
            val toggleStyle = fun(){
                data.useCustomStyle = !data.useCustomStyle
            }
            val toggleIndexs = fun(){
                data.useCustomIndexs = !data.useCustomIndexs
            }
            val onSelect = fun(index: String){
                val list = listRef.value
                if (list == null) {
                    return
                }
                val childId = "idx-" + index
                data.indexViewID = childId
            }
            __expose(_uM("data" to data, "currentIndexs" to currentIndexs, "toggleStyle" to toggleStyle, "toggleIndexs" to toggleIndexs, "onSelect" to onSelect))
            return fun(): Any? {
                val _component_uni_index_bar = resolveEasyComponent("uni-index-bar", GenUniModulesUniIndexBarComponentsUniIndexBarUniIndexBarClass)
                return _cE("view", _uM("style" to _nS(_uM("flex" to "1", "flex-direction" to "column", "position" to "relative"))), _uA(
                    _cE("view", _uM("class" to "control-bar"), _uA(
                        _cE("button", _uM("class" to "control-btn", "onClick" to toggleStyle), _tD(if (unref(data).useCustomStyle) {
                            "默认样式"
                        } else {
                            "自定义样式"
                        }
                        ), 1),
                        _cE("button", _uM("class" to "control-btn", "onClick" to toggleIndexs), _tD(if (unref(data).useCustomIndexs) {
                            "根据数据设索引"
                        } else {
                            "自定义索引"
                        }
                        ), 1)
                    )),
                    _cE("list-view", _uM("ref_key" to "listRef", "ref" to listRef, "style" to _nS(_uM("flex" to "1")), "scroll-into-view" to unref(data).indexViewID), _uA(
                        _cE(Fragment, null, RenderHelpers.renderList(unref(cityGroups), fun(group, __key, __index, _cached): Any {
                            return _cE("sticky-section", _uM("key" to group.index), _uA(
                                _cE("sticky-header", _uM("id" to ("idx-" + group.index)), _uA(
                                    _cE("view", _uM("class" to "group-header"), _uA(
                                        _cE("text", _uM("class" to "group-header-text"), _tD(group.index), 1)
                                    ))
                                ), 8, _uA(
                                    "id"
                                )),
                                _cE(Fragment, null, RenderHelpers.renderList(group.cities, fun(city, __key, __index, _cached): Any {
                                    return _cE("list-item", _uM("key" to city.pinyin, "type" to "city"), _uA(
                                        _cE("view", _uM("class" to "city-item"), _uA(
                                            _cE("text", _uM("class" to "city-name"), _tD(city.name), 1)
                                        ))
                                    ))
                                }
                                ), 128)
                            ))
                        }
                        ), 128)
                    ), 12, _uA(
                        "scroll-into-view"
                    )),
                    _cV(_component_uni_index_bar, _uM("indexs" to unref(currentIndexs), "indicator-view-class" to if (unref(data).useCustomStyle) {
                        "custom-indicator"
                    } else {
                        ""
                    }
                    , "indicator-text-class" to if (unref(data).useCustomStyle) {
                        "custom-indicator-text"
                    } else {
                        ""
                    }
                    , "style" to _nS(if (unref(data).useCustomStyle) {
                        "color: aqua;"
                    } else {
                        ""
                    }
                    ), "onSelect" to onSelect), null, 8, _uA(
                        "indexs",
                        "indicator-view-class",
                        "indicator-text-class",
                        "style"
                    ))
                ), 4)
            }
        }
        val styles: Map<String, Map<String, Map<String, Any>>> by lazy {
            _nCS(_uA(
                styles0
            ))
        }
        val styles0: Map<String, Map<String, Map<String, Any>>>
            get() {
                return _uM("control-bar" to _pS(_uM("flexDirection" to "row", "paddingTop" to 10, "paddingRight" to 10, "paddingBottom" to 10, "paddingLeft" to 10, "backgroundColor" to "var(--background-color, #f5f5f5)")), "control-btn" to _pS(_uM("flexGrow" to 1, "flexShrink" to 1, "flexBasis" to "0%", "marginTop" to 0, "marginRight" to 5, "marginBottom" to 0, "marginLeft" to 5, "fontSize" to 14)), "group-header" to _pS(_uM("backgroundColor" to "var(--background-color, #f5f5f5)", "paddingLeft" to 16, "paddingTop" to 8, "paddingBottom" to 8)), "group-header-text" to _pS(_uM("fontSize" to 14, "color" to "var(--text-color, #333333)", "opacity" to 0.7, "fontWeight" to "bold")), "city-item" to _pS(_uM("paddingLeft" to 16, "paddingTop" to 14, "paddingBottom" to 14, "backgroundColor" to "var(--list-background-color, #ffffff)", "borderBottomWidth" to 1, "borderBottomColor" to "var(--border-color, #eeeeee)", "borderBottomStyle" to "solid")), "city-name" to _pS(_uM("fontSize" to 16, "color" to "var(--text-color, #333333)")), "custom-indicator" to _pS(_uM("backgroundColor" to "#007aff")), "custom-indicator-text" to _pS(_uM("color" to "#ffff00")))
            }
        var inheritAttrs = true
        var inject: Map<String, Map<String, Any?>> = _uM()
        var emits: Map<String, Any?> = _uM()
        var props = _nP(_uM())
        var propsNeedCastKeys: UTSArray<String> = _uA()
        var components: Map<String, CreateVueComponent> = _uM()
    }
}
