@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,197 +1,202 @@
|
|
|
1
|
-
import { Icon as
|
|
2
|
-
import {
|
|
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
|
|
5
|
-
import { Chip as
|
|
6
|
-
import { Slider as
|
|
7
|
-
import
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
className: "control-panel__options-
|
|
28
|
-
children: "
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
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:
|
|
112
|
-
}),
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
201
|
+
H as ControlPanelOptions
|
|
197
202
|
};
|