This commit is contained in:
2026-05-25 17:08:18 +08:00
parent df501f6151
commit f1259b71b5
9178 changed files with 1626125 additions and 0 deletions
@@ -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;
@@ -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;