@reportportal/ui-kit 0.0.1-alpha.173 → 0.0.1-alpha.175

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.
@@ -1,3 +1,3 @@
1
1
  import { UseTreeSortableOptions, UseTreeSortableReturn } from '../types';
2
2
 
3
- export declare const useTreeSortable: ({ id, index, parentId, type, isDisabled, acceptDrop, canDropOn, onDrop, hideDefaultPreview, }: UseTreeSortableOptions) => UseTreeSortableReturn;
3
+ export declare const useTreeSortable: ({ id, index, parentId, type, isDisabled, acceptDrop, isLast, canDropOn, onDrop, hideDefaultPreview, }: UseTreeSortableOptions) => UseTreeSortableReturn;
@@ -1,5 +1,5 @@
1
1
  import { u as E } from "../useOnClickOutside-8f7d68a1.js";
2
- import { u as A, a as R } from "../useTreeSortable-70a9c8f5.js";
2
+ import { u as A, a as R } from "../useTreeSortable-694cfbbc.js";
3
3
  import { useCallback as D } from "react";
4
4
  import { i as x } from "../isEmpty-ccacb5ff.js";
5
5
  import { u as W } from "../useWindowResize-a7e1ac92.js";
@@ -1,4 +1,4 @@
1
- import { ReactNode, Ref } from 'react';
1
+ import { ReactNode, Ref, CSSProperties } from 'react';
2
2
  import { XYCoord, ConnectDragSource, ConnectDropTarget, ConnectDragPreview } from 'react-dnd';
3
3
 
