taro-react-uilib 1.4.31 → 1.4.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Collapse/index.js +1 -1
- package/dist/components/Collapse/index.js.map +1 -1
- package/dist/components/Radio/Group/index.js +1 -1
- package/dist/components/Radio/Group/index.js.map +1 -1
- package/dist/components/Radio/index.js +1 -1
- package/dist/components/Radio/index.js.map +1 -1
- package/dist/components/Tabbar/tabbar/Tabbar.js +1 -1
- package/dist/components/Tabbar/tabbar/Tabbar.js.map +1 -1
- package/dist/index.esm.js +6 -6
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/styles/components/tabbar.scss +29 -6
- package/package.json +1 -1
- package/types/components/Radio/Group/index.d.ts +1 -0
- package/types/components/Tabbar/tabbar/Tabbar.d.ts +2 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__read as
|
|
1
|
+
import{__rest as e,__read as a,__assign as r}from"../node_modules/tslib/tslib.es6.js";import o,{useRef as t,useState as l,useMemo as s}from"react";import n from"../List/index.js";import{View as c}from"@tarojs/components";import m from"classnames";var i=function(i){var d=i.summary,u=void 0===d?"":d,p=i.children,h=i.open,v=void 0!==h&&h;i.arrow;var f=i.className,y=i.style,T=i.onToggle,g=i.dataTrackId,k=void 0===g?"collapse":g,N=e(i,["summary","children","open","arrow","className","style","onToggle","dataTrackId"]),x=t(null),E=a(l(v),2),I=E[0],_=E[1],b=s((function(){var e,a,r={height:0};return I&&(r.height="h5"===process.env.TARO_ENV?"".concat(null===(e=x.current)||void 0===e?void 0:e.scrollHeight,"px"):"auto"),"h5"===process.env.TARO_ENV&&I&&(null===(a=x.current)||void 0===a||a.scrollIntoView({behavior:"smooth",block:"end",inline:"nearest"})),null==T||T(I),r}),[I]);return o.createElement(c,{className:m("xh-collapse",f),style:y,dataTrackId:k},o.createElement(c,{dataTrackId:"".concat(k,"_summary"),className:m("xh-collapse-summary",{open:I}),onClick:function(){_((function(e){return!e}))}},u||o.createElement(n,r({},N,{arrow:!0,dataTrackId:"".concat(k,"_summary_list")}))),o.createElement(c,{className:m("xh-collapse-detail"),ref:x,style:b},p))};export{i as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Collapse/index.tsx"],"sourcesContent":["import React, { ReactNode, useMemo, useRef, useState } from \"react\";\nimport List from \"@/components/List\";\nimport { View } from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport type { XHListProps } from \"../List\";\n\nimport \"./index.scss\";\n\nexport type CollapseProps = {\n summary?: string | ReactNode;\n open?: boolean;\n style?: React.CSSProperties;\n onToggle?: (open: boolean) => void;\n dataTrackId?: string;\n} & XHListProps;\n\nconst Collapse: React.FC<CollapseProps> = props => {\n const {\n summary = \"\",\n children,\n open = false,\n arrow,\n className,\n style,\n onToggle,\n dataTrackId = \"collapse\",\n ...rest\n } = props;\n const detailRef = useRef<HTMLDivElement>(null);\n const [innerOpen, setInneropen] = useState(open);\n const handleOnchange = () => {\n setInneropen(old => !old);\n };\n\n const detailStyle = useMemo(() => {\n const style: React.CSSProperties = { height: 0 };\n if (innerOpen)\n style.height =\n process.env.TARO_ENV === \"h5\"\n ? `${detailRef.current?.scrollHeight}px`\n : \"auto\";\n process.env.TARO_ENV === \"h5\" &&\n innerOpen &&\n detailRef.current?.scrollIntoView({\n behavior: \"smooth\",\n block: \"end\",\n inline: \"nearest\",\n });\n onToggle?.(innerOpen);\n return style;\n }, [innerOpen]);\n\n return (\n <View\n className={classNames(\"xh-collapse\", className)}\n style={style}\n // @ts-ignore\n dataTrackId={dataTrackId}\n >\n <View\n // @ts-ignore\n dataTrackId={`${dataTrackId}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Collapse/index.tsx"],"sourcesContent":["import React, { ReactNode, useMemo, useRef, useState } from \"react\";\nimport List from \"@/components/List\";\nimport { View } from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport type { XHListProps } from \"../List\";\n\nimport \"./index.scss\";\n\nexport type CollapseProps = {\n summary?: string | ReactNode;\n open?: boolean;\n style?: React.CSSProperties;\n onToggle?: (open: boolean) => void;\n dataTrackId?: string;\n} & XHListProps;\n\nconst Collapse: React.FC<CollapseProps> = props => {\n const {\n summary = \"\",\n children,\n open = false,\n arrow,\n className,\n style,\n onToggle,\n dataTrackId = \"collapse\",\n ...rest\n } = props;\n const detailRef = useRef<HTMLDivElement>(null);\n const [innerOpen, setInneropen] = useState(open);\n const handleOnchange = () => {\n setInneropen(old => !old);\n };\n\n const detailStyle = useMemo(() => {\n const style: React.CSSProperties = { height: 0 };\n if (innerOpen)\n style.height =\n process.env.TARO_ENV === \"h5\"\n ? `${detailRef.current?.scrollHeight}px`\n : \"auto\";\n process.env.TARO_ENV === \"h5\" &&\n innerOpen &&\n detailRef.current?.scrollIntoView({\n behavior: \"smooth\",\n block: \"end\",\n inline: \"nearest\",\n });\n onToggle?.(innerOpen);\n return style;\n }, [innerOpen]);\n\n return (\n <View\n className={classNames(\"xh-collapse\", className)}\n style={style}\n // @ts-ignore\n dataTrackId={dataTrackId}\n >\n <View\n // @ts-ignore\n dataTrackId={`${dataTrackId}_summary`}\n className={classNames(\"xh-collapse-summary\", { open: innerOpen })}\n onClick={handleOnchange}\n >\n {summary || (\n <List {...rest} arrow dataTrackId={`${dataTrackId}_summary_list`} />\n )}\n </View>\n <View\n className={classNames(\"xh-collapse-detail\")}\n ref={detailRef}\n style={detailStyle}\n >\n {children}\n </View>\n </View>\n );\n};\n\nexport default Collapse;\n"],"names":["Collapse","props","_a","summary","children","_b","open","arrow","className","style","onToggle","_c","dataTrackId","rest","__rest","detailRef","useRef","_d","__read","useState","innerOpen","setInneropen","detailStyle","useMemo","height","process","env","TARO_ENV","current","scrollHeight","scrollIntoView","behavior","block","inline","React","createElement","View","classNames","concat","onClick","old","List","ref"],"mappings":"uPAgBM,IAAAA,EAAoC,SAAAC,GAEtC,IAAAC,EASED,EAAKE,QATPA,OAAU,IAAAD,EAAA,GAAEA,EACZE,EAQEH,EAAKG,SAPPC,EAOEJ,EAAKK,KAPPA,OAAO,IAAAD,GAAKA,EAOVJ,EAAKM,MALP,IAAAC,EAKEP,EAAKO,UAJPC,EAIER,EAJGQ,MACLC,EAGET,EAAKS,SAFPC,EAEEV,EAAKW,YAFPA,OAAc,IAAAD,EAAA,WAAUA,EACrBE,EAAIC,EACLb,EAVE,CAUL,UAAA,WAAA,OAAA,QAAA,YAAA,QAAA,WAAA,gBACKc,EAAYC,EAAuB,MACnCC,EAAAC,EAA4BC,EAASb,GAAK,GAAzCc,EAASH,EAAA,GAAEI,OAKZC,EAAcC,GAAQ,mBACpBd,EAA6B,CAAEe,OAAQ,GAc7C,OAbIJ,IACFX,EAAMe,OACqB,OAAzBC,QAAQC,IAAIC,SACR,UAAoB,QAAjBzB,EAAAa,EAAUa,eAAO,IAAA1B,OAAA,EAAAA,EAAE2B,aAAgB,MACtC,QACiB,OAAzBJ,QAAQC,IAAIC,UACVP,IACiB,QAAjBf,EAAAU,EAAUa,eAAO,IAAAvB,GAAAA,EAAEyB,eAAe,CAChCC,SAAU,SACVC,MAAO,MACPC,OAAQ,aAEZvB,SAAAA,EAAWU,GACJX,CACT,GAAG,CAACW,IAEJ,OACEc,EAAAC,cAACC,EAAI,CACH5B,UAAW6B,EAAW,cAAe7B,GACrCC,MAAOA,EAEPG,YAAaA,GAEbsB,EAAAC,cAACC,GAECxB,YAAa,GAAG0B,OAAA1B,EAAqB,YACrCJ,UAAW6B,EAAW,sBAAuB,CAAE/B,KAAMc,IACrDmB,QAjCiB,WACrBlB,GAAa,SAAAmB,GAAO,OAACA,CAAG,GAC1B,GAiCOrC,GACC+B,EAACC,cAAAM,OAAS5B,EAAI,CAAEN,OAAK,EAACK,YAAa,GAAA0B,OAAG1B,EAA0B,qBAGpEsB,EAACC,cAAAC,GACC5B,UAAW6B,EAAW,sBACtBK,IAAK3B,EACLN,MAAOa,GAENlB,GAIT"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__rest as e,__read as
|
|
1
|
+
import{__rest as e,__read as a,__assign as r,__spreadArray as n}from"../../node_modules/tslib/tslib.es6.js";import o,{useMemo as t,useState as d,useEffect as i}from"react";import c from"classnames";import{eventCenter as l}from"@tarojs/taro";import s from"../index.js";var u=function(u){var m=u.option,p=u.onChange,h=u.name,f=u.padding,k=u.border,v=u.radioStyle,g=u.defaultChecked,b=u.inline,y=u.style,C=u.checkedClass,x=void 0===C?"":C,T=u.dataTrackId,_=void 0===T?"RadioGroup":T,j=e(u,["option","onChange","name","padding","border","radioStyle","defaultChecked","inline","style","checkedClass","dataTrackId"]),E=t((function(){return null==m?void 0:m.map((function(e){return"string"==typeof e?{label:e,value:e,checked:g===e}:(g===e.value&&(e.checked=!0),e)}))}),[m,g]),I=a(d(E),2),N=I[0],R=I[1];i((function(){R(E)}),[E]);var S=c("xh-radio-group",{padding:f},{border:k},{inline:b});return o.createElement("div",{className:S,style:y},E.map((function(e,t){var d;return o.createElement(s,r({dataTrackId:"".concat(_,"_option_").concat(t),label:e.label,value:e.value,disabled:e.disabled,name:h,key:t,className:c("xh-radio-group-list",(d={},d[x]=e.checked,d)),circle:!0,onChange:function(){return function(e){for(var r=n([],a(N),!1),o="",t=0;t<r.length;t++)t===e?(r[t].checked=!0,o=r[t].value):r[t].checked=!1;R(r),null==p||p(o),"h5"!==process.env.TARO_ENV&&l.trigger("radioChange",e)}(t)},checked:e.checked,style:v,index:t,group:!0},j))})))};export{u as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/Radio/Group/index.tsx"],"sourcesContent":["import React, { useMemo, useState, ReactNode, useEffect } from \"react\";\nimport classNames from \"classnames\";\nimport { eventCenter } from \"@tarojs/taro\";\n\nimport Radio from \"..\";\n\nexport type RadioItemType = {\n label: string | ReactNode;\n value: string;\n disabled?: boolean;\n checked?: boolean;\n};\nexport type RadioItem = RadioItemType | string;\nexport type RadioGroupProps = {\n option: RadioItem[];\n onChange?: (value: string | number) => void;\n name: string;\n circle?: boolean;\n align?: \"center\" | \"end\";\n direction?: \"rtl\";\n justify?: \"around\" | \"between\";\n id?: string;\n padding?: true;\n border?: boolean;\n style?: React.CSSProperties;\n radioStyle?: React.CSSProperties;\n defaultChecked?: string | number;\n color?: string;\n inline?: boolean;\n size?: number;\n fancy?: boolean;\n checkedClass?: string;\n};\n\nconst RadioGroup: React.FC<RadioGroupProps> = props => {\n const {\n option,\n onChange,\n name,\n padding,\n border,\n radioStyle,\n defaultChecked,\n inline,\n style,\n checkedClass = \"\",\n ...rest\n } = props;\n\n let getOpions = useMemo(() => {\n return option?.map(item => {\n if (typeof item === \"string\") {\n return {\n label: item,\n value: item,\n checked: defaultChecked === item,\n };\n } else {\n if (defaultChecked === item.value) {\n item.checked = true;\n }\n return item;\n }\n });\n }, [option, defaultChecked]);\n\n const [innerOptions, setInnerOptions] = useState(getOpions);\n\n useEffect(() => {\n setInnerOptions(getOpions);\n }, [getOpions]);\n\n const handleChange = idx => {\n let newoption = [...innerOptions];\n let newValue = \"\";\n for (let index = 0; index < newoption.length; index++) {\n if (index === idx) {\n newoption[index].checked = true;\n newValue = newoption[index].value;\n } else {\n newoption[index].checked = false;\n }\n }\n setInnerOptions(newoption);\n onChange?.(newValue);\n if (process.env.TARO_ENV !== \"h5\") {\n eventCenter.trigger(\"radioChange\", idx);\n }\n };\n\n const cls = classNames(\"xh-radio-group\", { padding }, { border }, { inline });\n\n return (\n <div className={cls} style={style}>\n {getOpions.map((item, index) => {\n return (\n <Radio\n label={item.label}\n value={item.value}\n disabled={item.disabled}\n name={name}\n key={index}\n className={classNames(\"xh-radio-group-list\", {\n [checkedClass]: item.checked,\n })}\n circle\n onChange={() => handleChange(index)}\n checked={item.checked}\n style={radioStyle}\n index={index}\n group\n {...rest}\n />\n );\n })}\n </div>\n );\n};\n\nexport default RadioGroup;\n"],"names":["RadioGroup","props","option","onChange","name","padding","border","radioStyle","defaultChecked","inline","style","_a","checkedClass","rest","__rest","getOpions","useMemo","map","item","label","value","checked","
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/Radio/Group/index.tsx"],"sourcesContent":["import React, { useMemo, useState, ReactNode, useEffect } from \"react\";\nimport classNames from \"classnames\";\nimport { eventCenter } from \"@tarojs/taro\";\n\nimport Radio from \"..\";\n\nexport type RadioItemType = {\n label: string | ReactNode;\n value: string;\n disabled?: boolean;\n checked?: boolean;\n};\nexport type RadioItem = RadioItemType | string;\nexport type RadioGroupProps = {\n option: RadioItem[];\n onChange?: (value: string | number) => void;\n name: string;\n circle?: boolean;\n align?: \"center\" | \"end\";\n direction?: \"rtl\";\n justify?: \"around\" | \"between\";\n id?: string;\n padding?: true;\n border?: boolean;\n style?: React.CSSProperties;\n radioStyle?: React.CSSProperties;\n defaultChecked?: string | number;\n color?: string;\n inline?: boolean;\n size?: number;\n fancy?: boolean;\n checkedClass?: string;\n dataTrackId?: string;\n};\n\nconst RadioGroup: React.FC<RadioGroupProps> = props => {\n const {\n option,\n onChange,\n name,\n padding,\n border,\n radioStyle,\n defaultChecked,\n inline,\n style,\n checkedClass = \"\",\n dataTrackId = \"RadioGroup\",\n ...rest\n } = props;\n\n let getOpions = useMemo(() => {\n return option?.map(item => {\n if (typeof item === \"string\") {\n return {\n label: item,\n value: item,\n checked: defaultChecked === item,\n };\n } else {\n if (defaultChecked === item.value) {\n item.checked = true;\n }\n return item;\n }\n });\n }, [option, defaultChecked]);\n\n const [innerOptions, setInnerOptions] = useState(getOpions);\n\n useEffect(() => {\n setInnerOptions(getOpions);\n }, [getOpions]);\n\n const handleChange = idx => {\n let newoption = [...innerOptions];\n let newValue = \"\";\n for (let index = 0; index < newoption.length; index++) {\n if (index === idx) {\n newoption[index].checked = true;\n newValue = newoption[index].value;\n } else {\n newoption[index].checked = false;\n }\n }\n setInnerOptions(newoption);\n onChange?.(newValue);\n if (process.env.TARO_ENV !== \"h5\") {\n eventCenter.trigger(\"radioChange\", idx);\n }\n };\n\n const cls = classNames(\"xh-radio-group\", { padding }, { border }, { inline });\n\n return (\n <div className={cls} style={style}>\n {getOpions.map((item, index) => {\n return (\n <Radio\n dataTrackId={`${dataTrackId}_option_${index}`}\n label={item.label}\n value={item.value}\n disabled={item.disabled}\n name={name}\n key={index}\n className={classNames(\"xh-radio-group-list\", {\n [checkedClass]: item.checked,\n })}\n circle\n onChange={() => handleChange(index)}\n checked={item.checked}\n style={radioStyle}\n index={index}\n group\n {...rest}\n />\n );\n })}\n </div>\n );\n};\n\nexport default RadioGroup;\n"],"names":["RadioGroup","props","option","onChange","name","padding","border","radioStyle","defaultChecked","inline","style","_a","checkedClass","_b","dataTrackId","rest","__rest","getOpions","useMemo","map","item","label","value","checked","_c","__read","useState","innerOptions","setInnerOptions","useEffect","cls","classNames","React","createElement","className","index","Radio","concat","disabled","key","circle","idx","newoption","__spreadArray","newValue","length","process","env","TARO_ENV","eventCenter","trigger","handleChange","group"],"mappings":"4QAmCM,IAAAA,EAAwC,SAAAC,GAE1C,IAAAC,EAYED,EAAKC,OAXPC,EAWEF,EAAKE,SAVPC,EAUEH,OATFI,EASEJ,EATKI,QACPC,EAQEL,EARIK,OACNC,EAOEN,EAAKM,WANPC,EAMEP,EAAKO,eALPC,EAKER,EALIQ,OACNC,EAIET,EAJGS,MACLC,EAGEV,EAHeW,aAAjBA,OAAe,IAAAD,EAAA,GAAEA,EACjBE,EAEEZ,EAFwBa,YAA1BA,OAAc,IAAAD,EAAA,aAAYA,EACvBE,EACDC,EAAAf,EAbE,CAAA,SAAA,WAAA,OAAA,UAAA,SAAA,aAAA,iBAAA,SAAA,QAAA,eAAA,gBAeFgB,EAAYC,GAAQ,WACtB,OAAOhB,aAAM,EAANA,EAAQiB,KAAI,SAAAC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es6.js";import a,{useState as o,useEffect as
|
|
1
|
+
import{__read as e}from"../node_modules/tslib/tslib.es6.js";import a,{useState as o,useEffect as t}from"react";import i from"classnames";import{eventCenter as r}from"@tarojs/taro";import{View as n}from"@tarojs/components";import s from"../src/hooks/useGenerateId.js";import{pxTransform as c}from"../src/utils/index.js";import l from"./Group/index.js";import d from"../Icon/index.js";var m=function(l){var m=l.className,u=l.name,h=l.label,p=l.id,f=l.circle,v=void 0===f||f,x=l.onChange,N=l.align,E=l.direction,k=l.justify,g=l.checked,y=l.disabled,b=l.value,j=l.style,C=l.size,F=void 0===C?0:C,T=l.fancy,_=void 0!==T&&T,A=l.index,I=void 0===A?0:A,O=l.group,R=void 0!==O&&O,V=l.iconColor,z=void 0===V?"#FFFFFF":V,G=l.dataTrackId,w=s(p,"xh-radio-id"),q=e(o(g),2),B=q[0],D=q[1],H=function(e){"h5"!==process.env.TARO_ENV&&e!==I&&D(!1)};t((function(){return"h5"!==process.env.TARO_ENV&&r.on("radioChange",H),function(){r.off("radioChange",H)}}),[]);var J=i("xh-radio",m,N,E,k);return"h5"!==process.env.TARO_ENV?a.createElement(n,{dataTrackId:G,onClick:function(){B&&R||(D(!B),null==x||x(!B,b||""))},className:J,style:j},a.createElement(n,{className:i("xh-radio-input",{checked:B})}),a.createElement("span",{style:F>0?{width:c(F),height:c(F)}:{},className:i("xh-radio-input-fake",v&&"circle",{fancy:_})},a.createElement(d,{icon:"duigou",className:"xh-radio-input-fake-icon",color:z,size:F?.55*F:18})),a.createElement("span",{className:"xh-radio-label"},h)):a.createElement("label",{htmlFor:w,className:J,"data-track-id":G,style:j},a.createElement("input",{type:"radio",id:w,name:u,className:"xh-radio-input",onChange:function(e){var a=g||!1,o="";"h5"===process.env.TARO_ENV?(a=e.target.checked,o=e.target.value):(a=e.detail.value,o=e.detail.value),null==x||x(a,o)},value:b,disabled:y,defaultChecked:g}),a.createElement("span",{style:F>0?{width:c(F),height:c(F)}:{},className:i("xh-radio-input-fake",{circle:v,fancy:_})},a.createElement(d,{icon:"duigou",className:"xh-radio-input-fake-icon",color:z,size:F?.55*F:18})),a.createElement("span",{className:"xh-radio-label"},h))};m.Group=l;export{m as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/Radio/index.tsx"],"sourcesContent":["import React, { FC, ReactNode, useState, useEffect } from \"react\";\nimport classNames from \"classnames\";\nimport { eventCenter } from \"@tarojs/taro\";\nimport { View } from \"@tarojs/components\";\nimport useGenerateId from \"@/hooks/useGenerateId\";\nimport { pxTransform } from \"@/utils\";\n\nimport Group from \"./Group\";\nimport type { XHComponentCommonProps } from \"../../types\";\nimport Icon from \"../Icon\";\n\nimport \"./index.scss\";\n\ntype CompoundedComponent = React.ForwardRefExoticComponent<\n XHRadioProps & React.RefAttributes<HTMLInputElement>\n> & {\n Group: typeof Group;\n};\n\nexport type XHRadioProps = {\n onChange?: (check: boolean, value: string | number) => void;\n checked?: boolean;\n name?: string;\n label: string | ReactNode;\n size?: number;\n circle?: boolean;\n align?: \"center\" | \"end\";\n direction?: \"rtl\";\n justify?: \"around\" | \"between\";\n value?: string | number;\n id?: string;\n disabled?: boolean;\n style?: React.CSSProperties;\n fancy?: boolean;\n index?: number;\n /**\n * 抖音不支持属性选择器\n * @description 主要为抖音支持颜色\n */\n color?: string;\n group?: boolean;\n /**\n * 选中状态下打勾icon的颜色\n */\n iconColor?: string;\n dataTrackId?: string;\n} & XHComponentCommonProps;\n\nconst XHRadio: FC<XHRadioProps> = props => {\n const {\n className,\n name,\n label,\n id,\n circle = true,\n onChange,\n align,\n direction,\n justify,\n checked,\n disabled,\n value,\n style,\n size = 0,\n fancy = false,\n index = 0,\n group = false,\n iconColor = \"#FFFFFF\",\n dataTrackId,\n } = props;\n\n const finalId = useGenerateId(id, \"xh-radio-id\");\n\n const [innerChecked, setInnerChecked] = useState(checked);\n\n const resetChecked = idx => {\n if (process.env.TARO_ENV !== \"h5\" && idx !== index) {\n setInnerChecked(false);\n }\n };\n\n useEffect(() => {\n if (process.env.TARO_ENV !== \"h5\") {\n eventCenter.on(\"radioChange\", resetChecked);\n }\n\n return () => {\n eventCenter.off(\"radioChange\", resetChecked);\n };\n }, []);\n\n const handleOnchange = e => {\n let finalchecked = checked || false;\n let value = \"\";\n\n if (process.env.TARO_ENV === \"h5\") {\n finalchecked = e.target.checked;\n value = e.target.value;\n } else {\n finalchecked = e.detail.value;\n\n value = e.detail.value;\n }\n\n onChange?.(finalchecked, value);\n };\n\n const handleFakeChange = () => {\n if (innerChecked && group) return;\n setInnerChecked(!innerChecked);\n onChange?.(!innerChecked, value || \"\");\n };\n\n const cls = classNames(\"xh-radio\", className, align, direction, justify);\n if (process.env.TARO_ENV !== \"h5\") {\n return (\n <View onClick={handleFakeChange}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/Radio/index.tsx"],"sourcesContent":["import React, { FC, ReactNode, useState, useEffect } from \"react\";\nimport classNames from \"classnames\";\nimport { eventCenter } from \"@tarojs/taro\";\nimport { View } from \"@tarojs/components\";\nimport useGenerateId from \"@/hooks/useGenerateId\";\nimport { pxTransform } from \"@/utils\";\n\nimport Group from \"./Group\";\nimport type { XHComponentCommonProps } from \"../../types\";\nimport Icon from \"../Icon\";\n\nimport \"./index.scss\";\n\ntype CompoundedComponent = React.ForwardRefExoticComponent<\n XHRadioProps & React.RefAttributes<HTMLInputElement>\n> & {\n Group: typeof Group;\n};\n\nexport type XHRadioProps = {\n onChange?: (check: boolean, value: string | number) => void;\n checked?: boolean;\n name?: string;\n label: string | ReactNode;\n size?: number;\n circle?: boolean;\n align?: \"center\" | \"end\";\n direction?: \"rtl\";\n justify?: \"around\" | \"between\";\n value?: string | number;\n id?: string;\n disabled?: boolean;\n style?: React.CSSProperties;\n fancy?: boolean;\n index?: number;\n /**\n * 抖音不支持属性选择器\n * @description 主要为抖音支持颜色\n */\n color?: string;\n group?: boolean;\n /**\n * 选中状态下打勾icon的颜色\n */\n iconColor?: string;\n dataTrackId?: string;\n} & XHComponentCommonProps;\n\nconst XHRadio: FC<XHRadioProps> = props => {\n const {\n className,\n name,\n label,\n id,\n circle = true,\n onChange,\n align,\n direction,\n justify,\n checked,\n disabled,\n value,\n style,\n size = 0,\n fancy = false,\n index = 0,\n group = false,\n iconColor = \"#FFFFFF\",\n dataTrackId,\n } = props;\n\n const finalId = useGenerateId(id, \"xh-radio-id\");\n\n const [innerChecked, setInnerChecked] = useState(checked);\n\n const resetChecked = idx => {\n if (process.env.TARO_ENV !== \"h5\" && idx !== index) {\n setInnerChecked(false);\n }\n };\n\n useEffect(() => {\n if (process.env.TARO_ENV !== \"h5\") {\n eventCenter.on(\"radioChange\", resetChecked);\n }\n\n return () => {\n eventCenter.off(\"radioChange\", resetChecked);\n };\n }, []);\n\n const handleOnchange = e => {\n let finalchecked = checked || false;\n let value = \"\";\n\n if (process.env.TARO_ENV === \"h5\") {\n finalchecked = e.target.checked;\n value = e.target.value;\n } else {\n finalchecked = e.detail.value;\n\n value = e.detail.value;\n }\n\n onChange?.(finalchecked, value);\n };\n\n const handleFakeChange = () => {\n if (innerChecked && group) return;\n setInnerChecked(!innerChecked);\n onChange?.(!innerChecked, value || \"\");\n };\n\n const cls = classNames(\"xh-radio\", className, align, direction, justify);\n if (process.env.TARO_ENV !== \"h5\") {\n return (\n <View\n // @ts-ignore\n dataTrackId={dataTrackId}\n onClick={handleFakeChange}\n className={cls}\n style={style}\n >\n <View\n className={classNames(\"xh-radio-input\", {\n checked: innerChecked,\n })}\n />\n <span\n style={\n size > 0\n ? {\n width: pxTransform(size),\n height: pxTransform(size),\n }\n : {}\n }\n className={classNames(\"xh-radio-input-fake\", circle && \"circle\", {\n fancy,\n })}\n >\n <Icon\n icon=\"duigou\"\n className=\"xh-radio-input-fake-icon\"\n color={iconColor}\n size={size ? size * 0.55 : 18}\n />\n </span>\n <span className=\"xh-radio-label\">{label}</span>\n </View>\n );\n }\n\n return (\n <label\n htmlFor={finalId}\n className={cls}\n data-track-id={dataTrackId}\n style={style}\n >\n <input\n type=\"radio\"\n id={finalId}\n name={name}\n className=\"xh-radio-input\"\n onChange={handleOnchange}\n value={value}\n disabled={disabled}\n defaultChecked={checked}\n />\n <span\n style={\n size > 0\n ? {\n width: pxTransform(size),\n height: pxTransform(size),\n }\n : {}\n }\n className={classNames(\"xh-radio-input-fake\", { circle, fancy })}\n >\n <Icon\n icon=\"duigou\"\n className=\"xh-radio-input-fake-icon\"\n color={iconColor}\n size={size ? size * 0.55 : 18}\n />\n </span>\n <span className=\"xh-radio-label\">{label}</span>\n </label>\n );\n};\n\nconst Radio = XHRadio as CompoundedComponent;\nRadio.Group = Group;\n\nexport default Radio;\n"],"names":["Radio","props","className","name","label","id","_a","circle","onChange","align","direction","justify","checked","disabled","value","style","_b","size","_c","fancy","_d","index","_e","group","_f","iconColor","dataTrackId","finalId","useGenerateId","_g","__read","useState","innerChecked","setInnerChecked","resetChecked","idx","process","env","TARO_ENV","useEffect","eventCenter","on","off","cls","classNames","React","View","onClick","createElement","width","pxTransform","height","Icon","icon","color","htmlFor","type","e","finalchecked","target","detail","defaultChecked","Group"],"mappings":"+XAgDA,IAiJMA,EAjJ4B,SAAAC,GAE9B,IAAAC,EAmBED,EAnBOC,UACTC,EAkBEF,EAAKE,KAjBPC,EAiBEH,QAhBFI,EAgBEJ,EAhBAI,GACFC,EAeEL,EAfWM,OAAbA,OAAM,IAAAD,GAAOA,EACbE,EAcEP,EAAKO,SAbPC,EAaER,EAbGQ,MACLC,EAYET,EAAKS,UAXPC,EAWEV,EAXKU,QACPC,EAUEX,EAAKW,QATPC,EASEZ,EATMY,SACRC,EAQEb,EARGa,MACLC,EAOEd,EAAKc,MANPC,EAMEf,EAAKgB,KANPA,aAAO,EAACD,EACRE,EAKEjB,EAAKkB,MALPA,OAAQ,IAAAD,GAAKA,EACbE,EAIEnB,QAJFoB,OAAQ,IAAAD,EAAA,EAACA,EACTE,EAGErB,EAHWsB,MAAb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iB,SAAAiD,GACrB,IAAIC,EAAe9C,IAAW,EAC1BE,EAAQ,GAEiB,OAAzBsB,QAAQC,IAAIC,UACdoB,EAAeD,EAAEE,OAAO/C,QACxBE,EAAQ2C,EAAEE,OAAO7C,QAEjB4C,EAAeD,EAAEG,OAAO9C,MAExBA,EAAQ2C,EAAEG,OAAO9C,OAGnBN,SAAAA,EAAWkD,EAAc5C,EAC3B,EA6DMA,MAAOA,EACPD,SAAUA,EACVgD,eAAgBjD,IAElBiC,EAAAG,cAAA,OAAA,CACEjC,MACEE,EAAO,EACH,CACEgC,MAAOC,EAAYjC,GACnBkC,OAAQD,EAAYjC,IAEtB,GAENf,UAAW0C,EAAW,sBAAuB,CAAErC,OAAMA,EAAEY,MAAKA,KAE5D0B,EAAAG,cAACI,EAAI,CACHC,KAAK,SACLnD,UAAU,2BACVoD,MAAO7B,EACPR,KAAMA,EAAc,IAAPA,EAAc,MAG/B4B,EAAMG,cAAA,OAAA,CAAA9C,UAAU,kBAAkBE,GAGxC,EAGAJ,EAAM8D,MAAQA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{__read as t}from"../../node_modules/tslib/tslib.es6.js";import e,{useState as n,useRef as a,useEffect as
|
|
1
|
+
import{__read as t}from"../../node_modules/tslib/tslib.es6.js";import e,{useState as n,useRef as a,useCallback as r,useEffect as i}from"react";import{createSelectorQuery as o}from"@tarojs/taro";import{View as l,ScrollView as c}from"@tarojs/components";import s from"classnames";import m from"./TabItem.js";var f=function(m){var f=m.children,u=void 0===f?[]:f,h=m.animated,b=void 0!==h&&h,d=m.lineColor,v=void 0===d?"#FE5E00":d,x=m.titleActiveColor,g=void 0===x?"#333":x,p=m.titleInctiveColor,C=void 0===p?"#999":p,R=m.onChange,E=m.content,N=m.selectIndex,T=void 0===N?0:N,w=m.isOverflowNav,y=void 0!==w&&w,A=t(n(0),2),k=A[0],I=A[1],B=t(n(0),2),j=B[0],X=B[1],M=t(n(0),2),O=M[0],_=M[1],V=t(n(0),2),W=V[0],F=V[1],L=a([]),q=a([]),z=a([]),D=a(null),G=a(null),H=a(null),J=function(t,e,n,a){if(!e||!y)return 0;var r=t.left-n-(e.width-t.width)/2,i=Math.max(0,a-e.width);return Math.max(0,Math.min(r,i))},K=r((function(e){var n=u.filter(Boolean);if(!(e<0||e>=n.length))if("h5"!==process.env.TARO_ENV)H.current=setTimeout((function(){var n=o();n.selectAll(".xh-tabbar-nav-item").boundingClientRect(),n.select(".xh-tabbar-nav").boundingClientRect(),n.selectAll(".xh-tabbar-content-item").boundingClientRect(),n.selectAll(".xh-tabbar-content-slot").boundingClientRect(),n.select(".xh-tabbar-nav-scroll").boundingClientRect(),n.exec((function(n){var a=t(n,5),r=a[0],i=a[1],o=a[2],l=a[3],c=a[4],s=(null==i?void 0:i.node)||i;if(r[e]&&s&&c){var m=r[e],f=i,u=m.left+m.width/2-f.left;if(_(u),y){var h=J(m,c,i.left,i.width);F(h)}}o[e]&&I(o[e].height),l[0]&&X(l[0].height)}))}),50);else{var a=L.current[e],r=z.current[0],i=q.current[e],l=null==a?void 0:a.parentElement,c=D.current;if(a&&l&&c){var s=a.getBoundingClientRect(),m=l.getBoundingClientRect(),f=c.getBoundingClientRect(),h=s.left+s.width/2-m.left;if(_(h),y){var b=J(s,f,m.left,l.offsetWidth);c.scrollTo({left:b})}}if(r){var d=r.getBoundingClientRect();X(d.height)}if(i){var v=i.getBoundingClientRect();I(v.height)}}}),[u,y]);i((function(){return K(T),function(){H.current&&clearTimeout(H.current)}}),[T,K]);return e.createElement(l,{className:"xh-tabbar"},e.createElement(c,{scrollX:!0,scrollLeft:W,className:"xh-tabbar-nav-scroll",ref:D},e.createElement(l,{className:"xh-tabbar-nav",ref:G,style:{width:y?"fit-content":"100%"}},u.map((function(t,n){return e.createElement(l,{key:n,"data-index":n,dataTrackId:t.props.dataTrackId||"xh-tabbar-nav-item-".concat(n),ref:function(t){return L.current[n]=t},className:s("xh-tabbar-nav-item",{"more-item":y}),style:{color:T===n?g:C,flex:y?"none":"1"},onClick:function(){return function(t){if(t!==T&&(K(t),R&&R(t),"h5"===process.env.TARO_ENV)){var e=o();e.selectAll(".xh-tabbar-content-item").boundingClientRect(),e.selectAll(".xh-tabbar-content-slot").boundingClientRect(),e.exec((function(e){if(e[0][t]){var n=e[0][t].height;I(n),e[1][t]&&X(e[1][t].height)}}))}}(n)}},t.props.TabItemComponent||t.props.title)})),e.createElement("div",{className:s("xh-tabbar-nav-line",{"xh-tabbar-nav-line-active":b}),style:{background:"".concat(v),transform:"translateX(".concat(O,"px) translate(-50%, -50%)"),WebkitTransform:"translateX(".concat(O,"px) translate(-50%, -50%)"),transition:b?"transform 0.3s ease":"none"}}))),e.createElement(l,{className:"xh-tabbar-content",style:{width:"".concat(100*u.length,"%"),height:k+j?"".concat(k+j,"px"):"auto"}},E&&e.createElement(l,{className:"xh-tabbar-content-slot",ref:z},E),u.map((function(t,n){return e.createElement(l,{key:n,ref:function(t){return q.current[n]=t},className:s("xh-tabbar-content-item",{"xh-tabbar-content-item-dispaly":T!==n&&!b,"xh-tabbar-content-item-active":T===n}),style:{transform:b?"translateX(-".concat(100*T,"%)"):""}},t.props.children)}))))};f.Item=m;export{f as default};
|
|
2
2
|
//# sourceMappingURL=Tabbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tabbar.js","sources":["../../../../src/components/Tabbar/tabbar/Tabbar.tsx"],"sourcesContent":["import React, {\n FC,\n ReactElement,\n useEffect,\n useState,\n ReactNode,\n useRef,\n} from \"react\";\nimport { createSelectorQuery } from \"@tarojs/taro\";\nimport { View } from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport Item from \"./TabItem\";\n\n/**\n * Tab切换\n *\n * @param children //子组件\n * @param animated //是否开启转场动画\n * @param selectIndex //默认选中第几个\n * @param lineColor //下划线颜色\n * @param titleActiveColor //标题选中态颜色\n * @param titleInctiveColor //标题默认态颜色\n * @param onChange //切换回调事件\n * @param content //item公共节点\n *\n */\n\nexport interface TabProps {\n children: ReactElement[];\n animated?: boolean;\n // initIndex?: number;\n lineColor?: string;\n titleActiveColor?: string;\n titleInctiveColor?: string;\n onChange?: (index: number) => void;\n content?: string | ReactNode;\n selectIndex: number;\n}\n\nexport interface TabsComponent<P = {}> extends FC<P> {\n Item: typeof Item;\n}\n\nconst XHTabs: TabsComponent<TabProps> = props => {\n const {\n children = [],\n animated = false,\n // initIndex = 0,\n lineColor = \"#F6AB00\",\n titleActiveColor = \"#333\",\n titleInctiveColor = \"#999\",\n onChange,\n content,\n selectIndex = 0,\n } = props;\n\n // const [selectIndex, setSelectIndex] = useState(initIndex);\n const [tabWdith, setTabWdith] = useState(0);\n const [tabContentHeight, setTabContentHeight] = useState(0);\n const [tabSlotHeight, setTabSlotHeight] = useState(0);\n\n const itemNavRef = useRef<(HTMLLIElement | null)[]>([]);\n const itemContentRef = useRef<(HTMLDivElement | null)[]>([]);\n const itemSlotRef = useRef<(HTMLDivElement | null)[]>([]);\n\n useEffect(() => {\n const timer = setTimeout(() => {\n if (process.env.TARO_ENV === \"h5\") {\n const el = itemNavRef.current[selectIndex];\n if (el) {\n const rect = el.getBoundingClientRect();\n console.log(\"el\", rect);\n setTabWdith(rect.width);\n }\n const elSlot = itemSlotRef.current[0];\n if (elSlot) {\n const rect = elSlot.getBoundingClientRect();\n console.log(\"elSlot\", rect);\n setTabSlotHeight(rect.height);\n }\n\n const elitem = itemContentRef.current[selectIndex];\n if (elitem) {\n const rect = elitem.getBoundingClientRect();\n console.log(\"elitem\", rect);\n setTabContentHeight(rect.height);\n }\n clearTimeout(timer);\n return;\n }\n\n const query = createSelectorQuery();\n query.selectAll(\".xh-tabbar-nav-item\").boundingClientRect();\n query.selectAll(\".xh-tabbar-content-item\").boundingClientRect();\n query.selectAll(\".xh-tabbar-content-slot\").boundingClientRect();\n\n query.exec(res => {\n if (!res[0][selectIndex]) return;\n const width: number = res[0][selectIndex].width;\n setTabWdith(width);\n\n if (!res[1][selectIndex]) return;\n setTabContentHeight(res[1][selectIndex].height);\n\n if (!res[2][selectIndex]) return;\n setTabSlotHeight(res[2][selectIndex].height);\n clearTimeout(timer);\n });\n }, 300);\n console.log(children.length);\n }, [selectIndex, children]);\n\n const handleClick = (index: number): void => {\n // setSelectIndex(index);\n const query = createSelectorQuery();\n query.selectAll(\".xh-tabbar-content-item\").boundingClientRect();\n query.selectAll(\".xh-tabbar-content-slot\").boundingClientRect();\n query.exec(res => {\n if (!res[0][index]) return;\n const height: number = res[0][index].height;\n setTabContentHeight(height);\n if (!res[1][index]) return;\n setTabSlotHeight(res[1][index].height);\n });\n\n onChange && onChange(index);\n };\n\n function renderLine(): ReactElement | null {\n const left: number = tabWdith / 2 + selectIndex * tabWdith;\n return (\n <div\n className={classNames(\"xh-tabbar-nav-line\", {\n \"xh-tabbar-nav-line-active\": animated,\n })}\n style={{\n background: `${lineColor}`,\n transform: `translateX(${left}px) translate(-50%, -50%)`,\n WebkitTransform: `translateX(${left}px) translate(-50%, -50%)`,\n }}\n />\n );\n }\n\n return (\n <View className=\"xh-tabbar\">\n <View className=\"xh-tabbar-nav\">\n {children.map((child, index) => (\n <View\n key={index}\n // @ts-ignore\n dataTrackId={\n child.props.dataTrackId || `xh-tabbar-nav-item-${index}`\n }\n ref={el => (itemNavRef.current[index] = el)}\n className=\"xh-tabbar-nav-item\"\n style={{\n color:\n selectIndex === index ? titleActiveColor : titleInctiveColor,\n }}\n onClick={() => handleClick(index)}\n >\n {child.props.TabItemComponent\n ? child.props.TabItemComponent\n : child.props.title}\n </View>\n ))}\n {renderLine()}\n </View>\n <View\n className=\"xh-tabbar-content\"\n style={{\n width: `${children.length * 100}%`,\n height:\n tabContentHeight + tabSlotHeight\n ? `${tabContentHeight + tabSlotHeight}px`\n : \"auto\",\n }}\n >\n {content && (\n <View className=\"xh-tabbar-content-slot\" ref={itemSlotRef}>\n {content}\n </View>\n )}\n {children.map((child, index) => (\n <View\n key={index}\n ref={el => (itemContentRef.current[index] = el)}\n className={classNames(\"xh-tabbar-content-item\", {\n \"xh-tabbar-content-item-dispaly\":\n selectIndex !== index && !animated,\n \"xh-tabbar-content-item-active\": selectIndex === index,\n })}\n style={{\n transform: animated ? `translateX(-${selectIndex * 100}%)` : \"\",\n }}\n >\n {child.props.children}\n </View>\n ))}\n </View>\n </View>\n );\n};\n\nXHTabs.Item = Item;\n\nexport default XHTabs;\nexport const TabItem = Item;\n"],"names":["XHTabs","props","_a","children","_b","animated","_c","lineColor","_d","titleActiveColor","_e","titleInctiveColor","onChange","content","_f","selectIndex","_g","__read","useState","tabWdith","setTabWdith","_h","tabContentHeight","setTabContentHeight","_j","tabSlotHeight","setTabSlotHeight","itemNavRef","useRef","itemContentRef","itemSlotRef","useEffect","timer","setTimeout","process","env","TARO_ENV","query","createSelectorQuery","selectAll","boundingClientRect","exec","res","width","height","clearTimeout","el","current","rect","getBoundingClientRect","elSlot","elitem","left","React","createElement","View","className","map","child","index","key","dataTrackId","concat","ref","style","color","onClick","handleClick","TabItemComponent","title","classNames","background","transform","WebkitTransform","length","Item"],"mappings":"iRA2CM,IAAAA,EAAkC,SAAAC,GAEpC,IAAAC,EASED,EAAKE,SATPA,aAAW,GAAED,EACbE,EAQEH,EARcI,SAAhBA,OAAQ,IAAAD,GAAQA,EAEhBE,EAMEL,EANmBM,UAArBA,aAAY,UAASD,EACrBE,EAKEP,mBALFQ,OAAmB,IAAAD,EAAA,SACnBE,EAIET,EAJwBU,kBAA1BA,OAAoB,IAAAD,EAAA,OAAMA,EAC1BE,EAGEX,WAFFY,EAEEZ,EAAKY,QADPC,EACEb,EADac,YAAfA,OAAc,IAAAD,EAAA,IAIVE,EAAAC,EAA0BC,EAAS,GAAE,GAApCC,EAAQH,EAAA,GAAEI,OACXC,EAAAJ,EAA0CC,EAAS,GAAE,GAApDI,EAAgBD,EAAA,GAAEE,OACnBC,EAAAP,EAAoCC,EAAS,GAAE,GAA9CO,EAAaD,EAAA,GAAEE,OAEhBC,EAAaC,EAAiC,IAC9CC,EAAiBD,EAAkC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EAAiB,MAAO,KAG9D2C,EAAMzD,MAAME,SAEhB,KAIT,EAEAH,EAAO2E,KAAOA"}
|
|
1
|
+
{"version":3,"file":"Tabbar.js","sources":["../../../../src/components/Tabbar/tabbar/Tabbar.tsx"],"sourcesContent":["import React, {\n FC,\n ReactElement,\n useEffect,\n useState,\n ReactNode,\n useRef,\n useCallback,\n} from \"react\";\nimport { createSelectorQuery } from \"@tarojs/taro\";\nimport { View, ScrollView } from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport Item from \"./TabItem\";\n\n/**\n * Tab切换\n *\n * @param children //子组件\n * @param animated //是否开启转场动画\n * @param selectIndex //默认选中第几个\n * @param lineColor //下划线颜色\n * @param titleActiveColor //标题选中态颜色\n * @param titleInctiveColor //标题默认态颜色\n * @param onChange //切换回调事件\n * @param content //item公共节点\n * @param isOverflowNav //是否超宽导航(超过屏幕宽度,自动滚动)\n *\n */\n\nexport interface TabProps {\n children: ReactElement[];\n animated?: boolean;\n lineColor?: string;\n titleActiveColor?: string;\n titleInctiveColor?: string;\n onChange?: (index: number) => void;\n content?: string | ReactNode;\n selectIndex: number;\n isOverflowNav?: boolean;\n}\n\nexport interface TabsComponent<P = {}> extends FC<P> {\n Item: typeof Item;\n}\n\nconst XHTabs: TabsComponent<TabProps> = props => {\n const {\n children = [],\n animated = false,\n lineColor = \"#FE5E00\",\n titleActiveColor = \"#333\",\n titleInctiveColor = \"#999\",\n onChange,\n content,\n selectIndex = 0,\n isOverflowNav = false,\n } = props;\n\n const [tabContentHeight, setTabContentHeight] = useState(0);\n const [tabSlotHeight, setTabSlotHeight] = useState(0);\n const [lineLeft, setLineLeft] = useState(0); // 下划线左偏移,核心:通过状态控制下划线位置,确保同步更新和动画过渡\n const [navLeft, setNavLeft] = useState(0); // 导航滚动位置,核心:通过状态控制滚动位置,适配超宽导航\n // Ref定义\n const itemNavRef = useRef<(HTMLDivElement | null)[]>([]);\n const itemContentRef = useRef<(HTMLDivElement | null)[]>([]);\n const itemSlotRef = useRef<(HTMLDivElement | null)[]>([]);\n const navScrollRef = useRef<HTMLDivElement | null>(null); // 滚动容器ref\n const navContainerRef = useRef<HTMLDivElement | null>(null);\n const timerRef = useRef<NodeJS.Timeout | null>(null); // 定时器ref,避免闭包丢失\n\n // 统一滚动计算逻辑:H5/小程序通用\n const computeScroll = (\n itemRect: any,\n scrollRect: any,\n containerLeft: number,\n containerWidth: number\n ) => {\n if (!scrollRect || !isOverflowNav) return 0;\n // 元素在导航容器内的绝对偏移(视口坐标转容器坐标)\n const itemOffsetInNav = itemRect.left - containerLeft;\n // 居中滚动值:让选中项尽量居中显示\n let targetScroll =\n itemOffsetInNav - (scrollRect.width - itemRect.width) / 2;\n // 最大可滚动距离:总导航宽度 - 可视区域宽度\n const maxScroll = Math.max(0, containerWidth - scrollRect.width);\n // 边界处理:不小于0,不大于最大可滚动距离\n return Math.max(0, Math.min(targetScroll, maxScroll));\n };\n\n // 抽离位置/尺寸计算逻辑,复用(初始化+切换都调用)\n const calculateTabInfo = useCallback(\n (targetIndex: number) => {\n // 过滤空children,避免索引越界\n const validChildren = children.filter(Boolean);\n if (targetIndex < 0 || targetIndex >= validChildren.length) return;\n\n // H5端:直接通过ref获取元素信息,核心:同步更新,无需等待DOM渲染\n if (process.env.TARO_ENV === \"h5\") {\n const navItem = itemNavRef.current[targetIndex];\n const slotItem = itemSlotRef.current[0];\n const contentItem = itemContentRef.current[targetIndex];\n const navContainer = navItem?.parentElement as HTMLDivElement;\n const scrollContainer = navScrollRef.current;\n\n // 计算下划线位置\n if (navItem && navContainer && scrollContainer) {\n const itemRect = navItem.getBoundingClientRect();\n const containerRect = navContainer.getBoundingClientRect();\n const scrollRect = scrollContainer.getBoundingClientRect();\n const centerX =\n itemRect.left + itemRect.width / 2 - containerRect.left;\n setLineLeft(centerX);\n\n if (isOverflowNav) {\n const targetScroll = computeScroll(\n itemRect,\n scrollRect,\n containerRect.left,\n navContainer.offsetWidth\n );\n scrollContainer.scrollTo({\n left: targetScroll,\n // behavior: animated ? \"smooth\" : \"instant\",\n });\n }\n }\n\n if (slotItem) {\n const slotRect = slotItem.getBoundingClientRect();\n setTabSlotHeight(slotRect.height);\n }\n if (contentItem) {\n const contentRect = contentItem.getBoundingClientRect();\n setTabContentHeight(contentRect.height);\n }\n return;\n }\n\n // 小程序端:必须用createSelectorQuery,保留极短延迟(50ms),适配小程序DOM渲染时机\n timerRef.current = setTimeout(() => {\n const query = createSelectorQuery();\n query.selectAll(\".xh-tabbar-nav-item\").boundingClientRect();\n query.select(\".xh-tabbar-nav\").boundingClientRect(); // 导航容器(下划线定位基准)\n query.selectAll(\".xh-tabbar-content-item\").boundingClientRect();\n query.selectAll(\".xh-tabbar-content-slot\").boundingClientRect();\n query.select(\".xh-tabbar-nav-scroll\").boundingClientRect(); // 滚动容器\n query.exec(res => {\n const [\n navRects,\n navContainerRect,\n contentRects,\n slotRects,\n scrollRect,\n ] = res;\n const navContainer = navContainerRect?.node || navContainerRect;\n // 下划线宽度+内容高度\n if (navRects[targetIndex] && navContainer && scrollRect) {\n const itemRect = navRects[targetIndex];\n const containerRect = navContainerRect;\n const centerX =\n itemRect.left + itemRect.width / 2 - containerRect.left;\n setLineLeft(centerX);\n\n // 计算ScrollView滚动距离(选中项居中)\n if (isOverflowNav) {\n const targetScroll = computeScroll(\n itemRect,\n scrollRect,\n navContainerRect.left,\n navContainerRect.width\n );\n setNavLeft(targetScroll);\n }\n }\n // 内容高度计算(保持不变)\n if (contentRects[targetIndex]) {\n setTabContentHeight(contentRects[targetIndex].height);\n }\n // Slot高度查询取[0],因为Slot只有一个节点\n if (slotRects[0]) {\n setTabSlotHeight(slotRects[0].height);\n }\n });\n }, 50);\n },\n [children, isOverflowNav]\n );\n\n useEffect(() => {\n calculateTabInfo(selectIndex);\n // 清理定时器,防止内存泄漏\n return () => {\n if (timerRef.current) clearTimeout(timerRef.current);\n };\n }, [selectIndex, calculateTabInfo]);\n\n // 点击导航项\n const handleClick = (index: number): void => {\n if (index === selectIndex) return; // 点击当前选中项,不做处理\n // 同步计算目标项位置,下划线立即更新\n calculateTabInfo(index);\n // 触发切换回调\n onChange && onChange(index);\n\n // 小程序端单独处理内容高度(H5已在calculateTabInfo中处理)\n if (process.env.TARO_ENV === \"h5\") {\n // 点击导航获取内容高度和slot高度\n const query = createSelectorQuery();\n query.selectAll(\".xh-tabbar-content-item\").boundingClientRect();\n query.selectAll(\".xh-tabbar-content-slot\").boundingClientRect();\n query.exec(res => {\n if (!res[0][index]) return;\n const height: number = res[0][index].height;\n\n setTabContentHeight(height);\n if (!res[1][index]) return;\n setTabSlotHeight(res[1][index].height);\n });\n }\n };\n\n // 下划线\n function renderLine(): ReactElement | null {\n return (\n <div\n className={classNames(\"xh-tabbar-nav-line\", {\n \"xh-tabbar-nav-line-active\": animated,\n })}\n style={{\n background: `${lineColor}`,\n transform: `translateX(${lineLeft}px) translate(-50%, -50%)`,\n WebkitTransform: `translateX(${lineLeft}px) translate(-50%, -50%)`,\n transition: animated ? \"transform 0.3s ease\" : \"none\", // 小程序端动画过渡\n }}\n />\n );\n }\n\n // 导航栏\n function renderNav() {\n return (\n <ScrollView\n scrollX\n scrollLeft={navLeft}\n className=\"xh-tabbar-nav-scroll\"\n ref={navScrollRef}\n >\n <View\n className=\"xh-tabbar-nav\"\n ref={navContainerRef}\n style={{ width: isOverflowNav ? \"fit-content\" : \"100%\" }}\n >\n {children.map((child, index) => (\n <View\n key={index}\n data-index={index}\n // @ts-ignore\n dataTrackId={\n child.props.dataTrackId || `xh-tabbar-nav-item-${index}`\n }\n ref={el => (itemNavRef.current[index] = el)}\n className={classNames(\"xh-tabbar-nav-item\", {\n \"more-item\": isOverflowNav,\n })}\n style={{\n color:\n selectIndex === index ? titleActiveColor : titleInctiveColor,\n flex: isOverflowNav ? \"none\" : \"1\",\n }}\n onClick={() => handleClick(index)}\n >\n {child.props.TabItemComponent || child.props.title}\n </View>\n ))}\n {renderLine()}\n </View>\n </ScrollView>\n );\n }\n\n return (\n <View className=\"xh-tabbar\">\n {renderNav()}\n <View\n className=\"xh-tabbar-content\"\n style={{\n width: `${children.length * 100}%`,\n height:\n tabContentHeight + tabSlotHeight\n ? `${tabContentHeight + tabSlotHeight}px`\n : \"auto\",\n }}\n >\n {content && (\n <View className=\"xh-tabbar-content-slot\" ref={itemSlotRef}>\n {content}\n </View>\n )}\n {children.map((child, index) => (\n <View\n key={index}\n ref={el => (itemContentRef.current[index] = el)}\n className={classNames(\"xh-tabbar-content-item\", {\n \"xh-tabbar-content-item-dispaly\":\n selectIndex !== index && !animated,\n \"xh-tabbar-content-item-active\": selectIndex === index,\n })}\n style={{\n transform: animated ? `translateX(-${selectIndex * 100}%)` : \"\",\n }}\n >\n {child.props.children}\n </View>\n ))}\n </View>\n </View>\n );\n};\n\nXHTabs.Item = Item;\n\nexport default XHTabs;\nexport const TabItem = Item;\n"],"names":["XHTabs","props","_a","children","_b","animated","_c","lineColor","_d","titleActiveColor","_e","titleInctiveColor","onChange","content","_f","selectIndex","_g","isOverflowNav","_h","__read","useState","tabContentHeight","setTabContentHeight","_j","tabSlotHeight","setTabSlotHeight","_k","lineLeft","setLineLeft","_l","navLeft","setNavLeft","itemNavRef","useRef","itemContentRef","itemSlotRef","navScrollRef","navContainerRef","timerRef","computeScroll","itemRect","scrollRect","containerLeft","containerWidth","targetScroll","left","width","maxScroll","Math","max","min","calculateTabInfo","useCallback","targetIndex","validChildren","filter","Boolean","length","process","env","TARO_ENV","current","setTimeout","query","createSelectorQuery","selectAll","boundingClientRect","select","exec","res","navRects","navContainerRect","contentRects","slotRects","navContainer","node","containerRect","centerX","height","navItem","slotItem","contentItem","parentElement","scrollContainer","getBoundingClientRect","offsetWidth","scrollTo","slotRect","contentRect","useEffect","clearTimeout","React","createElement","View","className","ScrollView","scrollX","scrollLeft","ref","style","map","child","index","key","dataTrackId","concat","el","classNames","color","flex","onClick","handleClick","TabItemComponent","title","background","transform","WebkitTransform","transition","Item"],"mappings":"kTA6CM,IAAAA,EAAkC,SAAAC,GAEpC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