@reportportal/ui-kit 0.0.1-alpha.211 → 0.0.1-alpha.212

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,5 +1,6 @@
1
1
  import { KeyCodes } from '../../common/constants/keyCodes';
2
2
 
3
3
  export declare const DEFAULT_WIDTH_CH = 5;
4
- export declare const MAX_WIDTH_CH = 16;
4
+ export declare const SAFARI_CLIP_FIX_CH = 0.4;
5
+ export declare const MAX_WIDTH_CH: number;
5
6
  export declare const ALLOWED_KEY_CODES: KeyCodes[];
@@ -1,12 +1,12 @@
1
- import { jsxs as a, Fragment as V, jsx as r } from "react/jsx-runtime";
2
- import { useRef as W, useId as y, useMemo as B } from "react";
3
- import { c as w } from "./bind-06a7ff84.js";
1
+ import { jsxs as a, Fragment as W, jsx as r } from "react/jsx-runtime";
2
+ import { useRef as y, useId as B, useMemo as w } from "react";
3
+ import { c as v } from "./bind-06a7ff84.js";
4
4
  import { K as e } from "./keyCodes-f63c0e11.js";
5
5
  import { B as D } from "./baseIconButton-251479f7.js";
6
- import { S as v } from "./minus-2857540f.js";
6
+ import { S as H } from "./minus-2857540f.js";
7
7
  import { S as k } from "./plus-199fb2a8.js";
