@reportportal/ui-kit 0.0.1-alpha.210 → 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.
- package/dist/components/fieldNumber/constants.d.ts +2 -1
- package/dist/components/popover/popover.d.ts +7 -2
- package/dist/{fieldNumber-dd8e6902.js → fieldNumber-b4aa4d7e.js} +34 -34
- package/dist/fieldNumber.js +1 -1
- package/dist/index.js +1 -1
- package/dist/popover.js +61 -52
- package/package.json +1 -1
|
@@ -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
|
|
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[];
|
|
@@ -12,9 +12,14 @@ export interface PopoverProps {
|
|
|
12
12
|
safeZone?: number;
|
|
13
13
|
arrowColor?: string;
|
|
14
14
|
dataAutomationId?: string;
|
|
15
|
-
isOpened?: boolean;
|
|
16
|
-
isCentered?: boolean;
|
|
17
15
|
strategy?: Strategy;
|
|
16
|
+
transitionDuration?: number | Partial<{
|
|
17
|
+
open: number;
|
|
18
|
+
close: number;
|
|
19
|
+
}>;
|
|
20
|
+
isCentered?: boolean;
|
|
21
|
+
isFocusDisabled?: boolean;
|
|
22
|
+
isOpened?: boolean;
|
|
18
23
|
shouldUsePortal?: boolean;
|
|
19
24
|
setIsOpened?: (isOpened: boolean) => void;
|
|
20
25
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as a, Fragment as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { c as
|
|
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
|
|
6
|
+
import { S as H } from "./minus-2857540f.js";
|
|
7
7
|
import { S as k } from "./plus-199fb2a8.js";
|
|
8
|
-
import { FieldLabel as
|
|
9
|
-
const b = 5, Y = 16,
|
|
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
|
-
],
|
|
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:
|
|
29
|
+
sign: X,
|
|
30
30
|
"input-container": "_input-container_3v3h5_12",
|
|
31
|
-
error:
|
|
32
|
-
disabled:
|
|
31
|
+
error: $,
|
|
32
|
+
disabled: j,
|
|
33
33
|
"input-field": "_input-field_3v3h5_38",
|
|
34
|
-
input:
|
|
34
|
+
input: z,
|
|
35
35
|
"additional-content": "_additional-content_3v3h5_84",
|
|
36
36
|
"error-text": "_error-text_3v3h5_88"
|
|
37
|
-
}, c =
|
|
37
|
+
}, c = v.bind(q), rn = ({
|
|
38
38
|
value: i = "",
|
|
39
|
-
placeholder:
|
|
39
|
+
placeholder: L = "0",
|
|
40
40
|
disabled: t = !1,
|
|
41
41
|
onChange: l,
|
|
42
42
|
onFocus: d,
|
|
43
43
|
onBlur: N,
|
|
44
|
-
label:
|
|
44
|
+
label: f,
|
|
45
45
|
postfix: E = "",
|
|
46
46
|
min: s = 0,
|
|
47
47
|
max: o = Number.MAX_SAFE_INTEGER,
|
|
48
|
-
title:
|
|
48
|
+
title: A,
|
|
49
49
|
error: C,
|
|
50
50
|
id: h,
|
|
51
51
|
...M
|
|
52
52
|
}) => {
|
|
53
|
-
const u =
|
|
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,
|
|
63
|
-
|
|
64
|
-
},
|
|
62
|
+
const _ = +n.currentTarget.value, p = O(_);
|
|
63
|
+
p !== _ && l(p);
|
|
64
|
+
}, U = (n) => {
|
|
65
65
|
const { keyCode: _ } = n;
|
|
66
|
-
|
|
67
|
-
},
|
|
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 =
|
|
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
|
|
76
|
-
}, [K, E, i]),
|
|
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(
|
|
79
|
+
return /* @__PURE__ */ a(W, { children: [
|
|
80
80
|
/* @__PURE__ */ a("div", { className: c("field-number", { disabled: t }), children: [
|
|
81
|
-
|
|
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:
|
|
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:
|
|
97
|
-
children: /* @__PURE__ */ r(
|
|
96
|
+
onClick: F,
|
|
97
|
+
children: /* @__PURE__ */ r(H, {})
|
|
98
98
|
}
|
|
99
99
|
),
|
|
100
|
-
/* @__PURE__ */ a("span", { className: c("input-field", { disabled: t }), onClick:
|
|
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 ??
|
|
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 :
|
|
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:
|
|
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
|
-
|
|
140
|
+
rn as F
|
|
141
141
|
};
|
package/dist/fieldNumber.js
CHANGED
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-
|
|
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/dist/popover.js
CHANGED
|
@@ -1,86 +1,95 @@
|
|
|
1
|
-
import { jsxs as f, Fragment as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useFloating as
|
|
4
|
-
import { c as
|
|
5
|
-
import { g as
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as f, Fragment as W, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as U, useState as q, useCallback as z } from "react";
|
|
3
|
+
import { useFloating as B, offset as J, flip as K, arrow as Q, autoUpdate as V, useClick as X, useDismiss as Y, useRole as Z, useInteractions as $, useTransitionStyles as ee, FloatingFocusManager as te, FloatingArrow as se, FloatingPortal as ne } from "@floating-ui/react";
|
|
4
|
+
import { c as oe } from "./bind-06a7ff84.js";
|
|
5
|
+
import { g as ae, T as u, a as le, A as ie, b as re, m as ce } from "./floatingUi-46f5b896.js";
|
|
6
|
+
const pe = "_popover_n3nff_1", me = "_title_n3nff_28", fe = {
|
|
7
7
|
"popover-wrapper": "_popover-wrapper_n3nff_1",
|
|
8
|
-
popover:
|
|
9
|
-
title:
|
|
10
|
-
},
|
|
11
|
-
content:
|
|
12
|
-
children:
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
title:
|
|
17
|
-
arrowOffset: n =
|
|
8
|
+
popover: pe,
|
|
9
|
+
title: me
|
|
10
|
+
}, l = oe.bind(fe), he = ({
|
|
11
|
+
content: d,
|
|
12
|
+
children: g,
|
|
13
|
+
placement: v = "bottom",
|
|
14
|
+
fallbackPlacements: _ = le,
|
|
15
|
+
className: h,
|
|
16
|
+
title: i,
|
|
17
|
+
arrowOffset: n = ie,
|
|
18
18
|
safeZone: A = 4,
|
|
19
19
|
arrowColor: F = "white",
|
|
20
20
|
dataAutomationId: x,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
strategy: y = "absolute",
|
|
22
|
+
transitionDuration: R = 0,
|
|
23
|
+
isCentered: r = !0,
|
|
24
|
+
isFocusDisabled: w = !1,
|
|
25
|
+
isOpened: E,
|
|
26
|
+
shouldUsePortal: b = !1,
|
|
25
27
|
setIsOpened: o
|
|
26
28
|
}) => {
|
|
27
|
-
const c =
|
|
29
|
+
const c = U(null), [T, N] = q(!1), p = o ? E : T, P = (e) => {
|
|
28
30
|
o ? o(e) : N(e);
|
|
29
|
-
},
|
|
30
|
-
(e,
|
|
31
|
-
[n,
|
|
32
|
-
), { placement:
|
|
33
|
-
open:
|
|
31
|
+
}, S = z(
|
|
32
|
+
(e, a) => ae(e, a, n, r),
|
|
33
|
+
[n, r]
|
|
34
|
+
), { placement: k, refs: m, floatingStyles: I, context: t } = B({
|
|
35
|
+
open: p,
|
|
34
36
|
onOpenChange: P,
|
|
35
|
-
placement:
|
|
36
|
-
strategy:
|
|
37
|
+
placement: v,
|
|
38
|
+
strategy: y,
|
|
37
39
|
middleware: [
|
|
38
|
-
|
|
39
|
-
mainAxis: A +
|
|
40
|
-
alignmentAxis:
|
|
40
|
+
J(({ rects: e, placement: a }) => ({
|
|
41
|
+
mainAxis: A + u,
|
|
42
|
+
alignmentAxis: S(e, a)
|
|
41
43
|
})),
|
|
42
|
-
|
|
44
|
+
K({
|
|
43
45
|
fallbackAxisSideDirection: "start",
|
|
44
|
-
fallbackPlacements:
|
|
46
|
+
fallbackPlacements: _
|
|
45
47
|
}),
|
|
46
|
-
|
|
48
|
+
Q({
|
|
47
49
|
element: c
|
|
48
50
|
})
|
|
49
51
|
],
|
|
50
|
-
whileElementsMounted:
|
|
51
|
-
}),
|
|
52
|
-
|
|
52
|
+
whileElementsMounted: V
|
|
53
|
+
}), D = X(t), G = Y(t), H = Z(t), { getReferenceProps: M, getFloatingProps: O } = $([D, G, H]), { isMounted: j, styles: C } = ee(t, {
|
|
54
|
+
duration: R,
|
|
55
|
+
initial: { opacity: 0 }
|
|
56
|
+
}), L = () => {
|
|
57
|
+
const e = /* @__PURE__ */ s(te, { context: t, modal: !1, disabled: w, children: /* @__PURE__ */ f(
|
|
53
58
|
"div",
|
|
54
59
|
{
|
|
55
|
-
className:
|
|
60
|
+
className: l("popover", h),
|
|
56
61
|
"data-automation-id": x,
|
|
57
|
-
ref:
|
|
58
|
-
style:
|
|
59
|
-
|
|
62
|
+
ref: m.setFloating,
|
|
63
|
+
style: {
|
|
64
|
+
...I,
|
|
65
|
+
...C,
|
|
66
|
+
pointerEvents: p ? "auto" : "none"
|
|
67
|
+
},
|
|
68
|
+
...O(),
|
|
60
69
|
children: [
|
|
61
70
|
/* @__PURE__ */ s(
|
|
62
|
-
|
|
71
|
+
se,
|
|
63
72
|
{
|
|
64
73
|
ref: c,
|
|
65
74
|
context: t,
|
|
66
|
-
width:
|
|
67
|
-
height:
|
|
75
|
+
width: re,
|
|
76
|
+
height: u,
|
|
68
77
|
fill: F,
|
|
69
|
-
staticOffset:
|
|
78
|
+
staticOffset: ce.includes(k) ? null : n
|
|
70
79
|
}
|
|
71
80
|
),
|
|
72
|
-
|
|
73
|
-
|
|
81
|
+
i && /* @__PURE__ */ s("div", { className: l("title"), children: i }),
|
|
82
|
+
d
|
|
74
83
|
]
|
|
75
84
|
}
|
|
76
85
|
) });
|
|
77
|
-
return
|
|
86
|
+
return b ? /* @__PURE__ */ s(ne, { children: e }) : e;
|
|
78
87
|
};
|
|
79
|
-
return /* @__PURE__ */ f(
|
|
80
|
-
/* @__PURE__ */ s("div", { ref:
|
|
81
|
-
|
|
88
|
+
return /* @__PURE__ */ f(W, { children: [
|
|
89
|
+
/* @__PURE__ */ s("div", { ref: m.setReference, ...M(), className: l("popover-wrapper"), children: g }),
|
|
90
|
+
j && L()
|
|
82
91
|
] });
|
|
83
92
|
};
|
|
84
93
|
export {
|
|
85
|
-
|
|
94
|
+
he as Popover
|
|
86
95
|
};
|