@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.
Files changed (47) hide show
  1. package/dist/components/Banner/Banner2.js +15 -13
  2. package/dist/components/BoldText/BoldText.js +5 -0
  3. package/dist/components/Calendar/Calendar2.js +108 -135
  4. package/dist/components/ColorPicker/ColorPicker.css +1 -1
  5. package/dist/components/ColorPicker/ColorPicker2.js +114 -114
  6. package/dist/components/ConfirmDialog/ConfirmDialog2.js +13 -11
  7. package/dist/components/ConfirmPopover/ConfirmPopover2.js +26 -24
  8. package/dist/components/ContextMenu/ContextMenu2.js +46 -33
  9. package/dist/components/ControlPanel/ControlPanel2.js +95 -93
  10. package/dist/components/ControlPanel/ControlPanelFilter.js +205 -193
  11. package/dist/components/ControlPanel/ControlPanelOptions.js +190 -185
  12. package/dist/components/DataView/DataView.CardView.js +83 -81
  13. package/dist/components/DataView/DataView.ColumnSelector.js +27 -25
  14. package/dist/components/DataView/DataView.TableView.js +74 -72
  15. package/dist/components/DataView/DataView2.js +169 -167
  16. package/dist/components/DatePicker/DatePicker2.js +71 -69
  17. package/dist/components/Drawer/Drawer2.js +58 -55
  18. package/dist/components/Dropdown/Dropdown2.js +187 -189
  19. package/dist/components/InputDate/InputDate2.js +43 -41
  20. package/dist/components/InputSearch/InputSearch2.js +27 -25
  21. package/dist/components/MenuBar/MenuBar.css +1 -0
  22. package/dist/components/MenuBar/MenuBar2.js +46 -0
  23. package/dist/components/Modal/Modal2.js +49 -47
  24. package/dist/components/Pagination/Pagination2.js +44 -47
  25. package/dist/components/ScrollToTop/ScrollToTop2.js +18 -16
  26. package/dist/components/ThemeSettings/ThemeSettings2.js +131 -123
  27. package/dist/components/TipsOfTheDay/TipsOfTheDay2.js +16 -12
  28. package/dist/components/Toast/Toast2.js +38 -33
  29. package/dist/components/ToolButton/ToolButton.css +1 -0
  30. package/dist/components/ToolButton/ToolButton2.js +36 -0
  31. package/dist/components/ToolPalette/ToolPalette.css +1 -0
  32. package/dist/components/ToolPalette/ToolPalette2.js +83 -0
  33. package/dist/components/Toolbar/Toolbar2.js +58 -56
  34. package/dist/contexts/LanguageContext/LanguageContext.context.js +9 -0
  35. package/dist/contexts/LanguageContext/LanguageContext.js +19 -0
  36. package/dist/contexts/LanguageContext/libMessages.js +240 -0
  37. package/dist/helpers/Datetime.js +84 -68
  38. package/dist/helpers/Language.js +8 -0
  39. package/dist/helpers/Pagination.js +5 -4
  40. package/dist/helpers/VersionInfo.js +1 -1
  41. package/dist/hooks/useLanguage.js +16 -0
  42. package/dist/index.d.ts +133 -6
  43. package/dist/index.js +417 -399
  44. package/dist/memobit-icons.json +4 -0
  45. package/dist/version.js +2 -2
  46. package/dist/version.json +4 -4
  47. package/package.json +1 -1
@@ -1,150 +1,152 @@
1
1
  import './ControlPanel.css';
