index.js 4.3 KB

12345678910
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["components/tuiDrawer/index"],{"303f":function(t,e,i){"use strict";i.r(e);var a=i("3e40"),n=i.n(a);for(var o in a)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return a[t]}))}(o);e["default"]=n.a},"3e40":function(t,e,i){"use strict";(function(t){var a=i("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=a(i("19b6")),o={name:"tuiSwipeAction",emits:["click"],mixins:[n.default],props:{actions:{type:Array,default:function(){return[]}},closable:{type:Boolean,default:!0},showMask:{type:Boolean,default:!0},operateWidth:{type:Number,default:80},params:{type:Object,default:function(){return{}}},forbid:{type:Boolean,default:!1},open:{type:Boolean,default:!1},backgroundColor:{type:String,default:"#fff"}},watch:{actions:function(t,e){this.updateButtonSize()},open:function(t){this.manualSwitch(t)}},data:function(){return{tStart:{pageX:0,pageY:0},limitMove:0,position:{pageX:0,pageY:0},isShowBtn:!1,move:!1}},mounted:function(){this.updateButtonSize()},methods:{swipeDirection:function(t,e,i,a){return Math.abs(t-e)>=Math.abs(i-a)?t-e>0?"Left":"Right":i-a>0?"Up":"Down"},loop:function(){},updateButtonSize:function(){var e=this.actions;if(e.length>0){t.createSelectorQuery().in(this);var i=0;e.forEach((function(t){i+=t.width||0})),this.limitMove=i}else this.limitMove=this.operateWidth},handlerTouchstart:function(t){if(!this.forbid){var e=t.touches;if(!(e&&e.length>1)){this.move=!0,e=e?t.touches[0]:{},(!e||void 0===e.pageX&&void 0===e.pageY)&&(e={pageX:t.pageX,pageY:t.pageY});var i=this.tStart;if(e)for(var a in i)e[a]&&(i[a]=e[a])}}},swipper:function(t){var e=this.tStart,i={pageX:t.pageX-e.pageX,pageY:t.pageY-e.pageY};this.limitMove<Math.abs(i.pageX)&&(i.pageX=-this.limitMove),this.position=i},handlerTouchmove:function(t){if(!this.forbid&&this.move){var e=this.tStart,i=t.touches?t.touches[0]:{};if((!i||void 0===i.pageX&&void 0===i.pageY)&&(i={pageX:t.pageX,pageY:t.pageY}),i){var a=this.swipeDirection(e.pageX,i.pageX,e.pageY,i.pageY);"Left"===a&&Math.abs(this.position.pageX)!==this.limitMove&&this.swipper(i)}}},handlerTouchend:function(t){if(!this.forbid&&this.move){this.move=!1;var e=this.tStart,i=t.changedTouches?t.changedTouches[0]:{};if((!i||void 0===i.pageX&&void 0===i.pageY)&&(i={pageX:t.pageX,pageY:t.pageY}),i){var a=this.swipeDirection(e.pageX,i.pageX,e.pageY,i.pageY),n={pageX:i.pageX-e.pageX,pageY:i.pageY-e.pageY};Math.abs(n.pageX)>=40&&"Left"===a?(n.pageX=n.pageX<0?-this.limitMove:this.limitMove,this.isShowBtn=!0):n.pageX=0,0==n.pageX&&(this.isShowBtn=!1),this.position=n}}},handlerButton:function(t){this.closable&&this.closeButtonGroup();var e=t.currentTarget.dataset;this.$emit("click",{index:Number(e.index),item:this.params})},closeButtonGroup:function(){this.position={pageX:0,pageY:0},this.isShowBtn=!1},handlerParentButton:function(t){this.closable&&this.closeButtonGroup()},manualSwitch:function(t){var e=0;if(t)if(0===this.actions.length)e=this.operateWidth;else{var i=0;this.actions.forEach((function(t){i+=t.width})),e=i}this.position={pageX:-e,pageY:0}},px:function(e){return t.upx2px(e)+"px"}}};e.default=o}).call(this,i("543d")["default"])},"4c7d":function(t,e,i){},"8dfa":function(t,e,i){"use strict";i.r(e);var a=i("d13a"),n=i("303f");for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);i("e6b5");var s=i("f0c5"),p=Object(s["a"])(n["default"],a["b"],a["c"],!1,null,"618a1803",null,!1,a["a"],void 0);e["default"]=p.exports},d13a:function(t,e,i){"use strict";i.d(e,"b",(function(){return a})),i.d(e,"c",(function(){return n})),i.d(e,"a",(function(){}));var a=function(){var t=this,e=t.$createElement,i=(t._self._c,t.actions.length),a=i>0?t.__map(t.actions,(function(e,i){var a=t.__get_orig(e),n=e.icon?t.px(e.imgWidth):null,o=e.icon?t.px(e.imgHeight):null,s=t.px(e.fontsize);return{$orig:a,m0:n,m1:o,m2:s}})):null,n=t.actions.length;t.$mp.data=Object.assign({},{$root:{g0:i,l0:a,g1:n}})},n=[]},e6b5:function(t,e,i){"use strict";var a=i("4c7d"),n=i.n(a);n.a}}]);
  2. ;(global["webpackJsonp"] = global["webpackJsonp"] || []).push([
  3. 'components/tuiDrawer/index-create-component',
  4. {
  5. 'components/tuiDrawer/index-create-component':(function(module, exports, __webpack_require__){
  6. __webpack_require__('543d')['createComponent'](__webpack_require__("8dfa"))
  7. })
  8. },
  9. [['components/tuiDrawer/index-create-component']]
  10. ]);