UNPKG

saturn-ui

Version:

🪐 一款轻量级、模块化的Web可视化UI组件库(含大屏、GIS、图表、视频、后台等模块) 👍

2 lines (1 loc) 25.4 kB
import{defineComponent as e,openBlock as t,createElementBlock as a,createElementVNode as i,toDisplayString as l,createCommentVNode as n,renderSlot as r,ref as s,watch as o,nextTick as u,normalizeStyle as c,Fragment as d,renderList as v,createVNode as p,unref as m,provide as f,inject as h,getCurrentInstance as g,normalizeClass as y,reactive as b,onMounted as I,withDirectives as w,vShow as $,computed as x,onUnmounted as k,createBlock as _,Teleport as S,withModifiers as M}from"vue";var H={validPhone:/^1[3456789]\d{9}$/,validPwd:/^(?!_+$)(?!\d+$)(?!\D+$)[A-Za-z0-9]{6,12}$/i,validEmail:/^(\w|-)+@(\w|-)+(\.(\w|-)+)+$/i,validIdcard:/^((\d{18})|([0-9x]{18})|([0-9X]{18}))$/i,validImgs:/\.(svg|gif|png|jpe?g)$/i,validThousand:/(\d)(?=(\d{3})+$)/g,validThousandFloat:/(\d)(?=(\d{3})+\.)/g};const{validThousand:q,validThousandFloat:E}=H,D=(e,t)=>Object.prototype.toString.call(t).slice(8,-1)===e,N=e=>{const t=D("Object",e)?{}:D("Array",e)?[]:D("Date",e)?new e.constructor(+e):D("RegExp",e)||D("Error",e)?new e.constructor(e):e;return D("Object",e)||D("Array",e)&&Object.keys(e).forEach((a=>{t[a]=N(e[a])})),t},W=(e,t=1e3)=>{let a=null;return i=>{!a&&(a=setTimeout((()=>{e(i),a=null}),t))}},C=(e,t,a)=>e+new Array(Math.abs(t-a)+1).join("0"),T=(e,t="yyyy-MM-dd hh:mm:ss")=>{const a=`${e.getFullYear()}`;let i=`${e.getMonth()+1}`;1===i.length&&(i=`0${i}`);let l=`${e.getDate()}`;1===l.length&&(l=`0${l}`);let n=`${e.getHours()}`;1===n.length&&(n=`0${n}`);let r=`${e.getMinutes()}`;1===r.length&&(r=`0${r}`);let s=`${e.getSeconds()}`;return 1===s.length&&(s=`0${s}`),t.replace(/yyyy/gi,a).replace(/MM/g,i).replace(/dd/gi,l).replace(/hh/gi,n).replace(/mm/g,r).replace(/ss/gi,s)};var j={...{IsType:D,DeepCopyRA:N,IsLeapyear:e=>{if(!D("Number",e))throw new Error(`${e} is not number`);return e%4==0&&e%100!=0||e%400==0},FormatTime:(e=new Date)=>{if(""===e.trim())throw new Error(`${e} is not null`);const t=D("Number",e)&&String(e).length<13?1e3*e:e;D("string",e)&&t.replace(/-/g,"/");const a=new Date(t),i=e=>e<10?`0${e}`:String(e),[l,n,r,s,o,u,c]=[String(a.getFullYear()),i(a.getMonth()+1),i(a.getDate()),`星期${["日","一","二","三","四","五","六"][a.getDay()]}`,i(a.getHours()),i(a.getMinutes()),i(a.getSeconds())],d=`${l}-${n}-${r}`,v=`${o}:${u}:${c}`;return{Y:l,M:n,D:r,w:s,h:o,m:u,s:c,date:d,time:v,datetime:`${d} ${v}`}},CountDown:(e,t="hh:mm:ss")=>{if(!D("Number",e))throw new Error(`${e} is not number`);if(!"DD:hh:mm:ss:ms".includes(t))throw new Error(`${t} form error`);const a=~~(e/864e5);let i=~~(e/36e5%24),l=~~(e/6e4%60),n=~~(e/1e3%60),r=~~(e%1e3);const s={},o=e=>e<10?`0${e}`:String(e);if(t.includes("DD")?s.DD=o(a):i+=24*a,t.includes("hh")?s.hh=o(i):l+=60*i,t.includes("mm")?s.mm=o(l):n+=60*l,t.includes("ss")?s.ss=o(n):r+=1e3*n,t.includes("ms")){const a=t.includes("mm")?o(r):e;s.ms=+String(a).slice(0,2)}return s},Throttle:W,Debounce:(e,t=300)=>{let a;return i=>{void 0!==a&&clearTimeout(a),a=setTimeout((()=>{e(i)}),t)}},FormatThousand:e=>{if(!D("Number",e))throw new Error(`${e} is not number`);const t=String(e);return t.replace(t.includes(".")?E:q,"$1,")},Locked:(e,t=5e3)=>{let a=null;const i=new Proxy({value:!1},{get:(e,t)=>e[t],set:(e,i,l)=>(e[i]=l,l?a=setTimeout((()=>{e[i]=!1}),t):clearInterval(a),!0)});return t=>{!i.value&&e(t,(e=>{i.value=e}))}},AddZero:C,Calculation:(e,t)=>{if(!D("Number",e)||!D("Number",t))throw new Error(`${e} or ${t} is not number`);const a=String(e).split("."),i=String(t).split("."),l=a[1]?.length??0,n=i[1]?.length??0;l<n&&(a[1]=C(a[1],l,n)),l>n&&(i[1]=C(i[1],l,n));const r=+a.join(""),s=+i.join(""),o=Math.max(l,n);return{add:()=>(r+s)/10**o,subtract:()=>(r-s)/10**o,multiply:()=>r*s/10**(2*o),divide:()=>r/s}},GenerateRandom:()=>+new Date+String.prototype.slice.call(Math.random(),2,7),Retarder:(e=500)=>new Promise((t=>{setTimeout((()=>{t(!0)}),e)})),DateFormat:T,Random:(e,t)=>Math.floor(Math.random()*(t-e))+e},...{Bind:(e,t,a,i=!1)=>(e.addEventListener(t,a,i),e),Unbind:(e,t,a,i=!1)=>(e.removeEventListener(t,a,i),e)},Validator:H};const L={class:"ice-header"};var z=e({props:{title:{type:String,required:!1,default:"可视化数据展示平台"}},setup:e=>(n,r)=>(t(),a("div",L,[i("div",null,l(e.title),1)]))});z.__file="packages/IceHeader/header1/index.vue";const B={class:"ice-header-2"};var O=e({props:{title:{type:String,required:!1,default:"可视化数据展示平台"}},setup:e=>(n,r)=>(t(),a("div",B,[i("div",null,l(e.title),1)]))});O.__file="packages/IceHeader/header2/index.vue";const P={class:"ice-header-3"},R={class:"left"},Y=["src"],A={class:"title"},F={class:"menu"},V={class:"right"};var X=e({props:{logo:{type:String,required:!1},title:{type:String,required:!1,default:"可视化数据展示平台"}},setup:e=>(s,o)=>(t(),a("div",P,[i("div",R,[e.logo?(t(),a("img",{key:0,class:"logo",src:e.logo,alt:"logo"},null,8,Y)):n("v-if",!0),i("div",A,l(e.title),1),i("div",F,[r(s.$slots,"default")])]),i("div",V,[r(s.$slots,"right")])]))});X.__file="packages/IceHeader/header3/index.vue";const G=(e,t)=>{if(e.install=a=>{for(const i of[e,...Object.values(t??{})])a.component(i.name,i)},t)for(const[a,i]of Object.entries(t))e[a]=i;return e},K=G(z,{name:"IceHeader"}),Z=G(O,{name:"IceHeader2"}),U=G(X,{name:"IceHeader3"}),J={key:0,class:"ice-icon"},Q=["data-icon"];var ee=e({props:{icon:{type:null,required:!0},size:{type:null,required:!1,default:()=>16}},setup(e){const l=e,r=s(!0);return o(l,(()=>{r.value=!1,u((()=>{r.value=!0}))})),(l,s)=>r.value?(t(),a("span",J,[i("span",{class:"iconify","data-icon":e.icon,style:c({fontSize:e.size+"px"})},null,12,Q)])):n("v-if",!0)}});ee.__file="packages/IceIcon/index.vue";const te=G(ee,{name:"IceIcon"}),ae={class:"ice-menu"},ie={class:"title_tab"};var le=e({name:"IceMenu",props:{data:{type:Array,required:!1,default:()=>[{title:"菜单",icon:"icon-park-outline:application-menu"},{title:"菜单",icon:"icon-park-outline:application-menu"},{title:"菜单",icon:"icon-park-outline:application-menu"}]}},setup:e=>(n,r)=>(t(),a("div",ae,[(t(!0),a(d,null,v(e.data,((e,n)=>(t(),a("div",{key:n},[p(m(te),{icon:e.icon,size:20},null,8,["icon"]),i("div",ie,l(e.title),1)])))),128))]))});le.__file="packages/IceMenu/menu1/index.vue";const ne={class:"ice-menu-2"};var re=e({emits:["active"],setup(e,{emit:i}){const l=s();return f("activekey",l),o(l,(()=>{i("active",l.value.key)})),(e,i)=>(t(),a("div",ne,[r(e.$slots,"default")]))}});re.__file="packages/IceMenu/menu2/index.vue";var se=e({setup(e){const i=h("activekey"),l=g(),{key:n}=l.vnode;function s(){i.value={key:n}}return(e,l)=>(t(),a("div",{class:y(["ice-menu-item",{"ice-menu-item-active":m(i)==m(n)}]),onClick:s},[r(e.$slots,"default")],2))}});se.__file="packages/IceMenu/menu2/item.vue";const oe={class:"ice-menu-item-group"},ue={class:"item-group-title"};var ce=e({setup:e=>(h("isflex").value=!0,(e,l)=>(t(),a("div",oe,[i("div",ue,[r(e.$slots,"title")]),r(e.$slots,"default")])))});ce.__file="packages/IceMenu/menu2/itemGroup.vue";const de={class:"ice-menu-item"};var ve=e({setup(e){const l=s(!1),n=s(null),d=b({}),v=s(0);I((()=>{v.value=n.value?.clientWidth})),o(v,(e=>{d.minWidth=`${e}px`}));const p=s(!1);f("isflex",p),o(p,(e=>{e&&(d.display="flex")}));const g=s(!1),x=h("activekey");return o(x,(()=>{u((()=>{g.value=!!n.value?.getElementsByClassName("ice-menu-item-active").length,l.value=!1}))})),(e,s)=>(t(),a("div",{class:y(["ice-sub-item",{"ice-sub-item-active":g.value}]),onMouseover:s[0]||(s[0]=e=>l.value=!0),onMouseleave:s[1]||(s[1]=e=>l.value=!1),ref_key:"subRef",ref:n},[i("div",de,[r(e.$slots,"title")]),w(i("div",null,[i("div",{style:c(m(d)),class:"ice-sub"},[r(e.$slots,"default")],4)],512),[[$,l.value]])],34))}});ve.__file="packages/IceMenu/menu2/subMenu.vue";const pe=G(le,{name:"IceMenu"}),me=G(re,{name:"IceMenu2"}),fe=G(se,{name:"IceMenuItem"}),he=G(ce,{name:"IceMenuItemGroup"}),ge=G(ve,{name:"IceSubMenu"}),ye={class:"ice-wrapper-1"};var be=e({props:{visible:{type:Boolean,required:!1,default:!1},direction:{type:String,required:!1,default:"left"}},setup(e){const l=e,n=s(l.visible);function o(){n.value=!n.value}const u=s(0);return f("itemnum",u),f("direction",l.direction),(l,s)=>(t(),a("div",ye,[i("div",{class:y(["wrap",["right"==e.direction?"wrap-right":"wrap-left",n.value?"right"==e.direction?"showright":"showleft":"right"==e.direction?"hideright":"hideleft"]])},[p(m(te),{icon:`icon-park-outline:double-${e.direction}`,style:c("transform: "+(n.value?"":"rotate(180deg)")),size:30,class:"icon",onClick:o},null,8,["icon","style"]),r(l.$slots,"default")],2)]))}});be.__file="packages/IceWrapper/wrapper1/index.vue";const Ie={class:"ice-wrapper-2"};var we=e({props:{visible:{type:Boolean,required:!1,default:!0},direction:{type:String,required:!1,default:"left"}},setup(e){const l=e,n=s(l.visible);function o(){n.value=!n.value}const u=x((()=>{const e={transform:n.value?"":"rotate(180deg)"};return n.value||("left"==l.direction&&(e.right="-30px"),"right"==l.direction&&(e.right="auto",e.left="-30px"),"down"==l.direction&&(e.top="-50px")),e})),d=s(0);return f("itemnum",d),f("direction",l.direction),(l,s)=>(t(),a("div",Ie,[i("div",{class:y(["wrap",[`wrap-${e.direction}`,n.value?`show${e.direction}`:`hide${e.direction}`]])},[p(m(te),{icon:`icon-park-outline:double-${e.direction}`,style:c(m(u)),size:20,class:"icon",onClick:o},null,8,["icon","style"]),r(l.$slots,"default")],2)]))}});we.__file="packages/IceWrapper/wrapper2/index.vue";var $e=e({setup(e){const i=h("itemnum"),l=h("direction");i.value++;const n=x((()=>{const e={};return"down"==l?e.width=100/i.value+"%":e.height=100/i.value+"%",e}));return(e,i)=>(t(),a("div",{style:c(m(n))},[r(e.$slots,"default")],4))}});$e.__file="packages/IceWrapper/wrapperItem/index.vue";const xe=G(be,{name:"IceWrapper"}),ke=G(we,{name:"IceWrapper2"}),_e=G($e,{name:"IceWrapperItem"}),Se={class:"ice-panel-1"},Me={class:"title"},He={class:"content"};var qe=e({props:{title:{type:String,required:!1}},setup:e=>(n,s)=>(t(),a("div",Se,[i("div",Me,l(e.title),1),i("div",He,[r(n.$slots,"default")])]))});qe.__file="packages/IcePanel/panel1/index.vue";const Ee={class:"ice-panel-2"},De={class:"title"},Ne={class:"content"};var We=e({props:{title:{type:String,required:!1}},setup:e=>(n,s)=>(t(),a("div",Ee,[i("div",De,l(e.title),1),i("div",Ne,[r(n.$slots,"default")])]))});We.__file="packages/IcePanel/panel2/index.vue";const Ce=G(qe,{name:"IcePanel"}),Te=G(We,{name:"IcePanel2"}),je={class:"title"},Le={class:"ice-dialog__body"},ze={class:"content"},Be={key:0,class:"footer"},Oe={class:"footer-content"},Pe=["onMousedown"];var Re=e({props:{el:{type:String,required:!1,default:"app"},title:{type:String,required:!1,default:""},visible:{type:Boolean,required:!0,default:!1},width:{type:[Number,String],required:!1,default:500},height:{type:[Number,String],required:!1},left:{type:[Number,String],required:!1},right:{type:[Number,String],required:!1},top:{type:[Number,String],required:!1},bottom:{type:[Number,String],required:!1},handles:{type:[Boolean,String],required:!1,default:!0},minWidth:{type:Number,required:!1,default:100},minHeight:{type:Number,required:!1,default:100},maxWidth:{type:Number,required:!1,default:1e3},maxHeight:{type:Number,required:!1,default:1e3},zIndex:{type:Number,required:!1},customClass:{type:String,required:!1}},emits:["update:visible"],setup(e,{emit:o}){const u=e,c=x((()=>{const e=parseInt((u.left||"").toString()),t=parseInt((u.right||"").toString());return u.left&&e>0&&e<40?"fadein-left":u.right&&t>0&&t<40?"fadein-right":"fadein-popup"})),f=s();I((()=>{!function(){const e=f.value.style;u.width&&(e.width=b(u.width));u.top&&u.bottom||u.height&&(e.height=b(u.height))}(),function(){const e=f.value.style;e.zIndex=u.zIndex,void 0!==u.left?e.left=b(u.left):void 0!==u.right&&(e.right=b(u.right),e.left="initial");void 0!==u.top&&(e.top=b(u.top));void 0!==u.bottom&&(e.bottom=b(u.bottom))}(),N(window,"resize",g)})),k((()=>{W(window,"resize",g)}));const h=()=>{o("update:visible",!1)};function g(){const e=f.value,t=document.getElementById(u.el);e.offsetTop+e.offsetHeight>t.offsetHeight&&(e.style.height=b(Math.max(t.offsetHeight-e.offsetTop,u.minHeight))),e.offsetLeft+e.offsetWidth>t.offsetWidth&&(e.style.width=b(Math.max(t.offsetWidth-e.offsetLeft,u.minWidth)))}function b(e){return"number"==typeof e||"string"==typeof e&&/^[0-9]*$/.test(e)?`${e}px`:e}function H(e){const t=document.getElementById(u.el),a=f.value,i=e.clientX,l=e.clientY,n=a.offsetLeft,r=a.offsetTop,s=t.offsetWidth-a.offsetWidth,o=t.offsetHeight-a.offsetHeight;function c(e){e.preventDefault();const t=e.clientX-i,c=e.clientY-l,d=n+t,v=r+c;u.top&&u.bottom&&(a.style.height=b(a.offsetHeight),a.style.bottom="initial"),a.style.left=`${Math.min(Math.max(0,d),s)}px`,a.style.top=`${Math.min(Math.max(0,v),o)}px`}N(document.documentElement,"mousemove",c),N(document.documentElement,"mouseup",(function e(t){t.preventDefault(),W(document.documentElement,"mousemove",c),W(document.documentElement,"mouseup",e)}))}const q=["x","y","xy"];let E="";const D=x((()=>u.handles?"string"==typeof u.handles?u.handles.split(""):q:[]));function N(e,t,a){e&&(e.attachEvent?e.attachEvent(`on${t}`,a):e.addEventListener?e.addEventListener(t,a):e[`on${t}`]=a)}function W(e,t,a){e&&(e.detachEvent?e.detachEvent(`on${t}`,a):e.removeEventListener?e.removeEventListener(t,a):e[`on${t}`]=null)}return(s,o)=>(t(),_(S,{to:"body"},[w(i("div",{class:y(["ice-dialog",[e.customClass,m(c)]]),ref_key:"pannelBox",ref:f},[i("div",{ref:"modelHeader",class:"ice-dialog__header",onMousedown:H},[r(s.$slots,"icon"),i("span",je,l(e.title),1),p(m(te),{icon:"icon-park-outline:close",class:"close-btn",onClick:h})],544),i("div",Le,[i("div",ze,[r(s.$slots,"default",{visible:e.visible})]),s.$slots.footer?(t(),a("div",Be,[i("div",Oe,[r(s.$slots,"footer")])])):n("v-if",!0)]),(t(!0),a(d,null,v(m(D),(e=>(t(),a("div",{key:e,class:y(["handle",["handle-"+e]]),onMousedown:M((t=>function(e,t){E=e;const a=t.clientX,i=t.clientY,l=f.value.offsetWidth||0,n=f.value.offsetHeight||0;function r(e){if(e.preventDefault(),-1!==E.indexOf("x")){const t=l+e.clientX-a;f.value.style.width=`${Math.min(Math.max(u.minWidth,t,0),u.maxWidth)}px`}if(-1!==E.indexOf("y")){const t=n+e.clientY-i;f.value.style.height=`${Math.min(Math.max(u.minHeight,t,0),u.maxHeight)}px`}}N(document.documentElement,"mousemove",r),N(document.documentElement,"mouseup",(function e(t){t.preventDefault(),W(document.documentElement,"mousemove",r),W(document.documentElement,"mouseup",e)}))}(e,t)),["stop","prevent"])},[r(s.$slots,e)],42,Pe)))),128))],2),[[$,e.visible]])]))}});Re.__file="packages/IceDialog/index.vue";const Ye=G(Re,{name:"IceDialog"}),Ae={class:"ice-list"},Fe=["title"];var Ve=e({props:{listData:{type:Array,required:!0,default:()=>[{name:"小明",age:18,grade:"一年级",tset:"00000000000000000000000000000000000000000"},{name:"小明",age:18,grade:"一年级",tset:"00"},{name:"小明",age:18,grade:"一年级",tset:"00"},{name:"小明",age:18,grade:"一年级",tset:"00"},{name:"小明",age:18,grade:"一年级",tset:"00"},{name:"小明",age:18,grade:"一年级",tset:"00"}]},width:{type:String,required:!0,default:"110%"},maxHeight:{type:Number,required:!0,default:234},rowHeight:{type:Number,required:!0,default:50}},setup:e=>(n,r)=>(t(),a("div",Ae,[i("table",{style:c({width:e.width+"px"||e.width})},[i("thead",null,[i("tr",{style:c({height:e.rowHeight+"px"})},[(t(!0),a(d,null,v(Object.keys(e.listData[0]),(e=>(t(),a("th",{key:e},l(e),1)))),128))],4)]),i("tbody",{style:c({maxHeight:e.maxHeight+"px"})},[(t(!0),a(d,null,v(e.listData,(i=>(t(),a("tr",{key:i,style:c({height:e.rowHeight+"px"})},[(t(!0),a(d,null,v(Object.values(i),((e,i)=>(t(),a("td",{key:e+"_"+i,title:String(e)},l(e),9,Fe)))),128))],4)))),128))],4)],4)]))});Ve.__file="packages/IceList/index.vue";const Xe=G(Ve,{name:"IceList"});var Ge=e({props:{maxHeight:{type:Number,required:!1,default:100},width:{type:String,required:!1,default:"100%"}},setup:e=>(l,n)=>(t(),a("div",{class:"ice-scrollbar",style:c({maxHeight:e.maxHeight+"px",width:e.width+"px"||e.width})},[i("div",null,[r(l.$slots,"default")])],4))});Ge.__file="packages/IceScrollbar/index.vue";const Ke=G(Ge,{name:"IceScrollbar"}),Ze={class:"time"},Ue={key:0,class:"week"};var Je=e({props:{fontSize:{type:Number,required:!1,default:16},color:{type:String,required:!1,default:"#fff"},format:{type:String,required:!1,default:"MM月DD日 HH:mm:ss"},showWeek:{type:Boolean,required:!1,default:!0}},setup(e){const r=e,o=["周日","周一","周二","周三","周四","周五"],u={fontSize:`${r.fontSize}px`,color:r.color},c=s(),d=s(),v=()=>{const e=new Date;c.value=T(e,r.format),d.value=o[e.getDay()]};return v(),setInterval(v,1e3),(r,s)=>(t(),a("div",{class:"ice-clock",style:u},[i("span",Ze,l(c.value),1),e.showWeek?(t(),a("span",Ue,l(d.value),1)):n("v-if",!0)]))}});Je.__file="packages/IceClock/index.vue";const Qe=G(Je,{name:"IceClock"}),et=["title"],tt={key:0};var at=e({props:{city:{type:String,required:!1,default:void 0},apiKey:{type:String,required:!1,default:"c382f210cef36955b06c5f472af64a52"},showCity:{type:Boolean,required:!1,default:!1}},setup(e){const r=e,o=s(),u=s(),c=s(!1),d=x((()=>`${u.value.city}, ${u.value.weather}, ${u.value.temperature}℃`)),v=e=>fetch(`https://restapi.amap.com/v3/weather/weatherInfo?key=${r.apiKey}&city=${e}&extensions=base`).then((e=>e.json())).then((e=>e.lives)),p=e=>{u.value=e,(e=>{switch(e){case"晴":default:o.value="weather-1";break;case"多云":o.value="weather-2";break;case"阴":o.value="weather-3";break;case"小雨":o.value="weather-4";break;case"中雨":o.value="weather-5";break;case"大雨":o.value="weather-6";break;case"暴雨":o.value="weather-7";break;case"小雪":o.value="weather-8";break;case"中雪":o.value="weather-9";break;case"大雪":o.value="weather-10";break;case"暴雪":o.value="weather-11";break;case"雾":o.value="weather-12";break;case"霾":o.value="weather-13"}})(u.value.weather),c.value=!0};return I((()=>{r.city?v(r.city).then((e=>p({...e[0]}))):"geolocation"in navigator&&navigator.geolocation.getCurrentPosition((e=>{var t;(t=e.coords,fetch(`https://restapi.amap.com/v3/geocode/regeo?location=${t.longitude},${t.latitude}&key=${r.apiKey}`).then((e=>e.json())).then((e=>{const{city:t}=e.regeocode.addressComponent;return t}))).then((e=>{v(e).then((e=>p({...e[0]})))}))}))})),(e,s)=>c.value?(t(),a("div",{key:0,class:"ice-weather",title:m(d)},[r.showCity?(t(),a("span",tt,l(u.value?.city),1)):n("v-if",!0),i("span",{class:y(["weather-icon",o.value])},null,2),i("span",null,l(u.value?.temperature+"℃"),1)],8,et)):n("v-if",!0)}});at.__file="packages/IceWeather/index.vue";const it=G(at,{name:"IceWeather"}),lt={class:"ice-number-flop"},nt={class:"front face"},rt={class:"text"},st={class:"back face"},ot={class:"text"};var ut=e({props:{number:{type:Number,required:!1,default:0},separator:{type:String,required:!1,default:""}},setup(e){const n=e,r=(e,t)=>`${(e||0).toString()}`.replace(/(\d)(?=(?:\d{3})+$)/g,`$1${t}`),u=s(),c=s(),p=s();return I((()=>{o((()=>n.number),((e,t)=>{c.value=r(e,n.separator).split(""),p.value=r(t,n.separator).split(""),console.log("newArr>>>>>>",c.value),console.log("oldVal>>>>>>",p.value);const a=[],i=[];for(let e=0;e<c.value.length;e++)c.value[e]!==p.value[e]?a.push(!0):a.push(!1),i.push(!1);u.value=a,setTimeout((()=>{u.value=i}),300)}),{immediate:!0})})),(e,n)=>(t(),a("div",lt,[(t(!0),a(d,null,v(c.value,((e,n)=>(t(),a("div",{class:y(["anim-object","active",{"flip-vertical-left":u.value[n]}]),key:n},[i("div",nt,[i("div",rt,l(e),1)]),i("div",st,[i("div",ot,l(p.value[n]),1)])],2)))),128))]))}});ut.__file="packages/IceNumberFlip/index.vue";const ct=G(ut,{name:"IceNumberFlip"}),dt=["src"];var vt=e({props:{src:{type:String,required:!1},width:{type:Number,required:!1},height:{type:Number,required:!1}},setup(e){const l=e,n=s(null),r=s(),o=s("/packages/IceImage/default.svg"),u=()=>{const e=n.value?.getBoundingClientRect(),t=e?.top,a=e?.bottom;t<=window.innerHeight&&a>=0&&l.src&&(o.value=String(l.src))},d=()=>{((e,t="vertical")=>"hidden"!==(e.style?e.style.overflow:window.getComputedStyle(e).getPropertyValue("overflow"))&&("vertical"===t?e.scrollHeight>e.clientHeight:"horizontal"===t&&e.scrollWidth>e.clientWidth))(r.value)?r.value.addEventListener("scroll",(()=>{u()}),!0):(r.value=r.value.parentElement,d())},v=e=>{const t=e.srcElement;t.src="/packages/IceImage/losing.svg",t.onerror=null};return I((()=>{u(),r.value=n.value?.parentElement,d()})),(l,r)=>(t(),a("div",{ref_key:"iceimage",ref:n,style:c({width:e.width+"px"||"auto",height:e.height+"px"||"auto"}),class:"ice-image"},[i("img",{src:o.value,onerror:v},null,8,dt)],4))}});vt.__file="packages/IceImage/index.vue";const pt=G(vt,{name:"IceImage"});var mt=e({name:"IceVirtualList",emits:["on-load-more"],props:{list:{type:Array,default:()=>[]},interval:{type:Number,default:100},height:{type:String,default:"100%"},itemHeight:{type:Number,default:0},distance:{type:Number,default:50},screen:{type:Array,default:()=>[1,1]},remain:{type:Number,default:8}},setup(e,{emit:t}){const{scrollBarHeight:a,scrollTranslateY:i,renderData:l,onScroll:n,setItemRef:r}=((e,t)=>{const a=s(0),i=s(0),l=s([]),n=s(0),r=s(0),c=[],d=x((()=>e.remain*e.screen[0])),v=x((()=>e.remain*e.screen[1])),p=x((()=>Math.min(n.value,d.value))),m=x((()=>Math.min(e.list.length-r.value,v.value))),f=x((()=>l.value.slice(n.value-p.value,r.value+m.value))),h=()=>{u((()=>{0===e.itemHeight&&c.forEach((e=>{const{height:t}=e.getBoundingClientRect(),a=+e.dataset.index,i=l.value[a].height;t&&i!==t&&(l.value[a].height=t)})),a.value=l.value.reduce(((e,t)=>e+t.height),0)}))};let g=a=>{const{scrollTop:s,clientHeight:o,scrollHeight:c}=a.target;if(e.itemHeight)n.value=~~(s/e.itemHeight),r.value=n.value+e.remain,i.value=(n.value-p.value)*e.itemHeight;else{let t=0;const a=l.value.findIndex((e=>(t+=e.height,t>s)));n.value=a,r.value=n.value+e.remain;let o=0;const u=n.value-p.value;l.value.find(((e,t)=>t>=u||(o+=e.height,!1))),i.value=o,h()}u((()=>{s+o>=c-e.distance&&t("on-load-more")}))};return g=W(g,e.interval),o((()=>e.list),(t=>{const a=e.itemHeight||100;l.value=t.map(((e,t)=>({...e,virtualId:t,height:a}))),h()}),{deep:!0,immediate:!0}),{scrollBarHeight:a,scrollTranslateY:i,renderData:f,onScroll:g,setItemRef:(e,t)=>{e&&(c[t]=e)}}})(e,t);return{scrollBarHeight:a,scrollTranslateY:i,renderData:l,onScroll:n,setItemRef:r}}});const ft=["data-index"];mt.render=function(e,l,s,o,u,p){return t(),a(d,null,[n(" 虚拟列表 "),i("div",{class:"ice-virtual-list",style:c(`height:${e.height};`),onScrollPassive:l[0]||(l[0]=(...t)=>e.onScroll&&e.onScroll(...t))},[n(" 滚动高度 "),i("div",{class:"u-scroll-bar",style:c(`height:${e.scrollBarHeight}px;`)},null,4),n(" 列表 "),i("ul",{class:"m-list-scroll",style:c(`transform:translateY(${e.scrollTranslateY}px);`)},[(t(!0),a(d,null,v(e.renderData,(i=>(t(),a("li",{key:i.virtualId,"data-index":i.virtualId,ref_for:!0,ref:t=>e.setItemRef(t,i.virtualId)},[r(e.$slots,"default",{item:i})],8,ft)))),128))],4),r(e.$slots,"more")],36)],2112)},mt.__file="packages/IceVirtualList/index.vue";const ht=G(mt,{name:"IceVirtualList"}),gt={class:"ice-carousel",ref:"carousel"},yt={class:"icon"},bt=["data-icon"],It={class:"val"},wt=[i("span",{class:"iconify","data-icon":"icon-park-outline:close-one"},null,-1)];var $t=e({setup(e){const n=g(),r={icon:"icon-park-outline:alarm",bgcolor:"red",CN:"粥品香坊其烹饪粥料的秘方源于中国千年古法,在融和现代制作工艺,由世界烹饪大师屈浩先生领衔研发。",distance:0,time:5e3};let u=null,v=null,p=null;const f=s(!0),h=s(r.CN),y=b({overflow:"hidden"});function x(){v=setTimeout((()=>{f.value=!f.value}),r.time)}function k(){f.value=!f.value}function _(){!function(){y.overflow="visible";const e=n?.refs.box.clientWidth,t=n?.refs.text.scrollWidth;if(t<=e)return;p=n?.refs.text,console.log(p);let{distance:a}=r;u=setInterval((()=>{a-=1,-a>=t&&(a=e),p.style.transform=`translateX(${a}px)`,r.distance=a}),20)}(),clearTimeout(v)}function S(){clearInterval(u),x()}function M(){clearTimeout(v),f.value=!f.value}return I((()=>{x()})),o(f,(e=>{e||(p.style.transform="translateX(0px)",r.distance=0,y.overflow="hidden")})),(e,n)=>(t(),a(d,null,[w(i("div",gt,[i("div",yt,[i("span",{class:"iconify","data-icon":r.icon},null,8,bt)]),i("div",{ref_key:"box",ref:p,class:"box",onMouseenter:_,onMouseleave:S},[i("div",It,[i("p",{class:"text1",ref:"text",style:c(m(y))},l(h.value),5)])],544),i("div",{class:"close",onClick:M},wt)],512),[[$,f.value]]),i("button",{class:"btn",onClick:k},"切换")],64))}});$t.__file="packages/IceCarousel/index.vue";const xt=G($t,{name:"IceCarousel"});var kt=Object.freeze({__proto__:null,IceHeader:K,IceHeader2:Z,IceHeader3:U,IceMenu:pe,IceMenu2:me,IceMenuItem:fe,IceMenuItemGroup:he,IceSubMenu:ge,IceWrapper:xe,IceWrapper2:ke,IceWrapperItem:_e,IcePanel:Ce,IcePanel2:Te,IceIcon:te,IceDialog:Ye,IceList:Xe,IceScrollbar:Ke,IceClock:Qe,IceWeather:it,IceNumberFlip:ct,IceImage:pt,IceVirtualList:ht,IceCarousel:xt});const _t={...j};var St={version:Object.freeze({__proto__:null,default:"1.1.0"}),install:function(e,t){Object.keys(kt).forEach((a=>{e.use(kt[a],t)})),Object.keys(_t).forEach((t=>{e.config.globalProperties[`$${t}`]=_t[t]}))}};export{xt as IceCarousel,Qe as IceClock,Ye as IceDialog,K as IceHeader,Z as IceHeader2,U as IceHeader3,te as IceIcon,pt as IceImage,Xe as IceList,pe as IceMenu,me as IceMenu2,fe as IceMenuItem,he as IceMenuItemGroup,ct as IceNumberFlip,Ce as IcePanel,Te as IcePanel2,Ke as IceScrollbar,ge as IceSubMenu,ht as IceVirtualList,it as IceWeather,xe as IceWrapper,ke as IceWrapper2,_e as IceWrapperItem,St as default};