@reportportal/ui-kit 0.0.1-alpha.10 → 0.0.1-alpha.101
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/README.md +70 -12
- package/dist/arrowUp-4a5caee7.js +6 -0
- package/dist/attachedFile.js +9 -0
- package/dist/baseIconButton-251479f7.js +25 -0
- package/dist/baseIconButton.js +1 -1
- package/dist/breadcrumbs-8e5ca8d7.js +183 -0
- package/dist/breadcrumbs.js +11 -0
- package/dist/bubblesLoader-f3ffa240.js +28 -0
- package/dist/bubblesLoader.js +1 -1
- package/dist/button-97d9e587.js +66 -0
- package/dist/button.js +1 -1
- package/dist/calendarArrow-44c7e60e.js +5 -0
- package/dist/checkbox-ed6cc375.js +73 -0
- package/dist/checkbox.js +1 -1
- package/dist/close-4d480ef7.js +5 -0
- package/dist/common/hooks/useOnClickOutside.d.ts +1 -0
- package/dist/common/types.d.ts +4 -0
- package/dist/common/utils/getFileExtension.d.ts +1 -0
- package/dist/common/utils/index.d.ts +1 -0
- package/dist/components/attachedFile/attachedFile.d.ts +14 -0
- package/dist/components/attachedFile/index.d.ts +2 -0
- package/dist/components/{icons/baseIconButton → baseIconButton}/baseIconButton.d.ts +1 -0
- package/dist/components/{icons/baseIconButton → baseIconButton}/index.d.ts +1 -0
- package/dist/components/breadcrumbs/breadcrumb/breadcrumb.d.ts +10 -0
- package/dist/components/breadcrumbs/breadcrumb/index.d.ts +1 -0
- package/dist/components/breadcrumbs/breadcrumbs.d.ts +3 -0
- package/dist/components/breadcrumbs/breadcrumbsProvider/breadcrumbsProvider.d.ts +13 -0
- package/dist/components/breadcrumbs/breadcrumbsProvider/hooks.d.ts +3 -0
- package/dist/components/breadcrumbs/breadcrumbsProvider/index.d.ts +1 -0
- package/dist/components/breadcrumbs/hiddenBreadcrumbs/hiddenBreadcrumbs.d.ts +6 -0
- package/dist/components/breadcrumbs/hiddenBreadcrumbs/index.d.ts +2 -0
- package/dist/components/breadcrumbs/index.d.ts +5 -0
- package/dist/components/breadcrumbs/tree/index.d.ts +1 -0
- package/dist/components/breadcrumbs/tree/tree.d.ts +7 -0
- package/dist/components/breadcrumbs/types.d.ts +24 -0
- package/dist/components/bubblesLoader/bubblesLoader.d.ts +2 -0
- package/dist/components/bubblesLoader/index.d.ts +1 -0
- package/dist/components/button/button.d.ts +5 -4
- package/dist/components/button/index.d.ts +1 -0
- package/dist/components/checkbox/checkbox.d.ts +3 -1
- package/dist/components/checkbox/index.d.ts +1 -0
- package/dist/components/datePicker/datePicker.d.ts +25 -0
- package/dist/components/datePicker/header/datePickerHeader.d.ts +16 -0
- package/dist/components/datePicker/header/index.d.ts +4 -0
- package/dist/components/datePicker/index.d.ts +5 -0
- package/dist/components/datePicker/utils.d.ts +4 -0
- package/dist/components/dropdown/constants.d.ts +1 -0
- package/dist/components/dropdown/dropdown.d.ts +14 -4
- package/dist/components/dropdown/dropdownOption/dropdownOption.d.ts +1 -0
- package/dist/components/dropdown/dropdownOption/index.d.ts +1 -0
- package/dist/components/dropdown/index.d.ts +1 -0
- package/dist/components/dropdown/types.d.ts +3 -0
- package/dist/components/dropdown/utils.d.ts +2 -1
- package/dist/components/fieldLabel/fieldLabel.d.ts +7 -0
- package/dist/components/fieldLabel/index.d.ts +1 -0
- package/dist/components/fieldNumber/constants.d.ts +1 -0
- package/dist/components/fieldNumber/fieldNumber.d.ts +3 -3
- package/dist/components/fieldNumber/index.d.ts +1 -0
- package/dist/components/fieldText/fieldText.d.ts +12 -4
- package/dist/components/fieldText/index.d.ts +1 -0
- package/dist/components/fieldTextFlex/fieldTextFlex.d.ts +4 -2
- package/dist/components/fieldTextFlex/index.d.ts +1 -0
- package/dist/components/fileDropArea/attachedFilesList/attachedFilesList.d.ts +20 -0
- package/dist/components/fileDropArea/attachedFilesList/index.d.ts +5 -0
- package/dist/components/fileDropArea/browseButton/browseButton.d.ts +9 -0
- package/dist/components/fileDropArea/browseButton/index.d.ts +4 -0
- package/dist/components/fileDropArea/constants.d.ts +2 -0
- package/dist/components/fileDropArea/dropZone/dropZone.d.ts +10 -0
- package/dist/components/fileDropArea/dropZone/index.d.ts +4 -0
- package/dist/components/fileDropArea/errorMessage/errorMessage.d.ts +5 -0
- package/dist/components/fileDropArea/errorMessage/index.d.ts +4 -0
- package/dist/components/fileDropArea/fileDropArea.d.ts +19 -0
- package/dist/components/fileDropArea/fileDropAreaProvider/fileDropAreaProvider.d.ts +17 -0
- package/dist/components/fileDropArea/fileDropAreaProvider/index.d.ts +1 -0
- package/dist/components/fileDropArea/fileDropAreaProvider/useFileDropAreaContext.d.ts +3 -0
- package/dist/components/fileDropArea/hooks/index.d.ts +1 -0
- package/dist/components/fileDropArea/hooks/useFileDropArea.d.ts +13 -0
- package/dist/components/fileDropArea/hooks/useFileProcessing.d.ts +13 -0
- package/dist/components/fileDropArea/hooks/useOverlayDropArea.d.ts +22 -0
- package/dist/components/fileDropArea/index.d.ts +6 -0
- package/dist/components/fileDropArea/types.d.ts +57 -0
- package/dist/components/fileDropArea/utils/getValidationErrorMessage.d.ts +3 -0
- package/dist/components/fileDropArea/utils/index.d.ts +2 -0
- package/dist/components/fileDropArea/utils/validateFile.d.ts +3 -0
- package/dist/components/icons/index.d.ts +52 -7
- package/dist/components/index.d.ts +18 -9
- package/dist/components/maxValueDisplay/index.d.ts +4 -0
- package/dist/components/maxValueDisplay/maxValueDisplay.d.ts +8 -0
- package/dist/components/maxValueDisplay/utils/index.d.ts +1 -0
- package/dist/components/maxValueDisplay/utils/isPositiveInteger.d.ts +1 -0
- package/dist/components/modal/modal.d.ts +7 -3
- package/dist/components/modal/modalContent/modalContent.d.ts +2 -0
- package/dist/components/modal/modalFooter/modalFooter.d.ts +3 -1
- package/dist/components/modal/modalHeader/modalHeader.d.ts +2 -1
- package/dist/components/modal/types.d.ts +6 -0
- package/dist/components/pagination/index.d.ts +1 -0
- package/dist/components/pagination/itemsCounter/itemCounter.d.ts +1 -0
- package/dist/components/pagination/pageControls/activePage/activePage.d.ts +1 -0
- package/dist/components/pagination/pageControls/activePage/pageSelector/pageSelector.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageControls.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageNavigator/bar/bar.d.ts +12 -0
- package/dist/components/pagination/pageControls/pageNavigator/bar/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageNavigator/pageNavigator.d.ts +4 -0
- package/dist/components/pagination/pageSizeControl/pageSizeControl.d.ts +1 -0
- package/dist/components/pagination/pageSizeControl/sizeSelector/sizeSelector.d.ts +1 -0
- package/dist/components/pagination/pagination.d.ts +1 -0
- package/dist/components/popover/index.d.ts +4 -1
- package/dist/components/popover/popover.d.ts +3 -2
- package/dist/components/radio/index.d.ts +1 -0
- package/dist/components/radio/radio.d.ts +1 -0
- package/dist/components/radio/radioGroup.d.ts +1 -0
- package/dist/components/selection/index.d.ts +5 -0
- package/dist/components/selection/selection.d.ts +12 -0
- package/dist/components/selection/types.d.ts +1 -0
- package/dist/components/spinLoader/index.d.ts +4 -0
- package/dist/components/spinLoader/spinLoader.d.ts +8 -0
- package/dist/components/systemAlert/index.d.ts +1 -0
- package/dist/components/systemAlert/systemAlert.d.ts +4 -0
- package/dist/components/systemAlert/types.d.ts +22 -0
- package/dist/components/systemMessage/index.d.ts +1 -0
- package/dist/components/systemMessage/systemMessage.d.ts +1 -0
- package/dist/components/table/constants.d.ts +2 -0
- package/dist/components/table/index.d.ts +1 -0
- package/dist/components/table/table.d.ts +1 -0
- package/dist/components/table/types.d.ts +13 -7
- package/dist/components/table/utils.d.ts +5 -1
- package/dist/components/themeProvider/index.d.ts +1 -0
- package/dist/components/themeProvider/themeProvider.d.ts +1 -0
- package/dist/components/toggle/index.d.ts +1 -0
- package/dist/components/toggle/toggle.d.ts +1 -0
- package/dist/components/tooltip/tooltip.d.ts +12 -2
- package/dist/datePicker-efa4e2d6.js +194 -0
- package/dist/datePicker.js +27 -0
- package/dist/dropdown-0260bb66.js +5 -0
- package/dist/dropdown-ec754bbe.js +289 -0
- package/dist/dropdown.js +5 -2
- package/dist/fieldLabel.js +18 -0
- package/dist/fieldNumber-4a22c986.js +131 -0
- package/dist/fieldNumber.js +4 -2
- package/dist/fieldText-ba8a917c.js +165 -0
- package/dist/fieldText.js +6 -2
- package/dist/fieldTextFlex-8afaab31.js +78 -0
- package/dist/fieldTextFlex.js +3 -1
- package/dist/fileDropArea.js +353 -0
- package/dist/fonts/OpenSans/OpenSans-Bold.ttf +0 -0
- package/dist/fonts/OpenSans/OpenSans-Medium.ttf +0 -0
- package/dist/icons.js +71 -0
- package/dist/index-e27a72a8.js +99 -0
- package/dist/index.js +128 -50
- package/dist/maxValueDisplay-9be01a75.js +13 -0
- package/dist/maxValueDisplay.js +6 -0
- package/dist/modal.js +153 -14
- package/dist/openEye-7b9cf080.js +7 -0
- package/dist/pagination-43330c73.js +347 -0
- package/dist/pagination.js +11 -4
- package/dist/plus-0929dda4.js +6 -0
- package/dist/popover.js +61 -57
- package/dist/prevPage-87faf576.js +6 -0
- package/dist/radio-62546efa.js +76 -0
- package/dist/radio.js +1 -1
- package/dist/selection-9124d029.js +38 -0
- package/dist/selection.js +10 -0
- package/dist/spinLoader-c4a53718.js +11 -0
- package/dist/spinLoader.js +7 -0
- package/dist/style.css +1 -1
- package/dist/success-8fd8bd2c.js +7 -0
- package/dist/systemAlert.js +69 -0
- package/dist/systemMessage-924fdaa6.js +30 -0
- package/dist/systemMessage.js +1 -1
- package/dist/table-920fdad9.js +142 -0
- package/dist/table.js +3 -3
- package/dist/toggle-304107fa.js +59 -0
- package/dist/toggle.js +1 -1
- package/dist/tooltip.js +87 -56
- package/dist/tree-c3dd3d45.js +6 -0
- package/dist/xls-995781cc.js +11 -0
- package/package.json +30 -16
- package/dist/baseIconButton-7bc53dec.js +0 -25
- package/dist/bubblesLoader-a7e709d4.js +0 -17
- package/dist/button-7fb84fde.js +0 -62
- package/dist/checkbox-4143390f.js +0 -70
- package/dist/dropdown-e07f2a71.js +0 -212
- package/dist/fieldNumber-46fe79b9.js +0 -127
- package/dist/fieldText-d80b29ba.js +0 -102
- package/dist/fieldTextFlex-5bddf46a.js +0 -67
- package/dist/index-bb9b62ef.js +0 -131
- package/dist/pagination-a36bc786.js +0 -274
- package/dist/radio-fd49a09c.js +0 -76
- package/dist/systemMessage-1ced6079.js +0 -30
- package/dist/table-d949a4ae.js +0 -132
- package/dist/toggle-707ecb74.js +0 -67
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import { jsx as e, jsxs as o, Fragment as b } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as W, useRef as X, useId as Y, useState as B } from "react";
|
|
3
|
+
import { c as Z } from "./bind-06a7ff84.js";
|
|
4
|
+
import { b as q, a as ee, S as ne } from "./openEye-7b9cf080.js";
|
|
5
|
+
import { B as te } from "./baseIconButton-251479f7.js";
|
|
6
|
+
import { S as se } from "./spinLoader-c4a53718.js";
|
|
7
|
+
import { M as oe } from "./maxValueDisplay-9be01a75.js";
|
|
8
|
+
import { FieldLabel as ae } from "./fieldLabel.js";
|
|
9
|
+
const ie = "_collapsed_uz1iu_13", ce = "_field_uz1iu_21", re = "_placeholder_uz1iu_46", le = "_disabled_uz1iu_49", ue = "_error_uz1iu_52", de = "_touched_uz1iu_52", _e = "_input_uz1iu_71", pe = "_icon_uz1iu_1", fe = "_text_uz1iu_169", me = {
|
|
10
|
+
"icon-container": "_icon-container_uz1iu_1",
|
|
11
|
+
"icon-container-end": "_icon-container-end_uz1iu_1",
|
|
12
|
+
"icon-container-start": "_icon-container-start_uz1iu_1",
|
|
13
|
+
collapsed: ie,
|
|
14
|
+
field: ce,
|
|
15
|
+
"default-width": "_default-width_uz1iu_33",
|
|
16
|
+
placeholder: re,
|
|
17
|
+
disabled: le,
|
|
18
|
+
error: ue,
|
|
19
|
+
touched: de,
|
|
20
|
+
"max-length-display": "_max-length-display_uz1iu_59",
|
|
21
|
+
"input-container": "_input-container_uz1iu_71",
|
|
22
|
+
"type-password": "_type-password_uz1iu_75",
|
|
23
|
+
input: _e,
|
|
24
|
+
"eye-icon": "_eye-icon_uz1iu_79",
|
|
25
|
+
icon: pe,
|
|
26
|
+
"start-icon": "_start-icon_uz1iu_125",
|
|
27
|
+
"clear-icon": "_clear-icon_uz1iu_126",
|
|
28
|
+
"additional-content": "_additional-content_uz1iu_162",
|
|
29
|
+
text: fe,
|
|
30
|
+
"error-text": "_error-text_uz1iu_189",
|
|
31
|
+
"help-text": "_help-text_uz1iu_193"
|
|
32
|
+
}, n = Z.bind(me), Se = W(
|
|
33
|
+
({
|
|
34
|
+
value: s = "",
|
|
35
|
+
className: E,
|
|
36
|
+
classNameHelpText: v,
|
|
37
|
+
error: r,
|
|
38
|
+
placeholder: p,
|
|
39
|
+
disabled: a = !1,
|
|
40
|
+
onChange: C,
|
|
41
|
+
touched: f = !1,
|
|
42
|
+
title: T,
|
|
43
|
+
label: l,
|
|
44
|
+
helpText: u,
|
|
45
|
+
defaultWidth: V = !0,
|
|
46
|
+
startIcon: m,
|
|
47
|
+
endIcon: h,
|
|
48
|
+
clearable: k = !1,
|
|
49
|
+
onClear: x,
|
|
50
|
+
isRequired: z = !1,
|
|
51
|
+
hasDoubleMessage: I = !1,
|
|
52
|
+
type: i = "text",
|
|
53
|
+
displayError: L = !0,
|
|
54
|
+
collapsible: P = !1,
|
|
55
|
+
loading: R = !1,
|
|
56
|
+
maxLengthDisplay: j,
|
|
57
|
+
onFocus: H = () => {
|
|
58
|
+
},
|
|
59
|
+
onBlur: O = () => {
|
|
60
|
+
},
|
|
61
|
+
...U
|
|
62
|
+
}, $) => {
|
|
63
|
+
const A = X(null), d = $ || A, w = Y(), [N, y] = B(!1), [g, F] = B(!1), G = (t) => {
|
|
64
|
+
y(!0), H(t);
|
|
65
|
+
}, J = (t) => {
|
|
66
|
+
y(!1), O(t);
|
|
67
|
+
}, K = () => {
|
|
68
|
+
var t;
|
|
69
|
+
x && (x(s), (t = d.current) == null || t.focus());
|
|
70
|
+
}, S = L && r && f, D = /* @__PURE__ */ e("span", { className: n("text", "help-text", v), children: u }), Q = () => i !== "password" ? i : g ? "text" : "password", M = (t) => {
|
|
71
|
+
t.preventDefault(), F(!0);
|
|
72
|
+
}, c = (t) => {
|
|
73
|
+
t.preventDefault(), F(!1);
|
|
74
|
+
};
|
|
75
|
+
return /* @__PURE__ */ o(b, { children: [
|
|
76
|
+
l && /* @__PURE__ */ e(ae, { isRequired: z, htmlFor: w, children: l }),
|
|
77
|
+
/* @__PURE__ */ o(
|
|
78
|
+
"div",
|
|
79
|
+
{
|
|
80
|
+
className: n("field", E, {
|
|
81
|
+
error: r,
|
|
82
|
+
touched: f,
|
|
83
|
+
disabled: a,
|
|
84
|
+
"default-width": V,
|
|
85
|
+
collapsed: P && !N && !s
|
|
86
|
+
}),
|
|
87
|
+
title: T,
|
|
88
|
+
children: [
|
|
89
|
+
R ? /* @__PURE__ */ e(se, {}) : m && /* @__PURE__ */ e(
|
|
90
|
+
"span",
|
|
91
|
+
{
|
|
92
|
+
className: n("icon-container-start"),
|
|
93
|
+
onClick: () => {
|
|
94
|
+
var _;
|
|
95
|
+
(_ = d.current) == null || _.focus();
|
|
96
|
+
},
|
|
97
|
+
children: /* @__PURE__ */ e("span", { className: n("icon", { "start-icon": !N }), children: m })
|
|
98
|
+
}
|
|
99
|
+
),
|
|
100
|
+
/* @__PURE__ */ o("span", { className: n("input-container", `type-${i}`), children: [
|
|
101
|
+
/* @__PURE__ */ e(
|
|
102
|
+
"input",
|
|
103
|
+
{
|
|
104
|
+
ref: d,
|
|
105
|
+
type: Q(),
|
|
106
|
+
className: n("input"),
|
|
107
|
+
value: s,
|
|
108
|
+
disabled: a,
|
|
109
|
+
id: w,
|
|
110
|
+
onChange: C,
|
|
111
|
+
onFocus: G,
|
|
112
|
+
onBlur: J,
|
|
113
|
+
...U
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
i === "password" && s && /* @__PURE__ */ e(
|
|
117
|
+
te,
|
|
118
|
+
{
|
|
119
|
+
className: n("eye-icon"),
|
|
120
|
+
onMouseDown: M,
|
|
121
|
+
onMouseLeave: c,
|
|
122
|
+
onMouseUp: c,
|
|
123
|
+
onTouchStart: M,
|
|
124
|
+
onTouchEnd: c,
|
|
125
|
+
onTouchCancel: c,
|
|
126
|
+
children: g ? /* @__PURE__ */ e(q, {}) : /* @__PURE__ */ e(ee, {})
|
|
127
|
+
}
|
|
128
|
+
),
|
|
129
|
+
p && !s && /* @__PURE__ */ o("span", { className: n("placeholder"), children: [
|
|
130
|
+
p,
|
|
131
|
+
z && !l && /* @__PURE__ */ e("span", { className: n("asterisk") })
|
|
132
|
+
] })
|
|
133
|
+
] }),
|
|
134
|
+
/* @__PURE__ */ e(
|
|
135
|
+
oe,
|
|
136
|
+
{
|
|
137
|
+
className: n("max-length-display"),
|
|
138
|
+
value: s.length,
|
|
139
|
+
maxValue: j
|
|
140
|
+
}
|
|
141
|
+
),
|
|
142
|
+
h && /* @__PURE__ */ e("span", { className: n("icon-container-end"), children: /* @__PURE__ */ e("span", { className: n("icon"), children: h }) }),
|
|
143
|
+
k && s.length > 0 && /* @__PURE__ */ e("span", { className: n("icon-container-end"), children: /* @__PURE__ */ e(
|
|
144
|
+
"button",
|
|
145
|
+
{
|
|
146
|
+
type: "button",
|
|
147
|
+
className: n("clear-icon", { disabled: a }),
|
|
148
|
+
onClick: K,
|
|
149
|
+
onMouseDown: (t) => t.preventDefault(),
|
|
150
|
+
children: /* @__PURE__ */ e(ne, {})
|
|
151
|
+
}
|
|
152
|
+
) })
|
|
153
|
+
]
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
(S || u) && /* @__PURE__ */ e("div", { className: n("additional-content", { disabled: a }), children: S ? /* @__PURE__ */ o(b, { children: [
|
|
157
|
+
/* @__PURE__ */ e("span", { className: n("text", "error-text"), children: r }),
|
|
158
|
+
I && D
|
|
159
|
+
] }) : u && D })
|
|
160
|
+
] });
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
export {
|
|
164
|
+
Se as F
|
|
165
|
+
};
|
package/dist/fieldText.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
import { F as o } from "./fieldText-
|
|
1
|
+
import { F as o } from "./fieldText-ba8a917c.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./bind-06a7ff84.js";
|
|
5
|
-
import "./
|
|
5
|
+
import "./openEye-7b9cf080.js";
|
|
6
|
+
import "./baseIconButton-251479f7.js";
|
|
7
|
+
import "./spinLoader-c4a53718.js";
|
|
8
|
+
import "./maxValueDisplay-9be01a75.js";
|
|
9
|
+
import "./fieldLabel.js";
|
|
6
10
|
export {
|
|
7
11
|
o as FieldText,
|
|
8
12
|
o as default
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsxs as _, Fragment as I, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { c as E } from "./bind-06a7ff84.js";
|
|
3
|
+
import { forwardRef as R, useId as j } from "react";
|
|
4
|
+
import { M as D } from "./maxValueDisplay-9be01a75.js";
|
|
5
|
+
import { FieldLabel as M } from "./fieldLabel.js";
|
|
6
|
+
const O = "_disabled_s8aoo_17", V = "_error_s8aoo_20", $ = "_touched_s8aoo_20", b = {
|
|
7
|
+
"text-area": "_text-area_s8aoo_1",
|
|
8
|
+
disabled: O,
|
|
9
|
+
error: V,
|
|
10
|
+
touched: $,
|
|
11
|
+
"max-length-display": "_max-length-display_s8aoo_27",
|
|
12
|
+
"additional-content": "_additional-content_s8aoo_46",
|
|
13
|
+
"error-text": "_error-text_s8aoo_46",
|
|
14
|
+
"help-text": "_help-text_s8aoo_54"
|
|
15
|
+
}, t = E.bind(b), w = 72, z = 2, q = R(
|
|
16
|
+
({
|
|
17
|
+
value: s = "",
|
|
18
|
+
readonly: m = !1,
|
|
19
|
+
error: o = "",
|
|
20
|
+
placeholder: x = "",
|
|
21
|
+
disabled: e = !1,
|
|
22
|
+
touched: n = !1,
|
|
23
|
+
className: h = "",
|
|
24
|
+
label: c = "",
|
|
25
|
+
helpText: r = "",
|
|
26
|
+
maxLengthDisplay: p,
|
|
27
|
+
onChange: g,
|
|
28
|
+
onFocus: f,
|
|
29
|
+
onBlur: y,
|
|
30
|
+
onKeyUp: N,
|
|
31
|
+
...u
|
|
32
|
+
}, F) => {
|
|
33
|
+
const i = j(), d = o && n, H = (l) => {
|
|
34
|
+
l.target.style.height = `${w}px`, l.target.style.height = `${l.target.scrollHeight + z}px`;
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ _(I, { children: [
|
|
37
|
+
c && /* @__PURE__ */ a(M, { htmlFor: i, className: t({ disabled: e }), children: c }),
|
|
38
|
+
/* @__PURE__ */ a(
|
|
39
|
+
"textarea",
|
|
40
|
+
{
|
|
41
|
+
id: i,
|
|
42
|
+
ref: F,
|
|
43
|
+
className: t("text-area", h, {
|
|
44
|
+
disabled: e,
|
|
45
|
+
error: o,
|
|
46
|
+
touched: n
|
|
47
|
+
}),
|
|
48
|
+
value: s,
|
|
49
|
+
placeholder: x,
|
|
50
|
+
disabled: e,
|
|
51
|
+
readOnly: m,
|
|
52
|
+
onChange: g,
|
|
53
|
+
onFocus: f,
|
|
54
|
+
onBlur: y,
|
|
55
|
+
onKeyUp: N,
|
|
56
|
+
onInput: H,
|
|
57
|
+
...u,
|
|
58
|
+
children: s
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
/* @__PURE__ */ a(
|
|
62
|
+
D,
|
|
63
|
+
{
|
|
64
|
+
className: t("max-length-display"),
|
|
65
|
+
value: s.length,
|
|
66
|
+
maxValue: p
|
|
67
|
+
}
|
|
68
|
+
),
|
|
69
|
+
(d || r) && /* @__PURE__ */ _("div", { className: t("additional-content", { disabled: e }), children: [
|
|
70
|
+
d && /* @__PURE__ */ a("span", { className: t("error-text"), children: o }),
|
|
71
|
+
r && /* @__PURE__ */ a("span", { className: t("help-text"), children: r })
|
|
72
|
+
] })
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
export {
|
|
77
|
+
q as F
|
|
78
|
+
};
|
package/dist/fieldTextFlex.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { F as o } from "./fieldTextFlex-
|
|
1
|
+
import { F as o } from "./fieldTextFlex-8afaab31.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "./bind-06a7ff84.js";
|
|
4
4
|
import "react";
|
|
5
|
+
import "./maxValueDisplay-9be01a75.js";
|
|
6
|
+
import "./fieldLabel.js";
|
|
5
7
|
export {
|
|
6
8
|
o as FieldTextFlex,
|
|
7
9
|
o as default
|
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
import { jsx as f, jsxs as F } from "react/jsx-runtime";
|
|
2
|
+
import { c as h } from "./bind-06a7ff84.js";
|
|
3
|
+
import { useState as C, useCallback as d, useRef as A, createContext as L, useMemo as z, useContext as M } from "react";
|
|
4
|
+
import { g as k, A as B } from "./index-e27a72a8.js";
|
|
5
|
+
import { B as S } from "./button-97d9e587.js";
|
|
6
|
+
import w from "react-dropzone";
|
|
7
|
+
import "./close-4d480ef7.js";
|
|
8
|
+
import "./xls-995781cc.js";
|
|
9
|
+
function P(e) {
|
|
10
|
+
return Number.isSafeInteger(e) && e >= 0;
|
|
11
|
+
}
|
|
12
|
+
function U(e) {
|
|
13
|
+
return e != null && typeof e != "function" && P(e.length);
|
|
14
|
+
}
|
|
15
|
+
function Z(e) {
|
|
16
|
+
return e == null ? e === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(e);
|
|
17
|
+
}
|
|
18
|
+
function V(e) {
|
|
19
|
+
return ArrayBuffer.isView(e) && !(e instanceof DataView);
|
|
20
|
+
}
|
|
21
|
+
function $(e) {
|
|
22
|
+
return e !== null && typeof e == "object" && Z(e) === "[object Arguments]";
|
|
23
|
+
}
|
|
24
|
+
function W(e) {
|
|
25
|
+
const r = e == null ? void 0 : e.constructor, t = typeof r == "function" ? r.prototype : Object.prototype;
|
|
26
|
+
return e === t;
|
|
27
|
+
}
|
|
28
|
+
function X(e) {
|
|
29
|
+
return V(e);
|
|
30
|
+
}
|
|
31
|
+
function E(e) {
|
|
32
|
+
if (e == null)
|
|
33
|
+
return !0;
|
|
34
|
+
if (U(e))
|
|
35
|
+
return typeof e.splice != "function" && typeof e != "string" && (typeof Buffer > "u" || !Buffer.isBuffer(e)) && !X(e) && !$(e) ? !1 : e.length === 0;
|
|
36
|
+
if (typeof e == "object") {
|
|
37
|
+
if (e instanceof Map || e instanceof Set)
|
|
38
|
+
return e.size === 0;
|
|
39
|
+
const r = Object.keys(e);
|
|
40
|
+
return W(e) ? r.filter((t) => t !== "constructor").length === 0 : r.length === 0;
|
|
41
|
+
}
|
|
42
|
+
return !0;
|
|
43
|
+
}
|
|
44
|
+
const me = {
|
|
45
|
+
png: "image/png",
|
|
46
|
+
jpeg: "image/jpeg",
|
|
47
|
+
gif: "image/gif",
|
|
48
|
+
svg: "image/svg+xml",
|
|
49
|
+
webp: "image/webp",
|
|
50
|
+
pdf: "application/pdf",
|
|
51
|
+
doc: "application/msword",
|
|
52
|
+
docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
53
|
+
xls: "application/vnd.ms-excel",
|
|
54
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
55
|
+
csv: "text/csv",
|
|
56
|
+
txt: "text/plain",
|
|
57
|
+
zip: "application/zip",
|
|
58
|
+
mp4: "video/mp4",
|
|
59
|
+
mov: "video/quicktime",
|
|
60
|
+
avi: "video/x-msvideo",
|
|
61
|
+
xml: "application/xml",
|
|
62
|
+
html: "text/html",
|
|
63
|
+
javascript: "application/javascript",
|
|
64
|
+
json: "application/json",
|
|
65
|
+
css: "text/css",
|
|
66
|
+
php: "application/x-httpd-php",
|
|
67
|
+
har: "application/json",
|
|
68
|
+
rar: "application/vnd.rar",
|
|
69
|
+
tgz: "application/gzip",
|
|
70
|
+
taz: "application/x-compress",
|
|
71
|
+
tar: "application/x-tar",
|
|
72
|
+
gzip: "application/gzip",
|
|
73
|
+
plain: "text/plain",
|
|
74
|
+
image: "image/*",
|
|
75
|
+
jar: "application/java-archive",
|
|
76
|
+
gtar: "application/x-gtar",
|
|
77
|
+
kml: "application/vnd.google-earth.kml+xml"
|
|
78
|
+
};
|
|
79
|
+
var g = /* @__PURE__ */ ((e) => (e.INCORRECT_FILE_SIZE = "INCORRECT_FILE_SIZE", e.INCORRECT_FILE_FORMAT = "INCORRECT_FILE_FORMAT", e))(g || {});
|
|
80
|
+
const q = (e, r) => {
|
|
81
|
+
const { maxFileSize: t, acceptFileMimeTypes: i = [] } = r, n = [];
|
|
82
|
+
if (t && e.size > t && n.push(g.INCORRECT_FILE_SIZE), !E(i)) {
|
|
83
|
+
const s = k(e.name);
|
|
84
|
+
i.some(
|
|
85
|
+
(o) => o.startsWith(".") ? s === o.slice(1) : e.type === o
|
|
86
|
+
) || n.push(g.INCORRECT_FILE_FORMAT);
|
|
87
|
+
}
|
|
88
|
+
return n;
|
|
89
|
+
}, I = (e, r) => E(e) ? null : {
|
|
90
|
+
[g.INCORRECT_FILE_SIZE]: r.incorrectFileSize,
|
|
91
|
+
[g.INCORRECT_FILE_FORMAT]: r.incorrectFileFormat
|
|
92
|
+
}[e[0]], Y = 128, b = Y * 1024 * 1024, G = ({
|
|
93
|
+
maxFileSize: e = b,
|
|
94
|
+
acceptFileMimeTypes: r = [],
|
|
95
|
+
onFilesAdded: t
|
|
96
|
+
}) => {
|
|
97
|
+
const [i, n] = C(null), s = d(
|
|
98
|
+
(a) => {
|
|
99
|
+
n(null);
|
|
100
|
+
const p = a.map((u) => ({
|
|
101
|
+
file: u,
|
|
102
|
+
validationErrors: q(u, { maxFileSize: e, acceptFileMimeTypes: r })
|
|
103
|
+
}));
|
|
104
|
+
t(p);
|
|
105
|
+
const m = p.find(
|
|
106
|
+
({ validationErrors: u }) => !E(u)
|
|
107
|
+
);
|
|
108
|
+
m && n(m.validationErrors[0]);
|
|
109
|
+
},
|
|
110
|
+
[e, r, t]
|
|
111
|
+
), l = d(
|
|
112
|
+
(a) => {
|
|
113
|
+
s(a);
|
|
114
|
+
},
|
|
115
|
+
[s]
|
|
116
|
+
), o = d(
|
|
117
|
+
(a) => {
|
|
118
|
+
const { files: p } = a.currentTarget;
|
|
119
|
+
p && s([...p]), a.currentTarget.value = "";
|
|
120
|
+
},
|
|
121
|
+
[s]
|
|
122
|
+
), c = d(() => {
|
|
123
|
+
n(null);
|
|
124
|
+
}, []);
|
|
125
|
+
return {
|
|
126
|
+
onDrop: l,
|
|
127
|
+
handleFileInputChange: o,
|
|
128
|
+
error: i,
|
|
129
|
+
clearError: c
|
|
130
|
+
};
|
|
131
|
+
}, H = ({
|
|
132
|
+
maxFileSize: e = b,
|
|
133
|
+
acceptFileMimeTypes: r = [],
|
|
134
|
+
onFilesAdded: t
|
|
135
|
+
}) => {
|
|
136
|
+
const { onDrop: i, handleFileInputChange: n, error: s, clearError: l } = G({
|
|
137
|
+
maxFileSize: e,
|
|
138
|
+
acceptFileMimeTypes: r,
|
|
139
|
+
onFilesAdded: t
|
|
140
|
+
}), o = d(() => {
|
|
141
|
+
l();
|
|
142
|
+
}, [l]);
|
|
143
|
+
return {
|
|
144
|
+
error: s,
|
|
145
|
+
onDrop: i,
|
|
146
|
+
handleDropzoneClick: o,
|
|
147
|
+
handleFileInputChange: n,
|
|
148
|
+
clearError: l
|
|
149
|
+
};
|
|
150
|
+
}, J = ({ isOverlay: e = !1 }) => {
|
|
151
|
+
const [r, t] = C(!1), i = A(null), n = d((a) => {
|
|
152
|
+
var p;
|
|
153
|
+
a.preventDefault(), (p = a.dataTransfer) != null && p.types.includes("Files") && t(!0);
|
|
154
|
+
}, []), s = d((a) => {
|
|
155
|
+
a.preventDefault(), i.current && !i.current.contains(a.relatedTarget) && t(!1);
|
|
156
|
+
}, []), l = d((a) => {
|
|
157
|
+
a.preventDefault();
|
|
158
|
+
}, []), o = d((a) => {
|
|
159
|
+
a.preventDefault(), t(!1);
|
|
160
|
+
}, []);
|
|
161
|
+
return {
|
|
162
|
+
handlers: e ? {
|
|
163
|
+
ref: i,
|
|
164
|
+
onDragEnter: n,
|
|
165
|
+
onDragLeave: s,
|
|
166
|
+
onDragOver: l,
|
|
167
|
+
onDrop: o
|
|
168
|
+
} : {},
|
|
169
|
+
...e && { isDragActive: r }
|
|
170
|
+
};
|
|
171
|
+
}, y = L(null);
|
|
172
|
+
y.displayName = "FileDropAreaContext";
|
|
173
|
+
const K = ({
|
|
174
|
+
children: e,
|
|
175
|
+
...r
|
|
176
|
+
}) => {
|
|
177
|
+
const t = A(null), i = d((l) => {
|
|
178
|
+
t.current = l;
|
|
179
|
+
}, []), n = d(() => {
|
|
180
|
+
r.isDisabled || !t.current || (r.clearError(), t.current());
|
|
181
|
+
}, [r]), s = z(
|
|
182
|
+
() => ({ ...r, registerOpenFunction: i, openFileDialog: n }),
|
|
183
|
+
[r, i, n]
|
|
184
|
+
);
|
|
185
|
+
return /* @__PURE__ */ f(y.Provider, { value: s, children: e });
|
|
186
|
+
}, v = () => {
|
|
187
|
+
const e = M(y);
|
|
188
|
+
if (!e)
|
|
189
|
+
throw new Error("useFileDropAreaContext must be used within a FileDropAreaProvider");
|
|
190
|
+
return e;
|
|
191
|
+
}, Q = ({
|
|
192
|
+
children: e,
|
|
193
|
+
className: r,
|
|
194
|
+
variant: t = "text",
|
|
195
|
+
...i
|
|
196
|
+
}) => {
|
|
197
|
+
const { openFileDialog: n, isDisabled: s } = v();
|
|
198
|
+
return /* @__PURE__ */ f(
|
|
199
|
+
S,
|
|
200
|
+
{
|
|
201
|
+
...i,
|
|
202
|
+
variant: t,
|
|
203
|
+
adjustWidthOn: "content",
|
|
204
|
+
disabled: s,
|
|
205
|
+
className: r,
|
|
206
|
+
onClick: (o) => {
|
|
207
|
+
o.stopPropagation(), n();
|
|
208
|
+
},
|
|
209
|
+
children: e
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
}, D = {
|
|
213
|
+
"file-drop-area": "_file-drop-area_1fufl_16",
|
|
214
|
+
"file-drop-area--active": "_file-drop-area--active_1fufl_27",
|
|
215
|
+
"file-drop-area--disabled": "_file-drop-area--disabled_1fufl_31",
|
|
216
|
+
"file-drop-area--error": "_file-drop-area--error_1fufl_35",
|
|
217
|
+
"file-drop-area__content": "_file-drop-area__content_1fufl_38",
|
|
218
|
+
"file-drop-area__icon": "_file-drop-area__icon_1fufl_45",
|
|
219
|
+
"file-drop-area__text": "_file-drop-area__text_1fufl_53",
|
|
220
|
+
"file-drop-area__description": "_file-drop-area__description_1fufl_59",
|
|
221
|
+
"file-drop-area__browse-button": "_file-drop-area__browse-button_1fufl_72",
|
|
222
|
+
"file-drop-area__file-size-info": "_file-drop-area__file-size-info_1fufl_75",
|
|
223
|
+
"file-drop-area__hidden-input": "_file-drop-area__hidden-input_1fufl_79",
|
|
224
|
+
"file-drop-area__error-message": "_file-drop-area__error-message_1fufl_82",
|
|
225
|
+
"file-drop-area--overlay": "_file-drop-area--overlay_1fufl_88",
|
|
226
|
+
"file-drop-area--overlay-mode": "_file-drop-area--overlay-mode_1fufl_106"
|
|
227
|
+
}, ee = h.bind(D), re = ({ className: e }) => {
|
|
228
|
+
const { error: r, messages: t } = v();
|
|
229
|
+
return r ? /* @__PURE__ */ f(
|
|
230
|
+
"div",
|
|
231
|
+
{
|
|
232
|
+
className: ee("file-drop-area__error-message", e),
|
|
233
|
+
role: "alert",
|
|
234
|
+
"aria-live": "assertive",
|
|
235
|
+
"aria-atomic": "true",
|
|
236
|
+
children: I([r], t) || r
|
|
237
|
+
}
|
|
238
|
+
) : null;
|
|
239
|
+
}, _ = h.bind(D), te = ({ icon: e, description: r, fileSizeMessage: t, className: i }) => {
|
|
240
|
+
const {
|
|
241
|
+
variant: n = "default",
|
|
242
|
+
error: s,
|
|
243
|
+
isDisabled: l,
|
|
244
|
+
isMultipleFiles: o,
|
|
245
|
+
overlayProps: c,
|
|
246
|
+
onDrop: a,
|
|
247
|
+
handleDropzoneClick: p,
|
|
248
|
+
registerOpenFunction: m
|
|
249
|
+
} = v(), u = n === "overlay";
|
|
250
|
+
return /* @__PURE__ */ f(w, { multiple: o, disabled: l, noClick: u, onDrop: a, children: ({ getRootProps: R, getInputProps: T, isDragActive: N, open: O }) => {
|
|
251
|
+
m(O);
|
|
252
|
+
const j = u ? !!(c != null && c.isDragActive) : N;
|
|
253
|
+
return /* @__PURE__ */ F(
|
|
254
|
+
"div",
|
|
255
|
+
{
|
|
256
|
+
...R({
|
|
257
|
+
className: _("file-drop-area", i, {
|
|
258
|
+
"file-drop-area--active": j,
|
|
259
|
+
"file-drop-area--disabled": l,
|
|
260
|
+
"file-drop-area--error": !!s,
|
|
261
|
+
"file-drop-area--overlay-mode": u
|
|
262
|
+
}),
|
|
263
|
+
onClick: u ? void 0 : p
|
|
264
|
+
}),
|
|
265
|
+
children: [
|
|
266
|
+
/* @__PURE__ */ f("input", { ...T() }),
|
|
267
|
+
/* @__PURE__ */ F("div", { className: _("file-drop-area__content"), children: [
|
|
268
|
+
/* @__PURE__ */ f("div", { className: _("file-drop-area__icon"), children: e }),
|
|
269
|
+
/* @__PURE__ */ F("div", { className: _("file-drop-area__text"), children: [
|
|
270
|
+
r && /* @__PURE__ */ f("div", { className: _("file-drop-area__description"), children: r }),
|
|
271
|
+
t && /* @__PURE__ */ f("div", { className: _("file-drop-area__file-size-info"), children: t })
|
|
272
|
+
] })
|
|
273
|
+
] })
|
|
274
|
+
]
|
|
275
|
+
}
|
|
276
|
+
);
|
|
277
|
+
} });
|
|
278
|
+
}, oe = {
|
|
279
|
+
"attached-files-list": "_attached-files-list_lg6ri_16"
|
|
280
|
+
}, ie = h.bind(oe), ne = ({
|
|
281
|
+
files: e,
|
|
282
|
+
className: r,
|
|
283
|
+
onRemoveFile: t,
|
|
284
|
+
onDownloadFile: i
|
|
285
|
+
}) => {
|
|
286
|
+
const { messages: n } = v(), s = d(
|
|
287
|
+
(o) => () => t(o.id),
|
|
288
|
+
[t]
|
|
289
|
+
), l = d(
|
|
290
|
+
(o) => () => i == null ? void 0 : i(o),
|
|
291
|
+
[i]
|
|
292
|
+
);
|
|
293
|
+
return E(e) ? null : /* @__PURE__ */ f("div", { className: ie("attached-files-list", r), children: e.map((o) => {
|
|
294
|
+
const c = I(
|
|
295
|
+
o.validationErrors ?? [],
|
|
296
|
+
n
|
|
297
|
+
), a = !o.isUploadFailed && c;
|
|
298
|
+
return /* @__PURE__ */ f(
|
|
299
|
+
B,
|
|
300
|
+
{
|
|
301
|
+
fileName: o.fileName,
|
|
302
|
+
size: o.size,
|
|
303
|
+
uploadingProgress: o.uploadingProgress,
|
|
304
|
+
isUploadFailed: o.isUploadFailed || !!c,
|
|
305
|
+
isUploading: o.isUploading,
|
|
306
|
+
onRemove: s(o),
|
|
307
|
+
...a && { uploadFailedMessage: c },
|
|
308
|
+
...i && { onDownload: l(o) }
|
|
309
|
+
},
|
|
310
|
+
o.id
|
|
311
|
+
);
|
|
312
|
+
}) });
|
|
313
|
+
}, ae = h.bind(D), x = ({
|
|
314
|
+
maxFileSize: e,
|
|
315
|
+
acceptFileMimeTypes: r,
|
|
316
|
+
isMultipleFiles: t,
|
|
317
|
+
isDisabled: i,
|
|
318
|
+
variant: n = "default",
|
|
319
|
+
children: s,
|
|
320
|
+
messages: l,
|
|
321
|
+
onFilesAdded: o
|
|
322
|
+
}) => {
|
|
323
|
+
const c = n === "overlay", a = H({
|
|
324
|
+
maxFileSize: e,
|
|
325
|
+
acceptFileMimeTypes: r,
|
|
326
|
+
messages: l,
|
|
327
|
+
isMultipleFiles: t,
|
|
328
|
+
isDisabled: i,
|
|
329
|
+
onFilesAdded: o
|
|
330
|
+
}), p = J({
|
|
331
|
+
isOverlay: c
|
|
332
|
+
});
|
|
333
|
+
return /* @__PURE__ */ f(
|
|
334
|
+
K,
|
|
335
|
+
{
|
|
336
|
+
...a,
|
|
337
|
+
variant: n,
|
|
338
|
+
messages: l,
|
|
339
|
+
overlayProps: p,
|
|
340
|
+
isDisabled: i,
|
|
341
|
+
isMultipleFiles: t,
|
|
342
|
+
children: (() => c ? /* @__PURE__ */ f("div", { className: ae("file-drop-area--overlay"), ...p.handlers, children: s }) : s)()
|
|
343
|
+
}
|
|
344
|
+
);
|
|
345
|
+
};
|
|
346
|
+
x.DropZone = te;
|
|
347
|
+
x.BrowseButton = Q;
|
|
348
|
+
x.Error = re;
|
|
349
|
+
x.AttachedFilesList = ne;
|
|
350
|
+
export {
|
|
351
|
+
x as FileDropArea,
|
|
352
|
+
me as MIME_TYPES
|
|
353
|
+
};
|
|
Binary file
|
|
Binary file
|