@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,197 +1,202 @@
1
- import { Icon as p } from "../Icon/Icon2.js";
2
- import { Button as y } from "../Button/Button2.js";
1
+ import { Icon as k } from "../Icon/Icon2.js";
2
+ import { libMessages as g } from "../../contexts/LanguageContext/libMessages.js";
3
+ import { useMessages as w } from "../../hooks/useLanguage.js";
4
+ import { Button as F } from "../Button/Button2.js";
3
5
  import { Tooltip as I } from "../Tooltip/Tooltip2.js";
4
- import { Separator as u } from "../Separator/Separator2.js";
5
- import { Chip as f } from "../Chip/Chip2.js";
6
- import { Slider as G } from "../Slider/Slider2.js";
7
- import k from "react";
6
+ import { Separator as f } from "../Separator/Separator2.js";
7
+ import { Chip as b } from "../Chip/Chip2.js";
8
+ import { Slider as j } from "../Slider/Slider2.js";
9
+ import y from "react";
8
10
  import { Fragment as _, jsx as e, jsxs as c } from "react/jsx-runtime";
9
- var $ = [{
10
- value: "cards",
11
- label: "Grid",
12
- icon: "grid"
13
- }, {
14
- value: "table",
15
- label: "Table",
16
- icon: "table"
17
- }], C = {
18
- value: "gallery",
19
- label: "Gallery",
20
- icon: "gallery"
21
- }, W = ({ normalizedOptionGroups: b, onOptionChange: m, viewToggle: r, onViewToggleComplete: S, groupBy: s, visibleColumns: i }) => /* @__PURE__ */ c("div", {
22
- className: "control-panel__options",
23
- children: [
24
- /* @__PURE__ */ e("div", {
25
- className: "control-panel__options-header",
26
- children: /* @__PURE__ */ e("span", {
27
- className: "control-panel__options-heading",
28
- children: "Options"
29
- })
30
- }),
31
- r && /* @__PURE__ */ e("div", {
32
- className: "control-panel__option control-panel__option--view-toggle",
33
- children: /* @__PURE__ */ e("div", {
34
- className: "control-panel__option-view-toggle",
35
- children: (r.options ?? [...$, ...r.showGallery ? [C] : []]).map((n) => /* @__PURE__ */ e(y, {
36
- icon: n.icon,
37
- size: "small",
38
- variant: r.value === n.value ? "info" : "default",
39
- onClick: () => {
40
- r.onChange(n.value), S?.();
41
- },
42
- children: n.label
43
- }, n.value))
44
- })
45
- }),
46
- s && s.options.length > 0 && /* @__PURE__ */ c(_, { children: [r && /* @__PURE__ */ e(u, { spacing: 0 }), /* @__PURE__ */ c("div", {
47
- className: "control-panel__option control-panel__option--group-by",
48
- children: [/* @__PURE__ */ e("span", {
49
- className: "control-panel__filter-title",
50
- children: "Group by"
51
- }), /* @__PURE__ */ e("div", {
52
- className: "control-panel__filter-chips",
53
- children: s.options.map((n) => {
54
- const t = s.value === n.value;
55
- return /* @__PURE__ */ e(f, {
56
- selected: t,
57
- onClick: () => s.onChange(t ? null : n.value),
58
- children: n.label
59
- }, n.value);
11
+ var H = ({ normalizedOptionGroups: p, onOptionChange: m, viewToggle: r, onViewToggleComplete: x, groupBy: s, visibleColumns: i }) => {
12
+ const d = w(g), S = [{
13
+ value: "cards",
14
+ label: d.viewGrid,
15
+ icon: "grid"
16
+ }, {
17
+ value: "table",
18
+ label: d.viewTable,
19
+ icon: "table"
20
+ }], C = {
21
+ value: "gallery",
22
+ label: d.viewGallery,
23
+ icon: "gallery"
24
+ };
25
+ return /* @__PURE__ */ c("div", {
26
+ className: "control-panel__options",
27
+ children: [
28
+ /* @__PURE__ */ e("div", {
29
+ className: "control-panel__options-header",
30
+ children: /* @__PURE__ */ e("span", {
31
+ className: "control-panel__options-heading",
32
+ children: d.options
60
33
  })
61
- })]
62
- })] }),
63
- i && /* @__PURE__ */ c(_, { children: [(r || s && s.options.length > 0) && /* @__PURE__ */ e(u, { spacing: 0 }), /* @__PURE__ */ c("div", {
64
- className: "control-panel__option control-panel__option--chips",
65
- children: [/* @__PURE__ */ e("span", {
66
- className: "control-panel__filter-title",
67
- children: "Visible columns"
68
- }), /* @__PURE__ */ e("div", {
69
- className: "control-panel__filter-chips",
70
- children: i.options.map((n) => {
71
- const t = i.value.includes(n.value);
72
- return /* @__PURE__ */ e(f, {
73
- selected: t,
34
+ }),
35
+ r && /* @__PURE__ */ e("div", {
36
+ className: "control-panel__option control-panel__option--view-toggle",
37
+ children: /* @__PURE__ */ e("div", {
38
+ className: "control-panel__option-view-toggle",
39
+ children: (r.options ?? [...S, ...r.showGallery ? [C] : []]).map((n) => /* @__PURE__ */ e(F, {
40
+ icon: n.icon,
41
+ size: "small",
42
+ variant: r.value === n.value ? "info" : "default",
74
43
  onClick: () => {
75
- const l = t ? i.value.filter((o) => o !== n.value) : [...i.value, n.value];
76
- i.onChange(l);
44
+ r.onChange(n.value), x?.();
77
45
  },
78
46
  children: n.label
79
- }, n.value);
47
+ }, n.value))
80
48
  })
81
- })]
82
- })] }),
83
- b.length > 0 && (r || s || i) && /* @__PURE__ */ e(u, { spacing: 0 }),
84
- b.map((n, t) => /* @__PURE__ */ c("div", {
85
- className: "control-panel__option-group",
86
- children: [n.label && /* @__PURE__ */ e("span", {
87
- className: "control-panel__option-group-label",
88
- children: n.label
89
- }), n.options.map((l, o) => {
90
- const N = o > 0 ? n.options[o - 1] : void 0, x = !!N && N.type !== l.type;
91
- return /* @__PURE__ */ c(k.Fragment, { children: [x && /* @__PURE__ */ e(u, { spacing: 0 }), /* @__PURE__ */ c("div", {
92
- className: `control-panel__option control-panel__option--${l.type}`,
93
- children: [
94
- l.type === "checkbox" && /* @__PURE__ */ e(f, {
95
- icon: l.icon,
96
- selected: l.value ?? !1,
97
- onClick: () => m?.({
98
- optionId: l.id,
99
- value: !(l.value ?? !1)
100
- }),
101
- children: l.label
102
- }),
103
- l.type === "radio" && /* @__PURE__ */ c(_, { children: [l.label && /* @__PURE__ */ e("span", {
104
- className: "control-panel__filter-title",
105
- children: l.label
106
- }), /* @__PURE__ */ e("div", {
107
- className: `control-panel__filter-list ${l.inline ? "control-panel__filter-list--inline" : ""}`,
108
- children: l.options.map((a) => {
109
- const d = l.value === a.value, h = () => m?.({
49
+ }),
50
+ s && s.options.length > 0 && /* @__PURE__ */ c(_, { children: [r && /* @__PURE__ */ e(f, { spacing: 0 }), /* @__PURE__ */ c("div", {
51
+ className: "control-panel__option control-panel__option--group-by",
52
+ children: [/* @__PURE__ */ e("span", {
53
+ className: "control-panel__filter-title",
54
+ children: d.groupBy
55
+ }), /* @__PURE__ */ e("div", {
56
+ className: "control-panel__filter-chips",
57
+ children: s.options.map((n) => {
58
+ const t = s.value === n.value;
59
+ return /* @__PURE__ */ e(b, {
60
+ selected: t,
61
+ onClick: () => s.onChange(t ? null : n.value),
62
+ children: n.label
63
+ }, n.value);
64
+ })
65
+ })]
66
+ })] }),
67
+ i && /* @__PURE__ */ c(_, { children: [(r || s && s.options.length > 0) && /* @__PURE__ */ e(f, { spacing: 0 }), /* @__PURE__ */ c("div", {
68
+ className: "control-panel__option control-panel__option--chips",
69
+ children: [/* @__PURE__ */ e("span", {
70
+ className: "control-panel__filter-title",
71
+ children: d.visibleColumns
72
+ }), /* @__PURE__ */ e("div", {
73
+ className: "control-panel__filter-chips",
74
+ children: i.options.map((n) => {
75
+ const t = i.value.includes(n.value);
76
+ return /* @__PURE__ */ e(b, {
77
+ selected: t,
78
+ onClick: () => {
79
+ const l = t ? i.value.filter((v) => v !== n.value) : [...i.value, n.value];
80
+ i.onChange(l);
81
+ },
82
+ children: n.label
83
+ }, n.value);
84
+ })
85
+ })]
86
+ })] }),
87
+ p.length > 0 && (r || s || i) && /* @__PURE__ */ e(f, { spacing: 0 }),
88
+ p.map((n, t) => /* @__PURE__ */ c("div", {
89
+ className: "control-panel__option-group",
90
+ children: [n.label && /* @__PURE__ */ e("span", {
91
+ className: "control-panel__option-group-label",
92
+ children: n.label
93
+ }), n.options.map((l, v) => {
94
+ const N = v > 0 ? n.options[v - 1] : void 0, $ = !!N && N.type !== l.type;
95
+ return /* @__PURE__ */ c(y.Fragment, { children: [$ && /* @__PURE__ */ e(f, { spacing: 0 }), /* @__PURE__ */ c("div", {
96
+ className: `control-panel__option control-panel__option--${l.type}`,
97
+ children: [
98
+ l.type === "checkbox" && /* @__PURE__ */ e(b, {
99
+ icon: l.icon,
100
+ selected: l.value ?? !1,
101
+ onClick: () => m?.({
110
102
  optionId: l.id,
111
- value: a.value
112
- }), v = /* @__PURE__ */ e("div", {
113
- className: `control-panel__filter-radio ${d ? "control-panel__filter-radio--selected" : ""} ${a.disabled ? "control-panel__filter-radio--disabled" : ""}`,
114
- children: /* @__PURE__ */ c("label", {
115
- className: "control-panel__filter-radio-label",
116
- children: [
117
- /* @__PURE__ */ e("input", {
118
- checked: d,
119
- className: "control-panel__filter-radio-input",
120
- disabled: a.disabled,
121
- name: `control-panel-option-${l.id}`,
122
- onChange: h,
123
- onClick: () => {
124
- a.disabled || d && h();
125
- },
126
- type: "radio",
127
- value: a.value
128
- }),
129
- a.icon && /* @__PURE__ */ e(p, { name: a.icon }),
130
- /* @__PURE__ */ e("span", {
131
- className: "control-panel__filter-label",
132
- children: a.label
133
- })
134
- ]
103
+ value: !(l.value ?? !1)
104
+ }),
105
+ children: l.label
106
+ }),
107
+ l.type === "radio" && /* @__PURE__ */ c(_, { children: [l.label && /* @__PURE__ */ e("span", {
108
+ className: "control-panel__filter-title",
109
+ children: l.label
110
+ }), /* @__PURE__ */ e("div", {
111
+ className: `control-panel__filter-list ${l.inline ? "control-panel__filter-list--inline" : ""}`,
112
+ children: l.options.map((a) => {
113
+ const o = l.value === a.value, h = () => m?.({
114
+ optionId: l.id,
115
+ value: a.value
116
+ }), u = /* @__PURE__ */ e("div", {
117
+ className: `control-panel__filter-radio ${o ? "control-panel__filter-radio--selected" : ""} ${a.disabled ? "control-panel__filter-radio--disabled" : ""}`,
118
+ children: /* @__PURE__ */ c("label", {
119
+ className: "control-panel__filter-radio-label",
120
+ children: [
121
+ /* @__PURE__ */ e("input", {
122
+ checked: o,
123
+ className: "control-panel__filter-radio-input",
124
+ disabled: a.disabled,
125
+ name: `control-panel-option-${l.id}`,
126
+ onChange: h,
127
+ onClick: () => {
128
+ a.disabled || o && h();
129
+ },
130
+ type: "radio",
131
+ value: a.value
132
+ }),
133
+ a.icon && /* @__PURE__ */ e(k, { name: a.icon }),
134
+ /* @__PURE__ */ e("span", {
135
+ className: "control-panel__filter-label",
136
+ children: a.label
137
+ })
138
+ ]
139
+ })
140
+ });
141
+ return a.title ? /* @__PURE__ */ e(I, {
142
+ title: a.title,
143
+ children: u
144
+ }, a.value) : /* @__PURE__ */ e(y.Fragment, { children: u }, a.value);
145
+ })
146
+ })] }),
147
+ l.type === "slider" && /* @__PURE__ */ c(_, { children: [l.label && /* @__PURE__ */ c("span", {
148
+ className: "control-panel__filter-title",
149
+ children: [
150
+ l.icon && /* @__PURE__ */ e(k, { name: l.icon }),
151
+ l.label,
152
+ l.showValue !== !1 && /* @__PURE__ */ c("span", {
153
+ className: "control-panel__option-slider-value",
154
+ children: [l.value, l.unit ?? ""]
135
155
  })
136
- });
137
- return a.title ? /* @__PURE__ */ e(I, {
138
- title: a.title,
139
- children: v
140
- }, a.value) : /* @__PURE__ */ e(k.Fragment, { children: v }, a.value);
141
- })
142
- })] }),
143
- l.type === "slider" && /* @__PURE__ */ c(_, { children: [l.label && /* @__PURE__ */ c("span", {
144
- className: "control-panel__filter-title",
145
- children: [
146
- l.icon && /* @__PURE__ */ e(p, { name: l.icon }),
147
- l.label,
148
- l.showValue !== !1 && /* @__PURE__ */ c("span", {
149
- className: "control-panel__option-slider-value",
150
- children: [l.value, l.unit ?? ""]
156
+ ]
157
+ }), /* @__PURE__ */ e(j, {
158
+ min: l.min,
159
+ max: l.max,
160
+ step: l.step,
161
+ value: l.value,
162
+ onChange: (a) => m?.({
163
+ optionId: l.id,
164
+ value: a
165
+ }),
166
+ showValues: !1,
167
+ thin: !0
168
+ })] }),
169
+ l.type === "chips" && /* @__PURE__ */ c(_, { children: [l.label && /* @__PURE__ */ e("span", {
170
+ className: "control-panel__filter-title",
171
+ children: l.label
172
+ }), /* @__PURE__ */ e("div", {
173
+ className: "control-panel__filter-chips",
174
+ children: l.options.map((a) => {
175
+ const o = l.value.includes(a.value);
176
+ return /* @__PURE__ */ e(b, {
177
+ disabled: a.disabled,
178
+ icon: a.icon,
179
+ title: a.title,
180
+ selected: o,
181
+ onClick: () => {
182
+ if (a.disabled) return;
183
+ const h = o ? l.value.filter((u) => u !== a.value) : [...l.value, a.value];
184
+ m?.({
185
+ optionId: l.id,
186
+ value: h
187
+ });
188
+ },
189
+ children: a.label
190
+ }, a.value);
151
191
  })
152
- ]
153
- }), /* @__PURE__ */ e(G, {
154
- min: l.min,
155
- max: l.max,
156
- step: l.step,
157
- value: l.value,
158
- onChange: (a) => m?.({
159
- optionId: l.id,
160
- value: a
161
- }),
162
- showValues: !1,
163
- thin: !0
164
- })] }),
165
- l.type === "chips" && /* @__PURE__ */ c(_, { children: [l.label && /* @__PURE__ */ e("span", {
166
- className: "control-panel__filter-title",
167
- children: l.label
168
- }), /* @__PURE__ */ e("div", {
169
- className: "control-panel__filter-chips",
170
- children: l.options.map((a) => {
171
- const d = l.value.includes(a.value);
172
- return /* @__PURE__ */ e(f, {
173
- disabled: a.disabled,
174
- icon: a.icon,
175
- title: a.title,
176
- selected: d,
177
- onClick: () => {
178
- if (a.disabled) return;
179
- const h = d ? l.value.filter((v) => v !== a.value) : [...l.value, a.value];
180
- m?.({
181
- optionId: l.id,
182
- value: h
183
- });
184
- },
185
- children: a.label
186
- }, a.value);
187
- })
188
- })] })
189
- ]
190
- })] }, l.id);
191
- })]
192
- }, n.id ?? n.label ?? t))
193
- ]
194
- });
192
+ })] })
193
+ ]
194
+ })] }, l.id);
195
+ })]
196
+ }, n.id ?? n.label ?? t))
197
+ ]
198
+ });
199
+ };
195
200
  export {
196
- W as ControlPanelOptions
201
+ H as ControlPanelOptions
197
202
  };