@tarojs/components 3.4.0-beta.0 → 3.5.0-canary.0

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.
@@ -336,6 +336,9 @@ let Tabbar = class {
336
336
  });
337
337
  this.list = list;
338
338
  this.borderStyle = this.conf.borderStyle;
339
+ this.backgroundColor = this.conf.backgroundColor;
340
+ this.color = this.conf.color;
341
+ this.selectedColor = this.conf.selectedColor;
339
342
  }
340
343
  getCurrentUrl() {
341
344
  const routerMode = this.conf.mode;
@@ -404,14 +407,13 @@ let Tabbar = class {
404
407
  let textColor;
405
408
  let iconPath;
406
409
  if (isSelected) {
407
- textColor = this.selectedColor;
410
+ textColor = this.selectedColor || '';
408
411
  iconPath = item.selectedIconPath;
409
412
  }
410
413
  else {
411
414
  textColor = this.color || '';
412
415
  iconPath = item.iconPath;
413
416
  }
414
- console.log('TabbarItem', item);
415
417
  return (index$1.h(TabbarItem, { index: index, onSelect: this.switchTab.bind(this), isSelected: isSelected, textColor: textColor, iconPath: iconPath, text: item.text, badgeText: item.badgeText, showRedDot: item.showRedDot }));
416
418
  }))));
417
419
  }
@@ -205,6 +205,9 @@ export class Tabbar {
205
205
  });
206
206
  this.list = list;
207
207
  this.borderStyle = this.conf.borderStyle;
208
+ this.backgroundColor = this.conf.backgroundColor;
209
+ this.color = this.conf.color;
210
+ this.selectedColor = this.conf.selectedColor;
208
211
  }
209
212
  getCurrentUrl() {
210
213
  const routerMode = this.conf.mode;
@@ -274,14 +277,13 @@ export class Tabbar {
274
277
  let textColor;
275
278
  let iconPath;
276
279
  if (isSelected) {
277
- textColor = this.selectedColor;
280
+ textColor = this.selectedColor || '';
278
281
  iconPath = item.selectedIconPath;
279
282
  }
280
283
  else {
281
284
  textColor = this.color || '';
282
285
  iconPath = item.iconPath;
283
286
  }
284
- console.log('TabbarItem', item);
285
287
  return (h(TabbarItem, { index: index, onSelect: this.switchTab.bind(this), isSelected: isSelected, textColor: textColor, iconPath: iconPath, text: item.text, badgeText: item.badgeText, showRedDot: item.showRedDot }));
286
288
  }))));
287
289
  }
@@ -332,6 +332,9 @@ let Tabbar = class {
332
332
  });
333
333
  this.list = list;
334
334
  this.borderStyle = this.conf.borderStyle;
335
+ this.backgroundColor = this.conf.backgroundColor;
336
+ this.color = this.conf.color;
337
+ this.selectedColor = this.conf.selectedColor;
335
338
  }
336
339
  getCurrentUrl() {
337
340
  const routerMode = this.conf.mode;
@@ -400,14 +403,13 @@ let Tabbar = class {
400
403
  let textColor;
401
404
  let iconPath;
402
405
  if (isSelected) {
403
- textColor = this.selectedColor;
406
+ textColor = this.selectedColor || '';
404
407
  iconPath = item.selectedIconPath;
405
408
  }
406
409
  else {
407
410
  textColor = this.color || '';
408
411
  iconPath = item.iconPath;
409
412
  }
410
- console.log('TabbarItem', item);
411
413
  return (h(TabbarItem, { index: index, onSelect: this.switchTab.bind(this), isSelected: isSelected, textColor: textColor, iconPath: iconPath, text: item.text, badgeText: item.badgeText, showRedDot: item.showRedDot }));
412
414
  }))));
413
415
  }
