@douyinfe/semi-ui 2.10.3 → 2.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/datePicker/__test__/datePicker.test.js +1 -0
- package/datePicker/_story/v2/FixTriggerRender.tsx +36 -0
- package/datePicker/_story/v2/index.js +1 -0
- package/dist/css/semi.css +0 -1
- package/dist/umd/semi-ui.js +358 -333
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/form/baseForm.d.ts +1 -1
- package/lib/cjs/form/field.d.ts +1 -1
- package/lib/cjs/typography/title.d.ts +1 -1
- package/lib/es/form/baseForm.d.ts +1 -1
- package/lib/es/form/field.d.ts +1 -1
- package/lib/es/typography/title.d.ts +1 -1
- package/package.json +9 -9
- package/yarn-error.log +26235 -0
|
@@ -1056,6 +1056,7 @@ describe(`DatePicker`, () => {
|
|
|
1056
1056
|
const rightSecondWeek = rightPanel.querySelectorAll(`.${BASE_CLASS_PREFIX}-datepicker-week`)[1];
|
|
1057
1057
|
const rightSecondWeekDays = rightSecondWeek.querySelectorAll(`.${BASE_CLASS_PREFIX}-datepicker-day`);
|
|
1058
1058
|
leftSecondWeekDays[0].click();
|
|
1059
|
+
await sleep();
|
|
1059
1060
|
rightSecondWeekDays[0].click();
|
|
1060
1061
|
|
|
1061
1062
|
const baseElem = elem.find(BaseDatePicker);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React, { useState, useCallback, useMemo } from 'react';
|
|
2
|
+
import { DatePicker, Button, Icon, Space } from '@douyinfe/semi-ui';
|
|
3
|
+
|
|
4
|
+
export default function Demo() {
|
|
5
|
+
const [date, setDate] = useState([]);
|
|
6
|
+
const onChange = useCallback(date => {
|
|
7
|
+
setDate(date);
|
|
8
|
+
console.log(date);
|
|
9
|
+
}, []);
|
|
10
|
+
const onClear = useCallback(e => {
|
|
11
|
+
e && e.stopPropagation();
|
|
12
|
+
setDate(null);
|
|
13
|
+
}, []);
|
|
14
|
+
|
|
15
|
+
const closeIcon = useMemo(() => (date ? <Icon type="close" onClick={onClear} /> : <Icon type="chevron_down" />), [date]);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Space>
|
|
19
|
+
<DatePicker
|
|
20
|
+
type="dateTimeRange"
|
|
21
|
+
onChange={onChange}
|
|
22
|
+
value={date}
|
|
23
|
+
triggerRender={({ placeholder }) => (
|
|
24
|
+
<Button theme={'light'} icon={closeIcon} iconPosition={'right'}>
|
|
25
|
+
{(date && String(date)) || placeholder}
|
|
26
|
+
</Button>
|
|
27
|
+
)}
|
|
28
|
+
/>
|
|
29
|
+
<DatePicker
|
|
30
|
+
type="dateRange"
|
|
31
|
+
motion={false}
|
|
32
|
+
triggerRender={({ placeholder }) => <Button theme={'light'}>{placeholder}</Button>}
|
|
33
|
+
/>
|
|
34
|
+
</Space>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -4,3 +4,4 @@ export { default as FixInputRangeFocus } from './FixInputRangeFocus';
|
|
|
4
4
|
export { default as InsetInput } from './InsetInput';
|
|
5
5
|
export { default as InsetInputE2E } from './InsetInputE2E';
|
|
6
6
|
export { default as FixDefaultPickerValue } from './FixDefaultPickerValue';
|
|
7
|
+
export { default as FixedTriggerRender } from './FixTriggerRender';
|
package/dist/css/semi.css
CHANGED