1 В избранное 0 Ответвления 0

OSCHINA-MIRROR/open-hand-choerodon-ui

Присоединиться к Gitlife
Откройте для себя и примите участие в публичных проектах с открытым исходным кодом с участием более 10 миллионов разработчиков. Приватные репозитории также полностью бесплатны :)
Присоединиться бесплатно
Клонировать/Скачать
utils.tsx 1.2 КБ
Копировать Редактировать Исходные данные Просмотреть построчно История
HughHzWu Отправлено 3 лет назад bad5b40
import isBoolean from 'lodash/isBoolean';
import isObject from 'lodash/isObject';
import { getConfig as getDataSetConfig } from 'choerodon-ui/dataset';
import { Config, Customizable, DefaultConfig } from './index';
export function isCustomizable(target: boolean | Customizable | undefined): target is Customizable {
return isObject(target);
}
export function getConfig<T extends keyof Config>(key: T): T extends keyof DefaultConfig ? DefaultConfig[T] : Config[T] {
return getDataSetConfig<Config, T, DefaultConfig>(key);
}
export function getPrefixCls(suffixCls: string, customizePrefixCls?: string): string {
if (customizePrefixCls) {
return customizePrefixCls;
}
return `${getConfig('prefixCls')}-${suffixCls}`;
}
export function getProPrefixCls(suffixCls: string, customizePrefixCls?: string): string {
if (customizePrefixCls) {
return customizePrefixCls;
}
return `${getConfig('proPrefixCls')}-${suffixCls}`;
}
export function getCustomizable<T extends keyof Customizable>(component: T): boolean | undefined {
const customizable = getConfig('customizable');
if (isBoolean(customizable)) {
return customizable;
}
if (isCustomizable(customizable)) {
return customizable[component];
}
}

Опубликовать ( 0 )

Вы можете оставить комментарий после Вход в систему

1
https://gitlife.ru/oschina-mirror/open-hand-choerodon-ui.git
git@gitlife.ru:oschina-mirror/open-hand-choerodon-ui.git
oschina-mirror
open-hand-choerodon-ui
open-hand-choerodon-ui
1.6.4