@reportportal/ui-kit 0.0.1-alpha.87 → 0.0.1-alpha.89
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/calendarArrow-44c7e60e.js +5 -0
- package/dist/components/fieldNumber/fieldNumber.d.ts +1 -2
- package/dist/datePicker-b626922f.js +194 -0
- package/dist/datePicker.js +3 -3
- package/dist/fieldNumber-c9113a7f.js +135 -0
- package/dist/fieldNumber.js +1 -1
- package/dist/icons.js +38 -38
- package/dist/index.js +38 -38
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/calendarArrow-3e1339ea.js +0 -6
- package/dist/datePicker-30077e06.js +0 -201
- package/dist/fieldNumber-2542b311.js +0 -128
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const t = (l) => /* @__PURE__ */ e.createElement("svg", { width: 8, height: 13, viewBox: "0 0 8 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.54134 12.2173C6.69755 12.3735 6.95081 12.3735 7.10702 12.2173L7.24844 12.0759C7.40465 11.9197 7.40465 11.6664 7.24844 11.5102L1.90539 6.16715L7.24844 0.824097C7.40465 0.667887 7.40465 0.41462 7.24844 0.258411L7.10702 0.116989C6.95081 -0.0392199 6.69755 -0.0392199 6.54134 0.116989L0.998591 5.65973L0.999562 5.6607L0.767094 5.89317C0.610884 6.04938 0.610884 6.30265 0.767093 6.45886L1.48425 7.17602L1.49215 7.16813L6.54134 12.2173Z", fill: "#C1C7D0" }));
|
|
3
|
+
export {
|
|
4
|
+
t as S
|
|
5
|
+
};
|
|
@@ -12,8 +12,7 @@ interface FieldNumberProps extends Omit<HTMLAttributes<HTMLInputElement>, 'onCha
|
|
|
12
12
|
max?: number;
|
|
13
13
|
title?: string;
|
|
14
14
|
error?: string;
|
|
15
|
-
touched?: boolean;
|
|
16
15
|
onFocus?: () => void | FocusEventHandler<HTMLInputElement>;
|
|
17
16
|
}
|
|
18
|
-
export declare const FieldNumber: ({ value, placeholder, disabled, onChange, onFocus, onBlur, label, postfix, min, max, title, error,
|
|
17
|
+
export declare const FieldNumber: ({ value, placeholder, disabled, onChange, onFocus, onBlur, label, postfix, min, max, title, error, id, ...rest }: FieldNumberProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
18
|
export {};
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { jsxs as F, Fragment as $, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import B from "react-datepicker/dist/es/index.js";
|
|
3
|
+
import { c as R } from "./bind-06a7ff84.js";
|
|
4
|
+
import { useMemo as P, useRef as D } from "react";
|
|
5
|
+
import { F as I } from "./fieldText-35421470.js";
|
|
6
|
+
import { D as E } from "./dropdown-b26b8fd8.js";
|
|
7
|
+
import { S as T } from "./calendarArrow-44c7e60e.js";
|
|
8
|
+
import { registerLocale as j } from "react-datepicker";
|
|
9
|
+
const ie = (n, s) => {
|
|
10
|
+
j(n, s);
|
|
11
|
+
}, G = (n, s = 20) => {
|
|
12
|
+
const l = n + s;
|
|
13
|
+
return new Array(l - n).fill(void 0).map((g, o) => n - o);
|
|
14
|
+
}, H = "_header_1q16i_1", V = "_disabled_1q16i_25", O = "_dropdown_1q16i_8", W = {
|
|
15
|
+
header: H,
|
|
16
|
+
"dropdowns-wrapper": "_dropdowns-wrapper_1q16i_8",
|
|
17
|
+
"button-prev": "_button-prev_1q16i_13",
|
|
18
|
+
"button-next": "_button-next_1q16i_14",
|
|
19
|
+
disabled: V,
|
|
20
|
+
dropdown: O,
|
|
21
|
+
"month-dropdown": "_month-dropdown_1q16i_44",
|
|
22
|
+
"toggle-button": "_toggle-button_1q16i_47"
|
|
23
|
+
}, a = R.bind(W), z = ({
|
|
24
|
+
date: n = /* @__PURE__ */ new Date(),
|
|
25
|
+
changeYear: s = () => {
|
|
26
|
+
},
|
|
27
|
+
changeMonth: l = () => {
|
|
28
|
+
},
|
|
29
|
+
decreaseMonth: g = () => {
|
|
30
|
+
},
|
|
31
|
+
increaseMonth: o = () => {
|
|
32
|
+
},
|
|
33
|
+
prevMonthButtonDisabled: t = !1,
|
|
34
|
+
nextMonthButtonDisabled: h = !1,
|
|
35
|
+
headerNodes: b = null,
|
|
36
|
+
customClassName: w = "",
|
|
37
|
+
yearsOptions: i = [],
|
|
38
|
+
locale: N
|
|
39
|
+
}) => {
|
|
40
|
+
const m = n.getFullYear(), v = n.getMonth(), f = P(() => {
|
|
41
|
+
const e = Array(12).keys(), d = new Intl.DateTimeFormat(N, {
|
|
42
|
+
month: "long"
|
|
43
|
+
}), c = (p) => d.format(new Date(m, p));
|
|
44
|
+
return Array.from(e, c).reduce((p, y, k) => p.concat({
|
|
45
|
+
value: k,
|
|
46
|
+
label: y
|
|
47
|
+
}), []);
|
|
48
|
+
}, []), C = P(() => (i.length > 0 ? i : G(m)).reduce(
|
|
49
|
+
(d, c) => d.concat({ value: c, label: `${c}` }),
|
|
50
|
+
[]
|
|
51
|
+
), [i]), x = (e) => {
|
|
52
|
+
l(e);
|
|
53
|
+
}, A = (e) => {
|
|
54
|
+
s(e);
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ F($, { children: [
|
|
57
|
+
b && /* @__PURE__ */ r("div", { className: a(w), children: b }),
|
|
58
|
+
/* @__PURE__ */ F("div", { className: a("header"), children: [
|
|
59
|
+
/* @__PURE__ */ r(
|
|
60
|
+
"button",
|
|
61
|
+
{
|
|
62
|
+
"aria-label": "Previous Months",
|
|
63
|
+
disabled: t,
|
|
64
|
+
onClick: (e) => {
|
|
65
|
+
e.stopPropagation(), g();
|
|
66
|
+
},
|
|
67
|
+
className: a("button-prev", { disabled: t }),
|
|
68
|
+
children: /* @__PURE__ */ r(T, {})
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ F("div", { className: a("dropdowns-wrapper"), children: [
|
|
72
|
+
/* @__PURE__ */ r(
|
|
73
|
+
E,
|
|
74
|
+
{
|
|
75
|
+
options: f,
|
|
76
|
+
value: v,
|
|
77
|
+
onChange: x,
|
|
78
|
+
transparentBackground: !0,
|
|
79
|
+
className: a("dropdown", "month-dropdown"),
|
|
80
|
+
toggleButtonClassName: a("toggle-button")
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ r(
|
|
84
|
+
E,
|
|
85
|
+
{
|
|
86
|
+
options: C,
|
|
87
|
+
value: m,
|
|
88
|
+
onChange: A,
|
|
89
|
+
transparentBackground: !0,
|
|
90
|
+
className: a("dropdown"),
|
|
91
|
+
toggleButtonClassName: a("toggle-button")
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ r(
|
|
96
|
+
"button",
|
|
97
|
+
{
|
|
98
|
+
"aria-label": "Next Months",
|
|
99
|
+
disabled: h,
|
|
100
|
+
onClick: (e) => {
|
|
101
|
+
e.stopPropagation(), o();
|
|
102
|
+
},
|
|
103
|
+
className: a("button-next", { disabled: h }),
|
|
104
|
+
children: /* @__PURE__ */ r(T, {})
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] })
|
|
108
|
+
] });
|
|
109
|
+
}, J = "_calendar_3ty6m_5", K = "_date_3ty6m_90", Q = "_disabled_3ty6m_203", X = "_popper_3ty6m_211", Z = "_input_3ty6m_215", ee = {
|
|
110
|
+
calendar: J,
|
|
111
|
+
"current-date": "_current-date_3ty6m_89",
|
|
112
|
+
date: K,
|
|
113
|
+
"selected-range": "_selected-range_3ty6m_119",
|
|
114
|
+
"end-date": "_end-date_3ty6m_119",
|
|
115
|
+
disabled: Q,
|
|
116
|
+
popper: X,
|
|
117
|
+
input: Z
|
|
118
|
+
}, _ = R.bind(ee), oe = "en", L = "MM-dd-yyyy", me = ({
|
|
119
|
+
onChange: n = () => {
|
|
120
|
+
},
|
|
121
|
+
disabled: s = !1,
|
|
122
|
+
onBlur: l = () => {
|
|
123
|
+
},
|
|
124
|
+
onFocus: g = () => {
|
|
125
|
+
},
|
|
126
|
+
endDate: o = void 0,
|
|
127
|
+
startDate: t = void 0,
|
|
128
|
+
headerNodes: h = null,
|
|
129
|
+
customClassName: b = "",
|
|
130
|
+
customTimeInput: w = void 0,
|
|
131
|
+
shouldCloseOnSelect: i = !0,
|
|
132
|
+
popperClassName: N = "",
|
|
133
|
+
calendarClassName: m = "",
|
|
134
|
+
fixedHeight: v = !1,
|
|
135
|
+
language: f = oe,
|
|
136
|
+
yearsOptions: C = [],
|
|
137
|
+
placeholder: x = L.toUpperCase(),
|
|
138
|
+
dateFormat: A = L,
|
|
139
|
+
selects: e = "start",
|
|
140
|
+
value: d = null
|
|
141
|
+
}) => {
|
|
142
|
+
const c = D(null), S = t == null ? void 0 : t.toDateString(), p = o == null ? void 0 : o.toDateString(), y = o && t && o > t, k = (u) => {
|
|
143
|
+
const M = u.toDateString(), Y = M === S, q = y && M === p, U = t && o && u > t && u < o;
|
|
144
|
+
return _("date", {
|
|
145
|
+
"current-date": Y,
|
|
146
|
+
"selected-range": U && !q,
|
|
147
|
+
"end-date": q && y,
|
|
148
|
+
disabled: s
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
return /* @__PURE__ */ r(
|
|
152
|
+
B,
|
|
153
|
+
{
|
|
154
|
+
customInput: /* @__PURE__ */ r(I, { className: _("input"), defaultWidth: !1, ref: c }),
|
|
155
|
+
placeholderText: x,
|
|
156
|
+
selected: d,
|
|
157
|
+
startDate: t,
|
|
158
|
+
endDate: o,
|
|
159
|
+
minDate: e === "end" ? t : void 0,
|
|
160
|
+
maxDate: e === "start" ? o : void 0,
|
|
161
|
+
disabled: s,
|
|
162
|
+
shouldCloseOnSelect: i,
|
|
163
|
+
fixedHeight: v,
|
|
164
|
+
locale: f,
|
|
165
|
+
showPopperArrow: !1,
|
|
166
|
+
dayClassName: k,
|
|
167
|
+
calendarClassName: _(m, "calendar"),
|
|
168
|
+
renderCustomHeader: (u) => /* @__PURE__ */ r(
|
|
169
|
+
z,
|
|
170
|
+
{
|
|
171
|
+
...u,
|
|
172
|
+
headerNodes: h,
|
|
173
|
+
customClassName: b,
|
|
174
|
+
yearsOptions: C,
|
|
175
|
+
locale: f
|
|
176
|
+
}
|
|
177
|
+
),
|
|
178
|
+
onChange: n,
|
|
179
|
+
onBlur: l,
|
|
180
|
+
onFocus: g,
|
|
181
|
+
customTimeInput: w,
|
|
182
|
+
showTimeInput: !!w,
|
|
183
|
+
popperClassName: _(N, "popper"),
|
|
184
|
+
dateFormat: A,
|
|
185
|
+
selectsStart: e === "start",
|
|
186
|
+
selectsEnd: e === "end",
|
|
187
|
+
className: _("datepicker")
|
|
188
|
+
}
|
|
189
|
+
);
|
|
190
|
+
};
|
|
191
|
+
export {
|
|
192
|
+
me as D,
|
|
193
|
+
ie as r
|
|
194
|
+
};
|
package/dist/datePicker.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as t } from "./datePicker-
|
|
2
|
-
import { r as v } from "./datePicker-
|
|
1
|
+
import { D as t } from "./datePicker-b626922f.js";
|
|
2
|
+
import { r as v } from "./datePicker-b626922f.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react-datepicker/dist/es/index.js";
|
|
5
5
|
import "./bind-06a7ff84.js";
|
|
@@ -10,7 +10,6 @@ import "./button-97d9e587.js";
|
|
|
10
10
|
import "./spinLoader-c4a53718.js";
|
|
11
11
|
import "./maxValueDisplay-9be01a75.js";
|
|
12
12
|
import "./fieldLabel.js";
|
|
13
|
-
import "./calendarArrow-3e1339ea.js";
|
|
14
13
|
import "./dropdown-b26b8fd8.js";
|
|
15
14
|
import "@floating-ui/react-dom";
|
|
16
15
|
import "downshift";
|
|
@@ -20,6 +19,7 @@ import "./keyCodes-f63c0e11.js";
|
|
|
20
19
|
import "./baseIconButton-251479f7.js";
|
|
21
20
|
import "./dropdown-0260bb66.js";
|
|
22
21
|
import "./checkbox-ed6cc375.js";
|
|
22
|
+
import "./calendarArrow-44c7e60e.js";
|
|
23
23
|
import "react-datepicker";
|
|
24
24
|
export {
|
|
25
25
|
t as DatePicker,
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { jsxs as d, Fragment as v, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as T, useId as I, useMemo as W } from "react";
|
|
3
|
+
import { c as y } from "./bind-06a7ff84.js";
|
|
4
|
+
import { K as _ } from "./keyCodes-f63c0e11.js";
|
|
5
|
+
import { B as p } from "./baseIconButton-251479f7.js";
|
|
6
|
+
import { S as B, a as F } from "./plus-0929dda4.js";
|
|
7
|
+
import { FieldLabel as S } from "./fieldLabel.js";
|
|
8
|
+
const w = 5, m = 16, k = [
|
|
9
|
+
_.TAB_KEY_CODE,
|
|
10
|
+
_.BACKSPACE_KEY_CODE,
|
|
11
|
+
_.ARROW_LEFT_KEY_CODE,
|
|
12
|
+
_.ARROW_UP_KEY_CODE,
|
|
13
|
+
_.ARROW_RIGHT_KEY_CODE,
|
|
14
|
+
_.ARROW_DOWN_KEY_CODE,
|
|
15
|
+
_.DELETE_KEY_CODE,
|
|
16
|
+
_.NUM_LOCK_0_KEY_CODE,
|
|
17
|
+
_.NUM_LOCK_1_KEY_CODE,
|
|
18
|
+
_.NUM_LOCK_2_KEY_CODE,
|
|
19
|
+
_.NUM_LOCK_3_KEY_CODE,
|
|
20
|
+
_.NUM_LOCK_4_KEY_CODE,
|
|
21
|
+
_.NUM_LOCK_5_KEY_CODE,
|
|
22
|
+
_.NUM_LOCK_6_KEY_CODE,
|
|
23
|
+
_.NUM_LOCK_7_KEY_CODE,
|
|
24
|
+
_.NUM_LOCK_8_KEY_CODE,
|
|
25
|
+
_.NUM_LOCK_9_KEY_CODE
|
|
26
|
+
], H = "_sign_3v3h5_7", V = "_error_3v3h5_22", P = "_disabled_3v3h5_27", b = "_input_3v3h5_12", j = {
|
|
27
|
+
"field-number": "_field-number_3v3h5_1",
|
|
28
|
+
sign: H,
|
|
29
|
+
"input-container": "_input-container_3v3h5_12",
|
|
30
|
+
error: V,
|
|
31
|
+
disabled: P,
|
|
32
|
+
"input-field": "_input-field_3v3h5_38",
|
|
33
|
+
input: b,
|
|
34
|
+
"additional-content": "_additional-content_3v3h5_84",
|
|
35
|
+
"error-text": "_error-text_3v3h5_88"
|
|
36
|
+
}, s = y.bind(j), Z = ({
|
|
37
|
+
value: r = "",
|
|
38
|
+
placeholder: N = "0",
|
|
39
|
+
disabled: t = !1,
|
|
40
|
+
onChange: o,
|
|
41
|
+
onFocus: C,
|
|
42
|
+
onBlur: G,
|
|
43
|
+
label: O,
|
|
44
|
+
postfix: c = "",
|
|
45
|
+
min: E = 0,
|
|
46
|
+
max: l = Number.MAX_SAFE_INTEGER,
|
|
47
|
+
title: f,
|
|
48
|
+
error: u,
|
|
49
|
+
id: h,
|
|
50
|
+
...Y
|
|
51
|
+
}) => {
|
|
52
|
+
const a = T(null), D = I(), L = (n) => {
|
|
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);
|
|
59
|
+
}, M = (n) => {
|
|
60
|
+
const { keyCode: e } = n;
|
|
61
|
+
k.includes(e) || (e < _.NUMBER_START_KEY_CODE || e > _.NUMBER_END_KEY_CODE || n.shiftKey) && n.preventDefault();
|
|
62
|
+
}, R = () => {
|
|
63
|
+
const n = +r - 1;
|
|
64
|
+
n >= E && n <= l && o(n);
|
|
65
|
+
}, U = () => {
|
|
66
|
+
const n = +r + 1;
|
|
67
|
+
n >= E && n <= l && o(n);
|
|
68
|
+
}, K = N + c, A = W(() => {
|
|
69
|
+
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();
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ d(v, { children: [
|
|
75
|
+
/* @__PURE__ */ d("div", { className: s("field-number", { disabled: t }), children: [
|
|
76
|
+
O && /* @__PURE__ */ i(S, { htmlFor: h ?? D, children: O }),
|
|
77
|
+
/* @__PURE__ */ d(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: s("input-container", {
|
|
81
|
+
error: u,
|
|
82
|
+
disabled: t
|
|
83
|
+
}),
|
|
84
|
+
title: f,
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ i(
|
|
87
|
+
p,
|
|
88
|
+
{
|
|
89
|
+
className: s("sign", "minus"),
|
|
90
|
+
disabled: t,
|
|
91
|
+
onClick: R,
|
|
92
|
+
children: /* @__PURE__ */ i(B, {})
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ d("span", { className: s("input-field", { disabled: t }), onClick: g, children: [
|
|
96
|
+
/* @__PURE__ */ i(
|
|
97
|
+
"input",
|
|
98
|
+
{
|
|
99
|
+
id: h ?? D,
|
|
100
|
+
ref: a,
|
|
101
|
+
className: s("input"),
|
|
102
|
+
type: "number",
|
|
103
|
+
value: r,
|
|
104
|
+
placeholder: K,
|
|
105
|
+
disabled: t,
|
|
106
|
+
min: E,
|
|
107
|
+
max: l,
|
|
108
|
+
onKeyDown: t ? void 0 : M,
|
|
109
|
+
onChange: t ? void 0 : L,
|
|
110
|
+
onFocus: t ? void 0 : C,
|
|
111
|
+
style: { width: A },
|
|
112
|
+
...Y
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
!!c && (r === 0 || !!r) && /* @__PURE__ */ i("span", { children: c.slice(0, 1) })
|
|
116
|
+
] }),
|
|
117
|
+
/* @__PURE__ */ i(
|
|
118
|
+
p,
|
|
119
|
+
{
|
|
120
|
+
className: s("sign", "plus"),
|
|
121
|
+
disabled: t,
|
|
122
|
+
onClick: U,
|
|
123
|
+
children: /* @__PURE__ */ i(F, {})
|
|
124
|
+
}
|
|
125
|
+
)
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
)
|
|
129
|
+
] }),
|
|
130
|
+
u && /* @__PURE__ */ i("div", { className: s("additional-content"), children: /* @__PURE__ */ i("span", { className: s("error-text"), children: u }) })
|
|
131
|
+
] });
|
|
132
|
+
};
|
|
133
|
+
export {
|
|
134
|
+
Z as F
|
|
135
|
+
};
|
package/dist/fieldNumber.js
CHANGED