@tarojs/components 3.7.0-alpha.1 → 3.7.0-alpha.3
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.
- package/dist/cjs/hls-00fec546.js +25673 -0
- package/dist/{esm/index-394db4c1.js → cjs/index-f6805218.js} +2 -6
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/taro-button-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-cover-view-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-icon-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-image-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-input-core.cjs.entry.js +6 -11
- package/dist/cjs/taro-navigator-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-picker-core_2.cjs.entry.js +23 -20
- package/dist/cjs/taro-picker-view-column-core_2.cjs.entry.js +1 -1
- package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +1 -1
- package/dist/cjs/taro-rich-text-core.cjs.entry.js +6 -0
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +1 -1
- package/dist/cjs/taro-tabbar.cjs.entry.js +1 -1
- package/dist/cjs/taro-text-core.cjs.entry.js +9 -6
- package/dist/cjs/taro-textarea-core.cjs.entry.js +1 -8
- package/dist/cjs/taro-video-control_3.cjs.entry.js +3 -3
- package/dist/cjs/taro-view-core.cjs.entry.js +1 -1
- package/dist/collection/components/checkbox/checkbox.js +4 -4
- package/dist/collection/components/input/input.js +9 -13
- package/dist/collection/components/picker/picker-group.js +29 -26
- package/dist/collection/components/picker/picker.js +42 -16
- package/dist/collection/components/rich-text/rich-text.js +71 -0
- package/dist/collection/components/rich-text/style/index.css +16 -0
- package/dist/collection/components/text/style/index.css +20 -3
- package/dist/collection/components/text/text.js +66 -6
- package/dist/collection/components/textarea/textarea.js +4 -10
- package/dist/collection/components/video/video.js +1 -1
- package/dist/components/hls.js +23206 -24210
- package/dist/components/index2.js +1 -7
- package/dist/components/picker-group.js +9 -9
- package/dist/components/taro-checkbox-core.js +1 -1
- package/dist/components/taro-input-core.js +7 -12
- package/dist/components/taro-picker-core.js +16 -13
- package/dist/components/taro-rich-text-core.js +10 -1
- package/dist/components/taro-text-core.js +13 -7
- package/dist/components/taro-textarea-core.js +2 -9
- package/dist/components/taro-video-core.js +2 -2
- package/dist/esm/hls-4018c7ea.js +25671 -0
- package/dist/{cjs/index-067a58c1.js → esm/index-c3e4004b.js} +1 -12
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-button-core.entry.js +1 -1
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-cover-view-core.entry.js +1 -1
- package/dist/esm/taro-icon-core.entry.js +1 -1
- package/dist/esm/taro-image-core.entry.js +1 -1
- package/dist/esm/taro-input-core.entry.js +6 -11
- package/dist/esm/taro-navigator-core.entry.js +1 -1
- package/dist/esm/taro-picker-core_2.entry.js +23 -20
- package/dist/esm/taro-picker-view-column-core_2.entry.js +1 -1
- package/dist/esm/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm/taro-rich-text-core.entry.js +6 -0
- package/dist/esm/taro-scroll-view-core.entry.js +1 -1
- package/dist/esm/taro-swiper-core_2.entry.js +1 -1
- package/dist/esm/taro-tabbar.entry.js +1 -1
- package/dist/esm/taro-text-core.entry.js +9 -6
- package/dist/esm/taro-textarea-core.entry.js +1 -8
- package/dist/esm/taro-video-control_3.entry.js +3 -3
- package/dist/esm/taro-view-core.entry.js +1 -1
- package/dist/esm-es5/hls-4018c7ea.js +1 -0
- package/dist/esm-es5/index-c3e4004b.js +7 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-button-core.entry.js +1 -1
- package/dist/esm-es5/taro-components.js +1 -1
- package/dist/esm-es5/taro-cover-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-icon-core.entry.js +1 -1
- package/dist/esm-es5/taro-image-core.entry.js +1 -1
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-navigator-core.entry.js +1 -1
- package/dist/esm-es5/taro-picker-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-picker-view-column-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm-es5/taro-rich-text-core.entry.js +1 -1
- package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
- package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-tabbar.entry.js +1 -1
- package/dist/esm-es5/taro-text-core.entry.js +1 -1
- package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
- package/dist/esm-es5/taro-video-control_3.entry.js +1 -1
- package/dist/esm-es5/taro-view-core.entry.js +1 -1
- package/dist/taro-components/p-01e163f8.system.entry.js +1 -0
- package/dist/taro-components/p-085076c5.system.entry.js +1 -0
- package/dist/taro-components/{p-25adb80c.entry.js → p-091a7153.entry.js} +1 -1
- package/dist/taro-components/{p-cd90bead.system.entry.js → p-0cf235de.system.entry.js} +1 -1
- package/dist/taro-components/p-0fa96970.entry.js +1 -0
- package/dist/taro-components/{p-edbb1a17.system.entry.js → p-1991cc1a.system.entry.js} +1 -1
- package/dist/taro-components/{p-c0ec2f41.system.entry.js → p-2accb92c.system.entry.js} +1 -1
- package/dist/taro-components/p-2ec68968.system.js +7 -0
- package/dist/taro-components/{p-18703731.system.entry.js → p-416cc4dd.system.entry.js} +1 -1
- package/dist/taro-components/p-425c209a.entry.js +1 -0
- package/dist/taro-components/p-43efbf30.js +1 -0
- package/dist/taro-components/{p-385d8aed.entry.js → p-4874f671.entry.js} +1 -1
- package/dist/taro-components/{p-2c89af5b.system.entry.js → p-657cb6e4.system.entry.js} +1 -1
- package/dist/taro-components/p-6cde180b.entry.js +1 -0
- package/dist/taro-components/{p-c490cd45.entry.js → p-7152d85b.entry.js} +1 -1
- package/dist/taro-components/{p-ab2d4f12.entry.js → p-719e1eaf.entry.js} +1 -1
- package/dist/taro-components/{p-b898d734.entry.js → p-78e4805e.entry.js} +1 -1
- package/dist/taro-components/{p-6800ccdc.system.entry.js → p-7ff654e6.system.entry.js} +1 -1
- package/dist/taro-components/{p-16336cc6.system.entry.js → p-98f9f50f.system.entry.js} +1 -1
- package/dist/taro-components/p-9edea30f.system.entry.js +1 -0
- package/dist/taro-components/{p-3f9f3448.entry.js → p-9fe49bab.entry.js} +1 -1
- package/dist/taro-components/{p-31bba7c3.entry.js → p-a20ecd3b.entry.js} +1 -1
- package/dist/taro-components/p-a20fed0a.entry.js +1 -0
- package/dist/taro-components/{p-7c2454dd.system.entry.js → p-a8925584.system.entry.js} +1 -1
- package/dist/taro-components/p-a8e7cf87.entry.js +1 -0
- package/dist/taro-components/{p-5905e3ef.system.entry.js → p-a96b4b19.system.entry.js} +1 -1
- package/dist/taro-components/{p-c2322741.system.entry.js → p-b1d2b575.system.entry.js} +1 -1
- package/dist/taro-components/p-c39a46ca.system.entry.js +1 -0
- package/dist/taro-components/{p-ca3a269f.entry.js → p-c4b8851b.entry.js} +1 -1
- package/dist/taro-components/{p-e5f78321.system.entry.js → p-cdb76676.system.entry.js} +1 -1
- package/dist/taro-components/p-de951a46.js +7 -0
- package/dist/taro-components/p-e09451c5.system.entry.js +1 -0
- package/dist/taro-components/{p-df4c2f21.entry.js → p-e33f3592.entry.js} +1 -1
- package/dist/taro-components/p-e78775ce.system.js +1 -0
- package/dist/taro-components/p-ebc7b6fc.entry.js +1 -0
- package/dist/taro-components/p-ed331c06.system.js +1 -1
- package/dist/taro-components/p-f02b6f70.entry.js +1 -0
- package/dist/taro-components/{p-1e43a2d5.entry.js → p-f07cd1de.entry.js} +1 -1
- package/dist/taro-components/p-f6f6a996.system.entry.js +1 -0
- package/dist/taro-components/taro-components.css +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/checkbox/checkbox.d.ts +1 -1
- package/dist/types/components/input/input.d.ts +2 -2
- package/dist/types/components/picker/picker-group.d.ts +3 -3
- package/dist/types/components/picker/picker.d.ts +7 -2
- package/dist/types/components/rich-text/rich-text.d.ts +4 -0
- package/dist/types/components/text/text.d.ts +4 -0
- package/dist/types/components/textarea/textarea.d.ts +0 -1
- package/dist/types/components.d.ts +26 -8
- package/lib/react/component-lib/index.js +50 -50
- package/lib/react/component-lib/index.js.map +1 -1
- package/lib/react/component-lib/reactify-wc.js +1 -1
- package/lib/react/component-lib/reactify-wc.js.map +1 -1
- package/lib/react/components.d.ts +1 -3
- package/lib/react/components.js +2 -2
- package/lib/react/components.js.map +1 -1
- package/lib/react/helper.d.ts +1 -1
- package/lib/react/react-component-lib/createOverlayComponent.js.map +1 -1
- package/lib/react/react-component-lib/utils/attachProps.js +1 -4
- package/lib/react/react-component-lib/utils/attachProps.js.map +1 -1
- package/lib/vue2/components.d.ts +9 -3
- package/lib/vue2/components.js +12 -6
- package/lib/vue2/components.js.map +1 -1
- package/lib/vue2/vue-component-lib/utils.js.map +1 -1
- package/lib/vue3/component-lib/index.js +48 -48
- package/lib/vue3/component-lib/index.js.map +1 -1
- package/lib/vue3/components.d.ts +1 -1
- package/lib/vue3/components.js +13 -6
- package/lib/vue3/components.js.map +1 -1
- package/lib/vue3/vue-component-lib/utils.js.map +1 -1
- package/package.json +13 -11
- package/types/Button.d.ts +9 -7
- package/types/ChannelVideo.d.ts +4 -0
- package/types/Form.d.ts +11 -0
- package/types/Image.d.ts +5 -0
- package/types/Input.d.ts +6 -1
- package/types/LivePlayer.d.ts +17 -0
- package/types/LivePusher.d.ts +10 -0
- package/types/Picker.d.ts +9 -0
- package/types/Progress.d.ts +2 -2
- package/types/RichText.d.ts +6 -4
- package/types/ScrollView.d.ts +5 -5
- package/types/ShareElement.d.ts +39 -0
- package/types/StickySection.d.ts +0 -1
- package/types/Swiper.d.ts +10 -0
- package/types/Text.d.ts +8 -3
- package/types/Textarea.d.ts +10 -3
- package/types/Video.d.ts +12 -0
- package/types/View.d.ts +1 -1
- package/virtual-list/index.js +2 -2
- package/dist/cjs/hls-0f2d4d85.js +0 -26677
- package/dist/esm/hls-0e83e558.js +0 -26675
- package/dist/esm-es5/hls-0e83e558.js +0 -289
- package/dist/esm-es5/index-394db4c1.js +0 -7
- package/dist/taro-components/p-198000d8.system.js +0 -289
- package/dist/taro-components/p-2fad2a65.js +0 -7
- package/dist/taro-components/p-387314fa.system.js +0 -7
- package/dist/taro-components/p-3e701660.js +0 -289
- package/dist/taro-components/p-4e9bd4f6.entry.js +0 -1
- package/dist/taro-components/p-589293fd.entry.js +0 -1
- package/dist/taro-components/p-58b19305.system.entry.js +0 -1
- package/dist/taro-components/p-5b67a98e.entry.js +0 -1
- package/dist/taro-components/p-735c2a72.system.entry.js +0 -1
- package/dist/taro-components/p-97f0ad72.system.entry.js +0 -1
- package/dist/taro-components/p-a132ebb9.entry.js +0 -1
- package/dist/taro-components/p-c43c5e89.system.entry.js +0 -1
- package/dist/taro-components/p-cc7b95fd.system.entry.js +0 -1
- package/dist/taro-components/p-d9e2e3aa.entry.js +0 -1
- package/dist/taro-components/p-dcbb7b2d.entry.js +0 -1
- package/dist/taro-components/p-ed011ff9.entry.js +0 -1
- package/dist/taro-components/p-fa43177b.system.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-7e6b54cb.system.js","./p-
|
|
1
|
+
System.register(["./p-7e6b54cb.system.js","./p-2ec68968.system.js"],(function(t){"use strict";var i,e,o,s,n;return{setters:[function(t){i=t.r;e=t.c;o=t.h;s=t.H},function(t){n=t.c}],execute:function(){var r="taro-cover-view-core{display:block}";var a=t("taro_cover_view_core",function(){function t(t){i(this,t);this.onLongPress=e(this,"longpress",7);this.startTime=0;this.animation=undefined;this.hoverClass=undefined;this.hoverStartTime=50;this.hoverStayTime=400;this.hover=false;this.touch=false}t.prototype.onTouchStart=function(){var t=this;if(this.hoverClass){this.touch=true;setTimeout((function(){if(t.touch){t.hover=true}}),this.hoverStartTime)}this.timeoutEvent=setTimeout((function(){t.onLongPress.emit()}),350);this.startTime=Date.now()};t.prototype.onTouchMove=function(){clearTimeout(this.timeoutEvent)};t.prototype.onTouchEnd=function(){var t=this;var i=Date.now()-this.startTime;if(i<350){clearTimeout(this.timeoutEvent)}if(this.hoverClass){this.touch=false;setTimeout((function(){if(!t.touch){t.hover=false}}),this.hoverStayTime)}};t.prototype.render=function(){var t;var i=n((t={},t["".concat(this.hoverClass)]=this.hover,t));var e={};if(!!this.animation){e["animation"]=this.animation;e["data-animation"]=this.animation}return o(s,Object.assign({class:i},e),o("slot",null))};return t}());a.style=r}}}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var __awaiter=this&&this.__awaiter||function(e,t,i,n){function r(e){return e instanceof i?e:new i((function(t){t(e)}))}return new(i||(i=Promise))((function(i,a){function o(e){try{s(n.next(e))}catch(e){a(e)}}function u(e){try{s(n["throw"](e))}catch(e){a(e)}}function s(e){e.done?i(e.value):r(e.value).then(o,u)}s((n=n.apply(e,t||[])).next())}))};var __generator=this&&this.__generator||function(e,t){var i={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,r,a,o;return o={next:u(0),throw:u(1),return:u(2)},typeof Symbol==="function"&&(o[Symbol.iterator]=function(){return this}),o;function u(e){return function(t){return s([e,t])}}function s(u){if(n)throw new TypeError("Generator is already executing.");while(o&&(o=0,u[0]&&(i=0)),i)try{if(n=1,r&&(a=u[0]&2?r["return"]:u[0]?r["throw"]||((a=r["return"])&&a.call(r),0):r.next)&&!(a=a.call(r,u[1])).done)return a;if(r=0,a)u=[u[0]&2,a.value];switch(u[0]){case 0:case 1:a=u;break;case 4:i.label++;return{value:u[1],done:false};case 5:i.label++;r=u[1];u=[0];continue;case 7:u=i.ops.pop();i.trys.pop();continue;default:if(!(a=i.trys,a=a.length>0&&a[a.length-1])&&(u[0]===6||u[0]===2)){i=0;continue}if(u[0]===3&&(!a||u[1]>a[0]&&u[1]<a[3])){i.label=u[1];break}if(u[0]===6&&i.label<a[1]){i.label=a[1];a=u;break}if(a&&i.label<a[2]){i.label=a[2];i.ops.push(u);break}if(a[2])i.ops.pop();i.trys.pop();continue}u=t.call(e,i)}catch(e){u=[6,e];r=0}finally{n=a=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:true}}};var __spreadArray=this&&this.__spreadArray||function(e,t,i){if(i||arguments.length===2)for(var n=0,r=t.length,a;n<r;n++){if(a||!(n in t)){if(!a)a=Array.prototype.slice.call(t,0,n);a[n]=t[n]}}return e.concat(a||Array.prototype.slice.call(t))};System.register(["./p-7e6b54cb.system.js","./p-2ec68968.system.js"],(function(e){"use strict";var t,i,n,r,a,o;return{setters:[function(e){t=e.r;i=e.c;n=e.h;r=e.H;a=e.g},function(e){o=e.c}],execute:function(){function u(e,t){var i=[];for(var n=e;n<=t;n++){i.push("".concat(n<10?"0":"").concat(n))}return i}var s=__spreadArray(__spreadArray(["20","21","22","23"],u(0,23),true),["00","01","02","03"],false);var h=__spreadArray(__spreadArray(["56","57","58","59"],u(0,59),true),["00","01","02","03"],false);function l(e,t){if(!isNaN(+e)&&e>=0&&e<t.length)return true;return false}function c(e){if(!/^\d{1,2}:\d{1,2}$/.test(e))return false;var t=e.split(":").map((function(e){return+e}));if(t[0]<0||t[0]>23)return false;if(t[1]<0||t[1]>59)return false;return true}function d(e,t){var i=e.split(":").map((function(e){return+e}));var n=t.split(":").map((function(e){return+e}));if(i[0]<n[0])return true;if(i[0]===n[0]&&i[1]<=n[1])return true;return false}function f(e){if(!e)return false;var t=new Date(e.replace(/-/g,"/"));return isNaN(t.getMonth())?false:t}function p(e,t){if(t===4||t===6||t===9||t===11)return 30;if(t===2){if(e%4===0&&e%100!==0||e%400===0)return 29;else return 28}return 31}function v(e){var t;if(Array.isArray(e)){t=e.map((function(e){return String(e)}))}else{t=e}return t}function g(e,t){var i=[];for(var n=e;n<=t;n++){i.push(n)}return i}function m(e,t){return g(e,t)}function y(e,t,i){var n=1;var r=12;if(e.getFullYear()===i){n=e.getMonth()+1}if(t.getFullYear()===i){r=t.getMonth()+1}return g(n,r)}function _(e,t,i,n){var r=1;var a=p(i,n);if(e.getFullYear()===i&&e.getMonth()+1===n){r=e.getDate()}if(t.getFullYear()===i&&t.getMonth()+1===n){a=t.getDate()}return g(r,a)}var k=102;var w=34;var C=w*7;var x=".weui-picker,.weui-picker__hd{font-size:12px}";var M=e("taro_picker_core",function(){function e(e){var r=this;t(this,e);this.onChange=i(this,"change",7);this.onColumnChange=i(this,"columnchange",7);this.onCancel=i(this,"cancel",7);this.index=[];this.showPicker=function(){if(r.disabled)return;r.height=r.getHeightByIndex();r.hidden=false};this.getHeightByIndex=function(){var e=r.index.map((function(e){var t=0;if(r.mode==="time"){t=w*4}return k-w*e-t}));return e};this.hidePicker=function(){r.fadeOut=true;setTimeout((function(){r.hidden=true;r.fadeOut=false}),350)};this.handleChange=function(){r.hidePicker();r.index=r.height.map((function(e){return(k-e)/w}));var e=r.index.length&&r.mode!=="selector"?r.index:r.index[0];if(r.mode==="time"){var t=[s.slice(),h.slice()];var i=r.index.map((function(e,i){return t[i][e]}));r.index=i.map((function(e){return parseInt(e)}));e=i.join(":")}if(r.mode==="date"){var n=r.pickerDate,a=n._start,o=n._end,u=n._updateValue;var l=u[0];var c=u[1];var d=m(a.getFullYear(),o.getFullYear());var f=y(a,o,l);var p=_(a,o,l,c);var v=d[r.index[0]];var g=f[r.index[1]];var C=p[r.index[2]];if(r.fields==="year"){e=[v]}else if(r.fields==="month"){e=[v,g]}else{e=[v,g,C]}e=e.map((function(e){return e<10?"0".concat(e):e})).join("-")}r.value=e;r.pickerValue=r.value;r.onChange.emit({value:e})};this.handleColumnChange=function(e){var t=e.detail,i=t.columnId,n=t.height;r.onColumnChange.emit({column:Number(i),value:(k-n)/w})};this.handleCancel=function(){r.hidePicker();r.onCancel.emit()};this.updateHeight=function(e,t,i){if(i===void 0){i=false}var n=__spreadArray([],r.height,true);n[t]=e;r.height=n;if(i){var a=r,o=a.start,u=a.end;if(!c(o))o="00:00";if(!c(u))u="23:59";if(!d(o,u))return;var l=[s.slice(),h.slice()];var f=r.height.map((function(e){return(k-e)/w}));var p=f.map((function(e,t){return l[t][e]})).join(":");if(!d(o,p)){var v=o.split(":").map((function(e){return k-w*(+e+4)}));requestAnimationFrame((function(){return r.height=v}))}else if(!d(p,u)){var g=u.split(":").map((function(e){return k-w*(+e+4)}));requestAnimationFrame((function(){return r.height=g}))}}};this.updateDay=function(e,t){var i=r.pickerDate,n=i._start,a=i._end,o=i._updateValue;o[t]=e;var u=o[0];var s=o[1];var h=o[2];if(t===0){var l=y(n,a,u);var c=l[l.length-1];var d=l[0];if(s>c)o[1]=c;if(s<d)o[1]=d;var f=l.indexOf(o[1]);var p=k-w*f;r.updateDay(o[1],1);r.updateHeight(p,"1")}else if(t===1){var v=_(n,a,u,s);var c=v[v.length-1];var d=v[0];if(h>c)o[2]=c;if(h<d)o[2]=d;var f=v.indexOf(o[2]);var p=k-w*f;r.updateDay(o[2],2);r.updateHeight(p,"2")}};this.getSelector=function(){return n("taro-picker-group",{range:r.range,rangeKey:r.rangeKey,height:r.height[0],updateHeight:r.updateHeight,columnId:"0"})};this.getMultiSelector=function(){return r.range.map((function(e,t){return n("taro-picker-group",{range:e,rangeKey:r.rangeKey,height:r.height[t],updateHeight:r.updateHeight,onColumnChange:r.handleColumnChange,columnId:String(t)})}))};this.getTimeSelector=function(){var e=s.slice();var t=h.slice();return[n("taro-picker-group",{mode:"time",range:e,height:r.height[0],updateHeight:r.updateHeight,columnId:"0"}),n("taro-picker-group",{mode:"time",range:t,height:r.height[1],updateHeight:r.updateHeight,columnId:"1"})]};this.getDateSelector=function(){var e=r,t=e.fields,i=e.height;var a=r.pickerDate,o=a._start,u=a._end,s=a._updateValue;var h=s[0];var l=s[1];var c=m(o.getFullYear(),u.getFullYear()).map((function(e){return"".concat(e,"年")}));var d=y(o,u,h).map((function(e){return"".concat(e<10?"0".concat(e):e,"月")}));var f=_(o,u,h,l).map((function(e){return"".concat(e<10?"0".concat(e):e,"日")}));var p=[n("taro-picker-group",{mode:"date",range:c,height:i[0],updateDay:r.updateDay,updateHeight:r.updateHeight,columnId:"0"})];if(t==="month"||t==="day"){p.push(n("taro-picker-group",{mode:"date",range:d,height:i[1],updateDay:r.updateDay,updateHeight:r.updateHeight,columnId:"1"}))}if(t==="day"){p.push(n("taro-picker-group",{mode:"date",range:f,height:i[2],updateDay:r.updateDay,updateHeight:r.updateHeight,columnId:"2"}))}return p};this.mode="selector";this.disabled=false;this.range=[];this.rangeKey=undefined;this.value=undefined;this.start="";this.end="";this.fields="day";this.name="";this.textProps={};this.pickerValue=[];this.height=[];this.hidden=true;this.fadeOut=false;this.isWillLoadCalled=false}e.prototype.componentWillLoad=function(){this.isWillLoadCalled=true;this.handleProps()};e.prototype.componentDidLoad=function(){if(this.overlay){document.body.appendChild(this.overlay)}};e.prototype.disconnectedCallback=function(){var e;if(this.overlay){(e=this.overlay.parentNode)===null||e===void 0?void 0:e.removeChild(this.overlay)}};e.prototype.onPropsChange=function(){if(!this.isWillLoadCalled)return;this.handleProps()};e.prototype.handleProps=function(){var e=this;var t=this,i=t.mode,n=t.start,r=t.end;if(i==="selector"){var a=this.value;this.index=[l(a,this.range)?Math.floor(a):0]}else if(i==="multiSelector"){var o=this.value;this.index=[];this.range.forEach((function(t,i){var n=o===null||o===void 0?void 0:o[i];var r=l(n,t)?Math.floor(n):0;e.index.push(r)}))}else if(i==="time"){var a=this.value;if(!c(a)){console.warn("time picker value illegal");a="0:0"}var u=a.split(":").map((function(e){return+e}));this.index=u}else if(i==="date"){var a=this.value;var s=f(a)||new Date((new Date).setHours(0,0,0,0));var h=f(n)||new Date("1970/01/01");var d=f(r)||new Date("2999/01/01");if(s>=h&&s<=d){var p=s.getFullYear();var v=s.getMonth()+1;var g=s.getDate();var k=m(h.getFullYear(),d.getFullYear());var w=y(h,d,p);var C=_(h,d,p,v);this.index=[k.indexOf(p),w.indexOf(v),C.indexOf(g)];if(!this.pickerDate||this.pickerDate._value.getTime()!==s.getTime()||this.pickerDate._start.getTime()!==h.getTime()||this.pickerDate._end.getTime()!==d.getTime()){this.pickerDate={_value:s,_start:h,_end:d,_updateValue:[p,v,g]}}}else{throw new Error("Date Interval Error")}}else{throw new Error('Picker not support "'.concat(i,'" mode.'))}this.height=this.getHeightByIndex();this.pickerValue=this.value;if(i==="date"){var x=this.pickerValue;if(this.fields==="month"){this.pickerValue=x.split("-").slice(0,2).join("-")}else if(this.fields==="year"){this.pickerValue=x.split("-")[0]}}};e.prototype.render=function(){var e=this;var t,i;var a=this,u=a.name,s=a.mode,h=a.fadeOut,l=a.hidden;var c;switch(s){case"multiSelector":c=this.getMultiSelector();break;case"time":c=this.getTimeSelector();break;case"date":c=this.getDateSelector();break;default:c=this.getSelector()}var d=o("weui-mask","weui-animate-fade-in",{"weui-animate-fade-out":h});var f=o("weui-picker","weui-animate-slide-up",{"weui-animate-slide-down":h});var p=l?{display:"none"}:{};return n(r,null,n("div",{onClick:this.showPicker},n("slot",null),n("input",{type:"hidden",name:u,value:v(this.pickerValue)})),n("div",{class:"weui-picker__overlay",style:p,ref:function(t){e.overlay=t}},n("div",{class:d,onClick:this.handleCancel}),n("div",{class:f},n("div",{class:"weui-picker__hd"},n("div",{class:"weui-picker__action",onClick:this.handleCancel},(t=this.textProps.cancelText)!==null&&t!==void 0?t:"取消"),n("div",{class:"weui-picker__action",onClick:this.handleChange},(i=this.textProps.okText)!==null&&i!==void 0?i:"确定")),n("div",{class:"weui-picker__bd"},c),n("input",{type:"hidden",name:u,value:v(this.pickerValue)}))))};Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{mode:["onPropsChange"],value:["onPropsChange"],range:["onPropsChange"],start:["onPropsChange"],end:["onPropsChange"]}},enumerable:false,configurable:true});return e}());M.style=x;var D=e("taro_picker_group",function(){function e(e){t(this,e);this.onColumnChange=i(this,"columnChange",7);this.mode=undefined;this.range=[];this.rangeKey=undefined;this.height=undefined;this.columnId=undefined;this.updateHeight=undefined;this.updateDay=undefined;this.startY=undefined;this.preY=undefined;this.hadMove=undefined;this.touchEnd=undefined;this.isMove=undefined}e.prototype.getPosition=function(){var e=this.touchEnd?.3:0;var t="translate3d(0, ".concat(this.height,"px, 0)");var i="transform ".concat(e,"s");return{transform:t,"-webkit-transform":t,transition:i,"-webkit-transition":i}};e.prototype.formulaUnlimitedScroll=function(e,t,i){var n=this;var r=this,a=r.height,o=r.updateHeight,u=r.columnId;var s=i==="up"?1:-1;this.touchEnd=false;o(-e*s*w+a,u);requestAnimationFrame((function(){n.touchEnd=true;var i=Math.round(t/-w)+e*s;var r=k-w*i;o(r,u,true)}))};e.prototype.handleMoveStart=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){this.startY=e;this.preY=e;this.hadMove=false;return[2]}))}))};e.prototype.handleMoving=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n;return __generator(this,(function(r){t=e;i=t-this.preY;this.preY=t;this.touchEnd=false;if(Math.abs(t-this.startY)>10)this.hadMove=true;n=this.height+i;if(this.mode==="time"){if(this.columnId==="0"){if(n>k-w*3){n=k-w*27+i}if(n<k-w*28){n=k-w*4+i}}else if(this.columnId==="1"){if(n>k-w*3){n=k-w*63+i}if(n<k-w*64){n=k-w*4+i}}}this.updateHeight(n,this.columnId);return[2]}))}))};e.prototype.handleMoveEnd=function(e){return __awaiter(this,void 0,void 0,(function(){var t,i,n,r,a,o,u,s,h,l,c,d,f,p;return __generator(this,(function(v){t=this,i=t.mode,n=t.range,r=t.height,a=t.updateHeight,o=t.columnId;u=0;s=-w*(n.length-1);h=e;this.touchEnd=true;if(!this.hadMove){c=window.innerHeight;d=c-C/2;l=r-k-(h-d);if(i==="time"){if(o==="0"){if(l>-w*2.5){return[2,this.formulaUnlimitedScroll(24,l,"up")]}if(l<-w*28.5){return[2,this.formulaUnlimitedScroll(24,l,"down")]}}else if(o==="1"){if(l>-w*2.5){return[2,this.formulaUnlimitedScroll(60,l,"up")]}if(l<-w*64.5){return[2,this.formulaUnlimitedScroll(60,l,"down")]}}}}else{l=r-k}if(l>u)l=0;if(l<s)l=s;f=Math.round(l/-w);p=k-w*f;if(this.mode==="date"&&typeof this.updateDay==="function"){if(this.columnId==="0"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),0)}if(this.columnId==="1"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),1)}if(this.columnId==="2"){this.updateDay(+this.range[f].replace(/[^0-9]/gi,""),2)}}a(p,o,i==="time");this.onColumnChange.emit({columnId:o,height:p});return[2]}))}))};e.prototype.onMouseDown=function(e){this.isMove=true;this.handleMoveStart(e.clientY)};e.prototype.onMouseMove=function(e){if(!this.isMove)return;this.handleMoving(e.clientY)};e.prototype.onMouseMoveEnd=function(e){if(!this.isMove)return;this.isMove=false;this.handleMoveEnd(e.clientY)};e.prototype.onTouchStart=function(e){this.handleMoveStart(e.changedTouches[0].clientY)};e.prototype.onTouchMove=function(e){this.handleMoving(e.changedTouches[0].clientY)};e.prototype.onTouchEnd=function(e){this.handleMoveEnd(e.changedTouches[0].clientY)};e.prototype.render=function(){var e=this,t=e.range,i=e.rangeKey;var a=t.map((function(e){var t=i?e[i]:e;return n("div",{class:"weui-picker__item"},t)}));return n(r,{class:"weui-picker__group"},n("div",{class:"weui-picker__mask"}),n("div",{class:"weui-picker__indicator"}),n("div",{class:"weui-picker__content",style:this.getPosition()},a))};return e}())}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as s,h as e,H as i,g as o}from"./p-9137dcab.js";import{c as h}from"./p-
|
|
1
|
+
import{r as t,c as s,h as e,H as i,g as o}from"./p-9137dcab.js";import{c as h}from"./p-de951a46.js";const r=class{constructor(e){t(this,e),this.onLongPress=s(this,"longpress",7),this.startTime=0,this.animation=void 0,this.hoverClass=void 0,this.hoverStartTime=50,this.hoverStayTime=400,this.hover=!1,this.touch=!1}onTouchStart(){this.hoverClass&&(this.touch=!0,setTimeout((()=>{this.touch&&(this.hover=!0)}),this.hoverStartTime)),this.timeoutEvent=setTimeout((()=>{this.onLongPress.emit()}),350),this.startTime=Date.now()}onTouchMove(){clearTimeout(this.timeoutEvent)}onTouchEnd(){Date.now()-this.startTime<350&&clearTimeout(this.timeoutEvent),this.hoverClass&&(this.touch=!1,setTimeout((()=>{this.touch||(this.hover=!1)}),this.hoverStayTime))}componentDidRender(){this.el.childNodes.forEach((t=>{t.nodeType===document.COMMENT_NODE&&t["s-cn"]&&(t["s-cn"]=!1),t.nodeType!==document.COMMENT_NODE&&t["s-sr"]&&(t["s-sr"]=!1)}))}render(){const t=h({[`${this.hoverClass}`]:this.hover});let s={};return this.animation&&(s.animation=this.animation,s["data-animation"]=this.animation),e(i,Object.assign({class:t},s),e("slot",null))}get el(){return o(this)}};r.style="body,html{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}taro-view-core{display:block}";export{r as taro_view_core}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-7e6b54cb.system.js","./p-
|
|
1
|
+
System.register(["./p-7e6b54cb.system.js","./p-2ec68968.system.js"],(function(t,i){"use strict";var o,e,r,a,s;return{setters:[function(t){o=t.r;e=t.c;r=t.h;a=t.H},function(t){s=t.c}],execute:function(){var n='img[src=""]{opacity:0}taro-image-core{display:inline-block;overflow:hidden;position:relative;width:auto;height:auto;font-size:0}.taro-img.taro-img__widthfix{height:100%}.taro-img__mode-scaletofill{width:100%;height:100%}.taro-img__mode-aspectfit{max-width:100%;max-height:100%}.taro-img__mode-aspectfill{position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.taro-img__mode-aspectfill--width{min-width:100%;height:100%}.taro-img__mode-aspectfill--height{width:100%;min-height:100%}.taro-img__mode-widthfix{width:100%}.taro-img__mode-heightfix{height:100%}.taro-img__mode-top{width:100%}.taro-img__mode-bottom{position:absolute;bottom:0;width:100%}.taro-img__mode-left{height:100%}.taro-img__mode-right{position:absolute;right:0;height:100%}.taro-img__mode-topright{position:absolute;right:0}.taro-img__mode-bottomleft{position:absolute;bottom:0}.taro-img__mode-bottomright{position:absolute;right:0;bottom:0}';i.import("./p-3b1d2d37.system.js");var h=t("taro_image_core",function(){function t(t){o(this,t);this.onLoad=e(this,"load",7);this.onError=e(this,"error",7);this.src=undefined;this.mode="scaleToFill";this.lazyLoad=false;this.nativeProps={};this.aspectFillMode="width"}t.prototype.componentDidLoad=function(){var t=this;if(!this.lazyLoad)return;var i=new IntersectionObserver((function(o){if(o[o.length-1].isIntersecting){i.unobserve(t.imgRef);t.imgRef.src=t.src}}),{rootMargin:"300px 0px"});i.observe(this.imgRef)};t.prototype.imageOnLoad=function(){var t=this.imgRef,i=t.width,o=t.height,e=t.naturalWidth,r=t.naturalHeight;this.onLoad.emit({width:i,height:o});this.aspectFillMode=e>r?"width":"height"};t.prototype.imageOnError=function(t){this.onError.emit(t)};t.prototype.render=function(){var t;var i=this;var o=this,e=o.src,n=o.mode,h=n===void 0?"scaleToFill":n,m=o.lazyLoad,d=m===void 0?false:m,g=o.aspectFillMode,l=g===void 0?"width":g,c=o.imageOnLoad,f=o.imageOnError,p=o.nativeProps;var _=s({"taro-img__widthfix":h==="widthFix"});var u=s("taro-img__mode-".concat(h.toLowerCase().replace(/\s/g,"")),(t={},t["taro-img__mode-aspectfill--".concat(l)]=h==="aspectFill",t));return r(a,{class:_},d?r("img",Object.assign({ref:function(t){return i.imgRef=t},class:u,onLoad:c.bind(this),onError:f.bind(this)},p)):r("img",Object.assign({ref:function(t){return i.imgRef=t},class:u,src:e,onLoad:c.bind(this),onError:f.bind(this)},p)))};return t}());h.style=n}}}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
var r,n,e=(r=function(r){
|
|
2
|
+
/*!
|
|
3
|
+
Copyright (c) 2018 Jed Watson.
|
|
4
|
+
Licensed under the MIT License (MIT), see
|
|
5
|
+
http://jedwatson.github.io/classnames
|
|
6
|
+
*/
|
|
7
|
+
!function(){var n={}.hasOwnProperty;function e(){for(var r=[],i=0;i<arguments.length;i++){var o=arguments[i];if(o){var t=typeof o;if("string"===t||"number"===t)r.push(o);else if(Array.isArray(o)){if(o.length){var u=e.apply(null,o);u&&r.push(u)}}else if("object"===t){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){r.push(o.toString());continue}for(var f in o)n.call(o,f)&&o[f]&&r.push(f)}}}return r.join(" ")}r.exports?(e.default=e,r.exports=e):window.classNames=e}()},r(n={path:undefined,exports:{},require:function(){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}}),n.exports);export{e as c}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
System.register(["./p-7e6b54cb.system.js"],(function(e){"use strict";var t,r,n;return{setters:[function(e){t=e.r;r=e.h;n=e.H}],execute:function(){var s="taro-rich-text-core{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}taro-rich-text-core[selectable=true],taro-rich-text-core[user-select=true]{display:block;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}taro-rich-text-core[space]{white-space:pre-wrap}taro-rich-text-core[space=ensp]{word-spacing:0.5em}taro-rich-text-core[space=nbsp]{word-spacing:1em}";var c=e("taro_rich_text_core",function(){function e(e){var n=this;t(this,e);this.renderNode=function(e){if("type"in e&&e.type==="text"){var t=(e.text||"").replace(/ /g," ");return t}else if("name"in e&&e.name){var s=e.name,c=e.attrs,i=e.children;var a={};var o=[];if(c&&typeof c==="object"){var u=function(e){var t=c[e];if(e==="style"&&typeof t==="string"){var r=t.split(";").map((function(e){return e.trim()})).filter((function(e){return e}));var n={};r.forEach((function(e){if(!e)return;var t=/(.+): *(.+)/g.exec(e);if(!t)return;var r=t[1],s=t[2];var c=r.replace(/-([a-z])/g,(function(){var e=[];for(var t=0;t<arguments.length;t++){e[t]=arguments[t]}return e[1].toUpperCase()}));n[c]=s}));if(Object.keys(n).length){a.style=n}return"continue"}a[e]=t};for(var l in c){u(l)}}if(i&&i.length){o=i.map((function(e){return n.renderNode(e)}))}return r(s,a,o)}return null};this.nodes=undefined;this.selectable=false;this.userSelect=false;this.space=undefined}e.prototype.render=function(){var e=this,t=e.nodes,s=e.renderNode;if(Array.isArray(t)){return r(n,null,t.map((function(e){return s(e)})))}else{return r(n,{innerHTML:t})}};return e}());c.style=s}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as a,c as r,H as e,g as o}from"./p-9137dcab.js";import s from"@tarojs/taro";import{c as i}from"./p-
|
|
1
|
+
import{h as t,r as a,c as r,H as e,g as o}from"./p-9137dcab.js";import s from"@tarojs/taro";import{c as i}from"./p-de951a46.js";import{i as n}from"./p-d3c7f87d.js";const h=t=>{let a,r=t||"";const e={path:null,query:null,fragment:null};return a=r.indexOf("#"),a>-1&&(e.fragment=r.substring(a+1),r=r.substring(0,a)),a=r.indexOf("?"),a>-1&&(e.query=r.substring(a+1),r=r.substring(0,a)),e.path=r,e},b=(t="")=>"/"===t.charAt(0)?t:"/"+t,l=(t="",a="")=>((t="",a="")=>new RegExp("^"+a+"(\\/|\\?|#|$)","i").test(t)||t===a)(t,a)?t.substring(a.length):t;function d(t){return"/"===t.charAt(0)}function c(t,a){for(var r=a,e=r+1,o=t.length;e<o;r+=1,e+=1)t[r]=t[e];t.pop()}const _=({index:a,isSelected:r=!1,textColor:e,iconPath:o,badgeText:h,showRedDot:b=!1,pagePath:l,text:d,onSelect:c})=>{const _=i("weui-tabbar__item",{"weui-bar__item_on":r});return t("a",{key:a,href:"javascript:;",class:_,onClick:function(){const t=s.getCurrentPages().shift();"function"==typeof(null==t?void 0:t.onTabItemTap)&&n(this)&&t.onTabItemTap({index:a,pagePath:l,text:d}),c(a)}},t("span",{style:{display:"inline-block",position:"relative"}},t("img",{src:o,alt:"",class:"weui-tabbar__icon"}),!!h&&t("span",{class:"weui-badge taro-tabbar-badge",style:{position:"absolute",top:"-2px",right:"-13px"}},h),b&&t("span",{class:"weui-badge weui-badge_dot",style:{position:"absolute",top:"0",right:"-6px"}})),t("p",{class:"weui-tabbar__label",style:{color:e}},d))},u="taro-tabbar__tabbar",g=class{constructor(t){a(this,t),this.onLongPress=r(this,"longpress",7),this.homePage="",this.customRoutes=[],this.tabbarPos="bottom",this.getOriginUrl=t=>{const a=this.customRoutes.filter((([,a])=>h(a).path===h(t).path));return((t="",a="")=>t.includes(a)?t.substring(0,t.length-a.length):t)(a.length?a[0][0]:t,".html")},this.getSelectedIndex=t=>{let a=-1;return this.list.forEach((({pagePath:r},e)=>{h(t).path===h(r).path&&(a=e)})),a},this.switchTab=t=>{this.selectedIndex=t,s.switchTab({url:this.list[t].pagePath})},this.switchTabHandler=({url:t,successHandler:a,errorHandler:r})=>{const e=function(t,a){void 0===a&&(a="");var r,e=t&&t.split("/")||[],o=a&&a.split("/")||[],s=t&&d(t),i=a&&d(a),n=s||i;if(t&&d(t)?o=e:e.length&&(o.pop(),o=o.concat(e)),!o.length)return"/";if(o.length){var h=o[o.length-1];r="."===h||".."===h||""===h}else r=!1;for(var b=0,l=o.length;l>=0;l--){var _=o[l];"."===_?c(o,l):".."===_?(c(o,l),b++):b&&(c(o,l),b--)}if(!n)for(;b--;b)o.unshift("..");!n||""===o[0]||o[0]&&d(o[0])||o.unshift("");var u=o.join("/");return r&&"/"!==u.substr(-1)&&(u+="/"),u}(t,this.getOriginUrl(this.getCurrentUrl()||this.homePage)),o=this.getSelectedIndex(e);o>-1?(this.switchTab(o),a({errMsg:"switchTab:ok"})):r({errMsg:`switchTab:fail page "${e}" is not found`})},this.routerChangeHandler=t=>{var a;const r=null===(a=null==t?void 0:t.toLocation)||void 0===a?void 0:a.path;let e;if("string"==typeof r){const t=this.conf.basename||"/";e=l(b(r||this.homePage),t)||"/"}else e=this.getCurrentUrl();this.selectedIndex=this.getSelectedIndex(this.getOriginUrl(e))},this.setTabBarBadgeHandler=({index:t,text:a,successHandler:r,errorHandler:e})=>{const o=[...this.list];t in o?(o[t].showRedDot=!1,o[t].badgeText=a,r({errMsg:"setTabBarBadge:ok"})):e({errMsg:"setTabBarBadge:fail tabbar item not found"}),this.list=o},this.removeTabBarBadgeHandler=({index:t,successHandler:a,errorHandler:r})=>{const e=[...this.list];t in e?(e[t].badgeText=null,e[t].badgeText=null,a({errMsg:"removeTabBarBadge:ok"})):r({errMsg:"removeTabBarBadge:fail tabbar item not found"}),this.list=e},this.showTabBarRedDotHandler=({index:t,successHandler:a,errorHandler:r})=>{const e=[...this.list];t in e?(e[t].badgeText=null,e[t].showRedDot=!0,a({errMsg:"showTabBarRedDot:ok"})):r({errMsg:"showTabBarRedDot:fail tabbar item not found"}),this.list=e},this.hideTabBarRedDotHandler=({index:t,successHandler:a,errorHandler:r})=>{const e=[...this.list];t in e?(e[t].showRedDot=!1,a({errMsg:"hideTabBarRedDot:ok"})):r({errMsg:"hideTabBarRedDot:fail tabbar item not found"}),this.list=e},this.showTabBarHandler=({successHandler:t})=>{this.status=0,t({errMsg:"showTabBar:ok"})},this.hideTabBarHandler=({animation:t,successHandler:a})=>{this.status=t?2:1,a({errMsg:"hideTabBar:ok"})},this.setTabBarStyleHandler=({color:t,selectedColor:a,backgroundColor:r,borderStyle:e,successHandler:o})=>{r&&(this.backgroundColor=r),e&&(this.borderStyle=e),t&&(this.color=t),a&&(this.selectedColor=a),o({errMsg:"setTabBarStyle:ok"})},this.setTabBarItemHandler=({index:t,iconPath:a,selectedIconPath:r,text:e,successHandler:o,errorHandler:s})=>{const i=[...this.list];t in i?(a&&(i[t].iconPath=a),r&&(i[t].selectedIconPath=r),e&&(i[t].text=e),o({errMsg:"setTabBarItem:ok"})):s({errMsg:"setTabBarItem:fail tabbar item not found"}),this.list=i},this.conf=void 0,this.list=void 0,this.borderStyle=void 0,this.backgroundColor=void 0,this.color=void 0,this.selectedColor=void 0,this.selectedIndex=-1,this.status=0}componentWillLoad(){var t,a;const r=(null===(t=this.conf)||void 0===t?void 0:t.list)||[],e=(null===(a=this.conf)||void 0===a?void 0:a.customRoutes)||{};if("[object Array]"!==Object.prototype.toString.call(r)||r.length<2||r.length>5)throw new Error("tabBar 配置错误");this.homePage=b(this.conf.homePage);for(let t in e){const a=e[t];t=b(t),"string"==typeof a?this.customRoutes.push([t,b(a)]):(null==a?void 0:a.length)>0&&this.customRoutes.push(...a.map((a=>[t,b(a)])))}r.forEach((t=>{0!==t.pagePath.indexOf("/")&&(t.pagePath="/"+t.pagePath)})),this.list=r,this.borderStyle=this.conf.borderStyle,this.backgroundColor=this.conf.backgroundColor,this.color=this.conf.color,this.selectedColor=this.conf.selectedColor}getCurrentUrl(){const t=((t="hash",a="/")=>{const r="hash"===t?location.hash.slice(1).split("?")[0]:location.pathname;return b(l(r,a))})(this.conf.mode,this.conf.basename);return decodeURI("/"===t?this.homePage:t)}bindEvent(){s.eventCenter.on("__taroRouterChange",this.routerChangeHandler),s.eventCenter.on("__taroSwitchTab",this.switchTabHandler),s.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler),s.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler),s.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler),s.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler),s.eventCenter.on("__taroShowTabBar",this.showTabBarHandler),s.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler),s.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler),s.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)}removeEvent(){s.eventCenter.off("__taroRouterChange",this.routerChangeHandler),s.eventCenter.off("__taroSwitchTab",this.switchTabHandler),s.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler),s.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler),s.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler),s.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler),s.eventCenter.off("__taroShowTabBar",this.showTabBarHandler),s.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler),s.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler),s.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)}componentDidLoad(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom",this.bindEvent(),this.routerChangeHandler()}disconnectedCallback(){this.removeEvent()}render(){const{tabbarPos:a="bottom"}=this,r=this.status,o=i("weui-tabbar",{[`taro-tabbar__border-${this.borderStyle||"black"}`]:!0});return t(e,{class:i(u,`${u}-${a}`,{"taro-tabbar__tabbar-hide":-1===this.selectedIndex||1===r,"taro-tabbar__tabbar-slideout":2===r})},t("div",{class:o,style:{backgroundColor:this.backgroundColor||"",height:"inherit"}},this.list.map(((a,r)=>{const e=this.selectedIndex===r;let o,s;return e?(o=this.selectedColor||"",s=a.selectedIconPath):(o=this.color||"",s=a.iconPath),t(_,{index:r,onSelect:this.switchTab.bind(this),isSelected:e,textColor:o,iconPath:s,pagePath:a.pagePath,text:a.text,badgeText:a.badgeText,showRedDot:a.showRedDot})}))))}get tabbar(){return o(this)}};g.style="html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;overflow:hidden;-ms-flex-direction:column;flex-direction:column;height:100%}.taro-tabbar__panel{overflow:auto;position:relative;-ms-flex:1;flex:1;-webkit-overflow-scrolling:auto}.taro-tabbar__tabbar{position:relative;width:100%;height:50px;-webkit-transition:bottom 0.2s, top 0.2s;transition:bottom 0.2s, top 0.2s}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{bottom:0;margin-bottom:constant(safe-area-inset-bottom);margin-bottom:env(safe-area-inset-bottom)}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{top:-52px;-ms-flex:0 0;flex:0 0}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}";export{g as taro_tabbar}
|