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.94
to
0.3.95
+4
dist/src/components/checkbox/index.d.ts
import { ReactNode } from 'react';
export declare const Checkbox: ({ children, ...restProps }: {
children: ReactNode;
}) => import("react/jsx-runtime").JSX.Element;
import { ReactNode } from 'react';
export declare const SmoothCheckbox: ({ children, ...restProps }: {
children: ReactNode;
}) => import("react/jsx-runtime").JSX.Element;
export declare const IconMobile: ({ className, prefixClass, onClick, style, value }: {
className?: Array<any> | string;
prefixClass?: string;
style?: Object;
value: string;
onClick?: Function;
}) => import("react/jsx-runtime").JSX.Element;
export declare const Image: import("react").MemoExoticComponent<({ src, errorImg, ...props }: {
[x: string]: any;
src: any;
errorImg?: string | undefined;
}) => import("react/jsx-runtime").JSX.Element | null>;
export declare function useImage(src: string): {
srcPath: string;
loading: boolean;
error: any;
};
export * from './swiper';
export * from './scrollView';
export * from './scrollViewX';
export * from './loading';
export * from './tabs';
export * from './popup';
export * from './numStep';
export * from './iconMobile';
export * from './radio';
export * from './radioGroup';
export * from './checkbox';
export * from './checkboxGroup';
export * from './wrapLoading';
export * from './noticeBar';
export * from './smoothView';
export * from './smoothText';
export * from './image';
export declare function Loading({ text }: {
text?: string;
}): import("react/jsx-runtime").JSX.Element;
interface NoticebarInterface {
content: Array<string>;
speed?: number;
fontSize?: number;
icon?: string;
color: string;
direction?: 'horizontal' | 'vertical';
navigator?: (e: number) => void;
}
export declare const NoticeBar: import("react").NamedExoticComponent<NoticebarInterface>;
export {};
import React from 'react';
interface numStepType {
count: number;
handleStep: (e: string) => void;
}
export declare const NumStep: React.FC<numStepType>;
export {};
import React, { Dispatch, ReactNode } from 'react';
interface PopupInterface {
popupVisible: boolean;
popupHandler: Dispatch<boolean>;
children: ReactNode;
}
export declare const Popup: React.FC<PopupInterface>;
export {};
import { ReactNode } from 'react';
export declare const Radio: ({ children, ...restProps }: {
children: ReactNode;
}) => import("react/jsx-runtime").JSX.Element;
import { ReactNode } from 'react';
export declare const SmoothRadio: ({ children, ...restProps }: {
children: ReactNode;
}) => import("react/jsx-runtime").JSX.Element;
import { ReactNode } from 'react';
interface ScrollViewType {
Threshold?: number;
scrollTop?: number;
children: ReactNode;
onScroll?: (e: any) => void;
}
export declare const ScrollView: import("react").NamedExoticComponent<ScrollViewType>;
export {};
import { ReactNode } from 'react';
interface ScrollViewType {
Threshold?: number;
scrollTop?: number;
children: ReactNode;
onScroll?: (e: any) => void;
}
export declare const ScrollViewX: import("react").NamedExoticComponent<ScrollViewType>;
export {};
import { ReactNode } from 'react';
interface PropsView {
children: ReactNode;
[v: string]: unknown;
}
export declare const SmoothText: import("react").MemoExoticComponent<({ children, ...props }: PropsView) => import("react/jsx-runtime").JSX.Element>;
export {};
import { ReactNode } from 'react';
interface PropsView {
children: ReactNode;
[v: string]: unknown;
}
export declare const SmoothView: import("react").MemoExoticComponent<({ children, ...props }: PropsView) => import("react/jsx-runtime").JSX.Element>;
export {};
interface SwiperType<T> {
indicatorDots?: boolean;
direction?: 'horizontal' | 'vertical';
autoplayInterval: number;
loop?: boolean;
type: number;
render: Function;
style: {
[v: string]: unknown;
};
data: Array<T>;
imgHeight: {
height: number;
width: number;
};
[v: string]: unknown;
}
export declare function SmoothSwiper<T>({ indicatorDots, direction, autoplayInterval, loop, data, type, render, style, imgHeight, autoplay, ...props }: SwiperType<T>): import("react/jsx-runtime").JSX.Element;
export {};
import { TabsHeaderType } from '../index';
declare const TabsHeader: React.FC<TabsHeaderType>;
export default TabsHeader;
import React, { ReactNode } from 'react';
interface TabsType {
tabs: Array<TabItemType>;
render: (item: TabItemType) => ReactNode;
defaultIndex: number;
activeColor?: string;
}
export interface TabsHeaderType {
tabs: Array<TabItemType>;
onChange: (e: number, item: TabItemType) => void;
actived: number;
activeColor?: string;
}
export interface TabItemType {
name: string;
code: string;
}
export declare const Tabs: React.FC<TabsType>;
export {};
import { ReactNode } from 'react';
interface PropsText {
children?: ReactNode;
[v: string]: unknown;
}
export declare const Text: ({ children, ...props }: PropsText) => import("react/jsx-runtime").JSX.Element;
export {};
import { ReactNode } from 'react';
interface Props {
children?: ReactNode | undefined;
[v: string]: unknown;
}
export declare const View: ({ children, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
export {};
import { ReactNode } from 'react';
export declare function WrapLoading({ loading, children }: {
loading: boolean;
children?: ReactNode;
}): import("react/jsx-runtime").JSX.Element;
export declare function useImmutableCallback(callback: any): (...args: any) => any;
export declare function useLazyRef(getInitialValue: Function, initialValues?: any): import("react").MutableRefObject<any>;
export * from './basic';
export * from './useComponent';
export * from './useImageHeight';
import { ComponentType } from '@/utils/type';
import * as appendComponent from '../components';
type simulateType = ComponentType & typeof appendComponent;
export declare function useComponent(): simulateType;
export {};
export declare function useImageHeight(type: number, widthHeight?: {
height: number;
width: number;
}, defaultValue?: string): string;
export * from './components';
export * from './hooks';
export * as antdMobile from 'antd-mobile';
import { ComponentType } from '@/utils/type';
export declare function useLocal(): ComponentType;
export declare function fetchResource(): {
read(): any;
};
export * from './fetchResource';
import * as Component from '@tarojs/components';
import * as ComponentWeb from 'antd-mobile';
export type ComponentType = typeof ComponentWeb & typeof Component;
+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 g from"classnames";import{isEmpty as f,isFunction as b,noop as v}from"lodash-es";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:g,autoplay:f}=t,b=w(t,["indicatorDots","direction","autoplayInterval","loop","data","type","render","style","imgHeight","autoplay"]);const[v,y]=r(f),[j,S]=r(0),{Swiper:x,SwiperItem:O,Skeleton:T}=N(),C=o(()=>d(),[]),E=o(()=>C?x:h,[C]),I=o(()=>C?O:h.Item,[C]),W=k(u,g),z=o(()=>C?{vertical:"horizontal"!==l,interval:c,indicatorColor:"#999",circular:!0,indicatorActiveColor:"#333",indicatorDots:i}:{direction:l,autoplayInterval:c,loop:a},[l,c,a,i,C]);return e(n,{children:s.length>0?e(E,Object.assign({},z,b,{style:Object.assign(Object.assign({},m),{height:W}),autoplay:v,onChange:e=>{if(C){const{current:n}=e.detail;S(n),n!==s.length-1||a?y(f):y(!1)}},children:s.map((n,t)=>e(I,{children:p(n,j,t)},t))})):e(T,{animated:!0,style:{"--width":"100%","--height":W}})})}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:g({"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:g(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(()=>l&&"WEB"!==l.getEnv()?i:u,[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(()=>l&&"WEB"!==l.getEnv()?i:null==u?void 0:u.Group,[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(()=>l&&"WEB"!==l.getEnv()?i:p,[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(()=>l&&"WEB"!==l.getEnv()?i:null==p?void 0:p.Group,[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:g}=N(),[f,b]=r({}),v=o(()=>`animElemId${Math.ceil(1e6*Math.random()).toString(36)}`,[]),w="horizontal"===u?"scroll-animate":"normal",y=o(()=>a.toString().length,[a]),j=o(()=>"horizontal"===u?1e3:350,[u]),S=o(()=>{const e=d();return e&&"WEB"!==e.getEnv()},[]),x=o(()=>{switch(u){case"horizontal":return 15*y;case"vertical":return"100%"}},[u,y]);return i(()=>{if(!S)return;const e=d();let n="";const t=setTimeout(()=>{e.createSelectorQuery().select(`#${v}`).boundingClientRect(t=>{const{width:r,height:o}=t||{},i=(e=>{if(!S)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*j,timingFunction:"linear"}),t=e.createAnimation({duration:0,timingFunction:"linear"}),c=()=>{setTimeout(()=>{t.translateX(r/i).step(),b(t.export())},l*j+200),setTimeout(()=>{n.translateX(-r).step(),b(n.export())},100)};switch(u){case"horizontal":default:c();break;case"vertical":setTimeout(()=>{t.translateY(o/a.length).step(),b(t.export())},l*j+200),setTimeout(()=>{n.translateY(-o).step(),b(n.export())},100)}};c(),n=setInterval(c,l*j+300)}).exec()},1e3);return()=>{clearTimeout(t),clearInterval(n)}},[a,j,u,v,S,s]),e(n,{children:S?t(m,{id:"noticebar-wrap",children:[e(m,{className:"icon-pre",children:e(V,{style:{fontSize:20,fontWeight:600},value:h})}),e(m,{animation:f,id:v,children:e(m,{style:{width:x},className:w,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]})})}),$=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=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){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=b(e)?e:v,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(()=>f(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,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(()=>l&&"WEB"!==l.getEnv()?i:u,[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(()=>l&&"WEB"!==l.getEnv()?i:null==u?void 0:u.Group,[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(()=>l&&"WEB"!==l.getEnv()?i:p,[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(()=>l&&"WEB"!==l.getEnv()?i:null==p?void 0:p.Group,[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};
{
"name": "@brushes/simulate-component",
"version": "0.3.94",
"version": "0.3.95",
"description": "'组件库'",

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