@reportportal/ui-kit 0.0.1-alpha.56 → 0.0.1-alpha.58

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,160 +0,0 @@
1
- import { jsx as e, jsxs as a, Fragment as F } from "react/jsx-runtime";
2
- import { forwardRef as K, useRef as Q, useState as E } from "react";
3
- import { c as W } from "./bind-06a7ff84.js";
4
- import { b as X, a as Y, S as Z } from "./openEye-7b9cf080.js";
5
- import { B as ee } from "./button-33c88abf.js";
6
- import { S as ne } from "./spinLoader-c4a53718.js";
7
- import { M as te } from "./maxValueDisplay-9be01a75.js";
8
- const se = "_collapsed_qkfmy_13", ae = "_label_qkfmy_21", oe = "_asterisk_qkfmy_30", ce = "_disabled_qkfmy_36", re = "_field_qkfmy_41", ie = "_placeholder_qkfmy_62", le = "_error_qkfmy_69", _e = "_touched_qkfmy_69", de = "_input_qkfmy_87", me = "_icon_qkfmy_1", fe = "_text_qkfmy_193", pe = {
9
- "icon-container": "_icon-container_qkfmy_1",
10
- "icon-container-end": "_icon-container-end_qkfmy_1",
11
- "icon-container-start": "_icon-container-start_qkfmy_1",
12
- collapsed: se,
13
- label: ae,
14
- asterisk: oe,
15
- disabled: ce,
16
- field: re,
17
- "default-width": "_default-width_qkfmy_53",
18
- placeholder: ie,
19
- error: le,
20
- touched: _e,
21
- "max-length-display": "_max-length-display_qkfmy_76",
22
- "input-container": "_input-container_qkfmy_87",
23
- "type-password": "_type-password_qkfmy_91",
24
- input: de,
25
- "eye-icon": "_eye-icon_qkfmy_95",
26
- icon: me,
27
- "start-icon": "_start-icon_qkfmy_149",
28
- "clear-icon": "_clear-icon_qkfmy_150",
29
- "additional-content": "_additional-content_qkfmy_186",
30
- text: fe,
31
- "error-text": "_error-text_qkfmy_212",
32
- "help-text": "_help-text_qkfmy_216"
33
- }, n = W.bind(pe), we = K(
34
- ({
35
- value: s = "",
36
- className: M,
37
- classNameHelpText: v,
38
- error: i,
39
- placeholder: f,
40
- disabled: o = !1,
41
- onChange: B,
42
- touched: p = !1,
43
- title: C,
44
- label: l,
45
- helpText: _,
46
- defaultWidth: D = !0,
47
- startIcon: u,
48
- endIcon: h,
49
- clearable: T = !1,
50
- onClear: y,
51
- isRequired: k = !1,
52
- hasDoubleMessage: V = !1,
53
- type: c = "text",
54
- displayError: P = !0,
55
- collapsible: R = !1,
56
- loading: j = !1,
57
- maxLengthDisplay: H,
58
- onFocus: L = () => {
59
- },
60
- onBlur: O = () => {
61
- },
62
- ...U
63
- }, $) => {
64
- const z = Q(null), d = $ || z, [q, x] = E(!1), [N, w] = E(!1), A = (t) => {
65
- x(!0), L(t);
66
- }, G = (t) => {
67
- x(!1), O(t);
68
- }, I = () => {
69
- var t;
70
- y && (y(s), (t = d.current) == null || t.focus());
71
- }, g = P && i && p, S = /* @__PURE__ */ e("span", { className: n("text", "help-text", v), children: _ }), J = () => c !== "password" ? c : N ? "text" : "password", b = (t) => {
72
- t.preventDefault(), w(!0);
73
- }, r = (t) => {
74
- t.preventDefault(), w(!1);
75
- };
76
- return /* @__PURE__ */ a(F, { children: [
77
- l && /* @__PURE__ */ a("span", { className: n("label", { disabled: o }), children: [
78
- l,
79
- k && /* @__PURE__ */ e("span", { className: n("asterisk"), children: "*" })
80
- ] }),
81
- /* @__PURE__ */ a(
82
- "div",
83
- {
84
- className: n("field", M, {
85
- error: i,
86
- touched: p,
87
- disabled: o,
88
- "default-width": D,
89
- collapsed: R && !q && !s
90
- }),
91
- title: C,
92
- children: [
93
- j ? /* @__PURE__ */ e(ne, {}) : u && /* @__PURE__ */ e(
94
- "span",
95
- {
96
- className: n("icon-container-start"),
97
- onClick: () => {
98
- var m;
99
- (m = d.current) == null || m.focus();
100
- },
101
- children: /* @__PURE__ */ e("span", { className: n("icon", { "start-icon": !q }), children: u })
102
- }
103
- ),
104
- /* @__PURE__ */ a("span", { className: n("input-container", `type-${c}`), children: [
105
- /* @__PURE__ */ e(
106
- "input",
107
- {
108
- ref: d,
109
- type: J(),
110
- className: n("input"),
111
- value: s,
112
- disabled: o,
113
- onChange: B,
114
- onFocus: A,
115
- onBlur: G,
116
- ...U
117
- }
118
- ),
119
- c === "password" && s && /* @__PURE__ */ e(
120
- ee,
121
- {
122
- icon: N ? /* @__PURE__ */ e(X, {}) : /* @__PURE__ */ e(Y, {}),
123
- variant: "text",
124
- className: n("eye-icon"),
125
- onMouseDown: b,
126
- onMouseLeave: r,
127
- onMouseUp: r,
128
- onTouchStart: b,
129
- onTouchEnd: r,
130
- onTouchCancel: r
131
- }
132
- ),
133
- f && !s && /* @__PURE__ */ a("span", { className: n("placeholder"), children: [
134
- f,
135
- k && !l && /* @__PURE__ */ e("span", { className: n("asterisk") })
136
- ] })
137
- ] }),
138
- /* @__PURE__ */ e(
139
- te,
140
- {
141
- className: n("max-length-display"),
142
- value: s.length,
143
- maxValue: H
144
- }
145
- ),
146
- h && /* @__PURE__ */ e("span", { className: n("icon-container-end"), children: /* @__PURE__ */ e("span", { className: n("icon"), children: h }) }),
147
- T && s.length > 0 && /* @__PURE__ */ e("span", { className: n("icon-container-end"), children: /* @__PURE__ */ e("button", { type: "button", className: n("clear-icon", { disabled: o }), onClick: I, children: /* @__PURE__ */ e(Z, {}) }) })
148
- ]
149
- }
150
- ),
151
- (g || _) && /* @__PURE__ */ e("div", { className: n("additional-content", { disabled: o }), children: g ? /* @__PURE__ */ a(F, { children: [
152
- /* @__PURE__ */ e("span", { className: n("text", "error-text"), children: i }),
153
- V && S
154
- ] }) : _ && S })
155
- ] });
156
- }
157
- );
158
- export {
159
- we as F
160
- };