@reportportal/ui-kit 0.0.1-alpha.116 → 0.0.1-alpha.118

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.
@@ -3,7 +3,8 @@ import { AutocompleteOptionsProps } from '../autocompleteOptions';
3
3
  export declare const AutocompleteMenu: <T>(props: {
4
4
  isOpen?: boolean | undefined;
5
5
  style?: import('react').CSSProperties | undefined;
6
- minLength: number | null;
6
+ isDropdownMode?: boolean | undefined;
7
+ minLength?: number | null | undefined;
7
8
  inputValue?: string | undefined;
8
9
  className?: string | undefined;
9
10
  } & AutocompleteOptionsProps<T> & import('react').RefAttributes<HTMLUListElement>) => import('react').ReactElement<any, string | import('react').JSXElementConstructor<any>> | null;
@@ -3,12 +3,12 @@ import { GetItemPropsT } from '../types';
3
3
 
4
4
  export interface AutocompleteOptionsProps<T> {
5
5
  options: T[];
6
- loading: boolean;
6
+ loading?: boolean;
7
7
  inputValue: string;
8
8
  parseValueToString: (value: T | null) => string;
9
9
  getItemProps: GetItemPropsT<T>;
10
10
  renderOption?: (item: T, index: number, isNew: boolean, getItemProps: GetItemPropsT<T>) => ReactNode;
11
- async: boolean;
11
+ async?: boolean;
12
12
  optionVariant: 'key-variant' | 'value-variant' | '';
13
13
  createWithoutConfirmation: boolean;
14
14
  customEmptyListMessage?: string;
@@ -23,18 +23,19 @@ export interface MultipleAutocompleteProps<T> {
23
23
  mobileDisabled: boolean;
24
24
  inputProps: ComponentProps<typeof FieldText>;
25
25
  parseValueToString: (value: T | null) => string;
26
- minLength: number | null;
27
- maxLength: number | null;
28
- async: boolean;
26
+ minLength?: number | null;
27
+ maxLength?: number | null;
28
+ async?: boolean;
29
29
  customClass: string;
30
30
  createWithoutConfirmation: boolean;
31
31
  getItemValidationErrorType?: (item: T) => string;
32
32
  clearItemsError: () => void;
33
+ isDropdownMode?: boolean;
33
34
  getAdditionalCreationCondition: (value: string) => boolean;
34
35
  highlightUnStoredItem: boolean;
35
36
  parseInputValueFn: ((value: string) => T[]) | null;
36
37
  handleUnStoredItemCb: ((newSelectedItems: DownshiftStore<T>, prevSelectedItems: DownshiftStore<T>) => void) | null;
37
- dataAutomationId: string;
38
+ dataAutomationId?: string;
38
39
  existingItemsMap: Record<string | number, boolean>;
39
40
  optionVariant: ComponentProps<typeof AutocompleteMenu>['optionVariant'];
40
41
  customizeNewSelectedValue: (value: T) => T;
@@ -6,28 +6,29 @@ import { GetItemPropsT } from '../types';
6
6
 
7
7
  export interface SingleAutocompleteProps<T> {
8
8
  options: T[];
9
- loading: boolean;
9
+ loading?: boolean;
10
10
  onStateChange: ComponentProps<typeof Downshift<T>>['onStateChange'];
11
11
  value: T | null;
12
12
  placeholder: string;
13
13
  onChange: ComponentProps<typeof Downshift<T>>['onChange'];
14
14
  onFocus: () => void;
15
15
  onBlur: (e: FocusEvent<HTMLInputElement>) => void;
16
- disabled: boolean;
17
- inputProps: ComponentProps<typeof FieldText>;
16
+ disabled?: boolean;
17
+ inputProps?: ComponentProps<typeof FieldText>;
18
18
  parseValueToString: (value: T | null) => string;
19
19
  renderOption?: (value: T, index: number, isNew: boolean, getItemProps: GetItemPropsT<T>) => ReactNode;
20
- minLength: number;
21
- maxLength: number | null;
22
- async: boolean;
20
+ minLength?: number;
21
+ maxLength?: number | null;
22
+ async?: boolean;
23
23
  optionVariant: ComponentProps<typeof AutocompleteMenu>['optionVariant'];
24
- isRequired: boolean;
24
+ isRequired?: boolean;
25
25
  error: string;
26
- touched: boolean;
26
+ touched?: boolean;
27
27
  setTouch?: (value: boolean) => void;
28
28
  createWithoutConfirmation: boolean;
29
- menuClassName: string;
29
+ menuClassName?: string;
30
30
  icon?: ReactNode;
31
+ isDropdownMode?: boolean;
31
32
  skipOptionCreation?: boolean;
32
33
  isOptionUnique?: (value: boolean | null) => void;
33
34
  refFunction?: Ref<HTMLInputElement>;
@@ -61,5 +61,5 @@ export { default as TreeIcon } from './svg/tree.svg';
61
61
  export { default as WarningIcon } from './svg/warning.svg';
62
62
  export { default as XlsIcon } from './svg/xls.svg';
63
63
  export { default as TestPlanIcon } from './svg/testPlan.svg';
64
- export { default as OwnerIcon } from './svg/owner.svg';
64
+ export { default as UserIcon } from './svg/userIcon.svg';
65
65
  export { default as LaunchTypeIcon } from './svg/launchType.svg';
@@ -2,7 +2,7 @@ import { jsxs as F, Fragment as $, jsx as r } from "react/jsx-runtime";
2
2
  import B from "react-datepicker/dist/es/index.js";
3
3
  import { c as R } from "./bind-06a7ff84.js";
4
4
  import { useMemo as P, useRef as D } from "react";
5
- import { F as I } from "./fieldText-ba8a917c.js";
5
+ import { F as I } from "./fieldText-e4a554dc.js";
6
6
  import { D as E } from "./dropdown-ec754bbe.js";
7
7
  import { S as T } from "./calendarArrow-44c7e60e.js";
8
8
  import { registerLocale as j } from "react-datepicker";
@@ -1,10 +1,10 @@
1
- import { D as t } from "./datePicker-efa4e2d6.js";
2
- import { r as q } from "./datePicker-efa4e2d6.js";
1
+ import { D as t } from "./datePicker-fe5bfdcd.js";
2
+ import { r as q } from "./datePicker-fe5bfdcd.js";
3
3
  import "react/jsx-runtime";
4
4
  import "react-datepicker/dist/es/index.js";
5
5
  import "./bind-06a7ff84.js";
6
6
  import "react";
7
- import "./fieldText-ba8a917c.js";
7
+ import "./fieldText-e4a554dc.js";
8
8
  import "./openEye-7b9cf080.js";
9
9
  import "./baseIconButton-251479f7.js";
10
10
  import "./spinLoader-c4a53718.js";
@@ -0,0 +1,166 @@
1
+ import { jsx as n, jsxs as s, Fragment as B } from "react/jsx-runtime";
2
+ import { forwardRef as W, useRef as X, useId as Y, useState as E } from "react";
3
+ import { c as Z } from "./bind-06a7ff84.js";
4
+ import { b as q, a as nn, S as en } from "./openEye-7b9cf080.js";
5
+ import { B as tn } from "./baseIconButton-251479f7.js";
6
+ import { S as on } from "./spinLoader-c4a53718.js";
7
+ import { M as sn } from "./maxValueDisplay-9be01a75.js";
8
+ import { FieldLabel as an } from "./fieldLabel.js";
9
+ const cn = "_collapsed_p9bm7_13", rn = "_field_p9bm7_25", ln = "_placeholder_p9bm7_50", pn = "_disabled_p9bm7_53", dn = "_error_p9bm7_56", _n = "_touched_p9bm7_56", mn = "_input_p9bm7_75", un = "_icon_p9bm7_1", fn = "_text_p9bm7_173", hn = {
10
+ "icon-container": "_icon-container_p9bm7_1",
11
+ "icon-container-additional": "_icon-container-additional_p9bm7_1",
12
+ "icon-container-end": "_icon-container-end_p9bm7_1",
13
+ "icon-container-start": "_icon-container-start_p9bm7_1",
14
+ collapsed: cn,
15
+ field: rn,
16
+ "default-width": "_default-width_p9bm7_37",
17
+ placeholder: ln,
18
+ disabled: pn,
19
+ error: dn,
20
+ touched: _n,
21
+ "max-length-display": "_max-length-display_p9bm7_63",
22
+ "input-container": "_input-container_p9bm7_75",
23
+ "type-password": "_type-password_p9bm7_79",
24
+ input: mn,
25
+ "eye-icon": "_eye-icon_p9bm7_83",
26
+ icon: un,
27
+ "start-icon": "_start-icon_p9bm7_129",
28
+ "clear-icon": "_clear-icon_p9bm7_130",
29
+ "additional-content": "_additional-content_p9bm7_166",
30
+ text: fn,
31
+ "error-text": "_error-text_p9bm7_193",
32
+ "help-text": "_help-text_p9bm7_197"
33
+ }, e = Z.bind(hn), Dn = W(
34
+ ({
35
+ value: o = "",
36
+ className: v,
37
+ classNameHelpText: C,
38
+ error: r,
39
+ placeholder: m,
40
+ disabled: a = !1,
41
+ onChange: T,
42
+ touched: u = !1,
43
+ title: V,
44
+ label: l,
45
+ helpText: p,
46
+ defaultWidth: k = !0,
47
+ startIcon: f,
48
+ endIcon: h,
49
+ clearable: I = !1,
50
+ onClear: b,
51
+ isRequired: x = !1,
52
+ hasDoubleMessage: L = !1,
53
+ type: c = "text",
54
+ displayError: P = !0,
55
+ collapsible: R = !1,
56
+ loading: j = !1,
57
+ maxLengthDisplay: H,
58
+ onFocus: O = () => {
59
+ },
60
+ onBlur: U = () => {
61
+ },
62
+ ...$
63
+ }, z) => {
64
+ const A = X(null), d = z || A, w = Y(), [N, y] = E(!1), [g, F] = E(!1), G = (t) => {
65
+ y(!0), O(t);
66
+ }, J = (t) => {
67
+ y(!1), U(t);
68
+ }, K = () => {
69
+ var t;
70
+ b && (b(o), (t = d.current) == null || t.focus());
71
+ }, S = P && r && u, D = /* @__PURE__ */ n("span", { className: e("text", "help-text", C), children: p }), Q = () => c !== "password" ? c : g ? "text" : "password", M = (t) => {
72
+ t.preventDefault(), F(!0);
73
+ }, i = (t) => {
74
+ t.preventDefault(), F(!1);
75
+ };
76
+ return /* @__PURE__ */ s(B, { children: [
77
+ l && /* @__PURE__ */ n(an, { isRequired: x, htmlFor: w, children: l }),
78
+ /* @__PURE__ */ s(
79
+ "div",
80
+ {
81
+ className: e("field", v, {
82
+ error: r,
83
+ touched: u,
84
+ disabled: a,
85
+ "default-width": k,
86
+ collapsed: R && !N && !o
87
+ }),
88
+ title: V,
89
+ children: [
90
+ j ? /* @__PURE__ */ n(on, {}) : f && /* @__PURE__ */ n(
91
+ "span",
92
+ {
93
+ className: e("icon-container-start"),
94
+ onClick: () => {
95
+ var _;
96
+ (_ = d.current) == null || _.focus();
97
+ },
98
+ children: /* @__PURE__ */ n("span", { className: e("icon", { "start-icon": !N }), children: f })
99
+ }
100
+ ),
101
+ /* @__PURE__ */ s("span", { className: e("input-container", `type-${c}`), children: [
102
+ /* @__PURE__ */ n(
103
+ "input",
104
+ {
105
+ ref: d,
106
+ type: Q(),
107
+ className: e("input"),
108
+ value: o,
109
+ disabled: a,
110
+ id: w,
111
+ onChange: T,
112
+ onFocus: G,
113
+ onBlur: J,
114
+ ...$
115
+ }
116
+ ),
117
+ c === "password" && o && /* @__PURE__ */ n(
118
+ tn,
119
+ {
120
+ className: e("eye-icon"),
121
+ onMouseDown: M,
122
+ onMouseLeave: i,
123
+ onMouseUp: i,
124
+ onTouchStart: M,
125
+ onTouchEnd: i,
126
+ onTouchCancel: i,
127
+ children: g ? /* @__PURE__ */ n(q, {}) : /* @__PURE__ */ n(nn, {})
128
+ }
129
+ ),
130
+ m && !o && /* @__PURE__ */ s("span", { className: e("placeholder"), children: [
131
+ m,
132
+ x && !l && /* @__PURE__ */ n("span", { className: e("asterisk") })
133
+ ] })
134
+ ] }),
135
+ /* @__PURE__ */ n(
136
+ sn,
137
+ {
138
+ className: e("max-length-display"),
139
+ value: o.length,
140
+ maxValue: H
141
+ }
142
+ ),
143
+ I && o.length > 0 && /* @__PURE__ */ n("span", { className: e("icon-container-end"), children: /* @__PURE__ */ n(
144
+ "button",
145
+ {
146
+ type: "button",
147
+ className: e("clear-icon", { disabled: a }),
148
+ onClick: K,
149
+ onMouseDown: (t) => t.preventDefault(),
150
+ children: /* @__PURE__ */ n(en, {})
151
+ }
152
+ ) }),
153
+ h && /* @__PURE__ */ n("span", { className: e("icon-container-end"), children: /* @__PURE__ */ n("span", { className: e("icon"), children: h }) })
154
+ ]
155
+ }
156
+ ),
157
+ (S || p) && /* @__PURE__ */ n("div", { className: e("additional-content", { disabled: a }), children: S ? /* @__PURE__ */ s(B, { children: [
158
+ /* @__PURE__ */ n("span", { className: e("text", "error-text"), children: r }),
159
+ L && D
160
+ ] }) : p && D })
161
+ ] });
162
+ }
163
+ );
164
+ export {
165
+ Dn as F
166
+ };
package/dist/fieldText.js CHANGED
@@ -1,4 +1,4 @@
1
- import { F as o } from "./fieldText-ba8a917c.js";
1
+ import { F as o } from "./fieldText-e4a554dc.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "./bind-06a7ff84.js";