@reportportal/ui-kit 0.0.1-alpha.67 → 0.0.1-alpha.69

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 (47) hide show
  1. package/dist/button-33bc880f.js +64 -0
  2. package/dist/button.js +1 -1
  3. package/dist/{checkbox-9a6c7ce1.js → checkbox-aa91985d.js} +15 -15
  4. package/dist/checkbox.js +1 -1
  5. package/dist/components/fieldLabel/fieldLabel.d.ts +2 -2
  6. package/dist/components/fieldNumber/fieldNumber.d.ts +2 -2
  7. package/dist/components/fieldTextFlex/fieldTextFlex.d.ts +2 -2
  8. package/dist/components/icons/index.d.ts +2 -0
  9. package/dist/{datePicker-06e90999.js → datePicker-382ef010.js} +57 -57
  10. package/dist/datePicker.js +6 -6
  11. package/dist/dropdown-13d7d50e.js +278 -0
  12. package/dist/dropdown.js +2 -2
  13. package/dist/fieldLabel.js +12 -7
  14. package/dist/fieldNumber-2542b311.js +128 -0
  15. package/dist/fieldNumber.js +2 -1
  16. package/dist/fieldText-e605a521.js +158 -0
  17. package/dist/fieldText.js +2 -2
  18. package/dist/fieldTextFlex-9e616f66.js +78 -0
  19. package/dist/fieldTextFlex.js +2 -1
  20. package/dist/fonts/OpenSans/OpenSans-Bold.ttf +0 -0
  21. package/dist/fonts/OpenSans/OpenSans-Medium.ttf +0 -0
  22. package/dist/icons.js +36 -34
  23. package/dist/index.js +53 -51
  24. package/dist/modal.js +81 -81
  25. package/dist/{pagination-91729c7d.js → pagination-ecbc9940.js} +53 -53
  26. package/dist/pagination.js +3 -3
  27. package/dist/popover.js +15 -15
  28. package/dist/{radio-bccc84f2.js → radio-62546efa.js} +27 -27
  29. package/dist/radio.js +1 -1
  30. package/dist/style.css +1 -1
  31. package/dist/systemAlert.js +28 -28
  32. package/dist/systemMessage-924fdaa6.js +30 -0
  33. package/dist/systemMessage.js +1 -1
  34. package/dist/table-20aa2cdf.js +142 -0
  35. package/dist/table.js +2 -2
  36. package/dist/toggle-304107fa.js +59 -0
  37. package/dist/toggle.js +1 -1
  38. package/dist/tooltip.js +15 -15
  39. package/package.json +1 -1
  40. package/dist/button-770f7b20.js +0 -64
  41. package/dist/dropdown-29285346.js +0 -278
  42. package/dist/fieldNumber-d81e551e.js +0 -125
  43. package/dist/fieldText-94e2c8eb.js +0 -158
  44. package/dist/fieldTextFlex-314741ad.js +0 -78
  45. package/dist/systemMessage-1ced6079.js +0 -30
  46. package/dist/table-02e40724.js +0 -142
  47. package/dist/toggle-1a3aacb5.js +0 -59
