chore: expose getIconNames Close: #6831 (#6870)

This commit is contained in:
liaoxuezhi 2023-05-15 15:26:05 +08:00 committed by GitHub
parent 390883c79e
commit acf4070de0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -118,6 +118,10 @@ const iconFactory: {
[propName: string]: React.ElementType<{}>;
} = {};
export function getIconNames() {
return Object.keys(iconFactory);
}
export function getIcon(key: string) {
return iconFactory[key];
}

View File

@ -76,7 +76,7 @@ import PickerContainer from './PickerContainer';
import InputJSONSchema from './json-schema';
import {Badge, withBadge} from './Badge';
import type {BadgeObject} from './Badge';
import {getIcon, Icon, registerIcon} from './icons';
import {getIcon, getIconNames, Icon, registerIcon} from './icons';
import {withRemoteConfig} from './WithRemoteConfig';
import type {RemoteOptionsProps} from './WithRemoteConfig';
import ConditionBuilder from './condition-builder';
@ -224,6 +224,7 @@ export {
UserSelect,
UserTabSelect,
getIcon,
getIconNames,
registerIcon,
Badge,
HeadCellDropDown,