@krosoft/react 0.0.228 → 0.0.229

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.
@@ -1,4 +1,4 @@
1
- import { jsxs as a, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
2
  import * as M from "react";
3
3
  import { useState as S, useRef as G, useEffect as X, useMemo as q } from "react";
4
4
  import { C as j, b0 as E, b2 as R, b1 as _ } from "./toggle-group-DLLrEwv2.js";
@@ -8,7 +8,7 @@ import { B as v, f as H } from "./tooltip-DVeqVwqV.js";
8
8
  import "./chart-DntJZGxB.js";
9
9
  import "@radix-ui/react-collapsible";
10
10
  import { C as J, m as Q, o as U, k as W, l as Y, n as T, I as Z } from "./sheet-tuC_C3M3.js";
11
- import { CalendarIcon as O, XIcon as I, ChevronDownIcon as ee, CheckIcon as te, PlusIcon as re, SearchIcon as ae } from "lucide-react";
11
+ import { CalendarIcon as O, XIcon as I, ChevronDownIcon as ee, CheckIcon as te, PlusIcon as re, SearchIcon as oe } from "lucide-react";
12
12
  import "react-resizable-panels";
13
13
  import { c as g } from "./tailwind.helper-B6yFEsav.js";
14
14
  import "./select-BpjFWqAY.js";
@@ -20,23 +20,23 @@ import "react-i18next";
20
20
  import { u as P } from "./useKrosoftTranslation-DtdbUewZ.js";
21
21
  import "date-fns/locale";
22
22
  const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
23
- const f = V(), [o, c] = S(!1), d = G(null);
23
+ const f = V(), [a, c] = S(!1), d = G(null);
24
24
  X(() => {
25
- if (!o) return;
25
+ if (!a) return;
26
26
  const s = (h) => {
27
27
  d.current !== null && !d.current.contains(h.target) && c(!1);
28
28
  };
29
29
  return document.addEventListener("mousedown", s), () => {
30
30
  document.removeEventListener("mousedown", s);
31
31
  };
32
- }, [o]);
32
+ }, [a]);
33
33
  const u = () => {
34
34
  c((s) => !s);
35
35
  }, i = (s) => {
36
36
  l(s), c(!1);
37
37
  };
