@reportportal/ui-kit 0.0.1-alpha.6 → 0.0.1-alpha.60
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/LICENSE +201 -201
- package/README.md +255 -3
- package/dist/arrowUp-4a5caee7.js +6 -0
- package/dist/baseIconButton-251479f7.js +25 -0
- package/dist/baseIconButton.js +7 -0
- package/dist/bubblesLoader-a7e709d4.js +17 -0
- package/dist/bubblesLoader.js +1 -1
- package/dist/button-33c88abf.js +62 -0
- package/dist/button.js +1 -1
- package/dist/calendarArrow-3e1339ea.js +6 -0
- package/dist/checkbox-9a6c7ce1.js +73 -0
- package/dist/checkbox.js +1 -1
- package/dist/close-4b33d7c1.js +5 -0
- package/dist/common/hooks/useOnClickOutside.d.ts +1 -0
- package/dist/common/types.d.ts +3 -0
- package/dist/components/baseIconButton/baseIconButton.d.ts +9 -0
- package/dist/components/baseIconButton/index.d.ts +5 -0
- package/dist/components/bubblesLoader/bubblesLoader.d.ts +1 -0
- package/dist/components/bubblesLoader/index.d.ts +1 -0
- package/dist/components/button/button.d.ts +1 -1
- package/dist/components/button/index.d.ts +3 -2
- package/dist/components/checkbox/checkbox.d.ts +3 -0
- 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 +5 -0
- package/dist/components/dropdown/dropdown.d.ts +12 -5
- 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/fieldNumber/constants.d.ts +1 -0
- package/dist/components/fieldNumber/fieldNumber.d.ts +2 -1
- package/dist/components/fieldNumber/index.d.ts +1 -0
- package/dist/components/fieldText/fieldText.d.ts +13 -5
- package/dist/components/fieldText/index.d.ts +1 -0
- package/dist/components/fieldText/types.d.ts +5 -0
- package/dist/components/fieldTextFlex/fieldTextFlex.d.ts +16 -0
- package/dist/components/fieldTextFlex/index.d.ts +4 -0
- package/dist/components/icons/index.d.ts +32 -0
- package/dist/components/index.d.ts +11 -1
- 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 -2
- package/dist/components/modal/modalContent/modalContent.d.ts +2 -0
- package/dist/components/modal/modalFooter/modalFooter.d.ts +1 -0
- package/dist/components/modal/modalHeader/modalHeader.d.ts +2 -1
- package/dist/components/pagination/index.d.ts +5 -0
- package/dist/components/pagination/itemsCounter/index.d.ts +1 -0
- package/dist/components/pagination/itemsCounter/itemCounter.d.ts +10 -0
- package/dist/components/pagination/pageControls/activePage/activePage.d.ts +13 -0
- package/dist/components/pagination/pageControls/activePage/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/activePage/pageSelector/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/activePage/pageSelector/pageSelector.d.ts +11 -0
- package/dist/components/pagination/pageControls/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageControls.d.ts +17 -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/index.d.ts +1 -0
- package/dist/components/pagination/pageControls/pageNavigator/pageNavigator.d.ts +12 -0
- package/dist/components/pagination/pageSizeControl/index.d.ts +1 -0
- package/dist/components/pagination/pageSizeControl/pageSizeControl.d.ts +11 -0
- package/dist/components/pagination/pageSizeControl/sizeSelector/index.d.ts +1 -0
- package/dist/components/pagination/pageSizeControl/sizeSelector/sizeSelector.d.ts +9 -0
- package/dist/components/pagination/pagination.d.ts +23 -0
- package/dist/components/pagination/types.d.ts +2 -0
- package/dist/components/popover/index.d.ts +1 -0
- package/dist/components/popover/popover.d.ts +19 -0
- package/dist/components/radio/index.d.ts +5 -0
- package/dist/components/radio/radio.d.ts +17 -0
- package/dist/components/radio/radioGroup.d.ts +9 -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 +16 -0
- package/dist/components/systemMessage/index.d.ts +1 -0
- package/dist/components/systemMessage/systemMessage.d.ts +1 -0
- package/dist/components/table/index.d.ts +4 -0
- package/dist/components/table/table.d.ts +4 -0
- package/dist/components/table/types.d.ts +54 -0
- package/dist/components/table/utils.d.ts +4 -0
- package/dist/components/themeProvider/index.d.ts +1 -0
- package/dist/components/themeProvider/themeProvider.d.ts +3 -1
- package/dist/components/toggle/index.d.ts +1 -0
- package/dist/components/toggle/toggle.d.ts +1 -0
- package/dist/components/tooltip/index.d.ts +1 -0
- package/dist/components/tooltip/tooltip.d.ts +23 -0
- package/dist/datePicker-5253e237.js +201 -0
- package/dist/datePicker.js +27 -0
- package/dist/dropdown-0260bb66.js +5 -0
- package/dist/dropdown-d6aea1b9.js +273 -0
- package/dist/dropdown.js +5 -4
- package/dist/fieldNumber-d81e551e.js +125 -0
- package/dist/fieldNumber.js +3 -3
- package/dist/fieldText-10046ca8.js +161 -0
- package/dist/fieldText.js +5 -2
- package/dist/fieldTextFlex-314741ad.js +78 -0
- package/dist/fieldTextFlex.js +9 -0
- package/dist/icons.js +44 -0
- package/dist/index.js +86 -23
- package/dist/maxValueDisplay-9be01a75.js +13 -0
- package/dist/maxValueDisplay.js +6 -0
- package/dist/modal.js +114 -96
- package/dist/openEye-7b9cf080.js +7 -0
- package/dist/pagination-2076b7b6.js +345 -0
- package/dist/pagination.js +19 -0
- package/dist/plus-0929dda4.js +6 -0
- package/dist/popover.js +95 -0
- package/dist/prevPage-87faf576.js +6 -0
- package/dist/radio-bccc84f2.js +76 -0
- package/dist/{icon.js → radio.js} +4 -4
- package/dist/spinLoader-c4a53718.js +11 -0
- package/dist/spinLoader.js +7 -0
- package/dist/style.css +1 -1
- package/dist/success-dc1914aa.js +7 -0
- package/dist/systemAlert.js +63 -0
- package/dist/systemMessage-1ced6079.js +30 -0
- package/dist/systemMessage.js +1 -1
- package/dist/table-32fc8c70.js +144 -0
- package/dist/table.js +11 -0
- package/dist/themeProvider-46c2be7b.js +23 -0
- package/dist/themeProvider.js +4 -3
- package/dist/toggle-1a3aacb5.js +59 -0
- package/dist/toggle.js +1 -1
- package/dist/tooltip.js +101 -0
- package/package.json +53 -17
- package/dist/bubblesLoader-9bec3797.js +0 -17
- package/dist/button-d4944dbc.js +0 -64
- package/dist/checkbox-fdc44740.js +0 -68
- package/dist/clear-4963efcd.js +0 -5
- package/dist/components/icon/icon.d.ts +0 -11
- package/dist/components/icon/icons.d.ts +0 -21
- package/dist/components/icon/index.d.ts +0 -3
- package/dist/dropdown-45e7bc7d.js +0 -204
- package/dist/fieldNumber-8417cd65.js +0 -132
- package/dist/fieldText-c7085849.js +0 -99
- package/dist/icon-71262f5c.js +0 -26
- package/dist/systemMessage-62c3133d.js +0 -30
- package/dist/themeProvider-5800417e.js +0 -19
- package/dist/toggle-5b3d8333.js +0 -67
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
export interface Column {
|
|
4
|
+
key: string;
|
|
5
|
+
header: string;
|
|
6
|
+
}
|
|
7
|
+
export interface PrimaryColumn extends Column {
|
|
8
|
+
primary: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface FixedColumn extends Column {
|
|
11
|
+
width: string | number;
|
|
12
|
+
align?: 'left' | 'center' | 'right';
|
|
13
|
+
}
|
|
14
|
+
export interface RowConfigs {
|
|
15
|
+
size?: 'small' | 'medium' | 'large';
|
|
16
|
+
}
|
|
17
|
+
export interface DetailedCellData {
|
|
18
|
+
content: string | number;
|
|
19
|
+
component: ReactNode;
|
|
20
|
+
}
|
|
21
|
+
export interface MetaData {
|
|
22
|
+
[key: string]: any;
|
|
23
|
+
}
|
|
24
|
+
export interface RowData {
|
|
25
|
+
id: string | number;
|
|
26
|
+
[key: string]: DetailedCellData | RowConfigs | string | number | any;
|
|
27
|
+
rowConfigs?: RowConfigs;
|
|
28
|
+
metaData?: MetaData;
|
|
29
|
+
}
|
|
30
|
+
export declare enum SortDirection {
|
|
31
|
+
ASC = "asc",
|
|
32
|
+
DESC = "desc"
|
|
33
|
+
}
|
|
34
|
+
export interface SortConfig {
|
|
35
|
+
key: string;
|
|
36
|
+
direction: SortDirection;
|
|
37
|
+
}
|
|
38
|
+
export interface TableComponentProps {
|
|
39
|
+
data: RowData[];
|
|
40
|
+
primaryColumn: Column;
|
|
41
|
+
fixedColumns: FixedColumn[];
|
|
42
|
+
renderRowActions?: (metaData?: MetaData) => ReactNode;
|
|
43
|
+
selectable?: boolean;
|
|
44
|
+
className?: string;
|
|
45
|
+
headerClassName?: string;
|
|
46
|
+
rowClassName?: string;
|
|
47
|
+
selectedRowIds?: (string | number)[];
|
|
48
|
+
sortingDirection?: SortDirection;
|
|
49
|
+
sortingColumn?: Column;
|
|
50
|
+
sortableColumns?: string[];
|
|
51
|
+
onChangeSorting?: (sortConfig?: SortConfig) => void;
|
|
52
|
+
onToggleRowSelection?: (id: string | number) => void;
|
|
53
|
+
onToggleAllRowsSelection?: () => void;
|
|
54
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
|
|
2
3
|
type ThemeKey = 'light' | 'dark' | string;
|
|
3
4
|
interface ITheme {
|
|
4
5
|
[themeKey: ThemeKey]: string;
|
|
@@ -7,6 +8,7 @@ interface IThemeProviderProps {
|
|
|
7
8
|
children?: ReactNode;
|
|
8
9
|
theme?: ThemeKey;
|
|
9
10
|
customThemes?: ITheme;
|
|
11
|
+
className?: string;
|
|
10
12
|
}
|
|
11
|
-
export declare function ThemeProvider({ children, theme, customThemes, }: IThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function ThemeProvider({ children, theme, customThemes, className, }: IThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
14
|
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Tooltip } from './tooltip';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
import { Placement } from '@floating-ui/react';
|
|
3
|
+
|
|
4
|
+
interface TooltipProps {
|
|
5
|
+
content: ReactNode;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
wrapperClassName?: string;
|
|
8
|
+
tooltipClassName?: string;
|
|
9
|
+
contentClassName?: string;
|
|
10
|
+
dynamicWidth?: boolean;
|
|
11
|
+
width?: number;
|
|
12
|
+
minWidth?: number;
|
|
13
|
+
placement?: Placement;
|
|
14
|
+
dataAutomationId?: string;
|
|
15
|
+
arrowColor?: string;
|
|
16
|
+
safeZone?: number;
|
|
17
|
+
zIndex?: number;
|
|
18
|
+
mainAxis?: boolean;
|
|
19
|
+
portalRoot?: Element;
|
|
20
|
+
isFloating?: boolean;
|
|
21
|
+
}
|
|
22
|
+
export declare const Tooltip: FC<TooltipProps>;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { jsxs as S, Fragment as U, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import $ from "react-datepicker/dist/es/index.js";
|
|
3
|
+
import { c as R } from "./bind-06a7ff84.js";
|
|
4
|
+
import { useMemo as P, useRef as B } from "react";
|
|
5
|
+
import { F as D } from "./fieldText-10046ca8.js";
|
|
6
|
+
import { a as E, S as G } from "./calendarArrow-3e1339ea.js";
|
|
7
|
+
import { D as T } from "./dropdown-d6aea1b9.js";
|
|
8
|
+
import { registerLocale as H } from "react-datepicker";
|
|
9
|
+
const pe = (r, s) => {
|
|
10
|
+
H(r, s);
|
|
11
|
+
}, V = (r, s = 20) => {
|
|
12
|
+
const l = r + s;
|
|
13
|
+
return new Array(l - r).fill(void 0).map((g, o) => r - o);
|
|
14
|
+
}, O = "_header_a3cjx_1", W = "_disabled_a3cjx_25", q = "_dropdown_a3cjx_8", z = {
|
|
15
|
+
header: O,
|
|
16
|
+
"dropdowns-wrapper": "_dropdowns-wrapper_a3cjx_8",
|
|
17
|
+
"button-prev": "_button-prev_a3cjx_13",
|
|
18
|
+
"button-next": "_button-next_a3cjx_14",
|
|
19
|
+
disabled: W,
|
|
20
|
+
dropdown: q,
|
|
21
|
+
"month-dropdown": "_month-dropdown_a3cjx_44",
|
|
22
|
+
"toggle-button": "_toggle-button_a3cjx_47"
|
|
23
|
+
}, a = R.bind(z), J = ({
|
|
24
|
+
date: r = /* @__PURE__ */ new Date(),
|
|
25
|
+
changeYear: s = () => {
|
|
26
|
+
},
|
|
27
|
+
changeMonth: l = () => {
|
|
28
|
+
},
|
|
29
|
+
decreaseMonth: g = () => {
|
|
30
|
+
},
|
|
31
|
+
increaseMonth: o = () => {
|
|
32
|
+
},
|
|
33
|
+
prevMonthButtonDisabled: n = !1,
|
|
34
|
+
nextMonthButtonDisabled: h = !1,
|
|
35
|
+
headerNodes: b = null,
|
|
36
|
+
customClassName: w = "",
|
|
37
|
+
yearsOptions: i = [],
|
|
38
|
+
locale: x
|
|
39
|
+
}) => {
|
|
40
|
+
const p = r.getFullYear(), C = r.getMonth(), f = P(() => {
|
|
41
|
+
const e = Array(12).keys(), c = new Intl.DateTimeFormat(x, {
|
|
42
|
+
month: "long"
|
|
43
|
+
}), d = (m) => c.format(new Date(p, m));
|
|
44
|
+
return Array.from(e, d).reduce((m, j, A) => m.concat({
|
|
45
|
+
value: A,
|
|
46
|
+
label: j
|
|
47
|
+
}), []);
|
|
48
|
+
}, []), N = P(() => (i.length > 0 ? i : V(p)).reduce(
|
|
49
|
+
(c, d) => c.concat({ value: d, label: `${d}` }),
|
|
50
|
+
[]
|
|
51
|
+
), [i]), v = (e) => {
|
|
52
|
+
l(e);
|
|
53
|
+
}, y = (e) => {
|
|
54
|
+
s(e);
|
|
55
|
+
};
|
|
56
|
+
return /* @__PURE__ */ S(U, { children: [
|
|
57
|
+
b && /* @__PURE__ */ t("div", { className: a(w), children: b }),
|
|
58
|
+
/* @__PURE__ */ S("div", { className: a("header"), children: [
|
|
59
|
+
/* @__PURE__ */ t(
|
|
60
|
+
"button",
|
|
61
|
+
{
|
|
62
|
+
"aria-label": "Previous Months",
|
|
63
|
+
disabled: n,
|
|
64
|
+
onClick: (e) => {
|
|
65
|
+
e.stopPropagation(), g();
|
|
66
|
+
},
|
|
67
|
+
className: a("button-prev", { disabled: n }),
|
|
68
|
+
children: /* @__PURE__ */ t(E, {})
|
|
69
|
+
}
|
|
70
|
+
),
|
|
71
|
+
/* @__PURE__ */ S("div", { className: a("dropdowns-wrapper"), children: [
|
|
72
|
+
/* @__PURE__ */ t(
|
|
73
|
+
T,
|
|
74
|
+
{
|
|
75
|
+
options: f,
|
|
76
|
+
value: C,
|
|
77
|
+
onChange: v,
|
|
78
|
+
transparentBackground: !0,
|
|
79
|
+
className: a("dropdown", "month-dropdown"),
|
|
80
|
+
toggleButtonClassName: a("toggle-button")
|
|
81
|
+
}
|
|
82
|
+
),
|
|
83
|
+
/* @__PURE__ */ t(
|
|
84
|
+
T,
|
|
85
|
+
{
|
|
86
|
+
options: N,
|
|
87
|
+
value: p,
|
|
88
|
+
onChange: y,
|
|
89
|
+
transparentBackground: !0,
|
|
90
|
+
className: a("dropdown"),
|
|
91
|
+
toggleButtonClassName: a("toggle-button")
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ t(
|
|
96
|
+
"button",
|
|
97
|
+
{
|
|
98
|
+
"aria-label": "Next Months",
|
|
99
|
+
disabled: h,
|
|
100
|
+
onClick: (e) => {
|
|
101
|
+
e.stopPropagation(), o();
|
|
102
|
+
},
|
|
103
|
+
className: a("button-next", { disabled: h }),
|
|
104
|
+
children: /* @__PURE__ */ t(E, {})
|
|
105
|
+
}
|
|
106
|
+
)
|
|
107
|
+
] })
|
|
108
|
+
] });
|
|
109
|
+
}, K = "_calendar_1jr94_5", Q = "_date_1jr94_90", X = "_disabled_1jr94_202", Z = "_popper_1jr94_210", ee = "_input_1jr94_214", oe = {
|
|
110
|
+
calendar: K,
|
|
111
|
+
"current-date": "_current-date_1jr94_89",
|
|
112
|
+
date: Q,
|
|
113
|
+
"selected-range": "_selected-range_1jr94_119",
|
|
114
|
+
"end-date": "_end-date_1jr94_119",
|
|
115
|
+
disabled: X,
|
|
116
|
+
popper: Z,
|
|
117
|
+
input: ee
|
|
118
|
+
}, _ = R.bind(oe), ne = "en", L = "MM-dd-yyyy", me = ({
|
|
119
|
+
onChange: r = () => {
|
|
120
|
+
},
|
|
121
|
+
disabled: s = !1,
|
|
122
|
+
onBlur: l = () => {
|
|
123
|
+
},
|
|
124
|
+
onFocus: g = () => {
|
|
125
|
+
},
|
|
126
|
+
endDate: o = void 0,
|
|
127
|
+
startDate: n = void 0,
|
|
128
|
+
headerNodes: h = null,
|
|
129
|
+
customClassName: b = "",
|
|
130
|
+
customTimeInput: w = void 0,
|
|
131
|
+
shouldCloseOnSelect: i = !0,
|
|
132
|
+
popperClassName: x = "",
|
|
133
|
+
calendarClassName: p = "",
|
|
134
|
+
fixedHeight: C = !1,
|
|
135
|
+
language: f = ne,
|
|
136
|
+
yearsOptions: N = [],
|
|
137
|
+
placeholder: v = L.toUpperCase(),
|
|
138
|
+
dateFormat: y = L,
|
|
139
|
+
selects: e = "start",
|
|
140
|
+
value: c = null
|
|
141
|
+
}) => {
|
|
142
|
+
const d = B(null), k = n == null ? void 0 : n.toDateString(), m = o == null ? void 0 : o.toDateString(), j = o && n && o > n, A = (u) => {
|
|
143
|
+
const F = u.toDateString(), Y = F === k, M = j && F === m, I = n && o && u > n && u < o;
|
|
144
|
+
return _("date", {
|
|
145
|
+
"current-date": Y,
|
|
146
|
+
"selected-range": I && !M,
|
|
147
|
+
"end-date": M && j,
|
|
148
|
+
disabled: s
|
|
149
|
+
});
|
|
150
|
+
};
|
|
151
|
+
return /* @__PURE__ */ t(
|
|
152
|
+
$,
|
|
153
|
+
{
|
|
154
|
+
customInput: /* @__PURE__ */ t(
|
|
155
|
+
D,
|
|
156
|
+
{
|
|
157
|
+
className: _("input"),
|
|
158
|
+
defaultWidth: !1,
|
|
159
|
+
endIcon: /* @__PURE__ */ t(G, {}),
|
|
160
|
+
ref: d
|
|
161
|
+
}
|
|
162
|
+
),
|
|
163
|
+
placeholderText: v,
|
|
164
|
+
selected: c,
|
|
165
|
+
startDate: n,
|
|
166
|
+
endDate: o,
|
|
167
|
+
minDate: e === "end" ? n : void 0,
|
|
168
|
+
disabled: s,
|
|
169
|
+
shouldCloseOnSelect: i,
|
|
170
|
+
fixedHeight: C,
|
|
171
|
+
locale: f,
|
|
172
|
+
showPopperArrow: !1,
|
|
173
|
+
dayClassName: A,
|
|
174
|
+
calendarClassName: _(p, "calendar"),
|
|
175
|
+
renderCustomHeader: (u) => /* @__PURE__ */ t(
|
|
176
|
+
J,
|
|
177
|
+
{
|
|
178
|
+
...u,
|
|
179
|
+
headerNodes: h,
|
|
180
|
+
customClassName: b,
|
|
181
|
+
yearsOptions: N,
|
|
182
|
+
locale: f
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
onChange: r,
|
|
186
|
+
onBlur: l,
|
|
187
|
+
onFocus: g,
|
|
188
|
+
customTimeInput: w,
|
|
189
|
+
showTimeInput: !!w,
|
|
190
|
+
popperClassName: _(x, "popper"),
|
|
191
|
+
dateFormat: y,
|
|
192
|
+
selectsStart: e === "start",
|
|
193
|
+
selectsEnd: e === "end",
|
|
194
|
+
className: _("datepicker")
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
};
|
|
198
|
+
export {
|
|
199
|
+
me as D,
|
|
200
|
+
pe as r
|
|
201
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { D as t } from "./datePicker-5253e237.js";
|
|
2
|
+
import { r as q } from "./datePicker-5253e237.js";
|
|
3
|
+
import "react/jsx-runtime";
|
|
4
|
+
import "react-datepicker/dist/es/index.js";
|
|
5
|
+
import "./bind-06a7ff84.js";
|
|
6
|
+
import "react";
|
|
7
|
+
import "./fieldText-10046ca8.js";
|
|
8
|
+
import "./openEye-7b9cf080.js";
|
|
9
|
+
import "./button-33c88abf.js";
|
|
10
|
+
import "./spinLoader-c4a53718.js";
|
|
11
|
+
import "./maxValueDisplay-9be01a75.js";
|
|
12
|
+
import "./calendarArrow-3e1339ea.js";
|
|
13
|
+
import "./dropdown-d6aea1b9.js";
|
|
14
|
+
import "@floating-ui/react-dom";
|
|
15
|
+
import "downshift";
|
|
16
|
+
import "rc-scrollbars";
|
|
17
|
+
import "./useOnClickOutside-c332f7d3.js";
|
|
18
|
+
import "./keyCodes-f63c0e11.js";
|
|
19
|
+
import "./baseIconButton-251479f7.js";
|
|
20
|
+
import "./dropdown-0260bb66.js";
|
|
21
|
+
import "./checkbox-9a6c7ce1.js";
|
|
22
|
+
import "react-datepicker";
|
|
23
|
+
export {
|
|
24
|
+
t as DatePicker,
|
|
25
|
+
t as default,
|
|
26
|
+
q as registerDatePickerLocale
|
|
27
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const o = (t) => /* @__PURE__ */ e.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ e.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" }));
|
|
3
|
+
export {
|
|
4
|
+
o as S
|
|
5
|
+
};
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import { jsxs as f, jsx as d, Fragment as U } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as oe, useState as q, useRef as ce } from "react";
|
|
3
|
+
import { c as J } from "./bind-06a7ff84.js";
|
|
4
|
+
import { useFloating as _e, offset as he, flip as fe } from "@floating-ui/react-dom";
|
|
5
|
+
import { useSelect as j } from "downshift";
|
|
6
|
+
import { Scrollbars as ge } from "rc-scrollbars";
|
|
7
|
+
import { u as ue } from "./useOnClickOutside-c332f7d3.js";
|
|
8
|
+
import { K as u } from "./keyCodes-f63c0e11.js";
|
|
9
|
+
import { B as ye } from "./baseIconButton-251479f7.js";
|
|
10
|
+
import { S as pe } from "./dropdown-0260bb66.js";
|
|
11
|
+
import { C as me } from "./checkbox-9a6c7ce1.js";
|
|
12
|
+
const Ce = "_disabled_t3cjj_12", Oe = "_hidden_t3cjj_16", be = "_hover_t3cjj_22", Ne = {
|
|
13
|
+
"dropdown-option": "_dropdown-option_t3cjj_1",
|
|
14
|
+
disabled: Ce,
|
|
15
|
+
hidden: Oe,
|
|
16
|
+
hover: be,
|
|
17
|
+
"single-option": "_single-option_t3cjj_35",
|
|
18
|
+
"sub-option": "_sub-option_t3cjj_42"
|
|
19
|
+
}, z = J.bind(Ne), G = oe(
|
|
20
|
+
(r, t) => {
|
|
21
|
+
const {
|
|
22
|
+
option: { value: n, disabled: l, hidden: w, label: y, title: c, groupRef: a },
|
|
23
|
+
selected: v,
|
|
24
|
+
onChange: p,
|
|
25
|
+
render: C,
|
|
26
|
+
highlightHovered: O,
|
|
27
|
+
onMouseEnter: K,
|
|
28
|
+
multiSelect: m,
|
|
29
|
+
isPartiallyChecked: A = !1
|
|
30
|
+
} = r, x = (b) => {
|
|
31
|
+
(b.target instanceof HTMLDivElement || b.target instanceof HTMLInputElement) && (p == null || p(n));
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ f(
|
|
34
|
+
"div",
|
|
35
|
+
{
|
|
36
|
+
className: z("dropdown-option", {
|
|
37
|
+
disabled: l,
|
|
38
|
+
hidden: w,
|
|
39
|
+
hover: O
|
|
40
|
+
}),
|
|
41
|
+
title: c,
|
|
42
|
+
onClick: x,
|
|
43
|
+
ref: t,
|
|
44
|
+
onMouseEnter: K,
|
|
45
|
+
children: [
|
|
46
|
+
m && /* @__PURE__ */ d(me, { value: !!v, partiallyChecked: A }),
|
|
47
|
+
/* @__PURE__ */ d("div", { className: z("single-option", { "sub-option": !!a }), children: C ? C(r) : y })
|
|
48
|
+
]
|
|
49
|
+
}
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
), De = [
|
|
53
|
+
u.ENTER_KEY_CODE,
|
|
54
|
+
u.SPACE_KEY_CODE,
|
|
55
|
+
u.ARROW_DOWN_KEY_CODE
|
|
56
|
+
], Ee = [u.ESCAPE_KEY_CODE, u.TAB_KEY_CODE];
|
|
57
|
+
var g = /* @__PURE__ */ ((r) => (r.ON_KEY_DOWN = "onKeyDown", r.ON_CLICK = "onClick", r))(g || {});
|
|
58
|
+
const we = (r, t) => {
|
|
59
|
+
const n = Array.isArray(t) ? t : [t];
|
|
60
|
+
return r.findIndex(({ value: l }) => n.includes(l));
|
|
61
|
+
}, ve = (r, t) => (r % t + t) % t, P = (r, t = 0, n = 1) => {
|
|
62
|
+
if (!r[t].disabled)
|
|
63
|
+
return t;
|
|
64
|
+
const l = r.length;
|
|
65
|
+
return P(
|
|
66
|
+
r,
|
|
67
|
+
ve(t + n, l),
|
|
68
|
+
n
|
|
69
|
+
);
|
|
70
|
+
}, Ke = (r, t) => P(r, t), Ae = (r, t) => P(r, t, -1), xe = "_container_1yr7u_1", Ie = "_icon_1yr7u_7", ke = "_arrow_1yr7u_13", je = "_dropdown_1yr7u_19", Pe = "_disabled_1yr7u_36", Ye = "_value_1yr7u_43", Re = "_error_1yr7u_46", Te = "_touched_1yr7u_46", He = "_opened_1yr7u_50", Me = "_placeholder_1yr7u_83", We = "_ghost_1yr7u_118", Le = "_divider_1yr7u_132", Se = {
|
|
71
|
+
container: xe,
|
|
72
|
+
icon: Ie,
|
|
73
|
+
arrow: ke,
|
|
74
|
+
dropdown: je,
|
|
75
|
+
"transparent-background": "_transparent-background_1yr7u_33",
|
|
76
|
+
disabled: Pe,
|
|
77
|
+
value: Ye,
|
|
78
|
+
error: Re,
|
|
79
|
+
touched: Te,
|
|
80
|
+
opened: He,
|
|
81
|
+
placeholder: Me,
|
|
82
|
+
"mobile-disabled": "_mobile-disabled_1yr7u_87",
|
|
83
|
+
"select-list": "_select-list_1yr7u_92",
|
|
84
|
+
"limited-width": "_limited-width_1yr7u_109",
|
|
85
|
+
"options-container": "_options-container_1yr7u_113",
|
|
86
|
+
ghost: We,
|
|
87
|
+
divider: Le
|
|
88
|
+
}, o = J.bind(Se), tt = ({
|
|
89
|
+
multiSelect: r = !1,
|
|
90
|
+
value: t = r ? [] : "",
|
|
91
|
+
options: n = [],
|
|
92
|
+
disabled: l = !1,
|
|
93
|
+
error: w,
|
|
94
|
+
onChange: y,
|
|
95
|
+
onFocus: c,
|
|
96
|
+
onBlur: a,
|
|
97
|
+
mobileDisabled: v,
|
|
98
|
+
title: p,
|
|
99
|
+
touched: C = !1,
|
|
100
|
+
icon: O,
|
|
101
|
+
variant: K,
|
|
102
|
+
placeholder: m = "",
|
|
103
|
+
renderOption: A,
|
|
104
|
+
transparentBackground: x = !1,
|
|
105
|
+
className: b,
|
|
106
|
+
toggleButtonClassName: Q,
|
|
107
|
+
isListWidthLimited: X = !1,
|
|
108
|
+
optionAll: Y = { value: "all", label: "All" },
|
|
109
|
+
isOptionAllVisible: R = !1,
|
|
110
|
+
onSelectAll: Z = () => {
|
|
111
|
+
},
|
|
112
|
+
formatDisplayedValue: T,
|
|
113
|
+
notScrollable: F = !1,
|
|
114
|
+
footer: H
|
|
115
|
+
}) => {
|
|
116
|
+
const [_, h] = q(!1), M = ce(null), [B, N] = q(null), I = r && Array.isArray(t) ? n.filter((e) => t.includes(e.value)) : null, { refs: W, floatingStyles: ee } = _e({
|
|
117
|
+
middleware: [
|
|
118
|
+
he(5),
|
|
119
|
+
fe({
|
|
120
|
+
fallbackPlacements: ["bottom", "top"]
|
|
121
|
+
})
|
|
122
|
+
]
|
|
123
|
+
}), te = () => {
|
|
124
|
+
if (R && Array.isArray(t)) {
|
|
125
|
+
const e = n.map((s) => s.value);
|
|
126
|
+
y(t.length === n.length ? [] : e), Z();
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
ue(M, () => {
|
|
130
|
+
_ && (h(!1), a == null || a());
|
|
131
|
+
});
|
|
132
|
+
const L = (e) => {
|
|
133
|
+
if (!e.disabled) {
|
|
134
|
+
if (r) {
|
|
135
|
+
const s = Array.isArray(t) ? [...t] : [], i = s.indexOf(e.value);
|
|
136
|
+
i === -1 ? s.push(e.value) : s.splice(i, 1), y(s);
|
|
137
|
+
} else
|
|
138
|
+
y(e.value);
|
|
139
|
+
h((s) => r || !s);
|
|
140
|
+
}
|
|
141
|
+
}, re = () => n.find(({ value: e }) => e === t), S = we(n, t), {
|
|
142
|
+
getToggleButtonProps: ne,
|
|
143
|
+
getMenuProps: se,
|
|
144
|
+
getItemProps: ae,
|
|
145
|
+
setHighlightedIndex: D,
|
|
146
|
+
highlightedIndex: V,
|
|
147
|
+
selectedItem: E
|
|
148
|
+
} = j({
|
|
149
|
+
items: n,
|
|
150
|
+
itemToString: (e) => (e != null && e.label ? String(e.label) : m) || "",
|
|
151
|
+
selectedItem: re(),
|
|
152
|
+
isOpen: _,
|
|
153
|
+
circularNavigation: !0,
|
|
154
|
+
defaultHighlightedIndex: S,
|
|
155
|
+
onHighlightedIndexChange: (e) => {
|
|
156
|
+
switch (e.type) {
|
|
157
|
+
case j.stateChangeTypes.MenuKeyDownArrowUp:
|
|
158
|
+
return N(g.ON_KEY_DOWN), D(Ae(n, e.highlightedIndex)), e;
|
|
159
|
+
case j.stateChangeTypes.MenuKeyDownArrowDown:
|
|
160
|
+
return N(g.ON_KEY_DOWN), D(Ke(n, e.highlightedIndex)), e;
|
|
161
|
+
default:
|
|
162
|
+
return e;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}), de = () => {
|
|
166
|
+
l || (h((e) => !e), _ ? a == null || a() : c == null || c(), N(g.ON_CLICK));
|
|
167
|
+
}, k = (() => {
|
|
168
|
+
if (r && Array.isArray(t) && n.length === t.length)
|
|
169
|
+
return Y.label;
|
|
170
|
+
const e = n.reduce((s, i) => ((Array.isArray(t) && t.includes(i.value) || i.value === t) && s.push(i.label), s), []);
|
|
171
|
+
if (e.length > 0)
|
|
172
|
+
return e.join(", ");
|
|
173
|
+
if (!t && t !== !1 && t !== 0 || Array.isArray(t) && !t.length)
|
|
174
|
+
return m;
|
|
175
|
+
})(), ie = (e) => {
|
|
176
|
+
const { keyCode: s } = e;
|
|
177
|
+
De.includes(s) && !_ && (e.preventDefault(), D(S), h(!0), c == null || c(), N(g.ON_KEY_DOWN));
|
|
178
|
+
}, le = (e) => {
|
|
179
|
+
const { keyCode: s } = e;
|
|
180
|
+
if (s === u.ENTER_KEY_CODE) {
|
|
181
|
+
const i = n[V];
|
|
182
|
+
L(i), r || (h(!1), a == null || a());
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
Ee.includes(s) && (e.stopPropagation(), h(!1), a == null || a());
|
|
186
|
+
}, $ = () => /* @__PURE__ */ f("div", { className: o("options-container"), children: [
|
|
187
|
+
r && R && Array.isArray(t) && /* @__PURE__ */ f(U, { children: [
|
|
188
|
+
/* @__PURE__ */ d(
|
|
189
|
+
G,
|
|
190
|
+
{
|
|
191
|
+
option: Y,
|
|
192
|
+
selected: t.length === n.length,
|
|
193
|
+
onChange: te,
|
|
194
|
+
multiSelect: r,
|
|
195
|
+
isPartiallyChecked: !!t.length
|
|
196
|
+
}
|
|
197
|
+
),
|
|
198
|
+
/* @__PURE__ */ d("div", { className: o("divider") }),
|
|
199
|
+
" "
|
|
200
|
+
] }),
|
|
201
|
+
n.map((e, s) => /* @__PURE__ */ d(
|
|
202
|
+
G,
|
|
203
|
+
{
|
|
204
|
+
...ae({
|
|
205
|
+
item: e,
|
|
206
|
+
index: s
|
|
207
|
+
}),
|
|
208
|
+
multiSelect: r,
|
|
209
|
+
selected: r ? I == null ? void 0 : I.some((i) => i.value === e.value) : e.value === ((E == null ? void 0 : E.value) ?? E),
|
|
210
|
+
option: { title: e.label, ...e },
|
|
211
|
+
highlightHovered: V === s && B !== g.ON_CLICK,
|
|
212
|
+
render: A,
|
|
213
|
+
onChange: e.disabled ? null : () => L(e),
|
|
214
|
+
onMouseEnter: () => D(s)
|
|
215
|
+
},
|
|
216
|
+
e.value
|
|
217
|
+
)),
|
|
218
|
+
H && /* @__PURE__ */ f(U, { children: [
|
|
219
|
+
/* @__PURE__ */ d("div", { className: o("divider") }),
|
|
220
|
+
H
|
|
221
|
+
] })
|
|
222
|
+
] });
|
|
223
|
+
return /* @__PURE__ */ f("div", { ref: M, className: o("container", b), title: p, children: [
|
|
224
|
+
/* @__PURE__ */ f(
|
|
225
|
+
"button",
|
|
226
|
+
{
|
|
227
|
+
disabled: l,
|
|
228
|
+
...ne({
|
|
229
|
+
className: o("dropdown", K, Q, {
|
|
230
|
+
"transparent-background": x,
|
|
231
|
+
opened: _,
|
|
232
|
+
disabled: l,
|
|
233
|
+
error: w,
|
|
234
|
+
touched: C,
|
|
235
|
+
"mobile-disabled": v
|
|
236
|
+
}),
|
|
237
|
+
onClick: de,
|
|
238
|
+
onKeyDown: ie,
|
|
239
|
+
ref: W.setReference
|
|
240
|
+
}),
|
|
241
|
+
type: "button",
|
|
242
|
+
children: [
|
|
243
|
+
O && /* @__PURE__ */ d("span", { className: o("icon"), children: O }),
|
|
244
|
+
/* @__PURE__ */ d(
|
|
245
|
+
"span",
|
|
246
|
+
{
|
|
247
|
+
className: o("value", {
|
|
248
|
+
placeholder: k === m
|
|
249
|
+
}),
|
|
250
|
+
children: T ? T(k) : k
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
/* @__PURE__ */ d(ye, { className: o("arrow"), tabIndex: -1, children: /* @__PURE__ */ d(pe, {}) })
|
|
254
|
+
]
|
|
255
|
+
}
|
|
256
|
+
),
|
|
257
|
+
_ && /* @__PURE__ */ d(
|
|
258
|
+
"div",
|
|
259
|
+
{
|
|
260
|
+
style: ee,
|
|
261
|
+
className: o("select-list", { opened: _, "limited-width": X }),
|
|
262
|
+
...se({
|
|
263
|
+
onKeyDown: le,
|
|
264
|
+
ref: W.setFloating
|
|
265
|
+
}),
|
|
266
|
+
children: F ? $() : /* @__PURE__ */ d(ge, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: $() })
|
|
267
|
+
}
|
|
268
|
+
)
|
|
269
|
+
] });
|
|
270
|
+
};
|
|
271
|
+
export {
|
|
272
|
+
tt as D
|
|
273
|
+
};
|
package/dist/dropdown.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { D as r } from "./dropdown-
|
|
1
|
+
import { D as r } from "./dropdown-d6aea1b9.js";
|
|
2
2
|
import "react/jsx-runtime";
|
|
3
3
|
import "react";
|
|
4
4
|
import "./bind-06a7ff84.js";
|
|
5
|
-
import "react-
|
|
5
|
+
import "@floating-ui/react-dom";
|
|
6
6
|
import "downshift";
|
|
7
7
|
import "rc-scrollbars";
|
|
8
8
|
import "./useOnClickOutside-c332f7d3.js";
|
|
9
9
|
import "./keyCodes-f63c0e11.js";
|
|
10
|
-
import "./
|
|
11
|
-
import "./
|
|
10
|
+
import "./baseIconButton-251479f7.js";
|
|
11
|
+
import "./dropdown-0260bb66.js";
|
|
12
|
+
import "./checkbox-9a6c7ce1.js";
|
|
12
13
|
export {
|
|
13
14
|
r as Dropdown,
|
|
14
15
|
r as default
|