@@ -1 +1 @@
1
- var __spreadArray=this&&this.__spreadArray||function(e,a){for(var t=0,r=a.length,o=e.length;t<r;t++,o++)e[o]=a[t];return e};import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-5bd7cbab.js";import{c as classnames}from"./index-3c78bcaf.js";function isAbsolute(e){return e.charAt(0)==="/"}function spliceOne(e,a){for(var t=a,r=t+1,o=e.length;r<o;t+=1,r+=1){e[t]=e[r]}e.pop()}function resolvePathname(e,a){if(a===undefined)a="";var t=e&&e.split("/")||[];var r=a&&a.split("/")||[];var o=e&&isAbsolute(e);var n=a&&isAbsolute(a);var s=o||n;if(e&&isAbsolute(e)){r=t}else if(t.length){r.pop();r=r.concat(t)}if(!r.length)return"/";var i;if(r.length){var l=r[r.length-1];i=l==="."||l===".."||l===""}else{i=false}var b=0;for(var d=r.length;d>=0;d--){var h=r[d];if(h==="."){spliceOne(r,d)}else if(h===".."){spliceOne(r,d);b++}else if(b){spliceOne(r,d);b--}}if(!s)for(;b--;b)r.unshift("..");if(s&&r[0]!==""&&(!r[0]||!isAbsolute(r[0])))r.unshift("");var c=r.join("/");if(i&&c.substr(-1)!=="/")c+="/";return c}var splitUrl=function(e){var a=e||"";var t;var r={path:null,query:null,fragment:null};t=a.indexOf("#");if(t>-1){r.fragment=a.substring(t+1);a=a.substring(0,t)}t=a.indexOf("?");if(t>-1){r.query=a.substring(t+1);a=a.substring(0,t)}r.path=a;return r};var TabbarItem=function(e){var a=e.index,t=e.isSelected,r=t===void 0?false:t,o=e.textColor,n=e.iconPath,s=e.badgeText,i=e.showRedDot,l=i===void 0?false:i,b=e.text,d=e.onSelect;var c=classnames("weui-tabbar__item",{"weui-bar__item_on":r});var f={position:"absolute",top:"-2px",right:"-13px"};var u={position:"absolute",top:"0",right:"-6px"};function v(){d(a)}return h("a",{key:a,href:"javascript:;",class:c,onClick:v},h("span",{style:{display:"inline-block",position:"relative"}},h("img",{src:n,alt:"",class:"weui-tabbar__icon"}),!!s&&h("span",{class:"weui-badge taro-tabbar-badge",style:f},s),l&&h("span",{class:"weui-badge weui-badge_dot",style:u})),h("p",{class:"weui-tabbar__label",style:{color:o}},b))};var indexCss="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;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-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}.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}";var Taro=require("@tarojs/taro");var addLeadingSlash=function(e){return e[0]==="/"?e:"/"+e};var hasBasename=function(e,a){return new RegExp("^"+a+"(\\/|\\?|#|$)","i").test(e)};var stripBasename=function(e,a){return hasBasename(e,a)?e.substr(a.length):e};var STATUS_SHOW=0;var STATUS_HIDE=1;var STATUS_SLIDEOUT=2;var basicTabBarClassName="taro-tabbar__tabbar";var hideTabBarClassName="taro-tabbar__tabbar-hide";var hideTabBarWithAnimationClassName="taro-tabbar__tabbar-slideout";var Tabbar=function(){function e(e){var a=this;registerInstance(this,e);this.onLongPress=createEvent(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.selectedIndex=-1;this.status=STATUS_SHOW;this.getOriginUrl=function(e){var t=a.customRoutes.filter((function(a){var t=a[1];var r=splitUrl(t).path;var o=splitUrl(e).path;return r===o}));return t.length?t[0][0]:e};this.getSelectedIndex=function(e){var t=-1;a.list.forEach((function(a,r){var o=a.pagePath;var n=splitUrl(e).path;var s=splitUrl(o).path;if(n===s){t=r}}));return t};this.switchTab=function(e){a.selectedIndex=e;Taro.switchTab({url:a.list[e].pagePath})};this.switchTabHandler=function(e){var t=e.url,r=e.successHandler,o=e.errorHandler;var n=a.getOriginUrl(a.getCurrentUrl()||a.homePage);var s=resolvePathname(t,n);var i=a.getSelectedIndex(s);if(i>-1){a.switchTab(i);r({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'+s+'" is not found'})}};this.routerChangeHandler=function(e){var t;var r;if(e){t=e.toLocation}if(t&&t.path){var o=addLeadingSlash(t.path);r=stripBasename(o==="/"?a.homePage:o,a.conf.basename||"/")}else{r=a.getCurrentUrl()}a.selectedIndex=a.getSelectedIndex(a.getOriginUrl(r))};this.setTabBarBadgeHandler=function(e){var t=e.index,r=e.text,o=e.successHandler,n=e.errorHandler;var s=__spreadArray([],a.list);if(t in s){s[t].showRedDot=false;s[t].badgeText=r;o({errMsg:"setTabBarBadge:ok"})}else{n({errMsg:"setTabBarBadge:fail tabbar item not found"})}a.list=s};this.removeTabBarBadgeHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].badgeText=null;n[t].badgeText=null;r({errMsg:"removeTabBarBadge:ok"})}else{o({errMsg:"removeTabBarBadge:fail tabbar item not found"})}a.list=n};this.showTabBarRedDotHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].badgeText=null;n[t].showRedDot=true;r({errMsg:"showTabBarRedDot:ok"})}else{o({errMsg:"showTabBarRedDot:fail tabbar item not found"})}a.list=n};this.hideTabBarRedDotHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].showRedDot=false;r({errMsg:"hideTabBarRedDot:ok"})}else{o({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}a.list=n};this.showTabBarHandler=function(e){var t=e.successHandler;a.status=STATUS_SHOW;t({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var t=e.animation,r=e.successHandler;a.status=t?STATUS_SLIDEOUT:STATUS_HIDE;r({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=function(e){var t=e.color,r=e.selectedColor,o=e.backgroundColor,n=e.borderStyle,s=e.successHandler;if(o)a.backgroundColor=o;if(n)a.borderStyle=n;if(t)a.color=t;if(r)a.selectedColor=r;s({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var t=e.index,r=e.iconPath,o=e.selectedIconPath,n=e.text,s=e.successHandler,i=e.errorHandler;var l=__spreadArray([],a.list);if(t in l){if(r)l[t].iconPath=r;if(o)l[t].selectedIconPath=o;if(n)l[t].text=n;s({errMsg:"setTabBarItem:ok"})}else{i({errMsg:"setTabBarItem:fail tabbar item not found"})}a.list=l};var t=this.conf.list;var r=this.conf.customRoutes;if(Object.prototype.toString.call(t)!=="[object Array]"||t.length<2||t.length>5){throw new Error("tabBar 配置错误")}this.homePage=addLeadingSlash(this.conf.homePage);for(var o in r){this.customRoutes.push([o,r[o]])}t.forEach((function(e){if(e.pagePath.indexOf("/")!==0){e.pagePath="/"+e.pagePath}}));this.list=t;this.borderStyle=this.conf.borderStyle}e.prototype.getCurrentUrl=function(){var e=this.conf.mode;var a=this.conf.basename||"/";var t;if(e==="hash"){var r=window.location.href;var o=r.indexOf("#");t=o===-1?"":r.substring(o+1)}else{t=location.pathname}var n=addLeadingSlash(stripBasename(t,a));return n==="/"?this.homePage:n};e.prototype.bindEvent=function(){Taro.eventCenter.on("__taroRouterChange",this.routerChangeHandler);Taro.eventCenter.on("__taroSwitchTab",this.switchTabHandler);Taro.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler);Taro.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);Taro.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);Taro.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);Taro.eventCenter.on("__taroShowTabBar",this.showTabBarHandler);Taro.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler);Taro.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler);Taro.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.removeEvent=function(){Taro.eventCenter.off("__taroRouterChange",this.routerChangeHandler);Taro.eventCenter.off("__taroSwitchTab",this.switchTabHandler);Taro.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler);Taro.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);Taro.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);Taro.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);Taro.eventCenter.off("__taroShowTabBar",this.showTabBarHandler);Taro.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler);Taro.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler);Taro.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.componentDidLoad=function(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom";this.bindEvent();this.routerChangeHandler()};e.prototype.disconnectedCallback=function(){this.removeEvent()};e.prototype.render=function(){var e,a;var t=this;var r=this.tabbarPos,o=r===void 0?"bottom":r;var n=this.status;var s=classnames("weui-tabbar",(e={},e["taro-tabbar__border-"+(this.borderStyle||"black")]=true,e));var i=this.selectedIndex===-1||n===STATUS_HIDE;var l=n===STATUS_SLIDEOUT;return h(Host,{class:classnames(basicTabBarClassName,basicTabBarClassName+"-"+o,(a={},a[hideTabBarClassName]=i,a[hideTabBarWithAnimationClassName]=l,a))},h("div",{class:s,style:{backgroundColor:this.backgroundColor||""}},this.list.map((function(e,a){var r=t.selectedIndex===a;var o;var n;if(r){o=t.selectedColor;n=e.selectedIconPath}else{o=t.color||"";n=e.iconPath}console.log("TabbarItem",e);return h(TabbarItem,{index:a,onSelect:t.switchTab.bind(t),isSelected:r,textColor:o,iconPath:n,text:e.text,badgeText:e.badgeText,showRedDot:e.showRedDot})}))))};Object.defineProperty(e.prototype,"tabbar",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();Tabbar.style=indexCss;export{Tabbar as taro_tabbar};
1
+ var __spreadArray=this&&this.__spreadArray||function(e,a){for(var t=0,r=a.length,o=e.length;t<r;t++,o++)e[o]=a[t];return e};import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-5bd7cbab.js";import{c as classnames}from"./index-3c78bcaf.js";function isAbsolute(e){return e.charAt(0)==="/"}function spliceOne(e,a){for(var t=a,r=t+1,o=e.length;r<o;t+=1,r+=1){e[t]=e[r]}e.pop()}function resolvePathname(e,a){if(a===undefined)a="";var t=e&&e.split("/")||[];var r=a&&a.split("/")||[];var o=e&&isAbsolute(e);var n=a&&isAbsolute(a);var s=o||n;if(e&&isAbsolute(e)){r=t}else if(t.length){r.pop();r=r.concat(t)}if(!r.length)return"/";var i;if(r.length){var l=r[r.length-1];i=l==="."||l===".."||l===""}else{i=false}var b=0;for(var d=r.length;d>=0;d--){var h=r[d];if(h==="."){spliceOne(r,d)}else if(h===".."){spliceOne(r,d);b++}else if(b){spliceOne(r,d);b--}}if(!s)for(;b--;b)r.unshift("..");if(s&&r[0]!==""&&(!r[0]||!isAbsolute(r[0])))r.unshift("");var c=r.join("/");if(i&&c.substr(-1)!=="/")c+="/";return c}var splitUrl=function(e){var a=e||"";var t;var r={path:null,query:null,fragment:null};t=a.indexOf("#");if(t>-1){r.fragment=a.substring(t+1);a=a.substring(0,t)}t=a.indexOf("?");if(t>-1){r.query=a.substring(t+1);a=a.substring(0,t)}r.path=a;return r};var TabbarItem=function(e){var a=e.index,t=e.isSelected,r=t===void 0?false:t,o=e.textColor,n=e.iconPath,s=e.badgeText,i=e.showRedDot,l=i===void 0?false:i,b=e.text,d=e.onSelect;var c=classnames("weui-tabbar__item",{"weui-bar__item_on":r});var f={position:"absolute",top:"-2px",right:"-13px"};var u={position:"absolute",top:"0",right:"-6px"};function v(){d(a)}return h("a",{key:a,href:"javascript:;",class:c,onClick:v},h("span",{style:{display:"inline-block",position:"relative"}},h("img",{src:n,alt:"",class:"weui-tabbar__icon"}),!!s&&h("span",{class:"weui-badge taro-tabbar-badge",style:f},s),l&&h("span",{class:"weui-badge weui-badge_dot",style:u})),h("p",{class:"weui-tabbar__label",style:{color:o}},b))};var indexCss="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;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-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}.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}";var Taro=require("@tarojs/taro");var addLeadingSlash=function(e){return e[0]==="/"?e:"/"+e};var hasBasename=function(e,a){return new RegExp("^"+a+"(\\/|\\?|#|$)","i").test(e)};var stripBasename=function(e,a){return hasBasename(e,a)?e.substr(a.length):e};var STATUS_SHOW=0;var STATUS_HIDE=1;var STATUS_SLIDEOUT=2;var basicTabBarClassName="taro-tabbar__tabbar";var hideTabBarClassName="taro-tabbar__tabbar-hide";var hideTabBarWithAnimationClassName="taro-tabbar__tabbar-slideout";var Tabbar=function(){function e(e){var a=this;registerInstance(this,e);this.onLongPress=createEvent(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.selectedIndex=-1;this.status=STATUS_SHOW;this.getOriginUrl=function(e){var t=a.customRoutes.filter((function(a){var t=a[1];var r=splitUrl(t).path;var o=splitUrl(e).path;return r===o}));return t.length?t[0][0]:e};this.getSelectedIndex=function(e){var t=-1;a.list.forEach((function(a,r){var o=a.pagePath;var n=splitUrl(e).path;var s=splitUrl(o).path;if(n===s){t=r}}));return t};this.switchTab=function(e){a.selectedIndex=e;Taro.switchTab({url:a.list[e].pagePath})};this.switchTabHandler=function(e){var t=e.url,r=e.successHandler,o=e.errorHandler;var n=a.getOriginUrl(a.getCurrentUrl()||a.homePage);var s=resolvePathname(t,n);var i=a.getSelectedIndex(s);if(i>-1){a.switchTab(i);r({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'+s+'" is not found'})}};this.routerChangeHandler=function(e){var t;var r;if(e){t=e.toLocation}if(t&&t.path){var o=addLeadingSlash(t.path);r=stripBasename(o==="/"?a.homePage:o,a.conf.basename||"/")}else{r=a.getCurrentUrl()}a.selectedIndex=a.getSelectedIndex(a.getOriginUrl(r))};this.setTabBarBadgeHandler=function(e){var t=e.index,r=e.text,o=e.successHandler,n=e.errorHandler;var s=__spreadArray([],a.list);if(t in s){s[t].showRedDot=false;s[t].badgeText=r;o({errMsg:"setTabBarBadge:ok"})}else{n({errMsg:"setTabBarBadge:fail tabbar item not found"})}a.list=s};this.removeTabBarBadgeHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].badgeText=null;n[t].badgeText=null;r({errMsg:"removeTabBarBadge:ok"})}else{o({errMsg:"removeTabBarBadge:fail tabbar item not found"})}a.list=n};this.showTabBarRedDotHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].badgeText=null;n[t].showRedDot=true;r({errMsg:"showTabBarRedDot:ok"})}else{o({errMsg:"showTabBarRedDot:fail tabbar item not found"})}a.list=n};this.hideTabBarRedDotHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list);if(t in n){n[t].showRedDot=false;r({errMsg:"hideTabBarRedDot:ok"})}else{o({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}a.list=n};this.showTabBarHandler=function(e){var t=e.successHandler;a.status=STATUS_SHOW;t({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var t=e.animation,r=e.successHandler;a.status=t?STATUS_SLIDEOUT:STATUS_HIDE;r({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=function(e){var t=e.color,r=e.selectedColor,o=e.backgroundColor,n=e.borderStyle,s=e.successHandler;if(o)a.backgroundColor=o;if(n)a.borderStyle=n;if(t)a.color=t;if(r)a.selectedColor=r;s({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var t=e.index,r=e.iconPath,o=e.selectedIconPath,n=e.text,s=e.successHandler,i=e.errorHandler;var l=__spreadArray([],a.list);if(t in l){if(r)l[t].iconPath=r;if(o)l[t].selectedIconPath=o;if(n)l[t].text=n;s({errMsg:"setTabBarItem:ok"})}else{i({errMsg:"setTabBarItem:fail tabbar item not found"})}a.list=l};var t=this.conf.list;var r=this.conf.customRoutes;if(Object.prototype.toString.call(t)!=="[object Array]"||t.length<2||t.length>5){throw new Error("tabBar 配置错误")}this.homePage=addLeadingSlash(this.conf.homePage);for(var o in r){this.customRoutes.push([o,r[o]])}t.forEach((function(e){if(e.pagePath.indexOf("/")!==0){e.pagePath="/"+e.pagePath}}));this.list=t;this.borderStyle=this.conf.borderStyle;this.backgroundColor=this.conf.backgroundColor;this.color=this.conf.color;this.selectedColor=this.conf.selectedColor}e.prototype.getCurrentUrl=function(){var e=this.conf.mode;var a=this.conf.basename||"/";var t;if(e==="hash"){var r=window.location.href;var o=r.indexOf("#");t=o===-1?"":r.substring(o+1)}else{t=location.pathname}var n=addLeadingSlash(stripBasename(t,a));return n==="/"?this.homePage:n};e.prototype.bindEvent=function(){Taro.eventCenter.on("__taroRouterChange",this.routerChangeHandler);Taro.eventCenter.on("__taroSwitchTab",this.switchTabHandler);Taro.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler);Taro.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);Taro.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);Taro.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);Taro.eventCenter.on("__taroShowTabBar",this.showTabBarHandler);Taro.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler);Taro.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler);Taro.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.removeEvent=function(){Taro.eventCenter.off("__taroRouterChange",this.routerChangeHandler);Taro.eventCenter.off("__taroSwitchTab",this.switchTabHandler);Taro.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler);Taro.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);Taro.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);Taro.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);Taro.eventCenter.off("__taroShowTabBar",this.showTabBarHandler);Taro.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler);Taro.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler);Taro.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.componentDidLoad=function(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom";this.bindEvent();this.routerChangeHandler()};e.prototype.disconnectedCallback=function(){this.removeEvent()};e.prototype.render=function(){var e,a;var t=this;var r=this.tabbarPos,o=r===void 0?"bottom":r;var n=this.status;var s=classnames("weui-tabbar",(e={},e["taro-tabbar__border-"+(this.borderStyle||"black")]=true,e));var i=this.selectedIndex===-1||n===STATUS_HIDE;var l=n===STATUS_SLIDEOUT;return h(Host,{class:classnames(basicTabBarClassName,basicTabBarClassName+"-"+o,(a={},a[hideTabBarClassName]=i,a[hideTabBarWithAnimationClassName]=l,a))},h("div",{class:s,style:{backgroundColor:this.backgroundColor||""}},this.list.map((function(e,a){var r=t.selectedIndex===a;var o;var n;if(r){o=t.selectedColor||"";n=e.selectedIconPath}else{o=t.color||"";n=e.iconPath}return h(TabbarItem,{index:a,onSelect:t.switchTab.bind(t),isSelected:r,textColor:o,iconPath:n,text:e.text,badgeText:e.badgeText,showRedDot:e.showRedDot})}))))};Object.defineProperty(e.prototype,"tabbar",{get:function(){return getElement(this)},enumerable:false,configurable:true});return e}();Tabbar.style=indexCss;export{Tabbar as taro_tabbar};
@@ -1 +1 @@
1
- var __spreadArray=this&&this.__spreadArray||function(e,t){for(var r=0,a=t.length,o=e.length;r<a;r++,o++)e[o]=t[r];return e};System.register(["./p-b2d01686.system.js","./p-94c20f60.system.js"],(function(e){"use strict";var t,r,a,o,n,i;return{setters:[function(e){t=e.h;r=e.r;a=e.c;o=e.H;n=e.g},function(e){i=e.c}],execute:function(){function s(e){return e.charAt(0)==="/"}function l(e,t){for(var r=t,a=r+1,o=e.length;a<o;r+=1,a+=1){e[r]=e[a]}e.pop()}function b(e,t){if(t===undefined)t="";var r=e&&e.split("/")||[];var a=t&&t.split("/")||[];var o=e&&s(e);var n=t&&s(t);var i=o||n;if(e&&s(e)){a=r}else if(r.length){a.pop();a=a.concat(r)}if(!a.length)return"/";var b;if(a.length){var d=a[a.length-1];b=d==="."||d===".."||d===""}else{b=false}var h=0;for(var c=a.length;c>=0;c--){var f=a[c];if(f==="."){l(a,c)}else if(f===".."){l(a,c);h++}else if(h){l(a,c);h--}}if(!i)for(;h--;h)a.unshift("..");if(i&&a[0]!==""&&(!a[0]||!s(a[0])))a.unshift("");var u=a.join("/");if(b&&u.substr(-1)!=="/")u+="/";return u}var d=function(e){var t=e||"";var r;var a={path:null,query:null,fragment:null};r=t.indexOf("#");if(r>-1){a.fragment=t.substring(r+1);t=t.substring(0,r)}r=t.indexOf("?");if(r>-1){a.query=t.substring(r+1);t=t.substring(0,r)}a.path=t;return a};var h=function(e){var r=e.index,a=e.isSelected,o=a===void 0?false:a,n=e.textColor,s=e.iconPath,l=e.badgeText,b=e.showRedDot,d=b===void 0?false:b,h=e.text,c=e.onSelect;var f=i("weui-tabbar__item",{"weui-bar__item_on":o});var u={position:"absolute",top:"-2px",right:"-13px"};var v={position:"absolute",top:"0",right:"-6px"};function g(){c(r)}return t("a",{key:r,href:"javascript:;",class:f,onClick:g},t("span",{style:{display:"inline-block",position:"relative"}},t("img",{src:s,alt:"",class:"weui-tabbar__icon"}),!!l&&t("span",{class:"weui-badge taro-tabbar-badge",style:u},l),d&&t("span",{class:"weui-badge weui-badge_dot",style:v})),t("p",{class:"weui-tabbar__label",style:{color:n}},h))};var c="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;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-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}.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}";var f=require("@tarojs/taro");var u=function(e){return e[0]==="/"?e:"/"+e};var v=function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)};var g=function(e,t){return v(e,t)?e.substr(t.length):e};var _=0;var p=1;var T=2;var B="taro-tabbar__tabbar";var m="taro-tabbar__tabbar-hide";var H="taro-tabbar__tabbar-slideout";var x=e("taro_tabbar",function(){function e(e){var t=this;r(this,e);this.onLongPress=a(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.selectedIndex=-1;this.status=_;this.getOriginUrl=function(e){var r=t.customRoutes.filter((function(t){var r=t[1];var a=d(r).path;var o=d(e).path;return a===o}));return r.length?r[0][0]:e};this.getSelectedIndex=function(e){var r=-1;t.list.forEach((function(t,a){var o=t.pagePath;var n=d(e).path;var i=d(o).path;if(n===i){r=a}}));return r};this.switchTab=function(e){t.selectedIndex=e;f.switchTab({url:t.list[e].pagePath})};this.switchTabHandler=function(e){var r=e.url,a=e.successHandler,o=e.errorHandler;var n=t.getOriginUrl(t.getCurrentUrl()||t.homePage);var i=b(r,n);var s=t.getSelectedIndex(i);if(s>-1){t.switchTab(s);a({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'+i+'" is not found'})}};this.routerChangeHandler=function(e){var r;var a;if(e){r=e.toLocation}if(r&&r.path){var o=u(r.path);a=g(o==="/"?t.homePage:o,t.conf.basename||"/")}else{a=t.getCurrentUrl()}t.selectedIndex=t.getSelectedIndex(t.getOriginUrl(a))};this.setTabBarBadgeHandler=function(e){var r=e.index,a=e.text,o=e.successHandler,n=e.errorHandler;var i=__spreadArray([],t.list);if(r in i){i[r].showRedDot=false;i[r].badgeText=a;o({errMsg:"setTabBarBadge:ok"})}else{n({errMsg:"setTabBarBadge:fail tabbar item not found"})}t.list=i};this.removeTabBarBadgeHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].badgeText=null;n[r].badgeText=null;a({errMsg:"removeTabBarBadge:ok"})}else{o({errMsg:"removeTabBarBadge:fail tabbar item not found"})}t.list=n};this.showTabBarRedDotHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].badgeText=null;n[r].showRedDot=true;a({errMsg:"showTabBarRedDot:ok"})}else{o({errMsg:"showTabBarRedDot:fail tabbar item not found"})}t.list=n};this.hideTabBarRedDotHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].showRedDot=false;a({errMsg:"hideTabBarRedDot:ok"})}else{o({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}t.list=n};this.showTabBarHandler=function(e){var r=e.successHandler;t.status=_;r({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var r=e.animation,a=e.successHandler;t.status=r?T:p;a({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=function(e){var r=e.color,a=e.selectedColor,o=e.backgroundColor,n=e.borderStyle,i=e.successHandler;if(o)t.backgroundColor=o;if(n)t.borderStyle=n;if(r)t.color=r;if(a)t.selectedColor=a;i({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var r=e.index,a=e.iconPath,o=e.selectedIconPath,n=e.text,i=e.successHandler,s=e.errorHandler;var l=__spreadArray([],t.list);if(r in l){if(a)l[r].iconPath=a;if(o)l[r].selectedIconPath=o;if(n)l[r].text=n;i({errMsg:"setTabBarItem:ok"})}else{s({errMsg:"setTabBarItem:fail tabbar item not found"})}t.list=l};var o=this.conf.list;var n=this.conf.customRoutes;if(Object.prototype.toString.call(o)!=="[object Array]"||o.length<2||o.length>5){throw new Error("tabBar 配置错误")}this.homePage=u(this.conf.homePage);for(var i in n){this.customRoutes.push([i,n[i]])}o.forEach((function(e){if(e.pagePath.indexOf("/")!==0){e.pagePath="/"+e.pagePath}}));this.list=o;this.borderStyle=this.conf.borderStyle}e.prototype.getCurrentUrl=function(){var e=this.conf.mode;var t=this.conf.basename||"/";var r;if(e==="hash"){var a=window.location.href;var o=a.indexOf("#");r=o===-1?"":a.substring(o+1)}else{r=location.pathname}var n=u(g(r,t));return n==="/"?this.homePage:n};e.prototype.bindEvent=function(){f.eventCenter.on("__taroRouterChange",this.routerChangeHandler);f.eventCenter.on("__taroSwitchTab",this.switchTabHandler);f.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler);f.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);f.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);f.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);f.eventCenter.on("__taroShowTabBar",this.showTabBarHandler);f.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler);f.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler);f.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.removeEvent=function(){f.eventCenter.off("__taroRouterChange",this.routerChangeHandler);f.eventCenter.off("__taroSwitchTab",this.switchTabHandler);f.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler);f.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);f.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);f.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);f.eventCenter.off("__taroShowTabBar",this.showTabBarHandler);f.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler);f.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler);f.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.componentDidLoad=function(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom";this.bindEvent();this.routerChangeHandler()};e.prototype.disconnectedCallback=function(){this.removeEvent()};e.prototype.render=function(){var e,r;var a=this;var n=this.tabbarPos,s=n===void 0?"bottom":n;var l=this.status;var b=i("weui-tabbar",(e={},e["taro-tabbar__border-"+(this.borderStyle||"black")]=true,e));var d=this.selectedIndex===-1||l===p;var c=l===T;return t(o,{class:i(B,B+"-"+s,(r={},r[m]=d,r[H]=c,r))},t("div",{class:b,style:{backgroundColor:this.backgroundColor||""}},this.list.map((function(e,r){var o=a.selectedIndex===r;var n;var i;if(o){n=a.selectedColor;i=e.selectedIconPath}else{n=a.color||"";i=e.iconPath}console.log("TabbarItem",e);return t(h,{index:r,onSelect:a.switchTab.bind(a),isSelected:o,textColor:n,iconPath:i,text:e.text,badgeText:e.badgeText,showRedDot:e.showRedDot})}))))};Object.defineProperty(e.prototype,"tabbar",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());x.style=c}}}));
1
+ var __spreadArray=this&&this.__spreadArray||function(e,t){for(var r=0,a=t.length,o=e.length;r<a;r++,o++)e[o]=t[r];return e};System.register(["./p-b2d01686.system.js","./p-94c20f60.system.js"],(function(e){"use strict";var t,r,a,o,n,i;return{setters:[function(e){t=e.h;r=e.r;a=e.c;o=e.H;n=e.g},function(e){i=e.c}],execute:function(){function s(e){return e.charAt(0)==="/"}function l(e,t){for(var r=t,a=r+1,o=e.length;a<o;r+=1,a+=1){e[r]=e[a]}e.pop()}function b(e,t){if(t===undefined)t="";var r=e&&e.split("/")||[];var a=t&&t.split("/")||[];var o=e&&s(e);var n=t&&s(t);var i=o||n;if(e&&s(e)){a=r}else if(r.length){a.pop();a=a.concat(r)}if(!a.length)return"/";var b;if(a.length){var d=a[a.length-1];b=d==="."||d===".."||d===""}else{b=false}var h=0;for(var c=a.length;c>=0;c--){var f=a[c];if(f==="."){l(a,c)}else if(f===".."){l(a,c);h++}else if(h){l(a,c);h--}}if(!i)for(;h--;h)a.unshift("..");if(i&&a[0]!==""&&(!a[0]||!s(a[0])))a.unshift("");var u=a.join("/");if(b&&u.substr(-1)!=="/")u+="/";return u}var d=function(e){var t=e||"";var r;var a={path:null,query:null,fragment:null};r=t.indexOf("#");if(r>-1){a.fragment=t.substring(r+1);t=t.substring(0,r)}r=t.indexOf("?");if(r>-1){a.query=t.substring(r+1);t=t.substring(0,r)}a.path=t;return a};var h=function(e){var r=e.index,a=e.isSelected,o=a===void 0?false:a,n=e.textColor,s=e.iconPath,l=e.badgeText,b=e.showRedDot,d=b===void 0?false:b,h=e.text,c=e.onSelect;var f=i("weui-tabbar__item",{"weui-bar__item_on":o});var u={position:"absolute",top:"-2px",right:"-13px"};var v={position:"absolute",top:"0",right:"-6px"};function g(){c(r)}return t("a",{key:r,href:"javascript:;",class:f,onClick:g},t("span",{style:{display:"inline-block",position:"relative"}},t("img",{src:s,alt:"",class:"weui-tabbar__icon"}),!!l&&t("span",{class:"weui-badge taro-tabbar-badge",style:u},l),d&&t("span",{class:"weui-badge weui-badge_dot",style:v})),t("p",{class:"weui-tabbar__label",style:{color:n}},h))};var c="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;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-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}.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}";var f=require("@tarojs/taro");var u=function(e){return e[0]==="/"?e:"/"+e};var v=function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)};var g=function(e,t){return v(e,t)?e.substr(t.length):e};var _=0;var p=1;var T=2;var B="taro-tabbar__tabbar";var m="taro-tabbar__tabbar-hide";var H="taro-tabbar__tabbar-slideout";var x=e("taro_tabbar",function(){function e(e){var t=this;r(this,e);this.onLongPress=a(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.selectedIndex=-1;this.status=_;this.getOriginUrl=function(e){var r=t.customRoutes.filter((function(t){var r=t[1];var a=d(r).path;var o=d(e).path;return a===o}));return r.length?r[0][0]:e};this.getSelectedIndex=function(e){var r=-1;t.list.forEach((function(t,a){var o=t.pagePath;var n=d(e).path;var i=d(o).path;if(n===i){r=a}}));return r};this.switchTab=function(e){t.selectedIndex=e;f.switchTab({url:t.list[e].pagePath})};this.switchTabHandler=function(e){var r=e.url,a=e.successHandler,o=e.errorHandler;var n=t.getOriginUrl(t.getCurrentUrl()||t.homePage);var i=b(r,n);var s=t.getSelectedIndex(i);if(s>-1){t.switchTab(s);a({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'+i+'" is not found'})}};this.routerChangeHandler=function(e){var r;var a;if(e){r=e.toLocation}if(r&&r.path){var o=u(r.path);a=g(o==="/"?t.homePage:o,t.conf.basename||"/")}else{a=t.getCurrentUrl()}t.selectedIndex=t.getSelectedIndex(t.getOriginUrl(a))};this.setTabBarBadgeHandler=function(e){var r=e.index,a=e.text,o=e.successHandler,n=e.errorHandler;var i=__spreadArray([],t.list);if(r in i){i[r].showRedDot=false;i[r].badgeText=a;o({errMsg:"setTabBarBadge:ok"})}else{n({errMsg:"setTabBarBadge:fail tabbar item not found"})}t.list=i};this.removeTabBarBadgeHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].badgeText=null;n[r].badgeText=null;a({errMsg:"removeTabBarBadge:ok"})}else{o({errMsg:"removeTabBarBadge:fail tabbar item not found"})}t.list=n};this.showTabBarRedDotHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].badgeText=null;n[r].showRedDot=true;a({errMsg:"showTabBarRedDot:ok"})}else{o({errMsg:"showTabBarRedDot:fail tabbar item not found"})}t.list=n};this.hideTabBarRedDotHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].showRedDot=false;a({errMsg:"hideTabBarRedDot:ok"})}else{o({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}t.list=n};this.showTabBarHandler=function(e){var r=e.successHandler;t.status=_;r({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var r=e.animation,a=e.successHandler;t.status=r?T:p;a({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=function(e){var r=e.color,a=e.selectedColor,o=e.backgroundColor,n=e.borderStyle,i=e.successHandler;if(o)t.backgroundColor=o;if(n)t.borderStyle=n;if(r)t.color=r;if(a)t.selectedColor=a;i({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var r=e.index,a=e.iconPath,o=e.selectedIconPath,n=e.text,i=e.successHandler,s=e.errorHandler;var l=__spreadArray([],t.list);if(r in l){if(a)l[r].iconPath=a;if(o)l[r].selectedIconPath=o;if(n)l[r].text=n;i({errMsg:"setTabBarItem:ok"})}else{s({errMsg:"setTabBarItem:fail tabbar item not found"})}t.list=l};var o=this.conf.list;var n=this.conf.customRoutes;if(Object.prototype.toString.call(o)!=="[object Array]"||o.length<2||o.length>5){throw new Error("tabBar 配置错误")}this.homePage=u(this.conf.homePage);for(var i in n){this.customRoutes.push([i,n[i]])}o.forEach((function(e){if(e.pagePath.indexOf("/")!==0){e.pagePath="/"+e.pagePath}}));this.list=o;this.borderStyle=this.conf.borderStyle;this.backgroundColor=this.conf.backgroundColor;this.color=this.conf.color;this.selectedColor=this.conf.selectedColor}e.prototype.getCurrentUrl=function(){var e=this.conf.mode;var t=this.conf.basename||"/";var r;if(e==="hash"){var a=window.location.href;var o=a.indexOf("#");r=o===-1?"":a.substring(o+1)}else{r=location.pathname}var n=u(g(r,t));return n==="/"?this.homePage:n};e.prototype.bindEvent=function(){f.eventCenter.on("__taroRouterChange",this.routerChangeHandler);f.eventCenter.on("__taroSwitchTab",this.switchTabHandler);f.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler);f.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);f.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);f.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);f.eventCenter.on("__taroShowTabBar",this.showTabBarHandler);f.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler);f.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler);f.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.removeEvent=function(){f.eventCenter.off("__taroRouterChange",this.routerChangeHandler);f.eventCenter.off("__taroSwitchTab",this.switchTabHandler);f.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler);f.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);f.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);f.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);f.eventCenter.off("__taroShowTabBar",this.showTabBarHandler);f.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler);f.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler);f.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)};e.prototype.componentDidLoad=function(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom";this.bindEvent();this.routerChangeHandler()};e.prototype.disconnectedCallback=function(){this.removeEvent()};e.prototype.render=function(){var e,r;var a=this;var n=this.tabbarPos,s=n===void 0?"bottom":n;var l=this.status;var b=i("weui-tabbar",(e={},e["taro-tabbar__border-"+(this.borderStyle||"black")]=true,e));var d=this.selectedIndex===-1||l===p;var c=l===T;return t(o,{class:i(B,B+"-"+s,(r={},r[m]=d,r[H]=c,r))},t("div",{class:b,style:{backgroundColor:this.backgroundColor||""}},this.list.map((function(e,r){var o=a.selectedIndex===r;var n;var i;if(o){n=a.selectedColor||"";i=e.selectedIconPath}else{n=a.color||"";i=e.iconPath}return t(h,{index:r,onSelect:a.switchTab.bind(a),isSelected:o,textColor:n,iconPath:i,text:e.text,badgeText:e.badgeText,showRedDot:e.showRedDot})}))))};Object.defineProperty(e.prototype,"tabbar",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());x.style=c}}}));
@@ -1 +1 @@
1
- System.register(["./p-b2d01686.system.js"],(function(e,o){"use strict";var t,r;return{setters:[function(e){t=e.p;r=e.b}],execute:function(){var e=function(){var e=o.meta.url;var r={};if(e!==""){r.resourcesUrl=new URL(".",e).href}return t(r)};e().then((function(e){return r([["p-fde3a009.system",[[4,"taro-checkbox-core",{name:[1],value:[1],color:[1],id:[1025],checked:[4],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-checkbox-group-core",{name:[8]},[[0,"checkboxchange","function"]]]]],["p-1e4f1702.system",[[4,"taro-radio-core",{name:[1],value:[1],id:[1025],checked:[1028],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-radio-group-core",{name:[8]},[[0,"radiochange","function"]]]]],["p-3aac5746.system",[[4,"taro-swiper-core",{indicatorDots:[4,"indicator-dots"],indicatorColor:[1,"indicator-color"],indicatorActiveColor:[1,"indicator-active-color"],autoplay:[4],current:[2],interval:[2],duration:[2],circular:[4],vertical:[4],previousMargin:[1,"previous-margin"],nextMargin:[1,"next-margin"],displayMultipleItems:[2,"display-multiple-items"],full:[4],swiperWrapper:[32],swiper:[32],isWillLoadCalled:[32],observer:[32],observerFirst:[32],observerLast:[32]}],[0,"taro-swiper-item-core",{itemId:[1,"item-id"]}]]],["p-3643d8f7.system",[[0,"taro-audio-core",{src:[1],controls:[4],autoplay:[4],loop:[4],muted:[4],nativeProps:[16]}]]],["p-8f90fca9.system",[[0,"taro-block-core"]]],["p-e0af1d0d.system",[[4,"taro-button-core",{disabled:[4],hoverClass:[1,"hover-class"],type:[1],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],size:[1],plain:[4],loading:[4],formType:[1,"form-type"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-bd3fa355.system",[[0,"taro-camera-core"]]],["p-fd8312e5.system",[[0,"taro-canvas-core",{canvasId:[1,"canvas-id"],nativeProps:[16]}]]],["p-964692f7.system",[[0,"taro-cover-image-core",{src:[1],nativeProps:[16]}]]],["p-99ed3ed2.system",[[4,"taro-cover-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-cfbdd4e3.system",[[0,"taro-custom-wrapper-core"]]],["p-1b790eb0.system",[[4,"taro-form-core",{slotParent:[32]},[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-17039974.system",[[0,"taro-icon-core",{type:[1],size:[8],color:[1]}]]],["p-3eebeb1c.system",[[0,"taro-image-core",{src:[1],mode:[1],lazyLoad:[4,"lazy-load"],nativeProps:[16],aspectFillMode:[32]}]]],["p-12638ebc.system",[[0,"taro-input-core",{value:[1],type:[1],password:[4],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"auto-focus"],confirmType:[1,"confirm-type"],name:[1],nativeProps:[16],_value:[32]}]]],["p-7d848382.system",[[4,"taro-label-core",{for:[1]}]]],["p-264b7229.system",[[0,"taro-movable-area-core"]]],["p-fb0959c1.system",[[0,"taro-movable-view-core"]]],["p-10a6c489.system",[[0,"taro-navigator-core",{hoverClass:[1,"hover-class"],url:[1],openType:[1,"open-type"],isHover:[4,"is-hover"],delta:[2]},[[0,"click","onClick"]]]]],["p-9a618935.system",[[0,"taro-open-data-core"]]],["p-fb2252b7.system",[[0,"taro-picker-view-column-core"]]],["p-43de2f12.system",[[0,"taro-picker-view-core"]]],["p-cea9a198.system",[[0,"taro-progress-core",{percent:[2],showInfo:[4,"show-info"],borderRadius:[8,"border-radius"],fontSize:[8,"font-size"],strokeWidth:[8,"stroke-width"],activeColor:[1,"active-color"],backgroundColor:[1,"background-color"],active:[4]}]]],["p-46cf6431.system",[[4,"taro-pull-to-refresh",{prefixCls:[1,"prefix-cls"],distanceToRefresh:[2,"distance-to-refresh"],damping:[2],indicator:[16],currSt:[32],dragOnEdge:[32]}]]],["p-fdd73355.system",[[0,"taro-rich-text-core",{nodes:[1]}]]],["p-13c1404f.system",[[4,"taro-scroll-view-core",{scrollX:[4,"scroll-x"],scrollY:[4,"scroll-y"],upperThreshold:[8,"upper-threshold"],lowerThreshold:[8,"lower-threshold"],mpScrollTop:[8,"scroll-top"],mpScrollLeft:[8,"scroll-left"],mpScrollIntoView:[1,"scroll-into-view"],scrollWithAnimation:[4,"scroll-with-animation"]}]]],["p-703dfad8.system",[[0,"taro-slider-core",{min:[2],max:[2],step:[2],disabled:[4],value:[1026],activeColor:[1,"active-color"],backgroundColor:[1,"background-color"],blockSize:[2,"block-size"],blockColor:[1,"block-color"],showValue:[4,"show-value"],name:[1],val:[32],totalWidth:[32],touching:[32],ogX:[32],touchId:[32],percent:[32],ogPercent:[32],isWillLoadCalled:[32]}]]],["p-ffe63ce9.system",[[0,"taro-switch-core",{type:[1],checked:[4],color:[1],name:[1],disabled:[4],nativeProps:[16],isChecked:[32],isWillLoadCalled:[32]}]]],["p-ad16d1f2.system",[[0,"taro-tabbar",{conf:[16],list:[32],borderStyle:[32],backgroundColor:[32],color:[32],selectedColor:[32],selectedIndex:[32],status:[32]}]]],["p-50066d5e.system",[[4,"taro-text-core",{selectable:[4]}]]],["p-627a5064.system",[[0,"taro-textarea-core",{value:[1],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"auto-focus"],autoHeight:[4,"auto-height"],name:[1],nativeProps:[16],line:[32]}]]],["p-fe156231.system",[[4,"taro-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-9fc88fc1.system",[[0,"taro-web-view-core",{src:[1]}]]],["p-fc4939c6.system",[[4,"taro-picker-core",{mode:[1],disabled:[4],range:[16],rangeKey:[1,"range-key"],value:[8],start:[1],end:[1],fields:[1],name:[1],pickerValue:[32],height:[32],hidden:[32],fadeOut:[32],isWillLoadCalled:[32]}],[0,"taro-picker-group",{mode:[1],range:[16],rangeKey:[1,"range-key"],height:[2],columnId:[1,"column-id"],updateHeight:[16],onColumnChange:[16],updateDay:[16],startY:[32],preY:[32],hadMove:[32],touchEnd:[32],isMove:[32]},[[1,"mousedown","onMouseDown"],[1,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-d394a61f.system",[[0,"taro-video-core",{src:[1],duration:[2],controls:[4],autoplay:[4],loop:[4],muted:[4],initialTime:[2,"initial-time"],poster:[1],objectFit:[1,"object-fit"],showProgress:[4,"show-progress"],showFullscreenBtn:[4,"show-fullscreen-btn"],showPlayBtn:[4,"show-play-btn"],showCenterPlayBtn:[4,"show-center-play-btn"],showMuteBtn:[4,"show-mute-btn"],danmuList:[16],danmuBtn:[4,"danmu-btn"],enableDanmu:[4,"enable-danmu"],enablePlayGesture:[4,"enable-play-gesture"],enableProgressGesture:[4,"enable-progress-gesture"],vslideGesture:[4,"vslide-gesture"],vslideGestureInFullscreen:[4,"vslide-gesture-in-fullscreen"],nativeProps:[16],_duration:[32],_enableDanmu:[32],isPlaying:[32],isFirst:[32],isFullScreen:[32],fullScreenTimestamp:[32],isMute:[32],play:[64],pause:[64],stop:[64],seek:[64],requestFullScreen:[64],exitFullScreen:[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[4,"taro-video-control",{controls:[4],currentTime:[2,"current-time"],duration:[2],isPlaying:[4,"is-playing"],pauseFunc:[16],playFunc:[16],seekFunc:[16],showPlayBtn:[4,"show-play-btn"],showProgress:[4,"show-progress"],setProgressBall:[64],toggleVisibility:[64],getIsDraggingProgressBall:[64],setCurrentTime:[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[0,"taro-video-danmu",{enable:[4],danmuList:[32],sendDanmu:[64],tick:[64]}]]]],e)}))}}}));
1
+ System.register(["./p-b2d01686.system.js"],(function(e,o){"use strict";var t,r;return{setters:[function(e){t=e.p;r=e.b}],execute:function(){var e=function(){var e=o.meta.url;var r={};if(e!==""){r.resourcesUrl=new URL(".",e).href}return t(r)};e().then((function(e){return r([["p-fde3a009.system",[[4,"taro-checkbox-core",{name:[1],value:[1],color:[1],id:[1025],checked:[4],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-checkbox-group-core",{name:[8]},[[0,"checkboxchange","function"]]]]],["p-1e4f1702.system",[[4,"taro-radio-core",{name:[1],value:[1],id:[1025],checked:[1028],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-radio-group-core",{name:[8]},[[0,"radiochange","function"]]]]],["p-3aac5746.system",[[4,"taro-swiper-core",{indicatorDots:[4,"indicator-dots"],indicatorColor:[1,"indicator-color"],indicatorActiveColor:[1,"indicator-active-color"],autoplay:[4],current:[2],interval:[2],duration:[2],circular:[4],vertical:[4],previousMargin:[1,"previous-margin"],nextMargin:[1,"next-margin"],displayMultipleItems:[2,"display-multiple-items"],full:[4],swiperWrapper:[32],swiper:[32],isWillLoadCalled:[32],observer:[32],observerFirst:[32],observerLast:[32]}],[0,"taro-swiper-item-core",{itemId:[1,"item-id"]}]]],["p-3643d8f7.system",[[0,"taro-audio-core",{src:[1],controls:[4],autoplay:[4],loop:[4],muted:[4],nativeProps:[16]}]]],["p-8f90fca9.system",[[0,"taro-block-core"]]],["p-e0af1d0d.system",[[4,"taro-button-core",{disabled:[4],hoverClass:[1,"hover-class"],type:[1],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],size:[1],plain:[4],loading:[4],formType:[1,"form-type"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-bd3fa355.system",[[0,"taro-camera-core"]]],["p-fd8312e5.system",[[0,"taro-canvas-core",{canvasId:[1,"canvas-id"],nativeProps:[16]}]]],["p-964692f7.system",[[0,"taro-cover-image-core",{src:[1],nativeProps:[16]}]]],["p-99ed3ed2.system",[[4,"taro-cover-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-cfbdd4e3.system",[[0,"taro-custom-wrapper-core"]]],["p-1b790eb0.system",[[4,"taro-form-core",{slotParent:[32]},[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-17039974.system",[[0,"taro-icon-core",{type:[1],size:[8],color:[1]}]]],["p-3eebeb1c.system",[[0,"taro-image-core",{src:[1],mode:[1],lazyLoad:[4,"lazy-load"],nativeProps:[16],aspectFillMode:[32]}]]],["p-12638ebc.system",[[0,"taro-input-core",{value:[1],type:[1],password:[4],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"auto-focus"],confirmType:[1,"confirm-type"],name:[1],nativeProps:[16],_value:[32]}]]],["p-7d848382.system",[[4,"taro-label-core",{for:[1]}]]],["p-264b7229.system",[[0,"taro-movable-area-core"]]],["p-fb0959c1.system",[[0,"taro-movable-view-core"]]],["p-10a6c489.system",[[0,"taro-navigator-core",{hoverClass:[1,"hover-class"],url:[1],openType:[1,"open-type"],isHover:[4,"is-hover"],delta:[2]},[[0,"click","onClick"]]]]],["p-9a618935.system",[[0,"taro-open-data-core"]]],["p-fb2252b7.system",[[0,"taro-picker-view-column-core"]]],["p-43de2f12.system",[[0,"taro-picker-view-core"]]],["p-cea9a198.system",[[0,"taro-progress-core",{percent:[2],showInfo:[4,"show-info"],borderRadius:[8,"border-radius"],fontSize:[8,"font-size"],strokeWidth:[8,"stroke-width"],activeColor:[1,"active-color"],backgroundColor:[1,"background-color"],active:[4]}]]],["p-46cf6431.system",[[4,"taro-pull-to-refresh",{prefixCls:[1,"prefix-cls"],distanceToRefresh:[2,"distance-to-refresh"],damping:[2],indicator:[16],currSt:[32],dragOnEdge:[32]}]]],["p-fdd73355.system",[[0,"taro-rich-text-core",{nodes:[1]}]]],["p-13c1404f.system",[[4,"taro-scroll-view-core",{scrollX:[4,"scroll-x"],scrollY:[4,"scroll-y"],upperThreshold:[8,"upper-threshold"],lowerThreshold:[8,"lower-threshold"],mpScrollTop:[8,"scroll-top"],mpScrollLeft:[8,"scroll-left"],mpScrollIntoView:[1,"scroll-into-view"],scrollWithAnimation:[4,"scroll-with-animation"]}]]],["p-703dfad8.system",[[0,"taro-slider-core",{min:[2],max:[2],step:[2],disabled:[4],value:[1026],activeColor:[1,"active-color"],backgroundColor:[1,"background-color"],blockSize:[2,"block-size"],blockColor:[1,"block-color"],showValue:[4,"show-value"],name:[1],val:[32],totalWidth:[32],touching:[32],ogX:[32],touchId:[32],percent:[32],ogPercent:[32],isWillLoadCalled:[32]}]]],["p-ffe63ce9.system",[[0,"taro-switch-core",{type:[1],checked:[4],color:[1],name:[1],disabled:[4],nativeProps:[16],isChecked:[32],isWillLoadCalled:[32]}]]],["p-2438fcd4.system",[[0,"taro-tabbar",{conf:[16],list:[32],borderStyle:[32],backgroundColor:[32],color:[32],selectedColor:[32],selectedIndex:[32],status:[32]}]]],["p-50066d5e.system",[[4,"taro-text-core",{selectable:[4]}]]],["p-627a5064.system",[[0,"taro-textarea-core",{value:[1],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"auto-focus"],autoHeight:[4,"auto-height"],name:[1],nativeProps:[16],line:[32]}]]],["p-fe156231.system",[[4,"taro-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-9fc88fc1.system",[[0,"taro-web-view-core",{src:[1]}]]],["p-fc4939c6.system",[[4,"taro-picker-core",{mode:[1],disabled:[4],range:[16],rangeKey:[1,"range-key"],value:[8],start:[1],end:[1],fields:[1],name:[1],pickerValue:[32],height:[32],hidden:[32],fadeOut:[32],isWillLoadCalled:[32]}],[0,"taro-picker-group",{mode:[1],range:[16],rangeKey:[1,"range-key"],height:[2],columnId:[1,"column-id"],updateHeight:[16],onColumnChange:[16],updateDay:[16],startY:[32],preY:[32],hadMove:[32],touchEnd:[32],isMove:[32]},[[1,"mousedown","onMouseDown"],[1,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-d394a61f.system",[[0,"taro-video-core",{src:[1],duration:[2],controls:[4],autoplay:[4],loop:[4],muted:[4],initialTime:[2,"initial-time"],poster:[1],objectFit:[1,"object-fit"],showProgress:[4,"show-progress"],showFullscreenBtn:[4,"show-fullscreen-btn"],showPlayBtn:[4,"show-play-btn"],showCenterPlayBtn:[4,"show-center-play-btn"],showMuteBtn:[4,"show-mute-btn"],danmuList:[16],danmuBtn:[4,"danmu-btn"],enableDanmu:[4,"enable-danmu"],enablePlayGesture:[4,"enable-play-gesture"],enableProgressGesture:[4,"enable-progress-gesture"],vslideGesture:[4,"vslide-gesture"],vslideGestureInFullscreen:[4,"vslide-gesture-in-fullscreen"],nativeProps:[16],_duration:[32],_enableDanmu:[32],isPlaying:[32],isFirst:[32],isFullScreen:[32],fullScreenTimestamp:[32],isMute:[32],play:[64],pause:[64],stop:[64],seek:[64],requestFullScreen:[64],exitFullScreen:[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[4,"taro-video-control",{controls:[4],currentTime:[2,"current-time"],duration:[2],isPlaying:[4,"is-playing"],pauseFunc:[16],playFunc:[16],seekFunc:[16],showPlayBtn:[4,"show-play-btn"],showProgress:[4,"show-progress"],setProgressBall:[64],toggleVisibility:[64],getIsDraggingProgressBall:[64],setCurrentTime:[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[0,"taro-video-danmu",{enable:[4],danmuList:[32],sendDanmu:[64],tick:[64]}]]]],e)}))}}}));
@@ -0,0 +1 @@
1
+ import{h as t,r as a,c as r,H as e,g as s}from"./p-f05e1558.js";import{c as o}from"./p-37cfdd8f.js";function i(t){return"/"===t.charAt(0)}function h(t,a){for(var r=a,e=r+1,s=t.length;e<s;r+=1,e+=1)t[r]=t[e];t.pop()}const b=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},n=({index:a,isSelected:r=!1,textColor:e,iconPath:s,badgeText:i,showRedDot:h=!1,text:b,onSelect:n})=>{const l=o("weui-tabbar__item",{"weui-bar__item_on":r});return t("a",{key:a,href:"javascript:;",class:l,onClick:function(){n(a)}},t("span",{style:{display:"inline-block",position:"relative"}},t("img",{src:s,alt:"",class:"weui-tabbar__icon"}),!!i&&t("span",{class:"weui-badge taro-tabbar-badge",style:{position:"absolute",top:"-2px",right:"-13px"}},i),h&&t("span",{class:"weui-badge weui-badge_dot",style:{position:"absolute",top:"0",right:"-6px"}})),t("p",{class:"weui-tabbar__label",style:{color:e}},b))},l=require("@tarojs/taro"),d=t=>"/"===t[0]?t:`/${t}`,c=(t,a)=>((t,a)=>new RegExp("^"+a+"(\\/|\\?|#|$)","i").test(t))(t,a)?t.substr(a.length):t;let _=class{constructor(t){a(this,t),this.onLongPress=r(this,"longpress",7),this.homePage="",this.customRoutes=[],this.tabbarPos="bottom",this.selectedIndex=-1,this.status=0,this.getOriginUrl=t=>{const a=this.customRoutes.filter((([,a])=>b(a).path===b(t).path));return a.length?a[0][0]:t},this.getSelectedIndex=t=>{let a=-1;return this.list.forEach((({pagePath:r},e)=>{b(t).path===b(r).path&&(a=e)})),a},this.switchTab=t=>{this.selectedIndex=t,l.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("/")||[],s=a&&a.split("/")||[],o=t&&i(t),b=a&&i(a),n=o||b;if(t&&i(t)?s=e:e.length&&(s.pop(),s=s.concat(e)),!s.length)return"/";if(s.length){var l=s[s.length-1];r="."===l||".."===l||""===l}else r=!1;for(var d=0,c=s.length;c>=0;c--){var _=s[c];"."===_?h(s,c):".."===_?(h(s,c),d++):d&&(h(s,c),d--)}if(!n)for(;d--;d)s.unshift("..");!n||""===s[0]||s[0]&&i(s[0])||s.unshift("");var u=s.join("/");return r&&"/"!==u.substr(-1)&&(u+="/"),u}(t,this.getOriginUrl(this.getCurrentUrl()||this.homePage)),s=this.getSelectedIndex(e);s>-1?(this.switchTab(s),a({errMsg:"switchTab:ok"})):r({errMsg:`switchTab:fail page "${e}" is not found`})},this.routerChangeHandler=t=>{let a,r;if(t&&(a=t.toLocation),a&&a.path){const t=d(a.path);r=c("/"===t?this.homePage:t,this.conf.basename||"/")}else r=this.getCurrentUrl();this.selectedIndex=this.getSelectedIndex(this.getOriginUrl(r))},this.setTabBarBadgeHandler=({index:t,text:a,successHandler:r,errorHandler:e})=>{const s=[...this.list];t in s?(s[t].showRedDot=!1,s[t].badgeText=a,r({errMsg:"setTabBarBadge:ok"})):e({errMsg:"setTabBarBadge:fail tabbar item not found"}),this.list=s},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:s})=>{r&&(this.backgroundColor=r),e&&(this.borderStyle=e),t&&(this.color=t),a&&(this.selectedColor=a),s({errMsg:"setTabBarStyle:ok"})},this.setTabBarItemHandler=({index:t,iconPath:a,selectedIconPath:r,text:e,successHandler:s,errorHandler:o})=>{const i=[...this.list];t in i?(a&&(i[t].iconPath=a),r&&(i[t].selectedIconPath=r),e&&(i[t].text=e),s({errMsg:"setTabBarItem:ok"})):o({errMsg:"setTabBarItem:fail tabbar item not found"}),this.list=i};const e=this.conf.list,s=this.conf.customRoutes;if("[object Array]"!==Object.prototype.toString.call(e)||e.length<2||e.length>5)throw new Error("tabBar 配置错误");this.homePage=d(this.conf.homePage);for(const t in s)this.customRoutes.push([t,s[t]]);e.forEach((t=>{0!==t.pagePath.indexOf("/")&&(t.pagePath="/"+t.pagePath)})),this.list=e,this.borderStyle=this.conf.borderStyle,this.backgroundColor=this.conf.backgroundColor,this.color=this.conf.color,this.selectedColor=this.conf.selectedColor}getCurrentUrl(){const t=this.conf.basename||"/";let a;if("hash"===this.conf.mode){const t=window.location.href,r=t.indexOf("#");a=-1===r?"":t.substring(r+1)}else a=location.pathname;const r=d(c(a,t));return"/"===r?this.homePage:r}bindEvent(){l.eventCenter.on("__taroRouterChange",this.routerChangeHandler),l.eventCenter.on("__taroSwitchTab",this.switchTabHandler),l.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler),l.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler),l.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler),l.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler),l.eventCenter.on("__taroShowTabBar",this.showTabBarHandler),l.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler),l.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler),l.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)}removeEvent(){l.eventCenter.off("__taroRouterChange",this.routerChangeHandler),l.eventCenter.off("__taroSwitchTab",this.switchTabHandler),l.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler),l.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler),l.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler),l.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler),l.eventCenter.off("__taroShowTabBar",this.showTabBarHandler),l.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler),l.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler),l.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,s=o("weui-tabbar",{[`taro-tabbar__border-${this.borderStyle||"black"}`]:!0});return t(e,{class:o("taro-tabbar__tabbar",`taro-tabbar__tabbar-${a}`,{"taro-tabbar__tabbar-hide":-1===this.selectedIndex||1===r,"taro-tabbar__tabbar-slideout":2===r})},t("div",{class:s,style:{backgroundColor:this.backgroundColor||""}},this.list.map(((a,r)=>{const e=this.selectedIndex===r;let s,o;return e?(s=this.selectedColor||"",o=a.selectedIconPath):(s=this.color||"",o=a.iconPath),t(n,{index:r,onSelect:this.switchTab.bind(this),isSelected:e,textColor:s,iconPath:o,text:a.text,badgeText:a.badgeText,showRedDot:a.showRedDot})}))))}get tabbar(){return s(this)}};_.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;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-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}.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{_ as taro_tabbar}
@@ -1 +1 @@
1
- import{p as e,b as o}from"./p-f05e1558.js";(()=>{const o=import.meta.url,r={};return""!==o&&(r.resourcesUrl=new URL(".",o).href),e(r)})().then((e=>o([["p-d5971476",[[4,"taro-checkbox-core",{name:[1],value:[1],color:[1],id:[1025],checked:[4],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-checkbox-group-core",{name:[8]},[[0,"checkboxchange","function"]]]]],["p-55b0a30b",[[4,"taro-radio-core",{name:[1],value:[1],id:[1025],checked:[1028],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-radio-group-core",{name:[8]},[[0,"radiochange","function"]]]]],["p-64993f48",[[4,"taro-swiper-core",{indicatorDots:[4,"indicator-dots"],indicatorColor:[1,"indicator-color"],indicatorActiveColor:[1,"indicator-active-color"],autoplay:[4],current:[2],interval:[2],duration:[2],circular:[4],vertical:[4],previousMargin:[1,"previous-margin"],nextMargin:[1,"next-margin"],displayMultipleItems:[2,"display-multiple-items"],full:[4],swiperWrapper:[32],swiper:[32],isWillLoadCalled:[32],observer:[32],observerFirst:[32],observerLast:[32]}],[0,"taro-swiper-item-core",{itemId:[1,"item-id"]}]]],["p-5f8b5f62",[[0,"taro-audio-core",{src:[1],controls:[4],autoplay:[4],loop:[4],muted:[4],nativeProps:[16]}]]],["p-b9280444",[[0,"taro-block-core"]]],["p-83dedaa2",[[4,"taro-button-core",{disabled:[4],hoverClass:[1,"hover-class"],type:[1],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],size:[1],plain:[4],loading:[4],formType:[1,"form-type"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-c218c298",[[0,"taro-camera-core"]]],["p-4dbed323",[[0,"taro-canvas-core",{canvasId:[1,"canvas-id"],nativeProps:[16]}]]],["p-9d0ab7c4",[[0,"taro-cover-image-core",{src:[1],nativeProps:[16]}]]],["p-74540410",[[4,"taro-cover-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-a1423df9",[[0,"taro-custom-wrapper-core"]]],["p-8a5e67cb",[[4,"taro-form-core",{slotParent:[32]},[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-11932905",[[0,"taro-icon-core",{type:[1],size:[8],color:[1]}]]],["p-7a64a3d2",[[0,"taro-image-core",{src:[1],mode:[1],lazyLoad:[4,"lazy-load"],nativeProps:[16],aspectFillMode:[32]}]]],["p-66237ac0",[[0,"taro-input-core",{value:[1],type:[1],password:[4],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"auto-focus"],confirmType:[1,"confirm-type"],name:[1],nativeProps:[16],_value:[32]}]]],["p-e27798a4",[[4,"taro-label-core",{for:[1]}]]],["p-554e1039",[[0,"taro-movable-area-core"]]],["p-b75d8a65",[[0,"taro-movable-view-core"]]],["p-71de9bd6",[[0,"taro-navigator-core",{hoverClass:[1,"hover-class"],url:[1],openType:[1,"open-type"],isHover:[4,"is-hover"],delta:[2]},[[0,"click","onClick"]]]]],["p-c362734b",[[0,"taro-open-data-core"]]],["p-95529dc0",[[0,"taro-picker-view-column-core"]]],["p-5c420456",[[0,"taro-picker-view-core"]]],["p-06bffead",[[0,"taro-progress-core",{percent:[2],showInfo:[4,"show-info"],borderRadius:[8,"border-radius"],fontSize:[8,"font-size"],strokeWidth:[8,"stroke-width"],activeColor:[1,"active-color"],backgroundColor:[1,"background-color"],active:[4]}]]],["p-b8e0ad7d",[[4,"taro-pull-to-refresh",{prefixCls:[1,"prefix-cls"],distanceToRefresh:[2,"distance-to-refresh"],damping:[2],indicator:[16],currSt:[32],dragOnEdge:[32]}]]],["p-8db237e0",[[0,"taro-rich-text-core",{nodes:[1]}]]],["p-6965567d",[[4,"taro-scroll-view-core",{scrollX:[4,"scroll-x"],scrollY:[4,"scroll-y"],upperThreshold:[8,"upper-threshold"],lowerThreshold:[8,"lower-threshold"],mpScrollTop:[8,"scroll-top"],mpScrollLeft:[8,"scroll-left"],mpScrollIntoView:[1,"scroll-into-view"],scrollWithAnimation:[4,"scroll-with-animation"]}]]],["p-3633bb84",[[0,"taro-slider-core",{min:[2],max:[2],step:[2],disabled:[4],value:[1026],activeColor:[1,"active-color"],backgroundColor:[1,"background-color"],blockSize:[2,"block-size"],blockColor:[1,"block-color"],showValue:[4,"show-value"],name:[1],val:[32],totalWidth:[32],touching:[32],ogX:[32],touchId:[32],percent:[32],ogPercent:[32],isWillLoadCalled:[32]}]]],["p-e6298500",[[0,"taro-switch-core",{type:[1],checked:[4],color:[1],name:[1],disabled:[4],nativeProps:[16],isChecked:[32],isWillLoadCalled:[32]}]]],["p-ff017f01",[[0,"taro-tabbar",{conf:[16],list:[32],borderStyle:[32],backgroundColor:[32],color:[32],selectedColor:[32],selectedIndex:[32],status:[32]}]]],["p-d567b95e",[[4,"taro-text-core",{selectable:[4]}]]],["p-12ae0a33",[[0,"taro-textarea-core",{value:[1],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"auto-focus"],autoHeight:[4,"auto-height"],name:[1],nativeProps:[16],line:[32]}]]],["p-17cf8b5b",[[4,"taro-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-8bc82aaa",[[0,"taro-web-view-core",{src:[1]}]]],["p-865c21b5",[[4,"taro-picker-core",{mode:[1],disabled:[4],range:[16],rangeKey:[1,"range-key"],value:[8],start:[1],end:[1],fields:[1],name:[1],pickerValue:[32],height:[32],hidden:[32],fadeOut:[32],isWillLoadCalled:[32]}],[0,"taro-picker-group",{mode:[1],range:[16],rangeKey:[1,"range-key"],height:[2],columnId:[1,"column-id"],updateHeight:[16],onColumnChange:[16],updateDay:[16],startY:[32],preY:[32],hadMove:[32],touchEnd:[32],isMove:[32]},[[1,"mousedown","onMouseDown"],[1,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-431197bc",[[0,"taro-video-core",{src:[1],duration:[2],controls:[4],autoplay:[4],loop:[4],muted:[4],initialTime:[2,"initial-time"],poster:[1],objectFit:[1,"object-fit"],showProgress:[4,"show-progress"],showFullscreenBtn:[4,"show-fullscreen-btn"],showPlayBtn:[4,"show-play-btn"],showCenterPlayBtn:[4,"show-center-play-btn"],showMuteBtn:[4,"show-mute-btn"],danmuList:[16],danmuBtn:[4,"danmu-btn"],enableDanmu:[4,"enable-danmu"],enablePlayGesture:[4,"enable-play-gesture"],enableProgressGesture:[4,"enable-progress-gesture"],vslideGesture:[4,"vslide-gesture"],vslideGestureInFullscreen:[4,"vslide-gesture-in-fullscreen"],nativeProps:[16],_duration:[32],_enableDanmu:[32],isPlaying:[32],isFirst:[32],isFullScreen:[32],fullScreenTimestamp:[32],isMute:[32],play:[64],pause:[64],stop:[64],seek:[64],requestFullScreen:[64],exitFullScreen:[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[4,"taro-video-control",{controls:[4],currentTime:[2,"current-time"],duration:[2],isPlaying:[4,"is-playing"],pauseFunc:[16],playFunc:[16],seekFunc:[16],showPlayBtn:[4,"show-play-btn"],showProgress:[4,"show-progress"],setProgressBall:[64],toggleVisibility:[64],getIsDraggingProgressBall:[64],setCurrentTime:[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[0,"taro-video-danmu",{enable:[4],danmuList:[32],sendDanmu:[64],tick:[64]}]]]],e)));
1
+ import{p as e,b as o}from"./p-f05e1558.js";(()=>{const o=import.meta.url,r={};return""!==o&&(r.resourcesUrl=new URL(".",o).href),e(r)})().then((e=>o([["p-d5971476",[[4,"taro-checkbox-core",{name:[1],value:[1],color:[1],id:[1025],checked:[4],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-checkbox-group-core",{name:[8]},[[0,"checkboxchange","function"]]]]],["p-55b0a30b",[[4,"taro-radio-core",{name:[1],value:[1],id:[1025],checked:[1028],disabled:[4],nativeProps:[16],isWillLoadCalled:[32]}],[0,"taro-radio-group-core",{name:[8]},[[0,"radiochange","function"]]]]],["p-64993f48",[[4,"taro-swiper-core",{indicatorDots:[4,"indicator-dots"],indicatorColor:[1,"indicator-color"],indicatorActiveColor:[1,"indicator-active-color"],autoplay:[4],current:[2],interval:[2],duration:[2],circular:[4],vertical:[4],previousMargin:[1,"previous-margin"],nextMargin:[1,"next-margin"],displayMultipleItems:[2,"display-multiple-items"],full:[4],swiperWrapper:[32],swiper:[32],isWillLoadCalled:[32],observer:[32],observerFirst:[32],observerLast:[32]}],[0,"taro-swiper-item-core",{itemId:[1,"item-id"]}]]],["p-5f8b5f62",[[0,"taro-audio-core",{src:[1],controls:[4],autoplay:[4],loop:[4],muted:[4],nativeProps:[16]}]]],["p-b9280444",[[0,"taro-block-core"]]],["p-83dedaa2",[[4,"taro-button-core",{disabled:[4],hoverClass:[1,"hover-class"],type:[1],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],size:[1],plain:[4],loading:[4],formType:[1,"form-type"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-c218c298",[[0,"taro-camera-core"]]],["p-4dbed323",[[0,"taro-canvas-core",{canvasId:[1,"canvas-id"],nativeProps:[16]}]]],["p-9d0ab7c4",[[0,"taro-cover-image-core",{src:[1],nativeProps:[16]}]]],["p-74540410",[[4,"taro-cover-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-a1423df9",[[0,"taro-custom-wrapper-core"]]],["p-8a5e67cb",[[4,"taro-form-core",{slotParent:[32]},[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-11932905",[[0,"taro-icon-core",{type:[1],size:[8],color:[1]}]]],["p-7a64a3d2",[[0,"taro-image-core",{src:[1],mode:[1],lazyLoad:[4,"lazy-load"],nativeProps:[16],aspectFillMode:[32]}]]],["p-66237ac0",[[0,"taro-input-core",{value:[1],type:[1],password:[4],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"auto-focus"],confirmType:[1,"confirm-type"],name:[1],nativeProps:[16],_value:[32]}]]],["p-e27798a4",[[4,"taro-label-core",{for:[1]}]]],["p-554e1039",[[0,"taro-movable-area-core"]]],["p-b75d8a65",[[0,"taro-movable-view-core"]]],["p-71de9bd6",[[0,"taro-navigator-core",{hoverClass:[1,"hover-class"],url:[1],openType:[1,"open-type"],isHover:[4,"is-hover"],delta:[2]},[[0,"click","onClick"]]]]],["p-c362734b",[[0,"taro-open-data-core"]]],["p-95529dc0",[[0,"taro-picker-view-column-core"]]],["p-5c420456",[[0,"taro-picker-view-core"]]],["p-06bffead",[[0,"taro-progress-core",{percent:[2],showInfo:[4,"show-info"],borderRadius:[8,"border-radius"],fontSize:[8,"font-size"],strokeWidth:[8,"stroke-width"],activeColor:[1,"active-color"],backgroundColor:[1,"background-color"],active:[4]}]]],["p-b8e0ad7d",[[4,"taro-pull-to-refresh",{prefixCls:[1,"prefix-cls"],distanceToRefresh:[2,"distance-to-refresh"],damping:[2],indicator:[16],currSt:[32],dragOnEdge:[32]}]]],["p-8db237e0",[[0,"taro-rich-text-core",{nodes:[1]}]]],["p-6965567d",[[4,"taro-scroll-view-core",{scrollX:[4,"scroll-x"],scrollY:[4,"scroll-y"],upperThreshold:[8,"upper-threshold"],lowerThreshold:[8,"lower-threshold"],mpScrollTop:[8,"scroll-top"],mpScrollLeft:[8,"scroll-left"],mpScrollIntoView:[1,"scroll-into-view"],scrollWithAnimation:[4,"scroll-with-animation"]}]]],["p-3633bb84",[[0,"taro-slider-core",{min:[2],max:[2],step:[2],disabled:[4],value:[1026],activeColor:[1,"active-color"],backgroundColor:[1,"background-color"],blockSize:[2,"block-size"],blockColor:[1,"block-color"],showValue:[4,"show-value"],name:[1],val:[32],totalWidth:[32],touching:[32],ogX:[32],touchId:[32],percent:[32],ogPercent:[32],isWillLoadCalled:[32]}]]],["p-e6298500",[[0,"taro-switch-core",{type:[1],checked:[4],color:[1],name:[1],disabled:[4],nativeProps:[16],isChecked:[32],isWillLoadCalled:[32]}]]],["p-f98e0224",[[0,"taro-tabbar",{conf:[16],list:[32],borderStyle:[32],backgroundColor:[32],color:[32],selectedColor:[32],selectedIndex:[32],status:[32]}]]],["p-d567b95e",[[4,"taro-text-core",{selectable:[4]}]]],["p-12ae0a33",[[0,"taro-textarea-core",{value:[1],placeholder:[1],disabled:[4],maxlength:[2],autoFocus:[4,"auto-focus"],autoHeight:[4,"auto-height"],name:[1],nativeProps:[16],line:[32]}]]],["p-17cf8b5b",[[4,"taro-view-core",{animation:[1],hoverClass:[1,"hover-class"],hoverStartTime:[2,"hover-start-time"],hoverStayTime:[2,"hover-stay-time"],hover:[32],touch:[32]},[[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-8bc82aaa",[[0,"taro-web-view-core",{src:[1]}]]],["p-865c21b5",[[4,"taro-picker-core",{mode:[1],disabled:[4],range:[16],rangeKey:[1,"range-key"],value:[8],start:[1],end:[1],fields:[1],name:[1],pickerValue:[32],height:[32],hidden:[32],fadeOut:[32],isWillLoadCalled:[32]}],[0,"taro-picker-group",{mode:[1],range:[16],rangeKey:[1,"range-key"],height:[2],columnId:[1,"column-id"],updateHeight:[16],onColumnChange:[16],updateDay:[16],startY:[32],preY:[32],hadMove:[32],touchEnd:[32],isMove:[32]},[[1,"mousedown","onMouseDown"],[1,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-431197bc",[[0,"taro-video-core",{src:[1],duration:[2],controls:[4],autoplay:[4],loop:[4],muted:[4],initialTime:[2,"initial-time"],poster:[1],objectFit:[1,"object-fit"],showProgress:[4,"show-progress"],showFullscreenBtn:[4,"show-fullscreen-btn"],showPlayBtn:[4,"show-play-btn"],showCenterPlayBtn:[4,"show-center-play-btn"],showMuteBtn:[4,"show-mute-btn"],danmuList:[16],danmuBtn:[4,"danmu-btn"],enableDanmu:[4,"enable-danmu"],enablePlayGesture:[4,"enable-play-gesture"],enableProgressGesture:[4,"enable-progress-gesture"],vslideGesture:[4,"vslide-gesture"],vslideGestureInFullscreen:[4,"vslide-gesture-in-fullscreen"],nativeProps:[16],_duration:[32],_enableDanmu:[32],isPlaying:[32],isFirst:[32],isFullScreen:[32],fullScreenTimestamp:[32],isMute:[32],play:[64],pause:[64],stop:[64],seek:[64],requestFullScreen:[64],exitFullScreen:[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[4,"taro-video-control",{controls:[4],currentTime:[2,"current-time"],duration:[2],isPlaying:[4,"is-playing"],pauseFunc:[16],playFunc:[16],seekFunc:[16],showPlayBtn:[4,"show-play-btn"],showProgress:[4,"show-progress"],setProgressBall:[64],toggleVisibility:[64],getIsDraggingProgressBall:[64],setCurrentTime:[64]},[[5,"touchmove","onDocumentTouchMove"],[5,"touchend","onDocumentTouchEnd"],[5,"touchcancel","onDocumentTouchEnd"]]],[0,"taro-video-danmu",{enable:[4],danmuList:[32],sendDanmu:[64],tick:[64]}]]]],e)));
@@ -1,4 +1,4 @@
1
- export var simpleComponents = ['taro-view', 'taro-rich-text', 'taro-button', 'taro-checkbox-group', 'taro-editor', 'taro-form', 'taro-label', 'taro-picker-view', 'taro-picker-view-column', 'taro-cover-image', 'taro-cover-view', 'taro-moveable-area', 'taro-moveable-view', 'taro-swiper', 'taro-functional-page-navigator', 'taro-navigator', 'taro-audio', 'taro-camera', 'taro-live-player', 'taro-map', 'taro-ad', 'taro-official-account', 'taro-open-data', 'taro-web-view', 'taro-navigation-bar', 'taro-block', 'taro-canvas', 'taro-custom-wrapper', {
1
+ export var simpleComponents = ['taro-view', 'taro-rich-text', 'taro-button', 'taro-checkbox-group', 'taro-editor', 'taro-form', 'taro-label', 'taro-picker-view', 'taro-picker-view-column', 'taro-cover-image', 'taro-cover-view', 'taro-movable-area', 'taro-movable-view', 'taro-swiper', 'taro-functional-page-navigator', 'taro-navigator', 'taro-audio', 'taro-camera', 'taro-live-player', 'taro-map', 'taro-ad', 'taro-official-account', 'taro-open-data', 'taro-web-view', 'taro-navigation-bar', 'taro-block', 'taro-canvas', 'taro-custom-wrapper', {
2
2
  name: 'taro-checkbox',
3
3
  classNames: ['weui-cells_checkbox']
4
4
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tarojs/components",
3
- "version": "3.4.0-beta.0",
3
+ "version": "3.5.0-canary.0",
4
4
  "description": "",
5
5
  "main:h5": "src/index.js",
6
6
  "main": "dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "license": "MIT",
39
39
  "dependencies": {
40
40
  "@stencil/core": "2.9.0",
41
- "@tarojs/taro": "3.4.0-beta.0",
41
+ "@tarojs/taro": "3.5.0-canary.0",
42
42
  "better-scroll": "^1.14.1",
43
43
  "classnames": "^2.2.5",
44
44
  "intersection-observer": "^0.7.0",
@@ -55,5 +55,5 @@
55
55
  "simulant": "^0.2.2",
56
56
  "workbox-build": "4.3.1"
57
57
  },
58
- "gitHead": "107670bc2360ee9136a0e558e6d5fad1db640fba"
58
+ "gitHead": "a0222bc41bc05b0e34413d6db3de963d777a5015"
59
59
  }
@@ -1 +0,0 @@
1
- import{h as t,r as a,c as r,H as e,g as s}from"./p-f05e1558.js";import{c as o}from"./p-37cfdd8f.js";function i(t){return"/"===t.charAt(0)}function b(t,a){for(var r=a,e=r+1,s=t.length;e<s;r+=1,e+=1)t[r]=t[e];t.pop()}const n=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},h=({index:a,isSelected:r=!1,textColor:e,iconPath:s,badgeText:i,showRedDot:b=!1,text:n,onSelect:h})=>{const l=o("weui-tabbar__item",{"weui-bar__item_on":r});return t("a",{key:a,href:"javascript:;",class:l,onClick:function(){h(a)}},t("span",{style:{display:"inline-block",position:"relative"}},t("img",{src:s,alt:"",class:"weui-tabbar__icon"}),!!i&&t("span",{class:"weui-badge taro-tabbar-badge",style:{position:"absolute",top:"-2px",right:"-13px"}},i),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}},n))},l=require("@tarojs/taro"),d=t=>"/"===t[0]?t:`/${t}`,c=(t,a)=>((t,a)=>new RegExp("^"+a+"(\\/|\\?|#|$)","i").test(t))(t,a)?t.substr(a.length):t;let _=class{constructor(t){a(this,t),this.onLongPress=r(this,"longpress",7),this.homePage="",this.customRoutes=[],this.tabbarPos="bottom",this.selectedIndex=-1,this.status=0,this.getOriginUrl=t=>{const a=this.customRoutes.filter((([,a])=>n(a).path===n(t).path));return a.length?a[0][0]:t},this.getSelectedIndex=t=>{let a=-1;return this.list.forEach((({pagePath:r},e)=>{n(t).path===n(r).path&&(a=e)})),a},this.switchTab=t=>{this.selectedIndex=t,l.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("/")||[],s=a&&a.split("/")||[],o=t&&i(t),n=a&&i(a),h=o||n;if(t&&i(t)?s=e:e.length&&(s.pop(),s=s.concat(e)),!s.length)return"/";if(s.length){var l=s[s.length-1];r="."===l||".."===l||""===l}else r=!1;for(var d=0,c=s.length;c>=0;c--){var _=s[c];"."===_?b(s,c):".."===_?(b(s,c),d++):d&&(b(s,c),d--)}if(!h)for(;d--;d)s.unshift("..");!h||""===s[0]||s[0]&&i(s[0])||s.unshift("");var u=s.join("/");return r&&"/"!==u.substr(-1)&&(u+="/"),u}(t,this.getOriginUrl(this.getCurrentUrl()||this.homePage)),s=this.getSelectedIndex(e);s>-1?(this.switchTab(s),a({errMsg:"switchTab:ok"})):r({errMsg:`switchTab:fail page "${e}" is not found`})},this.routerChangeHandler=t=>{let a,r;if(t&&(a=t.toLocation),a&&a.path){const t=d(a.path);r=c("/"===t?this.homePage:t,this.conf.basename||"/")}else r=this.getCurrentUrl();this.selectedIndex=this.getSelectedIndex(this.getOriginUrl(r))},this.setTabBarBadgeHandler=({index:t,text:a,successHandler:r,errorHandler:e})=>{const s=[...this.list];t in s?(s[t].showRedDot=!1,s[t].badgeText=a,r({errMsg:"setTabBarBadge:ok"})):e({errMsg:"setTabBarBadge:fail tabbar item not found"}),this.list=s},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:s})=>{r&&(this.backgroundColor=r),e&&(this.borderStyle=e),t&&(this.color=t),a&&(this.selectedColor=a),s({errMsg:"setTabBarStyle:ok"})},this.setTabBarItemHandler=({index:t,iconPath:a,selectedIconPath:r,text:e,successHandler:s,errorHandler:o})=>{const i=[...this.list];t in i?(a&&(i[t].iconPath=a),r&&(i[t].selectedIconPath=r),e&&(i[t].text=e),s({errMsg:"setTabBarItem:ok"})):o({errMsg:"setTabBarItem:fail tabbar item not found"}),this.list=i};const e=this.conf.list,s=this.conf.customRoutes;if("[object Array]"!==Object.prototype.toString.call(e)||e.length<2||e.length>5)throw new Error("tabBar 配置错误");this.homePage=d(this.conf.homePage);for(const t in s)this.customRoutes.push([t,s[t]]);e.forEach((t=>{0!==t.pagePath.indexOf("/")&&(t.pagePath="/"+t.pagePath)})),this.list=e,this.borderStyle=this.conf.borderStyle}getCurrentUrl(){const t=this.conf.basename||"/";let a;if("hash"===this.conf.mode){const t=window.location.href,r=t.indexOf("#");a=-1===r?"":t.substring(r+1)}else a=location.pathname;const r=d(c(a,t));return"/"===r?this.homePage:r}bindEvent(){l.eventCenter.on("__taroRouterChange",this.routerChangeHandler),l.eventCenter.on("__taroSwitchTab",this.switchTabHandler),l.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler),l.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler),l.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler),l.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler),l.eventCenter.on("__taroShowTabBar",this.showTabBarHandler),l.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler),l.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler),l.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)}removeEvent(){l.eventCenter.off("__taroRouterChange",this.routerChangeHandler),l.eventCenter.off("__taroSwitchTab",this.switchTabHandler),l.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler),l.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler),l.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler),l.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler),l.eventCenter.off("__taroShowTabBar",this.showTabBarHandler),l.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler),l.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler),l.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,s=o("weui-tabbar",{[`taro-tabbar__border-${this.borderStyle||"black"}`]:!0});return t(e,{class:o("taro-tabbar__tabbar",`taro-tabbar__tabbar-${a}`,{"taro-tabbar__tabbar-hide":-1===this.selectedIndex||1===r,"taro-tabbar__tabbar-slideout":2===r})},t("div",{class:s,style:{backgroundColor:this.backgroundColor||""}},this.list.map(((a,r)=>{const e=this.selectedIndex===r;let s,o;return e?(s=this.selectedColor,o=a.selectedIconPath):(s=this.color||"",o=a.iconPath),console.log("TabbarItem",a),t(h,{index:r,onSelect:this.switchTab.bind(this),isSelected:e,textColor:s,iconPath:o,text:a.text,badgeText:a.badgeText,showRedDot:a.showRedDot})}))))}get tabbar(){return s(this)}};_.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;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:touch}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-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}.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{_ as taro_tabbar}