@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,142 +1,151 @@
1
1
  import { Icon as b } from "../Icon/Icon2.js";
2
- import { Button as V } from "../Button/Button2.js";
3
- import { Tooltip as f } from "../Tooltip/Tooltip2.js";
2
+ import { libMessages as R } from "../../contexts/LanguageContext/libMessages.js";
3
+ import { useMessages as M } from "../../hooks/useLanguage.js";
4
+ import { Button as j } from "../Button/Button2.js";
5
+ import { Tooltip as A } from "../Tooltip/Tooltip2.js";
4
6
  import { Chip as I } from "../Chip/Chip2.js";
5
- import { InputNumber as D } from "../InputNumber/InputNumber2.js";
6
- import { InputText as j } from "../InputText/InputText2.js";
7
- import { DatePicker as H } from "../DatePicker/DatePicker2.js";
7
+ import { InputNumber as $ } from "../InputNumber/InputNumber2.js";
8
+ import { InputText as U } from "../InputText/InputText2.js";
9
+ import { DatePicker as B } from "../DatePicker/DatePicker2.js";
8
10
  import { Dropdown as O } from "../Dropdown/Dropdown2.js";
9
- import { InputDate as U } from "../InputDate/InputDate2.js";
10
- import { InputSearch as L } from "../InputSearch/InputSearch2.js";
11
- import { Rating as B } from "../Rating/Rating2.js";
12
- import { DEFAULT_DATE_RANGE_PRESETS as Y } from "./ControlPanel.types.js";
13
- import { Fragment as R, useEffect as z, useMemo as E, useRef as G, useState as C } from "react";
14
- import { jsx as n, jsxs as v } from "react/jsx-runtime";
15
- var W = 3, w = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean" ? [] : [e], $ = (e) => e.every((l) => typeof l == "number") ? e : e.map(String), y = (e, l) => String(e) === String(l), M = "No longer available. Click to remove.", q = (e, l) => e.filter((t) => t !== "" && !l.some((o) => y(o.value, t))).map((t) => ({
11
+ import { InputDate as Y } from "../InputDate/InputDate2.js";
12
+ import { InputSearch as T } from "../InputSearch/InputSearch2.js";
13
+ import { Rating as z } from "../Rating/Rating2.js";
14
+ import { DEFAULT_DATE_RANGE_PRESETS as G } from "./ControlPanel.types.js";
15
+ import { Fragment as P, useEffect as W, useMemo as L, useRef as q, useState as E } from "react";
16
+ import { jsx as n, jsxs as _ } from "react/jsx-runtime";
17
+ var J = 3, C = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean" ? [] : [e], w = (e) => e.every((r) => typeof r == "number") ? e : e.map(String), y = (e, r) => String(e) === String(r), K = (e, r, o) => e.filter((t) => t !== "" && !r.some((s) => y(s.value, t))).map((t) => ({
16
18
  className: "control-panel__filter-option--stale",
17
- details: "No longer available",
19
+ details: o,
18
20
  icon: "warning",
19
21
  label: String(t),
20
22
  value: t