2
- import { Button as F } from "../Button/Button2.js";
3
- import { Tooltip as T } from "../Tooltip/Tooltip2.js";
4
- import { Separator as $ } from "../Separator/Separator2.js";
5
- import { AppHeader as q } from "../AppHeader/AppHeader2.js";
6
- import { ConfirmPopover as J } from "../ConfirmPopover/ConfirmPopover2.js";
7
- import { ControlPanelFilterItem as L } from "./ControlPanelFilter.js";
8
- import { ControlPanelNav as M } from "./ControlPanelNav.js";
9
- import { ControlPanelOptions as Q } from "./ControlPanelOptions.js";
10
- import { useControlPanelContext as X } from "./useControlPanel.js";
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 A } from "react";
13
- import { Fragment as V, jsx as n, jsxs as i } from "react/jsx-runtime";
14
- var fe = ({ width: e = "280px", className: c = "", isOpen: u, onClose: C, isMobile: s, showOverlay: m = !0, contained: p = !1, flush: _ = !1, sticky: f = !1, shadow: d = "none", header: l, navigation: k = [], actions: x = [], filters: g = [], filtersCount: h, collapsibleFilters: b = !1, onFilterChange: D, onClearFilters: y, options: v = [], onOptionChange: E, viewToggle: j, groupBy: P, visibleColumns: O }) => {
15
- const r = X(), o = s ?? r?.isDrawer ?? !1, w = u ?? (o ? r?.isOpen ?? !1 : !0), a = C ?? r?.close ?? (() => {
16
- }), N = s === void 0 && r?.undockable ? r : null, H = [
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
- w ? "control-panel--open" : "control-panel--closed",
19
- o ? "control-panel--mobile" : "",
20
- N ? "control-panel--undockable" : "",
21
- p ? "control-panel--contained" : "",
22
- _ ? "control-panel--flush" : "",
23
- f ? "control-panel--sticky" : "",
24
- c
25
- ].filter(Boolean).join(" "), W = ["control-panel__overlay", p ? "control-panel__overlay--contained" : ""].filter(Boolean).join(" "), G = {
26
- "--control-panel-width": e,
27
- "--control-panel-shadow": d
28
- }, z = v.length === 0 ? [] : "type" in v[0] ? [{ options: v }] : v, B = !!(j || P || O || z.length > 0), I = g.length > 0 || h !== void 0 && h > 0, K = typeof b == "number" ? b : b ? 1 : 1 / 0, S = g.length >= K, R = ["control-panel__filters", S ? "control-panel__filters--collapsible" : ""].filter(Boolean).join(" ");
29
- return /* @__PURE__ */ i(V, { children: [m && o && w && /* @__PURE__ */ n("div", {
30
- className: W,
31
- onClick: a
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: H,
34
- style: G,
35
+ className: G,
36
+ style: R,
35
37
  children: [
36
- N && /* @__PURE__ */ n("div", {
38
+ k && /* @__PURE__ */ n("div", {
37
39
  className: "control-panel__dock",
38
- children: /* @__PURE__ */ n(T, {
39
- title: o ? "Keep the panel open beside the page" : "Hide the panel, and open it from the toolbar when needed",
40
+ children: /* @__PURE__ */ n(E, {
41
+ title: e ? u.panelKeepOpen : u.panelHide,
40
42
  position: "right",
41
- children: /* @__PURE__ */ n(F, {
42
- icon: o ? "pin" : "caret-left",
43
- onClick: () => N.setUndocked(!o),
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(q, {
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?.(), o && a();
58
+ l.onClick?.(), e && c();
57
59
  } : void 0
58
60
  }),
59
- x.length > 0 && /* @__PURE__ */ n("div", {
61
+ y.length > 0 && /* @__PURE__ */ n("div", {
60
62
  className: "control-panel__actions",
61
- children: x.map((t) => /* @__PURE__ */ n(Y, {
63
+ children: y.map((t) => /* @__PURE__ */ n(no, {
62
64
  action: t,
63
- onActionComplete: o ? a : void 0
65
+ onActionComplete: e ? c : void 0
64
66
  }, t.id))
65
67
  }),
66
- k.length > 0 && /* @__PURE__ */ n(M, {
67
- navigation: k,
68
- onNavigate: o ? a : void 0
68
+ x.length > 0 && /* @__PURE__ */ n(Y, {
69
+ navigation: x,
70
+ onNavigate: e ? c : void 0
69
71
  }),
70
- I && /* @__PURE__ */ i("div", {
71
- className: R,
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: ["Filters", h !== void 0 && /* @__PURE__ */ n("span", {
78
+ children: [u.filters, d !== void 0 && /* @__PURE__ */ n("span", {
77
79
  className: "control-panel__filters-count",
78
- children: h
80
+ children: d
79
81
  })]
80
- }), y && /* @__PURE__ */ n("button", {
82
+ }), j && /* @__PURE__ */ n("button", {
81
83
  className: "control-panel__filters-clear",
82
84
  type: "button",
83
- onClick: () => y({ source: "control-panel" }),
84
- children: "Clear filters"
85
+ onClick: () => j({ source: "control-panel" }),
86
+ children: u.clearFilters
85
87
  })]
86
- }), g.map((t) => /* @__PURE__ */ n(L, {
88
+ }), N.map((t) => /* @__PURE__ */ n(X, {
87
89
  filter: t,
88
- collapsible: t.collapsible ?? S,
89
- onChange: (U) => D?.(U)
90
+ collapsible: t.collapsible ?? A,
91
+ onChange: (q) => M?.(q)
90
92
  }, t.id))]
91
93
  }),
92
- I && B && /* @__PURE__ */ n($, { spacing: 0 }),
93
- B && /* @__PURE__ */ n(Q, {
94
- normalizedOptionGroups: z,
95
- onOptionChange: E,
96
- viewToggle: j,
97
- onViewToggleComplete: o ? a : void 0,
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: O
101
+ visibleColumns: w
100
102
  })
101
103
  ]
102
104
  })] });
103
- }, Y = ({ action: e, onActionComplete: c }) => {
104
- const [u, C] = A(null), [s, m] = A(!1), p = (d) => {
105
- if (e.confirm) {
106
- C(d.currentTarget), m(!0);
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
- e.onClick?.(d), c?.();
111
+ o.onClick?.(l), s?.();
110
112
  }, _ = () => {
111
- e.onClick?.({}), c?.();
112
- }, f = /* @__PURE__ */ n(F, {
113
+ o.onClick?.({}), s?.();
114
+ }, f = /* @__PURE__ */ n(D, {
113
115
  className: "control-panel__action",
114
- disabled: e.disabled,
115
- fullWidth: e.fullWidth ?? !0,
116
- icon: e.icon,
117
- onClick: p,
118
- size: e.size ?? "medium",
119
- sufixIcon: e.suffixIcon,
120
- variant: e.variant ?? "default",
121
- children: e.label
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(V, { children: [e.tooltip ? /* @__PURE__ */ n(T, {
124
- title: e.tooltip,
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, e.confirm && /* @__PURE__ */ n(J, {
128
- visible: s,
129
- onClose: () => m(!1),
130
- anchorEl: u,
131
- title: e.confirm.title ?? e.label,
132
- message: e.confirm.message,
133
- icon: e.confirm.icon,
134
- placement: e.confirm.placement ?? "right",
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: e.confirm.confirm?.text ?? "Confirm",
137
- icon: e.confirm.confirm?.icon,
138
- variant: e.confirm.confirm?.variant ?? e.variant ?? "info",
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: e.confirm.cancel?.text ?? "Cancel",
143
- icon: e.confirm.cancel?.icon,
144
- variant: e.confirm.cancel?.variant ?? "default"
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
- fe as ControlPanel
151
+ go as ControlPanel
150
152
  };