@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.
- package/dist/assets/svg/group_default_icon.svg.js +4 -0
- package/dist/components/AppContainer/AppContainer.d.ts +1 -1
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +31 -23
- package/dist/components/AppContainer/hooks/useAppContainerStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerStore.js +30 -20
- package/dist/components/AppContainer/types.d.ts +1 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
- package/dist/components/CommentComposer/CommentEditorHotkeys.js +25 -22
- package/dist/components/CommentComposer/index.d.ts.map +1 -1
- package/dist/components/CommentComposer/index.js +237 -153
- package/dist/components/CommentComposer/{useFloatingPosition.d.ts → useVirtualAnchor.d.ts} +3 -4
- package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -0
- package/dist/components/CommentComposer/useVirtualAnchor.js +71 -0
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +50 -49
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +79 -78
- package/dist/components/FilePicker/FilePicker.d.ts +2 -3
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +88 -122
- package/dist/components/FilePicker/FilePickerGiphy.d.ts +1 -3
- package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerGiphy.js +43 -44
- package/dist/components/FilePicker/FilePickerLink.d.ts +2 -3
- package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerLink.js +21 -21
- package/dist/components/FilePicker/FilePickerUnsplash.d.ts +1 -3
- package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUnsplash.js +45 -46
- package/dist/components/FilePicker/FilePickerUpload.d.ts +3 -3
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +49 -43
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +5 -5
- package/dist/components/GroupAvatar/index.d.ts +9 -0
- package/dist/components/GroupAvatar/index.d.ts.map +1 -0
- package/dist/components/GroupAvatar/index.js +24 -0
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +6 -5
- package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts +2 -2
- package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceMenu.js +100 -103
- package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
- package/dist/components/modals/RemoveConfirmModal.js +22 -21
- package/dist/components/table/FrontTable.d.ts +2 -1
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/components/TableCell.d.ts.map +1 -1
- package/dist/components/table/components/TableCell.js +63 -26
- package/dist/components/table/components/TableMenu.d.ts +2 -1
- package/dist/components/table/components/TableMenu.d.ts.map +1 -1
- package/dist/components/table/components/TableMenu.js +15 -14
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +7 -4
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +390 -384
- package/dist/lang/locales/ui_en.json.js +20 -12
- package/dist/lang/locales/ui_es.json.js +18 -10
- package/dist/lang/locales/ui_ru.json.js +24 -16
- package/dist/store/accessOptionsControl.d.ts +11 -1
- package/dist/store/accessOptionsControl.d.ts.map +1 -1
- package/dist/store/accessOptionsControl.js +15 -7
- package/package.json +1 -1
- package/dist/components/CommentComposer/useFloatingPosition.d.ts.map +0 -1
- package/dist/components/CommentComposer/useFloatingPosition.js +0 -115
|
@@ -1,98 +1,95 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { Link as
|
|
5
|
-
import { Setting07Icon as
|
|
6
|
-
import { HugeiconsIcon as
|
|
7
|
-
import { Flex as
|
|
8
|
-
import { useMenu as
|
|
9
|
-
import { formatStorage as
|
|
10
|
-
import { Logotype as
|
|
11
|
-
import { WorkspaceAvatar as
|
|
12
|
-
import { Numbers as
|
|
13
|
-
import { WorkspaceItem as
|
|
14
|
-
const
|
|
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:
|
|
17
|
-
onClick:
|
|
16
|
+
onCreate: i,
|
|
17
|
+
onClick: s,
|
|
18
18
|
active: o,
|
|
19
|
-
items:
|
|
20
|
-
workspaceLink:
|
|
21
|
-
settingsLink:
|
|
19
|
+
items: c,
|
|
20
|
+
workspaceLink: t,
|
|
21
|
+
settingsLink: y,
|
|
22
22
|
membersLink: x,
|
|
23
|
-
|
|
24
|
-
isAnonym: C,
|
|
23
|
+
isAnonym: I,
|
|
25
24
|
publicMode: W
|
|
26
25
|
}) => {
|
|
27
|
-
const { t:
|
|
28
|
-
return
|
|
29
|
-
|
|
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: !
|
|
32
|
-
w:
|
|
30
|
+
minified: !u,
|
|
31
|
+
w: u ? 65 : 24,
|
|
33
32
|
isLink: !1
|
|
34
33
|
}
|
|
35
|
-
) }) }) : /* @__PURE__ */ e(
|
|
36
|
-
|
|
34
|
+
) }) }) : /* @__PURE__ */ e(M, { children: /* @__PURE__ */ n(
|
|
35
|
+
p,
|
|
37
36
|
{
|
|
38
|
-
opened:
|
|
39
|
-
onChange:
|
|
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(
|
|
46
|
-
/* @__PURE__ */ e(
|
|
47
|
-
/* @__PURE__ */ e(
|
|
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(
|
|
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:
|
|
55
|
-
settingsLink:
|
|
53
|
+
workspaceLink: t,
|
|
54
|
+
settingsLink: y,
|
|
56
55
|
membersLink: x,
|
|
57
|
-
|
|
58
|
-
onClose: () => f(!1)
|
|
56
|
+
onClose: () => d(!1)
|
|
59
57
|
}
|
|
60
58
|
),
|
|
61
|
-
/* @__PURE__ */ e(
|
|
59
|
+
/* @__PURE__ */ e(f, { px: 4, children: /* @__PURE__ */ e(p.Divider, {}) }),
|
|
62
60
|
/* @__PURE__ */ e(
|
|
63
|
-
|
|
61
|
+
$,
|
|
64
62
|
{
|
|
65
|
-
onCreate:
|
|
66
|
-
onClick:
|
|
67
|
-
items:
|
|
68
|
-
(
|
|
63
|
+
onCreate: i,
|
|
64
|
+
onClick: s,
|
|
65
|
+
items: c.filter(
|
|
66
|
+
(w) => w.workspaceId !== o?.workspaceId
|
|
69
67
|
),
|
|
70
|
-
onClose: () =>
|
|
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:
|
|
80
|
-
settingsLink:
|
|
77
|
+
workspaceLink: i,
|
|
78
|
+
settingsLink: s,
|
|
81
79
|
membersLink: o,
|
|
82
|
-
canEditWorkspace: i,
|
|
83
80
|
onClose: c
|
|
84
81
|
}) => {
|
|
85
|
-
const { t
|
|
86
|
-
return /* @__PURE__ */ n(
|
|
87
|
-
/* @__PURE__ */ n(
|
|
88
|
-
/* @__PURE__ */ e(
|
|
89
|
-
/* @__PURE__ */ n(
|
|
90
|
-
/* @__PURE__ */ e(
|
|
91
|
-
/* @__PURE__ */ e(
|
|
92
|
-
r.totalMembers ? /* @__PURE__ */ n(
|
|
93
|
-
|
|
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
|
-
|
|
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
|
-
|
|
102
|
+
t(`plans.${r.plan}`)
|
|
106
103
|
] }) })
|
|
107
104
|
] })
|
|
108
105
|
] }),
|
|
109
|
-
/* @__PURE__ */ e(
|
|
110
|
-
/* @__PURE__ */ n(
|
|
106
|
+
/* @__PURE__ */ e(H, { active: r }),
|
|
107
|
+
/* @__PURE__ */ n(l, { children: [
|
|
111
108
|
/* @__PURE__ */ e(
|
|
112
|
-
|
|
109
|
+
k,
|
|
113
110
|
{
|
|
114
111
|
flex: 1,
|
|
115
|
-
component:
|
|
112
|
+
component: b,
|
|
116
113
|
variant: "default",
|
|
117
114
|
size: "sm",
|
|
118
|
-
leftSection: /* @__PURE__ */ e(
|
|
119
|
-
to: i
|
|
115
|
+
leftSection: /* @__PURE__ */ e(g, { size: 16, icon: j }),
|
|
116
|
+
to: i ?? s ?? "",
|
|
120
117
|
onClick: c,
|
|
121
|
-
children:
|
|
118
|
+
children: t("settings")
|
|
122
119
|
}
|
|
123
120
|
),
|
|
124
121
|
/* @__PURE__ */ e(
|
|
125
|
-
|
|
122
|
+
k,
|
|
126
123
|
{
|
|
127
124
|
flex: 1,
|
|
128
|
-
component:
|
|
125
|
+
component: b,
|
|
129
126
|
variant: "default",
|
|
130
127
|
size: "sm",
|
|
131
|
-
leftSection: /* @__PURE__ */ e(
|
|
128
|
+
leftSection: /* @__PURE__ */ e(g, { size: 16, icon: A }),
|
|
132
129
|
to: o ?? "",
|
|
133
130
|
onClick: c,
|
|
134
|
-
children:
|
|
131
|
+
children: t("members")
|
|
135
132
|
}
|
|
136
133
|
)
|
|
137
134
|
] })
|
|
138
135
|
] });
|
|
139
|
-
},
|
|
136
|
+
}, H = ({
|
|
140
137
|
active: r
|
|
141
138
|
}) => {
|
|
142
|
-
const { t:
|
|
143
|
-
return /* @__PURE__ */ n(
|
|
144
|
-
/* @__PURE__ */ n(
|
|
145
|
-
/* @__PURE__ */ n(
|
|
146
|
-
|
|
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(
|
|
151
|
-
|
|
147
|
+
/* @__PURE__ */ n(m, { size: "sm", fw: 500, c: "gray", children: [
|
|
148
|
+
z(r?.storageUsedKb),
|
|
152
149
|
" ",
|
|
153
|
-
|
|
150
|
+
i("of"),
|
|
154
151
|
" ",
|
|
155
|
-
|
|
152
|
+
z(r?.storageLimitKb)
|
|
156
153
|
] })
|
|
157
154
|
] }),
|
|
158
|
-
/* @__PURE__ */ e(
|
|
155
|
+
/* @__PURE__ */ e(U, { h: 4, value: s * 100 })
|
|
159
156
|
] });
|
|
160
|
-
},
|
|
157
|
+
}, $ = ({
|
|
161
158
|
onCreate: r,
|
|
162
|
-
onClick:
|
|
163
|
-
items:
|
|
159
|
+
onClick: i,
|
|
160
|
+
items: s,
|
|
164
161
|
onClose: o
|
|
165
162
|
}) => {
|
|
166
|
-
const { t:
|
|
167
|
-
return /* @__PURE__ */ n(
|
|
168
|
-
|
|
169
|
-
/* @__PURE__ */ e(
|
|
170
|
-
/* @__PURE__ */ e(
|
|
171
|
-
|
|
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(
|
|
184
|
-
|
|
180
|
+
children: /* @__PURE__ */ e(a, { gap: 6, miw: 0, children: s.map((t) => /* @__PURE__ */ e(
|
|
181
|
+
O,
|
|
185
182
|
{
|
|
186
|
-
workspace:
|
|
187
|
-
onClick:
|
|
183
|
+
workspace: t,
|
|
184
|
+
onClick: i
|
|
188
185
|
},
|
|
189
|
-
|
|
186
|
+
t.workspaceId
|
|
190
187
|
)) })
|
|
191
188
|
}
|
|
192
189
|
) })
|
|
193
190
|
] }),
|
|
194
|
-
/* @__PURE__ */ e(
|
|
195
|
-
|
|
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(
|
|
204
|
-
children:
|
|
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
|
-
|
|
211
|
-
|
|
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,
|
|
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
|
|
2
|
-
import { Delete03Icon as
|
|
3
|
-
import { HugeiconsIcon as
|
|
4
|
-
import { Stack as
|
|
5
|
-
import { modals as
|
|
6
|
-
const
|
|
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:
|
|
14
|
-
|
|
13
|
+
icon: r = /* @__PURE__ */ e(
|
|
14
|
+
C,
|
|
15
15
|
{
|
|
16
16
|
size: 20,
|
|
17
|
-
icon:
|
|
17
|
+
icon: g,
|
|
18
18
|
color: "var(--mantine-color-red-filled)"
|
|
19
19
|
}
|
|
20
20
|
),
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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__ */
|
|
51
|
-
|
|
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",
|
|
58
|
+
window.removeEventListener("keydown", t), p?.();
|
|
58
59
|
},
|
|
59
|
-
...
|
|
60
|
-
}),
|
|
60
|
+
...h
|
|
61
|
+
}), t = (i) => {
|
|
61
62
|
const l = document.activeElement?.tagName;
|
|
62
|
-
l === "TEXTAREA" || l === "INPUT" || i.key === "Enter" && (i.preventDefault(), o?.(),
|
|
63
|
+
l === "TEXTAREA" || l === "INPUT" || i.key === "Enter" && (i.preventDefault(), o?.(), u && s.close(v));
|
|
63
64
|
};
|
|
64
|
-
window.addEventListener("keydown",
|
|
65
|
+
window.addEventListener("keydown", t);
|
|
65
66
|
};
|
|
66
67
|
export {
|
|
67
|
-
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
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":"
|
|
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
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
[
|
|
16
|
-
[
|
|
36
|
+
[r.COLUMN_ALIGN]: e.align,
|
|
37
|
+
[r.CELL]: p(e.field),
|
|
17
38
|
style: {
|
|
18
39
|
...e.fullCellStyle,
|
|
19
|
-
width: `var(--col-${
|
|
40
|
+
width: `var(--col-${p(e.field)})`
|
|
20
41
|
},
|
|
21
|
-
children: /* @__PURE__ */
|
|
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
|
-
}),
|
|
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
|
-
&[${
|
|
73
|
+
&[${r.COLUMN_ALIGN}='left'] {
|
|
36
74
|
justify-content: flex-start;
|
|
37
75
|
}
|
|
38
|
-
&[${
|
|
76
|
+
&[${r.COLUMN_ALIGN}='right'] {
|
|
39
77
|
justify-content: flex-end;
|
|
40
78
|
}
|
|
41
|
-
&[${
|
|
79
|
+
&[${r.COLUMN_ALIGN}='center'] {
|
|
42
80
|
justify-content: center;
|
|
43
81
|
}
|
|
44
|
-
`,
|
|
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
|
-
|
|
87
|
+
width: 100%;
|
|
51
88
|
`;
|
|
52
89
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
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,
|
|
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
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { Menu as o, Button as
|
|
5
|
-
import { IconFileDownload as
|
|
6
|
-
import { useTableStore as
|
|
7
|
-
const
|
|
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 } =
|
|
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
|
-
|
|
16
|
+
d,
|
|
16
17
|
{
|
|
17
18
|
variant: "default",
|
|
18
19
|
size: "sm",
|
|
19
|
-
disabled: l,
|
|
20
|
-
leftSection: /* @__PURE__ */ e(
|
|
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(
|
|
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(
|
|
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
|
-
|
|
59
|
+
w as TableMenu
|
|
59
60
|
};
|
package/dist/constants.d.ts
CHANGED
|
@@ -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;
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -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
|
-
},
|
|
15
|
+
}, L = "Inter, sans-serif";
|
|
16
16
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
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
|
};
|