@tarojs/components
Version:
Taro 组件库。
1 lines • 3.27 kB
JavaScript
System.register(["./p-b2d01686.system.js","./p-5f4d0d5b.system.js"],(function(t){"use strict";var e,i,r,o,a,n;return{setters:[function(t){e=t.r;i=t.c;r=t.h;o=t.H;a=t.g},function(t){n=t.c}],execute:function(){function s(t){if(t){var e=/([\w-]*)\s*:\s*([^;]*)/g;var i={};var r=void 0;while(r=e.exec(t))i[""+r[1]]=r[2].trim();return i}}var c=".taro-picker-view-container{display:-ms-flexbox;display:flex;position:relative}.taro-picker-view-mask-container{display:-ms-flexbox;display:flex;position:absolute;left:0;right:0;top:0;bottom:0;-ms-flex-direction:column;flex-direction:column;pointer-events:none}.taro-picker-view-mask-indicator{display:-ms-flexbox;display:flex;border-top:1px solid #ddd;border-bottom:1px solid #ddd;height:50px}.taro-picker-view-mask-top{-ms-flex:1;flex:1;background-image:-webkit-gradient(linear, left top, left bottom, from(rgba(255, 255, 255, 0.95)), to(rgba(255, 255, 255, 0.6)));background-image:linear-gradient(to bottom, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6))}.taro-picker-view-mask-bottom{-ms-flex:1;flex:1;background:-webkit-gradient(linear, left bottom, left top, from(rgba(255, 255, 255, 0.95)), to(rgba(255, 255, 255, 0.6)));background:linear-gradient(to top, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.6))}";var l=t("taro_picker_view_core",function(){function t(t){e(this,t);this.onChange=i(this,"change",7);this.onPickStart=i(this,"pickstart",7);this.onPickEnd=i(this,"pickend",7)}t.prototype.onSelect=function(t){t.stopPropagation();if(t.target.tagName!=="TARO-PICKER-VIEW-COLUMN-CORE")return;var e=+t.detail.curIndex;var i=+t.detail.selectedIndex;this.value[e]=i;this.onChange.emit({value:this.value})};t.prototype.onSelectStart=function(t){t.stopPropagation();if(t.target.tagName!=="TARO-PICKER-VIEW-COLUMN-CORE")return;this.onPickStart.emit()};t.prototype.onPickerColEnd=function(t){t.stopPropagation();if(t.target.tagName!=="TARO-PICKER-VIEW-COLUMN-CORE")return;this.onPickEnd.emit()};t.prototype.componentDidLoad=function(){var t=this;var e=this.el.querySelectorAll("taro-picker-view-column-core");e.forEach((function(e,i){var r;e.setAttribute("col",""+i);var o="0";if(!!t.value&&t.value.length>i){o=""+t.value[i]}var a=t.el.getBoundingClientRect().height;var n=((r=t.indicator)===null||r===void 0?void 0:r.offsetHeight)||0;var s=(a-n)/2;e.setAttribute("initial-position",""+o);e.setAttribute("padding-vertical",""+s)}))};t.prototype.componentDidRender=function(){var t=this;this.el.childNodes.forEach((function(e){var i=e;if("TARO-PICKER-VIEW-COLUMN-CORE"!==i.tagName&&i.className!=="taro-picker-view-mask-container"){t.el.removeChild(e)}}))};t.prototype.render=function(){var t=this;var e=n("taro-picker-view-mask-indicator",this.indicatorClass);var i=n("taro-picker-view-mask-top",this.maskClass);var a=n("taro-picker-view-mask-bottom",this.maskClass);var c=s(this.indicatorStyle);var l=s(this.maskStyle);var d=s(this.maskStyle);return r(o,{class:"taro-picker-view-container"},r("slot",null),r("div",{class:"taro-picker-view-mask-container"},r("div",{class:i,style:l}),r("div",{class:e,style:c,ref:function(e){return t.indicator=e}}),r("div",{class:a,style:d})))};Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());l.style=c}}}));