@reportportal/ui-kit 0.0.1-alpha.7 → 0.0.1-alpha.9
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/LICENSE +201 -201
- package/README.md +197 -3
- package/dist/baseIconButton-7bc53dec.js +25 -0
- package/dist/baseIconButton.js +7 -0
- package/dist/bubblesLoader-a7e709d4.js +17 -0
- package/dist/bubblesLoader.js +1 -1
- package/dist/button-7fb84fde.js +62 -0
- package/dist/button.js +1 -1
- package/dist/checkbox-4143390f.js +70 -0
- package/dist/checkbox.js +1 -1
- package/dist/components/button/button.d.ts +0 -1
- package/dist/components/button/index.d.ts +2 -2
- package/dist/components/checkbox/checkbox.d.ts +1 -0
- package/dist/components/dropdown/constants.d.ts +4 -0
- package/dist/components/dropdown/dropdown.d.ts +0 -1
- package/dist/components/fieldText/fieldText.d.ts +1 -0
- package/dist/components/fieldTextFlex/fieldTextFlex.d.ts +14 -0
- package/dist/components/fieldTextFlex/index.d.ts +3 -0
- package/dist/components/icons/baseIconButton/baseIconButton.d.ts +8 -0
- package/dist/components/icons/baseIconButton/index.d.ts +4 -0
- package/dist/components/icons/index.d.ts +12 -0
- package/dist/components/index.d.ts +6 -1
- package/dist/components/modal/modal.d.ts +3 -1
- package/dist/components/pagination/index.d.ts +4 -0
- package/dist/components/pagination/itemsCounter/index.d.ts +1 -0
- package/dist/components/pagination/itemsCounter/itemCounter.d.ts +9 -0
- package/dist/components/pagination/pageControls/activePage/activePage.d.ts +12 -0
- package/dist/components/pagination/pageControls/activePage/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/activePage/pageSelector/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/activePage/pageSelector/pageSelector.d.ts +10 -0
- package/dist/components/pagination/pageControls/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageControls.d.ts +16 -0
- package/dist/components/pagination/pageControls/pageNavigator/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageNavigator/pageNavigator.d.ts +8 -0
- package/dist/components/pagination/pageSizeControl/index.d.ts +1 -0
- package/dist/components/pagination/pageSizeControl/pageSizeControl.d.ts +10 -0
- package/dist/components/pagination/pageSizeControl/sizeSelector/index.d.ts +1 -0
- package/dist/components/pagination/pageSizeControl/sizeSelector/sizeSelector.d.ts +8 -0
- package/dist/components/pagination/pagination.d.ts +22 -0
- package/dist/components/pagination/types.d.ts +2 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/popover.d.ts +18 -0
- package/dist/components/radio/index.d.ts +4 -0
- package/dist/components/radio/radio.d.ts +16 -0
- package/dist/components/radio/radioGroup.d.ts +8 -0
- package/dist/components/table/index.d.ts +3 -0
- package/dist/components/table/table.d.ts +3 -0
- package/dist/components/table/types.d.ts +46 -0
- package/dist/components/table/utils.d.ts +2 -0
- package/dist/components/themeProvider/themeProvider.d.ts +2 -1
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/tooltip.d.ts +13 -0
- package/dist/dropdown-e07f2a71.js +212 -0
- package/dist/dropdown.js +3 -4
- package/dist/fieldNumber-46fe79b9.js +127 -0
- package/dist/fieldNumber.js +2 -3
- package/dist/fieldText-d80b29ba.js +102 -0
- package/dist/fieldText.js +2 -2
- package/dist/fieldTextFlex-5bddf46a.js +67 -0
- package/dist/fieldTextFlex.js +8 -0
- package/dist/index-bb9b62ef.js +131 -0
- package/dist/index.js +46 -24
- package/dist/modal.js +14 -126
- package/dist/pagination-a36bc786.js +274 -0
- package/dist/pagination.js +13 -0
- package/dist/popover.js +95 -0
- package/dist/radio-fd49a09c.js +76 -0
- package/dist/{icon.js → radio.js} +4 -4
- package/dist/style.css +1 -1
- package/dist/systemMessage-1ced6079.js +30 -0
- package/dist/systemMessage.js +1 -1
- package/dist/themeProvider-46c2be7b.js +23 -0
- package/dist/themeProvider.js +4 -3
- package/dist/toggle-707ecb74.js +67 -0
- package/dist/toggle.js +1 -1
- package/dist/tooltip.js +70 -0
- package/package.json +30 -6
- package/dist/bubblesLoader-9bec3797.js +0 -17
- package/dist/button-d4944dbc.js +0 -64
- package/dist/checkbox-fdc44740.js +0 -68
- package/dist/clear-4963efcd.js +0 -5
- package/dist/components/icon/icon.d.ts +0 -11
- package/dist/components/icon/icons.d.ts +0 -21
- package/dist/components/icon/index.d.ts +0 -3
- package/dist/dropdown-45e7bc7d.js +0 -204
- package/dist/fieldNumber-27e69676.js +0 -132
- package/dist/fieldText-c7085849.js +0 -99
- package/dist/icon-71262f5c.js +0 -26
- package/dist/systemMessage-62c3133d.js +0 -30
- package/dist/themeProvider-5800417e.js +0 -19
- package/dist/toggle-5b3d8333.js +0 -67
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
import { jsx as a, jsxs as L } from "react/jsx-runtime";
|
|
2
|
+
import * as R from "react";
|
|
3
|
+
import { forwardRef as F, useState as Y, useRef as B } from "react";
|
|
4
|
+
import { c as A } from "./bind-06a7ff84.js";
|
|
5
|
+
import { useFloating as ee, offset as te, flip as ne } from "@floating-ui/react-dom";
|
|
6
|
+
import { useSelect as x } from "downshift";
|
|
7
|
+
import { Scrollbars as de } from "rc-scrollbars";
|
|
8
|
+
import { u as oe } from "./useOnClickOutside-c332f7d3.js";
|
|
9
|
+
import { K as f } from "./keyCodes-f63c0e11.js";
|
|
10
|
+
import { B as se } from "./baseIconButton-7bc53dec.js";
|
|
11
|
+
const ae = (t) => /* @__PURE__ */ R.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ R.createElement("path", { d: "M14.2174 5.82426C14.3736 5.66805 14.3736 5.41479 14.2174 5.25858L14.0759 5.11716C13.9197 4.96095 13.6665 4.96095 13.5103 5.11716L8.16726 10.4602L2.82426 5.11716C2.66805 4.96095 2.41479 4.96095 2.25858 5.11716L2.11716 5.25858C1.96095 5.41479 1.96095 5.66805 2.11716 5.82426L7.89176 11.5989C8.04797 11.7551 8.30124 11.7551 8.45745 11.5989L8.88171 11.1746L8.87436 11.1673L14.2174 5.82426Z", fill: "#A2AAB5" })), le = "_disabled_nx3fh_13", re = "_hidden_nx3fh_17", ie = "_selected_nx3fh_23", ce = "_hover_nx3fh_26", _e = {
|
|
12
|
+
"dropdown-option": "_dropdown-option_nx3fh_1",
|
|
13
|
+
disabled: le,
|
|
14
|
+
hidden: re,
|
|
15
|
+
selected: ie,
|
|
16
|
+
hover: ce,
|
|
17
|
+
"single-option": "_single-option_nx3fh_39",
|
|
18
|
+
"sub-option": "_sub-option_nx3fh_45"
|
|
19
|
+
}, P = A.bind(_e), he = F(
|
|
20
|
+
(t, n) => {
|
|
21
|
+
const {
|
|
22
|
+
option: { value: s, disabled: i, hidden: O, label: l, title: d, groupRef: E },
|
|
23
|
+
selected: D,
|
|
24
|
+
onChange: p,
|
|
25
|
+
render: g,
|
|
26
|
+
highlightHovered: b,
|
|
27
|
+
onMouseEnter: w
|
|
28
|
+
} = t, N = () => {
|
|
29
|
+
p && p(s);
|
|
30
|
+
};
|
|
31
|
+
return /* @__PURE__ */ a(
|
|
32
|
+
"div",
|
|
33
|
+
{
|
|
34
|
+
className: P("dropdown-option", {
|
|
35
|
+
selected: D,
|
|
36
|
+
disabled: i,
|
|
37
|
+
hidden: O,
|
|
38
|
+
hover: b
|
|
39
|
+
}),
|
|
40
|
+
title: i && d || void 0,
|
|
41
|
+
onClick: N,
|
|
42
|
+
ref: n,
|
|
43
|
+
onMouseEnter: w,
|
|
44
|
+
children: /* @__PURE__ */ a("div", { className: P("single-option", { "sub-option": !!E }), children: g ? g(t) : l })
|
|
45
|
+
}
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
), fe = [
|
|
49
|
+
f.ENTER_KEY_CODE,
|
|
50
|
+
f.SPACE_KEY_CODE,
|
|
51
|
+
f.ARROW_DOWN_KEY_CODE
|
|
52
|
+
], ge = [f.ESCAPE_KEY_CODE, f.TAB_KEY_CODE];
|
|
53
|
+
var h = /* @__PURE__ */ ((t) => (t.ON_KEY_DOWN = "onKeyDown", t.ON_CLICK = "onClick", t))(h || {});
|
|
54
|
+
const pe = (t, n) => t.map(({ value: s }) => s).indexOf(n), we = (t, n) => (t % n + n) % n, v = (t, n = 0, s = 1) => {
|
|
55
|
+
if (!t[n].disabled)
|
|
56
|
+
return n;
|
|
57
|
+
const i = t.length;
|
|
58
|
+
return v(
|
|
59
|
+
t,
|
|
60
|
+
we(n + s, i),
|
|
61
|
+
s
|
|
62
|
+
);
|
|
63
|
+
}, me = (t, n) => v(t, n), ue = (t, n) => v(t, n, -1), Ce = "_container_3wi7d_1", Oe = "_icon_3wi7d_7", Ee = "_arrow_3wi7d_13", De = "_dropdown_3wi7d_19", be = "_disabled_3wi7d_36", Ne = "_value_3wi7d_43", xe = "_error_3wi7d_46", ve = "_touched_3wi7d_46", Ke = "_opened_3wi7d_50", ye = "_placeholder_3wi7d_72", Ie = "_ghost_3wi7d_108", ke = {
|
|
64
|
+
container: Ce,
|
|
65
|
+
icon: Oe,
|
|
66
|
+
arrow: Ee,
|
|
67
|
+
dropdown: De,
|
|
68
|
+
"transparent-background": "_transparent-background_3wi7d_33",
|
|
69
|
+
disabled: be,
|
|
70
|
+
value: Ne,
|
|
71
|
+
error: xe,
|
|
72
|
+
touched: ve,
|
|
73
|
+
opened: Ke,
|
|
74
|
+
placeholder: ye,
|
|
75
|
+
"mobile-disabled": "_mobile-disabled_3wi7d_87",
|
|
76
|
+
"select-list": "_select-list_3wi7d_92",
|
|
77
|
+
ghost: Ie
|
|
78
|
+
}, _ = A.bind(ke), $e = ({
|
|
79
|
+
value: t = "",
|
|
80
|
+
options: n = [],
|
|
81
|
+
disabled: s = !1,
|
|
82
|
+
error: i,
|
|
83
|
+
onChange: O,
|
|
84
|
+
onFocus: l,
|
|
85
|
+
onBlur: d,
|
|
86
|
+
mobileDisabled: E,
|
|
87
|
+
title: D,
|
|
88
|
+
touched: p = !1,
|
|
89
|
+
icon: g,
|
|
90
|
+
variant: b,
|
|
91
|
+
placeholder: w = "",
|
|
92
|
+
renderOption: N,
|
|
93
|
+
transparentBackground: T = !1,
|
|
94
|
+
className: W,
|
|
95
|
+
toggleButtonClassName: H
|
|
96
|
+
}) => {
|
|
97
|
+
const [r, c] = Y(!1), K = B(null), [M, m] = Y(null), { refs: y, floatingStyles: $ } = ee({
|
|
98
|
+
middleware: [
|
|
99
|
+
te(5),
|
|
100
|
+
ne({
|
|
101
|
+
fallbackPlacements: ["bottom", "top"]
|
|
102
|
+
})
|
|
103
|
+
]
|
|
104
|
+
});
|
|
105
|
+
oe(K, () => {
|
|
106
|
+
r && (c(!1), d == null || d());
|
|
107
|
+
});
|
|
108
|
+
const I = (e) => {
|
|
109
|
+
e.disabled || (O(e.value), c((o) => !o));
|
|
110
|
+
}, j = () => n.find(({ value: e }) => e === t), k = pe(n, t), {
|
|
111
|
+
getToggleButtonProps: V,
|
|
112
|
+
getMenuProps: U,
|
|
113
|
+
getItemProps: Z,
|
|
114
|
+
setHighlightedIndex: u,
|
|
115
|
+
highlightedIndex: S,
|
|
116
|
+
selectedItem: C
|
|
117
|
+
} = x({
|
|
118
|
+
items: n,
|
|
119
|
+
itemToString: (e) => (e != null && e.label ? String(e.label) : w) || "",
|
|
120
|
+
selectedItem: j(),
|
|
121
|
+
isOpen: r,
|
|
122
|
+
circularNavigation: !0,
|
|
123
|
+
defaultHighlightedIndex: k,
|
|
124
|
+
onHighlightedIndexChange: (e) => {
|
|
125
|
+
switch (e.type) {
|
|
126
|
+
case x.stateChangeTypes.MenuKeyDownArrowUp:
|
|
127
|
+
return m(h.ON_KEY_DOWN), u(ue(n, e.highlightedIndex)), e;
|
|
128
|
+
case x.stateChangeTypes.MenuKeyDownArrowDown:
|
|
129
|
+
return m(h.ON_KEY_DOWN), u(me(n, e.highlightedIndex)), e;
|
|
130
|
+
default:
|
|
131
|
+
return e;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}), q = () => {
|
|
135
|
+
s || (c((e) => !e), r ? d == null || d() : l == null || l(), m(h.ON_CLICK));
|
|
136
|
+
}, z = () => {
|
|
137
|
+
if (!t && t !== !1)
|
|
138
|
+
return w;
|
|
139
|
+
let e = t;
|
|
140
|
+
return n.forEach((o) => {
|
|
141
|
+
o.value === t && (e = o.label);
|
|
142
|
+
}), e;
|
|
143
|
+
}, G = (e) => {
|
|
144
|
+
const { keyCode: o } = e;
|
|
145
|
+
fe.includes(o) && !r && (e.preventDefault(), u(k), c(!0), l == null || l(), m(h.ON_KEY_DOWN));
|
|
146
|
+
}, J = (e) => {
|
|
147
|
+
const { keyCode: o } = e;
|
|
148
|
+
if (o === f.ENTER_KEY_CODE) {
|
|
149
|
+
const X = n[S];
|
|
150
|
+
I(X), c(!1), d == null || d();
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
ge.includes(o) && (e.stopPropagation(), c(!1), d == null || d());
|
|
154
|
+
}, Q = () => n.map((e, o) => /* @__PURE__ */ a(
|
|
155
|
+
he,
|
|
156
|
+
{
|
|
157
|
+
...Z({
|
|
158
|
+
item: e,
|
|
159
|
+
index: o
|
|
160
|
+
}),
|
|
161
|
+
selected: e.value === ((C == null ? void 0 : C.value) ?? C),
|
|
162
|
+
option: e,
|
|
163
|
+
highlightHovered: S === o && M !== h.ON_CLICK,
|
|
164
|
+
render: N,
|
|
165
|
+
onChange: e.disabled ? null : () => I(e),
|
|
166
|
+
onMouseEnter: () => u(o)
|
|
167
|
+
},
|
|
168
|
+
e.value
|
|
169
|
+
));
|
|
170
|
+
return /* @__PURE__ */ L("div", { ref: K, className: _("container", W), title: D, children: [
|
|
171
|
+
/* @__PURE__ */ L(
|
|
172
|
+
"button",
|
|
173
|
+
{
|
|
174
|
+
disabled: s,
|
|
175
|
+
...V({
|
|
176
|
+
className: _("dropdown", b, H, {
|
|
177
|
+
"transparent-background": T,
|
|
178
|
+
opened: r,
|
|
179
|
+
disabled: s,
|
|
180
|
+
error: i,
|
|
181
|
+
touched: p,
|
|
182
|
+
"mobile-disabled": E
|
|
183
|
+
}),
|
|
184
|
+
onClick: q,
|
|
185
|
+
onKeyDown: G,
|
|
186
|
+
ref: y.setReference
|
|
187
|
+
}),
|
|
188
|
+
children: [
|
|
189
|
+
g && /* @__PURE__ */ a("span", { className: _("icon"), children: g }),
|
|
190
|
+
/* @__PURE__ */ a("span", { className: _("value", { placeholder: !t }), children: z() }),
|
|
191
|
+
/* @__PURE__ */ a(se, { className: _("arrow"), tabIndex: -1, children: /* @__PURE__ */ a(ae, {}) })
|
|
192
|
+
]
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
r && /* @__PURE__ */ a(
|
|
196
|
+
"div",
|
|
197
|
+
{
|
|
198
|
+
style: $,
|
|
199
|
+
className: _("select-list", { opened: r }),
|
|
200
|
+
...U({
|
|
201
|
+
onKeyDown: J,
|
|
202
|
+
ref: y.setFloating
|
|
203
|
+
}),
|
|
204
|
+
children: /* @__PURE__ */ a(de, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: Q() })
|
|
205
|
+
}
|
|
206
|
+
)
|
|
207
|
+
] });
|
|
208
|
+
};
|
|
209
|
+
export {
|
|
210
|
+
$e as D,
|
|
211
|
+
ae as S
|
|
212
|
+
};
|
package/dist/dropdown.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { D as r } from "./dropdown-
|
|
1
|
+
import { D as r } from "./dropdown-e07f2a71.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./bind-06a7ff84.js";
|
|
5
|
-
import "react-
|
|
5
|
+
import "@floating-ui/react-dom";
|
|
6
6
|
import "downshift";
|
|
7
7
|
import "rc-scrollbars";
|
|
8
8
|
import "./useOnClickOutside-c332f7d3.js";
|
|
9
9
|
import "./keyCodes-f63c0e11.js";
|
|
10
|
-
import "./
|
|
11
|
-
import "./clear-4963efcd.js";
|
|
10
|
+
import "./baseIconButton-7bc53dec.js";
|
|
12
11
|
export {
|
|
13
12
|
r as Dropdown,
|
|
14
13
|
r as default
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsxs as K, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { useRef as A, useMemo as B } from "react";
|
|
4
|
+
import { c as T } from "./bind-06a7ff84.js";
|
|
5
|
+
import { K as e } from "./keyCodes-f63c0e11.js";
|
|
6
|
+
import { B as f } from "./baseIconButton-7bc53dec.js";
|
|
7
|
+
const W = (t) => /* @__PURE__ */ d.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#C1C7D0", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ d.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.00117 2.62046C7.63142 2.6189 7.33294 2.91738 7.3345 3.28712L7.35159 7.35159L3.28712 7.3345C2.91738 7.33295 2.6189 7.63142 2.62045 8.00117C2.62201 8.37091 2.92301 8.67191 3.29275 8.67346L7.35722 8.69056L7.37391 12.6599C7.37547 13.0296 7.67647 13.3306 8.04621 13.3322C8.41596 13.3337 8.71443 13.0352 8.71288 12.6655L8.69619 8.69619L12.6655 8.71288C13.0352 8.71444 13.3337 8.41596 13.3322 8.04621C13.3306 7.67647 13.0296 7.37547 12.6599 7.37392L8.69056 7.35722L8.67346 3.29275C8.67191 2.92301 8.37091 2.62201 8.00117 2.62046Z" })), v = (t) => /* @__PURE__ */ d.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#C1C7D0", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ d.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.31082 7.31081C2.94108 7.30926 2.6426 7.60773 2.64415 7.97748C2.64571 8.34722 2.9467 8.64822 3.31645 8.64977L12.6892 8.68919C13.0589 8.69074 13.3574 8.39227 13.3559 8.02252C13.3543 7.65278 13.0533 7.35178 12.6836 7.35023L3.31082 7.31081Z" })), y = 5, h = 16, S = [
|
|
8
|
+
e.TAB_KEY_CODE,
|
|
9
|
+
e.BACKSPACE_KEY_CODE,
|
|
10
|
+
e.ARROW_LEFT_KEY_CODE,
|
|
11
|
+
e.ARROW_UP_KEY_CODE,
|
|
12
|
+
e.ARROW_RIGHT_KEY_CODE,
|
|
13
|
+
e.ARROW_DOWN_KEY_CODE,
|
|
14
|
+
e.DELETE_KEY_CODE,
|
|
15
|
+
e.NUM_LOCK_0_KEY_CODE,
|
|
16
|
+
e.NUM_LOCK_1_KEY_CODE,
|
|
17
|
+
e.NUM_LOCK_2_KEY_CODE,
|
|
18
|
+
e.NUM_LOCK_3_KEY_CODE,
|
|
19
|
+
e.NUM_LOCK_4_KEY_CODE,
|
|
20
|
+
e.NUM_LOCK_5_KEY_CODE,
|
|
21
|
+
e.NUM_LOCK_6_KEY_CODE,
|
|
22
|
+
e.NUM_LOCK_7_KEY_CODE,
|
|
23
|
+
e.NUM_LOCK_8_KEY_CODE,
|
|
24
|
+
e.NUM_LOCK_9_KEY_CODE
|
|
25
|
+
], I = "_disabled_3tc9r_6", b = "_label_3tc9r_10", k = "_sign_3tc9r_21", F = "_error_3tc9r_36", H = "_touched_3tc9r_36", V = "_filled_3tc9r_41", P = "_input_3tc9r_26", j = {
|
|
26
|
+
"field-number": "_field-number_3tc9r_1",
|
|
27
|
+
disabled: I,
|
|
28
|
+
label: b,
|
|
29
|
+
sign: k,
|
|
30
|
+
"input-container": "_input-container_3tc9r_26",
|
|
31
|
+
error: F,
|
|
32
|
+
touched: H,
|
|
33
|
+
filled: V,
|
|
34
|
+
"input-field": "_input-field_3tc9r_48",
|
|
35
|
+
input: P
|
|
36
|
+
}, r = T.bind(j), z = ({
|
|
37
|
+
value: t = "",
|
|
38
|
+
placeholder: D = "0",
|
|
39
|
+
disabled: c = !1,
|
|
40
|
+
onChange: i,
|
|
41
|
+
onFocus: a,
|
|
42
|
+
onBlur: G,
|
|
43
|
+
label: O,
|
|
44
|
+
postfix: s = "",
|
|
45
|
+
min: o = 0,
|
|
46
|
+
max: E = Number.MAX_SAFE_INTEGER,
|
|
47
|
+
title: p,
|
|
48
|
+
error: m,
|
|
49
|
+
touched: L = !1,
|
|
50
|
+
...N
|
|
51
|
+
}) => {
|
|
52
|
+
const C = A(null), R = (_) => {
|
|
53
|
+
let n = _.target.value.replace(/^0(?=\d+|^\d)/g, "");
|
|
54
|
+
if (n === "") {
|
|
55
|
+
i("");
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
n = +n, n >= o && n <= E && i(n);
|
|
59
|
+
}, Y = (_) => {
|
|
60
|
+
const { keyCode: n } = _;
|
|
61
|
+
S.includes(n) || (n < e.NUMBER_START_KEY_CODE || n > e.NUMBER_END_KEY_CODE || _.shiftKey) && _.preventDefault();
|
|
62
|
+
}, w = () => {
|
|
63
|
+
const _ = +t - 1;
|
|
64
|
+
_ >= o && _ <= E && i(_);
|
|
65
|
+
}, g = () => {
|
|
66
|
+
const _ = +t + 1;
|
|
67
|
+
_ >= o && _ <= E && i(_);
|
|
68
|
+
}, u = D + s, M = B(() => {
|
|
69
|
+
let _ = (String(t) || u).length;
|
|
70
|
+
return s && !t && (_ += 1), _ > h ? `${h}ch` : `${_ || y}ch`;
|
|
71
|
+
}, [u, s, t]), U = () => {
|
|
72
|
+
C && C.current && C.current.focus(), a && a();
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ K("div", { className: r("field-number", { disabled: c }), children: [
|
|
75
|
+
O && /* @__PURE__ */ l("span", { className: r("label"), children: O }),
|
|
76
|
+
/* @__PURE__ */ K(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: r("input-container", {
|
|
80
|
+
filled: !!t || t === 0,
|
|
81
|
+
error: m,
|
|
82
|
+
disabled: c,
|
|
83
|
+
touched: L
|
|
84
|
+
}),
|
|
85
|
+
title: p,
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ l(
|
|
88
|
+
f,
|
|
89
|
+
{
|
|
90
|
+
className: r("sign", "minus"),
|
|
91
|
+
disabled: c,
|
|
92
|
+
onClick: w,
|
|
93
|
+
children: /* @__PURE__ */ l(v, {})
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ K("span", { className: r("input-field", { disabled: c }), onClick: U, children: [
|
|
97
|
+
/* @__PURE__ */ l(
|
|
98
|
+
"input",
|
|
99
|
+
{
|
|
100
|
+
ref: C,
|
|
101
|
+
className: r("input"),
|
|
102
|
+
type: "number",
|
|
103
|
+
value: t,
|
|
104
|
+
placeholder: u,
|
|
105
|
+
disabled: c,
|
|
106
|
+
min: o,
|
|
107
|
+
max: E,
|
|
108
|
+
onKeyDown: c ? void 0 : Y,
|
|
109
|
+
onChange: c ? void 0 : R,
|
|
110
|
+
onFocus: c ? void 0 : a,
|
|
111
|
+
style: { width: M },
|
|
112
|
+
...N
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
!!s && (t === 0 || !!t) && /* @__PURE__ */ l("span", { children: s.slice(0, 1) })
|
|
116
|
+
] }),
|
|
117
|
+
/* @__PURE__ */ l(f, { className: r("sign", "plus"), disabled: c, onClick: g, children: /* @__PURE__ */ l(W, {}) })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
] });
|
|
122
|
+
};
|
|
123
|
+
export {
|
|
124
|
+
z as F,
|
|
125
|
+
W as S,
|
|
126
|
+
v as a
|
|
127
|
+
};
|
package/dist/fieldNumber.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { F as m } from "./fieldNumber-
|
|
1
|
+
import { F as m } from "./fieldNumber-46fe79b9.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./bind-06a7ff84.js";
|
|
5
5
|
import "./keyCodes-f63c0e11.js";
|
|
6
|
-
import "./
|
|
7
|
-
import "./clear-4963efcd.js";
|
|
6
|
+
import "./baseIconButton-7bc53dec.js";
|
|
8
7
|
export {
|
|
9
8
|
m as FieldNumber,
|
|
10
9
|
m as default
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as t, jsxs as n, Fragment as q } from "react/jsx-runtime";
|
|
2
|
+
import * as l from "react";
|
|
3
|
+
import { forwardRef as F } from "react";
|
|
4
|
+
import { c as R } from "./bind-06a7ff84.js";
|
|
5
|
+
import "./baseIconButton-7bc53dec.js";
|
|
6
|
+
const j = (c) => /* @__PURE__ */ l.createElement("svg", { width: 17, height: 17, viewBox: "0 0 17 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...c }, /* @__PURE__ */ l.createElement("rect", { width: 16.2089, height: 16.1568, rx: 8.07842, fill: "#A2AAB5" }), /* @__PURE__ */ l.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M5.14768 5.14645C4.95077 5.34171 4.95077 5.65829 5.14768 5.85355L7.49578 8.18198L5.35655 10.3033C5.15963 10.4986 5.15963 10.8151 5.35655 11.0104C5.55346 11.2057 5.87271 11.2057 6.06962 11.0104L8.20886 8.88909L10.1392 10.8033C10.3361 10.9986 10.6554 10.9986 10.8523 10.8033C11.0492 10.608 11.0492 10.2915 10.8523 10.0962L8.92193 8.18198L11.0612 6.06065C11.2581 5.86539 11.2581 5.54881 11.0612 5.35355C10.8643 5.15828 10.545 5.15828 10.3481 5.35355L8.20886 7.47487L5.86076 5.14645C5.66385 4.95118 5.34459 4.95118 5.14768 5.14645Z", fill: "white" })), y = "_label_18rqf_18", B = "_asterisk_18rqf_27", S = "_disabled_18rqf_33", M = "_field_18rqf_38", Z = "_error_18rqf_52", z = "_touched_18rqf_52", D = "_placeholder_18rqf_63", G = "_input_18rqf_70", H = "_icon_18rqf_1", J = "_text_18rqf_159", K = {
|
|
7
|
+
"icon-container": "_icon-container_18rqf_1",
|
|
8
|
+
"icon-container-end": "_icon-container-end_18rqf_1",
|
|
9
|
+
"icon-container-start": "_icon-container-start_18rqf_1",
|
|
10
|
+
label: y,
|
|
11
|
+
asterisk: B,
|
|
12
|
+
disabled: S,
|
|
13
|
+
field: M,
|
|
14
|
+
error: Z,
|
|
15
|
+
touched: z,
|
|
16
|
+
placeholder: D,
|
|
17
|
+
"default-width": "_default-width_18rqf_66",
|
|
18
|
+
"input-container": "_input-container_18rqf_70",
|
|
19
|
+
input: G,
|
|
20
|
+
icon: H,
|
|
21
|
+
"clear-icon": "_clear-icon_18rqf_116",
|
|
22
|
+
"additional-content": "_additional-content_18rqf_152",
|
|
23
|
+
text: J,
|
|
24
|
+
"error-text": "_error-text_18rqf_167",
|
|
25
|
+
"help-text": "_help-text_18rqf_171"
|
|
26
|
+
}, e = R.bind(K), U = F(
|
|
27
|
+
({
|
|
28
|
+
value: c,
|
|
29
|
+
className: u,
|
|
30
|
+
error: a,
|
|
31
|
+
placeholder: o,
|
|
32
|
+
disabled: r = !1,
|
|
33
|
+
onChange: N,
|
|
34
|
+
touched: _ = !1,
|
|
35
|
+
title: w,
|
|
36
|
+
label: s,
|
|
37
|
+
helpText: i,
|
|
38
|
+
defaultWidth: C = !0,
|
|
39
|
+
startIcon: d,
|
|
40
|
+
endIcon: f,
|
|
41
|
+
clearable: L = !1,
|
|
42
|
+
onClear: h,
|
|
43
|
+
isRequired: p = !1,
|
|
44
|
+
hasDoubleMessage: g = !1,
|
|
45
|
+
type: k = "text",
|
|
46
|
+
displayError: v = !0,
|
|
47
|
+
...E
|
|
48
|
+
}, b) => {
|
|
49
|
+
const A = () => {
|
|
50
|
+
h && h(c);
|
|
51
|
+
}, m = v && a && _, x = /* @__PURE__ */ t("span", { className: e("text", "help-text"), children: i });
|
|
52
|
+
return /* @__PURE__ */ n(q, { children: [
|
|
53
|
+
s && /* @__PURE__ */ n("span", { className: e("label", { disabled: r }), children: [
|
|
54
|
+
s,
|
|
55
|
+
p && /* @__PURE__ */ t("span", { className: e("asterisk"), children: "*" })
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ n(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: e("field", u, {
|
|
61
|
+
error: a,
|
|
62
|
+
touched: _,
|
|
63
|
+
disabled: r,
|
|
64
|
+
"default-width": C
|
|
65
|
+
}),
|
|
66
|
+
title: w,
|
|
67
|
+
children: [
|
|
68
|
+
d && /* @__PURE__ */ t("span", { className: e("icon-container-start"), children: /* @__PURE__ */ t("span", { className: e("icon"), children: d }) }),
|
|
69
|
+
/* @__PURE__ */ n("span", { className: e("input-container"), children: [
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
|
+
"input",
|
|
72
|
+
{
|
|
73
|
+
ref: b,
|
|
74
|
+
type: k,
|
|
75
|
+
className: e("input"),
|
|
76
|
+
value: c,
|
|
77
|
+
disabled: r,
|
|
78
|
+
onChange: N,
|
|
79
|
+
...E
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
o && !c && /* @__PURE__ */ n("span", { className: e("placeholder"), children: [
|
|
83
|
+
o,
|
|
84
|
+
p && !s && /* @__PURE__ */ t("span", { className: e("asterisk") })
|
|
85
|
+
] })
|
|
86
|
+
] }),
|
|
87
|
+
f && /* @__PURE__ */ t("span", { className: e("icon-container-end"), children: /* @__PURE__ */ t("span", { className: e("icon"), children: f }) }),
|
|
88
|
+
L && /* @__PURE__ */ t("span", { className: e("icon-container-end"), children: /* @__PURE__ */ t("button", { type: "button", className: e("clear-icon", { disabled: r }), onClick: A, children: /* @__PURE__ */ t(j, {}) }) })
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
(m || i) && /* @__PURE__ */ t("div", { className: e("additional-content", { disabled: r }), children: m ? /* @__PURE__ */ n(q, { children: [
|
|
93
|
+
/* @__PURE__ */ t("span", { className: e("text", "error-text"), children: a }),
|
|
94
|
+
g && x
|
|
95
|
+
] }) : i && x })
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
export {
|
|
100
|
+
U as F,
|
|
101
|
+
j as S
|
|
102
|
+
};
|
package/dist/fieldText.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { F as o } from "./fieldText-
|
|
1
|
+
import { F as o } from "./fieldText-d80b29ba.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./bind-06a7ff84.js";
|
|
5
|
-
import "./
|
|
5
|
+
import "./baseIconButton-7bc53dec.js";
|
|
6
6
|
export {
|
|
7
7
|
o as FieldText,
|
|
8
8
|
o as default
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { jsxs as _, Fragment as u, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as y } from "./bind-06a7ff84.js";
|
|
3
|
+
import { forwardRef as H, useId as I } from "react";
|
|
4
|
+
const E = "_error_cxv68_19", R = "_touched_cxv68_19", j = "_label_cxv68_30", O = "_disabled_cxv68_56", $ = {
|
|
5
|
+
"text-area": "_text-area_cxv68_1",
|
|
6
|
+
error: E,
|
|
7
|
+
touched: R,
|
|
8
|
+
label: j,
|
|
9
|
+
"additional-content": "_additional-content_cxv68_39",
|
|
10
|
+
"error-text": "_error-text_cxv68_39",
|
|
11
|
+
"help-text": "_help-text_cxv68_47",
|
|
12
|
+
disabled: O
|
|
13
|
+
}, t = y.bind($), w = 72, z = 2, G = H(
|
|
14
|
+
({
|
|
15
|
+
value: o = "",
|
|
16
|
+
readonly: d = !1,
|
|
17
|
+
error: a = "",
|
|
18
|
+
placeholder: h = "",
|
|
19
|
+
disabled: e = !1,
|
|
20
|
+
touched: l = !1,
|
|
21
|
+
className: m = "",
|
|
22
|
+
label: n = "",
|
|
23
|
+
helpText: s = "",
|
|
24
|
+
onChange: p,
|
|
25
|
+
onFocus: f,
|
|
26
|
+
onBlur: g,
|
|
27
|
+
onKeyUp: v,
|
|
28
|
+
...N
|
|
29
|
+
}, b) => {
|
|
30
|
+
const i = I(), x = a && l, F = (c) => {
|
|
31
|
+
c.target.style.height = `${w}px`, c.target.style.height = `${c.target.scrollHeight + z}px`;
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ _(u, { children: [
|
|
34
|
+
n && /* @__PURE__ */ r("label", { htmlFor: i, className: t("label", { disabled: e }), children: n }),
|
|
35
|
+
/* @__PURE__ */ r(
|
|
36
|
+
"textarea",
|
|
37
|
+
{
|
|
38
|
+
id: i,
|
|
39
|
+
ref: b,
|
|
40
|
+
className: t("text-area", m, {
|
|
41
|
+
disabled: e,
|
|
42
|
+
error: a,
|
|
43
|
+
touched: l
|
|
44
|
+
}),
|
|
45
|
+
value: o,
|
|
46
|
+
placeholder: h,
|
|
47
|
+
disabled: e,
|
|
48
|
+
readOnly: d,
|
|
49
|
+
onChange: p,
|
|
50
|
+
onFocus: f,
|
|
51
|
+
onBlur: g,
|
|
52
|
+
onKeyUp: v,
|
|
53
|
+
onInput: F,
|
|
54
|
+
...N,
|
|
55
|
+
children: o
|
|
56
|
+
}
|
|
57
|
+
),
|
|
58
|
+
(x || s) && /* @__PURE__ */ _("div", { className: t("additional-content", { disabled: e }), children: [
|
|
59
|
+
x && /* @__PURE__ */ r("span", { className: t("error-text"), children: a }),
|
|
60
|
+
s && /* @__PURE__ */ r("span", { className: t("help-text"), children: s })
|
|
61
|
+
] })
|
|
62
|
+
] });
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
export {
|
|
66
|
+
G as F
|
|
67
|
+
};
|