@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
30 lines (29 loc) • 1 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import { __rest } from "tslib";
import { h } from "@stencil/core";
import KolRadioFc from "../../functional-components/inputs/Radio";
function getRadioProps(state, inputProps = {}) {
const props = {
id: state._id,
hideLabel: state._hideLabel,
label: state._label,
value: state._value,
disabled: state._disabled,
name: state._name,
};
if ('_required' in state)
props.required = state._required;
if ('_touched' in state)
props.touched = state._touched;
if ('_msg' in state)
props.msg = state._msg;
return Object.assign(Object.assign({}, props), inputProps);
}
const RadioStateWrapper = (_a) => {
var { state, inputProps } = _a, other = __rest(_a, ["state", "inputProps"]);
return h(KolRadioFc, Object.assign({ inputProps: getRadioProps(state, inputProps) }, other));
};
export default RadioStateWrapper;
//# sourceMappingURL=RadioStateWrapper.js.map