-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e8b3f70
commit e3c91d0
Showing
14 changed files
with
424 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-map-core' | ||
}) | ||
export class Map { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 Map 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
import { Component, h, Host } from '@stencil/core' | ||
|
||
@Component({ | ||
tag: 'taro-slot-core' | ||
}) | ||
export class Slot { | ||
componentDidLoad () { | ||
console.error('H5 暂不支持 Slot 组件!') | ||
} | ||
|
||
render () { | ||
return ( | ||
<Host /> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import { ComponentType } from 'react' | ||
import { StandardProps, CommonEventFunction } from './common' | ||
import { AdProps } from './Ad' | ||
|
||
interface AdCustomProps extends StandardProps { | ||
/** 广告单元id,可在[小程序管理后台](https://mp.weixin.qq.com/)的流量主模块新建 | ||
* @supported weapp | ||
*/ | ||
unitId: string | ||
|
||
/** 广告自动刷新的间隔时间,单位为秒,参数值必须大于等于30(该参数不传入时 Banner 广告不会自动刷新) | ||
* @supported weapp | ||
*/ | ||
adIntervals?: number | ||
|
||
/** 广告加载成功的回调 | ||
* @supported weapp | ||
*/ | ||
onLoad?: CommonEventFunction | ||
|
||
/** 当广告发生错误时,触发的事件,可以通过该事件获取错误码及原因,事件对象event.detail = {errCode: 1002} | ||
* @supported weapp | ||
*/ | ||
onError?: CommonEventFunction<AdProps.onErrorEventDetail> | ||
} | ||
|
||
/** Banner 广告 | ||
* @classification open | ||
* @supported weapp | ||
* @example | ||
* ```tsx | ||
* class App extends Component { | ||
* render () { | ||
* return ( | ||
* <AdCustom | ||
* unitId='' | ||
* adIntervals={60} | ||
* onLoad={() => console.log('ad onLoad')} | ||
* onError={() => console.log('ad onError')} | ||
* onClose={() => console.log('ad onClose')} | ||
* /> | ||
* ) | ||
* } | ||
* } | ||
* ``` | ||
* @see https://developers.weixin.qq.com/miniprogram/dev/component/ad.html | ||
*/ | ||
declare const AdCustom: ComponentType<AdCustomProps> | ||
|
||
export { AdCustom, AdCustomProps } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { ComponentType } from 'react' | ||
import { StandardProps, CommonEventFunction } from './common' | ||
|
||
type KeyboardAccessoryProps = StandardProps | ||
|
||
/** 设置 input / textarea 聚焦时键盘上方 cover-view / cover-image 工具栏视图 | ||
* | ||
* @classification forms | ||
* @supported weapp | ||
* @example | ||
* ```tsx | ||
* class App extends Component { | ||
* render () { | ||
* return ( | ||
* <Textarea holdKeyboard="{{true}}"> | ||
* <KeyboardAccessory className="container" style={{ height: 50 }} > | ||
* <CoverView onClick={() => { TODO }} style={{ flex: 1, background: 'green' }}>1</CoverView> | ||
* <CoverView onClick={() => { TODO }} style={{ flex: 1, background: 'red' }}>2</CoverView> | ||
* </KeyboardAccessory> | ||
* </Textarea> | ||
* ) | ||
* } | ||
* } | ||
* ``` | ||
* @see https://developers.weixin.qq.com/miniprogram/dev/component/keyboard-accessory.html | ||
*/ | ||
declare const KeyboardAccessory: ComponentType<KeyboardAccessoryProps> | ||
|
||
export { KeyboardAccessory, KeyboardAccessoryProps } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
import { ComponentType } from 'react' | ||
import { StandardProps, CommonEventFunction, BaseEventOrigFunction } from './common' | ||
|
||
interface PageContainerProps extends StandardProps { | ||
/** 是否显示容器组件 | ||
* @default false | ||
* @supported weapp | ||
*/ | ||
show?: boolean | ||
|
||
/** 动画时长,单位毫秒 | ||
* @default 300 | ||
* @supported weapp | ||
*/ | ||
duration?: number | ||
|
||
/** z-index 层级 | ||
* @default 100 | ||
* @supported weapp | ||
*/ | ||
zIndex?: number | ||
|
||
/** 是否显示遮罩层 | ||
* @default true | ||
* @supported weapp | ||
*/ | ||
overlay?: boolean | ||
|
||
/** 弹出位置,可选值为 top bottom right center | ||
* @default bottom | ||
* @supported weapp | ||
*/ | ||
position?: keyof PageContainerProps.position | ||
|
||
/** 是否显示圆角 | ||
* @default false | ||
* @supported weapp | ||
*/ | ||
round?: boolean | ||
|
||
/** 自定义遮罩层样式 | ||
* @default false | ||
* @supported weapp | ||
*/ | ||
closeOnSlideDown?: boolean | ||
|
||
/** 是否在下滑一段距离后关闭 | ||
* @supported weapp | ||
*/ | ||
overlayStyle?: boolean | ||
|
||
/** 自定义弹出层样式 | ||
* @supported weapp | ||
*/ | ||
customStyle?: boolean | ||
|
||
/** 进入前触发 | ||
* @supported weapp | ||
*/ | ||
onBeforeEnter?: CommonEventFunction | ||
|
||
/** 进入中触发 | ||
* @supported weapp | ||
*/ | ||
onEnter?: CommonEventFunction | ||
|
||
/** 进入后触发 | ||
* @supported weapp | ||
*/ | ||
onAfterEnter?: CommonEventFunction | ||
|
||
/** 离开前触发 | ||
* @supported weapp | ||
*/ | ||
onBeforeLeave?: CommonEventFunction | ||
|
||
/** 离开中触发 | ||
* @supported weapp | ||
*/ | ||
onLeave?: CommonEventFunction | ||
|
||
/** 离开后触发 | ||
* @supported weapp | ||
*/ | ||
onAfterLeave?: CommonEventFunction | ||
|
||
/** 点击遮罩层时触发 | ||
* @supported weapp | ||
*/ | ||
onClickOverlay?: CommonEventFunction | ||
} | ||
|
||
declare namespace PageContainerProps { | ||
interface position { | ||
top | ||
bottom | ||
left | ||
right | ||
} | ||
} | ||
|
||
/** 页面容器 | ||
* | ||
* 小程序如果在页面内进行复杂的界面设计(如在页面内弹出半屏的弹窗、在页面内加载一个全屏的子页面等),用户进行返回操作会直接离开当前页面,不符合用户预期,预期应为关闭当前弹出的组件。 | ||
* 为此提供“假页”容器组件,效果类似于 `popup` 弹出层,页面内存在该容器时,当用户进行返回操作,关闭该容器不关闭页面。返回操作包括三种情形,右滑手势、安卓物理返回键和调用 `navigateBack` 接口。 | ||
* | ||
* Bug & Tip | ||
* 1. tip: 当前页面最多只有 1 个容器,若已存在容器的情况下,无法增加新的容器 | ||
* 2. tip: wx.navigateBack 无法在页面栈顶调用,此时没有上一级页面 | ||
* @classification viewContainer | ||
* @see https://developers.weixin.qq.com/miniprogram/dev/component/page-container.html | ||
*/ | ||
declare const PageContainer: ComponentType<PageContainerProps> | ||
|
||
export { PageContainer, PageContainerProps } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { ComponentType } from 'react' | ||
import { StandardProps, CommonEventFunction } from './common' | ||
|
||
interface ShareElementProps extends StandardProps { | ||
/** 映射标记 | ||
* @supported weapp | ||
*/ | ||
key: string | ||
|
||
/** 是否进行动画 | ||
* @default false | ||
* @supported weapp | ||
*/ | ||
transform?: boolean | ||
|
||
/** 动画时长,单位毫秒 | ||
* @default 300 | ||
* @supported weapp | ||
*/ | ||
duration?: number | ||
|
||
/** css缓动函数 | ||
* @default ease-out | ||
* @supported weapp | ||
*/ | ||
easingFunction?: number | ||
} | ||
|
||
/** 共享元素 | ||
* | ||
* 共享元素是一种动画形式,类似于 [`flutter Hero`](https://flutterchina.club/animations/hero-animations/) 动画,表现为元素像是在页面间穿越一样。该组件需与 [`page-container`](https://developers.weixin.qq.com/miniprogram/dev/component/page-container.html) 组件结合使用。 | ||
* 使用时需在当前页放置 `share-element` 组件,同时在 `page-container` 容器中放置对应的 `share-element` 组件,对应关系通过属性值 key 映射。当设置 `page-container` `显示时,transform` 属性为 `true` 的共享元素会产生动画。当前页面容器退出时,会产生返回动画。 | ||
* @classification viewContainer | ||
* @supported weapp | ||
* @see https://developers.weixin.qq.com/miniprogram/dev/component/share-element.html | ||
*/ | ||
declare const ShareElement: ComponentType<ShareElementProps> | ||
|
||
export { ShareElement, ShareElementProps } |
Oops, something went wrong.