@reportportal/ui-kit 0.0.1-alpha.246 → 0.0.1-alpha.247
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/autocompletes.js +2 -2
- package/dist/common/hooks/useCapsLock.d.ts +5 -3
- package/dist/common/hooks.js +1 -1
- package/dist/{datePicker-f47b27d4.js → datePicker-21db317e.js} +1 -1
- package/dist/datePicker.js +4 -4
- package/dist/fieldText-88af67ae.js +189 -0
- package/dist/fieldText.js +2 -2
- package/dist/index.js +4 -4
- package/dist/{pagination-654cfe39.js → pagination-09ed6bb0.js} +1 -1
- package/dist/pagination.js +3 -3
- package/dist/useCapsLock-65753959.js +21 -0
- package/package.json +1 -1
- package/dist/fieldText-9ebc2f31.js +0 -185
- package/dist/useCapsLock-ac8ea6e0.js +0 -20
package/dist/autocompletes.js
CHANGED
|
@@ -9,7 +9,7 @@ import { i as Me } from "./isEmpty-ccacb5ff.js";
|
|
|
9
9
|
import { createPortal as Je } from "react-dom";
|
|
10
10
|
import _e from "downshift";
|
|
11
11
|
import { useFloating as Be, autoUpdate as Oe, flip as Qe, size as Ze } from "@floating-ui/react";
|
|
12
|
-
import { F as qe } from "./fieldText-
|
|
12
|
+
import { F as qe } from "./fieldText-88af67ae.js";
|
|
13
13
|
import { S as Te } from "./dropdown-0260bb66.js";
|
|
14
14
|
import { E as $e, A as Ue, T as Ve } from "./constants-85822a6b.js";
|
|
15
15
|
import { S as et } from "./close-4d480ef7.js";
|
|
@@ -21,7 +21,7 @@ import "./maxValueDisplay-9be01a75.js";
|
|
|
21
21
|
import "./fieldLabel.js";
|
|
22
22
|
import "react-dnd";
|
|
23
23
|
import "react-dnd-html5-backend";
|
|
24
|
-
import "./useCapsLock-
|
|
24
|
+
import "./useCapsLock-65753959.js";
|
|
25
25
|
import "./tooltip.js";
|
|
26
26
|
import "./floatingUi-46f5b896.js";
|
|
27
27
|
const ot = "_disabled_1rpph_43", st = "_input_1rpph_107", nt = {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Tracks Caps Lock via
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Tracks Caps Lock state via window-level keyboard events.
|
|
3
|
+
* Also exposes syncFromMouseEvent so callers can re-read the real OS state
|
|
4
|
+
* from a MouseEvent (e.g. onMouseDown on the input) — MouseEvent.getModifierState
|
|
5
|
+
* is reliable even after tab switches, unlike FocusEvent which lacks it.
|
|
5
6
|
*/
|
|
6
7
|
export declare const useCapsLock: () => {
|
|
7
8
|
capsLockOn: boolean;
|
|
9
|
+
syncFromMouseEvent: (event: MouseEvent) => void;
|
|
8
10
|
};
|
package/dist/common/hooks.js
CHANGED
|
@@ -4,7 +4,7 @@ import { useCallback as D } from "react";
|
|
|
4
4
|
import { i as x } from "../isEmpty-ccacb5ff.js";
|
|
5
5
|
import { u as V } from "../useWindowResize-a7e1ac92.js";
|
|
6
6
|
import { u as j } from "../useEllipsisTitle-462fa254.js";
|
|
7
|
-
import { u as v } from "../useCapsLock-
|
|
7
|
+
import { u as v } from "../useCapsLock-65753959.js";
|
|
8
8
|
import "react-dnd";
|
|
9
9
|
import "react-dnd-html5-backend";
|
|
10
10
|
import "../common.js";
|
|
@@ -2,7 +2,7 @@ import { jsxs as x, Fragment as z, jsx as a } from "react/jsx-runtime";
|
|
|
2
2
|
import { useMemo as v, forwardRef as J, useRef as K } from "react";
|
|
3
3
|
import I from "react-datepicker/dist/es/index.js";
|
|
4
4
|
import { c as Y } from "./bind-06a7ff84.js";
|
|
5
|
-
import { F as Q } from "./fieldText-
|
|
5
|
+
import { F as Q } from "./fieldText-88af67ae.js";
|
|
6
6
|
import { D as L } from "./dropdown-d2a05471.js";
|
|
7
7
|
import { S as B } from "./calendarArrow-44c7e60e.js";
|
|
8
8
|
import { registerLocale as X } from "react-datepicker";
|
package/dist/datePicker.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { D as t } from "./datePicker-
|
|
2
|
-
import { r as I } from "./datePicker-
|
|
1
|
+
import { D as t } from "./datePicker-21db317e.js";
|
|
2
|
+
import { r as I } from "./datePicker-21db317e.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "react-datepicker/dist/es/index.js";
|
|
6
6
|
import "./bind-06a7ff84.js";
|
|
7
|
-
import "./fieldText-
|
|
7
|
+
import "./fieldText-88af67ae.js";
|
|
8
8
|
import "./clear-53660571.js";
|
|
9
9
|
import "./capslockIcon-b100b9d6.js";
|
|
10
10
|
import "./baseIconButton-251479f7.js";
|
|
@@ -13,7 +13,7 @@ import "./maxValueDisplay-9be01a75.js";
|
|
|
13
13
|
import "./fieldLabel.js";
|
|
14
14
|
import "react-dnd";
|
|
15
15
|
import "react-dnd-html5-backend";
|
|
16
|
-
import "./useCapsLock-
|
|
16
|
+
import "./useCapsLock-65753959.js";
|
|
17
17
|
import "./tooltip.js";
|
|
18
18
|
import "react-dom";
|
|
19
19
|
import "@floating-ui/react";
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { jsx as t, jsxs as s, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as M, useRef as tt, useId as nt, useState as b } from "react";
|
|
3
|
+
import { c as ot } from "./bind-06a7ff84.js";
|
|
4
|
+
import { S as et } from "./clear-53660571.js";
|
|
5
|
+
import { b as ct, a as st, S as rt } from "./capslockIcon-b100b9d6.js";
|
|
6
|
+
import { B as at } from "./baseIconButton-251479f7.js";
|
|
7
|
+
import { S as it } from "./spinLoader-c4a53718.js";
|
|
8
|
+
import { M as lt } from "./maxValueDisplay-9be01a75.js";
|
|
9
|
+
import { FieldLabel as pt } from "./fieldLabel.js";
|
|
10
|
+
import "react-dnd";
|
|
11
|
+
import "react-dnd-html5-backend";
|
|
12
|
+
import { u as _t } from "./useCapsLock-65753959.js";
|
|
13
|
+
import { Tooltip as dt } from "./tooltip.js";
|
|
14
|
+
const mt = "_collapsed_1vr19_11", ft = "_field_1vr19_23", ut = "_placeholder_1vr19_48", ht = "_disabled_1vr19_51", vt = "_error_1vr19_54", xt = "_touched_1vr19_54", wt = "_input_1vr19_73", Nt = "_icon_1vr19_1", kt = "_text_1vr19_207", yt = {
|
|
15
|
+
"icon-container": "_icon-container_1vr19_1",
|
|
16
|
+
"icon-container-additional": "_icon-container-additional_1vr19_1",
|
|
17
|
+
"icon-container-end": "_icon-container-end_1vr19_1",
|
|
18
|
+
"icon-container-start": "_icon-container-start_1vr19_1",
|
|
19
|
+
collapsed: mt,
|
|
20
|
+
field: ft,
|
|
21
|
+
"default-width": "_default-width_1vr19_35",
|
|
22
|
+
placeholder: ut,
|
|
23
|
+
disabled: ht,
|
|
24
|
+
error: vt,
|
|
25
|
+
touched: xt,
|
|
26
|
+
"max-length-display": "_max-length-display_1vr19_61",
|
|
27
|
+
"input-container": "_input-container_1vr19_73",
|
|
28
|
+
"type-password": "_type-password_1vr19_77",
|
|
29
|
+
input: wt,
|
|
30
|
+
"with-caps-lock": "_with-caps-lock_1vr19_81",
|
|
31
|
+
"caps-lock-tooltip-wrapper": "_caps-lock-tooltip-wrapper_1vr19_84",
|
|
32
|
+
"caps-lock-tooltip-content": "_caps-lock-tooltip-content_1vr19_96",
|
|
33
|
+
"caps-lock-icon": "_caps-lock-icon_1vr19_107",
|
|
34
|
+
"eye-icon": "_eye-icon_1vr19_117",
|
|
35
|
+
icon: Nt,
|
|
36
|
+
"start-icon": "_start-icon_1vr19_163",
|
|
37
|
+
"clear-icon": "_clear-icon_1vr19_164",
|
|
38
|
+
"additional-content": "_additional-content_1vr19_200",
|
|
39
|
+
text: kt,
|
|
40
|
+
"error-text": "_error-text_1vr19_227",
|
|
41
|
+
"help-text": "_help-text_1vr19_231"
|
|
42
|
+
}, n = ot.bind(yt), Dt = M(
|
|
43
|
+
({
|
|
44
|
+
value: e = "",
|
|
45
|
+
className: B,
|
|
46
|
+
classNameHelpText: V,
|
|
47
|
+
error: a,
|
|
48
|
+
placeholder: u,
|
|
49
|
+
disabled: c = !1,
|
|
50
|
+
onChange: I,
|
|
51
|
+
touched: h = !1,
|
|
52
|
+
title: L,
|
|
53
|
+
label: i,
|
|
54
|
+
helpText: l,
|
|
55
|
+
defaultWidth: P = !0,
|
|
56
|
+
startIcon: v,
|
|
57
|
+
endIcon: x,
|
|
58
|
+
clearable: R = !1,
|
|
59
|
+
onClear: w,
|
|
60
|
+
isRequired: N = !1,
|
|
61
|
+
hasDoubleMessage: j = !1,
|
|
62
|
+
type: r = "text",
|
|
63
|
+
displayError: D = !0,
|
|
64
|
+
collapsible: H = !1,
|
|
65
|
+
loading: O = !1,
|
|
66
|
+
maxLengthDisplay: T,
|
|
67
|
+
capsLockMessage: p,
|
|
68
|
+
onFocus: $ = () => {
|
|
69
|
+
},
|
|
70
|
+
onBlur: z = () => {
|
|
71
|
+
},
|
|
72
|
+
onMouseDown: _,
|
|
73
|
+
...A
|
|
74
|
+
}, G) => {
|
|
75
|
+
const J = tt(null), d = G || J, k = nt(), [m, y] = b(!1), [g, K] = b(!1), { capsLockOn: Q, syncFromMouseEvent: U } = _t(), C = !!p && m && Q && e.length >= 1 && !c, W = (o) => {
|
|
76
|
+
y(!0), $(o);
|
|
77
|
+
}, X = (o) => {
|
|
78
|
+
y(!1), z(o);
|
|
79
|
+
}, Y = () => {
|
|
80
|
+
var o;
|
|
81
|
+
w && (w(e), (o = d.current) == null || o.focus());
|
|
82
|
+
}, F = D && a && h, S = /* @__PURE__ */ t("span", { className: n("text", "help-text", V), children: l }), Z = () => r !== "password" ? r : g ? "text" : "password", q = () => {
|
|
83
|
+
K((o) => !o);
|
|
84
|
+
};
|
|
85
|
+
return /* @__PURE__ */ s(E, { children: [
|
|
86
|
+
i && /* @__PURE__ */ t(pt, { isRequired: N, htmlFor: k, children: i }),
|
|
87
|
+
/* @__PURE__ */ s(
|
|
88
|
+
"div",
|
|
89
|
+
{
|
|
90
|
+
className: n("field", B, {
|
|
91
|
+
error: a,
|
|
92
|
+
touched: h,
|
|
93
|
+
disabled: c,
|
|
94
|
+
"default-width": P,
|
|
95
|
+
collapsed: H && !m && !e
|
|
96
|
+
}),
|
|
97
|
+
title: L,
|
|
98
|
+
children: [
|
|
99
|
+
O ? /* @__PURE__ */ t(it, {}) : v && /* @__PURE__ */ t(
|
|
100
|
+
"span",
|
|
101
|
+
{
|
|
102
|
+
className: n("icon-container-start"),
|
|
103
|
+
onClick: () => {
|
|
104
|
+
var f;
|
|
105
|
+
(f = d.current) == null || f.focus();
|
|
106
|
+
},
|
|
107
|
+
children: /* @__PURE__ */ t("span", { className: n("icon", { "start-icon": !m }), children: v })
|
|
108
|
+
}
|
|
109
|
+
),
|
|
110
|
+
/* @__PURE__ */ s(
|
|
111
|
+
"span",
|
|
112
|
+
{
|
|
113
|
+
className: n("input-container", `type-${r}`, { "with-caps-lock": C }),
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ t(
|
|
116
|
+
"input",
|
|
117
|
+
{
|
|
118
|
+
ref: d,
|
|
119
|
+
type: Z(),
|
|
120
|
+
className: n("input"),
|
|
121
|
+
value: e,
|
|
122
|
+
disabled: c,
|
|
123
|
+
id: k,
|
|
124
|
+
onChange: I,
|
|
125
|
+
onFocus: W,
|
|
126
|
+
onBlur: X,
|
|
127
|
+
onMouseDown: (o) => {
|
|
128
|
+
p && U(o.nativeEvent), _ == null || _(o);
|
|
129
|
+
},
|
|
130
|
+
...A
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
C && /* @__PURE__ */ t(
|
|
134
|
+
dt,
|
|
135
|
+
{
|
|
136
|
+
content: p,
|
|
137
|
+
wrapperClassName: n("caps-lock-tooltip-wrapper"),
|
|
138
|
+
contentClassName: n("caps-lock-tooltip-content"),
|
|
139
|
+
children: /* @__PURE__ */ t("span", { className: n("caps-lock-icon"), children: /* @__PURE__ */ t(ct, {}) })
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
r === "password" && e && /* @__PURE__ */ t(
|
|
143
|
+
at,
|
|
144
|
+
{
|
|
145
|
+
className: n("eye-icon"),
|
|
146
|
+
onClick: q,
|
|
147
|
+
onPointerDown: (o) => o.preventDefault(),
|
|
148
|
+
children: g ? /* @__PURE__ */ t(st, {}) : /* @__PURE__ */ t(rt, {})
|
|
149
|
+
}
|
|
150
|
+
),
|
|
151
|
+
u && !e && /* @__PURE__ */ s("span", { className: n("placeholder"), children: [
|
|
152
|
+
u,
|
|
153
|
+
N && !i && /* @__PURE__ */ t("span", { className: n("asterisk") })
|
|
154
|
+
] })
|
|
155
|
+
]
|
|
156
|
+
}
|
|
157
|
+
),
|
|
158
|
+
/* @__PURE__ */ t(
|
|
159
|
+
lt,
|
|
160
|
+
{
|
|
161
|
+
className: n("max-length-display"),
|
|
162
|
+
value: e.length,
|
|
163
|
+
maxValue: T
|
|
164
|
+
}
|
|
165
|
+
),
|
|
166
|
+
R && e.length > 0 && /* @__PURE__ */ t("span", { className: n("icon-container-end"), children: /* @__PURE__ */ t(
|
|
167
|
+
"button",
|
|
168
|
+
{
|
|
169
|
+
type: "button",
|
|
170
|
+
className: n("clear-icon", { disabled: c }),
|
|
171
|
+
onClick: Y,
|
|
172
|
+
onMouseDown: (o) => o.preventDefault(),
|
|
173
|
+
children: /* @__PURE__ */ t(et, {})
|
|
174
|
+
}
|
|
175
|
+
) }),
|
|
176
|
+
x && /* @__PURE__ */ t("span", { className: n("icon-container-end"), children: /* @__PURE__ */ t("span", { className: n("icon"), children: x }) })
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
),
|
|
180
|
+
(F || l) && /* @__PURE__ */ t("div", { className: n("additional-content", { disabled: c }), children: F ? /* @__PURE__ */ s(E, { children: [
|
|
181
|
+
/* @__PURE__ */ t("span", { className: n("text", "error-text"), children: a }),
|
|
182
|
+
j && S
|
|
183
|
+
] }) : l && S })
|
|
184
|
+
] });
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
export {
|
|
188
|
+
Dt as F
|
|
189
|
+
};
|
package/dist/fieldText.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as o } from "./fieldText-
|
|
1
|
+
import { F as o } from "./fieldText-88af67ae.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./bind-06a7ff84.js";
|
|
@@ -10,7 +10,7 @@ import "./maxValueDisplay-9be01a75.js";
|
|
|
10
10
|
import "./fieldLabel.js";
|
|
11
11
|
import "react-dnd";
|
|
12
12
|
import "react-dnd-html5-backend";
|
|
13
|
-
import "./useCapsLock-
|
|
13
|
+
import "./useCapsLock-65753959.js";
|
|
14
14
|
import "./tooltip.js";
|
|
15
15
|
import "react-dom";
|
|
16
16
|
import "@floating-ui/react";
|
package/dist/index.js
CHANGED
|
@@ -9,12 +9,12 @@ import { BulkPanel as V } from "./bulkPanel.js";
|
|
|
9
9
|
import { B as W } from "./button-7ab874f3.js";
|
|
10
10
|
import { C as j } from "./checkbox-76aa8f97.js";
|
|
11
11
|
import { Chip as K } from "./chip.js";
|
|
12
|
-
import { D as Y } from "./datePicker-
|
|
12
|
+
import { D as Y } from "./datePicker-21db317e.js";
|
|
13
13
|
import "react-datepicker";
|
|
14
14
|
import { D as $ } from "./dropdown-d2a05471.js";
|
|
15
15
|
import { FieldLabel as ro } from "./fieldLabel.js";
|
|
16
16
|
import { F as to } from "./fieldNumber-b4aa4d7e.js";
|
|
17
|
-
import { F as ao } from "./fieldText-
|
|
17
|
+
import { F as ao } from "./fieldText-88af67ae.js";
|
|
18
18
|
import { F as po } from "./fieldTextFlex-2f51c173.js";
|
|
19
19
|
import { FileDropArea as mo } from "./fileDropArea.js";
|
|
20
20
|
import { FiltersButton as Io } from "./filtersButton.js";
|
|
@@ -22,7 +22,7 @@ import { FilterItem as xo } from "./filterItem.js";
|
|
|
22
22
|
import { IssueList as uo } from "./issueList.js";
|
|
23
23
|
import { Modal as Co } from "./modal.js";
|
|
24
24
|
import { MultipleAutocomplete as Po, SingleAutocomplete as go } from "./autocompletes.js";
|
|
25
|
-
import { P as Fo } from "./pagination-
|
|
25
|
+
import { P as Fo } from "./pagination-09ed6bb0.js";
|
|
26
26
|
import { Popover as bo } from "./popover.js";
|
|
27
27
|
import { R as ho, a as Bo } from "./radioGroup-0c132c2e.js";
|
|
28
28
|
import { SegmentedControl as vo } from "./segmentedControl.js";
|
|
@@ -70,7 +70,7 @@ import "react-datepicker/dist/es/index.js";
|
|
|
70
70
|
import "@floating-ui/react-dom";
|
|
71
71
|
import "downshift";
|
|
72
72
|
import "./maxValueDisplay-9be01a75.js";
|
|
73
|
-
import "./useCapsLock-
|
|
73
|
+
import "./useCapsLock-65753959.js";
|
|
74
74
|
import "react-dropzone";
|
|
75
75
|
import "framer-motion";
|
|
76
76
|
import "./useWindowResize-a7e1ac92.js";
|
|
@@ -4,7 +4,7 @@ import { Tooltip as j } from "./tooltip.js";
|
|
|
4
4
|
import { useState as f } from "react";
|
|
5
5
|
import { Popover as A } from "./popover.js";
|
|
6
6
|
import { B as w } from "./button-7ab874f3.js";
|
|
7
|
-
import { F as B } from "./fieldText-
|
|
7
|
+
import { F as B } from "./fieldText-88af67ae.js";
|
|
8
8
|
import { B as y } from "./baseIconButton-251479f7.js";
|
|
9
9
|
import { S as z, a as S } from "./prevPage-87faf576.js";
|
|
10
10
|
const W = {
|
package/dist/pagination.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as t } from "./pagination-
|
|
1
|
+
import { P as t } from "./pagination-09ed6bb0.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "./bind-06a7ff84.js";
|
|
4
4
|
import "./tooltip.js";
|
|
@@ -8,7 +8,7 @@ import "@floating-ui/react";
|
|
|
8
8
|
import "./floatingUi-46f5b896.js";
|
|
9
9
|
import "./popover.js";
|
|
10
10
|
import "./button-7ab874f3.js";
|
|
11
|
-
import "./fieldText-
|
|
11
|
+
import "./fieldText-88af67ae.js";
|
|
12
12
|
import "./clear-53660571.js";
|
|
13
13
|
import "./capslockIcon-b100b9d6.js";
|
|
14
14
|
import "./baseIconButton-251479f7.js";
|
|
@@ -17,7 +17,7 @@ import "./maxValueDisplay-9be01a75.js";
|
|
|
17
17
|
import "./fieldLabel.js";
|
|
18
18
|
import "react-dnd";
|
|
19
19
|
import "react-dnd-html5-backend";
|
|
20
|
-
import "./useCapsLock-
|
|
20
|
+
import "./useCapsLock-65753959.js";
|
|
21
21
|
import "./prevPage-87faf576.js";
|
|
22
22
|
export {
|
|
23
23
|
t as Pagination,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { useState as c, useCallback as d, useEffect as r } from "react";
|
|
2
|
+
const u = () => {
|
|
3
|
+
const [s, e] = c(!1), a = d((t) => {
|
|
4
|
+
e(t.getModifierState("CapsLock"));
|
|
5
|
+
}, []);
|
|
6
|
+
return r(() => {
|
|
7
|
+
const t = (n) => {
|
|
8
|
+
e(n.getModifierState("CapsLock"));
|
|
9
|
+
}, i = (n) => {
|
|
10
|
+
n.key === "CapsLock" && e(n.getModifierState("CapsLock"));
|
|
11
|
+
}, o = () => {
|
|
12
|
+
document.visibilityState === "visible" && e(!1);
|
|
13
|
+
};
|
|
14
|
+
return window.addEventListener("keydown", t), window.addEventListener("keyup", i), document.addEventListener("visibilitychange", o), () => {
|
|
15
|
+
window.removeEventListener("keydown", t), window.removeEventListener("keyup", i), document.removeEventListener("visibilitychange", o);
|
|
16
|
+
};
|
|
17
|
+
}, []), { capsLockOn: s, syncFromMouseEvent: a };
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
u
|
|
21
|
+
};
|
package/package.json
CHANGED
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
import { jsx as t, jsxs as s, Fragment as F } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as Y, useRef as Z, useId as q, useState as b } from "react";
|
|
3
|
-
import { c as tt } from "./bind-06a7ff84.js";
|
|
4
|
-
import { S as nt } from "./clear-53660571.js";
|
|
5
|
-
import { b as ot, a as et, S as ct } from "./capslockIcon-b100b9d6.js";
|
|
6
|
-
import { B as st } from "./baseIconButton-251479f7.js";
|
|
7
|
-
import { S as at } from "./spinLoader-c4a53718.js";
|
|
8
|
-
import { M as rt } from "./maxValueDisplay-9be01a75.js";
|
|
9
|
-
import { FieldLabel as it } from "./fieldLabel.js";
|
|
10
|
-
import "react-dnd";
|
|
11
|
-
import "react-dnd-html5-backend";
|
|
12
|
-
import { u as lt } from "./useCapsLock-ac8ea6e0.js";
|
|
13
|
-
import { Tooltip as pt } from "./tooltip.js";
|
|
14
|
-
const _t = "_collapsed_1vr19_11", dt = "_field_1vr19_23", mt = "_placeholder_1vr19_48", ut = "_disabled_1vr19_51", ft = "_error_1vr19_54", ht = "_touched_1vr19_54", vt = "_input_1vr19_73", wt = "_icon_1vr19_1", xt = "_text_1vr19_207", Nt = {
|
|
15
|
-
"icon-container": "_icon-container_1vr19_1",
|
|
16
|
-
"icon-container-additional": "_icon-container-additional_1vr19_1",
|
|
17
|
-
"icon-container-end": "_icon-container-end_1vr19_1",
|
|
18
|
-
"icon-container-start": "_icon-container-start_1vr19_1",
|
|
19
|
-
collapsed: _t,
|
|
20
|
-
field: dt,
|
|
21
|
-
"default-width": "_default-width_1vr19_35",
|
|
22
|
-
placeholder: mt,
|
|
23
|
-
disabled: ut,
|
|
24
|
-
error: ft,
|
|
25
|
-
touched: ht,
|
|
26
|
-
"max-length-display": "_max-length-display_1vr19_61",
|
|
27
|
-
"input-container": "_input-container_1vr19_73",
|
|
28
|
-
"type-password": "_type-password_1vr19_77",
|
|
29
|
-
input: vt,
|
|
30
|
-
"with-caps-lock": "_with-caps-lock_1vr19_81",
|
|
31
|
-
"caps-lock-tooltip-wrapper": "_caps-lock-tooltip-wrapper_1vr19_84",
|
|
32
|
-
"caps-lock-tooltip-content": "_caps-lock-tooltip-content_1vr19_96",
|
|
33
|
-
"caps-lock-icon": "_caps-lock-icon_1vr19_107",
|
|
34
|
-
"eye-icon": "_eye-icon_1vr19_117",
|
|
35
|
-
icon: wt,
|
|
36
|
-
"start-icon": "_start-icon_1vr19_163",
|
|
37
|
-
"clear-icon": "_clear-icon_1vr19_164",
|
|
38
|
-
"additional-content": "_additional-content_1vr19_200",
|
|
39
|
-
text: xt,
|
|
40
|
-
"error-text": "_error-text_1vr19_227",
|
|
41
|
-
"help-text": "_help-text_1vr19_231"
|
|
42
|
-
}, n = tt.bind(Nt), Pt = Y(
|
|
43
|
-
({
|
|
44
|
-
value: e = "",
|
|
45
|
-
className: B,
|
|
46
|
-
classNameHelpText: D,
|
|
47
|
-
error: r,
|
|
48
|
-
placeholder: m,
|
|
49
|
-
disabled: c = !1,
|
|
50
|
-
onChange: V,
|
|
51
|
-
touched: u = !1,
|
|
52
|
-
title: E,
|
|
53
|
-
label: i,
|
|
54
|
-
helpText: l,
|
|
55
|
-
defaultWidth: I = !0,
|
|
56
|
-
startIcon: f,
|
|
57
|
-
endIcon: h,
|
|
58
|
-
clearable: L = !1,
|
|
59
|
-
onClear: v,
|
|
60
|
-
isRequired: w = !1,
|
|
61
|
-
hasDoubleMessage: P = !1,
|
|
62
|
-
type: a = "text",
|
|
63
|
-
displayError: R = !0,
|
|
64
|
-
collapsible: j = !1,
|
|
65
|
-
loading: H = !1,
|
|
66
|
-
maxLengthDisplay: M,
|
|
67
|
-
capsLockMessage: x,
|
|
68
|
-
onFocus: O = () => {
|
|
69
|
-
},
|
|
70
|
-
onBlur: T = () => {
|
|
71
|
-
},
|
|
72
|
-
...$
|
|
73
|
-
}, z) => {
|
|
74
|
-
const A = Z(null), p = z || A, N = q(), [_, k] = b(!1), [y, G] = b(!1), { capsLockOn: J } = lt(), g = !!x && _ && J && e.length >= 1 && !c, K = (o) => {
|
|
75
|
-
k(!0), O(o);
|
|
76
|
-
}, Q = (o) => {
|
|
77
|
-
k(!1), T(o);
|
|
78
|
-
}, U = () => {
|
|
79
|
-
var o;
|
|
80
|
-
v && (v(e), (o = p.current) == null || o.focus());
|
|
81
|
-
}, C = R && r && u, S = /* @__PURE__ */ t("span", { className: n("text", "help-text", D), children: l }), W = () => a !== "password" ? a : y ? "text" : "password", X = () => {
|
|
82
|
-
G((o) => !o);
|
|
83
|
-
};
|
|
84
|
-
return /* @__PURE__ */ s(F, { children: [
|
|
85
|
-
i && /* @__PURE__ */ t(it, { isRequired: w, htmlFor: N, children: i }),
|
|
86
|
-
/* @__PURE__ */ s(
|
|
87
|
-
"div",
|
|
88
|
-
{
|
|
89
|
-
className: n("field", B, {
|
|
90
|
-
error: r,
|
|
91
|
-
touched: u,
|
|
92
|
-
disabled: c,
|
|
93
|
-
"default-width": I,
|
|
94
|
-
collapsed: j && !_ && !e
|
|
95
|
-
}),
|
|
96
|
-
title: E,
|
|
97
|
-
children: [
|
|
98
|
-
H ? /* @__PURE__ */ t(at, {}) : f && /* @__PURE__ */ t(
|
|
99
|
-
"span",
|
|
100
|
-
{
|
|
101
|
-
className: n("icon-container-start"),
|
|
102
|
-
onClick: () => {
|
|
103
|
-
var d;
|
|
104
|
-
(d = p.current) == null || d.focus();
|
|
105
|
-
},
|
|
106
|
-
children: /* @__PURE__ */ t("span", { className: n("icon", { "start-icon": !_ }), children: f })
|
|
107
|
-
}
|
|
108
|
-
),
|
|
109
|
-
/* @__PURE__ */ s(
|
|
110
|
-
"span",
|
|
111
|
-
{
|
|
112
|
-
className: n("input-container", `type-${a}`, { "with-caps-lock": g }),
|
|
113
|
-
children: [
|
|
114
|
-
/* @__PURE__ */ t(
|
|
115
|
-
"input",
|
|
116
|
-
{
|
|
117
|
-
ref: p,
|
|
118
|
-
type: W(),
|
|
119
|
-
className: n("input"),
|
|
120
|
-
value: e,
|
|
121
|
-
disabled: c,
|
|
122
|
-
id: N,
|
|
123
|
-
onChange: V,
|
|
124
|
-
onFocus: K,
|
|
125
|
-
onBlur: Q,
|
|
126
|
-
...$
|
|
127
|
-
}
|
|
128
|
-
),
|
|
129
|
-
g && /* @__PURE__ */ t(
|
|
130
|
-
pt,
|
|
131
|
-
{
|
|
132
|
-
content: x,
|
|
133
|
-
wrapperClassName: n("caps-lock-tooltip-wrapper"),
|
|
134
|
-
contentClassName: n("caps-lock-tooltip-content"),
|
|
135
|
-
children: /* @__PURE__ */ t("span", { className: n("caps-lock-icon"), children: /* @__PURE__ */ t(ot, {}) })
|
|
136
|
-
}
|
|
137
|
-
),
|
|
138
|
-
a === "password" && e && /* @__PURE__ */ t(
|
|
139
|
-
st,
|
|
140
|
-
{
|
|
141
|
-
className: n("eye-icon"),
|
|
142
|
-
onClick: X,
|
|
143
|
-
onPointerDown: (o) => o.preventDefault(),
|
|
144
|
-
children: y ? /* @__PURE__ */ t(et, {}) : /* @__PURE__ */ t(ct, {})
|
|
145
|
-
}
|
|
146
|
-
),
|
|
147
|
-
m && !e && /* @__PURE__ */ s("span", { className: n("placeholder"), children: [
|
|
148
|
-
m,
|
|
149
|
-
w && !i && /* @__PURE__ */ t("span", { className: n("asterisk") })
|
|
150
|
-
] })
|
|
151
|
-
]
|
|
152
|
-
}
|
|
153
|
-
),
|
|
154
|
-
/* @__PURE__ */ t(
|
|
155
|
-
rt,
|
|
156
|
-
{
|
|
157
|
-
className: n("max-length-display"),
|
|
158
|
-
value: e.length,
|
|
159
|
-
maxValue: M
|
|
160
|
-
}
|
|
161
|
-
),
|
|
162
|
-
L && e.length > 0 && /* @__PURE__ */ t("span", { className: n("icon-container-end"), children: /* @__PURE__ */ t(
|
|
163
|
-
"button",
|
|
164
|
-
{
|
|
165
|
-
type: "button",
|
|
166
|
-
className: n("clear-icon", { disabled: c }),
|
|
167
|
-
onClick: U,
|
|
168
|
-
onMouseDown: (o) => o.preventDefault(),
|
|
169
|
-
children: /* @__PURE__ */ t(nt, {})
|
|
170
|
-
}
|
|
171
|
-
) }),
|
|
172
|
-
h && /* @__PURE__ */ t("span", { className: n("icon-container-end"), children: /* @__PURE__ */ t("span", { className: n("icon"), children: h }) })
|
|
173
|
-
]
|
|
174
|
-
}
|
|
175
|
-
),
|
|
176
|
-
(C || l) && /* @__PURE__ */ t("div", { className: n("additional-content", { disabled: c }), children: C ? /* @__PURE__ */ s(F, { children: [
|
|
177
|
-
/* @__PURE__ */ t("span", { className: n("text", "error-text"), children: r }),
|
|
178
|
-
P && S
|
|
179
|
-
] }) : l && S })
|
|
180
|
-
] });
|
|
181
|
-
}
|
|
182
|
-
);
|
|
183
|
-
export {
|
|
184
|
-
Pt as F
|
|
185
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { useState as c, useEffect as d } from "react";
|
|
2
|
-
const L = () => {
|
|
3
|
-
const [a, t] = c(!1);
|
|
4
|
-
return d(() => {
|
|
5
|
-
const i = (e) => {
|
|
6
|
-
var o;
|
|
7
|
-
t(((o = e.getModifierState) == null ? void 0 : o.call(e, "CapsLock")) ?? !1);
|
|
8
|
-
}, n = (e) => {
|
|
9
|
-
e.key === "CapsLock" && i(e);
|
|
10
|
-
}, s = () => {
|
|
11
|
-
document.visibilityState === "visible" && t(!1);
|
|
12
|
-
};
|
|
13
|
-
return window.addEventListener("keydown", i), window.addEventListener("keyup", n), document.addEventListener("visibilitychange", s), () => {
|
|
14
|
-
window.removeEventListener("keydown", i), window.removeEventListener("keyup", n), document.removeEventListener("visibilitychange", s);
|
|
15
|
-
};
|
|
16
|
-
}, []), { capsLockOn: a };
|
|
17
|
-
};
|
|
18
|
-
export {
|
|
19
|
-
L as u
|
|
20
|
-
};
|