1
This commit is contained in:
Generated
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
import * as React from 'react';
|
||||
import type { AnyObject } from '../../_util/type';
|
||||
declare const useMergedPickerSemantic: <P extends AnyObject = AnyObject>(pickerType: "timePicker" | "datePicker", classNames?: P["classNames"], styles?: P["styles"], popupClassName?: string, popupStyle?: React.CSSProperties, mergedProps?: P) => readonly [classNames: import("..").DatePickerSemanticClassNames & {
|
||||
popup: import("..").DatePickerPanelSemanticClassNames;
|
||||
}, styles: import("..").DatePickerSemanticStyles & {
|
||||
popup: import("..").DatePickerPanelSemanticStyles;
|
||||
}];
|
||||
export default useMergedPickerSemantic;
|
||||
Generated
Vendored
+41
@@ -0,0 +1,41 @@
|
||||
import * as React from 'react';
|
||||
import { clsx } from 'clsx';
|
||||
import { useMergeSemantic } from '../../_util/hooks';
|
||||
import { useComponentConfig } from '../../config-provider/context';
|
||||
const useMergedPickerSemantic = (pickerType, classNames, styles, popupClassName, popupStyle, mergedProps) => {
|
||||
const {
|
||||
classNames: contextClassNames,
|
||||
styles: contextStyles
|
||||
} = useComponentConfig(pickerType);
|
||||
const [mergedClassNames, mergedStyles] = useMergeSemantic([contextClassNames, classNames], [contextStyles, styles], {
|
||||
props: mergedProps
|
||||
}, {
|
||||
popup: {
|
||||
_default: 'root'
|
||||
}
|
||||
});
|
||||
return React.useMemo(() => {
|
||||
// ClassNames
|
||||
const filledClassNames = {
|
||||
...mergedClassNames,
|
||||
popup: {
|
||||
...mergedClassNames.popup,
|
||||
root: clsx(mergedClassNames.popup?.root, popupClassName)
|
||||
}
|
||||
};
|
||||
// Styles
|
||||
const filledStyles = {
|
||||
...mergedStyles,
|
||||
popup: {
|
||||
...mergedStyles.popup,
|
||||
root: {
|
||||
...mergedStyles.popup?.root,
|
||||
...popupStyle
|
||||
}
|
||||
}
|
||||
};
|
||||
// Return
|
||||
return [filledClassNames, filledStyles];
|
||||
}, [mergedClassNames, mergedStyles, popupClassName, popupStyle]);
|
||||
};
|
||||
export default useMergedPickerSemantic;
|
||||
Reference in New Issue
Block a user