21
- })), k = 2, J = (e) => {
22
- const l = e.options ?? [];
23
- return w(e.value).map((t) => l.find((o) => y(o.value, t))?.label ?? String(t));
24
- }, K = (e) => {
25
- const { type: l, value: t } = e;
23
+ })), k = 2, Q = (e) => {
24
+ const r = e.options ?? [];
25
+ return C(e.value).map((o) => r.find((t) => y(t.value, o))?.label ?? String(o));
26
+ }, X = (e, r) => {
27
+ const { type: o, value: t } = e;
26
28
  if (t == null || t === "") return;
27
- if (l === "checkbox") return t === !0 ? "On" : void 0;
28
- if (l === "range") {
29
- const [c, i] = Array.isArray(t) ? t : [];
30
- return c === void 0 && i === void 0 ? void 0 : c === void 0 ? `≤ ${i}` : i === void 0 ? `≥ ${c}` : `${c} – ${i}`;
29
+ if (o === "checkbox") return t === !0 ? r.filterOn : void 0;
30
+ if (o === "range") {
31
+ const [i, d] = Array.isArray(t) ? t : [];
32
+ return i === void 0 && d === void 0 ? void 0 : i === void 0 ? `≤ ${d}` : d === void 0 ? `≥ ${i}` : `${i} – ${d}`;
31
33
  }
32
- if (l === "date-range") {
33
- const [c, i] = Array.isArray(t) ? t : [];
34
- return !c && !i ? void 0 : c ? i ? `${c} → ${i}` : `from ${c}` : `until ${i}`;
34
+ if (o === "date-range") {
35
+ const [i, d] = Array.isArray(t) ? t : [];
36
+ return !i && !d ? void 0 : i ? d ? `${i} → ${d}` : r.filterFrom(i) : r.filterUntil(d);
35
37
  }
36
- if (l === "rating") return typeof t == "number" && t > 0 ? String(t) : void 0;
37
- if (l === "text" || l === "search" || l === "date" || l === "number") return String(t);
38
- const o = J(e);
39
- if (o.length !== 0)
40
- return o.length <= k ? o.join(", ") : `${o.slice(0, k).join(", ")} +${o.length - k}`;
41
- }, me = ({ filter: e, collapsible: l = !1, onChange: t }) => {
42
- const o = l && e.type !== "checkbox", [c, i] = C(e.defaultExpanded ?? !1), _ = e.summary ?? K(e), N = /* @__PURE__ */ v("span", {
38
+ if (o === "rating") return typeof t == "number" && t > 0 ? String(t) : void 0;
39
+ if (o === "text" || o === "search" || o === "date" || o === "number") return String(t);
40
+ const s = Q(e);
41
+ if (s.length !== 0)
42
+ return s.length <= k ? s.join(", ") : `${s.slice(0, k).join(", ")} +${s.length - k}`;
43
+ }, ye = ({ filter: e, collapsible: r = !1, onChange: o }) => {
44
+ const t = M(R), s = r && e.type !== "checkbox", [i, d] = E(e.defaultExpanded ?? !1), N = e.summary ?? X(e, t), x = /* @__PURE__ */ _("span", {
43
45
  className: `control-panel__filter-title${e.isActive ? " control-panel__filter-title--active" : ""}`,
44
46
  children: [
45
47
  e.isActive && /* @__PURE__ */ n("span", { className: "control-panel__filter-active-dot" }),
46
48
  e.icon && /* @__PURE__ */ n(b, { name: e.icon }),
47
49
  e.label
48
50
  ]
49
- }), A = [
51
+ }), D = [
50
52
  "control-panel__filter",
51
53
  e.type === "checkbox" ? "control-panel__filter--checkbox" : "",
52
- o ? "control-panel__filter--collapsible" : "",
53
- o && !c ? "control-panel__filter--collapsed" : ""
54
+ s ? "control-panel__filter--collapsible" : "",
55
+ s && !i ? "control-panel__filter--collapsed" : ""
54
56
  ].filter(Boolean).join(" ");
55
- return /* @__PURE__ */ v("div", {
56
- className: A,
57
- children: [o ? /* @__PURE__ */ v("button", {
57
+ return /* @__PURE__ */ _("div", {
58
+ className: D,
59
+ children: [s ? /* @__PURE__ */ _("button", {
58
60
  className: "control-panel__filter-toggle",
59
61
  type: "button",
60
- onClick: () => i((a) => !a),
62
+ onClick: () => d((a) => !a),
61
63
  children: [
62
- N,
63
- !c && _ && /* @__PURE__ */ n("span", {
64
+ x,
65
+ !i && N && /* @__PURE__ */ n("span", {
64
66
  className: "control-panel__filter-summary",
65
- children: _
67
+ children: N
66
68
  }),
67
69
  /* @__PURE__ */ n("span", {
68
70
  className: "control-panel__filter-caret",
69
- children: /* @__PURE__ */ n(b, { name: c ? "caret-up" : "caret-down" })
71
+ children: /* @__PURE__ */ n(b, { name: i ? "caret-up" : "caret-down" })
70
72
  })
71
73
  ]
72
- }) : e.type !== "checkbox" && N, (!o || c) && /* @__PURE__ */ n(X, {
74
+ }) : e.type !== "checkbox" && x, (!s || i) && /* @__PURE__ */ n(F, {
73
75
  filter: e,
74
- onChange: t
76
+ onChange: o
75
77
  })]
76
78
  });
77
- }, Q = ({ placeholder: e, value: l, onChange: t }) => {
78
- const [o, c] = C(l), i = G(l);
79
- return z(() => {
80
- l !== i.current && (i.current = l, c(l));
81
- }, [l]), /* @__PURE__ */ n(L, {
79
+ }, Z = ({ placeholder: e, value: r, onChange: o }) => {
80
+ const [t, s] = E(r), i = q(r);
81
+ return W(() => {
82
+ r !== i.current && (i.current = r, s(r));
83
+ }, [r]), /* @__PURE__ */ n(T, {
82
84
  className: "control-panel__filter-search",
83
- onChange: (_) => {
84
- i.current = _, c(_), t(_);
85
+ onChange: (d) => {
86
+ i.current = d, s(d), o(d);
85
87
  },
86
88
  placeholder: e,
87
- value: o
89
+ value: t
88
90
  });
89
- }, T = ({ option: e, onRemove: l }) => /* @__PURE__ */ n(f, {
90
- title: M,
91
- children: /* @__PURE__ */ n("div", {
92
- className: "control-panel__filter-radio control-panel__filter-radio--selected control-panel__filter-radio--stale",
93
- children: /* @__PURE__ */ v("label", {
94
- className: "control-panel__filter-radio-label",
95
- children: [
96
- /* @__PURE__ */ n("input", {
97
- checked: !0,
98
- className: "control-panel__filter-radio-input",
99
- onChange: l,
100
- type: "checkbox"
101
- }),
102
- /* @__PURE__ */ n(b, {
103
- className: "control-panel__filter-icon",
104
- name: "warning"
105
- }),
106
- /* @__PURE__ */ n("span", {
107
- className: "control-panel__filter-label",
108
- children: e.label
109
- }),
110
- /* @__PURE__ */ n(b, {
111
- className: "control-panel__filter-icon",
112
- name: "clear"
113
- })
114
- ]
91
+ }, V = ({ option: e, onRemove: r }) => {
92
+ const o = M(R);
93
+ return /* @__PURE__ */ n(A, {
94
+ title: o.filterStaleHint,
95
+ children: /* @__PURE__ */ n("div", {
96
+ className: "control-panel__filter-radio control-panel__filter-radio--selected control-panel__filter-radio--stale",
97
+ children: /* @__PURE__ */ _("label", {
98
+ className: "control-panel__filter-radio-label",
99
+ children: [
100
+ /* @__PURE__ */ n("input", {
101
+ checked: !0,
102
+ className: "control-panel__filter-radio-input",
103
+ onChange: r,
104
+ type: "checkbox"
105
+ }),
106
+ /* @__PURE__ */ n(b, {
107
+ className: "control-panel__filter-icon",
108
+ name: "warning"
109
+ }),
110
+ /* @__PURE__ */ n("span", {
111
+ className: "control-panel__filter-label",
112
+ children: e.label
113
+ }),
114
+ /* @__PURE__ */ n(b, {
115
+ className: "control-panel__filter-icon",
116
+ name: "clear"
117
+ })
118
+ ]
119
+ })
115
120
  })
116
- })
117
- }), X = ({ filter: e, onChange: l }) => {
118
- const t = w(e.value), o = e.options ?? [], c = E(() => q(w(e.value), e.options ?? []), [e.value, e.options]), i = E(() => c.length > 0 ? [...c, ...e.options ?? []] : e.options ?? [], [c, e.options]), _ = () => l({
121
+ });
122
+ }, F = ({ filter: e, onChange: r }) => {
123
+ const o = M(R), t = C(e.value), s = e.options ?? [], i = L(() => K(C(e.value), e.options ?? [], o.filterStaleDetails), [
124
+ e.value,
125
+ e.options,
126
+ o.filterStaleDetails
127
+ ]), d = L(() => i.length > 0 ? [...i, ...e.options ?? []] : e.options ?? [], [i, e.options]), N = () => r({
119
128
  filterId: e.id,
120
129
  type: e.type,
121
130
  value: null,
122
131
  option: null,
123
132
  options: []
124
- }), [N, A] = C("");
133
+ }), [x, D] = E("");
125
134
  if (e.type === "checkbox") return /* @__PURE__ */ n(I, {
126
135
  count: e.count,
127
136
  selected: e.value === !0,
128
- onClick: () => l({
137
+ onClick: () => r({
129
138
  filterId: e.id,
130
139
  type: e.type,
131
140
  value: e.value !== !0
132
141
  }),
133
142
  children: e.label
134
143
  });
135
- if (e.type === "date") return /* @__PURE__ */ n(U, {
144
+ if (e.type === "date") return /* @__PURE__ */ n(Y, {
136
145
  min: e.minDate,
137
146
  max: e.maxDate,
138
147
  value: typeof e.value == "string" ? e.value : "",
139
- onChange: (a) => l({
148
+ onChange: (a) => r({
140
149
  filterId: e.id,
141
150
  type: e.type,
142
151
  value: a ?? null
@@ -144,8 +153,8 @@ var W = 3, w = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
144
153
  });
145
154
  if (e.type === "text") return /* @__PURE__ */ n("div", {
146
155
  className: "control-panel__filter-text",
147
- children: /* @__PURE__ */ n(j, {
148
- onChange: (a) => l({
156
+ children: /* @__PURE__ */ n(U, {
157
+ onChange: (a) => r({
149
158
  filterId: e.id,
150
159
  type: e.type,
151
160
  value: a
@@ -154,10 +163,10 @@ var W = 3, w = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
154
163
  value: typeof e.value == "string" ? e.value : ""
155
164
  })
156
165
  });
157
- if (e.type === "search") return /* @__PURE__ */ n(Q, {
166
+ if (e.type === "search") return /* @__PURE__ */ n(Z, {
158
167
  placeholder: e.placeholder,
159
168
  value: typeof e.value == "string" ? e.value : "",
160
- onChange: (a) => l({
169
+ onChange: (a) => r({
161
170
  filterId: e.id,
162
171
  type: e.type,
163
172
  value: a
@@ -165,102 +174,105 @@ var W = 3, w = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
165
174
  });
166
175
  if (e.type === "number") return /* @__PURE__ */ n("div", {
167
176
  className: "control-panel__filter-number",
168
- children: /* @__PURE__ */ n(D, {
177
+ children: /* @__PURE__ */ n($, {
169
178
  min: e.min,
170
179
  max: e.max,
171
180
  step: e.step,
172
181
  placeholder: e.placeholder,
173
182
  value: typeof e.value == "number" ? e.value : void 0,
174
- onChange: (a) => l({
183
+ onChange: (a) => r({
175
184
  filterId: e.id,
176
185
  type: e.type,
177
186
  value: a ?? null
178
187
  })
179
188
  })
180
189
  });
181
- if (e.type === "rating") return /* @__PURE__ */ n(B, {
190
+ if (e.type === "rating") return /* @__PURE__ */ n(z, {
182
191
  selectable: !0,
183
192
  icon: e.ratingIcon ?? "star",
184
193
  maxRate: e.maxRate ?? 10,
185
194
  rating: typeof e.value == "number" ? e.value : 0,
186
195
  variant: e.ratingVariant ?? "warning",
187
- onSelect: (a) => l({
196
+ onSelect: (a) => r({
188
197
  filterId: e.id,
189
198
  type: e.type,
190
199
  value: a
191
200
  })
192
201
  });
193
202
  if (e.type === "range") {
194
- const a = Array.isArray(e.value) ? e.value : [], d = a[0], r = a[1], m = d !== void 0 && r !== void 0 && d > r, u = (p, h) => l({
203
+ const a = Array.isArray(e.value) ? e.value : [], p = a[0], l = a[1], v = p !== void 0 && l !== void 0 && p > l, m = (u, h) => r({
195
204
  filterId: e.id,
196
205
  type: e.type,
197
- value: [p, h]
206
+ value: [u, h]
198
207
  });
199
- return /* @__PURE__ */ v("div", {
208
+ return /* @__PURE__ */ _("div", {
200
209
  className: "control-panel__filter-range",
201
210
  children: [
202
- /* @__PURE__ */ n(D, {
211
+ /* @__PURE__ */ n($, {
203
212
  min: e.min,
204
213
  max: e.max,
205
214
  step: e.step,
206
- placeholder: "Min",
207
- value: d,
208
- error: m ? "Min exceeds max" : void 0,
209
- onChange: (p) => u(p, r)
215
+ placeholder: o.rangeMin,
216
+ value: p,
217
+ error: v ? o.rangeMinExceedsMax : void 0,
218
+ onChange: (u) => m(u, l)
210
219
  }),
211
220
  /* @__PURE__ */ n("span", {
212
221
  className: "control-panel__filter-range-sep",
213
222
  children: "—"
214
223
  }),
215
- /* @__PURE__ */ n(D, {
224
+ /* @__PURE__ */ n($, {
216
225
  min: e.min,
217
226
  max: e.max,
218
227
  step: e.step,
219
- placeholder: "Max",
220
- value: r,
221
- error: m ? "Max is below min" : void 0,
222
- onChange: (p) => u(d, p)
228
+ placeholder: o.rangeMax,
229
+ value: l,
230
+ error: v ? o.rangeMaxBelowMin : void 0,
231
+ onChange: (u) => m(p, u)
223
232
  })
224
233
  ]
225
234
  });
226
235
  }
227
236
  if (e.type === "date-range") {
228
- const a = Array.isArray(e.value) ? e.value : [], d = a[0] || void 0, r = a[1] || void 0, m = e.presets ?? Y, u = (s) => {
229
- if (!s) return;
230
- const [g, S, P] = s.split("-").map(Number);
231
- return new Date(g, S - 1, P);
232
- }, p = (s) => `${s.getFullYear()}-${String(s.getMonth() + 1).padStart(2, "0")}-${String(s.getDate()).padStart(2, "0")}`, h = (s, g) => l({
237
+ const a = Array.isArray(e.value) ? e.value : [], p = a[0] || void 0, l = a[1] || void 0, v = e.presets ?? G.map((c) => ({
238
+ ...c,
239
+ label: o.datePresetDays(c.days)
240
+ })), m = (c) => {
241
+ if (!c) return;
242
+ const [g, S, H] = c.split("-").map(Number);
243
+ return new Date(g, S - 1, H);
244
+ }, u = (c) => `${c.getFullYear()}-${String(c.getMonth() + 1).padStart(2, "0")}-${String(c.getDate()).padStart(2, "0")}`, h = (c, g) => r({
233
245
  filterId: e.id,
234
246
  type: e.type,
235
- value: [s ?? "", g ?? ""]
236
- }), x = (s) => {
237
- const g = e.maxDate ? u(e.maxDate) : /* @__PURE__ */ new Date();
247
+ value: [c ?? "", g ?? ""]
248
+ }), f = (c) => {
249
+ const g = e.maxDate ? m(e.maxDate) : /* @__PURE__ */ new Date();
238
250
  if (!g) return;
239
251
  const S = new Date(g);
240
- S.setDate(S.getDate() - s), h(p(S), p(g));
252
+ S.setDate(S.getDate() - c), h(u(S), u(g));
241
253
  };
242
- return /* @__PURE__ */ v("div", {
254
+ return /* @__PURE__ */ _("div", {
243
255
  className: "control-panel__filter-date-range",
244
- children: [m.length > 0 && /* @__PURE__ */ n("div", {
256
+ children: [v.length > 0 && /* @__PURE__ */ n("div", {
245
257
  className: "control-panel__filter-date-presets",
246
- children: m.map((s) => /* @__PURE__ */ n(V, {
258
+ children: v.map((c) => /* @__PURE__ */ n(j, {
247
259
  size: "small",
248
260
  variant: "default",
249
- onClick: () => x(s.days),
250
- children: s.label
251
- }, s.days))
252
- }), /* @__PURE__ */ n(H, {
261
+ onClick: () => f(c.days),
262
+ children: c.label
263
+ }, c.days))
264
+ }), /* @__PURE__ */ n(B, {
253
265
  mode: "range",
254
- minDate: u(e.minDate),
255
- maxDate: u(e.maxDate),
256
- placeholder: e.placeholder ?? "Select range",
257
- value: d && r ? {
258
- start: u(d),
259
- end: u(r)
266
+ minDate: m(e.minDate),
267
+ maxDate: m(e.maxDate),
268
+ placeholder: e.placeholder ?? o.selectRange,
269
+ value: p && l ? {
270
+ start: m(p),
271
+ end: m(l)
260
272
  } : void 0,
261
- onChange: (s) => {
262
- if (s && typeof s == "object" && !Array.isArray(s) && "start" in s) {
263
- h(p(s.start), p(s.end));
273
+ onChange: (c) => {
274
+ if (c && typeof c == "object" && !Array.isArray(c) && "start" in c) {
275
+ h(u(c.start), u(c.end));
264
276
  return;
265
277
  }
266
278
  h(void 0, void 0);
@@ -269,23 +281,23 @@ var W = 3, w = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
269
281
  });
270
282
  }
271
283
  if (e.type === "dropdown")
272
- return !e.multiple && o.length > 0 && o.length <= W ? /* @__PURE__ */ v("div", {
284
+ return !e.multiple && s.length > 0 && s.length <= J ? /* @__PURE__ */ _("div", {
273
285
  className: `control-panel__filter-list ${e.inline ? "control-panel__filter-list--inline" : ""}`,
274
- children: [c.map((a) => /* @__PURE__ */ n(T, {
286
+ children: [i.map((a) => /* @__PURE__ */ n(V, {
275
287
  option: a,
276
- onRemove: _
277
- }, `stale-${a.value}`)), o.map((a) => {
278
- const d = t.some((r) => y(r, a.value));
288
+ onRemove: N
289
+ }, `stale-${a.value}`)), s.map((a) => {
290
+ const p = t.some((l) => y(l, a.value));
279
291
  return /* @__PURE__ */ n("div", {
280
- className: `control-panel__filter-radio ${d ? "control-panel__filter-radio--selected" : ""}`,
281
- children: /* @__PURE__ */ v("label", {
292
+ className: `control-panel__filter-radio ${p ? "control-panel__filter-radio--selected" : ""}`,
293
+ children: /* @__PURE__ */ _("label", {
282
294
  className: "control-panel__filter-radio-label",
283
295
  children: [
284
296
  /* @__PURE__ */ n("input", {
285
- checked: d,
297
+ checked: p,
286
298
  className: "control-panel__filter-radio-input",
287
299
  name: e.id,
288
- onChange: () => l({
300
+ onChange: () => r({
289
301
  filterId: e.id,
290
302
  type: e.type,
291
303
  value: a.value,
@@ -317,16 +329,16 @@ var W = 3, w = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
317
329
  multiple: e.multiple,
318
330
  name: e.id,
319
331
  onChange: (a) => {
320
- const d = Array.isArray(a) ? a : a ? [a] : [];
321
- l({
332
+ const p = Array.isArray(a) ? a : a ? [a] : [];
333
+ r({
322
334
  filterId: e.id,
323
335
  type: e.type,
324
- value: Array.isArray(a) ? $(a.map((r) => r.value)) : a?.value ?? null,
336
+ value: Array.isArray(a) ? w(a.map((l) => l.value)) : a?.value ?? null,
325
337
  option: Array.isArray(a) ? null : a,
326
- options: d
338
+ options: p
327
339
  });
328
340
  },
329
- options: i,
341
+ options: d,
330
342
  placeholder: e.placeholder,
331
343
  searchable: e.searchable ?? !0,
332
344
  selectedCountDisplay: "inline",
@@ -334,88 +346,88 @@ var W = 3, w = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
334
346
  value: typeof e.value == "boolean" ? null : e.value
335
347
  });
336
348
  if (e.type === "chips") {
337
- const a = N.trim().toLowerCase(), d = e.searchable && a ? o.filter((r) => r.label.toLowerCase().includes(a)) : o;
338
- return /* @__PURE__ */ v("div", {
349
+ const a = x.trim().toLowerCase(), p = e.searchable && a ? s.filter((l) => l.label.toLowerCase().includes(a)) : s;
350
+ return /* @__PURE__ */ _("div", {
339
351
  className: "control-panel__filter-chips-wrap",
340
- children: [e.searchable && o.length > 0 && /* @__PURE__ */ n(L, {
352
+ children: [e.searchable && s.length > 0 && /* @__PURE__ */ n(T, {
341
353
  className: "control-panel__filter-chip-search",
342
- value: N,
343
- onChange: A,
344
- placeholder: e.placeholder ?? "Filter..."
345
- }), /* @__PURE__ */ v("div", {
354
+ value: x,
355
+ onChange: D,
356
+ placeholder: e.placeholder ?? o.filterPlaceholder
357
+ }), /* @__PURE__ */ _("div", {
346
358
  className: `control-panel__filter-chips${e.inline === !1 ? " control-panel__filter-chips--stacked" : ""}`,
347
359
  style: e.maxHeight !== void 0 ? {
348
360
  maxHeight: typeof e.maxHeight == "number" ? `${e.maxHeight}px` : e.maxHeight,
349
361
  overflowY: "auto"
350
362
  } : void 0,
351
- children: [c.map((r) => /* @__PURE__ */ n(f, {
352
- title: M,
363
+ children: [i.map((l) => /* @__PURE__ */ n(A, {
364
+ title: o.filterStaleHint,
353
365
  children: /* @__PURE__ */ n(I, {
354
366
  className: "control-panel__filter-chip--stale",
355
367
  icon: "warning",
356
368
  selected: !0,
357
369
  variant: "warning",
358
370
  onClick: () => {
359
- const m = t.filter((u) => !y(u, r.value));
360
- l({
371
+ const v = t.filter((m) => !y(m, l.value));
372
+ r({
361
373
  filterId: e.id,
362
374
  type: e.type,
363
- value: e.multiple === !1 ? null : $(m),
375
+ value: e.multiple === !1 ? null : w(v),
364
376
  option: null,
365
- options: o.filter((u) => m.some((p) => y(p, u.value)))
377
+ options: s.filter((m) => v.some((u) => y(u, m.value)))
366
378
  });
367
379
  },
368
- children: r.label
380
+ children: l.label
369
381
  })
370
- }, `stale-${r.value}`)), d.map((r) => {
371
- const m = t.some((p) => y(p, r.value)), u = /* @__PURE__ */ v(I, {
372
- color: r.color,
373
- count: r.count,
374
- disabled: r.disabled,
375
- icon: r.icon,
376
- selected: m,
382
+ }, `stale-${l.value}`)), p.map((l) => {
383
+ const v = t.some((u) => y(u, l.value)), m = /* @__PURE__ */ _(I, {
384
+ color: l.color,
385
+ count: l.count,
386
+ disabled: l.disabled,
387
+ icon: l.icon,
388
+ selected: v,
377
389
  onClick: () => {
378
- if (r.disabled) return;
379
- const p = e.multiple === !1, h = p ? m ? [] : [r.value] : m ? t.filter((x) => !y(x, r.value)) : [...t, r.value];
380
- l({
390
+ if (l.disabled) return;
391
+ const u = e.multiple === !1, h = u ? v ? [] : [l.value] : v ? t.filter((f) => !y(f, l.value)) : [...t, l.value];
392
+ r({
381
393
  filterId: e.id,
382
394
  type: e.type,
383
- value: p ? h[0] ?? null : $(h),
384
- option: r,
385
- options: o.filter((x) => h.some((s) => y(s, x.value)))
395
+ value: u ? h[0] ?? null : w(h),
396
+ option: l,
397
+ options: s.filter((f) => h.some((c) => y(c, f.value)))
386
398
  });
387
399
  },
388
- children: [r.imageUrl && /* @__PURE__ */ n("img", {
400
+ children: [l.imageUrl && /* @__PURE__ */ n("img", {
389
401
  className: "control-panel__filter-chip-avatar",
390
- src: r.imageUrl,
402
+ src: l.imageUrl,
391
403
  alt: ""
392
- }), r.label]
404
+ }), l.label]
393
405
  });
394
- return r.tooltip ? /* @__PURE__ */ n(f, {
395
- title: r.tooltip,
396
- children: u
397
- }, r.value) : /* @__PURE__ */ n(R, { children: u }, r.value);
406
+ return l.tooltip ? /* @__PURE__ */ n(A, {
407
+ title: l.tooltip,
408
+ children: m
409
+ }, l.value) : /* @__PURE__ */ n(P, { children: m }, l.value);
398
410
  })]
399
411
  })]
400
412
  });
401
413
  }
402
- return /* @__PURE__ */ v("div", {
414
+ return /* @__PURE__ */ _("div", {
403
415
  className: `control-panel__filter-list ${e.inline ? "control-panel__filter-list--inline" : ""}`,
404
- children: [c.map((a) => /* @__PURE__ */ n(T, {
416
+ children: [i.map((a) => /* @__PURE__ */ n(V, {
405
417
  option: a,
406
- onRemove: _
407
- }, `stale-${a.value}`)), o.map((a) => {
408
- const d = t.some((m) => y(m, a.value)), r = /* @__PURE__ */ n("div", {
409
- className: `control-panel__filter-radio ${d ? "control-panel__filter-radio--selected" : ""} ${a.disabled ? "control-panel__filter-radio--disabled" : ""}`,
410
- children: /* @__PURE__ */ v("label", {
418
+ onRemove: N
419
+ }, `stale-${a.value}`)), s.map((a) => {
420
+ const p = t.some((v) => y(v, a.value)), l = /* @__PURE__ */ n("div", {
421
+ className: `control-panel__filter-radio ${p ? "control-panel__filter-radio--selected" : ""} ${a.disabled ? "control-panel__filter-radio--disabled" : ""}`,
422
+ children: /* @__PURE__ */ _("label", {
411
423
  className: "control-panel__filter-radio-label",
412
424
  children: [
413
425
  /* @__PURE__ */ n("input", {
414
- checked: d,
426
+ checked: p,
415
427
  className: "control-panel__filter-radio-input",
416
428
  disabled: a.disabled,
417
429
  name: e.id,
418
- onChange: () => l({
430
+ onChange: () => r({
419
431
  filterId: e.id,
420
432
  type: e.type,
421
433
  value: a.value,
@@ -444,13 +456,13 @@ var W = 3, w = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
444
456
  ]
445
457
  })
446
458
  });
447
- return a.tooltip ? /* @__PURE__ */ n(f, {
459
+ return a.tooltip ? /* @__PURE__ */ n(A, {
448
460
  title: a.tooltip,
449
- children: r
450
- }, a.value) : /* @__PURE__ */ n(R, { children: r }, a.value);
461
+ children: l
462
+ }, a.value) : /* @__PURE__ */ n(P, { children: l }, a.value);
451
463
  })]
452
464
  });
453
465
  };
454
466
  export {
455
- me as ControlPanelFilterItem
467
+ ye as ControlPanelFilterItem
456
468
  };