@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
27 lines (24 loc) • 1.66 kB
JavaScript
/*!
* KoliBri - The accessible HTML-Standard
*/
import { a as __rest } from './tslib.es6-QNbPBOk5.js';
import { h, F as Fragment } from './index-BQlHOxik.js';
import './common-Cx_AGO_M.js';
import { i as isMsgDefinedAndInputTouched, c as getDefaultProps, g as getMsgType } from './FormFieldStateWrapper-BWTMRKXT.js';
import { c as clsx } from './clsx-COFh-Vc8.js';
import { a as createRelatedUniqueId } from './dev.utils-02Sl9bQo.js';
const InputFc = (props) => {
const { class: classNames, msg, required, disabled, touched, readonly, ariaDescribedBy, hideLabel, label, suggestions, value } = props, other = __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--${getMsgType(msg)}`]: isMsgDefinedAndInputTouched(msg, touched),
};
const inputProps = Object.assign(Object.assign({ class: clsx('kol-input', stateCssClasses, classNames), required: required, disabled: disabled, readonly: readonly, type: 'text', list: suggestions && typeof other.id === 'string' ? createRelatedUniqueId(other.id, 'list') : undefined }, getDefaultProps({ ariaDescribedBy, hideLabel, label })), other);
return (h(Fragment, null, h("input", Object.assign({}, inputProps, { value: value })), suggestions));
};
export { InputFc as I };
//# sourceMappingURL=Input-DQJln-L5.js.map
//# sourceMappingURL=Input-DQJln-L5.js.map