@tarojs/components-react 4.0.0-canary.11 → 4.0.0-canary.13
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/view/index.js +1 -1
- package/dist/components/view/index.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/shared/dist/shared.esm.js +52 -6
- package/dist/shared/dist/shared.esm.js.map +1 -1
- package/dist/solid/components/view/index.js +1 -1
- package/dist/solid/components/view/index.js.map +1 -1
- package/dist/solid/index.css +1 -1
- package/dist/solid/shared/dist/shared.esm.js +52 -6
- package/dist/solid/shared/dist/shared.esm.js.map +1 -1
- package/package.json +3 -3
|
@@ -62,7 +62,7 @@ function View(_a) {
|
|
|
62
62
|
setCls(classNames('', {
|
|
63
63
|
[`${hoverClass}`]: "react" === 'solid' ? hover() : hover
|
|
64
64
|
}, className));
|
|
65
|
-
}, [hover]);
|
|
65
|
+
}, [hover, className]);
|
|
66
66
|
return /*#__PURE__*/jsx("div", {
|
|
67
67
|
className: "react" === 'solid' ? cls() : cls,
|
|
68
68
|
onTouchStart: _onTouchStart,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../src/components/view/index.tsx"],"sourcesContent":["import './style/index.css'\n\nimport classNames from 'classnames'\n\nimport { useEffect, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n onTouchStart?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchEnd?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchMove?(e: React.TouchEvent<HTMLDivElement>): void\n onLongPress?(): void\n}\n\nfunction View ({\n className,\n hoverClass,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n hoverStartTime = 50,\n hoverStayTime = 400,\n ...other\n}: IProps) {\n let timeoutEvent: ReturnType<typeof setTimeout>\n let startTime = 0\n const [hover, setHover] = useState<boolean>(false)\n const [touch, setTouch] = useState<boolean>(false)\n\n const [cls, setCls] = useState<string>(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as Exclude<typeof hover, boolean>)() : hover\n },\n className\n ))\n\n const _onTouchStart = e => {\n if (hoverClass) {\n setTouch(true)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as Exclude<typeof touch, boolean>)() : touch) {\n setHover(true)\n }\n }, hoverStartTime)\n }\n onTouchStart && onTouchStart(e)\n if (other.onLongPress) {\n timeoutEvent = setTimeout(() => {\n other.onLongPress!()\n }, 350)\n startTime = new Date().getTime()\n }\n }\n\n const _onTouchMove = e => {\n clearTimeout(timeoutEvent)\n onTouchMove && onTouchMove(e)\n }\n\n const _onTouchEnd = e => {\n const spanTime = new Date().getTime() - startTime\n if (spanTime < 350) {\n clearTimeout(timeoutEvent)\n }\n if (hoverClass) {\n setTouch(false)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as Exclude<typeof touch, boolean>)() : touch) {\n setHover(false)\n }\n }, hoverStayTime)\n }\n onTouchEnd && onTouchEnd(e)\n }\n\n useEffect(() => {\n setCls(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as Exclude<typeof hover, boolean>)() : hover\n },\n className\n ))\n }, [hover])\n\n return (\n <div\n className={process.env.FRAMEWORK === 'solid' ? (cls as Exclude<typeof cls, string>)() : cls as string}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n onTouchMove={_onTouchMove}\n {...other}\n >\n {other.children}\n </div>\n )\n}\n\nexport default View\n"],"names":["View","_a","className","hoverClass","onTouchStart","onTouchEnd","onTouchMove","hoverStartTime","hoverStayTime","other","__rest","timeoutEvent","startTime","hover","setHover","useState","touch","setTouch","cls","setCls","classNames","process","_onTouchStart","e","setTimeout","onLongPress","Date","getTime","_onTouchMove","clearTimeout","_onTouchEnd","spanTime","useEffect","_jsx","children"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AAU,CAAC,MAAK;QAC7Bf,KAAK,CAACgB,WAAY,EAAE,CAAA;OACrB,EAAE,GAAG,CAAC,CAAA;MACPb,SAAS,GAAG,IAAIc,IAAI,EAAE,CAACC,OAAO,EAAE,CAAA;AACjC,KAAA;GACF,CAAA;EAED,MAAMC,YAAY,GAAGL,CAAC,IAAG;IACvBM,YAAY,CAAClB,YAAY,CAAC,CAAA;AAC1BL,IAAAA,WAAW,IAAIA,WAAW,CAACiB,CAAC,CAAC,CAAA;GAC9B,CAAA;EAED,MAAMO,WAAW,GAAGP,CAAC,IAAG;IACtB,MAAMQ,QAAQ,GAAG,IAAIL,IAAI,EAAE,CAACC,OAAO,EAAE,GAAGf,SAAS,CAAA;IACjD,IAAImB,QAAQ,GAAG,GAAG,EAAE;MAClBF,YAAY,CAAClB,YAAY,CAAC,CAAA;AAC3B,KAAA;AACD,IAAA,IAAIR,UAAU,EAAE;MACdc,QAAQ,CAAC,KAAK,CAAC,CAAA;AACfO,MAAAA,UAAU,CAAC,MAAK;AACd,QAAA,IAAIH,OAAqB,KAAK,OAAO,GAAIL,KAAwC,EAAE,GAAGA,KAAK,EAAE;UAC3FF,QAAQ,CAAC,KAAK,CAAC,CAAA;AAChB,SAAA;OACF,EAAEN,aAAa,CAAC,CAAA;AAClB,KAAA;AACDH,IAAAA,UAAU,IAAIA,UAAU,CAACkB,CAAC,CAAC,CAAA;GAC5B,CAAA;AAEDS,EAAAA,SAAS,CAAC,MAAK;AACbb,IAAAA,MAAM,CAACC,UAAU,CACf,EAAE,EACF;AACE,MAAA,CAAC,CAAGjB,EAAAA,UAAY,CAAA,CAAA,GAAGkB,OAAqB,KAAK,OAAO,GAAIR,KAAwC,EAAE,GAAGA,KAAAA;KACtG,EACDX,SAAS,CACV,CAAC,CAAA;AACJ,GAAC,EAAE,CAACW,KAAK,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../src/components/view/index.tsx"],"sourcesContent":["import './style/index.css'\n\nimport classNames from 'classnames'\n\nimport { useEffect, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n onTouchStart?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchEnd?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchMove?(e: React.TouchEvent<HTMLDivElement>): void\n onLongPress?(): void\n}\n\nfunction View ({\n className,\n hoverClass,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n hoverStartTime = 50,\n hoverStayTime = 400,\n ...other\n}: IProps) {\n let timeoutEvent: ReturnType<typeof setTimeout>\n let startTime = 0\n const [hover, setHover] = useState<boolean>(false)\n const [touch, setTouch] = useState<boolean>(false)\n\n const [cls, setCls] = useState<string>(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as Exclude<typeof hover, boolean>)() : hover\n },\n className\n ))\n\n const _onTouchStart = e => {\n if (hoverClass) {\n setTouch(true)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as Exclude<typeof touch, boolean>)() : touch) {\n setHover(true)\n }\n }, hoverStartTime)\n }\n onTouchStart && onTouchStart(e)\n if (other.onLongPress) {\n timeoutEvent = setTimeout(() => {\n other.onLongPress!()\n }, 350)\n startTime = new Date().getTime()\n }\n }\n\n const _onTouchMove = e => {\n clearTimeout(timeoutEvent)\n onTouchMove && onTouchMove(e)\n }\n\n const _onTouchEnd = e => {\n const spanTime = new Date().getTime() - startTime\n if (spanTime < 350) {\n clearTimeout(timeoutEvent)\n }\n if (hoverClass) {\n setTouch(false)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as Exclude<typeof touch, boolean>)() : touch) {\n setHover(false)\n }\n }, hoverStayTime)\n }\n onTouchEnd && onTouchEnd(e)\n }\n\n useEffect(() => {\n setCls(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as Exclude<typeof hover, boolean>)() : hover\n },\n className\n ))\n }, [hover, className])\n\n return (\n <div\n className={process.env.FRAMEWORK === 'solid' ? (cls as Exclude<typeof cls, string>)() : cls as string}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n onTouchMove={_onTouchMove}\n {...other}\n >\n {other.children}\n </div>\n )\n}\n\nexport default View\n"],"names":["View","_a","className","hoverClass","onTouchStart","onTouchEnd","onTouchMove","hoverStartTime","hoverStayTime","other","__rest","timeoutEvent","startTime","hover","setHover","useState","touch","setTouch","cls","setCls","classNames","process","_onTouchStart","e","setTimeout","onLongPress","Date","getTime","_onTouchMove","clearTimeout","_onTouchEnd","spanTime","useEffect","_jsx","children"],"mappings":";;;;;;AAkBA,SAASA,IAAIA,CAAEC,EASN,EAAA;MATM;MACbC,SAAS;MACTC,UAAU;MACVC,YAAY;MACZC,UAAU;MACVC,WAAW;AACXC,MAAAA,cAAc,GAAG,EAAE;AACnBC,MAAAA,aAAa,GAAG,GAAA;UAET;IADJC,KAAK,GARKC,MAAA,CAAAT,EAAA,EAAA,CAAA,WAAA,EAAA,YAAA,EAAA,cAAA,EAAA,YAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,eAAA,CASd,CADS,CAAA;AAER,EAAA,IAAIU,YAA2C,CAAA;EAC/C,IAAIC,SAAS,GAAG,CAAC,CAAA;EACjB,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAAU,KAAK,CAAC,CAAA;EAClD,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGF,QAAQ,CAAU,KAAK,CAAC,CAAA;EAElD,MAAM,CAACG,GAAG,EAAEC,MAAM,CAAC,GAAGJ,QAAQ,CAASK,UAAU,CAC/C,EAAE,EACF;AACE,IAAA,CAAC,CAAGjB,EAAAA,UAAY,CAAA,CAAA,GAAGkB,OAAqB,KAAK,OAAO,GAAIR,KAAwC,EAAE,GAAGA,KAAAA;GACtG,EACDX,SAAS,CAC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;AAClB,KAAA;AACDH,IAAAA,UAAU,IAAIA,UAAU,CAACkB,CAAC,CAAC,CAAA;GAC5B,CAAA;AAEDS,EAAAA,SAAS,CAAC,MAAK;AACbb,IAAAA,MAAM,CAACC,UAAU,CACf,EAAE,EACF;AACE,MAAA,CAAC,CAAGjB,EAAAA,UAAY,CAAA,CAAA,GAAGkB,OAAqB,KAAK,OAAO,GAAIR,KAAwC,EAAE,GAAGA,KAAAA;KACtG,EACDX,SAAS,CACV,CAAC,CAAA;AACJ,GAAC,EAAE,CAACW,KAAK,EAAEX,SAAS,CAAC,CAAC,CAAA;AAEtB,EAAA,oBACE+B,GAAA,CAAA,KAAA,EAAA;AACE/B,IAAAA,SAAS,EAAEmB,OAAqB,KAAK,OAAO,GAAIH,GAAmC,EAAE,GAAGA,GAAc;AACtGd,IAAAA,YAAY,EAAEkB,aAAc;AAC5BjB,IAAAA,UAAU,EAAEyB,WAAY;AACxBxB,IAAAA,WAAW,EAAEsB,YAAa;AAAA,IAAA,GACtBnB,KAAK;IAAAyB,QAAA,EAERzB,KAAK,CAACyB,QAAAA;AAAQ,GACZ,CAAC,CAAA;AAEV;;;;"}
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@-webkit-keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.taro-button-core[loading]>.weui-loading{animation:weuiLoading 1s steps(12) infinite;background:transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;background-size:100%;display:inline-block;height:20px;vertical-align:middle;width:20px}.taro-button-core[loading]>.weui-loading.weui-btn_primary,.taro-button-core[loading]>.weui-loading.weui-btn_warn{color:hsla(0,0%,100%,.6)}.taro-button-core[loading]>.weui-loading.weui-btn_primary{background-color:#179b16}.taro-button-core[loading]>.weui-loading.weui-btn_warn{background-color:#ce3c39}.taro-button-core{-webkit-tap-highlight-color:rgba(0,0,0,0);appearance:none;background-color:#f8f8f8;border-radius:5px;border-width:0;box-sizing:border-box;color:#000;display:block;font-size:18px;line-height:2.55555556;margin-left:auto;margin-right:auto;outline:0;overflow:hidden;padding-left:14px;padding-right:14px;position:relative;text-align:center;text-decoration:none;width:100%}.taro-button-core:focus{outline:0}.taro-button-core:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core:after{border:1px solid rgba(0,0,0,.2);border-radius:10px;box-sizing:border-box;content:" ";height:200%;left:0;position:absolute;top:0;transform:scale(.5);transform-origin:0 0;width:200%}.taro-button-core+.taro-button-core{margin-top:15px}.taro-button-core[type=default]{background-color:#f8f8f8;color:#000}.taro-button-core[type=default]:not([disabled]):visited{color:#000}.taro-button-core[type=default]:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core[size=mini]{display:inline-block;font-size:13px;line-height:2.3;padding:0 1.32em;width:auto}.taro-button-core[plain],.taro-button-core[plain][type=default],.taro-button-core[plain][type=primary]{background-color:transparent;border-width:1px}.taro-button-core[disabled]{color:hsla(0,0%,100%,.6)}.taro-button-core[disabled][type=default]{background-color:#f7f7f7;color:rgba(0,0,0,.3)}.taro-button-core[disabled][type=primary]{background-color:#9ed99d}.taro-button-core[disabled][type=warn]{background-color:#ec8b89}.taro-button-core[loading] .weui-loading{margin:-.2em .34em 0 0}.taro-button-core[loading][type=primary],.taro-button-core[loading][type=warn]{color:hsla(0,0%,100%,.6)}.taro-button-core[loading][type=primary]{background-color:#179b16}.taro-button-core[loading][type=warn]{background-color:#ce3c39}.taro-button-core[plain][type=primary]{border:1px solid #1aad19;color:#1aad19}.taro-button-core[plain][type=primary]:not([disabled]):active{background-color:transparent;border-color:rgba(26,173,25,.6);color:rgba(26,173,25,.6)}.taro-button-core[plain][type=primary]:after{border-width:0}.taro-button-core[plain][type=warn]{border:1px solid #e64340;color:#e64340}.taro-button-core[plain][type=warn]:not([disabled]):active{background-color:transparent;border-color:rgba(230,67,64,.6);color:rgba(230,67,64,.6)}.taro-button-core[plain][type=warn]:after{border-width:0}.taro-button-core[plain],.taro-button-core[plain][type=default]{border:1px solid #353535;color:#353535}.taro-button-core[plain]:not([disabled]):active,.taro-button-core[plain][type=default]:not([disabled]):active{background-color:transparent;border-color:rgba(53,53,53,.6);color:rgba(53,53,53,.6)}.taro-button-core[plain]:after,.taro-button-core[plain][type=default]:after{border-width:0}.taro-button-core[type=primary]{background-color:#1aad19;color:#fff}.taro-button-core[type=primary]:not([disabled]):visited{color:#fff}.taro-button-core[type=primary]:not([disabled]):active{background-color:#179b16;color:hsla(0,0%,100%,.6)}.taro-button-core[type=warn]{background-color:#e64340;color:#fff}.taro-button-core[type=warn]:not([disabled]):visited{color:#fff}.taro-button-core[type=warn]:not([disabled]):active{background-color:#ce3c39;color:hsla(0,0%,100%,.6)}.taro-button-core[plain][disabled]
|
|
1
|
+
@-webkit-keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.taro-button-core[loading]>.weui-loading{animation:weuiLoading 1s steps(12) infinite;background:transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;background-size:100%;display:inline-block;height:20px;vertical-align:middle;width:20px}.taro-button-core[loading]>.weui-loading.weui-btn_primary,.taro-button-core[loading]>.weui-loading.weui-btn_warn{color:hsla(0,0%,100%,.6)}.taro-button-core[loading]>.weui-loading.weui-btn_primary{background-color:#179b16}.taro-button-core[loading]>.weui-loading.weui-btn_warn{background-color:#ce3c39}.taro-button-core{-webkit-tap-highlight-color:rgba(0,0,0,0);appearance:none;background-color:#f8f8f8;border-radius:5px;border-width:0;box-sizing:border-box;color:#000;display:block;font-size:18px;line-height:2.55555556;margin-left:auto;margin-right:auto;outline:0;overflow:hidden;padding-left:14px;padding-right:14px;position:relative;text-align:center;text-decoration:none;width:100%}.taro-button-core:focus{outline:0}.taro-button-core:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core:after{border:1px solid rgba(0,0,0,.2);border-radius:10px;box-sizing:border-box;content:" ";height:200%;left:0;position:absolute;top:0;transform:scale(.5);transform-origin:0 0;width:200%}.taro-button-core+.taro-button-core{margin-top:15px}.taro-button-core[type=default]{background-color:#f8f8f8;color:#000}.taro-button-core[type=default]:not([disabled]):visited{color:#000}.taro-button-core[type=default]:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core[size=mini]{display:inline-block;font-size:13px;line-height:2.3;padding:0 1.32em;width:auto}.taro-button-core[plain],.taro-button-core[plain][type=default],.taro-button-core[plain][type=primary]{background-color:transparent;border-width:1px}.taro-button-core[disabled]{color:hsla(0,0%,100%,.6)}.taro-button-core[disabled][type=default]{background-color:#f7f7f7;color:rgba(0,0,0,.3)}.taro-button-core[disabled][type=primary]{background-color:#9ed99d}.taro-button-core[disabled][type=warn]{background-color:#ec8b89}.taro-button-core[loading] .weui-loading{margin:-.2em .34em 0 0}.taro-button-core[loading][type=primary],.taro-button-core[loading][type=warn]{color:hsla(0,0%,100%,.6)}.taro-button-core[loading][type=primary]{background-color:#179b16}.taro-button-core[loading][type=warn]{background-color:#ce3c39}.taro-button-core[plain][type=primary]{border:1px solid #1aad19;color:#1aad19}.taro-button-core[plain][type=primary]:not([disabled]):active{background-color:transparent;border-color:rgba(26,173,25,.6);color:rgba(26,173,25,.6)}.taro-button-core[plain][type=primary]:after{border-width:0}.taro-button-core[plain][type=warn]{border:1px solid #e64340;color:#e64340}.taro-button-core[plain][type=warn]:not([disabled]):active{background-color:transparent;border-color:rgba(230,67,64,.6);color:rgba(230,67,64,.6)}.taro-button-core[plain][type=warn]:after{border-width:0}.taro-button-core[plain],.taro-button-core[plain][type=default]{border:1px solid #353535;color:#353535}.taro-button-core[plain]:not([disabled]):active,.taro-button-core[plain][type=default]:not([disabled]):active{background-color:transparent;border-color:rgba(53,53,53,.6);color:rgba(53,53,53,.6)}.taro-button-core[plain]:after,.taro-button-core[plain][type=default]:after{border-width:0}.taro-button-core[type=primary]{background-color:#1aad19;color:#fff}.taro-button-core[type=primary]:not([disabled]):visited{color:#fff}.taro-button-core[type=primary]:not([disabled]):active{background-color:#179b16;color:hsla(0,0%,100%,.6)}.taro-button-core[type=warn]{background-color:#e64340;color:#fff}.taro-button-core[type=warn]:not([disabled]):visited{color:#fff}.taro-button-core[type=warn]:not([disabled]):active{background-color:#ce3c39;color:hsla(0,0%,100%,.6)}.taro-button-core[plain][disabled],.taro-button-core[plain][disabled][type=primary]{background-color:#f7f7f7;border:1px solid rgba(0,0,0,.2);color:rgba(0,0,0,.3)}.weui-icon-circle:before{content:"\ea01"}.weui-icon-download:before{content:"\ea02"}.weui-icon-info:before{content:"\ea03"}.weui-icon-safe-success:before{content:"\ea04"}.weui-icon-safe-warn:before{content:"\ea05"}.weui-icon-success:before{content:"\ea06"}.weui-icon-success-circle:before{content:"\ea07"}.weui-icon-success-no-circle:before{content:"\ea08"}.weui-icon-waiting:before{content:"\ea09"}.weui-icon-waiting-circle:before{content:"\ea0a"}.weui-icon-warn:before{content:"\ea0b"}.weui-icon-info-circle:before{content:"\ea0c"}.weui-icon-cancel:before{content:"\ea0d"}.weui-icon-search:before{content:"\ea0e"}.weui-icon-clear:before{content:"\ea0f"}.weui-icon-back:before{content:"\ea10"}.weui-icon-delete:before{content:"\ea11"}.weui-icon-success{color:#09bb07;font-size:23px}.weui-icon-waiting{color:#10aeff;font-size:23px}.weui-icon-warn{color:#f43530;font-size:23px}.weui-icon-info{color:#10aeff;font-size:23px}.weui-icon-success-circle,.weui-icon-success-no-circle{color:#09bb07;font-size:23px}.weui-icon-waiting-circle{color:#10aeff;font-size:23px}.weui-icon-circle{color:#c9c9c9;font-size:23px}.weui-icon-download,.weui-icon-info-circle{color:#09bb07;font-size:23px}.weui-icon-safe-success{color:#09bb07}.weui-icon-safe-warn{color:#ffbe00}.weui-icon-cancel{color:#f43530;font-size:22px}.weui-icon-clear,.weui-icon-search{color:#b2b2b2;font-size:14px}.weui-icon-delete.weui-icon_gallery-delete{color:#fff;font-size:22px}.weui-icon_msg{font-size:93px}.weui-icon_msg.weui-icon-warn{color:#f76260}.weui-icon_msg-primary{font-size:93px}.weui-icon_msg-primary.weui-icon-warn{color:#ffbe00}img[src=""]{opacity:0}.taro-img{display:inline-block;font-size:0;height:240px;overflow:hidden;position:relative;width:320px}.taro-img.taro-img__widthfix{height:100%}.taro-img__mode-aspectfit,.taro-img__mode-scaletofill{height:100%;object-fit:contain;width:100%}.taro-img__mode-aspectfill{height:100%;object-fit:cover;width:100%}.taro-img__mode-top,.taro-img__mode-widthfix{width:100%}.taro-img__mode-bottom{bottom:0;position:absolute;width:100%}.taro-img__mode-left{height:100%}.taro-img__mode-right{height:100%}.taro-img__mode-right,.taro-img__mode-topright{position:absolute;right:0}.taro-img__mode-bottomleft{bottom:0;position:absolute}.taro-img__mode-bottomright{bottom:0;position:absolute;right:0}.taro-input-core,input{display:block}input{height:1.4rem;overflow:hidden;text-align:inherit;text-overflow:clip;white-space:nowrap}.weui-input{-webkit-appearance:none;background-color:transparent;border:0;color:inherit;font-size:inherit;height:1.4705882353em;line-height:1.4705882353;outline:0;width:100%}.weui-input::-webkit-inner-spin-button,.weui-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.rmc-pull-to-refresh-content{transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{min-height:100%}.rmc-pull-to-refresh-transition{transition:transform .3s}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:.2}to{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{animation-fill-mode:both;animation:rmc-pull-to-refresh-indicator .5s linear 0s infinite;background-color:grey;border-radius:100%;display:inline-block;height:6px;margin:3px;width:6px}.rmc-pull-to-refresh-indicator>div:nth-child(0){animation-delay:-.1s!important}.rmc-pull-to-refresh-indicator>div:first-child{animation-delay:-.2s!important}.rmc-pull-to-refresh-indicator>div:nth-child(2){animation-delay:-.3s!important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}.taro-scroll{-webkit-overflow-scrolling:auto}.taro-scroll::-webkit-scrollbar{display:none}.taro-scroll-view{overflow:hidden}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}.swiper-container-wrapper{height:150px}.swiper-container{height:100%}.swiper-pagination{font-size:0}.swiper-pagination-bullet{opacity:1}.taro-text{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.taro-text__selectable{-moz-user-select:text;-webkit-user-select:text;-ms-user-select:text;user-select:text}body,html{-webkit-tap-highlight-color:rgba(0,0,0,0);user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}
|
|
@@ -60,11 +60,11 @@ const Progress = {
|
|
|
60
60
|
const RichText = {
|
|
61
61
|
nodes: DEFAULT_EMPTY_ARRAY
|
|
62
62
|
};
|
|
63
|
-
const Text = {
|
|
63
|
+
const Text = Object.assign({
|
|
64
64
|
selectable: DEFAULT_FALSE,
|
|
65
65
|
space: NO_DEFAULT_VALUE,
|
|
66
66
|
decode: DEFAULT_FALSE
|
|
67
|
-
};
|
|
67
|
+
}, touchEvents);
|
|
68
68
|
const Button = Object.assign({
|
|
69
69
|
size: singleQuote('default'),
|
|
70
70
|
type: NO_DEFAULT_VALUE,
|
|
@@ -119,10 +119,10 @@ const Input = {
|
|
|
119
119
|
bindConfirm: NO_DEFAULT_VALUE,
|
|
120
120
|
name: NO_DEFAULT_VALUE
|
|
121
121
|
};
|
|
122
|
-
const Label = {
|
|
122
|
+
const Label = Object.assign({
|
|
123
123
|
for: NO_DEFAULT_VALUE,
|
|
124
124
|
name: NO_DEFAULT_VALUE
|
|
125
|
-
};
|
|
125
|
+
}, touchEvents);
|
|
126
126
|
const Picker = {
|
|
127
127
|
mode: singleQuote('selector'),
|
|
128
128
|
disabled: NO_DEFAULT_VALUE,
|
|
@@ -385,6 +385,7 @@ const Slot = {
|
|
|
385
385
|
const NativeSlot = {
|
|
386
386
|
name: NO_DEFAULT_VALUE
|
|
387
387
|
};
|
|
388
|
+
const Script = {};
|
|
388
389
|
const internalComponents = {
|
|
389
390
|
View,
|
|
390
391
|
Icon,
|
|
@@ -425,7 +426,8 @@ const internalComponents = {
|
|
|
425
426
|
Map: MapComp,
|
|
426
427
|
Slot,
|
|
427
428
|
SlotView,
|
|
428
|
-
NativeSlot
|
|
429
|
+
NativeSlot,
|
|
430
|
+
Script
|
|
429
431
|
};
|
|
430
432
|
const controlledComponent = new Set(['input', 'checkbox', 'picker', 'picker-view', 'radio', 'slider', 'switch', 'textarea']);
|
|
431
433
|
const focusComponents = new Set(['input', 'textarea']);
|
|
@@ -555,6 +557,50 @@ class Events {
|
|
|
555
557
|
}
|
|
556
558
|
Events.eventSplitter = ','; // Note: Harmony ACE API 8 开发板不支持使用正则 split 字符串 /\s+/
|
|
557
559
|
|
|
560
|
+
class PageEvts extends Events {
|
|
561
|
+
constructor() {
|
|
562
|
+
super(...arguments);
|
|
563
|
+
this.exeList = [];
|
|
564
|
+
}
|
|
565
|
+
on(eventName, callback) {
|
|
566
|
+
super.on(eventName, callback, this);
|
|
567
|
+
this.exeList = this.exeList.reduce((prev, item) => {
|
|
568
|
+
if (item.eventName === eventName) {
|
|
569
|
+
super.trigger(item.eventName, item.data);
|
|
570
|
+
} else {
|
|
571
|
+
prev.push(item);
|
|
572
|
+
}
|
|
573
|
+
return prev;
|
|
574
|
+
}, []);
|
|
575
|
+
return this;
|
|
576
|
+
}
|
|
577
|
+
emit(events, data) {
|
|
578
|
+
// eslint-disable-next-line
|
|
579
|
+
routeChannel.trigger(events, data);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
const pageChannel = new PageEvts();
|
|
583
|
+
class RouteEvts extends Events {
|
|
584
|
+
emit(events, data) {
|
|
585
|
+
pageChannel.off(events);
|
|
586
|
+
pageChannel.exeList.push({
|
|
587
|
+
eventName: events,
|
|
588
|
+
data
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
addEvents(events) {
|
|
592
|
+
if (!events || typeof events !== 'object') return;
|
|
593
|
+
Object.keys(events).forEach(key => {
|
|
594
|
+
this.off(key);
|
|
595
|
+
this.on(key, events[key], this);
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
const routeChannel = new RouteEvts();
|
|
600
|
+
const EventChannel = {
|
|
601
|
+
pageChannel,
|
|
602
|
+
routeChannel
|
|
603
|
+
};
|
|
558
604
|
function isString(o) {
|
|
559
605
|
return typeof o === 'string';
|
|
560
606
|
}
|
|
@@ -1160,5 +1206,5 @@ var Shortcuts;
|
|
|
1160
1206
|
Shortcuts["Src"] = "src";
|
|
1161
1207
|
})(Shortcuts || (Shortcuts = {}));
|
|
1162
1208
|
|
|
1163
|
-
export { EMPTY_ARR, EMPTY_OBJ, Events, HOOK_TYPE, PLATFORM_CONFIG_MAP, PLATFORM_TYPE, Shortcuts, TaroHook, TaroHooks, animation, box, cacheDataGet, cacheDataHas, cacheDataSet, capitalize, controlledComponent, ensure, focusComponents, getComponentsAlias, getPlatformType, getUniqueKey, hasOwn, hooks, indent, internalComponents, isArray, isBoolean, isBooleanStringLiteral, isFunction, isNull, isNumber, isObject, isString, isUndefined, isWebPlatform, mergeInternalComponents, mergeReconciler, nestElements, nonsupport, noop, processApis, queryToJson, setUniqueKeyToRoute, singleQuote, toCamelCase, toDashed, toKebabCase, touchEvents, unbox, voidElements, warn };
|
|
1209
|
+
export { EMPTY_ARR, EMPTY_OBJ, EventChannel, Events, HOOK_TYPE, PLATFORM_CONFIG_MAP, PLATFORM_TYPE, Shortcuts, TaroHook, TaroHooks, animation, box, cacheDataGet, cacheDataHas, cacheDataSet, capitalize, controlledComponent, ensure, focusComponents, getComponentsAlias, getPlatformType, getUniqueKey, hasOwn, hooks, indent, internalComponents, isArray, isBoolean, isBooleanStringLiteral, isFunction, isNull, isNumber, isObject, isString, isUndefined, isWebPlatform, mergeInternalComponents, mergeReconciler, nestElements, nonsupport, noop, processApis, queryToJson, setUniqueKeyToRoute, singleQuote, toCamelCase, toDashed, toKebabCase, touchEvents, unbox, voidElements, warn };
|
|
1164
1210
|
//# sourceMappingURL=shared.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/view/index.tsx"],"sourcesContent":["import './style/index.css'\n\nimport classNames from 'classnames'\n\nimport { useEffect, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n onTouchStart?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchEnd?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchMove?(e: React.TouchEvent<HTMLDivElement>): void\n onLongPress?(): void\n}\n\nfunction View ({\n className,\n hoverClass,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n hoverStartTime = 50,\n hoverStayTime = 400,\n ...other\n}: IProps) {\n let timeoutEvent: ReturnType<typeof setTimeout>\n let startTime = 0\n const [hover, setHover] = useState<boolean>(false)\n const [touch, setTouch] = useState<boolean>(false)\n\n const [cls, setCls] = useState<string>(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as Exclude<typeof hover, boolean>)() : hover\n },\n className\n ))\n\n const _onTouchStart = e => {\n if (hoverClass) {\n setTouch(true)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as Exclude<typeof touch, boolean>)() : touch) {\n setHover(true)\n }\n }, hoverStartTime)\n }\n onTouchStart && onTouchStart(e)\n if (other.onLongPress) {\n timeoutEvent = setTimeout(() => {\n other.onLongPress!()\n }, 350)\n startTime = new Date().getTime()\n }\n }\n\n const _onTouchMove = e => {\n clearTimeout(timeoutEvent)\n onTouchMove && onTouchMove(e)\n }\n\n const _onTouchEnd = e => {\n const spanTime = new Date().getTime() - startTime\n if (spanTime < 350) {\n clearTimeout(timeoutEvent)\n }\n if (hoverClass) {\n setTouch(false)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as Exclude<typeof touch, boolean>)() : touch) {\n setHover(false)\n }\n }, hoverStayTime)\n }\n onTouchEnd && onTouchEnd(e)\n }\n\n useEffect(() => {\n setCls(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as Exclude<typeof hover, boolean>)() : hover\n },\n className\n ))\n }, [hover])\n\n return (\n <div\n className={process.env.FRAMEWORK === 'solid' ? (cls as Exclude<typeof cls, string>)() : cls as string}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n onTouchMove={_onTouchMove}\n {...other}\n >\n {other.children}\n </div>\n )\n}\n\nexport default View\n"],"names":["View","_a","className","hoverClass","onTouchStart","onTouchEnd","onTouchMove","hoverStartTime","hoverStayTime","other","__rest","timeoutEvent","startTime","hover","setHover","useState","touch","setTouch","cls","setCls","classNames","process","_onTouchStart","e","setTimeout","onLongPress","Date","getTime","_onTouchMove","clearTimeout","_onTouchEnd","spanTime","useEffect","_el$","_tmpl$","$$touchmove","$$touchend","$$touchstart","_$spread","_$mergeProps","_$memo","_$insert","children","_$delegateEvents"],"mappings":";;;;;;;AAkBA,SAASA,IAAIA,CAAEC,EASN,EAAA;MATM;MACbC,SAAS;MACTC,UAAU;MACVC,YAAY;MACZC,UAAU;MACVC,WAAW;AACXC,MAAAA,cAAc,GAAG,EAAE;AACnBC,MAAAA,aAAa,GAAG,GAAA;UAET;IADJC,KAAK,GARKC,MAAA,CAAAT,EAAA,EAAA,CAAA,WAAA,EAAA,YAAA,EAAA,cAAA,EAAA,YAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,eAAA,CASd,CADS,CAAA;AAER,EAAA,IAAIU,YAA2C,CAAA;EAC/C,IAAIC,SAAS,GAAG,CAAC,CAAA;EACjB,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGC,QAAQ,CAAU,KAAK,CAAC,CAAA;EAClD,MAAM,CA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ClB,YAAY,CAAC,CAAA;AAC3B,KAAA;AACD,IAAA,IAAIR,UAAU,EAAE;MACdc,QAAQ,CAAC,KAAK,CAAC,CAAA;AACfO,MAAAA,UAAU,CAAC,MAAK;AACd,QAAA,IAAIH,OAAqB,KAAK,OAAO,GAAIL,KAAwC,EAAE,GAAGA,KAAK,EAAE;UAC3FF,QAAQ,CAAC,KAAK,CAAC,CAAA;AAChB,SAAA;OACF,EAAEN,aAAa,CAAC,CAAA;AAClB,KAAA;AACDH,IAAAA,UAAU,IAAIA,UAAU,CAACkB,CAAC,CAAC,CAAA;GAC5B,CAAA;AAEDS,EAAAA,SAAS,CAAC,MAAK;AACbb,IAAAA,MAAM,CAACC,UAAU,CACf,EAAE,EACF;AACE,MAAA,CAAC,CAAGjB,EAAAA,UAAY,CAAA,CAAA,GAAGkB,OAAqB,KAAK,OAAO,GAAIR,KAAwC,EAAE,GAAGA,KAAAA;KACtG,EACDX,SAAS,CACV,CAAC,CAAA;AACJ,GAAC,EAAE,CAACW,KAAK,CAAC,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/view/index.tsx"],"sourcesContent":["import './style/index.css'\n\nimport classNames from 'classnames'\n\nimport { useEffect, useState } from '../../utils/hooks'\n\nimport type React from 'react'\n\ninterface IProps extends React.HTMLAttributes<HTMLDivElement> {\n hoverClass?: string\n hoverStartTime?: number\n hoverStayTime?: number\n onTouchStart?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchEnd?(e: React.TouchEvent<HTMLDivElement>): void\n onTouchMove?(e: React.TouchEvent<HTMLDivElement>): void\n onLongPress?(): void\n}\n\nfunction View ({\n className,\n hoverClass,\n onTouchStart,\n onTouchEnd,\n onTouchMove,\n hoverStartTime = 50,\n hoverStayTime = 400,\n ...other\n}: IProps) {\n let timeoutEvent: ReturnType<typeof setTimeout>\n let startTime = 0\n const [hover, setHover] = useState<boolean>(false)\n const [touch, setTouch] = useState<boolean>(false)\n\n const [cls, setCls] = useState<string>(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as Exclude<typeof hover, boolean>)() : hover\n },\n className\n ))\n\n const _onTouchStart = e => {\n if (hoverClass) {\n setTouch(true)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as Exclude<typeof touch, boolean>)() : touch) {\n setHover(true)\n }\n }, hoverStartTime)\n }\n onTouchStart && onTouchStart(e)\n if (other.onLongPress) {\n timeoutEvent = setTimeout(() => {\n other.onLongPress!()\n }, 350)\n startTime = new Date().getTime()\n }\n }\n\n const _onTouchMove = e => {\n clearTimeout(timeoutEvent)\n onTouchMove && onTouchMove(e)\n }\n\n const _onTouchEnd = e => {\n const spanTime = new Date().getTime() - startTime\n if (spanTime < 350) {\n clearTimeout(timeoutEvent)\n }\n if (hoverClass) {\n setTouch(false)\n setTimeout(() => {\n if (process.env.FRAMEWORK === 'solid' ? (touch as Exclude<typeof touch, boolean>)() : touch) {\n setHover(false)\n }\n }, hoverStayTime)\n }\n onTouchEnd && onTouchEnd(e)\n }\n\n useEffect(() => {\n setCls(classNames(\n '',\n {\n [`${hoverClass}`]: process.env.FRAMEWORK === 'solid' ? (hover as Exclude<typeof hover, boolean>)() : hover\n },\n className\n ))\n }, [hover, className])\n\n return (\n <div\n className={process.env.FRAMEWORK === 'solid' ? (cls as Exclude<typeof cls, string>)() : cls as string}\n onTouchStart={_onTouchStart}\n onTouchEnd={_onTouchEnd}\n onTouchMove={_onTouchMove}\n {...other}\n >\n {other.children}\n </div>\n )\n}\n\nexport default View\n"],"names":["View","_a","className","hoverClass","onTouchStart","onTouchEnd","onTouchMove","hoverStartTime","hoverStayTime","other","__rest","timeoutEvent","startTime","hover","setHover","useState","touch","setTouch","cls","setCls","classNames","process","_onTouchStart","e","setTimeout","onLongPress","Date","getTime","_onTouchMove","clearTimeout","_onTouchEnd","spanTime","useEffect","_el$","_tmpl$","$$touchmove","$$touchend","$$touchstart","_$spread","_$mergeProps","_$memo","_$ins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AAAC,MAAA,EAAA,CAAA;IAAAD,IAAA,CAAAE,WAAA,GAKiBP,YAAY,CAAA;IAAAK,IAAA,CAAAG,UAAA,GADbN,WAAW,CAAA;IAAAG,IAAA,CAAAI,YAAA,GADTf,aAAa,CAAA;IAAAgB,MAAA,CAAAL,IAAA,EAAAM,UAAA,CAAA;AAAA,MAAA,IAD3BrC,SAASA,GAAA;AAAA,QAAA,OAAEsC,IAAA,CAAA,MAAAnB,OAAqB,KAAK,OAAO,CAAIH,EAAAA,GAAAA,GAAmC,EAAE,GAAGA,GAAa,CAAA;AAAA,OAAA;AAAA,KAAA,EAIjGT,KAAK,CAAA,EAAA,KAAA,EAAA,IAAA,CAAA,CAAA;AAAAgC,IAAAA,MAAA,CAAAR,IAAA,EAERxB,MAAAA,KAAK,CAACiC,QAAQ,CAAA,CAAA;AAAA,IAAA,OAAAT,IAAA,CAAA;AAAA,GAAA,GAAA,CAAA;AAGrB,CAAA;AAEmBU,cAAA,CAAA,CAAA,YAAA,EAAA,UAAA,EAAA,WAAA,CAAA,CAAA;;;;"}
|
package/dist/solid/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@-webkit-keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.taro-button-core[loading]>.weui-loading{animation:weuiLoading 1s steps(12) infinite;background:transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;background-size:100%;display:inline-block;height:20px;vertical-align:middle;width:20px}.taro-button-core[loading]>.weui-loading.weui-btn_primary,.taro-button-core[loading]>.weui-loading.weui-btn_warn{color:hsla(0,0%,100%,.6)}.taro-button-core[loading]>.weui-loading.weui-btn_primary{background-color:#179b16}.taro-button-core[loading]>.weui-loading.weui-btn_warn{background-color:#ce3c39}.taro-button-core{-webkit-tap-highlight-color:rgba(0,0,0,0);appearance:none;background-color:#f8f8f8;border-radius:5px;border-width:0;box-sizing:border-box;color:#000;display:block;font-size:18px;line-height:2.55555556;margin-left:auto;margin-right:auto;outline:0;overflow:hidden;padding-left:14px;padding-right:14px;position:relative;text-align:center;text-decoration:none;width:100%}.taro-button-core:focus{outline:0}.taro-button-core:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core:after{border:1px solid rgba(0,0,0,.2);border-radius:10px;box-sizing:border-box;content:" ";height:200%;left:0;position:absolute;top:0;transform:scale(.5);transform-origin:0 0;width:200%}.taro-button-core+.taro-button-core{margin-top:15px}.taro-button-core[type=default]{background-color:#f8f8f8;color:#000}.taro-button-core[type=default]:not([disabled]):visited{color:#000}.taro-button-core[type=default]:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core[size=mini]{display:inline-block;font-size:13px;line-height:2.3;padding:0 1.32em;width:auto}.taro-button-core[plain],.taro-button-core[plain][type=default],.taro-button-core[plain][type=primary]{background-color:transparent;border-width:1px}.taro-button-core[disabled]{color:hsla(0,0%,100%,.6)}.taro-button-core[disabled][type=default]{background-color:#f7f7f7;color:rgba(0,0,0,.3)}.taro-button-core[disabled][type=primary]{background-color:#9ed99d}.taro-button-core[disabled][type=warn]{background-color:#ec8b89}.taro-button-core[loading] .weui-loading{margin:-.2em .34em 0 0}.taro-button-core[loading][type=primary],.taro-button-core[loading][type=warn]{color:hsla(0,0%,100%,.6)}.taro-button-core[loading][type=primary]{background-color:#179b16}.taro-button-core[loading][type=warn]{background-color:#ce3c39}.taro-button-core[plain][type=primary]{border:1px solid #1aad19;color:#1aad19}.taro-button-core[plain][type=primary]:not([disabled]):active{background-color:transparent;border-color:rgba(26,173,25,.6);color:rgba(26,173,25,.6)}.taro-button-core[plain][type=primary]:after{border-width:0}.taro-button-core[plain][type=warn]{border:1px solid #e64340;color:#e64340}.taro-button-core[plain][type=warn]:not([disabled]):active{background-color:transparent;border-color:rgba(230,67,64,.6);color:rgba(230,67,64,.6)}.taro-button-core[plain][type=warn]:after{border-width:0}.taro-button-core[plain],.taro-button-core[plain][type=default]{border:1px solid #353535;color:#353535}.taro-button-core[plain]:not([disabled]):active,.taro-button-core[plain][type=default]:not([disabled]):active{background-color:transparent;border-color:rgba(53,53,53,.6);color:rgba(53,53,53,.6)}.taro-button-core[plain]:after,.taro-button-core[plain][type=default]:after{border-width:0}.taro-button-core[type=primary]{background-color:#1aad19;color:#fff}.taro-button-core[type=primary]:not([disabled]):visited{color:#fff}.taro-button-core[type=primary]:not([disabled]):active{background-color:#179b16;color:hsla(0,0%,100%,.6)}.taro-button-core[type=warn]{background-color:#e64340;color:#fff}.taro-button-core[type=warn]:not([disabled]):visited{color:#fff}.taro-button-core[type=warn]:not([disabled]):active{background-color:#ce3c39;color:hsla(0,0%,100%,.6)}.taro-button-core[plain][disabled]
|
|
1
|
+
@-webkit-keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}@keyframes weuiLoading{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.taro-button-core[loading]>.weui-loading{animation:weuiLoading 1s steps(12) infinite;background:transparent url("data:image/svg+xml;charset=utf8, %3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 100 100'%3E%3Cpath fill='none' d='M0 0h100v100H0z'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E9E9E9' rx='5' ry='5' transform='translate(0 -30)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23989697' rx='5' ry='5' transform='rotate(30 105.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%239B999A' rx='5' ry='5' transform='rotate(60 75.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23A3A1A2' rx='5' ry='5' transform='rotate(90 65 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23ABA9AA' rx='5' ry='5' transform='rotate(120 58.66 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23B2B2B2' rx='5' ry='5' transform='rotate(150 54.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23BAB8B9' rx='5' ry='5' transform='rotate(180 50 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23C2C0C1' rx='5' ry='5' transform='rotate(-150 45.98 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23CBCBCB' rx='5' ry='5' transform='rotate(-120 41.34 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23D2D2D2' rx='5' ry='5' transform='rotate(-90 35 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23DADADA' rx='5' ry='5' transform='rotate(-60 24.02 65)'/%3E%3Crect width='7' height='20' x='46.5' y='40' fill='%23E2E2E2' rx='5' ry='5' transform='rotate(-30 -5.98 65)'/%3E%3C/svg%3E") no-repeat;background-size:100%;display:inline-block;height:20px;vertical-align:middle;width:20px}.taro-button-core[loading]>.weui-loading.weui-btn_primary,.taro-button-core[loading]>.weui-loading.weui-btn_warn{color:hsla(0,0%,100%,.6)}.taro-button-core[loading]>.weui-loading.weui-btn_primary{background-color:#179b16}.taro-button-core[loading]>.weui-loading.weui-btn_warn{background-color:#ce3c39}.taro-button-core{-webkit-tap-highlight-color:rgba(0,0,0,0);appearance:none;background-color:#f8f8f8;border-radius:5px;border-width:0;box-sizing:border-box;color:#000;display:block;font-size:18px;line-height:2.55555556;margin-left:auto;margin-right:auto;outline:0;overflow:hidden;padding-left:14px;padding-right:14px;position:relative;text-align:center;text-decoration:none;width:100%}.taro-button-core:focus{outline:0}.taro-button-core:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core:after{border:1px solid rgba(0,0,0,.2);border-radius:10px;box-sizing:border-box;content:" ";height:200%;left:0;position:absolute;top:0;transform:scale(.5);transform-origin:0 0;width:200%}.taro-button-core+.taro-button-core{margin-top:15px}.taro-button-core[type=default]{background-color:#f8f8f8;color:#000}.taro-button-core[type=default]:not([disabled]):visited{color:#000}.taro-button-core[type=default]:not([disabled]):active{background-color:#dedede;color:rgba(0,0,0,.6)}.taro-button-core[size=mini]{display:inline-block;font-size:13px;line-height:2.3;padding:0 1.32em;width:auto}.taro-button-core[plain],.taro-button-core[plain][type=default],.taro-button-core[plain][type=primary]{background-color:transparent;border-width:1px}.taro-button-core[disabled]{color:hsla(0,0%,100%,.6)}.taro-button-core[disabled][type=default]{background-color:#f7f7f7;color:rgba(0,0,0,.3)}.taro-button-core[disabled][type=primary]{background-color:#9ed99d}.taro-button-core[disabled][type=warn]{background-color:#ec8b89}.taro-button-core[loading] .weui-loading{margin:-.2em .34em 0 0}.taro-button-core[loading][type=primary],.taro-button-core[loading][type=warn]{color:hsla(0,0%,100%,.6)}.taro-button-core[loading][type=primary]{background-color:#179b16}.taro-button-core[loading][type=warn]{background-color:#ce3c39}.taro-button-core[plain][type=primary]{border:1px solid #1aad19;color:#1aad19}.taro-button-core[plain][type=primary]:not([disabled]):active{background-color:transparent;border-color:rgba(26,173,25,.6);color:rgba(26,173,25,.6)}.taro-button-core[plain][type=primary]:after{border-width:0}.taro-button-core[plain][type=warn]{border:1px solid #e64340;color:#e64340}.taro-button-core[plain][type=warn]:not([disabled]):active{background-color:transparent;border-color:rgba(230,67,64,.6);color:rgba(230,67,64,.6)}.taro-button-core[plain][type=warn]:after{border-width:0}.taro-button-core[plain],.taro-button-core[plain][type=default]{border:1px solid #353535;color:#353535}.taro-button-core[plain]:not([disabled]):active,.taro-button-core[plain][type=default]:not([disabled]):active{background-color:transparent;border-color:rgba(53,53,53,.6);color:rgba(53,53,53,.6)}.taro-button-core[plain]:after,.taro-button-core[plain][type=default]:after{border-width:0}.taro-button-core[type=primary]{background-color:#1aad19;color:#fff}.taro-button-core[type=primary]:not([disabled]):visited{color:#fff}.taro-button-core[type=primary]:not([disabled]):active{background-color:#179b16;color:hsla(0,0%,100%,.6)}.taro-button-core[type=warn]{background-color:#e64340;color:#fff}.taro-button-core[type=warn]:not([disabled]):visited{color:#fff}.taro-button-core[type=warn]:not([disabled]):active{background-color:#ce3c39;color:hsla(0,0%,100%,.6)}.taro-button-core[plain][disabled],.taro-button-core[plain][disabled][type=primary]{background-color:#f7f7f7;border:1px solid rgba(0,0,0,.2);color:rgba(0,0,0,.3)}.weui-icon-circle:before{content:"\ea01"}.weui-icon-download:before{content:"\ea02"}.weui-icon-info:before{content:"\ea03"}.weui-icon-safe-success:before{content:"\ea04"}.weui-icon-safe-warn:before{content:"\ea05"}.weui-icon-success:before{content:"\ea06"}.weui-icon-success-circle:before{content:"\ea07"}.weui-icon-success-no-circle:before{content:"\ea08"}.weui-icon-waiting:before{content:"\ea09"}.weui-icon-waiting-circle:before{content:"\ea0a"}.weui-icon-warn:before{content:"\ea0b"}.weui-icon-info-circle:before{content:"\ea0c"}.weui-icon-cancel:before{content:"\ea0d"}.weui-icon-search:before{content:"\ea0e"}.weui-icon-clear:before{content:"\ea0f"}.weui-icon-back:before{content:"\ea10"}.weui-icon-delete:before{content:"\ea11"}.weui-icon-success{color:#09bb07;font-size:23px}.weui-icon-waiting{color:#10aeff;font-size:23px}.weui-icon-warn{color:#f43530;font-size:23px}.weui-icon-info{color:#10aeff;font-size:23px}.weui-icon-success-circle,.weui-icon-success-no-circle{color:#09bb07;font-size:23px}.weui-icon-waiting-circle{color:#10aeff;font-size:23px}.weui-icon-circle{color:#c9c9c9;font-size:23px}.weui-icon-download,.weui-icon-info-circle{color:#09bb07;font-size:23px}.weui-icon-safe-success{color:#09bb07}.weui-icon-safe-warn{color:#ffbe00}.weui-icon-cancel{color:#f43530;font-size:22px}.weui-icon-clear,.weui-icon-search{color:#b2b2b2;font-size:14px}.weui-icon-delete.weui-icon_gallery-delete{color:#fff;font-size:22px}.weui-icon_msg{font-size:93px}.weui-icon_msg.weui-icon-warn{color:#f76260}.weui-icon_msg-primary{font-size:93px}.weui-icon_msg-primary.weui-icon-warn{color:#ffbe00}img[src=""]{opacity:0}.taro-img{display:inline-block;font-size:0;height:240px;overflow:hidden;position:relative;width:320px}.taro-img.taro-img__widthfix{height:100%}.taro-img__mode-aspectfit,.taro-img__mode-scaletofill{height:100%;object-fit:contain;width:100%}.taro-img__mode-aspectfill{height:100%;object-fit:cover;width:100%}.taro-img__mode-top,.taro-img__mode-widthfix{width:100%}.taro-img__mode-bottom{bottom:0;position:absolute;width:100%}.taro-img__mode-left{height:100%}.taro-img__mode-right{height:100%}.taro-img__mode-right,.taro-img__mode-topright{position:absolute;right:0}.taro-img__mode-bottomleft{bottom:0;position:absolute}.taro-img__mode-bottomright{bottom:0;position:absolute;right:0}.taro-input-core,input{display:block}input{height:1.4rem;overflow:hidden;text-align:inherit;text-overflow:clip;white-space:nowrap}.weui-input{-webkit-appearance:none;background-color:transparent;border:0;color:inherit;font-size:inherit;height:1.4705882353em;line-height:1.4705882353;outline:0;width:100%}.weui-input::-webkit-inner-spin-button,.weui-input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.rmc-pull-to-refresh-content{transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{min-height:100%}.rmc-pull-to-refresh-transition{transition:transform .3s}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:.2}to{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{animation-fill-mode:both;animation:rmc-pull-to-refresh-indicator .5s linear 0s infinite;background-color:grey;border-radius:100%;display:inline-block;height:6px;margin:3px;width:6px}.rmc-pull-to-refresh-indicator>div:nth-child(0){animation-delay:-.1s!important}.rmc-pull-to-refresh-indicator>div:first-child{animation-delay:-.2s!important}.rmc-pull-to-refresh-indicator>div:nth-child(2){animation-delay:-.3s!important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}.taro-scroll{-webkit-overflow-scrolling:auto}.taro-scroll::-webkit-scrollbar{display:none}.taro-scroll-view{overflow:hidden}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}.swiper-container-wrapper{height:150px}.swiper-container{height:100%}.swiper-pagination{font-size:0}.swiper-pagination-bullet{opacity:1}.taro-text{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.taro-text__selectable{-moz-user-select:text;-webkit-user-select:text;-ms-user-select:text;user-select:text}body,html{-webkit-tap-highlight-color:rgba(0,0,0,0);user-select:none;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}
|
|
@@ -60,11 +60,11 @@ const Progress = {
|
|
|
60
60
|
const RichText = {
|
|
61
61
|
nodes: DEFAULT_EMPTY_ARRAY
|
|
62
62
|
};
|
|
63
|
-
const Text = {
|
|
63
|
+
const Text = Object.assign({
|
|
64
64
|
selectable: DEFAULT_FALSE,
|
|
65
65
|
space: NO_DEFAULT_VALUE,
|
|
66
66
|
decode: DEFAULT_FALSE
|
|
67
|
-
};
|
|
67
|
+
}, touchEvents);
|
|
68
68
|
const Button = Object.assign({
|
|
69
69
|
size: singleQuote('default'),
|
|
70
70
|
type: NO_DEFAULT_VALUE,
|
|
@@ -119,10 +119,10 @@ const Input = {
|
|
|
119
119
|
bindConfirm: NO_DEFAULT_VALUE,
|
|
120
120
|
name: NO_DEFAULT_VALUE
|
|
121
121
|
};
|
|
122
|
-
const Label = {
|
|
122
|
+
const Label = Object.assign({
|
|
123
123
|
for: NO_DEFAULT_VALUE,
|
|
124
124
|
name: NO_DEFAULT_VALUE
|
|
125
|
-
};
|
|
125
|
+
}, touchEvents);
|
|
126
126
|
const Picker = {
|
|
127
127
|
mode: singleQuote('selector'),
|
|
128
128
|
disabled: NO_DEFAULT_VALUE,
|
|
@@ -385,6 +385,7 @@ const Slot = {
|
|
|
385
385
|
const NativeSlot = {
|
|
386
386
|
name: NO_DEFAULT_VALUE
|
|
387
387
|
};
|
|
388
|
+
const Script = {};
|
|
388
389
|
const internalComponents = {
|
|
389
390
|
View,
|
|
390
391
|
Icon,
|
|
@@ -425,7 +426,8 @@ const internalComponents = {
|
|
|
425
426
|
Map: MapComp,
|
|
426
427
|
Slot,
|
|
427
428
|
SlotView,
|
|
428
|
-
NativeSlot
|
|
429
|
+
NativeSlot,
|
|
430
|
+
Script
|
|
429
431
|
};
|
|
430
432
|
const controlledComponent = new Set(['input', 'checkbox', 'picker', 'picker-view', 'radio', 'slider', 'switch', 'textarea']);
|
|
431
433
|
const focusComponents = new Set(['input', 'textarea']);
|
|
@@ -555,6 +557,50 @@ class Events {
|
|
|
555
557
|
}
|
|
556
558
|
Events.eventSplitter = ','; // Note: Harmony ACE API 8 开发板不支持使用正则 split 字符串 /\s+/
|
|
557
559
|
|
|
560
|
+
class PageEvts extends Events {
|
|
561
|
+
constructor() {
|
|
562
|
+
super(...arguments);
|
|
563
|
+
this.exeList = [];
|
|
564
|
+
}
|
|
565
|
+
on(eventName, callback) {
|
|
566
|
+
super.on(eventName, callback, this);
|
|
567
|
+
this.exeList = this.exeList.reduce((prev, item) => {
|
|
568
|
+
if (item.eventName === eventName) {
|
|
569
|
+
super.trigger(item.eventName, item.data);
|
|
570
|
+
} else {
|
|
571
|
+
prev.push(item);
|
|
572
|
+
}
|
|
573
|
+
return prev;
|
|
574
|
+
}, []);
|
|
575
|
+
return this;
|
|
576
|
+
}
|
|
577
|
+
emit(events, data) {
|
|
578
|
+
// eslint-disable-next-line
|
|
579
|
+
routeChannel.trigger(events, data);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
const pageChannel = new PageEvts();
|
|
583
|
+
class RouteEvts extends Events {
|
|
584
|
+
emit(events, data) {
|
|
585
|
+
pageChannel.off(events);
|
|
586
|
+
pageChannel.exeList.push({
|
|
587
|
+
eventName: events,
|
|
588
|
+
data
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
addEvents(events) {
|
|
592
|
+
if (!events || typeof events !== 'object') return;
|
|
593
|
+
Object.keys(events).forEach(key => {
|
|
594
|
+
this.off(key);
|
|
595
|
+
this.on(key, events[key], this);
|
|
596
|
+
});
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
const routeChannel = new RouteEvts();
|
|
600
|
+
const EventChannel = {
|
|
601
|
+
pageChannel,
|
|
602
|
+
routeChannel
|
|
603
|
+
};
|
|
558
604
|
function isString(o) {
|
|
559
605
|
return typeof o === 'string';
|
|
560
606
|
}
|
|
@@ -1160,5 +1206,5 @@ var Shortcuts;
|
|
|
1160
1206
|
Shortcuts["Src"] = "src";
|
|
1161
1207
|
})(Shortcuts || (Shortcuts = {}));
|
|
1162
1208
|
|
|
1163
|
-
export { EMPTY_ARR, EMPTY_OBJ, Events, HOOK_TYPE, PLATFORM_CONFIG_MAP, PLATFORM_TYPE, Shortcuts, TaroHook, TaroHooks, animation, box, cacheDataGet, cacheDataHas, cacheDataSet, capitalize, controlledComponent, ensure, focusComponents, getComponentsAlias, getPlatformType, getUniqueKey, hasOwn, hooks, indent, internalComponents, isArray, isBoolean, isBooleanStringLiteral, isFunction, isNull, isNumber, isObject, isString, isUndefined, isWebPlatform, mergeInternalComponents, mergeReconciler, nestElements, nonsupport, noop, processApis, queryToJson, setUniqueKeyToRoute, singleQuote, toCamelCase, toDashed, toKebabCase, touchEvents, unbox, voidElements, warn };
|
|
1209
|
+
export { EMPTY_ARR, EMPTY_OBJ, EventChannel, Events, HOOK_TYPE, PLATFORM_CONFIG_MAP, PLATFORM_TYPE, Shortcuts, TaroHook, TaroHooks, animation, box, cacheDataGet, cacheDataHas, cacheDataSet, capitalize, controlledComponent, ensure, focusComponents, getComponentsAlias, getPlatformType, getUniqueKey, hasOwn, hooks, indent, internalComponents, isArray, isBoolean, isBooleanStringLiteral, isFunction, isNull, isNumber, isObject, isString, isUndefined, isWebPlatform, mergeInternalComponents, mergeReconciler, nestElements, nonsupport, noop, processApis, queryToJson, setUniqueKeyToRoute, singleQuote, toCamelCase, toDashed, toKebabCase, touchEvents, unbox, voidElements, warn };
|
|
1164
1210
|
//# sourceMappingURL=shared.esm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared.esm.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/components-react",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.13",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main:h5": "dist/index.js",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"classnames": "^2.2.5",
|
|
29
29
|
"swiper": "6.8.0",
|
|
30
30
|
"tslib": "^2.6.2",
|
|
31
|
-
"@tarojs/
|
|
32
|
-
"@tarojs/
|
|
31
|
+
"@tarojs/taro": "4.0.0-canary.13",
|
|
32
|
+
"@tarojs/components": "4.0.0-canary.13"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/core": "^7.14.5",
|