4
4
  export interface SortableItemData {
@@ -101,6 +101,7 @@ export interface UseTreeSortableOptions {
101
101
  type?: string;
102
102
  isDisabled?: boolean;
103
103
  acceptDrop?: boolean;
104
+ isLast?: boolean;
104
105
  canDropOn?: (draggedItem: TreeDragItem, targetId: string | number) => boolean;
105
106
  onDrop?: TreeDropHandler;
106
107
  hideDefaultPreview?: boolean;
@@ -126,8 +127,8 @@ export interface TreeSortableItemProps {
126
127
  acceptDrop?: boolean;
127
128
  isLast?: boolean;
128
129
  canDropOn?: (draggedItem: TreeDragItem, targetId: string | number) => boolean;
129
- depth?: number;
130
130
  className?: string;
131
+ style?: CSSProperties;
131
132
  draggingClassName?: string;
132
133
  dropBeforeClassName?: string;
133
134
  dropInsideClassName?: string;
@@ -1,3 +1,3 @@
1
1
  import { TreeSortableItemProps } from '../../../common/types';
2
2
 
3
- export declare const TreeSortableItem: ({ id, index, parentId, type, isDisabled, acceptDrop, isLast, canDropOn, className, draggingClassName, dropBeforeClassName, dropInsideClassName, dropAfterClassName, onDrop, hideDefaultPreview, children, }: TreeSortableItemProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const TreeSortableItem: ({ id, index, parentId, type, isDisabled, acceptDrop, isLast, canDropOn, className, style, draggingClassName, dropBeforeClassName, dropInsideClassName, dropAfterClassName, onDrop, hideDefaultPreview, children, }: TreeSortableItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,64 +1,64 @@
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";
1
+ import { jsxs as h, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as N } from "react";
3
+ import { c as g } from "./bind-06a7ff84.js";
4
+ import { S } from "./clear-53660571.js";
5
5
  import { S as D, a as k } from "./filterOutline-819b4b0d.js";
6
6
  import "react-dnd";
7
7
  import "react-dnd-html5-backend";
8
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",
9
+ const F = "_opened_1ytvw_37", T = "_icon_1ytvw_95", j = "_disabled_1ytvw_112", E = {
10
+ "filters-icon-container": "_filters-icon-container_1ytvw_16",
11
+ "filter-icon": "_filter-icon_1ytvw_34",
12
12
  opened: F,
13
- "with-applied": "_with-applied_ntvuh_43",
14
- "filters-count": "_filters-count_ntvuh_52",
15
- "clear-wrapper": "_clear-wrapper_ntvuh_89",
13
+ "with-applied": "_with-applied_1ytvw_43",
14
+ "filters-count": "_filters-count_1ytvw_51",
15
+ "clear-wrapper": "_clear-wrapper_1ytvw_86",
16
16
  icon: T,
17
- "clear-icon": "_clear-icon_ntvuh_98",
17
+ "clear-icon": "_clear-icon_1ytvw_95",
18
18
  disabled: j
19
- }, n = S.bind(E), q = g(
19
+ }, o = g.bind(E), q = N(
20
20
  ({
21
21
  appliedFiltersCount: l = 0,
22
22
  isOpen: f = !1,
23
23
  className: _,
24
24
  type: d = "button",
25
- text: r,
25
+ text: n,
26
26
  filtersLabelClassName: c,
27
- clearable: u = !1,
27
+ clearable: m = !1,
28
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,
29
+ clearButtonAriaLabel: w = "Clear filters",
30
+ ...v
31
+ }, u) => {
32
+ const s = l > 0, r = n !== void 0 && n !== "", y = r ? n : s ? l : void 0, { ref: a, title: p } = x(y), b = o("filters-icon-container", _, {
33
+ "with-applied": s || r,
34
34
  opened: f
35
35
  });
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(
36
+ return /* @__PURE__ */ h("button", { type: d, className: b, ref: u, ...v, children: [
37
+ /* @__PURE__ */ e("span", { className: o("filter-icon"), children: s ? /* @__PURE__ */ e(D, {}) : /* @__PURE__ */ e(k, {}) }),
38
+ r ? /* @__PURE__ */ e(
39
39
  "span",
40
40
  {
41
41
  ref: a,
42
42
  title: p,
43
- className: n("filters-count", c),
44
- children: r
43
+ className: o("filters-count", c),
44
+ children: n
45
45
  }
46
- ) : o ? /* @__PURE__ */ e(
46
+ ) : s ? /* @__PURE__ */ e(
47
47
  "span",
48
48
  {
49
49
  ref: a,
50
50
  title: p,
51
- className: n("filters-count", c),
51
+ className: o("filters-count", c),
52
52
  children: l
53
53
  }
54
54
  ) : null,
55
- u && (o || s) && /* @__PURE__ */ e("div", { className: n("clear-wrapper"), children: /* @__PURE__ */ e(
55
+ m && (s || r) && /* @__PURE__ */ e("div", { className: o("clear-wrapper"), children: /* @__PURE__ */ e(
56
56
  "span",
57
57
  {
58
58
  role: "button",
59
59
  tabIndex: 0,
60
- "aria-label": m,
61
- className: n("clear-icon"),
60
+ "aria-label": w,
61
+ className: o("clear-icon"),
62
62
  onClick: (t) => {
63
63
  t.stopPropagation(), i == null || i();
64
64
  },
@@ -66,7 +66,7 @@ const F = "_opened_ntvuh_37", T = "_icon_ntvuh_98", j = "_disabled_ntvuh_115", E
66
66
  (t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), i == null || i());
67
67
  },
68
68
  onMouseDown: (t) => t.preventDefault(),
69
- children: /* @__PURE__ */ e(y, {})
69
+ children: /* @__PURE__ */ e(S, {})
70
70
  }
71
71
  ) })
72
72
  ] });
package/dist/index.js CHANGED
@@ -75,7 +75,7 @@ import "./useWindowResize-a7e1ac92.js";
75
75
  import "@floating-ui/react";
76
76
  import "./floatingUi-41f8c7b5.js";
77
77
  import "es-toolkit";
78
- import "./useTreeSortable-70a9c8f5.js";
78
+ import "./useTreeSortable-694cfbbc.js";
79
79
  import "./common.js";
80
80
  import "react-resizable";
81
81
  export {
@@ -1,42 +1,42 @@
1
- import { jsx as u, jsxs as m } from "react/jsx-runtime";
2
- import { useState as o, useEffect as f } from "react";
3
- import { c as v } from "./bind-06a7ff84.js";
4
- const N = "_button_188ud_28", w = "_disabled_188ud_53", x = "_active_188ud_53", h = "_icon_188ud_77", j = {
5
- "segmented-control": "_segmented-control_188ud_16",
6
- "full-width": "_full-width_188ud_23",
7
- button: N,
8
- disabled: w,
9
- active: x,
10
- icon: h
11
- }, c = v.bind(j), g = ({
1
+ import { jsx as r, jsxs as u } from "react/jsx-runtime";
2
+ import { useState as o, useEffect as v } from "react";
3
+ import { c as z } from "./bind-06a7ff84.js";
4
+ const f = "_button_8evzz_29", N = "_disabled_8evzz_50", w = "_active_8evzz_50", x = "_icon_8evzz_74", h = {
5
+ "segmented-control": "_segmented-control_8evzz_16",
6
+ "full-width": "_full-width_8evzz_24",
7
+ button: f,
8
+ disabled: N,
9
+ active: w,
10
+ icon: x
11
+ }, c = z.bind(h), S = ({
12
12
  options: s,
13
13
  onChange: l,
14
- className: r,
15
- fullWidth: n = !1,
16
- ariaLabel: i
14
+ className: n,
15
+ fullWidth: i = !1,
16
+ ariaLabel: _
17
17
  }) => {
18
- const [d, t] = o(s);
19
- f(() => {
20
- t(s);
18
+ const [t, d] = o(s);
19
+ v(() => {
20
+ d(s);
21
21
  }, [s]);
22
- const _ = (e) => {
22
+ const b = (e) => {
23
23
  if (!e.disabled && !e.selected) {
24
- const b = d.map((a) => ({
24
+ const m = t.map((a) => ({
25
25
  ...a,
26
26
  selected: a.value === e.value
27
27
  }));
28
- t(b), l == null || l(e.value);
28
+ d(m), l == null || l(e.value);
29
29
  }
30
30
  };
31
- return /* @__PURE__ */ u(
31
+ return /* @__PURE__ */ r(
32
32
  "div",
33
33
  {
34
- className: c("segmented-control", r, {
35
- "full-width": n
34
+ className: c("segmented-control", n, {
35
+ "full-width": i
36
36
  }),
37
37
  role: "group",
38
- "aria-label": i,
39
- children: d.map((e) => /* @__PURE__ */ m(
38
+ "aria-label": _,
39
+ children: t.map((e) => /* @__PURE__ */ u(
40
40
  "button",
41
41
  {
42
42
  type: "button",
@@ -44,11 +44,11 @@ const N = "_button_188ud_28", w = "_disabled_188ud_53", x = "_active_188ud_53",
44
44
  active: e.selected,
45
45
  disabled: e.disabled
46
46
  }),
47
- onClick: () => _(e),
47
+ onClick: () => b(e),
48
48
  disabled: e.disabled,
49
49
  "aria-pressed": e.selected,
50
50
  children: [
51
- e.icon && /* @__PURE__ */ u("span", { className: c("icon"), children: e.icon }),
51
+ e.icon && /* @__PURE__ */ r("span", { className: c("icon"), children: e.icon }),
52
52
  e.label
53
53
  ]
54
54
  },
@@ -58,5 +58,5 @@ const N = "_button_188ud_28", w = "_disabled_188ud_53", x = "_active_188ud_53",
58
58
  );
59
59
  };
60
60
  export {
61
- g as SegmentedControl
61
+ S as SegmentedControl
62
62
  };