提交 e3934b5a 编写于 作者: O oasis-cloud

# Conflicts:

#	.gitignore
#	src/packages/datepicker/datepicker.taro.tsx
#	src/packages/griditem/griditem.taro.tsx
上级 07a78ce5
......@@ -62,6 +62,7 @@ export const GridItem: FunctionComponent<
center,
reverse,
direction,
className,
onClick,
...rest
} = {
......@@ -69,6 +70,7 @@ export const GridItem: FunctionComponent<
...props,
}
const b = bem('grid-item')
const classes = classNames(b(), className)
const context = useContext(GridContext)
const pxCheck = (value: string | number): string => {
return Number.isNaN(Number(value)) ? String(value) : `${value}px`
......@@ -125,7 +127,12 @@ export const GridItem: FunctionComponent<
}
return (
<div className={b()} style={rootStyle()} {...rest} onClick={handleClick}>
<div
className={classes}
style={rootStyle()}
{...rest}
onClick={handleClick}
>
<div className={contentClass()}>
{icon && <>{icon}</>}
{text && (
......
......@@ -230,6 +230,28 @@ const InputNumberDemo = () => {
formatter={(value) => `${value}%`}
/>
</Cell>
<h2>支持formatter</h2>
<Cell>
<InputNumber
className="format-width"
modelValue="1000"
min={10}
max={15020}
formatter={(value) =>
`$ ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')
}
/>
</Cell>
<Cell>
<InputNumber
className="format-width"
modelValue="100"
min={0}
max={100}
formatter={(value) => `${value}%`}
/>
</Cell>
</div>
</>
)
......
......@@ -106,7 +106,7 @@ export const Tabs: FunctionComponent<
const childProps = child?.props
if (childProps?.title || childProps?.paneKey) {
title.title = childProps?.title
title.paneKey = childProps?.paneKey || idx
title.paneKey = getPaneKey(childProps?.paneKey, idx)
title.disabled = childProps?.disabled
title.index = idx
if (title.paneKey === value) {
......@@ -149,6 +149,10 @@ export const Tabs: FunctionComponent<
transitionDuration: `${animatedTime}ms`,
}
const getPaneKey = (paneKey: string | number, index: number) => {
return typeof paneKey === 'string' ? paneKey : String(paneKey || index)
}
const tabChange = (item: Title, index: number) => {
onClick && onClick(item)
if (item.disabled) {
......@@ -224,7 +228,7 @@ export const Tabs: FunctionComponent<
}
if (
String(value) !== String(child.props?.paneKey || idx) &&
String(value) !== getPaneKey(child.props?.paneKey, idx) &&
autoHeight
) {
childProps = {
......
......@@ -144,7 +144,7 @@ export const TextArea: FunctionComponent<
onCompositionEnd={(e) => endComposing()}
onCompositionStart={(e) => startComposing()}
rows={rows}
// maxLength={maxlength < 0 ? 0 : maxlength}
maxLength={maxlength < 0 ? 0 : maxlength}
placeholder={placeholder || locale.placeholder}
/>
{limitshow ? (
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册