@reportportal/ui-kit 0.0.1-alpha.4 → 0.0.1-alpha.40

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.
Files changed (117) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +252 -3
  3. package/dist/baseIconButton-b6adc843.js +25 -0
  4. package/dist/baseIconButton.js +7 -0
  5. package/dist/bubblesLoader-a7e709d4.js +17 -0
  6. package/dist/bubblesLoader.js +7 -0
  7. package/dist/button-33c88abf.js +62 -0
  8. package/dist/button.js +1 -1
  9. package/dist/checkbox-9a6c7ce1.js +73 -0
  10. package/dist/checkbox.js +2 -2
  11. package/dist/common/constants/keyCodes.d.ts +24 -0
  12. package/dist/components/bubblesLoader/bubblesLoader.d.ts +7 -0
  13. package/dist/components/bubblesLoader/index.d.ts +3 -0
  14. package/dist/components/button/button.d.ts +0 -1
  15. package/dist/components/button/index.d.ts +2 -2
  16. package/dist/components/checkbox/checkbox.d.ts +2 -1
  17. package/dist/components/datePicker/datePicker.d.ts +24 -0
  18. package/dist/components/datePicker/header/datePickerHeader.d.ts +15 -0
  19. package/dist/components/datePicker/header/index.d.ts +3 -0
  20. package/dist/components/datePicker/index.d.ts +3 -0
  21. package/dist/components/datePicker/utils.d.ts +3 -0
  22. package/dist/components/dropdown/constants.d.ts +7 -0
  23. package/dist/components/dropdown/dropdown.d.ts +28 -0
  24. package/dist/components/dropdown/dropdownOption/dropdownOption.d.ts +3 -0
  25. package/dist/components/dropdown/dropdownOption/index.d.ts +3 -0
  26. package/dist/components/dropdown/index.d.ts +3 -0
  27. package/dist/components/dropdown/types.d.ts +22 -0
  28. package/dist/components/dropdown/utils.d.ts +4 -0
  29. package/dist/components/fieldNumber/constants.d.ts +4 -0
  30. package/dist/components/fieldNumber/fieldNumber.d.ts +18 -0
  31. package/dist/components/fieldNumber/index.d.ts +3 -0
  32. package/dist/components/fieldText/fieldText.d.ts +8 -3
  33. package/dist/components/fieldTextFlex/fieldTextFlex.d.ts +14 -0
  34. package/dist/components/fieldTextFlex/index.d.ts +3 -0
  35. package/dist/components/icons/baseIconButton/baseIconButton.d.ts +8 -0
  36. package/dist/components/icons/baseIconButton/index.d.ts +4 -0
  37. package/dist/components/icons/index.d.ts +21 -0
  38. package/dist/components/index.d.ts +14 -0
  39. package/dist/components/modal/modal.d.ts +6 -2
  40. package/dist/components/modal/modalContent/modalContent.d.ts +1 -0
  41. package/dist/components/modal/modalHeader/modalHeader.d.ts +1 -1
  42. package/dist/components/pagination/index.d.ts +4 -0
  43. package/dist/components/pagination/itemsCounter/index.d.ts +1 -0
  44. package/dist/components/pagination/itemsCounter/itemCounter.d.ts +9 -0
  45. package/dist/components/pagination/pageControls/activePage/activePage.d.ts +12 -0
  46. package/dist/components/pagination/pageControls/activePage/index.d.ts +1 -0
  47. package/dist/components/pagination/pageControls/activePage/pageSelector/index.d.ts +1 -0
  48. package/dist/components/pagination/pageControls/activePage/pageSelector/pageSelector.d.ts +10 -0
  49. package/dist/components/pagination/pageControls/index.d.ts +1 -0
  50. package/dist/components/pagination/pageControls/pageControls.d.ts +16 -0
  51. package/dist/components/pagination/pageControls/pageNavigator/bar/bar.d.ts +11 -0
  52. package/dist/components/pagination/pageControls/pageNavigator/bar/index.d.ts +1 -0
  53. package/dist/components/pagination/pageControls/pageNavigator/index.d.ts +1 -0
  54. package/dist/components/pagination/pageControls/pageNavigator/pageNavigator.d.ts +11 -0
  55. package/dist/components/pagination/pageSizeControl/index.d.ts +1 -0
  56. package/dist/components/pagination/pageSizeControl/pageSizeControl.d.ts +10 -0
  57. package/dist/components/pagination/pageSizeControl/sizeSelector/index.d.ts +1 -0
  58. package/dist/components/pagination/pageSizeControl/sizeSelector/sizeSelector.d.ts +8 -0
  59. package/dist/components/pagination/pagination.d.ts +22 -0
  60. package/dist/components/pagination/types.d.ts +2 -0
  61. package/dist/components/popover/index.d.ts +1 -0
  62. package/dist/components/popover/popover.d.ts +18 -0
  63. package/dist/components/radio/index.d.ts +4 -0
  64. package/dist/components/radio/radio.d.ts +16 -0
  65. package/dist/components/radio/radioGroup.d.ts +8 -0
  66. package/dist/components/spinLoader/index.d.ts +3 -0
  67. package/dist/components/spinLoader/spinLoader.d.ts +7 -0
  68. package/dist/components/systemAlert/index.d.ts +1 -0
  69. package/dist/components/systemAlert/systemAlert.d.ts +3 -0
  70. package/dist/components/systemAlert/types.d.ts +14 -0
  71. package/dist/components/table/index.d.ts +3 -0
  72. package/dist/components/table/table.d.ts +3 -0
  73. package/dist/components/table/types.d.ts +53 -0
  74. package/dist/components/table/utils.d.ts +3 -0
  75. package/dist/components/themeProvider/themeProvider.d.ts +2 -1
  76. package/dist/components/toggle/index.d.ts +3 -0
  77. package/dist/components/toggle/toggle.d.ts +11 -0
  78. package/dist/components/tooltip/index.d.ts +1 -0
  79. package/dist/components/tooltip/tooltip.d.ts +19 -0
  80. package/dist/datePicker-1b333ee2.js +196 -0
  81. package/dist/datePicker.js +18 -0
  82. package/dist/dropdown-9f4d1928.js +245 -0
  83. package/dist/dropdown.js +15 -0
  84. package/dist/fieldNumber-1f286b40.js +127 -0
  85. package/dist/fieldNumber.js +10 -0
  86. package/dist/fieldText-65e4c614.js +134 -0
  87. package/dist/fieldText.js +2 -1
  88. package/dist/fieldTextFlex-5bddf46a.js +67 -0
  89. package/dist/fieldTextFlex.js +8 -0
  90. package/dist/index-54e3bfc2.js +147 -0
  91. package/dist/index.js +113 -16
  92. package/dist/keyCodes-f63c0e11.js +4 -0
  93. package/dist/modal.js +14 -135
  94. package/dist/pagination-f087f454.js +346 -0
  95. package/dist/pagination.js +14 -0
  96. package/dist/popover.js +95 -0
  97. package/dist/radio-bccc84f2.js +76 -0
  98. package/dist/radio.js +9 -0
  99. package/dist/style.css +1 -1
  100. package/dist/systemMessage-1ced6079.js +30 -0
  101. package/dist/systemMessage.js +1 -1
  102. package/dist/table-9bf4ddab.js +147 -0
  103. package/dist/table.js +11 -0
  104. package/dist/themeProvider-46c2be7b.js +23 -0
  105. package/dist/themeProvider.js +4 -3
  106. package/dist/toggle-1a3aacb5.js +59 -0
  107. package/dist/toggle.js +9 -0
  108. package/dist/tooltip.js +96 -0
  109. package/dist/useOnClickOutside-c332f7d3.js +16 -0
  110. package/package.json +105 -66
  111. package/dist/button-d4944dbc.js +0 -64
  112. package/dist/checkbox-7736509c.js +0 -70
  113. package/dist/common/constants/key-codes.d.ts +0 -5
  114. package/dist/fieldText-9621b0b7.js +0 -99
  115. package/dist/key-codes-abbe7725.js +0 -4
  116. package/dist/systemMessage-62c3133d.js +0 -30
  117. package/dist/themeProvider-5800417e.js +0 -19
