@memobit/libs 3.26.4 → 3.28.0
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/components/Banner/Banner2.js +15 -13
- package/dist/components/BoldText/BoldText.js +5 -0
- package/dist/components/Calendar/Calendar2.js +108 -135
- package/dist/components/ColorPicker/ColorPicker.css +1 -1
- package/dist/components/ColorPicker/ColorPicker2.js +114 -114
- package/dist/components/ConfirmDialog/ConfirmDialog2.js +13 -11
- package/dist/components/ConfirmPopover/ConfirmPopover2.js +26 -24
- package/dist/components/ContextMenu/ContextMenu2.js +46 -33
- package/dist/components/ControlPanel/ControlPanel2.js +95 -93
- package/dist/components/ControlPanel/ControlPanelFilter.js +205 -193
- package/dist/components/ControlPanel/ControlPanelOptions.js +190 -185
- package/dist/components/DataView/DataView.CardView.js +83 -81
- package/dist/components/DataView/DataView.ColumnSelector.js +27 -25
- package/dist/components/DataView/DataView.TableView.js +74 -72
- package/dist/components/DataView/DataView2.js +169 -167
- package/dist/components/DatePicker/DatePicker2.js +71 -69
- package/dist/components/Drawer/Drawer2.js +58 -55
- package/dist/components/Dropdown/Dropdown2.js +187 -189
- package/dist/components/InputDate/InputDate2.js +43 -41
- package/dist/components/InputSearch/InputSearch2.js +27 -25
- package/dist/components/MenuBar/MenuBar.css +1 -0
- package/dist/components/MenuBar/MenuBar2.js +46 -0
- package/dist/components/Modal/Modal2.js +49 -47
- package/dist/components/Pagination/Pagination2.js +44 -47
- package/dist/components/ScrollToTop/ScrollToTop2.js +18 -16
- package/dist/components/ThemeSettings/ThemeSettings2.js +131 -123
- package/dist/components/TipsOfTheDay/TipsOfTheDay2.js +16 -12
- package/dist/components/Toast/Toast2.js +38 -33
- package/dist/components/ToolButton/ToolButton.css +1 -0
- package/dist/components/ToolButton/ToolButton2.js +36 -0
- package/dist/components/ToolPalette/ToolPalette.css +1 -0
- package/dist/components/ToolPalette/ToolPalette2.js +83 -0
- package/dist/components/Toolbar/Toolbar2.js +58 -56
- package/dist/contexts/LanguageContext/LanguageContext.context.js +9 -0
- package/dist/contexts/LanguageContext/LanguageContext.js +19 -0
- package/dist/contexts/LanguageContext/libMessages.js +240 -0
- package/dist/helpers/Datetime.js +84 -68
- package/dist/helpers/Language.js +8 -0
- package/dist/helpers/Pagination.js +5 -4
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/hooks/useLanguage.js +16 -0
- package/dist/index.d.ts +133 -6
- package/dist/index.js +417 -399
- package/dist/memobit-icons.json +4 -0
- package/dist/version.js +2 -2
- package/dist/version.json +4 -4
- package/package.json +1 -1
|
@@ -1,58 +1,60 @@
|
|
|
1
|
-
import { Icon as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { Icon as k } from "../Icon/Icon2.js";
|
|
2
|
+
import { libMessages as X } from "../../contexts/LanguageContext/libMessages.js";
|
|
3
|
+
import { useMessages as Y } from "../../hooks/useLanguage.js";
|
|
4
|
+
import { Tooltip as Z } from "../Tooltip/Tooltip2.js";
|
|
5
|
+
import { Checkbox as F } from "../Checkbox/Checkbox2.js";
|
|
6
|
+
import { EmptyState as j } from "../EmptyState/EmptyState2.js";
|
|
7
|
+
import { calculateTimelineMarkers as R } from "../TimelineMarkers/calculateTimelineMarkers.js";
|
|
8
|
+
import { TimelineMobileSeparator as W } from "../TimelineMarkers/TimelineMarkers2.js";
|
|
9
|
+
import { groupMotionKey as ee, renderCellContent as ae, renderColumnLabel as te } from "./DataView.helpers.js";
|
|
10
|
+
import ie, { useMemo as z } from "react";
|
|
11
|
+
import { Fragment as se, jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
12
|
+
var ne = (d) => typeof d == "number" ? `${d}px` : d;
|
|
13
|
+
function fe({ data: d, columns: D, rowKey: V, card: s, actions: b, timeline: l, onRowClick: o, rowHref: E, rowClassName: L, empty: r, selectable: u, selectedIds: q = [], pinnedIds: g, onToggleSelect: _, cardMaxWidth: f, isMobile: B = !1, groups: $, showGroupCount: G = !0, collapsible: v = !1, collapsedGroups: H, onToggleGroup: J }) {
|
|
14
|
+
const N = Y(X), I = D.filter((a) => !a.hideInCard && !(B && a.hideInMobile)), O = z(() => new Set(g ?? []), [g]), M = `data-view__cards${f !== void 0 ? " data-view__cards--grid" : ""}`, K = f !== void 0 ? { "--data-view-card-max-width": ne(f) } : void 0, Q = z(() => {
|
|
13
15
|
if (!l) return /* @__PURE__ */ new Map();
|
|
14
|
-
const
|
|
16
|
+
const a = d.map((i) => ({
|
|
15
17
|
id: l.idAccessor(i),
|
|
16
18
|
date: l.dateAccessor(i)
|
|
17
19
|
}));
|
|
18
|
-
return
|
|
20
|
+
return R(a, l.granularity);
|
|
19
21
|
}, [d, l]);
|
|
20
22
|
if (d.length === 0)
|
|
21
|
-
return r ? /* @__PURE__ */
|
|
23
|
+
return r ? /* @__PURE__ */ e(j, {
|
|
22
24
|
title: r.title,
|
|
23
25
|
description: r.description,
|
|
24
26
|
icon: r.icon,
|
|
25
27
|
primary: r.primary,
|
|
26
28
|
secondary: r.secondary
|
|
27
|
-
}) : /* @__PURE__ */
|
|
28
|
-
const P = (
|
|
29
|
-
const h =
|
|
30
|
-
t.metaKey || t.ctrlKey || t.shiftKey || t.altKey || t.button !== 0 || o && (t.preventDefault(), o(
|
|
31
|
-
},
|
|
32
|
-
p && /* @__PURE__ */
|
|
33
|
-
title:
|
|
34
|
-
children: /* @__PURE__ */
|
|
29
|
+
}) : /* @__PURE__ */ e(j, { title: N.noData });
|
|
30
|
+
const P = (a, i) => {
|
|
31
|
+
const h = Q.get(i), n = V(a, i), m = u && q.includes(n), p = O.has(n), w = E?.(a), T = !!o || !!w, C = s?.accentColor?.(a), x = `data-view__card ${T ? "data-view__card--clickable" : ""} ${m ? "data-view__card--selected" : ""} ${p ? "data-view__card--pinned" : ""} ${C ? "data-view__card--accent" : ""} ${L?.(a) || ""}`, S = C ? { "--data-view-card-accent-color": C } : void 0, U = (t) => {
|
|
32
|
+
t.metaKey || t.ctrlKey || t.shiftKey || t.altKey || t.button !== 0 || o && (t.preventDefault(), o(a, t));
|
|
33
|
+
}, A = /* @__PURE__ */ c(se, { children: [
|
|
34
|
+
p && /* @__PURE__ */ e(Z, {
|
|
35
|
+
title: N.pinned,
|
|
36
|
+
children: /* @__PURE__ */ e("span", {
|
|
35
37
|
className: "data-view__card-pin",
|
|
36
|
-
children: /* @__PURE__ */
|
|
38
|
+
children: /* @__PURE__ */ e(k, {
|
|
37
39
|
name: "pin",
|
|
38
40
|
size: "sm"
|
|
39
41
|
})
|
|
40
42
|
})
|
|
41
43
|
}),
|
|
42
|
-
u && _ && !
|
|
44
|
+
u && _ && !s && /* @__PURE__ */ e("div", {
|
|
43
45
|
className: "data-view__card-select",
|
|
44
46
|
onClick: (t) => t.stopPropagation(),
|
|
45
|
-
children: /* @__PURE__ */
|
|
47
|
+
children: /* @__PURE__ */ e(F, {
|
|
46
48
|
checked: m || !1,
|
|
47
|
-
onChange: (t) => _(
|
|
49
|
+
onChange: (t) => _(n, t)
|
|
48
50
|
})
|
|
49
51
|
}),
|
|
50
|
-
|
|
52
|
+
s?.media && /* @__PURE__ */ e("div", {
|
|
51
53
|
className: "data-view__card-media",
|
|
52
|
-
children:
|
|
54
|
+
children: s.media(a)
|
|
53
55
|
}),
|
|
54
|
-
|
|
55
|
-
const t =
|
|
56
|
+
s && (() => {
|
|
57
|
+
const t = s.icon?.(a);
|
|
56
58
|
return /* @__PURE__ */ c("div", {
|
|
57
59
|
className: "data-view__card-header",
|
|
58
60
|
children: [/* @__PURE__ */ c("div", {
|
|
@@ -60,98 +62,98 @@ function _a({ data: d, columns: z, rowKey: V, card: n, actions: k, timeline: l,
|
|
|
60
62
|
children: [/* @__PURE__ */ c("div", {
|
|
61
63
|
className: "data-view__card-title-line",
|
|
62
64
|
children: [
|
|
63
|
-
u && _ && /* @__PURE__ */
|
|
65
|
+
u && _ && /* @__PURE__ */ e("div", {
|
|
64
66
|
className: "data-view__card-select",
|
|
65
67
|
onClick: (y) => y.stopPropagation(),
|
|
66
|
-
children: /* @__PURE__ */
|
|
68
|
+
children: /* @__PURE__ */ e(F, {
|
|
67
69
|
checked: m || !1,
|
|
68
|
-
onChange: (y) => _(
|
|
70
|
+
onChange: (y) => _(n, y)
|
|
69
71
|
})
|
|
70
72
|
}),
|
|
71
|
-
t && /* @__PURE__ */
|
|
73
|
+
t && /* @__PURE__ */ e(k, {
|
|
72
74
|
className: "data-view__card-icon",
|
|
73
75
|
name: t
|
|
74
76
|
}),
|
|
75
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ e("span", {
|
|
76
78
|
className: "data-view__card-title",
|
|
77
|
-
children:
|
|
79
|
+
children: s.title(a)
|
|
78
80
|
})
|
|
79
81
|
]
|
|
80
|
-
}),
|
|
82
|
+
}), s.subtitle && /* @__PURE__ */ e("span", {
|
|
81
83
|
className: "data-view__card-subtitle",
|
|
82
|
-
children:
|
|
84
|
+
children: s.subtitle(a)
|
|
83
85
|
})]
|
|
84
|
-
}),
|
|
86
|
+
}), s.badges && /* @__PURE__ */ e("div", {
|
|
85
87
|
className: "data-view__card-badges",
|
|
86
|
-
children:
|
|
88
|
+
children: s.badges(a)
|
|
87
89
|
})]
|
|
88
90
|
});
|
|
89
91
|
})(),
|
|
90
|
-
|
|
92
|
+
I.length > 0 && /* @__PURE__ */ e("div", {
|
|
91
93
|
className: "data-view__card-body",
|
|
92
|
-
children:
|
|
94
|
+
children: I.map((t) => /* @__PURE__ */ c("div", {
|
|
93
95
|
className: "data-view__card-field",
|
|
94
|
-
children: [/* @__PURE__ */
|
|
96
|
+
children: [/* @__PURE__ */ e("span", {
|
|
95
97
|
className: "data-view__card-label",
|
|
96
|
-
children:
|
|
97
|
-
}), /* @__PURE__ */
|
|
98
|
+
children: te(t)
|
|
99
|
+
}), /* @__PURE__ */ e("span", {
|
|
98
100
|
className: "data-view__card-value",
|
|
99
|
-
children:
|
|
101
|
+
children: ae(t, a)
|
|
100
102
|
})]
|
|
101
103
|
}, t.key))
|
|
102
104
|
}),
|
|
103
|
-
|
|
105
|
+
b && /* @__PURE__ */ e("div", {
|
|
104
106
|
className: "data-view__card-actions",
|
|
105
107
|
onClick: (t) => t.stopPropagation(),
|
|
106
|
-
children:
|
|
108
|
+
children: b(a)
|
|
107
109
|
})
|
|
108
110
|
] });
|
|
109
|
-
return /* @__PURE__ */ c(
|
|
111
|
+
return /* @__PURE__ */ c(ie.Fragment, { children: [h && /* @__PURE__ */ e(W, { marker: h }), w ? /* @__PURE__ */ e("a", {
|
|
110
112
|
className: x,
|
|
111
|
-
"data-motion-key":
|
|
112
|
-
href:
|
|
113
|
-
style:
|
|
114
|
-
onClick:
|
|
115
|
-
children:
|
|
116
|
-
}) : /* @__PURE__ */
|
|
113
|
+
"data-motion-key": n,
|
|
114
|
+
href: w,
|
|
115
|
+
style: S,
|
|
116
|
+
onClick: U,
|
|
117
|
+
children: A
|
|
118
|
+
}) : /* @__PURE__ */ e("div", {
|
|
117
119
|
className: x,
|
|
118
|
-
"data-motion-key":
|
|
119
|
-
style:
|
|
120
|
-
onClick: o ? (t) => o(
|
|
121
|
-
children:
|
|
122
|
-
})] },
|
|
120
|
+
"data-motion-key": n,
|
|
121
|
+
style: S,
|
|
122
|
+
onClick: o ? (t) => o(a, t) : void 0,
|
|
123
|
+
children: A
|
|
124
|
+
})] }, n);
|
|
123
125
|
};
|
|
124
|
-
if (
|
|
125
|
-
let
|
|
126
|
-
return /* @__PURE__ */
|
|
126
|
+
if ($) {
|
|
127
|
+
let a = 0;
|
|
128
|
+
return /* @__PURE__ */ e("div", {
|
|
127
129
|
className: "data-view__groups",
|
|
128
|
-
children:
|
|
129
|
-
const h =
|
|
130
|
-
|
|
131
|
-
const
|
|
130
|
+
children: $.map((i) => {
|
|
131
|
+
const h = a;
|
|
132
|
+
a += i.items.length;
|
|
133
|
+
const n = v && H?.has(i.key);
|
|
132
134
|
return /* @__PURE__ */ c("section", {
|
|
133
135
|
className: "data-view__group",
|
|
134
136
|
children: [/* @__PURE__ */ c("header", {
|
|
135
137
|
className: `data-view__group-header${v ? " data-view__group-header--collapsible" : ""}`,
|
|
136
|
-
"data-motion-key":
|
|
137
|
-
onClick: v ? () =>
|
|
138
|
+
"data-motion-key": ee(i.key),
|
|
139
|
+
onClick: v ? () => J?.(i.key) : void 0,
|
|
138
140
|
children: [
|
|
139
|
-
/* @__PURE__ */
|
|
141
|
+
/* @__PURE__ */ e("span", {
|
|
140
142
|
className: "data-view__group-label",
|
|
141
143
|
children: i.label
|
|
142
144
|
}),
|
|
143
|
-
|
|
145
|
+
G && /* @__PURE__ */ e("span", {
|
|
144
146
|
className: "data-view__group-count",
|
|
145
|
-
children: i.items.length === i.totalCount ? i.totalCount :
|
|
147
|
+
children: i.items.length === i.totalCount ? i.totalCount : N.groupPartCount(i.items.length, i.totalCount)
|
|
146
148
|
}),
|
|
147
|
-
v && /* @__PURE__ */
|
|
149
|
+
v && /* @__PURE__ */ e(k, {
|
|
148
150
|
className: "data-view__group-chevron",
|
|
149
|
-
name:
|
|
151
|
+
name: n ? "caret-down" : "caret-up",
|
|
150
152
|
size: "sm"
|
|
151
153
|
})
|
|
152
154
|
]
|
|
153
|
-
}), !
|
|
154
|
-
className:
|
|
155
|
+
}), !n && /* @__PURE__ */ e("div", {
|
|
156
|
+
className: M,
|
|
155
157
|
style: K,
|
|
156
158
|
children: i.items.map((m, p) => P(m, h + p))
|
|
157
159
|
})]
|
|
@@ -159,12 +161,12 @@ function _a({ data: d, columns: z, rowKey: V, card: n, actions: k, timeline: l,
|
|
|
159
161
|
})
|
|
160
162
|
});
|
|
161
163
|
}
|
|
162
|
-
return /* @__PURE__ */
|
|
163
|
-
className:
|
|
164
|
+
return /* @__PURE__ */ e("div", {
|
|
165
|
+
className: M,
|
|
164
166
|
style: K,
|
|
165
|
-
children: d.map((
|
|
167
|
+
children: d.map((a, i) => P(a, i))
|
|
166
168
|
});
|
|
167
169
|
}
|
|
168
170
|
export {
|
|
169
|
-
|
|
171
|
+
fe as CardView
|
|
170
172
|
};
|
|
@@ -1,47 +1,49 @@
|
|
|
1
|
-
import { Icon as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { Icon as p } from "../Icon/Icon2.js";
|
|
2
|
+
import { libMessages as b } from "../../contexts/LanguageContext/libMessages.js";
|
|
3
|
+
import { useMessages as v } from "../../hooks/useLanguage.js";
|
|
4
|
+
import { Button as g } from "../Button/Button2.js";
|
|
5
|
+
import { Checkbox as _ } from "../Checkbox/Checkbox2.js";
|
|
6
|
+
import { Popover as C } from "../Popover/Popover2.js";
|
|
7
|
+
import { useRef as w, useState as k } from "react";
|
|
8
|
+
import { jsx as l, jsxs as n } from "react/jsx-runtime";
|
|
9
|
+
function S({ config: m }) {
|
|
10
|
+
const u = v(b), { options: r, selectedKeys: s, onChange: c, label: d = u.columns } = m, a = w(null), [f, i] = k(!1);
|
|
9
11
|
if (r.length === 0) return null;
|
|
10
|
-
const
|
|
11
|
-
if (
|
|
12
|
-
if (
|
|
13
|
-
c([...
|
|
14
|
-
} else c(
|
|
12
|
+
const h = (e, t) => {
|
|
13
|
+
if (t) {
|
|
14
|
+
if (s.includes(e)) return;
|
|
15
|
+
c([...s, e]);
|
|
16
|
+
} else c(s.filter((o) => o !== e));
|
|
15
17
|
};
|
|
16
|
-
return /* @__PURE__ */
|
|
18
|
+
return /* @__PURE__ */ n("div", {
|
|
17
19
|
className: "data-view__column-selector",
|
|
18
|
-
children: [/* @__PURE__ */ l(
|
|
20
|
+
children: [/* @__PURE__ */ l(g, {
|
|
19
21
|
ref: a,
|
|
20
22
|
variant: "ghost",
|
|
21
23
|
size: "small",
|
|
22
24
|
icon: "table",
|
|
23
25
|
onClick: () => i((e) => !e),
|
|
24
|
-
children: /* @__PURE__ */
|
|
26
|
+
children: /* @__PURE__ */ n("span", {
|
|
25
27
|
className: "data-view__column-selector-label",
|
|
26
|
-
children: [
|
|
28
|
+
children: [d, /* @__PURE__ */ l(p, {
|
|
27
29
|
name: "caret-down",
|
|
28
30
|
size: "sm"
|
|
29
31
|
})]
|
|
30
32
|
})
|
|
31
|
-
}), /* @__PURE__ */ l(
|
|
32
|
-
visible:
|
|
33
|
+
}), /* @__PURE__ */ l(C, {
|
|
34
|
+
visible: f,
|
|
33
35
|
onClose: () => i(!1),
|
|
34
36
|
anchorEl: a.current,
|
|
35
37
|
placement: "bottom",
|
|
36
38
|
children: /* @__PURE__ */ l("div", {
|
|
37
39
|
className: "data-view__column-selector-list",
|
|
38
40
|
children: r.map((e) => {
|
|
39
|
-
const
|
|
40
|
-
return /* @__PURE__ */
|
|
41
|
+
const t = s.includes(e.key);
|
|
42
|
+
return /* @__PURE__ */ n("label", {
|
|
41
43
|
className: "data-view__column-selector-item",
|
|
42
|
-
children: [/* @__PURE__ */ l(
|
|
43
|
-
checked:
|
|
44
|
-
onChange: (o) =>
|
|
44
|
+
children: [/* @__PURE__ */ l(_, {
|
|
45
|
+
checked: t,
|
|
46
|
+
onChange: (o) => h(e.key, o)
|
|
45
47
|
}), /* @__PURE__ */ l("span", { children: e.label })]
|
|
46
48
|
}, e.key);
|
|
47
49
|
})
|
|
@@ -50,5 +52,5 @@ function j({ config: m }) {
|
|
|
50
52
|
});
|
|
51
53
|
}
|
|
52
54
|
export {
|
|
53
|
-
|
|
55
|
+
S as DataViewColumnSelector
|
|
54
56
|
};
|
|
@@ -1,60 +1,62 @@
|
|
|
1
|
-
import { Icon as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
9
|
-
|
|
1
|
+
import { Icon as u } from "../Icon/Icon2.js";
|
|
2
|
+
import { libMessages as W } from "../../contexts/LanguageContext/libMessages.js";
|
|
3
|
+
import { useMessages as ee } from "../../hooks/useLanguage.js";
|
|
4
|
+
import { Tooltip as ae } from "../Tooltip/Tooltip2.js";
|
|
5
|
+
import { Checkbox as M } from "../Checkbox/Checkbox2.js";
|
|
6
|
+
import { EmptyState as P } from "../EmptyState/EmptyState2.js";
|
|
7
|
+
import { TimelineMarkerDot as te } from "../TimelineMarkers/TimelineMarkers2.js";
|
|
8
|
+
import { detailMotionKey as ie, groupMotionKey as le, renderCellContent as re, renderColumnLabel as ne } from "./DataView.helpers.js";
|
|
9
|
+
import $ from "react";
|
|
10
|
+
import { jsx as e, jsxs as r } from "react/jsx-runtime";
|
|
11
|
+
function oe({ state: o }) {
|
|
10
12
|
return /* @__PURE__ */ e("span", {
|
|
11
13
|
className: `data-view__sort-icon data-view__sort-icon--${o}`,
|
|
12
|
-
children: /* @__PURE__ */ e(
|
|
14
|
+
children: /* @__PURE__ */ e(u, { name: o === "asc" ? "arrow-up" : o === "desc" ? "arrow-down" : "arrow-bidirectional-vertical" })
|
|
13
15
|
});
|
|
14
16
|
}
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
const l = I(a, t), h =
|
|
18
|
-
if (
|
|
19
|
-
window.open(
|
|
17
|
+
function fe({ data: o, columns: w, rowKey: I, columnWidths: s, onResizeStart: K, sortKey: D, sortDirection: j, onToggleSort: z, hasFilters: T, showTimeline: p, timelineMarkers: A, selectable: m, selectedIds: F, allVisibleSelected: R, someVisibleSelected: B, onToggleVisibleSelection: E, onToggleSelect: G, pinnedSet: L, actions: c, actionsWidth: v, onRowClick: b, rowHref: O, rowClassName: V, rowDetail: q, empty: d, groups: g, group: _, collapsedGroups: H, onToggleGroup: J }) {
|
|
18
|
+
const k = ee(W), N = w.length + (p ? 1 : 0) + (m ? 1 : 0) + (c ? 1 : 0), Q = _?.showCount !== !1, x = (a, t) => {
|
|
19
|
+
const l = I(a, t), h = F.includes(l), f = L.has(l), y = A.get(t), n = O?.(a), S = !!b || !!n, X = (i) => {
|
|
20
|
+
if (n && (i.metaKey || i.ctrlKey || i.shiftKey)) {
|
|
21
|
+
window.open(n, "_blank", "noopener,noreferrer");
|
|
20
22
|
return;
|
|
21
23
|
}
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
+
if (b) {
|
|
25
|
+
b(a, i);
|
|
24
26
|
return;
|
|
25
27
|
}
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
i.button !== 1 || !
|
|
29
|
-
},
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
className: `${h ? "is-selected" : ""} ${
|
|
28
|
+
n && window.location.assign(n);
|
|
29
|
+
}, Y = (i) => {
|
|
30
|
+
i.button !== 1 || !n || (i.preventDefault(), window.open(n, "_blank", "noopener,noreferrer"));
|
|
31
|
+
}, C = q?.(a);
|
|
32
|
+
return /* @__PURE__ */ r($.Fragment, { children: [/* @__PURE__ */ r("tr", {
|
|
33
|
+
className: `${h ? "is-selected" : ""} ${S ? "data-view__row--clickable" : ""} ${f ? "data-view__row--pinned" : ""} ${V?.(a) || ""}`,
|
|
32
34
|
"data-motion-key": l,
|
|
33
|
-
onClick:
|
|
34
|
-
onAuxClick:
|
|
35
|
+
onClick: S ? X : void 0,
|
|
36
|
+
onAuxClick: n ? Y : void 0,
|
|
35
37
|
children: [
|
|
36
38
|
p && /* @__PURE__ */ e("td", {
|
|
37
39
|
className: "data-view__timeline-cell",
|
|
38
|
-
children:
|
|
40
|
+
children: y && /* @__PURE__ */ e(te, { marker: y })
|
|
39
41
|
}),
|
|
40
42
|
m && /* @__PURE__ */ e("td", {
|
|
41
43
|
className: "data-view__checkbox",
|
|
42
44
|
onClick: (i) => i.stopPropagation(),
|
|
43
|
-
children: /* @__PURE__ */ e(
|
|
45
|
+
children: /* @__PURE__ */ e(M, {
|
|
44
46
|
checked: h,
|
|
45
|
-
onChange: (i) =>
|
|
47
|
+
onChange: (i) => G(l, i)
|
|
46
48
|
})
|
|
47
49
|
}),
|
|
48
|
-
w.map((i,
|
|
49
|
-
style:
|
|
50
|
-
children: [
|
|
51
|
-
title:
|
|
52
|
-
children: /* @__PURE__ */ e(
|
|
50
|
+
w.map((i, Z) => /* @__PURE__ */ r("td", {
|
|
51
|
+
style: s[i.key] ? { width: s[i.key] } : void 0,
|
|
52
|
+
children: [Z === 0 && f && /* @__PURE__ */ e(ae, {
|
|
53
|
+
title: k.pinned,
|
|
54
|
+
children: /* @__PURE__ */ e(u, {
|
|
53
55
|
className: "data-view__pin-indicator",
|
|
54
56
|
name: "pin",
|
|
55
57
|
size: "sm"
|
|
56
58
|
})
|
|
57
|
-
}),
|
|
59
|
+
}), re(i, a)]
|
|
58
60
|
}, i.key)),
|
|
59
61
|
c && /* @__PURE__ */ e("td", {
|
|
60
62
|
className: "data-view__actions-cell",
|
|
@@ -66,80 +68,80 @@ function we({ data: o, columns: w, rowKey: I, columnWidths: d, onResizeStart: K,
|
|
|
66
68
|
})
|
|
67
69
|
})
|
|
68
70
|
]
|
|
69
|
-
}),
|
|
71
|
+
}), C != null && C !== !1 && /* @__PURE__ */ e("tr", {
|
|
70
72
|
className: "data-view__row-detail",
|
|
71
|
-
"data-motion-key":
|
|
73
|
+
"data-motion-key": ie(l),
|
|
72
74
|
children: /* @__PURE__ */ e("td", {
|
|
73
|
-
colSpan:
|
|
75
|
+
colSpan: N,
|
|
74
76
|
onClick: (i) => i.stopPropagation(),
|
|
75
|
-
children:
|
|
77
|
+
children: C
|
|
76
78
|
})
|
|
77
79
|
})] }, l);
|
|
78
|
-
},
|
|
80
|
+
}, U = () => {
|
|
79
81
|
if (o.length === 0) return /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", {
|
|
80
|
-
colSpan:
|
|
82
|
+
colSpan: N,
|
|
81
83
|
className: "data-view__empty",
|
|
82
|
-
children:
|
|
83
|
-
title:
|
|
84
|
-
description:
|
|
85
|
-
icon:
|
|
86
|
-
primary:
|
|
87
|
-
secondary:
|
|
88
|
-
}) : /* @__PURE__ */ e(
|
|
84
|
+
children: d ? /* @__PURE__ */ e(P, {
|
|
85
|
+
title: d.title,
|
|
86
|
+
description: d.description,
|
|
87
|
+
icon: d.icon,
|
|
88
|
+
primary: d.primary,
|
|
89
|
+
secondary: d.secondary
|
|
90
|
+
}) : /* @__PURE__ */ e(P, { title: k.noData })
|
|
89
91
|
}) });
|
|
90
|
-
if (
|
|
92
|
+
if (g) {
|
|
91
93
|
let a = 0;
|
|
92
|
-
return
|
|
94
|
+
return g.map((t) => {
|
|
93
95
|
const l = a;
|
|
94
96
|
a += t.items.length;
|
|
95
|
-
const h = _?.collapsible &&
|
|
96
|
-
return /* @__PURE__ */
|
|
97
|
+
const h = _?.collapsible && H.has(t.key);
|
|
98
|
+
return /* @__PURE__ */ r($.Fragment, { children: [/* @__PURE__ */ e("tr", {
|
|
97
99
|
className: `data-view__group-row${_?.collapsible ? " data-view__group-row--collapsible" : ""}`,
|
|
98
|
-
"data-motion-key":
|
|
99
|
-
onClick: _?.collapsible ? () =>
|
|
100
|
-
children: /* @__PURE__ */
|
|
101
|
-
colSpan:
|
|
100
|
+
"data-motion-key": le(t.key),
|
|
101
|
+
onClick: _?.collapsible ? () => J(t.key) : void 0,
|
|
102
|
+
children: /* @__PURE__ */ r("td", {
|
|
103
|
+
colSpan: N,
|
|
102
104
|
className: "data-view__group-cell",
|
|
103
105
|
children: [
|
|
104
106
|
/* @__PURE__ */ e("span", {
|
|
105
107
|
className: "data-view__group-label",
|
|
106
108
|
children: t.label
|
|
107
109
|
}),
|
|
108
|
-
|
|
110
|
+
Q && /* @__PURE__ */ e("span", {
|
|
109
111
|
className: "data-view__group-count",
|
|
110
|
-
children: t.items.length === t.totalCount ? t.totalCount :
|
|
112
|
+
children: t.items.length === t.totalCount ? t.totalCount : k.groupPartCount(t.items.length, t.totalCount)
|
|
111
113
|
}),
|
|
112
|
-
_?.collapsible && /* @__PURE__ */ e(
|
|
114
|
+
_?.collapsible && /* @__PURE__ */ e(u, {
|
|
113
115
|
className: "data-view__group-chevron",
|
|
114
116
|
name: h ? "caret-down" : "caret-up",
|
|
115
117
|
size: "sm"
|
|
116
118
|
})
|
|
117
119
|
]
|
|
118
120
|
})
|
|
119
|
-
}), !h && t.items.map((
|
|
121
|
+
}), !h && t.items.map((f, y) => x(f, l + y))] }, t.key ?? "__null__");
|
|
120
122
|
});
|
|
121
123
|
}
|
|
122
124
|
return o.map((a, t) => x(a, t));
|
|
123
125
|
};
|
|
124
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ r("table", { children: [/* @__PURE__ */ r("thead", { children: [/* @__PURE__ */ r("tr", { children: [
|
|
125
127
|
p && /* @__PURE__ */ e("th", { className: "data-view__timeline-cell" }),
|
|
126
128
|
m && /* @__PURE__ */ e("th", {
|
|
127
129
|
className: "data-view__checkbox",
|
|
128
|
-
children: /* @__PURE__ */ e(
|
|
129
|
-
checked:
|
|
130
|
-
indeterminate:
|
|
131
|
-
onChange:
|
|
130
|
+
children: /* @__PURE__ */ e(M, {
|
|
131
|
+
checked: R,
|
|
132
|
+
indeterminate: B,
|
|
133
|
+
onChange: E
|
|
132
134
|
})
|
|
133
135
|
}),
|
|
134
136
|
w.map((a) => {
|
|
135
137
|
const t = {};
|
|
136
|
-
return
|
|
138
|
+
return s[a.key] && (t.width = s[a.key]), a.minWidth && (t.minWidth = a.minWidth), /* @__PURE__ */ r("th", {
|
|
137
139
|
style: Object.keys(t).length > 0 ? t : void 0,
|
|
138
140
|
className: a.sortable ? "is-sortable" : "",
|
|
139
141
|
onClick: () => z(a),
|
|
140
|
-
children: [/* @__PURE__ */
|
|
142
|
+
children: [/* @__PURE__ */ r("span", {
|
|
141
143
|
className: "data-view__th-content",
|
|
142
|
-
children: [
|
|
144
|
+
children: [ne(a), a.sortable && /* @__PURE__ */ e(oe, { state: D === a.key ? j : "unsorted" })]
|
|
143
145
|
}), /* @__PURE__ */ e("span", {
|
|
144
146
|
className: "data-view__resizer",
|
|
145
147
|
onMouseDown: (l) => K(l, a.key),
|
|
@@ -150,22 +152,22 @@ function we({ data: o, columns: w, rowKey: I, columnWidths: d, onResizeStart: K,
|
|
|
150
152
|
c && /* @__PURE__ */ e("th", {
|
|
151
153
|
className: "data-view__actions-header",
|
|
152
154
|
style: v ? { width: v } : void 0,
|
|
153
|
-
children:
|
|
155
|
+
children: k.actions
|
|
154
156
|
})
|
|
155
|
-
] }),
|
|
157
|
+
] }), T && /* @__PURE__ */ r("tr", {
|
|
156
158
|
className: "data-view__filter-row",
|
|
157
159
|
children: [
|
|
158
160
|
p && /* @__PURE__ */ e("td", { className: "data-view__filter-cell data-view__filter-cell--spacer" }),
|
|
159
161
|
m && /* @__PURE__ */ e("td", { className: "data-view__filter-cell data-view__filter-cell--spacer" }),
|
|
160
162
|
w.map((a) => /* @__PURE__ */ e("td", {
|
|
161
163
|
className: "data-view__filter-cell",
|
|
162
|
-
style:
|
|
164
|
+
style: s[a.key] ? { width: s[a.key] } : void 0,
|
|
163
165
|
children: a.filter ?? null
|
|
164
166
|
}, a.key)),
|
|
165
167
|
c && /* @__PURE__ */ e("td", { className: "data-view__filter-cell data-view__filter-cell--spacer" })
|
|
166
168
|
]
|
|
167
|
-
})] }), /* @__PURE__ */ e("tbody", { children:
|
|
169
|
+
})] }), /* @__PURE__ */ e("tbody", { children: U() })] });
|
|
168
170
|
}
|
|
169
171
|
export {
|
|
170
|
-
|
|
172
|
+
fe as TableView
|
|
171
173
|
};
|