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

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reportportal/ui-kit",
3
- "version": "0.0.1-alpha.101",
3
+ "version": "0.0.1-alpha.103",
4
4
  "description": "The UI-kit library for ReportPortal Design System.",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,131 +0,0 @@
1
- import { jsxs as a, 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, N = 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: m = "0",
39
- disabled: t = !1,
40
- onChange: C,
41
- onFocus: d,
42
- onBlur: G,
43
- label: O,
44
- postfix: o = "",
45
- min: c = 0,
46
- max: E = Number.MAX_SAFE_INTEGER,
47
- title: f,
48
- error: u,
49
- id: h,
50
- ...Y
51
- }) => {
52
- const l = T(null), D = I(), L = (n) => {
53
- let e = n.target.value.replace(/^0(?=\d+|^\d)/g, "");
54
- e = +e, e = e < c ? c : e, e >= c && e <= E && C(e);
55
- }, M = (n) => {
56
- const { keyCode: e } = n;
57
- k.includes(e) || (e < _.NUMBER_START_KEY_CODE || e > _.NUMBER_END_KEY_CODE || n.shiftKey) && n.preventDefault();
58
- }, R = () => {
59
- const n = +r - 1;
60
- n >= c && n <= E && C(n);
61
- }, U = () => {
62
- const n = +r + 1;
63
- n >= c && n <= E && C(n);
64
- }, K = m + o, A = W(() => {
65
- let n = (String(r) || K).length;
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();
69
- };
70
- return /* @__PURE__ */ a(v, { children: [
71
- /* @__PURE__ */ a("div", { className: s("field-number", { disabled: t }), children: [
72
- O && /* @__PURE__ */ i(S, { htmlFor: h ?? D, children: O }),
73
- /* @__PURE__ */ a(
74
- "div",
75
- {
76
- className: s("input-container", {
77
- error: u,
78
- disabled: t
79
- }),
80
- title: f,
81
- children: [
82
- /* @__PURE__ */ i(
83
- p,
84
- {
85
- className: s("sign", "minus"),
86
- disabled: t,
87
- onClick: R,
88
- children: /* @__PURE__ */ i(B, {})
89
- }
90
- ),
91
- /* @__PURE__ */ a("span", { className: s("input-field", { disabled: t }), onClick: g, children: [
92
- /* @__PURE__ */ i(
93
- "input",
94
- {
95
- id: h ?? D,
96
- ref: l,
97
- className: s("input"),
98
- type: "number",
99
- value: r,
100
- placeholder: K,
101
- disabled: t,
102
- min: c,
103
- max: E,
104
- onKeyDown: t ? void 0 : M,
105
- onChange: t ? void 0 : L,
106
- onFocus: t ? void 0 : d,
107
- style: { width: A },
108
- ...Y
109
- }
110
- ),
111
- !!o && (r === 0 || !!r) && /* @__PURE__ */ i("span", { children: o.slice(0, 1) })
112
- ] }),
113
- /* @__PURE__ */ i(
114
- p,
115
- {
116
- className: s("sign", "plus"),
117
- disabled: t,
118
- onClick: U,
119
- children: /* @__PURE__ */ i(F, {})
120
- }
121
- )
122
- ]
123
- }
124
- )
125
- ] }),
126
- u && /* @__PURE__ */ i("div", { className: s("additional-content"), children: /* @__PURE__ */ i("span", { className: s("error-text"), children: u }) })
127
- ] });
128
- };
129
- export {
130
- Z as F
131
- };
@@ -1,99 +0,0 @@
1
- import { jsxs as o, jsx as a } from "react/jsx-runtime";
2
- import { useMemo as r, useCallback as m } from "react";
3
- import { c as w } from "./bind-06a7ff84.js";
4
- import { S as C } from "./close-4d480ef7.js";
5
- import { a as S, b as E, S as j, d as y, e as I, c as l, f as p } from "./xls-995781cc.js";
6
- const k = (t) => {
7
- var i;
8
- const s = t.split(".");
9
- return s.length > 1 && ((i = s.at(-1)) == null ? void 0 : i.toLowerCase()) || "";
10
- }, L = {
11
- "attached-file": "_attached-file_1od33_16",
12
- "attached-file__file-name": "_attached-file__file-name_1od33_28",
13
- "attached-file--failed": "_attached-file--failed_1od33_31",
14
- "attached-file__name-text": "_attached-file__name-text_1od33_34",
15
- "attached-file__icon": "_attached-file__icon_1od33_37",
16
- "attached-file--uploading": "_attached-file--uploading_1od33_40",
17
- "attached-file--full-width": "_attached-file--full-width_1od33_49",
18
- "attached-file__file-icon": "_attached-file__file-icon_1od33_58",
19
- "attached-file__info": "_attached-file__info_1od33_70",
20
- "attached-file__download-icon": "_attached-file__download-icon_1od33_94",
21
- "attached-file__file-details": "_attached-file__file-details_1od33_113",
22
- "attached-file__error-message": "_attached-file__error-message_1od33_118",
23
- "attached-file__upload-progress": "_attached-file__upload-progress_1od33_123",
24
- "attached-file__upload-progress-bar": "_attached-file__upload-progress-bar_1od33_132",
25
- "attached-file__remove-button": "_attached-file__remove-button_1od33_136"
26
- }, e = w.bind(L), A = {
27
- csv: j,
28
- jar: y,
29
- pdf: I,
30
- jpg: l,
31
- jpeg: l,
32
- png: l,
33
- gif: l,
34
- svg: l,
35
- webp: l,
36
- xls: p,
37
- xlsx: p
38
- }, M = (t) => A[t.toLowerCase()] ?? E, X = ({
39
- fileName: t,
40
- size: s,
41
- uploadingProgress: i = 0,
42
- isUploadFailed: _ = !1,
43
- uploadFailedMessage: g,
44
- isUploading: c = !1,
45
- isFullWidth: u = !1,
46
- onDownload: h = () => {
47
- },
48
- onRemove: d
49
- }) => {
50
- const f = r(() => k(t), [t]), v = f.toUpperCase(), x = r(() => M(f), [f]), b = m(
51
- (n) => {
52
- n.stopPropagation(), d == null || d();
53
- },
54
- [d]
55
- ), N = m(
56
- (n) => {
57
- n.stopPropagation(), !_ && !c && h();
58
- },
59
- [_, c, h]
60
- );
61
- return /* @__PURE__ */ o(
62
- "div",
63
- {
64
- className: e("attached-file", {
65
- "attached-file--failed": _,
66
- "attached-file--uploading": c,
67
- "attached-file--full-width": u
68
- }),
69
- children: [
70
- /* @__PURE__ */ a("div", { className: e("attached-file__icon"), children: /* @__PURE__ */ a("div", { className: e("attached-file__file-icon"), children: /* @__PURE__ */ a(x, {}) }) }),
71
- /* @__PURE__ */ o("div", { className: e("attached-file__info"), children: [
72
- /* @__PURE__ */ o("button", { type: "button", className: e("attached-file__file-name"), onClick: N, children: [
73
- /* @__PURE__ */ a("span", { className: e("attached-file__name-text"), children: t }),
74
- !c && !_ && /* @__PURE__ */ a("span", { className: e("attached-file__download-icon"), children: /* @__PURE__ */ a(S, {}) })
75
- ] }),
76
- !_ && /* @__PURE__ */ o("div", { className: e("attached-file__file-details"), children: [
77
- v,
78
- ", ",
79
- s,
80
- " MB"
81
- ] }),
82
- _ && /* @__PURE__ */ a("div", { className: e("attached-file__error-message"), children: g })
83
- ] }),
84
- d && /* @__PURE__ */ a("button", { type: "button", className: e("attached-file__remove-button"), onClick: b, children: /* @__PURE__ */ a(C, {}) }),
85
- c && i > 0 && /* @__PURE__ */ a("div", { className: e("attached-file__upload-progress"), children: /* @__PURE__ */ a(
86
- "div",
87
- {
88
- className: e("attached-file__upload-progress-bar"),
89
- style: { width: `${i}%` }
90
- }
91
- ) })
92
- ]
93
- }
94
- );
95
- };
96
- export {
97
- X as A,
98
- k as g
99
- };