@hexure/ui 1.13.55 → 1.13.57

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
@@ -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` },
@@ -2083,6 +2089,7 @@ const Step = styled.div `
2083
2089
  align-items: center;
2084
2090
  gap: 8px;
2085
2091
  `;
2092
+ const StyledIconWWrapper = styled.div ``;
2086
2093
  const StyledIcon$2 = styled(Icon) `
2087
2094
  > path {
2088
2095
  fill: ${props => props.theme.PRIMARY_COLOR.Hex} !important;
@@ -2158,7 +2165,8 @@ const ProgressBar = ({ steps, showStepLine = false, dataItemid }) => {
2158
2165
  return (React.createElement(React.Fragment, { key: i },
2159
2166
  i !== 0 && showStepLine && (React.createElement(StepLine, { "$active": step.active, "data-itemid": `${stepId}-line` })),
2160
2167
  React.createElement(Step, { "data-itemid": `${stepId}-step` },
2161
- step.complete ? (React.createElement(StyledIcon$2, { "data-itemid": `${stepId}-icon`, path: mdiCheckboxMarkedCircleOutline, size: '32px' })) : (React.createElement(StepIndicator, { "$active": step.active, "data-itemid": `${stepId}-indicator` }, i + 1)),
2168
+ step.complete ? (React.createElement(StyledIconWWrapper, { "data-itemid": `${stepId}-icon-wrapper` },
2169
+ React.createElement(StyledIcon$2, { "data-itemid": `${stepId}-icon`, path: mdiCheckboxMarkedCircleOutline, size: '32px' }))) : (React.createElement(StepIndicator, { "$active": step.active, "data-itemid": `${stepId}-indicator` }, i + 1)),
2162
2170
  React.createElement(StepLabel, { "data-itemid": `${stepId}-label` },
2163
2171
  step.label,
2164
2172
  step.percentComplete !== undefined && (React.createElement(ProgressBarFill, { "$percent": step.percentComplete, "data-itemid": `${stepId}-fill` }))))));