@reportportal/ui-kit 0.0.1-alpha.5 → 0.0.1-alpha.7
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/bubblesLoader-9bec3797.js +17 -0
- package/dist/bubblesLoader.js +7 -0
- package/dist/checkbox-fdc44740.js +68 -0
- package/dist/checkbox.js +2 -2
- package/dist/clear-4963efcd.js +5 -0
- 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/checkbox/checkbox.d.ts +0 -1
- package/dist/components/dropdown/constants.d.ts +3 -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/icon/icon.d.ts +11 -0
- package/dist/components/icon/icons.d.ts +21 -0
- package/dist/components/icon/index.d.ts +3 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/toggle/index.d.ts +3 -0
- package/dist/components/toggle/toggle.d.ts +11 -0
- package/dist/dropdown-45e7bc7d.js +204 -0
- package/dist/dropdown.js +15 -0
- package/dist/fieldNumber-27e69676.js +132 -0
- package/dist/fieldNumber.js +11 -0
- package/dist/fieldText-c7085849.js +99 -0
- package/dist/fieldText.js +2 -1
- package/dist/icon-71262f5c.js +26 -0
- package/dist/icon.js +9 -0
- package/dist/index.js +27 -13
- package/dist/keyCodes-f63c0e11.js +4 -0
- package/dist/modal.js +85 -94
- package/dist/style.css +1 -1
- package/dist/toggle-5b3d8333.js +67 -0
- package/dist/toggle.js +9 -0
- package/dist/useOnClickOutside-c332f7d3.js +16 -0
- package/package.json +5 -2
- 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
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { jsxs as O, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as A, useMemo as T } from "react";
|
|
3
|
+
import { c as W } from "./bind-06a7ff84.js";
|
|
4
|
+
import { K as _ } from "./keyCodes-f63c0e11.js";
|
|
5
|
+
import { I as d } from "./icon-71262f5c.js";
|
|
6
|
+
const y = 5, D = 16, I = [
|
|
7
|
+
_.TAB_KEY_CODE,
|
|
8
|
+
_.BACKSPACE_KEY_CODE,
|
|
9
|
+
_.ARROW_LEFT_KEY_CODE,
|
|
10
|
+
_.ARROW_UP_KEY_CODE,
|
|
11
|
+
_.ARROW_RIGHT_KEY_CODE,
|
|
12
|
+
_.ARROW_DOWN_KEY_CODE,
|
|
13
|
+
_.DELETE_KEY_CODE,
|
|
14
|
+
_.NUM_LOCK_0_KEY_CODE,
|
|
15
|
+
_.NUM_LOCK_1_KEY_CODE,
|
|
16
|
+
_.NUM_LOCK_2_KEY_CODE,
|
|
17
|
+
_.NUM_LOCK_3_KEY_CODE,
|
|
18
|
+
_.NUM_LOCK_4_KEY_CODE,
|
|
19
|
+
_.NUM_LOCK_5_KEY_CODE,
|
|
20
|
+
_.NUM_LOCK_6_KEY_CODE,
|
|
21
|
+
_.NUM_LOCK_7_KEY_CODE,
|
|
22
|
+
_.NUM_LOCK_8_KEY_CODE,
|
|
23
|
+
_.NUM_LOCK_9_KEY_CODE
|
|
24
|
+
], w = "_disabled_12fgx_6", x = "_label_12fgx_10", b = "_sign_12fgx_21", k = "_error_12fgx_36", B = "_touched_12fgx_36", F = "_filled_12fgx_41", H = "_input_12fgx_26", S = {
|
|
25
|
+
"field-number": "_field-number_12fgx_1",
|
|
26
|
+
disabled: w,
|
|
27
|
+
label: x,
|
|
28
|
+
sign: b,
|
|
29
|
+
"input-container": "_input-container_12fgx_26",
|
|
30
|
+
error: k,
|
|
31
|
+
touched: B,
|
|
32
|
+
filled: F,
|
|
33
|
+
"input-field": "_input-field_12fgx_48",
|
|
34
|
+
input: H
|
|
35
|
+
}, c = W.bind(S), q = ({
|
|
36
|
+
value: e = "",
|
|
37
|
+
placeholder: a = "0",
|
|
38
|
+
disabled: s = !1,
|
|
39
|
+
onChange: l,
|
|
40
|
+
onFocus: f,
|
|
41
|
+
onBlur: V,
|
|
42
|
+
label: u,
|
|
43
|
+
postfix: i = "",
|
|
44
|
+
min: o = 0,
|
|
45
|
+
max: E = Number.MAX_SAFE_INTEGER,
|
|
46
|
+
title: p,
|
|
47
|
+
error: N,
|
|
48
|
+
touched: h = !1,
|
|
49
|
+
...m
|
|
50
|
+
}) => {
|
|
51
|
+
const C = A(null), Y = (n) => {
|
|
52
|
+
let t = n.target.value.replace(/^0(?=\d+|^\d)/g, "");
|
|
53
|
+
if (t === "") {
|
|
54
|
+
l("");
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
t = +t, t >= o && t <= E && l(t);
|
|
58
|
+
}, g = (n) => {
|
|
59
|
+
const { keyCode: t } = n;
|
|
60
|
+
I.includes(t) || (t < _.NUMBER_START_KEY_CODE || t > _.NUMBER_END_KEY_CODE || n.shiftKey) && n.preventDefault();
|
|
61
|
+
}, L = () => {
|
|
62
|
+
const n = +e - 1;
|
|
63
|
+
n >= o && n <= E && l(n);
|
|
64
|
+
}, M = () => {
|
|
65
|
+
const n = +e + 1;
|
|
66
|
+
n >= o && n <= E && l(n);
|
|
67
|
+
}, K = a + i, R = T(() => {
|
|
68
|
+
let n = (String(e) || K).length;
|
|
69
|
+
return i && !e && (n += 1), n > D ? `${D}ch` : `${n || y}ch`;
|
|
70
|
+
}, [K, i, e]), U = () => {
|
|
71
|
+
C && C.current && C.current.focus(), f && f();
|
|
72
|
+
};
|
|
73
|
+
return /* @__PURE__ */ O("div", { className: c("field-number", { disabled: s }), children: [
|
|
74
|
+
u && /* @__PURE__ */ r("span", { className: c("label"), children: u }),
|
|
75
|
+
/* @__PURE__ */ O(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: c("input-container", {
|
|
79
|
+
filled: !!e || e === 0,
|
|
80
|
+
error: N,
|
|
81
|
+
disabled: s,
|
|
82
|
+
touched: h
|
|
83
|
+
}),
|
|
84
|
+
title: p,
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ r(
|
|
87
|
+
d,
|
|
88
|
+
{
|
|
89
|
+
icon: "minus",
|
|
90
|
+
className: c("sign", "minus"),
|
|
91
|
+
disabled: s,
|
|
92
|
+
onClick: L
|
|
93
|
+
}
|
|
94
|
+
),
|
|
95
|
+
/* @__PURE__ */ O("span", { className: c("input-field", { disabled: s }), onClick: U, children: [
|
|
96
|
+
/* @__PURE__ */ r(
|
|
97
|
+
"input",
|
|
98
|
+
{
|
|
99
|
+
ref: C,
|
|
100
|
+
className: c("input"),
|
|
101
|
+
type: "number",
|
|
102
|
+
value: e,
|
|
103
|
+
placeholder: K,
|
|
104
|
+
disabled: s,
|
|
105
|
+
min: o,
|
|
106
|
+
max: E,
|
|
107
|
+
onKeyDown: s ? void 0 : g,
|
|
108
|
+
onChange: s ? void 0 : Y,
|
|
109
|
+
onFocus: s ? void 0 : f,
|
|
110
|
+
style: { width: R },
|
|
111
|
+
...m
|
|
112
|
+
}
|
|
113
|
+
),
|
|
114
|
+
!!i && (e === 0 || !!e) && /* @__PURE__ */ r("span", { children: i.slice(0, 1) })
|
|
115
|
+
] }),
|
|
116
|
+
/* @__PURE__ */ r(
|
|
117
|
+
d,
|
|
118
|
+
{
|
|
119
|
+
icon: "plus",
|
|
120
|
+
className: c("sign", "plus"),
|
|
121
|
+
disabled: s,
|
|
122
|
+
onClick: M
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
]
|
|
126
|
+
}
|
|
127
|
+
)
|
|
128
|
+
] });
|
|
129
|
+
};
|
|
130
|
+
export {
|
|
131
|
+
q as F
|
|
132
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { F as m } from "./fieldNumber-27e69676.js";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "react";
|
|
4
|
+
import "./bind-06a7ff84.js";
|
|
5
|
+
import "./keyCodes-f63c0e11.js";
|
|
6
|
+
import "./icon-71262f5c.js";
|
|
7
|
+
import "./clear-4963efcd.js";
|
|
8
|
+
export {
|
|
9
|
+
m as FieldNumber,
|
|
10
|
+
m as default
|
|
11
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { jsx as e, jsxs as t, Fragment as h } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as S } from "react";
|
|
3
|
+
import { c as v } from "./bind-06a7ff84.js";
|
|
4
|
+
import { S as C } from "./clear-4963efcd.js";
|
|
5
|
+
const E = "_label_11rxn_18", z = "_asterisk_11rxn_27", A = "_disabled_11rxn_33", B = "_field_11rxn_37", D = "_error_11rxn_51", G = "_touched_11rxn_51", H = "_input_11rxn_65", J = "_placeholder_11rxn_88", K = "_icon_11rxn_1", L = "_text_11rxn_151", M = {
|
|
6
|
+
"icon-container": "_icon-container_11rxn_1",
|
|
7
|
+
"icon-container-end": "_icon-container-end_11rxn_1",
|
|
8
|
+
"icon-container-start": "_icon-container-start_11rxn_1",
|
|
9
|
+
label: E,
|
|
10
|
+
asterisk: z,
|
|
11
|
+
disabled: A,
|
|
12
|
+
field: B,
|
|
13
|
+
error: D,
|
|
14
|
+
touched: G,
|
|
15
|
+
"default-width": "_default-width_11rxn_61",
|
|
16
|
+
"input-container": "_input-container_11rxn_65",
|
|
17
|
+
input: H,
|
|
18
|
+
placeholder: J,
|
|
19
|
+
icon: K,
|
|
20
|
+
"clear-icon": "_clear-icon_11rxn_108",
|
|
21
|
+
"additional-content": "_additional-content_11rxn_144",
|
|
22
|
+
text: L,
|
|
23
|
+
"error-text": "_error-text_11rxn_159",
|
|
24
|
+
"help-text": "_help-text_11rxn_163"
|
|
25
|
+
}, n = v.bind(M), T = S(
|
|
26
|
+
({
|
|
27
|
+
value: s,
|
|
28
|
+
className: f,
|
|
29
|
+
error: c,
|
|
30
|
+
placeholder: l,
|
|
31
|
+
disabled: a = !1,
|
|
32
|
+
onChange: N,
|
|
33
|
+
touched: r = !1,
|
|
34
|
+
title: u,
|
|
35
|
+
label: i,
|
|
36
|
+
helpText: o,
|
|
37
|
+
defaultWidth: k = !0,
|
|
38
|
+
startIcon: _,
|
|
39
|
+
endIcon: d,
|
|
40
|
+
clearable: b = !1,
|
|
41
|
+
onClear: x,
|
|
42
|
+
isRequired: p = !1,
|
|
43
|
+
hasDoubleMessage: w = !1,
|
|
44
|
+
type: F = "text",
|
|
45
|
+
...g
|
|
46
|
+
}, j) => {
|
|
47
|
+
const y = () => {
|
|
48
|
+
x && x(s);
|
|
49
|
+
}, m = /* @__PURE__ */ e("span", { className: n("text", "help-text"), children: o });
|
|
50
|
+
return /* @__PURE__ */ t(h, { children: [
|
|
51
|
+
i && /* @__PURE__ */ t("span", { className: n("label", { disabled: a }), children: [
|
|
52
|
+
i,
|
|
53
|
+
p && /* @__PURE__ */ e("span", { className: n("asterisk"), children: "*" })
|
|
54
|
+
] }),
|
|
55
|
+
/* @__PURE__ */ t(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: n("field", f, {
|
|
59
|
+
error: c,
|
|
60
|
+
touched: r,
|
|
61
|
+
disabled: a,
|
|
62
|
+
"default-width": k
|
|
63
|
+
}),
|
|
64
|
+
title: u,
|
|
65
|
+
children: [
|
|
66
|
+
_ && /* @__PURE__ */ e("span", { className: n("icon-container-start"), children: /* @__PURE__ */ e("span", { className: n("icon"), children: _ }) }),
|
|
67
|
+
/* @__PURE__ */ t("span", { className: n("input-container"), children: [
|
|
68
|
+
/* @__PURE__ */ e(
|
|
69
|
+
"input",
|
|
70
|
+
{
|
|
71
|
+
ref: j,
|
|
72
|
+
type: F,
|
|
73
|
+
className: n("input"),
|
|
74
|
+
value: s,
|
|
75
|
+
disabled: a,
|
|
76
|
+
onChange: N,
|
|
77
|
+
...g
|
|
78
|
+
}
|
|
79
|
+
),
|
|
80
|
+
l && !s && /* @__PURE__ */ t("span", { className: n("placeholder"), children: [
|
|
81
|
+
l,
|
|
82
|
+
p && !i && /* @__PURE__ */ e("span", { className: n("asterisk") })
|
|
83
|
+
] })
|
|
84
|
+
] }),
|
|
85
|
+
d && /* @__PURE__ */ e("span", { className: n("icon-container-end"), children: /* @__PURE__ */ e("span", { className: n("icon"), children: d }) }),
|
|
86
|
+
b && /* @__PURE__ */ e("span", { className: n("icon-container-end"), children: /* @__PURE__ */ e("button", { type: "button", className: n("clear-icon", { disabled: a }), onClick: y, children: /* @__PURE__ */ e(C, {}) }) })
|
|
87
|
+
]
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
(c && r || o) && /* @__PURE__ */ e("div", { className: n("additional-content", { disabled: a }), children: c && r ? /* @__PURE__ */ t(h, { children: [
|
|
91
|
+
/* @__PURE__ */ e("span", { className: n("text", "error-text"), children: c }),
|
|
92
|
+
w && m
|
|
93
|
+
] }) : o && m })
|
|
94
|
+
] });
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
export {
|
|
98
|
+
T as F
|
|
99
|
+
};
|
package/dist/fieldText.js
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { c as i } from "./bind-06a7ff84.js";
|
|
3
|
+
import { S as c } from "./clear-4963efcd.js";
|
|
4
|
+
import * as l from "react";
|
|
5
|
+
const L = (e) => /* @__PURE__ */ l.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__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" })), d = (e) => /* @__PURE__ */ l.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ l.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" })), a = (e) => /* @__PURE__ */ l.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ l.createElement("path", { d: "M9.80051 6.3661C9.95672 6.20989 10.21 6.20989 10.3662 6.3661L10.6338 6.63375C10.7901 6.78996 10.7901 7.04323 10.6338 7.19944L8.83331 8.99996L10.6338 10.8005C10.79 10.9567 10.79 11.2099 10.6338 11.3662L10.3662 11.6338C10.21 11.79 9.95669 11.79 9.80048 11.6338L7.99998 9.8333L6.19953 11.6338C6.04332 11.79 5.79005 11.79 5.63384 11.6338L5.36619 11.3661C5.20998 11.2099 5.20998 10.9566 5.36619 10.8004L7.16665 8.99996L5.36617 7.19949C5.20996 7.04328 5.20996 6.79001 5.36617 6.6338L5.63382 6.36615C5.79003 6.20994 6.04329 6.20994 6.1995 6.36615L7.99998 8.16663L9.80051 6.3661Z", fill: "#A2AAB5" }), /* @__PURE__ */ l.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M4.99878 3V2C4.99878 1.44772 5.44649 1 5.99878 1H9.99878C10.5511 1 10.9988 1.44772 10.9988 2V3H14.5C14.7761 3 15 3.22386 15 3.5C15 3.77614 14.7761 4 14.5 4H13.4167L12.6146 13.6246C12.5498 14.402 11.8999 15 11.1198 15H4.8802C4.10007 15 3.45017 14.402 3.38538 13.6246L2.58333 4H1.5C1.22386 4 1 3.77614 1 3.5C1 3.22386 1.22386 3 1.5 3H4.99878ZM5.99878 2H9.99878V3H5.99878V2ZM3.5868 4L4.38193 13.5415C4.40352 13.8007 4.62016 14 4.8802 14H11.1198C11.3798 14 11.5965 13.8007 11.6181 13.5415L12.4132 4H3.5868Z", fill: "#A2AAB5" })), r = (e) => /* @__PURE__ */ l.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#C1C7D0", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ l.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" })), w = (e) => /* @__PURE__ */ l.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#C1C7D0", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ l.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" })), v = {
|
|
6
|
+
clear: c,
|
|
7
|
+
close: L,
|
|
8
|
+
dropdown: d,
|
|
9
|
+
delete: a,
|
|
10
|
+
plus: r,
|
|
11
|
+
minus: w
|
|
12
|
+
}, g = "_icon_pgc7q_1", h = "_disabled_pgc7q_4", m = {
|
|
13
|
+
icon: g,
|
|
14
|
+
disabled: h
|
|
15
|
+
}, p = i.bind(m), A = ({
|
|
16
|
+
icon: e,
|
|
17
|
+
className: o,
|
|
18
|
+
disabled: t = !1,
|
|
19
|
+
onClick: s
|
|
20
|
+
}) => {
|
|
21
|
+
const C = v[e];
|
|
22
|
+
return /* @__PURE__ */ n("span", { className: p("icon", o, { disabled: t }), onClick: t ? void 0 : s, children: /* @__PURE__ */ n(C, {}) });
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
A as I
|
|
26
|
+
};
|
package/dist/icon.js
ADDED
package/dist/index.js
CHANGED
|
@@ -1,20 +1,34 @@
|
|
|
1
|
-
import { B as
|
|
2
|
-
import { C as
|
|
3
|
-
import { S as
|
|
4
|
-
import { F as
|
|
5
|
-
import { T as
|
|
6
|
-
import { Modal as
|
|
1
|
+
import { B as l } from "./button-d4944dbc.js";
|
|
2
|
+
import { C as b } from "./checkbox-fdc44740.js";
|
|
3
|
+
import { S as F } from "./systemMessage-62c3133d.js";
|
|
4
|
+
import { F as n } from "./fieldText-c7085849.js";
|
|
5
|
+
import { T as c } from "./themeProvider-5800417e.js";
|
|
6
|
+
import { Modal as C } from "./modal.js";
|
|
7
|
+
import { D as I } from "./dropdown-45e7bc7d.js";
|
|
8
|
+
import { T as S } from "./toggle-5b3d8333.js";
|
|
9
|
+
import { I as v } from "./icon-71262f5c.js";
|
|
10
|
+
import { F as y } from "./fieldNumber-27e69676.js";
|
|
11
|
+
import { B as N } from "./bubblesLoader-9bec3797.js";
|
|
7
12
|
import "react/jsx-runtime";
|
|
8
13
|
import "react";
|
|
9
14
|
import "./bind-06a7ff84.js";
|
|
10
|
-
import "./
|
|
15
|
+
import "./keyCodes-f63c0e11.js";
|
|
16
|
+
import "./clear-4963efcd.js";
|
|
11
17
|
import "rc-scrollbars";
|
|
12
18
|
import "framer-motion";
|
|
19
|
+
import "./useOnClickOutside-c332f7d3.js";
|
|
20
|
+
import "react-popper";
|
|
21
|
+
import "downshift";
|
|
13
22
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
N as BubblesLoader,
|
|
24
|
+
l as Button,
|
|
25
|
+
b as Checkbox,
|
|
26
|
+
I as Dropdown,
|
|
27
|
+
y as FieldNumber,
|
|
28
|
+
n as FieldText,
|
|
29
|
+
v as Icon,
|
|
30
|
+
C as Modal,
|
|
31
|
+
F as SystemMessage,
|
|
32
|
+
c as ThemeProvider,
|
|
33
|
+
S as Toggle
|
|
20
34
|
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
var E = /* @__PURE__ */ ((_) => (_[_.BACKSPACE_KEY_CODE = 8] = "BACKSPACE_KEY_CODE", _[_.TAB_KEY_CODE = 9] = "TAB_KEY_CODE", _[_.ENTER_KEY_CODE = 13] = "ENTER_KEY_CODE", _[_.ESCAPE_KEY_CODE = 27] = "ESCAPE_KEY_CODE", _[_.SPACE_KEY_CODE = 32] = "SPACE_KEY_CODE", _[_.ARROW_LEFT_KEY_CODE = 37] = "ARROW_LEFT_KEY_CODE", _[_.ARROW_UP_KEY_CODE = 38] = "ARROW_UP_KEY_CODE", _[_.ARROW_RIGHT_KEY_CODE = 39] = "ARROW_RIGHT_KEY_CODE", _[_.ARROW_DOWN_KEY_CODE = 40] = "ARROW_DOWN_KEY_CODE", _[_.DELETE_KEY_CODE = 46] = "DELETE_KEY_CODE", _[_.NUMBER_START_KEY_CODE = 48] = "NUMBER_START_KEY_CODE", _[_.NUMBER_END_KEY_CODE = 57] = "NUMBER_END_KEY_CODE", _[_.NUM_LOCK_0_KEY_CODE = 96] = "NUM_LOCK_0_KEY_CODE", _[_.NUM_LOCK_1_KEY_CODE = 97] = "NUM_LOCK_1_KEY_CODE", _[_.NUM_LOCK_2_KEY_CODE = 98] = "NUM_LOCK_2_KEY_CODE", _[_.NUM_LOCK_3_KEY_CODE = 99] = "NUM_LOCK_3_KEY_CODE", _[_.NUM_LOCK_4_KEY_CODE = 100] = "NUM_LOCK_4_KEY_CODE", _[_.NUM_LOCK_5_KEY_CODE = 101] = "NUM_LOCK_5_KEY_CODE", _[_.NUM_LOCK_6_KEY_CODE = 102] = "NUM_LOCK_6_KEY_CODE", _[_.NUM_LOCK_7_KEY_CODE = 103] = "NUM_LOCK_7_KEY_CODE", _[_.NUM_LOCK_8_KEY_CODE = 104] = "NUM_LOCK_8_KEY_CODE", _[_.NUM_LOCK_9_KEY_CODE = 105] = "NUM_LOCK_9_KEY_CODE", _))(E || {});
|
|
2
|
+
export {
|
|
3
|
+
E as K
|
|
4
|
+
};
|
package/dist/modal.js
CHANGED
|
@@ -1,75 +1,65 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { K as
|
|
8
|
-
import { B as
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (!n)
|
|
12
|
-
return;
|
|
13
|
-
const t = (i) => {
|
|
14
|
-
e && e.current && !e.current.contains(i.target) && n(i);
|
|
15
|
-
};
|
|
16
|
-
return document.addEventListener("pointerdown", t), () => {
|
|
17
|
-
document.removeEventListener("pointerdown", t);
|
|
18
|
-
};
|
|
19
|
-
}, [e, n]);
|
|
20
|
-
}
|
|
1
|
+
import { jsx as e, jsxs as l } from "react/jsx-runtime";
|
|
2
|
+
import { useState as w, useEffect as f, useRef as R } from "react";
|
|
3
|
+
import { Scrollbars as T } from "rc-scrollbars";
|
|
4
|
+
import { AnimatePresence as L, motion as W } from "framer-motion";
|
|
5
|
+
import { c as m } from "./bind-06a7ff84.js";
|
|
6
|
+
import { u as D } from "./useOnClickOutside-c332f7d3.js";
|
|
7
|
+
import { K as I } from "./keyCodes-f63c0e11.js";
|
|
8
|
+
import { B as b } from "./button-d4944dbc.js";
|
|
9
|
+
import { I as j } from "./icon-71262f5c.js";
|
|
10
|
+
import "./clear-4963efcd.js";
|
|
21
11
|
const K = () => {
|
|
22
|
-
const [
|
|
23
|
-
return
|
|
24
|
-
const
|
|
25
|
-
|
|
12
|
+
const [t, a] = w({ width: 0, height: 0 });
|
|
13
|
+
return f(() => {
|
|
14
|
+
const o = () => {
|
|
15
|
+
a({
|
|
26
16
|
width: window.innerWidth,
|
|
27
17
|
height: window.innerHeight
|
|
28
18
|
});
|
|
29
19
|
};
|
|
30
|
-
return window.addEventListener("resize",
|
|
31
|
-
}, []),
|
|
32
|
-
},
|
|
20
|
+
return window.addEventListener("resize", o), o(), () => window.removeEventListener("resize", o);
|
|
21
|
+
}, []), t;
|
|
22
|
+
}, F = {
|
|
33
23
|
"modal-content": "_modal-content_xak18_1"
|
|
34
|
-
},
|
|
24
|
+
}, P = m.bind(F), G = ({ children: t }) => /* @__PURE__ */ e("div", { className: P("modal-content"), children: t }), X = {
|
|
35
25
|
"buttons-block": "_buttons-block_1dgm4_1",
|
|
36
26
|
"button-container": "_button-container_1dgm4_5",
|
|
37
27
|
"modal-footer": "_modal-footer_1dgm4_14",
|
|
38
28
|
"with-extra-node": "_with-extra-node_1dgm4_21",
|
|
39
29
|
"size-small": "_size-small_1dgm4_25"
|
|
40
|
-
}, c =
|
|
41
|
-
footerNode:
|
|
42
|
-
closeHandler:
|
|
43
|
-
okButton:
|
|
44
|
-
cancelButton:
|
|
45
|
-
size:
|
|
46
|
-
}) => /* @__PURE__ */
|
|
47
|
-
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
|
|
30
|
+
}, c = m.bind(X), Y = ({
|
|
31
|
+
footerNode: t,
|
|
32
|
+
closeHandler: a,
|
|
33
|
+
okButton: o,
|
|
34
|
+
cancelButton: s,
|
|
35
|
+
size: i
|
|
36
|
+
}) => /* @__PURE__ */ l("div", { className: c("modal-footer", { "with-extra-node": t, [`size-${i}`]: i }), children: [
|
|
37
|
+
t && t,
|
|
38
|
+
/* @__PURE__ */ l("div", { className: c("buttons-block"), children: [
|
|
39
|
+
s && /* @__PURE__ */ e("div", { className: c("button-container"), children: /* @__PURE__ */ e(
|
|
40
|
+
b,
|
|
51
41
|
{
|
|
52
42
|
variant: "ghost",
|
|
53
|
-
adjustWidthOn:
|
|
54
|
-
onClick:
|
|
55
|
-
...
|
|
43
|
+
adjustWidthOn: i === "small" ? "parent" : "content",
|
|
44
|
+
onClick: a,
|
|
45
|
+
...s
|
|
56
46
|
}
|
|
57
47
|
) }),
|
|
58
|
-
|
|
48
|
+
o && /* @__PURE__ */ e("div", { className: c("button-container"), children: /* @__PURE__ */ e(b, { adjustWidthOn: i === "small" ? "parent" : "content", ...o }) })
|
|
59
49
|
] })
|
|
60
|
-
] }),
|
|
61
|
-
"modal-header": "_modal-
|
|
62
|
-
"modal-header-content": "_modal-header-
|
|
63
|
-
"modal-title": "_modal-
|
|
64
|
-
"close-modal-icon": "_close-modal-
|
|
65
|
-
}, r =
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
|
|
68
|
-
|
|
50
|
+
] }), q = {
|
|
51
|
+
"modal-header": "_modal-header_1d7tr_1",
|
|
52
|
+
"modal-header-content": "_modal-header-content_1d7tr_11",
|
|
53
|
+
"modal-title": "_modal-title_1d7tr_20",
|
|
54
|
+
"close-modal-icon": "_close-modal-icon_1d7tr_28"
|
|
55
|
+
}, r = m.bind(q), B = ({ title: t, onClose: a, headerNode: o }) => /* @__PURE__ */ l("div", { className: r("modal-header"), children: [
|
|
56
|
+
/* @__PURE__ */ l("div", { className: r("modal-header-content"), children: [
|
|
57
|
+
t && /* @__PURE__ */ e("span", { className: r("modal-title"), children: t }),
|
|
58
|
+
o && o
|
|
69
59
|
] }),
|
|
70
|
-
/* @__PURE__ */
|
|
71
|
-
] }),
|
|
72
|
-
modal:
|
|
60
|
+
/* @__PURE__ */ e(j, { icon: "close", className: r("close-modal-icon"), onClick: a })
|
|
61
|
+
] }), J = "_modal_8a5l_1", Q = {
|
|
62
|
+
modal: J,
|
|
73
63
|
"overlay-default": "_overlay-default_8a5l_11",
|
|
74
64
|
"overlay-light-cyan": "_overlay-light-cyan_8a5l_16",
|
|
75
65
|
"scrolling-content": "_scrolling-content_8a5l_21",
|
|
@@ -77,50 +67,51 @@ const K = () => {
|
|
|
77
67
|
"size-default": "_size-default_8a5l_45",
|
|
78
68
|
"size-small": "_size-small_8a5l_57",
|
|
79
69
|
"size-large": "_size-large_8a5l_69"
|
|
80
|
-
},
|
|
81
|
-
title:
|
|
82
|
-
headerNode:
|
|
83
|
-
children:
|
|
84
|
-
footerNode:
|
|
85
|
-
okButton:
|
|
86
|
-
cancelButton:
|
|
87
|
-
className:
|
|
88
|
-
size:
|
|
89
|
-
onClose:
|
|
70
|
+
}, E = m.bind(Q), U = 0.9, V = 176, ce = ({
|
|
71
|
+
title: t,
|
|
72
|
+
headerNode: a,
|
|
73
|
+
children: o,
|
|
74
|
+
footerNode: s,
|
|
75
|
+
okButton: i,
|
|
76
|
+
cancelButton: H,
|
|
77
|
+
className: M,
|
|
78
|
+
size: _ = "default",
|
|
79
|
+
onClose: z = () => {
|
|
90
80
|
},
|
|
91
|
-
overlay:
|
|
92
|
-
allowCloseOutside:
|
|
81
|
+
overlay: g = "default",
|
|
82
|
+
allowCloseOutside: N = !0
|
|
93
83
|
}) => {
|
|
94
|
-
const [
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
|
|
84
|
+
const [k, p] = w(!1), [C, O] = w(0), n = R(null), v = K(), y = v.height, $ = y * U, h = (y - C) / 2, A = $ - V, d = () => {
|
|
85
|
+
p(!1);
|
|
86
|
+
}, x = (u) => {
|
|
87
|
+
const { keyCode: S } = u;
|
|
88
|
+
S === I.ESCAPE_KEY_CODE && d();
|
|
98
89
|
};
|
|
99
|
-
return
|
|
100
|
-
if (
|
|
101
|
-
const { clientHeight:
|
|
102
|
-
O(
|
|
90
|
+
return f(() => {
|
|
91
|
+
if (n && n.current) {
|
|
92
|
+
const { clientHeight: u } = n.current;
|
|
93
|
+
O(u);
|
|
103
94
|
}
|
|
104
|
-
}, [
|
|
105
|
-
|
|
95
|
+
}, [o, v]), f(() => (p(!0), n && n.current && n.current.focus(), document.addEventListener("keydown", x, !1), () => document.removeEventListener("keydown", x, !1)), []), D(n, N ? d : void 0), /* @__PURE__ */ e(L, { onExitComplete: z, children: k && /* @__PURE__ */ e("div", { className: E("modal", { [`overlay-${g}`]: g }), children: /* @__PURE__ */ l(
|
|
96
|
+
W.div,
|
|
106
97
|
{
|
|
107
|
-
className:
|
|
108
|
-
ref:
|
|
98
|
+
className: E("modal-window", { [`size-${_}`]: _ }, M),
|
|
99
|
+
ref: n,
|
|
109
100
|
tabIndex: 0,
|
|
110
|
-
initial: { opacity: 0, marginTop: -
|
|
111
|
-
animate: { opacity: 1, marginTop:
|
|
112
|
-
exit: { opacity: 0, marginTop: -
|
|
101
|
+
initial: { opacity: 0, marginTop: -h },
|
|
102
|
+
animate: { opacity: 1, marginTop: h },
|
|
103
|
+
exit: { opacity: 0, marginTop: -h },
|
|
113
104
|
transition: { duration: 0.3 },
|
|
114
105
|
children: [
|
|
115
|
-
/* @__PURE__ */
|
|
116
|
-
/* @__PURE__ */
|
|
117
|
-
/* @__PURE__ */
|
|
118
|
-
|
|
106
|
+
/* @__PURE__ */ e(B, { title: t, headerNode: a, onClose: d }),
|
|
107
|
+
/* @__PURE__ */ e(T, { autoHeight: !0, autoHeightMax: A, hideTracksWhenNotNeeded: !0, children: /* @__PURE__ */ e(G, { children: o }) }),
|
|
108
|
+
/* @__PURE__ */ e(
|
|
109
|
+
Y,
|
|
119
110
|
{
|
|
120
|
-
size:
|
|
121
|
-
footerNode:
|
|
122
|
-
okButton:
|
|
123
|
-
cancelButton:
|
|
111
|
+
size: _,
|
|
112
|
+
footerNode: s,
|
|
113
|
+
okButton: i,
|
|
114
|
+
cancelButton: H,
|
|
124
115
|
closeHandler: d
|
|
125
116
|
}
|
|
126
117
|
)
|
|
@@ -130,8 +121,8 @@ const K = () => {
|
|
|
130
121
|
) }) });
|
|
131
122
|
};
|
|
132
123
|
export {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
124
|
+
ce as Modal,
|
|
125
|
+
G as ModalContent,
|
|
126
|
+
Y as ModalFooter,
|
|
127
|
+
B as ModalHeader
|
|
137
128
|
};
|