Skip to content

Commit

Permalink
1.0.45
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaoGongBra committed Oct 15, 2024
1 parent f87ab4f commit 220f428
Show file tree
Hide file tree
Showing 31 changed files with 595 additions and 113 deletions.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ yarn duxapp app add duxui
## 示例

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

## 文档
Expand Down
5 changes: 0 additions & 5 deletions app.js

This file was deleted.

2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "duxui",
"description": "DUXUI库",
"version": "1.0.41",
"version": "1.0.45",
"dependencies": [
"duxapp"
],
Expand Down
17 changes: 17 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# 1.0.45

## Recorder
新增录音表单组建,用于录音上传

## Upload
完善对视频、图片上传的预览功能

## Step
新增 `lineType` 指定线条的类型

## Cascade
修复对RN的兼容

## Types
修复多个组建的types提示

# 1.0.41

## 主要更改
Expand Down
4 changes: 2 additions & 2 deletions components/CardSelect/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface CardSelectGroupProps {
checkedProps?: {
/** 选中时背景颜色 */
color?: string
/** 是否实心 */
/** 是否镂空 */
plain?: boolean
/** 是否有边框 */
border?: boolean
Expand All @@ -28,7 +28,7 @@ interface CardSelectProps extends ViewProps {
value: string | number
/** 是否选中 */
checked?: boolean
/** 是否实心 */
/** 是否镂空 */
plain?: boolean
/** 颜色 */
color?: string
Expand Down
8 changes: 4 additions & 4 deletions components/DropDown/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactElement, CSSProperties, RefForwardingComponent } from 'react'
import { ReactElement, CSSProperties, FC } from 'react'

interface DropDownMenuItem {
/**
Expand Down Expand Up @@ -49,6 +49,6 @@ interface DropDownProps {
/**
* 下拉菜单组件
*/
export declare const DropDown: RefForwardingComponent<{
close: () => void
}, DropDownProps>
export const DropDown: FC<DropDownProps> & {
ref?: Ref<MenuItemClickHandler>
}
3 changes: 3 additions & 0 deletions components/DuxuiIcon/icons.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"voice-right": 59083,
"voice-right_01": 59146,
"voice-right_02": 59147,
"roundcheckfill": 58966,
"roundcheck": 58967,
"backspace": 58930,
Expand Down
3 changes: 3 additions & 0 deletions components/DuxuiIcon/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import { ComponentType, Component, CSSProperties } from 'react'

interface names {
'voice-right'
'voice-right_01'
'voice-right_02'
'roundcheckfill'
'roundcheck'
'backspace'
Expand Down
2 changes: 1 addition & 1 deletion components/DuxuiIcon/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { font, px } from '@/duxapp/utils'
import icons from './icons.json'
import './index.scss'

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

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

Expand Down
4 changes: 2 additions & 2 deletions components/Form/Cascade.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReactNode } from 'react'
import { ReactNode, FC } from 'react'
import { ViewProps } from '@tarojs/components'

interface CascadeData {
Expand Down Expand Up @@ -69,4 +69,4 @@ interface CascadeProps extends ViewProps {
/**
* 级联选择组件
*/
export const Cascade: React.FC<CascadeProps>
export const Cascade: FC<CascadeProps>
35 changes: 19 additions & 16 deletions components/Form/Cascade.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { View } from '@tarojs/components'
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react'
import { ScrollView, duxappTheme, recursionGetValue } from '@/duxapp'
import classNames from 'classnames'
import { Divider } from '../Divider'
Expand Down Expand Up @@ -321,7 +321,7 @@ const DefaultRender = ({
group.map((item, index) => {
const isSelect = select[groupIndex] === index
return <View key={index} className='Cascade__left__label' onClick={() => labelClick(groupIndex, index, item)}>
<Text style={{ color: isSelect ? duxappTheme.primaryColor : '#373D52' }} className='Cascade__left__label__title'>{item[nameKey]}</Text>
<Text style={{ color: isSelect ? duxappTheme.primaryColor : duxappTheme.textColor1 }} className='Cascade__left__label__title'>{item[nameKey]}</Text>
{!isRadio && groupIndex === 0 && checkNumbers[index] > 0 && !anyLevel && <View style={{ color: isSelect ? duxappTheme.primaryColor : '#73778E' }} className='Cascade__left__label__select'>已选
<Text className='Cascade__left__label__select__num'>{checkNumbers[index]}</Text>
</View>}
Expand All @@ -336,20 +336,23 @@ const DefaultRender = ({
{
right.map((item, index) => {
const isSelect = isRadio ? value === item[valueKey] : value?.includes?.(item[valueKey])
return <View key={'item' + index} className='Cascade__right__item' style={{ borderBottom: '1px solid rgba(180,180,180,0.3)' }} onClick={() => rightClick(item)}>
<Text style={{ color: isSelect ? duxappTheme.primaryColor : '#373D52' }} className='Cascade__right__item__label'>{item[nameKey]}</Text>
<DuxuiIcon
className='Cascade__right__item__icon'
color={isSelect ? duxappTheme.primaryColor : '#373D52'}
name={
!isRadio ? (
isSelect ? 'xuanzhong' : 'xuanzekuang'
) : (
isSelect ? 'add_check1' : 'option'
)
}
/>
</View>
return <Fragment key={'item' + index}>
{!!index && <Divider />}
<View className='Cascade__right__item' onClick={() => rightClick(item)}>
<Text style={{ color: isSelect ? duxappTheme.primaryColor : duxappTheme.textColor1 }} className='Cascade__right__item__label'>{item[nameKey]}</Text>
<DuxuiIcon
className='Cascade__right__item__icon'
color={isSelect ? duxappTheme.primaryColor : duxappTheme.textColor1}
name={
!isRadio ? (
isSelect ? 'xuanzhong' : 'xuanzekuang'
) : (
isSelect ? 'add_check1' : 'option'
)
}
/>
</View>
</Fragment>
})
}
</ScrollView>
Expand Down
1 change: 0 additions & 1 deletion components/Form/Cascade.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
.Cascade {
width: 100%;
height: 300px;
flex-direction: row;

Expand Down
8 changes: 6 additions & 2 deletions components/Form/Grade.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,13 @@ interface type {

interface GradeProps extends SpaceProps {
/**
* 当前评分值
* 当前评分值 1-5
*/
value: number
value?: number
/**
* 默认值 1-5
*/
defaultValue?: number
/**
* 值变化回调函数
*/
Expand Down
22 changes: 15 additions & 7 deletions components/Form/Grade.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,47 @@ import { DuxuiIcon } from '../DuxuiIcon'
import { Text } from '../Text'
import { Space } from '../Space'
import { Row } from '../Flex'
import { Form } from './Form'
import './Grade.scss'

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

export const Grade = ({
value,
onChange,
defaultValue,
size = 'm',
type = 'primary',
...props
}) => {

const values = value ? ('' + value).split('.') : []
const [val, setVal] = Form.useFormItemProxy({
value,
onChange,
defaultValue
})

const values = val ? ('' + val).split('.') : []

return <Space row items='center' size={16} {...props}>
<Row items='center'>
{arr.map((item, index) => {
return <Text
type={index < value ? type : void 0}
color={index < value ? void 0 : 3}
type={index < val ? type : void 0}
color={index < val ? void 0 : 3}
key={index}
onClick={() => onChange?.(index + 1)}
onClick={() => setVal?.(index + 1)}
className={classNames('Grade--' + size)}
>
<DuxuiIcon
name={index < value ? 'collection-fill' : 'collection'} onClick={() => {
name={index < val ? 'collection-fill' : 'collection'} onClick={() => {
// RN安卓端外面的事件不触发 触发了此处
onChange?.(index + 1)
setVal?.(index + 1)
}}
/>
</Text>
})}
</Row>
{!!value && <Text type={type}>{values[0]}.{values[1] || 0}</Text>}
{!!val && <Text type={type}>{values[0]}.{values[1] || 0}</Text>}
</Space>
}
56 changes: 56 additions & 0 deletions components/Form/Recorder.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import { Upload } from '../../../duxapp/utils/net'
import { GridProps } from '../Grid'

interface RecorderProps extends GridProps {
/**
* 音频地址
*/
value?: string | string[]
/**
* 操作值回调
*/
onChange?: (value: string | string[]) => void
/**
* 每行显示多少
* 默认4
*/
column?: number
/**
* 最多允许录制多少音频
* 默认 1
* 传入 1 相当于单个录制,value是字符串类型,大于1是多个录制,value是数组类型
*/
max?: number
/** 是否禁用 */
disabled?: boolean
/**
* 录制提示文本
*/
tip?: string
/** 传递给上传临时文件函数的选项 */
option?: Upload.Option
}

/**
* 音频录制表单
*/
export const Recorder: React.FC<RecorderProps> & {

/**
* 弹出音频录制功能,异步返回录制的值
*/
start: () => Promise<{
/**
* 临时文件位置
*/
path: string
/**
* 录音大小
*/
size: number
/**
* 录音时长 ms
*/
duration: number
}>
}
Loading

0 comments on commit 220f428

Please sign in to comment.