Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

@brushes/simulate-component

Package Overview
Dependencies
Maintainers
3
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brushes/simulate-component - npm Package Compare versions

Comparing version
0.3.96
to
0.3.97
+5
-0
css/tabs.scss

@@ -19,1 +19,6 @@ .qj-tabs {

}
.swiper-pagination-hidden {
opacity: 1 !important;
display: block !important;
}
+1
-1

@@ -1,1 +0,1 @@

import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import{useState as r,useMemo as o,useEffect as i,memo as l,useCallback as c,useRef as a}from"react";import{getEnv as s,getTaro as d}from"@brushes/utils";import{Swiper as h,Radio as u,Checkbox as p}from"antd-mobile";import*as m from"antd-mobile";export{m as antdMobile};import{isEmpty as g,isFunction as f,noop as b}from"lodash-es";import v from"classnames";function w(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}function y(e,n,t,r){return new(t||(t=Promise))(function(o,i){function l(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(l,c)}a((r=r.apply(e,n||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const j=n=>{var{children:t=""}=n,r=w(n,["children"]);return e("div",Object.assign({},r,{children:t}))},S=n=>{var{children:t=""}=n,r=w(n,["children"]);return e("span",Object.assign({},r,{children:t}))},x=new Map;const O=function(e){let n,t="pending",r=e.then(e=>{t="success",n=e},e=>{t="error",n=e});return{read(){if("pending"===t)throw r;if("error"===t)throw n;if("success"===t)return n}}}(function(){const e=x.get("component");return new Promise(n=>{e?n(e):(()=>{y(this,void 0,void 0,function*(){let e={};if(s()){const[n,t]=yield Promise.all([import("@tarojs/components"),import("antd-mobile")]);e=Object.assign(Object.assign({},t),n)}else{const n=yield import("antd-mobile");e=Object.assign(Object.assign({},n),{View:j,Text:S})}x.set("component",e),n(e)})})()})}());let T=!0,C={};function N(){const[e]=r(()=>(T&&(T=!1,C=O.read()),C));return e}function k(e,n={height:200,width:375},t=""){const l=o(()=>s(),[]),[c,a]=r("");return i(()=>{let r="";if(l){const o=d().getSystemInfoSync().windowWidth;r=1==e?Math.floor(o*n.height/n.width)+"px":t||"100vh"}else r=1==e?Math.floor(375*n.height/n.width)+"px":t||"667px";a(r)},[e,n]),c}function E(t){var{indicatorDots:i=!0,direction:l="horizontal",autoplayInterval:c,loop:a=!0,data:s,type:u,render:p,style:m,imgHeight:f,autoplay:b}=t,v=w(t,["indicatorDots","direction","autoplayInterval","loop","data","type","render","style","imgHeight","autoplay"]);const[y,j]=r(b),[S,x]=r(0),{Swiper:O,SwiperItem:T,Skeleton:C}=N(),E=o(()=>!g(d()),[]),I=o(()=>E?O:h,[E]),W=o(()=>E?T:h.Item,[E]),z=k(u,f),P=o(()=>E?{vertical:"horizontal"!==l,interval:c,indicatorColor:"#999",circular:!0,indicatorActiveColor:"#333",indicatorDots:i}:{direction:l,autoplayInterval:c,loop:a},[l,c,a,i,E]);return e(n,{children:s.length>0?e(I,Object.assign({},P,v,{style:Object.assign(Object.assign({},m),{height:z}),autoplay:y,onChange:e=>{if(E){const{current:n}=e.detail;x(n),n!==s.length-1||a?j(b):j(!1)}},children:s.map((n,t)=>e(W,{children:p(n,S,t)},t))})):e(C,{animated:!0,style:{"--width":"100%","--height":z}})})}const I=l(({Threshold:n=50,onScroll:t,scrollTop:i=0,children:l})=>{const{ScrollView:a,PullToRefresh:h}=N(),[u,p]=r(i),m=a||h,g=o(()=>s(),[]),f=o(()=>g?{scrollY:!0,enablePassive:!0,scrollWithAnimation:!0,upperThreshold:n,lowerThreshold:n,onScrollToLower:t,enhanced:!0,showScrollbar:!1,style:{height:"100%"}}:{onRefresh:t},[]),b=c(e=>{if(!g)return;if("WEB"===d().getEnv()){const{scrollTop:n}=e.detail;p(n)}},[]);return e(m,Object.assign({onScroll:b},f,{scrollTop:u,children:l}))}),W=l(({Threshold:n=50,onScroll:t,scrollTop:i=0,children:l})=>{const a=o(()=>s(),[]),{ScrollView:h,PullToRefresh:u}=N(),[p,m]=r(i),g=h||u,f=o(()=>a?{scrollY:!0,enablePassive:!0,scrollWithAnimation:!0,upperThreshold:n,lowerThreshold:n,onScrollToLower:t,enhanced:!0,showScrollbar:!1,style:{height:"100%"}}:{onRefresh:t},[a]),b=c(e=>{if(!a)return;if("WEB"===d().getEnv()){const{scrollTop:n}=e.detail;m(n)}},[]);return e(g,Object.assign({onScroll:b},f,{scrollTop:p,children:l}))});function z({text:n="加载中……"}){const{View:r,Text:o}=N();return t(r,{style:{textAlign:"center",fontSize:"14px",padding:"5px 0"},children:[t(r,{className:"qj-loading",children:[e(r,{className:"qj-loading__ring"}),e(r,{className:"qj-loading__ring"}),e(r,{className:"qj-loading__ring"})]}),e(o,{style:{marginLeft:5},children:n})]})}const P=({tabs:n,onChange:t,actived:r,activeColor:o})=>{const{View:i}=N();return e(i,{className:"qj-tabs",id:"qj-tabs-id",children:n.map((n,l)=>e(i,{onClick:()=>t(l,n),className:v({"actived-item":r===l,"default-item":!0}),style:{borderColor:r===l?o:""},children:n.name},l))})},_=({tabs:o,render:i,defaultIndex:l,activeColor:c="#000"})=>{const{View:a}=N(),[s,d]=r(l),[h,u]=r(()=>{const e=new Array(l+1);return e[l]=o[l],e});return t(n,{children:[e(P,{actived:s,onChange:(e,n)=>{d(e),u(t=>(t[e]=n,t))},tabs:o,activeColor:c}),h.map((n,t)=>e(a,{style:{display:t===s?"block":"none"},children:i(n)},t))]})},V=({className:n="iconfont",prefixClass:t="icon",onClick:r=()=>{},style:o={fontSize:16,color:"#444",fontWeight:900},value:i})=>{const{Text:l}=N();return e(l,{onClick:r,className:v(t,i?`${t}-${i}`:"",n),style:o})},q=({popupVisible:n,popupHandler:r,children:o})=>{const{View:i}=N();return t(i,{className:"brushes-popup "+(n?"show":""),children:[e(i,{className:"brushes-popup-mask",onClick:()=>r(!1)}),t(i,{className:"brushes-popup-content",children:[e(i,{className:"brushes-popup-closeWrap",children:e(V,{value:"close-bold",style:{fontSize:22},onClick:()=>r(!1)})}),o]})]})},B=({count:n,handleStep:r})=>{const{View:o,Text:i}=N();return t(o,{className:"numStep",children:[e(V,{value:"jianqu",onClick:r.bind(null,"minus")}),e(i,{className:"content",children:n}),e(V,{value:"zengjia",onClick:r.bind(null,"plus")})]})},R=n=>{var{children:t}=n,r=w(n,["children"]);const{Radio:i}=N(),l=d(),c=o(()=>g(l)||"WEB"===l.getEnv()?u:i,[i,l]);return e(c,Object.assign({},r,{children:t}))},A=n=>{var{children:t}=n,r=w(n,["children"]);const{RadioGroup:i}=N(),l=d(),c=o(()=>g(l)||"WEB"===l.getEnv()?null==u?void 0:u.Group:i,[i,l]);return e(c,Object.assign({},r,{children:t}))},M=n=>{var{children:t}=n,r=w(n,["children"]);const{Checkbox:i}=N(),l=d(),c=o(()=>g(l)||"WEB"===l.getEnv()?p:i,[i,l]);return e(c,Object.assign({},r,{children:t}))},L=n=>{var{children:t}=n,r=w(n,["children"]);const{CheckboxGroup:i}=N(),l=d(),c=o(()=>g(l)||"WEB"===l.getEnv()?null==p?void 0:p.Group:i,[i,l]);return e(c,Object.assign({},r,{children:t}))};function G({loading:n,children:r}){const{View:o}=N();return t(o,{style:{position:"relative",textAlign:"center"},children:[r,n?e(o,{className:"wrap-loading",children:t(o,{className:"qj-loading",children:[e(o,{className:"qj-loading__ring"}),e(o,{className:"qj-loading__ring"}),e(o,{className:"qj-loading__ring"})]})}):null]})}const Y=l(({fontSize:l=14,color:c,content:a=[],speed:s=30,icon:h="gonggao",direction:u="horizontal",navigator:p})=>{const{View:m,NoticeBar:f}=N(),[b,v]=r({}),w=o(()=>`animElemId${Math.ceil(1e6*Math.random()).toString(36)}`,[]),y="horizontal"===u?"scroll-animate":"normal",j=o(()=>a.toString().length,[a]),S=o(()=>"horizontal"===u?1e3:350,[u]),x=o(()=>{const e=d();if(!g(e))return"WEB"!==e.getEnv()},[]),O=o(()=>{switch(u){case"horizontal":return 15*j;case"vertical":return"100%"}},[u,j]);return i(()=>{if(!x)return;const e=d();let n="";const t=setTimeout(()=>{e.createSelectorQuery().select(`#${w}`).boundingClientRect(t=>{const{width:r,height:o}=t||{},i=(e=>{if(!x)return;const n=d().getSystemInfoSync().windowWidth;return"horizontal"===u&&e/n>1?e/n:1})(r)||1,l=500*i/+s,c=()=>{const n=e.createAnimation({duration:l*S,timingFunction:"linear"}),t=e.createAnimation({duration:0,timingFunction:"linear"}),c=()=>{setTimeout(()=>{t.translateX(r/i).step(),v(t.export())},l*S+200),setTimeout(()=>{n.translateX(-r).step(),v(n.export())},100)};switch(u){case"horizontal":default:c();break;case"vertical":setTimeout(()=>{t.translateY(o/a.length).step(),v(t.export())},l*S+200),setTimeout(()=>{n.translateY(-o).step(),v(n.export())},100)}};c(),n=setInterval(c,l*S+300)}).exec()},1e3);return()=>{clearTimeout(t),clearInterval(n)}},[a,S,u,w,x,s]),e(n,{children:x?t(m,{id:"noticebar-wrap",children:[e(m,{className:"icon-pre",children:e(V,{style:{fontSize:20,fontWeight:600},value:h})}),e(m,{animation:b,id:w,children:e(m,{style:{width:O},className:y,children:a.map((n,t)=>e(m,{style:{color:c},onClick:()=>p?p(t):()=>{},className:"scroll-animate-item",children:n},t))})})]}):e(f,{speed:s,style:{"--font-size":l+"px","--text-color":c,"--border-color":"#fff3e9","--background-color":"#fff9ed"},content:a[0]})})}),$=n=>{var{children:t}=n,r=w(n,["children"]);return e("div",Object.assign({},r,{children:t}))},D=l(n=>{var{children:t}=n,r=w(n,["children"]);const{View:o=$,Skeleton:i}=N();return e(o,Object.assign({},r,{children:t||e(i.Paragraph,{style:{minWidth:35,height:20,overflow:"hidden"},lineCount:1,animated:!0})}))}),H=n=>{var{children:t}=n,r=w(n,["children"]);return e("div",Object.assign({},r,{children:t}))},X=l(n=>{var{children:t}=n,r=w(n,["children"]);const{Text:o=H,Skeleton:i}=N();return e(o,Object.assign({},r,{children:t||e(i,{style:{"--width":"100%","--height":"16px"},animated:!0})}))}),F=new Map;function Q(e){const[n,t]=r(!0),[o,l]=r(null),[c,a]=r("");return i(()=>{if(F.has(e)&&e){const n=F.get(e);return t(!1),void a(n)}(function(e){return new Promise((n,t)=>{let r;const o=d();r=g(o)||"WEB"===o.getEnv()?new Image:o.createOffscreenCanvas({type:"2d"}).createImage(),r.onload=()=>{n(e)},r.onerror=t,r.src=e})})(e).then(()=>{t(!1),a(e),function(e){F.set(e,e)}(e)}).catch(e=>{t(!1),l(e)})},[e]),{loading:n,srcPath:c,error:o}}const J=l(n=>{var{src:t,errorImg:r="https://brushes.oss-cn-shanghai.aliyuncs.com/static/defaultPic.png"}=n,o=w(n,["src","errorImg"]);const{Image:i,Skeleton:l}=N(),{srcPath:c,loading:a,error:s}=Q(t);return c?e(i,Object.assign({src:c},o)):a?e(l,Object.assign({animated:!0},o)):s?e(i,Object.assign({src:r},o)):null});var K=Object.freeze({__proto__:null,SmoothSwiper:E,ScrollView:I,ScrollViewX:W,Loading:z,Tabs:_,Popup:q,NumStep:B,IconMobile:V,Radio:R,SmoothRadio:A,Checkbox:M,SmoothCheckbox:L,WrapLoading:G,NoticeBar:Y,SmoothView:D,SmoothText:X,Image:J});function U(e){const n=a();return n.current=f(e)?e:b,c((...e)=>n.current(...e),[n])}function Z(e,n=void 0){const t=a(n);return t.current===n&&(t.current=e()),t}let ee={};function ne(){const e=N();return o(()=>g(ee)?(ee=Object.assign(Object.assign({},e),K),ee):ee,[e])}export{M as Checkbox,V as IconMobile,J as Image,z as Loading,Y as NoticeBar,B as NumStep,q as Popup,R as Radio,I as ScrollView,W as ScrollViewX,L as SmoothCheckbox,A as SmoothRadio,E as SmoothSwiper,X as SmoothText,D as SmoothView,_ as Tabs,G as WrapLoading,ne as useComponent,k as useImageHeight,U as useImmutableCallback,Z as useLazyRef};
import{jsx as e,Fragment as n,jsxs as t}from"react/jsx-runtime";import{useState as r,useMemo as o,useEffect as i,memo as l,useCallback as c,useRef as a}from"react";import{getEnv as s,getTaro as d}from"@brushes/utils";import{Swiper as h}from"@nutui/nutui-react-taro";import{Swiper as u,Radio as p,Checkbox as m}from"antd-mobile";import*as g from"antd-mobile";export{g as antdMobile};import{isEmpty as f,isFunction as b,noop as v}from"lodash-es";import w from"classnames";function y(e,n){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&n.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)n.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(t[r[o]]=e[r[o]])}return t}function j(e,n,t,r){return new(t||(t=Promise))(function(o,i){function l(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t(function(e){e(n)})).then(l,c)}a((r=r.apply(e,n||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const S=n=>{var{children:t=""}=n,r=y(n,["children"]);return e("div",Object.assign({},r,{children:t}))},x=n=>{var{children:t=""}=n,r=y(n,["children"]);return e("span",Object.assign({},r,{children:t}))},O=new Map;const T=function(e){let n,t="pending",r=e.then(e=>{t="success",n=e},e=>{t="error",n=e});return{read(){if("pending"===t)throw r;if("error"===t)throw n;if("success"===t)return n}}}(function(){const e=O.get("component");return new Promise(n=>{e?n(e):(()=>{j(this,void 0,void 0,function*(){let e={};if(s()){const[n,t]=yield Promise.all([import("@tarojs/components"),import("antd-mobile")]);e=Object.assign(Object.assign({},t),n)}else{const n=yield import("antd-mobile");e=Object.assign(Object.assign({},n),{View:S,Text:x})}O.set("component",e),n(e)})})()})}());let N=!0,C={};function k(){const[e]=r(()=>(N&&(N=!1,C=T.read()),C));return e}function E(e,n={height:200,width:375},t=""){const l=o(()=>s(),[]),[c,a]=r("");return i(()=>{let r="";if(l){const o=d().getSystemInfoSync().windowWidth;r=1==e?Math.floor(o*n.height/n.width)+"px":t||"100vh"}else r=1==e?Math.floor(375*n.height/n.width)+"px":t||"667px";a(r)},[e,n]),c}function I(t){var{indicatorDots:i=!0,direction:l="horizontal",autoplayInterval:c,loop:a=!0,data:s,type:p,render:m,style:g,imgHeight:b,autoplay:v}=t,w=y(t,["indicatorDots","direction","autoplayInterval","loop","data","type","render","style","imgHeight","autoplay"]);const[j,S]=r(v),[x,O]=r(0),{Skeleton:T}=k(),N=o(()=>!f(d()),[]),C=o(()=>N?h:u,[N]),I=o(()=>N?h.Item:u.Item,[N]),W=E(p,b),z=o(()=>N?{vertical:"horizontal"!==l,interval:c,circular:!0,indicator:i}:{direction:l,autoplayInterval:c,loop:a},[l,c,a,i,N]);return e(n,{children:s.length>0?e(C,Object.assign({},z,w,{style:Object.assign(Object.assign({},g),{height:W}),indicator:!0,autoplay:!0,onChange:e=>{if(N){const{current:n}=e.detail;O(n),n!==s.length-1||a?S(v):S(!1)}},children:s.map((n,t)=>e(I,{children:m(n,x,t)},t))})):e(T,{animated:!0,style:{"--width":"100%","--height":W}})})}const W=l(({Threshold:n=50,onScroll:t,scrollTop:i=0,children:l})=>{const{ScrollView:a,PullToRefresh:h}=k(),[u,p]=r(i),m=a||h,g=o(()=>s(),[]),f=o(()=>g?{scrollY:!0,enablePassive:!0,scrollWithAnimation:!0,upperThreshold:n,lowerThreshold:n,onScrollToLower:t,enhanced:!0,showScrollbar:!1,style:{height:"100%"}}:{onRefresh:t},[]),b=c(e=>{if(!g)return;if("WEB"===d().getEnv()){const{scrollTop:n}=e.detail;p(n)}},[]);return e(m,Object.assign({onScroll:b},f,{scrollTop:u,children:l}))}),z=l(({Threshold:n=50,onScroll:t,scrollTop:i=0,children:l})=>{const a=o(()=>s(),[]),{ScrollView:h,PullToRefresh:u}=k(),[p,m]=r(i),g=h||u,f=o(()=>a?{scrollY:!0,enablePassive:!0,scrollWithAnimation:!0,upperThreshold:n,lowerThreshold:n,onScrollToLower:t,enhanced:!0,showScrollbar:!1,style:{height:"100%"}}:{onRefresh:t},[a]),b=c(e=>{if(!a)return;if("WEB"===d().getEnv()){const{scrollTop:n}=e.detail;m(n)}},[]);return e(g,Object.assign({onScroll:b},f,{scrollTop:p,children:l}))});function P({text:n="加载中……"}){const{View:r,Text:o}=k();return t(r,{style:{textAlign:"center",fontSize:"14px",padding:"5px 0"},children:[t(r,{className:"qj-loading",children:[e(r,{className:"qj-loading__ring"}),e(r,{className:"qj-loading__ring"}),e(r,{className:"qj-loading__ring"})]}),e(o,{style:{marginLeft:5},children:n})]})}const _=({tabs:n,onChange:t,actived:r,activeColor:o})=>{const{View:i}=k();return e(i,{className:"qj-tabs",id:"qj-tabs-id",children:n.map((n,l)=>e(i,{onClick:()=>t(l,n),className:w({"actived-item":r===l,"default-item":!0}),style:{borderColor:r===l?o:""},children:n.name},l))})},V=({tabs:o,render:i,defaultIndex:l,activeColor:c="#000"})=>{const{View:a}=k(),[s,d]=r(l),[h,u]=r(()=>{const e=new Array(l+1);return e[l]=o[l],e});return t(n,{children:[e(_,{actived:s,onChange:(e,n)=>{d(e),u(t=>(t[e]=n,t))},tabs:o,activeColor:c}),h.map((n,t)=>e(a,{style:{display:t===s?"block":"none"},children:i(n)},t))]})},q=({className:n="iconfont",prefixClass:t="icon",onClick:r=()=>{},style:o={fontSize:16,color:"#444",fontWeight:900},value:i})=>{const{Text:l}=k();return e(l,{onClick:r,className:w(t,i?`${t}-${i}`:"",n),style:o})},B=({popupVisible:n,popupHandler:r,children:o})=>{const{View:i}=k();return t(i,{className:"brushes-popup "+(n?"show":""),children:[e(i,{className:"brushes-popup-mask",onClick:()=>r(!1)}),t(i,{className:"brushes-popup-content",children:[e(i,{className:"brushes-popup-closeWrap",children:e(q,{value:"close-bold",style:{fontSize:22},onClick:()=>r(!1)})}),o]})]})},R=({count:n,handleStep:r})=>{const{View:o,Text:i}=k();return t(o,{className:"numStep",children:[e(q,{value:"jianqu",onClick:r.bind(null,"minus")}),e(i,{className:"content",children:n}),e(q,{value:"zengjia",onClick:r.bind(null,"plus")})]})},A=n=>{var{children:t}=n,r=y(n,["children"]);const{Radio:i}=k(),l=d(),c=o(()=>f(l)||"WEB"===l.getEnv()?p:i,[i,l]);return e(c,Object.assign({},r,{children:t}))},M=n=>{var{children:t}=n,r=y(n,["children"]);const{RadioGroup:i}=k(),l=d(),c=o(()=>f(l)||"WEB"===l.getEnv()?null==p?void 0:p.Group:i,[i,l]);return e(c,Object.assign({},r,{children:t}))},L=n=>{var{children:t}=n,r=y(n,["children"]);const{Checkbox:i}=k(),l=d(),c=o(()=>f(l)||"WEB"===l.getEnv()?m:i,[i,l]);return e(c,Object.assign({},r,{children:t}))},G=n=>{var{children:t}=n,r=y(n,["children"]);const{CheckboxGroup:i}=k(),l=d(),c=o(()=>f(l)||"WEB"===l.getEnv()?null==m?void 0:m.Group:i,[i,l]);return e(c,Object.assign({},r,{children:t}))};function Y({loading:n,children:r}){const{View:o}=k();return t(o,{style:{position:"relative",textAlign:"center"},children:[r,n?e(o,{className:"wrap-loading",children:t(o,{className:"qj-loading",children:[e(o,{className:"qj-loading__ring"}),e(o,{className:"qj-loading__ring"}),e(o,{className:"qj-loading__ring"})]})}):null]})}const $=l(({fontSize:l=14,color:c,content:a=[],speed:s=30,icon:h="gonggao",direction:u="horizontal",navigator:p})=>{const{View:m,NoticeBar:g}=k(),[b,v]=r({}),w=o(()=>`animElemId${Math.ceil(1e6*Math.random()).toString(36)}`,[]),y="horizontal"===u?"scroll-animate":"normal",j=o(()=>a.toString().length,[a]),S=o(()=>"horizontal"===u?1e3:350,[u]),x=o(()=>{const e=d();if(!f(e))return"WEB"!==e.getEnv()},[]),O=o(()=>{switch(u){case"horizontal":return 15*j;case"vertical":return"100%"}},[u,j]);return i(()=>{if(!x)return;const e=d();let n="";const t=setTimeout(()=>{e.createSelectorQuery().select(`#${w}`).boundingClientRect(t=>{const{width:r,height:o}=t||{},i=(e=>{if(!x)return;const n=d().getSystemInfoSync().windowWidth;return"horizontal"===u&&e/n>1?e/n:1})(r)||1,l=500*i/+s,c=()=>{const n=e.createAnimation({duration:l*S,timingFunction:"linear"}),t=e.createAnimation({duration:0,timingFunction:"linear"}),c=()=>{setTimeout(()=>{t.translateX(r/i).step(),v(t.export())},l*S+200),setTimeout(()=>{n.translateX(-r).step(),v(n.export())},100)};switch(u){case"horizontal":default:c();break;case"vertical":setTimeout(()=>{t.translateY(o/a.length).step(),v(t.export())},l*S+200),setTimeout(()=>{n.translateY(-o).step(),v(n.export())},100)}};c(),n=setInterval(c,l*S+300)}).exec()},1e3);return()=>{clearTimeout(t),clearInterval(n)}},[a,S,u,w,x,s]),e(n,{children:x?t(m,{id:"noticebar-wrap",children:[e(m,{className:"icon-pre",children:e(q,{style:{fontSize:20,fontWeight:600},value:h})}),e(m,{animation:b,id:w,children:e(m,{style:{width:O},className:y,children:a.map((n,t)=>e(m,{style:{color:c},onClick:()=>p?p(t):()=>{},className:"scroll-animate-item",children:n},t))})})]}):e(g,{speed:s,style:{"--font-size":l+"px","--text-color":c,"--border-color":"#fff3e9","--background-color":"#fff9ed"},content:a[0]})})}),H=n=>{var{children:t}=n,r=y(n,["children"]);return e("div",Object.assign({},r,{children:t}))},X=l(n=>{var{children:t}=n,r=y(n,["children"]);const{View:o=H,Skeleton:i}=k();return e(o,Object.assign({},r,{children:t||e(i.Paragraph,{style:{minWidth:35,height:20,overflow:"hidden"},lineCount:1,animated:!0})}))}),D=n=>{var{children:t}=n,r=y(n,["children"]);return e("div",Object.assign({},r,{children:t}))},F=l(n=>{var{children:t}=n,r=y(n,["children"]);const{Text:o=D,Skeleton:i}=k();return e(o,Object.assign({},r,{children:t||e(i,{style:{"--width":"100%","--height":"16px"},animated:!0})}))}),Q=new Map;function J(e){const[n,t]=r(!0),[o,l]=r(null),[c,a]=r("");return i(()=>{if(Q.has(e)&&e){const n=Q.get(e);return t(!1),void a(n)}(function(e){return new Promise((n,t)=>{let r;const o=d();r=f(o)||"WEB"===o.getEnv()?new Image:o.createOffscreenCanvas({type:"2d"}).createImage(),r.onload=()=>{n(e)},r.onerror=t,r.src=e})})(e).then(()=>{t(!1),a(e),function(e){Q.set(e,e)}(e)}).catch(e=>{t(!1),l(e)})},[e]),{loading:n,srcPath:c,error:o}}const K=l(n=>{var{src:t,errorImg:r="https://brushes.oss-cn-shanghai.aliyuncs.com/static/defaultPic.png"}=n,o=y(n,["src","errorImg"]);const{Image:i,Skeleton:l}=k(),{srcPath:c,loading:a,error:s}=J(t);return c?e(i,Object.assign({src:c},o)):a?e(l,Object.assign({animated:!0},o)):s?e(i,Object.assign({src:r},o)):null});var U=Object.freeze({__proto__:null,SmoothSwiper:I,ScrollView:W,ScrollViewX:z,Loading:P,Tabs:V,Popup:B,NumStep:R,IconMobile:q,Radio:A,SmoothRadio:M,Checkbox:L,SmoothCheckbox:G,WrapLoading:Y,NoticeBar:$,SmoothView:X,SmoothText:F,Image:K});function Z(e){const n=a();return n.current=b(e)?e:v,c((...e)=>n.current(...e),[n])}function ee(e,n=void 0){const t=a(n);return t.current===n&&(t.current=e()),t}let ne={};function te(){const e=k();return o(()=>f(ne)?(ne=Object.assign(Object.assign({},e),U),ne):ne,[e])}export{L as Checkbox,q as IconMobile,K as Image,P as Loading,$ as NoticeBar,R as NumStep,B as Popup,A as Radio,W as ScrollView,z as ScrollViewX,G as SmoothCheckbox,M as SmoothRadio,I as SmoothSwiper,F as SmoothText,X as SmoothView,V as Tabs,Y as WrapLoading,te as useComponent,E as useImageHeight,Z as useImmutableCallback,ee as useLazyRef};
{
"name": "@brushes/simulate-component",
"version": "0.3.96",
"version": "0.3.97",
"description": "'组件库'",

@@ -5,0 +5,0 @@ "main": "dist/index.js",