triafly-ui-kit 1.0.63 → 1.0.64

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,10 +1,29 @@
1
- import { jsx as o } from "react/jsx-runtime";
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import { forwardRef as p } from "react";
2
3
  import "../../../src/components/Ui/NumberInput/NumberInput.scss.js";
3
- import { TextInput as r } from "../TextInput/TextInput.js";
4
- const u = (t) => /* @__PURE__ */ o(r, { ...t, type: "number", onKeyDown: (e) => {
5
- var n;
6
- !/[0-9]|Backspace|Delete|Tab|ArrowLeft|ArrowRight/.test(e.key) && !(e.ctrlKey && ["a", "c", "v", "x"].includes(e.key.toLowerCase())) && e.preventDefault(), (n = t.onKeyDown) == null || n.call(t, e);
7
- } });
4
+ import { TextInput as f } from "../TextInput/TextInput.js";
5
+ const t = [
6
+ "0",
7
+ "1",
8
+ "2",
9
+ "3",
10
+ "4",
11
+ "5",
12
+ "6",
13
+ "7",
14
+ "8",
15
+ "9",
16
+ "Backspace",
17
+ "Delete",
18
+ "Tab",
19
+ "ArrowLeft",
20
+ "ArrowRight"
21
+ ], i = p(
22
+ ({ allowNegative: a = !1, allowDecimal: u = !1, onKeyDown: r, ...l }, n) => /* @__PURE__ */ s(f, { ...l, name: "NumberInput", ref: n, type: "number", onKeyDown: (e) => {
23
+ u && e.key === "." && (e.currentTarget.value.includes(".") ? e.preventDefault() : t.push(".")), a && e.key === "-" && (e.currentTarget.selectionStart === 0 || e.currentTarget.value === "" ? t.push("-") : e.preventDefault()), !t.includes(e.key) && !(e.ctrlKey && ["a", "c", "v", "x"].includes(e.key.toLowerCase())) && e.preventDefault(), r == null || r(e);
24
+ } })
25
+ );
26
+ i.displayName = "NumberInput";
8
27
  export {
9
- u as NumberInput
28
+ i as NumberInput
10
29
  };
package/dist/main.d.ts CHANGED
@@ -1062,7 +1062,12 @@ declare type ModalWindowProps = {
1062
1062
  foolHeight?: boolean;
1063
1063
  };
1064
1064
 
1065
- export declare const NumberInput: default_2.FC<TextInputProps>;
1065
+ export declare const NumberInput: default_2.ForwardRefExoticComponent<NumberInputProps & default_2.RefAttributes<HTMLInputElement>>;
1066
+
1067
+ declare interface NumberInputProps extends TextInputProps {
1068
+ allowNegative?: boolean;
1069
+ allowDecimal?: boolean;
1070
+ }
1066
1071
 
1067
1072
  declare type Option_2 = {
1068
1073
  value: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triafly-ui-kit",
3
- "version": "1.0.63",
3
+ "version": "1.0.64",
4
4
  "description": "UI Kit from Triafly",
5
5
  "main": "./dist/main.js",
6
6
  "module": "./dist/main.js",