@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
29 lines (25 loc) • 1.7 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
;
var tslib_es6 = require('./tslib.es6-Cm0ytgPY.js');
var index = require('./index-BrhW8s5h.js');
require('./common-DPb6NWR4.js');
var FormFieldStateWrapper = require('./FormFieldStateWrapper-BZsSDU0S.js');
var clsx = require('./clsx-Bm_HQUnh.js');
var dev_utils = require('./dev.utils-BeTuwcHU.js');
const InputFc = (props) => {
const { class: classNames, msg, required, disabled, touched, readonly, ariaDescribedBy, hideLabel, label, suggestions, value } = props, other = tslib_es6.__rest(props, ["class", "msg", "required", "disabled", "touched", "readonly", "ariaDescribedBy", "hideLabel", "label", "suggestions", "value"]);
const stateCssClasses = {
['kol-input--disabled']: Boolean(disabled),
['kol-input--required']: Boolean(required),
['kol-input--touched']: Boolean(touched),
['kol-input--readonly']: Boolean(readonly),
[`kol-input--${FormFieldStateWrapper.getMsgType(msg)}`]: FormFieldStateWrapper.isMsgDefinedAndInputTouched(msg, touched),
};
const inputProps = Object.assign(Object.assign({ class: clsx.clsx('kol-input', stateCssClasses, classNames), required: required, disabled: disabled, readonly: readonly, type: 'text', list: suggestions && typeof other.id === 'string' ? dev_utils.createRelatedUniqueId(other.id, 'list') : undefined }, FormFieldStateWrapper.getDefaultProps({ ariaDescribedBy, hideLabel, label })), other);
return (index.h(index.Fragment, null, index.h("input", Object.assign({}, inputProps, { value: value })), suggestions));
};
exports.InputFc = InputFc;
//# sourceMappingURL=Input-CJWa5Pws.js.map
//# sourceMappingURL=Input-CJWa5Pws.js.map