@reportportal/ui-kit 0.0.1-alpha.141 → 0.0.1-alpha.142

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.
Files changed (141) hide show
  1. package/dist/adaptiveTagList.js +189 -0
  2. package/dist/attachedFile.js +9 -0
  3. package/dist/autocompletes.js +779 -0
  4. package/dist/baseIconButton-251479f7.js +25 -0
  5. package/dist/baseIconButton.js +7 -0
  6. package/dist/bind-06a7ff84.js +41 -0
  7. package/dist/breadcrumbs-8e5ca8d7.js +183 -0
  8. package/dist/breadcrumbs.js +12 -0
  9. package/dist/bubblesLoader-f3ffa240.js +28 -0
  10. package/dist/bubblesLoader.js +7 -0
  11. package/dist/button-97d9e587.js +66 -0
  12. package/dist/button.js +8 -0
  13. package/dist/calendarArrow-44c7e60e.js +5 -0
  14. package/dist/checkbox-ed6cc375.js +73 -0
  15. package/dist/checkbox.js +9 -0
  16. package/dist/chevronDownDropdown-66f5b1af.js +7 -0
  17. package/dist/clear-53660571.js +5 -0
  18. package/dist/close-4d480ef7.js +5 -0
  19. package/dist/datePicker-f8e0df24.js +194 -0
  20. package/dist/datePicker.js +35 -0
  21. package/dist/dropdown-0260bb66.js +5 -0
  22. package/dist/dropdown-893c692c.js +634 -0
  23. package/dist/dropdown.js +27 -0
  24. package/dist/fieldLabel.js +18 -0
  25. package/dist/fieldNumber-d1b5a7a1.js +140 -0
  26. package/dist/fieldNumber.js +13 -0
  27. package/dist/fieldText-1749da7a.js +167 -0
  28. package/dist/fieldText.js +14 -0
  29. package/dist/fieldTextFlex-2f51c173.js +80 -0
  30. package/dist/fieldTextFlex.js +10 -0
  31. package/dist/fileDropArea.js +325 -0
  32. package/dist/filterOutline-819b4b0d.js +6 -0
  33. package/dist/filtersButton.js +25 -0
  34. package/dist/floatingUi-41f8c7b5.js +29 -0
  35. package/dist/icons.js +85 -0
  36. package/dist/index-1a874a8b.js +110 -0
  37. package/dist/index.js +165 -0
  38. package/dist/isEmpty-ccacb5ff.js +38 -0
  39. package/dist/keyCodes-f63c0e11.js +4 -0
  40. package/dist/maxValueDisplay-9be01a75.js +13 -0
  41. package/dist/maxValueDisplay.js +6 -0
  42. package/dist/minus-2857540f.js +5 -0
  43. package/dist/modal.js +194 -0
  44. package/dist/openEye-950159cb.js +6 -0
  45. package/dist/pagination-a3dee614.js +347 -0
  46. package/dist/pagination.js +22 -0
  47. package/dist/plus-199fb2a8.js +5 -0
  48. package/dist/popover.js +80 -0
  49. package/dist/prevPage-87faf576.js +6 -0
  50. package/dist/radio-62546efa.js +76 -0
  51. package/dist/radio.js +9 -0
  52. package/dist/selection-9124d029.js +38 -0
  53. package/dist/selection.js +10 -0
  54. package/dist/sidePanel.js +88 -0
  55. package/dist/sortable.js +160 -0
  56. package/dist/spinLoader-c4a53718.js +11 -0
  57. package/dist/spinLoader.js +7 -0
  58. package/dist/success-8fd8bd2c.js +7 -0
  59. package/dist/systemAlert.js +69 -0
  60. package/dist/systemMessage-924fdaa6.js +30 -0
  61. package/dist/systemMessage.js +7 -0
  62. package/dist/table-c172f35e.js +504 -0
  63. package/dist/table.js +15 -0
  64. package/dist/themeProvider-46c2be7b.js +23 -0
  65. package/dist/themeProvider.js +7 -0
  66. package/dist/toggle-304107fa.js +59 -0
  67. package/dist/toggle.js +9 -0
  68. package/dist/tooltip.js +103 -0
  69. package/dist/tree-c3dd3d45.js +6 -0
  70. package/dist/xls-995781cc.js +11 -0
  71. package/package.json +8 -6
  72. package/dist/adaptiveTagList.cjs +0 -1
  73. package/dist/attachedFile.cjs +0 -1
  74. package/dist/autocompletes.cjs +0 -1
  75. package/dist/baseIconButton-263e74dc.js +0 -1
  76. package/dist/baseIconButton.cjs +0 -1
  77. package/dist/bind-29baac98.js +0 -5
  78. package/dist/breadcrumbs-a11e7e56.js +0 -1
  79. package/dist/breadcrumbs.cjs +0 -1
  80. package/dist/bubblesLoader-98fdf0af.js +0 -1
  81. package/dist/bubblesLoader.cjs +0 -1
  82. package/dist/button-8456d133.js +0 -1
  83. package/dist/button.cjs +0 -1
  84. package/dist/calendarArrow-6c6d9356.js +0 -1
  85. package/dist/checkbox-d4cc648d.js +0 -1
  86. package/dist/checkbox.cjs +0 -1
  87. package/dist/chevronDownDropdown-6196562c.js +0 -1
  88. package/dist/clear-07e1c174.js +0 -1
  89. package/dist/close-82e2e274.js +0 -1
  90. package/dist/datePicker-245e845d.js +0 -1
  91. package/dist/datePicker.cjs +0 -1
  92. package/dist/dropdown-b56964c6.js +0 -1
  93. package/dist/dropdown-fa4cd19c.js +0 -1
  94. package/dist/dropdown.cjs +0 -1
  95. package/dist/fieldLabel.cjs +0 -1
  96. package/dist/fieldNumber-9fe044df.js +0 -1
  97. package/dist/fieldNumber.cjs +0 -1
  98. package/dist/fieldText-2af0d7db.js +0 -1
  99. package/dist/fieldText.cjs +0 -1
  100. package/dist/fieldTextFlex-c26b190d.js +0 -1
  101. package/dist/fieldTextFlex.cjs +0 -1
  102. package/dist/fileDropArea.cjs +0 -1
  103. package/dist/filterOutline-5f3f8591.js +0 -1
  104. package/dist/filtersButton.cjs +0 -1
  105. package/dist/floatingUi-97183bba.js +0 -1
  106. package/dist/icons.cjs +0 -1
  107. package/dist/index-4c0424bf.js +0 -1
  108. package/dist/index.cjs +0 -1
  109. package/dist/isEmpty-fe949e63.js +0 -1
  110. package/dist/keyCodes-b188a920.js +0 -1
  111. package/dist/maxValueDisplay-68f1f114.js +0 -1
  112. package/dist/maxValueDisplay.cjs +0 -1
  113. package/dist/minus-0debd2c6.js +0 -1
  114. package/dist/modal.cjs +0 -1
  115. package/dist/openEye-737c72d6.js +0 -1
  116. package/dist/pagination-fc5189f7.js +0 -1
  117. package/dist/pagination.cjs +0 -1
  118. package/dist/plus-b12abe9f.js +0 -1
  119. package/dist/popover.cjs +0 -1
  120. package/dist/prevPage-063b5d63.js +0 -1
  121. package/dist/radio-aba4677b.js +0 -1
  122. package/dist/radio.cjs +0 -1
  123. package/dist/selection-49b927d0.js +0 -1
  124. package/dist/selection.cjs +0 -1
  125. package/dist/sidePanel.cjs +0 -1
  126. package/dist/sortable.cjs +0 -1
  127. package/dist/spinLoader-9ebd776a.js +0 -1
  128. package/dist/spinLoader.cjs +0 -1
  129. package/dist/success-823e5446.js +0 -1
  130. package/dist/systemAlert.cjs +0 -1
  131. package/dist/systemMessage-1ae2764d.js +0 -1
  132. package/dist/systemMessage.cjs +0 -1
  133. package/dist/table-cd9f0ff3.js +0 -1
  134. package/dist/table.cjs +0 -1
  135. package/dist/themeProvider-4dfafca5.js +0 -1
  136. package/dist/themeProvider.cjs +0 -1
  137. package/dist/toggle-359b70d4.js +0 -1
  138. package/dist/toggle.cjs +0 -1
  139. package/dist/tooltip.cjs +0 -1
  140. package/dist/tree-4610ac42.js +0 -1
  141. package/dist/xls-3ed747b0.js +0 -1
