@devtron-labs/devtron-fe-common-lib 0.0.45-beta-22 → 0.0.45-beta-23

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,3 +1,3 @@
1
1
  /// <reference types="react" />
2
2
  import { CustomInputProps } from './Types';
3
- export declare function CustomInput({ name, value, error, onChange, onFocus, label, type, disabled, labelClassName, placeholder, tabIndex, dataTestid, isRequiredField, autoFocus, rootClassName, autoComplete, showLink, linkText, link, helperText, handleOnBlur, readOnly, noTrim, ref, onKeyPress, defaultValue, }: CustomInputProps): JSX.Element;
3
+ export declare function CustomInput({ name, value, error, onChange, onFocus, label, type, disabled, labelClassName, placeholder, tabIndex, dataTestid, isRequiredField, autoFocus, rootClassName, autoComplete, showLink, linkText, link, helperText, handleOnBlur, readOnly, noTrim, ref, onKeyPress, defaultValue, onKeyDown }: CustomInputProps): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { LegacyRef } from "react";
1
+ import { HTMLInputTypeAttribute, LegacyRef } from "react";
2
2
  export interface CustomInputProps {
3
3
  name: string;
4
4
  value: string | number;
@@ -7,7 +7,7 @@ export interface CustomInputProps {
7
7
  autoComplete?: string;
8
8
  label?: React.ReactNode;
9
9
  labelClassName?: string;
10
- type?: 'text' | 'number';
10
+ type?: HTMLInputTypeAttribute;
11
11
  disabled?: boolean;
12
12
  placeholder?: string;
13
13
  tabIndex?: number;
@@ -26,4 +26,5 @@ export interface CustomInputProps {
26
26
  ref?: LegacyRef<HTMLInputElement>;
27
27
  onKeyPress?: (e: any) => void;
28
28
  defaultValue?: string | number | ReadonlyArray<string> | undefined;
29
+ onKeyDown?: (e: any) => void;
29
30
  }
package/dist/index.js CHANGED
@@ -26624,7 +26624,7 @@ function DevtronProgressing(_a) {
26624
26624
  }
26625
26625
 
26626
26626
  function CustomInput(_a) {
26627
- var name = _a.name, value = _a.value, error = _a.error, onChange = _a.onChange, _b = _a.onFocus, onFocus = _b === void 0 ? function (e) { } : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.type, type = _d === void 0 ? 'text' : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.labelClassName, labelClassName = _f === void 0 ? '' : _f, _g = _a.placeholder, placeholder = _g === void 0 ? '' : _g, _h = _a.tabIndex, tabIndex = _h === void 0 ? 1 : _h, _j = _a.dataTestid, dataTestid = _j === void 0 ? '' : _j, _k = _a.isRequiredField, isRequiredField = _k === void 0 ? false : _k, _l = _a.autoFocus, autoFocus = _l === void 0 ? false : _l, _m = _a.rootClassName, rootClassName = _m === void 0 ? '' : _m, _o = _a.autoComplete, autoComplete = _o === void 0 ? 'off' : _o, _p = _a.showLink, showLink = _p === void 0 ? false : _p, _q = _a.linkText, linkText = _q === void 0 ? '' : _q, _r = _a.link, link = _r === void 0 ? '' : _r, _s = _a.helperText, helperText = _s === void 0 ? '' : _s, handleOnBlur = _a.handleOnBlur, _t = _a.readOnly, readOnly = _t === void 0 ? false : _t, _u = _a.noTrim, noTrim = _u === void 0 ? false : _u, ref = _a.ref, onKeyPress = _a.onKeyPress, defaultValue = _a.defaultValue;
26627
+ var name = _a.name, value = _a.value, error = _a.error, onChange = _a.onChange, _b = _a.onFocus, onFocus = _b === void 0 ? function (e) { } : _b, _c = _a.label, label = _c === void 0 ? '' : _c, _d = _a.type, type = _d === void 0 ? 'text' : _d, _e = _a.disabled, disabled = _e === void 0 ? false : _e, _f = _a.labelClassName, labelClassName = _f === void 0 ? '' : _f, _g = _a.placeholder, placeholder = _g === void 0 ? '' : _g, _h = _a.tabIndex, tabIndex = _h === void 0 ? 1 : _h, _j = _a.dataTestid, dataTestid = _j === void 0 ? '' : _j, _k = _a.isRequiredField, isRequiredField = _k === void 0 ? false : _k, _l = _a.autoFocus, autoFocus = _l === void 0 ? false : _l, _m = _a.rootClassName, rootClassName = _m === void 0 ? '' : _m, _o = _a.autoComplete, autoComplete = _o === void 0 ? 'off' : _o, _p = _a.showLink, showLink = _p === void 0 ? false : _p, _q = _a.linkText, linkText = _q === void 0 ? '' : _q, _r = _a.link, link = _r === void 0 ? '' : _r, _s = _a.helperText, helperText = _s === void 0 ? '' : _s, handleOnBlur = _a.handleOnBlur, _t = _a.readOnly, readOnly = _t === void 0 ? false : _t, _u = _a.noTrim, noTrim = _u === void 0 ? false : _u, ref = _a.ref, onKeyPress = _a.onKeyPress, defaultValue = _a.defaultValue, onKeyDown = _a.onKeyDown;
26628
26628
  var renderLabelHelperText = function () {
26629
26629
  return (jsxRuntime.jsx("span", { children: jsxRuntime.jsx("a", __assign({ target: "_blank", href: link, className: "cursor fs-13 onlink ml-4" }, { children: linkText })) }));
26630
26630
  };
@@ -26660,7 +26660,7 @@ function CustomInput(_a) {
26660
26660
  return (jsxRuntime.jsxs("div", __assign({ className: "flex column left top" }, { children: [label && (jsxRuntime.jsxs("label", __assign({ className: "form__label ".concat(labelClassName), "data-testid": "label-".concat(dataTestid) }, { children: [jsxRuntime.jsx("span", __assign({ className: "".concat(isRequiredField ? 'dc__required-field' : '') }, { children: label })), showLink && renderLabelHelperText()] }))), jsxRuntime.jsx("input", { "data-testid": dataTestid, type: type, name: name, autoComplete: autoComplete, className: "form__input ".concat(rootClassName), onChange: function (e) {
26661
26661
  e.persist();
26662
26662
  onChange(e);
26663
- }, onBlur: onBlur, onFocus: onFocus, placeholder: placeholder, value: value, disabled: disabled, tabIndex: tabIndex, autoFocus: autoFocus, readOnly: readOnly, ref: ref, onKeyPress: onKeyPress, defaultValue: defaultValue }), renderFormError(), helperText && (jsxRuntime.jsxs("div", __assign({ className: "form__text-field-info" }, { children: [jsxRuntime.jsx(SvgIcInfoFilled, { className: "form__icon form__icon--info" }), jsxRuntime.jsx("p", __assign({ className: "sentence-case" }, { children: helperText }))] })))] })));
26663
+ }, onBlur: onBlur, onFocus: onFocus, placeholder: placeholder, value: value, disabled: disabled, tabIndex: tabIndex, autoFocus: autoFocus, readOnly: readOnly, ref: ref, onKeyPress: onKeyPress, defaultValue: defaultValue, onKeyDown: onKeyDown }), renderFormError(), helperText && (jsxRuntime.jsxs("div", __assign({ className: "form__text-field-info" }, { children: [jsxRuntime.jsx(SvgIcInfoFilled, { className: "form__icon form__icon--info" }), jsxRuntime.jsx("p", __assign({ className: "sentence-case" }, { children: helperText }))] })))] })));
26664
26664
  }
