mand-mobile/docs/static/js/EnUSDocsComponentsFeedbackP...

1 line
274 KiB
JavaScript
Raw Normal View History

2023-02-02 11:12:53 +08:00
webpackJsonp([25],{"+eRn":function(e,t,i){var a,o,l;(function(){(function(n,s){o=[t,i("o9V8"),i("Svgr"),i("dgYx"),i("U6ik"),i("YqFQ")],a=s,l="function"==typeof a?a.apply(t,o):a,!(void 0!==l&&(e.exports=l))})(this,function(e,t,i,a){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var o=function(e){return e&&e.__esModule?e:{default:e}}(t),l=(0,a.getDpr)(),n=["getColumnValue","getColumnValues","getColumnIndex","getColumnIndexs","getColumnIndexByDefault","setColumnValues","refresh","inheritPickerApi"];e.default={name:"md-picker-column",props:{data:{type:Array,default:function(){return[]}},cols:{type:Number,default:1},defaultValue:{type:Array,default:function(){return[]}},defaultIndex:{type:Array,default:function(){return[]}},invalidIndex:{type:Array,default:function(){return[]}},lineHeight:{type:Number,default:45},keepIndex:{type:Boolean,default:!1}},data:function(){return{columnValues:[],scrollers:[],scrollDirect:1,scrollPosition:0,activedIndexs:[],isInitialed:!1,isScrollInitialed:!1,isScrolling:!1,isMouseDown:!1}},computed:{hooks:function(){var e=this.$el.querySelectorAll(".md-picker-column-hook");return e?Array.isArray(e)?e:Array.prototype.slice.call(e):[]},style:function(){return{maskerHeight:(2*this.lineHeight+10)*l,indicatorHeight:this.lineHeight*l}}},watch:{data:{handler:function(e){this.columnValues=(0,a.extend)([],e)},deep:!0}},created:function(){this.columnValues=(0,a.extend)([],this.data)},methods:{$_initColumnsScroller:function(){for(var e=this,t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:0,a=t,i=this.hooks.length,o;a<i;a++)o=this.hooks[a],o&&this.$_initSingleColumnScroller(o,a);t||(this.$_initColumnIndex(),!this.isInitialed&&(this.isInitialed=!0,setTimeout(function(){e.$emit("initialed")},0))),this.isScrollInitialed=!0},$_initSingleColumnScroller:function(e,t){var a=this,l=this.$el.querySelectorAll(".column-list"),n=l[t];if(void 0!==t&&l&&e&&n){var s=e.getBoundingClientRect(),r=new o.default(function(e,t){(0,i.render)(n,e,t)},{scrollingX:!1,snapping:!0,snappingVelocity:1,animationDuration:350,scrollingComplete:function(){a.$_onColumnScrollEnd(t)}});r.setPosition(s.left+e.clientLeft,s.top+e.clientTop),r.setDimensions(e.clientWidth,e.clientHeight,n.offsetWidth,n.offsetHeight+this.style.maskerHeight),r.setSnapSize(0,this.style.indicatorHeight),this.$set(this.scrollers,t,r),this.$_resetScrollingPosition(t)}},$_initColumnIndex:function(){var e=this,t=this.columnValues,i=this.scrollers,o=this.defaultValue,l=this.defaultIndex;this.$_getColumnIndexByDefault(t,l,o,function(t,o){var l=i[t];return l?void(e.$_isColumnIndexInvalid(t,o)?e.$_scrollToValidIndex(l,t,o):(e.$_scrollToIndex(l,t,o),e.$set(e.activedIndexs,t,o))):((0,a.warn)("initialColumnIndex: scroller of column "+t+" is undefined"),1)})},$_getColumnIndexByDefault:function(e){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:[],i=2<arguments.length&&void 0!==arguments[2]?arguments[2]:[],o=3<arguments.length&&void 0!==arguments[3]?arguments[3]:a.noop;e&&(0,a.traverse)(e,function(e,a,l){var n=l[0],s=l[1],r=t[n],d=i[n];if(void 0===r&&void 0===d&&(r=0),void 0!==r&&s===r||void 0!==d&&(e.text===d||e.label===d||e.value===d))return o(n,s),2})},$_getColumnIndexByOffset:function(e){return Math.round(e/this.style.indicatorHeight)},$_getColumnOffsetByIndex:function(e){return e*this.style.indicatorHeight},$_isColumnIndexActive:function(e,t){var i=this.activedIndexs[e];return i===t},$_isColumnIndexInvalid:function(e,t){var i=this.invalidIndex[e];return(0,a.inArray)(i,t)},$_hasValidIndex:function(e){var t=!0,i=!1,o=void 0;try{for(var l=this.data[e].keys()[Symbol.iterator](),n,s;!(t=(n=l.next()).done);t=!0)if(s=n.value,!this.$_isColumnIndexInvalid(e,s))return!0}catch(e){i=!0,o=e}finally{try{!t&&l.return&&l.return()}finally{if(i)throw o}}return(0,a.warn)("hasValidIndex: has no valid items in column index "+e),!1},$_findValidIndex:function(e,t){if(!this.$_hasValidIndex(e))return t;for(var i=t;this.$_isColumnIndexInvalid(e,i);)i+=this.scrollDirect;return 0>i||i>this.data[e].length-1?(this.scrollDirect=-this.scrollDirect,this.$_findValidIndex(e,t)):