@layers-app/shared 0.2.2 → 0.2.4

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 (69) hide show
  1. package/dist/assets/svg/group_default_icon.svg.js +4 -0
  2. package/dist/components/AppContainer/AppContainer.d.ts +1 -1
  3. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  4. package/dist/components/AppContainer/AppContainer.js +31 -23
  5. package/dist/components/AppContainer/hooks/useAppContainerStore.d.ts.map +1 -1
  6. package/dist/components/AppContainer/hooks/useAppContainerStore.js +30 -20
  7. package/dist/components/AppContainer/types.d.ts +1 -0
  8. package/dist/components/AppContainer/types.d.ts.map +1 -1
  9. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  10. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  11. package/dist/components/CommentComposer/CommentEditorHotkeys.js +25 -22
  12. package/dist/components/CommentComposer/index.d.ts.map +1 -1
  13. package/dist/components/CommentComposer/index.js +237 -153
  14. package/dist/components/CommentComposer/{useFloatingPosition.d.ts → useVirtualAnchor.d.ts} +3 -4
  15. package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -0
  16. package/dist/components/CommentComposer/useVirtualAnchor.js +71 -0
  17. package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
  18. package/dist/components/EmojiPicker/EmojiPanel.js +50 -49
  19. package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
  20. package/dist/components/EmojiPicker/IconsPanel.js +79 -78
  21. package/dist/components/FilePicker/FilePicker.d.ts +2 -3
  22. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  23. package/dist/components/FilePicker/FilePicker.js +88 -122
  24. package/dist/components/FilePicker/FilePickerGiphy.d.ts +1 -3
  25. package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
  26. package/dist/components/FilePicker/FilePickerGiphy.js +43 -44
  27. package/dist/components/FilePicker/FilePickerLink.d.ts +2 -3
  28. package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
  29. package/dist/components/FilePicker/FilePickerLink.js +21 -21
  30. package/dist/components/FilePicker/FilePickerUnsplash.d.ts +1 -3
  31. package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
  32. package/dist/components/FilePicker/FilePickerUnsplash.js +45 -46
  33. package/dist/components/FilePicker/FilePickerUpload.d.ts +3 -3
  34. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  35. package/dist/components/FilePicker/FilePickerUpload.js +49 -43
  36. package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +5 -5
  37. package/dist/components/GroupAvatar/index.d.ts +9 -0
  38. package/dist/components/GroupAvatar/index.d.ts.map +1 -0
  39. package/dist/components/GroupAvatar/index.js +24 -0
  40. package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
  41. package/dist/components/NavMenu/components/NavMenuItem.js +6 -5
  42. package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts +2 -2
  43. package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
  44. package/dist/components/WorkspaceMenu/WorkspaceMenu.js +100 -103
  45. package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
  46. package/dist/components/modals/RemoveConfirmModal.js +22 -21
  47. package/dist/components/table/FrontTable.d.ts +2 -1
  48. package/dist/components/table/FrontTable.d.ts.map +1 -1
  49. package/dist/components/table/components/TableCell.d.ts.map +1 -1
  50. package/dist/components/table/components/TableCell.js +63 -26
  51. package/dist/components/table/components/TableMenu.d.ts +2 -1
  52. package/dist/components/table/components/TableMenu.d.ts.map +1 -1
  53. package/dist/components/table/components/TableMenu.js +15 -14
  54. package/dist/constants.d.ts +4 -0
  55. package/dist/constants.d.ts.map +1 -1
  56. package/dist/constants.js +7 -4
  57. package/dist/index.css +1 -1
  58. package/dist/index.d.ts +1 -0
  59. package/dist/index.d.ts.map +1 -1
  60. package/dist/index.js +390 -384
  61. package/dist/lang/locales/ui_en.json.js +20 -12
  62. package/dist/lang/locales/ui_es.json.js +18 -10
  63. package/dist/lang/locales/ui_ru.json.js +24 -16
  64. package/dist/store/accessOptionsControl.d.ts +11 -1
  65. package/dist/store/accessOptionsControl.d.ts.map +1 -1
  66. package/dist/store/accessOptionsControl.js +15 -7
  67. package/package.json +1 -1
  68. package/dist/components/CommentComposer/useFloatingPosition.d.ts.map +0 -1
  69. package/dist/components/CommentComposer/useFloatingPosition.js +0 -115
