taro-react-uilib 1.4.13 → 1.4.15-0

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.
@@ -1,2 +1,2 @@
1
- var t=function(){function t(t,e,n){this.ctx=t,this.chart=null,e?this.canvasNode=n:this._initStyle(t),this._initEvent()}return t.prototype.getContext=function(t){if("2d"===t)return this.ctx},t.prototype.setChart=function(t){this.chart=t},t.prototype.attachEvent=function(){},t.prototype.addEventListener=function(){},t.prototype.removeEventListener=function(){},t.prototype.detachEvent=function(){},t.prototype._initCanvas=function(t,e){t.util.getContext=function(){return e},t.util.$override("measureText",(function(t,n){return e.font=n||"12px sans-serif",e.measureText(t)}))},t.prototype._initStyle=function(t){["fillStyle","strokeStyle","globalAlpha","textAlign","textBaseAlign","shadow","lineWidth","lineCap","lineJoin","lineDash","miterLimit","fontSize"].forEach((function(e){Object.defineProperty(t,e,{set:function(n){("fillStyle"!==e&&"strokeStyle"!==e||"none"!==n&&null!==n)&&t["set"+e.charAt(0).toUpperCase()+e.slice(1)](n)}})})),t.createRadialGradient=function(){return t.createCircularGradient.apply(t,arguments)}},t.prototype._initEvent=function(){var t=this;this.event={};[{wxName:"touchStart",ecName:"mousedown"},{wxName:"touchMove",ecName:"mousemove"},{wxName:"touchEnd",ecName:"mouseup"},{wxName:"touchEnd",ecName:"click"}].forEach((function(e){t.event[e.wxName]=function(n){var i=n.touches[0];t.chart&&t.chart.getZr().handler.dispatch(e.ecName,{zrX:"tap"===e.wxName?i.clientX:i.x,zrY:"tap"===e.wxName?i.clientY:i.y})}}))},Object.defineProperty(t.prototype,"width",{get:function(){return this.canvasNode?this.canvasNode.width:0},set:function(t){this.canvasNode&&(this.canvasNode.width=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.canvasNode?this.canvasNode.height:0},set:function(t){this.canvasNode&&(this.canvasNode.height=t)},enumerable:!1,configurable:!0}),t}();export{t as default};
1
+ var t=function(){function t(t,e,n){this.ctx=t,this.chart=null,e?this.canvasNode=n:this._initStyle(t),this._initEvent()}return t.prototype.getContext=function(t){if("2d"===t)return this.ctx},t.prototype.setChart=function(t){this.chart=t},t.prototype.attachEvent=function(){},t.prototype.addEventListener=function(){},t.prototype.removeEventListener=function(){},t.prototype.detachEvent=function(){},t.prototype._initCanvas=function(t,e){t.util.getContext=function(){return e},t.util.$override("measureText",(function(t,n){return e.font=n||"12px sans-serif",e.measureText(t)}))},t.prototype._initStyle=function(t){["fillStyle","strokeStyle","globalAlpha","textAlign","textBaseAlign","shadow","lineWidth","lineCap","lineJoin","lineDash","miterLimit","fontSize"].forEach((function(e){Object.defineProperty(t,e,{set:function(n){("fillStyle"!==e&&"strokeStyle"!==e||"none"!==n&&null!==n)&&t["set"+e.charAt(0).toUpperCase()+e.slice(1)](n)}})})),t.createRadialGradient=function(){return t.createCircularGradient.apply(t,arguments)}},t.prototype._initEvent=function(){var t=this;this.event={};[{wxName:"touchStart",ecName:"mousedown"},{wxName:"touchMove",ecName:"mousemove"},{wxName:"touchEnd",ecName:"mouseup"},{wxName:"touchEnd",ecName:"click"}].forEach((function(e){t.event[e.wxName]=function(n){var i,o=n.touches[0];t.chart&&(null===(i=t.chart.getZr())||void 0===i||i.handler.dispatch(e.ecName,{zrX:"tap"===e.wxName?o.clientX:o.x,zrY:"tap"===e.wxName?o.clientY:o.y}))}}))},Object.defineProperty(t.prototype,"width",{get:function(){return this.canvasNode?this.canvasNode.width:0},set:function(t){this.canvasNode&&(this.canvasNode.width=t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.canvasNode?this.canvasNode.height:0},set:function(t){this.canvasNode&&(this.canvasNode.height=t)},enumerable:!1,configurable:!0}),t}();export{t as default};
2
2
  //# sourceMappingURL=wx-canvas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wx-canvas.js","sources":["../../../../src/components/Echarts/weapp/wx-canvas.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/member-ordering */\n/* eslint-disable accessor-pairs */\n/* eslint-disable @typescript-eslint/explicit-member-accessibility */\nimport { CanvasContext } from \"@tarojs/taro\";\n\nexport default class WxCanvas {\n private ctx: CanvasContext;\n\n private chart: any;\n\n private canvasNode: any;\n\n private event: {};\n\n constructor(ctx: CanvasContext, isNew: boolean, canvasNode?: any) {\n this.ctx = ctx;\n this.chart = null;\n if (isNew) {\n this.canvasNode = canvasNode;\n } else {\n this._initStyle(ctx);\n }\n\n this._initEvent();\n }\n\n getContext(contextType) {\n if (contextType === \"2d\") {\n return this.ctx;\n }\n }\n\n setChart(chart) {\n this.chart = chart;\n }\n\n attachEvent() {\n // noop\n }\n\n addEventListener() {\n // noop\n }\n\n removeEventListener() {\n // noop\n }\n\n detachEvent() {\n // noop\n }\n\n _initCanvas(zrender, ctx) {\n zrender.util.getContext = function () {\n return ctx;\n };\n\n zrender.util.$override(\"measureText\", function (text, font) {\n ctx.font = font || \"12px sans-serif\";\n return ctx.measureText(text);\n });\n }\n\n _initStyle(ctx) {\n let styles = [\n \"fillStyle\",\n \"strokeStyle\",\n \"globalAlpha\",\n \"textAlign\",\n \"textBaseAlign\",\n \"shadow\",\n \"lineWidth\",\n \"lineCap\",\n \"lineJoin\",\n \"lineDash\",\n \"miterLimit\",\n \"fontSize\",\n ];\n\n styles.forEach(style => {\n Object.defineProperty(ctx, style, {\n set: value => {\n if (\n (style !== \"fillStyle\" && style !== \"strokeStyle\") ||\n (value !== \"none\" && value !== null)\n ) {\n ctx[\"set\" + style.charAt(0).toUpperCase() + style.slice(1)](value);\n }\n },\n });\n });\n\n ctx.createRadialGradient = function () {\n return ctx.createCircularGradient.apply(ctx, arguments);\n };\n }\n\n _initEvent() {\n this.event = {};\n const eventNames = [\n {\n wxName: \"touchStart\",\n ecName: \"mousedown\",\n },\n {\n wxName: \"touchMove\",\n ecName: \"mousemove\",\n },\n {\n wxName: \"touchEnd\",\n ecName: \"mouseup\",\n },\n {\n wxName: \"touchEnd\",\n ecName: \"click\",\n },\n ];\n\n eventNames.forEach(name => {\n this.event[name.wxName] = e => {\n const touch = e.touches[0];\n if (this.chart) {\n this.chart.getZr().handler.dispatch(name.ecName, {\n zrX: name.wxName === \"tap\" ? touch.clientX : touch.x,\n zrY: name.wxName === \"tap\" ? touch.clientY : touch.y,\n });\n }\n };\n });\n }\n\n set width(w) {\n if (this.canvasNode) this.canvasNode.width = w;\n }\n\n set height(h) {\n if (this.canvasNode) this.canvasNode.height = h;\n }\n\n // eslint-disable-next-line @typescript-eslint/adjacent-overload-signatures\n get width() {\n if (this.canvasNode) return this.canvasNode.width;\n return 0;\n }\n\n // eslint-disable-next-line @typescript-eslint/adjacent-overload-signatures\n get height() {\n if (this.canvasNode) return this.canvasNode.height;\n return 0;\n }\n}\n"],"names":["WxCanvas","ctx","isNew","canvasNode","this","chart","_initStyle","_initEvent","prototype","getContext","contextType","setChart","attachEvent","addEventListener","removeEventListener","detachEvent","_initCanvas","zrender","util","$override","text","font","measureText","forEach","style","Object","defineProperty","set","value","charAt","toUpperCase","slice","createRadialGradient","createCircularGradient","apply","arguments","_this","event","wxName","ecName","name","e","touch","touches","getZr","handler","dispatch","zrX","clientX","x","zrY","clientY","y","get","width","w","height","h"],"mappings":"AAKA,IAAAA,EAAA,WASE,SAAAA,EAAYC,EAAoBC,EAAgBC,GAC9CC,KAAKH,IAAMA,EACXG,KAAKC,MAAQ,KACTH,EACFE,KAAKD,WAAaA,EAElBC,KAAKE,WAAWL,GAGlBG,KAAKG,YACN,CA8HH,OA5HEP,EAAUQ,UAAAC,WAAV,SAAWC,GACT,GAAoB,OAAhBA,EACF,OAAON,KAAKH,KAIhBD,EAAQQ,UAAAG,SAAR,SAASN,GACPD,KAAKC,MAAQA,GAGfL,EAAAQ,UAAAI,YAAA,aAIAZ,EAAAQ,UAAAK,iBAAA,aAIAb,EAAAQ,UAAAM,oBAAA,aAIAd,EAAAQ,UAAAO,YAAA,aAIAf,EAAAQ,UAAAQ,YAAA,SAAYC,EAAShB,GAC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D,aAAYC,KAAKD,WAAWmD,MAAQC,EAC9C,kCAED9B,OAAAC,eAAI1B,EAAMQ,UAAA,SAAA,CAWV6C,IAAA,WACE,OAAIjD,KAAKD,WAAmBC,KAAKD,WAAWqD,OACrC,CACR,EAdD7B,IAAA,SAAW8B,GACLrD,KAAKD,aAAYC,KAAKD,WAAWqD,OAASC,EAC/C,kCAaFzD,CAAD"}
1
+ {"version":3,"file":"wx-canvas.js","sources":["../../../../src/components/Echarts/weapp/wx-canvas.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/member-ordering */\n/* eslint-disable accessor-pairs */\n/* eslint-disable @typescript-eslint/explicit-member-accessibility */\nimport { CanvasContext } from \"@tarojs/taro\";\n\nexport default class WxCanvas {\n private ctx: CanvasContext;\n\n private chart: any;\n\n private canvasNode: any;\n\n private event: {};\n\n constructor(ctx: CanvasContext, isNew: boolean, canvasNode?: any) {\n this.ctx = ctx;\n this.chart = null;\n if (isNew) {\n this.canvasNode = canvasNode;\n } else {\n this._initStyle(ctx);\n }\n\n this._initEvent();\n }\n\n getContext(contextType) {\n if (contextType === \"2d\") {\n return this.ctx;\n }\n }\n\n setChart(chart) {\n this.chart = chart;\n }\n\n attachEvent() {\n // noop\n }\n\n addEventListener() {\n // noop\n }\n\n removeEventListener() {\n // noop\n }\n\n detachEvent() {\n // noop\n }\n\n _initCanvas(zrender, ctx) {\n zrender.util.getContext = function () {\n return ctx;\n };\n\n zrender.util.$override(\"measureText\", function (text, font) {\n ctx.font = font || \"12px sans-serif\";\n return ctx.measureText(text);\n });\n }\n\n _initStyle(ctx) {\n let styles = [\n \"fillStyle\",\n \"strokeStyle\",\n \"globalAlpha\",\n \"textAlign\",\n \"textBaseAlign\",\n \"shadow\",\n \"lineWidth\",\n \"lineCap\",\n \"lineJoin\",\n \"lineDash\",\n \"miterLimit\",\n \"fontSize\",\n ];\n\n styles.forEach(style => {\n Object.defineProperty(ctx, style, {\n set: value => {\n if (\n (style !== \"fillStyle\" && style !== \"strokeStyle\") ||\n (value !== \"none\" && value !== null)\n ) {\n ctx[\"set\" + style.charAt(0).toUpperCase() + style.slice(1)](value);\n }\n },\n });\n });\n\n ctx.createRadialGradient = function () {\n return ctx.createCircularGradient.apply(ctx, arguments);\n };\n }\n\n _initEvent() {\n this.event = {};\n const eventNames = [\n {\n wxName: \"touchStart\",\n ecName: \"mousedown\",\n },\n {\n wxName: \"touchMove\",\n ecName: \"mousemove\",\n },\n {\n wxName: \"touchEnd\",\n ecName: \"mouseup\",\n },\n {\n wxName: \"touchEnd\",\n ecName: \"click\",\n },\n ];\n\n eventNames.forEach(name => {\n this.event[name.wxName] = e => {\n const touch = e.touches[0];\n if (this.chart) {\n this.chart.getZr()?.handler.dispatch(name.ecName, {\n zrX: name.wxName === \"tap\" ? touch.clientX : touch.x,\n zrY: name.wxName === \"tap\" ? touch.clientY : touch.y,\n });\n }\n };\n });\n }\n\n set width(w) {\n if (this.canvasNode) this.canvasNode.width = w;\n }\n\n set height(h) {\n if (this.canvasNode) this.canvasNode.height = h;\n }\n\n // eslint-disable-next-line @typescript-eslint/adjacent-overload-signatures\n get width() {\n if (this.canvasNode) return this.canvasNode.width;\n return 0;\n }\n\n // eslint-disable-next-line @typescript-eslint/adjacent-overload-signatures\n get height() {\n if (this.canvasNode) return this.canvasNode.height;\n return 0;\n }\n}\n"],"names":["WxCanvas","ctx","isNew","canvasNode","this","chart","_initStyle","_initEvent","prototype","getContext","contextType","setChart","attachEvent","addEventListener","removeEventListener","detachEvent","_initCanvas","zrender","util","$override","text","font","measureText","forEach","style","Object","defineProperty","set","value","charAt","toUpperCase","slice","createRadialGradient","createCircularGradient","apply","arguments","_this","event","wxName","ecName","name","e","touch","touches","_a","getZr","handler","dispatch","zrX","clientX","x","zrY","clientY","y","get","width","w","height","h"],"mappings":"AAKA,IAAAA,EAAA,WASE,SAAAA,EAAYC,EAAoBC,EAAgBC,GAC9CC,KAAKH,IAAMA,EACXG,KAAKC,MAAQ,KACTH,EACFE,KAAKD,WAA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/B,QACW,QAAlBuC,EAAAR,EAAK/B,MAAMwC,eAAO,IAAAD,GAAAA,EAAEE,QAAQC,SAASP,EAAKD,OAAQ,CAChDS,IAAqB,QAAhBR,EAAKF,OAAmBI,EAAMO,QAAUP,EAAMQ,EACnDC,IAAqB,QAAhBX,EAAKF,OAAmBI,EAAMU,QAAUV,EAAMW,IAGzD,CACF,KAGF5B,OAAAC,eAAI1B,EAAKQ,UAAA,QAAA,CAST8C,IAAA,WACE,OAAIlD,KAAKD,WAAmBC,KAAKD,WAAWoD,MACrC,CACR,EAZD5B,IAAA,SAAU6B,GACJpD,KAAKD,aAAYC,KAAKD,WAAWoD,MAAQC,EAC9C,kCAED/B,OAAAC,eAAI1B,EAAMQ,UAAA,SAAA,CAWV8C,IAAA,WACE,OAAIlD,KAAKD,WAAmBC,KAAKD,WAAWsD,OACrC,CACR,EAdD9B,IAAA,SAAW+B,GACLtD,KAAKD,aAAYC,KAAKD,WAAWsD,OAASC,EAC/C,kCAaF1D,CAAD"}
@@ -1,2 +1,2 @@
1
- function t(t){for(var o=0;o<t.touches.length;++o){var n=t.touches[o];n.offsetX=n.x,n.offsetY=n.y}return t}function o(o){var n=o.chart,e=o.event;if(n&&e.touches.length>0){var a=e.touches[0],r=n.getZr().handler;r.dispatch("mousedown",{zrX:a.x,zrY:a.y,preventDefault:function(){},stopImmediatePropagation:function(){},stopPropagation:function(){}}),r.dispatch("mousemove",{zrX:a.x,zrY:a.y,preventDefault:function(){},stopImmediatePropagation:function(){},stopPropagation:function(){}}),r.processGesture(t(e),"start")}}function n(o){var n=o.chart,e=o.event;if(n&&e.touches.length>0){var a=e.touches[0],r=n.getZr().handler;r.dispatch("mousedown",{zrX:a.x,zrY:a.y,preventDefault:function(){},stopImmediatePropagation:function(){},stopPropagation:function(){}}),r.dispatch("mousemove",{zrX:a.x,zrY:a.y,preventDefault:function(){},stopImmediatePropagation:function(){},stopPropagation:function(){}}),r.processGesture(t(e),"start")}}function e(o){var n=o.chart,e=o.event;if(n){var a=e.changedTouches?e.changedTouches[0]:{},r=n.getZr().handler;r.dispatch("mouseup",{zrX:a.x,zrY:a.y,preventDefault:function(){},stopImmediatePropagation:function(){},stopPropagation:function(){}}),r.dispatch("click",{zrX:a.x,zrY:a.y,preventDefault:function(){},stopImmediatePropagation:function(){},stopPropagation:function(){}}),r.processGesture(t(e),"end")}}export{e as touchEnd,n as touchMove,o as touchStart,t as wrapTouch};
1
+ function t(t){for(var o=0;o<t.touches.length;++o){var n=t.touches[o];n.offsetX=n.x,n.offsetY=n.y}return t}function o(o){var n,e=o.chart,a=o.event;if(e&&a.touches.length>0){var r=a.touches[0],i=null===(n=e.getZr())||void 0===n?void 0:n.handler;i.dispatch("mousedown",{zrX:r.x,zrY:r.y,preventDefault:function(){},stopImmediatePropagation:function(){},stopPropagation:function(){}}),i.dispatch("mousemove",{zrX:r.x,zrY:r.y,preventDefault:function(){},stopImmediatePropagation:function(){},stopPropagation:function(){}}),i.processGesture(t(a),"start")}}function n(o){var n,e=o.chart,a=o.event;if(e&&a.touches.length>0){var r=a.touches[0],i=null===(n=e.getZr())||void 0===n?void 0:n.handler;i.dispatch("mousedown",{zrX:r.x,zrY:r.y,preventDefault:function(){},stopImmediatePropagation:function(){},stopPropagation:function(){}}),i.dispatch("mousemove",{zrX:r.x,zrY:r.y,preventDefault:function(){},stopImmediatePropagation:function(){},stopPropagation:function(){}}),i.processGesture(t(a),"start")}}function e(o){var n,e=o.chart,a=o.event;if(e){var r=a.changedTouches?a.changedTouches[0]:{},i=null===(n=e.getZr())||void 0===n?void 0:n.handler;i.dispatch("mouseup",{zrX:r.x,zrY:r.y,preventDefault:function(){},stopImmediatePropagation:function(){},stopPropagation:function(){}}),i.dispatch("click",{zrX:r.x,zrY:r.y,preventDefault:function(){},stopImmediatePropagation:function(){},stopPropagation:function(){}}),i.processGesture(t(a),"end")}}export{e as touchEnd,n as touchMove,o as touchStart,t as wrapTouch};
2
2
  //# sourceMappingURL=wx-touch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wx-touch.js","sources":["../../../../src/components/Echarts/weapp/wx-touch.ts"],"sourcesContent":["export function wrapTouch(event) {\n for (let i = 0; i < event.touches.length; ++i) {\n const touch = event.touches[i];\n touch.offsetX = touch.x;\n touch.offsetY = touch.y;\n }\n return event;\n}\n\nexport function touchStart({ chart, event }) {\n if (chart && event.touches.length > 0) {\n const touch = event.touches[0];\n const handler = chart.getZr().handler;\n handler.dispatch(\"mousedown\", {\n zrX: touch.x,\n zrY: touch.y,\n preventDefault: () => {},\n stopImmediatePropagation: () => {},\n stopPropagation: () => {},\n });\n handler.dispatch(\"mousemove\", {\n zrX: touch.x,\n zrY: touch.y,\n preventDefault: () => {},\n stopImmediatePropagation: () => {},\n stopPropagation: () => {},\n });\n handler.processGesture(wrapTouch(event), \"start\");\n }\n}\n\nexport function touchMove({ chart, event }) {\n if (chart && event.touches.length > 0) {\n const touch = event.touches[0];\n const handler = chart.getZr().handler;\n handler.dispatch(\"mousedown\", {\n zrX: touch.x,\n zrY: touch.y,\n preventDefault: () => {},\n stopImmediatePropagation: () => {},\n stopPropagation: () => {},\n });\n handler.dispatch(\"mousemove\", {\n zrX: touch.x,\n zrY: touch.y,\n preventDefault: () => {},\n stopImmediatePropagation: () => {},\n stopPropagation: () => {},\n });\n handler.processGesture(wrapTouch(event), \"start\");\n }\n}\n\nexport function touchEnd({ chart, event }) {\n if (chart) {\n const touch = event.changedTouches ? event.changedTouches[0] : {};\n const handler = chart.getZr().handler;\n handler.dispatch(\"mouseup\", {\n zrX: touch.x,\n zrY: touch.y,\n preventDefault: () => {},\n stopImmediatePropagation: () => {},\n stopPropagation: () => {},\n });\n handler.dispatch(\"click\", {\n zrX: touch.x,\n zrY: touch.y,\n preventDefault: () => {},\n stopImmediatePropagation: () => {},\n stopPropagation: () => {},\n });\n handler.processGesture(wrapTouch(event), \"end\");\n }\n}\n"],"names":["wrapTouch","event","i","touches","length","touch","offsetX","x","offsetY","y","touchStart","_a","chart","handler","getZr","dispatch","zrX","zrY","preventDefault","stopImmediatePropagation","stopPropagation","processGesture","touchMove","touchEnd","changedTouches"],"mappings":"AAAM,SAAUA,EAAUC,GACxB,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAME,QAAQC,SAAUF,EAAG,CAC7C,IAAMG,EAAQJ,EAAME,QAAQD,GAC5BG,EAAMC,QAAUD,EAAME,EACtBF,EAAMG,QAAUH,EAAMI,CACvB,CACD,OAAOR,CACT,CAEM,SAAUS,EAAWC,OAAEC,EAAKD,EAAAC,MAAEX,EAAKU,EAAAV,MACvC,GAAIW,GAASX,EAAME,QAAQC,OAAS,EAAG,CACrC,IAAMC,EAAQJ,EAAME,QAAQ,GACtBU,EAAUD,EAAME,QAAQD,QAC9BA,EAAQE,SAAS,YAAa,CAC5BC,IAAKX,EAAME,EACXU,IAAKZ,EAAMI,EACXS,eAAgB,WAAQ,EACxBC,yBAA0B,WAAQ,EAClCC,gBAAiB,WAAQ,IAE3BP,EAAQE,SAAS,YAAa,CAC5BC,IAAKX,EAAME,EACXU,IAAKZ,EAAMI,EACXS,eAAgB,WAAQ,EACxBC,yBAA0B,WAAQ,EAClCC,gBAAiB,WAAQ,IAE3BP,EAAQQ,eAAerB,EAAUC,GAAQ,QAC1C,CACH,CAEM,SAAUqB,EAAUX,OAAEC,EAAKD,EAAAC,MAAEX,EAAKU,EAAAV,MACtC,GAAIW,GAASX,EAAME,QAAQC,OAAS,EAAG,CACrC,IAAMC,EAAQJ,EAAME,QAAQ,GACtBU,EAAUD,EAAME,QAAQD,QAC9BA,EAAQE,SAAS,YAAa,CAC5BC,IAAKX,EAAME,EACXU,IAAKZ,EAAMI,EACXS,eAAgB,WAAQ,EACxBC,yBAA0B,WAAQ,EAClCC,gBAAiB,WAAQ,IAE3BP,EAAQE,SAAS,YAAa,CAC5BC,IAAKX,EAAME,EACXU,IAAKZ,EAAMI,EACXS,eAAgB,WAAQ,EACxBC,yBAA0B,WAAQ,EAClCC,gBAAiB,WAAQ,IAE3BP,EAAQQ,eAAerB,EAAUC,GAAQ,QAC1C,CACH,CAEM,SAAUsB,EAASZ,OAAEC,EAAKD,EAAAC,MAAEX,EAAKU,EAAAV,MACrC,GAAIW,EAAO,CACT,IAAMP,EAAQJ,EAAMuB,eAAiBvB,EAAMuB,eAAe,GAAK,GACzDX,EAAUD,EAAME,QAAQD,QAC9BA,EAAQE,SAAS,UAAW,CAC1BC,IAAKX,EAAME,EACXU,IAAKZ,EAAMI,EACXS,eAAgB,WAAQ,EACxBC,yBAA0B,WAAQ,EAClCC,gBAAiB,WAAQ,IAE3BP,EAAQE,SAAS,QAAS,CACxBC,IAAKX,EAAME,EACXU,IAAKZ,EAAMI,EACXS,eAAgB,WAAQ,EACxBC,yBAA0B,WAAQ,EAClCC,gBAAiB,WAAQ,IAE3BP,EAAQQ,eAAerB,EAAUC,GAAQ,MAC1C,CACH"}
1
+ {"version":3,"file":"wx-touch.js","sources":["../../../../src/components/Echarts/weapp/wx-touch.ts"],"sourcesContent":["export function wrapTouch(event) {\n for (let i = 0; i < event.touches.length; ++i) {\n const touch = event.touches[i];\n touch.offsetX = touch.x;\n touch.offsetY = touch.y;\n }\n return event;\n}\n\nexport function touchStart({ chart, event }) {\n if (chart && event.touches.length > 0) {\n const touch = event.touches[0];\n const handler = chart.getZr()?.handler;\n handler.dispatch(\"mousedown\", {\n zrX: touch.x,\n zrY: touch.y,\n preventDefault: () => {},\n stopImmediatePropagation: () => {},\n stopPropagation: () => {},\n });\n handler.dispatch(\"mousemove\", {\n zrX: touch.x,\n zrY: touch.y,\n preventDefault: () => {},\n stopImmediatePropagation: () => {},\n stopPropagation: () => {},\n });\n handler.processGesture(wrapTouch(event), \"start\");\n }\n}\n\nexport function touchMove({ chart, event }) {\n if (chart && event.touches.length > 0) {\n const touch = event.touches[0];\n const handler = chart.getZr()?.handler;\n handler.dispatch(\"mousedown\", {\n zrX: touch.x,\n zrY: touch.y,\n preventDefault: () => {},\n stopImmediatePropagation: () => {},\n stopPropagation: () => {},\n });\n handler.dispatch(\"mousemove\", {\n zrX: touch.x,\n zrY: touch.y,\n preventDefault: () => {},\n stopImmediatePropagation: () => {},\n stopPropagation: () => {},\n });\n handler.processGesture(wrapTouch(event), \"start\");\n }\n}\n\nexport function touchEnd({ chart, event }) {\n if (chart) {\n const touch = event.changedTouches ? event.changedTouches[0] : {};\n const handler = chart.getZr()?.handler;\n handler.dispatch(\"mouseup\", {\n zrX: touch.x,\n zrY: touch.y,\n preventDefault: () => {},\n stopImmediatePropagation: () => {},\n stopPropagation: () => {},\n });\n handler.dispatch(\"click\", {\n zrX: touch.x,\n zrY: touch.y,\n preventDefault: () => {},\n stopImmediatePropagation: () => {},\n stopPropagation: () => {},\n });\n handler.processGesture(wrapTouch(event), \"end\");\n }\n}\n"],"names":["wrapTouch","event","i","touches","length","touch","offsetX","x","offsetY","y","touchStart","_a","chart","handler","_b","getZr","dispatch","zrX","zrY","preventDefault","stopImmediatePropagation","stopPropagation","processGesture","touchMove","touchEnd","changedTouches"],"mappings":"AAAM,SAAUA,EAAUC,GACxB,IAAK,IAAIC,EAAI,EAAGA,EAAID,EAAME,QAAQC,SAAUF,EAAG,CAC7C,IAAMG,EAAQJ,EAAME,QAAQD,GAC5BG,EAAMC,QAAUD,EAAME,EACtBF,EAAMG,QAAUH,EAAMI,CACvB,CACD,OAAOR,CACT,CAEM,SAAUS,EAAWC,SAAEC,EAAKD,EAAAC,MAAEX,EAAKU,EAAAV,MACvC,GAAIW,GAASX,EAAME,QAAQC,OAAS,EAAG,CACrC,IAAMC,EAAQJ,EAAME,QAAQ,GACtBU,EAAyB,QAAfC,EAAAF,EAAMG,eAAS,IAAAD,OAAA,EAAAA,EAAAD,QAC/BA,EAAQG,SAAS,YAAa,CAC5BC,IAAKZ,EAAME,EACXW,IAAKb,EAAMI,EACXU,eAAgB,WAAQ,EACxBC,yBAA0B,WAAQ,EAClCC,gBAAiB,WAAQ,IAE3BR,EAAQG,SAAS,YAAa,CAC5BC,IAAKZ,EAAME,EACX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import{__rest as e,__assign as a}from"../node_modules/tslib/tslib.es6.js";import t,{forwardRef as n,useRef as l,useImperativeHandle as r}from"react";import{View as m,Text as o,Input as c}from"@tarojs/components";import i from"classnames";import{inputRange as s}from"../src/utils/index.js";var u=n((function(n,u){var p=n.onChange,f=n.maxlength,h=n.value,d=n.type,v=n.placeholder,x=n.label,E=n.labelHtml,N=n.RightComponent,b=n.onBlur,g=n.pattern,y=n.LeftComponent,w=n.LeftIcon,L=n.name,C=n.readonly,I=void 0!==C&&C,_=n.withArrow,B=void 0!==_&&_,H=n.direction,j=void 0===H?"row":H,A=n.border,R=void 0===A||A,T=n.mainExtra,M=n.padding,S=void 0!==M&&M,O=n.className,V=e(n,["onChange","maxlength","value","type","placeholder","label","labelHtml","RightComponent","onBlur","pattern","LeftComponent","LeftIcon","name","readonly","withArrow","direction","border","mainExtra","padding","className"]);function k(e){var a=s(e.target.value);e.target.value=a,p&&p(a)}function q(e){var a=s(e.target.value);b&&b(a)}var z=l(null);r(u,(function(){return{focus:function(){var e;null===(e=z.current)||void 0===e||e.focus()}}}));var D=i("xh-form-input",{column:"column"===j,border:R,padding:S,className:O});return"h5"!==process.env.TARO_ENV?t.createElement(m,{className:D},t.createElement(m,{className:"xh-form-input-main"},t.createElement(m,{className:"xh-form-input-main-left"},x&&t.createElement(m,{className:"xh-form-input-main-left-label"},x,w&&t.createElement(m,{className:"xh-form-input-main-left-label-icon"},w)),E&&t.createElement("label",{dangerouslySetInnerHTML:{__html:E},className:"label"}),t.createElement(m,null,y)),t.createElement(m,{className:"xh-form-input-main-center"},I?t.createElement(o,{className:i("xh-form-input-readonly",{"xh-form-input-placeholder":!h})},h||v):t.createElement(c,a({},V,{ref:z,className:"xh-form-input-main-center-native",maxlength:f,name:L,placeholder:v,type:d,value:h,onBlur:q,onInput:k}))),T&&t.createElement(m,{className:"xh-form-input-main-extra"},T)),t.createElement(m,{className:"xh-form-input-right"},N,B&&t.createElement(m,{className:"arrow"}))):t.createElement("div",{className:D},t.createElement("div",{className:"xh-form-input-main"},t.createElement("div",{className:"xh-form-input-main-left"},x&&t.createElement("label",{className:"xh-form-input-main-left-label"},x,w&&t.createElement("div",{className:"xh-form-input-main-left-label-icon"},w)),E&&t.createElement("label",{dangerouslySetInnerHTML:{__html:E},className:"label"}),t.createElement("div",null,y)),t.createElement("div",{className:"xh-form-input-main-center"},I?t.createElement("p",{className:i("xh-form-input-main-center-readonly",{"xh-form-input-main-placeholder":!h})},h||v):t.createElement("input",{ref:z,className:"xh-form-input-main-center-native",maxLength:f,name:L,pattern:g,placeholder:v,type:d,value:h,onBlur:q,onInput:k})),T&&t.createElement("div",{className:"xh-form-input-main-extra"},T)),t.createElement("div",{className:"xh-form-input-right"},N,B&&t.createElement("span",{className:"arrow"})))}));export{u as default};
1
+ import{__rest as e,__assign as a}from"../node_modules/tslib/tslib.es6.js";import t,{forwardRef as n,useRef as l,useImperativeHandle as r}from"react";import{View as m,Text as o,Input as i}from"@tarojs/components";import c from"classnames";import{inputRange as s}from"../src/utils/index.js";var u=n((function(n,u){var p=n.onChange,f=n.maxlength,h=n.value,d=n.type,v=n.placeholder,x=n.label,E=n.labelHtml,N=n.RightComponent,b=n.onBlur,g=n.pattern,y=n.LeftComponent,w=n.LeftIcon,L=n.name,C=n.readonly,I=void 0!==C&&C,_=n.withArrow,B=void 0!==_&&_,H=n.direction,j=void 0===H?"row":H,A=n.border,R=void 0===A||A,T=n.mainExtra,M=n.padding,S=void 0!==M&&M,O=n.className,V=e(n,["onChange","maxlength","value","type","placeholder","label","labelHtml","RightComponent","onBlur","pattern","LeftComponent","LeftIcon","name","readonly","withArrow","direction","border","mainExtra","padding","className"]);function k(e){var a=s(e.target.value);e.target.value=a,p&&p(a)}function q(e){var a=s(e.target.value);b&&b(a)}var z=l(null);r(u,(function(){return{focus:function(){var e;null===(e=z.current)||void 0===e||e.focus()}}}));var D=c("xh-form-input",{column:"column"===j,border:R,padding:S},O);return"h5"!==process.env.TARO_ENV?t.createElement(m,{className:D},t.createElement(m,{className:"xh-form-input-main"},t.createElement(m,{className:"xh-form-input-main-left"},x&&t.createElement(m,{className:"xh-form-input-main-left-label"},x,w&&t.createElement(m,{className:"xh-form-input-main-left-label-icon"},w)),E&&t.createElement("label",{dangerouslySetInnerHTML:{__html:E},className:"label"}),t.createElement(m,null,y)),t.createElement(m,{className:"xh-form-input-main-center"},I?t.createElement(o,{className:c("xh-form-input-readonly",{"xh-form-input-placeholder":!h})},h||v):t.createElement(i,a({},V,{ref:z,className:"xh-form-input-main-center-native",maxlength:f,name:L,placeholder:v,type:d,value:h,onBlur:q,onInput:k}))),T&&t.createElement(m,{className:"xh-form-input-main-extra"},T)),t.createElement(m,{className:"xh-form-input-right"},N,B&&t.createElement(m,{className:"arrow"}))):t.createElement("div",{className:D},t.createElement("div",{className:"xh-form-input-main"},t.createElement("div",{className:"xh-form-input-main-left"},x&&t.createElement("label",{className:"xh-form-input-main-left-label"},x,w&&t.createElement("div",{className:"xh-form-input-main-left-label-icon"},w)),E&&t.createElement("label",{dangerouslySetInnerHTML:{__html:E},className:"label"}),t.createElement("div",null,y)),t.createElement("div",{className:"xh-form-input-main-center"},I?t.createElement("p",{className:c("xh-form-input-main-center-readonly",{"xh-form-input-main-placeholder":!h})},h||v):t.createElement("input",{ref:z,className:"xh-form-input-main-center-native",maxLength:f,name:L,pattern:g,placeholder:v,type:d,value:h,onBlur:q,onInput:k})),T&&t.createElement("div",{className:"xh-form-input-main-extra"},T)),t.createElement("div",{className:"xh-form-input-right"},N,B&&t.createElement("span",{className:"arrow"})))}));export{u as default};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/FormInput/index.tsx"],"sourcesContent":["import React, {\n ReactNode,\n useRef,\n useImperativeHandle,\n forwardRef,\n} from \"react\";\nimport {\n Input,\n View,\n Text,\n InputProps,\n CommonEventFunction,\n} from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport { inputRange } from \"../../utils/index\";\n\nimport \"./index.scss\";\n\nexport type HTMLFormType =\n | \"tel\"\n | \"text\"\n | \"number\"\n | \"password\"\n | \"idcard\"\n | \"digit\"\n | \"safe-password\"\n | \"nickname\";\n\nexport type FormInputProps = {\n onChange?: (value: string) => void;\n onBlur?: (value: string) => void;\n /** 当键盘输入时,触发input事件,event.detail = {value, cursor, keyCode},处理函数可以直接 return 一个字符串,将替换输入框的内容。\n * @supported weapp, h5, rn\n */\n onInput?: CommonEventFunction<InputProps.inputEventDetail>;\n\n /** 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度\n * @supported weapp, h5, rn\n */\n onFocus?: CommonEventFunction<InputProps.inputForceEventDetail>;\n\n /** 输入框失去焦点时触发\n *\n * event.detail = {value: value}\n * @supported weapp, h5, rn\n */\n value?: string;\n maxlength?: number;\n placeholder?: string;\n type?: HTMLFormType;\n pattern?: string;\n RightComponent?: ReactNode;\n label?: string;\n labelHtml?: string;\n LeftComponent?: ReactNode;\n LeftIcon?: ReactNode;\n name?: string;\n readonly?: boolean;\n withArrow?: boolean;\n direction?: \"row\" | \"column\";\n border?: boolean;\n mainExtra?: ReactNode;\n padding?: boolean;\n password?: boolean;\n focus?: boolean;\n /** 设置键盘右下角按钮的文字\n * @default done\n * @supported weapp, rn\n */\n confirmType?: \"send\" | \"search\" | \"next\" | \"go\" | \"done\";\n /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上\n * @supported h5\n */\n nativeProps?: Record<string, unknown>;\n className?: string;\n};\n\nexport type FocusHandler = { focus: () => void };\n\nconst FormInput = forwardRef<FocusHandler, FormInputProps>((props, formRef) => {\n const {\n onChange,\n maxlength,\n value,\n type,\n placeholder,\n label,\n labelHtml,\n RightComponent,\n onBlur,\n pattern,\n LeftComponent,\n LeftIcon,\n name,\n readonly = false,\n withArrow = false,\n direction = \"row\",\n border = true,\n mainExtra,\n padding = false,\n className,\n ...rest\n } = props;\n\n function handleChange(e): any {\n let inputValue = inputRange(e.target.value);\n e.target.value = inputValue;\n onChange && onChange(inputValue);\n }\n\n function handleBlur(e): any {\n let inputValue = inputRange(e.target.value);\n onBlur && onBlur(inputValue);\n }\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n useImperativeHandle(formRef, () => ({\n focus() {\n inputRef.current?.focus();\n },\n }));\n\n const wrapperCls = classNames(\"xh-form-input\", {\n column: direction === \"column\",\n border,\n padding,\n className,\n });\n\n if (process.env.TARO_ENV !== \"h5\") {\n return (\n <View className={wrapperCls}>\n <View className=\"xh-form-input-main\">\n <View className=\"xh-form-input-main-left\">\n {label && (\n <View className=\"xh-form-input-main-left-label\">\n {label}\n {LeftIcon && (\n <View className=\"xh-form-input-main-left-label-icon\">\n {LeftIcon}\n </View>\n )}\n </View>\n )}\n {labelHtml && (\n <label\n dangerouslySetInnerHTML={{ __html: labelHtml }}\n className=\"label\"\n />\n )}\n <View>{LeftComponent}</View>\n </View>\n <View className=\"xh-form-input-main-center\">\n {readonly ? (\n <Text\n className={classNames(\"xh-form-input-readonly\", {\n \"xh-form-input-placeholder\": !value,\n })}\n >\n {value || placeholder}\n </Text>\n ) : (\n <Input\n {...rest}\n ref={inputRef}\n className=\"xh-form-input-main-center-native\"\n maxlength={maxlength}\n name={name}\n placeholder={placeholder}\n type={type as InputProps[\"type\"]}\n value={value}\n onBlur={handleBlur}\n onInput={handleChange}\n />\n )}\n </View>\n {mainExtra && (\n <View className=\"xh-form-input-main-extra\">{mainExtra}</View>\n )}\n </View>\n <View className=\"xh-form-input-right\">\n {RightComponent}\n {withArrow && <View className=\"arrow\" />}\n </View>\n </View>\n );\n }\n\n return (\n <div className={wrapperCls}>\n <div className=\"xh-form-input-main\">\n <div className=\"xh-form-input-main-left\">\n {label && (\n <label className=\"xh-form-input-main-left-label\">\n {label}\n {LeftIcon && (\n <div className=\"xh-form-input-main-left-label-icon\">\n {LeftIcon}\n </div>\n )}\n </label>\n )}\n {labelHtml && (\n <label\n dangerouslySetInnerHTML={{ __html: labelHtml }}\n className=\"label\"\n />\n )}\n <div>{LeftComponent}</div>\n </div>\n <div className=\"xh-form-input-main-center\">\n {readonly ? (\n <p\n className={classNames(\"xh-form-input-main-center-readonly\", {\n \"xh-form-input-main-placeholder\": !value,\n })}\n >\n {value || placeholder}\n </p>\n ) : (\n <input\n ref={inputRef}\n className=\"xh-form-input-main-center-native\"\n maxLength={maxlength}\n name={name}\n pattern={pattern}\n placeholder={placeholder}\n type={type}\n value={value}\n onBlur={handleBlur}\n onInput={handleChange}\n />\n )}\n </div>\n {mainExtra && (\n <div className=\"xh-form-input-main-extra\">{mainExtra}</div>\n )}\n </div>\n <div className=\"xh-form-input-right\">\n {RightComponent}\n {withArrow && <span className=\"arrow\" />}\n </div>\n </div>\n );\n});\nexport default FormInput;\n"],"names":["FormInput","forwardRef","props","formRef","onChange","maxlength","value","type","placeholder","label","labelHtml","RightComponent","onBlur","pattern","LeftComponent","LeftIcon","name","_a","readonly","_b","withArrow","_c","direction","_d","border","mainExtra","_e","padding","className","rest","__rest","handleChange","e","inputValue","inputRange","target","handleBlur","inputRef","useRef","useImperativeHandle","focus","current","wrapperCls","classNames","column","process","env","TARO_ENV","React","createElement","View","dangerouslySetInnerHTML","__html","Text","Input","ref","onInput","maxLength"],"mappings":"iSA+EA,IAAMA,EAAYC,GAAyC,SAACC,EAAOC,GAE/D,IAAAC,EAqBEF,EAAKE,SApBPC,EAoBEH,EApBOG,UACTC,EAmBEJ,EAAKI,MAlBPC,EAkBEL,EAlBEK,KACJC,EAiBEN,EAAKM,YAhBPC,EAgBEP,EAhBGO,MACLC,EAeER,EAAKQ,UAdPC,EAcET,EAdYS,eACdC,EAaEV,EAAKU,OAZPC,EAYEX,EAZKW,QACPC,EAWEZ,EAAKY,cAVPC,EAUEb,EAVMa,SACRC,EASEd,EATEc,KACJC,EAQEf,EARcgB,SAAhBA,OAAQ,IAAAD,GAAQA,EAChBE,EAOEjB,EAAKkB,UAPPA,OAAY,IAAAD,GAAKA,EACjBE,EAMEnB,EANeoB,UAAjBA,OAAS,IAAAD,E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,CAAAzB,UAAWe,EAAW,yBAA0B,CAC9C,6BAA8BrC,KAG/BA,GAASE,GAGZwC,EAACC,cAAAK,OACKzB,EAAI,CACR0B,IAAKlB,EACLT,UAAU,mCACVvB,UAAWA,EACXW,KAAMA,EACNR,YAAaA,EACbD,KAAMA,EACND,MAAOA,EACPM,OAAQwB,EACRoB,QAASzB,MAIdN,GACCuB,EAACC,cAAAC,EAAK,CAAAtB,UAAU,4BAA4BH,IAGhDuB,EAAAC,cAACC,EAAI,CAACtB,UAAU,uBACbjB,EACAS,GAAa4B,EAACC,cAAAC,EAAK,CAAAtB,UAAU,YAOpCoB,EAAAC,cAAA,MAAA,CAAKrB,UAAWc,GACdM,EAAKC,cAAA,MAAA,CAAArB,UAAU,sBACboB,EAAKC,cAAA,MAAA,CAAArB,UAAU,2BACZnB,GACCuC,EAAOC,cAAA,QAAA,CAAArB,UAAU,iCACdnB,EACAM,GACCiC,EAAAC,cAAA,MAAA,CAAKrB,UAAU,sCACZb,IAKRL,GACCsC,EACEC,cAAA,QAAA,CAAAE,wBAAyB,CAAEC,OAAQ1C,GACnCkB,UAAU,UAGdoB,EAAMC,cAAA,MAAA,KAAAnC,IAERkC,EAAAC,cAAA,MAAA,CAAKrB,UAAU,6BACZV,EACC8B,qBACEpB,UAAWe,EAAW,qCAAsC,CAC1D,kCAAmCrC,KAGpCA,GAASE,GAGZwC,EACEC,cAAA,QAAA,CAAAM,IAAKlB,EACLT,UAAU,mCACV6B,UAAWpD,EACXW,KAAMA,EACNH,QAASA,EACTL,YAAaA,EACbD,KAAMA,EACND,MAAOA,EACPM,OAAQwB,EACRoB,QAASzB,KAIdN,GACCuB,EAAAC,cAAA,MAAA,CAAKrB,UAAU,4BAA4BH,IAG/CuB,EAAKC,cAAA,MAAA,CAAArB,UAAU,uBACZjB,EACAS,GAAa4B,wBAAMpB,UAAU,WAItC"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/FormInput/index.tsx"],"sourcesContent":["import React, {\n ReactNode,\n useRef,\n useImperativeHandle,\n forwardRef,\n} from \"react\";\nimport {\n Input,\n View,\n Text,\n InputProps,\n CommonEventFunction,\n} from \"@tarojs/components\";\nimport classNames from \"classnames\";\nimport { inputRange } from \"../../utils/index\";\n\nimport \"./index.scss\";\n\nexport type HTMLFormType =\n | \"tel\"\n | \"text\"\n | \"number\"\n | \"password\"\n | \"idcard\"\n | \"digit\"\n | \"safe-password\"\n | \"nickname\";\n\nexport type FormInputProps = {\n onChange?: (value: string) => void;\n onBlur?: (value: string) => void;\n /** 当键盘输入时,触发input事件,event.detail = {value, cursor, keyCode},处理函数可以直接 return 一个字符串,将替换输入框的内容。\n * @supported weapp, h5, rn\n */\n onInput?: CommonEventFunction<InputProps.inputEventDetail>;\n\n /** 输入框聚焦时触发,event.detail = { value, height },height 为键盘高度\n * @supported weapp, h5, rn\n */\n onFocus?: CommonEventFunction<InputProps.inputForceEventDetail>;\n\n /** 输入框失去焦点时触发\n *\n * event.detail = {value: value}\n * @supported weapp, h5, rn\n */\n value?: string;\n maxlength?: number;\n placeholder?: string;\n type?: HTMLFormType;\n pattern?: string;\n RightComponent?: ReactNode;\n label?: string;\n labelHtml?: string;\n LeftComponent?: ReactNode;\n LeftIcon?: ReactNode;\n name?: string;\n readonly?: boolean;\n withArrow?: boolean;\n direction?: \"row\" | \"column\";\n border?: boolean;\n mainExtra?: ReactNode;\n padding?: boolean;\n password?: boolean;\n focus?: boolean;\n /** 设置键盘右下角按钮的文字\n * @default done\n * @supported weapp, rn\n */\n confirmType?: \"send\" | \"search\" | \"next\" | \"go\" | \"done\";\n /** 用于透传 `WebComponents` 上的属性到内部 H5 标签上\n * @supported h5\n */\n nativeProps?: Record<string, unknown>;\n className?: string;\n};\n\nexport type FocusHandler = { focus: () => void };\n\nconst FormInput = forwardRef<FocusHandler, FormInputProps>((props, formRef) => {\n const {\n onChange,\n maxlength,\n value,\n type,\n placeholder,\n label,\n labelHtml,\n RightComponent,\n onBlur,\n pattern,\n LeftComponent,\n LeftIcon,\n name,\n readonly = false,\n withArrow = false,\n direction = \"row\",\n border = true,\n mainExtra,\n padding = false,\n className,\n ...rest\n } = props;\n\n function handleChange(e): any {\n let inputValue = inputRange(e.target.value);\n e.target.value = inputValue;\n onChange && onChange(inputValue);\n }\n\n function handleBlur(e): any {\n let inputValue = inputRange(e.target.value);\n onBlur && onBlur(inputValue);\n }\n\n const inputRef = useRef<HTMLInputElement>(null);\n\n useImperativeHandle(formRef, () => ({\n focus() {\n inputRef.current?.focus();\n },\n }));\n\n const wrapperCls = classNames(\n \"xh-form-input\",\n {\n column: direction === \"column\",\n border,\n padding,\n },\n className\n );\n\n if (process.env.TARO_ENV !== \"h5\") {\n return (\n <View className={wrapperCls}>\n <View className=\"xh-form-input-main\">\n <View className=\"xh-form-input-main-left\">\n {label && (\n <View className=\"xh-form-input-main-left-label\">\n {label}\n {LeftIcon && (\n <View className=\"xh-form-input-main-left-label-icon\">\n {LeftIcon}\n </View>\n )}\n </View>\n )}\n {labelHtml && (\n <label\n dangerouslySetInnerHTML={{ __html: labelHtml }}\n className=\"label\"\n />\n )}\n <View>{LeftComponent}</View>\n </View>\n <View className=\"xh-form-input-main-center\">\n {readonly ? (\n <Text\n className={classNames(\"xh-form-input-readonly\", {\n \"xh-form-input-placeholder\": !value,\n })}\n >\n {value || placeholder}\n </Text>\n ) : (\n <Input\n {...rest}\n ref={inputRef}\n className=\"xh-form-input-main-center-native\"\n maxlength={maxlength}\n name={name}\n placeholder={placeholder}\n type={type as InputProps[\"type\"]}\n value={value}\n onBlur={handleBlur}\n onInput={handleChange}\n />\n )}\n </View>\n {mainExtra && (\n <View className=\"xh-form-input-main-extra\">{mainExtra}</View>\n )}\n </View>\n <View className=\"xh-form-input-right\">\n {RightComponent}\n {withArrow && <View className=\"arrow\" />}\n </View>\n </View>\n );\n }\n\n return (\n <div className={wrapperCls}>\n <div className=\"xh-form-input-main\">\n <div className=\"xh-form-input-main-left\">\n {label && (\n <label className=\"xh-form-input-main-left-label\">\n {label}\n {LeftIcon && (\n <div className=\"xh-form-input-main-left-label-icon\">\n {LeftIcon}\n </div>\n )}\n </label>\n )}\n {labelHtml && (\n <label\n dangerouslySetInnerHTML={{ __html: labelHtml }}\n className=\"label\"\n />\n )}\n <div>{LeftComponent}</div>\n </div>\n <div className=\"xh-form-input-main-center\">\n {readonly ? (\n <p\n className={classNames(\"xh-form-input-main-center-readonly\", {\n \"xh-form-input-main-placeholder\": !value,\n })}\n >\n {value || placeholder}\n </p>\n ) : (\n <input\n ref={inputRef}\n className=\"xh-form-input-main-center-native\"\n maxLength={maxlength}\n name={name}\n pattern={pattern}\n placeholder={placeholder}\n type={type}\n value={value}\n onBlur={handleBlur}\n onInput={handleChange}\n />\n )}\n </div>\n {mainExtra && (\n <div className=\"xh-form-input-main-extra\">{mainExtra}</div>\n )}\n </div>\n <div className=\"xh-form-input-right\">\n {RightComponent}\n {withArrow && <span className=\"arrow\" />}\n </div>\n </div>\n );\n});\nexport default FormInput;\n"],"names":["FormInput","forwardRef","props","formRef","onChange","maxlength","value","type","placeholder","label","labelHtml","RightComponent","onBlur","pattern","LeftComponent","LeftIcon","name","_a","readonly","_b","withArrow","_c","direction","_d","border","mainExtra","_e","padding","className","rest","__rest","handleChange","e","inputValue","inputRange","target","handleBlur","inputRef","useRef","useImperativeHandle","focus","current","wrapperCls","classNames","column","process","env","TARO_ENV","React","createElement","View","dangerouslySetInnerHTML","__html","Text","Input","ref","onInput","maxLength"],"mappings":"iSA+EA,IAAMA,EAAYC,GAAyC,SAACC,EAAOC,GAE/D,IAAAC,EAqBEF,EAAKE,SApBPC,EAoBEH,EApBOG,UACTC,EAmBEJ,EAAKI,MAlBPC,EAkBEL,EAlBEK,KACJC,EAiBEN,EAAKM,YAhBPC,EAgBEP,EAhBGO,MACLC,EAeER,EAAKQ,UAdPC,EAcET,EAdYS,eACdC,EAaEV,EAAKU,OAZPC,EAYEX,EAZKW,QACPC,EAWEZ,EAAKY,cAVPC,EAUEb,EAVMa,SACRC,EASE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AA,MAAA,CAAArB,UAAU,uBACZjB,EACAS,GAAa4B,wBAAMpB,UAAU,WAItC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../../src/components/Icon/index.tsx"],"sourcesContent":["import React from \"react\";\nimport classNames from \"classnames\";\nimport { pxTransform } from \"@/utils\";\nimport type { StandardLonghandProperties } from \"csstype\";\nimport { XHComponentCommonProps } from \"../../types\";\n\nimport \"./index.scss\";\n\nexport type XHIcon =\n | \"prompt\"\n | \"score\"\n | \"info\"\n | \"failure\"\n | \"success\"\n | \"loading\"\n | \"back\"\n | \"notice\"\n | \"scan\"\n | \"light\"\n | \"faceScan\"\n | \"delete\"\n | \"radioFull\"\n | \"checkboxFull\"\n | \"checkedSquare\"\n | \"checked2\"\n | \"arrowTop\"\n | \"notice2\"\n | \"position\"\n | \"contacts\"\n | \"billFull\"\n | \"bill2\"\n | \"bill3\"\n | \"bill4\"\n | \"edit\"\n | \"editFull\"\n | \"camera\"\n | \"close\"\n | \"gift\"\n | \"message\"\n | \"user\"\n | \"wenhao\"\n | \"kefu\"\n | \"play\"\n | \"arrowLeft\"\n | \"arrowRight\"\n | \"keyboardClose\"\n | \"add\"\n | \"tongxunlu\"\n | \"zhuyi\"\n | \"duigou\"\n | \"edit2\"\n | \"alipay\"\n | \"wechat\"\n | \"friendPay\"\n | \"pen\"\n | \"location\"\n | \"waiting\";\n\nexport type XHIconProps = {\n icon: XHIcon;\n size?: number;\n color?: StandardLonghandProperties[\"color\"];\n style?: React.CSSProperties;\n onClick?: () => void;\n} & XHComponentCommonProps;\n\nconst Icon: React.FC<XHIconProps> = props => {\n const { icon = \"\", size = 0, className, color, style, ...rest } = props;\n\n const fixIcon = icon && `xh-icon-${icon}`;\n const iconCls = classNames(\"xh-icon\", fixIcon, className);\n\n const finalStyle: React.CSSProperties = {\n ...style,\n fontSize: pxTransform(size),\n color,\n };\n\n return <span className={iconCls} {...{ style: finalStyle }} {...rest} />;\n};\n\nexport default Icon;\n"],"names":["Icon","props","_a","icon","_b","size","className","color","style","rest","__rest","fixIcon","concat","iconCls","classNames","finalStyle","__assign","fontSize","pxTransform","React","createElement"],"mappings":"6KAkEM,IAAAA,EAA8B,SAAAC,GAC1B,IAAAC,EAA0DD,EAAKE,KAA/DA,aAAO,GAAED,EAAEE,EAA+CH,EAAvCI,KAARA,OAAO,IAAAD,EAAA,IAAGE,EAAqCL,YAA1BM,EAA0BN,EAAKM,MAAxBC,EAAmBP,EAAKO,MAAdC,EAAIC,EAAKT,EAA5D,CAAA,OAAA,OAAA,YAAA,QAAA,UAEAU,EAAUR,GAAQ,WAAWS,OAAAT,GAC7BU,EAAUC,EAAW,UAAWH,EAASL,GAEzCS,EAAUC,EAAAA,EAAA,CAAA,EACXR,GAAK,CACRS,SAAUC,EAAYb,GACtBE,MAAKA,IAGP,OAAOY,EAAMC,cAAA,OAAAJ,EAAA,CAAAV,UAAWO,GAAa,CAAEL,MAAOO,GAAkBN,GAClE"}
1
+ {"version":3,"file":"index.js","sources":["../../../src/components/Icon/index.tsx"],"sourcesContent":["import React from \"react\";\nimport classNames from \"classnames\";\nimport { pxTransform } from \"@/utils\";\nimport type { StandardLonghandProperties } from \"csstype\";\nimport { XHComponentCommonProps } from \"../../types\";\n\nimport \"./index.scss\";\n\nexport type XHIcon =\n | \"prompt\"\n | \"score\"\n | \"info\"\n | \"failure\"\n | \"success\"\n | \"loading\"\n | \"back\"\n | \"notice\"\n | \"scan\"\n | \"light\"\n | \"faceScan\"\n | \"delete\"\n | \"radioFull\"\n | \"checkboxFull\"\n | \"checkedSquare\"\n | \"checked2\"\n | \"arrowTop\"\n | \"notice2\"\n | \"position\"\n | \"contacts\"\n | \"billFull\"\n | \"bill2\"\n | \"bill3\"\n | \"bill4\"\n | \"edit\"\n | \"editFull\"\n | \"camera\"\n | \"close\"\n | \"gift\"\n | \"message\"\n | \"user\"\n | \"wenhao\"\n | \"kefu\"\n | \"play\"\n | \"arrowLeft\"\n | \"arrowRight\"\n | \"keyboardClose\"\n | \"add\"\n | \"tongxunlu\"\n | \"zhuyi\"\n | \"duigou\"\n | \"edit2\"\n | \"alipay\"\n | \"wechat\"\n | \"friendPay\"\n | \"pen\"\n | \"location\"\n | \"search\"\n | \"qa\"\n | \"thumbsUp\"\n | \"thumbsDown\"\n | \"thumbsUpFull\"\n | \"thumbsDownFull\"\n | \"waiting\"\n | (string & {});\n\nexport type XHIconProps = {\n icon: XHIcon;\n size?: number;\n color?: StandardLonghandProperties[\"color\"];\n style?: React.CSSProperties;\n onClick?: () => void;\n} & XHComponentCommonProps;\n\nconst Icon: React.FC<XHIconProps> = props => {\n const { icon = \"\", size = 0, className, color, style, ...rest } = props;\n\n const fixIcon = icon && `xh-icon-${icon}`;\n const iconCls = classNames(\"xh-icon\", fixIcon, className);\n\n const finalStyle: React.CSSProperties = {\n ...style,\n fontSize: pxTransform(size),\n color,\n };\n\n return <span className={iconCls} {...{ style: finalStyle }} {...rest} />;\n};\n\nexport default Icon;\n"],"names":["Icon","props","_a","icon","_b","size","className","color","style","rest","__rest","fixIcon","concat","iconCls","classNames","finalStyle","__assign","fontSize","pxTransform","React","createElement"],"mappings":"6KAyEM,IAAAA,EAA8B,SAAAC,GAC1B,IAAAC,EAA0DD,EAAKE,KAA/DA,aAAO,GAAED,EAAEE,EAA+CH,EAAvCI,KAARA,OAAO,IAAAD,EAAA,IAAGE,EAAqCL,YAA1BM,EAA0BN,EAAKM,MAAxBC,EAAmBP,EAAKO,MAAdC,EAAIC,EAAKT,EAA5D,CAAA,OAAA,OAAA,YAAA,QAAA,UAEAU,EAAUR,GAAQ,WAAWS,OAAAT,GAC7BU,EAAUC,EAAW,UAAWH,EAASL,GAEzCS,EAAUC,EAAAA,EAAA,CAAA,EACXR,GAAK,CACRS,SAAUC,EAAYb,GACtBE,MAAKA,IAGP,OAAOY,EAAMC,cAAA,OAAAJ,EAAA,CAAAV,UAAWO,GAAa,CAAEL,MAAOO,GAAkBN,GAClE"}