Skip to content

Commit

Permalink
feat: 补全京东小程序组件和类型:Editor、PageContainer、RootPortal、MatchMedia、RichText (
Browse files Browse the repository at this point in the history
NervJS#16736)

* feat: 补全京东小程序组件

* test: update snapshoot
  • Loading branch information
ZEJIA-LIU authored Oct 25, 2024
1 parent c378497 commit a262dcb
Show file tree
Hide file tree
Showing 7 changed files with 141 additions and 107 deletions.
22 changes: 11 additions & 11 deletions packages/taro-components/types/Editor.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,48 +3,48 @@ import { StandardProps, CommonEventFunction } from './common'
interface EditorProps extends StandardProps {
/** 设置编辑器为只读
* @default false
* @supported weapp
* @supported weapp, jd
*/
readOnly?: boolean
/** 提示信息
* @supported weapp
* @supported weapp, jd
*/
placeholder?: string
/** 点击图片时显示图片大小控件
* @default false
* @supported weapp
* @supported weapp, jd
*/
showImgSize?: boolean
/** 点击图片时显示工具栏控件
* @default false
* @supported weapp
* @supported weapp, jd
*/
showImgToolbar?: boolean
/** 点击图片时显示修改尺寸控件
* @default false
* @supported weapp
* @supported weapp, jd
*/
showImgResize?: boolean
/** 编辑器初始化完成时触发
* @supported weapp
* @supported weapp, jd
*/
onReady?: CommonEventFunction
/** 编辑器聚焦时触发
* @supported weapp
* @supported weapp, jd
*/
onFocus?: CommonEventFunction<EditorProps.editorEventDetail>
/** 编辑器失去焦点时触发
* detail = { html, text, delta }
* @supported weapp
* @supported weapp, jd
*/
onBlur?: CommonEventFunction<EditorProps.editorEventDetail>
/** 编辑器内容改变时触发
* detail = { html, text, delta }
* @supported weapp
* @supported weapp, jd
*/
onInput?: CommonEventFunction<EditorProps.editorEventDetail>
/** 通过 Context 方法改变编辑器内样式时触发,返回选区已设置的样式
* @supported weapp
* @supported weapp, jd
*/
onStatusChange?: CommonEventFunction
}
Expand All @@ -67,7 +67,7 @@ declare namespace EditorProps {
*
* *编辑器内支持部分 HTML 标签和内联样式,不支持 **class** 和 **id***
* @classification forms
* @supported weapp
* @supported weapp, jd
* @example_react
* ```tsx
* class App extends Components {
Expand Down
16 changes: 8 additions & 8 deletions packages/taro-components/types/MatchMedia.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@ import { ComponentType } from 'react'
import { StandardProps } from './common'
interface MatchMediaProps extends StandardProps {
/** 页面最小宽度( px 为单位)
* @supported weapp, alipay
* @supported weapp, alipay, jd
*/
minWidth?: number
/** 页面最大宽度( px 为单位)
* @supported weapp, alipay
* @supported weapp, alipay, jd
*/
maxWidth?: number
/** 页面宽度( px 为单位)
* @supported weapp, alipay
* @supported weapp, alipay, jd
*/
width?: number
/** 页面最小高度( px 为单位)
* @supported weapp, alipay
* @supported weapp, alipay, jd
*/
minHeight?: number
/** 页面最大高度( px 为单位)
* @supported weapp, alipay
* @supported weapp, alipay, jd
*/
maxHeight?: number
/** 页面高度( px 为单位)
* @supported weapp, alipay
* @supported weapp, alipay, jd
*/
height?: number
/** 屏幕方向( landscape 或 portrait )
* @supported weapp, alipay
* @supported weapp, alipay, jd
*/
orientation?: string
}
/** media query 匹配检测节点。可以指定一组 media query 规则,满足时,这个节点才会被展示。
* 通过这个节点可以实现“页面宽高在某个范围时才展示某个区域”这样的效果。
* @supported weapp, alipay
* @supported weapp, alipay, jd
* @classification viewContainer
* @example_react
* ```tsx
Expand Down
32 changes: 16 additions & 16 deletions packages/taro-components/types/PageContainer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { StandardProps, CommonEventFunction } from './common'
interface PageContainerProps extends StandardProps {
/** 是否显示容器组件
* @default false
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
*/
show?: boolean
/** 动画时长,单位毫秒
* @default 300
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
*/
duration?: number
/** z-index 层级
Expand All @@ -18,58 +18,58 @@ interface PageContainerProps extends StandardProps {
zIndex?: number
/** 是否显示遮罩层
* @default true
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
*/
overlay?: boolean
/** 弹出位置,可选值为 top bottom right center
* @default bottom
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
*/
position?: keyof PageContainerProps.Position
/** 是否显示圆角
* @default false
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
*/
round?: boolean
/** 自定义遮罩层样式
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
*/
overlayStyle?: string
/** 自定义弹出层样式
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
*/
customStyle?: string
/** 是否在下滑一段距离后关闭
* @supported weapp, alipay
* @supported weapp, alipay, jd
* @default false
*/
closeOnSlideDown?: boolean
/** 进入前触发
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
*/
onBeforeEnter?: CommonEventFunction
/** 进入中触发
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
*/
onEnter?: CommonEventFunction
/** 进入后触发
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
*/
onAfterEnter?: CommonEventFunction
/** 离开前触发
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
*/
onBeforeLeave?: CommonEventFunction
/** 离开中触发
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
*/
onLeave?: CommonEventFunction
/** 离开后触发
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
*/
onAfterLeave?: CommonEventFunction
/** 点击遮罩层时触发
* @supported weapp, alipay
* @supported weapp, alipay, jd
*/
onClickOverlay?: CommonEventFunction
/** 进入被打断时触发(通过 a: if 打断时不会触发)。
Expand Down Expand Up @@ -103,7 +103,7 @@ declare namespace PageContainerProps {
* 1. tip: 当前页面最多只有 1 个容器,若已存在容器的情况下,无法增加新的容器
* 2. tip: wx.navigateBack 无法在页面栈顶调用,此时没有上一级页面
* @classification viewContainer
* @supported weapp, alipay, rn
* @supported weapp, alipay, jd, rn
* @see https://developers.weixin.qq.com/miniprogram/dev/component/page-container.html
*/
declare const PageContainer: ComponentType<PageContainerProps>
Expand Down
8 changes: 4 additions & 4 deletions packages/taro-components/types/RichText.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ import { CommonEventFunction, StandardProps } from './common'
interface RichTextProps extends StandardProps {
/** 文本是否可选,该属性会使节点显示为 block
* @default false
* @supported weapp, h5, harmony_hybrid
* @supported weapp, jd, h5, harmony_hybrid
*/
userSelect?: boolean
/** 节点列表/ HTML String
* @supported weapp, alipay, swan, tt, qq, h5, rn, harmony, harmony_hybrid
* @supported weapp, jd, alipay, swan, tt, qq, h5, rn, harmony, harmony_hybrid
*/
nodes?: Nodes
/** 显示连续空格
* @supported weapp, alipay, tt, qq, h5, rn, harmony_hybrid
* @supported weapp, jd, alipay, tt, qq, h5, rn, harmony_hybrid
*/
space?: keyof RichTextProps.TSpace
/** 富文本是否可以长按选中,可用于复制,粘贴,长按搜索等场景
Expand Down Expand Up @@ -99,7 +99,7 @@ declare namespace RichTextProps {
}
/** 富文本
* @classification base
* @supported weapp, swan, alipay, tt, h5, rn, harmony, harmony_hybrid
* @supported weapp, jd, swan, alipay, tt, h5, rn, harmony, harmony_hybrid
* @example_react
* ```tsx
* class App extends Components {
Expand Down
1 change: 1 addition & 0 deletions packages/taro-platform-jd/src/components-react.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ export * from '@tarojs/components/mini'
export const Editor = 'editor'
export const PageContainer = 'page-container'
export const RootPortal = 'root-portal'
export const MatchMedia = 'match-media'
85 changes: 51 additions & 34 deletions packages/taro-platform-jd/src/components.ts
Original file line number Diff line number Diff line change
@@ -1,63 +1,80 @@
import { singleQuote } from '@tarojs/shared'

const _true = 'true'
const _false = 'false'
const _empty = ''

export const components = {
// ======== 调整属性 ========
Swiper: {
'easing-function': singleQuote('default')
},
Canvas: {
type: ''
type: _empty
},
Button: {
bindGetPhoneNumber: ''
bindGetPhoneNumber: _empty
},
Map: {
bindRegionChange: ''
bindRegionChange: _empty
},
WebView: {
height: ''
height: _empty
},
Input: {
'adjust-position': 'true',
'adjust-position': _true,
},
Textarea: {
'show-confirm-bar': 'true',
'adjust-position': 'true',
'disable-default-padding': 'false',
'show-confirm-bar': _true,
'adjust-position': _true,
'disable-default-padding': _false,
},
RootPortal: {
enable: 'true'
enable: _true
},
Editor: {
'read-only': 'false',
placeholder: '',
'show-img-size': 'false',
'show-img-toolbar': 'false',
'show-img-resize': 'false',
focus: 'false',
bindReady: '',
bindFocus: '',
bindBlur: '',
bindInput: '',
bindStatusChange: '',
name: ''
'read-only': _false,
placeholder: _empty,
'show-img-size': _false,
'show-img-toolbar': _false,
'show-img-resize': _false,
focus: _false,
bindReady: _empty,
bindFocus: _empty,
bindBlur: _empty,
bindInput: _empty,
bindStatusChange: _empty,
name: _empty
},
PageContainer: {
show: 'false',
show: _false,
duration: '300',
'z-index': '100',
overlay: 'true',
overlay: _true,
position: "'bottom'",
round: 'false',
'close-on-slide-down': 'false',
'overlay-style': '',
'custom-style': '',
bindBeforeEnter: '',
bindEnter: '',
bindAfterEnter: '',
bindBeforeLeave: '',
bindLeave: '',
bindAfterLeave: '',
bindClickOverlay: ''
round: _false,
'close-on-slide-down': _false,
'overlay-style': _empty,
'custom-style': _empty,
bindBeforeEnter: _empty,
bindEnter: _empty,
bindAfterEnter: _empty,
bindBeforeLeave: _empty,
bindLeave: _empty,
bindAfterLeave: _empty,
bindClickOverlay: _empty
},
MatchMedia: {
'min-width': _empty,
'max-width': _empty,
width: _empty,
'min-height': _empty,
'max-height': _empty,
height: _empty,
orientation: _empty
},
RichText: {
space: _empty,
'user-select': _false
},
}
Loading

0 comments on commit a262dcb

Please sign in to comment.