@@ -1,98 +1,95 @@
1
- import { jsx as e, Fragment as S, jsxs as n } from "react/jsx-runtime";
2
- import { useState as A } from "react";
3
- import { useTranslation as u } from "react-i18next";
4
- import { Link as z } from "react-router-dom";
5
- import { Setting07Icon as L, UserMultiple02Icon as K, Add01Icon as T } from "@hugeicons/core-free-icons";
6
- import { HugeiconsIcon as k } from "@hugeicons/react";
7
- import { Flex as a, Menu as m, Tooltip as P, Text as d, Stack as p, Box as h, Button as b, ScrollArea as U, Progress as B } from "@mantine/core";
8
- import { useMenu as D } from "../../hooks/useMenu.js";
9
- import { formatStorage as M } from "../../utils/formatStorage.js";
10
- import { Logotype as F } from "../Logotype.js";
11
- import { WorkspaceAvatar as y } from "../WorkspaceAvatar/WorkspaceAvatar.js";
12
- import { Numbers as O } from "../table/helpers/formatters.js";
13
- import { WorkspaceItem as H } from "./WorkspaceItem.js";
14
- const oe = ({
1
+ import { jsx as e, Fragment as M, jsxs as n } from "react/jsx-runtime";
2
+ import { useState as N } from "react";
3
+ import { useTranslation as h } from "react-i18next";
4
+ import { Link as b } from "react-router-dom";
5
+ import { Setting07Icon as j, UserMultiple02Icon as A, Add01Icon as K } from "@hugeicons/core-free-icons";
6
+ import { HugeiconsIcon as g } from "@hugeicons/react";
7
+ import { Flex as l, Menu as p, Tooltip as T, Text as m, Stack as a, Box as f, Button as k, ScrollArea as P, Progress as U } from "@mantine/core";
8
+ import { useMenu as B } from "../../hooks/useMenu.js";
9
+ import { formatStorage as z } from "../../utils/formatStorage.js";
10
+ import { Logotype as D } from "../Logotype.js";
11
+ import { WorkspaceAvatar as S } from "../WorkspaceAvatar/WorkspaceAvatar.js";
12
+ import { Numbers as F } from "../table/helpers/formatters.js";
13
+ import { WorkspaceItem as O } from "./WorkspaceItem.js";
14
+ const ne = ({
15
15
  children: r,
16
- onCreate: s,
17
- onClick: t,
16
+ onCreate: i,
17
+ onClick: s,
18
18
  active: o,
19
- items: i,
20
- workspaceLink: c,
21
- settingsLink: l,
19
+ items: c,
20
+ workspaceLink: t,
21
+ settingsLink: y,
22
22
  membersLink: x,
23
- canEditWorkspace: I,
24
- isAnonym: C,
23
+ isAnonym: I,
25
24
  publicMode: W
26
25
  }) => {
27
- const { t: N } = u("workspaceMenu"), { isMobile: w } = D(), [j, f] = A(!1);
28
- return C || W ? /* @__PURE__ */ e(a, { w: "100%", justify: w ? "start" : "center", children: /* @__PURE__ */ e("a", { href: "/", children: /* @__PURE__ */ e(
29
- F,
26
+ const { t: C } = h("workspaceMenu"), { isMobile: u } = B(), [L, d] = N(!1);
27
+ return I || W ? /* @__PURE__ */ e(l, { w: "100%", justify: u ? "start" : "center", children: /* @__PURE__ */ e("a", { href: "/", children: /* @__PURE__ */ e(
28
+ D,
30
29
  {
31
- minified: !w,
32
- w: w ? 65 : 24,
30
+ minified: !u,
31
+ w: u ? 65 : 24,
33
32
  isLink: !1
34
33
  }
35
- ) }) }) : /* @__PURE__ */ e(S, { children: /* @__PURE__ */ n(
36
- m,
34
+ ) }) }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ n(
35
+ p,
37
36
  {
38
- opened: j,
39
- onChange: f,
37
+ opened: L,
38
+ onChange: d,
40
39
  position: "right-start",
41
40
  keepMounted: !1,
42
41
  clickOutsideEvents: ["mousedown", "click"],
43
42
  offset: 17,
44
43
  children: [
45
- /* @__PURE__ */ e(m.Target, { children: r ?? /* @__PURE__ */ n(a, { onClick: () => f((g) => !g), children: [
46
- /* @__PURE__ */ e(y, { size: 30, workspace: o }),
47
- /* @__PURE__ */ e(a, { justify: "space-between", align: "center", w: "100%", miw: 0, children: /* @__PURE__ */ e(P, { label: o.workspaceName, children: /* @__PURE__ */ e(d, { size: "md", truncate: !0, children: o?.workspaceName || N("noName") }) }) })
44
+ /* @__PURE__ */ e(p.Target, { children: r ?? /* @__PURE__ */ n(l, { onClick: () => d((w) => !w), children: [
45
+ /* @__PURE__ */ e(S, { size: 30, workspace: o }),
46
+ /* @__PURE__ */ e(l, { justify: "space-between", align: "center", w: "100%", miw: 0, children: /* @__PURE__ */ e(T, { label: o.workspaceName, children: /* @__PURE__ */ e(m, { size: "md", truncate: !0, children: o?.workspaceName || C("noName") }) }) })
48
47
  ] }) }),
49
- /* @__PURE__ */ e(m.Dropdown, { w: 310, children: /* @__PURE__ */ n(p, { gap: 6, children: [
48
+ /* @__PURE__ */ e(p.Dropdown, { w: 310, children: /* @__PURE__ */ n(a, { gap: 6, children: [
50
49
  /* @__PURE__ */ e(
51
- $,
50
+ E,
52
51
  {
53
52
  active: o,
54
- workspaceLink: c,
55
- settingsLink: l,
53
+ workspaceLink: t,
54
+ settingsLink: y,
56
55
  membersLink: x,
57
- canEditWorkspace: I,
58
- onClose: () => f(!1)
56
+ onClose: () => d(!1)
59
57
  }
60
58
  ),
61
- /* @__PURE__ */ e(h, { px: 4, children: /* @__PURE__ */ e(m.Divider, {}) }),
59
+ /* @__PURE__ */ e(f, { px: 4, children: /* @__PURE__ */ e(p.Divider, {}) }),
62
60
  /* @__PURE__ */ e(
63
- E,
61
+ $,
64
62
  {
65
- onCreate: s,
66
- onClick: t,
67
- items: i.filter(
68
- (g) => g.workspaceId !== o?.workspaceId
63
+ onCreate: i,
64
+ onClick: s,
65
+ items: c.filter(
66
+ (w) => w.workspaceId !== o?.workspaceId
69
67
  ),
70
- onClose: () => f(!1)
68
+ onClose: () => d(!1)
71
69
  }
72
70
  )
73
71
  ] }) })
74
72
  ]
75
73
  }
76
74
  ) });
77
- }, $ = ({
75
+ }, E = ({
78
76
  active: r,
79
- workspaceLink: s,
80
- settingsLink: t,
77
+ workspaceLink: i,
78
+ settingsLink: s,
81
79
  membersLink: o,
82
- canEditWorkspace: i,
83
80
  onClose: c
84
81
  }) => {
85
- const { t: l } = u("workspaceMenu");
86
- return /* @__PURE__ */ n(p, { p: 4, pb: 5, gap: 12, children: [
87
- /* @__PURE__ */ n(a, { gap: 12, children: [
88
- /* @__PURE__ */ e(y, { size: 48, workspace: r }),
89
- /* @__PURE__ */ n(p, { gap: 0, miw: 0, children: [
90
- /* @__PURE__ */ e(d, { truncate: !0, size: "md", fw: 500, c: "var(--mantine-color-bright", children: r.workspaceName || l("noName") }),
91
- /* @__PURE__ */ e(d, { c: "gray", size: "sm", fw: 500, component: "span", children: /* @__PURE__ */ n(a, { gap: 8, component: "span", children: [
92
- r.totalMembers ? /* @__PURE__ */ n(S, { children: [
93
- l("member", { count: r.totalMembers }),
82
+ const { t } = h("workspaceMenu");
83
+ return /* @__PURE__ */ n(a, { p: 4, pb: 5, gap: 12, children: [
84
+ /* @__PURE__ */ n(l, { gap: 12, children: [
85
+ /* @__PURE__ */ e(S, { size: 48, workspace: r }),
86
+ /* @__PURE__ */ n(a, { gap: 0, miw: 0, children: [
87
+ /* @__PURE__ */ e(m, { truncate: !0, size: "md", fw: 500, c: "var(--mantine-color-bright)", children: r.workspaceName || t("noName") }),
88
+ /* @__PURE__ */ e(m, { c: "gray", size: "sm", fw: 500, component: "span", children: /* @__PURE__ */ n(l, { gap: 8, component: "span", children: [
89
+ r.totalMembers ? /* @__PURE__ */ n(M, { children: [
90
+ t("member", { count: r.totalMembers }),
94
91
  /* @__PURE__ */ e(
95
- h,
92
+ f,
96
93
  {
97
94
  w: 2,
98
95
  h: 2,
@@ -102,73 +99,73 @@ const oe = ({
102
99
  }
103
100
  )
104
101
  ] }) : null,
105
- l(`plans.${r.plan}`)
102
+ t(`plans.${r.plan}`)
106
103
  ] }) })
107
104
  ] })
108
105
  ] }),
109
- /* @__PURE__ */ e(q, { active: r }),
110
- /* @__PURE__ */ n(a, { children: [
106
+ /* @__PURE__ */ e(H, { active: r }),
107
+ /* @__PURE__ */ n(l, { children: [
111
108
  /* @__PURE__ */ e(
112
- b,
109
+ k,
113
110
  {
114
111
  flex: 1,
115
- component: z,
112
+ component: b,
116
113
  variant: "default",
117
114
  size: "sm",
118
- leftSection: /* @__PURE__ */ e(k, { size: 16, icon: L }),
119
- to: i ? s ?? "" : t ?? "",
115
+ leftSection: /* @__PURE__ */ e(g, { size: 16, icon: j }),
116
+ to: i ?? s ?? "",
120
117
  onClick: c,
121
- children: l("settings")
118
+ children: t("settings")
122
119
  }
123
120
  ),
124
121
  /* @__PURE__ */ e(
125
- b,
122
+ k,
126
123
  {
127
124
  flex: 1,
128
- component: z,
125
+ component: b,
129
126
  variant: "default",
130
127
  size: "sm",
131
- leftSection: /* @__PURE__ */ e(k, { size: 16, icon: K }),
128
+ leftSection: /* @__PURE__ */ e(g, { size: 16, icon: A }),
132
129
  to: o ?? "",
133
130
  onClick: c,
134
- children: l("members")
131
+ children: t("members")
135
132
  }
136
133
  )
137
134
  ] })
138
135
  ] });
139
- }, q = ({
136
+ }, H = ({
140
137
  active: r
141
138
  }) => {
142
- const { t: s } = u("workspaceMenu"), t = (r?.storageUsedKb || 0) / (r?.storageLimitKb || 1), o = O.formatPercents(t);
143
- return /* @__PURE__ */ n(p, { gap: 4, w: "100%", children: [
144
- /* @__PURE__ */ n(a, { justify: "space-between", children: [
145
- /* @__PURE__ */ n(d, { size: "sm", fw: 500, children: [
146
- s("usedStorage"),
139
+ const { t: i } = h("workspaceMenu"), s = (r?.storageUsedKb || 0) / (r?.storageLimitKb || 1), o = F.formatPercents(s);
140
+ return /* @__PURE__ */ n(a, { gap: 4, w: "100%", children: [
141
+ /* @__PURE__ */ n(l, { justify: "space-between", children: [
142
+ /* @__PURE__ */ n(m, { size: "sm", fw: 500, children: [
143
+ i("usedStorage"),
147
144
  ": ",
148
145
  o
149
146
  ] }),
150
- /* @__PURE__ */ n(d, { size: "sm", fw: 500, c: "gray", children: [
151
- M(r?.storageUsedKb),
147
+ /* @__PURE__ */ n(m, { size: "sm", fw: 500, c: "gray", children: [
148
+ z(r?.storageUsedKb),
152
149
  " ",
153
- s("of"),
150
+ i("of"),
154
151
  " ",
155
- M(r?.storageLimitKb)
152
+ z(r?.storageLimitKb)
156
153
  ] })
157
154
  ] }),
158
- /* @__PURE__ */ e(B, { h: 4, value: t * 100 })
155
+ /* @__PURE__ */ e(U, { h: 4, value: s * 100 })
159
156
  ] });
160
- }, E = ({
157
+ }, $ = ({
161
158
  onCreate: r,
162
- onClick: s,
163
- items: t,
159
+ onClick: i,
160
+ items: s,
164
161
  onClose: o
165
162
  }) => {
166
- const { t: i } = u("workspaceMenu");
167
- return /* @__PURE__ */ n(p, { gap: 12, children: [
168
- t?.length > 0 && /* @__PURE__ */ n(p, { gap: 6, children: [
169
- /* @__PURE__ */ e(m.Label, { fw: 600, px: 4, py: 5, fz: "sm", children: i("switchWorkspace") }),
170
- /* @__PURE__ */ e(h, { w: "100%", children: /* @__PURE__ */ e(
171
- U.Autosize,
163
+ const { t: c } = h("workspaceMenu");
164
+ return /* @__PURE__ */ n(a, { gap: 12, children: [
165
+ s?.length > 0 && /* @__PURE__ */ n(a, { gap: 6, children: [
166
+ /* @__PURE__ */ e(p.Label, { fw: 600, px: 4, py: 5, fz: "sm", children: c("switchWorkspace") }),
167
+ /* @__PURE__ */ e(f, { w: "100%", children: /* @__PURE__ */ e(
168
+ P.Autosize,
172
169
  {
173
170
  mah: 200,
174
171
  w: "100%",
@@ -180,19 +177,19 @@ const oe = ({
180
177
  minWidth: 0
181
178
  }
182
179
  },
183
- children: /* @__PURE__ */ e(p, { gap: 6, miw: 0, children: t.map((c) => /* @__PURE__ */ e(
184
- H,
180
+ children: /* @__PURE__ */ e(a, { gap: 6, miw: 0, children: s.map((t) => /* @__PURE__ */ e(
181
+ O,
185
182
  {
186
- workspace: c,
187
- onClick: s
183
+ workspace: t,
184
+ onClick: i
188
185
  },
189
- c.workspaceId
186
+ t.workspaceId
190
187
  )) })
191
188
  }
192
189
  ) })
193
190
  ] }),
194
- /* @__PURE__ */ e(h, { p: 4, pt: 0, children: /* @__PURE__ */ e(
195
- b,
191
+ /* @__PURE__ */ e(f, { p: 4, pt: 0, children: /* @__PURE__ */ e(
192
+ k,
196
193
  {
197
194
  fullWidth: !0,
198
195
  variant: "default",
@@ -200,13 +197,13 @@ const oe = ({
200
197
  onClick: () => {
201
198
  r?.(), o?.();
202
199
  },
203
- leftSection: /* @__PURE__ */ e(k, { icon: T, size: 16 }),
204
- children: i("newWorkspace")
200
+ leftSection: /* @__PURE__ */ e(g, { icon: K, size: 16 }),
201
+ children: c("newWorkspace")
205
202
  }
206
203
  ) })
207
204
  ] });
208
205
  };
209
206
  export {
210
- $ as ActiveWorkspace,
211
- oe as WorkspaceMenu
207
+ E as ActiveWorkspace,
208
+ ne as WorkspaceMenu
212
209
  };
@@ -1 +1 @@
1
- {"version":3,"file":"RemoveConfirmModal.d.ts","sourceRoot":"","sources":["../../../src/components/modals/RemoveConfirmModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKlC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,eAAO,MAAM,sBAAsB,GACjC,OAAO,UAAU,CAAC,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG;IACrD,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CACzB,SA+EF,CAAC"}
1
+ {"version":3,"file":"RemoveConfirmModal.d.ts","sourceRoot":"","sources":["../../../src/components/modals/RemoveConfirmModal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKlC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,eAAO,MAAM,sBAAsB,GACjC,OAAO,UAAU,CAAC,OAAO,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,GAAG;IACrD,MAAM,CAAC,EAAE;QACP,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC;CACzB,SAgFF,CAAC"}
@@ -1,31 +1,32 @@
1
- import { jsxs as v, jsx as e } from "react/jsx-runtime";
2
- import { Delete03Icon as w } from "@hugeicons/core-free-icons";
3
- import { HugeiconsIcon as g } from "@hugeicons/react";
4
- import { Stack as C, Text as c } from "@mantine/core";
5
- import { modals as a } from "@mantine/modals";
6
- const P = (s) => {
1
+ import { jsxs as w, jsx as e } from "react/jsx-runtime";
2
+ import { Delete03Icon as g } from "@hugeicons/core-free-icons";
3
+ import { HugeiconsIcon as C } from "@hugeicons/react";
4
+ import { Stack as y, Text as c } from "@mantine/core";
5
+ import { modals as s } from "@mantine/modals";
6
+ const z = (a) => {
7
7
  const {
8
8
  title: m,
9
9
  children: d,
10
10
  onConfirm: o,
11
11
  onClose: p,
12
12
  labels: n,
13
- icon: t = /* @__PURE__ */ e(
14
- g,
13
+ icon: r = /* @__PURE__ */ e(
14
+ C,
15
15
  {
16
16
  size: 20,
17
- icon: w,
17
+ icon: g,
18
18
  color: "var(--mantine-color-red-filled)"
19
19
  }
20
20
  ),
21
- closeOnConfirm: f = !0,
22
- ...u
23
- } = s, h = a.openConfirmModal({
21
+ confirmProps: f,
22
+ closeOnConfirm: u = !0,
23
+ ...h
24
+ } = a, v = s.openConfirmModal({
24
25
  withCloseButton: !1,
25
26
  keepMounted: !1,
26
27
  centered: !0,
27
28
  confirmProps: {
28
- color: "red",
29
+ color: f?.color ?? "red",
29
30
  fullWidth: !0,
30
31
  variant: "filled",
31
32
  size: "sm",
@@ -47,22 +48,22 @@ const P = (s) => {
47
48
  paddingTop: "var(--mantine-spacing-xl)"
48
49
  }
49
50
  },
50
- children: /* @__PURE__ */ v(C, { gap: 0, align: "center", mb: 0, children: [
51
- t && t,
51
+ children: /* @__PURE__ */ w(y, { gap: 0, align: "center", mb: 0, children: [
52
+ r && r,
52
53
  /* @__PURE__ */ e(c, { mt: "xs", fw: "700", ta: "center", children: m }),
53
54
  /* @__PURE__ */ e(c, { mt: 6, size: "sm", c: "gray", ta: "center", children: d })
54
55
  ] }),
55
56
  onConfirm: o,
56
57
  onClose: () => {
57
- window.removeEventListener("keydown", r), p?.();
58
+ window.removeEventListener("keydown", t), p?.();
58
59
  },
59
- ...u
60
- }), r = (i) => {
60
+ ...h
61
+ }), t = (i) => {
61
62
  const l = document.activeElement?.tagName;
62
- l === "TEXTAREA" || l === "INPUT" || i.key === "Enter" && (i.preventDefault(), o?.(), f && a.close(h));
63
+ l === "TEXTAREA" || l === "INPUT" || i.key === "Enter" && (i.preventDefault(), o?.(), u && s.close(v));
63
64
  };
64
- window.addEventListener("keydown", r);
65
+ window.addEventListener("keydown", t);
65
66
  };
66
67
  export {
67
- P as openRemoveConfirmModal
68
+ z as openRemoveConfirmModal
68
69
  };
@@ -22,9 +22,10 @@ export declare const FrontTable: import("react").NamedExoticComponent<unknown> &
22
22
  Provider: <ITEM extends import("./types").TableRowModel>({ children, store, rows, columns, loading, pageSizeOptions, rowHeight, headerHeight, rowCount, exportFileName, pagination, virtualization, searching, selection, sorting, expanding, }: import("react").PropsWithChildren<{
23
23
  store: import("./store").CreateTableReturn;
24
24
  } & import("./types").TableProps<ITEM>>) => import("react/jsx-runtime").JSX.Element;
25
- Menu: import("react").MemoExoticComponent<({ onExport, isLoading, }: {
25
+ Menu: import("react").MemoExoticComponent<({ onExport, isLoading, disabled, }: {
26
26
  onExport?: (format: "csv" | "xlsx") => void;
27
27
  isLoading?: boolean;
28
+ disabled?: boolean;
28
29
  }) => import("react/jsx-runtime").JSX.Element>;
29
30
  };
30
31
  export * from './hooks/useCreateTable';
@@ -1 +1 @@
1
- {"version":3,"file":"FrontTable.d.ts","sourceRoot":"","sources":["../../../src/components/table/FrontTable.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;gBAFyB,CAAC;iBAEP,CAAC;;CASzC,CAAC;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC"}
1
+ {"version":3,"file":"FrontTable.d.ts","sourceRoot":"","sources":["../../../src/components/table/FrontTable.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;gBAAhB,CAAA;iBACA,CAAC;gBACC,CAAA;;CAOP,CAAC;AAEH,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/TableCell.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAEnE,UAAU,cAAc;IACtB,MAAM,EAAE,cAAc,CAAC;IACvB,GAAG,EAAE,aAAa,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,wDAA0B,cAAc,6CA6B5D,CAAC;AAEH,eAAO,MAAM,QAAQ;;;yGAoBpB,CAAC"}
1
+ {"version":3,"file":"TableCell.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/TableCell.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,UAAU,CAAC;AAEnE,UAAU,cAAc;IACtB,MAAM,EAAE,cAAc,CAAC;IACvB,GAAG,EAAE,aAAa,CAAC;CACpB;AAED,eAAO,MAAM,SAAS,wDAA0B,cAAc,6CA8E5D,CAAC;AAEH,eAAO,MAAM,QAAQ;;;yGAoBpB,CAAC"}
@@ -1,27 +1,65 @@
1
- import { jsx as l } from "react/jsx-runtime";
2
- import { memo as f, useMemo as s } from "react";
3
- import o from "@emotion/styled";
4
- import { get as a } from "lodash-es";
5
- import { TABLE_ATTRIBUTES as t } from "../constants.js";
6
- import { getColumnId as n } from "../helpers/columns.js";
7
- const C = f(({ column: e, row: r }) => {
8
- const d = s(() => {
9
- const i = a(r, e.field);
10
- return e.render ? e.render?.(r, i) : typeof i == "object" ? null : i;
11
- }, [e, r]);
12
- return /* @__PURE__ */ l(
13
- p,
1
+ import { jsx as i } from "react/jsx-runtime";
2
+ import { memo as x, useRef as y, useState as L, useMemo as C, useEffect as T } from "react";
3
+ import u from "@emotion/styled";
4
+ import { Tooltip as v } from "@mantine/core";
5
+ import { get as N } from "lodash-es";
6
+ import { TABLE_ATTRIBUTES as r } from "../constants.js";
7
+ import { getColumnId as p } from "../helpers/columns.js";
8
+ const G = x(({ column: e, row: l }) => {
9
+ const o = y(null), [f, d] = L(""), a = C(() => {
10
+ const t = N(l, e.field);
11
+ return e.render ? e.render?.(l, t) : typeof t == "object" ? null : t;
12
+ }, [e, l]);
13
+ T(() => {
14
+ d("");
15
+ }, [a]);
16
+ const m = () => {
17
+ if (!o.current) return;
18
+ const t = o.current, c = t.textContent?.trim() || "";
19
+ if (!c) {
20
+ d("");
21
+ return;
22
+ }
23
+ const h = (n) => {
24
+ if (n.scrollWidth > n.clientWidth)
25
+ return !0;
26
+ for (let s = 0; s < n.children.length; s++)
27
+ if (h(n.children[s]))
28
+ return !0;
29
+ return !1;
30
+ }, g = h(t);
31
+ d(g ? c : "");
32
+ };
33
+ return /* @__PURE__ */ i(
34
+ b,
14
35
  {
15
- [t.COLUMN_ALIGN]: e.align,
16
- [t.CELL]: n(e.field),
36
+ [r.COLUMN_ALIGN]: e.align,
37
+ [r.CELL]: p(e.field),
17
38
  style: {
18
39
  ...e.fullCellStyle,
19
- width: `var(--col-${n(e.field)})`
40
+ width: `var(--col-${p(e.field)})`
20
41
  },
21
- children: /* @__PURE__ */ l(h, { style: e.cellStyle, children: d })
42
+ children: /* @__PURE__ */ i(
43
+ v,
44
+ {
45
+ label: f,
46
+ disabled: !f,
47
+ openDelay: 400,
48
+ withinPortal: !0,
49
+ children: /* @__PURE__ */ i(
50
+ "div",
51
+ {
52
+ ref: o,
53
+ onMouseEnter: m,
54
+ style: { width: "100%", minWidth: 0 },
55
+ children: /* @__PURE__ */ i(M, { style: e.cellStyle, children: a })
56
+ }
57
+ )
58
+ }
59
+ )
22
60
  }
23
61
  );
24
- }), p = o.div`
62
+ }), b = u.div`
25
63
  height: 100%;
26
64
  display: flex;
27
65
  align-items: center;
@@ -32,24 +70,23 @@ const C = f(({ column: e, row: r }) => {
32
70
  border-right: 1px solid
33
71
  light-dark(var(--mantine-color-gray-3), var(--mantine-color-dark-5));
34
72
 
35
- &[${t.COLUMN_ALIGN}='left'] {
73
+ &[${r.COLUMN_ALIGN}='left'] {
36
74
  justify-content: flex-start;
37
75
  }
38
- &[${t.COLUMN_ALIGN}='right'] {
76
+ &[${r.COLUMN_ALIGN}='right'] {
39
77
  justify-content: flex-end;
40
78
  }
41
- &[${t.COLUMN_ALIGN}='center'] {
79
+ &[${r.COLUMN_ALIGN}='center'] {
42
80
  justify-content: center;
43
81
  }
44
- `, h = o.div`
45
- /* height: 100%; */
82
+ `, M = u.div`
46
83
  font-size: 14px;
47
84
  white-space: nowrap;
48
85
  overflow: hidden;
49
86
  text-overflow: ellipsis;
50
- /* width: 100%; */
87
+ width: 100%;
51
88
  `;
52
89
  export {
53
- p as CellRoot,
54
- C as TableCell
90
+ b as CellRoot,
91
+ G as TableCell
55
92
  };
@@ -1,5 +1,6 @@
1
- export declare const TableMenu: import("react").MemoExoticComponent<({ onExport, isLoading, }: {
1
+ export declare const TableMenu: import("react").MemoExoticComponent<({ onExport, isLoading, disabled, }: {
2
2
  onExport?: (format: "csv" | "xlsx") => void;
3
3
  isLoading?: boolean;
4
+ disabled?: boolean;
4
5
  }) => import("react/jsx-runtime").JSX.Element>;
5
6
  //# sourceMappingURL=TableMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/TableMenu.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS,iEAIjB;IACD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,6CA+CF,CAAC"}
1
+ {"version":3,"file":"TableMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/table/components/TableMenu.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,SAAS,2EAKjB;IACD,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,KAAK,GAAG,MAAM,KAAK,IAAI,CAAC;IAC5C,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,6CA+CF,CAAC"}
@@ -1,23 +1,24 @@
1
1
  import { jsxs as n, jsx as e } from "react/jsx-runtime";
2
- import { memo as c } from "react";
3
- import { useTranslation as m } from "react-i18next";
4
- import { Menu as o, Button as s } from "@mantine/core";
5
- import { IconFileDownload as d, IconFileTypeCsv as a, IconFileExcel as f } from "@tabler/icons-react";
6
- import { useTableStore as p } from "../hooks/useTableStore.js";
7
- const T = c(
2
+ import { memo as m } from "react";
3
+ import { useTranslation as s } from "react-i18next";
4
+ import { Menu as o, Button as d } from "@mantine/core";
5
+ import { IconFileDownload as a, IconFileTypeCsv as f, IconFileExcel as p } from "@tabler/icons-react";
6
+ import { useTableStore as u } from "../hooks/useTableStore.js";
7
+ const w = m(
8
8
  ({
9
9
  onExport: i,
10
- isLoading: l
10
+ isLoading: l,
11
+ disabled: c
11
12
  }) => {
12
- const { t: r } = m(), { api: t } = p();
13
+ const { t: r } = s(), { api: t } = u();
13
14
  return /* @__PURE__ */ n(o, { children: [
14
15
  /* @__PURE__ */ e(o.Target, { children: /* @__PURE__ */ e(
15
- s,
16
+ d,
16
17
  {
17
18
  variant: "default",
18
19
  size: "sm",
19
- disabled: l,
20
- leftSection: /* @__PURE__ */ e(d, { size: "1em" }),
20
+ disabled: l || c,
21
+ leftSection: /* @__PURE__ */ e(a, { size: "1em" }),
21
22
  children: r("export")
22
23
  }
23
24
  ) }),
@@ -25,7 +26,7 @@ const T = c(
25
26
  /* @__PURE__ */ e(
26
27
  o.Item,
27
28
  {
28
- leftSection: /* @__PURE__ */ e(a, { size: 20 }),
29
+ leftSection: /* @__PURE__ */ e(f, { size: 20 }),
29
30
  onClick: () => {
30
31
  if (i) {
31
32
  i("csv");
@@ -39,7 +40,7 @@ const T = c(
39
40
  /* @__PURE__ */ e(
40
41
  o.Item,
41
42
  {
42
- leftSection: /* @__PURE__ */ e(f, { size: 20 }),
43
+ leftSection: /* @__PURE__ */ e(p, { size: 20 }),
43
44
  onClick: () => {
44
45
  if (i) {
45
46
  i("xlsx");
@@ -55,5 +56,5 @@ const T = c(
55
56
  }
56
57
  );
57
58
  export {
58
- T as TableMenu
59
+ w as TableMenu
59
60
  };
@@ -1,3 +1,7 @@
1
+ export declare const COLOR_SCHEMES: readonly ["blue", "indigo", "violet", "grape", "green", "orange"];
2
+ export declare const DEFAULT_COLOR_SCHEME: "indigo";
3
+ export type ColorScheme = (typeof COLOR_SCHEMES)[number];
4
+ export declare const isValidColorScheme: (value: string) => value is ColorScheme;
1
5
  export declare const DEFAULT_VALUES: {
2
6
  readonly TASK_TYPE_COLOR: string;
3
7
  readonly TASK_STATUS_COLOR: string;
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;;;;CAc1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,sBAAsB,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,mEAAoE,CAAC;AAC/F,eAAO,MAAM,oBAAoB,EAAG,QAAiB,CAAC;AAEtD,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD,eAAO,MAAM,kBAAkB,GAAI,OAAO,MAAM,KAAG,KAAK,IAAI,WACN,CAAC;AAEvD,eAAO,MAAM,cAAc;;;;;;CAc1B,CAAC;AAEF,eAAO,MAAM,mBAAmB,sBAAsB,CAAC"}
package/dist/constants.js CHANGED
@@ -1,4 +1,4 @@
1
- const O = {
1
+ const O = ["blue", "indigo", "violet", "grape", "green", "orange"], t = "indigo", n = (e) => O.includes(e), r = {
2
2
  get TASK_TYPE_COLOR() {
3
3
  return this.COLORS[1];
4
4
  },
@@ -12,8 +12,11 @@ const O = {
12
12
  return this.COLORS[1];
13
13
  },
14
14
  COLORS: ["gray", "blue", "violet", "cyan", "green", "yellow", "red"]
15
- }, e = "Inter, sans-serif";
15
+ }, L = "Inter, sans-serif";
16
16
  export {
17
- e as DEFAULT_FONT_FAMILY,
18
- O as DEFAULT_VALUES
17
+ O as COLOR_SCHEMES,
18
+ t as DEFAULT_COLOR_SCHEME,
19
+ L as DEFAULT_FONT_FAMILY,
20
+ r as DEFAULT_VALUES,
21
+ n as isValidColorScheme
19
22
  };