8
- import { FieldLabel as H } from "./fieldLabel.js";
9
- const b = 5, Y = 16, P = [
8
+ import { FieldLabel as P } from "./fieldLabel.js";
9
+ const b = 5, I = 0.4, Y = 16 + I, G = [
10
10
  e.TAB_KEY_CODE,
11
11
  e.BACKSPACE_KEY_CODE,
12
12
  e.ARROW_LEFT_KEY_CODE,
@@ -24,33 +24,33 @@ const b = 5, Y = 16, P = [
24
24
  e.NUM_LOCK_7_KEY_CODE,
25
25
  e.NUM_LOCK_8_KEY_CODE,
26
26
  e.NUM_LOCK_9_KEY_CODE
27
- ], G = "_sign_3v3h5_7", j = "_error_3v3h5_22", z = "_disabled_3v3h5_27", X = "_input_3v3h5_12", $ = {
27
+ ], X = "_sign_3v3h5_7", $ = "_error_3v3h5_22", j = "_disabled_3v3h5_27", z = "_input_3v3h5_12", q = {
28
28
  "field-number": "_field-number_3v3h5_1",
29
- sign: G,
29
+ sign: X,
30
30
  "input-container": "_input-container_3v3h5_12",
31
- error: j,
32
- disabled: z,
31
+ error: $,
32
+ disabled: j,
33
33
  "input-field": "_input-field_3v3h5_38",
34
- input: X,
34
+ input: z,
35
35
  "additional-content": "_additional-content_3v3h5_84",
36
36
  "error-text": "_error-text_3v3h5_88"
37
- }, c = w.bind($), tn = ({
37
+ }, c = v.bind(q), rn = ({
38
38
  value: i = "",
39
- placeholder: I = "0",
39
+ placeholder: L = "0",
40
40
  disabled: t = !1,
41
41
  onChange: l,
42
42
  onFocus: d,
43
43
  onBlur: N,
44
- label: m,
44
+ label: f,
45
45
  postfix: E = "",
46
46
  min: s = 0,
47
47
  max: o = Number.MAX_SAFE_INTEGER,
48
- title: L,
48
+ title: A,
49
49
  error: C,
50
50
  id: h,
51
51
  ...M
52
52
  }) => {
53
- const u = W(null), p = y(), O = (n) => Number.isNaN(n) ? s : n === Number.POSITIVE_INFINITY ? o : n === Number.NEGATIVE_INFINITY || n < s ? s : n > o ? o : n, R = (n) => {
53
+ const u = y(null), m = B(), O = (n) => Number.isNaN(n) ? s : n === Number.POSITIVE_INFINITY ? o : n === Number.NEGATIVE_INFINITY || n < s ? s : n > o ? o : n, R = (n) => {
54
54
  const _ = n.target.value.replace(/^0(?=\d+|^\d)/g, "");
55
55
  if (_ === "") {
56
56
  l("");
@@ -59,26 +59,26 @@ const b = 5, Y = 16, P = [
59
59
  l(+_);
60
60
  }, T = (n) => {
61
61
  N && N(n);
62
- const _ = +n.currentTarget.value, f = O(_);
63
- f !== _ && l(f);
64
- }, A = (n) => {
62
+ const _ = +n.currentTarget.value, p = O(_);
63
+ p !== _ && l(p);
64
+ }, U = (n) => {
65
65
  const { keyCode: _ } = n;
66
- P.includes(_) || (_ < e.NUMBER_START_KEY_CODE || _ > e.NUMBER_END_KEY_CODE || n.shiftKey) && n.preventDefault();
67
- }, U = () => {
66
+ G.includes(_) || (_ < e.NUMBER_START_KEY_CODE || _ > e.NUMBER_END_KEY_CODE || n.shiftKey) && n.preventDefault();
67
+ }, F = () => {
68
68
  const _ = O(+i) - 1;
69
69
  _ >= s && _ <= o && l(_);
70
70
  }, g = () => {
71
71
  const _ = O(+i) + 1;
72
72
  _ >= s && _ <= o && l(_);
73
- }, K = I + E, F = B(() => {
73
+ }, K = L + E, S = w(() => {
74
74
  let n = (String(i) || K).length;
75
- return E && !i && (n += 1), n > Y ? `${Y}ch` : `${n || b}ch`;
76
- }, [K, E, i]), S = () => {
75
+ return E && !i && (n += 1), n ? n > Y ? `${Y}ch` : `${n + I}ch` : `${b}ch`;
76
+ }, [K, E, i]), V = () => {
77
77
  u && u.current && u.current.focus(), d && d();
78
78
  };
79
- return /* @__PURE__ */ a(V, { children: [
79
+ return /* @__PURE__ */ a(W, { children: [
80
80
  /* @__PURE__ */ a("div", { className: c("field-number", { disabled: t }), children: [
81
- m && /* @__PURE__ */ r(H, { htmlFor: h ?? p, children: m }),
81
+ f && /* @__PURE__ */ r(P, { htmlFor: h ?? m, children: f }),
82
82
  /* @__PURE__ */ a(
83
83
  "div",
84
84
  {
@@ -86,22 +86,22 @@ const b = 5, Y = 16, P = [
86
86
  error: C,
87
87
  disabled: t
88
88
  }),
89
- title: L,
89
+ title: A,
90
90
  children: [
91
91
  /* @__PURE__ */ r(
92
92
  D,
93
93
  {
94
94
  className: c("sign", "minus"),
95
95
  disabled: t,
96
- onClick: U,
97
- children: /* @__PURE__ */ r(v, {})
96
+ onClick: F,
97
+ children: /* @__PURE__ */ r(H, {})
98
98
  }
99
99
  ),
100
- /* @__PURE__ */ a("span", { className: c("input-field", { disabled: t }), onClick: S, children: [
100
+ /* @__PURE__ */ a("span", { className: c("input-field", { disabled: t }), onClick: V, children: [
101
101
  /* @__PURE__ */ r(
102
102
  "input",
103
103
  {
104
- id: h ?? p,
104
+ id: h ?? m,
105
105
  ref: u,
106
106
  className: c("input"),
107
107
  type: "number",
@@ -110,11 +110,11 @@ const b = 5, Y = 16, P = [
110
110
  disabled: t,
111
111
  min: s,
112
112
  max: o,
113
- onKeyDown: t ? void 0 : A,
113
+ onKeyDown: t ? void 0 : U,
114
114
  onChange: t ? void 0 : R,
115
115
  onFocus: t ? void 0 : d,
116
116
  onBlur: t ? void 0 : T,
117
- style: { width: F },
117
+ style: { width: S },
118
118
  ...M
119
119
  }
120
120
  ),
@@ -137,5 +137,5 @@ const b = 5, Y = 16, P = [
137
137
  ] });
138
138
  };
139
139
  export {
140
- tn as F
140
+ rn as F
141
141
  };
@@ -1,4 +1,4 @@
1
- import { F as m } from "./fieldNumber-dd8e6902.js";
1
+ import { F as m } from "./fieldNumber-b4aa4d7e.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "./bind-06a7ff84.js";
package/dist/index.js CHANGED
@@ -13,7 +13,7 @@ import { D as K } from "./datePicker-6085b8d0.js";
13
13
  import "react-datepicker";
14
14
  import { D as Y } from "./dropdown-0b931e15.js";
15
15
  import { FieldLabel as $ } from "./fieldLabel.js";
16
- import { F as ro } from "./fieldNumber-dd8e6902.js";
16
+ import { F as ro } from "./fieldNumber-b4aa4d7e.js";
17
17
  import { F as to } from "./fieldText-1749da7a.js";
18
18
  import { F as no } from "./fieldTextFlex-2f51c173.js";
19
19
  import { FileDropArea as mo } 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.211",
3
+ "version": "0.0.1-alpha.212",
4
4
  "description": "The UI-kit library for ReportPortal Design System.",
5
5
  "type": "module",
6
6
  "scripts": {