triafly-ui-kit 1.0.43 → 1.0.45

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 (34) hide show
  1. package/README.md +93 -93
  2. package/dist/_virtual/index2.js +2 -5
  3. package/dist/assets/src/components/Ui/Skeleton/Skeleton.module.css +1 -1
  4. package/dist/assets/src/components/Ui/Table/Table.css +1 -1
  5. package/dist/assets/src/components/Ui/Table/TableSkeletonRow/TableSkeletonRow.css +1 -0
  6. package/dist/assets/src/components/Ui/Tooltip/Tooltip.stories.module.css +1 -1
  7. package/dist/components/Ui/ButtonsArray/ButtonsArray.js +15 -16
  8. package/dist/components/Ui/ButtonsArray/ButtonsArray.stories.js +8 -8
  9. package/dist/components/Ui/Icons/Icons.js +32 -24
  10. package/dist/components/Ui/Icons/index.js +69 -67
  11. package/dist/components/Ui/ModalWindow/ModalWindow.stories.js +89 -0
  12. package/dist/components/Ui/Table/MemoizedRow/MemoizedRow.js +30 -31
  13. package/dist/components/Ui/Table/Table.js +147 -112
  14. package/dist/components/Ui/Table/TableSkeletonRow/TableSkeletonRow.js +11 -0
  15. package/dist/main.d.ts +26 -4
  16. package/dist/main.js +105 -103
  17. package/dist/node_modules/classnames/index.js +1 -1
  18. package/dist/src/components/Ui/Skeleton/Skeleton.module.scss.js +5 -5
  19. package/dist/src/components/Ui/Tooltip/Tooltip.stories.module.css.js +1 -1
  20. package/package.json +112 -112
  21. package/src/styles/_mixins.scss +21 -21
  22. package/src/styles/fix.scss +3 -3
  23. package/src/styles/main.scss +26 -26
  24. package/src/styles/reset.scss +105 -105
  25. package/src/styles/typography.scss +106 -106
  26. package/src/styles/variables.scss +277 -277
  27. package/dist/_virtual/index3.js +0 -4
  28. package/dist/node_modules/fast-deep-equal/index.js +0 -31
  29. package/dist/styles/_mixins.scss +0 -22
  30. package/dist/styles/fix.scss +0 -4
  31. package/dist/styles/main.scss +0 -27
  32. package/dist/styles/reset.scss +0 -106
  33. package/dist/styles/typography.scss +0 -106
  34. package/dist/styles/variables.scss +0 -277