@@ -0,0 +1,278 @@
1
+ import { jsxs as f, jsx as d, Fragment as U } from "react/jsx-runtime";
2
+ import { forwardRef as _e, useState as q, useRef as he } from "react";
3
+ import { c as J } from "./bind-06a7ff84.js";
4
+ import { useFloating as fe, offset as ge, flip as pe } from "@floating-ui/react-dom";
5
+ import { useSelect as P } from "downshift";
6
+ import { Scrollbars as me } from "rc-scrollbars";
7
+ import { u as ue } from "./useOnClickOutside-c332f7d3.js";
8
+ import { K as p } from "./keyCodes-f63c0e11.js";
9
+ import { B as ye } from "./baseIconButton-251479f7.js";
10
+ import { S as be } from "./dropdown-0260bb66.js";
11
+ import { FieldLabel as xe } from "./fieldLabel.js";
12
+ import { C as Ce } from "./checkbox-aa91985d.js";
13
+ const Oe = "_disabled_1a01l_12", ke = "_hidden_1a01l_16", Ne = "_hover_1a01l_22", De = {
14
+ "dropdown-option": "_dropdown-option_1a01l_1",
15
+ disabled: Oe,
16
+ hidden: ke,
17
+ hover: Ne,
18
+ "single-option": "_single-option_1a01l_35",
19
+ "sub-option": "_sub-option_1a01l_42"
20
+ }, z = J.bind(De), G = _e(
21
+ (n, t) => {
22
+ const {
23
+ option: { value: r, disabled: i, hidden: E, label: m, title: c, groupRef: s },
24
+ selected: w,
25
+ onChange: u,
26
+ render: b,
27
+ highlightHovered: x,
28
+ onMouseEnter: v,
29
+ multiSelect: y,
30
+ isPartiallyChecked: C = !1
31
+ } = n, K = (O) => {
32
+ (O.target instanceof HTMLDivElement || O.target instanceof HTMLInputElement) && (u == null || u(r));
33
+ };
34
+ return /* @__PURE__ */ f(
35
+ "div",
36
+ {
37
+ className: z("dropdown-option", {
38
+ disabled: i,
39
+ hidden: E,
40
+ hover: x
41
+ }),
42
+ title: c,
43
+ onClick: K,
44
+ ref: t,
45
+ onMouseEnter: v,
46
+ children: [
47
+ y && /* @__PURE__ */ d(Ce, { value: !!w, partiallyChecked: C }),
48
+ /* @__PURE__ */ d("div", { className: z("single-option", { "sub-option": !!s }), children: b ? b(n) : m })
49
+ ]
50
+ }
51
+ );
52
+ }
53
+ ), Ee = [
54
+ p.ENTER_KEY_CODE,
55
+ p.SPACE_KEY_CODE,
56
+ p.ARROW_DOWN_KEY_CODE
57
+ ], we = [p.ESCAPE_KEY_CODE, p.TAB_KEY_CODE];
58
+ var g = /* @__PURE__ */ ((n) => (n.ON_KEY_DOWN = "onKeyDown", n.ON_CLICK = "onClick", n))(g || {});
59
+ const ve = (n, t) => {
60
+ const r = Array.isArray(t) ? t : [t];
61
+ return n.findIndex(({ value: i }) => r.includes(i));
62
+ }, Ke = (n, t) => (n % t + t) % t, Y = (n, t = 0, r = 1) => {
63
+ if (!n[t].disabled)
64
+ return t;
65
+ const i = n.length;
66
+ return Y(
67
+ n,
68
+ Ke(t + r, i),
69
+ r
70
+ );
71
+ }, Ae = (n, t) => Y(n, t), Ie = (n, t) => Y(n, t, -1), Pe = "_container_1xhk2_1", Ye = "_icon_1xhk2_7", Re = "_arrow_1xhk2_13", Te = "_dropdown_1xhk2_19", He = "_disabled_1xhk2_36", Me = "_value_1xhk2_43", We = "_error_1xhk2_46", Le = "_touched_1xhk2_46", Se = "_opened_1xhk2_50", je = "_placeholder_1xhk2_83", Ve = "_ghost_1xhk2_118", $e = "_divider_1xhk2_132", Ue = {
72
+ container: Pe,
73
+ icon: Ye,
74
+ arrow: Re,
75
+ dropdown: Te,
76
+ "transparent-background": "_transparent-background_1xhk2_33",
77
+ disabled: He,
78
+ value: Me,
79
+ error: We,
80
+ touched: Le,
81
+ opened: Se,
82
+ placeholder: je,
83
+ "mobile-disabled": "_mobile-disabled_1xhk2_87",
84
+ "select-list": "_select-list_1xhk2_92",
85
+ "limited-width": "_limited-width_1xhk2_109",
86
+ "options-container": "_options-container_1xhk2_113",
87
+ ghost: Ve,
88
+ divider: $e
89
+ }, o = J.bind(Ue), st = ({
90
+ multiSelect: n = !1,
91
+ value: t = n ? [] : "",
92
+ options: r = [],
93
+ disabled: i = !1,
94
+ error: E,
95
+ onChange: m,
96
+ onFocus: c,
97
+ onBlur: s,
98
+ mobileDisabled: w,
99
+ title: u,
100
+ touched: b = !1,
101
+ icon: x,
102
+ variant: v,
103
+ placeholder: y = "",
104
+ label: C = "",
105
+ renderOption: K,
106
+ transparentBackground: O = !1,
107
+ className: Q,
108
+ toggleButtonClassName: X,
109
+ isListWidthLimited: Z = !1,
110
+ optionAll: R = { value: "all", label: "All" },
111
+ isOptionAllVisible: T = !1,
112
+ onSelectAll: F = () => {
113
+ },
114
+ formatDisplayedValue: H,
115
+ notScrollable: B = !1,
116
+ footer: M
117
+ }) => {
118
+ const [_, h] = q(!1), W = he(null), [ee, k] = q(null), A = n && Array.isArray(t) ? r.filter((e) => t.includes(e.value)) : null, { refs: L, floatingStyles: te } = fe({
119
+ placement: "bottom-start",
120
+ middleware: [
121
+ ge(5),
122
+ pe({
123
+ fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"]
124
+ })
125
+ ]
126
+ }), ne = () => {
127
+ if (T && Array.isArray(t)) {
128
+ const e = r.map((a) => a.value);
129
+ m(t.length === r.length ? [] : e), F();
130
+ }
131
+ };
132
+ ue(W, () => {
133
+ _ && (h(!1), s == null || s());
134
+ });
135
+ const S = (e) => {
136
+ if (!e.disabled) {
137
+ if (n) {
138
+ const a = Array.isArray(t) ? [...t] : [], l = a.indexOf(e.value);
139
+ l === -1 ? a.push(e.value) : a.splice(l, 1), m(a);
140
+ } else
141
+ m(e.value);
142
+ h((a) => n || !a);
143
+ }
144
+ }, re = () => r.find(({ value: e }) => e === t), j = ve(r, t), {
145
+ getToggleButtonProps: ae,
146
+ getLabelProps: se,
147
+ getMenuProps: de,
148
+ getItemProps: le,
149
+ setHighlightedIndex: N,
150
+ highlightedIndex: V,
151
+ selectedItem: D
152
+ } = P({
153
+ items: r,
154
+ itemToString: (e) => (e != null && e.label ? String(e.label) : y) || "",
155
+ selectedItem: re(),
156
+ isOpen: _,
157
+ circularNavigation: !0,
158
+ defaultHighlightedIndex: j,
159
+ onHighlightedIndexChange: (e) => {
160
+ switch (e.type) {
161
+ case P.stateChangeTypes.MenuKeyDownArrowUp:
162
+ return k(g.ON_KEY_DOWN), N(Ie(r, e.highlightedIndex)), e;
163
+ case P.stateChangeTypes.MenuKeyDownArrowDown:
164
+ return k(g.ON_KEY_DOWN), N(Ae(r, e.highlightedIndex)), e;
165
+ default:
166
+ return e;
167
+ }
168
+ }
169
+ }), ie = () => {
170
+ i || (h((e) => !e), _ ? s == null || s() : c == null || c(), k(g.ON_CLICK));
171
+ }, I = (() => {
172
+ if (n && Array.isArray(t) && r.length === t.length)
173
+ return R.label;
174
+ const e = r.reduce((a, l) => ((Array.isArray(t) && t.includes(l.value) || l.value === t) && a.push(l.label), a), []);
175
+ if (e.length > 0)
176
+ return e.join(", ");
177
+ if (!t && t !== !1 && t !== 0 || Array.isArray(t) && !t.length)
178
+ return y;
179
+ })(), oe = (e) => {
180
+ const { keyCode: a } = e;
181
+ Ee.includes(a) && !_ && (e.preventDefault(), N(j), h(!0), c == null || c(), k(g.ON_KEY_DOWN));
182
+ }, ce = (e) => {
183
+ const { keyCode: a } = e;
184
+ if (a === p.ENTER_KEY_CODE) {
185
+ const l = r[V];
186
+ S(l), n || (h(!1), s == null || s());
187
+ return;
188
+ }
189
+ we.includes(a) && (e.stopPropagation(), h(!1), s == null || s());
190
+ }, $ = () => /* @__PURE__ */ f("div", { className: o("options-container"), children: [
191
+ n && T && Array.isArray(t) && /* @__PURE__ */ f(U, { children: [
192
+ /* @__PURE__ */ d(
193
+ G,
194
+ {
195
+ option: R,
196
+ selected: t.length === r.length,
197
+ onChange: ne,
198
+ multiSelect: n,
199
+ isPartiallyChecked: !!t.length
200
+ }
201
+ ),
202
+ /* @__PURE__ */ d("div", { className: o("divider") }),
203
+ " "
204
+ ] }),
205
+ r.map((e, a) => /* @__PURE__ */ d(
206
+ G,
207
+ {
208
+ ...le({
209
+ item: e,
210
+ index: a
211
+ }),
212
+ multiSelect: n,
213
+ selected: n ? A == null ? void 0 : A.some((l) => l.value === e.value) : e.value === ((D == null ? void 0 : D.value) ?? D),
214
+ option: { title: e.label, ...e },
215
+ highlightHovered: V === a && ee !== g.ON_CLICK,
216
+ render: K,
217
+ onChange: e.disabled ? null : () => S(e),
218
+ onMouseEnter: () => N(a)
219
+ },
220
+ e.value
221
+ )),
222
+ M && /* @__PURE__ */ f(U, { children: [
223
+ /* @__PURE__ */ d("div", { className: o("divider") }),
224
+ M
225
+ ] })
226
+ ] });
227
+ return /* @__PURE__ */ f("div", { ref: W, className: o("container", Q), title: u, children: [
228
+ C && /* @__PURE__ */ d(xe, { ...se(), children: C }),
229
+ /* @__PURE__ */ f(
230
+ "button",
231
+ {
232
+ disabled: i,
233
+ ...ae({
234
+ className: o("dropdown", v, X, {
235
+ "transparent-background": O,
236
+ opened: _,
237
+ disabled: i,
238
+ error: E,
239
+ touched: b,
240
+ "mobile-disabled": w
241
+ }),
242
+ onClick: ie,
243
+ onKeyDown: oe,
244
+ ref: L.setReference
245
+ }),
246
+ type: "button",
247
+ children: [
248
+ x && /* @__PURE__ */ d("span", { className: o("icon"), children: x }),
249
+ /* @__PURE__ */ d(
250
+ "span",
251
+ {
252
+ className: o("value", {
253
+ placeholder: I === y
254
+ }),
255
+ children: H ? H(I) : I
256
+ }
257
+ ),
258
+ /* @__PURE__ */ d(ye, { className: o("arrow"), tabIndex: -1, children: /* @__PURE__ */ d(be, {}) })
259
+ ]
260
+ }
261
+ ),
262
+ _ && /* @__PURE__ */ d(
263
+ "div",
264
+ {
265
+ style: te,
266
+ className: o("select-list", { opened: _, "limited-width": Z }),
267
+ ...de({
268
+ onKeyDown: ce,
269
+ ref: L.setFloating
270
+ }),
271
+ children: B ? $() : /* @__PURE__ */ d(me, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: $() })
272
+ }
273
+ )
274
+ ] });
275
+ };
276
+ export {
277
+ st as D
278
+ };
package/dist/dropdown.js CHANGED
@@ -1,4 +1,4 @@
1
- import { D as r } from "./dropdown-29285346.js";
1
+ import { D as r } from "./dropdown-13d7d50e.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "./bind-06a7ff84.js";
@@ -10,7 +10,7 @@ import "./keyCodes-f63c0e11.js";
10
10
  import "./baseIconButton-251479f7.js";
