Skip to content

Commit 220f428

Browse files
committed
1.0.45
1 parent f87ab4f commit 220f428

31 files changed

+595
-113
lines changed

Readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ yarn duxapp app add duxui
1313
## 示例
1414

1515
- 小程序 (小程序搜索 duxui)
16-
- APP https://app.share.dux.plus/com.duxapp.duxui
16+
- APP https://app.share.dux.plus/cn.duxapp.duxui
1717
- H5 https://example.duxui.cn
1818

1919
## 文档

app.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "duxui",
33
"description": "DUXUI库",
4-
"version": "1.0.41",
4+
"version": "1.0.45",
55
"dependencies": [
66
"duxapp"
77
],

changelog.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# 1.0.45
2+
3+
## Recorder
4+
新增录音表单组建,用于录音上传
5+
6+
## Upload
7+
完善对视频、图片上传的预览功能
8+
9+
## Step
10+
新增 `lineType` 指定线条的类型
11+
12+
## Cascade
13+
修复对RN的兼容
14+
15+
## Types
16+
修复多个组建的types提示
17+
118
# 1.0.41
219

320
## 主要更改

components/CardSelect/index.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface CardSelectGroupProps {
1212
checkedProps?: {
1313
/** 选中时背景颜色 */
1414
color?: string
15-
/** 是否实心 */
15+
/** 是否镂空 */
1616
plain?: boolean
1717
/** 是否有边框 */
1818
border?: boolean
@@ -28,7 +28,7 @@ interface CardSelectProps extends ViewProps {
2828
value: string | number
2929
/** 是否选中 */
3030
checked?: boolean
31-
/** 是否实心 */
31+
/** 是否镂空 */
3232
plain?: boolean
3333
/** 颜色 */
3434
color?: string

components/DropDown/index.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReactElement, CSSProperties, RefForwardingComponent } from 'react'
1+
import { ReactElement, CSSProperties, FC } from 'react'
22

33
interface DropDownMenuItem {
44
/**
@@ -49,6 +49,6 @@ interface DropDownProps {
4949
/**
5050
* 下拉菜单组件
5151
*/
52-
export declare const DropDown: RefForwardingComponent<{
53-
close: () => void
54-
}, DropDownProps>
52+
export const DropDown: FC<DropDownProps> & {
53+
ref?: Ref<MenuItemClickHandler>
54+
}

components/DuxuiIcon/icons.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
2+
"voice-right": 59083,
3+
"voice-right_01": 59146,
4+
"voice-right_02": 59147,
25
"roundcheckfill": 58966,
36
"roundcheck": 58967,
47
"backspace": 58930,

components/DuxuiIcon/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import { ComponentType, Component, CSSProperties } from 'react'
22

33
interface names {
4+
'voice-right'
5+
'voice-right_01'
6+
'voice-right_02'
47
'roundcheckfill'
58
'roundcheck'
69
'backspace'

components/DuxuiIcon/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { font, px } from '@/duxapp/utils'
44
import icons from './icons.json'
55
import './index.scss'
66

7-
font.load('DuxuiIcon', 'https://pictcdn.client.jujiang.me/fonts/DuxuiIcon.1709522237756.ttf')
7+
font.load('DuxuiIcon', 'https://pictcdn.client.jujiang.me/fonts/DuxuiIcon.1728705176383.ttf')
88

99
export const DuxuiIcon = ({ name, color, size, style, className, ...props }) => {
1010

components/Form/Cascade.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ReactNode } from 'react'
1+
import { ReactNode, FC } from 'react'
22
import { ViewProps } from '@tarojs/components'
33

44
interface CascadeData {
@@ -69,4 +69,4 @@ interface CascadeProps extends ViewProps {
6969
/**
7070
* 级联选择组件
7171
*/
72-
export const Cascade: React.FC<CascadeProps>
72+
export const Cascade: FC<CascadeProps>

components/Form/Cascade.jsx

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { View } from '@tarojs/components'
2-
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
2+
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react'
33
import { ScrollView, duxappTheme, recursionGetValue } from '@/duxapp'
44
import classNames from 'classnames'
55
import { Divider } from '../Divider'
@@ -321,7 +321,7 @@ const DefaultRender = ({
321321
group.map((item, index) => {
322322
const isSelect = select[groupIndex] === index
323323
return <View key={index} className='Cascade__left__label' onClick={() => labelClick(groupIndex, index, item)}>
324-
<Text style={{ color: isSelect ? duxappTheme.primaryColor : '#373D52' }} className='Cascade__left__label__title'>{item[nameKey]}</Text>
324+
<Text style={{ color: isSelect ? duxappTheme.primaryColor : duxappTheme.textColor1 }} className='Cascade__left__label__title'>{item[nameKey]}</Text>
325325
{!isRadio && groupIndex === 0 && checkNumbers[index] > 0 && !anyLevel && <View style={{ color: isSelect ? duxappTheme.primaryColor : '#73778E' }} className='Cascade__left__label__select'>已选
326326
<Text className='Cascade__left__label__select__num'>{checkNumbers[index]}</Text>
327327
</View>}
@@ -336,20 +336,23 @@ const DefaultRender = ({
336336
{
337337
right.map((item, index) => {
338338
const isSelect = isRadio ? value === item[valueKey] : value?.includes?.(item[valueKey])
339-
return <View key={'item' + index} className='Cascade__right__item' style={{ borderBottom: '1px solid rgba(180,180,180,0.3)' }} onClick={() => rightClick(item)}>
340-
<Text style={{ color: isSelect ? duxappTheme.primaryColor : '#373D52' }} className='Cascade__right__item__label'>{item[nameKey]}</Text>
341-
<DuxuiIcon
342-
className='Cascade__right__item__icon'
343-
color={isSelect ? duxappTheme.primaryColor : '#373D52'}
344-
name={
345-
!isRadio ? (
346-
isSelect ? 'xuanzhong' : 'xuanzekuang'
347-
) : (
348-
isSelect ? 'add_check1' : 'option'
349-
)
350-
}
351-
/>
352-
</View>
339+
return <Fragment key={'item' + index}>
340+
{!!index && <Divider />}
341+
<View className='Cascade__right__item' onClick={() => rightClick(item)}>
342+
<Text style={{ color: isSelect ? duxappTheme.primaryColor : duxappTheme.textColor1 }} className='Cascade__right__item__label'>{item[nameKey]}</Text>
343+
<DuxuiIcon
344+
className='Cascade__right__item__icon'
345+
color={isSelect ? duxappTheme.primaryColor : duxappTheme.textColor1}
346+
name={
347+
!isRadio ? (
348+
isSelect ? 'xuanzhong' : 'xuanzekuang'
349+
) : (
350+
isSelect ? 'add_check1' : 'option'
351+
)
352+
}
353+
/>
354+
</View>
355+
</Fragment>
353356
})
354357
}
355358
</ScrollView>

components/Form/Cascade.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.Cascade {
2-
width: 100%;
32
height: 300px;
43
flex-direction: row;
54

components/Form/Grade.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,13 @@ interface type {
2626

2727
interface GradeProps extends SpaceProps {
2828
/**
29-
* 当前评分值
29+
* 当前评分值 1-5
3030
*/
31-
value: number
31+
value?: number
32+
/**
33+
* 默认值 1-5
34+
*/
35+
defaultValue?: number
3236
/**
3337
* 值变化回调函数
3438
*/

components/Form/Grade.jsx

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,47 @@ import { DuxuiIcon } from '../DuxuiIcon'
33
import { Text } from '../Text'
44
import { Space } from '../Space'
55
import { Row } from '../Flex'
6+
import { Form } from './Form'
67
import './Grade.scss'
78

89
const arr = [...new Array(5)]
910

1011
export const Grade = ({
1112
value,
1213
onChange,
14+
defaultValue,
1315
size = 'm',
1416
type = 'primary',
1517
...props
1618
}) => {
1719

18-
const values = value ? ('' + value).split('.') : []
20+
const [val, setVal] = Form.useFormItemProxy({
21+
value,
22+
onChange,
23+
defaultValue
24+
})
25+
26+
const values = val ? ('' + val).split('.') : []
1927

2028
return <Space row items='center' size={16} {...props}>
2129
<Row items='center'>
2230
{arr.map((item, index) => {
2331
return <Text
24-
type={index < value ? type : void 0}
25-
color={index < value ? void 0 : 3}
32+
type={index < val ? type : void 0}
33+
color={index < val ? void 0 : 3}
2634
key={index}
27-
onClick={() => onChange?.(index + 1)}
35+
onClick={() => setVal?.(index + 1)}
2836
className={classNames('Grade--' + size)}
2937
>
3038
<DuxuiIcon
31-
name={index < value ? 'collection-fill' : 'collection'} onClick={() => {
39+
name={index < val ? 'collection-fill' : 'collection'} onClick={() => {
3240
// RN安卓端外面的事件不触发 触发了此处
33-
onChange?.(index + 1)
41+
setVal?.(index + 1)
3442
}}
3543
/>
3644
</Text>
3745
})}
3846
</Row>
39-
{!!value && <Text type={type}>{values[0]}.{values[1] || 0}</Text>}
47+
{!!val && <Text type={type}>{values[0]}.{values[1] || 0}</Text>}
4048
</Space>
4149
}

components/Form/Recorder.d.ts

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import { Upload } from '../../../duxapp/utils/net'
2+
import { GridProps } from '../Grid'
3+
4+
interface RecorderProps extends GridProps {
5+
/**
6+
* 音频地址
7+
*/
8+
value?: string | string[]
9+
/**
10+
* 操作值回调
11+
*/
12+
onChange?: (value: string | string[]) => void
13+
/**
14+
* 每行显示多少
15+
* 默认4
16+
*/
17+
column?: number
18+
/**
19+
* 最多允许录制多少音频
20+
* 默认 1
21+
* 传入 1 相当于单个录制,value是字符串类型,大于1是多个录制,value是数组类型
22+
*/
23+
max?: number
24+
/** 是否禁用 */
25+
disabled?: boolean
26+
/**
27+
* 录制提示文本
28+
*/
29+
tip?: string
30+
/** 传递给上传临时文件函数的选项 */
31+
option?: Upload.Option
32+
}
33+
34+
/**
35+
* 音频录制表单
36+
*/
37+
export const Recorder: React.FC<RecorderProps> & {
38+
39+
/**
40+
* 弹出音频录制功能,异步返回录制的值
41+
*/
42+
start: () => Promise<{
43+
/**
44+
* 临时文件位置
45+
*/
46+
path: string
47+
/**
48+
* 录音大小
49+
*/
50+
size: number
51+
/**
52+
* 录音时长 ms
53+
*/
54+
duration: number
55+
}>
56+
}

0 commit comments

Comments
 (0)