@tarojs/components 3.6.5 → 3.7.0-alpha.1

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.
Files changed (29) hide show
  1. package/dist/cjs/taro-swiper-core_2.cjs.entry.js +14 -3
  2. package/dist/cjs/taro-textarea-core.cjs.entry.js +14 -1
  3. package/dist/collection/components/swiper/swiper.js +14 -3
  4. package/dist/collection/components/textarea/textarea.js +42 -1
  5. package/dist/components/taro-swiper-core.js +14 -3
  6. package/dist/components/taro-textarea-core.js +14 -1
  7. package/dist/esm/taro-swiper-core_2.entry.js +14 -3
  8. package/dist/esm/taro-textarea-core.entry.js +14 -1
  9. package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
  10. package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
  11. package/dist/taro-components/{p-ba7cb688.entry.js → p-1e43a2d5.entry.js} +1 -1
  12. package/dist/taro-components/p-2c89af5b.system.entry.js +1 -0
  13. package/dist/taro-components/{p-f7baa03f.system.entry.js → p-5905e3ef.system.entry.js} +1 -1
  14. package/dist/taro-components/p-d9e2e3aa.entry.js +1 -0
  15. package/dist/taro-components/p-ed331c06.system.js +1 -1
  16. package/dist/taro-components/taro-components.esm.js +1 -1
  17. package/dist/types/components/textarea/textarea.d.ts +3 -0
  18. package/dist/types/components.d.ts +2 -0
  19. package/lib/vue2/components.js +1 -1
  20. package/lib/vue2/components.js.map +1 -1
  21. package/lib/vue3/components.js +3 -1
  22. package/lib/vue3/components.js.map +1 -1
  23. package/package.json +4 -4
  24. package/types/Input.d.ts +0 -1
  25. package/types/Map.d.ts +1 -0
  26. package/types/Picker.d.ts +4 -4
  27. package/types/Textarea.d.ts +1 -1
  28. package/dist/taro-components/p-cfb01848.system.entry.js +0 -1
  29. package/dist/taro-components/p-d8831b3c.entry.js +0 -1
