提交 29be371b 编写于 作者: H hanyuxinting

feat: 更新address、video属性,删除过期的事件属性:avatar、backtop、signature等3个组件。

上级 82a2c1ab
......@@ -166,7 +166,7 @@ test('exist address choose event', async () => {
test('exist address & list address', async () => {
const changeHandle = jest.fn()
const switchModule = jest.fn()
const onSwitch = jest.fn()
const { container } = render(
<Address
modelValue
......@@ -177,7 +177,7 @@ test('exist address & list address', async () => {
town={addressData.town}
existAddress={existAddress}
customAddressTitle="请选择所在地区"
switchModule={switchModule}
onSwitch={onSwitch}
onChange={changeHandle}
/>
)
......@@ -187,7 +187,7 @@ test('exist address & list address', async () => {
chooseBtn && fireEvent.click(chooseBtn)
await waitFor(() => {
expect(switchModule).toBeCalled()
expect(onSwitch).toBeCalled()
})
const regionItem = container.querySelectorAll('.nut-address__region-item')
......
......@@ -48,8 +48,8 @@ export interface AddressProps extends BasicComponent {
copyExistAdd: AddressList[]
) => void
onClose?: (cal: CloseCallBack) => void
closeMask?: (cal: { closeWay: string }) => void
switchModule?: (cal: { type: string }) => void
onCancel?: (cal: { closeWay: string }) => void
onSwitch?: (cal: { type: string }) => void
onChange?: (cal: ChangeCallBack) => void
onTabChecked?: (cal: string) => void
}
......@@ -101,8 +101,8 @@ export const Address: FunctionComponent<
onChange,
onSelected,
onClose,
closeMask,
switchModule,
onCancel,
onSwitch,
onTabChecked,
style,
className,
......@@ -131,7 +131,7 @@ export const Address: FunctionComponent<
}
// 点击遮罩层关闭
const clickOverlay = () => {
closeMask && closeMask({ closeWay: 'mask' })
onCancel && onCancel({ closeWay: 'mask' })
}
// 切换下一级列表
const nextAreaList = (item: NextListObj) => {
......@@ -213,7 +213,7 @@ export const Address: FunctionComponent<
setPrivateType('exist')
}
initAddress()
switchModule && switchModule({ type: privateType })
onSwitch && onSwitch({ type: privateType })
}
const headerRender = () => {
......
......@@ -48,8 +48,8 @@ export interface AddressProps extends BasicComponent {
copyExistAdd: AddressList[]
) => void
onClose?: (cal: CloseCallBack) => void
closeMask?: (cal: { closeWay: string }) => void
switchModule?: (cal: { type: string }) => void
onCancel?: (cal: { closeWay: string }) => void
onSwitch?: (cal: { type: string }) => void
onChange?: (cal: ChangeCallBack) => void
onTabChecked?: (cal: string) => void
}
......@@ -101,8 +101,8 @@ export const Address: FunctionComponent<
onChange,
onSelected,
onClose,
closeMask,
switchModule,
onCancel,
onSwitch,
onTabChecked,
style,
className,
......@@ -131,7 +131,7 @@ export const Address: FunctionComponent<
}
// 点击遮罩层关闭
const clickOverlay = () => {
closeMask && closeMask({ closeWay: 'mask' })
onCancel && onCancel({ closeWay: 'mask' })
}
// 切换下一级列表
const nextAreaList = (item: NextListObj) => {
......@@ -213,7 +213,7 @@ export const Address: FunctionComponent<
setPrivateType('exist')
}
initAddress()
switchModule && switchModule({ type: privateType })
onSwitch && onSwitch({ type: privateType })
}
const headerRender = () => {
......
......@@ -203,7 +203,7 @@ const AddressDemo = () => {
console.log('选择')
}
const switchModule = (val: { type: string }) => {
const onSwitch = (val: { type: string }) => {
if (val.type === 'custom') {
console.log('点击了“选择其他地址”按钮')
} else {
......@@ -211,7 +211,7 @@ const AddressDemo = () => {
}
}
const closeMask = (val: { closeWay: string }) => {
const onCancel = (val: { closeWay: string }) => {
console.log('关闭弹层', val)
}
......@@ -442,8 +442,8 @@ const AddressDemo = () => {
onClose={close4}
onSelected={selected}
customAndExistTitle="选择其他地址"
switchModule={switchModule}
closeMask={closeMask}
onSwitch={onSwitch}
onCancel={onCancel}
/>
</div>
</>
......
......@@ -242,7 +242,7 @@ const AddressDemo = () => {
console.log('选择')
}
const switchModule = (val: { type: string }) => {
const onSwitch = (val: { type: string }) => {
if (val.type === 'custom') {
console.log('点击了“选择其他地址”按钮')
} else {
......@@ -250,7 +250,7 @@ const AddressDemo = () => {
}
}
const closeMask = (val: { closeWay: string }) => {
const onCancel = (val: { closeWay: string }) => {
console.log('关闭弹层', val)
}
......@@ -480,8 +480,8 @@ const AddressDemo = () => {
onClose={close4}
onSelected={selected}
customAndExistTitle={translated.other}
switchModule={switchModule}
closeMask={closeMask}
onSwitch={onSwitch}
onCancel={onCancel}
/>
</div>
</>
......
......@@ -545,7 +545,7 @@ const App = () => {
setText((val.data as AddressResult).addressStr)
}
}
const switchModule = (val) => {
const onSwitch = (val) => {
if (val.type === 'custom') {
console.log('点击了“选择其他地址”按钮')
} else {
......@@ -553,7 +553,7 @@ const App = () => {
}
}
const closeMask = (val) => {
const onCancel = (val) => {
console.log('关闭弹层', val)
}
return (
......@@ -572,8 +572,8 @@ const App = () => {
onClose={close}
onSelected={selected}
customAndExistTitle="Choose Other Address"
switchModule={switchModule}
closeMask={closeMask}
onSwitch={onSwitch}
onCancel={onCancel}
/>
</>
);
......@@ -613,8 +613,8 @@ export default App;
| onChange | Emitted when to selected custom address | reference onChange |
| onSelected | Emitted when to selected exist address | reference selected
| onClose | Emitted when to close | reference close |
| closeMask |Emitted when to close mask | `closeWay:'mask' \| 'cross'` |
| switchModule | Click to select another address or custom address to select the upper left corner of the return button triggered | `type:'exist' \| 'custom' \| 'custom2'` |
| onCancel `v2.0.0` |Emitted when to close mask | `closeWay:'mask' \| 'cross'` |
| onSwitch `v2.0.0` | Click to select another address or custom address to select the upper left corner of the return button triggered | `type:'exist' \| 'custom' \| 'custom2'` |
## change 回调参数
......
......@@ -580,36 +580,36 @@ const App = () => {
setText((val.data as AddressResult).addressStr)
}
}
const switchModule = (val) => {
if (val.type === 'custom') {
console.log('点击了“选择其他地址”按钮')
} else {
console.log('点击了自定义地址左上角的返回按钮')
}
const onSwitch = (val) => {
if (val.type === 'custom') {
console.log('点击了“选择其他地址”按钮')
} else {
console.log('点击了自定义地址左上角的返回按钮')
}
}
const closeMask = (val) => {
console.log('关闭弹层', val)
const onCancel = (val) => {
console.log('关闭弹层', val)
}
return (
<>
<Cell title="选择地址" description={text} onClick={()=>setOther(true)} />
<Address
modelValue={other}
type="exist"
existAddress={existAddress}
province={province}
city={city}
country={country}
town={town}
backBtnIcon={icon.backBtnIcon}
onChange={onChange}
onClose={close}
onSelected={selected}
customAndExistTitle="选择其他地址"
switchModule={switchModule}
closeMask={closeMask}
/>
modelValue={other}
type="exist"
existAddress={existAddress}
province={province}
city={city}
country={country}
town={town}
backBtnIcon={icon.backBtnIcon}
onChange={onChange}
onClose={close}
onSelected={selected}
customAndExistTitle="选择其他地址"
onSwitch={onSwitch}
onCancel={onCancel}
/>
</>
);
};
......@@ -657,8 +657,8 @@ export default App;
| onChange | 自定义选择地址时,选择地区时触发 | 参考 onChange |
| onSelected | 选择已有地址列表时触发 | 参考 selected |
| onClose | 地址选择弹框关闭时触发 | 参考 close |
| closeMask |点击遮罩层或点击右上角叉号关闭时触发 | `closeWay: 'mask' \| 'cross'` |
| switchModule | 点击'选择其他地址'或自定义地址选择左上角返回按钮触发 | `type: 'exist' \| 'custom' \| 'custom2'` |
| onCancel `v2.0.0` |点击遮罩层或点击右上角叉号关闭时触发 | `closeWay: 'mask' \| 'cross'` |
| onSwitch `v2.0.0` | 点击'选择其他地址'或自定义地址选择左上角返回按钮触发 | `type: 'exist' \| 'custom' \| 'custom2'` |
## change 回调参数
......
......@@ -579,36 +579,36 @@ const App = () => {
setText((val.data as AddressResult).addressStr)
}
}
const switchModule = (val) => {
if (val.type === 'custom') {
console.log('点击了“选择其他地址”按钮')
} else {
console.log('点击了自定义地址左上角的返回按钮')
}
const onSwitch = (val) => {
if (val.type === 'custom') {
console.log('点击了“选择其他地址”按钮')
} else {
console.log('点击了自定义地址左上角的返回按钮')
}
}
const closeMask = (val) => {
console.log('关闭弹层', val)
const onCancel = (val) => {
console.log('关闭弹层', val)
}
return (
<>
<Cell title="选择地址" description={text} onClick={()=>setOther(true)} />
<Address
modelValue={other}
type="exist"
existAddress={existAddress}
province={province}
city={city}
country={country}
town={town}
backBtnIcon={icon.backBtnIcon}
onChange={onChange}
onClose={close}
onSelected={selected}
customAndExistTitle="选择其他地址"
switchModule={switchModule}
closeMask={closeMask}
/>
modelValue={other}
type="exist"
existAddress={existAddress}
province={province}
city={city}
country={country}
town={town}
backBtnIcon={icon.backBtnIcon}
onChange={onChange}
onClose={close}
onSelected={selected}
customAndExistTitle="选择其他地址"
onSwitch={onSwitch}
onCancel={onCancel}
/>
</>
);
};
......@@ -656,8 +656,8 @@ export default App;
| onChange | 自定义选择地址时,选择地区时触发 | 参考 onChange |
| onSelected | 选择已有地址列表时触发 | 参考 selected |
| onClose | 地址选择弹框关闭时触发 | 参考 close |
| closeMask |点击遮罩层或点击右上角叉号关闭时触发 | `closeWay: 'mask' \| 'cross'` |
| switchModule | 点击'选择其他地址'或自定义地址选择左上角返回按钮触发 | `type: 'exist' \| 'custom' \| 'custom2'` |
| onCancel `v2.0.0` |点击遮罩层或点击右上角叉号关闭时触发 | `closeWay: 'mask' \| 'cross'` |
| onSwitch `v2.0.0` | 点击'选择其他地址'或自定义地址选择左上角返回按钮触发 | `type: 'exist' \| 'custom' \| 'custom2'` |
## change 回调参数
......
......@@ -547,7 +547,7 @@ const App = () => {
setText((val.data as AddressResult).addressStr)
}
}
const switchModule = (val) => {
const onSwitch = (val) => {
if (val.type === 'custom') {
console.log('點擊了“選擇其他地址”按鈕')
} else {
......@@ -555,7 +555,7 @@ const App = () => {
}
}
const closeMask = (val) => {
const onCancel = (val) => {
console.log('關閉彈層', val)
}
return (
......@@ -574,8 +574,8 @@ const App = () => {
onClose={close}
onSelected={selected}
customAndExistTitle="選擇其他地址"
switchModule={switchModule}
closeMask={closeMask}
onSwitch={onSwitch}
onCancel={onCancel}
/>
</>
);
......@@ -622,8 +622,8 @@ export default App;
| onChange | 自定義選擇地址時,選擇地區時觸發 | 參考 onChange |
| onSelected | 選擇已有地址列錶時觸發 | 參考 selected |
| onClose | 地址選擇彈框關閉時觸發 | 參考 close |
| closeMask |點擊遮罩層或點擊右上角叉號關閉時觸發 | `closeWay: 'mask' \| 'cross'` |
| switchModule | 點擊'選擇其他地址'或自定義地址選擇左上角返回按鈕觸發 | `type: 'exist' \| 'custom' \| 'custom2'` |
| onCancel `v2.0.0` |點擊遮罩層或點擊右上角叉號關閉時觸發 | `closeWay: 'mask' \| 'cross'` |
| onSwitch `v2.0.0` | 點擊'選擇其他地址'或自定義地址選擇左上角返回按鈕觸發 | `type: 'exist' \| 'custom' \| 'custom2'` |
## change 回調參數
......
......@@ -72,7 +72,7 @@ export const ExistRender: FunctionComponent<
}
// 选择其他地址
const switchModule = () => {
const onSwitch = () => {
onSwitchModule &&
onSwitchModule({ type: type === 'exist' ? 'custom' : 'exist' })
}
......@@ -114,7 +114,7 @@ export const ExistRender: FunctionComponent<
</ul>
</div>
{isShowCustomAddress && (
<div className={b('choose-other')} onClick={switchModule}>
<div className={b('choose-other')} onClick={onSwitch}>
<div className={b('choose-other-btn')}>
{customAndExistTitle || locale.address.chooseAnotherAddress}
</div>
......
......@@ -246,7 +246,6 @@ export default App;
| Event | Description | Type | Arguments |
| ---------------- | ------------ | -------- | -------- |
| activeAvatar | Emitted when cell is clicked | Function | `event` |
| onActiveAvatar | Emitted when cell is clicked | Function | `event` |
| onError | Handler when img load error | Function | `event` |
......
......@@ -271,7 +271,6 @@ export default App;
| 字段 | 说明 | 类型 | 回调参数 |
| ---------------- | ------------ |---------------------------|-----------------|
| activeAvatar | 点击头像触发事件 | `(e: MouseEvent) => void` | `e: MouseEvent` |
| onActiveAvatar | 点击头像触发事件 | `(e: MouseEvent) => void` | `e: MouseEvent` |
| onError | 图片加载失败的事件 | `(e: any) => void` | `e: any` |
......
......@@ -249,7 +249,6 @@ export default App;
| 字段 | 说明 | 类型 | 回调参数 |
| ---------------- | ------------ | -------- | -------- |
| activeAvatar | 点击头像触发事件 | Function | `event` |
| onActiveAvatar | 点击头像触发事件 | Function | `event` |
| onError | 图片加载失败的事件 | Function | `event` |
......
......@@ -247,7 +247,6 @@ export default App;
| 字段 | 說明 | 類型 | 回調參數 |
| ---------------- | ------------ | -------- | -------- |
| activeAvatar `v1.3.8廢棄` | 點擊頭像觸發事件 | Function | `event` |
| onActiveAvatar | 點擊頭像觸發事件 | Function | `event` |
| onError | 圖片加載失敗的事件 | Function | `event` |
......
......@@ -332,7 +332,6 @@ export default App;
| 名称 | 说明 | 回调参数 |
|--------------------------| ------------------ | ----------------- |
| backTopClick | 按钮点击时触发事件 | `event: MouseEvent` |
| onClick | 按钮点击时触发事件 | `event: MouseEvent` |
......
......@@ -268,7 +268,6 @@ export default App;
| 名称 | 说明 | 回调参数 |
|--------------------------| ------------------ | ----------------- |
| backTopClick | 按钮点击时触发事件 | `event: MouseEvent` |
| onClick | 按钮点击时触发事件 | `event: MouseEvent` |
......
......@@ -331,7 +331,6 @@ export default App;
| 名稱 | 說明 | 回調參數 |
|--------------------------| ------------------ | ----------------- |
| backTopClick`v1.2.1(廢棄)` | 按鈕點擊時觸發事件 | `event: MouseEvent` |
| onClick | 按鈕點擊時觸發事件 | `event: MouseEvent` |
## 主題定制
......
......@@ -352,8 +352,8 @@ export default App;
| Attribute | Description | Type | Default |
|---------------------------|---------------------------------------------------|---------|----------|
| modelValue | Default Date | Date | `null` |
| visible | Is Show | boolean | `false` |
| modelValue | Default Date | Date | `null` |
| visible | Is Show | boolean | `false` |
| type | Can be set to date time year-month month-day datehour hour-minutes | string | `date` |
| minuteStep | Option minute step | number | `1` |
| isShowChinese | Show Chinese | boolean | `false` |
......
......@@ -367,7 +367,7 @@ export default App;
| title | 设置标题 | string | `null` |
| minDate | 开始日期 | Date | `十年前` |
| maxDate | 结束日期 | Date | `十年后` |
| formatter | 选项格式化函数 | (type: string, option: PickerOption) => PickerOption | - |
| formatter | 选项格式化函数 | (type: string, option: PickerOption) => PickerOption | - |
| filter | 选项过滤函数 | (type: string, option: PickerOption) => PickerOption[] | - |
| threeDimensional | 是否开启3D效果 | boolean | `true` |
......
......@@ -474,9 +474,9 @@ export default App
| height | 电梯区域的高度 | number \| string | `200px` |
| acceptKey | 索引 key 值 | string | `title` |
| indexList | 索引列表 | Array(item 需包含 id、name 属性, name 支持传入 html 结构) | `[{id: 0, name: ''}]` |
| isSticky | 索引是否吸顶 | boolean | `false` |
| spaceHeight | 右侧锚点的上下间距 | number | `23` |
| titleHeight | 左侧索引的高度 | number | `35` |
| isSticky | 索引是否吸顶 | boolean | `false` |
| spaceHeight | 右侧锚点的上下间距 | number | `23` |
| titleHeight | 左侧索引的高度 | number | `35` |
### Event
......
......@@ -106,8 +106,6 @@ export default App;
| 字段 | 说明 | 回调参数 |
| ------- | ---------------------------- | -------------------------------- |
| confirm | Click the confirm button to trigger the event callback function | Canvas and data URI displayed by signature imageURI |
| clear | Click the re sign button to trigger the event callback function | - |
| onConfirm | Click the confirm button to trigger the event callback function | Canvas and data URI displayed by signature imageURI |
| onClear | Click the re sign button to trigger the event callback function | - |
......@@ -106,8 +106,6 @@ export default App;
| 字段 | 说明 | 回调参数 |
| ------- | ---------------------------- | -------------------------------- |
| confirm | 点击确认按钮触发事件回调函数 | canvas 和签名图片展示的 data URI |
| clear | 点击重签按钮触发事件回调函数 | - |
| onConfirm | 点击确认按钮触发事件回调函数 | canvas 和签名图片展示的 data URI |
| onClear | 点击重签按钮触发事件回调函数 | - |
......@@ -105,8 +105,6 @@ export default App;
| 字段 | 说明 | 回调参数 |
| ------- | ---------------------------- | -------------------------------- |
| confirm | 点击确认按钮触发事件回调函数 | canvas 和签名图片展示的 data URI |
| clear | 点击重签按钮触发事件回调函数 | - |
| onConfirm | 点击确认按钮触发事件回调函数 | canvas 和签名图片展示的 data URI |
| onClear | 点击重签按钮触发事件回调函数 | - |
......@@ -106,8 +106,6 @@ export default App;
| 字段 | 說明 | 回調參數 |
| ------- | ---------------------------- | -------------------------------- |
| confirm | 點擊確認按鈕觸發事件回調函數 | canvas 和簽名圖片展示的 data URI |
| clear | 點擊重簽按鈕觸發事件回調函數 | - |
| onConfirm | 點擊確認按鈕觸發事件回調函數 | canvas 和簽名圖片展示的 data URI |
| onClear | 點擊重簽按鈕觸發事件回調函數 | - |
......@@ -13,11 +13,11 @@ const state = {
currentKey: 0,
dates: [
{
'pannel-key': '0',
paneKey: '0',
date: '5月20日(今天)',
},
{
'pannel-key': '1',
paneKey: '1',
date: '5月21日(星期三)',
},
],
......
......@@ -38,11 +38,11 @@ const TimeSelectDemo = () => {
const dates = [
{
'pannel-key': '0',
paneKey: '0',
date: translated.text4,
},
{
'pannel-key': '1',
paneKey: '1',
date: translated.text5,
},
]
......
......@@ -35,11 +35,11 @@ const TimeSelectDemo = () => {
const dates = [
{
'pannel-key': '0',
paneKey: '0',
date: translated.text4,
},
{
'pannel-key': '1',
paneKey: '1',
date: translated.text5,
},
]
......
......@@ -25,11 +25,11 @@ const TimeSelectDemo = () => {
const dates = [
{
'pannel-key': '0',
'paneKey': '0',
date: 'May 20 (Today)',
},
{
'pannel-key': '1',
'paneKey': '1',
date: 'May 21 (Wednesday)',
},
]
......@@ -100,16 +100,16 @@ export default TimeSelectDemo
### dates
| Props | Description | Type | Default |
|------------------------|----------------------------------------------------------------|---------|------|
| date | display name | string | - |
| pannel-key | Unique identifier, together with currentKey to identify the currently selected day | number \| string | `0`|
| Props | Description | Type | Default |
|------------------------|-------------------------|---------|------|
| date | display name | string | - |
| paneKey | Unique identifier, together with currentKey to identify the currently selected day | number \| string | `0`|
### times
| Props | Description | Type | Default |
|------------------------|---------------------------------------------------------------------------------------------------|---------|------|
| key | Unique identifier, together with pannel-key and currentKey to identify the currently selected day | Array | `[]`|
| key | Unique identifier, together with paneKey and currentKey to identify the currently selected day | Array | `[]`|
| list | Optional time list | Array | `[]`|
### TimeSelect Event
......
......@@ -25,11 +25,11 @@ const TimeSelectDemo = () => {
const dates = [
{
'pannel-key': '0',
'paneKey': '0',
date: '5月20日(今天)',
},
{
'pannel-key': '1',
'paneKey': '1',
date: '5月21日(星期三)',
},
]
......@@ -103,7 +103,7 @@ export default TimeSelectDemo
| 字段 | 说明 | 类型 | 默认值 |
|------------------------|----------------------------------------------------------------|---------|------|
| date | 显示的名称 | string | - |
| pannel-key | 唯一标识,和 currentKey 一起标识当前选择的天 | number \| string | `0`|
| paneKey | 唯一标识,和 currentKey 一起标识当前选择的天 | number \| string | `0`|
### times
......
......@@ -24,11 +24,11 @@ const TimeSelectDemo = () => {
const dates = [
{
'pannel-key': '0',
'paneKey': '0',
date: '5月20日(今天)',
},
{
'pannel-key': '1',
'paneKey': '1',
date: '5月21日(星期三)',
},
]
......@@ -102,13 +102,13 @@ export default TimeSelectDemo
| 字段 | 说明 | 类型 | 默认值 |
|------------------------|----------------------------------------------------------------|---------|------|
| date | 显示的名称 | string | - |
| pannel-key | 唯一标识,和 currentKey 一起标识当前选择的天 | number、string | `0`|
| paneKey | 唯一标识,和 currentKey 一起标识当前选择的天 | number、string | `0`|
### times
| 字段 | 说明 | 类型 | 默认值 |
|------------------------|----------------------------------------------------------------|---------|------|
| key | 唯一标识,和 pannel-key、currentKey 一起标识当前选择的天 | Array | `[]`|
| key | 唯一标识,和 paneKey、currentKey 一起标识当前选择的天 | Array | `[]`|
| list | 可选时间列表 | Array | `[]`|
### TimeSelect Event
......
......@@ -25,11 +25,11 @@ const TimeSelectDemo = () => {
const dates = [
{
'pannel-key': '0',
'paneKey': '0',
date: '5月20日(今天)',
},
{
'pannel-key': '1',
'paneKey': '1',
date: '5月21日(星期三)',
},
]
......@@ -103,13 +103,13 @@ export default TimeSelectDemo
| 字段 | 说明 | 类型 | 默认值 |
|------------------------|----------------------------------------------------------------|---------|------|
| date | 显示的名称 | string | - |
| pannel-key | 唯一标识,和 currentKey 一起标识当前选择的天 | number \| string | `0`|
| paneKey | 唯一标识,和 currentKey 一起标识当前选择的天 | number \| string | `0`|
### times
| 字段 | 说明 | 类型 | 默认值 |
|------------------------|----------------------------------------------------------------|---------|------|
| key | 唯一标识,和 pannel-key、currentKey 一起标识当前选择的天 | Array | `[]`|
| key | 唯一标识,和 paneKey、currentKey 一起标识当前选择的天 | Array | `[]`|
| list | 可选时间列表 | Array | `[]`|
### TimeSelect Event
......
......@@ -7,7 +7,7 @@ import { useConfig } from '@/packages/configprovider/configprovider.taro'
import { TimeType } from '@/packages/timedetail/timedetail.taro'
export interface DateType {
'pannel-key'?: string | number
paneKey?: string | number
date: string
}
export interface TimeSelectProps {
......@@ -157,7 +157,7 @@ export const TimeSelect: FunctionComponent<Partial<TimeSelectProps>> = (
}
// 选中的日期增加 active 类名
const getTimePannelClass = (dataItem: DateType) => {
if (String(dataItem['pannel-key']) === String(activeKey)) {
if (String(dataItem['paneKey']) === String(activeKey)) {
return 'nut-timepannel-active'
}
return ''
......@@ -186,8 +186,8 @@ export const TimeSelect: FunctionComponent<Partial<TimeSelectProps>> = (
<TimePannel
date={dataItem.date}
className={getTimePannelClass(dataItem)}
key={String(dataItem['pannel-key'] || index)}
curKey={String(dataItem['pannel-key'] || index)}
key={String(dataItem['paneKey'] || index)}
curKey={String(dataItem['paneKey'] || index)}
change={handleChange}
/>
))}
......
......@@ -7,7 +7,7 @@ import { useConfig } from '@/packages/configprovider'
import { TimeType } from '@/packages/timedetail/timedetail'
export interface DateType {
'pannel-key'?: string | number
paneKey?: string | number
date: string
}
export interface TimeSelectProps {
......@@ -157,7 +157,7 @@ export const TimeSelect: FunctionComponent<Partial<TimeSelectProps>> = (
}
// 选中的日期增加 active 类名
const getTimePannelClass = (dataItem: DateType) => {
if (String(dataItem['pannel-key']) === String(activeKey)) {
if (String(dataItem['paneKey']) === String(activeKey)) {
return 'nut-timepannel-active'
}
return ''
......@@ -186,8 +186,8 @@ export const TimeSelect: FunctionComponent<Partial<TimeSelectProps>> = (
<TimePannel
date={dataItem.date}
className={getTimePannelClass(dataItem)}
key={String(dataItem['pannel-key'] || index)}
curKey={String(dataItem['pannel-key'] || index)}
key={String(dataItem['paneKey'] || index)}
curKey={String(dataItem['paneKey'] || index)}
change={handleChange}
/>
))}
......
......@@ -287,7 +287,7 @@ import { Uploader, Button } from '@nutui/nutui-react';
const App = () => {
const uploadUrl = 'https://my-json-server.typicode.com/linrufeng/demo/posts'
const beforeXhrUpload = (xhr: XMLHttpRequest, options: any) => {
if (options.method.toLowerCase() == 'put') {
if (options.method.toLowerCase() === 'put') {
xhr.send(options.sourceFile);
} else {
xhr.send(options.formData);
......
......@@ -102,7 +102,7 @@ const VideoDemo = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<h2>{translated.a5a25e88}</h2>
......@@ -112,7 +112,7 @@ const VideoDemo = () => {
options={options1}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<h2>{translated['19875a3f']}</h2>
......@@ -122,7 +122,7 @@ const VideoDemo = () => {
options={options2}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<h2>{translated.fcdac2ed}</h2>
......@@ -132,7 +132,7 @@ const VideoDemo = () => {
options={options3}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<h2>{translated['200baa8c']}</h2>
......@@ -142,7 +142,7 @@ const VideoDemo = () => {
options={options4}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<h2>{translated['5ec0e561']}</h2>
......@@ -152,7 +152,7 @@ const VideoDemo = () => {
options={options5}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<h2>{translated.a6e0b0cf}</h2>
......@@ -162,7 +162,7 @@ const VideoDemo = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<Button type="primary" className="video-m-b" onClick={changeVideo}>
......
......@@ -99,7 +99,7 @@ const VideoDemo = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<h2>{translated.a5a25e88}</h2>
......@@ -109,7 +109,7 @@ const VideoDemo = () => {
options={options1}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<h2>{translated['19875a3f']}</h2>
......@@ -119,7 +119,7 @@ const VideoDemo = () => {
options={options2}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<h2>{translated.fcdac2ed}</h2>
......@@ -129,7 +129,7 @@ const VideoDemo = () => {
options={options3}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<h2>{translated['200baa8c']}</h2>
......@@ -139,7 +139,7 @@ const VideoDemo = () => {
options={options4}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<h2>{translated['5ec0e561']}</h2>
......@@ -149,7 +149,7 @@ const VideoDemo = () => {
options={options5}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<h2>{translated.a6e0b0cf}</h2>
......@@ -159,7 +159,7 @@ const VideoDemo = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<Button type="primary" className="video-m-b" onClick={changeVideo}>
......
......@@ -37,7 +37,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -77,7 +77,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -116,7 +116,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -156,7 +156,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -196,7 +196,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -239,7 +239,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -281,7 +281,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<Button type="primary" className="m-b" onClick={changeVideo}>Video switching</Button>
......@@ -317,4 +317,4 @@ export default App;
| playend | Playback completion callback | - |
| onPlay `v2.0.0` | play event | - |
| onPause `v2.0.0` | pause event | - |
| onPlayend | Playback completion callback | - |
| onPlayEnd `v2.0.0` | Playback completion callback | - |
......@@ -39,7 +39,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -79,7 +79,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -118,7 +118,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -158,7 +158,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -198,7 +198,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -241,7 +241,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -283,7 +283,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<Button type="primary" className="m-b" onClick={changeVideo}>视频切换</Button>
......@@ -319,4 +319,4 @@ export default App;
| playend | 播放完成回调 | - |
| onPlay `v2.0.0` | 播放 | - |
| onPause `v2.0.0` | 暂停 | - |
| onPlayend | 播放完成回调 | - |
\ No newline at end of file
| onPlayEnd `v2.0.0` | 播放完成回调 | - |
\ No newline at end of file
......@@ -39,7 +39,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -79,7 +79,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -118,7 +118,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -158,7 +158,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -198,7 +198,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -242,7 +242,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
</>
......@@ -284,7 +284,7 @@ const App = () => {
options={options}
onPlay={play}
onPause={pause}
onPlayend={playend}
onPlayEnd={playend}
/>
</Cell>
<Button type="primary" className="m-b" onClick={changeVideo}>視頻切換</Button>
......@@ -320,4 +320,4 @@ export default App;
| playend `v1.3.8廢棄` | 播放完成回調 | - |
| onPlay `v2.0.0` | 播放 | - |
| onPause `v2.0.0` | 暫停 | - |
| onPlayend | 播放完成回調 | - |
\ No newline at end of file
| onPlayEnd `v2.0.0` | 播放完成回調 | - |
\ No newline at end of file
......@@ -22,7 +22,7 @@ export interface VideoProps {
playend: (e: HTMLVideoElement) => void
onPlay: (e: HTMLVideoElement) => void
onPause: (e: HTMLVideoElement) => void
onPlayend: (e: HTMLVideoElement) => void
onPlayEnd: (e: HTMLVideoElement) => void
}
const defaultProps = {
source: {
......@@ -52,7 +52,7 @@ export const Video: FunctionComponent<
playend,
onPlay,
onPause,
onPlayend,
onPlayEnd,
...restProps
} = {
...defaultProps,
......@@ -90,7 +90,7 @@ export const Video: FunctionComponent<
})
videoRef.addEventListener('ended', () => {
videoRef.currentTime = 0
onPlayend && onPlayend(videoRef)
onPlayEnd && onPlayEnd(videoRef)
playend && playend(videoRef)
})
}
......
......@@ -22,7 +22,7 @@ export interface VideoProps {
playend: (e: HTMLVideoElement) => void
onPlay: (e: HTMLVideoElement) => void
onPause: (e: HTMLVideoElement) => void
onPlayend: (e: HTMLVideoElement) => void
onPlayEnd: (e: HTMLVideoElement) => void
}
const defaultProps = {
source: {
......@@ -52,7 +52,7 @@ export const Video: FunctionComponent<
playend,
onPlay,
onPause,
onPlayend,
onPlayEnd,
...restProps
} = {
...defaultProps,
......@@ -90,7 +90,7 @@ export const Video: FunctionComponent<
})
videoRef.addEventListener('ended', () => {
videoRef.currentTime = 0
onPlayend && onPlayend(videoRef)
onPlayEnd && onPlayEnd(videoRef)
playend && playend(videoRef)
})
}
......
......@@ -198,11 +198,11 @@ export default App;
| 参数 | 说明 | 类型 | 默认值 |
|---------------|----------------------------------|----------|---------------------------------------|
| sourceData | source data | Array | - |
| containerSize | container height | number | Get the element offsetWidth or offsetHeight, which is given by CSS |
| ItemRender | virtual function rendered by the parent of the list | React.FC | - |
| itemSize | Item height, if not height, the first screen single maximum size | string | - |
| itemEqualSize | the sizes of items are consistent | boolean | `true` |
| sourceData | source data | Array | - |
| containerSize | container height | number | Get the element offsetWidth or offsetHeight, which is given by CSS |
| ItemRender | virtual function rendered by the parent of the list | React.FC | - |
| itemSize | Item height, if not height, the first screen single maximum size | string | - |
| itemEqualSize | the sizes of items are consistent | boolean | `true` |
| overscan | In addition to the default elements in the viewport, there is an additional number of items to render | number | `2` |
| key | Unique value,Item(sourceData) Specifies a field with a unique value | string | `index` |
| horizontal | horizontal or vertical | boolean | `false` |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册