38
- return /* @__PURE__ */ a("div", { ref: d, className: "relative w-full", children: [
39
- /* @__PURE__ */ a(
38
+ return /* @__PURE__ */ o("div", { ref: d, className: "relative w-full", children: [
39
+ /* @__PURE__ */ o(
40
40
  v,
41
41
  {
42
42
  variant: "outline",
@@ -44,7 +44,7 @@ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
44
44
  onClick: u,
45
45
  className: g(
46
46
  "w-full justify-start text-left font-normal focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
47
- o && "ring-2 ring-ring ring-offset-2",
47
+ a && "ring-2 ring-ring ring-offset-2",
48
48
  r === void 0 && "text-muted-foreground"
49
49
  ),
50
50
  children: [
@@ -53,10 +53,10 @@ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
53
53
  ]
54
54
  }
55
55
  ),
56
- o ? /* @__PURE__ */ e("div", { className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-surface border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: /* @__PURE__ */ e(j, { mode: "single", locale: f, selected: r, onSelect: i }) }) : null
56
+ a ? /* @__PURE__ */ e("div", { className: "absolute left-0 top-[calc(100%+4px)] z-[100] rounded-surface border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: /* @__PURE__ */ e(j, { mode: "single", locale: f, defaultMonth: r, selected: r, onSelect: i }) }) : null
57
57
  ] });
58
58
  }, Me = ({ value: r, onChange: l, placeholder: p, className: f }) => {
59
- const { t: o } = P(), c = V(), [d, u] = M.useState(!1), [i, s] = M.useState(r);
59
+ const { t: a } = P(), c = V(), [d, u] = M.useState(!1), [i, s] = M.useState(r);
60
60
  M.useEffect(() => {
61
61
  d && s(r);
62
62
  }, [d, r]);
@@ -68,9 +68,9 @@ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
68
68
  s(r), u(!1);
69
69
  }, N = () => {
70
70
  s(void 0);
71
- }, w = (n) => n != null && n.from ? !n.to || n.from.getTime() === n.to.getTime() ? x(n.from, "dd MMM yyyy", { locale: c }) : `${x(n.from, "dd MMM yyyy", { locale: c })} - ${x(n.to, "dd MMM yyyy", { locale: c })}` : p ?? o("date.pickPeriod");
72
- return /* @__PURE__ */ e("div", { className: g("grid gap-2", f), children: /* @__PURE__ */ a(E, { open: d, onOpenChange: u, children: [
73
- /* @__PURE__ */ e(R, { asChild: !0, children: /* @__PURE__ */ a(v, { id: "date", variant: "outline", className: g("w-[300px] justify-start text-left font-normal", !(r != null && r.from) && "text-muted-foreground"), children: [
71
+ }, w = (n) => n != null && n.from ? !n.to || n.from.getTime() === n.to.getTime() ? x(n.from, "dd MMM yyyy", { locale: c }) : `${x(n.from, "dd MMM yyyy", { locale: c })} - ${x(n.to, "dd MMM yyyy", { locale: c })}` : p ?? a("date.pickPeriod");
72
+ return /* @__PURE__ */ e("div", { className: g("grid gap-2", f), children: /* @__PURE__ */ o(E, { open: d, onOpenChange: u, children: [
73
+ /* @__PURE__ */ e(R, { asChild: !0, children: /* @__PURE__ */ o(v, { id: "date", variant: "outline", className: g("w-[300px] justify-start text-left font-normal", !(r != null && r.from) && "text-muted-foreground"), children: [
74
74
  /* @__PURE__ */ e(O, { className: "mr-2 size-4" }),
75
75
  w(r),
76
76
  (r == null ? void 0 : r.from) && /* @__PURE__ */ e(
@@ -79,14 +79,14 @@ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
79
79
  type: "button",
80
80
  variant: "ghost",
81
81
  size: "icon",
82
- "aria-label": o("date.clearPeriod"),
82
+ "aria-label": a("date.clearPeriod"),
83
83
  className: "ml-auto h-5 w-5 opacity-50 hover:opacity-100",
84
84
  onClick: h,
85
85
  children: /* @__PURE__ */ e(I, { className: "size-4" })
86
86
  }
87
87
  )
88
88
  ] }) }),
89
- /* @__PURE__ */ a(_, { className: "w-auto p-0", align: "start", side: "bottom", sideOffset: 4, children: [
89
+ /* @__PURE__ */ o(_, { className: "w-auto p-0", align: "start", side: "bottom", sideOffset: 4, children: [
90
90
  /* @__PURE__ */ e(
91
91
  j,
92
92
  {
@@ -99,11 +99,11 @@ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
99
99
  className: "pointer-events-auto p-3"
100
100
  }
101
101
  ),
102
- /* @__PURE__ */ a("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
103
- /* @__PURE__ */ e(v, { variant: "ghost", size: "sm", onClick: N, children: o("actions.clear") }),
104
- /* @__PURE__ */ a("div", { className: "flex gap-2", children: [
105
- /* @__PURE__ */ e(v, { variant: "ghost", size: "sm", onClick: y, children: o("actions.cancel") }),
106
- /* @__PURE__ */ e(v, { size: "sm", onClick: k, children: o("actions.apply") })
102
+ /* @__PURE__ */ o("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
103
+ /* @__PURE__ */ e(v, { variant: "ghost", size: "sm", onClick: N, children: a("actions.clear") }),
104
+ /* @__PURE__ */ o("div", { className: "flex gap-2", children: [
105
+ /* @__PURE__ */ e(v, { variant: "ghost", size: "sm", onClick: y, children: a("actions.cancel") }),
106
+ /* @__PURE__ */ e(v, { size: "sm", onClick: k, children: a("actions.apply") })
107
107
  ] })
108
108
  ] })
109
109
  ] })
@@ -113,7 +113,7 @@ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
113
113
  value: l,
114
114
  onChange: p,
115
115
  onClear: f,
116
- onCreate: o,
116
+ onCreate: a,
117
117
  placeholder: c,
118
118
  searchPlaceholder: d,
119
119
  emptyLabel: u,
@@ -122,15 +122,15 @@ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
122
122
  modal: h = !0,
123
123
  className: k
124
124
  }) => {
125
- const { t: y } = P(), [N, w] = S(!1), [n, D] = S(""), C = l !== void 0 && l !== "", m = q(() => C ? r.find((t) => t.value === l) : void 0, [C, r, l]), B = C ? (m == null ? void 0 : m.label) ?? l : void 0, b = n.trim(), L = o !== void 0 && b !== "" && !r.some((t) => t.label.toLowerCase() === b.toLowerCase()), z = (t) => {
125
+ const { t: y } = P(), [N, w] = S(!1), [n, D] = S(""), C = l !== void 0 && l !== "", m = q(() => C ? r.find((t) => t.value === l) : void 0, [C, r, l]), B = C ? (m == null ? void 0 : m.label) ?? l : void 0, b = n.trim(), L = a !== void 0 && b !== "" && !r.some((t) => t.label.toLowerCase() === b.toLowerCase()), z = (t) => {
126
126
  w(t), t || D("");
127
127
  }, K = (t) => {
128
128
  p(t), z(!1);
129
129
  }, $ = () => {
130
- o == null || o(b), z(!1);
130
+ a == null || a(b), z(!1);
131
131
  };
132
- return /* @__PURE__ */ a(E, { open: N, onOpenChange: z, modal: h, children: [
133
- /* @__PURE__ */ e(R, { asChild: !0, children: /* @__PURE__ */ a(
132
+ return /* @__PURE__ */ o(E, { open: N, onOpenChange: z, modal: h, children: [
133
+ /* @__PURE__ */ e(R, { asChild: !0, children: /* @__PURE__ */ o(
134
134
  "button",
135
135
  {
136
136
  type: "button",
@@ -145,16 +145,16 @@ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
145
145
  k
146
146
  ),
147
147
  children: [
148
- /* @__PURE__ */ a("span", { className: "flex items-center truncate", children: [
148
+ /* @__PURE__ */ o("span", { className: "flex items-center truncate", children: [
149
149
  (m == null ? void 0 : m.color) && /* @__PURE__ */ e("span", { className: "mr-2 size-2.5 shrink-0 rounded-full", style: { backgroundColor: m.color } }),
150
150
  /* @__PURE__ */ e("span", { className: "truncate", children: B ?? c ?? y("select.placeholder") }),
151
- (m == null ? void 0 : m.description) !== void 0 && /* @__PURE__ */ a("span", { className: "ml-1 truncate text-muted-foreground", children: [
151
+ (m == null ? void 0 : m.description) !== void 0 && /* @__PURE__ */ o("span", { className: "ml-1 truncate text-muted-foreground", children: [
152
152
  "(",
153
153
  m.description,
154
154
  ")"
155
155
  ] })
156
156
  ] }),
157
- /* @__PURE__ */ a("div", { className: "flex items-center gap-1", children: [
157
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-1", children: [
158
158
  f && C && !s && /* @__PURE__ */ e(
159
159
  "span",
160
160
  {
@@ -175,16 +175,16 @@ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
175
175
  ]
176
176
  }
177
177
  ) }),
178
- /* @__PURE__ */ e(_, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ a(
178
+ /* @__PURE__ */ e(_, { className: "w-[var(--radix-popover-trigger-width)] p-0", align: "start", children: /* @__PURE__ */ o(
179
179
  J,
180
180
  {
181
181
  filter: (t, A, F) => (F ?? []).join(" ").toLowerCase().includes(A.trim().toLowerCase()) ? 1 : 0,
182
182
  children: [
183
183
  /* @__PURE__ */ e(Q, { placeholder: d ?? y("search.placeholder"), value: n, onValueChange: D }),
184
- /* @__PURE__ */ a(U, { children: [
184
+ /* @__PURE__ */ o(U, { children: [
185
185
  !L && /* @__PURE__ */ e(W, { children: u ?? y("states.noResult") }),
186
- /* @__PURE__ */ a(Y, { children: [
187
- r.map((t) => /* @__PURE__ */ a(
186
+ /* @__PURE__ */ o(Y, { children: [
187
+ r.map((t) => /* @__PURE__ */ o(
188
188
  T,
189
189
  {
190
190
  value: t.value,
@@ -196,7 +196,7 @@ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
196
196
  /* @__PURE__ */ e(te, { className: g("mr-2 size-4 shrink-0", l === t.value ? "opacity-100" : "opacity-0") }),
197
197
  t.color !== void 0 && /* @__PURE__ */ e("span", { className: "mr-2 size-2.5 shrink-0 rounded-full", style: { backgroundColor: t.color } }),
198
198
  /* @__PURE__ */ e("span", { className: "truncate", children: t.label }),
199
- t.description !== void 0 && /* @__PURE__ */ a("span", { className: "ml-1 truncate text-muted-foreground", children: [
199
+ t.description !== void 0 && /* @__PURE__ */ o("span", { className: "ml-1 truncate text-muted-foreground", children: [
200
200
  "(",
201
201
  t.description,
202
202
  ")"
@@ -205,7 +205,7 @@ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
205
205
  },
206
206
  t.value
207
207
  )),
208
- L && /* @__PURE__ */ a(T, { forceMount: !0, value: "__create__", onSelect: $, children: [
208
+ L && /* @__PURE__ */ o(T, { forceMount: !0, value: "__create__", onSelect: $, children: [
209
209
  /* @__PURE__ */ e(re, { className: "mr-2 size-4 shrink-0" }),
210
210
  /* @__PURE__ */ e("span", { className: "truncate", children: i ? i(b) : y("select.create", { search: b }) })
211
211
  ] })
@@ -215,12 +215,12 @@ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
215
215
  }
216
216
  ) })
217
217
  ] });
218
- }, Ie = ({ searchQuery: r, search: l, placeholder: p, onSearch: f, onSubmit: o, onClear: c, className: d }) => {
218
+ }, Ie = ({ searchQuery: r, search: l, placeholder: p, onSearch: f, onSubmit: a, onClear: c, className: d }) => {
219
219
  const { t: u } = P(), i = r ?? l ?? "", s = () => {
220
220
  f(""), c !== void 0 && c();
221
221
  };
222
- return /* @__PURE__ */ a("div", { className: g("relative h-fit w-full md:w-64", d), children: [
223
- /* @__PURE__ */ e(ae, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
222
+ return /* @__PURE__ */ o("div", { className: g("relative h-fit w-full md:w-64", d), children: [
223
+ /* @__PURE__ */ e(oe, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
224
224
  /* @__PURE__ */ e(
225
225
  Z,
226
226
  {
@@ -231,7 +231,7 @@ const ze = ({ date: r, onDateChange: l, placeholder: p }) => {
231
231
  },
232
232
  className: "pl-8",
233
233
  onKeyDown: (h) => {
234
- h.key === "Enter" && o !== void 0 && (h.preventDefault(), o());
234
+ h.key === "Enter" && a !== void 0 && (h.preventDefault(), a());
235
235
  }
236
236
  }
237
237
  ),
@@ -3,7 +3,7 @@ import "date-fns/locale";
3
3
  import "react-i18next";
4
4
  import { u as w } from "./useKrosoftTranslation-DtdbUewZ.js";
5
5
  import { useState as C, useEffect as O, useMemo as S } from "react";
6
- import { a as z, D as I, b as $, S as B } from "./SearchInput-Y-iBtCCc.js";
6
+ import { a as z, D as I, b as $, S as B } from "./SearchInput-Dkvaei9K.js";
7
7
  import { getLocale as Q } from "@krosoft/core/helpers";
8
8
  import { B as E, aw as V, b0 as _, b2 as R, b1 as H, E as P } from "./toggle-group-DLLrEwv2.js";
9
9
  import "./alert-B9F1N9Qk.js";
@@ -1,4 +1,4 @@
1
- import { A as l, a as i, F as r, S as s, T as t } from "../../../TableFilter-CJrFjUod.js";
1
+ import { A as l, a as i, F as r, S as s, T as t } from "../../../TableFilter-BXD7Es8j.js";
2
2
  export {
3
3
  l as ActiveFilters,
4
4
  i as AdvancedFilters,
@@ -4,10 +4,10 @@ import { B as m, a as g, C as c, b as d, c as f, L as C, P as n, g as A } from "
4
4
  import { A as x, C as D, F as S } from "../../ConfirmationDialog-CK65nSle.js";
5
5
  import { D as F, a as P, b as u, c as H, d as L, e as k, f as B, g as G, h as I, i as K } from "../../sheet-tuC_C3M3.js";
6
6
  import { P as E } from "../../toggle-group-DLLrEwv2.js";
7
- import { A as y, a as O, F as R, S as V, T as z } from "../../TableFilter-CJrFjUod.js";
7
+ import { A as y, a as O, F as R, S as V, T as z } from "../../TableFilter-BXD7Es8j.js";
8
8
  import { G as _ } from "../../GenericForm-B7L7NkrE.js";
9
9
  import { I as q } from "../../ImageInput-CBDkCEho.js";
10
- import { D as J, a as Q, S as U, b as W } from "../../SearchInput-Y-iBtCCc.js";
10
+ import { D as J, a as Q, S as U, b as W } from "../../SearchInput-Dkvaei9K.js";
11
11
  import { M as Y } from "../../MultiSelect-DWNOCqe1.js";
12
12
  import { A as $ } from "../../AppActions-QHJ6CP5w.js";
13
13
  import { A as ra, K as ea } from "../../KpiCardsLayout-CUDfA-AP.js";
@@ -1,5 +1,5 @@
1
1
  import { I as r } from "../../../ImageInput-CBDkCEho.js";
2
- import { D as c, a as o, S as s, b as p } from "../../../SearchInput-Y-iBtCCc.js";
2
+ import { D as c, a as o, S as s, b as p } from "../../../SearchInput-Dkvaei9K.js";
3
3
  import { M as l } from "../../../MultiSelect-DWNOCqe1.js";
4
4
  export {
5
5
  c as DatePicker,
@@ -4,10 +4,10 @@ import { B as p, a as u, C, b as g, c as d, L as m, P as S, g as T } from "../Pi
4
4
  import { A as D, C as M, F as x } from "../ConfirmationDialog-CK65nSle.js";
5
5
  import { C as h, j as f, k as P, l as I, m as w, n as v, o as F, p as L, q as B, D as G, a as k, b as H, c as R, d as y, e as N, f as O, g as V, h as E, i as z, I as K, S as j, r as q, s as U, t as _, u as J, v as Q, w as W, x as X, y as Y, z as Z } from "../sheet-tuC_C3M3.js";
6
6
  import { A as aa, a as ea, b as ra, c as oa, d as sa, e as ta, f as na, g as ia, h as la, i as ba, j as pa, k as ua, l as Ca, m as ga, n as da, o as ma, B as Sa, p as Ta, q as ca, r as Da, s as Ma, t as xa, u as Aa, v as ha, C as fa, w as Pa, x as Ia, y as wa, z as va, D as Fa, E as La, F as Ba, G as Ga, H as ka, I as Ha, J as Ra, K as ya, L as Na, M as Oa, N as Va, O as Ea, Q as za, R as Ka, S as ja, T as qa, U as Ua, V as _a, W as Ja, X as Qa, Y as Wa, Z as Xa, _ as Ya, $ as Za, a0 as $a, a1 as ae, a2 as ee, a3 as re, a4 as oe, a5 as se, a6 as te, a7 as ne, a8 as ie, a9 as le, aa as be, ab as pe, ac as ue, ad as Ce, ae as ge, af as de, ag as me, ah as Se, ai as Te, aj as ce, ak as De, al as Me, am as xe, an as Ae, ao as he, ap as fe, aq as Pe, ar as Ie, as as we, at as ve, au as Fe, av as Le, aw as Be, ax as Ge, ay as ke, az as He, aA as Re, aB as ye, aC as Ne, aD as Oe, aE as Ve, aF as Ee, aG as ze, aH as Ke, aI as je, aJ as qe, aK as Ue, aL as _e, aM as Je, aN as Qe, aO as We, aP as Xe, aQ as Ye, aR as Ze, aS as $e, aT as ar, aU as er, aV as rr, aW as or, aX as sr, aY as tr, aZ as nr, a_ as ir, a$ as lr, b0 as br, b1 as pr, b2 as ur, P as Cr, b3 as gr, b4 as dr, b5 as mr, b6 as Sr, b7 as Tr, b8 as cr, b9 as Dr, ba as Mr, bb as xr, bc as Ar, bd as hr, be as fr, bf as Pr, bg as Ir, bh as wr, bi as vr, bj as Fr, bk as Lr, bl as Br, bm as Gr, bn as kr, bo as Hr, bp as Rr, bq as yr, br as Nr, bs as Or, bt as Vr, bu as Er, bv as zr, bw as Kr, bx as jr, by as qr, bz as Ur, bA as _r } from "../toggle-group-DLLrEwv2.js";
7
- import { A as Qr, a as Wr, F as Xr, S as Yr, T as Zr } from "../TableFilter-CJrFjUod.js";
7
+ import { A as Qr, a as Wr, F as Xr, S as Yr, T as Zr } from "../TableFilter-BXD7Es8j.js";
8
8
  import { G as ao } from "../GenericForm-B7L7NkrE.js";
9
9
  import { I as ro } from "../ImageInput-CBDkCEho.js";
10
- import { D as so, a as to, S as no, b as io } from "../SearchInput-Y-iBtCCc.js";
10
+ import { D as so, a as to, S as no, b as io } from "../SearchInput-Dkvaei9K.js";
11
11
  import { M as bo } from "../MultiSelect-DWNOCqe1.js";
12
12
  import { A as uo } from "../AppActions-QHJ6CP5w.js";
13
13
  import { A as go, K as mo } from "../KpiCardsLayout-CUDfA-AP.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.228",
3
+ "version": "0.0.229",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {