@reportportal/ui-kit 0.0.1-alpha.4 → 0.0.1-alpha.41
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 +252 -3
- package/dist/baseIconButton-b6adc843.js +25 -0
- package/dist/baseIconButton.js +7 -0
- package/dist/bubblesLoader-a7e709d4.js +17 -0
- package/dist/bubblesLoader.js +7 -0
- package/dist/button-33c88abf.js +62 -0
- package/dist/button.js +1 -1
- package/dist/calendar-f154eb78.js +6 -0
- package/dist/checkbox-9a6c7ce1.js +73 -0
- package/dist/checkbox.js +2 -2
- package/dist/common/constants/keyCodes.d.ts +24 -0
- package/dist/components/bubblesLoader/bubblesLoader.d.ts +7 -0
- package/dist/components/bubblesLoader/index.d.ts +3 -0
- 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 +2 -1
- package/dist/components/dataPicker2/dataPicker2/datePicker.d.ts +24 -0
- package/dist/components/dataPicker2/dataPicker2/header/datePickerHeader.d.ts +15 -0
- package/dist/components/dataPicker2/dataPicker2/header/index.d.ts +3 -0
- package/dist/components/dataPicker2/dataPicker2/index.d.ts +3 -0
- package/dist/components/dataPicker2/dataPicker2/utils.d.ts +3 -0
- package/dist/components/date2/date2.d.ts +24 -0
- package/dist/components/date2/index.d.ts +3 -0
- package/dist/components/datePicker/datePicker.d.ts +24 -0
- package/dist/components/datePicker/header/datePickerHeader.d.ts +15 -0
- package/dist/components/datePicker/header/index.d.ts +3 -0
- package/dist/components/datePicker/index.d.ts +3 -0
- package/dist/components/datePicker/utils.d.ts +3 -0
- package/dist/components/datePicker1/datePicker.d.ts +24 -0
- package/dist/components/datePicker1/header/datePickerHeader.d.ts +15 -0
- package/dist/components/datePicker1/header/index.d.ts +3 -0
- package/dist/components/datePicker1/index.d.ts +3 -0
- package/dist/components/datePicker1/utils.d.ts +3 -0
- package/dist/components/dropdown/constants.d.ts +7 -0
- package/dist/components/dropdown/dropdown.d.ts +28 -0
- package/dist/components/dropdown/dropdownOption/dropdownOption.d.ts +3 -0
- package/dist/components/dropdown/dropdownOption/index.d.ts +3 -0
- package/dist/components/dropdown/index.d.ts +3 -0
- package/dist/components/dropdown/types.d.ts +22 -0
- package/dist/components/dropdown/utils.d.ts +4 -0
- package/dist/components/fieldNumber/constants.d.ts +4 -0
- package/dist/components/fieldNumber/fieldNumber.d.ts +18 -0
- package/dist/components/fieldNumber/index.d.ts +3 -0
- package/dist/components/fieldText/fieldText.d.ts +8 -3
- 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 +21 -0
- package/dist/components/index.d.ts +17 -0
- package/dist/components/modal/modal.d.ts +6 -2
- package/dist/components/modal/modalContent/modalContent.d.ts +1 -0
- package/dist/components/modal/modalHeader/modalHeader.d.ts +1 -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/bar/bar.d.ts +11 -0
- package/dist/components/pagination/pageControls/pageNavigator/bar/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageNavigator/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageNavigator/pageNavigator.d.ts +11 -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/spinLoader/index.d.ts +3 -0
- package/dist/components/spinLoader/spinLoader.d.ts +7 -0
- package/dist/components/systemAlert/index.d.ts +1 -0
- package/dist/components/systemAlert/systemAlert.d.ts +3 -0
- package/dist/components/systemAlert/types.d.ts +14 -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 +53 -0
- package/dist/components/table/utils.d.ts +3 -0
- package/dist/components/themeProvider/themeProvider.d.ts +2 -1
- package/dist/components/toggle/index.d.ts +3 -0
- package/dist/components/toggle/toggle.d.ts +11 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/tooltip.d.ts +19 -0
- package/dist/date2-9273411e.js +46 -0
- package/dist/date2.js +7 -0
- package/dist/datePicker-a005ebc6.js +194 -0
- package/dist/datePicker-e85bee1d.js +194 -0
- package/dist/datePicker.js +19 -0
- package/dist/datePicker1.js +19 -0
- package/dist/dropdown-9f4d1928.js +245 -0
- package/dist/dropdown.js +15 -0
- package/dist/fieldNumber-1f286b40.js +127 -0
- package/dist/fieldNumber.js +10 -0
- package/dist/fieldText-65e4c614.js +134 -0
- package/dist/fieldText.js +2 -1
- package/dist/fieldTextFlex-5bddf46a.js +67 -0
- package/dist/fieldTextFlex.js +8 -0
- package/dist/index-54e3bfc2.js +147 -0
- package/dist/index.js +303 -16
- package/dist/keyCodes-f63c0e11.js +4 -0
- package/dist/modal.js +14 -135
- package/dist/pagination-f087f454.js +346 -0
- package/dist/pagination.js +14 -0
- package/dist/popover.js +95 -0
- package/dist/radio-bccc84f2.js +76 -0
- package/dist/radio.js +9 -0
- package/dist/style.css +1 -1
- package/dist/systemMessage-1ced6079.js +30 -0
- package/dist/systemMessage.js +1 -1
- package/dist/table-9bf4ddab.js +147 -0
- package/dist/table.js +11 -0
- package/dist/themeProvider-46c2be7b.js +23 -0
- package/dist/themeProvider.js +4 -3
- package/dist/toggle-1a3aacb5.js +59 -0
- package/dist/toggle.js +9 -0
- package/dist/tooltip.js +96 -0
- package/dist/useOnClickOutside-c332f7d3.js +16 -0
- package/package.json +105 -66
- package/dist/button-d4944dbc.js +0 -64
- package/dist/checkbox-7736509c.js +0 -70
- package/dist/common/constants/key-codes.d.ts +0 -5
- package/dist/fieldText-9621b0b7.js +0 -99
- package/dist/key-codes-abbe7725.js +0 -4
- package/dist/systemMessage-62c3133d.js +0 -30
- package/dist/themeProvider-5800417e.js +0 -19
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { jsxs as g, jsx as i, Fragment as S } from "react/jsx-runtime";
|
|
2
|
+
import * as j from "react";
|
|
3
|
+
import { forwardRef as de, useState as $, useRef as oe } from "react";
|
|
4
|
+
import { c as Z } from "./bind-06a7ff84.js";
|
|
5
|
+
import { useFloating as le, offset as ce, flip as _e } from "@floating-ui/react-dom";
|
|
6
|
+
import { useSelect as k } from "downshift";
|
|
7
|
+
import { Scrollbars as he } from "rc-scrollbars";
|
|
8
|
+
import { u as ge } from "./useOnClickOutside-c332f7d3.js";
|
|
9
|
+
import { K as f } from "./keyCodes-f63c0e11.js";
|
|
10
|
+
import { B as pe } from "./baseIconButton-b6adc843.js";
|
|
11
|
+
import { C as fe } from "./checkbox-9a6c7ce1.js";
|
|
12
|
+
const Ce = (n) => /* @__PURE__ */ j.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n }, /* @__PURE__ */ j.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" })), me = "_disabled_1ppvi_12", ue = "_hidden_1ppvi_16", we = "_selected_1ppvi_22", be = "_hover_1ppvi_25", ye = {
|
|
13
|
+
"dropdown-option": "_dropdown-option_1ppvi_1",
|
|
14
|
+
disabled: me,
|
|
15
|
+
hidden: ue,
|
|
16
|
+
selected: we,
|
|
17
|
+
hover: be,
|
|
18
|
+
"single-option": "_single-option_1ppvi_38",
|
|
19
|
+
"sub-option": "_sub-option_1ppvi_45"
|
|
20
|
+
}, V = Z.bind(ye), U = de(
|
|
21
|
+
(n, e) => {
|
|
22
|
+
const {
|
|
23
|
+
option: { value: r, disabled: d, hidden: v, label: D, title: l, groupRef: s },
|
|
24
|
+
selected: m,
|
|
25
|
+
onChange: C,
|
|
26
|
+
render: u,
|
|
27
|
+
highlightHovered: w,
|
|
28
|
+
onMouseEnter: K,
|
|
29
|
+
multiSelect: b,
|
|
30
|
+
isPartiallyChecked: A = !1
|
|
31
|
+
} = n, x = (y) => {
|
|
32
|
+
(y.target instanceof HTMLDivElement || y.target instanceof HTMLInputElement) && (C == null || C(r));
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ g(
|
|
35
|
+
"div",
|
|
36
|
+
{
|
|
37
|
+
className: V("dropdown-option", {
|
|
38
|
+
selected: m,
|
|
39
|
+
disabled: d,
|
|
40
|
+
hidden: v,
|
|
41
|
+
hover: w
|
|
42
|
+
}),
|
|
43
|
+
title: l,
|
|
44
|
+
onClick: x,
|
|
45
|
+
ref: e,
|
|
46
|
+
onMouseEnter: K,
|
|
47
|
+
children: [
|
|
48
|
+
b && /* @__PURE__ */ i(fe, { value: !!m, partiallyChecked: A }),
|
|
49
|
+
/* @__PURE__ */ i("div", { className: V("single-option", { "sub-option": !!s }), children: u ? u(n) : D })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
), Oe = [
|
|
55
|
+
f.ENTER_KEY_CODE,
|
|
56
|
+
f.SPACE_KEY_CODE,
|
|
57
|
+
f.ARROW_DOWN_KEY_CODE
|
|
58
|
+
], Ee = [f.ESCAPE_KEY_CODE, f.TAB_KEY_CODE];
|
|
59
|
+
var p = /* @__PURE__ */ ((n) => (n.ON_KEY_DOWN = "onKeyDown", n.ON_CLICK = "onClick", n))(p || {});
|
|
60
|
+
const Ne = (n, e) => {
|
|
61
|
+
const r = Array.isArray(e) ? e : [e];
|
|
62
|
+
return n.findIndex(({ value: d }) => r.includes(d));
|
|
63
|
+
}, ve = (n, e) => (n % e + e) % e, L = (n, e = 0, r = 1) => {
|
|
64
|
+
if (!n[e].disabled)
|
|
65
|
+
return e;
|
|
66
|
+
const d = n.length;
|
|
67
|
+
return L(
|
|
68
|
+
n,
|
|
69
|
+
ve(e + r, d),
|
|
70
|
+
r
|
|
71
|
+
);
|
|
72
|
+
}, De = (n, e) => L(n, e), Ke = (n, e) => L(n, e, -1), Ae = "_container_re5ge_1", xe = "_icon_re5ge_7", Ie = "_arrow_re5ge_13", ke = "_dropdown_re5ge_19", Le = "_disabled_re5ge_36", Pe = "_value_re5ge_43", Re = "_error_re5ge_46", Ye = "_touched_re5ge_46", Te = "_opened_re5ge_50", He = "_placeholder_re5ge_72", Me = "_ghost_re5ge_118", We = "_divider_re5ge_132", Se = {
|
|
73
|
+
container: Ae,
|
|
74
|
+
icon: xe,
|
|
75
|
+
arrow: Ie,
|
|
76
|
+
dropdown: ke,
|
|
77
|
+
"transparent-background": "_transparent-background_re5ge_33",
|
|
78
|
+
disabled: Le,
|
|
79
|
+
value: Pe,
|
|
80
|
+
error: Re,
|
|
81
|
+
touched: Ye,
|
|
82
|
+
opened: Te,
|
|
83
|
+
placeholder: He,
|
|
84
|
+
"mobile-disabled": "_mobile-disabled_re5ge_87",
|
|
85
|
+
"select-list": "_select-list_re5ge_92",
|
|
86
|
+
"limited-width": "_limited-width_re5ge_109",
|
|
87
|
+
"options-container": "_options-container_re5ge_113",
|
|
88
|
+
ghost: Me,
|
|
89
|
+
divider: We
|
|
90
|
+
}, o = Z.bind(Se), Fe = ({
|
|
91
|
+
multiSelect: n = !1,
|
|
92
|
+
value: e = n ? [] : "",
|
|
93
|
+
options: r = [],
|
|
94
|
+
disabled: d = !1,
|
|
95
|
+
error: v,
|
|
96
|
+
onChange: D,
|
|
97
|
+
onFocus: l,
|
|
98
|
+
onBlur: s,
|
|
99
|
+
mobileDisabled: m,
|
|
100
|
+
title: C,
|
|
101
|
+
touched: u = !1,
|
|
102
|
+
icon: w,
|
|
103
|
+
variant: K,
|
|
104
|
+
placeholder: b = "",
|
|
105
|
+
renderOption: A,
|
|
106
|
+
transparentBackground: x = !1,
|
|
107
|
+
className: y,
|
|
108
|
+
toggleButtonClassName: q,
|
|
109
|
+
isListWidthLimited: z = !1,
|
|
110
|
+
optionAll: P = { value: "all", label: "All" },
|
|
111
|
+
isOptionAllVisible: G = !1,
|
|
112
|
+
onSelectAll: J,
|
|
113
|
+
footer: R
|
|
114
|
+
}) => {
|
|
115
|
+
const [c, h] = $(!1), Y = oe(null), [Q, O] = $(null), I = n && Array.isArray(e) ? r.filter((t) => e.includes(t.value)) : null, { refs: T, floatingStyles: X } = le({
|
|
116
|
+
middleware: [
|
|
117
|
+
ce(5),
|
|
118
|
+
_e({
|
|
119
|
+
fallbackPlacements: ["bottom", "top"]
|
|
120
|
+
})
|
|
121
|
+
]
|
|
122
|
+
});
|
|
123
|
+
ge(Y, () => {
|
|
124
|
+
c && (h(!1), s == null || s());
|
|
125
|
+
});
|
|
126
|
+
const H = (t) => {
|
|
127
|
+
t.disabled || (D(t.value), h((a) => n || !a));
|
|
128
|
+
}, F = () => r.find(({ value: t }) => t === e), M = Ne(r, e), {
|
|
129
|
+
getToggleButtonProps: B,
|
|
130
|
+
getMenuProps: ee,
|
|
131
|
+
getItemProps: te,
|
|
132
|
+
setHighlightedIndex: E,
|
|
133
|
+
highlightedIndex: W,
|
|
134
|
+
selectedItem: N
|
|
135
|
+
} = k({
|
|
136
|
+
items: r,
|
|
137
|
+
itemToString: (t) => (t != null && t.label ? String(t.label) : b) || "",
|
|
138
|
+
selectedItem: F(),
|
|
139
|
+
isOpen: c,
|
|
140
|
+
circularNavigation: !0,
|
|
141
|
+
defaultHighlightedIndex: M,
|
|
142
|
+
onHighlightedIndexChange: (t) => {
|
|
143
|
+
switch (t.type) {
|
|
144
|
+
case k.stateChangeTypes.MenuKeyDownArrowUp:
|
|
145
|
+
return O(p.ON_KEY_DOWN), E(Ke(r, t.highlightedIndex)), t;
|
|
146
|
+
case k.stateChangeTypes.MenuKeyDownArrowDown:
|
|
147
|
+
return O(p.ON_KEY_DOWN), E(De(r, t.highlightedIndex)), t;
|
|
148
|
+
default:
|
|
149
|
+
return t;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}), ne = () => {
|
|
153
|
+
d || (h((t) => !t), c ? s == null || s() : l == null || l(), O(p.ON_CLICK));
|
|
154
|
+
}, re = () => !e && e !== !1 && e !== 0 || Array.isArray(e) && !e.length ? b : n && Array.isArray(e) && r.length === e.length ? P.label : r.reduce((a, _) => ((Array.isArray(e) && e.includes(_.value) || _.value === e) && a.push(_.label), a), []).join(", "), se = (t) => {
|
|
155
|
+
const { keyCode: a } = t;
|
|
156
|
+
Oe.includes(a) && !c && (t.preventDefault(), E(M), h(!0), l == null || l(), O(p.ON_KEY_DOWN));
|
|
157
|
+
}, ae = (t) => {
|
|
158
|
+
const { keyCode: a } = t;
|
|
159
|
+
if (a === f.ENTER_KEY_CODE) {
|
|
160
|
+
const _ = r[W];
|
|
161
|
+
H(_), n || (h(!1), s == null || s());
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
Ee.includes(a) && (t.stopPropagation(), h(!1), s == null || s());
|
|
165
|
+
}, ie = () => /* @__PURE__ */ g("div", { className: o("options-container"), children: [
|
|
166
|
+
n && G && Array.isArray(e) && /* @__PURE__ */ g(S, { children: [
|
|
167
|
+
/* @__PURE__ */ i(
|
|
168
|
+
U,
|
|
169
|
+
{
|
|
170
|
+
option: P,
|
|
171
|
+
selected: e.length === r.length,
|
|
172
|
+
onChange: J,
|
|
173
|
+
multiSelect: n,
|
|
174
|
+
isPartiallyChecked: !!e.length
|
|
175
|
+
}
|
|
176
|
+
),
|
|
177
|
+
/* @__PURE__ */ i("div", { className: o("divider") }),
|
|
178
|
+
" "
|
|
179
|
+
] }),
|
|
180
|
+
r.map((t, a) => /* @__PURE__ */ i(
|
|
181
|
+
U,
|
|
182
|
+
{
|
|
183
|
+
...te({
|
|
184
|
+
item: t,
|
|
185
|
+
index: a
|
|
186
|
+
}),
|
|
187
|
+
multiSelect: n,
|
|
188
|
+
selected: n ? I == null ? void 0 : I.some((_) => _.value === t.value) : t.value === ((N == null ? void 0 : N.value) ?? N),
|
|
189
|
+
option: { title: t.label, ...t },
|
|
190
|
+
highlightHovered: W === a && Q !== p.ON_CLICK,
|
|
191
|
+
render: A,
|
|
192
|
+
onChange: t.disabled ? null : () => H(t),
|
|
193
|
+
onMouseEnter: () => E(a)
|
|
194
|
+
},
|
|
195
|
+
t.value
|
|
196
|
+
)),
|
|
197
|
+
R && /* @__PURE__ */ g(S, { children: [
|
|
198
|
+
/* @__PURE__ */ i("div", { className: o("divider") }),
|
|
199
|
+
R
|
|
200
|
+
] })
|
|
201
|
+
] });
|
|
202
|
+
return /* @__PURE__ */ g("div", { ref: Y, className: o("container", y), title: C, children: [
|
|
203
|
+
/* @__PURE__ */ g(
|
|
204
|
+
"button",
|
|
205
|
+
{
|
|
206
|
+
disabled: d,
|
|
207
|
+
...B({
|
|
208
|
+
className: o("dropdown", K, q, {
|
|
209
|
+
"transparent-background": x,
|
|
210
|
+
opened: c,
|
|
211
|
+
disabled: d,
|
|
212
|
+
error: v,
|
|
213
|
+
touched: u,
|
|
214
|
+
"mobile-disabled": m
|
|
215
|
+
}),
|
|
216
|
+
onClick: ne,
|
|
217
|
+
onKeyDown: se,
|
|
218
|
+
ref: T.setReference
|
|
219
|
+
}),
|
|
220
|
+
type: "button",
|
|
221
|
+
children: [
|
|
222
|
+
w && /* @__PURE__ */ i("span", { className: o("icon"), children: w }),
|
|
223
|
+
/* @__PURE__ */ i("span", { className: o("value", { placeholder: !e }), children: re() }),
|
|
224
|
+
/* @__PURE__ */ i(pe, { className: o("arrow"), tabIndex: -1, children: /* @__PURE__ */ i(Ce, {}) })
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
),
|
|
228
|
+
c && /* @__PURE__ */ i(
|
|
229
|
+
"div",
|
|
230
|
+
{
|
|
231
|
+
style: X,
|
|
232
|
+
className: o("select-list", { opened: c, "limited-width": z }),
|
|
233
|
+
...ee({
|
|
234
|
+
onKeyDown: ae,
|
|
235
|
+
ref: T.setFloating
|
|
236
|
+
}),
|
|
237
|
+
children: /* @__PURE__ */ i(he, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: ie() })
|
|
238
|
+
}
|
|
239
|
+
)
|
|
240
|
+
] });
|
|
241
|
+
};
|
|
242
|
+
export {
|
|
243
|
+
Fe as D,
|
|
244
|
+
Ce as S
|
|
245
|
+
};
|
package/dist/dropdown.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { D as r } from "./dropdown-9f4d1928.js";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
import "./bind-06a7ff84.js";
|
|
5
|
+
import "@floating-ui/react-dom";
|
|
6
|
+
import "downshift";
|
|
7
|
+
import "rc-scrollbars";
|
|
8
|
+
import "./useOnClickOutside-c332f7d3.js";
|
|
9
|
+
import "./keyCodes-f63c0e11.js";
|
|
10
|
+
import "./baseIconButton-b6adc843.js";
|
|
11
|
+
import "./checkbox-9a6c7ce1.js";
|
|
12
|
+
export {
|
|
13
|
+
r as Dropdown,
|
|
14
|
+
r as default
|
|
15
|
+
};
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsxs as w, jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import * as u 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 O } from "./baseIconButton-b6adc843.js";
|
|
7
|
+
const W = (n) => /* @__PURE__ */ u.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#C1C7D0", xmlns: "http://www.w3.org/2000/svg", ...n }, /* @__PURE__ */ u.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 = (n) => /* @__PURE__ */ u.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#C1C7D0", xmlns: "http://www.w3.org/2000/svg", ...n }, /* @__PURE__ */ u.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, f = 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_wswgu_6", b = "_label_wswgu_10", k = "_sign_wswgu_21", F = "_error_wswgu_36", H = "_touched_wswgu_36", V = "_filled_wswgu_44", P = "_input_wswgu_26", j = {
|
|
26
|
+
"field-number": "_field-number_wswgu_1",
|
|
27
|
+
disabled: I,
|
|
28
|
+
label: b,
|
|
29
|
+
sign: k,
|
|
30
|
+
"input-container": "_input-container_wswgu_26",
|
|
31
|
+
error: F,
|
|
32
|
+
touched: H,
|
|
33
|
+
filled: V,
|
|
34
|
+
"input-field": "_input-field_wswgu_51",
|
|
35
|
+
input: P
|
|
36
|
+
}, i = T.bind(j), z = ({
|
|
37
|
+
value: n = "",
|
|
38
|
+
placeholder: h = "0",
|
|
39
|
+
disabled: s = !1,
|
|
40
|
+
onChange: o,
|
|
41
|
+
onFocus: d,
|
|
42
|
+
onBlur: G,
|
|
43
|
+
label: K,
|
|
44
|
+
postfix: c = "",
|
|
45
|
+
min: r = 0,
|
|
46
|
+
max: E = Number.MAX_SAFE_INTEGER,
|
|
47
|
+
title: D,
|
|
48
|
+
error: p,
|
|
49
|
+
touched: g = !1,
|
|
50
|
+
...m
|
|
51
|
+
}) => {
|
|
52
|
+
const C = A(null), L = (_) => {
|
|
53
|
+
let t = _.target.value.replace(/^0(?=\d+|^\d)/g, "");
|
|
54
|
+
if (t === "") {
|
|
55
|
+
o("");
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
t = +t, t >= r && t <= E && o(t);
|
|
59
|
+
}, N = (_) => {
|
|
60
|
+
const { keyCode: t } = _;
|
|
61
|
+
S.includes(t) || (t < e.NUMBER_START_KEY_CODE || t > e.NUMBER_END_KEY_CODE || _.shiftKey) && _.preventDefault();
|
|
62
|
+
}, R = () => {
|
|
63
|
+
const _ = +n - 1;
|
|
64
|
+
_ >= r && _ <= E && o(_);
|
|
65
|
+
}, Y = () => {
|
|
66
|
+
const _ = +n + 1;
|
|
67
|
+
_ >= r && _ <= E && o(_);
|
|
68
|
+
}, a = h + c, M = B(() => {
|
|
69
|
+
let _ = (String(n) || a).length;
|
|
70
|
+
return c && !n && (_ += 1), _ > f ? `${f}ch` : `${_ || y}ch`;
|
|
71
|
+
}, [a, c, n]), U = () => {
|
|
72
|
+
C && C.current && C.current.focus(), d && d();
|
|
73
|
+
};
|
|
74
|
+
return /* @__PURE__ */ w("div", { className: i("field-number", { disabled: s }), children: [
|
|
75
|
+
K && /* @__PURE__ */ l("span", { className: i("label"), children: K }),
|
|
76
|
+
/* @__PURE__ */ w(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
className: i("input-container", {
|
|
80
|
+
filled: !!n || n === 0,
|
|
81
|
+
error: p,
|
|
82
|
+
disabled: s,
|
|
83
|
+
touched: g
|
|
84
|
+
}),
|
|
85
|
+
title: D,
|
|
86
|
+
children: [
|
|
87
|
+
/* @__PURE__ */ l(
|
|
88
|
+
O,
|
|
89
|
+
{
|
|
90
|
+
className: i("sign", "minus"),
|
|
91
|
+
disabled: s,
|
|
92
|
+
onClick: R,
|
|
93
|
+
children: /* @__PURE__ */ l(v, {})
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ w("span", { className: i("input-field", { disabled: s }), onClick: U, children: [
|
|
97
|
+
/* @__PURE__ */ l(
|
|
98
|
+
"input",
|
|
99
|
+
{
|
|
100
|
+
ref: C,
|
|
101
|
+
className: i("input"),
|
|
102
|
+
type: "number",
|
|
103
|
+
value: n,
|
|
104
|
+
placeholder: a,
|
|
105
|
+
disabled: s,
|
|
106
|
+
min: r,
|
|
107
|
+
max: E,
|
|
108
|
+
onKeyDown: s ? void 0 : N,
|
|
109
|
+
onChange: s ? void 0 : L,
|
|
110
|
+
onFocus: s ? void 0 : d,
|
|
111
|
+
style: { width: M },
|
|
112
|
+
...m
|
|
113
|
+
}
|
|
114
|
+
),
|
|
115
|
+
!!c && (n === 0 || !!n) && /* @__PURE__ */ l("span", { children: c.slice(0, 1) })
|
|
116
|
+
] }),
|
|
117
|
+
/* @__PURE__ */ l(O, { className: i("sign", "plus"), disabled: s, onClick: Y, children: /* @__PURE__ */ l(W, {}) })
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
] });
|
|
122
|
+
};
|
|
123
|
+
export {
|
|
124
|
+
z as F,
|
|
125
|
+
W as S,
|
|
126
|
+
v as a
|
|
127
|
+
};
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { jsx as e, jsxs as s, Fragment as w } from "react/jsx-runtime";
|
|
2
|
+
import * as k from "react";
|
|
3
|
+
import { forwardRef as K, useRef as O, useState as P } from "react";
|
|
4
|
+
import { c as C } from "./bind-06a7ff84.js";
|
|
5
|
+
import "./baseIconButton-b6adc843.js";
|
|
6
|
+
const Q = (t) => /* @__PURE__ */ k.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ k.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1 8C1 4.14001 4.14001 1 8 1C11.86 1 15 4.14001 15 8C15 11.8595 11.86 15 8 15C4.14001 15 1 11.8595 1 8ZM5 5.54545L5.54545 5L8 7.45455L10.4545 5L11 5.54545L8.54545 8L11 10.4545L10.4545 11L8 8.54545L5.54545 11L5 10.4545L7.45455 8L5 5.54545Z", fill: "#A2AAB5" })), T = "_collapsed_7ag8j_13", U = "_label_7ag8j_21", V = "_asterisk_7ag8j_30", W = "_disabled_7ag8j_36", X = "_field_7ag8j_41", Y = "_placeholder_7ag8j_62", I = "_error_7ag8j_69", nn = "_touched_7ag8j_69", en = "_input_7ag8j_84", tn = "_icon_7ag8j_1", an = "_text_7ag8j_175", sn = {
|
|
7
|
+
"icon-container": "_icon-container_7ag8j_1",
|
|
8
|
+
"icon-container-end": "_icon-container-end_7ag8j_1",
|
|
9
|
+
"icon-container-start": "_icon-container-start_7ag8j_1",
|
|
10
|
+
collapsed: T,
|
|
11
|
+
label: U,
|
|
12
|
+
asterisk: V,
|
|
13
|
+
disabled: W,
|
|
14
|
+
field: X,
|
|
15
|
+
"default-width": "_default-width_7ag8j_53",
|
|
16
|
+
placeholder: Y,
|
|
17
|
+
error: I,
|
|
18
|
+
touched: nn,
|
|
19
|
+
"input-container": "_input-container_7ag8j_84",
|
|
20
|
+
input: en,
|
|
21
|
+
icon: tn,
|
|
22
|
+
"start-icon": "_start-icon_7ag8j_131",
|
|
23
|
+
"clear-icon": "_clear-icon_7ag8j_132",
|
|
24
|
+
"additional-content": "_additional-content_7ag8j_168",
|
|
25
|
+
text: an,
|
|
26
|
+
"error-text": "_error-text_7ag8j_183",
|
|
27
|
+
"help-text": "_help-text_7ag8j_187"
|
|
28
|
+
}, cn = "_spinner_qn4ih_8", on = "_spin_qn4ih_1", ln = {
|
|
29
|
+
"spin-loader": "_spin-loader_qn4ih_1",
|
|
30
|
+
spinner: cn,
|
|
31
|
+
spin: on,
|
|
32
|
+
"color-topaz": "_color-topaz_qn4ih_20"
|
|
33
|
+
}, v = C.bind(ln), rn = ({ color: t = "topaz", className: o }) => /* @__PURE__ */ e("div", { className: v("spin-loader", o), children: /* @__PURE__ */ e("div", { className: v("spinner", { [`color-${t}`]: t }) }) }), n = C.bind(sn), un = K(
|
|
34
|
+
({
|
|
35
|
+
value: t = "",
|
|
36
|
+
className: o,
|
|
37
|
+
error: i,
|
|
38
|
+
placeholder: p,
|
|
39
|
+
disabled: c = !1,
|
|
40
|
+
onChange: F,
|
|
41
|
+
touched: h = !1,
|
|
42
|
+
title: R,
|
|
43
|
+
label: l,
|
|
44
|
+
helpText: r,
|
|
45
|
+
defaultWidth: b = !0,
|
|
46
|
+
startIcon: u,
|
|
47
|
+
endIcon: f,
|
|
48
|
+
clearable: B = !1,
|
|
49
|
+
onClear: m,
|
|
50
|
+
isRequired: g = !1,
|
|
51
|
+
hasDoubleMessage: E = !1,
|
|
52
|
+
type: S = "text",
|
|
53
|
+
displayError: q = !0,
|
|
54
|
+
collapsible: y = !1,
|
|
55
|
+
loading: z = !1,
|
|
56
|
+
onFocus: A = () => {
|
|
57
|
+
},
|
|
58
|
+
onBlur: $ = () => {
|
|
59
|
+
},
|
|
60
|
+
...H
|
|
61
|
+
}, M) => {
|
|
62
|
+
const Z = O(null), _ = M || Z, [j, x] = P(!1), D = (a) => {
|
|
63
|
+
x(!0), A(a);
|
|
64
|
+
}, G = (a) => {
|
|
65
|
+
x(!1), $(a);
|
|
66
|
+
}, J = () => {
|
|
67
|
+
var a;
|
|
68
|
+
m && (m(t), (a = _.current) == null || a.focus());
|
|
69
|
+
}, N = q && i && h, L = /* @__PURE__ */ e("span", { className: n("text", "help-text"), children: r });
|
|
70
|
+
return /* @__PURE__ */ s(w, { children: [
|
|
71
|
+
l && /* @__PURE__ */ s("span", { className: n("label", { disabled: c }), children: [
|
|
72
|
+
l,
|
|
73
|
+
g && /* @__PURE__ */ e("span", { className: n("asterisk"), children: "*" })
|
|
74
|
+
] }),
|
|
75
|
+
/* @__PURE__ */ s(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: n("field", o, {
|
|
79
|
+
error: i,
|
|
80
|
+
touched: h,
|
|
81
|
+
disabled: c,
|
|
82
|
+
"default-width": b,
|
|
83
|
+
collapsed: y && !j && !t
|
|
84
|
+
}),
|
|
85
|
+
title: R,
|
|
86
|
+
children: [
|
|
87
|
+
z ? /* @__PURE__ */ e(rn, {}) : u && /* @__PURE__ */ e(
|
|
88
|
+
"span",
|
|
89
|
+
{
|
|
90
|
+
className: n("icon-container-start"),
|
|
91
|
+
onClick: () => {
|
|
92
|
+
var d;
|
|
93
|
+
(d = _.current) == null || d.focus();
|
|
94
|
+
},
|
|
95
|
+
children: /* @__PURE__ */ e("span", { className: n("icon", { "start-icon": !j }), children: u })
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ s("span", { className: n("input-container"), children: [
|
|
99
|
+
/* @__PURE__ */ e(
|
|
100
|
+
"input",
|
|
101
|
+
{
|
|
102
|
+
ref: _,
|
|
103
|
+
type: S,
|
|
104
|
+
className: n("input"),
|
|
105
|
+
value: t,
|
|
106
|
+
disabled: c,
|
|
107
|
+
onChange: F,
|
|
108
|
+
onFocus: D,
|
|
109
|
+
onBlur: G,
|
|
110
|
+
...H
|
|
111
|
+
}
|
|
112
|
+
),
|
|
113
|
+
p && !t && /* @__PURE__ */ s("span", { className: n("placeholder"), children: [
|
|
114
|
+
p,
|
|
115
|
+
g && !l && /* @__PURE__ */ e("span", { className: n("asterisk") })
|
|
116
|
+
] })
|
|
117
|
+
] }),
|
|
118
|
+
f && /* @__PURE__ */ e("span", { className: n("icon-container-end"), children: /* @__PURE__ */ e("span", { className: n("icon"), children: f }) }),
|
|
119
|
+
B && 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(Q, {}) }) })
|
|
120
|
+
]
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
(N || r) && /* @__PURE__ */ e("div", { className: n("additional-content", { disabled: c }), children: N ? /* @__PURE__ */ s(w, { children: [
|
|
124
|
+
/* @__PURE__ */ e("span", { className: n("text", "error-text"), children: i }),
|
|
125
|
+
E && L
|
|
126
|
+
] }) : r && L })
|
|
127
|
+
] });
|
|
128
|
+
}
|
|
129
|
+
);
|
|
130
|
+
export {
|
|
131
|
+
un as F,
|
|
132
|
+
rn as S,
|
|
133
|
+
Q as a
|
|
134
|
+
};
|
package/dist/fieldText.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { F as o } from "./fieldText-
|
|
1
|
+
import { F as o } from "./fieldText-65e4c614.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./bind-06a7ff84.js";
|
|
5
|
+
import "./baseIconButton-b6adc843.js";
|
|
5
6
|
export {
|
|
6
7
|
o as FieldText,
|
|
7
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
|
+
};
|