@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
import io.dcloud.uniapp.extapi.showToast as uni_showToast
open class GenPagesUniUiRateRate : 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__7
        get() {
            return unref(this.`$exposed`["data"]) as Data__7
        }
        set(value) {
            setRefValue(this.`$exposed`, "data", value)
        }
    open var onRateChange: (value: Number) -> Unit
        get() {
            return unref(this.`$exposed`["onRateChange"]) as (value: Number) -> Unit
        }
        set(value) {
            setRefValue(this.`$exposed`, "onRateChange", value)
        }
    companion object {
        @Suppress("UNUSED_PARAMETER", "UNUSED_VARIABLE")
        var setup: (__props: GenPagesUniUiRateRate, __setupCtx: SetupContext) -> Any? = fun(__props, __setupCtx): Any? {
            val __expose = __setupCtx.expose
            val __ins = getCurrentInstance()!!
            val _ctx = __ins.proxy as GenPagesUniUiRateRate
            val _cache = __ins.renderCache
            val data = reactive<Data__7>(Data__7(vModelRateValue = 0, rateValue = 0))
            var interval: Number = 0
            fun gen_onRateChange_fn(value: Number) {
                console.log("onRateChange received value:", value, "type:", UTSAndroid.`typeof`(value))
                if (isNaN(value)) {
                    console.error("Invalid value received:", value)
                    uni_showToast(ShowToastOptions(title = "无效值: " + value, position = "bottom"))
                    return
                }
                uni_showToast(ShowToastOptions(title = "rate改变:" + value, position = "bottom"))
            }
            val onRateChange = ::gen_onRateChange_fn
            onMounted(fun(){
                interval = setInterval(fun(){
                    data.rateValue = Math.floor(Math.random() * 6)
                }
                , 2000)
            }
            )
            onUnmounted(fun(){
                if (interval != 0) {
                    clearInterval(interval)
                }
            }
            )
            __expose(_uM("data" to data, "onRateChange" to onRateChange))
            return fun(): Any? {
                val _component_uni_rate = resolveEasyComponent("uni-rate", GenUniModulesUniRateComponentsUniRateUniRateClass)
                return _cE("scroll-view", _uM("style" to _nS(_uM("flex" to "1", "padding" to "15px 15px 30px 15px"))), _uA(
                    _cE("text", _uM("class" to "desc"), "评分组件用于商品评价打分、服务态度评价、用户满意度等场景。\n 高性能模式仅有一个text组件，不可修改评分，适合长列表中显示的场景。\n 普通模式可以通过点击星星进行评分，且专门调大字号、调宽间距以适合点击。 "),
                    _cE("text", _uM("class" to "title"), "只读评分文字"),
                    _cE("text", _uM("style" to _nS(_uM("color" to "#ffca3e"))), "★★★★", 4),
                    _cE("text", _uM("class" to "title"), "高性能：只读，不显示灰星，不支持小数"),
                    _cV(_component_uni_rate, _uM("value" to 3.6)),
                    _cE("text", _uM("class" to "title"), "只读，显示灰星"),
                    _cV(_component_uni_rate, _uM("full" to "", "readonly" to "")),
                    _cE("text", _uM("class" to "title"), "只读，小数4.3"),
                    _cV(_component_uni_rate, _uM("full" to "", "readonly" to "", "value" to 4.3)),
                    _cE("text", _uM("class" to "title"), "只读，value大于5超限测试"),
                    _cV(_component_uni_rate, _uM("full" to "", "readonly" to "", "value" to 100)),
                    _cE("text", _uM("class" to "title"), "只读，value小于0超限测试"),
                    _cV(_component_uni_rate, _uM("full" to "", "readonly" to "", "value" to -1)),
                    _cE("text", _uM("class" to "title"), "未选中的星星为镂空状态\" "),
                    _cV(_component_uni_rate, _uM("full" to "", "value" to 3.5, "plain" to true)),
                    _cE("text", _uM("class" to "title"), "未选中的星星为实心且响应change事件"),
                    _cV(_component_uni_rate, _uM("full" to "", "onChange" to onRateChange)),
                    _cE("text", _uM("class" to "title"), "响应点击并双向绑定响应式变量"),
                    _cV(_component_uni_rate, _uM("full" to "", "modelValue" to unref(data).vModelRateValue, "onUpdate:modelValue" to fun(`$event`: Number){
                        unref(data).vModelRateValue = `$event`
                    }
                    ), null, 8, _uA(
                        "modelValue",
                        "onUpdate:modelValue"
                    )),
                    _cE("text", null, _tD(unref(data).vModelRateValue), 1),
                    _cE("text", _uM("class" to "title"), "只读，不触发change\" "),
                    _cV(_component_uni_rate, _uM("readonly" to "", "value" to 5, "onChange" to onRateChange)),
                    _cE("text", _uM("class" to "title"), "高性能只读，自定义大小和颜色（style方式）"),
                    _cV(_component_uni_rate, _uM("style" to _nS(_uM("font-size" to "32px")), "star-active-style" to "color:red", "value" to 4.6), null, 8, _uA(
                        "style"
                    )),
                    _cE("text", _uM("class" to "title"), "高性能只读，自定义间隔letter-space（class方式）\" "),
                    _cV(_component_uni_rate, _uM("value" to 4, "star-active-class" to "star-active-class")),
                    _cE("text", _uM("class" to "title"), "自定义默认颜色和选中颜色 class方式"),
                    _cV(_component_uni_rate, _uM("value" to 3, "full" to "", "star-class" to "custom-default", "star-active-class" to "custom-selected")),
                    _cE("text", _uM("class" to "title"), "自定义默认颜色和选中颜色 style方式"),
                    _cV(_component_uni_rate, _uM("value" to 3, "full" to "", "star-style" to "color:lightgreen", "star-active-style" to "color:green")),
                    _cE("text", _uM("class" to "title"), "只读，程序动态赋值，不触发change"),
                    _cV(_component_uni_rate, _uM("value" to unref(data).rateValue, "onChange" to onRateChange), null, 8, _uA(
                        "value"
                    ))
                ), 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("desc" to _pS(_uM("color" to "var(--text-color, #333333)")), "custom-default" to _pS(_uM("color" to "#000000")), "custom-selected" to _pS(_uM("color" to "#FF0000")), "title" to _pS(_uM("fontWeight" to "bold", "marginTop" to 10, "color" to "var(--text-color, #333333)")), "star-active-class" to _pS(_uM("letterSpacing" to 5)))
            }
        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()
    }
}