26665
26665
 
26666
26666
  exports.AppStatus = AppStatus;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtron-labs/devtron-fe-common-lib",
3
- "version": "0.0.45-beta-22",
3
+ "version": "0.0.45-beta-23",
4
4
  "description": "Supporting common component library",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -29,6 +29,7 @@ export function CustomInput({
29
29
  ref,
30
30
  onKeyPress,
31
31
  defaultValue,
32
+ onKeyDown
32
33
  }: CustomInputProps) {
33
34
  const renderLabelHelperText = () => {
34
35
  return (
@@ -112,6 +113,7 @@ export function CustomInput({
112
113
  ref={ref}
113
114
  onKeyPress={onKeyPress}
114
115
  defaultValue={defaultValue}
116
+ onKeyDown={onKeyDown}
115
117
  />
116
118
 
117
119
  {renderFormError()}
@@ -1,4 +1,4 @@
1
- import { LegacyRef } from "react"
1
+ import { HTMLInputTypeAttribute, LegacyRef } from "react"
2
2
 
3
3
  export interface CustomInputProps {
4
4
  name: string
@@ -8,7 +8,7 @@ export interface CustomInputProps {
8
8
  autoComplete?: string
9
9
  label?: React.ReactNode
10
10
  labelClassName?: string
11
- type?: 'text' | 'number'
11
+ type?: HTMLInputTypeAttribute
12
12
  disabled?: boolean
13
13
  placeholder?: string
14
14
  tabIndex?: number
@@ -27,4 +27,5 @@ export interface CustomInputProps {
27
27
  ref?: LegacyRef<HTMLInputElement>
28
28
  onKeyPress?: (e) => void
29
29
  defaultValue?: string | number | ReadonlyArray<string> | undefined;
30
+ onKeyDown?: (e) => void
30
31
  }