@arche-mc2/arche-controls
Version:
We know that there are a ton of react UI library projects to choose from. Our hope with this one is to provide the next generation of react components that you can use to bootstrap your next project, or as a reference for building a UIKit. Read on to get
56 lines • 2.17 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var React = require("react");
var typestyle_1 = require("typestyle");
var classnames_1 = require("classnames");
var ButtonGroup_1 = require("../ButtonGroup");
var theming_1 = require("../../../Common/theming");
var device_1 = require("../../../Common/utils/device");
var getStyle = function (props) {
return typestyle_1.style({
display: 'flex',
marginTop: '5px',
marginBottom: '5px',
width: '100%',
position: 'relative',
flexDirection: 'row',
$nest: {
'&.up-data-grid-header .header-title': {
lineHeight: '21px',
fontWeight: 'bold',
fontSize: '18px',
flexGrow: 1,
alignSelf: 'center',
color: props.theme.colorMap.primary
},
'&.up-data-grid-header .up-btn-wrapper': {
marginLeft: '20px',
},
},
}, typestyle_1.media(device_1.DeviceSmartphones, {
flexDirection: 'column',
$nest: {
'div > .up-buttons-wrapper': {
justifyContent: 'center',
},
},
}));
};
var UpDataGridHeader = function (props) {
var title = props.title, theme = props.theme, buttons = props.buttons, buttonExport = props.buttonExport;
var renderTitle = function () {
return title &&
(typeof title === 'string' ? (React.createElement("p", { className: classnames_1.default('header-title') }, title)) : (title));
};
return (React.createElement("div", { className: classnames_1.default('up-data-grid-header', getStyle({ theme: theme })) },
renderTitle(),
(buttons || buttonExport) && (React.createElement("div", null,
React.createElement(ButtonGroup_1.default, { isAddOn: "right", gutter: 1, align: 'h' },
buttons,
buttonExport)))));
};
UpDataGridHeader.defaultProps = {
theme: theming_1.default
};
exports.default = UpDataGridHeader;
//# sourceMappingURL=UpDataGridHeader.js.map