@@ -0,0 +1,196 @@
1
+ import { jsxs as B, Fragment as U, jsx as r } from "react/jsx-runtime";
2
+ import $ from "react-datepicker";
3
+ import { c as P } from "./bind-06a7ff84.js";
4
+ import * as o from "react";
5
+ import { useMemo as F, useRef as D } from "react";
6
+ import { F as G } from "./fieldText-65e4c614.js";
7
+ import "./baseIconButton-b6adc843.js";
8
+ import { D as M } from "./dropdown-9f4d1928.js";
9
+ const R = (e) => /* @__PURE__ */ o.createElement("svg", { width: 8, height: 13, viewBox: "0 0 8 13", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ o.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" })), H = (e) => /* @__PURE__ */ o.createElement("svg", { width: 14, height: 15, viewBox: "0 0 14 15", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ o.createElement("rect", { x: 0.5, y: 1.5, width: 13, height: 13, rx: 1.5, stroke: "#A2AAB5" }), /* @__PURE__ */ o.createElement("rect", { x: 9, width: 1, height: 3.00067, rx: 0.5, fill: "#A2AAB5" }), /* @__PURE__ */ o.createElement("rect", { x: 4, width: 1, height: 3.00067, rx: 0.5, fill: "#A2AAB5" }), /* @__PURE__ */ o.createElement("rect", { x: 14, y: 4, width: 1, height: 14, transform: "rotate(90 14 4)", fill: "#A2AAB5" }), /* @__PURE__ */ o.createElement("rect", { x: 3, y: 10, width: 2, height: 2, fill: "#A2AAB5" }), /* @__PURE__ */ o.createElement("rect", { x: 6, y: 10, width: 2, height: 2, fill: "#A2AAB5" }), /* @__PURE__ */ o.createElement("rect", { x: 6, y: 7, width: 2, height: 2, fill: "#A2AAB5" }), /* @__PURE__ */ o.createElement("rect", { x: 3, y: 7, width: 2, height: 2, fill: "#A2AAB5" }), /* @__PURE__ */ o.createElement("rect", { x: 9, y: 7, width: 2, height: 2, fill: "#A2AAB5" })), V = (e, c = 20) => {
10
+ const i = e + c;
11
+ return new Array(i - e).fill(void 0).map((_, t) => e - t);
12
+ }, O = "_header_a3cjx_1", W = "_disabled_a3cjx_25", Z = "_dropdown_a3cjx_8", q = {
13
+ header: O,
14
+ "dropdowns-wrapper": "_dropdowns-wrapper_a3cjx_8",
15
+ "button-prev": "_button-prev_a3cjx_13",
16
+ "button-next": "_button-next_a3cjx_14",
17
+ disabled: W,
18
+ dropdown: Z,
19
+ "month-dropdown": "_month-dropdown_a3cjx_44",
20
+ "toggle-button": "_toggle-button_a3cjx_47"
21
+ }, l = P.bind(q), z = ({
22
+ date: e = /* @__PURE__ */ new Date(),
23
+ changeYear: c = () => {
24
+ },
25
+ changeMonth: i = () => {
26
+ },
27
+ decreaseMonth: _ = () => {
28
+ },
29
+ increaseMonth: t = () => {
30
+ },
31
+ prevMonthButtonDisabled: n = !1,
32
+ nextMonthButtonDisabled: w = !1,
33
+ headerNodes: A = null,
34
+ customClassName: f = "",
35
+ yearsOptions: m = [],
36
+ locale: v
37
+ }) => {
38
+ const h = e.getFullYear(), C = e.getMonth(), x = F(() => {
39
+ const a = Array(12).keys(), s = new Intl.DateTimeFormat(v, {
40
+ month: "long"
41
+ }), d = (p) => s.format(new Date(h, p));
42
+ return Array.from(a, d).reduce((p, b, N) => p.concat({
43
+ value: N,
44
+ label: b
45
+ }), []);
46
+ }, []), y = F(() => (m.length > 0 ? m : V(h)).reduce(
47
+ (s, d) => s.concat({ value: d, label: `${d}` }),
48
+ []
49
+ ), [m]), E = (a) => {
50
+ i(a);
51
+ }, j = (a) => {
52
+ c(a);
53
+ };
54
+ return /* @__PURE__ */ B(U, { children: [
55
+ A && /* @__PURE__ */ r("div", { className: l(f), children: A }),
56
+ /* @__PURE__ */ B("div", { className: l("header"), children: [
57
+ /* @__PURE__ */ r(
58
+ "button",
59
+ {
60
+ "aria-label": "Previous Months",
61
+ disabled: n,
62
+ onClick: _,
63
+ className: l("button-prev", { disabled: n }),
64
+ children: /* @__PURE__ */ r(R, {})
65
+ }
66
+ ),
67
+ /* @__PURE__ */ B("div", { className: l("dropdowns-wrapper"), children: [
68
+ /* @__PURE__ */ r(
69
+ M,
70
+ {
71
+ options: x,
72
+ value: C,
73
+ onChange: E,
74
+ transparentBackground: !0,
75
+ className: l("dropdown", "month-dropdown"),
76
+ toggleButtonClassName: l("toggle-button")
77
+ }
78
+ ),
79
+ /* @__PURE__ */ r(
80
+ M,
81
+ {
82
+ options: y,
83
+ value: h,
84
+ onChange: j,
85
+ transparentBackground: !0,
86
+ className: l("dropdown"),
87
+ toggleButtonClassName: l("toggle-button")
88
+ }
89
+ )
90
+ ] }),
91
+ /* @__PURE__ */ r(
92
+ "button",
93
+ {
94
+ "aria-label": "Next Months",
95
+ disabled: w,
96
+ onClick: t,
97
+ className: l("button-next", { disabled: w }),
98
+ children: /* @__PURE__ */ r(R, {})
99
+ }
100
+ )
101
+ ] })
102
+ ] });
103
+ }, J = "_calendar_1jr94_5", K = "_date_1jr94_90", Q = "_disabled_1jr94_202", X = "_popper_1jr94_210", ee = "_input_1jr94_214", te = {
104
+ calendar: J,
105
+ "current-date": "_current-date_1jr94_89",
106
+ date: K,
107
+ "selected-range": "_selected-range_1jr94_119",
108
+ "end-date": "_end-date_1jr94_119",
109
+ disabled: Q,
110
+ popper: X,
111
+ input: ee
112
+ }, g = P.bind(te), ne = "en", T = "MM-dd-yyyy", ie = ({
113
+ onChange: e = () => {
114
+ },
115
+ disabled: c = !1,
116
+ onBlur: i = () => {
117
+ },
118
+ onFocus: _ = () => {
119
+ },
120
+ endDate: t = void 0,
121
+ startDate: n = void 0,
122
+ headerNodes: w = null,
123
+ customClassName: A = "",
124
+ customTimeInput: f = void 0,
125
+ shouldCloseOnSelect: m = !0,
126
+ popperClassName: v = "",
127
+ calendarClassName: h = "",
128
+ fixedHeight: C = !1,
129
+ language: x = ne,
130
+ yearsOptions: y = [],
131
+ placeholder: E = T.toUpperCase(),
132
+ dateFormat: j = T,
133
+ selects: a = "start",
134
+ value: s = null
135
+ }) => {
136
+ const d = D(null), L = n == null ? void 0 : n.toDateString(), p = t == null ? void 0 : t.toDateString(), b = t && n && t > n, N = (u) => {
137
+ const S = u.toDateString(), Y = S === L, k = b && S === p, I = n && t && u > n && u < t;
138
+ return g("date", {
139
+ "current-date": Y,
140
+ "selected-range": I && !k,
141
+ "end-date": k && b,
142
+ disabled: c
143
+ });
144
+ };
145
+ return /* @__PURE__ */ r(
146
+ $,
147
+ {
148
+ customInput: /* @__PURE__ */ r(
149
+ G,
150
+ {
151
+ className: g("input"),
152
+ defaultWidth: !1,
153
+ endIcon: /* @__PURE__ */ r(H, {}),
154
+ ref: d
155
+ }
156
+ ),
157
+ placeholderText: E,
158
+ selected: s,
159
+ startDate: n,
160
+ endDate: t,
161
+ minDate: a === "end" ? n : void 0,
162
+ disabled: c,
163
+ shouldCloseOnSelect: m,
164
+ fixedHeight: C,
165
+ locale: x,
166
+ showPopperArrow: !1,
167
+ dayClassName: N,
168
+ calendarClassName: g(h, "calendar"),
169
+ renderCustomHeader: (u) => /* @__PURE__ */ r(
170
+ z,
171
+ {
172
+ ...u,
173
+ headerNodes: w,
174
+ customClassName: A,
175
+ yearsOptions: y,
176
+ locale: x
177
+ }
178
+ ),
179
+ onChange: e,
180
+ onBlur: i,
181
+ onFocus: _,
182
+ customTimeInput: f,
183
+ showTimeInput: !!f,
184
+ popperClassName: g(v, "popper"),
185
+ dateFormat: j,
186
+ selectsStart: a === "start",
187
+ selectsEnd: a === "end",
188
+ className: g("datepicker")
189
+ }
190
+ );
191
+ };
192
+ export {
193
+ ie as D,
194
+ R as S,
195
+ H as a
196
+ };
@@ -0,0 +1,18 @@
1
+ import { D as t } from "./datePicker-1b333ee2.js";
2
+ import "react/jsx-runtime";
3
+ import "react-datepicker";
4
+ import "./bind-06a7ff84.js";
5
+ import "react";
6
+ import "./fieldText-65e4c614.js";
7
+ import "./baseIconButton-b6adc843.js";
8
+ import "./dropdown-9f4d1928.js";
9
+ import "@floating-ui/react-dom";
10
+ import "downshift";
11
+ import "rc-scrollbars";
12
+ import "./useOnClickOutside-c332f7d3.js";
13
+ import "./keyCodes-f63c0e11.js";
14
+ import "./checkbox-9a6c7ce1.js";
15
+ export {
16
+ t as DatePicker,
17
+ t as default
18
+ };
@@ -0,0 +1,245 @@
1
+ import { jsxs as g, jsx as i, Fragment as S } from "react/jsx-runtime";
2
+ import * as j from "react";
3
+ import { forwardRef as de, useState as $, useRef as oe } from "react";
4
+ import { c as Z } from "./bind-06a7ff84.js";
5
+ import { useFloating as le, offset as ce, flip as _e } from "@floating-ui/react-dom";
6
+ import { useSelect as k } from "downshift";
7
+ import { Scrollbars as he } from "rc-scrollbars";
8
+ import { u as ge } from "./useOnClickOutside-c332f7d3.js";
9
+ import { K as f } from "./keyCodes-f63c0e11.js";
10
+ import { B as pe } from "./baseIconButton-b6adc843.js";
11
+ import { C as fe } from "./checkbox-9a6c7ce1.js";
12
+ const Ce = (n) => /* @__PURE__ */ j.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...n }, /* @__PURE__ */ j.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" })), me = "_disabled_1ppvi_12", ue = "_hidden_1ppvi_16", we = "_selected_1ppvi_22", be = "_hover_1ppvi_25", ye = {
13
+ "dropdown-option": "_dropdown-option_1ppvi_1",
14
+ disabled: me,
15
+ hidden: ue,
16
+ selected: we,
17
+ hover: be,
18
+ "single-option": "_single-option_1ppvi_38",
19
+ "sub-option": "_sub-option_1ppvi_45"
20
+ }, V = Z.bind(ye), U = de(
21
+ (n, e) => {
22
+ const {
23
+ option: { value: r, disabled: d, hidden: v, label: D, title: l, groupRef: s },
24
+ selected: m,
25
+ onChange: C,
26
+ render: u,
27
+ highlightHovered: w,
28
+ onMouseEnter: K,
29
+ multiSelect: b,
30
+ isPartiallyChecked: A = !1
31
+ } = n, x = (y) => {
32
+ (y.target instanceof HTMLDivElement || y.target instanceof HTMLInputElement) && (C == null || C(r));
33
+ };
34
+ return /* @__PURE__ */ g(
35
+ "div",
36
+ {
37
+ className: V("dropdown-option", {
38
+ selected: m,
39
+ disabled: d,
40
+ hidden: v,
41
+ hover: w
42
+ }),
43
+ title: l,
44
+ onClick: x,
45
+ ref: e,
46
+ onMouseEnter: K,
47
+ children: [
48
+ b && /* @__PURE__ */ i(fe, { value: !!m, partiallyChecked: A }),
49
+ /* @__PURE__ */ i("div", { className: V("single-option", { "sub-option": !!s }), children: u ? u(n) : D })
50
+ ]
51
+ }
52
+ );
53
+ }
54
+ ), Oe = [
55
+ f.ENTER_KEY_CODE,
56
+ f.SPACE_KEY_CODE,
57
+ f.ARROW_DOWN_KEY_CODE
58
+ ], Ee = [f.ESCAPE_KEY_CODE, f.TAB_KEY_CODE];
59
+ var p = /* @__PURE__ */ ((n) => (n.ON_KEY_DOWN = "onKeyDown", n.ON_CLICK = "onClick", n))(p || {});
60
+ const Ne = (n, e) => {
61
+ const r = Array.isArray(e) ? e : [e];
62
+ return n.findIndex(({ value: d }) => r.includes(d));
63
+ }, ve = (n, e) => (n % e + e) % e, L = (n, e = 0, r = 1) => {
64
+ if (!n[e].disabled)
65
+ return e;
66
+ const d = n.length;
67
+ return L(
68
+ n,
69
+ ve(e + r, d),
70
+ r
71
+ );
72
+ }, De = (n, e) => L(n, e), Ke = (n, e) => L(n, e, -1), Ae = "_container_re5ge_1", xe = "_icon_re5ge_7", Ie = "_arrow_re5ge_13", ke = "_dropdown_re5ge_19", Le = "_disabled_re5ge_36", Pe = "_value_re5ge_43", Re = "_error_re5ge_46", Ye = "_touched_re5ge_46", Te = "_opened_re5ge_50", He = "_placeholder_re5ge_72", Me = "_ghost_re5ge_118", We = "_divider_re5ge_132", Se = {
73
+ container: Ae,
74
+ icon: xe,
75
+ arrow: Ie,
76
+ dropdown: ke,
77
+ "transparent-background": "_transparent-background_re5ge_33",
78
+ disabled: Le,
79
+ value: Pe,
80
+ error: Re,
81
+ touched: Ye,
82
+ opened: Te,
83
+ placeholder: He,
84
+ "mobile-disabled": "_mobile-disabled_re5ge_87",
85
+ "select-list": "_select-list_re5ge_92",
86
+ "limited-width": "_limited-width_re5ge_109",
87
+ "options-container": "_options-container_re5ge_113",
88
+ ghost: Me,
89
+ divider: We
90
+ }, o = Z.bind(Se), Fe = ({
91
+ multiSelect: n = !1,
92
+ value: e = n ? [] : "",
93
+ options: r = [],
94
+ disabled: d = !1,
95
+ error: v,
96
+ onChange: D,
97
+ onFocus: l,
98
+ onBlur: s,
99
+ mobileDisabled: m,
100
+ title: C,
101
+ touched: u = !1,
102
+ icon: w,
103
+ variant: K,
104
+ placeholder: b = "",
105
+ renderOption: A,
106
+ transparentBackground: x = !1,
107
+ className: y,
108
+ toggleButtonClassName: q,
109
+ isListWidthLimited: z = !1,
110
+ optionAll: P = { value: "all", label: "All" },
111
+ isOptionAllVisible: G = !1,
112
+ onSelectAll: J,
113
+ footer: R
114
+ }) => {
115
+ const [c, h] = $(!1), Y = oe(null), [Q, O] = $(null), I = n && Array.isArray(e) ? r.filter((t) => e.includes(t.value)) : null, { refs: T, floatingStyles: X } = le({
116
+ middleware: [
117
+ ce(5),
118
+ _e({
119
+ fallbackPlacements: ["bottom", "top"]
120
+ })
121
+ ]
122
+ });
123
+ ge(Y, () => {
124
+ c && (h(!1), s == null || s());
125
+ });
126
+ const H = (t) => {
127
+ t.disabled || (D(t.value), h((a) => n || !a));
128
+ }, F = () => r.find(({ value: t }) => t === e), M = Ne(r, e), {
129
+ getToggleButtonProps: B,
130
+ getMenuProps: ee,
131
+ getItemProps: te,
132
+ setHighlightedIndex: E,
133
+ highlightedIndex: W,
134
+ selectedItem: N
135
+ } = k({
136
+ items: r,
137
+ itemToString: (t) => (t != null && t.label ? String(t.label) : b) || "",
138
+ selectedItem: F(),
139
+ isOpen: c,
140
+ circularNavigation: !0,
141
+ defaultHighlightedIndex: M,
142
+ onHighlightedIndexChange: (t) => {
143
+ switch (t.type) {
144
+ case k.stateChangeTypes.MenuKeyDownArrowUp:
145
+ return O(p.ON_KEY_DOWN), E(Ke(r, t.highlightedIndex)), t;
146
+ case k.stateChangeTypes.MenuKeyDownArrowDown:
147
+ return O(p.ON_KEY_DOWN), E(De(r, t.highlightedIndex)), t;
148
+ default:
149
+ return t;
150
+ }
151
+ }
152
+ }), ne = () => {
153
+ d || (h((t) => !t), c ? s == null || s() : l == null || l(), O(p.ON_CLICK));
154
+ }, re = () => !e && e !== !1 && e !== 0 || Array.isArray(e) && !e.length ? b : n && Array.isArray(e) && r.length === e.length ? P.label : r.reduce((a, _) => ((Array.isArray(e) && e.includes(_.value) || _.value === e) && a.push(_.label), a), []).join(", "), se = (t) => {
155
+ const { keyCode: a } = t;
156
+ Oe.includes(a) && !c && (t.preventDefault(), E(M), h(!0), l == null || l(), O(p.ON_KEY_DOWN));
157
+ }, ae = (t) => {
158
+ const { keyCode: a } = t;
159
+ if (a === f.ENTER_KEY_CODE) {
160
+ const _ = r[W];
161
+ H(_), n || (h(!1), s == null || s());
162
+ return;
163
+ }
164
+ Ee.includes(a) && (t.stopPropagation(), h(!1), s == null || s());
165
+ }, ie = () => /* @__PURE__ */ g("div", { className: o("options-container"), children: [
166
+ n && G && Array.isArray(e) && /* @__PURE__ */ g(S, { children: [
167
+ /* @__PURE__ */ i(
168
+ U,
169
+ {
170
+ option: P,
171
+ selected: e.length === r.length,
172
+ onChange: J,
173
+ multiSelect: n,
174
+ isPartiallyChecked: !!e.length
175
+ }
176
+ ),
177
+ /* @__PURE__ */ i("div", { className: o("divider") }),
178
+ " "
179
+ ] }),
180
+ r.map((t, a) => /* @__PURE__ */ i(
181
+ U,
182
+ {
183
+ ...te({
184
+ item: t,
185
+ index: a
186
+ }),
187
+ multiSelect: n,
188
+ selected: n ? I == null ? void 0 : I.some((_) => _.value === t.value) : t.value === ((N == null ? void 0 : N.value) ?? N),
189
+ option: { title: t.label, ...t },
190
+ highlightHovered: W === a && Q !== p.ON_CLICK,
191
+ render: A,
192
+ onChange: t.disabled ? null : () => H(t),
193
+ onMouseEnter: () => E(a)
194
+ },
195
+ t.value
196
+ )),
197
+ R && /* @__PURE__ */ g(S, { children: [
198
+ /* @__PURE__ */ i("div", { className: o("divider") }),
199
+ R
200
+ ] })
201
+ ] });
202
+ return /* @__PURE__ */ g("div", { ref: Y, className: o("container", y), title: C, children: [
203
+ /* @__PURE__ */ g(
204
+ "button",
205
+ {
206
+ disabled: d,
207
+ ...B({
208
+ className: o("dropdown", K, q, {
209
+ "transparent-background": x,
210
+ opened: c,
211
+ disabled: d,
212
+ error: v,
213
+ touched: u,
214
+ "mobile-disabled": m
215
+ }),
216
+ onClick: ne,
217
+ onKeyDown: se,
218
+ ref: T.setReference
219
+ }),
220
+ type: "button",
221
+ children: [
222
+ w && /* @__PURE__ */ i("span", { className: o("icon"), children: w }),
223
+ /* @__PURE__ */ i("span", { className: o("value", { placeholder: !e }), children: re() }),
224
+ /* @__PURE__ */ i(pe, { className: o("arrow"), tabIndex: -1, children: /* @__PURE__ */ i(Ce, {}) })
225
+ ]
226
+ }
227
+ ),
228
+ c && /* @__PURE__ */ i(
229
+ "div",
230
+ {
231
+ style: X,
232
+ className: o("select-list", { opened: c, "limited-width": z }),
233
+ ...ee({
234
+ onKeyDown: ae,
235
+ ref: T.setFloating
236
+ }),
237
+ children: /* @__PURE__ */ i(he, { autoHeight: !0, autoHeightMax: 216, hideTracksWhenNotNeeded: !0, children: ie() })
238
+ }
239
+ )
240
+ ] });
241
+ };
242
+ export {
243
+ Fe as D,
244
+ Ce as S
245
+ };
@@ -0,0 +1,15 @@
1
+ import { D as r } from "./dropdown-9f4d1928.js";
2
+ import "react/jsx-runtime";
3
+ import "react";
4
+ import "./bind-06a7ff84.js";
5
+ import "@floating-ui/react-dom";
6
+ import "downshift";
7
+ import "rc-scrollbars";
8
+ import "./useOnClickOutside-c332f7d3.js";
9
+ import "./keyCodes-f63c0e11.js";
10
+ import "./baseIconButton-b6adc843.js";
11
+ import "./checkbox-9a6c7ce1.js";
12
+ export {
13
+ r as Dropdown,
14
+ r as default
15
+ };
@@ -0,0 +1,127 @@
1
+ import { jsxs as w, jsx as l } from "react/jsx-runtime";
2
+ import * as u from "react";
3
+ import { useRef as A, useMemo as B } from "react";
4
+ import { c as T } from "./bind-06a7ff84.js";
5
+ import { K as e } from "./keyCodes-f63c0e11.js";
6
+ import { B as O } from "./baseIconButton-b6adc843.js";
7
+ const W = (n) => /* @__PURE__ */ u.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#C1C7D0", xmlns: "http://www.w3.org/2000/svg", ...n }, /* @__PURE__ */ u.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M8.00117 2.62046C7.63142 2.6189 7.33294 2.91738 7.3345 3.28712L7.35159 7.35159L3.28712 7.3345C2.91738 7.33295 2.6189 7.63142 2.62045 8.00117C2.62201 8.37091 2.92301 8.67191 3.29275 8.67346L7.35722 8.69056L7.37391 12.6599C7.37547 13.0296 7.67647 13.3306 8.04621 13.3322C8.41596 13.3337 8.71443 13.0352 8.71288 12.6655L8.69619 8.69619L12.6655 8.71288C13.0352 8.71444 13.3337 8.41596 13.3322 8.04621C13.3306 7.67647 13.0296 7.37547 12.6599 7.37392L8.69056 7.35722L8.67346 3.29275C8.67191 2.92301 8.37091 2.62201 8.00117 2.62046Z" })), v = (n) => /* @__PURE__ */ u.createElement("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "#C1C7D0", xmlns: "http://www.w3.org/2000/svg", ...n }, /* @__PURE__ */ u.createElement("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M3.31082 7.31081C2.94108 7.30926 2.6426 7.60773 2.64415 7.97748C2.64571 8.34722 2.9467 8.64822 3.31645 8.64977L12.6892 8.68919C13.0589 8.69074 13.3574 8.39227 13.3559 8.02252C13.3543 7.65278 13.0533 7.35178 12.6836 7.35023L3.31082 7.31081Z" })), y = 5, f = 16, S = [
8
+ e.TAB_KEY_CODE,
9
+ e.BACKSPACE_KEY_CODE,
10
+ e.ARROW_LEFT_KEY_CODE,
11
+ e.ARROW_UP_KEY_CODE,
12
+ e.ARROW_RIGHT_KEY_CODE,
13
+ e.ARROW_DOWN_KEY_CODE,
14
+ e.DELETE_KEY_CODE,
15
+ e.NUM_LOCK_0_KEY_CODE,
16
+ e.NUM_LOCK_1_KEY_CODE,
17
+ e.NUM_LOCK_2_KEY_CODE,
18
+ e.NUM_LOCK_3_KEY_CODE,
19
+ e.NUM_LOCK_4_KEY_CODE,
20
+ e.NUM_LOCK_5_KEY_CODE,
21
+ e.NUM_LOCK_6_KEY_CODE,
22
+ e.NUM_LOCK_7_KEY_CODE,
23
+ e.NUM_LOCK_8_KEY_CODE,
24
+ e.NUM_LOCK_9_KEY_CODE
25
+ ], I = "_disabled_wswgu_6", b = "_label_wswgu_10", k = "_sign_wswgu_21", F = "_error_wswgu_36", H = "_touched_wswgu_36", V = "_filled_wswgu_44", P = "_input_wswgu_26", j = {
26
+ "field-number": "_field-number_wswgu_1",
27
+ disabled: I,
28
+ label: b,
29
+ sign: k,
30
+ "input-container": "_input-container_wswgu_26",
31
+ error: F,
32
+ touched: H,
33
+ filled: V,
34
+ "input-field": "_input-field_wswgu_51",
35
+ input: P
36
+ }, i = T.bind(j), z = ({
37
+ value: n = "",
38
+ placeholder: h = "0",
39
+ disabled: s = !1,
40
+ onChange: o,
41
+ onFocus: d,
42
+ onBlur: G,
43
+ label: K,
44
+ postfix: c = "",
45
+ min: r = 0,
46
+ max: E = Number.MAX_SAFE_INTEGER,
47
+ title: D,
48
+ error: p,
49
+ touched: g = !1,
50
+ ...m
51
+ }) => {
52
+ const C = A(null), L = (_) => {
53
+ let t = _.target.value.replace(/^0(?=\d+|^\d)/g, "");
54
+ if (t === "") {
55
+ o("");
56
+ return;
57
+ }
58
+ t = +t, t >= r && t <= E && o(t);
59
+ }, N = (_) => {
60
+ const { keyCode: t } = _;
61
+ S.includes(t) || (t < e.NUMBER_START_KEY_CODE || t > e.NUMBER_END_KEY_CODE || _.shiftKey) && _.preventDefault();
62
+ }, R = () => {
63
+ const _ = +n - 1;
64
+ _ >= r && _ <= E && o(_);
65
+ }, Y = () => {
66
+ const _ = +n + 1;
67
+ _ >= r && _ <= E && o(_);
68
+ }, a = h + c, M = B(() => {
69
+ let _ = (String(n) || a).length;
70
+ return c && !n && (_ += 1), _ > f ? `${f}ch` : `${_ || y}ch`;
71
+ }, [a, c, n]), U = () => {
72
+ C && C.current && C.current.focus(), d && d();
73
+ };
74
+ return /* @__PURE__ */ w("div", { className: i("field-number", { disabled: s }), children: [
75
+ K && /* @__PURE__ */ l("span", { className: i("label"), children: K }),
76
+ /* @__PURE__ */ w(
77
+ "div",
78
+ {
79
+ className: i("input-container", {
80
+ filled: !!n || n === 0,
81
+ error: p,
82
+ disabled: s,
83
+ touched: g
84
+ }),
85
+ title: D,
86
+ children: [
87
+ /* @__PURE__ */ l(
88
+ O,
89
+ {
90
+ className: i("sign", "minus"),
91
+ disabled: s,
92
+ onClick: R,
93
+ children: /* @__PURE__ */ l(v, {})
94
+ }
95
+ ),
96
+ /* @__PURE__ */ w("span", { className: i("input-field", { disabled: s }), onClick: U, children: [
97
+ /* @__PURE__ */ l(
98
+ "input",
99
+ {
100
+ ref: C,
101
+ className: i("input"),
102
+ type: "number",
103
+ value: n,
104
+ placeholder: a,
105
+ disabled: s,
106
+ min: r,
107
+ max: E,
108
+ onKeyDown: s ? void 0 : N,
109
+ onChange: s ? void 0 : L,
110
+ onFocus: s ? void 0 : d,
111
+ style: { width: M },
112
+ ...m
113
+ }
114
+ ),
115
+ !!c && (n === 0 || !!n) && /* @__PURE__ */ l("span", { children: c.slice(0, 1) })
116
+ ] }),
117
+ /* @__PURE__ */ l(O, { className: i("sign", "plus"), disabled: s, onClick: Y, children: /* @__PURE__ */ l(W, {}) })
118
+ ]
119
+ }
120
+ )
121
+ ] });
122
+ };
123
+ export {
124
+ z as F,
125
+ W as S,
126
+ v as a
127
+ };
@@ -0,0 +1,10 @@
1
+ import { F as m } from "./fieldNumber-1f286b40.js";
2
+ import "react/jsx-runtime";
3
+ import "react";
4
+ import "./bind-06a7ff84.js";
5
+ import "./keyCodes-f63c0e11.js";
6
+ import "./baseIconButton-b6adc843.js";
7
+ export {
8
+ m as FieldNumber,
9
+ m as default
10
+ };