@@ -0,0 +1,779 @@
1
+ import { jsx as o, jsxs as $, Fragment as ce } from "react/jsx-runtime";
2
+ import { useState as re, useRef as xe, useEffect as ke, useCallback as V, forwardRef as Ae } from "react";
3
+ import { c as G } from "./bind-06a7ff84.js";
4
+ import { Scrollbars as $e } from "rc-scrollbars";
5
+ import { B as Pe } from "./bubblesLoader-f3ffa240.js";
6
+ import { B as Oe } from "./button-97d9e587.js";
7
+ import { S as je } from "./plus-199fb2a8.js";
8
+ import { i as he } from "./isEmpty-ccacb5ff.js";
9
+ import le from "downshift";
10
+ import { useFloating as Ie, autoUpdate as Ce } from "@floating-ui/react";
11
+ import { F as ze } from "./fieldText-1749da7a.js";
12
+ import { S as Se } from "./dropdown-0260bb66.js";
13
+ import { S as He } from "./close-4d480ef7.js";
14
+ import { S as We } from "./clear-53660571.js";
15
+ import "./openEye-950159cb.js";
16
+ import "./baseIconButton-251479f7.js";
17
+ import "./spinLoader-c4a53718.js";
18
+ import "./maxValueDisplay-9be01a75.js";
19
+ import "./fieldLabel.js";
20
+ const Le = "_disabled_1rpph_43", Ke = "_input_1rpph_107", Te = {
21
+ "selected-item": "_selected-item_1rpph_16",
22
+ "validation-error": "_validation-error_1rpph_35",
23
+ "highlight-un-stored-item": "_highlight-un-stored-item_1rpph_40",
24
+ disabled: Le,
25
+ "mobile-disabled": "_mobile-disabled_1rpph_48",
26
+ "selected-item-text": "_selected-item-text_1rpph_54",
27
+ "single-line": "_single-line_1rpph_58",
28
+ "cross-icon": "_cross-icon_1rpph_64",
29
+ input: Ke
30
+ }, ne = G.bind(Te), Ye = (t) => t.scrollWidth > t.clientWidth, Xe = ({
31
+ item: t,
32
+ onRemoveItem: e,
33
+ disabled: c = !1,
34
+ mobileDisabled: r = !1,
35
+ parseValueToString: n,
36
+ error: d = !1,
37
+ editItem: v,
38
+ editable: p = !1,
39
+ getAdditionalCreationCondition: g = () => !0,
40
+ storedOption: N = !0,
41
+ highlightUnStoredItem: f = !1,
42
+ variant: k = "light",
43
+ getItemName: x,
44
+ singleLine: u = !1,
45
+ className: R,
46
+ textClassName: I
47
+ }) => {
48
+ const [y, b] = re(!1), [C, B] = re(""), [l, a] = re(!1), s = xe(null), i = () => {
49
+ !c && p && !N && (B((x == null ? void 0 : x(t)) || (n == null ? void 0 : n(t)) || ""), b(!0));
50
+ }, _ = (S) => {
51
+ B(S.target.value);
52
+ }, O = (S) => {
53
+ const j = g(C);
54
+ S.key === "Enter" && j && (v(t, C), b(!1), B(""));
55
+ }, H = () => {
56
+ b(!1), B("");
57
+ }, P = (S) => {
58
+ S.stopPropagation(), e(t);
59
+ }, W = (n == null ? void 0 : n(t)) || "";
60
+ ke(() => {
61
+ if (s.current && u) {
62
+ const S = () => {
63
+ s.current && a(Ye(s.current));
64
+ };
65
+ if (S(), typeof ResizeObserver < "u") {
66
+ const j = new ResizeObserver(S);
67
+ return j.observe(s.current), () => j.disconnect();
68
+ }
69
+ } else
70
+ a(!1);
71
+ }, [W, u]);
72
+ const J = ne(
73
+ "selected-item-text",
74
+ {
75
+ "single-line": u
76
+ },
77
+ I
78
+ ), te = ne(
79
+ "selected-item",
80
+ k,
81
+ {
82
+ [`validation-${d}`]: d,
83
+ disabled: c,
84
+ "mobile-disabled": r,
85
+ "highlight-un-stored-item": f && !N
86
+ },
87
+ R
88
+ );
89
+ return y ? /* @__PURE__ */ o(
90
+ "input",
91
+ {
92
+ autoFocus: !0,
93
+ value: C,
94
+ onChange: _,
95
+ onKeyDown: O,
96
+ onBlur: H,
97
+ className: ne("input")
98
+ }
99
+ ) : /* @__PURE__ */ $("div", { className: te, onClick: i, children: [
100
+ /* @__PURE__ */ o(
101
+ "span",
102
+ {
103
+ ref: s,
104
+ className: J,
105
+ title: u && l ? W : void 0,
106
+ children: W
107
+ }
108
+ ),
109
+ !c && /* @__PURE__ */ o(
110
+ "button",
111
+ {
112
+ type: "button",
113
+ className: ne("cross-icon", {
114
+ [`validation-${d}`]: d,
115
+ "mobile-disabled": r,
116
+ disabled: c
117
+ }),
118
+ onClick: P,
119
+ children: /* @__PURE__ */ o(He, {})
120
+ }
121
+ )
122
+ ] });
123
+ }, Ge = ({
124
+ items: t = [],
125
+ parseValueToString: e,
126
+ getItemValidationErrorType: c,
127
+ storedItemsMap: r = {},
128
+ highlightUnStoredItem: n = !1,
129
+ renderCustomSelectedItem: d,
130
+ selectedItemSingleLine: v,
131
+ selectedItemClassName: p,
132
+ selectedItemTextClassName: g,
133
+ ...N
134
+ }) => t.map((f) => d ? d(f) : /* @__PURE__ */ o(
135
+ Xe,
136
+ {
137
+ parseValueToString: e,
138
+ error: (c == null ? void 0 : c(f)) || "",
139
+ item: f,
140
+ storedOption: !!r[e(f)],
141
+ highlightUnStoredItem: n,
142
+ singleLine: v,
143
+ className: p,
144
+ textClassName: g,
145
+ ...N
146
+ },
147
+ e == null ? void 0 : e(f)
148
+ )), Je = "_prompt_1xfmd_16", Qe = {
149
+ prompt: Je
150
+ }, Ze = G.bind(Qe), Ue = ({ children: t = null }) => /* @__PURE__ */ o("div", { className: Ze("prompt"), children: t }), Ve = "_item_1qhaq_16", et = "_divider_1qhaq_24", tt = "_active_1qhaq_48", st = "_value_1qhaq_60", ot = "_tag_1qhaq_78", nt = "_disabled_1qhaq_89", rt = {
151
+ item: Ve,
152
+ divider: et,
153
+ "new-item": "_new-item_1qhaq_31",
154
+ active: tt,
155
+ value: st,
156
+ "key-variant": "_key-variant_1qhaq_75",
157
+ tag: ot,
158
+ "button-active": "_button-active_1qhaq_89",
159
+ disabled: nt,
160
+ "value-variant": "_value-variant_1qhaq_109"
161
+ }, ee = G.bind(rt), ye = ({
162
+ isActive: t = !1,
163
+ isSelected: e = !1,
164
+ isNew: c = !1,
165
+ children: r = null,
166
+ disabled: n = !1,
167
+ optionVariant: d = "",
168
+ newItemButtonText: v = "",
169
+ ...p
170
+ }) => {
171
+ const g = () => v || (d === "key-variant" ? "New key" : "New value");
172
+ return c ? /* @__PURE__ */ $(ce, { children: [
173
+ /* @__PURE__ */ o("div", { className: ee("divider") }),
174
+ /* @__PURE__ */ $(
175
+ "li",
176
+ {
177
+ className: ee("new-item", d, {
178
+ active: t,
179
+ selected: e,
180
+ disabled: n
181
+ }),
182
+ ...p,
183
+ children: [
184
+ /* @__PURE__ */ o("span", { className: ee("value"), children: r }),
185
+ /* @__PURE__ */ o(
186
+ Oe,
187
+ {
188
+ ...!n && p,
189
+ className: ee({ "button-active": t }),
190
+ icon: /* @__PURE__ */ o(je, {}),
191
+ variant: "text",
192
+ children: g()
193
+ }
194
+ )
195
+ ]
196
+ }
197
+ )
198
+ ] }) : /* @__PURE__ */ o(
199
+ "li",
200
+ {
201
+ className: ee("item", d, {
202
+ active: t,
203
+ selected: e,
204
+ disabled: n
205
+ }),
206
+ ...n ? {} : p,
207
+ children: /* @__PURE__ */ o("span", { className: ee("label", "tag"), children: r })
208
+ }
209
+ );
210
+ }, lt = "_container_5088x_16", at = {
211
+ container: lt,
212
+ "empty-list-message": "_empty-list-message_5088x_20"
213
+ }, _e = G.bind(at), ct = (t) => {
214
+ const {
215
+ options: e,
216
+ async: c,
217
+ inputValue: r,
218
+ loading: n,
219
+ createWithoutConfirmation: d,
220
+ customEmptyListMessage: v,
221
+ customNoMatchesMessage: p,
222
+ optionVariant: g,
223
+ newItemButtonText: N,
224
+ renderOption: f,
225
+ getUniqKey: k,
226
+ getItemProps: x,
227
+ parseValueToString: u
228
+ } = t, R = V(() => (e || []).filter((s) => u(s).toUpperCase().indexOf((r.toUpperCase() || "").trim()) > -1), [r, e, u]), I = V(
229
+ (s, i, _ = !1) => f ? f(s, i, _, x) : /* @__PURE__ */ o(
230
+ ye,
231
+ {
232
+ optionVariant: g,
233
+ ...x({ item: s, index: i }),
234
+ isNew: _,
235
+ newItemButtonText: N,
236
+ children: u(s)
237
+ },
238
+ (k == null ? void 0 : k(s)) || u(s)
239
+ ),
240
+ [x, k, N, g, u, f]
241
+ ), y = V(
242
+ (s) => s.length ? s.map((i, _) => I(i, _)) : "",
243
+ [I]
244
+ ), b = V(
245
+ (s) => {
246
+ const i = s.length;
247
+ return /* @__PURE__ */ o("div", { className: _e({ container: !i }), children: /* @__PURE__ */ o(
248
+ ye,
249
+ {
250
+ optionVariant: g,
251
+ isNew: !0,
252
+ ...x({ item: r, index: i }),
253
+ children: u(r)
254
+ },
255
+ u(r)
256
+ ) });
257
+ },
258
+ [x, r, g, u]
259
+ ), C = V(
260
+ (s) => n ? /* @__PURE__ */ $(ce, { children: [
261
+ /* @__PURE__ */ o(Ue, { children: /* @__PURE__ */ o(Pe, {}) }),
262
+ !d && b(s)
263
+ ] }) : "",
264
+ [d, n, b]
265
+ ), B = V(() => {
266
+ const s = (e == null ? void 0 : e.length) === 0 ? v || "No available options" : p || "No matches found";
267
+ return /* @__PURE__ */ o("div", { className: _e("empty-list-message"), children: s });
268
+ }, [v, p, e == null ? void 0 : e.length]), l = c ? e : R(), a = C(e);
269
+ return a || /* @__PURE__ */ $("div", { className: _e({ container: e.length }), children: [
270
+ /* @__PURE__ */ o($e, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: he(l) ? B() : y(l) }),
271
+ !d && b(l)
272
+ ] });
273
+ }, it = "_menu_f64z5_16", dt = "_opened_f64z5_34", ut = "_dark_f64z5_37", mt = {
274
+ menu: it,
275
+ opened: dt,
276
+ dark: ut
277
+ }, ft = G.bind(mt), pt = (t, e) => !t || t <= e.trim().length, Ee = Ae(
278
+ ({
279
+ isOpen: t = !1,
280
+ style: e = {},
281
+ minLength: c = 1,
282
+ isDropdownMode: r,
283
+ inputValue: n = "",
284
+ className: d = "",
285
+ ...v
286
+ }, p) => /* @__PURE__ */ o(
287
+ "ul",
288
+ {
289
+ ref: p,
290
+ className: ft(
291
+ "menu",
292
+ { opened: t && (r || pt(c, n)) },
293
+ d
294
+ ),
295
+ style: e,
296
+ children: /* @__PURE__ */ o(ct, { inputValue: n, ...v })
297
+ }
298
+ )
299
+ ), we = (t, e) => typeof t == "string" ? t : e ? String(t[e(t)]) : "", ae = (t, e) => {
300
+ var r;
301
+ return t === e ? !0 : !!(t && e && typeof t == "object" && typeof e == "object" && Object.keys(t).length === Object.keys(e).length && ((r = Object.entries(t)) != null && r.every(([n, d]) => ae(d, e[n]))));
302
+ }, _t = (t, e, c) => typeof t == "string" ? t === e : c ? (() => {
303
+ const r = c(t);
304
+ return t[r] === e[r];
305
+ })() : !1, ht = ({
306
+ options: t = [],
307
+ onChange: e,
308
+ selectedItems: c = [],
309
+ handleUnStoredItemCb: r = null,
310
+ existingItemsMap: n = {},
311
+ children: d,
312
+ customizeNewSelectedValue: v = (f) => f,
313
+ getOptionUniqKey: p,
314
+ getOptionUniqKeyValue: g,
315
+ ...N
316
+ }) => {
317
+ const [f, k] = re(n), x = (l, a) => {
318
+ const s = {
319
+ ...f
320
+ };
321
+ l.forEach((i) => {
322
+ if (t.find((_) => _t(_, i, p))) {
323
+ const _ = we(i, p);
324
+ s[_] = !0;
325
+ }
326
+ }), k(s), a(s);
327
+ }, u = (l, a) => {
328
+ const s = we(l, p);
329
+ if (s in f) {
330
+ const i = { ...f };
331
+ delete i[s], k(i), a(i);
332
+ } else
333
+ a(f);
334
+ }, R = (l, a) => {
335
+ const s = v(l), i = Array.isArray(s) ? s : [s], O = [...c.filter((P) => i.indexOf(P) < 0), ...i];
336
+ e == null || e(O, a), x(i, (P) => r == null ? void 0 : r(O, P));
337
+ }, I = (l, a) => {
338
+ const s = c.indexOf(l), i = [...c];
339
+ i.splice(s, 1, a), e == null || e(i, null);
340
+ }, y = (l, a) => {
341
+ const s = c.filter((_) => !ae(_, l));
342
+ e == null || e(s, a), u(l, (_) => r == null ? void 0 : r(s, _));
343
+ }, b = (l, a) => {
344
+ l && R(l, a);
345
+ }, C = (l) => ({
346
+ removeItem: y,
347
+ editItem: I,
348
+ handleChange: e,
349
+ getOptionUniqKeyValue: g,
350
+ storedItemsMap: f,
351
+ ...l
352
+ });
353
+ return /* @__PURE__ */ o(
354
+ le,
355
+ {
356
+ ...N,
357
+ stateReducer: (l, a) => {
358
+ switch (a.type) {
359
+ case le.stateChangeTypes.keyDownEnter:
360
+ case le.stateChangeTypes.clickItem:
361
+ return {
362
+ ...a,
363
+ highlightedIndex: l.highlightedIndex,
364
+ inputValue: ""
365
+ };
366
+ default:
367
+ return a;
368
+ }
369
+ },
370
+ onChange: b,
371
+ selectedItem: null,
372
+ children: (l) => d == null ? void 0 : d(C(l))
373
+ }
374
+ );
375
+ }, Re = "Enter", bt = "Tab", vt = "_autocomplete_1so4a_16", gt = "_disabled_1so4a_32", yt = "_error_1so4a_35", wt = "_touched_1so4a_35", Nt = "_input_1so4a_77", xt = {
376
+ autocomplete: vt,
377
+ "autocomplete-wrapper": "_autocomplete-wrapper_1so4a_28",
378
+ disabled: gt,
379
+ error: yt,
380
+ touched: wt,
381
+ "clear-icon": "_clear-icon_1so4a_46",
382
+ "clear-icon--disabled": "_clear-icon--disabled_1so4a_56",
383
+ "autocomplete-input": "_autocomplete-input_1so4a_60",
384
+ "single-line-mode": "_single-line-mode_1so4a_68",
385
+ "mobile-disabled": "_mobile-disabled_1so4a_72",
386
+ input: Nt,
387
+ "type-number": "_type-number_1so4a_101",
388
+ "error-text": "_error-text_1so4a_112",
389
+ "dropdown-button": "_dropdown-button_1so4a_121",
390
+ "icon-reversed": "_icon-reversed_1so4a_129"
391
+ }, X = G.bind(xt), Yt = (t) => {
392
+ const {
393
+ options: e = [],
394
+ loading: c = !1,
395
+ onStateChange: r = () => {
396
+ },
397
+ value: n = [],
398
+ placeholder: d = "",
399
+ error: v = "",
400
+ touched: p = !1,
401
+ creatable: g = !1,
402
+ editable: N = !1,
403
+ onChange: f = () => {
404
+ },
405
+ onFocus: k = () => {
406
+ },
407
+ onBlur: x = () => {
408
+ },
409
+ disabled: u = !1,
410
+ isDropdownMode: R = !1,
411
+ mobileDisabled: I = !1,
412
+ inputProps: y = {},
413
+ parseValueToString: b = (h) => h == null ? "" : String(h),
414
+ maxLength: C = null,
415
+ async: B = !1,
416
+ customClass: l = "",
417
+ createWithoutConfirmation: a = !1,
418
+ getItemValidationErrorType: s = null,
419
+ clearItemsError: i = () => {
420
+ },
421
+ getAdditionalCreationCondition: _ = () => !0,
422
+ highlightUnStoredItem: O = !1,
423
+ parseInputValueFn: H = null,
424
+ handleUnStoredItemCb: P = null,
425
+ dataAutomationId: W = "",
426
+ existingItemsMap: J = {},
427
+ customizeNewSelectedValue: te = (h) => h,
428
+ renderCustomSelectedItem: S,
429
+ useFixedPositioning: j,
430
+ newItemButtonText: D = "",
431
+ menuClassName: L = "",
432
+ selectedItemSingleLine: K,
433
+ selectedItemClassName: T,
434
+ selectedItemTextClassName: Q,
435
+ ...M
436
+ } = t, { refs: Z, floatingStyles: ie } = Ie({
437
+ placement: "bottom-start",
438
+ strategy: j ? "fixed" : "absolute",
439
+ whileElementsMounted: Ce
440
+ }), de = n.length === 0 && !u ? d : "", z = xe(null);
441
+ ke(() => {
442
+ i();
443
+ }, [i, n]);
444
+ const oe = (h, w) => {
445
+ f(h, w);
446
+ }, ue = (h, w, E) => ({ item: m, index: q, ...A }) => h({
447
+ item: m,
448
+ index: q,
449
+ isSelected: E.some((U) => ae(U, m)),
450
+ ...A,
451
+ isActive: w === q
452
+ }), me = ({
453
+ event: h,
454
+ removeItem: w,
455
+ inputValue: E
456
+ }) => {
457
+ h.key === "Backspace" && !E && n.length && w(n[n.length - 1], null);
458
+ }, Y = ({
459
+ inputValue: h,
460
+ selectItem: w,
461
+ clearSelection: E
462
+ }) => {
463
+ if (H) {
464
+ const m = H(h);
465
+ (m.length ? m : [h]).forEach((A) => w(A)), E();
466
+ } else
467
+ w(h), E();
468
+ }, fe = (h) => (w) => {
469
+ h(w, null), z.current && z.current.focus();
470
+ }, pe = e.filter((h) => n.every((w) => !ae(w, h)));
471
+ return /* @__PURE__ */ o(
472
+ ht,
473
+ {
474
+ onChange: oe,
475
+ itemToString: b,
476
+ selectedItems: n,
477
+ onStateChange: r,
478
+ options: e,
479
+ existingItemsMap: J,
480
+ handleUnStoredItemCb: P,
481
+ customizeNewSelectedValue: te,
482
+ children: ({
483
+ getInputProps: h,
484
+ getItemProps: w,
485
+ isOpen: E,
486
+ inputValue: m = "",
487
+ highlightedIndex: q,
488
+ removeItem: A,
489
+ editItem: U,
490
+ openMenu: se,
491
+ selectItem: be,
492
+ clearSelection: ve,
493
+ toggleMenu: Be,
494
+ storedItemsMap: De,
495
+ getRootProps: Fe
496
+ }) => {
497
+ const ge = Fe(void 0, { suppressRefError: !0 }), Me = {
498
+ ...ge,
499
+ ref: (F) => (Z.setReference(F), ge.ref(F))
500
+ }, qe = m ?? "";
501
+ return /* @__PURE__ */ $("div", { ...Me, className: X("autocomplete-wrapper"), children: [
502
+ /* @__PURE__ */ $(ce, { children: [
503
+ /* @__PURE__ */ $(
504
+ "div",
505
+ {
506
+ className: X("autocomplete", l, {
507
+ "mobile-disabled": I,
508
+ error: v,
509
+ touched: p,
510
+ disabled: u
511
+ }),
512
+ children: [
513
+ /* @__PURE__ */ $(
514
+ "div",
515
+ {
516
+ className: X("autocomplete-input", {
517
+ "mobile-disabled": I,
518
+ "single-line-mode": K
519
+ }),
520
+ children: [
521
+ /* @__PURE__ */ o(
522
+ Ge,
523
+ {
524
+ items: n,
525
+ onRemoveItem: fe(A),
526
+ disabled: u,
527
+ mobileDisabled: I,
528
+ parseValueToString: b,
529
+ getItemValidationErrorType: s,
530
+ renderCustomSelectedItem: S,
531
+ editItem: U,
532
+ editable: N,
533
+ getAdditionalCreationCondition: _,
534
+ storedItemsMap: De,
535
+ highlightUnStoredItem: O,
536
+ selectedItemSingleLine: K,
537
+ selectedItemClassName: T,
538
+ selectedItemTextClassName: Q
539
+ }
540
+ ),
541
+ /* @__PURE__ */ o(
542
+ "input",
543
+ {
544
+ ...h({
545
+ ref: z,
546
+ placeholder: de,
547
+ maxLength: C,
548
+ onFocus: () => {
549
+ R && se(), k();
550
+ },
551
+ onKeyDown: (F) => {
552
+ F.key === Re && m && g && _(m) && Y({
553
+ inputValue: m,
554
+ selectItem: be,
555
+ clearSelection: ve
556
+ }), me({ event: F, removeItem: A, inputValue: m });
557
+ },
558
+ onBlur: () => {
559
+ x(), m && g && _(m) && Y({
560
+ inputValue: m,
561
+ selectItem: be,
562
+ clearSelection: ve
563
+ });
564
+ },
565
+ disabled: u,
566
+ ...y
567
+ }),
568
+ className: X("input", { disabled: u }),
569
+ "data-automation-id": W
570
+ }
571
+ )
572
+ ]
573
+ }
574
+ ),
575
+ (y == null ? void 0 : y.clearable) && !he(n) && /* @__PURE__ */ o(
576
+ "button",
577
+ {
578
+ type: "button",
579
+ className: X("clear-icon", { "clear-icon--disabled": u }),
580
+ onClick: () => {
581
+ var F;
582
+ return !u && ((F = y == null ? void 0 : y.onClear) == null ? void 0 : F.call(y));
583
+ },
584
+ onMouseDown: (F) => F.preventDefault(),
585
+ children: /* @__PURE__ */ o(We, {})
586
+ }
587
+ ),
588
+ R && /* @__PURE__ */ o(
589
+ "button",
590
+ {
591
+ type: "button",
592
+ className: X("dropdown-button", { "icon-reversed": E }),
593
+ onClick: () => Be(),
594
+ "aria-label": "Toggle dropdown",
595
+ "aria-expanded": E,
596
+ children: /* @__PURE__ */ o(Se, {})
597
+ }
598
+ )
599
+ ]
600
+ }
601
+ ),
602
+ v && p && /* @__PURE__ */ o("span", { className: X("error-text"), children: v })
603
+ ] }),
604
+ /* @__PURE__ */ o(
605
+ Ee,
606
+ {
607
+ isOpen: E,
608
+ loading: c,
609
+ async: B,
610
+ ref: Z.setFloating,
611
+ newItemButtonText: D,
612
+ isDropdownMode: R,
613
+ style: ie,
614
+ inputValue: qe.trim(),
615
+ getItemProps: ue(w, q, n),
616
+ parseValueToString: b,
617
+ createWithoutConfirmation: a,
618
+ options: pe,
619
+ className: L,
620
+ ...M
621
+ }
622
+ )
623
+ ] });
624
+ }
625
+ }
626
+ );
627
+ }, kt = {
628
+ "input-wrapper": "_input-wrapper_d9vma_1",
629
+ "dropdown-button": "_dropdown-button_d9vma_6",
630
+ "icon-reversed": "_icon-reversed_d9vma_14"
631
+ }, Ne = G.bind(kt), It = 0, Xt = (t) => {
632
+ const {
633
+ options: e = [],
634
+ value: c,
635
+ placeholder: r = "",
636
+ onChange: n = () => {
637
+ },
638
+ onFocus: d = () => {
639
+ },
640
+ onBlur: v = () => {
641
+ },
642
+ disabled: p = !1,
643
+ inputProps: g = {},
644
+ parseValueToString: N = (D) => D === null ? "" : String(D),
645
+ minLength: f = 1,
646
+ skipOptionCreation: k = !1,
647
+ maxLength: x = null,
648
+ optionVariant: u = "",
649
+ isRequired: R = !1,
650
+ error: I = "",
651
+ touched: y = !1,
652
+ setTouch: b = () => {
653
+ },
654
+ createWithoutConfirmation: C = !1,
655
+ menuClassName: B = "",
656
+ icon: l,
657
+ isDropdownMode: a = !1,
658
+ isOptionUnique: s,
659
+ refFunction: i,
660
+ stateReducer: _,
661
+ onStateChange: O,
662
+ useFixedPositioning: H,
663
+ newItemButtonText: P = "",
664
+ ...W
665
+ } = t, { refs: J, floatingStyles: te } = Ie({
666
+ placement: "bottom-start",
667
+ strategy: H ? "fixed" : "absolute",
668
+ whileElementsMounted: Ce
669
+ }), S = (D, L, K) => ({ item: T, index: Q, ...M }) => D({
670
+ item: T,
671
+ index: Q,
672
+ isSelected: K !== null && K === T,
673
+ ...M,
674
+ isActive: L === Q
675
+ }), j = (D, L) => {
676
+ D.key === bt && (D.preventDefault(), L(e.length));
677
+ };
678
+ return /* @__PURE__ */ o(
679
+ le,
680
+ {
681
+ onChange: n,
682
+ itemToString: N,
683
+ selectedItem: c,
684
+ onStateChange: O,
685
+ defaultHighlightedIndex: It,
686
+ stateReducer: _,
687
+ children: ({
688
+ getInputProps: D,
689
+ getItemProps: L,
690
+ setHighlightedIndex: K,
691
+ toggleMenu: T,
692
+ openMenu: Q,
693
+ isOpen: M,
694
+ inputValue: Z,
695
+ highlightedIndex: ie,
696
+ getRootProps: de,
697
+ selectItem: z
698
+ }) => {
699
+ const oe = de(void 0, { suppressRefError: !0 }), ue = {
700
+ ...oe,
701
+ ref: (m) => (J.setReference(m), oe.ref(m))
702
+ }, me = Z ?? "", { onClear: Y, clearable: fe, ...pe } = g, w = fe && c !== null, E = (...m) => {
703
+ z(null), Y == null || Y(...m);
704
+ };
705
+ return /* @__PURE__ */ o(ce, { children: /* @__PURE__ */ $("div", { className: Ne("input-wrapper"), ...ue, children: [
706
+ /* @__PURE__ */ o(
707
+ ze,
708
+ {
709
+ ...D({
710
+ placeholder: p ? "" : r,
711
+ maxLength: x || void 0,
712
+ onFocus: () => {
713
+ a && !M && (Q(), b == null || b(!0)), d();
714
+ },
715
+ ref: i,
716
+ onKeyDown: (m) => {
717
+ m.key === Re && m.preventDefault(), Z && M && j(m, K);
718
+ },
719
+ onBlur: (m) => {
720
+ const q = me.trim(), A = !he(q), U = A ? e.find((se) => N(se) === q) : void 0;
721
+ z(U || (!k && C && A ? q : null)), v(m), s == null || s(
722
+ A ? !e.some((se) => N(se) === q) : null
723
+ ), a && M && T(), b == null || b(!0);
724
+ },
725
+ disabled: p,
726
+ defaultWidth: !1,
727
+ isRequired: R,
728
+ touched: y,
729
+ error: I,
730
+ ...pe,
731
+ clearable: w,
732
+ onClear: w ? E : Y,
733
+ endIcon: a && !l ? /* @__PURE__ */ o(
734
+ "button",
735
+ {
736
+ type: "button",
737
+ className: Ne("dropdown-button", { "icon-reversed": M }),
738
+ onClick: () => T(),
739
+ "aria-label": "Toggle dropdown",
740
+ "aria-expanded": M,
741
+ children: /* @__PURE__ */ o(Se, {})
742
+ }
743
+ ) : l,
744
+ minLength: a ? 0 : f
745
+ })
746
+ }
747
+ ),
748
+ /* @__PURE__ */ o(
749
+ Ee,
750
+ {
751
+ isOpen: M,
752
+ isDropdownMode: a,
753
+ style: te,
754
+ ref: J.setFloating,
755
+ minLength: f,
756
+ inputValue: (Z || "").trim(),
757
+ getItemProps: S(L, ie, c),
758
+ parseValueToString: N,
759
+ optionVariant: u,
760
+ createWithoutConfirmation: C,
761
+ className: B,
762
+ options: e,
763
+ newItemButtonText: P,
764
+ ...W
765
+ }
766
+ )
767
+ ] }) });
768
+ }
769
+ }
770
+ );
771
+ };
772
+ export {
773
+ Ee as AutocompleteMenu,
774
+ ye as AutocompleteOption,
775
+ ct as AutocompleteOptions,
776
+ Ue as AutocompletePrompt,
777
+ Yt as MultipleAutocomplete,
778
+ Xt as SingleAutocomplete
779
+ };