@tarojs/components 3.6.0-beta.3 → 3.6.0-beta.4

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.
@@ -31,6 +31,12 @@ const addLeadingSlash = (url = '') => (url.charAt(0) === '/' ? url : '/' + url);
31
31
  const hasBasename = (path = '', prefix = '') => new RegExp('^' + prefix + '(\\/|\\?|#|$)', 'i').test(path) || path === prefix;
32
32
  const stripBasename = (path = '', prefix = '') => hasBasename(path, prefix) ? path.substring(prefix.length) : path;
33
33
  const stripSuffix = (path = '', suffix = '') => path.includes(suffix) ? path.substring(0, path.length - suffix.length) : path;
34
+ const getCurrentPage = (routerMode = 'hash', basename = '/') => {
35
+ const pagePath = routerMode === 'hash'
36
+ ? location.hash.slice(1).split('?')[0]
37
+ : location.pathname;
38
+ return addLeadingSlash(stripBasename(pagePath, basename));
39
+ };
34
40
 
35
41
  function isAbsolute(pathname) {
36
42
  return pathname.charAt(0) === '/';
@@ -350,21 +356,8 @@ const Tabbar = class {
350
356
  this.selectedColor = this.conf.selectedColor;
351
357
  }
352
358
  getCurrentUrl() {
353
- const routerMode = this.conf.mode;
354
- const routerBasename = this.conf.basename || '/';
355
- let url;
356
- if (routerMode === 'hash') {
357
- const href = window.location.href;
358
- const hashIndex = href.indexOf('#');
359
- url = hashIndex === -1
360
- ? ''
361
- : href.substring(hashIndex + 1);
362
- }
363
- else {
364
- url = location.pathname;
365
- }
366
- const processedUrl = addLeadingSlash(stripBasename(url, routerBasename));
367
- return decodeURI(processedUrl === '/' ? this.homePage : processedUrl);
359
+ const routePath = getCurrentPage(this.conf.mode, this.conf.basename);
360
+ return decodeURI(routePath === '/' ? this.homePage : routePath);
368
361
  }
369
362
  bindEvent() {
370
363
  Taro.eventCenter.on('__taroRouterChange', this.routerChangeHandler);
@@ -1 +1 @@
1
- {"file":"taro-tabbar.entry.js","mappings":";;;;;AAsDO,MAAM,QAAQ,GAAG,IAAI;EAC1B,IAAI,GAAG,GA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CAAC,IAAI,CAAC,EACnC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,UAAU,EAAE,IAAI,CAAC,UAAU,GAC3B,EACH;KACF,CAAC,CACE,CACD,EACR;GACF;;;;;;;","names":["classNames"],"sources":["./src/utils/url.ts","../taro-router/dist/utils/index.js","../../node_modules/.pnpm/registry.npmjs.org+resolve-pathname@3.0.0/node_modules/resolve-pathname/esm/resolve-pathname.js","./src/components/tabbar/tabbar-item.tsx","./src/components/tabbar/style/index.scss?tag=taro-tabbar","./src/components/tabbar/tabbar.tsx"],"sourcesContent":["export const normalizePath = url => {\n let _isRelative\n let _leadingParents = ''\n let _parent, _pos\n\n // handle relative paths\n if (url.charAt(0) !== '/') {\n _isRelative = true\n url = '/' + url\n }\n\n // handle relative files (as opposed to directories)\n if (url.substring(-3) === '/..' || url.slice(-2) === '/.') {\n url += '/'\n }\n\n // resolve simples\n url = url.replace(/(\\/(\\.\\/)+)|(\\/\\.$)/g, '/').replace(/\\/{2,}/g, '/')\n\n // remember leading parents\n if (_isRelative) {\n _leadingParents = url.substring(1).match(/^(\\.\\.\\/)+/) || ''\n if (_leadingParents) {\n _leadingParents = _leadingParents[0]\n }\n }\n\n // resolve parents\n while (true) {\n _parent = url.search(/\\/\\.\\.(\\/|$)/)\n if (_parent === -1) {\n // no more ../ to resolve\n break\n } else if (_parent === 0) {\n // top level cannot be relative, skip it\n url = url.substring(3)\n continue\n }\n\n _pos = url.substring(0, _parent).lastIndexOf('/')\n if (_pos === -1) {\n _pos = _parent\n }\n url = url.substring(0, _pos) + url.substring(_parent + 3)\n }\n\n // revert to relative\n if (_isRelative) {\n url = _leadingParents + url.substring(1)\n }\n\n return url\n}\n\nexport const splitUrl = _url => {\n let url = _url || ''\n let pos\n const res = {\n path: null,\n query: null,\n fragment: null\n }\n\n pos = url.indexOf('#')\n if (pos > -1) {\n res.fragment = url.substring(pos + 1)\n url = url.substring(0, pos)\n }\n\n pos = url.indexOf('?')\n if (pos > -1) {\n res.query = url.substring(pos + 1)\n url = url.substring(0, pos)\n }\n\n res.path = url\n\n return res\n}\n","// export const removeLeadingSlash = (str = '') => str.replace(/^\\.?\\//, '')\n// export const removeTrailingSearch = (str = '') => str.replace(/\\?[\\s\\S]*$/, '')\nexport const addLeadingSlash = (url = '') => (url.charAt(0) === '/' ? url : '/' + url);\nexport const hasBasename = (path = '', prefix = '') => new RegExp('^' + prefix + '(\\\\/|\\\\?|#|$)', 'i').test(path) || path === prefix;\nexport const stripBasename = (path = '', prefix = '') => hasBasename(path, prefix) ? path.substring(prefix.length) : path;\nexport const stripTrailing = (str = '') => str.replace(/[?#][\\s\\S]*$/, '');\nexport const stripSuffix = (path = '', suffix = '') => path.includes(suffix) ? path.substring(0, path.length - suffix.length) : path;\nexport const getHomePage = (path = '', basename = '', customRoutes = {}, entryPagePath = '') => {\n var _a;\n const routePath = addLeadingSlash(stripBasename(path, basename));\n const alias = ((_a = Object.entries(customRoutes).find(([key]) => key === routePath)) === null || _a === void 0 ? void 0 : _a[1]) || routePath;\n return entryPagePath || (typeof alias === 'string' ? alias : alias[0]) || basename;\n};\nclass RoutesAlias {\n constructor() {\n this.conf = [];\n this.getConfig = (url = '') => {\n const customRoute = this.conf.filter((arr) => {\n return arr.includes(url);\n });\n return customRoute[0];\n };\n this.getOrigin = (url = '') => {\n var _a;\n return ((_a = this.getConfig(url)) === null || _a === void 0 ? void 0 : _a[0]) || url;\n };\n this.getAlias = (url = '') => {\n var _a;\n return ((_a = this.getConfig(url)) === null || _a === void 0 ? void 0 : _a[1]) || url;\n };\n this.getAll = (url = '') => {\n return this.conf\n .filter((arr) => arr.includes(url))\n .reduceRight((p, a) => {\n p.unshift(a[1]);\n return p;\n }, []);\n };\n }\n set(customRoutes = {}) {\n for (let key in customRoutes) {\n const path = customRoutes[key];\n key = addLeadingSlash(key);\n if (typeof path === 'string') {\n this.conf.push([key, addLeadingSlash(path)]);\n }\n else if ((path === null || path === void 0 ? void 0 : path.length) > 0) {\n this.conf.push(...path.map(p => [key, addLeadingSlash(p)]));\n }\n }\n }\n}\nexport const routesAlias = new RoutesAlias();\n","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;\n","import classNames from 'classnames'\nimport { FunctionalComponent, h } from '@stencil/core'\nimport Taro from '@tarojs/taro'\n\nimport { isVisible } from '../../utils'\n\ntype TabbarItemProps = {\n index: number\n isSelected?: boolean\n textColor?: string\n badgeText?: string\n iconPath: string\n showRedDot?: boolean\n pagePath?: string\n text?: string\n onSelect: (index: number) => void\n}\n\nexport const TabbarItem: FunctionalComponent<TabbarItemProps> = ({\n index,\n isSelected = false,\n textColor,\n iconPath,\n badgeText,\n showRedDot = false,\n pagePath,\n text,\n onSelect\n}) => {\n const className = classNames('weui-tabbar__item', {\n 'weui-bar__item_on': isSelected\n })\n const badgeStyle = {\n position: 'absolute',\n top: '-2px',\n right: '-13px'\n }\n const dotStyle = {\n position: 'absolute',\n top: '0',\n right: '-6px'\n }\n\n function onClick () {\n const page = Taro.getCurrentPages().shift()\n if (typeof page?.onTabItemTap === 'function' && isVisible(this)) {\n page.onTabItemTap({ index, pagePath, text })\n }\n onSelect(index)\n }\n\n return (\n <a key={index} href='javascript:;' class={className} onClick={onClick}>\n <span style={{ display: 'inline-block', position: 'relative' }}>\n <img src={iconPath} alt='' class='weui-tabbar__icon' />\n {!!badgeText && (\n <span\n class='weui-badge taro-tabbar-badge'\n style={badgeStyle}>\n {badgeText}\n </span>\n )}\n {showRedDot && (\n <span\n class='weui-badge weui-badge_dot'\n style={dotStyle}\n />\n )}\n </span>\n <p class='weui-tabbar__label' style={{ color: textColor }}>\n {text}\n </p>\n </a>\n )\n}\n","html,\nbody {\n height: 100%;\n}\n\n#app {\n height: 100%;\n}\n\n.taro-tabbar {\n &__border {\n &-white {\n &::before {\n border-top-color: #fff !important;\n }\n }\n }\n\n &__container {\n display: flex;\n overflow: hidden;\n flex-direction: column;\n height: 100%;\n }\n\n &__panel {\n overflow: auto;\n position: relative;\n flex: 1;\n -webkit-overflow-scrolling: auto;\n }\n\n &__tabbar {\n position: relative;\n width: 100%;\n height: 50px;\n transition: bottom 0.2s, top 0.2s;\n\n &-top {\n top: 0;\n }\n\n &-bottom {\n bottom: 0;\n margin-bottom: constant(safe-area-inset-bottom);\n margin-bottom: env(safe-area-inset-bottom);\n }\n\n &-hide {\n display: none;\n }\n\n &-slideout {\n top: -52px;\n flex: 0 0;\n }\n }\n\n &__panel + &__tabbar-slideout {\n top: auto;\n bottom: -52px;\n }\n}\n","import { Component, Prop, h, ComponentInterface, Host, State, Event, EventEmitter, Element } from '@stencil/core'\nimport Taro from '@tarojs/taro'\nimport { addLeadingSlash, stripBasename, stripSuffix } from '@tarojs/router/dist/utils'\nimport { IH5RouterConfig } from '@tarojs/taro/types/compile'\nimport classNames from 'classnames'\nimport resolvePathname from 'resolve-pathname'\n\nimport { splitUrl } from '../../utils'\nimport { TabbarItem } from './tabbar-item'\n\nconst STATUS_SHOW = 0\nconst STATUS_HIDE = 1\nconst STATUS_SLIDEOUT = 2\n\nconst basicTabBarClassName = 'taro-tabbar__tabbar'\nconst hideTabBarClassName = 'taro-tabbar__tabbar-hide'\nconst hideTabBarWithAnimationClassName = 'taro-tabbar__tabbar-slideout'\n\ninterface RouterHandler {\n index: string\n text: string\n url: string\n successHandler: Function\n errorHandler: Function\n animation?: boolean\n}\n\nexport interface Conf {\n color: string\n selectedColor: string\n backgroundColor: string\n borderStyle?: 'black' | 'white'\n list: TabbarList[]\n position?: 'bottom' | 'top'\n custom: boolean\n customRoutes: Record<string, string | string[]>\n mode: IH5RouterConfig['mode']\n basename: string\n homePage: string\n currentPagename: string\n}\n\ninterface TabbarList {\n pagePath: string\n text: string\n iconPath?: string\n selectedIconPath?: string\n badgeText?: string\n showRedDot?: boolean\n}\n\n@Component({\n tag: 'taro-tabbar',\n styleUrl: './style/index.scss'\n})\nexport class Tabbar implements ComponentInterface {\n private homePage = ''\n\n private customRoutes: Array<string[]> = []\n\n private tabbarPos: 'top' | 'bottom' = 'bottom'\n\n @Prop() conf: Conf\n\n @State() list: TabbarList[]\n\n @State() borderStyle: Conf['borderStyle']\n\n @State() backgroundColor: Conf['backgroundColor']\n\n @State() color: Conf['color']\n\n @State() selectedColor: Conf['selectedColor']\n\n @State() selectedIndex = -1\n\n @State() status: 0 | 1 | 2 = STATUS_SHOW\n\n @Event({\n eventName: 'longpress'\n }) onLongPress: EventEmitter\n\n @Element() tabbar: HTMLDivElement\n\n constructor () {\n const list = this.conf.list\n const customRoutes = this.conf.customRoutes\n if (\n Object.prototype.toString.call(list) !== '[object Array]' ||\n list.length < 2 ||\n list.length > 5\n ) {\n throw new Error('tabBar 配置错误')\n }\n\n this.homePage = addLeadingSlash(this.conf.homePage)\n for (let key in customRoutes) {\n const path = customRoutes[key]\n key = addLeadingSlash(key)\n if (typeof path === 'string') {\n this.customRoutes.push([key, addLeadingSlash(path)])\n } else if (path?.length > 0) {\n this.customRoutes.push(...path.map(p => [key, addLeadingSlash(p)]))\n }\n }\n\n list.forEach(item => {\n if (item.pagePath.indexOf('/') !== 0) {\n item.pagePath = '/' + item.pagePath\n }\n })\n\n this.list = list\n this.borderStyle = this.conf.borderStyle\n this.backgroundColor = this.conf.backgroundColor\n this.color = this.conf.color\n this.selectedColor = this.conf.selectedColor\n }\n\n getCurrentUrl () {\n const routerMode = this.conf.mode\n const routerBasename = this.conf.basename || '/'\n let url\n if (routerMode === 'hash') {\n const href = window.location.href\n const hashIndex = href.indexOf('#')\n url = hashIndex === -1\n ? ''\n : href.substring(hashIndex + 1)\n } else {\n url = location.pathname\n }\n const processedUrl = addLeadingSlash(stripBasename(url, routerBasename))\n return decodeURI(processedUrl === '/' ? this.homePage : processedUrl)\n }\n\n getOriginUrl = (url: string) => {\n const customRoute = this.customRoutes.filter(([, customUrl]) => {\n const pathA = splitUrl(customUrl).path\n const pathB = splitUrl(url).path\n return pathA === pathB\n })\n return stripSuffix(customRoute.length ? customRoute[0][0] : url, '.html')\n }\n\n getSelectedIndex = (url: string) => {\n let foundIndex = -1\n this.list.forEach(({ pagePath }, idx) => {\n const pathA = splitUrl(url).path\n const pathB = splitUrl(pagePath).path\n if (pathA === pathB) {\n foundIndex = idx\n }\n })\n return foundIndex\n }\n\n switchTab = (index: number) => {\n this.selectedIndex = index\n Taro.switchTab({\n url: this.list[index].pagePath\n })\n }\n\n switchTabHandler = ({ url, successHandler, errorHandler }: RouterHandler) => {\n const currentUrl = this.getOriginUrl(this.getCurrentUrl() || this.homePage)\n const nextTab = resolvePathname(url, currentUrl)\n const foundIndex = this.getSelectedIndex(nextTab)\n\n if (foundIndex > -1) {\n this.switchTab(foundIndex)\n successHandler({\n errMsg: 'switchTab:ok'\n })\n } else {\n errorHandler({\n errMsg: `switchTab:fail page \"${nextTab}\" is not found`\n })\n }\n }\n\n routerChangeHandler = (options?) => {\n const to = options?.toLocation?.path\n let currentPage\n\n if (typeof to === 'string') {\n const routerBasename = this.conf.basename || '/'\n currentPage = stripBasename(addLeadingSlash(to || this.homePage), routerBasename) || '/'\n } else {\n currentPage = this.getCurrentUrl()\n }\n\n this.selectedIndex = this.getSelectedIndex(this.getOriginUrl(currentPage))\n }\n\n setTabBarBadgeHandler = ({ index, text, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].showRedDot = false\n list[index].badgeText = text\n successHandler({\n errMsg: 'setTabBarBadge:ok'\n })\n } else {\n errorHandler({\n errMsg: 'setTabBarBadge:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n removeTabBarBadgeHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].badgeText = null\n list[index].badgeText = null\n successHandler({\n errMsg: 'removeTabBarBadge:ok'\n })\n } else {\n errorHandler({\n errMsg: 'removeTabBarBadge:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n showTabBarRedDotHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].badgeText = null\n list[index].showRedDot = true\n successHandler({\n errMsg: 'showTabBarRedDot:ok'\n })\n } else {\n errorHandler({\n errMsg: 'showTabBarRedDot:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n hideTabBarRedDotHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].showRedDot = false\n successHandler({\n errMsg: 'hideTabBarRedDot:ok'\n })\n } else {\n errorHandler({\n errMsg: 'hideTabBarRedDot:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n showTabBarHandler = ({ successHandler }) => {\n this.status = STATUS_SHOW\n successHandler({\n errMsg: 'showTabBar:ok'\n })\n }\n\n hideTabBarHandler = ({ animation, successHandler }) => {\n this.status = animation ? STATUS_SLIDEOUT : STATUS_HIDE\n successHandler({\n errMsg: 'hideTabBar:ok'\n })\n }\n\n setTabBarStyleHandler = ({ color, selectedColor, backgroundColor, borderStyle, successHandler }) => {\n if (backgroundColor) this.backgroundColor = backgroundColor\n if (borderStyle) this.borderStyle = borderStyle\n if (color) this.color = color\n if (selectedColor) this.selectedColor = selectedColor\n successHandler({\n errMsg: 'setTabBarStyle:ok'\n })\n }\n\n setTabBarItemHandler = ({ index, iconPath, selectedIconPath, text, successHandler, errorHandler }) => {\n const list = [...this.list]\n if (index in list) {\n if (iconPath) list[index].iconPath = iconPath\n if (selectedIconPath) list[index].selectedIconPath = selectedIconPath\n if (text) list[index].text = text\n successHandler({\n errMsg: 'setTabBarItem:ok'\n })\n } else {\n errorHandler({\n errMsg: 'setTabBarItem:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n bindEvent () {\n Taro.eventCenter.on('__taroRouterChange', this.routerChangeHandler)\n Taro.eventCenter.on('__taroSwitchTab', this.switchTabHandler)\n Taro.eventCenter.on('__taroSetTabBarBadge', this.setTabBarBadgeHandler)\n Taro.eventCenter.on('__taroRemoveTabBarBadge', this.removeTabBarBadgeHandler)\n Taro.eventCenter.on('__taroShowTabBarRedDotHandler', this.showTabBarRedDotHandler)\n Taro.eventCenter.on('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler)\n Taro.eventCenter.on('__taroShowTabBar', this.showTabBarHandler)\n Taro.eventCenter.on('__taroHideTabBar', this.hideTabBarHandler)\n Taro.eventCenter.on('__taroSetTabBarStyle', this.setTabBarStyleHandler)\n Taro.eventCenter.on('__taroSetTabBarItem', this.setTabBarItemHandler)\n }\n\n removeEvent () {\n Taro.eventCenter.off('__taroRouterChange', this.routerChangeHandler)\n Taro.eventCenter.off('__taroSwitchTab', this.switchTabHandler)\n Taro.eventCenter.off('__taroSetTabBarBadge', this.setTabBarBadgeHandler)\n Taro.eventCenter.off('__taroRemoveTabBarBadge', this.removeTabBarBadgeHandler)\n Taro.eventCenter.off('__taroShowTabBarRedDotHandler', this.showTabBarRedDotHandler)\n Taro.eventCenter.off('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler)\n Taro.eventCenter.off('__taroShowTabBar', this.showTabBarHandler)\n Taro.eventCenter.off('__taroHideTabBar', this.hideTabBarHandler)\n Taro.eventCenter.off('__taroSetTabBarStyle', this.setTabBarStyleHandler)\n Taro.eventCenter.off('__taroSetTabBarItem', this.setTabBarItemHandler)\n }\n\n componentDidLoad () {\n this.tabbarPos = this.tabbar.nextElementSibling ? 'top' : 'bottom'\n this.bindEvent()\n this.routerChangeHandler()\n }\n\n disconnectedCallback () {\n this.removeEvent()\n }\n\n render () {\n const { tabbarPos = 'bottom' } = this\n const status = this.status\n const containerCls = classNames('weui-tabbar', {\n [`taro-tabbar__border-${this.borderStyle || 'black'}`]: true\n })\n const shouldHideTabBar = this.selectedIndex === -1 || status === STATUS_HIDE\n const shouldSlideout = status === STATUS_SLIDEOUT\n\n return (\n <Host\n class={classNames(\n basicTabBarClassName,\n `${basicTabBarClassName}-${tabbarPos}`, {\n [hideTabBarClassName]: shouldHideTabBar,\n [hideTabBarWithAnimationClassName]: shouldSlideout\n })} >\n <div\n class={containerCls}\n style={{\n backgroundColor: this.backgroundColor || '',\n height: 'inherit'\n }}\n >\n {this.list.map((item, index) => {\n const isSelected = this.selectedIndex === index\n let textColor\n let iconPath\n if (isSelected) {\n textColor = this.selectedColor || ''\n iconPath = item.selectedIconPath\n } else {\n textColor = this.color || ''\n iconPath = item.iconPath\n }\n return (\n <TabbarItem\n index={index}\n onSelect={this.switchTab.bind(this)}\n isSelected={isSelected}\n textColor={textColor}\n iconPath={iconPath}\n pagePath={item.pagePath}\n text={item.text}\n badgeText={item.badgeText}\n showRedDot={item.showRedDot}\n />\n )\n })}\n </div>\n </Host>\n )\n }\n}\n"],"version":3}
1
+ {"file":"taro-tabbar.entry.js","mappings":";;;;;AAsDO,MAAM,QAAQ,GAAG,IAAI;EAC1B,IAAI,GAAG,GAAG,IAAI,IAAI,EAAE,CAAA;EACpB,IAAI,GAAG,CAAA;EACP,MAAM,GAAG,GAAG;IACV,IAAI,EAAE,IAAI;IACV,KAAK,EAAE,IAAI;IACX,QAAQ,EAAE,IAAI;GACf,CAAA;EAED,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;EACtB,IAAI,GAAG,GAAG,CAAC,CAAC,EAAE;IACZ,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;IACrC,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;GAC5B;EAED,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;EACtB,IAAI,GAAG,GAAG,CAAC,CAAC,EAAE;IACZ,GAAG,CAAC,KAAK,GAAG,GAAG,CAAC,SAAS,CAAC,GAAG,GAAG,CAAC,CAAC,CAAA;IAClC,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,CAAA;GAC5B;EAED,GAAG,CAAC,IAAI,GAAG,GAAG,CAAA;EAEd,OAAO,GAAG,CAAA;AACZ,CAAC;;AC9ED;AACA;AACO,MAAM,eAAe,GAAG,CAAC,GAAG,GAAG,EAAE,MAAM,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,GAA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E,CAAA;QACpC,QAAQ,GAAG,IAAI,CAAC,gBAAgB,CAAA;OACjC;WAAM;QACL,SAAS,GAAG,IAAI,CAAC,KAAK,IAAI,EAAE,CAAA;QAC5B,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;OACzB;MACD,QACE,EAAC,UAAU,IACT,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,EACnC,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,SAAS,EACpB,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EACvB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,UAAU,EAAE,IAAI,CAAC,UAAU,GAC3B,EACH;KACF,CAAC,CACE,CACD,EACR;GACF;;;;;;;","names":["classNames"],"sources":["./src/utils/url.ts","../taro-router/dist/utils/index.js","../../node_modules/.pnpm/registry.npmjs.org+resolve-pathname@3.0.0/node_modules/resolve-pathname/esm/resolve-pathname.js","./src/components/tabbar/tabbar-item.tsx","./src/components/tabbar/style/index.scss?tag=taro-tabbar","./src/components/tabbar/tabbar.tsx"],"sourcesContent":["export const normalizePath = url => {\n let _isRelative\n let _leadingParents = ''\n let _parent, _pos\n\n // handle relative paths\n if (url.charAt(0) !== '/') {\n _isRelative = true\n url = '/' + url\n }\n\n // handle relative files (as opposed to directories)\n if (url.substring(-3) === '/..' || url.slice(-2) === '/.') {\n url += '/'\n }\n\n // resolve simples\n url = url.replace(/(\\/(\\.\\/)+)|(\\/\\.$)/g, '/').replace(/\\/{2,}/g, '/')\n\n // remember leading parents\n if (_isRelative) {\n _leadingParents = url.substring(1).match(/^(\\.\\.\\/)+/) || ''\n if (_leadingParents) {\n _leadingParents = _leadingParents[0]\n }\n }\n\n // resolve parents\n while (true) {\n _parent = url.search(/\\/\\.\\.(\\/|$)/)\n if (_parent === -1) {\n // no more ../ to resolve\n break\n } else if (_parent === 0) {\n // top level cannot be relative, skip it\n url = url.substring(3)\n continue\n }\n\n _pos = url.substring(0, _parent).lastIndexOf('/')\n if (_pos === -1) {\n _pos = _parent\n }\n url = url.substring(0, _pos) + url.substring(_parent + 3)\n }\n\n // revert to relative\n if (_isRelative) {\n url = _leadingParents + url.substring(1)\n }\n\n return url\n}\n\nexport const splitUrl = _url => {\n let url = _url || ''\n let pos\n const res = {\n path: null,\n query: null,\n fragment: null\n }\n\n pos = url.indexOf('#')\n if (pos > -1) {\n res.fragment = url.substring(pos + 1)\n url = url.substring(0, pos)\n }\n\n pos = url.indexOf('?')\n if (pos > -1) {\n res.query = url.substring(pos + 1)\n url = url.substring(0, pos)\n }\n\n res.path = url\n\n return res\n}\n","// export const removeLeadingSlash = (str = '') => str.replace(/^\\.?\\//, '')\n// export const removeTrailingSearch = (str = '') => str.replace(/\\?[\\s\\S]*$/, '')\nexport const addLeadingSlash = (url = '') => (url.charAt(0) === '/' ? url : '/' + url);\nexport const hasBasename = (path = '', prefix = '') => new RegExp('^' + prefix + '(\\\\/|\\\\?|#|$)', 'i').test(path) || path === prefix;\nexport const stripBasename = (path = '', prefix = '') => hasBasename(path, prefix) ? path.substring(prefix.length) : path;\nexport const stripTrailing = (str = '') => str.replace(/[?#][\\s\\S]*$/, '');\nexport const stripSuffix = (path = '', suffix = '') => path.includes(suffix) ? path.substring(0, path.length - suffix.length) : path;\nexport const getHomePage = (path = '', basename = '', customRoutes = {}, entryPagePath = '') => {\n var _a;\n const routePath = addLeadingSlash(stripBasename(path, basename));\n const alias = ((_a = Object.entries(customRoutes).find(([key]) => key === routePath)) === null || _a === void 0 ? void 0 : _a[1]) || routePath;\n return entryPagePath || (typeof alias === 'string' ? alias : alias[0]) || basename;\n};\nexport const getCurrentPage = (routerMode = 'hash', basename = '/') => {\n const pagePath = routerMode === 'hash'\n ? location.hash.slice(1).split('?')[0]\n : location.pathname;\n return addLeadingSlash(stripBasename(pagePath, basename));\n};\nclass RoutesAlias {\n constructor() {\n this.conf = [];\n this.getConfig = (url = '') => {\n const customRoute = this.conf.filter((arr) => {\n return arr.includes(url);\n });\n return customRoute[0];\n };\n this.getOrigin = (url = '') => {\n var _a;\n return ((_a = this.getConfig(url)) === null || _a === void 0 ? void 0 : _a[0]) || url;\n };\n this.getAlias = (url = '') => {\n var _a;\n return ((_a = this.getConfig(url)) === null || _a === void 0 ? void 0 : _a[1]) || url;\n };\n this.getAll = (url = '') => {\n return this.conf\n .filter((arr) => arr.includes(url))\n .reduceRight((p, a) => {\n p.unshift(a[1]);\n return p;\n }, []);\n };\n }\n set(customRoutes = {}) {\n for (let key in customRoutes) {\n const path = customRoutes[key];\n key = addLeadingSlash(key);\n if (typeof path === 'string') {\n this.conf.push([key, addLeadingSlash(path)]);\n }\n else if ((path === null || path === void 0 ? void 0 : path.length) > 0) {\n this.conf.push(...path.map(p => [key, addLeadingSlash(p)]));\n }\n }\n }\n}\nexport const routesAlias = new RoutesAlias();\n","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;\n","import classNames from 'classnames'\nimport { FunctionalComponent, h } from '@stencil/core'\nimport Taro from '@tarojs/taro'\n\nimport { isVisible } from '../../utils'\n\ntype TabbarItemProps = {\n index: number\n isSelected?: boolean\n textColor?: string\n badgeText?: string\n iconPath: string\n showRedDot?: boolean\n pagePath?: string\n text?: string\n onSelect: (index: number) => void\n}\n\nexport const TabbarItem: FunctionalComponent<TabbarItemProps> = ({\n index,\n isSelected = false,\n textColor,\n iconPath,\n badgeText,\n showRedDot = false,\n pagePath,\n text,\n onSelect\n}) => {\n const className = classNames('weui-tabbar__item', {\n 'weui-bar__item_on': isSelected\n })\n const badgeStyle = {\n position: 'absolute',\n top: '-2px',\n right: '-13px'\n }\n const dotStyle = {\n position: 'absolute',\n top: '0',\n right: '-6px'\n }\n\n function onClick () {\n const page = Taro.getCurrentPages().shift()\n if (typeof page?.onTabItemTap === 'function' && isVisible(this)) {\n page.onTabItemTap({ index, pagePath, text })\n }\n onSelect(index)\n }\n\n return (\n <a key={index} href='javascript:;' class={className} onClick={onClick}>\n <span style={{ display: 'inline-block', position: 'relative' }}>\n <img src={iconPath} alt='' class='weui-tabbar__icon' />\n {!!badgeText && (\n <span\n class='weui-badge taro-tabbar-badge'\n style={badgeStyle}>\n {badgeText}\n </span>\n )}\n {showRedDot && (\n <span\n class='weui-badge weui-badge_dot'\n style={dotStyle}\n />\n )}\n </span>\n <p class='weui-tabbar__label' style={{ color: textColor }}>\n {text}\n </p>\n </a>\n )\n}\n","html,\nbody {\n height: 100%;\n}\n\n#app {\n height: 100%;\n}\n\n.taro-tabbar {\n &__border {\n &-white {\n &::before {\n border-top-color: #fff !important;\n }\n }\n }\n\n &__container {\n display: flex;\n overflow: hidden;\n flex-direction: column;\n height: 100%;\n }\n\n &__panel {\n overflow: auto;\n position: relative;\n flex: 1;\n -webkit-overflow-scrolling: auto;\n }\n\n &__tabbar {\n position: relative;\n width: 100%;\n height: 50px;\n transition: bottom 0.2s, top 0.2s;\n\n &-top {\n top: 0;\n }\n\n &-bottom {\n bottom: 0;\n margin-bottom: constant(safe-area-inset-bottom);\n margin-bottom: env(safe-area-inset-bottom);\n }\n\n &-hide {\n display: none;\n }\n\n &-slideout {\n top: -52px;\n flex: 0 0;\n }\n }\n\n &__panel + &__tabbar-slideout {\n top: auto;\n bottom: -52px;\n }\n}\n","import { Component, Prop, h, ComponentInterface, Host, State, Event, EventEmitter, Element } from '@stencil/core'\nimport Taro from '@tarojs/taro'\nimport { addLeadingSlash, getCurrentPage, stripBasename, stripSuffix } from '@tarojs/router/dist/utils'\nimport { IH5RouterConfig } from '@tarojs/taro/types/compile'\nimport classNames from 'classnames'\nimport resolvePathname from 'resolve-pathname'\n\nimport { splitUrl } from '../../utils'\nimport { TabbarItem } from './tabbar-item'\n\nconst STATUS_SHOW = 0\nconst STATUS_HIDE = 1\nconst STATUS_SLIDEOUT = 2\n\nconst basicTabBarClassName = 'taro-tabbar__tabbar'\nconst hideTabBarClassName = 'taro-tabbar__tabbar-hide'\nconst hideTabBarWithAnimationClassName = 'taro-tabbar__tabbar-slideout'\n\ninterface RouterHandler {\n index: string\n text: string\n url: string\n successHandler: Function\n errorHandler: Function\n animation?: boolean\n}\n\nexport interface Conf {\n color: string\n selectedColor: string\n backgroundColor: string\n borderStyle?: 'black' | 'white'\n list: TabbarList[]\n position?: 'bottom' | 'top'\n custom: boolean\n customRoutes: Record<string, string | string[]>\n mode: IH5RouterConfig['mode']\n basename: string\n homePage: string\n currentPagename: string\n}\n\ninterface TabbarList {\n pagePath: string\n text: string\n iconPath?: string\n selectedIconPath?: string\n badgeText?: string\n showRedDot?: boolean\n}\n\n@Component({\n tag: 'taro-tabbar',\n styleUrl: './style/index.scss'\n})\nexport class Tabbar implements ComponentInterface {\n private homePage = ''\n\n private customRoutes: Array<string[]> = []\n\n private tabbarPos: 'top' | 'bottom' = 'bottom'\n\n @Prop() conf: Conf\n\n @State() list: TabbarList[]\n\n @State() borderStyle: Conf['borderStyle']\n\n @State() backgroundColor: Conf['backgroundColor']\n\n @State() color: Conf['color']\n\n @State() selectedColor: Conf['selectedColor']\n\n @State() selectedIndex = -1\n\n @State() status: 0 | 1 | 2 = STATUS_SHOW\n\n @Event({\n eventName: 'longpress'\n }) onLongPress: EventEmitter\n\n @Element() tabbar: HTMLDivElement\n\n constructor () {\n const list = this.conf.list\n const customRoutes = this.conf.customRoutes\n if (\n Object.prototype.toString.call(list) !== '[object Array]' ||\n list.length < 2 ||\n list.length > 5\n ) {\n throw new Error('tabBar 配置错误')\n }\n\n this.homePage = addLeadingSlash(this.conf.homePage)\n for (let key in customRoutes) {\n const path = customRoutes[key]\n key = addLeadingSlash(key)\n if (typeof path === 'string') {\n this.customRoutes.push([key, addLeadingSlash(path)])\n } else if (path?.length > 0) {\n this.customRoutes.push(...path.map(p => [key, addLeadingSlash(p)]))\n }\n }\n\n list.forEach(item => {\n if (item.pagePath.indexOf('/') !== 0) {\n item.pagePath = '/' + item.pagePath\n }\n })\n\n this.list = list\n this.borderStyle = this.conf.borderStyle\n this.backgroundColor = this.conf.backgroundColor\n this.color = this.conf.color\n this.selectedColor = this.conf.selectedColor\n }\n\n getCurrentUrl () {\n const routePath = getCurrentPage(this.conf.mode, this.conf.basename)\n return decodeURI(routePath === '/' ? this.homePage : routePath)\n }\n\n getOriginUrl = (url: string) => {\n const customRoute = this.customRoutes.filter(([, customUrl]) => {\n const pathA = splitUrl(customUrl).path\n const pathB = splitUrl(url).path\n return pathA === pathB\n })\n return stripSuffix(customRoute.length ? customRoute[0][0] : url, '.html')\n }\n\n getSelectedIndex = (url: string) => {\n let foundIndex = -1\n this.list.forEach(({ pagePath }, idx) => {\n const pathA = splitUrl(url).path\n const pathB = splitUrl(pagePath).path\n if (pathA === pathB) {\n foundIndex = idx\n }\n })\n return foundIndex\n }\n\n switchTab = (index: number) => {\n this.selectedIndex = index\n Taro.switchTab({\n url: this.list[index].pagePath\n })\n }\n\n switchTabHandler = ({ url, successHandler, errorHandler }: RouterHandler) => {\n const currentUrl = this.getOriginUrl(this.getCurrentUrl() || this.homePage)\n const nextTab = resolvePathname(url, currentUrl)\n const foundIndex = this.getSelectedIndex(nextTab)\n\n if (foundIndex > -1) {\n this.switchTab(foundIndex)\n successHandler({\n errMsg: 'switchTab:ok'\n })\n } else {\n errorHandler({\n errMsg: `switchTab:fail page \"${nextTab}\" is not found`\n })\n }\n }\n\n routerChangeHandler = (options?) => {\n const to = options?.toLocation?.path\n let currentPage\n\n if (typeof to === 'string') {\n const routerBasename = this.conf.basename || '/'\n currentPage = stripBasename(addLeadingSlash(to || this.homePage), routerBasename) || '/'\n } else {\n currentPage = this.getCurrentUrl()\n }\n\n this.selectedIndex = this.getSelectedIndex(this.getOriginUrl(currentPage))\n }\n\n setTabBarBadgeHandler = ({ index, text, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].showRedDot = false\n list[index].badgeText = text\n successHandler({\n errMsg: 'setTabBarBadge:ok'\n })\n } else {\n errorHandler({\n errMsg: 'setTabBarBadge:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n removeTabBarBadgeHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].badgeText = null\n list[index].badgeText = null\n successHandler({\n errMsg: 'removeTabBarBadge:ok'\n })\n } else {\n errorHandler({\n errMsg: 'removeTabBarBadge:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n showTabBarRedDotHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].badgeText = null\n list[index].showRedDot = true\n successHandler({\n errMsg: 'showTabBarRedDot:ok'\n })\n } else {\n errorHandler({\n errMsg: 'showTabBarRedDot:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n hideTabBarRedDotHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].showRedDot = false\n successHandler({\n errMsg: 'hideTabBarRedDot:ok'\n })\n } else {\n errorHandler({\n errMsg: 'hideTabBarRedDot:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n showTabBarHandler = ({ successHandler }) => {\n this.status = STATUS_SHOW\n successHandler({\n errMsg: 'showTabBar:ok'\n })\n }\n\n hideTabBarHandler = ({ animation, successHandler }) => {\n this.status = animation ? STATUS_SLIDEOUT : STATUS_HIDE\n successHandler({\n errMsg: 'hideTabBar:ok'\n })\n }\n\n setTabBarStyleHandler = ({ color, selectedColor, backgroundColor, borderStyle, successHandler }) => {\n if (backgroundColor) this.backgroundColor = backgroundColor\n if (borderStyle) this.borderStyle = borderStyle\n if (color) this.color = color\n if (selectedColor) this.selectedColor = selectedColor\n successHandler({\n errMsg: 'setTabBarStyle:ok'\n })\n }\n\n setTabBarItemHandler = ({ index, iconPath, selectedIconPath, text, successHandler, errorHandler }) => {\n const list = [...this.list]\n if (index in list) {\n if (iconPath) list[index].iconPath = iconPath\n if (selectedIconPath) list[index].selectedIconPath = selectedIconPath\n if (text) list[index].text = text\n successHandler({\n errMsg: 'setTabBarItem:ok'\n })\n } else {\n errorHandler({\n errMsg: 'setTabBarItem:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n bindEvent () {\n Taro.eventCenter.on('__taroRouterChange', this.routerChangeHandler)\n Taro.eventCenter.on('__taroSwitchTab', this.switchTabHandler)\n Taro.eventCenter.on('__taroSetTabBarBadge', this.setTabBarBadgeHandler)\n Taro.eventCenter.on('__taroRemoveTabBarBadge', this.removeTabBarBadgeHandler)\n Taro.eventCenter.on('__taroShowTabBarRedDotHandler', this.showTabBarRedDotHandler)\n Taro.eventCenter.on('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler)\n Taro.eventCenter.on('__taroShowTabBar', this.showTabBarHandler)\n Taro.eventCenter.on('__taroHideTabBar', this.hideTabBarHandler)\n Taro.eventCenter.on('__taroSetTabBarStyle', this.setTabBarStyleHandler)\n Taro.eventCenter.on('__taroSetTabBarItem', this.setTabBarItemHandler)\n }\n\n removeEvent () {\n Taro.eventCenter.off('__taroRouterChange', this.routerChangeHandler)\n Taro.eventCenter.off('__taroSwitchTab', this.switchTabHandler)\n Taro.eventCenter.off('__taroSetTabBarBadge', this.setTabBarBadgeHandler)\n Taro.eventCenter.off('__taroRemoveTabBarBadge', this.removeTabBarBadgeHandler)\n Taro.eventCenter.off('__taroShowTabBarRedDotHandler', this.showTabBarRedDotHandler)\n Taro.eventCenter.off('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler)\n Taro.eventCenter.off('__taroShowTabBar', this.showTabBarHandler)\n Taro.eventCenter.off('__taroHideTabBar', this.hideTabBarHandler)\n Taro.eventCenter.off('__taroSetTabBarStyle', this.setTabBarStyleHandler)\n Taro.eventCenter.off('__taroSetTabBarItem', this.setTabBarItemHandler)\n }\n\n componentDidLoad () {\n this.tabbarPos = this.tabbar.nextElementSibling ? 'top' : 'bottom'\n this.bindEvent()\n this.routerChangeHandler()\n }\n\n disconnectedCallback () {\n this.removeEvent()\n }\n\n render () {\n const { tabbarPos = 'bottom' } = this\n const status = this.status\n const containerCls = classNames('weui-tabbar', {\n [`taro-tabbar__border-${this.borderStyle || 'black'}`]: true\n })\n const shouldHideTabBar = this.selectedIndex === -1 || status === STATUS_HIDE\n const shouldSlideout = status === STATUS_SLIDEOUT\n\n return (\n <Host\n class={classNames(\n basicTabBarClassName,\n `${basicTabBarClassName}-${tabbarPos}`, {\n [hideTabBarClassName]: shouldHideTabBar,\n [hideTabBarWithAnimationClassName]: shouldSlideout\n })} >\n <div\n class={containerCls}\n style={{\n backgroundColor: this.backgroundColor || '',\n height: 'inherit'\n }}\n >\n {this.list.map((item, index) => {\n const isSelected = this.selectedIndex === index\n let textColor\n let iconPath\n if (isSelected) {\n textColor = this.selectedColor || ''\n iconPath = item.selectedIconPath\n } else {\n textColor = this.color || ''\n iconPath = item.iconPath\n }\n return (\n <TabbarItem\n index={index}\n onSelect={this.switchTab.bind(this)}\n isSelected={isSelected}\n textColor={textColor}\n iconPath={iconPath}\n pagePath={item.pagePath}\n text={item.text}\n badgeText={item.badgeText}\n showRedDot={item.showRedDot}\n />\n )\n })}\n </div>\n </Host>\n )\n }\n}\n"],"version":3}
@@ -1,2 +1,2 @@
1
- var __spreadArray=this&&this.__spreadArray||function(e,a,t){if(t||arguments.length===2)for(var r=0,o=a.length,n;r<o;r++){if(n||!(r in a)){if(!n)n=Array.prototype.slice.call(a,0,r);n[r]=a[r]}}return e.concat(n||Array.prototype.slice.call(a))};import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-c948674f.js";import Taro from"@tarojs/taro";import{c as classnames}from"./index-1d8e8acd.js";import{i as isVisible}from"./index-d1b03e47.js";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 addLeadingSlash=function(e){if(e===void 0){e=""}return e.charAt(0)==="/"?e:"/"+e};var hasBasename=function(e,a){if(e===void 0){e=""}if(a===void 0){a=""}return new RegExp("^"+a+"(\\/|\\?|#|$)","i").test(e)||e===a};var stripBasename=function(e,a){if(e===void 0){e=""}if(a===void 0){a=""}return hasBasename(e,a)?e.substring(a.length):e};var stripSuffix=function(e,a){if(e===void 0){e=""}if(a===void 0){a=""}return e.includes(a)?e.substring(0,e.length-a.length):e};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 i=o||n;if(e&&isAbsolute(e)){r=t}else if(t.length){r.pop();r=r.concat(t)}if(!r.length)return"/";var s;if(r.length){var l=r[r.length-1];s=l==="."||l===".."||l===""}else{s=false}var d=0;for(var b=r.length;b>=0;b--){var h=r[b];if(h==="."){spliceOne(r,b)}else if(h===".."){spliceOne(r,b);d++}else if(d){spliceOne(r,b);d--}}if(!i)for(;d--;d)r.unshift("..");if(i&&r[0]!==""&&(!r[0]||!isAbsolute(r[0])))r.unshift("");var c=r.join("/");if(s&&c.substr(-1)!=="/")c+="/";return c}var TabbarItem=function(e){var a=e.index,t=e.isSelected,r=t===void 0?false:t,o=e.textColor,n=e.iconPath,i=e.badgeText,s=e.showRedDot,l=s===void 0?false:s,d=e.pagePath,b=e.text,c=e.onSelect;var f=classnames("weui-tabbar__item",{"weui-bar__item_on":r});var u={position:"absolute",top:"-2px",right:"-13px"};var v={position:"absolute",top:"0",right:"-6px"};function g(){var e=Taro.getCurrentPages().shift();if(typeof(e===null||e===void 0?void 0:e.onTabItemTap)==="function"&&isVisible(this)){e.onTabItemTap({index:a,pagePath:d,text:b})}c(a)}return h("a",{key:a,href:"javascript:;",class:f,onClick:g},h("span",{style:{display:"inline-block",position:"relative"}},h("img",{src:n,alt:"",class:"weui-tabbar__icon"}),!!i&&h("span",{class:"weui-badge taro-tabbar-badge",style:u},i),l&&h("span",{class:"weui-badge weui-badge_dot",style:v})),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;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}";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.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 stripSuffix(t.length?t[0][0]:e,".html")};this.getSelectedIndex=function(e){var t=-1;a.list.forEach((function(a,r){var o=a.pagePath;var n=splitUrl(e).path;var i=splitUrl(o).path;if(n===i){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 i=resolvePathname(t,n);var s=a.getSelectedIndex(i);if(s>-1){a.switchTab(s);r({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'.concat(i,'" is not found')})}};this.routerChangeHandler=function(e){var t;var r=(t=e===null||e===void 0?void 0:e.toLocation)===null||t===void 0?void 0:t.path;var o;if(typeof r==="string"){var n=a.conf.basename||"/";o=stripBasename(addLeadingSlash(r||a.homePage),n)||"/"}else{o=a.getCurrentUrl()}a.selectedIndex=a.getSelectedIndex(a.getOriginUrl(o))};this.setTabBarBadgeHandler=function(e){var t=e.index,r=e.text,o=e.successHandler,n=e.errorHandler;var i=__spreadArray([],a.list,true);if(t in i){i[t].showRedDot=false;i[t].badgeText=r;o({errMsg:"setTabBarBadge:ok"})}else{n({errMsg:"setTabBarBadge:fail tabbar item not found"})}a.list=i};this.removeTabBarBadgeHandler=function(e){var t=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],a.list,true);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,true);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,true);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,i=e.successHandler;if(o)a.backgroundColor=o;if(n)a.borderStyle=n;if(t)a.color=t;if(r)a.selectedColor=r;i({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var t=e.index,r=e.iconPath,o=e.selectedIconPath,n=e.text,i=e.successHandler,s=e.errorHandler;var l=__spreadArray([],a.list,true);if(t in l){if(r)l[t].iconPath=r;if(o)l[t].selectedIconPath=o;if(n)l[t].text=n;i({errMsg:"setTabBarItem:ok"})}else{s({errMsg:"setTabBarItem:fail tabbar item not found"})}a.list=l};this.conf=undefined;this.list=undefined;this.borderStyle=undefined;this.backgroundColor=undefined;this.color=undefined;this.selectedColor=undefined;this.selectedIndex=-1;this.status=STATUS_SHOW;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);var o=function(e){var a;var t=r[e];e=addLeadingSlash(e);if(typeof t==="string"){n.customRoutes.push([e,addLeadingSlash(t)])}else if((t===null||t===void 0?void 0:t.length)>0){(a=n.customRoutes).push.apply(a,t.map((function(a){return[e,addLeadingSlash(a)]})))}};var n=this;for(var i in r){o(i)}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 decodeURI(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 i=classnames("weui-tabbar",(e={},e["taro-tabbar__border-".concat(this.borderStyle||"black")]=true,e));var s=this.selectedIndex===-1||n===STATUS_HIDE;var l=n===STATUS_SLIDEOUT;return h(Host,{class:classnames(basicTabBarClassName,"".concat(basicTabBarClassName,"-").concat(o),(a={},a[hideTabBarClassName]=s,a[hideTabBarWithAnimationClassName]=l,a))},h("div",{class:i,style:{backgroundColor:this.backgroundColor||"",height:"inherit"}},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,pagePath:e.pagePath,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,t,a){if(a||arguments.length===2)for(var r=0,o=t.length,n;r<o;r++){if(n||!(r in t)){if(!n)n=Array.prototype.slice.call(t,0,r);n[r]=t[r]}}return e.concat(n||Array.prototype.slice.call(t))};import{h,r as registerInstance,c as createEvent,H as Host,g as getElement}from"./index-c948674f.js";import Taro from"@tarojs/taro";import{c as classnames}from"./index-1d8e8acd.js";import{i as isVisible}from"./index-d1b03e47.js";var splitUrl=function(e){var t=e||"";var a;var r={path:null,query:null,fragment:null};a=t.indexOf("#");if(a>-1){r.fragment=t.substring(a+1);t=t.substring(0,a)}a=t.indexOf("?");if(a>-1){r.query=t.substring(a+1);t=t.substring(0,a)}r.path=t;return r};var addLeadingSlash=function(e){if(e===void 0){e=""}return e.charAt(0)==="/"?e:"/"+e};var hasBasename=function(e,t){if(e===void 0){e=""}if(t===void 0){t=""}return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)||e===t};var stripBasename=function(e,t){if(e===void 0){e=""}if(t===void 0){t=""}return hasBasename(e,t)?e.substring(t.length):e};var stripSuffix=function(e,t){if(e===void 0){e=""}if(t===void 0){t=""}return e.includes(t)?e.substring(0,e.length-t.length):e};var getCurrentPage=function(e,t){if(e===void 0){e="hash"}if(t===void 0){t="/"}var a=e==="hash"?location.hash.slice(1).split("?")[0]:location.pathname;return addLeadingSlash(stripBasename(a,t))};function isAbsolute(e){return e.charAt(0)==="/"}function spliceOne(e,t){for(var a=t,r=a+1,o=e.length;r<o;a+=1,r+=1){e[a]=e[r]}e.pop()}function resolvePathname(e,t){if(t===undefined)t="";var a=e&&e.split("/")||[];var r=t&&t.split("/")||[];var o=e&&isAbsolute(e);var n=t&&isAbsolute(t);var i=o||n;if(e&&isAbsolute(e)){r=a}else if(a.length){r.pop();r=r.concat(a)}if(!r.length)return"/";var s;if(r.length){var l=r[r.length-1];s=l==="."||l===".."||l===""}else{s=false}var d=0;for(var b=r.length;b>=0;b--){var h=r[b];if(h==="."){spliceOne(r,b)}else if(h===".."){spliceOne(r,b);d++}else if(d){spliceOne(r,b);d--}}if(!i)for(;d--;d)r.unshift("..");if(i&&r[0]!==""&&(!r[0]||!isAbsolute(r[0])))r.unshift("");var c=r.join("/");if(s&&c.substr(-1)!=="/")c+="/";return c}var TabbarItem=function(e){var t=e.index,a=e.isSelected,r=a===void 0?false:a,o=e.textColor,n=e.iconPath,i=e.badgeText,s=e.showRedDot,l=s===void 0?false:s,d=e.pagePath,b=e.text,c=e.onSelect;var f=classnames("weui-tabbar__item",{"weui-bar__item_on":r});var u={position:"absolute",top:"-2px",right:"-13px"};var v={position:"absolute",top:"0",right:"-6px"};function g(){var e=Taro.getCurrentPages().shift();if(typeof(e===null||e===void 0?void 0:e.onTabItemTap)==="function"&&isVisible(this)){e.onTabItemTap({index:t,pagePath:d,text:b})}c(t)}return h("a",{key:t,href:"javascript:;",class:f,onClick:g},h("span",{style:{display:"inline-block",position:"relative"}},h("img",{src:n,alt:"",class:"weui-tabbar__icon"}),!!i&&h("span",{class:"weui-badge taro-tabbar-badge",style:u},i),l&&h("span",{class:"weui-badge weui-badge_dot",style:v})),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;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}";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 t=this;registerInstance(this,e);this.onLongPress=createEvent(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.getOriginUrl=function(e){var a=t.customRoutes.filter((function(t){var a=t[1];var r=splitUrl(a).path;var o=splitUrl(e).path;return r===o}));return stripSuffix(a.length?a[0][0]:e,".html")};this.getSelectedIndex=function(e){var a=-1;t.list.forEach((function(t,r){var o=t.pagePath;var n=splitUrl(e).path;var i=splitUrl(o).path;if(n===i){a=r}}));return a};this.switchTab=function(e){t.selectedIndex=e;Taro.switchTab({url:t.list[e].pagePath})};this.switchTabHandler=function(e){var a=e.url,r=e.successHandler,o=e.errorHandler;var n=t.getOriginUrl(t.getCurrentUrl()||t.homePage);var i=resolvePathname(a,n);var s=t.getSelectedIndex(i);if(s>-1){t.switchTab(s);r({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'.concat(i,'" is not found')})}};this.routerChangeHandler=function(e){var a;var r=(a=e===null||e===void 0?void 0:e.toLocation)===null||a===void 0?void 0:a.path;var o;if(typeof r==="string"){var n=t.conf.basename||"/";o=stripBasename(addLeadingSlash(r||t.homePage),n)||"/"}else{o=t.getCurrentUrl()}t.selectedIndex=t.getSelectedIndex(t.getOriginUrl(o))};this.setTabBarBadgeHandler=function(e){var a=e.index,r=e.text,o=e.successHandler,n=e.errorHandler;var i=__spreadArray([],t.list,true);if(a in i){i[a].showRedDot=false;i[a].badgeText=r;o({errMsg:"setTabBarBadge:ok"})}else{n({errMsg:"setTabBarBadge:fail tabbar item not found"})}t.list=i};this.removeTabBarBadgeHandler=function(e){var a=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list,true);if(a in n){n[a].badgeText=null;n[a].badgeText=null;r({errMsg:"removeTabBarBadge:ok"})}else{o({errMsg:"removeTabBarBadge:fail tabbar item not found"})}t.list=n};this.showTabBarRedDotHandler=function(e){var a=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list,true);if(a in n){n[a].badgeText=null;n[a].showRedDot=true;r({errMsg:"showTabBarRedDot:ok"})}else{o({errMsg:"showTabBarRedDot:fail tabbar item not found"})}t.list=n};this.hideTabBarRedDotHandler=function(e){var a=e.index,r=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list,true);if(a in n){n[a].showRedDot=false;r({errMsg:"hideTabBarRedDot:ok"})}else{o({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}t.list=n};this.showTabBarHandler=function(e){var a=e.successHandler;t.status=STATUS_SHOW;a({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var a=e.animation,r=e.successHandler;t.status=a?STATUS_SLIDEOUT:STATUS_HIDE;r({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=function(e){var a=e.color,r=e.selectedColor,o=e.backgroundColor,n=e.borderStyle,i=e.successHandler;if(o)t.backgroundColor=o;if(n)t.borderStyle=n;if(a)t.color=a;if(r)t.selectedColor=r;i({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var a=e.index,r=e.iconPath,o=e.selectedIconPath,n=e.text,i=e.successHandler,s=e.errorHandler;var l=__spreadArray([],t.list,true);if(a in l){if(r)l[a].iconPath=r;if(o)l[a].selectedIconPath=o;if(n)l[a].text=n;i({errMsg:"setTabBarItem:ok"})}else{s({errMsg:"setTabBarItem:fail tabbar item not found"})}t.list=l};this.conf=undefined;this.list=undefined;this.borderStyle=undefined;this.backgroundColor=undefined;this.color=undefined;this.selectedColor=undefined;this.selectedIndex=-1;this.status=STATUS_SHOW;var a=this.conf.list;var r=this.conf.customRoutes;if(Object.prototype.toString.call(a)!=="[object Array]"||a.length<2||a.length>5){throw new Error("tabBar 配置错误")}this.homePage=addLeadingSlash(this.conf.homePage);var o=function(e){var t;var a=r[e];e=addLeadingSlash(e);if(typeof a==="string"){n.customRoutes.push([e,addLeadingSlash(a)])}else if((a===null||a===void 0?void 0:a.length)>0){(t=n.customRoutes).push.apply(t,a.map((function(t){return[e,addLeadingSlash(t)]})))}};var n=this;for(var i in r){o(i)}a.forEach((function(e){if(e.pagePath.indexOf("/")!==0){e.pagePath="/"+e.pagePath}}));this.list=a;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=getCurrentPage(this.conf.mode,this.conf.basename);return decodeURI(e==="/"?this.homePage:e)};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,t;var a=this;var r=this.tabbarPos,o=r===void 0?"bottom":r;var n=this.status;var i=classnames("weui-tabbar",(e={},e["taro-tabbar__border-".concat(this.borderStyle||"black")]=true,e));var s=this.selectedIndex===-1||n===STATUS_HIDE;var l=n===STATUS_SLIDEOUT;return h(Host,{class:classnames(basicTabBarClassName,"".concat(basicTabBarClassName,"-").concat(o),(t={},t[hideTabBarClassName]=s,t[hideTabBarWithAnimationClassName]=l,t))},h("div",{class:i,style:{backgroundColor:this.backgroundColor||"",height:"inherit"}},this.list.map((function(e,t){var r=a.selectedIndex===t;var o;var n;if(r){o=a.selectedColor||"";n=e.selectedIconPath}else{o=a.color||"";n=e.iconPath}return h(TabbarItem,{index:t,onSelect:a.switchTab.bind(a),isSelected:r,textColor:o,iconPath:n,pagePath:e.pagePath,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};
2
2
  //# sourceMappingURL=taro-tabbar.entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["splitUrl","_url","url","pos","res","path","query","fragment","indexOf","substring","addLeadingSlash","charAt","hasBasename","prefix","RegExp","test","stripBasename","length","stripSuffix","suffix","includes","isAbsolute","pathname","spliceOne","list","index","i","k","n","pop","resolvePathname","to","from","undefined","toParts","split","fromParts","isToAbs","isFromAbs","mustEndAbs","concat","hasTrailingSlash","last","up","part","unshift","result","join","substr","TabbarItem","_b","_c","isSelected","textColor","iconPath","badgeText","_d","showRedDot","pagePath","text","onSelect","className","classNames","badgeStyle","position","top","right","dotStyle","onClick","page","Taro","getCurrentPages","shift","onTabItemTap","isVisible","this","h","key","href","class","style","display","src","alt","color","indexCss","STATUS_SHOW","STATUS_HIDE","STATUS_SLIDEOUT","basicTabBarClassName","hideTabBarClassName","hideTabBarWithAnimationClassName","Tabbar","hostRef","_this","homePage","customRoutes","tabbarPos","getOriginUrl","customRoute","filter","customUrl","pathA","pathB","getSelectedIndex","foundIndex","forEach","idx","switchTab","selectedIndex","switchTabHandler","successHandler","errorHandler","currentUrl","getCurrentUrl","nextTab","errMsg","routerChangeHandler","options","_a","toLocation","currentPage","routerBasename","conf","basename","setTabBarBadgeHandler","__spreadArray","removeTabBarBadgeHandler","showTabBarRedDotHandler","hideTabBarRedDotHandler","showTabBarHandler","status","hideTabBarHandler","animation","setTabBarStyleHandler","selectedColor","backgroundColor","borderStyle","setTabBarItemHandler","selectedIconPath","Object","prototype","toString","call","Error","this_1","push","apply","map","p","item","routerMode","mode","window","location","hashIndex","processedUrl","decodeURI","bindEvent","eventCenter","on","removeEvent","off","componentDidLoad","tabbar","nextElementSibling","disconnectedCallback","render","containerCls","shouldHideTabBar","shouldSlideout","Host","height","bind"],"sources":["src/utils/url.ts","../taro-router/dist/utils/index.js","../../node_modules/.pnpm/registry.npmjs.org+resolve-pathname@3.0.0/node_modules/resolve-pathname/esm/resolve-pathname.js","src/components/tabbar/tabbar-item.tsx","src/components/tabbar/style/index.scss?tag=taro-tabbar","src/components/tabbar/tabbar.tsx"],"sourcesContent":["export const normalizePath = url => {\n let _isRelative\n let _leadingParents = ''\n let _parent, _pos\n\n // handle relative paths\n if (url.charAt(0) !== '/') {\n _isRelative = true\n url = '/' + url\n }\n\n // handle relative files (as opposed to directories)\n if (url.substring(-3) === '/..' || url.slice(-2) === '/.') {\n url += '/'\n }\n\n // resolve simples\n url = url.replace(/(\\/(\\.\\/)+)|(\\/\\.$)/g, '/').replace(/\\/{2,}/g, '/')\n\n // remember leading parents\n if (_isRelative) {\n _leadingParents = url.substring(1).match(/^(\\.\\.\\/)+/) || ''\n if (_leadingParents) {\n _leadingParents = _leadingParents[0]\n }\n }\n\n // resolve parents\n while (true) {\n _parent = url.search(/\\/\\.\\.(\\/|$)/)\n if (_parent === -1) {\n // no more ../ to resolve\n break\n } else if (_parent === 0) {\n // top level cannot be relative, skip it\n url = url.substring(3)\n continue\n }\n\n _pos = url.substring(0, _parent).lastIndexOf('/')\n if (_pos === -1) {\n _pos = _parent\n }\n url = url.substring(0, _pos) + url.substring(_parent + 3)\n }\n\n // revert to relative\n if (_isRelative) {\n url = _leadingParents + url.substring(1)\n }\n\n return url\n}\n\nexport const splitUrl = _url => {\n let url = _url || ''\n let pos\n const res = {\n path: null,\n query: null,\n fragment: null\n }\n\n pos = url.indexOf('#')\n if (pos > -1) {\n res.fragment = url.substring(pos + 1)\n url = url.substring(0, pos)\n }\n\n pos = url.indexOf('?')\n if (pos > -1) {\n res.query = url.substring(pos + 1)\n url = url.substring(0, pos)\n }\n\n res.path = url\n\n return res\n}\n","// export const removeLeadingSlash = (str = '') => str.replace(/^\\.?\\//, '')\n// export const removeTrailingSearch = (str = '') => str.replace(/\\?[\\s\\S]*$/, '')\nexport const addLeadingSlash = (url = '') => (url.charAt(0) === '/' ? url : '/' + url);\nexport const hasBasename = (path = '', prefix = '') => new RegExp('^' + prefix + '(\\\\/|\\\\?|#|$)', 'i').test(path) || path === prefix;\nexport const stripBasename = (path = '', prefix = '') => hasBasename(path, prefix) ? path.substring(prefix.length) : path;\nexport const stripTrailing = (str = '') => str.replace(/[?#][\\s\\S]*$/, '');\nexport const stripSuffix = (path = '', suffix = '') => path.includes(suffix) ? path.substring(0, path.length - suffix.length) : path;\nexport const getHomePage = (path = '', basename = '', customRoutes = {}, entryPagePath = '') => {\n var _a;\n const routePath = addLeadingSlash(stripBasename(path, basename));\n const alias = ((_a = Object.entries(customRoutes).find(([key]) => key === routePath)) === null || _a === void 0 ? void 0 : _a[1]) || routePath;\n return entryPagePath || (typeof alias === 'string' ? alias : alias[0]) || basename;\n};\nclass RoutesAlias {\n constructor() {\n this.conf = [];\n this.getConfig = (url = '') => {\n const customRoute = this.conf.filter((arr) => {\n return arr.includes(url);\n });\n return customRoute[0];\n };\n this.getOrigin = (url = '') => {\n var _a;\n return ((_a = this.getConfig(url)) === null || _a === void 0 ? void 0 : _a[0]) || url;\n };\n this.getAlias = (url = '') => {\n var _a;\n return ((_a = this.getConfig(url)) === null || _a === void 0 ? void 0 : _a[1]) || url;\n };\n this.getAll = (url = '') => {\n return this.conf\n .filter((arr) => arr.includes(url))\n .reduceRight((p, a) => {\n p.unshift(a[1]);\n return p;\n }, []);\n };\n }\n set(customRoutes = {}) {\n for (let key in customRoutes) {\n const path = customRoutes[key];\n key = addLeadingSlash(key);\n if (typeof path === 'string') {\n this.conf.push([key, addLeadingSlash(path)]);\n }\n else if ((path === null || path === void 0 ? void 0 : path.length) > 0) {\n this.conf.push(...path.map(p => [key, addLeadingSlash(p)]));\n }\n }\n }\n}\nexport const routesAlias = new RoutesAlias();\n","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;\n","import classNames from 'classnames'\nimport { FunctionalComponent, h } from '@stencil/core'\nimport Taro from '@tarojs/taro'\n\nimport { isVisible } from '../../utils'\n\ntype TabbarItemProps = {\n index: number\n isSelected?: boolean\n textColor?: string\n badgeText?: string\n iconPath: string\n showRedDot?: boolean\n pagePath?: string\n text?: string\n onSelect: (index: number) => void\n}\n\nexport const TabbarItem: FunctionalComponent<TabbarItemProps> = ({\n index,\n isSelected = false,\n textColor,\n iconPath,\n badgeText,\n showRedDot = false,\n pagePath,\n text,\n onSelect\n}) => {\n const className = classNames('weui-tabbar__item', {\n 'weui-bar__item_on': isSelected\n })\n const badgeStyle = {\n position: 'absolute',\n top: '-2px',\n right: '-13px'\n }\n const dotStyle = {\n position: 'absolute',\n top: '0',\n right: '-6px'\n }\n\n function onClick () {\n const page = Taro.getCurrentPages().shift()\n if (typeof page?.onTabItemTap === 'function' && isVisible(this)) {\n page.onTabItemTap({ index, pagePath, text })\n }\n onSelect(index)\n }\n\n return (\n <a key={index} href='javascript:;' class={className} onClick={onClick}>\n <span style={{ display: 'inline-block', position: 'relative' }}>\n <img src={iconPath} alt='' class='weui-tabbar__icon' />\n {!!badgeText && (\n <span\n class='weui-badge taro-tabbar-badge'\n style={badgeStyle}>\n {badgeText}\n </span>\n )}\n {showRedDot && (\n <span\n class='weui-badge weui-badge_dot'\n style={dotStyle}\n />\n )}\n </span>\n <p class='weui-tabbar__label' style={{ color: textColor }}>\n {text}\n </p>\n </a>\n )\n}\n","html,\nbody {\n height: 100%;\n}\n\n#app {\n height: 100%;\n}\n\n.taro-tabbar {\n &__border {\n &-white {\n &::before {\n border-top-color: #fff !important;\n }\n }\n }\n\n &__container {\n display: flex;\n overflow: hidden;\n flex-direction: column;\n height: 100%;\n }\n\n &__panel {\n overflow: auto;\n position: relative;\n flex: 1;\n -webkit-overflow-scrolling: auto;\n }\n\n &__tabbar {\n position: relative;\n width: 100%;\n height: 50px;\n transition: bottom 0.2s, top 0.2s;\n\n &-top {\n top: 0;\n }\n\n &-bottom {\n bottom: 0;\n margin-bottom: constant(safe-area-inset-bottom);\n margin-bottom: env(safe-area-inset-bottom);\n }\n\n &-hide {\n display: none;\n }\n\n &-slideout {\n top: -52px;\n flex: 0 0;\n }\n }\n\n &__panel + &__tabbar-slideout {\n top: auto;\n bottom: -52px;\n }\n}\n","import { Component, Prop, h, ComponentInterface, Host, State, Event, EventEmitter, Element } from '@stencil/core'\nimport Taro from '@tarojs/taro'\nimport { addLeadingSlash, stripBasename, stripSuffix } from '@tarojs/router/dist/utils'\nimport { IH5RouterConfig } from '@tarojs/taro/types/compile'\nimport classNames from 'classnames'\nimport resolvePathname from 'resolve-pathname'\n\nimport { splitUrl } from '../../utils'\nimport { TabbarItem } from './tabbar-item'\n\nconst STATUS_SHOW = 0\nconst STATUS_HIDE = 1\nconst STATUS_SLIDEOUT = 2\n\nconst basicTabBarClassName = 'taro-tabbar__tabbar'\nconst hideTabBarClassName = 'taro-tabbar__tabbar-hide'\nconst hideTabBarWithAnimationClassName = 'taro-tabbar__tabbar-slideout'\n\ninterface RouterHandler {\n index: string\n text: string\n url: string\n successHandler: Function\n errorHandler: Function\n animation?: boolean\n}\n\nexport interface Conf {\n color: string\n selectedColor: string\n backgroundColor: string\n borderStyle?: 'black' | 'white'\n list: TabbarList[]\n position?: 'bottom' | 'top'\n custom: boolean\n customRoutes: Record<string, string | string[]>\n mode: IH5RouterConfig['mode']\n basename: string\n homePage: string\n currentPagename: string\n}\n\ninterface TabbarList {\n pagePath: string\n text: string\n iconPath?: string\n selectedIconPath?: string\n badgeText?: string\n showRedDot?: boolean\n}\n\n@Component({\n tag: 'taro-tabbar',\n styleUrl: './style/index.scss'\n})\nexport class Tabbar implements ComponentInterface {\n private homePage = ''\n\n private customRoutes: Array<string[]> = []\n\n private tabbarPos: 'top' | 'bottom' = 'bottom'\n\n @Prop() conf: Conf\n\n @State() list: TabbarList[]\n\n @State() borderStyle: Conf['borderStyle']\n\n @State() backgroundColor: Conf['backgroundColor']\n\n @State() color: Conf['color']\n\n @State() selectedColor: Conf['selectedColor']\n\n @State() selectedIndex = -1\n\n @State() status: 0 | 1 | 2 = STATUS_SHOW\n\n @Event({\n eventName: 'longpress'\n }) onLongPress: EventEmitter\n\n @Element() tabbar: HTMLDivElement\n\n constructor () {\n const list = this.conf.list\n const customRoutes = this.conf.customRoutes\n if (\n Object.prototype.toString.call(list) !== '[object Array]' ||\n list.length < 2 ||\n list.length > 5\n ) {\n throw new Error('tabBar 配置错误')\n }\n\n this.homePage = addLeadingSlash(this.conf.homePage)\n for (let key in customRoutes) {\n const path = customRoutes[key]\n key = addLeadingSlash(key)\n if (typeof path === 'string') {\n this.customRoutes.push([key, addLeadingSlash(path)])\n } else if (path?.length > 0) {\n this.customRoutes.push(...path.map(p => [key, addLeadingSlash(p)]))\n }\n }\n\n list.forEach(item => {\n if (item.pagePath.indexOf('/') !== 0) {\n item.pagePath = '/' + item.pagePath\n }\n })\n\n this.list = list\n this.borderStyle = this.conf.borderStyle\n this.backgroundColor = this.conf.backgroundColor\n this.color = this.conf.color\n this.selectedColor = this.conf.selectedColor\n }\n\n getCurrentUrl () {\n const routerMode = this.conf.mode\n const routerBasename = this.conf.basename || '/'\n let url\n if (routerMode === 'hash') {\n const href = window.location.href\n const hashIndex = href.indexOf('#')\n url = hashIndex === -1\n ? ''\n : href.substring(hashIndex + 1)\n } else {\n url = location.pathname\n }\n const processedUrl = addLeadingSlash(stripBasename(url, routerBasename))\n return decodeURI(processedUrl === '/' ? this.homePage : processedUrl)\n }\n\n getOriginUrl = (url: string) => {\n const customRoute = this.customRoutes.filter(([, customUrl]) => {\n const pathA = splitUrl(customUrl).path\n const pathB = splitUrl(url).path\n return pathA === pathB\n })\n return stripSuffix(customRoute.length ? customRoute[0][0] : url, '.html')\n }\n\n getSelectedIndex = (url: string) => {\n let foundIndex = -1\n this.list.forEach(({ pagePath }, idx) => {\n const pathA = splitUrl(url).path\n const pathB = splitUrl(pagePath).path\n if (pathA === pathB) {\n foundIndex = idx\n }\n })\n return foundIndex\n }\n\n switchTab = (index: number) => {\n this.selectedIndex = index\n Taro.switchTab({\n url: this.list[index].pagePath\n })\n }\n\n switchTabHandler = ({ url, successHandler, errorHandler }: RouterHandler) => {\n const currentUrl = this.getOriginUrl(this.getCurrentUrl() || this.homePage)\n const nextTab = resolvePathname(url, currentUrl)\n const foundIndex = this.getSelectedIndex(nextTab)\n\n if (foundIndex > -1) {\n this.switchTab(foundIndex)\n successHandler({\n errMsg: 'switchTab:ok'\n })\n } else {\n errorHandler({\n errMsg: `switchTab:fail page \"${nextTab}\" is not found`\n })\n }\n }\n\n routerChangeHandler = (options?) => {\n const to = options?.toLocation?.path\n let currentPage\n\n if (typeof to === 'string') {\n const routerBasename = this.conf.basename || '/'\n currentPage = stripBasename(addLeadingSlash(to || this.homePage), routerBasename) || '/'\n } else {\n currentPage = this.getCurrentUrl()\n }\n\n this.selectedIndex = this.getSelectedIndex(this.getOriginUrl(currentPage))\n }\n\n setTabBarBadgeHandler = ({ index, text, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].showRedDot = false\n list[index].badgeText = text\n successHandler({\n errMsg: 'setTabBarBadge:ok'\n })\n } else {\n errorHandler({\n errMsg: 'setTabBarBadge:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n removeTabBarBadgeHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].badgeText = null\n list[index].badgeText = null\n successHandler({\n errMsg: 'removeTabBarBadge:ok'\n })\n } else {\n errorHandler({\n errMsg: 'removeTabBarBadge:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n showTabBarRedDotHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].badgeText = null\n list[index].showRedDot = true\n successHandler({\n errMsg: 'showTabBarRedDot:ok'\n })\n } else {\n errorHandler({\n errMsg: 'showTabBarRedDot:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n hideTabBarRedDotHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].showRedDot = false\n successHandler({\n errMsg: 'hideTabBarRedDot:ok'\n })\n } else {\n errorHandler({\n errMsg: 'hideTabBarRedDot:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n showTabBarHandler = ({ successHandler }) => {\n this.status = STATUS_SHOW\n successHandler({\n errMsg: 'showTabBar:ok'\n })\n }\n\n hideTabBarHandler = ({ animation, successHandler }) => {\n this.status = animation ? STATUS_SLIDEOUT : STATUS_HIDE\n successHandler({\n errMsg: 'hideTabBar:ok'\n })\n }\n\n setTabBarStyleHandler = ({ color, selectedColor, backgroundColor, borderStyle, successHandler }) => {\n if (backgroundColor) this.backgroundColor = backgroundColor\n if (borderStyle) this.borderStyle = borderStyle\n if (color) this.color = color\n if (selectedColor) this.selectedColor = selectedColor\n successHandler({\n errMsg: 'setTabBarStyle:ok'\n })\n }\n\n setTabBarItemHandler = ({ index, iconPath, selectedIconPath, text, successHandler, errorHandler }) => {\n const list = [...this.list]\n if (index in list) {\n if (iconPath) list[index].iconPath = iconPath\n if (selectedIconPath) list[index].selectedIconPath = selectedIconPath\n if (text) list[index].text = text\n successHandler({\n errMsg: 'setTabBarItem:ok'\n })\n } else {\n errorHandler({\n errMsg: 'setTabBarItem:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n bindEvent () {\n Taro.eventCenter.on('__taroRouterChange', this.routerChangeHandler)\n Taro.eventCenter.on('__taroSwitchTab', this.switchTabHandler)\n Taro.eventCenter.on('__taroSetTabBarBadge', this.setTabBarBadgeHandler)\n Taro.eventCenter.on('__taroRemoveTabBarBadge', this.removeTabBarBadgeHandler)\n Taro.eventCenter.on('__taroShowTabBarRedDotHandler', this.showTabBarRedDotHandler)\n Taro.eventCenter.on('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler)\n Taro.eventCenter.on('__taroShowTabBar', this.showTabBarHandler)\n Taro.eventCenter.on('__taroHideTabBar', this.hideTabBarHandler)\n Taro.eventCenter.on('__taroSetTabBarStyle', this.setTabBarStyleHandler)\n Taro.eventCenter.on('__taroSetTabBarItem', this.setTabBarItemHandler)\n }\n\n removeEvent () {\n Taro.eventCenter.off('__taroRouterChange', this.routerChangeHandler)\n Taro.eventCenter.off('__taroSwitchTab', this.switchTabHandler)\n Taro.eventCenter.off('__taroSetTabBarBadge', this.setTabBarBadgeHandler)\n Taro.eventCenter.off('__taroRemoveTabBarBadge', this.removeTabBarBadgeHandler)\n Taro.eventCenter.off('__taroShowTabBarRedDotHandler', this.showTabBarRedDotHandler)\n Taro.eventCenter.off('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler)\n Taro.eventCenter.off('__taroShowTabBar', this.showTabBarHandler)\n Taro.eventCenter.off('__taroHideTabBar', this.hideTabBarHandler)\n Taro.eventCenter.off('__taroSetTabBarStyle', this.setTabBarStyleHandler)\n Taro.eventCenter.off('__taroSetTabBarItem', this.setTabBarItemHandler)\n }\n\n componentDidLoad () {\n this.tabbarPos = this.tabbar.nextElementSibling ? 'top' : 'bottom'\n this.bindEvent()\n this.routerChangeHandler()\n }\n\n disconnectedCallback () {\n this.removeEvent()\n }\n\n render () {\n const { tabbarPos = 'bottom' } = this\n const status = this.status\n const containerCls = classNames('weui-tabbar', {\n [`taro-tabbar__border-${this.borderStyle || 'black'}`]: true\n })\n const shouldHideTabBar = this.selectedIndex === -1 || status === STATUS_HIDE\n const shouldSlideout = status === STATUS_SLIDEOUT\n\n return (\n <Host\n class={classNames(\n basicTabBarClassName,\n `${basicTabBarClassName}-${tabbarPos}`, {\n [hideTabBarClassName]: shouldHideTabBar,\n [hideTabBarWithAnimationClassName]: shouldSlideout\n })} >\n <div\n class={containerCls}\n style={{\n backgroundColor: this.backgroundColor || '',\n height: 'inherit'\n }}\n >\n {this.list.map((item, index) => {\n const isSelected = this.selectedIndex === index\n let textColor\n let iconPath\n if (isSelected) {\n textColor = this.selectedColor || ''\n iconPath = item.selectedIconPath\n } else {\n textColor = this.color || ''\n iconPath = item.iconPath\n }\n return (\n <TabbarItem\n index={index}\n onSelect={this.switchTab.bind(this)}\n isSelected={isSelected}\n textColor={textColor}\n iconPath={iconPath}\n pagePath={item.pagePath}\n text={item.text}\n badgeText={item.badgeText}\n showRedDot={item.showRedDot}\n />\n )\n })}\n </div>\n </Host>\n )\n }\n}\n"],"mappings":"sdAsDO,IAAMA,SAAW,SAAAC,GACtB,IAAIC,EAAMD,GAAQ,GAClB,IAAIE,EACJ,IAAMC,EAAM,CACVC,KAAM,KACNC,MAAO,KACPC,SAAU,MAGZJ,EAAMD,EAAIM,QAAQ,KAClB,GAAIL,GAAO,EAAG,CACZC,EAAIG,SAAWL,EAAIO,UAAUN,EAAM,GACnCD,EAAMA,EAAIO,UAAU,EAAGN,E,CAGzBA,EAAMD,EAAIM,QAAQ,KAClB,GAAIL,GAAO,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EACVI,SAAU4F,EAAK5F,SACfC,KAAM2F,EAAK3F,KACXJ,UAAW+F,EAAK/F,UAChBE,WAAY6F,EAAK7F,Y,yIA1Ud,G"}
1
+ {"version":3,"names":["splitUrl","_url","url","pos","res","path","query","fragment","indexOf","substring","addLeadingSlash","charAt","hasBasename","prefix","RegExp","test","stripBasename","length","stripSuffix","suffix","includes","getCurrentPage","routerMode","basename","pagePath","location","hash","slice","split","pathname","isAbsolute","spliceOne","list","index","i","k","n","pop","resolvePathname","to","from","undefined","toParts","fromParts","isToAbs","isFromAbs","mustEndAbs","concat","hasTrailingSlash","last","up","part","unshift","result","join","substr","TabbarItem","_b","_c","isSelected","textColor","iconPath","badgeText","_d","showRedDot","text","onSelect","className","classNames","badgeStyle","position","top","right","dotStyle","onClick","page","Taro","getCurrentPages","shift","onTabItemTap","isVisible","this","h","key","href","class","style","display","src","alt","color","indexCss","STATUS_SHOW","STATUS_HIDE","STATUS_SLIDEOUT","basicTabBarClassName","hideTabBarClassName","hideTabBarWithAnimationClassName","Tabbar","hostRef","_this","homePage","customRoutes","tabbarPos","getOriginUrl","customRoute","filter","customUrl","pathA","pathB","getSelectedIndex","foundIndex","forEach","idx","switchTab","selectedIndex","switchTabHandler","successHandler","errorHandler","currentUrl","getCurrentUrl","nextTab","errMsg","routerChangeHandler","options","_a","toLocation","currentPage","routerBasename","conf","setTabBarBadgeHandler","__spreadArray","removeTabBarBadgeHandler","showTabBarRedDotHandler","hideTabBarRedDotHandler","showTabBarHandler","status","hideTabBarHandler","animation","setTabBarStyleHandler","selectedColor","backgroundColor","borderStyle","setTabBarItemHandler","selectedIconPath","Object","prototype","toString","call","Error","this_1","push","apply","map","p","item","routePath","mode","decodeURI","bindEvent","eventCenter","on","removeEvent","off","componentDidLoad","tabbar","nextElementSibling","disconnectedCallback","render","containerCls","shouldHideTabBar","shouldSlideout","Host","height","bind"],"sources":["src/utils/url.ts","../taro-router/dist/utils/index.js","../../node_modules/.pnpm/registry.npmjs.org+resolve-pathname@3.0.0/node_modules/resolve-pathname/esm/resolve-pathname.js","src/components/tabbar/tabbar-item.tsx","src/components/tabbar/style/index.scss?tag=taro-tabbar","src/components/tabbar/tabbar.tsx"],"sourcesContent":["export const normalizePath = url => {\n let _isRelative\n let _leadingParents = ''\n let _parent, _pos\n\n // handle relative paths\n if (url.charAt(0) !== '/') {\n _isRelative = true\n url = '/' + url\n }\n\n // handle relative files (as opposed to directories)\n if (url.substring(-3) === '/..' || url.slice(-2) === '/.') {\n url += '/'\n }\n\n // resolve simples\n url = url.replace(/(\\/(\\.\\/)+)|(\\/\\.$)/g, '/').replace(/\\/{2,}/g, '/')\n\n // remember leading parents\n if (_isRelative) {\n _leadingParents = url.substring(1).match(/^(\\.\\.\\/)+/) || ''\n if (_leadingParents) {\n _leadingParents = _leadingParents[0]\n }\n }\n\n // resolve parents\n while (true) {\n _parent = url.search(/\\/\\.\\.(\\/|$)/)\n if (_parent === -1) {\n // no more ../ to resolve\n break\n } else if (_parent === 0) {\n // top level cannot be relative, skip it\n url = url.substring(3)\n continue\n }\n\n _pos = url.substring(0, _parent).lastIndexOf('/')\n if (_pos === -1) {\n _pos = _parent\n }\n url = url.substring(0, _pos) + url.substring(_parent + 3)\n }\n\n // revert to relative\n if (_isRelative) {\n url = _leadingParents + url.substring(1)\n }\n\n return url\n}\n\nexport const splitUrl = _url => {\n let url = _url || ''\n let pos\n const res = {\n path: null,\n query: null,\n fragment: null\n }\n\n pos = url.indexOf('#')\n if (pos > -1) {\n res.fragment = url.substring(pos + 1)\n url = url.substring(0, pos)\n }\n\n pos = url.indexOf('?')\n if (pos > -1) {\n res.query = url.substring(pos + 1)\n url = url.substring(0, pos)\n }\n\n res.path = url\n\n return res\n}\n","// export const removeLeadingSlash = (str = '') => str.replace(/^\\.?\\//, '')\n// export const removeTrailingSearch = (str = '') => str.replace(/\\?[\\s\\S]*$/, '')\nexport const addLeadingSlash = (url = '') => (url.charAt(0) === '/' ? url : '/' + url);\nexport const hasBasename = (path = '', prefix = '') => new RegExp('^' + prefix + '(\\\\/|\\\\?|#|$)', 'i').test(path) || path === prefix;\nexport const stripBasename = (path = '', prefix = '') => hasBasename(path, prefix) ? path.substring(prefix.length) : path;\nexport const stripTrailing = (str = '') => str.replace(/[?#][\\s\\S]*$/, '');\nexport const stripSuffix = (path = '', suffix = '') => path.includes(suffix) ? path.substring(0, path.length - suffix.length) : path;\nexport const getHomePage = (path = '', basename = '', customRoutes = {}, entryPagePath = '') => {\n var _a;\n const routePath = addLeadingSlash(stripBasename(path, basename));\n const alias = ((_a = Object.entries(customRoutes).find(([key]) => key === routePath)) === null || _a === void 0 ? void 0 : _a[1]) || routePath;\n return entryPagePath || (typeof alias === 'string' ? alias : alias[0]) || basename;\n};\nexport const getCurrentPage = (routerMode = 'hash', basename = '/') => {\n const pagePath = routerMode === 'hash'\n ? location.hash.slice(1).split('?')[0]\n : location.pathname;\n return addLeadingSlash(stripBasename(pagePath, basename));\n};\nclass RoutesAlias {\n constructor() {\n this.conf = [];\n this.getConfig = (url = '') => {\n const customRoute = this.conf.filter((arr) => {\n return arr.includes(url);\n });\n return customRoute[0];\n };\n this.getOrigin = (url = '') => {\n var _a;\n return ((_a = this.getConfig(url)) === null || _a === void 0 ? void 0 : _a[0]) || url;\n };\n this.getAlias = (url = '') => {\n var _a;\n return ((_a = this.getConfig(url)) === null || _a === void 0 ? void 0 : _a[1]) || url;\n };\n this.getAll = (url = '') => {\n return this.conf\n .filter((arr) => arr.includes(url))\n .reduceRight((p, a) => {\n p.unshift(a[1]);\n return p;\n }, []);\n };\n }\n set(customRoutes = {}) {\n for (let key in customRoutes) {\n const path = customRoutes[key];\n key = addLeadingSlash(key);\n if (typeof path === 'string') {\n this.conf.push([key, addLeadingSlash(path)]);\n }\n else if ((path === null || path === void 0 ? void 0 : path.length) > 0) {\n this.conf.push(...path.map(p => [key, addLeadingSlash(p)]));\n }\n }\n }\n}\nexport const routesAlias = new RoutesAlias();\n","function isAbsolute(pathname) {\n return pathname.charAt(0) === '/';\n}\n\n// About 1.5x faster than the two-arg version of Array#splice()\nfunction spliceOne(list, index) {\n for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) {\n list[i] = list[k];\n }\n\n list.pop();\n}\n\n// This implementation is based heavily on node's url.parse\nfunction resolvePathname(to, from) {\n if (from === undefined) from = '';\n\n var toParts = (to && to.split('/')) || [];\n var fromParts = (from && from.split('/')) || [];\n\n var isToAbs = to && isAbsolute(to);\n var isFromAbs = from && isAbsolute(from);\n var mustEndAbs = isToAbs || isFromAbs;\n\n if (to && isAbsolute(to)) {\n // to is absolute\n fromParts = toParts;\n } else if (toParts.length) {\n // to is relative, drop the filename\n fromParts.pop();\n fromParts = fromParts.concat(toParts);\n }\n\n if (!fromParts.length) return '/';\n\n var hasTrailingSlash;\n if (fromParts.length) {\n var last = fromParts[fromParts.length - 1];\n hasTrailingSlash = last === '.' || last === '..' || last === '';\n } else {\n hasTrailingSlash = false;\n }\n\n var up = 0;\n for (var i = fromParts.length; i >= 0; i--) {\n var part = fromParts[i];\n\n if (part === '.') {\n spliceOne(fromParts, i);\n } else if (part === '..') {\n spliceOne(fromParts, i);\n up++;\n } else if (up) {\n spliceOne(fromParts, i);\n up--;\n }\n }\n\n if (!mustEndAbs) for (; up--; up) fromParts.unshift('..');\n\n if (\n mustEndAbs &&\n fromParts[0] !== '' &&\n (!fromParts[0] || !isAbsolute(fromParts[0]))\n )\n fromParts.unshift('');\n\n var result = fromParts.join('/');\n\n if (hasTrailingSlash && result.substr(-1) !== '/') result += '/';\n\n return result;\n}\n\nexport default resolvePathname;\n","import classNames from 'classnames'\nimport { FunctionalComponent, h } from '@stencil/core'\nimport Taro from '@tarojs/taro'\n\nimport { isVisible } from '../../utils'\n\ntype TabbarItemProps = {\n index: number\n isSelected?: boolean\n textColor?: string\n badgeText?: string\n iconPath: string\n showRedDot?: boolean\n pagePath?: string\n text?: string\n onSelect: (index: number) => void\n}\n\nexport const TabbarItem: FunctionalComponent<TabbarItemProps> = ({\n index,\n isSelected = false,\n textColor,\n iconPath,\n badgeText,\n showRedDot = false,\n pagePath,\n text,\n onSelect\n}) => {\n const className = classNames('weui-tabbar__item', {\n 'weui-bar__item_on': isSelected\n })\n const badgeStyle = {\n position: 'absolute',\n top: '-2px',\n right: '-13px'\n }\n const dotStyle = {\n position: 'absolute',\n top: '0',\n right: '-6px'\n }\n\n function onClick () {\n const page = Taro.getCurrentPages().shift()\n if (typeof page?.onTabItemTap === 'function' && isVisible(this)) {\n page.onTabItemTap({ index, pagePath, text })\n }\n onSelect(index)\n }\n\n return (\n <a key={index} href='javascript:;' class={className} onClick={onClick}>\n <span style={{ display: 'inline-block', position: 'relative' }}>\n <img src={iconPath} alt='' class='weui-tabbar__icon' />\n {!!badgeText && (\n <span\n class='weui-badge taro-tabbar-badge'\n style={badgeStyle}>\n {badgeText}\n </span>\n )}\n {showRedDot && (\n <span\n class='weui-badge weui-badge_dot'\n style={dotStyle}\n />\n )}\n </span>\n <p class='weui-tabbar__label' style={{ color: textColor }}>\n {text}\n </p>\n </a>\n )\n}\n","html,\nbody {\n height: 100%;\n}\n\n#app {\n height: 100%;\n}\n\n.taro-tabbar {\n &__border {\n &-white {\n &::before {\n border-top-color: #fff !important;\n }\n }\n }\n\n &__container {\n display: flex;\n overflow: hidden;\n flex-direction: column;\n height: 100%;\n }\n\n &__panel {\n overflow: auto;\n position: relative;\n flex: 1;\n -webkit-overflow-scrolling: auto;\n }\n\n &__tabbar {\n position: relative;\n width: 100%;\n height: 50px;\n transition: bottom 0.2s, top 0.2s;\n\n &-top {\n top: 0;\n }\n\n &-bottom {\n bottom: 0;\n margin-bottom: constant(safe-area-inset-bottom);\n margin-bottom: env(safe-area-inset-bottom);\n }\n\n &-hide {\n display: none;\n }\n\n &-slideout {\n top: -52px;\n flex: 0 0;\n }\n }\n\n &__panel + &__tabbar-slideout {\n top: auto;\n bottom: -52px;\n }\n}\n","import { Component, Prop, h, ComponentInterface, Host, State, Event, EventEmitter, Element } from '@stencil/core'\nimport Taro from '@tarojs/taro'\nimport { addLeadingSlash, getCurrentPage, stripBasename, stripSuffix } from '@tarojs/router/dist/utils'\nimport { IH5RouterConfig } from '@tarojs/taro/types/compile'\nimport classNames from 'classnames'\nimport resolvePathname from 'resolve-pathname'\n\nimport { splitUrl } from '../../utils'\nimport { TabbarItem } from './tabbar-item'\n\nconst STATUS_SHOW = 0\nconst STATUS_HIDE = 1\nconst STATUS_SLIDEOUT = 2\n\nconst basicTabBarClassName = 'taro-tabbar__tabbar'\nconst hideTabBarClassName = 'taro-tabbar__tabbar-hide'\nconst hideTabBarWithAnimationClassName = 'taro-tabbar__tabbar-slideout'\n\ninterface RouterHandler {\n index: string\n text: string\n url: string\n successHandler: Function\n errorHandler: Function\n animation?: boolean\n}\n\nexport interface Conf {\n color: string\n selectedColor: string\n backgroundColor: string\n borderStyle?: 'black' | 'white'\n list: TabbarList[]\n position?: 'bottom' | 'top'\n custom: boolean\n customRoutes: Record<string, string | string[]>\n mode: IH5RouterConfig['mode']\n basename: string\n homePage: string\n currentPagename: string\n}\n\ninterface TabbarList {\n pagePath: string\n text: string\n iconPath?: string\n selectedIconPath?: string\n badgeText?: string\n showRedDot?: boolean\n}\n\n@Component({\n tag: 'taro-tabbar',\n styleUrl: './style/index.scss'\n})\nexport class Tabbar implements ComponentInterface {\n private homePage = ''\n\n private customRoutes: Array<string[]> = []\n\n private tabbarPos: 'top' | 'bottom' = 'bottom'\n\n @Prop() conf: Conf\n\n @State() list: TabbarList[]\n\n @State() borderStyle: Conf['borderStyle']\n\n @State() backgroundColor: Conf['backgroundColor']\n\n @State() color: Conf['color']\n\n @State() selectedColor: Conf['selectedColor']\n\n @State() selectedIndex = -1\n\n @State() status: 0 | 1 | 2 = STATUS_SHOW\n\n @Event({\n eventName: 'longpress'\n }) onLongPress: EventEmitter\n\n @Element() tabbar: HTMLDivElement\n\n constructor () {\n const list = this.conf.list\n const customRoutes = this.conf.customRoutes\n if (\n Object.prototype.toString.call(list) !== '[object Array]' ||\n list.length < 2 ||\n list.length > 5\n ) {\n throw new Error('tabBar 配置错误')\n }\n\n this.homePage = addLeadingSlash(this.conf.homePage)\n for (let key in customRoutes) {\n const path = customRoutes[key]\n key = addLeadingSlash(key)\n if (typeof path === 'string') {\n this.customRoutes.push([key, addLeadingSlash(path)])\n } else if (path?.length > 0) {\n this.customRoutes.push(...path.map(p => [key, addLeadingSlash(p)]))\n }\n }\n\n list.forEach(item => {\n if (item.pagePath.indexOf('/') !== 0) {\n item.pagePath = '/' + item.pagePath\n }\n })\n\n this.list = list\n this.borderStyle = this.conf.borderStyle\n this.backgroundColor = this.conf.backgroundColor\n this.color = this.conf.color\n this.selectedColor = this.conf.selectedColor\n }\n\n getCurrentUrl () {\n const routePath = getCurrentPage(this.conf.mode, this.conf.basename)\n return decodeURI(routePath === '/' ? this.homePage : routePath)\n }\n\n getOriginUrl = (url: string) => {\n const customRoute = this.customRoutes.filter(([, customUrl]) => {\n const pathA = splitUrl(customUrl).path\n const pathB = splitUrl(url).path\n return pathA === pathB\n })\n return stripSuffix(customRoute.length ? customRoute[0][0] : url, '.html')\n }\n\n getSelectedIndex = (url: string) => {\n let foundIndex = -1\n this.list.forEach(({ pagePath }, idx) => {\n const pathA = splitUrl(url).path\n const pathB = splitUrl(pagePath).path\n if (pathA === pathB) {\n foundIndex = idx\n }\n })\n return foundIndex\n }\n\n switchTab = (index: number) => {\n this.selectedIndex = index\n Taro.switchTab({\n url: this.list[index].pagePath\n })\n }\n\n switchTabHandler = ({ url, successHandler, errorHandler }: RouterHandler) => {\n const currentUrl = this.getOriginUrl(this.getCurrentUrl() || this.homePage)\n const nextTab = resolvePathname(url, currentUrl)\n const foundIndex = this.getSelectedIndex(nextTab)\n\n if (foundIndex > -1) {\n this.switchTab(foundIndex)\n successHandler({\n errMsg: 'switchTab:ok'\n })\n } else {\n errorHandler({\n errMsg: `switchTab:fail page \"${nextTab}\" is not found`\n })\n }\n }\n\n routerChangeHandler = (options?) => {\n const to = options?.toLocation?.path\n let currentPage\n\n if (typeof to === 'string') {\n const routerBasename = this.conf.basename || '/'\n currentPage = stripBasename(addLeadingSlash(to || this.homePage), routerBasename) || '/'\n } else {\n currentPage = this.getCurrentUrl()\n }\n\n this.selectedIndex = this.getSelectedIndex(this.getOriginUrl(currentPage))\n }\n\n setTabBarBadgeHandler = ({ index, text, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].showRedDot = false\n list[index].badgeText = text\n successHandler({\n errMsg: 'setTabBarBadge:ok'\n })\n } else {\n errorHandler({\n errMsg: 'setTabBarBadge:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n removeTabBarBadgeHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].badgeText = null\n list[index].badgeText = null\n successHandler({\n errMsg: 'removeTabBarBadge:ok'\n })\n } else {\n errorHandler({\n errMsg: 'removeTabBarBadge:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n showTabBarRedDotHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].badgeText = null\n list[index].showRedDot = true\n successHandler({\n errMsg: 'showTabBarRedDot:ok'\n })\n } else {\n errorHandler({\n errMsg: 'showTabBarRedDot:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n hideTabBarRedDotHandler = ({ index, successHandler, errorHandler }: RouterHandler) => {\n const list = [...this.list]\n if (index in list) {\n list[index].showRedDot = false\n successHandler({\n errMsg: 'hideTabBarRedDot:ok'\n })\n } else {\n errorHandler({\n errMsg: 'hideTabBarRedDot:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n showTabBarHandler = ({ successHandler }) => {\n this.status = STATUS_SHOW\n successHandler({\n errMsg: 'showTabBar:ok'\n })\n }\n\n hideTabBarHandler = ({ animation, successHandler }) => {\n this.status = animation ? STATUS_SLIDEOUT : STATUS_HIDE\n successHandler({\n errMsg: 'hideTabBar:ok'\n })\n }\n\n setTabBarStyleHandler = ({ color, selectedColor, backgroundColor, borderStyle, successHandler }) => {\n if (backgroundColor) this.backgroundColor = backgroundColor\n if (borderStyle) this.borderStyle = borderStyle\n if (color) this.color = color\n if (selectedColor) this.selectedColor = selectedColor\n successHandler({\n errMsg: 'setTabBarStyle:ok'\n })\n }\n\n setTabBarItemHandler = ({ index, iconPath, selectedIconPath, text, successHandler, errorHandler }) => {\n const list = [...this.list]\n if (index in list) {\n if (iconPath) list[index].iconPath = iconPath\n if (selectedIconPath) list[index].selectedIconPath = selectedIconPath\n if (text) list[index].text = text\n successHandler({\n errMsg: 'setTabBarItem:ok'\n })\n } else {\n errorHandler({\n errMsg: 'setTabBarItem:fail tabbar item not found'\n })\n }\n\n this.list = list\n }\n\n bindEvent () {\n Taro.eventCenter.on('__taroRouterChange', this.routerChangeHandler)\n Taro.eventCenter.on('__taroSwitchTab', this.switchTabHandler)\n Taro.eventCenter.on('__taroSetTabBarBadge', this.setTabBarBadgeHandler)\n Taro.eventCenter.on('__taroRemoveTabBarBadge', this.removeTabBarBadgeHandler)\n Taro.eventCenter.on('__taroShowTabBarRedDotHandler', this.showTabBarRedDotHandler)\n Taro.eventCenter.on('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler)\n Taro.eventCenter.on('__taroShowTabBar', this.showTabBarHandler)\n Taro.eventCenter.on('__taroHideTabBar', this.hideTabBarHandler)\n Taro.eventCenter.on('__taroSetTabBarStyle', this.setTabBarStyleHandler)\n Taro.eventCenter.on('__taroSetTabBarItem', this.setTabBarItemHandler)\n }\n\n removeEvent () {\n Taro.eventCenter.off('__taroRouterChange', this.routerChangeHandler)\n Taro.eventCenter.off('__taroSwitchTab', this.switchTabHandler)\n Taro.eventCenter.off('__taroSetTabBarBadge', this.setTabBarBadgeHandler)\n Taro.eventCenter.off('__taroRemoveTabBarBadge', this.removeTabBarBadgeHandler)\n Taro.eventCenter.off('__taroShowTabBarRedDotHandler', this.showTabBarRedDotHandler)\n Taro.eventCenter.off('__taroHideTabBarRedDotHandler', this.hideTabBarRedDotHandler)\n Taro.eventCenter.off('__taroShowTabBar', this.showTabBarHandler)\n Taro.eventCenter.off('__taroHideTabBar', this.hideTabBarHandler)\n Taro.eventCenter.off('__taroSetTabBarStyle', this.setTabBarStyleHandler)\n Taro.eventCenter.off('__taroSetTabBarItem', this.setTabBarItemHandler)\n }\n\n componentDidLoad () {\n this.tabbarPos = this.tabbar.nextElementSibling ? 'top' : 'bottom'\n this.bindEvent()\n this.routerChangeHandler()\n }\n\n disconnectedCallback () {\n this.removeEvent()\n }\n\n render () {\n const { tabbarPos = 'bottom' } = this\n const status = this.status\n const containerCls = classNames('weui-tabbar', {\n [`taro-tabbar__border-${this.borderStyle || 'black'}`]: true\n })\n const shouldHideTabBar = this.selectedIndex === -1 || status === STATUS_HIDE\n const shouldSlideout = status === STATUS_SLIDEOUT\n\n return (\n <Host\n class={classNames(\n basicTabBarClassName,\n `${basicTabBarClassName}-${tabbarPos}`, {\n [hideTabBarClassName]: shouldHideTabBar,\n [hideTabBarWithAnimationClassName]: shouldSlideout\n })} >\n <div\n class={containerCls}\n style={{\n backgroundColor: this.backgroundColor || '',\n height: 'inherit'\n }}\n >\n {this.list.map((item, index) => {\n const isSelected = this.selectedIndex === index\n let textColor\n let iconPath\n if (isSelected) {\n textColor = this.selectedColor || ''\n iconPath = item.selectedIconPath\n } else {\n textColor = this.color || ''\n iconPath = item.iconPath\n }\n return (\n <TabbarItem\n index={index}\n onSelect={this.switchTab.bind(this)}\n isSelected={isSelected}\n textColor={textColor}\n iconPath={iconPath}\n pagePath={item.pagePath}\n text={item.text}\n badgeText={item.badgeText}\n showRedDot={item.showRedDot}\n />\n )\n })}\n </div>\n </Host>\n )\n }\n}\n"],"mappings":"sdAsDO,IAAMA,SAAW,SAAAC,GACtB,IAAIC,EAAMD,GAAQ,GAClB,IAAIE,EACJ,IAAMC,EAAM,CACVC,KAAM,KACNC,MAAO,KACPC,SAAU,MAGZJ,EAAMD,EAAIM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q,CAElB,OACEqB,EAAC1B,WAAU,CACTvB,MAAOA,EACPiC,SAAUkC,EAAKc,UAAU4D,KAAK1E,GAC9BzC,WAAYA,EACZC,UAAWA,EACXC,SAAUA,EACVrC,SAAUmI,EAAKnI,SACfyC,KAAM0F,EAAK1F,KACXH,UAAW6F,EAAK7F,UAChBE,WAAY2F,EAAK3F,Y,yIA9Td,G"}
@@ -1,2 +1,2 @@
1
- System.register(["./p-1a0e1932.system.js"],(function(e,o){"use strict";var t,r;return{setters:[function(o){t=o.p;r=o.b;e("setNonce",o.s)}],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(JSON.parse('[["p-56da1da3.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-c33733b3.system",[[0,"taro-movable-area-core",{"scaleArea":[4,"scale-area"]}],[0,"taro-movable-view-core",{"x":[8],"y":[8],"direction":[1],"outOfBounds":[4,"out-of-bounds"],"inertia":[4],"friction":[2],"damping":[2],"disabled":[4],"scale":[4],"scaleMin":[2,"scale-min"],"scaleMax":[2,"scale-max"],"scaleValue":[2,"scale-value"],"animation":[4],"setParent":[64],"endScale":[64],"setScale":[64]}]]],["p-6dae898a.system",[[0,"taro-picker-view-column-core",{"col":[1],"initialPosition":[1,"initial-position"],"paddingVertical":[2,"padding-vertical"],"isInit":[32],"isMove":[32]},[[1,"scroll","onScroll"],[1,"mouseup","onMouseEnd"],[1,"mouseout","onMouseEnd"],[1,"mouseleave","onMouseEnd"],[1,"touchend","onTouchEnd"]]],[4,"taro-picker-view-core",{"indicatorStyle":[1,"indicator-style"],"indicatorClass":[1,"indicator-class"],"value":[16],"maskStyle":[1,"mask-style"],"maskClass":[1,"mask-class"]},[[0,"onselect","onSelect"],[0,"onselectstart","onSelectStart"],[0,"onselectend","onPickerColEnd"]]]]],["p-4086e546.system",[[4,"taro-radio-core",{"name":[1],"value":[1],"id":[1025],"checked":[1540],"disabled":[4],"nativeProps":[16],"isWillLoadCalled":[32]}],[0,"taro-radio-group-core",{"name":[8]},[[0,"radiochange","function"]]]]],["p-e53feb03.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],"zoom":[4],"swiperWrapper":[32],"swiper":[32],"isWillLoadCalled":[32],"observer":[32],"observerFirst":[32],"observerLast":[32]}],[0,"taro-swiper-item-core",{"itemId":[1,"item-id"]}]]],["p-b2bb02d7.system",[[0,"taro-ad-core"]]],["p-08bb8dfc.system",[[0,"taro-ad-custom-core"]]],["p-b1c972e2.system",[[0,"taro-animation-video-core"]]],["p-9d4fa0d3.system",[[0,"taro-animation-view-core"]]],["p-46244579.system",[[0,"taro-ar-camera-core"]]],["p-69fa7272.system",[[0,"taro-audio-core",{"src":[1],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"nativeProps":[16]}]]],["p-78c30850.system",[[0,"taro-aweme-data-core"]]],["p-7dd9c8da.system",[[0,"taro-block-core"]]],["p-623b3eb6.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":[513,"form-type"],"hover":[32],"touch":[32]},[[0,"click","onClick"],[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-b1249ebb.system",[[0,"taro-camera-core"]]],["p-17302fe9.system",[[0,"taro-canvas-core",{"canvasId":[1,"canvas-id"],"nativeProps":[16]}]]],["p-da5cdbf5.system",[[0,"taro-comment-detail-core"]]],["p-c586a796.system",[[0,"taro-comment-list-core"]]],["p-97782cdd.system",[[0,"taro-contact-button-core"]]],["p-4d0da795.system",[[0,"taro-cover-image-core",{"src":[1],"nativeProps":[16]}]]],["p-2024e133.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-1941d333.system",[[0,"taro-custom-wrapper-core"]]],["p-4190e20b.system",[[0,"taro-editor-core"]]],["p-087bf23a.system",[[0,"taro-follow-swan-core"]]],["p-de2d8e2e.system",[[4,"taro-form-core",null,[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-ef7e7d73.system",[[0,"taro-functional-page-navigator-core"]]],["p-30f32fa2.system",[[0,"taro-icon-core",{"type":[1],"size":[8],"color":[1]}]]],["p-8d2101be.system",[[0,"taro-image-core",{"src":[1],"mode":[1],"lazyLoad":[4,"lazy-load"],"nativeProps":[16],"aspectFillMode":[32]}]]],["p-8027e1c6.system",[[0,"taro-inline-payment-panel-core"]]],["p-5beca045.system",[[0,"taro-input-core",{"value":[1025],"type":[1],"password":[4],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[516,"focus"],"confirmType":[1,"confirm-type"],"name":[1],"nativeProps":[16],"focus":[64]}]]],["p-895cd7c9.system",[[0,"taro-keyboard-accessory-core"]]],["p-ae3f1ed4.system",[[4,"taro-label-core",{"for":[1]}]]],["p-6f048097.system",[[0,"taro-lifestyle-core"]]],["p-f499c0a0.system",[[0,"taro-like-core"]]],["p-0a9b984e.system",[[0,"taro-live-player-core"]]],["p-c4fdb669.system",[[0,"taro-live-pusher-core"]]],["p-c70dd956.system",[[0,"taro-login-core"]]],["p-bba8c3a7.system",[[0,"taro-lottie-core"]]],["p-736053bb.system",[[0,"taro-map-core"]]],["p-30fe0e81.system",[[0,"taro-match-media-core"]]],["p-bac3deb0.system",[[0,"taro-native-slot-core"]]],["p-8e5cc8fe.system",[[0,"taro-navigation-bar-core"]]],["p-de356b29.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-f9ac515e.system",[[0,"taro-official-account-core"]]],["p-26889f3c.system",[[0,"taro-open-data-core"]]],["p-51b6fc09.system",[[0,"taro-page-container-core"]]],["p-fa36fe8e.system",[[0,"taro-page-meta-core"]]],["p-10be7fb5.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-4915fdc1.system",[[4,"taro-pull-to-refresh",{"prefixCls":[1,"prefix-cls"],"distanceToRefresh":[2,"distance-to-refresh"],"damping":[2],"indicator":[16],"currSt":[32],"dragOnEdge":[32]}]]],["p-fcdac6ec.system",[[0,"taro-rich-text-core",{"nodes":[1]}]]],["p-33223303.system",[[0,"taro-root-portal-core"]]],["p-74bf8246.system",[[0,"taro-rtc-room-core"]]],["p-1c320250.system",[[0,"taro-rtc-room-item-core"]]],["p-6de64a4b.system",[[4,"taro-scroll-view-core",{"scrollX":[4,"scroll-x"],"scrollY":[4,"scroll-y"],"upperThreshold":[8,"upper-threshold"],"lowerThreshold":[8,"lower-threshold"],"mpScrollTop":[520,"scroll-top"],"mpScrollLeft":[520,"scroll-left"],"mpScrollIntoView":[513,"scroll-into-view"],"scrollWithAnimation":[4,"scroll-with-animation"]},[[3,"scroll","handleScroll"]]]]],["p-c6e6dab1.system",[[0,"taro-share-element-core"]]],["p-59590806.system",[[0,"taro-slider-core",{"min":[2],"max":[2],"step":[2],"disabled":[4],"value":[1538],"activeColor":[1,"active-color"],"backgroundColor":[1,"background-color"],"blockSize":[2,"block-size"],"blockColor":[1,"block-color"],"showValue":[4,"show-value"],"name":[1],"totalWidth":[32],"touching":[32],"ogX":[32],"touchId":[32],"percent":[32],"ogPercent":[32],"isWillLoadCalled":[32]}]]],["p-e3f8265d.system",[[0,"taro-slot-core"]]],["p-88d64daa.system",[[0,"taro-switch-core",{"type":[1],"checked":[4],"color":[1],"name":[1],"disabled":[4],"nativeProps":[16],"isChecked":[32],"isWillLoadCalled":[32]}]]],["p-0a165ad3.system",[[0,"taro-tab-item-core"]]],["p-47e6bde7.system",[[0,"taro-tabbar",{"conf":[16],"list":[32],"borderStyle":[32],"backgroundColor":[32],"color":[32],"selectedColor":[32],"selectedIndex":[32],"status":[32]}]]],["p-95f70aea.system",[[0,"taro-tabs-core"]]],["p-651586f8.system",[[4,"taro-text-core",{"selectable":[4]}]]],["p-0895120a.system",[[0,"taro-textarea-core",{"value":[1025],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[4,"auto-focus"],"autoHeight":[4,"auto-height"],"name":[1],"nativeProps":[16],"line":[32],"focus":[64]}]]],["p-58877ef2.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-518146fd.system",[[0,"taro-voip-room-core"]]],["p-6f214fc3.system",[[0,"taro-web-view-core",{"src":[1]}]]],["p-f034fb11.system",[[4,"taro-picker-core",{"mode":[1],"disabled":[4],"range":[16],"rangeKey":[1,"range-key"],"value":[1032],"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],"handleMoveStart":[64],"handleMoving":[64],"handleMoveEnd":[64]},[[1,"mousedown","onMouseDown"],[1,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-69f6784d.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],"getHlsObject":[64],"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-1a0e1932.system.js"],(function(e,o){"use strict";var t,r;return{setters:[function(o){t=o.p;r=o.b;e("setNonce",o.s)}],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(JSON.parse('[["p-56da1da3.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-c33733b3.system",[[0,"taro-movable-area-core",{"scaleArea":[4,"scale-area"]}],[0,"taro-movable-view-core",{"x":[8],"y":[8],"direction":[1],"outOfBounds":[4,"out-of-bounds"],"inertia":[4],"friction":[2],"damping":[2],"disabled":[4],"scale":[4],"scaleMin":[2,"scale-min"],"scaleMax":[2,"scale-max"],"scaleValue":[2,"scale-value"],"animation":[4],"setParent":[64],"endScale":[64],"setScale":[64]}]]],["p-6dae898a.system",[[0,"taro-picker-view-column-core",{"col":[1],"initialPosition":[1,"initial-position"],"paddingVertical":[2,"padding-vertical"],"isInit":[32],"isMove":[32]},[[1,"scroll","onScroll"],[1,"mouseup","onMouseEnd"],[1,"mouseout","onMouseEnd"],[1,"mouseleave","onMouseEnd"],[1,"touchend","onTouchEnd"]]],[4,"taro-picker-view-core",{"indicatorStyle":[1,"indicator-style"],"indicatorClass":[1,"indicator-class"],"value":[16],"maskStyle":[1,"mask-style"],"maskClass":[1,"mask-class"]},[[0,"onselect","onSelect"],[0,"onselectstart","onSelectStart"],[0,"onselectend","onPickerColEnd"]]]]],["p-4086e546.system",[[4,"taro-radio-core",{"name":[1],"value":[1],"id":[1025],"checked":[1540],"disabled":[4],"nativeProps":[16],"isWillLoadCalled":[32]}],[0,"taro-radio-group-core",{"name":[8]},[[0,"radiochange","function"]]]]],["p-e53feb03.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],"zoom":[4],"swiperWrapper":[32],"swiper":[32],"isWillLoadCalled":[32],"observer":[32],"observerFirst":[32],"observerLast":[32]}],[0,"taro-swiper-item-core",{"itemId":[1,"item-id"]}]]],["p-b2bb02d7.system",[[0,"taro-ad-core"]]],["p-08bb8dfc.system",[[0,"taro-ad-custom-core"]]],["p-b1c972e2.system",[[0,"taro-animation-video-core"]]],["p-9d4fa0d3.system",[[0,"taro-animation-view-core"]]],["p-46244579.system",[[0,"taro-ar-camera-core"]]],["p-69fa7272.system",[[0,"taro-audio-core",{"src":[1],"controls":[4],"autoplay":[4],"loop":[4],"muted":[4],"nativeProps":[16]}]]],["p-78c30850.system",[[0,"taro-aweme-data-core"]]],["p-7dd9c8da.system",[[0,"taro-block-core"]]],["p-623b3eb6.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":[513,"form-type"],"hover":[32],"touch":[32]},[[0,"click","onClick"],[1,"touchstart","onTouchStart"],[1,"touchend","onTouchEnd"]]]]],["p-b1249ebb.system",[[0,"taro-camera-core"]]],["p-17302fe9.system",[[0,"taro-canvas-core",{"canvasId":[1,"canvas-id"],"nativeProps":[16]}]]],["p-da5cdbf5.system",[[0,"taro-comment-detail-core"]]],["p-c586a796.system",[[0,"taro-comment-list-core"]]],["p-97782cdd.system",[[0,"taro-contact-button-core"]]],["p-4d0da795.system",[[0,"taro-cover-image-core",{"src":[1],"nativeProps":[16]}]]],["p-2024e133.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-1941d333.system",[[0,"taro-custom-wrapper-core"]]],["p-4190e20b.system",[[0,"taro-editor-core"]]],["p-087bf23a.system",[[0,"taro-follow-swan-core"]]],["p-de2d8e2e.system",[[4,"taro-form-core",null,[[0,"tarobuttonsubmit","onButtonSubmit"],[0,"tarobuttonreset","onButtonReset"]]]]],["p-ef7e7d73.system",[[0,"taro-functional-page-navigator-core"]]],["p-30f32fa2.system",[[0,"taro-icon-core",{"type":[1],"size":[8],"color":[1]}]]],["p-8d2101be.system",[[0,"taro-image-core",{"src":[1],"mode":[1],"lazyLoad":[4,"lazy-load"],"nativeProps":[16],"aspectFillMode":[32]}]]],["p-8027e1c6.system",[[0,"taro-inline-payment-panel-core"]]],["p-5beca045.system",[[0,"taro-input-core",{"value":[1025],"type":[1],"password":[4],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[516,"focus"],"confirmType":[1,"confirm-type"],"name":[1],"nativeProps":[16],"focus":[64]}]]],["p-895cd7c9.system",[[0,"taro-keyboard-accessory-core"]]],["p-ae3f1ed4.system",[[4,"taro-label-core",{"for":[1]}]]],["p-6f048097.system",[[0,"taro-lifestyle-core"]]],["p-f499c0a0.system",[[0,"taro-like-core"]]],["p-0a9b984e.system",[[0,"taro-live-player-core"]]],["p-c4fdb669.system",[[0,"taro-live-pusher-core"]]],["p-c70dd956.system",[[0,"taro-login-core"]]],["p-bba8c3a7.system",[[0,"taro-lottie-core"]]],["p-736053bb.system",[[0,"taro-map-core"]]],["p-30fe0e81.system",[[0,"taro-match-media-core"]]],["p-bac3deb0.system",[[0,"taro-native-slot-core"]]],["p-8e5cc8fe.system",[[0,"taro-navigation-bar-core"]]],["p-de356b29.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-f9ac515e.system",[[0,"taro-official-account-core"]]],["p-26889f3c.system",[[0,"taro-open-data-core"]]],["p-51b6fc09.system",[[0,"taro-page-container-core"]]],["p-fa36fe8e.system",[[0,"taro-page-meta-core"]]],["p-10be7fb5.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-4915fdc1.system",[[4,"taro-pull-to-refresh",{"prefixCls":[1,"prefix-cls"],"distanceToRefresh":[2,"distance-to-refresh"],"damping":[2],"indicator":[16],"currSt":[32],"dragOnEdge":[32]}]]],["p-fcdac6ec.system",[[0,"taro-rich-text-core",{"nodes":[1]}]]],["p-33223303.system",[[0,"taro-root-portal-core"]]],["p-74bf8246.system",[[0,"taro-rtc-room-core"]]],["p-1c320250.system",[[0,"taro-rtc-room-item-core"]]],["p-6de64a4b.system",[[4,"taro-scroll-view-core",{"scrollX":[4,"scroll-x"],"scrollY":[4,"scroll-y"],"upperThreshold":[8,"upper-threshold"],"lowerThreshold":[8,"lower-threshold"],"mpScrollTop":[520,"scroll-top"],"mpScrollLeft":[520,"scroll-left"],"mpScrollIntoView":[513,"scroll-into-view"],"scrollWithAnimation":[4,"scroll-with-animation"]},[[3,"scroll","handleScroll"]]]]],["p-c6e6dab1.system",[[0,"taro-share-element-core"]]],["p-59590806.system",[[0,"taro-slider-core",{"min":[2],"max":[2],"step":[2],"disabled":[4],"value":[1538],"activeColor":[1,"active-color"],"backgroundColor":[1,"background-color"],"blockSize":[2,"block-size"],"blockColor":[1,"block-color"],"showValue":[4,"show-value"],"name":[1],"totalWidth":[32],"touching":[32],"ogX":[32],"touchId":[32],"percent":[32],"ogPercent":[32],"isWillLoadCalled":[32]}]]],["p-e3f8265d.system",[[0,"taro-slot-core"]]],["p-88d64daa.system",[[0,"taro-switch-core",{"type":[1],"checked":[4],"color":[1],"name":[1],"disabled":[4],"nativeProps":[16],"isChecked":[32],"isWillLoadCalled":[32]}]]],["p-0a165ad3.system",[[0,"taro-tab-item-core"]]],["p-efa51030.system",[[0,"taro-tabbar",{"conf":[16],"list":[32],"borderStyle":[32],"backgroundColor":[32],"color":[32],"selectedColor":[32],"selectedIndex":[32],"status":[32]}]]],["p-95f70aea.system",[[0,"taro-tabs-core"]]],["p-651586f8.system",[[4,"taro-text-core",{"selectable":[4]}]]],["p-0895120a.system",[[0,"taro-textarea-core",{"value":[1025],"placeholder":[1],"disabled":[4],"maxlength":[2],"autoFocus":[4,"auto-focus"],"autoHeight":[4,"auto-height"],"name":[1],"nativeProps":[16],"line":[32],"focus":[64]}]]],["p-58877ef2.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-518146fd.system",[[0,"taro-voip-room-core"]]],["p-6f214fc3.system",[[0,"taro-web-view-core",{"src":[1]}]]],["p-f034fb11.system",[[4,"taro-picker-core",{"mode":[1],"disabled":[4],"range":[16],"rangeKey":[1,"range-key"],"value":[1032],"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],"handleMoveStart":[64],"handleMoving":[64],"handleMoveEnd":[64]},[[1,"mousedown","onMouseDown"],[1,"mousemove","onMouseMove"],[1,"mouseup","onMouseMoveEnd"],[1,"mouseleave","onMouseMoveEnd"],[1,"touchstart","onTouchStart"],[1,"touchmove","onTouchMove"],[1,"touchend","onTouchEnd"]]]]],["p-69f6784d.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],"getHlsObject":[64],"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)}))}}}));
2
2
  //# sourceMappingURL=p-1c446c65.system.js.map
