You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
3.4 KiB

import{b as d,dc as $,d as I,r as j,D as k,f as w,aP as z}from"./index-f4658ae7.js";import{c as B,t as y,n as g,A as H,k as M,y as D,o as N,a4 as R,w as _,e as E,D as F,G,a as L,I as Y}from"./index-f3701452.js";import{u as Z}from"./index-55c72c71.js";import{r as q,u as J}from"./use-route-96578f25.js";var Q={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 184H712v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H384v-64c0-4.4-3.6-8-8-8h-56c-4.4 0-8 3.6-8 8v64H144c-17.7 0-32 14.3-32 32v664c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V216c0-17.7-14.3-32-32-32zm-40 656H184V256h128v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h256v48c0 4.4 3.6 8 8 8h56c4.4 0 8-3.6 8-8v-48h128v584zM688 420h-55.2c-5.1 0-10 2.5-13 6.6L468.9 634.4l-64.7-89c-3-4.1-7.8-6.6-13-6.6H336c-6.5 0-10.3 7.4-6.5 12.7l126.4 174a16.1 16.1 0 0026 0l212.6-292.7c3.8-5.4 0-12.8-6.5-12.8z"}}]},name:"carry-out",theme:"outlined"};const U=Q;function C(e){for(var a=1;a<arguments.length;a++){var t=arguments[a]!=null?Object(arguments[a]):{},o=Object.keys(t);typeof Object.getOwnPropertySymbols=="function"&&(o=o.concat(Object.getOwnPropertySymbols(t).filter(function(c){return Object.getOwnPropertyDescriptor(t,c).enumerable}))),o.forEach(function(c){W(e,c,t[c])})}return e}function W(e,a,t){return a in e?Object.defineProperty(e,a,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[a]=t,e}var O=function(a,t){var o=C({},a,t.attrs);return d($,C({},o,{icon:U}),null)};O.displayName="CarryOutOutlined";O.inheritAttrs=!1;const le=O,[A,x]=B("tabbar"),X={route:Boolean,fixed:y,border:y,zIndex:g,placeholder:Boolean,activeColor:String,beforeChange:Function,inactiveColor:String,modelValue:H(0),safeAreaInsetBottom:{type:Boolean,default:null}},S=Symbol(A);var K=I({name:A,props:X,emits:["change","update:modelValue"],setup(e,{emit:a,slots:t}){const o=j(),{linkChildren:c}=M(S),s=Z(o,x),v=()=>{var n;return(n=e.safeAreaInsetBottom)!=null?n:e.fixed},l=()=>{var n;const{fixed:r,zIndex:i,border:f}=e;return d("div",{ref:o,role:"tablist",style:D(i),class:[x({fixed:r}),{[N]:f,"van-safe-area-bottom":v()}]},[(n=t.default)==null?void 0:n.call(t)])};return c({props:e,setActive:(n,r)=>{R(e.beforeChange,{args:[n],done(){a("update:modelValue",n),a("change",n),r()}})}}),()=>e.fixed&&e.placeholder?s(l):l()}});const ie=_(K),[ee,h]=B("tabbar-item"),te=E({},q,{dot:Boolean,icon:String,name:g,badge:g,badgeProps:Object,iconPrefix:String});var ae=I({name:ee,props:te,emits:["click"],setup(e,{emit:a,slots:t}){const o=J(),c=k().proxy,{parent:s,index:v}=F(S);if(!s)return;const l=w(()=>{var r;const{route:i,modelValue:f}=s.props;if(i&&"$route"in c){const{$route:b}=c,{to:m}=e,u=L(m)?m:{path:m};return!!b.matched.find(P=>{const T="path"in u&&u.path===P.path,V="name"in u&&u.name===P.name;return T||V})}return((r=e.name)!=null?r:v.value)===f}),p=r=>{var i;l.value||s.setActive((i=e.name)!=null?i:v.value,o),a("click",r)},n=()=>{if(t.icon)return t.icon({active:l.value});if(e.icon)return d(Y,{name:e.icon,classPrefix:e.iconPrefix},null)};return()=>{var r;const{dot:i,badge:f}=e,{activeColor:b,inactiveColor:m}=s.props,u=l.value?b:m;return d("div",{role:"tab",class:h({active:l.value}),style:{color:u},tabindex:0,"aria-selected":l.value,onClick:p},[d(G,z({dot:i,class:h("icon"),content:f},e.badgeProps),{default:n}),d("div",{class:h("text")},[(r=t.default)==null?void 0:r.call(t,{active:l.value})])])}}});const se=_(ae);export{le as C,ie as T,se as a};