@hexure/ui 1.13.54 → 1.13.56

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import React, { FC } from 'react';
2
2
  import { CSSProperties } from 'styled-components';
3
3
  import { AccessibleProps } from '../../utils/Accessibility';
4
4
  export interface styleProps {
@@ -33,6 +33,8 @@ export interface InputProps extends AccessibleProps {
33
33
  /** Optional ID for automation purposes */
34
34
  dataItemid?: string;
35
35
  mask?: string;
36
+ onPaste?: (e?: any) => void;
37
+ autoComplete?: React.InputHTMLAttributes<HTMLInputElement>['autoComplete'];
36
38
  }
37
39
  declare const Input: FC<InputProps>;
38
40
  export default Input;
package/dist/esm/index.js CHANGED
@@ -1310,7 +1310,7 @@ const Drawer = (_a) => {
1310
1310
  title ? (React.createElement(Heading, { "data-itemid": `${baseId}-title`, type: 'secondary' }, title)) : null,
1311
1311
  description ? (React.createElement(Copy, { color: 'GRAY', "data-itemid": `${baseId}-description` }, description)) : null),
1312
1312
  React.createElement(Close$1, { "data-itemid": `${baseId}-close`, onClick: onClose },
1313
- React.createElement(Button, { "data-itemid": `${baseId}-close-button`, format: 'secondary', icon: mdiClose, small: true }))),
1313
+ React.createElement(Button, { dataItemid: `${baseId}-close-button`, format: 'secondary', icon: mdiClose, small: true }))),
1314
1314
  React.createElement(ContentWrapper$1, { "data-itemid": `${baseId}-content-wrapper` }, children),
