{"version":3,"file":"input.types.mjs","names":[],"sources":["../../../../package/common/input/input.types.ts"],"sourcesContent":["import React from 'react';\nimport type { FormValidator } from 'services/formValidation';\nimport type { SlotClassNames, SlotStyles, DataProps } from '../types/slots.types';\n\nexport enum InputType {\n  Edit = 'edit',\n  Phone = 'phone',\n  Email = 'email',\n  Iban = 'iban',\n  Date = 'date',\n  HasNoIcon = 'hasNoIcon',\n  Search = 'searchInput',\n  Password = 'password',\n}\n\nexport enum InputIconPosition {\n  Left = 'left',\n  Right = 'right',\n}\n\nexport type InputSlots = 'label' | 'container' | 'input' | 'suffix' | 'upperRightLabel' | 'fieldset';\n\ntype OverriddenInputAttributes =\n  | 'onChange'\n  | 'onFocus'\n  | 'onBlur'\n  | 'onMouseEnter'\n  | 'onMouseLeave'\n  | 'onClick'\n  | 'type'\n  | 'value'\n  | 'min'\n  | 'max'\n  | 'autoComplete';\n\n/** Text Input renders of its own, for translating it. */\nexport interface InputLabels {\n  /** Clear button on a search input, read out by screen readers. */\n  clear?: string;\n  /** Reveals a password, read out by screen readers. */\n  showPassword?: string;\n  /** Hides a password again. */\n  hidePassword?: string;\n  /** Clears a search input, read out by screen readers. */\n  clearSearch?: string;\n}\n\nexport interface InputProps\n  extends Omit<React.InputHTMLAttributes<HTMLInputElement>, OverriddenInputAttributes>, DataProps {\n  onMouseEnter?: ((event: React.MouseEvent) => void) | null;\n  onMouseLeave?: ((event: React.MouseEvent) => void) | null;\n  onFocus?: ((event: React.FocusEvent) => void) | null;\n  onBlur?: ((event: React.FocusEvent) => void) | null;\n  onChange?:\n    | ((value: string, event?: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement, Element>) => void)\n    | null;\n  errorMessage?: string;\n  isValid?: boolean;\n  isRequired?: boolean;\n  label?: string;\n  name?: string;\n  className?: string;\n  style?: React.CSSProperties;\n  value?: string | number;\n  icon?: React.ReactElement | null;\n  iconPosition?: InputIconPosition;\n  isUppercase?: boolean;\n  isRow?: boolean;\n  tabIndex?: number;\n  type?: InputType;\n  onIconClick?: (() => void) | null;\n  parse?: ((value: string) => string) | null;\n  suffix?: string | React.ReactNode;\n  disabled?: boolean;\n  upperRightLabel?: string | React.ReactNode;\n  labelInBorder?: boolean;\n  /** Show a button that clears the field, whenever it has a value it can change. */\n  clearable?: boolean;\n  /** Called after a clear button empties the field, by click or key. */\n  onClear?: (() => void) | null;\n  min?: string | number | null;\n  max?: string | number | null;\n  placeholder?: string;\n  useMatLabelStyle?: boolean;\n  alwaysFloatLabel?: boolean;\n  autoComplete?: string | null;\n  onClick?: (() => void) | null;\n  readOnly?: boolean;\n  customInput?: React.ReactElement | null;\n  autoFocus?: boolean;\n  formValidator?: FormValidator | null;\n  multiline?: boolean;\n  rows?: number;\n  autoResize?: boolean;\n  /**\n   * Ref to the rendered `<input>` (or `<textarea>` when `multiline`). Not forwarded to a\n   * `customInput`, which owns its own ref.\n   */\n  ref?: React.Ref<HTMLInputElement | HTMLTextAreaElement>;\n  classNames?: SlotClassNames<InputSlots>;\n  styles?: SlotStyles<InputSlots>;\n  /** Overrides the text Input renders of its own. Merged per key. */\n  labels?: InputLabels;\n}\n"],"mappings":"aAIA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,KAAA,OACA,EAAA,MAAA,QACA,EAAA,MAAA,QACA,EAAA,KAAA,OACA,EAAA,KAAA,OACA,EAAA,UAAA,YACA,EAAA,OAAA,cACA,EAAA,SAAA,YACF,EAAA,CAAA,CAAA,EAEY,EAAL,SAAA,EAAA,OACL,GAAA,KAAA,OACA,EAAA,MAAA,SACF,EAAA,CAAA,CAAA"}