@@ -1,4 +1,4 @@
1
- import { IconArrowBendUpRight as c, IconArrowClockwise as I, IconArrowDown as e, IconArrowLeft as r, IconArrowLineDown as i, IconArrowLineLeft as t, IconArrowLineRight as a, IconArrowLineUp as l, IconArrowRight as s, IconArrowUp as C, IconArrowsOut as w, IconArticle as h, IconAt as p, IconBellSimple as g, IconBookOpenText as u, IconCalendarBlank as S, IconCaretDown as A, IconCaretLeft as D, IconCaretRight as L, IconCaretUp as d, IconCaretUpDown as k, IconChartPieSlice as U, IconChatText as P, IconCheck as F, IconCheckCircle as T, IconChecks as f, IconCircleNotch as y, IconCopy as B, IconCornersOut as R, IconCsv as X, IconCube as m, IconDatabase as x, IconDotsNine as M, IconDotsThreeVertical as v, IconExport as H, IconEye as N, IconEyeSlash as O, IconFile as Q, IconFiles as E, IconFloppyDisk as G, IconFolderSimple as b, IconFolderSimpleX as W, IconFunnel as z, IconGauge as J, IconGear as V, IconGoogleDrive as Y, IconHand as j, IconHeadCircuit as q, IconHouse as K, IconIcon as Z, IconInfo as _, IconJoin as $, IconLanguage as oo, IconLink as no, IconList as co, IconLock as Io, IconLockOpen as eo, IconMariaDB as ro, IconMinus as io, IconMongoDB as to, IconMoon as ao, IconMySQL as lo, IconNavigationArrow as so, IconNotePencil as Co, IconPassword as wo, IconPen as ho, IconPlay as po, IconPlugsX as go, IconPlus as uo, IconPorsgteSQL as So, IconPresentationChart as Ao, IconQuestion as Do, IconQuestionFullfilled as Lo, IconRedo as ko, IconRoleX as Uo, IconSearch as Po, IconSearchX as Fo, IconSelection as To, IconServer as fo, IconSlidersHorizontal as yo, IconSticker as Bo, IconSun as Ro, IconThreeDot as Xo, IconTrash as mo, IconTriangleDown as xo, IconTriangleUp as Mo, IconUndo as vo, IconUploadSimple as Ho, IconUser as No, IconUserX as Oo, IconWarningCircle as Qo, IconWrench as Eo, IconX as Go, IconYandexDisk as bo } from "./Icons.js";
1
+ import { IconArrowBendUpRight as c, IconArrowClockwise as I, IconArrowDown as e, IconArrowLeft as r, IconArrowLineDown as i, IconArrowLineLeft as t, IconArrowLineRight as a, IconArrowLineUp as l, IconArrowRight as s, IconArrowUp as C, IconArrowsOut as h, IconArticle as w, IconAt as p, IconBellSimple as u, IconBookOpenText as g, IconCalendarBlank as S, IconCaretDown as A, IconCaretLeft as D, IconCaretRight as L, IconCaretUp as d, IconCaretUpDown as k, IconChartPieSlice as U, IconChatText as P, IconCheck as B, IconCheckCircle as F, IconChecks as T, IconCircleNotch as X, IconClickHouse as f, IconCopy as y, IconCornersOut as R, IconCsv as m, IconCube as x, IconDatabase as H, IconDotsNine as M, IconDotsThreeVertical as v, IconExport as G, IconEye as N, IconEyeSlash as O, IconFile as Q, IconFiles as E, IconFloppyDisk as b, IconFolderSimple as W, IconFolderSimpleX as z, IconFunnel as J, IconGauge as V, IconGear as Y, IconGitBranchX as j, IconGoogleDrive as q, IconHand as K, IconHeadCircuit as Z, IconHouse as _, IconIcon as $, IconInfo as oo, IconJoin as no, IconLanguage as co, IconLink as Io, IconList as eo, IconLock as ro, IconLockOpen as io, IconMariaDB as to, IconMinus as ao, IconMongoDB as lo, IconMoon as so, IconMySQL as Co, IconNavigationArrow as ho, IconNotePencil as wo, IconPassword as po, IconPen as uo, IconPlay as go, IconPlugsX as So, IconPlus as Ao, IconPorsgteSQL as Do, IconPresentationChart as Lo, IconQuestion as ko, IconQuestionFullfilled as Uo, IconRedo as Po, IconRoleX as Bo, IconSearch as Fo, IconSearchX as To, IconSelection as Xo, IconServer as fo, IconSlidersHorizontal as yo, IconSticker as Ro, IconSun as mo, IconThreeDot as xo, IconTrash as Ho, IconTriangleDown as Mo, IconTriangleUp as vo, IconUndo as Go, IconUploadSimple as No, IconUser as Oo, IconUserX as Qo, IconWarningCircle as Eo, IconWrench as bo, IconX as Wo, IconYandexDisk as zo } from "./Icons.js";
2
2
  export {
3
3
  c as IconArrowBendUpRight,
4
4
  I as IconArrowClockwise,
@@ -10,11 +10,11 @@ export {
10
10
  l as IconArrowLineUp,
11
11
  s as IconArrowRight,
12
12
  C as IconArrowUp,
13
- w as IconArrowsOut,
14
- h as IconArticle,
13
+ h as IconArrowsOut,
14
+ w as IconArticle,
15
15
  p as IconAt,
16
- g as IconBellSimple,
17
- u as IconBookOpenText,
16
+ u as IconBellSimple,
17
+ g as IconBookOpenText,
18
18
  S as IconCalendarBlank,
19
19
  A as IconCaretDown,
20
20
  D as IconCaretLeft,
@@ -23,75 +23,77 @@ export {
23
23
  k as IconCaretUpDown,
24
24
  U as IconChartPieSlice,
25
25
  P as IconChatText,
26
- F as IconCheck,
27
- T as IconCheckCircle,
28
- f as IconChecks,
29
- y as IconCircleNotch,
30
- B as IconCopy,
26
+ B as IconCheck,
27
+ F as IconCheckCircle,
28
+ T as IconChecks,
29
+ X as IconCircleNotch,
30
+ f as IconClickHouse,
31
+ y as IconCopy,
31
32
  R as IconCornersOut,
32
- X as IconCsv,
33
- m as IconCube,
34
- x as IconDatabase,
33
+ m as IconCsv,
34
+ x as IconCube,
35
+ H as IconDatabase,
35
36
  M as IconDotsNine,
36
37
  v as IconDotsThreeVertical,
37
- H as IconExport,
38
+ G as IconExport,
38
39
  N as IconEye,
39
40
  O as IconEyeSlash,
40
41
  Q as IconFile,
41
42
  E as IconFiles,
42
- G as IconFloppyDisk,
43
- b as IconFolderSimple,
44
- W as IconFolderSimpleX,
45
- z as IconFunnel,
46
- J as IconGauge,
47
- V as IconGear,
48
- Y as IconGoogleDrive,
49
- j as IconHand,
50
- q as IconHeadCircuit,
51
- K as IconHouse,
52
- Z as IconIcon,
53
- _ as IconInfo,
54
- $ as IconJoin,
55
- oo as IconLanguage,
56
- no as IconLink,
57
- co as IconList,
58
- Io as IconLock,
59
- eo as IconLockOpen,
60
- ro as IconMariaDB,
61
- io as IconMinus,
62
- to as IconMongoDB,
63
- ao as IconMoon,
64
- lo as IconMySQL,
65
- so as IconNavigationArrow,
66
- Co as IconNotePencil,
67
- wo as IconPassword,
68
- ho as IconPen,
69
- po as IconPlay,
70
- go as IconPlugsX,
71
- uo as IconPlus,
72
- So as IconPorsgteSQL,
73
- Ao as IconPresentationChart,
74
- Do as IconQuestion,
75
- Lo as IconQuestionFullfilled,
76
- ko as IconRedo,
77
- Uo as IconRoleX,
78
- Po as IconSearch,
79
- Fo as IconSearchX,
80
- To as IconSelection,
43
+ b as IconFloppyDisk,
44
+ W as IconFolderSimple,
45
+ z as IconFolderSimpleX,
46
+ J as IconFunnel,
47
+ V as IconGauge,
48
+ Y as IconGear,
49
+ j as IconGitBranchX,
50
+ q as IconGoogleDrive,
51
+ K as IconHand,
52
+ Z as IconHeadCircuit,
53
+ _ as IconHouse,
54
+ $ as IconIcon,
55
+ oo as IconInfo,
56
+ no as IconJoin,
57
+ co as IconLanguage,
58
+ Io as IconLink,
59
+ eo as IconList,
60
+ ro as IconLock,
61
+ io as IconLockOpen,
62
+ to as IconMariaDB,
63
+ ao as IconMinus,
64
+ lo as IconMongoDB,
65
+ so as IconMoon,
66
+ Co as IconMySQL,
67
+ ho as IconNavigationArrow,
68
+ wo as IconNotePencil,
69
+ po as IconPassword,
70
+ uo as IconPen,
71
+ go as IconPlay,
72
+ So as IconPlugsX,
73
+ Ao as IconPlus,
74
+ Do as IconPorsgteSQL,
75
+ Lo as IconPresentationChart,
76
+ ko as IconQuestion,
77
+ Uo as IconQuestionFullfilled,
78
+ Po as IconRedo,
79
+ Bo as IconRoleX,
80
+ Fo as IconSearch,
81
+ To as IconSearchX,
82
+ Xo as IconSelection,
81
83
  fo as IconServer,
82
84
  yo as IconSlidersHorizontal,
83
- Bo as IconSticker,
84
- Ro as IconSun,
85
- Xo as IconThreeDot,
86
- mo as IconTrash,
87
- xo as IconTriangleDown,
88
- Mo as IconTriangleUp,
89
- vo as IconUndo,
90
- Ho as IconUploadSimple,
91
- No as IconUser,
92
- Oo as IconUserX,
93
- Qo as IconWarningCircle,
94
- Eo as IconWrench,
95
- Go as IconX,
96
- bo as IconYandexDisk
85
+ Ro as IconSticker,
86
+ mo as IconSun,
87
+ xo as IconThreeDot,
88
+ Ho as IconTrash,
89
+ Mo as IconTriangleDown,
90
+ vo as IconTriangleUp,
91
+ Go as IconUndo,
92
+ No as IconUploadSimple,
93
+ Oo as IconUser,
94
+ Qo as IconUserX,
95
+ Eo as IconWarningCircle,
96
+ bo as IconWrench,
97
+ Wo as IconX,
98
+ zo as IconYandexDisk
97
99
  };
@@ -0,0 +1,89 @@
1
+ import { jsx as o, jsxs as i } from "react/jsx-runtime";
2
+ import { useState as d } from "react";
3
+ import { ModalWindow as r } from "./ModalWindow.js";
4
+ import { IconCheck as t } from "../Icons/Icons.js";
5
+ const u = {
6
+ title: "UIKit/ModalWindow",
7
+ component: r,
8
+ tags: ["autodocs"]
9
+ }, l = () => {
10
+ const [n, e] = d(!1);
11
+ return /* @__PURE__ */ i("div", { style: { padding: "20px" }, children: [
12
+ /* @__PURE__ */ o(
13
+ "button",
14
+ {
15
+ onClick: () => e(!0),
16
+ style: {
17
+ padding: "8px 16px",
18
+ backgroundColor: "#007bff",
19
+ color: "white",
20
+ border: "none",
21
+ borderRadius: "4px",
22
+ cursor: "pointer"
23
+ },
24
+ children: "Open Modal"
25
+ }
26
+ ),
27
+ /* @__PURE__ */ o(r, { isOpen: n, onClose: () => e(!1), title: "Basic Modal Window", children: /* @__PURE__ */ i("div", { style: { padding: "20px" }, children: [
28
+ /* @__PURE__ */ o("p", { children: "This is a simple modal content" }),
29
+ /* @__PURE__ */ o(
30
+ "button",
31
+ {
32
+ onClick: () => e(!1),
33
+ style: {
34
+ padding: "6px 12px",
35
+ backgroundColor: "#6c757d",
36
+ color: "white",
37
+ border: "none",
38
+ borderRadius: "4px",
39
+ cursor: "pointer"
40
+ },
41
+ children: "Close"
42
+ }
43
+ )
44
+ ] }) })
45
+ ] });
46
+ }, s = () => {
47
+ const [n, e] = d(!1);
48
+ return /* @__PURE__ */ i("div", { style: { padding: "20px" }, children: [
49
+ /* @__PURE__ */ o(
50
+ "button",
51
+ {
52
+ onClick: () => e(!0),
53
+ style: {
54
+ padding: "8px 16px",
55
+ backgroundColor: "#007bff",
56
+ color: "white",
57
+ border: "none",
58
+ borderRadius: "4px",
59
+ cursor: "pointer"
60
+ },
61
+ children: "Open Modal with Icon"
62
+ }
63
+ ),
64
+ /* @__PURE__ */ o(
65
+ r,
66
+ {
67
+ isOpen: n,
68
+ onClose: () => e(!1),
69
+ title: "Modal with Icon",
70
+ iconHeader: {
71
+ view: !0,
72
+ status: "info",
73
+ icon: t,
74
+ size: 24
75
+ },
76
+ children: /* @__PURE__ */ o("div", { style: { padding: "20px" }, children: /* @__PURE__ */ o("p", { children: "This modal has an icon in the header" }) })
77
+ }
78
+ )
79
+ ] });
80
+ }, x = {
81
+ render: () => /* @__PURE__ */ o(l, {})
82
+ }, f = {
83
+ render: () => /* @__PURE__ */ o(s, {})
84
+ };
85
+ export {
86
+ x as Basic,
87
+ f as WithIcon,
88
+ u as default
89
+ };
@@ -1,50 +1,49 @@
1
- import { jsx as p } from "react/jsx-runtime";
2
- import c from "react";
3
- import m from "../../../../_virtual/index2.js";
4
- import d from "../../../../_virtual/index.js";
5
- const h = c.memo(
1
+ import { jsx as b } from "react/jsx-runtime";
2
+ import f from "react";
3
+ import o from "../../../../_virtual/index.js";
4
+ const K = f.memo(
6
5
  ({
7
6
  record: t,
8
- columns: _,
7
+ columns: n,
9
8
  rowKey: a,
10
- rowClassName: n,
11
- index: l,
12
- stickyLeft: r,
13
- onClickTr: b,
14
- bordered: i
9
+ rowClassName: d,
10
+ index: i,
11
+ stickyLeft: e,
12
+ bordered: y,
13
+ id: c
15
14
  }) => {
16
- const s = (e) => {
17
- !e.target.closest("[data-no-bubble]") && b && b(t);
18
- };
19
- return /* @__PURE__ */ p(
15
+ const m = c || (typeof a == "function" ? a(t) : String(t[a]));
16
+ return /* @__PURE__ */ b(
20
17
  "tr",
21
18
  {
22
- className: d(
19
+ "data-id": m,
20
+ className: o(
23
21
  "table-component__wrapper__table__tbody__tr",
24
- n == null ? void 0 : n(t, l),
25
- {
26
- "table-component__wrapper__table__tbody__tr--hoverable": !!b
27
- }
22
+ d == null ? void 0 : d(t, i)
28
23
  ),
29
- onClick: s,
30
- children: _.map((e, o) => /* @__PURE__ */ p(
24
+ children: n.map((_, r) => /* @__PURE__ */ b(
31
25
  "td",
32
26
  {
33
- className: d("table-component__wrapper__table__tbody__td", e.className, {
34
- "table-component__wrapper__table__tbody__td--bordered": i,
35
- "table-component__wrapper__table__tbody__td--sticky-left": r && o === 0
27
+ className: o("table-component__wrapper__table__tbody__td", _.className, {
28
+ "table-component__wrapper__table__tbody__td--bordered": y,
29
+ "table-component__wrapper__table__tbody__td--sticky-left": e && r === 0
36
30
  }),
37
- align: e.align,
38
- children: e.render ? e.render(t[e.dataIndex], t) : String(t[e.dataIndex] ?? "")
31
+ align: _.align,
32
+ children: _.render ? _.render(t[_.dataIndex], t) : String(t[_.dataIndex] ?? "")
39
33
  },
40
- `${e.key}-${o}`
34
+ `${_.key}-${r}`
41
35
  ))
42
36
  },
43
- typeof a == "function" ? a(t) : String(t[a])
37
+ m
44
38
  );
45
39
  },
46
- (t, _) => m(t.columns, _.columns) && m(t.record, _.record)
40
+ (t, n) => {
41
+ if (t.id && n.id)
42
+ return t.id === n.id;
43
+ const a = (e) => typeof e.rowKey == "function" ? e.rowKey(e.record) : String(e.record[e.rowKey]), d = a(t), i = a(n);
44
+ return d !== i ? !1 : t.columns === n.columns;
45
+ }
47
46
  );
48
47
  export {
49
- h as MemoizedRow
48
+ K as MemoizedRow
50
49
  };
@@ -1,161 +1,196 @@
1
- import { jsx as t, jsxs as _ } from "react/jsx-runtime";
2
- import U, { useState as N, useEffect as q, useCallback as d } from "react";
3
- import o from "../../../_virtual/index.js";
1
+ import { jsx as n, jsxs as g } from "react/jsx-runtime";
2
+ import Z, { forwardRef as K, useState as j, useMemo as ee, useCallback as k, useEffect as te } from "react";
3
+ import i from "../../../_virtual/index.js";
4
4
  import '../../../assets/src/components/Ui/Table/Table.css';/* empty css */
5
- import { IconCaretDown as w, IconCaretUp as F } from "../Icons/Icons.js";
6
- import { MemoizedRow as G } from "./MemoizedRow/MemoizedRow.js";
7
- import { Loader as H } from "../Loader/Loader.js";
8
- const y = {
9
- asc: /* @__PURE__ */ t(w, { viewBox: "0 -6 24 24", "aria-hidden": "true" }),
10
- desc: /* @__PURE__ */ t(F, { viewBox: "0 -4 24 24", "aria-hidden": "true" }),
11
- default: /* @__PURE__ */ t(w, { viewBox: "0 -6 24 24", "aria-hidden": "true" })
12
- };
13
- function J({
14
- columns: f,
15
- dataSource: c,
16
- rowKey: i,
17
- tableClassName: v,
18
- theadClassName: k,
19
- trTheadClassNames: x,
20
- thTheadClassNames: D,
21
- tbodyClassName: I,
22
- wrapperClassName: A,
23
- borderBottom: u = !1,
24
- stickyHeader: C = !1,
25
- stickyLeft: h = !1,
26
- bordered: l = !1,
27
- rowClassName: j,
28
- defaultSort: B,
29
- onClickTr: m,
30
- onClickTrHeader: R,
31
- loading: S = !1
32
- }) {
33
- const [T, b] = N(c), [n, z] = N(
34
- B || null
35
- );
36
- q(() => {
37
- b(c);
38
- }, [c]);
39
- const $ = d(
40
- (e) => typeof i == "function" ? i(e) : typeof i == "string" && i in e ? String(e[i]) : "unknown",
41
- [i]
42
- ), g = d((e, a) => {
43
- b((p) => [...p].sort((L, M) => {
44
- const s = L[e], r = M[e];
45
- 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;
46
- })), z({ key: e, order: a });
47
- }, []), E = d(
5
+ import { IconCaretDown as z, IconCaretUp as ne } from "../Icons/Icons.js";
6
+ import { MemoizedRow as C } from "./MemoizedRow/MemoizedRow.js";
7
+ import { Loader as ae } from "../Loader/Loader.js";
8
+ import { TableSkeletonRow as re } from "./TableSkeletonRow/TableSkeletonRow.js";
9
+ const L = {
10
+ asc: /* @__PURE__ */ n(z, { viewBox: "0 -6 24 24", "aria-hidden": "true" }),
11
+ desc: /* @__PURE__ */ n(ne, { viewBox: "0 -4 24 24", "aria-hidden": "true" }),
12
+ default: /* @__PURE__ */ n(z, { viewBox: "0 -6 24 24", "aria-hidden": "true" })
13
+ }, se = ({
14
+ columns: m,
15
+ dataSource: l,
16
+ rowKey: f,
17
+ tableClassName: $,
18
+ theadClassName: O,
19
+ trTheadClassNames: U,
20
+ thTheadClassNames: q,
21
+ tbodyClassName: F,
22
+ wrapperClassName: G,
23
+ borderBottom: y = !1,
24
+ stickyHeader: H = !1,
25
+ stickyLeft: b = !1,
26
+ bordered: p = !1,
27
+ rowClassName: x,
28
+ defaultSort: J,
29
+ onClickTr: d,
30
+ onClickTrHeader: P,
31
+ loading: R = !1,
32
+ hasMore: Q = !1,
33
+ loadingIndicator: S,
34
+ loaderRef: B,
35
+ externalSorting: D = !1,
36
+ entities: c,
37
+ sortedIds: u
38
+ }, V) => {
39
+ const T = Z.useRef(null), o = !!c && !!u, [A, W] = j(l || []), [s, E] = j(
40
+ J || null
41
+ ), N = ee(() => {
42
+ if (!o)
43
+ return D ? l : A;
44
+ }, [o, l, A, D]), I = k(
45
+ (e, t) => {
46
+ if (o) {
47
+ E({ key: e, order: t });
48
+ return;
49
+ }
50
+ W((_) => [..._].sort((h, M) => {
51
+ const r = h[e], a = M[e];
52
+ return typeof r == "string" && typeof a == "string" ? t === "asc" ? r.localeCompare(a) : a.localeCompare(r) : typeof r == "number" && typeof a == "number" ? t === "asc" ? r - a : a - r : r instanceof Date && a instanceof Date ? t === "asc" ? r.getTime() - a.getTime() : a.getTime() - r.getTime() : 0;
53
+ })), E({ key: e, order: t });
54
+ },
55
+ [o]
56
+ ), v = k(
57
+ (e) => typeof f == "function" ? f(e) : String(e[f]),
58
+ [f]
59
+ ), X = k(
48
60
  (e) => {
49
- const p = (n == null ? void 0 : n.key) === e && n.order === "asc" ? "desc" : "asc";
50
- g(e, p);
61
+ const _ = (s == null ? void 0 : s.key) === e && s.order === "asc" ? "desc" : "asc";
62
+ I(e, _);
51
63
  },
52
- [n, g]
64
+ [s, I]
53
65
  );
54
- return /* @__PURE__ */ t("div", { className: o("table-component", A), children: /* @__PURE__ */ t(
66
+ return te(() => {
67
+ const e = T.current;
68
+ if (!e) return;
69
+ const t = (_) => {
70
+ const w = _.target, h = w.closest("tr");
71
+ if (!h || w.closest("[data-no-bubble]")) return;
72
+ const r = h.dataset.id;
73
+ if (!(!r || !d))
74
+ if (o && c) {
75
+ const a = c[r];
76
+ a && d(a);
77
+ } else {
78
+ const a = l == null ? void 0 : l.find((Y) => v(Y) === r);
79
+ a && d(a);
80
+ }
81
+ };
82
+ return e.addEventListener("click", t), () => e.removeEventListener("click", t);
83
+ }, [l, d, v, o, c]), /* @__PURE__ */ n("div", { className: i("table-component", G), children: /* @__PURE__ */ n(
55
84
  "div",
56
85
  {
57
- className: o(
86
+ className: i(
58
87
  "table-component__wrapper",
59
88
  {
60
- bordered: l,
61
- borderBottom: u
89
+ bordered: p,
90
+ borderBottom: y
62
91
  },
63
- v
92
+ $
64
93
  ),
65
- children: /* @__PURE__ */ _(
94
+ children: /* @__PURE__ */ g(
66
95
  "table",
67
96
  {
68
- className: o("table-component__wrapper__table", {
69
- bordered: l,
70
- borderBottom: u
97
+ className: i("table-component__wrapper__table", {
98
+ bordered: p,
99
+ borderBottom: y
71
100
  }),
101
+ ref: V,
72
102
  children: [
73
- /* @__PURE__ */ t(
103
+ /* @__PURE__ */ n(
74
104
  "thead",
75
105
  {
76
- className: o(
106
+ className: i(
77
107
  "table-component__wrapper__table__thead",
78
108
  {
79
- stickyHeader: C
109
+ stickyHeader: H
80
110
  },
81
- k
111
+ O
82
112
  ),
83
- children: /* @__PURE__ */ t(
113
+ children: /* @__PURE__ */ n(
84
114
  "tr",
85
115
  {
86
- className: o(
116
+ className: i(
87
117
  "table-component__wrapper__table__thead__tr",
88
- x
118
+ U
89
119
  ),
90
- onClick: R,
91
- children: f.map((e, a) => /* @__PURE__ */ t(
120
+ onClick: P,
121
+ children: m.map((e, t) => /* @__PURE__ */ n(
92
122
  "th",
93
123
  {
94
- className: o(
124
+ className: i(
95
125
  "table-component__wrapper__table__thead__th",
96
126
  {
97
- bordered: l,
98
- stickyLeft: h && a === 0
127
+ bordered: p,
128
+ stickyLeft: b && t === 0
99
129
  },
100
- D
130
+ q
101
131
  ),
102
132
  style: {
103
133
  ...e.width ? { width: e.width } : {},
104
134
  ...e.align ? { textAlign: e.align } : {}
105
135
  },
106
- onClick: () => e.sorted && E(e.key),
107
- children: /* @__PURE__ */ _("div", { className: "th-content", children: [
136
+ onClick: () => e.sorted && X(e.key),
137
+ children: /* @__PURE__ */ g("div", { className: "th-content", children: [
108
138
  e.title,
109
- e.sorted && /* @__PURE__ */ t("span", { className: "sort-icon", children: (n == null ? void 0 : n.key) === e.key ? y[n.order] : y.default })
139
+ e.sorted && /* @__PURE__ */ n("span", { className: "sort-icon", children: (s == null ? void 0 : s.key) === e.key ? L[s.order] : L.default })
110
140
  ] })
111
141
  },
112
- `${e.key}-${a}`
142
+ `${e.key}-${t}`
113
143
  ))
114
144
  }
115
145
  )
116
146
  }
117
147
  ),
118
- /* @__PURE__ */ _("tbody", { className: o("table-component__wrapper__table__tbody", I), children: [
119
- T.map((e, a) => /* @__PURE__ */ t(
120
- G,
121
- {
122
- record: e,
123
- onClickTr: () => m == null ? void 0 : m(e),
124
- columns: f,
125
- rowKey: i,
126
- rowClassName: j,
127
- index: a,
128
- stickyLeft: h,
129
- bordered: l
130
- },
131
- $(e)
132
- )),
133
- S ? /* @__PURE__ */ t(
134
- "div",
135
- {
136
- style: {
137
- position: "absolute",
138
- top: 0,
139
- left: 0,
140
- right: 0,
141
- bottom: 0,
142
- display: "flex",
143
- justifyContent: "center",
144
- alignItems: "center",
145
- backgroundColor: "rgba(255, 255, 255, 0.7)",
146
- zIndex: 10
147
- },
148
- children: /* @__PURE__ */ t(H, { className: "centered" })
149
- }
150
- ) : null
151
- ] })
148
+ /* @__PURE__ */ g(
149
+ "tbody",
150
+ {
151
+ ref: T,
152
+ className: i("table-component__wrapper__table__tbody", F),
153
+ children: [
154
+ o && u ? u.map((e) => {
155
+ const t = c == null ? void 0 : c[e];
156
+ return t ? /* @__PURE__ */ n(
157
+ C,
158
+ {
159
+ record: t,
160
+ columns: m,
161
+ rowKey: f,
162
+ rowClassName: x,
163
+ index: u.indexOf(e),
164
+ stickyLeft: b,
165
+ bordered: p,
166
+ id: e
167
+ },
168
+ e
169
+ ) : null;
170
+ }) : N == null ? void 0 : N.map((e, t) => /* @__PURE__ */ n(
171
+ C,
172
+ {
173
+ record: e,
174
+ columns: m,
175
+ rowKey: f,
176
+ rowClassName: x,
177
+ index: t,
178
+ stickyLeft: b,
179
+ bordered: p
180
+ },
181
+ v(e)
182
+ )),
183
+ R ? /* @__PURE__ */ n("div", { className: "loading_table_init", children: /* @__PURE__ */ n(ae, { className: "centered" }) }) : null,
184
+ !R && Q && B && /* @__PURE__ */ n("tr", { ref: B, children: /* @__PURE__ */ n("td", { colSpan: m.length, children: S || /* @__PURE__ */ n(re, { colSpan: m.length }) }) })
185
+ ]
186
+ }
187
+ )
152
188
  ]
153
189
  }
154
190
  )
155
191
  }
156
192
  ) });
157
- }
158
- const K = U.memo(J);
193
+ }, de = K(se);
159
194
  export {
160
- K as Table
195
+ de as Table
161
196
  };