@reportportal/ui-kit 0.0.1-alpha.225 → 0.0.1-alpha.227

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.
@@ -18,6 +18,8 @@ interface DatePickerBaseProps {
18
18
  placeholder?: string;
19
19
  dateFormat?: string;
20
20
  popperPlacement?: Placement;
21
+ minDate?: Date | null;
22
+ maxDate?: Date | null;
21
23
  }
22
24
  interface DatePickerSingleProps extends DatePickerBaseProps {
23
25
  selectsRange?: false;
@@ -75,3 +75,6 @@ export { default as LaunchTypeIcon } from './svg/launchType.svg';
75
75
  export { default as RunManualIcon } from './svg/runManual.svg';
76
76
  export { default as CoverageFullIcon } from './svg/coverageFull.svg';
77
77
  export { default as CoveragePartialIcon } from './svg/coveragePartially.svg';
78
+ export { default as DownloadIcon } from './svg/download.svg';
79
+ export { default as ArrowRightIcon } from './svg/arrowRight.svg';
80
+ export { default as ArrowLeftIcon } from './svg/arrowLeft.svg';
@@ -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-1749da7a.js";
6
+ import { D as L } from "./dropdown-33f2bf75.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
+ };
@@ -1,5 +1,5 @@
1
- import { D as t } from "./datePicker-bc0a9fca.js";
2
- import { r as H } from "./datePicker-bc0a9fca.js";
1
+ import { D as t } from "./datePicker-6c001a18.js";
2
+ import { r as H } from "./datePicker-6c001a18.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "react-datepicker/dist/es/index.js";