@tarojs/components 3.4.2 → 3.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/cjs/taro-image-core.cjs.entry.js +1 -1
  2. package/dist/cjs/taro-tabbar.cjs.entry.js +1 -1
  3. package/dist/cjs/taro-textarea-core.cjs.entry.js +3 -1
  4. package/dist/collection/components/image/image.js +1 -1
  5. package/dist/collection/components/image/style/index.css +3 -0
  6. package/dist/collection/components/tabbar/style/index.css +2 -0
  7. package/dist/collection/components/textarea/textarea.js +3 -1
  8. package/dist/esm/taro-image-core.entry.js +1 -1
  9. package/dist/esm/taro-tabbar.entry.js +1 -1
  10. package/dist/esm/taro-textarea-core.entry.js +3 -1
  11. package/dist/esm-es5/taro-image-core.entry.js +1 -1
  12. package/dist/esm-es5/taro-tabbar.entry.js +1 -1
  13. package/dist/esm-es5/taro-textarea-core.entry.js +1 -1
  14. package/dist/taro-components/{p-9eb7dfa8.entry.js → p-1c1336f5.entry.js} +1 -1
  15. package/dist/taro-components/p-293531af.system.entry.js +1 -0
  16. package/dist/taro-components/p-33ee636a.system.js +1 -1
  17. package/dist/taro-components/p-5ae86835.system.entry.js +1 -0
  18. package/dist/taro-components/{p-a345ba40.entry.js → p-6de12779.entry.js} +1 -1
  19. package/dist/taro-components/p-b32442fc.system.entry.js +1 -0
  20. package/dist/taro-components/p-d041b413.entry.js +1 -0
  21. package/dist/taro-components/taro-components.esm.js +1 -1
  22. package/dist/types/components/image/image.d.ts +1 -1
  23. package/dist-h5/react/components/input.js +2 -2
  24. package/dist-h5/react/utils/reactify-wc.js +2 -2
  25. package/dist-h5/vue/components/picker.js +2 -2
  26. package/dist-h5/vue/components/scroll-view.js +2 -2
  27. package/dist-h5/vue/createFormsComponent.js +2 -2
  28. package/dist-h5/vue/mixins/listeners.js +2 -2
  29. package/dist-h5/vue3/components/icon.js +3 -0
  30. package/dist-h5/vue3/components/image.js +3 -0
  31. package/dist-h5/vue3/components/scroll-view.js +3 -0
  32. package/dist-h5/vue3/components/text.js +3 -0
  33. package/dist-h5/vue3/createComponent.js +3 -0
  34. package/dist-h5/vue3/createFormsComponent.js +5 -2
  35. package/dist-h5/vue3/forwardRef.js +11 -0
  36. package/dist-h5/vue3/index.js +41 -5
  37. package/package.json +4 -4
  38. package/types/Button.d.ts +24 -8
  39. package/types/Input.d.ts +20 -17
  40. package/types/KeyboardAccessory.d.ts +19 -7
  41. package/types/LivePlayer.d.ts +2 -2
  42. package/types/PageContainer.d.ts +6 -6
  43. package/types/Picker.d.ts +5 -5
  44. package/types/ShareElement.d.ts +196 -3
  45. package/types/common.d.ts +1 -1
  46. package/virtual-list/react/createListComponent.js +2 -2
  47. package/dist/taro-components/p-19c46f62.system.entry.js +0 -1
  48. package/dist/taro-components/p-2dc57c71.system.entry.js +0 -1
  49. package/dist/taro-components/p-63ff7fa7.entry.js +0 -1
  50. package/dist/taro-components/p-fcc1c676.system.entry.js +0 -1
