@tarojs/components 3.5.0-theta.0 → 3.5.1
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/LICENSE +21 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/taro-components.cjs.js +1 -1
- package/dist/cjs/taro-input-core.cjs.entry.js +8 -1
- package/dist/cjs/taro-pull-to-refresh.cjs.entry.js +9 -5
- package/dist/cjs/taro-root-portal-core.cjs.entry.js +19 -0
- package/dist/cjs/taro-swiper-core_2.cjs.entry.js +1 -1
- package/dist/cjs/taro-tabbar.cjs.entry.js +7 -6
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/input/input.js +9 -0
- package/dist/collection/components/pull-to-refresh/pull-to-refresh.js +9 -5
- package/dist/collection/components/root-portal/root-portal.js +11 -0
- package/dist/collection/components/swiper/style/index.css +21 -9
- package/dist/collection/components/tabbar/tabbar.js +1 -6
- package/dist/esm/loader.js +1 -1
- package/dist/esm/polyfills/core-js.js +0 -0
- package/dist/esm/polyfills/dom.js +0 -0
- package/dist/esm/polyfills/es5-html-element.js +0 -0
- package/dist/esm/polyfills/index.js +0 -0
- package/dist/esm/polyfills/system.js +0 -0
- package/dist/esm/taro-components.js +1 -1
- package/dist/esm/taro-input-core.entry.js +8 -1
- package/dist/esm/taro-pull-to-refresh.entry.js +9 -5
- package/dist/esm/taro-root-portal-core.entry.js +15 -0
- package/dist/esm/taro-swiper-core_2.entry.js +1 -1
- package/dist/esm/taro-tabbar.entry.js +7 -6
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/taro-components.js +1 -1
- package/dist/esm-es5/taro-input-core.entry.js +1 -1
- package/dist/esm-es5/taro-pull-to-refresh.entry.js +1 -1
- package/dist/esm-es5/taro-root-portal-core.entry.js +1 -0
- package/dist/esm-es5/taro-swiper-core_2.entry.js +1 -1
- package/dist/esm-es5/taro-tabbar.entry.js +1 -1
- package/dist/taro-components/{p-c7dd3c92.entry.js → p-0f42b8a4.entry.js} +1 -1
- package/dist/taro-components/p-2241b671.system.js +1 -1
- package/dist/taro-components/{p-917830b4.system.entry.js → p-3e223f2f.system.entry.js} +1 -1
- package/dist/taro-components/p-430d72e8.entry.js +1 -0
- package/dist/taro-components/{p-a84098b5.system.entry.js → p-49954245.system.entry.js} +1 -1
- package/dist/taro-components/p-4ee47fc0.system.entry.js +1 -0
- package/dist/taro-components/p-69334f7c.entry.js +1 -0
- package/dist/taro-components/p-6e0a22dc.entry.js +1 -0
- package/dist/taro-components/p-88063d40.system.entry.js +1 -0
- package/dist/taro-components/p-a900b437.system.entry.js +1 -0
- package/dist/taro-components/{p-761d1085.entry.js → p-abb9c7d0.entry.js} +1 -1
- package/dist/taro-components/taro-components.esm.js +1 -1
- package/dist/types/components/input/input.d.ts +1 -0
- package/dist/types/components/root-portal/root-portal.d.ts +4 -0
- package/dist/types/components.d.ts +13 -0
- package/dist-h5/react/components/index.js +1 -0
- package/dist-h5/vue/components/index.js +1 -1
- package/dist-h5/vue/createComponent.js +1 -0
- package/dist-h5/vue/createFormsComponent.js +1 -1
- package/dist-h5/vue3/components/index.js +1 -0
- package/package.json +14 -12
- package/types/Button.d.ts +1 -1
- package/types/RootPortal.d.ts +32 -0
- package/types/View.d.ts +2 -2
- package/types/index.d.ts +1 -0
- package/types/index.vue3.d.ts +1 -0
- package/dist/taro-components/p-1c0ebbd5.entry.js +0 -1
- package/dist/taro-components/p-38d7c2e8.system.entry.js +0 -1
- package/dist/taro-components/p-79b16736.system.entry.js +0 -1
- package/dist/taro-components/p-a097985b.entry.js +0 -1
|
@@ -18,6 +18,7 @@ export declare class Input implements ComponentInterface {
|
|
|
18
18
|
nativeProps: {};
|
|
19
19
|
el: HTMLElement;
|
|
20
20
|
watchFocus(newValue: boolean, oldValue: boolean): void;
|
|
21
|
+
watchValue(newValue: string): void;
|
|
21
22
|
onInput: EventEmitter;
|
|
22
23
|
onPaste: EventEmitter;
|
|
23
24
|
onFocus: EventEmitter;
|
|
@@ -193,6 +193,8 @@ export namespace Components {
|
|
|
193
193
|
interface TaroRichTextCore {
|
|
194
194
|
"nodes": Nodes;
|
|
195
195
|
}
|
|
196
|
+
interface TaroRootPortalCore {
|
|
197
|
+
}
|
|
196
198
|
interface TaroScrollViewCore {
|
|
197
199
|
"lowerThreshold": number | string;
|
|
198
200
|
"mpScrollIntoView": string;
|
|
@@ -691,6 +693,12 @@ declare global {
|
|
|
691
693
|
prototype: HTMLTaroRichTextCoreElement;
|
|
692
694
|
new (): HTMLTaroRichTextCoreElement;
|
|
693
695
|
};
|
|
696
|
+
interface HTMLTaroRootPortalCoreElement extends Components.TaroRootPortalCore, HTMLStencilElement {
|
|
697
|
+
}
|
|
698
|
+
var HTMLTaroRootPortalCoreElement: {
|
|
699
|
+
prototype: HTMLTaroRootPortalCoreElement;
|
|
700
|
+
new (): HTMLTaroRootPortalCoreElement;
|
|
701
|
+
};
|
|
694
702
|
interface HTMLTaroScrollViewCoreElement extends Components.TaroScrollViewCore, HTMLStencilElement {
|
|
695
703
|
}
|
|
696
704
|
var HTMLTaroScrollViewCoreElement: {
|
|
@@ -829,6 +837,7 @@ declare global {
|
|
|
829
837
|
"taro-radio-core": HTMLTaroRadioCoreElement;
|
|
830
838
|
"taro-radio-group-core": HTMLTaroRadioGroupCoreElement;
|
|
831
839
|
"taro-rich-text-core": HTMLTaroRichTextCoreElement;
|
|
840
|
+
"taro-root-portal-core": HTMLTaroRootPortalCoreElement;
|
|
832
841
|
"taro-scroll-view-core": HTMLTaroScrollViewCoreElement;
|
|
833
842
|
"taro-share-element-core": HTMLTaroShareElementCoreElement;
|
|
834
843
|
"taro-slider-core": HTMLTaroSliderCoreElement;
|
|
@@ -1067,6 +1076,8 @@ declare namespace LocalJSX {
|
|
|
1067
1076
|
interface TaroRichTextCore {
|
|
1068
1077
|
"nodes"?: Nodes;
|
|
1069
1078
|
}
|
|
1079
|
+
interface TaroRootPortalCore {
|
|
1080
|
+
}
|
|
1070
1081
|
interface TaroScrollViewCore {
|
|
1071
1082
|
"lowerThreshold"?: number | string;
|
|
1072
1083
|
"mpScrollIntoView"?: string;
|
|
@@ -1354,6 +1365,7 @@ declare namespace LocalJSX {
|
|
|
1354
1365
|
"taro-radio-core": TaroRadioCore;
|
|
1355
1366
|
"taro-radio-group-core": TaroRadioGroupCore;
|
|
1356
1367
|
"taro-rich-text-core": TaroRichTextCore;
|
|
1368
|
+
"taro-root-portal-core": TaroRootPortalCore;
|
|
1357
1369
|
"taro-scroll-view-core": TaroScrollViewCore;
|
|
1358
1370
|
"taro-share-element-core": TaroShareElementCore;
|
|
1359
1371
|
"taro-slider-core": TaroSliderCore;
|
|
@@ -1417,6 +1429,7 @@ declare module "@stencil/core" {
|
|
|
1417
1429
|
"taro-radio-core": LocalJSX.TaroRadioCore & JSXBase.HTMLAttributes<HTMLTaroRadioCoreElement>;
|
|
1418
1430
|
"taro-radio-group-core": LocalJSX.TaroRadioGroupCore & JSXBase.HTMLAttributes<HTMLTaroRadioGroupCoreElement>;
|
|
1419
1431
|
"taro-rich-text-core": LocalJSX.TaroRichTextCore & JSXBase.HTMLAttributes<HTMLTaroRichTextCoreElement>;
|
|
1432
|
+
"taro-root-portal-core": LocalJSX.TaroRootPortalCore & JSXBase.HTMLAttributes<HTMLTaroRootPortalCoreElement>;
|
|
1420
1433
|
"taro-scroll-view-core": LocalJSX.TaroScrollViewCore & JSXBase.HTMLAttributes<HTMLTaroScrollViewCoreElement>;
|
|
1421
1434
|
"taro-share-element-core": LocalJSX.TaroShareElementCore & JSXBase.HTMLAttributes<HTMLTaroShareElementCoreElement>;
|
|
1422
1435
|
"taro-slider-core": LocalJSX.TaroSliderCore & JSXBase.HTMLAttributes<HTMLTaroSliderCoreElement>;
|
|
@@ -7,6 +7,7 @@ export var MatchMedia = reactifyWc('taro-match-media-core');
|
|
|
7
7
|
export var MovableArea = reactifyWc('taro-movable-area-core');
|
|
8
8
|
export var MovableView = reactifyWc('taro-movable-view-core');
|
|
9
9
|
export var PageContainer = reactifyWc('taro-page-container-core');
|
|
10
|
+
export var RootPortal = reactifyWc('taro-root-portal-core');
|
|
10
11
|
export var ScrollView = reactifyWc('taro-scroll-view-core');
|
|
11
12
|
export var ShareElement = reactifyWc('taro-share-element-core');
|
|
12
13
|
export var Swiper = reactifyWc('taro-swiper-core');
|
|
@@ -4,7 +4,7 @@ import Picker from './picker';
|
|
|
4
4
|
import ScrollView from './scroll-view';
|
|
5
5
|
import Text from './text';
|
|
6
6
|
var components = [// 视图容器
|
|
7
|
-
'taro-cover-image', 'taro-cover-view', 'taro-match-media', 'taro-movable-area', 'taro-movable-view', 'taro-page-container', ['taro-scroll-view', {
|
|
7
|
+
'taro-cover-image', 'taro-cover-view', 'taro-match-media', 'taro-movable-area', 'taro-movable-view', 'taro-page-container', 'taro-root-portal', ['taro-scroll-view', {
|
|
8
8
|
type: 'component',
|
|
9
9
|
component: ScrollView
|
|
10
10
|
}], 'taro-share-element', 'taro-swiper', ['taro-swiper-item', {
|
|
@@ -41,7 +41,7 @@ export default function createFormsComponent(name, event) {
|
|
|
41
41
|
render: function render(createElement) {
|
|
42
42
|
// eslint-disable-next-line
|
|
43
43
|
var self = this;
|
|
44
|
-
var attrs = {};
|
|
44
|
+
var attrs = this.$attrs || {};
|
|
45
45
|
|
|
46
46
|
if (name === 'taro-input') {
|
|
47
47
|
attrs['auto-focus'] = self.focus;
|
|
@@ -7,6 +7,7 @@ export var MatchMedia = createComponent('taro-match-media');
|
|
|
7
7
|
export var MovableArea = createComponent('taro-movable-area');
|
|
8
8
|
export var MovableView = createComponent('taro-movable-view');
|
|
9
9
|
export var PageContainer = createComponent('taro-page-container');
|
|
10
|
+
export var RootPortal = createComponent('taro-root-portal');
|
|
10
11
|
export { default as ScrollView } from './scroll-view';
|
|
11
12
|
export var ShareElement = createComponent('taro-share-element');
|
|
12
13
|
export var Swiper = createComponent('taro-swiper');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tarojs/components",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"browser": "dist/index.js",
|
|
6
6
|
"main:h5": "dist/index.js",
|
|
@@ -22,15 +22,6 @@
|
|
|
22
22
|
],
|
|
23
23
|
"collection": "dist/collection/collection-manifest.json",
|
|
24
24
|
"collection:main": "dist/collection/index.js",
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build-h5": "babel -d dist-h5 h5",
|
|
27
|
-
"build": "pnpm run build-h5 & stencil build --config stencil.config.ts",
|
|
28
|
-
"dev": "stencil build --config stencil.config.ts --watch",
|
|
29
|
-
"test": "karmatic --files '__tests__/setup.js,__tests__/**.spec.js' --coverage false",
|
|
30
|
-
"test:ci": "karmatic --files '__tests__/setup.js,__tests__/**.spec.js' --coverage false",
|
|
31
|
-
"test:debug": "karmatic debug --files '__tests__/setup.js,__tests__/**.spec.js' --coverage false",
|
|
32
|
-
"test:coverage": "karmatic --files '__tests__/setup.js,__tests__/**.spec.js'"
|
|
33
|
-
},
|
|
34
25
|
"repository": {
|
|
35
26
|
"type": "git",
|
|
36
27
|
"url": "git+https://github.com/NervJS/taro.git"
|
|
@@ -41,7 +32,8 @@
|
|
|
41
32
|
"dependencies": {
|
|
42
33
|
"@stencil/core": "~2.13.0",
|
|
43
34
|
"@stencil/sass": "1.5.2",
|
|
44
|
-
"@tarojs/taro": "
|
|
35
|
+
"@tarojs/taro": "3.5.1",
|
|
36
|
+
"@tarojs/router": "3.5.1",
|
|
45
37
|
"better-scroll": "^1.14.1",
|
|
46
38
|
"classnames": "^2.2.5",
|
|
47
39
|
"hls.js": "^1.1.5",
|
|
@@ -52,6 +44,7 @@
|
|
|
52
44
|
"weui": "^1.1.2"
|
|
53
45
|
},
|
|
54
46
|
"devDependencies": {
|
|
47
|
+
"css-loader": "3.4.2",
|
|
55
48
|
"jquery": "^3.4.1",
|
|
56
49
|
"karmatic": "^2.1.0",
|
|
57
50
|
"react": "^17.0.2",
|
|
@@ -71,5 +64,14 @@
|
|
|
71
64
|
"vue": {
|
|
72
65
|
"optional": true
|
|
73
66
|
}
|
|
67
|
+
},
|
|
68
|
+
"scripts": {
|
|
69
|
+
"build-h5": "babel -d dist-h5 h5",
|
|
70
|
+
"build": "pnpm run build-h5 & stencil build --config stencil.config.ts",
|
|
71
|
+
"dev": "stencil build --config stencil.config.ts --watch",
|
|
72
|
+
"test": "karmatic --files '__tests__/setup.js,__tests__/**.spec.js' --coverage false",
|
|
73
|
+
"test:ci": "karmatic --files '__tests__/setup.js,__tests__/**.spec.js' --coverage false",
|
|
74
|
+
"test:debug": "karmatic debug --files '__tests__/setup.js,__tests__/**.spec.js' --coverage false",
|
|
75
|
+
"test:coverage": "karmatic --files '__tests__/setup.js,__tests__/**.spec.js'"
|
|
74
76
|
}
|
|
75
|
-
}
|
|
77
|
+
}
|
package/types/Button.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ interface ButtonProps extends StandardProps {
|
|
|
50
50
|
*/
|
|
51
51
|
hoverClass?: string
|
|
52
52
|
|
|
53
|
-
/** 由于 RN 不支持
|
|
53
|
+
/** 由于 RN 不支持 hoverClass,故 RN 端的 Button 组件实现了 `hoverStyle`属性,写法和 style 类似,只不过 `hoverStyle` 的样式是指定按下去的样式。
|
|
54
54
|
* @default none
|
|
55
55
|
* @supported rn
|
|
56
56
|
*/
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { ComponentType } from 'react'
|
|
2
|
+
|
|
3
|
+
/** root-portal
|
|
4
|
+
* 使整个子树从页面中脱离出来,类似于在 CSS 中使用 fixed position 的效果。主要用于制作弹窗、弹出层等。
|
|
5
|
+
* @see https://developers.weixin.qq.com/miniprogram/dev/component/root-portal.html
|
|
6
|
+
* @supported weapp
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { useState } from 'react'
|
|
10
|
+
* import { RootPortal, View, Button } from '@tarojs/components'
|
|
11
|
+
*
|
|
12
|
+
* export default function RootPortalExample {
|
|
13
|
+
* const [show, setShow] = useState(false)
|
|
14
|
+
* const toggle = () => {
|
|
15
|
+
* setShow(!show)
|
|
16
|
+
* }
|
|
17
|
+
* render () {
|
|
18
|
+
* return (
|
|
19
|
+
* <View>
|
|
20
|
+
* <Button onClick={toggle}>显示root-portal</Button>
|
|
21
|
+
* {
|
|
22
|
+
* show && (<RootPortal><View>content</View></RootPortal>)
|
|
23
|
+
* }
|
|
24
|
+
* </View>
|
|
25
|
+
* )
|
|
26
|
+
* }
|
|
27
|
+
* }
|
|
28
|
+
* ```
|
|
29
|
+
*/
|
|
30
|
+
declare const RootPortal: ComponentType
|
|
31
|
+
|
|
32
|
+
export { RootPortal }
|
package/types/View.d.ts
CHANGED
|
@@ -6,11 +6,11 @@ interface ViewProps extends StandardProps {
|
|
|
6
6
|
/** 指定按下去的样式类。当 `hover-class="none"` 时,没有点击态效果
|
|
7
7
|
* @default none
|
|
8
8
|
* @supported weapp, swan, alipay, tt, h5
|
|
9
|
-
* @rn 由于 RN 不支持
|
|
9
|
+
* @rn 由于 RN 不支持 hoverClass,故 RN 端的 View 组件实现了 `hoverStyle`属性,写法和 style 类似,只不过 `hoverStyle` 的样式是指定按下去的样式。
|
|
10
10
|
*/
|
|
11
11
|
hoverClass?: string
|
|
12
12
|
|
|
13
|
-
/** 由于 RN 不支持
|
|
13
|
+
/** 由于 RN 不支持 hoverClass,故 RN 端的 View 组件实现了 `hoverStyle`属性,写法和 style 类似,只不过 `hoverStyle` 的样式是指定按下去的样式。
|
|
14
14
|
* @default none
|
|
15
15
|
* @supported rn
|
|
16
16
|
*/
|
package/types/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export { MatchMedia } from './MatchMedia'
|
|
|
10
10
|
export { MovableArea } from './MovableArea'
|
|
11
11
|
export { MovableView } from './MovableView'
|
|
12
12
|
export { PageContainer } from './PageContainer'
|
|
13
|
+
export { RootPortal } from './RootPortal'
|
|
13
14
|
export { ScrollView } from './ScrollView'
|
|
14
15
|
export { ShareElement } from './ShareElement'
|
|
15
16
|
export { Swiper } from './Swiper'
|
package/types/index.vue3.d.ts
CHANGED
|
@@ -101,6 +101,7 @@ export declare const MatchMedia: VueComponentType<MatchMediaProps>
|
|
|
101
101
|
export declare const MovableArea: VueComponentType<MovableAreaProps>
|
|
102
102
|
export declare const MovableView: VueComponentType<MovableViewProps>
|
|
103
103
|
export declare const PageContainer: VueComponentType<PageContainerProps>
|
|
104
|
+
export declare const RootPortal: VueComponentType
|
|
104
105
|
export declare const ScrollView: VueComponentType<ScrollViewProps>
|
|
105
106
|
export declare const ShareElement: VueComponentType<ShareElementProps>
|
|
106
107
|
export declare const Swiper: VueComponentType<SwiperProps>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as e,g as r}from"./p-a4721ae0.js";import h from"@tarojs/taro";import{c as a}from"./p-76724e58.js";const n="undefined"!=typeof navigator&&/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(navigator.userAgent),o={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};let d=class{constructor(s){t(this,s),this.onRefresh=i(this,"refresh",7),this.prefixCls="rmc-pull-to-refresh",this.distanceToRefresh=50,this.damping=100,this.indicator=o,this.currSt="deactivate",this.dragOnEdge=!1,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"),n&&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)}}get scrollContainer(){return this.el.parentElement||document.querySelector(".taro_page_stationed")||document.querySelector(".taro_page")||document.querySelector(".taro_router")||document.querySelector(".taro-tabbar__panel")||document.body}statusChange(){if("release"===this.currSt){const t=this.el.closest(".taro_page");t&&t.__page&&t.__page.onPullDownRefresh()}}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
|
-
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-83adb645.system.js","@tarojs/taro","./p-61f225ef.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(){var l=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};function d(e){return e.charAt(0)==="/"}function b(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 h(e,t){if(t===undefined)t="";var r=e&&e.split("/")||[];var a=t&&t.split("/")||[];var o=e&&d(e);var n=t&&d(t);var i=o||n;if(e&&d(e)){a=r}else if(r.length){a.pop();a=a.concat(r)}if(!a.length)return"/";var s;if(a.length){var l=a[a.length-1];s=l==="."||l===".."||l===""}else{s=false}var h=0;for(var f=a.length;f>=0;f--){var c=a[f];if(c==="."){b(a,f)}else if(c===".."){b(a,f);h++}else if(h){b(a,f);h--}}if(!i)for(;h--;h)a.unshift("..");if(i&&a[0]!==""&&(!a[0]||!d(a[0])))a.unshift("");var u=a.join("/");if(s&&u.substr(-1)!=="/")u+="/";return u}var f=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,f=e.onSelect;var c=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(){f(r)}return t("a",{key:r,href:"javascript:;",class:c,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 c="html,body{height:100%}#app{height:100%}.taro-tabbar__border-white::before{border-top-color:#fff !important}.taro-tabbar__container{display:-ms-flexbox;display:flex;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 u=function(e){if(e===void 0){e=""}return e[0]==="/"?e:"/"+e};var v=function(e,t){if(e===void 0){e=""}if(t===void 0){t=""}return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)};var g=function(e,t){if(e===void 0){e=""}if(t===void 0){t=""}return v(e,t)?e.substr(t.length):e};var _=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 p=0;var m=1;var T=2;var B="taro-tabbar__tabbar";var H="taro-tabbar__tabbar-hide";var x="taro-tabbar__tabbar-slideout";var w=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=p;this.getOriginUrl=function(e){var r=t.customRoutes.filter((function(t){var r=t[1];var a=l(r).path;var o=l(e).path;return a===o}));return _(r.length?r[0][0]:e,".html")};this.getSelectedIndex=function(e){var r=-1;t.list.forEach((function(t,a){var o=t.pagePath;var n=l(e).path;var i=l(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=h(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=(r=e===null||e===void 0?void 0:e.toLocation)===null||r===void 0?void 0:r.path;var o;if(typeof a==="string"){var n=t.conf.basename||"/";o=g(u(a||t.homePage),n)||"/"}else{o=t.getCurrentUrl()}t.selectedIndex=t.getSelectedIndex(t.getOriginUrl(o))};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=p;r({errMsg:"showTabBar:ok"})};this.hideTabBarHandler=function(e){var r=e.animation,a=e.successHandler;t.status=r?T:m;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"){d.customRoutes.push([e,u(r)])}else if((r===null||r===void 0?void 0:r.length)>0){(t=d.customRoutes).push.apply(t,r.map((function(t){return[e,u(t)]})))}};var d=this;for(var b in n){s(b)}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 decodeURI(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===m;var h=l===T;return t(o,{class:s(B,B+"-"+i,(r={},r[H]=b,r[x]=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(f,{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}());w.style=c}}}));
|