@@ -0,0 +1,2 @@
1
+ import{h as t,r as e,c as a,H as s,g as r}from"./p-78e3ebb9.js";import i from"@tarojs/taro";import{c as o}from"./p-76724e58.js";import{i as n}from"./p-d3c7f87d.js";const h=t=>{let e=t||"";let a;const s={path:null,query:null,fragment:null};a=e.indexOf("#");if(a>-1){s.fragment=e.substring(a+1);e=e.substring(0,a)}a=e.indexOf("?");if(a>-1){s.query=e.substring(a+1);e=e.substring(0,a)}s.path=e;return s};const b=(t="")=>t.charAt(0)==="/"?t:"/"+t;const l=(t="",e="")=>new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)||t===e;const c=(t="",e="")=>l(t,e)?t.substring(e.length):t;const d=(t="",e="")=>t.includes(e)?t.substring(0,t.length-e.length):t;const f=(t="hash",e="/")=>{const a=t==="hash"?location.hash.slice(1).split("?")[0]:location.pathname;return b(c(a,e))};function u(t){return t.charAt(0)==="/"}function _(t,e){for(var a=e,s=a+1,r=t.length;s<r;a+=1,s+=1){t[a]=t[s]}t.pop()}function g(t,e){if(e===undefined)e="";var a=t&&t.split("/")||[];var s=e&&e.split("/")||[];var r=t&&u(t);var i=e&&u(e);var o=r||i;if(t&&u(t)){s=a}else if(a.length){s.pop();s=s.concat(a)}if(!s.length)return"/";var n;if(s.length){var h=s[s.length-1];n=h==="."||h===".."||h===""}else{n=false}var b=0;for(var l=s.length;l>=0;l--){var c=s[l];if(c==="."){_(s,l)}else if(c===".."){_(s,l);b++}else if(b){_(s,l);b--}}if(!o)for(;b--;b)s.unshift("..");if(o&&s[0]!==""&&(!s[0]||!u(s[0])))s.unshift("");var d=s.join("/");if(n&&d.substr(-1)!=="/")d+="/";return d}const p=({index:e,isSelected:a=false,textColor:s,iconPath:r,badgeText:h,showRedDot:b=false,pagePath:l,text:c,onSelect:d})=>{const f=o("weui-tabbar__item",{"weui-bar__item_on":a});const u={position:"absolute",top:"-2px",right:"-13px"};const _={position:"absolute",top:"0",right:"-6px"};function g(){const t=i.getCurrentPages().shift();if(typeof(t===null||t===void 0?void 0:t.onTabItemTap)==="function"&&n(this)){t.onTabItemTap({index:e,pagePath:l,text:c})}d(e)}return t("a",{key:e,href:"javascript:;",class:f,onClick:g},t("span",{style:{display:"inline-block",position:"relative"}},t("img",{src:r,alt:"",class:"weui-tabbar__icon"}),!!h&&t("span",{class:"weui-badge taro-tabbar-badge",style:u},h),b&&t("span",{class:"weui-badge weui-badge_dot",style:_})),t("p",{class:"weui-tabbar__label",style:{color:s}},c))};const m="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}";const B=0;const v=1;const T=2;const x="taro-tabbar__tabbar";const w="taro-tabbar__tabbar-hide";const H="taro-tabbar__tabbar-slideout";const y=class{constructor(t){e(this,t);this.onLongPress=a(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.getOriginUrl=t=>{const e=this.customRoutes.filter((([,e])=>{const a=h(e).path;const s=h(t).path;return a===s}));return d(e.length?e[0][0]:t,".html")};this.getSelectedIndex=t=>{let e=-1;this.list.forEach((({pagePath:a},s)=>{const r=h(t).path;const i=h(a).path;if(r===i){e=s}}));return e};this.switchTab=t=>{this.selectedIndex=t;i.switchTab({url:this.list[t].pagePath})};this.switchTabHandler=({url:t,successHandler:e,errorHandler:a})=>{const s=this.getOriginUrl(this.getCurrentUrl()||this.homePage);const r=g(t,s);const i=this.getSelectedIndex(r);if(i>-1){this.switchTab(i);e({errMsg:"switchTab:ok"})}else{a({errMsg:`switchTab:fail page "${r}" is not found`})}};this.routerChangeHandler=t=>{var e;const a=(e=t===null||t===void 0?void 0:t.toLocation)===null||e===void 0?void 0:e.path;let s;if(typeof a==="string"){const t=this.conf.basename||"/";s=c(b(a||this.homePage),t)||"/"}else{s=this.getCurrentUrl()}this.selectedIndex=this.getSelectedIndex(this.getOriginUrl(s))};this.setTabBarBadgeHandler=({index:t,text:e,successHandler:a,errorHandler:s})=>{const r=[...this.list];if(t in r){r[t].showRedDot=false;r[t].badgeText=e;a({errMsg:"setTabBarBadge:ok"})}else{s({errMsg:"setTabBarBadge:fail tabbar item not found"})}this.list=r};this.removeTabBarBadgeHandler=({index:t,successHandler:e,errorHandler:a})=>{const s=[...this.list];if(t in s){s[t].badgeText=null;s[t].badgeText=null;e({errMsg:"removeTabBarBadge:ok"})}else{a({errMsg:"removeTabBarBadge:fail tabbar item not found"})}this.list=s};this.showTabBarRedDotHandler=({index:t,successHandler:e,errorHandler:a})=>{const s=[...this.list];if(t in s){s[t].badgeText=null;s[t].showRedDot=true;e({errMsg:"showTabBarRedDot:ok"})}else{a({errMsg:"showTabBarRedDot:fail tabbar item not found"})}this.list=s};this.hideTabBarRedDotHandler=({index:t,successHandler:e,errorHandler:a})=>{const s=[...this.list];if(t in s){s[t].showRedDot=false;e({errMsg:"hideTabBarRedDot:ok"})}else{a({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}this.list=s};this.showTabBarHandler=({successHandler:t})=>{this.status=B;t({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=({animation:t,successHandler:e})=>{this.status=t?T:v;e({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=({color:t,selectedColor:e,backgroundColor:a,borderStyle:s,successHandler:r})=>{if(a)this.backgroundColor=a;if(s)this.borderStyle=s;if(t)this.color=t;if(e)this.selectedColor=e;r({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=({index:t,iconPath:e,selectedIconPath:a,text:s,successHandler:r,errorHandler:i})=>{const o=[...this.list];if(t in o){if(e)o[t].iconPath=e;if(a)o[t].selectedIconPath=a;if(s)o[t].text=s;r({errMsg:"setTabBarItem:ok"})}else{i({errMsg:"setTabBarItem:fail tabbar item not found"})}this.list=o};this.conf=undefined;this.list=undefined;this.borderStyle=undefined;this.backgroundColor=undefined;this.color=undefined;this.selectedColor=undefined;this.selectedIndex=-1;this.status=B;const s=this.conf.list;const r=this.conf.customRoutes;if(Object.prototype.toString.call(s)!=="[object Array]"||s.length<2||s.length>5){throw new Error("tabBar 配置错误")}this.homePage=b(this.conf.homePage);for(let t in r){const e=r[t];t=b(t);if(typeof e==="string"){this.customRoutes.push([t,b(e)])}else if((e===null||e===void 0?void 0:e.length)>0){this.customRoutes.push(...e.map((e=>[t,b(e)])))}}s.forEach((t=>{if(t.pagePath.indexOf("/")!==0){t.pagePath="/"+t.pagePath}}));this.list=s;this.borderStyle=this.conf.borderStyle;this.backgroundColor=this.conf.backgroundColor;this.color=this.conf.color;this.selectedColor=this.conf.selectedColor}getCurrentUrl(){const t=f(this.conf.mode,this.conf.basename);return decodeURI(t==="/"?this.homePage:t)}bindEvent(){i.eventCenter.on("__taroRouterChange",this.routerChangeHandler);i.eventCenter.on("__taroSwitchTab",this.switchTabHandler);i.eventCenter.on("__taroSetTabBarBadge",this.setTabBarBadgeHandler);i.eventCenter.on("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);i.eventCenter.on("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);i.eventCenter.on("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);i.eventCenter.on("__taroShowTabBar",this.showTabBarHandler);i.eventCenter.on("__taroHideTabBar",this.hideTabBarHandler);i.eventCenter.on("__taroSetTabBarStyle",this.setTabBarStyleHandler);i.eventCenter.on("__taroSetTabBarItem",this.setTabBarItemHandler)}removeEvent(){i.eventCenter.off("__taroRouterChange",this.routerChangeHandler);i.eventCenter.off("__taroSwitchTab",this.switchTabHandler);i.eventCenter.off("__taroSetTabBarBadge",this.setTabBarBadgeHandler);i.eventCenter.off("__taroRemoveTabBarBadge",this.removeTabBarBadgeHandler);i.eventCenter.off("__taroShowTabBarRedDotHandler",this.showTabBarRedDotHandler);i.eventCenter.off("__taroHideTabBarRedDotHandler",this.hideTabBarRedDotHandler);i.eventCenter.off("__taroShowTabBar",this.showTabBarHandler);i.eventCenter.off("__taroHideTabBar",this.hideTabBarHandler);i.eventCenter.off("__taroSetTabBarStyle",this.setTabBarStyleHandler);i.eventCenter.off("__taroSetTabBarItem",this.setTabBarItemHandler)}componentDidLoad(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom";this.bindEvent();this.routerChangeHandler()}disconnectedCallback(){this.removeEvent()}render(){const{tabbarPos:e="bottom"}=this;const a=this.status;const r=o("weui-tabbar",{[`taro-tabbar__border-${this.borderStyle||"black"}`]:true});const i=this.selectedIndex===-1||a===v;const n=a===T;return t(s,{class:o(x,`${x}-${e}`,{[w]:i,[H]:n})},t("div",{class:r,style:{backgroundColor:this.backgroundColor||"",height:"inherit"}},this.list.map(((e,a)=>{const s=this.selectedIndex===a;let r;let i;if(s){r=this.selectedColor||"";i=e.selectedIconPath}else{r=this.color||"";i=e.iconPath}return t(p,{index:a,onSelect:this.switchTab.bind(this),isSelected:s,textColor:r,iconPath:i,pagePath:e.pagePath,text:e.text,badgeText:e.badgeText,showRedDot:e.showRedDot})}))))}get tabbar(){return r(this)}};y.style=m;export{y as taro_tabbar};
2
+ //# sourceMappingURL=p-5d3acf86.entry.js.map