@vs-form/vs-form
Version:
A schema-based form generator component for React using material-ui
61 lines (58 loc) • 1.94 kB
JavaScript
import { Component, createElement } from 'react';
import 'lodash/capitalize';
import 'lodash/cloneDeep';
import 'lodash/get';
import 'lodash/has';
import 'lodash/isArray';
import 'lodash/isDate';
import 'lodash/isBoolean';
import 'lodash/isEmpty';
import 'lodash/isFunction';
import 'lodash/isInteger';
import 'lodash/isNull';
import 'lodash/isNumber';
import 'lodash/isObject';
import 'lodash/isPlainObject';
import 'lodash/isRegExp';
import 'lodash/isString';
import isUndefined from 'lodash/isUndefined';
import 'lodash/merge';
import 'lodash/set';
import 'lodash/toInteger';
import 'lodash/toNumber';
import 'lodash/trimEnd';
import 'lodash/uniq';
import 'lodash/debounce';
import 'lodash/throttle';
import { b as Component$1 } from './chunk-68362596.js';
import { c as registerComponent } from './chunk-3774fd4c.js';
import '@material-ui/core/Typography';
import { a as Text } from './chunk-4358fb9c.js';
class VsPanelWithLabel extends Component {
constructor(props) {
super(props);
this.PanelProps = {};
this.HeaderTypographyProps = {};
this.initProps();
}
get comp() { return this.props.comp; }
render() {
return (createElement("div", Object.assign({}, this.PanelProps),
this.comp.label ? createElement(Text, Object.assign({ text: this.comp.label }, this.HeaderTypographyProps)) : null,
this.props.children));
}
initProps() {
const { HeaderTypographyProps, ...PanelProps } = this.comp.props;
if (PanelProps) {
this.PanelProps = PanelProps;
}
if (HeaderTypographyProps) {
this.HeaderTypographyProps = HeaderTypographyProps;
}
if (isUndefined(this.HeaderTypographyProps.variant)) {
this.HeaderTypographyProps.variant = 'h6';
}
}
}
registerComponent(Component$1.panel, VsPanelWithLabel);
export default VsPanelWithLabel;