@reportportal/ui-kit 0.0.1-alpha.238 → 0.0.1-alpha.239
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/autocompletes.js +890 -75
- package/dist/calendarArrow-44c7e60e.js +5 -0
- package/dist/components/icons/index.d.ts +1 -0
- package/dist/components/pagination/itemsCounter/itemCounter.d.ts +2 -1
- package/dist/components/pagination/pagination.d.ts +2 -1
- package/dist/components/table/types.d.ts +1 -0
- package/dist/constants-85822a6b.js +6 -0
- package/dist/datePicker-09dd025d.js +229 -0
- package/dist/datePicker.js +23 -62
- package/dist/{fieldNumber-c9795245.js → fieldNumber-b4aa4d7e.js} +23 -22
- package/dist/fieldNumber.js +3 -2
- package/dist/fieldText-4a8e5496.js +167 -0
- package/dist/fieldText.js +4 -65
- package/dist/icons.js +35 -31
- package/dist/index.js +182 -176
- package/dist/minus-2857540f.js +5 -0
- package/dist/modal.js +166 -18
- package/dist/openedEye-8fa4c67d.js +6 -0
- package/dist/pagination-535d600a.js +370 -0
- package/dist/pagination.js +11 -64
- package/dist/plus-199fb2a8.js +5 -0
- package/dist/prevPage-87faf576.js +6 -0
- package/dist/radio.js +3 -3
- package/dist/radioGroup-0c132c2e.js +77 -0
- package/dist/sortable.js +319 -40
- package/dist/style.css +2 -2
- package/dist/table-e0fd9727.js +1157 -0
- package/dist/table.js +1 -1
- package/package.json +1 -1
- package/dist/index-7ddba309.js +0 -1639
- package/dist/index-a13c9a87.js +0 -172
- package/dist/plus-0929dda4.js +0 -6
- package/dist/prevPage-1c4a826f.js +0 -9
- package/dist/radio-62546efa.js +0 -76
- package/dist/radioGroup-183d7a6f.js +0 -6
- package/dist/table-4d35951e.js +0 -1150
- package/dist/treeSortableItem-301dbd92.js +0 -298
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const t = (l) => /* @__PURE__ */ e.createElement("svg", { width: 8, height: 13, viewBox: "0 0 8 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...l }, /* @__PURE__ */ e.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M6.54134 12.2173C6.69755 12.3735 6.95081 12.3735 7.10702 12.2173L7.24844 12.0759C7.40465 11.9197 7.40465 11.6664 7.24844 11.5102L1.90539 6.16715L7.24844 0.824097C7.40465 0.667887 7.40465 0.41462 7.24844 0.258411L7.10702 0.116989C6.95081 -0.0392199 6.69755 -0.0392199 6.54134 0.116989L0.998591 5.65973L0.999562 5.6607L0.767094 5.89317C0.610884 6.04938 0.610884 6.30265 0.767093 6.45886L1.48425 7.17602L1.49215 7.16813L6.54134 12.2173Z", fill: "#C1C7D0" }));
|
|
3
|
+
export {
|
|
4
|
+
t as S
|
|
5
|
+
};
|
|
@@ -76,6 +76,7 @@ export { default as TestCaseIcon } from './svg/testCase.svg';
|
|
|
76
76
|
export { default as TestPlanIcon } from './svg/testPlan.svg';
|
|
77
77
|
export { default as UserIcon } from './svg/userIcon.svg';
|
|
78
78
|
export { default as LaunchTypeIcon } from './svg/launchType.svg';
|
|
79
|
+
export { default as LatestExecutionsIcon } from './svg/latestExecutions.svg';
|
|
79
80
|
export { default as RunManualIcon } from './svg/runManual.svg';
|
|
80
81
|
export { default as CoverageFullIcon } from './svg/coverageFull.svg';
|
|
81
82
|
export { default as CoveragePartialIcon } from './svg/coveragePartially.svg';
|
|
@@ -8,5 +8,6 @@ export interface ItemCounterProps {
|
|
|
8
8
|
itemsText: string;
|
|
9
9
|
limitExceeded?: boolean;
|
|
10
10
|
warningContent?: ReactNode;
|
|
11
|
+
accentTotalTooltip?: ReactNode;
|
|
11
12
|
}
|
|
12
|
-
export declare const ItemCounter: ({ activePage, pageSize, totalItems, ofText, itemsText, limitExceeded, warningContent, }: ItemCounterProps) => ReactElement;
|
|
13
|
+
export declare const ItemCounter: ({ activePage, pageSize, totalItems, ofText, itemsText, limitExceeded, warningContent, accentTotalTooltip, }: ItemCounterProps) => ReactElement;
|
|
@@ -21,6 +21,7 @@ export interface PaginationProps {
|
|
|
21
21
|
className?: string;
|
|
22
22
|
warningContent?: ReactNode;
|
|
23
23
|
limitExceeded?: boolean;
|
|
24
|
+
accentTotalTooltip?: ReactNode;
|
|
24
25
|
}
|
|
25
|
-
export declare const Pagination: ({ activePage, totalPages, pageSize, totalItems, pageSizeOptions, changePage, changePageSize, captions, className, warningContent, limitExceeded, }: PaginationProps) => ReactElement;
|
|
26
|
+
export declare const Pagination: ({ activePage, totalPages, pageSize, totalItems, pageSizeOptions, changePage, changePageSize, captions, className, warningContent, limitExceeded, accentTotalTooltip, }: PaginationProps) => ReactElement;
|
|
26
27
|
export {};
|
|
@@ -69,6 +69,7 @@ export interface TableComponentProps {
|
|
|
69
69
|
setExpandedRowIds?: Dispatch<SetStateAction<Set<string | number>>>;
|
|
70
70
|
isAllExpandedByDefault?: boolean;
|
|
71
71
|
expandAllTooltip?: ReactNode;
|
|
72
|
+
sortDisabledColumnTooltips?: Record<string, ReactNode>;
|
|
72
73
|
isResizable?: boolean;
|
|
73
74
|
minColumnWidth?: number;
|
|
74
75
|
maxColumnWidth?: number;
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { jsxs as x, Fragment as z, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as v, forwardRef as J, useRef as K } from "react";
|
|
3
|
+
import I from "react-datepicker/dist/es/index.js";
|
|
4
|
+
import { c as Y } from "./bind-06a7ff84.js";
|
|
5
|
+
import { F as Q } from "./fieldText-4a8e5496.js";
|
|
6
|
+
import { D as L } from "./dropdown-d2a05471.js";
|
|
7
|
+
import { S as B } from "./calendarArrow-44c7e60e.js";
|
|
8
|
+
import { registerLocale as X } from "react-datepicker";
|
|
9
|
+
function Z(e) {
|
|
10
|
+
return e == null;
|
|
11
|
+
}
|
|
12
|
+
const Ae = (e, t) => {
|
|
13
|
+
X(e, t);
|
|
14
|
+
}, ee = (e, t, r = 20) => {
|
|
15
|
+
const d = new Array(r).fill(void 0).map((f, u) => e - u), D = e - r + 1;
|
|
16
|
+
return t > e ? [t, ...d] : t < D ? [...d, t] : d;
|
|
17
|
+
}, te = "_header_1s3dn_1", ne = "_disabled_1s3dn_25", oe = "_dropdown_1s3dn_8", ae = {
|
|
18
|
+
header: te,
|
|
19
|
+
"dropdowns-wrapper": "_dropdowns-wrapper_1s3dn_8",
|
|
20
|
+
"button-prev": "_button-prev_1s3dn_13",
|
|
21
|
+
"button-next": "_button-next_1s3dn_14",
|
|
22
|
+
disabled: ne,
|
|
23
|
+
dropdown: oe,
|
|
24
|
+
"month-dropdown": "_month-dropdown_1s3dn_44",
|
|
25
|
+
"toggle-button": "_toggle-button_1s3dn_47"
|
|
26
|
+
}, l = Y.bind(ae), re = ({
|
|
27
|
+
date: e = /* @__PURE__ */ new Date(),
|
|
28
|
+
changeYear: t = () => {
|
|
29
|
+
},
|
|
30
|
+
changeMonth: r = () => {
|
|
31
|
+
},
|
|
32
|
+
decreaseMonth: d = () => {
|
|
33
|
+
},
|
|
34
|
+
increaseMonth: D = () => {
|
|
35
|
+
},
|
|
36
|
+
prevMonthButtonDisabled: f = !1,
|
|
37
|
+
nextMonthButtonDisabled: u = !1,
|
|
38
|
+
headerNodes: w = null,
|
|
39
|
+
customClassName: y = "",
|
|
40
|
+
yearsOptions: N = [],
|
|
41
|
+
locale: k
|
|
42
|
+
}) => {
|
|
43
|
+
const p = e.getFullYear(), S = e.getMonth(), C = v(() => {
|
|
44
|
+
const n = Array(12).keys(), m = new Intl.DateTimeFormat(k, {
|
|
45
|
+
month: "long"
|
|
46
|
+
}), g = (s) => m.format(new Date(p, s));
|
|
47
|
+
return Array.from(n, g).reduce((s, P, c) => s.concat({
|
|
48
|
+
value: c,
|
|
49
|
+
label: P
|
|
50
|
+
}), []);
|
|
51
|
+
}, [k, p]), A = v(() => {
|
|
52
|
+
const n = (/* @__PURE__ */ new Date()).getFullYear();
|
|
53
|
+
return (N.length > 0 ? N : ee(n, p)).reduce(
|
|
54
|
+
(g, _) => g.concat({ value: _, label: `${_}` }),
|
|
55
|
+
[]
|
|
56
|
+
);
|
|
57
|
+
}, [N, p]), F = (n) => {
|
|
58
|
+
r(n);
|
|
59
|
+
}, o = (n) => {
|
|
60
|
+
t(n);
|
|
61
|
+
};
|
|
62
|
+
return /* @__PURE__ */ x(z, { children: [
|
|
63
|
+
w && /* @__PURE__ */ a("div", { className: l(y), children: w }),
|
|
64
|
+
/* @__PURE__ */ x("div", { className: l("header"), children: [
|
|
65
|
+
/* @__PURE__ */ a(
|
|
66
|
+
"button",
|
|
67
|
+
{
|
|
68
|
+
type: "button",
|
|
69
|
+
"aria-label": "Previous Months",
|
|
70
|
+
disabled: f,
|
|
71
|
+
onClick: (n) => {
|
|
72
|
+
n.stopPropagation(), d();
|
|
73
|
+
},
|
|
74
|
+
className: l("button-prev", { disabled: f }),
|
|
75
|
+
children: /* @__PURE__ */ a(B, {})
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
/* @__PURE__ */ x("div", { className: l("dropdowns-wrapper"), children: [
|
|
79
|
+
/* @__PURE__ */ a(
|
|
80
|
+
L,
|
|
81
|
+
{
|
|
82
|
+
options: C,
|
|
83
|
+
value: S,
|
|
84
|
+
onChange: F,
|
|
85
|
+
transparentBackground: !0,
|
|
86
|
+
className: l("dropdown", "month-dropdown"),
|
|
87
|
+
toggleButtonClassName: l("toggle-button")
|
|
88
|
+
}
|
|
89
|
+
),
|
|
90
|
+
/* @__PURE__ */ a(
|
|
91
|
+
L,
|
|
92
|
+
{
|
|
93
|
+
options: A,
|
|
94
|
+
value: p,
|
|
95
|
+
onChange: o,
|
|
96
|
+
transparentBackground: !0,
|
|
97
|
+
className: l("dropdown"),
|
|
98
|
+
toggleButtonClassName: l("toggle-button")
|
|
99
|
+
}
|
|
100
|
+
)
|
|
101
|
+
] }),
|
|
102
|
+
/* @__PURE__ */ a(
|
|
103
|
+
"button",
|
|
104
|
+
{
|
|
105
|
+
type: "button",
|
|
106
|
+
"aria-label": "Next Months",
|
|
107
|
+
disabled: u,
|
|
108
|
+
onClick: (n) => {
|
|
109
|
+
n.stopPropagation(), D();
|
|
110
|
+
},
|
|
111
|
+
className: l("button-next", { disabled: u }),
|
|
112
|
+
children: /* @__PURE__ */ a(B, {})
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
] })
|
|
116
|
+
] });
|
|
117
|
+
}, se = "_calendar_1511k_5", ce = "_date_1511k_104", de = "_disabled_1511k_150", le = "_popper_1511k_159", ie = "_input_1511k_163", pe = {
|
|
118
|
+
calendar: se,
|
|
119
|
+
"current-date": "_current-date_1511k_103",
|
|
120
|
+
date: ce,
|
|
121
|
+
"end-date": "_end-date_1511k_121",
|
|
122
|
+
"selected-range": "_selected-range_1511k_131",
|
|
123
|
+
disabled: de,
|
|
124
|
+
popper: le,
|
|
125
|
+
input: ie,
|
|
126
|
+
"input-range": "_input-range_1511k_174"
|
|
127
|
+
}, b = Y.bind(pe), ue = "en", me = "MM-dd-yyyy", ge = " to ", O = (e) => Z(e) ? void 0 : e, _e = J(
|
|
128
|
+
({ selectsRange: e, value: t, ...r }, d) => /* @__PURE__ */ a(
|
|
129
|
+
Q,
|
|
130
|
+
{
|
|
131
|
+
...r,
|
|
132
|
+
className: b("input", e ? "input-range" : ""),
|
|
133
|
+
defaultWidth: !1,
|
|
134
|
+
value: e ? (t == null ? void 0 : t.replace(" - ", ge)) ?? "" : t,
|
|
135
|
+
ref: d,
|
|
136
|
+
readOnly: !0
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
), Fe = (e) => {
|
|
140
|
+
const {
|
|
141
|
+
onChange: t = () => {
|
|
142
|
+
},
|
|
143
|
+
disabled: r = !1,
|
|
144
|
+
onBlur: d = () => {
|
|
145
|
+
},
|
|
146
|
+
onFocus: D = () => {
|
|
147
|
+
},
|
|
148
|
+
headerNodes: f = null,
|
|
149
|
+
customClassName: u = "",
|
|
150
|
+
customTimeInput: w = void 0,
|
|
151
|
+
shouldCloseOnSelect: y = !0,
|
|
152
|
+
popperClassName: N = "",
|
|
153
|
+
calendarClassName: k = "",
|
|
154
|
+
popperPlacement: p = "bottom-start",
|
|
155
|
+
fixedHeight: S = !0,
|
|
156
|
+
language: C = ue,
|
|
157
|
+
yearsOptions: A = [],
|
|
158
|
+
dateFormat: F = me,
|
|
159
|
+
value: o = null
|
|
160
|
+
} = e, { minDate: n, maxDate: m } = e, g = O(n), _ = O(m), s = "selectsRange" in e && e.selectsRange === !0, P = K(null), c = s ? (o == null ? void 0 : o[0]) ?? void 0 : void 0, i = s ? (o == null ? void 0 : o[1]) ?? void 0 : void 0, $ = c == null ? void 0 : c.toDateString(), H = i == null ? void 0 : i.toDateString(), M = i && c && i > c, U = s ? "Select date range" : "Select date", j = e.placeholder ?? U, R = {
|
|
161
|
+
customInput: /* @__PURE__ */ a(_e, { ref: P, selectsRange: s }),
|
|
162
|
+
placeholderText: j,
|
|
163
|
+
disabled: r,
|
|
164
|
+
shouldCloseOnSelect: y,
|
|
165
|
+
fixedHeight: S,
|
|
166
|
+
locale: C,
|
|
167
|
+
showPopperArrow: !1,
|
|
168
|
+
dayClassName: (h) => {
|
|
169
|
+
if (!s) {
|
|
170
|
+
const W = o == null ? void 0 : o.toDateString(), q = h.toDateString();
|
|
171
|
+
return b("date", {
|
|
172
|
+
"current-date": q === W,
|
|
173
|
+
disabled: r
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
const T = h.toDateString(), G = T === $, E = M && T === H, V = c && i && h > c && h < i;
|
|
177
|
+
return b("date", {
|
|
178
|
+
"current-date": G,
|
|
179
|
+
"selected-range": V && !E,
|
|
180
|
+
"end-date": E && M,
|
|
181
|
+
disabled: r
|
|
182
|
+
});
|
|
183
|
+
},
|
|
184
|
+
calendarClassName: b(k, "calendar"),
|
|
185
|
+
renderCustomHeader: (h) => /* @__PURE__ */ a(
|
|
186
|
+
re,
|
|
187
|
+
{
|
|
188
|
+
...h,
|
|
189
|
+
headerNodes: f,
|
|
190
|
+
customClassName: u,
|
|
191
|
+
yearsOptions: A,
|
|
192
|
+
locale: C
|
|
193
|
+
}
|
|
194
|
+
),
|
|
195
|
+
onBlur: d,
|
|
196
|
+
onFocus: D,
|
|
197
|
+
customTimeInput: w,
|
|
198
|
+
showTimeInput: !!w,
|
|
199
|
+
popperClassName: b(N, "popper"),
|
|
200
|
+
dateFormat: F,
|
|
201
|
+
className: b("datepicker"),
|
|
202
|
+
popperPlacement: p
|
|
203
|
+
};
|
|
204
|
+
return s ? /* @__PURE__ */ a(
|
|
205
|
+
I,
|
|
206
|
+
{
|
|
207
|
+
...R,
|
|
208
|
+
selectsRange: !0,
|
|
209
|
+
startDate: c,
|
|
210
|
+
endDate: i,
|
|
211
|
+
onChange: t,
|
|
212
|
+
minDate: g,
|
|
213
|
+
maxDate: _
|
|
214
|
+
}
|
|
215
|
+
) : /* @__PURE__ */ a(
|
|
216
|
+
I,
|
|
217
|
+
{
|
|
218
|
+
...R,
|
|
219
|
+
selected: o,
|
|
220
|
+
onChange: t,
|
|
221
|
+
minDate: g,
|
|
222
|
+
maxDate: _
|
|
223
|
+
}
|
|
224
|
+
);
|
|
225
|
+
};
|
|
226
|
+
export {
|
|
227
|
+
Fe as D,
|
|
228
|
+
Ae as r
|
|
229
|
+
};
|
package/dist/datePicker.js
CHANGED
|
@@ -1,77 +1,38 @@
|
|
|
1
|
-
import { D as t } from "./
|
|
2
|
-
import { r as
|
|
1
|
+
import { D as t } from "./datePicker-09dd025d.js";
|
|
2
|
+
import { r as H } from "./datePicker-09dd025d.js";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
|
+
import "react-datepicker/dist/es/index.js";
|
|
5
6
|
import "./bind-06a7ff84.js";
|
|
6
|
-
import "
|
|
7
|
-
import "./
|
|
8
|
-
import "./
|
|
9
|
-
import "./
|
|
10
|
-
import "./
|
|
7
|
+
import "./fieldText-4a8e5496.js";
|
|
8
|
+
import "./clear-53660571.js";
|
|
9
|
+
import "./openedEye-8fa4c67d.js";
|
|
10
|
+
import "./baseIconButton-251479f7.js";
|
|
11
|
+
import "./spinLoader-c4a53718.js";
|
|
12
|
+
import "./maxValueDisplay-9be01a75.js";
|
|
13
|
+
import "./fieldLabel.js";
|
|
14
|
+
import "./dropdown-d2a05471.js";
|
|
11
15
|
import "react-dom";
|
|
16
|
+
import "@floating-ui/react-dom";
|
|
12
17
|
import "downshift";
|
|
13
|
-
import "
|
|
14
|
-
import "./
|
|
15
|
-
import "./
|
|
18
|
+
import "rc-scrollbars";
|
|
19
|
+
import "./keyCodes-f63c0e11.js";
|
|
20
|
+
import "./dropdown-0260bb66.js";
|
|
16
21
|
import "./adaptiveTagList.js";
|
|
22
|
+
import "./button-7ab874f3.js";
|
|
17
23
|
import "./close-4d480ef7.js";
|
|
18
|
-
import "./
|
|
19
|
-
import "./details-dbb1530b.js";
|
|
20
|
-
import "./baseIconButton-251479f7.js";
|
|
21
|
-
import "./popover.js";
|
|
22
|
-
import "./floatingUi-46f5b896.js";
|
|
23
|
-
import "./index-d6e02727.js";
|
|
24
|
-
import "./xls-995781cc.js";
|
|
25
|
-
import "./breadcrumbs-5730e318.js";
|
|
26
|
-
import "es-toolkit";
|
|
27
|
-
import "./tree-c3dd3d45.js";
|
|
28
|
-
import "./bulkPanel.js";
|
|
29
|
-
import "./useOnClickOutside-8f7d68a1.js";
|
|
24
|
+
import "./isEmpty-ccacb5ff.js";
|
|
30
25
|
import "react-dnd";
|
|
31
26
|
import "react-dnd-html5-backend";
|
|
32
|
-
import "./keyCodes-f63c0e11.js";
|
|
33
|
-
import "./selection-da1a3528.js";
|
|
34
|
-
import "./chip.js";
|
|
35
|
-
import "./tooltip.js";
|
|
36
|
-
import "./chevronDownDropdown-0260bb66.js";
|
|
37
|
-
import "./warning-537ead32.js";
|
|
38
|
-
import "./checkbox-76aa8f97.js";
|
|
39
|
-
import "react-datepicker/dist/es/index.js";
|
|
40
|
-
import "./dropdown-d2a05471.js";
|
|
41
|
-
import "@floating-ui/react-dom";
|
|
42
|
-
import "./dropdown-0260bb66.js";
|
|
43
|
-
import "./fieldLabel.js";
|
|
44
27
|
import "./useEllipsisTitle-462fa254.js";
|
|
28
|
+
import "./checkbox-76aa8f97.js";
|
|
29
|
+
import "./tooltip.js";
|
|
30
|
+
import "@floating-ui/react";
|
|
31
|
+
import "./floatingUi-46f5b896.js";
|
|
32
|
+
import "./calendarArrow-44c7e60e.js";
|
|
45
33
|
import "react-datepicker";
|
|
46
|
-
import "./fieldNumber-c9795245.js";
|
|
47
|
-
import "./fieldTextFlex-2f51c173.js";
|
|
48
|
-
import "./maxValueDisplay-9be01a75.js";
|
|
49
|
-
import "./fileDropArea.js";
|
|
50
|
-
import "react-dropzone";
|
|
51
|
-
import "./filtersButton.js";
|
|
52
|
-
import "./filterOutline-819b4b0d.js";
|
|
53
|
-
import "./filterItem.js";
|
|
54
|
-
import "./issueList.js";
|
|
55
|
-
import "./index-a13c9a87.js";
|
|
56
|
-
import "framer-motion";
|
|
57
|
-
import "./useWindowResize-a7e1ac92.js";
|
|
58
|
-
import "./radio-62546efa.js";
|
|
59
|
-
import "./segmentedControl.js";
|
|
60
|
-
import "./spinLoader-c4a53718.js";
|
|
61
|
-
import "./systemAlert.js";
|
|
62
|
-
import "./success-8fd8bd2c.js";
|
|
63
|
-
import "./systemMessage-924fdaa6.js";
|
|
64
|
-
import "./treeSortableItem-301dbd92.js";
|
|
65
|
-
import "./useTreeSortable-bc631689.js";
|
|
66
|
-
import "./common.js";
|
|
67
|
-
import "./table-4d35951e.js";
|
|
68
|
-
import "react-resizable";
|
|
69
|
-
import "./resizeColumn-46b5b30f.js";
|
|
70
|
-
import "./themeProvider-46c2be7b.js";
|
|
71
|
-
import "./toggle-304107fa.js";
|
|
72
|
-
import "./sidePanel.js";
|
|
73
34
|
export {
|
|
74
35
|
t as DatePicker,
|
|
75
36
|
t as default,
|
|
76
|
-
|
|
37
|
+
H as registerDatePickerLocale
|
|
77
38
|
};
|
|
@@ -3,7 +3,8 @@ import { useRef as y, useId as B, useMemo as w } from "react";
|
|
|
3
3
|
import { c as v } from "./bind-06a7ff84.js";
|
|
4
4
|
import { K as e } from "./keyCodes-f63c0e11.js";
|
|
5
5
|
import { B as D } from "./baseIconButton-251479f7.js";
|
|
6
|
-
import { S as H
|
|
6
|
+
import { S as H } from "./minus-2857540f.js";
|
|
7
|
+
import { S as k } from "./plus-199fb2a8.js";
|
|
7
8
|
import { FieldLabel as P } from "./fieldLabel.js";
|
|
8
9
|
const b = 5, I = 0.4, Y = 16 + I, G = [
|
|
9
10
|
e.TAB_KEY_CODE,
|
|
@@ -33,20 +34,20 @@ const b = 5, I = 0.4, Y = 16 + I, G = [
|
|
|
33
34
|
input: z,
|
|
34
35
|
"additional-content": "_additional-content_3v3h5_84",
|
|
35
36
|
"error-text": "_error-text_3v3h5_88"
|
|
36
|
-
},
|
|
37
|
-
value:
|
|
37
|
+
}, c = v.bind(q), rn = ({
|
|
38
|
+
value: i = "",
|
|
38
39
|
placeholder: L = "0",
|
|
39
40
|
disabled: t = !1,
|
|
40
41
|
onChange: l,
|
|
41
42
|
onFocus: d,
|
|
42
43
|
onBlur: N,
|
|
43
|
-
label:
|
|
44
|
+
label: f,
|
|
44
45
|
postfix: E = "",
|
|
45
46
|
min: s = 0,
|
|
46
47
|
max: o = Number.MAX_SAFE_INTEGER,
|
|
47
48
|
title: A,
|
|
48
49
|
error: C,
|
|
49
|
-
id:
|
|
50
|
+
id: h,
|
|
50
51
|
...M
|
|
51
52
|
}) => {
|
|
52
53
|
const u = y(null), m = B(), O = (n) => Number.isNaN(n) ? s : n === Number.POSITIVE_INFINITY ? o : n === Number.NEGATIVE_INFINITY || n < s ? s : n > o ? o : n, R = (n) => {
|
|
@@ -64,24 +65,24 @@ const b = 5, I = 0.4, Y = 16 + I, G = [
|
|
|
64
65
|
const { keyCode: _ } = n;
|
|
65
66
|
G.includes(_) || (_ < e.NUMBER_START_KEY_CODE || _ > e.NUMBER_END_KEY_CODE || n.shiftKey) && n.preventDefault();
|
|
66
67
|
}, F = () => {
|
|
67
|
-
const _ = O(+
|
|
68
|
+
const _ = O(+i) - 1;
|
|
68
69
|
_ >= s && _ <= o && l(_);
|
|
69
70
|
}, g = () => {
|
|
70
|
-
const _ = O(+
|
|
71
|
+
const _ = O(+i) + 1;
|
|
71
72
|
_ >= s && _ <= o && l(_);
|
|
72
73
|
}, K = L + E, S = w(() => {
|
|
73
|
-
let n = (String(
|
|
74
|
-
return E && !
|
|
75
|
-
}, [K, E,
|
|
74
|
+
let n = (String(i) || K).length;
|
|
75
|
+
return E && !i && (n += 1), n ? n > Y ? `${Y}ch` : `${n + I}ch` : `${b}ch`;
|
|
76
|
+
}, [K, E, i]), V = () => {
|
|
76
77
|
u && u.current && u.current.focus(), d && d();
|
|
77
78
|
};
|
|
78
79
|
return /* @__PURE__ */ a(W, { children: [
|
|
79
|
-
/* @__PURE__ */ a("div", { className:
|
|
80
|
-
|
|
80
|
+
/* @__PURE__ */ a("div", { className: c("field-number", { disabled: t }), children: [
|
|
81
|
+
f && /* @__PURE__ */ r(P, { htmlFor: h ?? m, children: f }),
|
|
81
82
|
/* @__PURE__ */ a(
|
|
82
83
|
"div",
|
|
83
84
|
{
|
|
84
|
-
className:
|
|
85
|
+
className: c("input-container", {
|
|
85
86
|
error: C,
|
|
86
87
|
disabled: t
|
|
87
88
|
}),
|
|
@@ -90,21 +91,21 @@ const b = 5, I = 0.4, Y = 16 + I, G = [
|
|
|
90
91
|
/* @__PURE__ */ r(
|
|
91
92
|
D,
|
|
92
93
|
{
|
|
93
|
-
className:
|
|
94
|
+
className: c("sign", "minus"),
|
|
94
95
|
disabled: t,
|
|
95
96
|
onClick: F,
|
|
96
97
|
children: /* @__PURE__ */ r(H, {})
|
|
97
98
|
}
|
|
98
99
|
),
|
|
99
|
-
/* @__PURE__ */ a("span", { className:
|
|
100
|
+
/* @__PURE__ */ a("span", { className: c("input-field", { disabled: t }), onClick: V, children: [
|
|
100
101
|
/* @__PURE__ */ r(
|
|
101
102
|
"input",
|
|
102
103
|
{
|
|
103
|
-
id:
|
|
104
|
+
id: h ?? m,
|
|
104
105
|
ref: u,
|
|
105
|
-
className:
|
|
106
|
+
className: c("input"),
|
|
106
107
|
type: "number",
|
|
107
|
-
value:
|
|
108
|
+
value: i,
|
|
108
109
|
placeholder: K,
|
|
109
110
|
disabled: t,
|
|
110
111
|
min: s,
|
|
@@ -117,12 +118,12 @@ const b = 5, I = 0.4, Y = 16 + I, G = [
|
|
|
117
118
|
...M
|
|
118
119
|
}
|
|
119
120
|
),
|
|
120
|
-
!!E && (
|
|
121
|
+
!!E && (i === 0 || !!i) && /* @__PURE__ */ r("span", { children: E.slice(0, 1) })
|
|
121
122
|
] }),
|
|
122
123
|
/* @__PURE__ */ r(
|
|
123
124
|
D,
|
|
124
125
|
{
|
|
125
|
-
className:
|
|
126
|
+
className: c("sign", "plus"),
|
|
126
127
|
disabled: t,
|
|
127
128
|
onClick: g,
|
|
128
129
|
children: /* @__PURE__ */ r(k, {})
|
|
@@ -132,9 +133,9 @@ const b = 5, I = 0.4, Y = 16 + I, G = [
|
|
|
132
133
|
}
|
|
133
134
|
)
|
|
134
135
|
] }),
|
|
135
|
-
C && /* @__PURE__ */ r("div", { className:
|
|
136
|
+
C && /* @__PURE__ */ r("div", { className: c("additional-content"), children: /* @__PURE__ */ r("span", { className: c("error-text"), children: C }) })
|
|
136
137
|
] });
|
|
137
138
|
};
|
|
138
139
|
export {
|
|
139
|
-
|
|
140
|
+
rn as F
|
|
140
141
|
};
|
package/dist/fieldNumber.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { F as m } from "./fieldNumber-
|
|
1
|
+
import { F as m } from "./fieldNumber-b4aa4d7e.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./bind-06a7ff84.js";
|
|
5
5
|
import "./keyCodes-f63c0e11.js";
|
|
6
6
|
import "./baseIconButton-251479f7.js";
|
|
7
|
-
import "./
|
|
7
|
+
import "./minus-2857540f.js";
|
|
8
|
+
import "./plus-199fb2a8.js";
|
|
8
9
|
import "./fieldLabel.js";
|
|
9
10
|
export {
|
|
10
11
|
m as FieldNumber,
|