11
11
  import "./dropdown-0260bb66.js";
12
12
  import "./fieldLabel.js";
13
- import "./checkbox-9a6c7ce1.js";
13
+ import "./checkbox-aa91985d.js";
14
14
  export {
15
15
  r as Dropdown,
16
16
  r as default
@@ -1,10 +1,15 @@
1
- import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import { c as d } from "./bind-06a7ff84.js";
3
- const c = "_asterisk_1hktw_11", r = "_disabled_1hktw_17", o = {
4
- "field-label": "_field-label_1hktw_1",
5
- asterisk: c,
6
- disabled: r
7
- }, s = d.bind(o), _ = ({ children: e, isRequired: l = !1, ...a }) => /* @__PURE__ */ i("label", { className: s("field-label"), ...a, children: [
1
+ import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
+ import { c } from "./bind-06a7ff84.js";
3
+ const r = "_asterisk_10m6x_11", m = "_disabled_10m6x_17", o = {
4
+ "field-label": "_field-label_10m6x_1",
5
+ asterisk: r,
6
+ disabled: m
7
+ }, s = c.bind(o), _ = ({
8
+ children: e,
9
+ isRequired: l = !1,
10
+ className: a,
11
+ ...i
12
+ }) => /* @__PURE__ */ d("label", { className: s("field-label", a), ...i, children: [
8
13
  e,
9
14
  l && /* @__PURE__ */ t("span", { className: s("asterisk"), children: "*" })
10
15
  ] });
@@ -0,0 +1,128 @@
1
+ import { jsxs as K, 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 f } from "./baseIconButton-251479f7.js";
6
+ import { S as B, a as S } from "./plus-0929dda4.js";
7
+ import { FieldLabel as x } from "./fieldLabel.js";
8
+ const F = 5, p = 16, b = [
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
+ ], k = "_disabled_1wxs7_6", H = "_label_1wxs7_10", V = "_sign_1wxs7_21", P = "_error_1wxs7_36", j = "_touched_1wxs7_36", G = "_filled_1wxs7_44", X = "_input_1wxs7_26", $ = {
27
+ "field-number": "_field-number_1wxs7_1",
28
+ disabled: k,
29
+ label: H,
30
+ sign: V,
31
+ "input-container": "_input-container_1wxs7_26",
32
+ error: P,
33
+ touched: j,
34
+ filled: G,
35
+ "input-field": "_input-field_1wxs7_51",
36
+ input: X
37
+ }, c = y.bind($), e_ = ({
38
+ value: e = "",
39
+ placeholder: h = "0",
40
+ disabled: t = !1,
41
+ onChange: o,
42
+ onFocus: u,
43
+ onBlur: q,
44
+ label: O,
45
+ postfix: r = "",
46
+ min: l = 0,
47
+ max: E = Number.MAX_SAFE_INTEGER,
48
+ title: m,
49
+ error: N,
50
+ touched: Y = !1,
51
+ id: a,
52
+ ...w
53
+ }) => {
54
+ const C = T(null), D = I(), L = (n) => {
55
+ let s = n.target.value.replace(/^0(?=\d+|^\d)/g, "");
56
+ if (s === "") {
57
+ o("");
58
+ return;
59
+ }
60
+ s = +s, s >= l && s <= E && o(s);
61
+ }, M = (n) => {
62
+ const { keyCode: s } = n;
63
+ b.includes(s) || (s < _.NUMBER_START_KEY_CODE || s > _.NUMBER_END_KEY_CODE || n.shiftKey) && n.preventDefault();
64
+ }, R = () => {
65
+ const n = +e - 1;
66
+ n >= l && n <= E && o(n);
67
+ }, U = () => {
68
+ const n = +e + 1;
69
+ n >= l && n <= E && o(n);
70
+ }, d = h + r, A = W(() => {
71
+ let n = (String(e) || d).length;
72
+ return r && !e && (n += 1), n > p ? `${p}ch` : `${n || F}ch`;
73
+ }, [d, r, e]), g = () => {
74
+ C && C.current && C.current.focus(), u && u();
75
+ };
76
+ return /* @__PURE__ */ K("div", { className: c("field-number", { disabled: t }), children: [
77
+ O && /* @__PURE__ */ i(x, { htmlFor: a ?? D, children: O }),
78
+ /* @__PURE__ */ K(
79
+ "div",
80
+ {
81
+ className: c("input-container", {
82
+ filled: !!e || e === 0,
83
+ error: N,
84
+ disabled: t,
85
+ touched: Y
86
+ }),
87
+ title: m,
88
+ children: [
89
+ /* @__PURE__ */ i(
90
+ f,
91
+ {
92
+ className: c("sign", "minus"),
93
+ disabled: t,
94
+ onClick: R,
95
+ children: /* @__PURE__ */ i(B, {})
96
+ }
97
+ ),
98
+ /* @__PURE__ */ K("span", { className: c("input-field", { disabled: t }), onClick: g, children: [
99
+ /* @__PURE__ */ i(
100
+ "input",
101
+ {
102
+ id: a ?? D,
103
+ ref: C,
104
+ className: c("input"),
105
+ type: "number",
106
+ value: e,
107
+ placeholder: d,
108
+ disabled: t,
109
+ min: l,
110
+ max: E,
111
+ onKeyDown: t ? void 0 : M,
112
+ onChange: t ? void 0 : L,
113
+ onFocus: t ? void 0 : u,
114
+ style: { width: A },
115
+ ...w
116
+ }
117
+ ),
118
+ !!r && (e === 0 || !!e) && /* @__PURE__ */ i("span", { children: r.slice(0, 1) })
119
+ ] }),
120
+ /* @__PURE__ */ i(f, { className: c("sign", "plus"), disabled: t, onClick: U, children: /* @__PURE__ */ i(S, {}) })
121
+ ]
122
+ }
123
+ )
124
+ ] });
125
+ };
126
+ export {
127
+ e_ as F
128
+ };
@@ -1,10 +1,11 @@
1
- import { F as m } from "./fieldNumber-d81e551e.js";
1
+ import { F as m } from "./fieldNumber-2542b311.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "./bind-06a7ff84.js";
5
5
  import "./keyCodes-f63c0e11.js";
6
6
  import "./baseIconButton-251479f7.js";
7
7
  import "./plus-0929dda4.js";
8
+ import "./fieldLabel.js";
8
9
  export {
9
10
  m as FieldNumber,
10
11
  m as default
@@ -0,0 +1,158 @@
1
+ import { jsx as e, jsxs as a, Fragment as R } from "react/jsx-runtime";
2
+ import { forwardRef as Q, useRef as Y, useId as Z, useState as M } from "react";
3
+ import { c as q } from "./bind-06a7ff84.js";
4
+ import { b as ee, a as ne, S as te } from "./openEye-7b9cf080.js";
5
+ import { B as se } from "./button-33bc880f.js";
6
+ import { S as oe } from "./spinLoader-c4a53718.js";
7
+ import { M as ae } from "./maxValueDisplay-9be01a75.js";
8
+ import { FieldLabel as ce } from "./fieldLabel.js";
9
+ var o = /* @__PURE__ */ ((t) => (t.PASSWORD = "password", t.TEXT = "text", t.EMAIL = "email", t))(o || {});
10
+ const re = "_collapsed_1xyy3_13", ie = "_field_1xyy3_21", le = "_placeholder_1xyy3_46", de = "_disabled_1xyy3_49", _e = "_error_1xyy3_52", pe = "_touched_1xyy3_52", ye = "_input_1xyy3_70", ue = "_icon_1xyy3_1", xe = "_text_1xyy3_168", me = {
11
+ "icon-container": "_icon-container_1xyy3_1",
12
+ "icon-container-end": "_icon-container-end_1xyy3_1",
13
+ "icon-container-start": "_icon-container-start_1xyy3_1",
14
+ collapsed: re,
15
+ field: ie,
16
+ "default-width": "_default-width_1xyy3_33",
17
+ placeholder: le,
18
+ disabled: de,
19
+ error: _e,
20
+ touched: pe,
21
+ "max-length-display": "_max-length-display_1xyy3_59",
22
+ "input-container": "_input-container_1xyy3_70",
23
+ "type-password": "_type-password_1xyy3_74",
24
+ input: ye,
25
+ "eye-icon": "_eye-icon_1xyy3_78",
26
+ icon: ue,
27
+ "start-icon": "_start-icon_1xyy3_124",
28
+ "clear-icon": "_clear-icon_1xyy3_125",
29
+ "additional-content": "_additional-content_1xyy3_161",
30
+ text: xe,
31
+ "error-text": "_error-text_1xyy3_188",
32
+ "help-text": "_help-text_1xyy3_192"
33
+ }, n = q.bind(me), Fe = Q(
34
+ ({
35
+ value: t = "",
36
+ className: b,
37
+ classNameHelpText: v,
38
+ error: l,
39
+ placeholder: u,
40
+ disabled: c = !1,
41
+ onChange: A,
42
+ touched: x = !1,
43
+ title: O,
44
+ label: d,
45
+ helpText: _,
46
+ defaultWidth: B = !0,
47
+ startIcon: m,
48
+ endIcon: f,
49
+ clearable: C = !1,
50
+ onClear: h,
51
+ isRequired: N = !1,
52
+ hasDoubleMessage: L = !1,
53
+ type: r = o.TEXT,
54
+ displayError: V = !0,
55
+ collapsible: W = !1,
56
+ loading: k = !1,
57
+ maxLengthDisplay: X,
58
+ onFocus: j = () => {
59
+ },
60
+ onBlur: H = () => {
61
+ },
62
+ ...I
63
+ }, U) => {
64
+ const $ = Y(null), p = U || $, S = Z(), [w, g] = M(!1), [E, D] = M(!1), z = (s) => {
65
+ g(!0), j(s);
66
+ }, G = (s) => {
67
+ g(!1), H(s);
68
+ }, J = () => {
69
+ var s;
70
+ h && (h(t), (s = p.current) == null || s.focus());
71
+ }, F = V && l && x, T = /* @__PURE__ */ e("span", { className: n("text", "help-text", v), children: _ }), K = () => r !== o.PASSWORD ? r : E ? o.TEXT : o.PASSWORD, P = (s) => {
72
+ s.preventDefault(), D(!0);
73
+ }, i = (s) => {
74
+ s.preventDefault(), D(!1);
75
+ };
76
+ return /* @__PURE__ */ a(R, { children: [
77
+ d && /* @__PURE__ */ e(ce, { isRequired: N, htmlFor: S, children: d }),
78
+ /* @__PURE__ */ a(
79
+ "div",
80
+ {
81
+ className: n("field", b, {
82
+ error: l,
83
+ touched: x,
84
+ disabled: c,
85
+ "default-width": B,
86
+ collapsed: W && !w && !t
87
+ }),
88
+ title: O,
89
+ children: [
90
+ k ? /* @__PURE__ */ e(oe, {}) : m && /* @__PURE__ */ e(
91
+ "span",
92
+ {
93
+ className: n("icon-container-start"),
94
+ onClick: () => {
95
+ var y;
96
+ (y = p.current) == null || y.focus();
97
+ },
98
+ children: /* @__PURE__ */ e("span", { className: n("icon", { "start-icon": !w }), children: m })
99
+ }
100
+ ),
101
+ /* @__PURE__ */ a("span", { className: n("input-container", `type-${r}`), children: [
102
+ /* @__PURE__ */ e(
103
+ "input",
104
+ {
105
+ ref: p,
106
+ type: K(),
107
+ className: n("input"),
108
+ value: t,
109
+ disabled: c,
110
+ id: S,
111
+ onChange: A,
112
+ onFocus: z,
113
+ onBlur: G,
114
+ ...I
115
+ }
116
+ ),
117
+ r === o.PASSWORD && t && /* @__PURE__ */ e(
118
+ se,
119
+ {
120
+ icon: E ? /* @__PURE__ */ e(ee, {}) : /* @__PURE__ */ e(ne, {}),
121
+ variant: "text",
122
+ className: n("eye-icon"),
123
+ onMouseDown: P,
124
+ onMouseLeave: i,
125
+ onMouseUp: i,
126
+ onTouchStart: P,
127
+ onTouchEnd: i,
128
+ onTouchCancel: i
129
+ }
130
+ ),
131
+ u && !t && /* @__PURE__ */ a("span", { className: n("placeholder"), children: [
132
+ u,
133
+ N && !d && /* @__PURE__ */ e("span", { className: n("asterisk") })
134
+ ] })
135
+ ] }),
136
+ /* @__PURE__ */ e(
137
+ ae,
138
+ {
139
+ className: n("max-length-display"),
140
+ value: t.length,
141
+ maxValue: X
142
+ }
143
+ ),
144
+ f && /* @__PURE__ */ e("span", { className: n("icon-container-end"), children: /* @__PURE__ */ e("span", { className: n("icon"), children: f }) }),
145
+ C && t.length > 0 && /* @__PURE__ */ e("span", { className: n("icon-container-end"), children: /* @__PURE__ */ e("button", { type: "button", className: n("clear-icon", { disabled: c }), onClick: J, children: /* @__PURE__ */ e(te, {}) }) })
146
+ ]
147
+ }
148
+ ),
149
+ (F || _) && /* @__PURE__ */ e("div", { className: n("additional-content", { disabled: c }), children: F ? /* @__PURE__ */ a(R, { children: [
150
+ /* @__PURE__ */ e("span", { className: n("text", "error-text"), children: l }),
151
+ L && T
152
+ ] }) : _ && T })
153
+ ] });
154
+ }
155
+ );
156
+ export {
157
+ Fe as F
158
+ };
package/dist/fieldText.js CHANGED
@@ -1,9 +1,9 @@
1
- import { F as o } from "./fieldText-94e2c8eb.js";
1
+ import { F as o } from "./fieldText-e605a521.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "./bind-06a7ff84.js";
5
5
  import "./openEye-7b9cf080.js";
6
- import "./button-770f7b20.js";
6
+ import "./button-33bc880f.js";
7
7
  import "./spinLoader-c4a53718.js";
8
8
  import "./maxValueDisplay-9be01a75.js";
9
9
  import "./fieldLabel.js";