File tree Expand file tree Collapse file tree
client/packages/openblocks/src/comps/comps/dateComp Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,7 +158,6 @@ export type DateCompViewProps = Pick<
158158 | "secondStep"
159159 | "viewRef"
160160> & {
161- onPanelChange : ( ) => void ;
162161 onFocus : ( ) => void ;
163162 onBlur : ( ) => void ;
164163 $style : DateTimeStyleType ;
@@ -282,10 +281,9 @@ export const dateRangeControl = (function () {
282281 ) ;
283282 props . onEvent ( "change" ) ;
284283 } }
285- onPanelChange = { ( ) => {
286- // mode[0] !== "date" && handleDateChange("", props.start.onChange, noop);
287- handleDateChange ( "" , props . start . onChange , noop ) ;
288- handleDateChange ( "" , props . end . onChange , noop ) ;
284+ onPanelChange = { ( _ , mode ) => {
285+ mode [ 0 ] !== "date" && handleDateChange ( "" , props . start . onChange , noop ) ;
286+ mode [ 1 ] !== "date" && handleDateChange ( "" , props . end . onChange , noop ) ;
289287 } }
290288 onFocus = { ( ) => props . onEvent ( "focus" ) }
291289 onBlur = { ( ) => props . onEvent ( "blur" ) }
Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ export interface DateRangeUIViewProps extends DateCompViewProps {
2424 start : moment . Moment | null ;
2525 end : moment . Moment | null ;
2626 onChange : ( start ?: moment . Moment | null , end ?: moment . Moment | null ) => void ;
27+ onPanelChange : ( value : any , mode : [ string , string ] ) => void ;
2728}
2829
2930export const DateRangeUIView = ( props : DateRangeUIViewProps ) => {
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ const DatePickerStyled = styled(DatePicker)<{ $style: DateTimeStyleType }>`
1717export interface DataUIViewProps extends DateCompViewProps {
1818 value : moment . Moment | null ;
1919 onChange : ( value : moment . Moment | null ) => void ;
20+ onPanelChange : ( ) => void ;
2021}
2122
2223const DateMobileUIView = React . lazy ( ( ) =>
You can’t perform that action at this time.
0 commit comments