Skip to content

Commit a262dcb

Browse files
authored
feat: 补全京东小程序组件和类型:Editor、PageContainer、RootPortal、MatchMedia、RichText (#16736)
* feat: 补全京东小程序组件 * test: update snapshoot
1 parent c378497 commit a262dcb

File tree

7 files changed

+141
-107
lines changed

7 files changed

+141
-107
lines changed

packages/taro-components/types/Editor.d.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -3,48 +3,48 @@ import { StandardProps, CommonEventFunction } from './common'
33
interface EditorProps extends StandardProps {
44
/** 设置编辑器为只读
55
* @default false
6-
* @supported weapp
6+
* @supported weapp, jd
77
*/
88
readOnly?: boolean
99
/** 提示信息
10-
* @supported weapp
10+
* @supported weapp, jd
1111
*/
1212
placeholder?: string
1313
/** 点击图片时显示图片大小控件
1414
* @default false
15-
* @supported weapp
15+
* @supported weapp, jd
1616
*/
1717
showImgSize?: boolean
1818
/** 点击图片时显示工具栏控件
1919
* @default false
20-
* @supported weapp
20+
* @supported weapp, jd
2121
*/
2222
showImgToolbar?: boolean
2323
/** 点击图片时显示修改尺寸控件
2424
* @default false
25-
* @supported weapp
25+
* @supported weapp, jd
2626
*/
2727
showImgResize?: boolean
2828
/** 编辑器初始化完成时触发
29-
* @supported weapp
29+
* @supported weapp, jd
3030
*/
3131
onReady?: CommonEventFunction
3232
/** 编辑器聚焦时触发
33-
* @supported weapp
33+
* @supported weapp, jd
3434
*/
3535
onFocus?: CommonEventFunction<EditorProps.editorEventDetail>
3636
/** 编辑器失去焦点时触发
3737
* detail = { html, text, delta }
38-
* @supported weapp
38+
* @supported weapp, jd
3939
*/
4040
onBlur?: CommonEventFunction<EditorProps.editorEventDetail>
4141
/** 编辑器内容改变时触发
4242
* detail = { html, text, delta }
43-
* @supported weapp
43+
* @supported weapp, jd
4444
*/
4545
onInput?: CommonEventFunction<EditorProps.editorEventDetail>
4646
/** 通过 Context 方法改变编辑器内样式时触发,返回选区已设置的样式
47-
* @supported weapp
47+
* @supported weapp, jd
4848
*/
4949
onStatusChange?: CommonEventFunction
5050
}
@@ -67,7 +67,7 @@ declare namespace EditorProps {
6767
*
6868
* *编辑器内支持部分 HTML 标签和内联样式,不支持 **class** 和 **id***
6969
* @classification forms
70-
* @supported weapp
70+
* @supported weapp, jd
7171
* @example_react
7272
* ```tsx
7373
* class App extends Components {

packages/taro-components/types/MatchMedia.d.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,37 @@ import { ComponentType } from 'react'
22
import { StandardProps } from './common'
33
interface MatchMediaProps extends StandardProps {
44
/** 页面最小宽度( px 为单位)
5-
* @supported weapp, alipay
5+
* @supported weapp, alipay, jd
66
*/
77
minWidth?: number
88
/** 页面最大宽度( px 为单位)
9-
* @supported weapp, alipay
9+
* @supported weapp, alipay, jd
1010
*/
1111
maxWidth?: number
1212
/** 页面宽度( px 为单位)
13-
* @supported weapp, alipay
13+
* @supported weapp, alipay, jd
1414
*/
1515
width?: number
1616
/** 页面最小高度( px 为单位)
17-
* @supported weapp, alipay
17+
* @supported weapp, alipay, jd
1818
*/
1919
minHeight?: number
2020
/** 页面最大高度( px 为单位)
21-
* @supported weapp, alipay
21+
* @supported weapp, alipay, jd
2222
*/
2323
maxHeight?: number
2424
/** 页面高度( px 为单位)
25-
* @supported weapp, alipay
25+
* @supported weapp, alipay, jd
2626
*/
2727
height?: number
2828
/** 屏幕方向( landscape 或 portrait )
29-
* @supported weapp, alipay
29+
* @supported weapp, alipay, jd
3030
*/
3131
orientation?: string
3232
}
3333
/** media query 匹配检测节点。可以指定一组 media query 规则,满足时,这个节点才会被展示。
3434
* 通过这个节点可以实现“页面宽高在某个范围时才展示某个区域”这样的效果。
35-
* @supported weapp, alipay
35+
* @supported weapp, alipay, jd
3636
* @classification viewContainer
3737
* @example_react
3838
* ```tsx

packages/taro-components/types/PageContainer.d.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ import { StandardProps, CommonEventFunction } from './common'
33
interface PageContainerProps extends StandardProps {
44
/** 是否显示容器组件
55
* @default false
6-
* @supported weapp, alipay, rn
6+
* @supported weapp, alipay, jd, rn
77
*/
88
show?: boolean
99
/** 动画时长,单位毫秒
1010
* @default 300
11-
* @supported weapp, alipay, rn
11+
* @supported weapp, alipay, jd, rn
1212
*/
1313
duration?: number
1414
/** z-index 层级
@@ -18,58 +18,58 @@ interface PageContainerProps extends StandardProps {
1818
zIndex?: number
1919
/** 是否显示遮罩层
2020
* @default true
21-
* @supported weapp, alipay, rn
21+
* @supported weapp, alipay, jd, rn
2222
*/
2323
overlay?: boolean
2424
/** 弹出位置,可选值为 top bottom right center
2525
* @default bottom
26-
* @supported weapp, alipay, rn
26+
* @supported weapp, alipay, jd, rn
2727
*/
2828
position?: keyof PageContainerProps.Position
2929
/** 是否显示圆角
3030
* @default false
31-
* @supported weapp, alipay, rn
31+
* @supported weapp, alipay, jd, rn
3232
*/
3333
round?: boolean
3434
/** 自定义遮罩层样式
35-
* @supported weapp, alipay, rn
35+
* @supported weapp, alipay, jd, rn
3636
*/
3737
overlayStyle?: string
3838
/** 自定义弹出层样式
39-
* @supported weapp, alipay, rn
39+
* @supported weapp, alipay, jd, rn
4040
*/
4141
customStyle?: string
4242
/** 是否在下滑一段距离后关闭
43-
* @supported weapp, alipay
43+
* @supported weapp, alipay, jd
4444
* @default false
4545
*/
4646
closeOnSlideDown?: boolean
4747
/** 进入前触发
48-
* @supported weapp, alipay, rn
48+
* @supported weapp, alipay, jd, rn
4949
*/
5050
onBeforeEnter?: CommonEventFunction
5151
/** 进入中触发
52-
* @supported weapp, alipay, rn
52+
* @supported weapp, alipay, jd, rn
5353
*/
5454
onEnter?: CommonEventFunction
5555
/** 进入后触发
56-
* @supported weapp, alipay, rn
56+
* @supported weapp, alipay, jd, rn
5757
*/
5858
onAfterEnter?: CommonEventFunction
5959
/** 离开前触发
60-
* @supported weapp, alipay, rn
60+
* @supported weapp, alipay, jd, rn
6161
*/
6262
onBeforeLeave?: CommonEventFunction
6363
/** 离开中触发
64-
* @supported weapp, alipay, rn
64+
* @supported weapp, alipay, jd, rn
6565
*/
6666
onLeave?: CommonEventFunction
6767
/** 离开后触发
68-
* @supported weapp, alipay, rn
68+
* @supported weapp, alipay, jd, rn
6969
*/
7070
onAfterLeave?: CommonEventFunction
7171
/** 点击遮罩层时触发
72-
* @supported weapp, alipay
72+
* @supported weapp, alipay, jd
7373
*/
7474
onClickOverlay?: CommonEventFunction
7575
/** 进入被打断时触发(通过 a: if 打断时不会触发)。
@@ -103,7 +103,7 @@ declare namespace PageContainerProps {
103103
* 1. tip: 当前页面最多只有 1 个容器,若已存在容器的情况下,无法增加新的容器
104104
* 2. tip: wx.navigateBack 无法在页面栈顶调用,此时没有上一级页面
105105
* @classification viewContainer
106-
* @supported weapp, alipay, rn
106+
* @supported weapp, alipay, jd, rn
107107
* @see https://developers.weixin.qq.com/miniprogram/dev/component/page-container.html
108108
*/
109109
declare const PageContainer: ComponentType<PageContainerProps>

packages/taro-components/types/RichText.d.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ import { CommonEventFunction, StandardProps } from './common'
33
interface RichTextProps extends StandardProps {
44
/** 文本是否可选,该属性会使节点显示为 block
55
* @default false
6-
* @supported weapp, h5, harmony_hybrid
6+
* @supported weapp, jd, h5, harmony_hybrid
77
*/
88
userSelect?: boolean
99
/** 节点列表/ HTML String
10-
* @supported weapp, alipay, swan, tt, qq, h5, rn, harmony, harmony_hybrid
10+
* @supported weapp, jd, alipay, swan, tt, qq, h5, rn, harmony, harmony_hybrid
1111
*/
1212
nodes?: Nodes
1313
/** 显示连续空格
14-
* @supported weapp, alipay, tt, qq, h5, rn, harmony_hybrid
14+
* @supported weapp, jd, alipay, tt, qq, h5, rn, harmony_hybrid
1515
*/
1616
space?: keyof RichTextProps.TSpace
1717
/** 富文本是否可以长按选中,可用于复制,粘贴,长按搜索等场景
@@ -99,7 +99,7 @@ declare namespace RichTextProps {
9999
}
100100
/** 富文本
101101
* @classification base
102-
* @supported weapp, swan, alipay, tt, h5, rn, harmony, harmony_hybrid
102+
* @supported weapp, jd, swan, alipay, tt, h5, rn, harmony, harmony_hybrid
103103
* @example_react
104104
* ```tsx
105105
* class App extends Components {

packages/taro-platform-jd/src/components-react.ts

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ export * from '@tarojs/components/mini'
33
export const Editor = 'editor'
44
export const PageContainer = 'page-container'
55
export const RootPortal = 'root-portal'
6+
export const MatchMedia = 'match-media'
+51-34
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,80 @@
11
import { singleQuote } from '@tarojs/shared'
22

3+
const _true = 'true'
4+
const _false = 'false'
5+
const _empty = ''
6+
37
export const components = {
48
// ======== 调整属性 ========
59
Swiper: {
610
'easing-function': singleQuote('default')
711
},
812
Canvas: {
9-
type: ''
13+
type: _empty
1014
},
1115
Button: {
12-
bindGetPhoneNumber: ''
16+
bindGetPhoneNumber: _empty
1317
},
1418
Map: {
15-
bindRegionChange: ''
19+
bindRegionChange: _empty
1620
},
1721
WebView: {
18-
height: ''
22+
height: _empty
1923
},
2024
Input: {
21-
'adjust-position': 'true',
25+
'adjust-position': _true,
2226
},
2327
Textarea: {
24-
'show-confirm-bar': 'true',
25-
'adjust-position': 'true',
26-
'disable-default-padding': 'false',
28+
'show-confirm-bar': _true,
29+
'adjust-position': _true,
30+
'disable-default-padding': _false,
2731
},
2832
RootPortal: {
29-
enable: 'true'
33+
enable: _true
3034
},
3135
Editor: {
32-
'read-only': 'false',
33-
placeholder: '',
34-
'show-img-size': 'false',
35-
'show-img-toolbar': 'false',
36-
'show-img-resize': 'false',
37-
focus: 'false',
38-
bindReady: '',
39-
bindFocus: '',
40-
bindBlur: '',
41-
bindInput: '',
42-
bindStatusChange: '',
43-
name: ''
36+
'read-only': _false,
37+
placeholder: _empty,
38+
'show-img-size': _false,
39+
'show-img-toolbar': _false,
40+
'show-img-resize': _false,
41+
focus: _false,
42+
bindReady: _empty,
43+
bindFocus: _empty,
44+
bindBlur: _empty,
45+
bindInput: _empty,
46+
bindStatusChange: _empty,
47+
name: _empty
4448
},
4549
PageContainer: {
46-
show: 'false',
50+
show: _false,
4751
duration: '300',
4852
'z-index': '100',
49-
overlay: 'true',
53+
overlay: _true,
5054
position: "'bottom'",
51-
round: 'false',
52-
'close-on-slide-down': 'false',
53-
'overlay-style': '',
54-
'custom-style': '',
55-
bindBeforeEnter: '',
56-
bindEnter: '',
57-
bindAfterEnter: '',
58-
bindBeforeLeave: '',
59-
bindLeave: '',
60-
bindAfterLeave: '',
61-
bindClickOverlay: ''
55+
round: _false,
56+
'close-on-slide-down': _false,
57+
'overlay-style': _empty,
58+
'custom-style': _empty,
59+
bindBeforeEnter: _empty,
60+
bindEnter: _empty,
61+
bindAfterEnter: _empty,
62+
bindBeforeLeave: _empty,
63+
bindLeave: _empty,
64+
bindAfterLeave: _empty,
65+
bindClickOverlay: _empty
66+
},
67+
MatchMedia: {
68+
'min-width': _empty,
69+
'max-width': _empty,
70+
width: _empty,
71+
'min-height': _empty,
72+
'max-height': _empty,
73+
height: _empty,
74+
orientation: _empty
75+
},
76+
RichText: {
77+
space: _empty,
78+
'user-select': _false
6279
},
6380
}

0 commit comments

Comments
 (0)