@reportportal/ui-kit 0.0.1-alpha.2 → 0.0.1-alpha.20
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 +229 -3
- package/dist/baseIconButton-7bc53dec.js +25 -0
- package/dist/baseIconButton.js +7 -0
- package/dist/bind-06a7ff84.js +41 -0
- package/dist/bubblesLoader-a7e709d4.js +17 -0
- package/dist/bubblesLoader.js +7 -0
- package/dist/button-bb309472.js +62 -0
- package/dist/button.js +2 -2
- package/dist/checkbox-6777be17.js +73 -0
- package/dist/checkbox.js +3 -2
- package/dist/common/constants/keyCodes.d.ts +24 -0
- package/dist/common/hooks/index.d.ts +2 -0
- package/dist/common/hooks/useOnClickOutside.d.ts +2 -0
- package/dist/common/hooks/useWindowResize.d.ts +4 -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 +6 -7
- package/dist/components/button/index.d.ts +2 -1
- package/dist/components/checkbox/checkbox.d.ts +5 -7
- 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/dropdown/constants.d.ts +7 -0
- package/dist/components/dropdown/dropdown.d.ts +24 -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 +20 -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 +24 -0
- package/dist/components/fieldText/index.d.ts +3 -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 +15 -0
- package/dist/components/index.d.ts +14 -0
- package/dist/components/modal/index.d.ts +4 -0
- package/dist/components/modal/modal.d.ts +23 -0
- package/dist/components/modal/modalContent/index.d.ts +1 -0
- package/dist/components/modal/modalContent/modalContent.d.ts +7 -0
- package/dist/components/modal/modalFooter/index.d.ts +2 -0
- package/dist/components/modal/modalFooter/modalFooter.d.ts +12 -0
- package/dist/components/modal/modalHeader/index.d.ts +1 -0
- package/dist/components/modal/modalHeader/modalHeader.d.ts +8 -0
- 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/table/index.d.ts +3 -0
- package/dist/components/table/table.d.ts +3 -0
- package/dist/components/table/types.d.ts +49 -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 +14 -0
- package/dist/dropdown-5d0eea6b.js +216 -0
- package/dist/dropdown.js +14 -0
- package/dist/fieldNumber-46fe79b9.js +127 -0
- package/dist/fieldNumber.js +10 -0
- package/dist/fieldText-98cf9984.js +102 -0
- package/dist/fieldText.js +9 -0
- package/dist/fieldTextFlex-5bddf46a.js +67 -0
- package/dist/fieldTextFlex.js +8 -0
- package/dist/index-bc6da711.js +147 -0
- package/dist/index.js +246 -11
- package/dist/keyCodes-f63c0e11.js +4 -0
- package/dist/modal.js +16 -0
- package/dist/pagination-13887e1c.js +346 -0
- package/dist/pagination.js +15 -0
- package/dist/popover.js +95 -0
- package/dist/radio-fd49a09c.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 +2 -2
- package/dist/table-4bc2c157.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-9284387b.js +67 -0
- package/dist/toggle.js +9 -0
- package/dist/tooltip.js +71 -0
- package/dist/useOnClickOutside-c332f7d3.js +16 -0
- package/package.json +96 -64
- package/dist/bind-e1346f99.js +0 -44
- package/dist/button-a4d3df83.js +0 -1867
- package/dist/checkbox-3fd4bcc1.js +0 -74
- package/dist/constants/key-codes.d.ts +0 -4
- package/dist/systemMessage-55cf51f4.js +0 -30
- package/dist/themeProvider-5800417e.js +0 -19
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { jsx as t, jsxs as a, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { forwardRef as R } from "react";
|
|
4
|
+
import { c as j } from "./bind-06a7ff84.js";
|
|
5
|
+
import "./baseIconButton-7bc53dec.js";
|
|
6
|
+
const y = (n) => /* @__PURE__ */ o.createElement("svg", { width: 17, height: 17, viewBox: "0 0 17 17", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n }, /* @__PURE__ */ o.createElement("rect", { width: 16.2089, height: 16.1568, rx: 8.07842, fill: "#A2AAB5" }), /* @__PURE__ */ o.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" })), B = "_label_4wu1a_18", S = "_asterisk_4wu1a_27", M = "_disabled_4wu1a_33", Z = "_field_4wu1a_38", z = "_error_4wu1a_53", D = "_touched_4wu1a_53", G = "_placeholder_4wu1a_64", H = "_input_4wu1a_71", J = "_icon_4wu1a_1", K = "_text_4wu1a_163", O = {
|
|
7
|
+
"icon-container": "_icon-container_4wu1a_1",
|
|
8
|
+
"icon-container-end": "_icon-container-end_4wu1a_1",
|
|
9
|
+
"icon-container-start": "_icon-container-start_4wu1a_1",
|
|
10
|
+
label: B,
|
|
11
|
+
asterisk: S,
|
|
12
|
+
disabled: M,
|
|
13
|
+
field: Z,
|
|
14
|
+
error: z,
|
|
15
|
+
touched: D,
|
|
16
|
+
placeholder: G,
|
|
17
|
+
"default-width": "_default-width_4wu1a_67",
|
|
18
|
+
"input-container": "_input-container_4wu1a_71",
|
|
19
|
+
input: H,
|
|
20
|
+
icon: J,
|
|
21
|
+
"clear-icon": "_clear-icon_4wu1a_117",
|
|
22
|
+
"additional-content": "_additional-content_4wu1a_156",
|
|
23
|
+
text: K,
|
|
24
|
+
"error-text": "_error-text_4wu1a_171",
|
|
25
|
+
"help-text": "_help-text_4wu1a_175"
|
|
26
|
+
}, e = j.bind(O), V = R(
|
|
27
|
+
({
|
|
28
|
+
value: n = "",
|
|
29
|
+
className: x,
|
|
30
|
+
error: s,
|
|
31
|
+
placeholder: r,
|
|
32
|
+
disabled: c = !1,
|
|
33
|
+
onChange: N,
|
|
34
|
+
touched: _ = !1,
|
|
35
|
+
title: C,
|
|
36
|
+
label: i,
|
|
37
|
+
helpText: l,
|
|
38
|
+
defaultWidth: g = !0,
|
|
39
|
+
startIcon: d,
|
|
40
|
+
endIcon: h,
|
|
41
|
+
clearable: L = !1,
|
|
42
|
+
onClear: p,
|
|
43
|
+
isRequired: u = !1,
|
|
44
|
+
hasDoubleMessage: k = !1,
|
|
45
|
+
type: v = "text",
|
|
46
|
+
displayError: E = !0,
|
|
47
|
+
...b
|
|
48
|
+
}, A) => {
|
|
49
|
+
const F = () => {
|
|
50
|
+
p && p(n);
|
|
51
|
+
}, m = E && s && _, w = /* @__PURE__ */ t("span", { className: e("text", "help-text"), children: l });
|
|
52
|
+
return /* @__PURE__ */ a(f, { children: [
|
|
53
|
+
i && /* @__PURE__ */ a("span", { className: e("label", { disabled: c }), children: [
|
|
54
|
+
i,
|
|
55
|
+
u && /* @__PURE__ */ t("span", { className: e("asterisk"), children: "*" })
|
|
56
|
+
] }),
|
|
57
|
+
/* @__PURE__ */ a(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
className: e("field", x, {
|
|
61
|
+
error: s,
|
|
62
|
+
touched: _,
|
|
63
|
+
disabled: c,
|
|
64
|
+
"default-width": g
|
|
65
|
+
}),
|
|
66
|
+
title: C,
|
|
67
|
+
children: [
|
|
68
|
+
d && /* @__PURE__ */ t("span", { className: e("icon-container-start"), children: /* @__PURE__ */ t("span", { className: e("icon"), children: d }) }),
|
|
69
|
+
/* @__PURE__ */ a("span", { className: e("input-container"), children: [
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
|
+
"input",
|
|
72
|
+
{
|
|
73
|
+
ref: A,
|
|
74
|
+
type: v,
|
|
75
|
+
className: e("input"),
|
|
76
|
+
value: n,
|
|
77
|
+
disabled: c,
|
|
78
|
+
onChange: N,
|
|
79
|
+
...b
|
|
80
|
+
}
|
|
81
|
+
),
|
|
82
|
+
r && !n && /* @__PURE__ */ a("span", { className: e("placeholder"), children: [
|
|
83
|
+
r,
|
|
84
|
+
u && !i && /* @__PURE__ */ t("span", { className: e("asterisk") })
|
|
85
|
+
] })
|
|
86
|
+
] }),
|
|
87
|
+
h && /* @__PURE__ */ t("span", { className: e("icon-container-end"), children: /* @__PURE__ */ t("span", { className: e("icon"), children: h }) }),
|
|
88
|
+
L && n.length > 0 && /* @__PURE__ */ t("span", { className: e("icon-container-end"), children: /* @__PURE__ */ t("button", { type: "button", className: e("clear-icon", { disabled: c }), onClick: F, children: /* @__PURE__ */ t(y, {}) }) })
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
(m || l) && /* @__PURE__ */ t("div", { className: e("additional-content", { disabled: c }), children: m ? /* @__PURE__ */ a(f, { children: [
|
|
93
|
+
/* @__PURE__ */ t("span", { className: e("text", "error-text"), children: s }),
|
|
94
|
+
k && w
|
|
95
|
+
] }) : l && w })
|
|
96
|
+
] });
|
|
97
|
+
}
|
|
98
|
+
);
|
|
99
|
+
export {
|
|
100
|
+
V as F,
|
|
101
|
+
y as S
|
|
102
|
+
};
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { jsx as e, jsxs as d, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import * as L from "react";
|
|
3
|
+
import { useState as g, useEffect as p, useRef as B } from "react";
|
|
4
|
+
import { Scrollbars as j } from "rc-scrollbars";
|
|
5
|
+
import { AnimatePresence as G, motion as K } from "framer-motion";
|
|
6
|
+
import { c as w } from "./bind-06a7ff84.js";
|
|
7
|
+
import { u as P } from "./useOnClickOutside-c332f7d3.js";
|
|
8
|
+
import { K as Y } from "./keyCodes-f63c0e11.js";
|
|
9
|
+
import { B as A } from "./button-bb309472.js";
|
|
10
|
+
import { B as F } from "./baseIconButton-7bc53dec.js";
|
|
11
|
+
const U = (o) => /* @__PURE__ */ L.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...o }, /* @__PURE__ */ L.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M0.732179 15.2698C0.330639 14.8683 0.33064 14.2172 0.73218 13.8157L6.54858 7.99928L0.73218 2.18288C0.33064 1.78134 0.330639 1.13031 0.732179 0.728774C1.13372 0.327235 1.78474 0.327235 2.18628 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.18628 15.2698C1.78474 15.6713 1.13372 15.6713 0.732179 15.2698Z", fill: "#A2AAB5" })), X = () => {
|
|
12
|
+
const [o, n] = g({ width: 0, height: 0 });
|
|
13
|
+
return p(() => {
|
|
14
|
+
const l = () => {
|
|
15
|
+
n({
|
|
16
|
+
width: window.innerWidth,
|
|
17
|
+
height: window.innerHeight
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
return window.addEventListener("resize", l), l(), () => window.removeEventListener("resize", l);
|
|
21
|
+
}, []), o;
|
|
22
|
+
}, Z = "_scrollable_qziry_12", J = {
|
|
23
|
+
"modal-content": "_modal-content_qziry_1",
|
|
24
|
+
scrollable: Z
|
|
25
|
+
}, Q = w.bind(J), N = ({ scrollable: o = !1, children: n }) => /* @__PURE__ */ e("div", { className: Q("modal-content", { scrollable: o }), children: n }), V = {
|
|
26
|
+
"buttons-block": "_buttons-block_1dgm4_1",
|
|
27
|
+
"button-container": "_button-container_1dgm4_5",
|
|
28
|
+
"modal-footer": "_modal-footer_1dgm4_14",
|
|
29
|
+
"with-extra-node": "_with-extra-node_1dgm4_21",
|
|
30
|
+
"size-small": "_size-small_1dgm4_25"
|
|
31
|
+
}, m = w.bind(V), ee = ({
|
|
32
|
+
footerNode: o,
|
|
33
|
+
closeHandler: n,
|
|
34
|
+
okButton: l,
|
|
35
|
+
cancelButton: r,
|
|
36
|
+
size: s
|
|
37
|
+
}) => /* @__PURE__ */ d("div", { className: m("modal-footer", { "with-extra-node": o, [`size-${s}`]: s }), children: [
|
|
38
|
+
o && o,
|
|
39
|
+
/* @__PURE__ */ d("div", { className: m("buttons-block"), children: [
|
|
40
|
+
r && /* @__PURE__ */ e("div", { className: m("button-container"), children: /* @__PURE__ */ e(
|
|
41
|
+
A,
|
|
42
|
+
{
|
|
43
|
+
variant: "ghost",
|
|
44
|
+
adjustWidthOn: s === "small" ? "parent" : "content",
|
|
45
|
+
onClick: n,
|
|
46
|
+
...r
|
|
47
|
+
}
|
|
48
|
+
) }),
|
|
49
|
+
l && /* @__PURE__ */ e("div", { className: m("button-container"), children: /* @__PURE__ */ e(A, { adjustWidthOn: s === "small" ? "parent" : "content", ...l }) })
|
|
50
|
+
] })
|
|
51
|
+
] }), oe = {
|
|
52
|
+
"modal-header": "_modal-header_68lru_1",
|
|
53
|
+
"width-description": "_width-description_68lru_10",
|
|
54
|
+
"modal-header-content": "_modal-header-content_68lru_14",
|
|
55
|
+
"modal-title": "_modal-title_68lru_20",
|
|
56
|
+
"close-modal-icon": "_close-modal-icon_68lru_29"
|
|
57
|
+
}, _ = w.bind(oe), te = ({ title: o, onClose: n, withDescription: l = !1 }) => /* @__PURE__ */ d("div", { className: _("modal-header", { "width-description": l }), children: [
|
|
58
|
+
/* @__PURE__ */ e("div", { className: _("modal-header-content"), children: o && /* @__PURE__ */ e("span", { className: _("modal-title"), children: o }) }),
|
|
59
|
+
/* @__PURE__ */ e(F, { className: _("close-modal-icon"), onClick: n, children: /* @__PURE__ */ e(U, {}) })
|
|
60
|
+
] }), ne = "_modal_lswqo_1", le = "_description_lswqo_42", se = "_scrollable_lswqo_52", ae = {
|
|
61
|
+
modal: ne,
|
|
62
|
+
"overlay-default": "_overlay-default_lswqo_11",
|
|
63
|
+
"overlay-light-cyan": "_overlay-light-cyan_lswqo_15",
|
|
64
|
+
"scrolling-content": "_scrolling-content_lswqo_19",
|
|
65
|
+
"modal-window": "_modal-window_lswqo_25",
|
|
66
|
+
description: le,
|
|
67
|
+
scrollable: se,
|
|
68
|
+
"size-default": "_size-default_lswqo_56",
|
|
69
|
+
"size-small": "_size-small_lswqo_68",
|
|
70
|
+
"size-large": "_size-large_lswqo_80"
|
|
71
|
+
}, h = w.bind(ae), ie = 0.9, de = 32 + 24, ce = 32 + 8, re = 36 + 16, me = 32 * 2, ye = ({
|
|
72
|
+
title: o,
|
|
73
|
+
children: n,
|
|
74
|
+
footerNode: l,
|
|
75
|
+
okButton: r,
|
|
76
|
+
cancelButton: s,
|
|
77
|
+
className: O,
|
|
78
|
+
size: u = "default",
|
|
79
|
+
onClose: z = () => {
|
|
80
|
+
},
|
|
81
|
+
overlay: v = "default",
|
|
82
|
+
zIndex: q = 2,
|
|
83
|
+
allowCloseOutside: D = !0,
|
|
84
|
+
scrollable: b = !1,
|
|
85
|
+
withoutFooter: y = !1,
|
|
86
|
+
createFooter: C = null,
|
|
87
|
+
description: a = null
|
|
88
|
+
}) => {
|
|
89
|
+
const [R, E] = g(!1), [S, T] = g(0), i = B(null), H = X(), x = H.height, I = x * ie, f = (x - S) / 2, $ = () => {
|
|
90
|
+
let t = I - me;
|
|
91
|
+
return y || (t = t - re), a ? t = t - ce : t = t - de, t;
|
|
92
|
+
}, c = () => {
|
|
93
|
+
E(!1);
|
|
94
|
+
}, M = (t) => {
|
|
95
|
+
const { keyCode: k } = t;
|
|
96
|
+
k === Y.ESCAPE_KEY_CODE && c();
|
|
97
|
+
};
|
|
98
|
+
return p(() => {
|
|
99
|
+
if (i && i.current) {
|
|
100
|
+
const { clientHeight: t } = i.current;
|
|
101
|
+
T(t);
|
|
102
|
+
}
|
|
103
|
+
}, [n, H]), p(() => (E(!0), document.addEventListener("keydown", M, !1), () => document.removeEventListener("keydown", M, !1)), []), P(i, D ? c : void 0), /* @__PURE__ */ e(G, { onExitComplete: z, children: R && /* @__PURE__ */ e("div", { className: h("modal", { [`overlay-${v}`]: v }), style: { zIndex: q }, children: /* @__PURE__ */ d(
|
|
104
|
+
K.div,
|
|
105
|
+
{
|
|
106
|
+
className: h("modal-window", { [`size-${u}`]: u }, O),
|
|
107
|
+
ref: i,
|
|
108
|
+
tabIndex: 0,
|
|
109
|
+
initial: { opacity: 0, marginTop: -f },
|
|
110
|
+
animate: { opacity: 1, marginTop: f },
|
|
111
|
+
exit: { opacity: 0, marginTop: -f },
|
|
112
|
+
transition: { duration: 0.3 },
|
|
113
|
+
onAnimationStart: () => {
|
|
114
|
+
var t;
|
|
115
|
+
return (t = i.current) == null ? void 0 : t.focus();
|
|
116
|
+
},
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ e(te, { title: o, onClose: c, withDescription: !!a }),
|
|
119
|
+
b ? /* @__PURE__ */ d(j, { autoHeight: !0, autoHeightMax: $(), hideTracksWhenNotNeeded: !0, children: [
|
|
120
|
+
a && /* @__PURE__ */ e("span", { className: h("description", { scrollable: b }), children: a }),
|
|
121
|
+
/* @__PURE__ */ e(N, { scrollable: !0, children: n })
|
|
122
|
+
] }) : /* @__PURE__ */ d(W, { children: [
|
|
123
|
+
a && /* @__PURE__ */ e("span", { className: h("description"), children: a }),
|
|
124
|
+
/* @__PURE__ */ e(N, { children: n })
|
|
125
|
+
] }),
|
|
126
|
+
!y && (C ? C(c) : /* @__PURE__ */ e(
|
|
127
|
+
ee,
|
|
128
|
+
{
|
|
129
|
+
size: u,
|
|
130
|
+
footerNode: l,
|
|
131
|
+
okButton: r,
|
|
132
|
+
cancelButton: s,
|
|
133
|
+
closeHandler: c
|
|
134
|
+
}
|
|
135
|
+
))
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
"modal-window"
|
|
139
|
+
) }) });
|
|
140
|
+
};
|
|
141
|
+
export {
|
|
142
|
+
ye as M,
|
|
143
|
+
U as S,
|
|
144
|
+
N as a,
|
|
145
|
+
te as b,
|
|
146
|
+
ee as c
|
|
147
|
+
};
|