triafly-ui-kit 1.0.39 → 1.0.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.
@@ -1,22 +1,22 @@
1
- import { jsx as t, jsxs as d } from "react/jsx-runtime";
2
- import { forwardRef as O, useRef as v, useState as y, useEffect as P, useImperativeHandle as Q, useCallback as _ } from "react";
3
- import i from "../../../_virtual/index.js";
1
+ import { jsx as t, jsxs as f } from "react/jsx-runtime";
2
+ import { forwardRef as H, useState as y, useEffect as J, useCallback as _ } from "react";
3
+ import l from "../../../_virtual/index.js";
4
4
  import '../../../assets/src/components/Ui/Table/Table.css';/* empty css */
5
- import { IconCaretDown as k, IconCaretUp as V } from "../Icons/Icons.js";
6
- import { MemoizedRow as W } from "./MemoizedRow/MemoizedRow.js";
7
- import { Loader as X } from "../Loader/Loader.js";
8
- import { TableSkeletonRow as Y } from "./TableSkeletonRow/TableSkeletonRow.js";
9
- const x = {
5
+ import { IconCaretDown as k, IconCaretUp as O } from "../Icons/Icons.js";
6
+ import { MemoizedRow as P } from "./MemoizedRow/MemoizedRow.js";
7
+ import { Loader as Q } from "../Loader/Loader.js";
8
+ import { TableSkeletonRow as V } from "./TableSkeletonRow/TableSkeletonRow.js";
9
+ const v = {
10
10
  asc: /* @__PURE__ */ t(k, { viewBox: "0 -6 24 24", "aria-hidden": "true" }),
11
- desc: /* @__PURE__ */ t(V, { viewBox: "0 -4 24 24", "aria-hidden": "true" }),
11
+ desc: /* @__PURE__ */ t(O, { viewBox: "0 -4 24 24", "aria-hidden": "true" }),
12
12
  default: /* @__PURE__ */ t(k, { viewBox: "0 -6 24 24", "aria-hidden": "true" })
13
- }, Z = ({
13
+ }, W = ({
14
14
  columns: o,
15
15
  dataSource: p,
16
- rowKey: l,
17
- tableClassName: R,
18
- theadClassName: I,
19
- trTheadClassNames: D,
16
+ rowKey: i,
17
+ tableClassName: x,
18
+ theadClassName: D,
19
+ trTheadClassNames: I,
20
20
  thTheadClassNames: S,
21
21
  tbodyClassName: A,
22
22
  wrapperClassName: C,
@@ -27,76 +27,75 @@ const x = {
27
27
  rowClassName: j,
28
28
  defaultSort: B,
29
29
  onClickTr: m,
30
- onClickTrHeader: z,
30
+ onClickTrHeader: R,
31
31
  loading: b = !1,
32
- hasMore: $ = !1,
33
- loadingIndicator: E
34
- }, H) => {
35
- const L = v(null), g = v(null), [M, w] = y(p), [n, U] = y(
32
+ hasMore: z = !1,
33
+ loadingIndicator: $,
34
+ loaderRef: g
35
+ }, E) => {
36
+ const [L, w] = y(p), [n, M] = y(
36
37
  B || null
37
38
  );
38
- P(() => {
39
+ J(() => {
39
40
  w(p);
40
- }, [p]), Q(H, () => ({
41
- loaderRef: g.current
42
- }));
43
- const q = _(
44
- (e) => typeof l == "function" ? l(e) : typeof l == "string" && l in e ? String(e[l]) : "unknown",
45
- [l]
41
+ }, [p]);
42
+ const U = _(
43
+ (e) => typeof i == "function" ? i(e) : typeof i == "string" && i in e ? String(e[i]) : "unknown",
44
+ [i]
46
45
  ), N = _((e, a) => {
47
- w((f) => [...f].sort((G, J) => {
48
- const s = G[e], r = J[e];
46
+ w((d) => [...d].sort((F, G) => {
47
+ const s = F[e], r = G[e];
49
48
  return typeof s == "string" && typeof r == "string" ? a === "asc" ? s.localeCompare(r) : r.localeCompare(s) : typeof s == "number" && typeof r == "number" ? a === "asc" ? s - r : r - s : s instanceof Date && r instanceof Date ? a === "asc" ? s.getTime() - r.getTime() : r.getTime() - s.getTime() : 0;
50
- })), U({ key: e, order: a });
51
- }, []), F = _(
49
+ })), M({ key: e, order: a });
50
+ }, []), q = _(
52
51
  (e) => {
53
- const f = (n == null ? void 0 : n.key) === e && n.order === "asc" ? "desc" : "asc";
54
- N(e, f);
52
+ const d = (n == null ? void 0 : n.key) === e && n.order === "asc" ? "desc" : "asc";
53
+ N(e, d);
55
54
  },
56
55
  [n, N]
57
56
  );
58
- return /* @__PURE__ */ t("div", { className: i("table-component", C), children: /* @__PURE__ */ t(
57
+ return /* @__PURE__ */ t("div", { className: l("table-component", C), children: /* @__PURE__ */ t(
59
58
  "div",
60
59
  {
61
- className: i(
60
+ className: l(
62
61
  "table-component__wrapper",
63
62
  {
64
63
  bordered: c,
65
64
  borderBottom: h
66
65
  },
67
- R
66
+ x
68
67
  ),
69
- children: /* @__PURE__ */ d(
68
+ children: /* @__PURE__ */ f(
70
69
  "table",
71
70
  {
72
- className: i("table-component__wrapper__table", {
71
+ className: l("table-component__wrapper__table", {
73
72
  bordered: c,
74
73
  borderBottom: h
75
74
  }),
76
- ref: L,
75
+ ref: E,
77
76
  children: [
78
77
  /* @__PURE__ */ t(
79
78
  "thead",
80
79
  {
81
- className: i(
80
+ className: l(
82
81
  "table-component__wrapper__table__thead",
83
82
  {
84
83
  stickyHeader: T
85
84
  },
86
- I
85
+ D
87
86
  ),
88
87
  children: /* @__PURE__ */ t(
89
88
  "tr",
90
89
  {
91
- className: i(
90
+ className: l(
92
91
  "table-component__wrapper__table__thead__tr",
93
- D
92
+ I
94
93
  ),
95
- onClick: z,
94
+ onClick: R,
96
95
  children: o.map((e, a) => /* @__PURE__ */ t(
97
96
  "th",
98
97
  {
99
- className: i(
98
+ className: l(
100
99
  "table-component__wrapper__table__thead__th",
101
100
  {
102
101
  bordered: c,
@@ -108,10 +107,10 @@ const x = {
108
107
  ...e.width ? { width: e.width } : {},
109
108
  ...e.align ? { textAlign: e.align } : {}
110
109
  },
111
- onClick: () => e.sorted && F(e.key),
112
- children: /* @__PURE__ */ d("div", { className: "th-content", children: [
110
+ onClick: () => e.sorted && q(e.key),
111
+ children: /* @__PURE__ */ f("div", { className: "th-content", children: [
113
112
  e.title,
114
- e.sorted && /* @__PURE__ */ t("span", { className: "sort-icon", children: (n == null ? void 0 : n.key) === e.key ? x[n.order] : x.default })
113
+ e.sorted && /* @__PURE__ */ t("span", { className: "sort-icon", children: (n == null ? void 0 : n.key) === e.key ? v[n.order] : v.default })
115
114
  ] })
116
115
  },
117
116
  `${e.key}-${a}`
@@ -120,20 +119,20 @@ const x = {
120
119
  )
121
120
  }
122
121
  ),
123
- /* @__PURE__ */ d("tbody", { className: i("table-component__wrapper__table__tbody", A), children: [
124
- M.map((e, a) => /* @__PURE__ */ t(
125
- W,
122
+ /* @__PURE__ */ f("tbody", { className: l("table-component__wrapper__table__tbody", A), children: [
123
+ L.map((e, a) => /* @__PURE__ */ t(
124
+ P,
126
125
  {
127
126
  record: e,
128
127
  onClickTr: () => m == null ? void 0 : m(e),
129
128
  columns: o,
130
- rowKey: l,
129
+ rowKey: i,
131
130
  rowClassName: j,
132
131
  index: a,
133
132
  stickyLeft: u,
134
133
  bordered: c
135
134
  },
136
- q(e)
135
+ U(e)
137
136
  )),
138
137
  b ? /* @__PURE__ */ t(
139
138
  "div",
@@ -150,17 +149,17 @@ const x = {
150
149
  backgroundColor: "rgba(255, 255, 255, 0.7)",
151
150
  zIndex: 10
152
151
  },
153
- children: /* @__PURE__ */ t(X, { className: "centered" })
152
+ children: /* @__PURE__ */ t(Q, { className: "centered" })
154
153
  }
155
154
  ) : null,
156
- !b && $ && /* @__PURE__ */ t("tr", { ref: g, children: /* @__PURE__ */ t("td", { colSpan: o.length, children: E || /* @__PURE__ */ t(Y, { colSpan: o.length }) }) })
155
+ !b && z && g && /* @__PURE__ */ t("tr", { ref: g, children: /* @__PURE__ */ t("td", { colSpan: o.length, children: $ || /* @__PURE__ */ t(V, { colSpan: o.length }) }) })
157
156
  ] })
158
157
  ]
159
158
  }
160
159
  )
161
160
  }
162
161
  ) });
163
- }, oe = O(Z);
162
+ }, re = H(W);
164
163
  export {
165
- oe as Table
164
+ re as Table
166
165
  };
package/dist/main.d.ts CHANGED
@@ -1150,9 +1150,7 @@ export declare interface TabItem {
1150
1150
  }
1151
1151
 
1152
1152
  export declare const Table: <T extends object>(props: TablesProps<T> & {
1153
- ref?: default_2.ForwardedRef<{
1154
- loaderRef: HTMLTableRowElement | null;
1155
- }>;
1153
+ ref?: default_2.ForwardedRef<HTMLTableElement>;
1156
1154
  }) => JSX.Element;
1157
1155
 
1158
1156
  declare type TablesProps<T extends object = Record<string, unknown>> = {
@@ -1179,6 +1177,7 @@ declare type TablesProps<T extends object = Record<string, unknown>> = {
1179
1177
  loading?: boolean;
1180
1178
  hasMore?: boolean;
1181
1179
  loadingIndicator?: default_2.ReactNode;
1180
+ loaderRef?: default_2.Ref<HTMLTableRowElement>;
1182
1181
  };
1183
1182
 
1184
1183
  export declare const Tabs: React.FC<TabsProps>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triafly-ui-kit",
3
- "version": "1.0.39",
3
+ "version": "1.0.40",
4
4
  "description": "UI Kit from Triafly",
5
5
  "main": "./dist/main.js",
6
6
  "module": "./dist/main.js",