@@ -5,7 +5,7 @@ interface ShareElementProps extends StandardProps {
5
5
  /** 映射标记
6
6
  * @supported weapp
7
7
  */
8
- key: string
8
+ mapkey: string
9
9
 
10
10
  /** 是否进行动画
11
11
  * @default false
@@ -28,10 +28,203 @@ interface ShareElementProps extends StandardProps {
28
28
 
29
29
  /** 共享元素
30
30
  *
31
- * 共享元素是一种动画形式,类似于 [`flutter Hero`](https://flutterchina.club/animations/hero-animations/) 动画,表现为元素像是在页面间穿越一样。该组件需与 [`page-container`](/docs/components/viewContainer/page-container) 组件结合使用。
32
- * 使用时需在当前页放置 `share-element` 组件,同时在 `page-container` 容器中放置对应的 `share-element` 组件,对应关系通过属性值 key 映射。当设置 `page-container` `显示时,transform` 属性为 `true` 的共享元素会产生动画。当前页面容器退出时,会产生返回动画。
31
+ * 共享元素是一种动画形式,类似于 [`flutter Hero`](https://flutterchina.club/animations/hero-animations/) 动画,表现为元素像是在页面间穿越一样。该组件需与 [`PageContainer`](/docs/components/viewContainer/page-container) 组件结合使用。
32
+ * 使用时需在当前页放置 `ShareElement` 组件,同时在 `PageContainer` 容器中放置对应的 `ShareElement` 组件,对应关系通过属性值 key 映射。当设置 `PageContainer` `显示时,transform` 属性为 `true` 的共享元素会产生动画。当前页面容器退出时,会产生返回动画。
33
33
  * @classification viewContainer
34
34
  * @supported weapp
35
+ * @example_react
36
+ * ```tsx
37
+ * // index.js
38
+ * import { useState, useCallback } from 'react'
39
+ * import { View, Button, PageContainer, ShareElement } from '@tarojs/components'
40
+ *
41
+ * import './index.scss'
42
+ *
43
+ * const contacts = [
44
+ * { id: 1, name: 'Frank', img: 'frank.png', phone: '0101 123456', mobile: '0770 123456', email: 'frank@emailionicsorter.com' },
45
+ * { id: 2, name: 'Susan', img: 'susan.png', phone: '0101 123456', mobile: '0770 123456', email: 'frank@emailionicsorter.com' },
46
+ * { id: 3, name: 'Emma', img: 'emma.png', phone: '0101 123456', mobile: '0770 123456', email: 'frank@emailionicsorter.com' },
47
+ * { id: 4, name: 'Scott', img: 'scott.png', phone: '0101 123456', mobile: '0770 123456', email: 'frank@emailionicsorter.com' },
48
+ * { id: 5, name: 'Bob', img: 'bob.png', phone: '0101 123456', mobile: '0770 123456', email: 'frank@emailionicsorter.com' },
49
+ * { id: 6, name: 'Olivia', img: 'olivia.png', phone: '0101 123456', mobile: '0770 123456', email: 'frank@emailionicsorter.com' },
50
+ * { id: 7, name: 'Anne', img: 'anne.png', phone: '0101 123456', mobile: '0770 123456', email: 'frank@emailionicsorter.com' },
51
+ * { id: 8, name: 'sunny', img: 'olivia.png', phone: '0101 123456', mobile: '0770 123456', email: 'frank@emailionicsorter.com' }
52
+ * ]
53
+ *
54
+ * export default function () {
55
+ * const [show, setShow] = useState(false)
56
+ * const [contact, setContact] = useState(contacts[0])
57
+ * const [transformIdx, setTransformIdx] = useState(0)
58
+ *
59
+ * const onBeforeEnter = useCallback((res) => {
60
+ * console.log('onBeforeEnter: ', res)
61
+ * }, [])
62
+ * const onEnter = useCallback((res) => {
63
+ * console.log('onEnter: ', res)
64
+ * }, [])
65
+ * const onAfterEnter = useCallback((res) => {
66
+ * console.log('onAfterEnter: ', res)
67
+ * }, [])
68
+ * const onBeforeLeave = useCallback((res) => {
69
+ * console.log('onBeforeLeave: ', res)
70
+ * }, [])
71
+ * const onLeave = useCallback((res) => {
72
+ * console.log('onLeave: ', res)
73
+ * }, [])
74
+ * const onAfterLeave = useCallback((res) => {
75
+ * console.log('onAfterLeave: ', res)
76
+ * }, [])
77
+ *
78
+ * const showNext = (e, index) => {
79
+ * setShow(true)
80
+ * setContact(contacts[index])
81
+ * setTransformIdx(index)
82
+ * }
83
+ *
84
+ * const showPrev = useCallback(() => {
85
+ * setShow(false)
86
+ * }, [])
87
+ *
88
+ * return (
89
+ * <View>
90
+ * <View className="screen screen1">
91
+ * {
92
+ * contacts.map((item, index) => (
93
+ * <View key={item.id} className="contact" onClick={e => showNext(e, index)}>
94
+ * <ShareElement duration={300} className="name" mapkey="name" transform={transformIdx === index}>
95
+ * {item.name}
96
+ * </ShareElement>
97
+ * <View className="list">
98
+ * <View>Phone: {item.phone}</View>
99
+ * <View>Mobile: {item.mobile}</View>
100
+ * <View>Email: {item.email}</View>
101
+ * </View>
102
+ * </View>
103
+ * ))
104
+ * }
105
+ * </View>
106
+ * <PageContainer
107
+ * show={show}
108
+ * overlay={false}
109
+ * closeOnSlideDown
110
+ * duration={300}
111
+ * position='center'
112
+ * onBeforeEnter={onBeforeEnter}
113
+ * onEnter={onEnter}
114
+ * onAfterEnter={onAfterEnter}
115
+ * onBeforeLeave={onBeforeLeave}
116
+ * onLeave={onLeave}
117
+ * onAfterLeave={onAfterLeave}
118
+ * >
119
+ * <View className="screen screen2">
120
+ * <View className="contact">
121
+ * <ShareElement className="name" mapkey="name" duration={300} transform>
122
+ * {contact.name}
123
+ * </ShareElement>
124
+ * <View className={`paragraph ${show ? 'enter' : ''}`}>
125
+ * Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nisl enim, sodales non augue efficitur, sagittis
126
+ * varius neque. Fusce dolor turpis, maximus eu volutpat quis, pellentesque et ligula. Ut vehicula metus in nibh
127
+ * mollis ornare. Etiam aliquam lacinia malesuada. Vestibulum dignissim mollis quam a tristique. Maecenas neque
128
+ * mauris, malesuada vitae magna eu, congue consectetur risus. Etiam vitae pulvinar ex. Maecenas suscipit mi ac
129
+ * imperdiet pretium. Aliquam velit mauris, euismod quis elementum sed, malesuada non dui. Nunc rutrum sagittis
130
+ * ligula in dapibus. Cras suscipit ut augue eget mollis. Donec auctor feugiat ipsum id viverra. Vestibulum eu nisi
131
+ * risus. Vestibulum eleifend dignissim.
132
+ *
133
+ * </View>
134
+ * <Button className="screen2-button" onClick={showPrev} hidden={!show} hoverClass="none">Click Me</Button>
135
+ * </View>
136
+ * </View>
137
+ * </PageContainer>
138
+ * </View>
139
+ * )
140
+ * }
141
+ * ```
142
+ * ```scss
143
+ * \/** index.scss *\/
144
+ * page {
145
+ * color: #333;
146
+ * background-color: #ddd;
147
+ * overflow: hidden;
148
+ * }
149
+ *
150
+ * button {
151
+ * border: 0 solid #0010ae;
152
+ * background-color: #1f2afe;
153
+ * color: #fff;
154
+ * font-size: 120%;
155
+ * padding: 8px 16px;
156
+ * outline-width: 0;
157
+ * -webkit-appearance: none;
158
+ * box-shadow: 0 8px 17px rgba(0, 0, 0, 0.2);
159
+ * }
160
+ *
161
+ * .screen {
162
+ * position: absolute;
163
+ * top: 0;
164
+ * bottom: 0;
165
+ * left: 0;
166
+ * right: 0;
167
+ * padding: 16px;
168
+ * -webkit-overflow-scrolling: touch;
169
+ * }
170
+ *
171
+ * .contact {
172
+ * position: relative;
173
+ * padding: 16px;
174
+ * background-color: #fff;
175
+ * width: 100%;
176
+ * height: 100%;
177
+ * box-sizing: border-box;
178
+ * }
179
+ *
180
+ * .avatar {
181
+ * position: absolute;
182
+ * top: 16px;
183
+ * left: 16px;
184
+ * font-size: 0;
185
+ * }
186
+ *
187
+ * .name {
188
+ * height: 65px;
189
+ * font-size: 2em;
190
+ * font-weight: bold;
191
+ * text-align: center;
192
+ * margin: 10px 0;
193
+ * }
194
+ *
195
+ * .list {
196
+ * padding-top: 8px;
197
+ * padding-left: 32px;
198
+ * }
199
+ *
200
+ * .screen1 {
201
+ * overflow-y: scroll;
202
+ * padding: 0;
203
+ * }
204
+ *
205
+ * .screen1 .contact {
206
+ * margin: 16px;
207
+ * height: auto;
208
+ * width: auto;
209
+ * box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.2);
210
+ * }
211
+ *
212
+ * .screen2-button {
213
+ * display: block;
214
+ * margin: 24px auto;
215
+ * }
216
+ *
217
+ * .paragraph {
218
+ * -webkit-transition: transform ease-in-out 300ms;
219
+ * transition: transform ease-in-out 300ms;
220
+ * -webkit-transform: scale(0.6);
221
+ * transform: scale(0.6);
222
+ * }
223
+ *
224
+ * .enter.paragraph {
225
+ * transform: none;
226
+ * }
227
+ * ```
35
228
  * @see https://developers.weixin.qq.com/miniprogram/dev/component/share-element.html
36
229
  */
37
230
  declare const ShareElement: ComponentType<ShareElementProps>
package/types/common.d.ts CHANGED
@@ -19,7 +19,7 @@ export interface StandardProps<T = any, TouchEvent extends BaseTouchEvent<any> =
19
19
  ref?: LegacyRef<T>
20
20
  /**
21
21
  * 渲染 HTML
22
- * @see https://taro-docs.jd.com/taro/docs/html
22
+ * @see /docs/html
23
23
  */
24
24
  dangerouslySetInnerHTML?: {
25
25
  __html: string
@@ -2,7 +2,7 @@
2
2
  /* eslint-disable no-case-declarations */
3
3
  /* eslint-disable no-void */
4
4
  /* eslint-disable no-return-assign */
5
- import Taro from '@tarojs/taro'
5
+ import { createSelectorQuery } from '@tarojs/taro'
6
6
  import { getRTLOffsetType } from '../domHelpers'
7
7
  import { memoizeOne } from '../memoize'
8
8
  import { createElement, PureComponent } from 'react'
@@ -22,7 +22,7 @@ export function isRtlFunc ({ direction }) {
22
22
  return direction === 'rtl'
23
23
  }
24
24
  export function getRectSize (id, success = () => {}, fail = () => {}) {
25
- const query = Taro.createSelectorQuery()
25
+ const query = createSelectorQuery()
26
26
  query.select(id).boundingClientRect((res) => {
27
27
  if (res) {
28
28
  success(res)
@@ -1 +0,0 @@
1
- var __spreadArray=this&&this.__spreadArray||function(e,t){for(var r=0,a=t.length,o=e.length;r<a;r++,o++)e[o]=t[r];return e};System.register(["./p-b2d01686.system.js","@tarojs/taro","./p-94c20f60.system.js"],(function(e){"use strict";var t,r,a,o,n,i,s;return{setters:[function(e){t=e.h;r=e.r;a=e.c;o=e.H;n=e.g},function(e){i=e.default},function(e){s=e.c}],execute:function(){function l(e){return e.charAt(0)==="/"}function d(e,t){for(var r=t,a=r+1,o=e.length;a<o;r+=1,a+=1){e[r]=e[a]}e.pop()}function b(e,t){if(t===undefined)t="";var r=e&&e.split("/")||[];var a=t&&t.split("/")||[];var o=e&&l(e);var n=t&&l(t);var i=o||n;if(e&&l(e)){a=r}else if(r.length){a.pop();a=a.concat(r)}if(!a.length)return"/";var s;if(a.length){var b=a[a.length-1];s=b==="."||b===".."||b===""}else{s=false}var h=0;for(var c=a.length;c>=0;c--){var f=a[c];if(f==="."){d(a,c)}else if(f===".."){d(a,c);h++}else if(h){d(a,c);h--}}if(!i)for(;h--;h)a.unshift("..");if(i&&a[0]!==""&&(!a[0]||!l(a[0])))a.unshift("");var u=a.join("/");if(s&&u.substr(-1)!=="/")u+="/";return u}var h=function(e){var t=e||"";var r;var a={path:null,query:null,fragment:null};r=t.indexOf("#");if(r>-1){a.fragment=t.substring(r+1);t=t.substring(0,r)}r=t.indexOf("?");if(r>-1){a.query=t.substring(r+1);t=t.substring(0,r)}a.path=t;return a};var c=function(e){var r=e.index,a=e.isSelected,o=a===void 0?false:a,n=e.textColor,i=e.iconPath,l=e.badgeText,d=e.showRedDot,b=d===void 0?false:d,h=e.text,c=e.onSelect;var f=s("weui-tabbar__item",{"weui-bar__item_on":o});var u={position:"absolute",top:"-2px",right:"-13px"};var v={position:"absolute",top:"0",right:"-6px"};function g(){c(r)}return t("a",{key:r,href:"javascript:;",class:f,onClick:g},t("span",{style:{display:"inline-block",position:"relative"}},t("img",{src:i,alt:"",class:"weui-tabbar__icon"}),!!l&&t("span",{class:"weui-badge taro-tabbar-badge",style:u},l),b&&t("span",{class:"weui-badge weui-badge_dot",style:v})),t("p",{class:"weui-tabbar__label",style:{color:n}},h))};var f="html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;height:100%;-ms-flex-direction:column;flex-direction:column;overflow:hidden}.taro-tabbar__panel{-ms-flex:1;flex:1;position:relative;overflow:auto;-webkit-overflow-scrolling:auto}.taro-tabbar__tabbar{position:relative;height:50px;width:100%;-webkit-transition:bottom 0.2s, top 0.2s;transition:bottom 0.2s, top 0.2s}.taro-tabbar__tabbar-top{top:0}.taro-tabbar__tabbar-bottom{bottom:0}.taro-tabbar__tabbar-hide{display:none}.taro-tabbar__tabbar-slideout{top:-52px;-ms-flex:0 0;flex:0 0}.taro-tabbar__panel+.taro-tabbar__tabbar-slideout{top:auto;bottom:-52px}";var u=function(e){return e[0]==="/"?e:"/"+e};var v=function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)};var g=function(e,t){return v(e,t)?e.substr(t.length):e};var _=0;var p=1;var T=2;var B="taro-tabbar__tabbar";var m="taro-tabbar__tabbar-hide";var H="taro-tabbar__tabbar-slideout";var x=e("taro_tabbar",function(){function e(e){var t=this;r(this,e);this.onLongPress=a(this,"longpress",7);this.homePage="";this.customRoutes=[];this.tabbarPos="bottom";this.selectedIndex=-1;this.status=_;this.getOriginUrl=function(e){var r=t.customRoutes.filter((function(t){var r=t[1];var a=h(r).path;var o=h(e).path;return a===o}));return r.length?r[0][0]:e};this.getSelectedIndex=function(e){var r=-1;t.list.forEach((function(t,a){var o=t.pagePath;var n=h(e).path;var i=h(o).path;if(n===i){r=a}}));return r};this.switchTab=function(e){t.selectedIndex=e;i.switchTab({url:t.list[e].pagePath})};this.switchTabHandler=function(e){var r=e.url,a=e.successHandler,o=e.errorHandler;var n=t.getOriginUrl(t.getCurrentUrl()||t.homePage);var i=b(r,n);var s=t.getSelectedIndex(i);if(s>-1){t.switchTab(s);a({errMsg:"switchTab:ok"})}else{o({errMsg:'switchTab:fail page "'+i+'" is not found'})}};this.routerChangeHandler=function(e){var r;var a;if(e){r=e.toLocation}if(r&&r.path){var o=u(r.path);a=g(o==="/"?t.homePage:o,t.conf.basename||"/")}else{a=t.getCurrentUrl()}t.selectedIndex=t.getSelectedIndex(t.getOriginUrl(a))};this.setTabBarBadgeHandler=function(e){var r=e.index,a=e.text,o=e.successHandler,n=e.errorHandler;var i=__spreadArray([],t.list);if(r in i){i[r].showRedDot=false;i[r].badgeText=a;o({errMsg:"setTabBarBadge:ok"})}else{n({errMsg:"setTabBarBadge:fail tabbar item not found"})}t.list=i};this.removeTabBarBadgeHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].badgeText=null;n[r].badgeText=null;a({errMsg:"removeTabBarBadge:ok"})}else{o({errMsg:"removeTabBarBadge:fail tabbar item not found"})}t.list=n};this.showTabBarRedDotHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].badgeText=null;n[r].showRedDot=true;a({errMsg:"showTabBarRedDot:ok"})}else{o({errMsg:"showTabBarRedDot:fail tabbar item not found"})}t.list=n};this.hideTabBarRedDotHandler=function(e){var r=e.index,a=e.successHandler,o=e.errorHandler;var n=__spreadArray([],t.list);if(r in n){n[r].showRedDot=false;a({errMsg:"hideTabBarRedDot:ok"})}else{o({errMsg:"hideTabBarRedDot:fail tabbar item not found"})}t.list=n};this.showTabBarHandler=function(e){var r=e.successHandler;t.status=_;r({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var r=e.animation,a=e.successHandler;t.status=r?T:p;a({errMsg:"hideTabBar:ok"})};this.setTabBarStyleHandler=function(e){var r=e.color,a=e.selectedColor,o=e.backgroundColor,n=e.borderStyle,i=e.successHandler;if(o)t.backgroundColor=o;if(n)t.borderStyle=n;if(r)t.color=r;if(a)t.selectedColor=a;i({errMsg:"setTabBarStyle:ok"})};this.setTabBarItemHandler=function(e){var r=e.index,a=e.iconPath,o=e.selectedIconPath,n=e.text,i=e.successHandler,s=e.errorHandler;var l=__spreadArray([],t.list);if(r in l){if(a)l[r].iconPath=a;if(o)l[r].selectedIconPath=o;if(n)l[r].text=n;i({errMsg:"setTabBarItem:ok"})}else{s({errMsg:"setTabBarItem:fail tabbar item not found"})}t.list=l};var o=this.conf.list;var n=this.conf.customRoutes;if(Object.prototype.toString.call(o)!=="[object Array]"||o.length<2||o.length>5){throw new Error("tabBar 配置错误")}this.homePage=u(this.conf.homePage);var s=function(e){var t;var r=n[e];e=u(e);if(typeof r==="string"){l.customRoutes.push([e,u(r)])}else if((r===null||r===void 0?void 0:r.length)>0){(t=l.customRoutes).push.apply(t,r.map((function(t){return[e,u(t)]})))}};var l=this;for(var d in n){s(d)}o.forEach((function(e){if(e.pagePath.indexOf("/")!==0){e.pagePath="/"+e.pagePath}}));this.list=o;this.borderStyle=this.conf.borderStyle;this.backgroundColor=this.conf.backgroundColor;this.color=this.conf.color;this.selectedColor=this.conf.selectedColor}e.prototype.getCurrentUrl=function(){var e=this.conf.mode;var t=this.conf.basename||"/";var r;if(e==="hash"){var a=window.location.href;var o=a.indexOf("#");r=o===-1?"":a.substring(o+1)}else{r=location.pathname}var n=u(g(r,t));return n==="/"?this.homePage:n};e.prototype.bindEvent=function(){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)};e.prototype.removeEvent=function(){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)};e.prototype.componentDidLoad=function(){this.tabbarPos=this.tabbar.nextElementSibling?"top":"bottom";this.bindEvent();this.routerChangeHandler()};e.prototype.disconnectedCallback=function(){this.removeEvent()};e.prototype.render=function(){var e,r;var a=this;var n=this.tabbarPos,i=n===void 0?"bottom":n;var l=this.status;var d=s("weui-tabbar",(e={},e["taro-tabbar__border-"+(this.borderStyle||"black")]=true,e));var b=this.selectedIndex===-1||l===p;var h=l===T;return t(o,{class:s(B,B+"-"+i,(r={},r[m]=b,r[H]=h,r))},t("div",{class:d,style:{backgroundColor:this.backgroundColor||"",height:"inherit"}},this.list.map((function(e,r){var o=a.selectedIndex===r;var n;var i;if(o){n=a.selectedColor||"";i=e.selectedIconPath}else{n=a.color||"";i=e.iconPath}return t(c,{index:r,onSelect:a.switchTab.bind(a),isSelected:o,textColor:n,iconPath:i,text:e.text,badgeText:e.badgeText,showRedDot:e.showRedDot})}))))};Object.defineProperty(e.prototype,"tabbar",{get:function(){return n(this)},enumerable:false,configurable:true});return e}());x.style=f}}}));
@@ -1 +0,0 @@
1
- System.register(["./p-b2d01686.system.js"],(function(e){"use strict";var t,n,i,a;return{setters:[function(e){t=e.r;n=e.c;i=e.h;a=e.g}],execute:function(){var o="taro-textarea-core{display:block;width:300px}taro-textarea-core .auto-height{height:auto}.taro-textarea{-webkit-appearance:none;cursor:auto;width:100%;height:150px;border:0;display:block;position:relative;line-height:1.5}.taro-textarea:focus{outline:none}";function r(e){return e!==null&&e!==void 0?e:""}var h=e("taro_textarea_core",function(){function e(e){var i=this;t(this,e);this.onInput=n(this,"input",7);this.onFocus=n(this,"focus",7);this.onBlur=n(this,"blur",7);this.onChange=n(this,"change",7);this.onLineChange=n(this,"linechange",7);this.disabled=false;this.maxlength=140;this.autoFocus=false;this.autoHeight=false;this.nativeProps={};this.line=1;this.handleInput=function(e){e.stopPropagation();i.handleLineChange();i.onInput.emit({value:e.target.value,cursor:e.target.value.length})};this.handleFocus=function(e){i.onFocus.emit({value:e.target.value})};this.handleBlur=function(e){i.onBlur.emit({value:e.target.value})};this.handleChange=function(e){e.stopPropagation();i.onChange.emit({value:e.target.value})};this.handleLineChange=function(){var e=i.getNumberOfLines();if(e!==i.line){i.line=e;i.onLineChange.emit({height:i.textareaRef.clientHeight,lineCount:i.line})}};this.calculateContentHeight=function(e,t){var n=e.style.height,i=e.offsetHeight,a=e.scrollHeight,o=e.style.overflow;if(i>=a){e.style.height=i+t+"px";e.style.overflow="hidden";if(a<e.scrollHeight){while(e.offsetHeight>=e.scrollHeight){e.style.height=(i-=t)+"px"}while(e.offsetHeight<e.scrollHeight){e.style.height=i+++"px"}e.style.height=n;e.style.overflow=o;return i}}else{return a}};this.getNumberOfLines=function(){var e=i.textareaRef,t=window.getComputedStyle?window.getComputedStyle(e):e.style,n=parseInt(t.lineHeight,10),a=i.calculateContentHeight(e,n),o=Math.floor(a/n);return o}}e.prototype.componentDidLoad=function(){var e=this;Object.defineProperty(this.el,"value",{get:function(){return e.textareaRef.value},set:function(t){return e.value=t},configurable:true});this.autoFocus&&this.textareaRef.focus()};e.prototype.render=function(){var e=this;var t=this,n=t.value,a=t.placeholder,o=t.disabled,h=t.maxlength,l=t.autoFocus,s=t.autoHeight,u=t.name,c=t.nativeProps,g=t.handleInput,f=t.handleFocus,p=t.handleBlur,d=t.handleChange;var v={};if(s){v.rows=this.line}return i("textarea",Object.assign({ref:function(t){if(t){e.textareaRef=t}},class:"taro-textarea "+(s?"auto-height":""),value:r(n),placeholder:a,name:u,disabled:o,maxlength:h,autofocus:l,onInput:g,onFocus:f,onBlur:p,onChange:d},c,v))};Object.defineProperty(e.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return e}());h.style=o}}}));
@@ -1 +0,0 @@
1
- import{r as t,c as e,h as i,g as h}from"./p-f05e1558.js";function s(t){return null!=t?t:""}let a=class{constructor(i){t(this,i),this.onInput=e(this,"input",7),this.onFocus=e(this,"focus",7),this.onBlur=e(this,"blur",7),this.onChange=e(this,"change",7),this.onLineChange=e(this,"linechange",7),this.disabled=!1,this.maxlength=140,this.autoFocus=!1,this.autoHeight=!1,this.nativeProps={},this.line=1,this.handleInput=t=>{t.stopPropagation(),this.handleLineChange(),this.onInput.emit({value:t.target.value,cursor:t.target.value.length})},this.handleFocus=t=>{this.onFocus.emit({value:t.target.value})},this.handleBlur=t=>{this.onBlur.emit({value:t.target.value})},this.handleChange=t=>{t.stopPropagation(),this.onChange.emit({value:t.target.value})},this.handleLineChange=()=>{const t=this.getNumberOfLines();t!==this.line&&(this.line=t,this.onLineChange.emit({height:this.textareaRef.clientHeight,lineCount:this.line}))},this.calculateContentHeight=(t,e)=>{let i=t.style.height,h=t.offsetHeight,s=t.scrollHeight,a=t.style.overflow;if(!(h>=s))return s;if(t.style.height=h+e+"px",t.style.overflow="hidden",s<t.scrollHeight){for(;t.offsetHeight>=t.scrollHeight;)t.style.height=(h-=e)+"px";for(;t.offsetHeight<t.scrollHeight;)t.style.height=h+++"px";return t.style.height=i,t.style.overflow=a,h}},this.getNumberOfLines=()=>{const t=this.textareaRef,e=window.getComputedStyle?window.getComputedStyle(t):t.style,i=parseInt(e.lineHeight,10),h=this.calculateContentHeight(t,i);return Math.floor(h/i)}}componentDidLoad(){Object.defineProperty(this.el,"value",{get:()=>this.textareaRef.value,set:t=>this.value=t,configurable:!0}),this.autoFocus&&this.textareaRef.focus()}render(){const{value:t,placeholder:e,disabled:h,maxlength:a,autoFocus:o,autoHeight:r,name:n,nativeProps:u,handleInput:l,handleFocus:c,handleBlur:d,handleChange:p}=this,g={};return r&&(g.rows=this.line),i("textarea",Object.assign({ref:t=>{t&&(this.textareaRef=t)},class:"taro-textarea "+(r?"auto-height":""),value:s(t),placeholder:e,name:n,disabled:h,maxlength:a,autofocus:o,onInput:l,onFocus:c,onBlur:d,onChange:p},u,g))}get el(){return h(this)}};a.style="taro-textarea-core{display:block;width:300px}taro-textarea-core .auto-height{height:auto}.taro-textarea{-webkit-appearance:none;cursor:auto;width:100%;height:150px;border:0;display:block;position:relative;line-height:1.5}.taro-textarea:focus{outline:none}";export{a as taro_textarea_core}
@@ -1 +0,0 @@
1
- System.register(["./p-b2d01686.system.js","./p-94c20f60.system.js"],(function(t,i){"use strict";var o,e,r,a,s;return{setters:[function(t){o=t.r;e=t.c;r=t.h;a=t.H},function(t){s=t.c}],execute:function(){var n='img[src=""]{opacity:0}taro-image-core{display:inline-block;overflow:hidden;position:relative;font-size:0;width:auto;height:auto}.taro-img.taro-img__widthfix{height:100%}.taro-img__mode-scaletofill{width:100%;height:100%}.taro-img__mode-aspectfit{max-width:100%;max-height:100%}.taro-img__mode-aspectfill{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.taro-img__mode-aspectfill--width{min-width:100%;height:100%}.taro-img__mode-aspectfill--height{width:100%;min-height:100%}.taro-img__mode-widthfix{width:100%}.taro-img__mode-top{width:100%}.taro-img__mode-bottom{width:100%;position:absolute;bottom:0}.taro-img__mode-left{height:100%}.taro-img__mode-right{position:absolute;height:100%;right:0}.taro-img__mode-topright{position:absolute;right:0}.taro-img__mode-bottomleft{position:absolute;bottom:0}.taro-img__mode-bottomright{position:absolute;right:0;bottom:0}';i.import("./p-3b1d2d37.system.js");var h=t("taro_image_core",function(){function t(t){o(this,t);this.onLoad=e(this,"load",7);this.onError=e(this,"error",7);this.mode="scaleToFill";this.lazyLoad=false;this.nativeProps={};this.aspectFillMode="width"}t.prototype.componentDidLoad=function(){var t=this;if(!this.lazyLoad)return;var i=new IntersectionObserver((function(o){if(o[o.length-1].isIntersecting){i.unobserve(t.imgRef);t.imgRef.src=t.src}}),{rootMargin:"300px 0px"});i.observe(this.imgRef)};t.prototype.imageOnLoad=function(){var t=this.imgRef,i=t.width,o=t.height,e=t.naturalWidth,r=t.naturalHeight;this.onLoad.emit({width:i,height:o});this.aspectFillMode=e>r?"width":"height"};t.prototype.imageOnError=function(){this.onError.emit()};t.prototype.render=function(){var t;var i=this;var o=this,e=o.src,n=o.mode,h=n===void 0?"scaleToFill":n,m=o.lazyLoad,d=m===void 0?false:m,g=o.aspectFillMode,l=g===void 0?"width":g,c=o.imageOnLoad,f=o.imageOnError,p=o.nativeProps;var _=s({"taro-img__widthfix":h==="widthFix"});var u=s("taro-img__mode-"+h.toLowerCase().replace(/\s/g,""),(t={},t["taro-img__mode-aspectfill--"+l]=h==="aspectFill",t));return r(a,{class:_},d?r("img",Object.assign({ref:function(t){return i.imgRef=t},class:u,onLoad:c.bind(this),onError:f.bind(this)},p)):r("img",Object.assign({ref:function(t){return i.imgRef=t},class:u,src:e,onLoad:c.bind(this),onError:f.bind(this)},p)))};return t}());h.style=n}}}));