@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,150 +1,152 @@
|
|
|
1
1
|
import './ControlPanel.css';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
2
|
+
import { libMessages as T } from "../../contexts/LanguageContext/libMessages.js";
|
|
3
|
+
import { useMessages as V } from "../../hooks/useLanguage.js";
|
|
4
|
+
import { Button as D } from "../Button/Button2.js";
|
|
5
|
+
import { Tooltip as E } from "../Tooltip/Tooltip2.js";
|
|
6
|
+
import { Separator as J } from "../Separator/Separator2.js";
|
|
7
|
+
import { AppHeader as L } from "../AppHeader/AppHeader2.js";
|
|
8
|
+
import { ConfirmPopover as Q } from "../ConfirmPopover/ConfirmPopover2.js";
|
|
9
|
+
import { ControlPanelFilterItem as X } from "./ControlPanelFilter.js";
|
|
10
|
+
import { ControlPanelNav as Y } from "./ControlPanelNav.js";
|
|
11
|
+
import { ControlPanelOptions as Z } from "./ControlPanelOptions.js";
|
|
12
|
+
import { useControlPanelContext as oo } from "./useControlPanel.js";
|
|
11
13
|
/* empty css */
|
|
12
|
-
import { useState as
|
|
13
|
-
import { Fragment as
|
|
14
|
-
var
|
|
15
|
-
const
|
|
16
|
-
}),
|
|
14
|
+
import { useState as F } from "react";
|
|
15
|
+
import { Fragment as H, jsx as n, jsxs as i } from "react/jsx-runtime";
|
|
16
|
+
var go = ({ width: o = "280px", className: s = "", isOpen: m, onClose: v, isMobile: p, showOverlay: C = !0, contained: r = !1, flush: g = !1, sticky: _ = !1, shadow: f = "none", header: l, navigation: x = [], actions: y = [], filters: N = [], filtersCount: d, collapsibleFilters: b = !1, onFilterChange: M, onClearFilters: j, options: h = [], onOptionChange: W, viewToggle: O, groupBy: P, visibleColumns: w }) => {
|
|
17
|
+
const u = V(T), a = oo(), e = p ?? a?.isDrawer ?? !1, z = m ?? (e ? a?.isOpen ?? !1 : !0), c = v ?? a?.close ?? (() => {
|
|
18
|
+
}), k = p === void 0 && a?.undockable ? a : null, G = [
|
|
17
19
|
"control-panel",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
].filter(Boolean).join(" "),
|
|
26
|
-
"--control-panel-width":
|
|
27
|
-
"--control-panel-shadow":
|
|
28
|
-
},
|
|
29
|
-
return /* @__PURE__ */ i(
|
|
30
|
-
className:
|
|
31
|
-
onClick:
|
|
20
|
+
z ? "control-panel--open" : "control-panel--closed",
|
|
21
|
+
e ? "control-panel--mobile" : "",
|
|
22
|
+
k ? "control-panel--undockable" : "",
|
|
23
|
+
r ? "control-panel--contained" : "",
|
|
24
|
+
g ? "control-panel--flush" : "",
|
|
25
|
+
_ ? "control-panel--sticky" : "",
|
|
26
|
+
s
|
|
27
|
+
].filter(Boolean).join(" "), K = ["control-panel__overlay", r ? "control-panel__overlay--contained" : ""].filter(Boolean).join(" "), R = {
|
|
28
|
+
"--control-panel-width": o,
|
|
29
|
+
"--control-panel-shadow": f
|
|
30
|
+
}, B = h.length === 0 ? [] : "type" in h[0] ? [{ options: h }] : h, I = !!(O || P || w || B.length > 0), S = N.length > 0 || d !== void 0 && d > 0, U = typeof b == "number" ? b : b ? 1 : 1 / 0, A = N.length >= U, $ = ["control-panel__filters", A ? "control-panel__filters--collapsible" : ""].filter(Boolean).join(" ");
|
|
31
|
+
return /* @__PURE__ */ i(H, { children: [C && e && z && /* @__PURE__ */ n("div", {
|
|
32
|
+
className: K,
|
|
33
|
+
onClick: c
|
|
32
34
|
}), /* @__PURE__ */ i("aside", {
|
|
33
|
-
className:
|
|
34
|
-
style:
|
|
35
|
+
className: G,
|
|
36
|
+
style: R,
|
|
35
37
|
children: [
|
|
36
|
-
|
|
38
|
+
k && /* @__PURE__ */ n("div", {
|
|
37
39
|
className: "control-panel__dock",
|
|
38
|
-
children: /* @__PURE__ */ n(
|
|
39
|
-
title:
|
|
40
|
+
children: /* @__PURE__ */ n(E, {
|
|
41
|
+
title: e ? u.panelKeepOpen : u.panelHide,
|
|
40
42
|
position: "right",
|
|
41
|
-
children: /* @__PURE__ */ n(
|
|
42
|
-
icon:
|
|
43
|
-
onClick: () =>
|
|
43
|
+
children: /* @__PURE__ */ n(D, {
|
|
44
|
+
icon: e ? "pin" : "caret-left",
|
|
45
|
+
onClick: () => k.setUndocked(!e),
|
|
44
46
|
size: "small",
|
|
45
47
|
variant: "default"
|
|
46
48
|
})
|
|
47
49
|
})
|
|
48
50
|
}),
|
|
49
|
-
l && /* @__PURE__ */ n(
|
|
51
|
+
l && /* @__PURE__ */ n(L, {
|
|
50
52
|
icon: l.icon,
|
|
51
53
|
emoji: l.emoji,
|
|
52
54
|
svg: l.svg,
|
|
53
55
|
appName: l.appName ?? l.siteName,
|
|
54
56
|
heading: l.heading,
|
|
55
57
|
onClick: l.onClick ? () => {
|
|
56
|
-
l.onClick?.(),
|
|
58
|
+
l.onClick?.(), e && c();
|
|
57
59
|
} : void 0
|
|
58
60
|
}),
|
|
59
|
-
|
|
61
|
+
y.length > 0 && /* @__PURE__ */ n("div", {
|
|
60
62
|
className: "control-panel__actions",
|
|
61
|
-
children:
|
|
63
|
+
children: y.map((t) => /* @__PURE__ */ n(no, {
|
|
62
64
|
action: t,
|
|
63
|
-
onActionComplete:
|
|
65
|
+
onActionComplete: e ? c : void 0
|
|
64
66
|
}, t.id))
|
|
65
67
|
}),
|
|
66
|
-
|
|
67
|
-
navigation:
|
|
68
|
-
onNavigate:
|
|
68
|
+
x.length > 0 && /* @__PURE__ */ n(Y, {
|
|
69
|
+
navigation: x,
|
|
70
|
+
onNavigate: e ? c : void 0
|
|
69
71
|
}),
|
|
70
|
-
|
|
71
|
-
className:
|
|
72
|
+
S && /* @__PURE__ */ i("div", {
|
|
73
|
+
className: $,
|
|
72
74
|
children: [/* @__PURE__ */ i("div", {
|
|
73
75
|
className: "control-panel__filters-header",
|
|
74
76
|
children: [/* @__PURE__ */ i("span", {
|
|
75
77
|
className: "control-panel__filters-heading",
|
|
76
|
-
children: [
|
|
78
|
+
children: [u.filters, d !== void 0 && /* @__PURE__ */ n("span", {
|
|
77
79
|
className: "control-panel__filters-count",
|
|
78
|
-
children:
|
|
80
|
+
children: d
|
|
79
81
|
})]
|
|
80
|
-
}),
|
|
82
|
+
}), j && /* @__PURE__ */ n("button", {
|
|
81
83
|
className: "control-panel__filters-clear",
|
|
82
84
|
type: "button",
|
|
83
|
-
onClick: () =>
|
|
84
|
-
children:
|
|
85
|
+
onClick: () => j({ source: "control-panel" }),
|
|
86
|
+
children: u.clearFilters
|
|
85
87
|
})]
|
|
86
|
-
}),
|
|
88
|
+
}), N.map((t) => /* @__PURE__ */ n(X, {
|
|
87
89
|
filter: t,
|
|
88
|
-
collapsible: t.collapsible ??
|
|
89
|
-
onChange: (
|
|
90
|
+
collapsible: t.collapsible ?? A,
|
|
91
|
+
onChange: (q) => M?.(q)
|
|
90
92
|
}, t.id))]
|
|
91
93
|
}),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
normalizedOptionGroups:
|
|
95
|
-
onOptionChange:
|
|
96
|
-
viewToggle:
|
|
97
|
-
onViewToggleComplete:
|
|
94
|
+
S && I && /* @__PURE__ */ n(J, { spacing: 0 }),
|
|
95
|
+
I && /* @__PURE__ */ n(Z, {
|
|
96
|
+
normalizedOptionGroups: B,
|
|
97
|
+
onOptionChange: W,
|
|
98
|
+
viewToggle: O,
|
|
99
|
+
onViewToggleComplete: e ? c : void 0,
|
|
98
100
|
groupBy: P,
|
|
99
|
-
visibleColumns:
|
|
101
|
+
visibleColumns: w
|
|
100
102
|
})
|
|
101
103
|
]
|
|
102
104
|
})] });
|
|
103
|
-
},
|
|
104
|
-
const [
|
|
105
|
-
if (
|
|
106
|
-
|
|
105
|
+
}, no = ({ action: o, onActionComplete: s }) => {
|
|
106
|
+
const m = V(T), [v, p] = F(null), [C, r] = F(!1), g = (l) => {
|
|
107
|
+
if (o.confirm) {
|
|
108
|
+
p(l.currentTarget), r(!0);
|
|
107
109
|
return;
|
|
108
110
|
}
|
|
109
|
-
|
|
111
|
+
o.onClick?.(l), s?.();
|
|
110
112
|
}, _ = () => {
|
|
111
|
-
|
|
112
|
-
}, f = /* @__PURE__ */ n(
|
|
113
|
+
o.onClick?.({}), s?.();
|
|
114
|
+
}, f = /* @__PURE__ */ n(D, {
|
|
113
115
|
className: "control-panel__action",
|
|
114
|
-
disabled:
|
|
115
|
-
fullWidth:
|
|
116
|
-
icon:
|
|
117
|
-
onClick:
|
|
118
|
-
size:
|
|
119
|
-
sufixIcon:
|
|
120
|
-
variant:
|
|
121
|
-
children:
|
|
116
|
+
disabled: o.disabled,
|
|
117
|
+
fullWidth: o.fullWidth ?? !0,
|
|
118
|
+
icon: o.icon,
|
|
119
|
+
onClick: g,
|
|
120
|
+
size: o.size ?? "medium",
|
|
121
|
+
sufixIcon: o.suffixIcon,
|
|
122
|
+
variant: o.variant ?? "default",
|
|
123
|
+
children: o.label
|
|
122
124
|
});
|
|
123
|
-
return /* @__PURE__ */ i(
|
|
124
|
-
title:
|
|
125
|
+
return /* @__PURE__ */ i(H, { children: [o.tooltip ? /* @__PURE__ */ n(E, {
|
|
126
|
+
title: o.tooltip,
|
|
125
127
|
position: "right",
|
|
126
128
|
children: f
|
|
127
|
-
}) : f,
|
|
128
|
-
visible:
|
|
129
|
-
onClose: () =>
|
|
130
|
-
anchorEl:
|
|
131
|
-
title:
|
|
132
|
-
message:
|
|
133
|
-
icon:
|
|
134
|
-
placement:
|
|
129
|
+
}) : f, o.confirm && /* @__PURE__ */ n(Q, {
|
|
130
|
+
visible: C,
|
|
131
|
+
onClose: () => r(!1),
|
|
132
|
+
anchorEl: v,
|
|
133
|
+
title: o.confirm.title ?? o.label,
|
|
134
|
+
message: o.confirm.message,
|
|
135
|
+
icon: o.confirm.icon,
|
|
136
|
+
placement: o.confirm.placement ?? "right",
|
|
135
137
|
confirm: {
|
|
136
|
-
text:
|
|
137
|
-
icon:
|
|
138
|
-
variant:
|
|
138
|
+
text: o.confirm.confirm?.text ?? m.confirm,
|
|
139
|
+
icon: o.confirm.confirm?.icon,
|
|
140
|
+
variant: o.confirm.confirm?.variant ?? o.variant ?? "info",
|
|
139
141
|
onClick: _
|
|
140
142
|
},
|
|
141
143
|
cancel: {
|
|
142
|
-
text:
|
|
143
|
-
icon:
|
|
144
|
-
variant:
|
|
144
|
+
text: o.confirm.cancel?.text ?? m.cancel,
|
|
145
|
+
icon: o.confirm.cancel?.icon,
|
|
146
|
+
variant: o.confirm.cancel?.variant ?? "default"
|
|
145
147
|
}
|
|
146
148
|
})] });
|
|
147
149
|
};
|
|
148
150
|
export {
|
|
149
|
-
|
|
151
|
+
go as ControlPanel
|
|
150
152
|
};
|