@reportportal/ui-kit 0.0.1-alpha.251 → 0.0.1-alpha.253

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,4 +1,4 @@
1
- import { A as a } from "./index-e0731146.js";
1
+ import { A as a } from "./index-8c921599.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "./bind-06a7ff84.js";
@@ -1,12 +1,12 @@
1
- import { jsx as e, jsxs as S, Fragment as j } from "react/jsx-runtime";
1
+ import { jsx as e, jsxs as S, Fragment as $ } from "react/jsx-runtime";
2
2
  import { c as h } from "./bind-06a7ff84.js";
3
- import { take as E, drop as P } from "es-toolkit";
4
- import { createContext as O, useContext as H, useRef as R, useState as y, useEffect as W } from "react";
3
+ import { take as j, drop as E } from "es-toolkit";
4
+ import { createContext as P, useContext as I, useRef as H, useState as T, useEffect as R } from "react";
5
5
  import { Popover as D } from "./popover.js";
6
- import { S as F, a as I } from "./tree-c3dd3d45.js";
6
+ import { S as W, a as F } from "./tree-c3dd3d45.js";
7
7
  import { i as B } from "./isEmpty-ccacb5ff.js";
8
- const M = O(void 0), A = ({ children: r, LinkComponent: l }) => /* @__PURE__ */ e(M.Provider, { value: { LinkComponent: l }, children: r }), L = () => {
9
- const r = H(M);
8
+ const M = P(void 0), A = ({ children: r, LinkComponent: l }) => /* @__PURE__ */ e(M.Provider, { value: { LinkComponent: l }, children: r }), L = () => {
9
+ const r = I(M);
10
10
  if (r === void 0)
11
11
  throw new Error("useBreadcrumbsContext must be used within a BreadcrumbsProvider");
12
12
  return r;
@@ -24,14 +24,14 @@ const M = O(void 0), A = ({ children: r, LinkComponent: l }) => /* @__PURE__ */
24
24
  }) => _ ? l ? r ? /* @__PURE__ */ e(r, { className: v("link"), to: l, onClick: t, children: n }) : /* @__PURE__ */ e("a", { className: v("link"), href: typeof l == "string" ? l : "#", onClick: t, children: n }) : t ? /* @__PURE__ */ e("button", { type: "button", className: v("link"), onClick: t, children: n }) : n : n, m = ({
25
25
  titleTailNumChars: r = 8,
26
26
  descriptor: { title: l, link: t, onClick: _, className: n },
27
- isClickable: k = !0,
27
+ isClickable: p = !0,
28
28
  variant: b = "default"
29
29
  }) => {
30
- const { LinkComponent: x } = L(), s = R(null), [p, d] = y(null);
31
- W(() => {
30
+ const { LinkComponent: x } = L(), s = H(null), [z, d] = T(null);
31
+ R(() => {
32
32
  if (s.current) {
33
- const { offsetWidth: T, scrollWidth: z, dataset: u } = s.current;
34
- if (T < z) {
33
+ const { offsetWidth: w, scrollWidth: f, dataset: u } = s.current;
34
+ if (w < f) {
35
35
  const c = typeof l == "string" ? l : "";
36
36
  u.tail = c.slice(c.length - r), d(c);
37
37
  }
@@ -42,49 +42,62 @@ const M = O(void 0), A = ({ children: r, LinkComponent: l }) => /* @__PURE__ */
42
42
  "div",
43
43
  {
44
44
  className: v("breadcrumb", b),
45
- title: p || void 0,
45
+ title: z || void 0,
46
46
  "data-testid": "breadcrumb",
47
- children: J({ LinkComponent: x, link: t, onClick: _, isClickable: k, breadcrumbContent: a })
47
+ children: J({ LinkComponent: x, link: t, onClick: _, isClickable: p, breadcrumbContent: a })
48
48
  }
49
49
  );
50
- }, K = {
51
- "hidden-breadcrumbs-trigger": "_hidden-breadcrumbs-trigger_14kki_1",
52
- "hidden-breadcrumbs-content": "_hidden-breadcrumbs-content_14kki_8",
53
- "hidden-breadcrumb-item": "_hidden-breadcrumb-item_14kki_14",
54
- "level-2": "_level-2_14kki_18",
55
- "level-3": "_level-3_14kki_31",
56
- "level-4": "_level-4_14kki_44",
57
- "level-5": "_level-5_14kki_57",
58
- "level-6": "_level-6_14kki_70",
59
- "level-7": "_level-7_14kki_83",
60
- "level-8": "_level-8_14kki_96",
61
- "level-9": "_level-9_14kki_109",
62
- "level-10": "_level-10_14kki_122",
63
- "level-11": "_level-11_14kki_135",
64
- "level-12": "_level-12_14kki_148",
65
- "level-13": "_level-13_14kki_161",
66
- "level-14": "_level-14_14kki_174",
67
- "level-15": "_level-15_14kki_187",
68
- "level-16": "_level-16_14kki_200",
69
- "level-17": "_level-17_14kki_213",
70
- "level-18": "_level-18_14kki_226",
71
- "level-19": "_level-19_14kki_239",
72
- "level-20": "_level-20_14kki_252",
73
- "level-21": "_level-21_14kki_265",
74
- "level-22": "_level-22_14kki_278",
75
- "level-23": "_level-23_14kki_291",
76
- "level-24": "_level-24_14kki_304",
77
- "level-25": "_level-25_14kki_317"
78
- }, C = h.bind(K), Q = ({ descriptors: r }) => /* @__PURE__ */ e("div", { className: C("hidden-breadcrumbs-content"), "data-testid": "hidden-breadcrumbs-content", children: r.map((l, t) => /* @__PURE__ */ e("div", { className: C("hidden-breadcrumb-item", `level-${t + 1}`), children: /* @__PURE__ */ e(m, { descriptor: l }) }, t)) }), V = ({ descriptors: r }) => /* @__PURE__ */ e(
79
- D,
80
- {
81
- content: /* @__PURE__ */ e(Q, { descriptors: r }),
82
- placement: "bottom-start",
83
- children: /* @__PURE__ */ e("div", { className: C("hidden-breadcrumbs-trigger"), "data-testid": "hidden-breadcrumbs-trigger", children: /* @__PURE__ */ e(F, {}) })
84
- }
85
- ), Y = "_opened_zxn5r_1", Z = {
50
+ }, K = "_active_60pvi_7", Q = {
51
+ "hidden-breadcrumbs-trigger": "_hidden-breadcrumbs-trigger_60pvi_1",
52
+ active: K,
53
+ "hidden-breadcrumbs-content": "_hidden-breadcrumbs-content_60pvi_11",
54
+ "hidden-breadcrumb-item": "_hidden-breadcrumb-item_60pvi_17",
55
+ "level-2": "_level-2_60pvi_21",
56
+ "level-3": "_level-3_60pvi_34",
57
+ "level-4": "_level-4_60pvi_47",
58
+ "level-5": "_level-5_60pvi_60",
59
+ "level-6": "_level-6_60pvi_73",
60
+ "level-7": "_level-7_60pvi_86",
61
+ "level-8": "_level-8_60pvi_99",
62
+ "level-9": "_level-9_60pvi_112",
63
+ "level-10": "_level-10_60pvi_125",
64
+ "level-11": "_level-11_60pvi_138",
65
+ "level-12": "_level-12_60pvi_151",
66
+ "level-13": "_level-13_60pvi_164",
67
+ "level-14": "_level-14_60pvi_177",
68
+ "level-15": "_level-15_60pvi_190",
69
+ "level-16": "_level-16_60pvi_203",
70
+ "level-17": "_level-17_60pvi_216",
71
+ "level-18": "_level-18_60pvi_229",
72
+ "level-19": "_level-19_60pvi_242",
73
+ "level-20": "_level-20_60pvi_255",
74
+ "level-21": "_level-21_60pvi_268",
75
+ "level-22": "_level-22_60pvi_281",
76
+ "level-23": "_level-23_60pvi_294",
77
+ "level-24": "_level-24_60pvi_307",
78
+ "level-25": "_level-25_60pvi_320"
79
+ }, C = h.bind(Q), V = ({ descriptors: r }) => /* @__PURE__ */ e("div", { className: C("hidden-breadcrumbs-content"), "data-testid": "hidden-breadcrumbs-content", children: r.map((l, t) => /* @__PURE__ */ e("div", { className: C("hidden-breadcrumb-item", `level-${t + 1}`), children: /* @__PURE__ */ e(m, { descriptor: l }) }, t)) }), Y = ({ descriptors: r }) => {
80
+ const [l, t] = T(!1);
81
+ return /* @__PURE__ */ e(
82
+ D,
83
+ {
84
+ content: /* @__PURE__ */ e(V, { descriptors: r }),
85
+ placement: "bottom-start",
86
+ isOpened: l,
87
+ setIsOpened: t,
88
+ children: /* @__PURE__ */ e(
89
+ "div",
90
+ {
91
+ className: C("hidden-breadcrumbs-trigger", { active: l }),
92
+ "data-testid": "hidden-breadcrumbs-trigger",
93
+ children: /* @__PURE__ */ e(W, {})
94
+ }
95
+ )
96
+ }
97
+ );
98
+ }, Z = "_opened_zxn5r_1", ee = {
86
99
  "tree-button": "_tree-button_zxn5r_1",
87
- opened: Y,
100
+ opened: Z,
88
101
  "tree-menu-node": "_tree-menu-node_zxn5r_8",
89
102
  "tree-menu-children": "_tree-menu-children_zxn5r_9",
90
103
  "tree-menu-item": "_tree-menu-item_zxn5r_15",
@@ -112,49 +125,49 @@ const M = O(void 0), A = ({ children: r, LinkComponent: l }) => /* @__PURE__ */
112
125
  "level-23": "_level-23_zxn5r_292",
113
126
  "level-24": "_level-24_zxn5r_305",
114
127
  "level-25": "_level-25_zxn5r_318"
115
- }, o = h.bind(Z), ee = ({ descriptor: r, level: l }) => /* @__PURE__ */ e("div", { className: o("tree-menu-item", `level-${l}`), children: /* @__PURE__ */ e(m, { descriptor: r, variant: "dark" }) }), $ = (r, l) => r.map((t, _) => /* @__PURE__ */ S("div", { className: o("tree-menu-node"), children: [
116
- /* @__PURE__ */ e(ee, { descriptor: t, level: l }),
117
- t.children && t.children.length > 0 && /* @__PURE__ */ e("div", { className: o("tree-menu-children"), children: $(t.children, l + 1) })
118
- ] }, _)), le = ({ tree: r }) => {
119
- const [l, t] = y(!1);
128
+ }, o = h.bind(ee), le = ({ descriptor: r, level: l }) => /* @__PURE__ */ e("div", { className: o("tree-menu-item", `level-${l}`), children: /* @__PURE__ */ e(m, { descriptor: r, variant: "dark" }) }), O = (r, l) => r.map((t, _) => /* @__PURE__ */ S("div", { className: o("tree-menu-node"), children: [
129
+ /* @__PURE__ */ e(le, { descriptor: t, level: l }),
130
+ t.children && t.children.length > 0 && /* @__PURE__ */ e("div", { className: o("tree-menu-children"), children: O(t.children, l + 1) })
131
+ ] }, _)), re = ({ tree: r }) => {
132
+ const [l, t] = T(!1);
120
133
  return /* @__PURE__ */ e(
121
134
  D,
122
135
  {
123
- content: /* @__PURE__ */ e("div", { className: o("tree-menu"), children: $(r, 1) }),
136
+ content: /* @__PURE__ */ e("div", { className: o("tree-menu"), children: O(r, 1) }),
124
137
  placement: "bottom-start",
125
138
  isOpened: l,
126
139
  setIsOpened: t,
127
- children: /* @__PURE__ */ e("div", { className: o("tree-button", { opened: l }), children: /* @__PURE__ */ e(I, {}) })
140
+ children: /* @__PURE__ */ e("div", { className: o("tree-button", { opened: l }), children: /* @__PURE__ */ e(F, {}) })
128
141
  }
129
142
  );
130
- }, re = "_breadcrumbs_1cb9j_1", te = {
143
+ }, te = "_breadcrumbs_1cb9j_1", ne = {
131
144
  "breadcrumbs-container": "_breadcrumbs-container_1cb9j_1",
132
- breadcrumbs: re,
145
+ breadcrumbs: te,
133
146
  "breadcrumb-item": "_breadcrumb-item_1cb9j_15",
134
147
  "hidden-breadcrumbs": "_hidden-breadcrumbs_1cb9j_23",
135
148
  "back-button": "_back-button_1cb9j_43"
136
- }, i = h.bind(te), ne = 5, me = ({
149
+ }, i = h.bind(ne), _e = 5, oe = ({
137
150
  descriptors: r = [],
138
151
  dataAutomationId: l,
139
152
  LinkComponent: t,
140
153
  tree: _,
141
154
  isBackButton: n = !1,
142
- isLastClickable: k = !1,
155
+ isLastClickable: p = !1,
143
156
  isSingleItemClickable: b = !1,
144
- maxShownDescriptors: x = ne,
157
+ maxShownDescriptors: x = _e,
145
158
  titleTailNumChars: s,
146
- className: p
159
+ className: z
147
160
  }) => {
148
- const [d, ...a] = r, z = Math.max(1, Math.floor(x)) - 1, u = Math.max(0, a.length - z), c = ((N) => ({
161
+ const [d, ...a] = r, f = Math.max(1, Math.floor(x)) - 1, u = Math.max(0, a.length - f), c = ((g) => ({
149
162
  1: 55,
150
163
  2: 24,
151
164
  3: 18,
152
165
  4: 13
153
- })[N] ?? 12)(r.length), w = E(a, u), f = P(a, u);
166
+ })[g] ?? 12)(r.length), y = j(a, u), N = E(a, u);
154
167
  return /* @__PURE__ */ e(A, { LinkComponent: t, children: /* @__PURE__ */ e(
155
168
  "div",
156
169
  {
157
- className: i("breadcrumbs-container", p),
170
+ className: i("breadcrumbs-container", z),
158
171
  "data-automation-id": l,
159
172
  "data-testid": l,
160
173
  children: n && d ? /* @__PURE__ */ e("div", { className: i("breadcrumbs"), children: /* @__PURE__ */ e("div", { className: i("breadcrumb-item", "back-button"), "data-testid": "back-breadcrumb", children: /* @__PURE__ */ e(
@@ -163,8 +176,8 @@ const M = O(void 0), A = ({ children: r, LinkComponent: l }) => /* @__PURE__ */
163
176
  descriptor: d,
164
177
  titleTailNumChars: s ?? c
165
178
  }
166
- ) }) }) : /* @__PURE__ */ S(j, { children: [
167
- _ && /* @__PURE__ */ e("div", { className: i("tree"), children: /* @__PURE__ */ e(le, { tree: _ }) }),
179
+ ) }) }) : /* @__PURE__ */ S($, { children: [
180
+ _ && /* @__PURE__ */ e("div", { className: i("tree"), children: /* @__PURE__ */ e(re, { tree: _ }) }),
168
181
  /* @__PURE__ */ S("div", { className: i("breadcrumbs"), children: [
169
182
  d && /* @__PURE__ */ e("div", { className: i("breadcrumb-item"), children: /* @__PURE__ */ e(
170
183
  m,
@@ -174,20 +187,20 @@ const M = O(void 0), A = ({ children: r, LinkComponent: l }) => /* @__PURE__ */
174
187
  isClickable: b || !B(a)
175
188
  }
176
189
  ) }),
177
- !B(w) && /* @__PURE__ */ e("div", { className: i("breadcrumb-item", "hidden-breadcrumbs"), children: /* @__PURE__ */ e(V, { descriptors: w }) }),
178
- !B(f) && f.map((N, g) => /* @__PURE__ */ e("div", { className: i("breadcrumb-item"), children: /* @__PURE__ */ e(
190
+ !B(y) && /* @__PURE__ */ e("div", { className: i("breadcrumb-item", "hidden-breadcrumbs"), children: /* @__PURE__ */ e(Y, { descriptors: y }) }),
191
+ !B(N) && N.map((g, k) => /* @__PURE__ */ e("div", { className: i("breadcrumb-item"), children: /* @__PURE__ */ e(
179
192
  m,
180
193
  {
181
- descriptor: N,
194
+ descriptor: g,
182
195
  titleTailNumChars: s ?? c,
183
- isClickable: k || g !== f.length - 1
196
+ isClickable: p || k !== N.length - 1
184
197
  }
185
- ) }, g))
198
+ ) }, k))
186
199
  ] })
187
200
  ] })
188
201
  }
189
202
  ) });
190
203
  };
191
204
  export {
192
- me as B
205
+ oe as B
193
206
  };
@@ -1,4 +1,4 @@
1
- import { B as m } from "./breadcrumbs-5730e318.js";
1
+ import { B as m } from "./breadcrumbs-0a228139.js";
2
2
  import "react/jsx-runtime";
3
3
  import "./bind-06a7ff84.js";
4
4
  import "es-toolkit";
@@ -1,12 +1,12 @@
1
- import { jsxs as a, Fragment as W, jsx as r } from "react/jsx-runtime";
1
+ import { jsxs as d, Fragment as W, jsx as r } from "react/jsx-runtime";
2
2
  import { useRef as y, useId as B, useMemo as w } from "react";
3
- import { c as v } from "./bind-06a7ff84.js";
3
+ import { c as H } from "./bind-06a7ff84.js";
4
4
  import { K as e } from "./keyCodes-f63c0e11.js";
5
- import { B as D } from "./baseIconButton-251479f7.js";
6
- import { S as H } from "./minus-2857540f.js";
7
- import { S as k } from "./plus-199fb2a8.js";
8
- import { FieldLabel as P } from "./fieldLabel.js";
9
- const b = 5, I = 0.4, Y = 16 + I, G = [
5
+ import { B as h } from "./baseIconButton-251479f7.js";
6
+ import { S as k } from "./minus-2857540f.js";
7
+ import { S as P } from "./plus-199fb2a8.js";
8
+ import { FieldLabel as b } from "./fieldLabel.js";
9
+ const G = 5, I = 0.4, Y = 16 + I, X = [
10
10
  e.TAB_KEY_CODE,
11
11
  e.BACKSPACE_KEY_CODE,
12
12
  e.ARROW_LEFT_KEY_CODE,
@@ -24,84 +24,84 @@ const b = 5, I = 0.4, Y = 16 + I, G = [
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
- ], X = "_sign_3v3h5_7", $ = "_error_3v3h5_22", j = "_disabled_3v3h5_27", z = "_input_3v3h5_12", q = {
28
- "field-number": "_field-number_3v3h5_1",
29
- sign: X,
30
- "input-container": "_input-container_3v3h5_12",
31
- error: $,
32
- disabled: j,
33
- "input-field": "_input-field_3v3h5_38",
34
- input: z,
35
- "additional-content": "_additional-content_3v3h5_84",
36
- "error-text": "_error-text_3v3h5_88"
37
- }, c = v.bind(q), rn = ({
27
+ ], $ = "_sign_12dg8_7", j = "_error_12dg8_22", z = "_disabled_12dg8_27", q = "_input_12dg8_12", J = {
28
+ "field-number": "_field-number_12dg8_1",
29
+ sign: $,
30
+ "input-container": "_input-container_12dg8_12",
31
+ error: j,
32
+ disabled: z,
33
+ "input-field": "_input-field_12dg8_38",
34
+ input: q,
35
+ "additional-content": "_additional-content_12dg8_85",
36
+ "error-text": "_error-text_12dg8_89"
37
+ }, c = H.bind(J), rn = ({
38
38
  value: i = "",
39
- placeholder: L = "0",
39
+ placeholder: g = "0",
40
40
  disabled: t = !1,
41
41
  onChange: l,
42
- onFocus: d,
42
+ onFocus: a,
43
43
  onBlur: N,
44
44
  label: f,
45
45
  postfix: E = "",
46
46
  min: s = 0,
47
47
  max: o = Number.MAX_SAFE_INTEGER,
48
- title: A,
48
+ title: L,
49
49
  error: C,
50
- id: h,
51
- ...M
50
+ id: m,
51
+ ...A
52
52
  }) => {
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) => {
53
+ const u = y(null), p = B(), O = (n) => Number.isNaN(n) ? s : n === Number.POSITIVE_INFINITY ? o : n === Number.NEGATIVE_INFINITY || n < s ? s : n > o ? o : n, M = (n) => {
54
54
  const _ = n.target.value.replace(/^0(?=\d+|^\d)/g, "");
55
55
  if (_ === "") {
56
56
  l("");
57
57
  return;
58
58
  }
59
59
  l(+_);
60
- }, T = (n) => {
60
+ }, R = (n) => {
61
61
  N && N(n);
62
- const _ = +n.currentTarget.value, p = O(_);
63
- p !== _ && l(p);
64
- }, U = (n) => {
62
+ const _ = +n.currentTarget.value, D = O(_);
63
+ D !== _ && l(D);
64
+ }, T = (n) => {
65
65
  const { keyCode: _ } = n;
66
- G.includes(_) || (_ < e.NUMBER_START_KEY_CODE || _ > e.NUMBER_END_KEY_CODE || n.shiftKey) && n.preventDefault();
67
- }, F = () => {
66
+ X.includes(_) || (_ < e.NUMBER_START_KEY_CODE || _ > e.NUMBER_END_KEY_CODE || n.shiftKey) && n.preventDefault();
67
+ }, U = () => {
68
68
  const _ = O(+i) - 1;
69
69
  _ >= s && _ <= o && l(_);
70
- }, g = () => {
70
+ }, F = () => {
71
71
  const _ = O(+i) + 1;
72
72
  _ >= s && _ <= o && l(_);
73
- }, K = L + E, S = w(() => {
73
+ }, K = g + E, S = w(() => {
74
74
  let n = (String(i) || K).length;
75
- return E && !i && (n += 1), n ? n > Y ? `${Y}ch` : `${n + I}ch` : `${b}ch`;
75
+ return E && !i && (n += 1), n ? n > Y ? `${Y}ch` : `${n + I}ch` : `${G}ch`;
76
76
  }, [K, E, i]), V = () => {
77
- u && u.current && u.current.focus(), d && d();
77
+ u && u.current && u.current.focus(), a && a();
78
78
  };
79
- return /* @__PURE__ */ a(W, { children: [
80
- /* @__PURE__ */ a("div", { className: c("field-number", { disabled: t }), children: [
81
- f && /* @__PURE__ */ r(P, { htmlFor: h ?? m, children: f }),
82
- /* @__PURE__ */ a(
79
+ return /* @__PURE__ */ d(W, { children: [
80
+ /* @__PURE__ */ d("div", { className: c("field-number", { disabled: t }), children: [
81
+ f && /* @__PURE__ */ r(b, { htmlFor: m ?? p, children: f }),
82
+ /* @__PURE__ */ d(
83
83
  "div",
84
84
  {
85
85
  className: c("input-container", {
86
86
  error: C,
87
87
  disabled: t
88
88
  }),
89
- title: A,
89
+ title: L,
90
90
  children: [
91
91
  /* @__PURE__ */ r(
92
- D,
92
+ h,
93
93
  {
94
94
  className: c("sign", "minus"),
95
95
  disabled: t,
96
- onClick: F,
97
- children: /* @__PURE__ */ r(H, {})
96
+ onClick: U,
97
+ children: /* @__PURE__ */ r(k, {})
98
98
  }
99
99
  ),
100
- /* @__PURE__ */ a("span", { className: c("input-field", { disabled: t }), onClick: V, children: [
100
+ /* @__PURE__ */ d("span", { className: c("input-field", { disabled: t }), onClick: V, children: [
101
101
  /* @__PURE__ */ r(
102
102
  "input",
103
103
  {
104
- id: h ?? m,
104
+ id: m ?? p,
105
105
  ref: u,
106
106
  className: c("input"),
107
107
  type: "number",
@@ -110,23 +110,23 @@ const b = 5, I = 0.4, Y = 16 + I, G = [
110
110
  disabled: t,
111
111
  min: s,
112
112
  max: o,
113
- onKeyDown: t ? void 0 : U,
114
- onChange: t ? void 0 : R,
115
- onFocus: t ? void 0 : d,
116
- onBlur: t ? void 0 : T,
113
+ onKeyDown: t ? void 0 : T,
114
+ onChange: t ? void 0 : M,
115
+ onFocus: t ? void 0 : a,
116
+ onBlur: t ? void 0 : R,
117
117
  style: { width: S },
118
- ...M
118
+ ...A
119
119
  }
120
120
  ),
121
121
  !!E && (i === 0 || !!i) && /* @__PURE__ */ r("span", { children: E.slice(0, 1) })
122
122
  ] }),
123
123
  /* @__PURE__ */ r(
124
- D,
124
+ h,
125
125
  {
126
126
  className: c("sign", "plus"),
127
127
  disabled: t,
128
- onClick: g,
129
- children: /* @__PURE__ */ r(k, {})
128
+ onClick: F,
129
+ children: /* @__PURE__ */ r(P, {})
130
130
  }
131
131
  )
132
132
  ]
@@ -1,4 +1,4 @@
1
- import { F as m } from "./fieldNumber-b4aa4d7e.js";
1
+ import { F as m } from "./fieldNumber-c5ecb471.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "./bind-06a7ff84.js";
@@ -1,7 +1,7 @@
1
1
  import { jsx as _, jsxs as F } from "react/jsx-runtime";
2
2
  import { c as h } from "./bind-06a7ff84.js";
3
3
  import { useState as I, useCallback as d, useRef as A, createContext as L, useMemo as M, useContext as j, useEffect as k } from "react";
4
- import { g as B, A as P } from "./index-e0731146.js";
4
+ import { g as B, A as P } from "./index-8c921599.js";
5
5
  import { i as v } from "./isEmpty-ccacb5ff.js";
6
6
  import { B as S } from "./button-7ab874f3.js";
7
7
  import Z from "react-dropzone";
@@ -1,13 +1,13 @@
1
- import { jsxs as s, jsx as a, Fragment as p } from "react/jsx-runtime";
2
- import { useMemo as g, useCallback as u } from "react";
3
- import { c as E } from "./bind-06a7ff84.js";
4
- import { S as I } from "./close-4d480ef7.js";
5
- import { b as j, g as k, a as A, S as M, d as P, e as B, c as d, f as b } from "./download-4950d639.js";
6
- const F = (e) => {
7
- var c;
8
- const n = e.split(".");
9
- return n.length > 1 && ((c = n.pop()) == null ? void 0 : c.toLowerCase()) || "";
10
- }, O = (e) => e.length <= 15 ? e : e.slice(0, 4) + "..." + e.slice(-8), J = {
1
+ import { jsxs as d, jsx as a, Fragment as b } from "react/jsx-runtime";
2
+ import { useMemo as y, useCallback as m } from "react";
3
+ import { c as j } from "./bind-06a7ff84.js";
4
+ import { S as A } from "./close-4d480ef7.js";
5
+ import { b as F, g as M, a as B, S as P, d as K, e as O, c as n, f as v } from "./download-4950d639.js";
6
+ const J = (e) => {
7
+ var i;
8
+ const h = e.split(".");
9
+ return h.length > 1 && ((i = h.pop()) == null ? void 0 : i.toLowerCase()) || "";
10
+ }, T = (e) => e.length <= 15 ? e : e.slice(0, 4) + "..." + e.slice(-8), X = {
11
11
  "attached-file": "_attached-file_1yz71_16",
12
12
  "attached-file__file-name": "_attached-file__file-name_1yz71_29",
13
13
  "attached-file__download-icon": "_attached-file__download-icon_1yz71_32",
@@ -27,78 +27,88 @@ const F = (e) => {
27
27
  "attached-file__upload-progress-bar": "_attached-file__upload-progress-bar_1yz71_179",
28
28
  "attached-file__remove-button": "_attached-file__remove-button_1yz71_183",
29
29
  "attached-file__remove-button--disabled": "_attached-file__remove-button--disabled_1yz71_205"
30
- }, t = E.bind(J), T = {
31
- csv: M,
32
- jar: P,
33
- pdf: B,
34
- jpg: d,
35
- jpeg: d,
36
- png: d,
37
- gif: d,
38
- svg: d,
39
- webp: d,
40
- xls: b,
41
- xlsx: b
42
- }, X = (e) => T[e.toLowerCase()] ?? j, Q = ({
30
+ }, t = j.bind(X), $ = {
31
+ csv: P,
32
+ jar: K,
33
+ pdf: O,
34
+ jpg: n,
35
+ jpeg: n,
36
+ png: n,
37
+ gif: n,
38
+ svg: n,
39
+ webp: n,
40
+ xls: v,
41
+ xlsx: v
42
+ }, q = (e) => $[e.toLowerCase()] ?? F, Y = ({
43
43
  fileName: e,
44
- size: n,
45
- uploadingProgress: c = 0,
46
- isUploadFailed: _ = !1,
47
- uploadFailedMessage: y,
44
+ size: h,
45
+ uploadingProgress: i = 0,
46
+ isUploadFailed: s = !1,
47
+ uploadFailedMessage: x,
48
48
  isUploading: l = !1,
49
- isFullWidth: v = !1,
50
- onDownload: h,
49
+ isFullWidth: z = !1,
50
+ onDownload: _,
51
51
  onRemove: f,
52
- withPreview: x = !1,
53
- textPosition: z = "right",
54
- imageSrc: m
52
+ withPreview: C = !1,
53
+ textPosition: L = "right",
54
+ imageSrc: u
55
55
  }) => {
56
- const o = g(() => F(e), [e]), C = o.toUpperCase(), L = g(() => X(o), [o]), S = h ? k : A, N = u(
57
- (r) => {
58
- r.stopPropagation(), l || f == null || f();
56
+ const p = y(() => J(e), [e]), S = p.toUpperCase(), N = y(() => q(p), [p]), E = _ ? M : B, k = m(
57
+ (o) => {
58
+ o.stopPropagation(), l || f == null || f();
59
59
  },
60
60
  [l, f]
61
- ), w = u(
62
- (r) => {
63
- r.stopPropagation(), !_ && !l && h && h();
61
+ ), c = L === "bottom", g = !c && !s && !l && !!_, r = m(() => {
62
+ g && (_ == null || _());
63
+ }, [g, _]), w = m(() => {
64
+ r();
65
+ }, [r]), I = m(
66
+ (o) => {
67
+ (o.key === "Enter" || o.key === " ") && (o.preventDefault(), r());
64
68
  },
65
- [_, l, h]
66
- ), i = z === "bottom";
67
- return /* @__PURE__ */ s(
69
+ [r]
70
+ );
71
+ return /* @__PURE__ */ d(
68
72
  "div",
69
73
  {
70
74
  className: t("attached-file", {
71
- "attached-file--failed": _,
75
+ "attached-file--failed": s,
72
76
  "attached-file--uploading": l,
73
- "attached-file--full-width": v,
74
- "attached-file--bottom-placed": i
77
+ "attached-file--full-width": z,
78
+ "attached-file--bottom-placed": c
75
79
  }),
80
+ ...g && {
81
+ role: "button",
82
+ tabIndex: 0,
83
+ onClick: w,
84
+ onKeyDown: I
85
+ },
76
86
  children: [
77
- /* @__PURE__ */ a("div", { className: t("attached-file__icon"), children: x && m ? /* @__PURE__ */ a("img", { className: t("attached-file__thumbnail"), src: m, alt: e }) : /* @__PURE__ */ a("div", { className: t("attached-file__file-icon"), children: /* @__PURE__ */ a(L, {}) }) }),
78
- /* @__PURE__ */ s("div", { className: t("attached-file__info"), children: [
79
- !i && h ? /* @__PURE__ */ s("button", { type: "button", className: t("attached-file__file-name"), onClick: w, children: [
87
+ /* @__PURE__ */ a("div", { className: t("attached-file__icon"), children: C && u ? /* @__PURE__ */ a("img", { className: t("attached-file__thumbnail"), src: u, alt: e }) : /* @__PURE__ */ a("div", { className: t("attached-file__file-icon"), children: /* @__PURE__ */ a(N, {}) }) }),
88
+ /* @__PURE__ */ d("div", { className: t("attached-file__info"), children: [
89
+ !c && _ ? /* @__PURE__ */ d("div", { className: t("attached-file__file-name"), children: [
80
90
  /* @__PURE__ */ a("span", { className: t("attached-file__name-text"), children: e }),
81
- !l && !_ && /* @__PURE__ */ a("span", { className: t("attached-file__download-icon"), children: /* @__PURE__ */ a(S, {}) })
91
+ !l && !s && /* @__PURE__ */ a("span", { className: t("attached-file__download-icon"), children: /* @__PURE__ */ a(E, {}) })
82
92
  ] }) : /* @__PURE__ */ a(
83
93
  "div",
84
94
  {
85
95
  className: t("attached-file__file-name", {
86
- "attached-file__file-name--bottom-placed": i
96
+ "attached-file__file-name--bottom-placed": c
87
97
  }),
88
- children: /* @__PURE__ */ a("span", { className: t("attached-file__name-text"), children: i ? O(e) : e })
98
+ children: /* @__PURE__ */ a("span", { className: t("attached-file__name-text"), children: c ? T(e) : e })
89
99
  }
90
100
  ),
91
- i ? null : /* @__PURE__ */ s(p, { children: [
92
- !_ && /* @__PURE__ */ s("div", { className: t("attached-file__file-details"), children: [
93
- C,
101
+ c ? null : /* @__PURE__ */ d(b, { children: [
102
+ !s && /* @__PURE__ */ d("div", { className: t("attached-file__file-details"), children: [
103
+ S,
94
104
  ", ",
95
- n,
105
+ h,
96
106
  " MB"
97
107
  ] }),
98
- _ && /* @__PURE__ */ a("div", { className: t("attached-file__error-message"), children: y })
108
+ s && /* @__PURE__ */ a("div", { className: t("attached-file__error-message"), children: x })
99
109
  ] })
100
110
  ] }),
101
- i ? null : /* @__PURE__ */ s(p, { children: [
111
+ c ? null : /* @__PURE__ */ d(b, { children: [
102
112
  f && /* @__PURE__ */ a(
103
113
  "button",
104
114
  {
@@ -107,15 +117,15 @@ const F = (e) => {
107
117
  "attached-file__remove-button--disabled": l
108
118
  }),
109
119
  disabled: l,
110
- onClick: N,
111
- children: /* @__PURE__ */ a(I, {})
120
+ onClick: k,
121
+ children: /* @__PURE__ */ a(A, {})
112
122
  }
113
123
  ),
114
- l && c > 0 && /* @__PURE__ */ a("div", { className: t("attached-file__upload-progress"), children: /* @__PURE__ */ a(
124
+ l && i > 0 && /* @__PURE__ */ a("div", { className: t("attached-file__upload-progress"), children: /* @__PURE__ */ a(
115
125
  "div",
116
126
  {
117
127
  className: t("attached-file__upload-progress-bar"),
118
- style: { width: `${c}%` }
128
+ style: { width: `${i}%` }
119
129
  }
120
130
  ) })
121
131
  ] })
@@ -124,6 +134,6 @@ const F = (e) => {
124
134
  );
125
135
  };
126
136
  export {
127
- Q as A,
128
- F as g
137
+ Y as A,
138
+ J as g
129
139
  };