zarm-web
Version:
基于 React 的桌面端UI库
47 lines (38 loc) • 855 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.handleFillType = handleFillType;
exports.handlAddonProps = handlAddonProps;
var _PropsType = require("./PropsType");
var DEFAULT_THEME_COLOR = '#F2F2F2';
var DEFAULT_FILL_COLOR = '#00BC70';
var colorTheme = {
fill: DEFAULT_FILL_COLOR,
default: DEFAULT_THEME_COLOR
};
function handleFillType(fillType) {
if (!fillType) {
return DEFAULT_THEME_COLOR;
}
var color = colorTheme[fillType];
return color || fillType;
}
function handlAddonProps(addon) {
if (typeof addon === 'function') {
return {
fillType: 'default',
addon: addon()
};
}
if ((0, _PropsType.isAddon)(addon)) {
if (!addon.fillType) {
addon.fillType = 'default';
}
return addon;
}
return {
fillType: 'default',
addon: addon
};
}