@@ -0,0 +1 @@
1
+ var __awaiter=this&&this.__awaiter||function(e,t,n,o){function i(e){return e instanceof n?e:new n((function(t){t(e)}))}return new(n||(n=Promise))((function(n,a){function r(e){try{l(o.next(e))}catch(e){a(e)}}function u(e){try{l(o["throw"](e))}catch(e){a(e)}}function l(e){e.done?n(e.value):i(e.value).then(r,u)}l((o=o.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},o,i,a,r;return r={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(r[Symbol.iterator]=function(){return this}),r;function u(e){return function(t){return l([e,t])}}function l(u){if(o)throw new TypeError("Generator is already executing.");while(r&&(r=0,u[0]&&(n=0)),n)try{if(o=1,i&&(a=u[0]&2?i["return"]:u[0]?i["throw"]||((a=i["return"])&&a.call(i),0):i.next)&&!(a=a.call(i,u[1])).done)return a;if(i=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:n.label++;return{value:u[1],done:false};case 5:n.label++;i=u[1];u=[0];continue;case 7:u=n.ops.pop();n.trys.pop();continue;default:if(!(a=n.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){n.label=u[1];break}if(u[0]===6&&n.label<a[1]){n.label=a[1];a=u;break}if(a&&n.label<a[2]){n.label=a[2];n.ops.push(u);break}if(a[2])n.ops.pop();n.trys.pop();continue}u=t.call(e,n)}catch(e){u=[6,e];i=0}finally{o=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};System.register(["./p-7e6b54cb.system.js"],(function(e){"use strict";var t,n,o,i;return{setters:[function(e){t=e.r;n=e.c;o=e.h;i=e.g}],execute:function(){var a="taro-textarea-core{display:block;width:300px}taro-textarea-core .auto-height{height:auto}.taro-textarea{display:block;position:relative;border:0;width:100%;height:inherit;-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:auto;line-height:1.5}.taro-textarea:focus{outline:none}";function r(e){return e!==null&&e!==void 0?e:""}var u=e("taro_textarea_core",function(){function e(e){var o=this;t(this,e);this.onInput=n(this,"input",7);this.onFocus=n(this,"focus",7);this.onBlur=n(this,"blur",7);this.onConfirm=n(this,"confirm",7);this.onChange=n(this,"change",7);this.onLineChange=n(this,"linechange",7);this.onKeyDown=n(this,"keydown",7);this.handleInput=function(e){e.stopPropagation();o.handleLineChange();var t=e.target.value||"";o.onInput.emit({value:t,cursor:t.length})};this.handleFocus=function(e){e.stopPropagation();o.onFocus.emit({value:e.target.value})};this.handleBlur=function(e){e.stopPropagation();o.onBlur.emit({value:e.target.value})};this.handleChange=function(e){e.stopPropagation();o.onChange.emit({value:e.target.value})};this.handleLineChange=function(){var e=o.getNumberOfLines();if(e!==o.line){o.line=e;o.onLineChange.emit({height:o.textareaRef.clientHeight,lineCount:o.line})}};this.handleKeyDown=function(e){e.stopPropagation();var t=e.target.value;var n=e.keyCode||e.code;o.onKeyDown.emit({value:t,cursor:t.length,keyCode:n});n===13&&o.onConfirm.emit({value:t})};this.calculateContentHeight=function(e,t){var n=e.style.height,o=e.offsetHeight,i=e.scrollHeight,a=e.style.overflow,r=e.style.minHeight||null;if(o>=i){e.style.minHeight=0;e.style.height=o+t+"px";e.style.overflow="hidden";if(i<e.scrollHeight){while(e.offsetHeight>=e.scrollHeight){e.style.height=(o-=t)+"px"}while(e.offsetHeight<e.scrollHeight){e.style.height=o+++"px"}e.style.height=n;e.style.overflow=a;e.style.minHeight=r;return o}}else{return i}};this.getNumberOfLines=function(){var e=o.textareaRef,t=window.getComputedStyle?window.getComputedStyle(e):e.style,n=parseInt(t.lineHeight,10),i=o.calculateContentHeight(e,n),a=Math.floor(i/n);return a};this.value=undefined;this.placeholder=undefined;this.disabled=false;this.maxlength=140;this.autoFocus=false;this.autoHeight=false;this.name=undefined;this.nativeProps={};this.line=1}e.prototype.watchAutoFocus=function(e,t){var n;if(!t&&e){(n=this.textareaRef)===null||n===void 0?void 0:n.focus()}};e.prototype.focus=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){this.textareaRef.focus();return[2]}))}))};e.prototype.componentDidLoad=function(){var e=this;Object.defineProperty(this.el,"value",{get:function(){return e.textareaRef.value},set:function(t){return e.value!==t&&(e.value=t)},configurable:true})};e.prototype.render=function(){var e=this;var t=this,n=t.value,i=t.placeholder,a=t.disabled,u=t.maxlength,l=t.autoFocus,s=t.autoHeight,h=t.name,c=t.nativeProps,f=t.handleInput,g=t.handleFocus,p=t.handleBlur,d=t.handleChange;var v={};if(s){v.rows=this.line}return o("textarea",Object.assign({ref:function(t){if(t){e.textareaRef=t;if(l&&t)t.focus()}},class:"taro-textarea ".concat(s?"auto-height":""),value:r(n),placeholder:i,name:h,disabled:a,maxlength:u,autofocus:l,onInput:f,onFocus:g,onBlur:p,onChange:d,onKeyDown:this.handleKeyDown},c,v))};Object.defineProperty(e.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{autoFocus:["watchAutoFocus"]}},enumerable:false,configurable:true});return e}());u.style=a}}}));