@uxf/ui 1.0.0-beta.47 → 1.0.0-beta.48

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,12 +1,19 @@
1
1
  import { FormControlProps } from "@uxf/ui/types/form-control-props";
2
- import React from "react";
2
+ import React, { KeyboardEventHandler } from "react";
3
3
  export interface InputElementProps extends FormControlProps<string> {
4
4
  "aria-describedby"?: string;
5
5
  "aria-invalid"?: boolean;
6
6
  form?: string;
7
7
  id?: string;
8
+ onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
8
9
  placeholder?: string;
9
- type?: "email" | "number" | "password" | "tel" | "text" | "url";
10
+ type?: "email" | "number" | "password" | "search" | "tel" | "text" | "url";
11
+ maxLength?: number | undefined;
12
+ minLength?: number | undefined;
13
+ max?: number | string;
14
+ min?: number | string;
15
+ pattern?: string;
16
+ step?: number | string;
10
17
  }
11
18
  declare const _default: React.ForwardRefExoticComponent<InputElementProps & React.RefAttributes<HTMLInputElement>>;
12
19
  export default _default;
@@ -6,6 +6,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const react_1 = __importDefault(require("react"));
7
7
  const forward_ref_1 = require("../utils/forward-ref");
8
8
  function InputElement(props, ref) {
9
- return (react_1.default.createElement("input", { "aria-describedby": props["aria-describedby"], "aria-invalid": props.isInvalid, className: "uxf-input__element", disabled: props.isDisabled, form: props.form, id: props.id, onBlur: props.onBlur, onChange: (event) => { var _a; return (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, event.target.value, event); }, onFocus: props.onFocus, placeholder: props.placeholder, readOnly: props.isReadOnly, ref: ref, type: props.type, value: props.value }));
9
+ return (react_1.default.createElement("input", { "aria-describedby": props["aria-describedby"], "aria-invalid": props.isInvalid, className: "uxf-input__element", disabled: props.isDisabled, form: props.form, id: props.id, max: props.max, maxLength: props.maxLength, min: props.min, minLength: props.minLength, onBlur: props.onBlur, onChange: (event) => { var _a; return (_a = props.onChange) === null || _a === void 0 ? void 0 : _a.call(props, event.target.value, event); }, onFocus: props.onFocus, onKeyDown: props.onKeyDown, pattern: props.pattern, placeholder: props.placeholder, readOnly: props.isReadOnly, ref: ref, step: props.step, type: props.type, value: props.value }));
10
10
  }
11
11
  exports.default = (0, forward_ref_1.forwardRef)("InputElement", InputElement);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uxf/ui",
3
- "version": "1.0.0-beta.47",
3
+ "version": "1.0.0-beta.48",
4
4
  "description": "",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,5 +1,5 @@
1
1
  import { FormControlProps } from "@uxf/ui/types";
2
- import React, { ReactNode } from "react";
2
+ import React, { KeyboardEventHandler, ReactNode } from "react";
3
3
  import { InputProps } from "@uxf/ui/input/input";
4
4
  declare type EnterKeyHint = "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
5
5
  declare type InputMode = "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
@@ -14,10 +14,17 @@ export interface TextInputProps extends FormControlProps<string>, Pick<InputProp
14
14
  label?: ReactNode;
15
15
  leftAddon?: ReactNode;
16
16
  leftElement?: ReactNode;
17
+ onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
17
18
  placeholder?: string;
18
19
  rightAddon?: ReactNode;
19
20
  rightElement?: ReactNode;
20
- type?: "email" | "number" | "password" | "tel" | "text" | "url";
21
+ type?: "email" | "number" | "password" | "search" | "tel" | "text" | "url";
22
+ maxLength?: number | undefined;
23
+ minLength?: number | undefined;
24
+ max?: number | string;
25
+ min?: number | string;
26
+ pattern?: string;
27
+ step?: number | string;
21
28
  }
22
29
  export declare const TextInput: React.ForwardRefExoticComponent<TextInputProps & React.RefAttributes<HTMLInputElement>>;
23
30
  export {};
@@ -51,7 +51,7 @@ exports.TextInput = (0, forward_ref_1.forwardRef)("TextInput", (props, ref) => {
51
51
  react_1.default.createElement(input_1.Input, { size: props.size, variant: props.variant },
52
52
  props.leftAddon && react_1.default.createElement(input_1.Input.LeftAddon, null, props.leftAddon),
53
53
  props.leftElement && react_1.default.createElement(input_1.Input.LeftElement, null, props.leftElement),
54
- react_1.default.createElement(input_1.Input.Element, { "aria-describedby": errorId, form: props.form, id: id, isDisabled: props.isDisabled, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, name: props.name, onBlur: onBlur, onChange: props.onChange, onFocus: onFocus, placeholder: props.placeholder, ref: ref, type: props.type, value: props.value }),
54
+ react_1.default.createElement(input_1.Input.Element, { "aria-describedby": errorId, form: props.form, id: id, isDisabled: props.isDisabled, isInvalid: props.isInvalid, isReadOnly: props.isReadOnly, isRequired: props.isRequired, max: props.max, maxLength: props.maxLength, min: props.min, minLength: props.minLength, name: props.name, onBlur: onBlur, onChange: props.onChange, onFocus: onFocus, onKeyDown: props.onKeyDown, pattern: props.pattern, placeholder: props.placeholder, ref: ref, step: props.step, type: props.type, value: props.value }),
55
55
  props.rightElement && react_1.default.createElement(input_1.Input.RightElement, null, props.rightElement),
56
56
  props.rightAddon && react_1.default.createElement(input_1.Input.RightAddon, null, props.rightAddon))));
57
57
  });