"use strict";const u=require("../../../../common/vendor.js"),p=require("../vue.js"),o=require("../function/index.js"),h=require("../function/test.js"),a=require("../util/route.js"),c=p.defineMixin({props:{customStyle:{type:[Object,String],default:()=>({})},customClass:{type:String,default:""},url:{type:String,default:""},linkType:{type:String,default:"navigateTo"}},data(){return{}},onLoad(){this.$u.getRect=this.$uGetRect},created(){this.$u.getRect=this.$uGetRect},computed:{$u(){return o.deepMerge(u.index.$u,{props:void 0,http:void 0,mixin:void 0})},bem(){return function(t,e,n){const i=`u-${t}--`,r={};return e&&e.map(s=>{r[i+this[s]]=!0}),n&&n.map(s=>{this[s]?r[i+s]=this[s]:delete r[i+s]}),Object.keys(r)}}},methods:{openPage(t="url"){const e=this[t];e&&a.route({type:this.linkType,url:e})},navTo(t="",e="navigateTo"){a.route({type:this.linkType,url:t})},$uGetRect(t,e){return new Promise(n=>{u.index.createSelectorQuery().in(this)[e?"selectAll":"select"](t).boundingClientRect(i=>{e&&Array.isArray(i)&&i.length&&n(i),!e&&i&&n(i)}).exec()})},getParentData(t=""){this.parent||(this.parent={}),this.parent=o.$parent.call(this,t),this.parent.children&&this.parent.children.indexOf(this)===-1&&this.parent.children.push(this),this.parent&&this.parentData&&Object.keys(this.parentData).map(e=>{this.parentData[e]=this.parent[e]})},preventEvent(t){t&&typeof t.stopPropagation=="function"&&t.stopPropagation()},noop(t){this.preventEvent(t)}},onReachBottom(){u.index.$emit("uOnReachBottom")},beforeUnmount(){if(this.parent&&h.test.array(this.parent.children)){const t=this.parent.children;t.map((e,n)=>{e===this&&t.splice(n,1)})}}});exports.mixin=c;
