@reportportal/ui-kit 0.0.1-alpha.70 → 0.0.1-alpha.72
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/dist/close-4d480ef7.js +5 -0
- package/dist/components/checkbox/checkbox.d.ts +1 -1
- package/dist/components/fieldText/fieldText.d.ts +2 -1
- package/dist/components/icons/index.d.ts +1 -0
- package/dist/{datePicker-382ef010.js → datePicker-e6c2c36d.js} +2 -2
- package/dist/datePicker.js +4 -4
- package/dist/dropdown-3c979474.js +278 -0
- package/dist/dropdown.js +1 -1
- package/dist/fieldText-450abb26.js +157 -0
- package/dist/fieldText.js +1 -1
- package/dist/icons.js +53 -52
- package/dist/index.js +62 -61
- package/dist/modal.js +1 -1
- package/dist/{pagination-ecbc9940.js → pagination-102c14bd.js} +1 -1
- package/dist/pagination.js +2 -2
- package/dist/style.css +1 -1
- package/dist/success-8fd8bd2c.js +7 -0
- package/dist/systemAlert.js +2 -2
- package/package.json +1 -1
- package/dist/close-4b33d7c1.js +0 -5
- package/dist/components/fieldText/types.d.ts +0 -5
- package/dist/dropdown-13d7d50e.js +0 -278
- package/dist/fieldText-e605a521.js +0 -158
- package/dist/success-dc1914aa.js +0 -7
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const t = (l) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.732184 15.2698C0.330645 14.8683 0.330646 14.2172 0.732185 13.8157L6.54859 7.99928L0.732185 2.18288C0.330646 1.78134 0.330645 1.13031 0.732184 0.728774C1.13372 0.327235 1.78475 0.327235 2.18629 0.728774L8.00269 6.54518L13.8191 0.728767C14.2206 0.327229 14.8717 0.327228 15.2732 0.728767C15.6747 1.13031 15.6747 1.78133 15.2732 2.18287L9.45679 7.99928L15.2732 13.8157C15.6747 14.2172 15.6747 14.8683 15.2732 15.2698C14.8717 15.6713 14.2206 15.6713 13.8191 15.2698L8.00269 9.45338L2.18629 15.2698C1.78475 15.6713 1.13372 15.6713 0.732184 15.2698Z", fill: "#A2AAB5" }));
|
|
3
|
+
export {
|
|
4
|
+
t as S
|
|
5
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChangeEventHandler, ReactNode, InputHTMLAttributes } from 'react';
|
|
2
|
-
import { InputType } from './types';
|
|
3
2
|
|
|
3
|
+
type InputType = 'password' | 'text' | 'email';
|
|
4
4
|
export interface FieldTextProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
5
5
|
value?: string;
|
|
6
6
|
className?: string;
|
|
@@ -29,3 +29,4 @@ export interface FieldTextProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
|
29
29
|
loading?: boolean;
|
|
30
30
|
}
|
|
31
31
|
export declare const FieldText: import('react').ForwardRefExoticComponent<FieldTextProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
32
|
+
export {};
|
|
@@ -5,6 +5,7 @@ export { default as ArrowDownIcon } from './svg/arrowDown.svg';
|
|
|
5
5
|
export { default as ArrowUpIcon } from './svg/arrowUp.svg';
|
|
6
6
|
export { default as BreadcrumbsTreeIcon } from './svg/breadcrumbsTree.svg';
|
|
7
7
|
export { default as CalendarIcon } from './svg/calendar.svg';
|
|
8
|
+
export { default as CheckmarkIcon } from './svg/checkmark.svg';
|
|
8
9
|
export { default as CalendarArrowIcon } from './svg/calendarArrow.svg';
|
|
9
10
|
export { default as ChevronDownDropdownIcon } from './svg/chevronDownDropdown.svg';
|
|
10
11
|
export { default as ChevronRightBreadcrumbsIcon } from './svg/chevronRightBreadcrumbs.svg';
|
|
@@ -2,9 +2,9 @@ import { jsxs as x, Fragment as U, jsx as t } from "react/jsx-runtime";
|
|
|
2
2
|
import $ from "react-datepicker/dist/es/index.js";
|
|
3
3
|
import { c as R } from "./bind-06a7ff84.js";
|
|
4
4
|
import { useMemo as P, useRef as B } from "react";
|
|
5
|
-
import { F as D } from "./fieldText-
|
|
5
|
+
import { F as D } from "./fieldText-450abb26.js";
|
|
6
6
|
import { a as E, S as j } from "./calendarArrow-3e1339ea.js";
|
|
7
|
-
import { D as T } from "./dropdown-
|
|
7
|
+
import { D as T } from "./dropdown-3c979474.js";
|
|
8
8
|
import { registerLocale as G } from "react-datepicker";
|
|
9
9
|
const pe = (r, s) => {
|
|
10
10
|
G(r, s);
|
package/dist/datePicker.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { D as t } from "./datePicker-
|
|
2
|
-
import { r as v } from "./datePicker-
|
|
1
|
+
import { D as t } from "./datePicker-e6c2c36d.js";
|
|
2
|
+
import { r as v } from "./datePicker-e6c2c36d.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react-datepicker/dist/es/index.js";
|
|
5
5
|
import "./bind-06a7ff84.js";
|
|
6
6
|
import "react";
|
|
7
|
-
import "./fieldText-
|
|
7
|
+
import "./fieldText-450abb26.js";
|
|
8
8
|
import "./openEye-7b9cf080.js";
|
|
9
9
|
import "./button-33bc880f.js";
|
|
10
10
|
import "./spinLoader-c4a53718.js";
|
|
11
11
|
import "./maxValueDisplay-9be01a75.js";
|
|
12
12
|
import "./fieldLabel.js";
|
|
13
13
|
import "./calendarArrow-3e1339ea.js";
|
|
14
|
-
import "./dropdown-
|
|
14
|
+
import "./dropdown-3c979474.js";
|
|
15
15
|
import "@floating-ui/react-dom";
|
|
16
16
|
import "downshift";
|
|
17
17
|
import "rc-scrollbars";
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { jsxs as f, jsx as o, 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 ue } from "@floating-ui/react-dom";
|
|
5
|
+
import { useSelect as P } from "downshift";
|
|
6
|
+
import { Scrollbars as pe } from "rc-scrollbars";
|
|
7
|
+
import { u as me } from "./useOnClickOutside-c332f7d3.js";
|
|
8
|
+
import { K as u } 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 Ce } from "./fieldLabel.js";
|
|
12
|
+
import { C as Oe } from "./checkbox-aa91985d.js";
|
|
13
|
+
const Ne = "_disabled_1a01l_12", De = "_hidden_1a01l_16", Ee = "_hover_1a01l_22", we = {
|
|
14
|
+
"dropdown-option": "_dropdown-option_1a01l_1",
|
|
15
|
+
disabled: Ne,
|
|
16
|
+
hidden: De,
|
|
17
|
+
hover: Ee,
|
|
18
|
+
"single-option": "_single-option_1a01l_35",
|
|
19
|
+
"sub-option": "_sub-option_1a01l_42"
|
|
20
|
+
}, z = J.bind(we), G = _e(
|
|
21
|
+
(a, t) => {
|
|
22
|
+
const {
|
|
23
|
+
option: { value: n, disabled: l, hidden: v, label: p, title: c, groupRef: s },
|
|
24
|
+
selected: K,
|
|
25
|
+
onChange: m,
|
|
26
|
+
render: b,
|
|
27
|
+
highlightHovered: C,
|
|
28
|
+
onMouseEnter: A,
|
|
29
|
+
multiSelect: y,
|
|
30
|
+
isPartiallyChecked: O = !1
|
|
31
|
+
} = a, x = (N) => {
|
|
32
|
+
(N.target instanceof HTMLDivElement || N.target instanceof HTMLInputElement) && (m == null || m(n));
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ f(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: z("dropdown-option", {
|
|
38
|
+
disabled: l,
|
|
39
|
+
hidden: v,
|
|
40
|
+
hover: C
|
|
41
|
+
}),
|
|
42
|
+
title: c,
|
|
43
|
+
onClick: x,
|
|
44
|
+
ref: t,
|
|
45
|
+
onMouseEnter: A,
|
|
46
|
+
children: [
|
|
47
|
+
y && /* @__PURE__ */ o(Oe, { value: !!K, partiallyChecked: O }),
|
|
48
|
+
/* @__PURE__ */ o("div", { className: z("single-option", { "sub-option": !!s }), children: b ? b(a) : p })
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
), ve = [
|
|
54
|
+
u.ENTER_KEY_CODE,
|
|
55
|
+
u.SPACE_KEY_CODE,
|
|
56
|
+
u.ARROW_DOWN_KEY_CODE
|
|
57
|
+
], Ke = [u.ESCAPE_KEY_CODE, u.TAB_KEY_CODE];
|
|
58
|
+
var g = /* @__PURE__ */ ((a) => (a.ON_KEY_DOWN = "onKeyDown", a.ON_CLICK = "onClick", a))(g || {});
|
|
59
|
+
const Ae = (a, t) => {
|
|
60
|
+
const n = Array.isArray(t) ? t : [t];
|
|
61
|
+
return a.findIndex(({ value: l }) => n.includes(l));
|
|
62
|
+
}, xe = (a, t) => (a % t + t) % t, Y = (a, t = 0, n = 1) => {
|
|
63
|
+
if (!a[t].disabled)
|
|
64
|
+
return t;
|
|
65
|
+
const l = a.length;
|
|
66
|
+
return Y(
|
|
67
|
+
a,
|
|
68
|
+
xe(t + n, l),
|
|
69
|
+
n
|
|
70
|
+
);
|
|
71
|
+
}, Ie = (a, t) => Y(a, t), ke = (a, t) => Y(a, t, -1), Pe = "_container_1ou1a_1", Ye = "_icon_1ou1a_7", Re = "_arrow_1ou1a_13", Te = "_dropdown_1ou1a_19", He = "_disabled_1ou1a_36", Me = "_value_1ou1a_43", We = "_error_1ou1a_46", Le = "_touched_1ou1a_46", Se = "_opened_1ou1a_50", je = "_placeholder_1ou1a_83", Ve = "_ghost_1ou1a_118", $e = "_divider_1ou1a_135", Ue = {
|
|
72
|
+
container: Pe,
|
|
73
|
+
icon: Ye,
|
|
74
|
+
arrow: Re,
|
|
75
|
+
dropdown: Te,
|
|
76
|
+
"transparent-background": "_transparent-background_1ou1a_33",
|
|
77
|
+
disabled: He,
|
|
78
|
+
value: Me,
|
|
79
|
+
error: We,
|
|
80
|
+
touched: Le,
|
|
81
|
+
opened: Se,
|
|
82
|
+
placeholder: je,
|
|
83
|
+
"mobile-disabled": "_mobile-disabled_1ou1a_87",
|
|
84
|
+
"select-list": "_select-list_1ou1a_92",
|
|
85
|
+
"limited-width": "_limited-width_1ou1a_109",
|
|
86
|
+
"options-container": "_options-container_1ou1a_113",
|
|
87
|
+
ghost: Ve,
|
|
88
|
+
divider: $e
|
|
89
|
+
}, i = J.bind(Ue), st = ({
|
|
90
|
+
multiSelect: a = !1,
|
|
91
|
+
value: t = a ? [] : "",
|
|
92
|
+
options: n = [],
|
|
93
|
+
disabled: l = !1,
|
|
94
|
+
error: v,
|
|
95
|
+
onChange: p,
|
|
96
|
+
onFocus: c,
|
|
97
|
+
onBlur: s,
|
|
98
|
+
mobileDisabled: K,
|
|
99
|
+
title: m,
|
|
100
|
+
touched: b = !1,
|
|
101
|
+
icon: C,
|
|
102
|
+
variant: A,
|
|
103
|
+
placeholder: y = "",
|
|
104
|
+
label: O = "",
|
|
105
|
+
renderOption: x,
|
|
106
|
+
transparentBackground: N = !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, D] = q(null), I = a && Array.isArray(t) ? n.filter((e) => t.includes(e.value)) : null, { refs: L, floatingStyles: te } = fe({
|
|
119
|
+
placement: "bottom-start",
|
|
120
|
+
middleware: [
|
|
121
|
+
ge(5),
|
|
122
|
+
ue({
|
|
123
|
+
fallbackPlacements: ["bottom-start", "top-start", "bottom", "top"]
|
|
124
|
+
})
|
|
125
|
+
]
|
|
126
|
+
}), ae = () => {
|
|
127
|
+
if (T && Array.isArray(t)) {
|
|
128
|
+
const e = n.map((r) => r.value);
|
|
129
|
+
p(t.length === n.length ? [] : e), F();
|
|
130
|
+
}
|
|
131
|
+
};
|
|
132
|
+
me(W, () => {
|
|
133
|
+
_ && (h(!1), s == null || s());
|
|
134
|
+
});
|
|
135
|
+
const S = (e) => {
|
|
136
|
+
if (!e.disabled) {
|
|
137
|
+
if (a) {
|
|
138
|
+
const r = Array.isArray(t) ? [...t] : [], d = r.indexOf(e.value);
|
|
139
|
+
d === -1 ? r.push(e.value) : r.splice(d, 1), p(r);
|
|
140
|
+
} else
|
|
141
|
+
p(e.value);
|
|
142
|
+
h((r) => a || !r);
|
|
143
|
+
}
|
|
144
|
+
}, ne = () => n.find(({ value: e }) => e === t), j = Ae(n, t), {
|
|
145
|
+
getToggleButtonProps: re,
|
|
146
|
+
getLabelProps: se,
|
|
147
|
+
getMenuProps: oe,
|
|
148
|
+
getItemProps: de,
|
|
149
|
+
setHighlightedIndex: E,
|
|
150
|
+
highlightedIndex: V,
|
|
151
|
+
selectedItem: w
|
|
152
|
+
} = P({
|
|
153
|
+
items: n,
|
|
154
|
+
itemToString: (e) => (e != null && e.label ? String(e.label) : y) || "",
|
|
155
|
+
selectedItem: ne(),
|
|
156
|
+
isOpen: _,
|
|
157
|
+
circularNavigation: !0,
|
|
158
|
+
defaultHighlightedIndex: j,
|
|
159
|
+
onHighlightedIndexChange: (e) => {
|
|
160
|
+
switch (e.type) {
|
|
161
|
+
case P.stateChangeTypes.MenuKeyDownArrowUp:
|
|
162
|
+
return D(g.ON_KEY_DOWN), E(ke(n, e.highlightedIndex)), e;
|
|
163
|
+
case P.stateChangeTypes.MenuKeyDownArrowDown:
|
|
164
|
+
return D(g.ON_KEY_DOWN), E(Ie(n, e.highlightedIndex)), e;
|
|
165
|
+
default:
|
|
166
|
+
return e;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}), le = () => {
|
|
170
|
+
l || (h((e) => !e), _ ? s == null || s() : c == null || c(), D(g.ON_CLICK));
|
|
171
|
+
}, k = (() => {
|
|
172
|
+
if (a && Array.isArray(t) && n.length === t.length)
|
|
173
|
+
return R.label;
|
|
174
|
+
const e = n.reduce((r, d) => ((Array.isArray(t) && t.includes(d.value) || d.value === t) && r.push(d.label), r), []);
|
|
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
|
+
})(), ie = (e) => {
|
|
180
|
+
const { keyCode: r } = e;
|
|
181
|
+
ve.includes(r) && !_ && (e.preventDefault(), E(j), h(!0), c == null || c(), D(g.ON_KEY_DOWN));
|
|
182
|
+
}, ce = (e) => {
|
|
183
|
+
const { keyCode: r } = e;
|
|
184
|
+
if (r === u.ENTER_KEY_CODE) {
|
|
185
|
+
const d = n[V];
|
|
186
|
+
S(d), a || (h(!1), s == null || s());
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
Ke.includes(r) && (e.stopPropagation(), h(!1), s == null || s());
|
|
190
|
+
}, $ = () => /* @__PURE__ */ f("div", { className: i("options-container"), children: [
|
|
191
|
+
a && T && Array.isArray(t) && /* @__PURE__ */ f(U, { children: [
|
|
192
|
+
/* @__PURE__ */ o(
|
|
193
|
+
G,
|
|
194
|
+
{
|
|
195
|
+
option: R,
|
|
196
|
+
selected: t.length === n.length,
|
|
197
|
+
onChange: ae,
|
|
198
|
+
multiSelect: a,
|
|
199
|
+
isPartiallyChecked: !!t.length
|
|
200
|
+
}
|
|
201
|
+
),
|
|
202
|
+
/* @__PURE__ */ o("div", { className: i("divider") }),
|
|
203
|
+
" "
|
|
204
|
+
] }),
|
|
205
|
+
n.map((e, r) => /* @__PURE__ */ o(
|
|
206
|
+
G,
|
|
207
|
+
{
|
|
208
|
+
...de({
|
|
209
|
+
item: e,
|
|
210
|
+
index: r
|
|
211
|
+
}),
|
|
212
|
+
multiSelect: a,
|
|
213
|
+
selected: a ? I == null ? void 0 : I.some((d) => d.value === e.value) : e.value === ((w == null ? void 0 : w.value) ?? w),
|
|
214
|
+
option: { title: e.label, ...e },
|
|
215
|
+
highlightHovered: V === r && ee !== g.ON_CLICK,
|
|
216
|
+
render: x,
|
|
217
|
+
onChange: e.disabled ? null : () => S(e),
|
|
218
|
+
onMouseEnter: () => E(r)
|
|
219
|
+
},
|
|
220
|
+
e.value
|
|
221
|
+
)),
|
|
222
|
+
M && /* @__PURE__ */ f(U, { children: [
|
|
223
|
+
/* @__PURE__ */ o("div", { className: i("divider") }),
|
|
224
|
+
M
|
|
225
|
+
] })
|
|
226
|
+
] });
|
|
227
|
+
return /* @__PURE__ */ f("div", { ref: W, className: i("container", Q), title: m, children: [
|
|
228
|
+
O && /* @__PURE__ */ o(Ce, { ...se(), children: O }),
|
|
229
|
+
/* @__PURE__ */ f(
|
|
230
|
+
"button",
|
|
231
|
+
{
|
|
232
|
+
disabled: l,
|
|
233
|
+
...re({
|
|
234
|
+
className: i("dropdown", A, X, {
|
|
235
|
+
"transparent-background": N,
|
|
236
|
+
opened: _,
|
|
237
|
+
disabled: l,
|
|
238
|
+
error: v,
|
|
239
|
+
touched: b,
|
|
240
|
+
"mobile-disabled": K
|
|
241
|
+
}),
|
|
242
|
+
onClick: le,
|
|
243
|
+
onKeyDown: ie,
|
|
244
|
+
ref: L.setReference
|
|
245
|
+
}),
|
|
246
|
+
type: "button",
|
|
247
|
+
children: [
|
|
248
|
+
C && /* @__PURE__ */ o("span", { className: i("icon"), children: C }),
|
|
249
|
+
/* @__PURE__ */ o(
|
|
250
|
+
"span",
|
|
251
|
+
{
|
|
252
|
+
className: i("value", {
|
|
253
|
+
placeholder: k === y
|
|
254
|
+
}),
|
|
255
|
+
children: H ? H(k) : k
|
|
256
|
+
}
|
|
257
|
+
),
|
|
258
|
+
/* @__PURE__ */ o(ye, { className: i("arrow"), tabIndex: -1, children: /* @__PURE__ */ o(be, {}) })
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
),
|
|
262
|
+
_ && /* @__PURE__ */ o(
|
|
263
|
+
"div",
|
|
264
|
+
{
|
|
265
|
+
style: te,
|
|
266
|
+
className: i("select-list", { opened: _, "limited-width": Z }),
|
|
267
|
+
...oe({
|
|
268
|
+
onKeyDown: ce,
|
|
269
|
+
ref: L.setFloating
|
|
270
|
+
}),
|
|
271
|
+
children: B ? $() : /* @__PURE__ */ o(pe, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: $() })
|
|
272
|
+
}
|
|
273
|
+
)
|
|
274
|
+
] });
|
|
275
|
+
};
|
|
276
|
+
export {
|
|
277
|
+
st as D
|
|
278
|
+
};
|
package/dist/dropdown.js
CHANGED
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { jsx as e, jsxs as o, Fragment as v } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as W, useRef as X, useId as Y, useState as B } from "react";
|
|
3
|
+
import { c as Z } from "./bind-06a7ff84.js";
|
|
4
|
+
import { b as q, a as ee, S as ne } from "./openEye-7b9cf080.js";
|
|
5
|
+
import { B as te } from "./button-33bc880f.js";
|
|
6
|
+
import { S as se } from "./spinLoader-c4a53718.js";
|
|
7
|
+
import { M as oe } from "./maxValueDisplay-9be01a75.js";
|
|
8
|
+
import { FieldLabel as ae } from "./fieldLabel.js";
|
|
9
|
+
const ce = "_collapsed_1xyy3_13", re = "_field_1xyy3_21", ie = "_placeholder_1xyy3_46", le = "_disabled_1xyy3_49", de = "_error_1xyy3_52", _e = "_touched_1xyy3_52", pe = "_input_1xyy3_70", ye = "_icon_1xyy3_1", ue = "_text_1xyy3_168", xe = {
|
|
10
|
+
"icon-container": "_icon-container_1xyy3_1",
|
|
11
|
+
"icon-container-end": "_icon-container-end_1xyy3_1",
|
|
12
|
+
"icon-container-start": "_icon-container-start_1xyy3_1",
|
|
13
|
+
collapsed: ce,
|
|
14
|
+
field: re,
|
|
15
|
+
"default-width": "_default-width_1xyy3_33",
|
|
16
|
+
placeholder: ie,
|
|
17
|
+
disabled: le,
|
|
18
|
+
error: de,
|
|
19
|
+
touched: _e,
|
|
20
|
+
"max-length-display": "_max-length-display_1xyy3_59",
|
|
21
|
+
"input-container": "_input-container_1xyy3_70",
|
|
22
|
+
"type-password": "_type-password_1xyy3_74",
|
|
23
|
+
input: pe,
|
|
24
|
+
"eye-icon": "_eye-icon_1xyy3_78",
|
|
25
|
+
icon: ye,
|
|
26
|
+
"start-icon": "_start-icon_1xyy3_124",
|
|
27
|
+
"clear-icon": "_clear-icon_1xyy3_125",
|
|
28
|
+
"additional-content": "_additional-content_1xyy3_161",
|
|
29
|
+
text: ue,
|
|
30
|
+
"error-text": "_error-text_1xyy3_188",
|
|
31
|
+
"help-text": "_help-text_1xyy3_192"
|
|
32
|
+
}, n = Z.bind(xe), be = W(
|
|
33
|
+
({
|
|
34
|
+
value: s = "",
|
|
35
|
+
className: C,
|
|
36
|
+
classNameHelpText: D,
|
|
37
|
+
error: i,
|
|
38
|
+
placeholder: y,
|
|
39
|
+
disabled: a = !1,
|
|
40
|
+
onChange: T,
|
|
41
|
+
touched: u = !1,
|
|
42
|
+
title: V,
|
|
43
|
+
label: l,
|
|
44
|
+
helpText: d,
|
|
45
|
+
defaultWidth: k = !0,
|
|
46
|
+
startIcon: x,
|
|
47
|
+
endIcon: m,
|
|
48
|
+
clearable: L = !1,
|
|
49
|
+
onClear: f,
|
|
50
|
+
isRequired: h = !1,
|
|
51
|
+
hasDoubleMessage: P = !1,
|
|
52
|
+
type: c = "text",
|
|
53
|
+
displayError: R = !0,
|
|
54
|
+
collapsible: j = !1,
|
|
55
|
+
loading: H = !1,
|
|
56
|
+
maxLengthDisplay: I,
|
|
57
|
+
onFocus: O = () => {
|
|
58
|
+
},
|
|
59
|
+
onBlur: U = () => {
|
|
60
|
+
},
|
|
61
|
+
...$
|
|
62
|
+
}, z) => {
|
|
63
|
+
const A = X(null), _ = z || A, N = Y(), [w, g] = B(!1), [F, S] = B(!1), G = (t) => {
|
|
64
|
+
g(!0), O(t);
|
|
65
|
+
}, J = (t) => {
|
|
66
|
+
g(!1), U(t);
|
|
67
|
+
}, K = () => {
|
|
68
|
+
var t;
|
|
69
|
+
f && (f(s), (t = _.current) == null || t.focus());
|
|
70
|
+
}, b = R && i && u, E = /* @__PURE__ */ e("span", { className: n("text", "help-text", D), children: d }), Q = () => c !== "password" ? c : F ? "text" : "password", M = (t) => {
|
|
71
|
+
t.preventDefault(), S(!0);
|
|
72
|
+
}, r = (t) => {
|
|
73
|
+
t.preventDefault(), S(!1);
|
|
74
|
+
};
|
|
75
|
+
return /* @__PURE__ */ o(v, { children: [
|
|
76
|
+
l && /* @__PURE__ */ e(ae, { isRequired: h, htmlFor: N, children: l }),
|
|
77
|
+
/* @__PURE__ */ o(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: n("field", C, {
|
|
81
|
+
error: i,
|
|
82
|
+
touched: u,
|
|
83
|
+
disabled: a,
|
|
84
|
+
"default-width": k,
|
|
85
|
+
collapsed: j && !w && !s
|
|
86
|
+
}),
|
|
87
|
+
title: V,
|
|
88
|
+
children: [
|
|
89
|
+
H ? /* @__PURE__ */ e(se, {}) : x && /* @__PURE__ */ e(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
className: n("icon-container-start"),
|
|
93
|
+
onClick: () => {
|
|
94
|
+
var p;
|
|
95
|
+
(p = _.current) == null || p.focus();
|
|
96
|
+
},
|
|
97
|
+
children: /* @__PURE__ */ e("span", { className: n("icon", { "start-icon": !w }), children: x })
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ o("span", { className: n("input-container", `type-${c}`), children: [
|
|
101
|
+
/* @__PURE__ */ e(
|
|
102
|
+
"input",
|
|
103
|
+
{
|
|
104
|
+
ref: _,
|
|
105
|
+
type: Q(),
|
|
106
|
+
className: n("input"),
|
|
107
|
+
value: s,
|
|
108
|
+
disabled: a,
|
|
109
|
+
id: N,
|
|
110
|
+
onChange: T,
|
|
111
|
+
onFocus: G,
|
|
112
|
+
onBlur: J,
|
|
113
|
+
...$
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
c === "password" && s && /* @__PURE__ */ e(
|
|
117
|
+
te,
|
|
118
|
+
{
|
|
119
|
+
icon: F ? /* @__PURE__ */ e(q, {}) : /* @__PURE__ */ e(ee, {}),
|
|
120
|
+
variant: "text",
|
|
121
|
+
className: n("eye-icon"),
|
|
122
|
+
onMouseDown: M,
|
|
123
|
+
onMouseLeave: r,
|
|
124
|
+
onMouseUp: r,
|
|
125
|
+
onTouchStart: M,
|
|
126
|
+
onTouchEnd: r,
|
|
127
|
+
onTouchCancel: r
|
|
128
|
+
}
|
|
129
|
+
),
|
|
130
|
+
y && !s && /* @__PURE__ */ o("span", { className: n("placeholder"), children: [
|
|
131
|
+
y,
|
|
132
|
+
h && !l && /* @__PURE__ */ e("span", { className: n("asterisk") })
|
|
133
|
+
] })
|
|
134
|
+
] }),
|
|
135
|
+
/* @__PURE__ */ e(
|
|
136
|
+
oe,
|
|
137
|
+
{
|
|
138
|
+
className: n("max-length-display"),
|
|
139
|
+
value: s.length,
|
|
140
|
+
maxValue: I
|
|
141
|
+
}
|
|
142
|
+
),
|
|
143
|
+
m && /* @__PURE__ */ e("span", { className: n("icon-container-end"), children: /* @__PURE__ */ e("span", { className: n("icon"), children: m }) }),
|
|
144
|
+
L && s.length > 0 && /* @__PURE__ */ e("span", { className: n("icon-container-end"), children: /* @__PURE__ */ e("button", { type: "button", className: n("clear-icon", { disabled: a }), onClick: K, children: /* @__PURE__ */ e(ne, {}) }) })
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
(b || d) && /* @__PURE__ */ e("div", { className: n("additional-content", { disabled: a }), children: b ? /* @__PURE__ */ o(v, { children: [
|
|
149
|
+
/* @__PURE__ */ e("span", { className: n("text", "error-text"), children: i }),
|
|
150
|
+
P && E
|
|
151
|
+
] }) : d && E })
|
|
152
|
+
] });
|
|
153
|
+
}
|
|
154
|
+
);
|
|
155
|
+
export {
|
|
156
|
+
be as F
|
|
157
|
+
};
|
package/dist/fieldText.js
CHANGED