@tarojs/components 3.7.0-alpha.6 → 3.7.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/taro-button-core.cjs.entry.js +1 -1
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-image-core.cjs.entry.js +4 -3
- package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +1 -1
- package/dist/cjs/taro-scroll-view-core.cjs.entry.js +4 -3
- package/dist/collection/components/button/style/index.css +12 -0
- package/dist/collection/components/image/image.js +6 -4
- package/dist/collection/components/pull-to-refresh/pull-to-refresh.js +1 -1
- package/dist/collection/components/scroll-view/scroll-view.js +22 -4
- package/dist/components/taro-button-core.js +1 -1
- package/dist/components/taro-image-core.js +6 -4
- package/dist/components/taro-pull-to-refresh.js +1 -1
- package/dist/components/taro-scroll-view-core.js +5 -3
- package/dist/esm/loader.js +1 -1
- package/dist/esm/taro-button-core.entry.js +1 -1
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-image-core.entry.js +4 -3
- package/dist/esm/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm/taro-scroll-view-core.entry.js +4 -3
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-button-core.entry.js +1 -1
- package/dist/esm-es5/taro-components.js +1 -1
- package/dist/esm-es5/taro-image-core.entry.js +1 -1
- package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm-es5/taro-scroll-view-core.entry.js +1 -1
- package/dist/taro-components/p-0198411e.system.entry.js +1 -0
- package/dist/taro-components/{p-2accb92c.system.entry.js → p-2de2a3fd.system.entry.js} +1 -1
- package/dist/taro-components/p-478deb81.entry.js +1 -0
- package/dist/taro-components/p-5dda8a67.entry.js +1 -0
- package/dist/taro-components/{p-7152d85b.entry.js → p-7b68dee8.entry.js} +1 -1
- package/dist/taro-components/p-982bb5bf.entry.js +1 -0
- package/dist/taro-components/{p-cdb76676.system.entry.js → p-a4882902.system.entry.js} +1 -1
- package/dist/taro-components/p-dab28e1f.system.entry.js +1 -0
- package/dist/taro-components/p-ed331c06.system.js +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/image/image.d.ts +1 -0
- package/dist/types/components/scroll-view/scroll-view.d.ts +1 -0
- package/dist/types/components.d.ts +2 -0
- package/lib/vue2/component-lib/index.js +0 -5
- package/lib/vue2/component-lib/index.js.map +1 -1
- package/lib/vue2/components-loader.js +1 -1
- package/lib/vue2/components-loader.js.map +1 -1
- package/lib/vue2/components.d.ts +1 -0
- package/lib/vue2/components.js +1 -0
- package/lib/vue2/components.js.map +1 -1
- package/lib/vue3/components.js +1 -0
- package/lib/vue3/components.js.map +1 -1
- package/package.json +4 -4
- package/types/Button.d.ts +22 -0
- package/types/ScrollView.d.ts +2 -2
- package/types/index.vue3.d.ts +18 -9
- package/dist/taro-components/p-091a7153.entry.js +0 -1
- package/dist/taro-components/p-0cf235de.system.entry.js +0 -1
- package/dist/taro-components/p-4874f671.entry.js +0 -1
- package/dist/taro-components/p-719e1eaf.entry.js +0 -1
- package/dist/taro-components/p-7ff654e6.system.entry.js +0 -1
package/types/Button.d.ts
CHANGED
|
@@ -189,6 +189,11 @@ interface ButtonProps extends StandardProps {
|
|
|
189
189
|
* @supported weapp, alipay, swan, tt, jd
|
|
190
190
|
*/
|
|
191
191
|
onGetPhoneNumber?: CommonEventFunction<ButtonProps.onGetPhoneNumberEventDetail>
|
|
192
|
+
/**
|
|
193
|
+
* 手机号实时验证回调,`open-type="getRealtimePhoneNumber"` 时有效
|
|
194
|
+
* @supported weapp
|
|
195
|
+
*/
|
|
196
|
+
onGetRealTimePhoneNumber?: CommonEventFunction<ButtonProps.onGetRealTimePhoneNumberEventDetail>
|
|
192
197
|
/** 当使用开放能力时,发生错误的回调
|
|
193
198
|
*
|
|
194
199
|
* 生效时机:`open-type="launchApp"`
|
|
@@ -213,6 +218,11 @@ interface ButtonProps extends StandardProps {
|
|
|
213
218
|
* @supported weapp
|
|
214
219
|
*/
|
|
215
220
|
onChooseAvatar?: CommonEventFunction
|
|
221
|
+
/**
|
|
222
|
+
* 用户同意隐私协议事件回调,`open-type="agreePrivacyAuthorization"`时有效
|
|
223
|
+
* @supported weapp
|
|
224
|
+
*/
|
|
225
|
+
onAgreePrivacyAuthorization?: CommonEventFunction
|
|
216
226
|
/** 点击。
|
|
217
227
|
* 说明: 每点击一次会触发一次事件,建议自行使用代码防止重复点击,可以使用 js 防抖和节流实现。
|
|
218
228
|
* @supported alipay
|
|
@@ -293,6 +303,11 @@ declare namespace ButtonProps {
|
|
|
293
303
|
* @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getPhoneNumber.html
|
|
294
304
|
*/
|
|
295
305
|
getPhoneNumber
|
|
306
|
+
/**
|
|
307
|
+
* 手机号实时验证,向用户申请,并在用户同意后,快速填写和实时验证手机号。(*小程序插件中不能使用*)
|
|
308
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/getRealtimePhoneNumber.html
|
|
309
|
+
*/
|
|
310
|
+
getRealtimePhoneNumber
|
|
296
311
|
/** 获取用户信息,可以从回调中获取到用户信息 */
|
|
297
312
|
getUserInfo
|
|
298
313
|
/** 打开APP,可以通过 app-parameter 属性设定向APP传的参数
|
|
@@ -305,6 +320,10 @@ declare namespace ButtonProps {
|
|
|
305
320
|
feedback
|
|
306
321
|
/** 获取用户头像,可以从回调中获得具体信息 */
|
|
307
322
|
chooseAvatar
|
|
323
|
+
/**
|
|
324
|
+
* 用户同意隐私协议按钮。可通过 bindagreeprivacyauthorization 监听用户同意隐私协议事件
|
|
325
|
+
*/
|
|
326
|
+
agreePrivacyAuthorization
|
|
308
327
|
}
|
|
309
328
|
/** 支付宝小程序专属的 open-type 合法值
|
|
310
329
|
* @see https://opendocs.alipay.com/mini/component/button
|
|
@@ -426,6 +445,9 @@ declare namespace ButtonProps {
|
|
|
426
445
|
*/
|
|
427
446
|
sign: string
|
|
428
447
|
}
|
|
448
|
+
interface onGetRealTimePhoneNumberEventDetail {
|
|
449
|
+
code: string
|
|
450
|
+
}
|
|
429
451
|
interface onOpenSettingEventDetail {
|
|
430
452
|
/* 打开授权设置页的调用状态 */
|
|
431
453
|
errMsg: string
|
package/types/ScrollView.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ComponentType } from 'react'
|
|
2
|
-
import {
|
|
2
|
+
import { BaseEventOrigFunction, CommonEventFunction, StandardProps } from './common'
|
|
3
3
|
interface ScrollViewProps extends StandardProps {
|
|
4
4
|
/** 允许横向滚动
|
|
5
5
|
* @default false
|
|
@@ -157,7 +157,7 @@ interface ScrollViewProps extends StandardProps {
|
|
|
157
157
|
* center - 目标节点显示在视口中间
|
|
158
158
|
* end - 目标节点显示在视口结束处
|
|
159
159
|
* nearest - 目标节点在就近的视口边缘显示,若节点已在视口内则不触发滚动
|
|
160
|
-
* @supported weapp
|
|
160
|
+
* @supported weapp, h5
|
|
161
161
|
* @default 'start'
|
|
162
162
|
*/
|
|
163
163
|
scrollIntoViewAlignment?: 'start' | 'center' | 'end' | 'nearest'
|
package/types/index.vue3.d.ts
CHANGED
|
@@ -18,9 +18,9 @@ import { AdCustomProps } from './AdCustom'
|
|
|
18
18
|
import { AudioProps } from './Audio'
|
|
19
19
|
import { ButtonProps } from './Button'
|
|
20
20
|
import { CameraProps } from './Camera'
|
|
21
|
+
import { CanvasProps } from './Canvas'
|
|
21
22
|
import { ChannelLiveProps } from './ChannelLive'
|
|
22
23
|
import { ChannelVideoProps } from './ChannelVideo'
|
|
23
|
-
import { CanvasProps } from './Canvas'
|
|
24
24
|
import { CheckboxProps } from './Checkbox'
|
|
25
25
|
import { CheckboxGroupProps } from './CheckboxGroup'
|
|
26
26
|
import { StandardProps } from './common'
|
|
@@ -30,17 +30,20 @@ import { CustomWrapperProps } from './CustomWrapper'
|
|
|
30
30
|
import { EditorProps } from './Editor'
|
|
31
31
|
import { FormProps } from './Form'
|
|
32
32
|
import { FunctionalPageNavigatorProps } from './FunctionalPageNavigator'
|
|
33
|
+
import { GridViewProps } from './GridView'
|
|
33
34
|
import { IconProps } from './Icon'
|
|
34
35
|
import { ImageProps } from './Image'
|
|
35
36
|
import { InputProps } from './Input'
|
|
36
37
|
import { KeyboardAccessoryProps } from './KeyboardAccessory'
|
|
37
38
|
import { LabelProps } from './Label'
|
|
39
|
+
import { ListViewProps } from './ListView'
|
|
38
40
|
import { LivePlayerProps } from './LivePlayer'
|
|
39
41
|
import { LivePusherProps } from './LivePusher'
|
|
40
42
|
import { MapProps } from './Map'
|
|
41
43
|
import { MatchMediaProps } from './MatchMedia'
|
|
42
44
|
import { MovableAreaProps } from './MovableArea'
|
|
43
45
|
import { MovableViewProps } from './MovableView'
|
|
46
|
+
import { NativeSlotProps } from './NativeSlot'
|
|
44
47
|
import { NavigationBarProps } from './NavigationBar'
|
|
45
48
|
import { NavigatorProps } from './Navigator'
|
|
46
49
|
import { OfficialAccountProps } from './OfficialAccount'
|
|
@@ -52,14 +55,18 @@ import {
|
|
|
52
55
|
PickerRegionProps, PickerSelectorProps, PickerTimeProps
|
|
53
56
|
} from './Picker'
|
|
54
57
|
import { PickerViewProps } from './PickerView'
|
|
58
|
+
import { PickerViewColumnProps } from './PickerViewColumn'
|
|
55
59
|
import { ProgressProps } from './Progress'
|
|
56
60
|
import { RadioProps } from './Radio'
|
|
57
61
|
import { RadioGroupProps } from './RadioGroup'
|
|
58
62
|
import { RichTextProps } from './RichText'
|
|
63
|
+
import { RootPortalProps } from './RootPortal'
|
|
59
64
|
import { ScrollViewProps } from './ScrollView'
|
|
60
65
|
import { ShareElementProps } from './ShareElement'
|
|
61
66
|
import { SliderProps } from './Slider'
|
|
62
67
|
import { SlotProps } from './Slot'
|
|
68
|
+
import { StickyHeaderProps } from './StickyHeader'
|
|
69
|
+
import { StickySectionProps } from './StickySection'
|
|
63
70
|
import { SwiperProps } from './Swiper'
|
|
64
71
|
import { SwiperItemProps } from './SwiperItem'
|
|
65
72
|
import { SwitchProps } from './Switch'
|
|
@@ -69,16 +76,18 @@ import { VideoProps } from './Video'
|
|
|
69
76
|
import { ViewProps } from './View'
|
|
70
77
|
import { VoipRoomProps } from './VoipRoom'
|
|
71
78
|
import { WebViewProps } from './WebView'
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
|
|
80
|
+
/** 因为react的事件是CamelCase而vue得是Camelcase, 所以需要转换 */
|
|
81
|
+
type OnCamelCaseToOnCamelcase<T extends string> = T extends `on${infer Rest}`
|
|
82
|
+
? `on${Capitalize<Lowercase<Rest>>}`
|
|
83
|
+
: T;
|
|
84
|
+
|
|
85
|
+
type TransformCamelCase<T extends Record<string, any>> = {
|
|
86
|
+
[key in keyof T as OnCamelCaseToOnCamelcase<key>]: T[key]
|
|
87
|
+
}
|
|
79
88
|
|
|
80
89
|
/** 联合类型不能用omit(比如picker) */
|
|
81
|
-
type DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K
|
|
90
|
+
type DistributiveOmit<T, K extends keyof T> = T extends unknown ? TransformCamelCase<Omit<T, K>> : never
|
|
82
91
|
|
|
83
92
|
interface SlimProps {
|
|
84
93
|
class?: any
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as o,h as s,H as i,g as l}from"./p-9137dcab.js";import{c as r}from"./p-de951a46.js";import{d as e}from"./p-d3c7f87d.js";function c(t,o,s=500,i){if(t===o||"number"!=typeof t)return;const l=o-t,r=Date.now(),e=o>=t;!function c(){var h;h=Date.now()-r,t=l*h/s+t,e&&t>=o||!e&&o>=t?i(o):(i(t),requestAnimationFrame(c))}()}const h=class{constructor(s){t(this,s),this.onScroll=o(this,"scroll",3),this.onScrollToUpper=o(this,"scrolltoupper",3),this.onScrollToLower=o(this,"scrolltolower",3),this._scrollLeft=0,this._scrollTop=0,this.upperAndLower=e((()=>{const{offsetWidth:t,offsetHeight:o,scrollLeft:s,scrollTop:i,scrollHeight:l,scrollWidth:r}=this.el,e=Number(this.lowerThreshold),c=Number(this.upperThreshold);!isNaN(e)&&(this.scrollY&&o+i+e>=l||this.scrollX&&t+s+e>=r)&&this.onScrollToLower.emit({direction:this.scrollX?"right":this.scrollY?"bottom":""}),!isNaN(c)&&(this.scrollY&&i<=c||this.scrollX&&s<=c)&&this.onScrollToUpper.emit({direction:this.scrollX?"left":this.scrollY?"top":""})}),200),this.scrollX=!1,this.scrollY=!1,this.upperThreshold=50,this.lowerThreshold=50,this.mpScrollTop=void 0,this.mpScrollLeft=void 0,this.mpScrollIntoView=void 0,this.animated=!1}watchScrollLeft(t){const o=Number(t),{animated:s}=this;this.mpScrollToMethod({left:o,animated:s})}watchScrollTop(t){const o=Number(t),{animated:s}=this;this.mpScrollToMethod({top:o,animated:s})}watchScrollIntoView(t){this.mpScrollIntoViewMethod(t)}handleScroll(t){if(t instanceof CustomEvent)return;t.stopPropagation();const{scrollLeft:o,scrollTop:s,scrollHeight:i,scrollWidth:l}=this.el;this._scrollLeft=o,this._scrollTop=s,this.upperAndLower(),this.onScroll.emit({scrollLeft:o,scrollTop:s,scrollHeight:i,scrollWidth:l})}async mpScrollToMethod(t){let{top:o,left:s,duration:i,animated:l=!1}=t;this.scrollY&&"number"==typeof o&&!isNaN(o)&&o!==this._scrollTop&&(l?c(this._scrollTop,o,i,(t=>this.el.scrollTop=t)):this.el.scrollTop=o,this._scrollTop=o),this.scrollX&&"number"==typeof s&&!isNaN(s)&&s!==this._scrollLeft&&(l?c(this._scrollLeft,s,i,(t=>this.el.scrollLeft=t)):this.el.scrollLeft=s,this._scrollLeft=s)}async mpScrollIntoViewMethod(t){var o;"string"==typeof t&&t&&(null===(o=document.querySelector(`#${t}`))||void 0===o||o.scrollIntoView({behavior:"smooth",block:"center",inline:"start"}))}componentDidLoad(){const t=Number(this.mpScrollTop),o=Number(this.mpScrollLeft),{animated:s}=this;this.mpScrollToMethod({top:t,left:o,animated:s})}render(){const{scrollX:t,scrollY:o}=this,l=r({"taro-scroll-view__scroll-x":t,"taro-scroll-view__scroll-y":o});return s(i,{class:l},s("slot",null))}get el(){return l(this)}static get watchers(){return{mpScrollLeft:["watchScrollLeft"],mpScrollTop:["watchScrollTop"],mpScrollIntoView:["watchScrollIntoView"]}}};h.style="taro-scroll-view-core{display:block;width:100%;-webkit-overflow-scrolling:auto}taro-scroll-view-core::-webkit-scrollbar{display:none}.taro-scroll-view__scroll-x{overflow-x:scroll;overflow-y:hidden}.taro-scroll-view__scroll-y{overflow-x:hidden;overflow-y:scroll}";export{h as taro_scroll_view_core}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-7e6b54cb.system.js","./p-2ec68968.system.js"],(function(o){"use strict";var t,r,e,a,i,n;return{setters:[function(o){t=o.r;r=o.c;e=o.h;a=o.H;i=o.g},function(o){n=o.c}],execute:function(){var c='taro-button-core{display:block;overflow:hidden;position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;margin-left:auto;margin-right:auto;padding-left:14px;padding-right:14px;border-width:0;border-radius:5px;width:100%;-webkit-appearance:none;-moz-appearance:none;appearance:none;outline:0;background-color:#f8f8f8;line-height:2.55555556;text-decoration:none;text-align:center;font-size:18px;color:#000;-webkit-tap-highlight-color:rgba(0, 0, 0, 0)}taro-button-core:focus{outline:0}taro-button-core:not([disabled]):active{background-color:#dedede;color:rgba(0, 0, 0, 0.6)}taro-button-core::after{position:absolute;left:0;top:0;-webkit-box-sizing:border-box;box-sizing:border-box;border:1px solid rgba(0, 0, 0, 0.2);border-radius:10px;width:200%;height:200%;content:" ";-webkit-transform:scale(0.5);transform:scale(0.5);-webkit-transform-origin:0 0;transform-origin:0 0}taro-button-core+taro-button-core{margin-top:15px}taro-button-core[type=default]{background-color:#f8f8f8;color:#000}taro-button-core[type=default]:not([disabled]):visited{color:#000}taro-button-core[type=default]:not([disabled]):active{background-color:#dedede;color:rgba(0, 0, 0, 0.6)}taro-button-core[size=mini]{display:inline-block;padding:0 1.32em;width:auto;line-height:2.3;font-size:13px}taro-button-core[plain],taro-button-core[plain][type=default],taro-button-core[plain][type=primary]{border-width:1px;background-color:transparent}taro-button-core[disabled]{color:rgba(255, 255, 255, 0.6)}taro-button-core[disabled][type=default]{background-color:#f7f7f7;color:rgba(0, 0, 0, 0.3)}taro-button-core[disabled][type=primary]{background-color:#9ed99d}taro-button-core[disabled][type=warn]{background-color:#ec8b89}taro-button-core[loading] .weui-loading{margin:-0.2em 0.34em 0 0}taro-button-core[loading][type=primary],taro-button-core[loading][type=warn]{color:rgba(255, 255, 255, 0.6)}taro-button-core[loading][type=primary]{background-color:#179b16}taro-button-core[loading][type=warn]{background-color:#ce3c39}taro-button-core[plain][type=primary]{border:1px solid #1aad19;color:#1aad19}taro-button-core[plain][type=primary]:not([disabled]):active{border-color:rgba(26, 173, 25, 0.6);background-color:transparent;color:rgba(26, 173, 25, 0.6)}taro-button-core[plain][type=primary]::after{border-width:0}taro-button-core[plain],taro-button-core[plain][type=default]{border:1px solid #353535;color:#353535}taro-button-core[plain]:not([disabled]):active,taro-button-core[plain][type=default]:not([disabled]):active{border-color:rgba(53, 53, 53, 0.6);background-color:transparent;color:rgba(53, 53, 53, 0.6)}taro-button-core[plain]::after,taro-button-core[plain][type=default]::after{border-width:0}taro-button-core[type=primary]{background-color:#1aad19;color:#fff}taro-button-core[type=primary]:not([disabled]):visited{color:#fff}taro-button-core[type=primary]:not([disabled]):active{background-color:#179b16;color:rgba(255, 255, 255, 0.6)}taro-button-core[type=warn]{background-color:#e64340;color:#fff}taro-button-core[type=warn]:not([disabled]):visited{color:#fff}taro-button-core[type=warn]:not([disabled]):active{background-color:#ce3c39;color:rgba(255, 255, 255, 0.6)}taro-button-core[plain][disabled]{border:1px solid rgba(0, 0, 0, 0.2);background-color:#f7f7f7;color:rgba(0, 0, 0, 0.3)}taro-button-core[plain][disabled][type=primary]{border:1px solid rgba(0, 0, 0, 0.2);background-color:#f7f7f7;color:rgba(0, 0, 0, 0.3)}';var d=o("taro_button_core",function(){function o(o){t(this,o);this.onSubmit=r(this,"tarobuttonsubmit",7);this.onReset=r(this,"tarobuttonreset",7);this.disabled=undefined;this.hoverClass="button-hover";this.type="";this.hoverStartTime=20;this.hoverStayTime=70;this.size=undefined;this.plain=undefined;this.loading=false;this.formType=null;this.hover=false;this.touch=false}o.prototype.onClick=function(o){if(this.disabled){o.stopPropagation()}};o.prototype.onTouchStart=function(){var o=this;if(this.disabled){return}this.touch=true;if(this.hoverClass&&!this.disabled){setTimeout((function(){if(o.touch){o.hover=true}}),this.hoverStartTime)}};o.prototype.onTouchEnd=function(){var o=this;if(this.disabled){return}this.touch=false;if(this.hoverClass&&!this.disabled){setTimeout((function(){if(!o.touch){o.hover=false}}),this.hoverStayTime)}if(this.formType==="submit"){this.onSubmit.emit()}else if(this.formType==="reset"){this.onReset.emit()}};o.prototype.render=function(){var o;var t=this,r=t.disabled,i=t.hoverClass,c=t.type,d=t.size,b=t.plain,l=t.loading,s=t.hover;var u=n((o={},o["".concat(i)]=s&&!r,o));return e(a,{class:u,type:c,plain:b,loading:l,size:d,disabled:r},l&&e("i",{class:"weui-loading"}),e("slot",null))};Object.defineProperty(o.prototype,"el",{get:function(){return i(this)},enumerable:false,configurable:true});return o}());d.style=c}}}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,H as e}from"./p-9137dcab.js";import{c as s}from"./p-de951a46.js";import("./p-72f327e1.js");const a=class{constructor(o){t(this,o),this.onLoad=i(this,"load",7),this.onError=i(this,"error",7),this.src=void 0,this.mode="scaleToFill",this.lazyLoad=!1,this.nativeProps={},this.aspectFillMode="width"}componentDidLoad(){if(!this.lazyLoad)return;const t=new IntersectionObserver((i=>{i[i.length-1].isIntersecting&&(t.unobserve(this.imgRef),this.imgRef.src=this.src)}),{rootMargin:"300px 0px"});t.observe(this.imgRef)}imageOnLoad(){const{width:t,height:i,naturalWidth:o,naturalHeight:e}=this.imgRef;this.onLoad.emit({width:t,height:i}),this.aspectFillMode=o>e?"width":"height"}imageOnError(t){this.onError.emit(t)}render(){const{src:t,mode:i="scaleToFill",lazyLoad:a=!1,aspectFillMode:h="width",imageOnLoad:r,imageOnError:m,nativeProps:d}=this,g=s({"taro-img__widthfix":"widthFix"===i}),l=s(`taro-img__mode-${i.toLowerCase().replace(/\s/g,"")}`,{[`taro-img__mode-aspectfill--${h}`]:"aspectFill"===i});return o(e,{class:g},o("img",Object.assign(a?{ref:t=>this.imgRef=t,class:l,onLoad:r.bind(this),onError:m.bind(this)}:{ref:t=>this.imgRef=t,class:l,src:t,onLoad:r.bind(this),onError:m.bind(this)},d)))}};a.style='img[src=""]{opacity:0}taro-image-core{display:inline-block;overflow:hidden;position:relative;width:auto;height:auto;font-size:0}.taro-img.taro-img__widthfix{height:100%}.taro-img__mode-scaletofill{width:100%;height:100%}.taro-img__mode-aspectfit{max-width:100%;max-height:100%}.taro-img__mode-aspectfill{position:absolute;left:50%;top:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%)}.taro-img__mode-aspectfill--width{min-width:100%;height:100%}.taro-img__mode-aspectfill--height{width:100%;min-height:100%}.taro-img__mode-widthfix{width:100%}.taro-img__mode-heightfix{height:100%}.taro-img__mode-top{width:100%}.taro-img__mode-bottom{position:absolute;bottom:0;width:100%}.taro-img__mode-left{height:100%}.taro-img__mode-right{position:absolute;right:0;height:100%}.taro-img__mode-topright{position:absolute;right:0}.taro-img__mode-bottomleft{position:absolute;bottom:0}.taro-img__mode-bottomright{position:absolute;right:0;bottom:0}';export{a as taro_image_core}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as r}from"./p-9137dcab.js";import h from"@tarojs/taro";import{c as a}from"./p-de951a46.js";const o="undefined"!=typeof navigator&&/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),n={activate:"release",deactivate:"pull",release:"loading",finish:"finish"};let l=!1;try{const t=Object.defineProperty({},"passive",{get(){l=!0}});window.addEventListener("cancel",(()=>({})),t)}catch(t){}const c=!!l&&{passive:!1},d=class{constructor(s){t(this,s),this.onRefresh=i(this,"refresh",7),this._ScreenY=0,this._startScreenY=0,this._lastScreenY=0,this._isMounted=!1,this.triggerPullDownRefresh=t=>{!this.dragOnEdge&&this._isMounted&&(t?(this._lastScreenY=this.distanceToRefresh+1,this.currSt="release",this.setContentStyle(this._lastScreenY)):(this.currSt="finish",this.reset()))},this.init=()=>{const t=this.scrollContainer,i=this.el.querySelector("rmc-pull-to-refresh-content");this.el.appendChild=null==i?void 0:i.appendChild.bind(i),this.el.insertBefore=null==i?void 0:i.insertBefore.bind(i),this.el.replaceChild=null==i?void 0:i.replaceChild.bind(i),this.el.removeChild=null==i?void 0:i.removeChild.bind(i),this._to={touchstart:this.onTouchStart.bind(this,t),touchmove:this.onTouchMove.bind(this,t),touchend:this.onTouchEnd.bind(this,t),touchcancel:this.onTouchEnd.bind(this,t)},Object.keys(this._to).forEach((i=>{t.addEventListener(i,this._to[i],c)}))},this.destroy=()=>{const t=this.scrollContainer;Object.keys(this._to).forEach((i=>{t.removeEventListener(i,this._to[i])}))},this.onTouchStart=(t,i)=>{this._ScreenY=this._startScreenY=i.touches[0].screenY,this._lastScreenY=this._lastScreenY||0},this.isEdge=t=>{const i=this.scrollContainer;return i&&i===document.body?(document.scrollingElement?document.scrollingElement:document.body).scrollTop<=0:t.scrollTop<=0},this.damp=t=>Math.abs(this._lastScreenY)>this.damping?0:t*(.6*(1-Math.abs(this._ScreenY-this._startScreenY)/window.screen.height)),this.onTouchMove=(t,i)=>{const s=i.touches[0].screenY;if(!(this._startScreenY>s)&&this.isEdge(t)){this.dragOnEdge||(this._ScreenY=this._startScreenY=i.touches[0].screenY,this.dragOnEdge=!0),i.cancelable&&i.preventDefault();const t=Math.round(s-this._ScreenY);this._ScreenY=s,this._lastScreenY+=this.damp(t),this.setContentStyle(this._lastScreenY),Math.abs(this._lastScreenY)<this.distanceToRefresh?"deactivate"!==this.currSt&&(this.currSt="deactivate"):"deactivate"===this.currSt&&(this.currSt="activate"),o&&i.changedTouches[0].clientY<0&&this.onTouchEnd()}},this.onTouchEnd=()=>{this.dragOnEdge&&(this.dragOnEdge=!1),"activate"===this.currSt?(this.currSt="release",this.onRefresh.emit(this),this._lastScreenY=this.distanceToRefresh+1,this.setContentStyle(this._lastScreenY)):"release"===this.currSt?(this._lastScreenY=this.distanceToRefresh+1,this.setContentStyle(this._lastScreenY)):this.reset()},this.reset=()=>{this._lastScreenY=0,this.setContentStyle(0)},this.setContentStyle=t=>{var i,s;this.contentRef&&((i=this.contentRef.style).transform=s=t?`translate3d(0px,${t}px,0)`:"",i.webkitTransform=s,i.MozTransform=s)},this.prefixCls="rmc-pull-to-refresh",this.distanceToRefresh=50,this.damping=100,this.indicator=n,this.currSt="deactivate",this.dragOnEdge=!1}get scrollContainer(){return this.el.parentElement||this.el.closest(".taro_page_stationed")||document.querySelector(".taro_page_stationed")||document.querySelector(".taro_page")||document.querySelector(".taro_router")||document.querySelector(".taro-tabbar__panel")||document.body}statusChange(){var t,i,s,e;const r=this.scrollContainer;switch(this.currSt){case"release":null===(i=null===(t=null==r?void 0:r.__page)||void 0===t?void 0:t.onPullDownRefresh)||void 0===i||i.call(t);break;case"deactivate":null===(e=null===(s=null==r?void 0:r.__page)||void 0===s?void 0:s.onPullIntercept)||void 0===e||e.call(s)}}disconnectedCallback(){this.destroy()}componentDidLoad(){this.init(),this._isMounted=!0,h.eventCenter.on("__taroStartPullDownRefresh",(({successHandler:t,errorHandler:i})=>{try{this.triggerPullDownRefresh(!0),t({errMsg:"startPullDownRefresh: ok"})}catch(t){i({errMsg:"startPullDownRefresh: fail"})}})),h.eventCenter.on("__taroStopPullDownRefresh",(({successHandler:t,errorHandler:i})=>{try{this.triggerPullDownRefresh(!1),t({errMsg:"stopPullDownRefresh: ok"})}catch(t){i({errMsg:"stopPullDownRefresh: fail"})}}))}render(){const t=t=>{const{currSt:i,dragOnEdge:e,prefixCls:r}=this,h=a(t,!e&&`${r}-transition`);return s("div",{class:`${r}-content-wrapper`},s("div",{class:h,ref:t=>{this.contentRef=t}},("activate"===i||"release"===i)&&s("div",{class:`${r}-indicator`},s("div",null),s("div",null),s("div",null)),s("slot",null)))};return this.scrollContainer?t(`${this.prefixCls}-content ${this.prefixCls}-down`):s(e,{class:a(this.prefixCls,`${this.prefixCls}-down`)},t(`${this.prefixCls}-content`))}get el(){return r(this)}static get watchers(){return{currSt:["statusChange"]}}};d.style=".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0;transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{overflow:hidden;min-height:100vh}.rmc-pull-to-refresh-transition{-webkit-transition:-webkit-transform 0.3s;transition:-webkit-transform 0.3s;transition:transform 0.3s;transition:transform 0.3s, -webkit-transform 0.3s}@-webkit-keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{display:inline-block;margin:3px;border-radius:100%;width:6px;height:6px;background-color:grey;-webkit-animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;-webkit-animation-fill-mode:both;animation-fill-mode:both}.rmc-pull-to-refresh-indicator>div:nth-child(0){-webkit-animation-delay:-0.1s !important;animation-delay:-0.1s !important}.rmc-pull-to-refresh-indicator>div:nth-child(1){-webkit-animation-delay:-0.2s !important;animation-delay:-0.2s !important}.rmc-pull-to-refresh-indicator>div:nth-child(2){-webkit-animation-delay:-0.3s !important;animation-delay:-0.3s !important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}";export{d as taro_pull_to_refresh}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
System.register(["./p-7e6b54cb.system.js","@tarojs/taro","./p-2ec68968.system.js"],(function(e){"use strict";var t,r,n,i,o,a,s;return{setters:[function(e){t=e.r;r=e.c;n=e.h;i=e.H;o=e.g},function(e){a=e.default},function(e){s=e.c}],execute:function(){var c=".rmc-pull-to-refresh-content{-webkit-transform-origin:left top 0;transform-origin:left top 0}.rmc-pull-to-refresh-content-wrapper{overflow:hidden;min-height:100vh}.rmc-pull-to-refresh-transition{-webkit-transition:-webkit-transform 0.3s;transition:-webkit-transform 0.3s;transition:transform 0.3s;transition:transform 0.3s, -webkit-transform 0.3s}@-webkit-keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}@keyframes rmc-pull-to-refresh-indicator{50%{opacity:0.2}100%{opacity:1}}.rmc-pull-to-refresh-indicator{height:30px;line-height:10px;text-align:center}.rmc-pull-to-refresh-indicator>div{display:inline-block;margin:3px;border-radius:100%;width:6px;height:6px;background-color:grey;-webkit-animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;animation:rmc-pull-to-refresh-indicator 0.5s 0s infinite linear;-webkit-animation-fill-mode:both;animation-fill-mode:both}.rmc-pull-to-refresh-indicator>div:nth-child(0){-webkit-animation-delay:-0.1s !important;animation-delay:-0.1s !important}.rmc-pull-to-refresh-indicator>div:nth-child(1){-webkit-animation-delay:-0.2s !important;animation-delay:-0.2s !important}.rmc-pull-to-refresh-indicator>div:nth-child(2){-webkit-animation-delay:-0.3s !important;animation-delay:-0.3s !important}.rmc-pull-to-refresh-down .rmc-pull-to-refresh-indicator{margin-top:-25px}";function l(e,t){e.transform=t;e.webkitTransform=t;e.MozTransform=t}var u=typeof navigator!=="undefined"&&/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent);var d={activate:"release",deactivate:"pull",release:"loading",finish:"finish"};var f=false;try{var h=Object.defineProperty({},"passive",{get:function(){f=true}});window.addEventListener("cancel",(function(){return{}}),h)}catch(e){}var p=f?{passive:false}:false;var v=e("taro_pull_to_refresh",function(){function e(e){var n=this;t(this,e);this.onRefresh=r(this,"refresh",7);this._ScreenY=0;this._startScreenY=0;this._lastScreenY=0;this._isMounted=false;this.triggerPullDownRefresh=function(e){if(!n.dragOnEdge&&n._isMounted){if(e){n._lastScreenY=n.distanceToRefresh+1;n.currSt="release";n.setContentStyle(n._lastScreenY)}else{n.currSt="finish";n.reset()}}};this.init=function(){var e=n.scrollContainer;var t=n.el.querySelector("rmc-pull-to-refresh-content");n.el.appendChild=t===null||t===void 0?void 0:t.appendChild.bind(t);n.el.insertBefore=t===null||t===void 0?void 0:t.insertBefore.bind(t);n.el.replaceChild=t===null||t===void 0?void 0:t.replaceChild.bind(t);n.el.removeChild=t===null||t===void 0?void 0:t.removeChild.bind(t);n._to={touchstart:n.onTouchStart.bind(n,e),touchmove:n.onTouchMove.bind(n,e),touchend:n.onTouchEnd.bind(n,e),touchcancel:n.onTouchEnd.bind(n,e)};Object.keys(n._to).forEach((function(t){e.addEventListener(t,n._to[t],p)}))};this.destroy=function(){var e=n.scrollContainer;Object.keys(n._to).forEach((function(t){e.removeEventListener(t,n._to[t])}))};this.onTouchStart=function(e,t){n._ScreenY=n._startScreenY=t.touches[0].screenY;n._lastScreenY=n._lastScreenY||0};this.isEdge=function(e){var t=n.scrollContainer;if(t&&t===document.body){var r=document.scrollingElement?document.scrollingElement:document.body;return r.scrollTop<=0}return e.scrollTop<=0};this.damp=function(e){if(Math.abs(n._lastScreenY)>n.damping){return 0}var t=Math.abs(n._ScreenY-n._startScreenY)/window.screen.height;e*=(1-t)*.6;return e};this.onTouchMove=function(e,t){var r=t.touches[0].screenY;if(n._startScreenY>r){return}if(n.isEdge(e)){if(!n.dragOnEdge){n._ScreenY=n._startScreenY=t.touches[0].screenY;n.dragOnEdge=true}if(t.cancelable){t.preventDefault()}var i=Math.round(r-n._ScreenY);n._ScreenY=r;n._lastScreenY+=n.damp(i);n.setContentStyle(n._lastScreenY);if(Math.abs(n._lastScreenY)<n.distanceToRefresh){if(n.currSt!=="deactivate"){n.currSt="deactivate"}}else{if(n.currSt==="deactivate"){n.currSt="activate"}}if(u&&t.changedTouches[0].clientY<0){n.onTouchEnd()}}};this.onTouchEnd=function(){if(n.dragOnEdge){n.dragOnEdge=false}if(n.currSt==="activate"){n.currSt="release";n.onRefresh.emit(n);n._lastScreenY=n.distanceToRefresh+1;n.setContentStyle(n._lastScreenY)}else if(n.currSt==="release"){n._lastScreenY=n.distanceToRefresh+1;n.setContentStyle(n._lastScreenY)}else{n.reset()}};this.reset=function(){n._lastScreenY=0;n.setContentStyle(0)};this.setContentStyle=function(e){if(n.contentRef){if(e){l(n.contentRef.style,"translate3d(0px,".concat(e,"px,0)"))}else{l(n.contentRef.style,"")}}};this.prefixCls="rmc-pull-to-refresh";this.distanceToRefresh=50;this.damping=100;this.indicator=d;this.currSt="deactivate";this.dragOnEdge=false}Object.defineProperty(e.prototype,"scrollContainer",{get:function(){return this.el.parentElement||this.el.closest(".taro_page_stationed")||document.querySelector(".taro_page_stationed")||document.querySelector(".taro_page")||document.querySelector(".taro_router")||document.querySelector(".taro-tabbar__panel")||document.body},enumerable:false,configurable:true});e.prototype.statusChange=function(){var e,t,r,n;var i=this.scrollContainer;switch(this.currSt){case"release":(t=(e=i===null||i===void 0?void 0:i.__page)===null||e===void 0?void 0:e.onPullDownRefresh)===null||t===void 0?void 0:t.call(e);break;case"deactivate":(n=(r=i===null||i===void 0?void 0:i.__page)===null||r===void 0?void 0:r.onPullIntercept)===null||n===void 0?void 0:n.call(r)}};e.prototype.disconnectedCallback=function(){this.destroy()};e.prototype.componentDidLoad=function(){var e=this;this.init();this._isMounted=true;a.eventCenter.on("__taroStartPullDownRefresh",(function(t){var r=t.successHandler,n=t.errorHandler;try{e.triggerPullDownRefresh(true);r({errMsg:"startPullDownRefresh: ok"})}catch(e){n({errMsg:"startPullDownRefresh: fail"})}}));a.eventCenter.on("__taroStopPullDownRefresh",(function(t){var r=t.successHandler,n=t.errorHandler;try{e.triggerPullDownRefresh(false);r({errMsg:"stopPullDownRefresh: ok"})}catch(e){n({errMsg:"stopPullDownRefresh: fail"})}}))};e.prototype.render=function(){var e=this;var t=function(t){var r=e,i=r.currSt,o=r.dragOnEdge,a=r.prefixCls;var c=s(t,!o&&"".concat(a,"-transition"));var l=i==="activate"||i==="release";return n("div",{class:"".concat(a,"-content-wrapper")},n("div",{class:c,ref:function(t){e.contentRef=t}},l&&n("div",{class:"".concat(a,"-indicator")},n("div",null),n("div",null),n("div",null)),n("slot",null)))};if(this.scrollContainer){return t("".concat(this.prefixCls,"-content ").concat(this.prefixCls,"-down"))}return n(i,{class:s(this.prefixCls,"".concat(this.prefixCls,"-down"))},t("".concat(this.prefixCls,"-content")))};Object.defineProperty(e.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{currSt:["statusChange"]}},enumerable:false,configurable:true});return e}());v.style=c}}}));
|