@reportportal/ui-kit 0.0.1-alpha.171 → 0.0.1-alpha.172

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/bulkPanel.js CHANGED
@@ -10,8 +10,8 @@ import { K as Z } from "./keyCodes-f63c0e11.js";
10
10
  import { S as ee } from "./selection-9124d029.js";
11
11
  import { Chip as ne } from "./chip.js";
12
12
  import { B } from "./button-97d9e587.js";
13
- import { Tooltip as te } from "./tooltip.js";
14
- import { S as le } from "./chevronDownDropdown-0260bb66.js";
13
+ import { Tooltip as le } from "./tooltip.js";
14
+ import { S as te } from "./chevronDownDropdown-0260bb66.js";
15
15
  import { S as ie } from "./warning-537ead32.js";
16
16
  import "./close-4d480ef7.js";
17
17
  import "@floating-ui/react";
@@ -37,41 +37,42 @@ const ae = "_expanded_ue1t9_6", se = "_header_ue1t9_32", oe = "_tabs_ue1t9_119",
37
37
  "items-list": "_items-list_ue1t9_167",
38
38
  item: de,
39
39
  "tooltip-wrapper": "_tooltip-wrapper_ue1t9_179"
40
- }, t = J.bind(me), pe = {
40
+ }, l = J.bind(me), pe = {
41
41
  selected: "selected",
42
42
  clearSelection: "Clear selection",
43
43
  selectedItems: "Selected items",
44
44
  eligibleTab: "Eligible Items",
45
45
  ineligibleTab: "Ineligible Items",
46
- ineligibleInfoMessage: (i) => /* @__PURE__ */ s(y, { children: [
46
+ ineligibleInfoMessage: (t) => /* @__PURE__ */ s(y, { children: [
47
47
  "You have ",
48
- /* @__PURE__ */ n("b", { children: i }),
49
- " ineligible items"
48
+ /* @__PURE__ */ n("b", { children: t }),
49
+ " ineligible item",
50
+ t === 1 ? "" : "s"
50
51
  ] }),
51
- cancelButton: (i) => `Cancel "${i}"`,
52
- proceedButton: (i) => `Proceed with ${i} Eligible Items`
52
+ cancelButton: (t) => `Cancel "${t}"`,
53
+ proceedButton: (t) => `Proceed with ${t} Eligible Item${t === 1 ? "" : "s"}`
53
54
  }, u = {
54
55
  ELIGIBLE: "eligible",
55
56
  INELIGIBLE: "ineligible"
56
57
  }, Ge = ({
57
- items: i,
58
- actions: D = [],
59
- captions: K,
58
+ items: t,
59
+ actions: $ = [],
60
+ captions: D,
60
61
  infoMessage: x,
61
- className: M,
62
+ className: K,
62
63
  portalRoot: f,
63
64
  onRemoveItem: w,
64
- onClearSelection: O
65
+ onClearSelection: M
65
66
  }) => {
66
- const r = { ...pe, ...K }, [o, v] = k(!1), [I, C] = k(u.INELIGIBLE), [l, E] = k(null), S = U(null), d = l !== null, { eligibleItems: b, ineligibleItems: h } = P(() => {
67
+ const r = { ...pe, ...D }, [o, v] = k(!1), [I, C] = k(u.INELIGIBLE), [i, E] = k(null), S = U(null), d = i !== null, { eligibleItems: b, ineligibleItems: h } = P(() => {
67
68
  var g;
68
- if (!l)
69
+ if (!i)
69
70
  return { eligibleItems: [], ineligibleItems: [] };
70
- const e = ((g = l.onValidate) == null ? void 0 : g.call(l, i)) ?? [], a = new Set(e.map((L) => L.id));
71
- return { eligibleItems: i.filter((L) => !a.has(L.id)), ineligibleItems: e };
72
- }, [i, l]), m = b.length, p = h.length, $ = d && m > 0, T = d && p > 0 ? r.ineligibleInfoMessage(p) : null, F = P(() => d ? p === 0 ? b : m === 0 ? h : I === u.ELIGIBLE ? b : h : i, [
71
+ const e = ((g = i.onValidate) == null ? void 0 : g.call(i, t)) ?? [], a = new Set(e.map((L) => L.id));
72
+ return { eligibleItems: t.filter((L) => !a.has(L.id)), ineligibleItems: e };
73
+ }, [t, i]), m = b.length, p = h.length, O = d && m > 0, T = d && p > 0 ? r.ineligibleInfoMessage(p) : null, F = P(() => d ? p === 0 ? b : m === 0 ? h : I === u.ELIGIBLE ? b : h : t, [
73
74
  d,
74
- i,
75
+ t,
75
76
  b,
76
77
  h,
77
78
  I,
@@ -84,15 +85,15 @@ const ae = "_expanded_ue1t9_6", se = "_header_ue1t9_32", oe = "_tabs_ue1t9_119",
84
85
  }, []), V = _(
85
86
  (e) => {
86
87
  var N, g;
87
- (N = e.onClick) == null || N.call(e), (((g = e.onValidate) == null ? void 0 : g.call(e, i)) ?? []).length === 0 ? (e.onProceed(i, !0), c()) : (E(e), C(u.INELIGIBLE), v(!0));
88
+ (N = e.onClick) == null || N.call(e), (((g = e.onValidate) == null ? void 0 : g.call(e, t)) ?? []).length === 0 ? (e.onProceed(t, !0), c()) : (E(e), C(u.INELIGIBLE), v(!0));
88
89
  },
89
- [i, c]
90
+ [t, c]
90
91
  ), j = _(() => {
91
- const e = l == null ? void 0 : l.onCancel;
92
+ const e = i == null ? void 0 : i.onCancel;
92
93
  E(null), c(), e == null || e();
93
- }, [l, c]), W = _(() => {
94
- l == null || l.onProceed(b), E(null), c();
95
- }, [l, b, c]), Y = _(() => {
94
+ }, [i, c]), W = _(() => {
95
+ i == null || i.onProceed(b), E(null), c();
96
+ }, [i, b, c]), Y = _(() => {
96
97
  v((e) => !e);
97
98
  }, []), q = _(
98
99
  (e) => {
@@ -107,7 +108,7 @@ const ae = "_expanded_ue1t9_6", se = "_header_ue1t9_32", oe = "_tabs_ue1t9_119",
107
108
  a.keyCode === Z.ESCAPE_KEY_CODE && c();
108
109
  };
109
110
  return document.addEventListener("keydown", e, !1), () => document.removeEventListener("keydown", e, !1);
110
- }, [o, c]), X(S, o ? c : void 0), i.length === 0)
111
+ }, [o, c]), X(S, o ? c : void 0), t.length === 0)
111
112
  return null;
112
113
  const A = (e) => h.some((a) => a.id === e.id), R = (e) => {
113
114
  const a = /* @__PURE__ */ n(
@@ -119,10 +120,10 @@ const ae = "_expanded_ue1t9_6", se = "_header_ue1t9_32", oe = "_tabs_ue1t9_119",
119
120
  },
120
121
  e.id
121
122
  );
122
- return /* @__PURE__ */ n("div", { className: t("item"), children: e.tooltipContent ? /* @__PURE__ */ n(
123
- te,
123
+ return /* @__PURE__ */ n("div", { className: l("item"), children: e.tooltipContent ? /* @__PURE__ */ n(
124
+ le,
124
125
  {
125
- wrapperClassName: t("tooltip-wrapper"),
126
+ wrapperClassName: l("tooltip-wrapper"),
126
127
  content: e.tooltipContent,
127
128
  placement: "top",
128
129
  width: 270,
@@ -134,26 +135,26 @@ const ae = "_expanded_ue1t9_6", se = "_header_ue1t9_32", oe = "_tabs_ue1t9_119",
134
135
  }, G = /* @__PURE__ */ n(
135
136
  "div",
136
137
  {
137
- className: t("bulk-panel", { expanded: o }, M),
138
+ className: l("bulk-panel", { expanded: o }, K),
138
139
  role: "region",
139
140
  "aria-label": "Bulk actions panel",
140
- children: /* @__PURE__ */ s("div", { className: t("panel-content", { expanded: o }), ref: S, children: [
141
- /* @__PURE__ */ s("div", { className: t("header"), children: [
142
- /* @__PURE__ */ s("div", { className: t("selection-info"), children: [
141
+ children: /* @__PURE__ */ s("div", { className: l("panel-content", { expanded: o }), ref: S, children: [
142
+ /* @__PURE__ */ s("div", { className: l("header"), children: [
143
+ /* @__PURE__ */ s("div", { className: l("selection-info"), children: [
143
144
  /* @__PURE__ */ n(
144
145
  "button",
145
146
  {
146
147
  onClick: Y,
147
148
  "aria-label": o ? "Collapse panel" : "Expand panel",
148
149
  "aria-expanded": o,
149
- children: /* @__PURE__ */ n("span", { className: t("expand-icon", { expanded: o }), children: /* @__PURE__ */ n(le, {}) })
150
+ children: /* @__PURE__ */ n("span", { className: l("expand-icon", { expanded: o }), children: /* @__PURE__ */ n(te, {}) })
150
151
  }
151
152
  ),
152
153
  /* @__PURE__ */ n(
153
154
  ee,
154
155
  {
155
- selectedCount: i.length,
156
- onClearSelection: O,
156
+ selectedCount: t.length,
157
+ onClearSelection: M,
157
158
  captions: {
158
159
  selected: r.selected,
159
160
  buttonCaption: r.clearSelection
@@ -161,15 +162,15 @@ const ae = "_expanded_ue1t9_6", se = "_header_ue1t9_32", oe = "_tabs_ue1t9_119",
161
162
  }
162
163
  )
163
164
  ] }),
164
- /* @__PURE__ */ s("div", { className: t("header-actions"), children: [
165
- (T || x) && /* @__PURE__ */ s("div", { className: t("info-message-container"), children: [
166
- /* @__PURE__ */ n("i", { className: t("warning-icon"), children: /* @__PURE__ */ n(ie, {}) }),
167
- /* @__PURE__ */ n("div", { className: t("info-message"), children: T || x })
165
+ /* @__PURE__ */ s("div", { className: l("header-actions"), children: [
166
+ (T || x) && /* @__PURE__ */ s("div", { className: l("info-message-container"), children: [
167
+ /* @__PURE__ */ n("i", { className: l("warning-icon"), children: /* @__PURE__ */ n(ie, {}) }),
168
+ /* @__PURE__ */ n("div", { className: l("info-message"), children: T || x })
168
169
  ] }),
169
- /* @__PURE__ */ n("div", { className: t("buttons-container"), children: d ? /* @__PURE__ */ s(y, { children: [
170
- /* @__PURE__ */ n(B, { variant: "ghost", onClick: j, children: r.cancelButton((l == null ? void 0 : l.label) ?? "") }),
171
- $ && /* @__PURE__ */ n(B, { variant: "primary", onClick: W, children: r.proceedButton(m) })
172
- ] }) : D.map((e, a) => /* @__PURE__ */ n(
170
+ /* @__PURE__ */ n("div", { className: l("buttons-container"), children: d ? /* @__PURE__ */ s(y, { children: [
171
+ /* @__PURE__ */ n(B, { variant: "ghost", onClick: j, children: r.cancelButton((i == null ? void 0 : i.label) ?? "") }),
172
+ O && /* @__PURE__ */ n(B, { variant: "primary", onClick: W, children: r.proceedButton(m) })
173
+ ] }) : $.map((e, a) => /* @__PURE__ */ n(
173
174
  B,
174
175
  {
175
176
  variant: e.variant,
@@ -181,36 +182,36 @@ const ae = "_expanded_ue1t9_6", se = "_header_ue1t9_32", oe = "_tabs_ue1t9_119",
181
182
  )) })
182
183
  ] })
183
184
  ] }),
184
- /* @__PURE__ */ s("div", { className: t("items-section"), children: [
185
- /* @__PURE__ */ n("div", { className: t("items-header"), children: d ? /* @__PURE__ */ s("div", { className: t("tabs"), children: [
185
+ /* @__PURE__ */ s("div", { className: l("items-section"), children: [
186
+ /* @__PURE__ */ n("div", { className: l("items-header"), children: d ? /* @__PURE__ */ s("div", { className: l("tabs"), children: [
186
187
  p > 0 && /* @__PURE__ */ s(
187
188
  "button",
188
189
  {
189
- className: t("tab", {
190
+ className: l("tab", {
190
191
  active: I === u.INELIGIBLE || m === 0
191
192
  }),
192
193
  onClick: () => C(u.INELIGIBLE),
193
194
  children: [
194
195
  r.ineligibleTab,
195
- /* @__PURE__ */ n("span", { className: t("tab-count"), children: p })
196
+ /* @__PURE__ */ n("span", { className: l("tab-count"), children: p })
196
197
  ]
197
198
  }
198
199
  ),
199
200
  m > 0 && /* @__PURE__ */ s(
200
201
  "button",
201
202
  {
202
- className: t("tab", {
203
+ className: l("tab", {
203
204
  active: I === u.ELIGIBLE || p === 0
204
205
  }),
205
206
  onClick: () => C(u.ELIGIBLE),
206
207
  children: [
207
208
  r.eligibleTab,
208
- /* @__PURE__ */ n("span", { className: t("tab-count"), children: m })
209
+ /* @__PURE__ */ n("span", { className: l("tab-count"), children: m })
209
210
  ]
210
211
  }
211
212
  )
212
213
  ] }) : r.selectedItems }),
213
- /* @__PURE__ */ n("div", { className: t("items-scroll"), children: /* @__PURE__ */ n(Q, { hideTracksWhenNotNeeded: !0, children: /* @__PURE__ */ n("div", { className: t("items-list"), children: F.map((e) => R(e)) }) }) })
214
+ /* @__PURE__ */ n("div", { className: l("items-scroll"), children: /* @__PURE__ */ n(Q, { hideTracksWhenNotNeeded: !0, children: /* @__PURE__ */ n("div", { className: l("items-list"), children: F.map((e) => R(e)) }) }) })
214
215
  ] })
215
216
  ] })
216
217
  }
@@ -3,3 +3,4 @@ export { useSortable } from './useSortable';
3
3
  export { useTreeSortable } from './useTreeSortable';
4
4
  export { useTreeDropValidation } from './useTreeDropValidation';
5
5
  export { useWindowResize } from './useWindowResize';
6
+ export { useEllipsisTitle } from './useEllipsisTitle';
@@ -0,0 +1,6 @@
1
+ import { RefObject } from 'react';
2
+
3
+ export declare function useEllipsisTitle<T extends HTMLElement = HTMLElement>(content: string | number | undefined): {
4
+ ref: RefObject<T>;
5
+ title: string | undefined;
6
+ };
@@ -1,8 +1,9 @@
1
- import { u as w } from "../useOnClickOutside-8f7d68a1.js";
2
- import { u as E, a as R } from "../useTreeSortable-70a9c8f5.js";
3
- import { useCallback as x } from "react";
4
- import { i as z } from "../isEmpty-ccacb5ff.js";
1
+ import { u as E } from "../useOnClickOutside-8f7d68a1.js";
2
+ import { u as A, a as R } from "../useTreeSortable-70a9c8f5.js";
3
+ import { useCallback as D } from "react";
4
+ import { i as x } from "../isEmpty-ccacb5ff.js";
5
5
  import { u as W } from "../useWindowResize-a7e1ac92.js";
6
+ import { u as q } from "../useEllipsisTitle-462fa254.js";
6
7
  import "react-dnd";
7
8
  import "react-dnd-html5-backend";
8
9
  import "../common.js";
@@ -21,46 +22,47 @@ import "../common.js";
21
22
  * See the License for the specific language governing permissions and
22
23
  * limitations under the License.
23
24
  */
24
- const o = (r) => String(r), I = (r, e, f, n = "children") => {
25
- const s = o(r), u = o(e), i = (c, a) => {
26
- for (const t of a) {
27
- if (o(t.id) === c)
28
- return t;
29
- const m = t[n] || [];
30
- if (!z(m)) {
25
+ const o = (r) => String(r), T = (r, e, f, t = "children") => {
26
+ const s = o(r), a = o(e), i = (c, u) => {
27
+ for (const n of u) {
28
+ if (o(n.id) === c)
29
+ return n;
30
+ const m = n[t] || [];
31
+ if (!x(m)) {
31
32
  const p = i(c, m);
32
33
  if (p)
33
34
  return p;
34
35
  }
35
36
  }
36
37
  return null;
37
- }, d = i(s, f);
38
- if (!d)
38
+ }, l = i(s, f);
39
+ if (!l)
39
40
  return !1;
40
- const l = (c) => {
41
- for (const a of c) {
42
- if (o(a.id) === u)
41
+ const d = (c) => {
42
+ for (const u of c) {
43
+ if (o(u.id) === a)
43
44
  return !0;
44
- const t = a[n] || [];
45
- if (!z(t) && l(t))
45
+ const n = u[t] || [];
46
+ if (!x(n) && d(n))
46
47
  return !0;
47
48
  }
48
49
  return !1;
49
- }, D = d[n] || [];
50
- return l(D);
50
+ }, z = l[t] || [];
51
+ return d(z);
51
52
  }, S = ({
52
53
  items: r,
53
54
  childrenKey: e = "children"
54
- }) => ({ canDropOn: x(
55
- (n, s) => {
56
- const u = o(n.id), i = o(s);
57
- return u === i ? !1 : !I(n.id, s, r, e);
55
+ }) => ({ canDropOn: D(
56
+ (t, s) => {
57
+ const a = o(t.id), i = o(s);
58
+ return a === i ? !1 : !T(t.id, s, r, e);
58
59
  },
59
60
  [r, e]
60
61
  ) });
61
62
  export {
62
- w as useOnClickOutside,
63
- E as useSortable,
63
+ q as useEllipsisTitle,
64
+ E as useOnClickOutside,
65
+ A as useSortable,
64
66
  S as useTreeDropValidation,
65
67
  R as useTreeSortable,
66
68
  W as useWindowResize
@@ -4,6 +4,11 @@ export interface FiltersButtonProps extends Omit<ComponentPropsWithRef<'button'>
4
4
  appliedFiltersCount?: number;
5
5
  isOpen?: boolean;
6
6
  type?: 'button' | 'submit';
7
+ text?: string;
8
+ filtersLabelClassName?: string;
9
+ clearable?: boolean;
10
+ onClear?: () => void;
11
+ clearButtonAriaLabel?: string;
7
12
  }
8
13
  export declare const FiltersButton: (props: FiltersButtonProps & import('react').RefAttributes<HTMLButtonElement>) => import('react').ReactElement<any, string | import('react').JSXElementConstructor<any>> | null;
9
14
  export default FiltersButton;
@@ -36,5 +36,5 @@ export { ThemeProvider } from './themeProvider';
36
36
  export { Toggle } from './toggle';
37
37
  export { Tooltip } from './tooltip';
38
38
  export { SidePanel } from './sidePanel';
39
- export { useTreeDropValidation } from '../common/hooks';
39
+ export { useTreeDropValidation, useEllipsisTitle } from '../common/hooks';
40
40
  export * from './icons';
@@ -1,89 +1,82 @@
1
- import { jsxs as O, jsx as l } from "react/jsx-runtime";
2
- import { useRef as _, useEffect as T, useCallback as o } from "react";
3
- import { c as W } from "./bind-06a7ff84.js";
4
- import { A as j } from "./actionMenu-77a63b96.js";
1
+ import { jsxs as D, jsx as l } from "react/jsx-runtime";
2
+ import { useRef as I, useCallback as i } from "react";
3
+ import { c as K } from "./bind-06a7ff84.js";
4
+ import "react-dnd";
5
+ import "react-dnd-html5-backend";
6
+ import { u as L } from "./useEllipsisTitle-462fa254.js";
7
+ import { A as M } from "./actionMenu-77a63b96.js";
5
8
  import "./meatballMenu-535635a9.js";
6
9
  import "./baseIconButton-251479f7.js";
7
10
  import "./popover.js";
8
11
  import "@floating-ui/react";
9
12
  import "./floatingUi-41f8c7b5.js";
10
- const D = "_disabled_1of31_29", I = "_selected_1of31_32", K = {
11
- "filter-item": "_filter-item_1of31_16",
12
- disabled: D,
13
- selected: I,
14
- "actions-button": "_actions-button_1of31_37",
15
- "caption-wrapper": "_caption-wrapper_1of31_58"
16
- }, p = W.bind(K), S = ({
13
+ const T = "_disabled_b9lbt_29", F = "_selected_b9lbt_32", W = {
14
+ "filter-item": "_filter-item_b9lbt_16",
15
+ disabled: T,
16
+ selected: F,
17
+ "actions-button": "_actions-button_b9lbt_37",
18
+ "caption-wrapper": "_caption-wrapper_b9lbt_58"
19
+ }, p = K.bind(W), Y = ({
17
20
  id: e,
18
21
  caption: f,
19
- actions: h,
20
- onClick: r,
21
- onHover: s,
22
- className: b,
23
- captionClassName: w,
24
- popoverClassName: N,
22
+ actions: u,
23
+ onClick: s,
24
+ onHover: r,
25
+ className: _,
26
+ captionClassName: b,
27
+ popoverClassName: h,
25
28
  disabled: t = !1,
26
- selected: x = !1,
27
- editMode: u = !1
29
+ selected: N = !1,
30
+ editMode: a = !1
28
31
  }) => {
29
- const n = _(null), m = _(null);
30
- T(() => {
31
- const a = () => {
32
- n.current && (n.current.scrollWidth > n.current.clientWidth ? n.current.setAttribute("title", f) : n.current.removeAttribute("title"));
33
- };
34
- if (a(), typeof ResizeObserver < "u" && n.current) {
35
- const c = new ResizeObserver(a);
36
- return c.observe(n.current), () => c.disconnect();
37
- }
38
- }, [f]);
39
- const y = o(
40
- (a) => {
41
- var i;
42
- if (t || u)
32
+ const { ref: w, title: x } = L(f), o = I(null), g = i(
33
+ (n) => {
34
+ var m;
35
+ if (t || a)
43
36
  return;
44
- const c = a.target;
45
- (i = m.current) != null && i.contains(c) || r == null || r(e);
37
+ const c = n.target;
38
+ (m = o.current) != null && m.contains(c) || s == null || s(e);
46
39
  },
47
- [e, r, t, u]
48
- ), R = o(
49
- (a) => {
40
+ [e, s, t, a]
41
+ ), y = i(
42
+ (n) => {
50
43
  var c;
51
- if (a.key === "Enter" && !t && !u) {
52
- const i = a.target;
53
- if ((c = m.current) != null && c.contains(i))
44
+ if (n.key === "Enter" && !t && !a) {
45
+ const m = n.target;
46
+ if ((c = o.current) != null && c.contains(m))
54
47
  return;
55
- r == null || r(e);
48
+ s == null || s(e);
56
49
  }
57
50
  },
58
- [e, r, t, u]
59
- ), g = o(() => {
60
- t || s == null || s(e, !0);
61
- }, [e, s, t]), A = o(() => {
62
- t || s == null || s(e, !1);
63
- }, [e, s, t]), E = p("filter-item", b, {
64
- selected: x,
51
+ [e, s, t, a]
52
+ ), E = i(() => {
53
+ t || r == null || r(e, !0);
54
+ }, [e, r, t]), R = i(() => {
55
+ t || r == null || r(e, !1);
56
+ }, [e, r, t]), j = p("filter-item", _, {
57
+ selected: N,
65
58
  disabled: t
66
- }), z = p("caption-wrapper", w);
67
- return /* @__PURE__ */ O(
59
+ }), A = p("caption-wrapper", b);
60
+ return /* @__PURE__ */ D(
68
61
  "div",
69
62
  {
70
- className: E,
63
+ className: j,
71
64
  "data-filter-item-container": !0,
72
- onClick: y,
73
- onKeyDown: R,
74
- onMouseEnter: g,
75
- onMouseLeave: A,
65
+ onClick: g,
66
+ onKeyDown: y,
67
+ onMouseEnter: E,
68
+ onMouseLeave: R,
76
69
  role: "button",
77
70
  tabIndex: t ? -1 : 0,
78
71
  children: [
79
- /* @__PURE__ */ l("div", { className: z, ref: n, children: f }),
80
- /* @__PURE__ */ l("div", { ref: m, children: /* @__PURE__ */ l(
81
- j,
72
+ /* @__PURE__ */ l("div", { className: A, ref: w, title: x, children: f }),
73
+ /* @__PURE__ */ l("div", { ref: o, children: /* @__PURE__ */ l(
74
+ M,
82
75
  {
83
- items: h,
84
- disabled: t || u,
76
+ items: u,
77
+ disabled: t || a,
85
78
  buttonClassName: p("actions-button"),
86
- popoverClassName: N,
79
+ popoverClassName: h,
87
80
  placement: "bottom-start"
88
81
  }
89
82
  ) })
@@ -92,5 +85,5 @@ const D = "_disabled_1of31_29", I = "_selected_1of31_32", K = {
92
85
  );
93
86
  };
94
87
  export {
95
- S as FilterItem
88
+ Y as FilterItem
96
89
  };
@@ -1,25 +1,77 @@
1
- import { jsxs as p, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as f } from "react";
3
- import { c as _ } from "./bind-06a7ff84.js";
4
- import { S as d, a as m } from "./filterOutline-819b4b0d.js";
5
- const u = "_opened_c1qju_22", h = {
6
- "filters-icon-container": "_filters-icon-container_c1qju_1",
7
- "filter-icon": "_filter-icon_c1qju_19",
8
- opened: u,
9
- "with-applied": "_with-applied_c1qju_28",
10
- "filters-count": "_filters-count_c1qju_37"
11
- }, i = _.bind(h), x = f(
12
- ({ appliedFiltersCount: n = 0, isOpen: s = !1, className: o, type: c = "button", ...r }, l) => {
13
- const t = n > 0, a = i("filters-icon-container", o, {
14
- "with-applied": t,
15
- opened: s
1
+ import { jsxs as N, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as g } from "react";
3
+ import { c as S } from "./bind-06a7ff84.js";
4
+ import { S as y } from "./clear-53660571.js";
5
+ import { S as D, a as k } from "./filterOutline-819b4b0d.js";
6
+ import "react-dnd";
7
+ import "react-dnd-html5-backend";
8
+ import { u as x } from "./useEllipsisTitle-462fa254.js";
9
+ const F = "_opened_ntvuh_37", T = "_icon_ntvuh_98", j = "_disabled_ntvuh_115", E = {
10
+ "filters-icon-container": "_filters-icon-container_ntvuh_16",
11
+ "filter-icon": "_filter-icon_ntvuh_34",
12
+ opened: F,
13
+ "with-applied": "_with-applied_ntvuh_43",
14
+ "filters-count": "_filters-count_ntvuh_52",
15
+ "clear-wrapper": "_clear-wrapper_ntvuh_89",
16
+ icon: T,
17
+ "clear-icon": "_clear-icon_ntvuh_98",
18
+ disabled: j
19
+ }, n = S.bind(E), q = g(
20
+ ({
21
+ appliedFiltersCount: l = 0,
22
+ isOpen: f = !1,
23
+ className: _,
24
+ type: d = "button",
25
+ text: r,
26
+ filtersLabelClassName: c,
27
+ clearable: u = !1,
28
+ onClear: i,
29
+ clearButtonAriaLabel: m = "Clear filters",
30
+ ...h
31
+ }, v) => {
32
+ const o = l > 0, s = r !== void 0 && r !== "", b = s ? r : o ? l : void 0, { ref: a, title: p } = x(b), w = n("filters-icon-container", _, {
33
+ "with-applied": o || s,
34
+ opened: f
16
35
  });
17
- return /* @__PURE__ */ p("button", { type: c, className: a, ref: l, ...r, children: [
18
- /* @__PURE__ */ e("span", { className: i("filter-icon"), children: t ? /* @__PURE__ */ e(d, {}) : /* @__PURE__ */ e(m, {}) }),
19
- t ? /* @__PURE__ */ e("span", { className: i("filters-count"), children: n }) : null
36
+ return /* @__PURE__ */ N("button", { type: d, className: w, ref: v, ...h, children: [
37
+ /* @__PURE__ */ e("span", { className: n("filter-icon"), children: o || s ? /* @__PURE__ */ e(D, {}) : /* @__PURE__ */ e(k, {}) }),
38
+ s ? /* @__PURE__ */ e(
39
+ "span",
40
+ {
41
+ ref: a,
42
+ title: p,
43
+ className: n("filters-count", c),
44
+ children: r
45
+ }
46
+ ) : o ? /* @__PURE__ */ e(
47
+ "span",
48
+ {
49
+ ref: a,
50
+ title: p,
51
+ className: n("filters-count", c),
52
+ children: l
53
+ }
54
+ ) : null,
55
+ u && (o || s) && /* @__PURE__ */ e("div", { className: n("clear-wrapper"), children: /* @__PURE__ */ e(
56
+ "span",
57
+ {
58
+ role: "button",
59
+ tabIndex: 0,
60
+ "aria-label": m,
61
+ className: n("clear-icon"),
62
+ onClick: (t) => {
63
+ t.stopPropagation(), i == null || i();
64
+ },
65
+ onKeyDown: (t) => {
66
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), i == null || i());
67
+ },
68
+ onMouseDown: (t) => t.preventDefault(),
69
+ children: /* @__PURE__ */ e(y, {})
70
+ }
71
+ ) })
20
72
  ] });
21
73
  }
22
74
  );
23
75
  export {
24
- x as FiltersButton
76
+ q as FiltersButton
25
77
  };