@memobit/libs 3.11.1 → 3.11.3
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/Confetti/Confetti2.js +33 -33
- package/dist/components/ContextToast/ContextToast2.js +53 -57
- package/dist/components/ContextToast/useToast.js +12 -0
- package/dist/components/ControlPanel/ControlPanel2.js +41 -43
- package/dist/components/ControlPanel/ControlPanelContext.js +16 -21
- package/dist/components/ControlPanel/useControlPanel.js +11 -0
- package/dist/components/DataView/DataView.CardView.js +83 -109
- package/dist/components/DataView/DataView.MiniSort.js +1 -1
- package/dist/components/DataView/DataView.helpers.js +34 -0
- package/dist/components/DataView/DataView2.js +111 -108
- package/dist/components/Dropdown/Dropdown2.js +108 -106
- package/dist/components/InputEmail/InputEmail2.js +43 -43
- package/dist/components/InputEmail/validateEmail.js +7 -0
- package/dist/components/InputMask/InputMask2.js +40 -54
- package/dist/components/InputMask/InputMaskPresets.js +18 -0
- package/dist/components/Pagination/Pagination2.js +4 -4
- package/dist/components/Sidebar/Sidebar2.js +1 -1
- package/dist/components/Sidebar/SidebarContext.js +18 -23
- package/dist/components/Sidebar/useSidebar.js +11 -0
- package/dist/components/SuggestionsList/SuggestionsList2.js +27 -27
- package/dist/components/TimelineMarkers/TimelineMarkers2.js +31 -49
- package/dist/components/TimelineMarkers/calculateTimelineMarkers.js +28 -0
- package/dist/components/Toolbar/Toolbar2.js +6 -6
- package/dist/components/Tooltip/Tooltip2.js +35 -35
- package/dist/contexts/AuthContext/AuthContext.context.js +5 -0
- package/dist/contexts/AuthContext/AuthContext.js +5 -6
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/hooks/useAppPersistence.js +20 -20
- package/dist/hooks/useAuth/useAuth.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +269 -262
- package/dist/memobit-icons.json +41 -1
- package/dist/version.js +2 -2
- package/dist/version.json +4 -4
- package/package.json +1 -1
|
@@ -1,80 +1,58 @@
|
|
|
1
|
-
import { Icon as
|
|
2
|
-
import { Tooltip as
|
|
3
|
-
import { Checkbox as
|
|
4
|
-
import { EmptyState as
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
children: [t.icon && /* @__PURE__ */ a(v, {
|
|
18
|
-
className: "data-view__column-icon",
|
|
19
|
-
name: t.icon,
|
|
20
|
-
size: "sm",
|
|
21
|
-
variant: "muted"
|
|
22
|
-
}), /* @__PURE__ */ a("span", { children: t.header })]
|
|
23
|
-
}), ea = (t, l) => {
|
|
24
|
-
const h = t.cellIcon?.(l), n = t.accessor ? t.accessor(l) : l[t.key];
|
|
25
|
-
return h ? /* @__PURE__ */ c("span", {
|
|
26
|
-
className: "data-view__cell-with-icon",
|
|
27
|
-
children: [/* @__PURE__ */ a(v, {
|
|
28
|
-
className: "data-view__cell-icon",
|
|
29
|
-
name: h
|
|
30
|
-
}), /* @__PURE__ */ a("span", { children: n })]
|
|
31
|
-
}) : n;
|
|
32
|
-
};
|
|
33
|
-
function _a({ data: t, columns: l, rowKey: h, card: n, actions: g, timeline: o, onRowClick: _, rowHref: j, rowClassName: D, empty: r, selectable: w, selectedIds: V = [], pinnedIds: $, onToggleSelect: p, cardMaxWidth: C, isMobile: G = !1, groups: I, showGroupCount: T = !0, collapsible: N = !1, collapsedGroups: U, onToggleGroup: Z }) {
|
|
34
|
-
const P = l.filter((e) => !e.hideInCard && !(G && e.hideInMobile)), q = M(() => new Set($ ?? []), [$]), S = `data-view__cards${C !== void 0 ? " data-view__cards--grid" : ""}`, A = C !== void 0 ? { "--data-view-card-max-width": W(C) } : void 0, B = M(() => {
|
|
35
|
-
if (!o) return /* @__PURE__ */ new Map();
|
|
36
|
-
const e = t.map((s) => ({
|
|
37
|
-
id: o.idAccessor(s),
|
|
38
|
-
date: o.dateAccessor(s)
|
|
1
|
+
import { Icon as y } from "../Icon/Icon2.js";
|
|
2
|
+
import { Tooltip as U } from "../Tooltip/Tooltip2.js";
|
|
3
|
+
import { Checkbox as F } from "../Checkbox/Checkbox2.js";
|
|
4
|
+
import { EmptyState as M } from "../EmptyState/EmptyState2.js";
|
|
5
|
+
import { calculateTimelineMarkers as X } from "../TimelineMarkers/calculateTimelineMarkers.js";
|
|
6
|
+
import { TimelineMobileSeparator as Y } from "../TimelineMarkers/TimelineMarkers2.js";
|
|
7
|
+
import { renderCellContent as Z, renderColumnLabel as R } from "./DataView.helpers.js";
|
|
8
|
+
import W, { useMemo as j } from "react";
|
|
9
|
+
import { Fragment as aa, jsx as a, jsxs as c } from "react/jsx-runtime";
|
|
10
|
+
var ea = (n) => typeof n == "number" ? `${n}px` : n;
|
|
11
|
+
function ma({ data: n, columns: z, rowKey: V, card: s, actions: b, timeline: l, onRowClick: o, rowHref: D, rowClassName: E, empty: r, selectable: u, selectedIds: L = [], pinnedIds: k, onToggleSelect: _, cardMaxWidth: N, isMobile: q = !1, groups: g, showGroupCount: B = !0, collapsible: v = !1, collapsedGroups: G, onToggleGroup: H }) {
|
|
12
|
+
const $ = z.filter((e) => !e.hideInCard && !(q && e.hideInMobile)), J = j(() => new Set(k ?? []), [k]), I = `data-view__cards${N !== void 0 ? " data-view__cards--grid" : ""}`, P = N !== void 0 ? { "--data-view-card-max-width": ea(N) } : void 0, O = j(() => {
|
|
13
|
+
if (!l) return /* @__PURE__ */ new Map();
|
|
14
|
+
const e = n.map((i) => ({
|
|
15
|
+
id: l.idAccessor(i),
|
|
16
|
+
date: l.dateAccessor(i)
|
|
39
17
|
}));
|
|
40
|
-
return X(e,
|
|
41
|
-
}, [
|
|
42
|
-
if (
|
|
43
|
-
return r ? /* @__PURE__ */ a(
|
|
18
|
+
return X(e, l.granularity);
|
|
19
|
+
}, [n, l]);
|
|
20
|
+
if (n.length === 0)
|
|
21
|
+
return r ? /* @__PURE__ */ a(M, {
|
|
44
22
|
title: r.title,
|
|
45
23
|
description: r.description,
|
|
46
24
|
icon: r.icon,
|
|
47
25
|
primary: r.primary,
|
|
48
26
|
secondary: r.secondary
|
|
49
|
-
}) : /* @__PURE__ */ a(
|
|
50
|
-
const x = (e,
|
|
51
|
-
const
|
|
52
|
-
|
|
53
|
-
},
|
|
54
|
-
|
|
27
|
+
}) : /* @__PURE__ */ a(M, { title: "No data available" });
|
|
28
|
+
const x = (e, i) => {
|
|
29
|
+
const h = O.get(i), d = V(e, i), m = u && L.includes(d), p = J.has(d), f = D?.(e), Q = !!o || !!f, w = s?.accentColor?.(e), K = `data-view__card ${Q ? "data-view__card--clickable" : ""} ${m ? "data-view__card--selected" : ""} ${p ? "data-view__card--pinned" : ""} ${w ? "data-view__card--accent" : ""} ${E?.(e) || ""}`, S = w ? { "--data-view-card-accent-color": w } : void 0, T = (t) => {
|
|
30
|
+
t.metaKey || t.ctrlKey || t.shiftKey || t.altKey || t.button !== 0 || o && (t.preventDefault(), o(e, t));
|
|
31
|
+
}, A = /* @__PURE__ */ c(aa, { children: [
|
|
32
|
+
p && /* @__PURE__ */ a(U, {
|
|
55
33
|
title: "Pinned",
|
|
56
34
|
children: /* @__PURE__ */ a("span", {
|
|
57
35
|
className: "data-view__card-pin",
|
|
58
|
-
children: /* @__PURE__ */ a(
|
|
36
|
+
children: /* @__PURE__ */ a(y, {
|
|
59
37
|
name: "pin",
|
|
60
38
|
size: "sm"
|
|
61
39
|
})
|
|
62
40
|
})
|
|
63
41
|
}),
|
|
64
|
-
|
|
42
|
+
u && _ && !s && /* @__PURE__ */ a("div", {
|
|
65
43
|
className: "data-view__card-select",
|
|
66
|
-
onClick: (
|
|
67
|
-
children: /* @__PURE__ */ a(
|
|
44
|
+
onClick: (t) => t.stopPropagation(),
|
|
45
|
+
children: /* @__PURE__ */ a(F, {
|
|
68
46
|
checked: m || !1,
|
|
69
|
-
onChange: (
|
|
47
|
+
onChange: (t) => _(d, t)
|
|
70
48
|
})
|
|
71
49
|
}),
|
|
72
|
-
|
|
50
|
+
s?.media && /* @__PURE__ */ a("div", {
|
|
73
51
|
className: "data-view__card-media",
|
|
74
|
-
children:
|
|
52
|
+
children: s.media(e)
|
|
75
53
|
}),
|
|
76
|
-
|
|
77
|
-
const
|
|
54
|
+
s && (() => {
|
|
55
|
+
const t = s.icon?.(e);
|
|
78
56
|
return /* @__PURE__ */ c("div", {
|
|
79
57
|
className: "data-view__card-header",
|
|
80
58
|
children: [/* @__PURE__ */ c("div", {
|
|
@@ -82,112 +60,108 @@ function _a({ data: t, columns: l, rowKey: h, card: n, actions: g, timeline: o,
|
|
|
82
60
|
children: [/* @__PURE__ */ c("div", {
|
|
83
61
|
className: "data-view__card-title-line",
|
|
84
62
|
children: [
|
|
85
|
-
|
|
63
|
+
u && _ && /* @__PURE__ */ a("div", {
|
|
86
64
|
className: "data-view__card-select",
|
|
87
|
-
onClick: (
|
|
88
|
-
children: /* @__PURE__ */ a(
|
|
65
|
+
onClick: (C) => C.stopPropagation(),
|
|
66
|
+
children: /* @__PURE__ */ a(F, {
|
|
89
67
|
checked: m || !1,
|
|
90
|
-
onChange: (
|
|
68
|
+
onChange: (C) => _(d, C)
|
|
91
69
|
})
|
|
92
70
|
}),
|
|
93
|
-
|
|
71
|
+
t && /* @__PURE__ */ a(y, {
|
|
94
72
|
className: "data-view__card-icon",
|
|
95
|
-
name:
|
|
73
|
+
name: t
|
|
96
74
|
}),
|
|
97
75
|
/* @__PURE__ */ a("span", {
|
|
98
76
|
className: "data-view__card-title",
|
|
99
|
-
children:
|
|
77
|
+
children: s.title(e)
|
|
100
78
|
})
|
|
101
79
|
]
|
|
102
|
-
}),
|
|
80
|
+
}), s.subtitle && /* @__PURE__ */ a("span", {
|
|
103
81
|
className: "data-view__card-subtitle",
|
|
104
|
-
children:
|
|
82
|
+
children: s.subtitle(e)
|
|
105
83
|
})]
|
|
106
|
-
}),
|
|
84
|
+
}), s.badges && /* @__PURE__ */ a("div", {
|
|
107
85
|
className: "data-view__card-badges",
|
|
108
|
-
children:
|
|
86
|
+
children: s.badges(e)
|
|
109
87
|
})]
|
|
110
88
|
});
|
|
111
89
|
})(),
|
|
112
|
-
|
|
90
|
+
$.length > 0 && /* @__PURE__ */ a("div", {
|
|
113
91
|
className: "data-view__card-body",
|
|
114
|
-
children:
|
|
92
|
+
children: $.map((t) => /* @__PURE__ */ c("div", {
|
|
115
93
|
className: "data-view__card-field",
|
|
116
94
|
children: [/* @__PURE__ */ a("span", {
|
|
117
95
|
className: "data-view__card-label",
|
|
118
|
-
children:
|
|
96
|
+
children: R(t)
|
|
119
97
|
}), /* @__PURE__ */ a("span", {
|
|
120
98
|
className: "data-view__card-value",
|
|
121
|
-
children:
|
|
99
|
+
children: Z(t, e)
|
|
122
100
|
})]
|
|
123
|
-
},
|
|
101
|
+
}, t.key))
|
|
124
102
|
}),
|
|
125
|
-
|
|
103
|
+
b && /* @__PURE__ */ a("div", {
|
|
126
104
|
className: "data-view__card-actions",
|
|
127
|
-
onClick: (
|
|
128
|
-
children:
|
|
105
|
+
onClick: (t) => t.stopPropagation(),
|
|
106
|
+
children: b(e)
|
|
129
107
|
})
|
|
130
108
|
] });
|
|
131
|
-
return /* @__PURE__ */ c(
|
|
132
|
-
className:
|
|
133
|
-
href:
|
|
134
|
-
style:
|
|
135
|
-
onClick:
|
|
136
|
-
children:
|
|
109
|
+
return /* @__PURE__ */ c(W.Fragment, { children: [h && /* @__PURE__ */ a(Y, { marker: h }), f ? /* @__PURE__ */ a("a", {
|
|
110
|
+
className: K,
|
|
111
|
+
href: f,
|
|
112
|
+
style: S,
|
|
113
|
+
onClick: T,
|
|
114
|
+
children: A
|
|
137
115
|
}) : /* @__PURE__ */ a("div", {
|
|
138
|
-
className:
|
|
139
|
-
style:
|
|
140
|
-
onClick:
|
|
141
|
-
children:
|
|
116
|
+
className: K,
|
|
117
|
+
style: S,
|
|
118
|
+
onClick: o ? (t) => o(e, t) : void 0,
|
|
119
|
+
children: A
|
|
142
120
|
})] }, d);
|
|
143
121
|
};
|
|
144
|
-
if (
|
|
122
|
+
if (g) {
|
|
145
123
|
let e = 0;
|
|
146
124
|
return /* @__PURE__ */ a("div", {
|
|
147
125
|
className: "data-view__groups",
|
|
148
|
-
children:
|
|
149
|
-
const
|
|
150
|
-
e +=
|
|
151
|
-
const d =
|
|
126
|
+
children: g.map((i) => {
|
|
127
|
+
const h = e;
|
|
128
|
+
e += i.items.length;
|
|
129
|
+
const d = v && G?.has(i.key);
|
|
152
130
|
return /* @__PURE__ */ c("section", {
|
|
153
131
|
className: "data-view__group",
|
|
154
132
|
children: [/* @__PURE__ */ c("header", {
|
|
155
|
-
className: `data-view__group-header${
|
|
156
|
-
onClick:
|
|
133
|
+
className: `data-view__group-header${v ? " data-view__group-header--collapsible" : ""}`,
|
|
134
|
+
onClick: v ? () => H?.(i.key) : void 0,
|
|
157
135
|
children: [
|
|
158
136
|
/* @__PURE__ */ a("span", {
|
|
159
137
|
className: "data-view__group-label",
|
|
160
|
-
children:
|
|
138
|
+
children: i.label
|
|
161
139
|
}),
|
|
162
|
-
|
|
140
|
+
B && /* @__PURE__ */ a("span", {
|
|
163
141
|
className: "data-view__group-count",
|
|
164
|
-
children:
|
|
142
|
+
children: i.items.length === i.totalCount ? i.totalCount : `${i.items.length} of ${i.totalCount}`
|
|
165
143
|
}),
|
|
166
|
-
|
|
144
|
+
v && /* @__PURE__ */ a(y, {
|
|
167
145
|
className: "data-view__group-chevron",
|
|
168
146
|
name: d ? "caret-down" : "caret-up",
|
|
169
147
|
size: "sm"
|
|
170
148
|
})
|
|
171
149
|
]
|
|
172
150
|
}), !d && /* @__PURE__ */ a("div", {
|
|
173
|
-
className:
|
|
174
|
-
style:
|
|
175
|
-
children:
|
|
151
|
+
className: I,
|
|
152
|
+
style: P,
|
|
153
|
+
children: i.items.map((m, p) => x(m, h + p))
|
|
176
154
|
})]
|
|
177
|
-
},
|
|
155
|
+
}, i.key ?? "__null__");
|
|
178
156
|
})
|
|
179
157
|
});
|
|
180
158
|
}
|
|
181
159
|
return /* @__PURE__ */ a("div", {
|
|
182
|
-
className:
|
|
183
|
-
style:
|
|
184
|
-
children:
|
|
160
|
+
className: I,
|
|
161
|
+
style: P,
|
|
162
|
+
children: n.map((e, i) => x(e, i))
|
|
185
163
|
});
|
|
186
164
|
}
|
|
187
165
|
export {
|
|
188
|
-
|
|
189
|
-
la as DEFAULT_PAGE_SIZES,
|
|
190
|
-
oa as getColumnLabel,
|
|
191
|
-
ea as renderCellContent,
|
|
192
|
-
aa as renderColumnLabel
|
|
166
|
+
ma as CardView
|
|
193
167
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getColumnLabel as a } from "./DataView.
|
|
1
|
+
import { getColumnLabel as a } from "./DataView.helpers.js";
|
|
2
2
|
import { MiniSort as s } from "../MiniSort/MiniSort2.js";
|
|
3
3
|
import { jsx as d } from "react/jsx-runtime";
|
|
4
4
|
function g({ columns: t, config: l, sortDirection: i, sortKey: c, onSort: e }) {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Icon as c } from "../Icon/Icon2.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { jsx as a, jsxs as i } from "react/jsx-runtime";
|
|
4
|
+
var m = [
|
|
5
|
+
15,
|
|
6
|
+
30,
|
|
7
|
+
50,
|
|
8
|
+
100,
|
|
9
|
+
250,
|
|
10
|
+
500
|
|
11
|
+
], v = (e) => typeof e.header == "string" ? e.header : e.key, _ = (e) => /* @__PURE__ */ i("span", {
|
|
12
|
+
className: "data-view__column-label",
|
|
13
|
+
children: [e.icon && /* @__PURE__ */ a(c, {
|
|
14
|
+
className: "data-view__column-icon",
|
|
15
|
+
name: e.icon,
|
|
16
|
+
size: "sm",
|
|
17
|
+
variant: "muted"
|
|
18
|
+
}), /* @__PURE__ */ a("span", { children: e.header })]
|
|
19
|
+
}), p = (e, r) => {
|
|
20
|
+
const n = e.cellIcon?.(r), s = e.accessor ? e.accessor(r) : r[e.key];
|
|
21
|
+
return n ? /* @__PURE__ */ i("span", {
|
|
22
|
+
className: "data-view__cell-with-icon",
|
|
23
|
+
children: [/* @__PURE__ */ a(c, {
|
|
24
|
+
className: "data-view__cell-icon",
|
|
25
|
+
name: n
|
|
26
|
+
}), /* @__PURE__ */ a("span", { children: s })]
|
|
27
|
+
}) : s;
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
m as DEFAULT_PAGE_SIZES,
|
|
31
|
+
v as getColumnLabel,
|
|
32
|
+
p as renderCellContent,
|
|
33
|
+
_ as renderColumnLabel
|
|
34
|
+
};
|