1315
1315
  primaryButton || secondaryButton || tertiaryButton ? (React.createElement(ButtonBar$1, { "data-itemid": `${baseId}-button-bar` },
1316
1316
  tertiaryButton ? (React.createElement(Button, Object.assign({}, tertiaryButton, { "data-itemid": `${baseId}-tertiary-button`, format: tertiaryButton.format || 'secondary' }))) : null,
@@ -1880,7 +1880,7 @@ const Loader$1 = styled.div `
1880
1880
  const Input$1 = (_a) => {
1881
1881
  var { format, suffix, height, invalid, loading, max, maxLength, min, onBlur, onChange, onFocus, onKeyDown,
1882
1882
  // eslint-disable-next-line @typescript-eslint/no-empty-function
1883
- onSuggestedSelect = () => { }, placeholder, readOnly, showCharCount, step, style, suggestedValues, showErrorTextColor = false, type = 'text', value = '', innerRef = null, tabIndex, isAutoComplete = false, dataItemid, mask } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "loading", "max", "maxLength", "min", "onBlur", "onChange", "onFocus", "onKeyDown", "onSuggestedSelect", "placeholder", "readOnly", "showCharCount", "step", "style", "suggestedValues", "showErrorTextColor", "type", "value", "innerRef", "tabIndex", "isAutoComplete", "dataItemid", "mask"]);
1883
+ onSuggestedSelect = () => { }, placeholder, readOnly, showCharCount, step, style, suggestedValues, showErrorTextColor = false, type = 'text', value = '', innerRef = null, tabIndex, isAutoComplete = false, dataItemid, mask, onPaste, autoComplete } = _a, accessibleProps = __rest(_a, ["format", "suffix", "height", "invalid", "loading", "max", "maxLength", "min", "onBlur", "onChange", "onFocus", "onKeyDown", "onSuggestedSelect", "placeholder", "readOnly", "showCharCount", "step", "style", "suggestedValues", "showErrorTextColor", "type", "value", "innerRef", "tabIndex", "isAutoComplete", "dataItemid", "mask", "onPaste", "autoComplete"]);
1884
1884
  const [show_options, setShowOptions] = useState(false);
1885
1885
  const [internalValue, setInternalValue] = useState(value);
1886
1886
  const [internalSuggestedValues, setInternalSuggestedValues] = useState(suggestedValues || []);
@@ -1957,7 +1957,7 @@ const Input$1 = (_a) => {
1957
1957
  }
1958
1958
  const baseId = dataItemid || 'input';
1959
1959
  return type === 'textarea' ? (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, "data-itemid": `${baseId}-wrapper`, style: style },
1960
- React.createElement(StyledTextArea, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, maxLength: maxLength, onBlur: readOnly
1960
+ React.createElement(StyledTextArea, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, autoComplete: autoComplete, maxLength: maxLength, onBlur: readOnly
1961
1961
  ? e => e.preventDefault()
1962
1962
  : e => {
1963
1963
  if (onBlur)
@@ -1971,13 +1971,16 @@ const Input$1 = (_a) => {
1971
1971
  setShowOptions(true);
1972
1972
  if (onFocus)
1973
1973
  onFocus(e);
1974
- }, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: innerRef, tabIndex: readOnly ? -1 : tabIndex, value: formatted_value }, accessibleProps, { "data-itemid": `${baseId}-textarea` })),
1974
+ }, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, onPaste: e => {
1975
+ if (onPaste)
1976
+ onPaste(e);
1977
+ }, placeholder: placeholder, readOnly: readOnly, ref: innerRef, tabIndex: readOnly ? -1 : tabIndex, value: formatted_value }, accessibleProps, { "data-itemid": `${baseId}-textarea` })),
1975
1978
  loading ? (React.createElement(Loader$1, { "data-itemid": `${baseId}-loader` },
1976
1979
  React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: mdiLoading, size: '20px', spin: true }))) : null,
1977
1980
  showCharCount ? (React.createElement(CharacterCount, { "data-itemid": `${baseId}-char-count` },
1978
1981
  internalValue.length,
1979
1982
  maxLength ? ` / ${maxLength}` : null)) : null)) : (React.createElement(StyledWrapper, { "$invalid": invalid, "$readOnly": readOnly, "$style": style, "$suggestions": show_options && !!internalSuggestedValues.length, "data-itemid": `${baseId}-wrapper`, style: style },
1980
- React.createElement(StyledInput, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, max: max, maxLength: maxLength, min: min, onBlur: readOnly
1983
+ React.createElement(StyledInput, Object.assign({ "$height": height, "$invalid": invalid, "$readOnly": readOnly, "$showErrorTextColor": showErrorTextColor, autoComplete: autoComplete, max: max, maxLength: maxLength, min: min, onBlur: readOnly
1981
1984
  ? e => e.preventDefault()
1982
1985
  : e => {
1983
1986
  if (onBlur)
@@ -1993,7 +1996,10 @@ const Input$1 = (_a) => {
1993
1996
  setIsFocused(true);
1994
1997
  if (onFocus)
1995
1998
  onFocus(e);
1996
- }, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, placeholder: placeholder, readOnly: readOnly, ref: innerRef, step: step, tabIndex: readOnly ? -1 : tabIndex, type: type, value: format === 'currency_decimal' && internalValue ? `$${formatted_value}` : formatted_value }, accessibleProps, { "data-itemid": `${baseId}-input` })),
1999
+ }, onKeyDown: readOnly ? e => e.preventDefault() : onKeyDown, onPaste: e => {
2000
+ if (onPaste)
2001
+ onPaste(e);
2002
+ }, placeholder: placeholder, readOnly: readOnly, ref: innerRef, step: step, tabIndex: readOnly ? -1 : tabIndex, type: type, value: format === 'currency_decimal' && internalValue ? `$${formatted_value}` : formatted_value }, accessibleProps, { "data-itemid": `${baseId}-input` })),
1997
2003
  loading ? (React.createElement(Loader$1, { "data-itemid": `${baseId}-loader` },
1998
2004
  React.createElement(Icon, { color: Colors.MEDIUM_GRAY.Hex, path: mdiLoading, size: '20px', spin: true }))) : null,
1999
2005
  showCharCount ? (React.createElement(CharacterCount, { "data-itemid": `${baseId}-char-count` },