colibri-ui 0.8.35 → 0.8.36

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.
package/Dropdown/index.js CHANGED
@@ -89,9 +89,9 @@ var Dropdown = function Dropdown(_ref) {
89
89
  var handleShow = function handleShow() {
90
90
  return setVisible(true);
91
91
  };
92
- var handleHide = function handleHide() {
93
- return setVisible(false);
94
- };
92
+ var handleHide = React.useCallback(function () {
93
+ setVisible(false);
94
+ }, []);
95
95
  var onClickOutside = React.useCallback(function (event) {
96
96
  if (controlElement === null || controlElement === void 0 ? void 0 : controlElement.contains(event.target)) return;
97
97
  handleHide();
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { Props } from "./index.props";
3
- declare const BaseInput: ({ className, onChange, ref, ...props }: Props) => React.JSX.Element;
3
+ declare const BaseInput: ({ className, onFocus, onChange, onBlur, onKeyDown, ref, ...props }: Props) => React.JSX.Element;
4
4
  export default BaseInput;
@@ -15,15 +15,23 @@ var styles__default = /*#__PURE__*/_interopDefault(styles);
15
15
 
16
16
  var BaseInput = function BaseInput(_a) {
17
17
  var className = _a.className,
18
+ onFocus = _a.onFocus,
18
19
  onChange = _a.onChange,
20
+ onBlur = _a.onBlur,
21
+ onKeyDown = _a.onKeyDown,
19
22
  ref = _a.ref,
20
- props = tslib.__rest(_a, ["className", "onChange", "ref"]);
23
+ props = tslib.__rest(_a, ["className", "onFocus", "onChange", "onBlur", "onKeyDown", "ref"]);
21
24
  var onChangeHandler = function onChangeHandler(e) {
22
25
  if (onChange) onChange(e, e.target.value);
23
26
  };
24
27
  return /*#__PURE__*/React__default.default.createElement("input", Object.assign({
25
28
  className: classNames__default.default(styles__default.default["base-input"], className),
26
29
  onChange: onChangeHandler,
30
+ onFocus: onFocus,
31
+ onBlur: onBlur,
32
+ onKeyDown: onKeyDown,
33
+ autoCorrect: "off",
34
+ autoCapitalize: "off",
27
35
  ref: ref
28
36
  }, props));
29
37
  };
@@ -1,5 +1,9 @@
1
- import type { ChangeEvent, InputHTMLAttributes } from "react";
1
+ import type { ChangeEvent, InputHTMLAttributes, KeyboardEvent, Ref, FormEvent, FocusEvent } from "react";
2
2
  export interface Props extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> {
3
- onChange?: (e: ChangeEvent<HTMLInputElement>, value: string) => void;
4
- ref?: React.Ref<HTMLInputElement>;
3
+ onChange?: (event: ChangeEvent<HTMLInputElement>, value: string) => void;
4
+ onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
5
+ onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
6
+ onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
7
+ onInput?: (event: FormEvent<HTMLInputElement>) => void;
8
+ ref?: Ref<HTMLInputElement>;
5
9
  }
@@ -78,9 +78,9 @@ var Dropdown = function Dropdown(_ref) {
78
78
  var handleShow = function handleShow() {
79
79
  return setVisible(true);
80
80
  };
81
- var handleHide = function handleHide() {
82
- return setVisible(false);
83
- };
81
+ var handleHide = useCallback(function () {
82
+ setVisible(false);
83
+ }, []);
84
84
  var onClickOutside = useCallback(function (event) {
85
85
  if (controlElement === null || controlElement === void 0 ? void 0 : controlElement.contains(event.target)) return;
86
86
  handleHide();
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import type { Props } from "./index.props";
3
- declare const BaseInput: ({ className, onChange, ref, ...props }: Props) => React.JSX.Element;
3
+ declare const BaseInput: ({ className, onFocus, onChange, onBlur, onKeyDown, ref, ...props }: Props) => React.JSX.Element;
4
4
  export default BaseInput;
@@ -5,15 +5,23 @@ import styles from './BaseInput.module.css';
5
5
 
6
6
  var BaseInput = function BaseInput(_a) {
7
7
  var className = _a.className,
8
+ onFocus = _a.onFocus,
8
9
  onChange = _a.onChange,
10
+ onBlur = _a.onBlur,
11
+ onKeyDown = _a.onKeyDown,
9
12
  ref = _a.ref,
10
- props = __rest(_a, ["className", "onChange", "ref"]);
13
+ props = __rest(_a, ["className", "onFocus", "onChange", "onBlur", "onKeyDown", "ref"]);
11
14
  var onChangeHandler = function onChangeHandler(e) {
12
15
  if (onChange) onChange(e, e.target.value);
13
16
  };
14
17
  return /*#__PURE__*/React__default.createElement("input", Object.assign({
15
18
  className: classNames(styles["base-input"], className),
16
19
  onChange: onChangeHandler,
20
+ onFocus: onFocus,
21
+ onBlur: onBlur,
22
+ onKeyDown: onKeyDown,
23
+ autoCorrect: "off",
24
+ autoCapitalize: "off",
17
25
  ref: ref
18
26
  }, props));
19
27
  };
@@ -1,5 +1,9 @@
1
- import type { ChangeEvent, InputHTMLAttributes } from "react";
1
+ import type { ChangeEvent, InputHTMLAttributes, KeyboardEvent, Ref, FormEvent, FocusEvent } from "react";
2
2
  export interface Props extends Omit<InputHTMLAttributes<HTMLInputElement>, "onChange"> {
3
- onChange?: (e: ChangeEvent<HTMLInputElement>, value: string) => void;
4
- ref?: React.Ref<HTMLInputElement>;
3
+ onChange?: (event: ChangeEvent<HTMLInputElement>, value: string) => void;
4
+ onFocus?: (event: FocusEvent<HTMLInputElement>) => void;
5
+ onBlur?: (event: FocusEvent<HTMLInputElement>) => void;
6
+ onKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
7
+ onInput?: (event: FormEvent<HTMLInputElement>) => void;
8
+ ref?: Ref<HTMLInputElement>;
5
9
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "colibri-ui",
3
- "version": "0.8.35",
3
+ "version": "0.8.36",
4
4
  "description": "React UI components library",
5
5
  "main": "index.js",
6
6
  "scripts": {},