@reportportal/ui-kit 0.0.1-alpha.100 → 0.0.1-alpha.101

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,11 +1,11 @@
1
- import { jsxs as d, Fragment as v, jsx as i } from "react/jsx-runtime";
1
+ import { jsxs as a, Fragment as v, jsx as i } from "react/jsx-runtime";
2
2
  import { useRef as T, useId as I, useMemo as W } from "react";
3
3
  import { c as y } from "./bind-06a7ff84.js";
4
4
  import { K as _ } from "./keyCodes-f63c0e11.js";
5
5
  import { B as p } from "./baseIconButton-251479f7.js";
6
6
  import { S as B, a as F } from "./plus-0929dda4.js";
7
7
  import { FieldLabel as S } from "./fieldLabel.js";
8
- const w = 5, m = 16, k = [
8
+ const w = 5, N = 16, k = [
9
9
  _.TAB_KEY_CODE,
10
10
  _.BACKSPACE_KEY_CODE,
11
11
  _.ARROW_LEFT_KEY_CODE,
@@ -35,46 +35,42 @@ const w = 5, m = 16, k = [
35
35
  "error-text": "_error-text_3v3h5_88"
36
36
  }, s = y.bind(j), Z = ({
37
37
  value: r = "",
38
- placeholder: N = "0",
38
+ placeholder: m = "0",
39
39
  disabled: t = !1,
40
- onChange: o,
41
- onFocus: C,
40
+ onChange: C,
41
+ onFocus: d,
42
42
  onBlur: G,
43
43
  label: O,
44
- postfix: c = "",
45
- min: E = 0,
46
- max: l = Number.MAX_SAFE_INTEGER,
44
+ postfix: o = "",
45
+ min: c = 0,
46
+ max: E = Number.MAX_SAFE_INTEGER,
47
47
  title: f,
48
48
  error: u,
49
49
  id: h,
50
50
  ...Y
51
51
  }) => {
52
- const a = T(null), D = I(), L = (n) => {
52
+ const l = T(null), D = I(), L = (n) => {
53
53
  let e = n.target.value.replace(/^0(?=\d+|^\d)/g, "");
54
- if (e === "") {
55
- o("");
56
- return;
57
- }
58
- e = +e, e >= E && e <= l && o(e);
54
+ e = +e, e = e < c ? c : e, e >= c && e <= E && C(e);
59
55
  }, M = (n) => {
60
56
  const { keyCode: e } = n;
61
57
  k.includes(e) || (e < _.NUMBER_START_KEY_CODE || e > _.NUMBER_END_KEY_CODE || n.shiftKey) && n.preventDefault();
62
58
  }, R = () => {
63
59
  const n = +r - 1;
64
- n >= E && n <= l && o(n);
60
+ n >= c && n <= E && C(n);
65
61
  }, U = () => {
66
62
  const n = +r + 1;
67
- n >= E && n <= l && o(n);
68
- }, K = N + c, A = W(() => {
63
+ n >= c && n <= E && C(n);
64
+ }, K = m + o, A = W(() => {
69
65
  let n = (String(r) || K).length;
70
- return c && !r && (n += 1), n > m ? `${m}ch` : `${n || w}ch`;
71
- }, [K, c, r]), g = () => {
72
- a && a.current && a.current.focus(), C && C();
66
+ return o && !r && (n += 1), n > N ? `${N}ch` : `${n || w}ch`;
67
+ }, [K, o, r]), g = () => {
68
+ l && l.current && l.current.focus(), d && d();
73
69
  };
74
- return /* @__PURE__ */ d(v, { children: [
75
- /* @__PURE__ */ d("div", { className: s("field-number", { disabled: t }), children: [
70
+ return /* @__PURE__ */ a(v, { children: [
71
+ /* @__PURE__ */ a("div", { className: s("field-number", { disabled: t }), children: [
76
72
  O && /* @__PURE__ */ i(S, { htmlFor: h ?? D, children: O }),
77
- /* @__PURE__ */ d(
73
+ /* @__PURE__ */ a(
78
74
  "div",
79
75
  {
80
76
  className: s("input-container", {
@@ -92,27 +88,27 @@ const w = 5, m = 16, k = [
92
88
  children: /* @__PURE__ */ i(B, {})
93
89
  }
94
90
  ),
95
- /* @__PURE__ */ d("span", { className: s("input-field", { disabled: t }), onClick: g, children: [
91
+ /* @__PURE__ */ a("span", { className: s("input-field", { disabled: t }), onClick: g, children: [
96
92
  /* @__PURE__ */ i(
97
93
  "input",
98
94
  {
99
95
  id: h ?? D,
100
- ref: a,
96
+ ref: l,
101
97
  className: s("input"),
102
98
  type: "number",
103
99
  value: r,
104
100
  placeholder: K,
105
101
  disabled: t,
106
- min: E,
107
- max: l,
102
+ min: c,
103
+ max: E,
108
104
  onKeyDown: t ? void 0 : M,
109
105
  onChange: t ? void 0 : L,
110
- onFocus: t ? void 0 : C,
106
+ onFocus: t ? void 0 : d,
111
107
  style: { width: A },
112
108
  ...Y
113
109
  }
114
110
  ),
115
- !!c && (r === 0 || !!r) && /* @__PURE__ */ i("span", { children: c.slice(0, 1) })
111
+ !!o && (r === 0 || !!r) && /* @__PURE__ */ i("span", { children: o.slice(0, 1) })
116
112
  ] }),
117
113
  /* @__PURE__ */ i(
118
114
  p,
@@ -1,4 +1,4 @@
1
- import { F as m } from "./fieldNumber-c9113a7f.js";
1
+ import { F as m } from "./fieldNumber-4a22c986.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "./bind-06a7ff84.js";
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { D as M } from "./datePicker-efa4e2d6.js";
8
8
  import "react-datepicker";
9
9
  import { D as w } from "./dropdown-ec754bbe.js";
10
10
  import { FieldLabel as k } from "./fieldLabel.js";
11
- import { F as R } from "./fieldNumber-c9113a7f.js";
11
+ import { F as R } from "./fieldNumber-4a22c986.js";
12
12
  import { F as H } from "./fieldText-ba8a917c.js";
13
13
  import { F as N } from "./fieldTextFlex-8afaab31.js";
14
14
  import { FileDropArea as z, MIME_TYPES as W } from "./fileDropArea.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reportportal/ui-kit",
3
- "version": "0.0.1-alpha.100",
3
+ "version": "0.0.1-alpha.101",
4
4
  "description": "The UI-kit library for ReportPortal Design System.",
5
5
  "type": "module",
6
6
  "scripts": {