react-luminus-components 1.2.81 → 1.2.83

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/main.es.js CHANGED
@@ -1,12 +1,12 @@
1
- import { j as s, c as w, t as re, a as ie, g as cr, T as lr, b as ur, s as jt, E as dr, d as hr, e as mr, f as fr, h as pr, u as V, i as de, k as Qt, F as kt, l as gr, m as wr, n as xr, o as yr, p as br, q as vr, r as _r, v as jr, w as lt, x as ut, y as kr, z as Cr, P as _e, A as he, B as Nr, C as $r, D as dt, S as Ct, G as Pe, H as Ae, I as ht, J as Ir, K as Xt, L as Ie, M as qe, O as Nt, N as Sr, Q as oe, R as Tr, U as Er, V as Jt, W as mt, X as ft, Y as z, Z as Or, _ as Zt, $ as Mr, a0 as en, a1 as Dr, a2 as Pr, a3 as Ar, a4 as Fr, a5 as tn, a6 as ke, a7 as Wr, a8 as Rr, a9 as Lr, aa as qr, ab as Yr, ac as Ze, ad as Ve, ae as nn, af as xe, ag as Br } from "./NoInputContainer-6brUvTDa.js";
2
- import { ai as yl, ah as bl } from "./NoInputContainer-6brUvTDa.js";
1
+ import { j as s, c as w, t as re, a as ie, g as cr, T as lr, b as ur, s as jt, E as dr, d as hr, e as mr, f as fr, h as pr, u as V, i as de, k as Qt, F as kt, l as gr, m as wr, n as xr, o as yr, p as br, q as vr, r as _r, v as jr, w as lt, x as ut, y as kr, z as Cr, P as _e, A as he, B as Nr, C as $r, D as dt, S as Ct, G as Pe, H as Ae, I as ht, J as Ir, K as Xt, L as Ie, M as qe, O as Nt, N as Sr, Q as oe, R as Tr, U as Er, V as Jt, W as mt, X as ft, Y as z, Z as Or, _ as Zt, $ as Mr, a0 as en, a1 as Dr, a2 as Pr, a3 as Ar, a4 as Fr, a5 as tn, a6 as ke, a7 as Wr, a8 as Rr, a9 as Lr, aa as qr, ab as Yr, ac as Ze, ad as Ve, ae as nn, af as xe, ag as Br } from "./NoInputContainer-D94YvUXW.js";
2
+ import { ai as yl, ah as bl } from "./NoInputContainer-D94YvUXW.js";
3
3
  import * as A from "react";
4
4
  import J, { useCallback as O, useMemo as Q, useEffect as D, useRef as Y, useState as P, useReducer as rn, useContext as F, Component as Hr, isValidElement as Gr, Suspense as Vr, createElement as Ur } from "react";
5
- import { c as le, d as zr, C as Kr, a as on, u as Qr, q as $t, E as Fe, M as We, L as Xr } from "./EventType-CFrd7EyJ.js";
5
+ import { c as le, d as zr, C as Kr, a as on, u as Qr, q as $t, E as Fe, M as We, L as Xr } from "./EventType-DY7SjWGF.js";
6
6
  import { useFormContext as me, Controller as sn } from "react-hook-form";
7
7
  import { m as Jr, a as an } from "./textUtils-BZyf3rh0.js";
8
8
  import { u as cn, a as ln, b as un } from "./useFormControlType-BAFqxupC.js";
9
- import { S as _l } from "./SimpleTooltip-_bjk41Zj.js";
9
+ import { S as _l } from "./SimpleTooltip-OyME0pwt.js";
10
10
  const qc = ({ fileLoader: t, fileName: e, children: n }) => {
11
11
  const r = O(async () => {
12
12
  var l;
@@ -1830,7 +1830,7 @@ function Oe({
1830
1830
  p && j && !u && (g.current = p.contains(p.ownerDocument.activeElement));
1831
1831
  const M = de(() => {
1832
1832
  f && f.focus && f.focus();
1833
- }), S = de(() => {
1833
+ }), I = de(() => {
1834
1834
  const _ = b.current;
1835
1835
  let T = a;
1836
1836
  if (T == null && (T = h.current && $n(h.current) ? "keyboard" : !1), T === !1 || T === "keyboard" && !/^key.+$/.test(_))
@@ -1839,8 +1839,8 @@ function Oe({
1839
1839
  W && W.focus && W.focus();
1840
1840
  });
1841
1841
  D(() => {
1842
- u ? S() : g.current && (g.current = !1, M());
1843
- }, [u, g, M, S]), D(() => {
1842
+ u ? I() : g.current && (g.current = !1, M());
1843
+ }, [u, g, M, I]), D(() => {
1844
1844
  b.current = null;
1845
1845
  });
1846
1846
  const N = (_, T) => {
@@ -1878,8 +1878,8 @@ function Oe({
1878
1878
  return;
1879
1879
  case "Tab":
1880
1880
  jr(B.ownerDocument, "keyup", (U) => {
1881
- var I;
1882
- (U.key === "Tab" && !U.target || !((I = h.current) != null && I.contains(U.target))) && d(!1, te);
1881
+ var S;
1882
+ (U.key === "Tab" && !U.target || !((S = h.current) != null && S.contains(U.target))) && d(!1, te);
1883
1883
  }, {
1884
1884
  once: !0
1885
1885
  });
@@ -2016,7 +2016,7 @@ const Ln = /* @__PURE__ */ A.forwardRef(({
2016
2016
  hasShown: y,
2017
2017
  popper: $,
2018
2018
  show: M,
2019
- toggle: S
2019
+ toggle: I
2020
2020
  }] = kn({
2021
2021
  flip: o,
2022
2022
  rootCloseEvent: r,
@@ -2030,7 +2030,7 @@ const Ln = /* @__PURE__ */ A.forwardRef(({
2030
2030
  M && ($ == null || $.update());
2031
2031
  }, [M]), !y && !i && !b)
2032
2032
  return null;
2033
- typeof l != "string" && (k.show = M, k.close = () => S == null ? void 0 : S(!1), k.align = n);
2033
+ typeof l != "string" && (k.show = M, k.close = () => I == null ? void 0 : I(!1), k.align = n);
2034
2034
  let N = d.style;
2035
2035
  return $ != null && $.placement && (N = {
2036
2036
  ...d.style,
@@ -2083,8 +2083,8 @@ const Yn = /* @__PURE__ */ A.forwardRef((t, e) => {
2083
2083
  } = Qt(t, {
2084
2084
  show: "onToggle"
2085
2085
  }), v = F(Ke), x = V(n, "dropdown"), f = Cr(), j = ($) => m === !1 ? $ === "click" : m === "inside" ? $ !== "rootClose" : m === "outside" ? $ !== "select" : !0, b = de(($, M) => {
2086
- var S, N;
2087
- !((S = M.originalEvent) == null || (N = S.target) == null) && N.classList.contains("dropdown-toggle") && M.source === "mousedown" || (M.originalEvent.currentTarget === document && (M.source !== "keydown" || M.originalEvent.key === "Escape") && (M.source = "rootClose"), j(M.source) && (c == null || c($, M)));
2086
+ var I, N;
2087
+ !((I = M.originalEvent) == null || (N = I.target) == null) && N.classList.contains("dropdown-toggle") && M.source === "mousedown" || (M.originalEvent.currentTarget === document && (M.source !== "keydown" || M.originalEvent.key === "Escape") && (M.source = "rootClose"), j(M.source) && (c == null || c($, M)));
2088
2088
  }), C = Rn(i === "end", r, f), k = Q(() => ({
2089
2089
  align: i,
2090
2090
  drop: r,
@@ -3149,7 +3149,7 @@ function _i(t, e, n) {
3149
3149
  var T = e - (_ - o.current), W = f ? Math.min(T, b - (_ - a.current)) : T;
3150
3150
  k(N, W);
3151
3151
  }
3152
- }, S = function() {
3152
+ }, I = function() {
3153
3153
  if (m || j) {
3154
3154
  var N = Date.now(), _ = y(N);
3155
3155
  if (l.current = [].slice.call(arguments), c.current = r, o.current = N, _) {
@@ -3161,13 +3161,13 @@ function _i(t, e, n) {
3161
3161
  return i.current || k(M, e), u.current;
3162
3162
  }
3163
3163
  };
3164
- return S.cancel = function() {
3164
+ return I.cancel = function() {
3165
3165
  i.current && (p ? cancelAnimationFrame(i.current) : clearTimeout(i.current)), a.current = 0, l.current = o.current = c.current = i.current = null;
3166
- }, S.isPending = function() {
3166
+ }, I.isPending = function() {
3167
3167
  return !!i.current;
3168
- }, S.flush = function() {
3168
+ }, I.flush = function() {
3169
3169
  return i.current ? $(Date.now()) : u.current;
3170
- }, S;
3170
+ }, I;
3171
3171
  }, [v, f, e, b, x, p, m, j]);
3172
3172
  return g;
3173
3173
  }
@@ -3205,8 +3205,8 @@ const Ci = "_wrapper_uccrb_1", Ni = "_open_uccrb_9", $i = "_dropdown_uccrb_13",
3205
3205
  "clear-button": "_clear-button_uccrb_74",
3206
3206
  clearButton: Fi
3207
3207
  }, _t = ({ show: t, onCancel: e, items: n, currentSelection: r, onSelectionChange: o, onSearchQueryChange: a, texts: i, itemsNameWidth: l, additionalColumns: c, displayIdAsName: u = !1, autoHideSearch: d = !1, allItemsLength: h, disabled: m, isLoading: p = !1, inputRef: v }) => {
3208
- var I;
3209
- const x = Y(null), f = Y(null), j = Y(null), [b, g] = P(""), [C] = rr(b, 500), [, k] = P(!1), y = (I = v.current) == null ? void 0 : I.getBoundingClientRect(), $ = (y == null ? void 0 : y.x) ?? 0, M = ((y == null ? void 0 : y.x) ?? 0) + ((y == null ? void 0 : y.width) ?? 0), S = (y == null ? void 0 : y.y) ?? 0, N = ((y == null ? void 0 : y.y) ?? 0) + ((y == null ? void 0 : y.height) ?? 0), _ = (y == null ? void 0 : y.width) ?? 0, T = (y == null ? void 0 : y.height) ?? 0, W = 5, R = Q(() => $ ? $ > window.innerWidth / 2 : !1, [$]), B = Q(() => S ? S > window.innerHeight / 2 : !1, [S]);
3208
+ var S;
3209
+ const x = Y(null), f = Y(null), j = Y(null), [b, g] = P(""), [C] = rr(b, 500), [, k] = P(!1), y = (S = v.current) == null ? void 0 : S.getBoundingClientRect(), $ = (y == null ? void 0 : y.x) ?? 0, M = ((y == null ? void 0 : y.x) ?? 0) + ((y == null ? void 0 : y.width) ?? 0), I = (y == null ? void 0 : y.y) ?? 0, N = ((y == null ? void 0 : y.y) ?? 0) + ((y == null ? void 0 : y.height) ?? 0), _ = (y == null ? void 0 : y.width) ?? 0, T = (y == null ? void 0 : y.height) ?? 0, W = 5, R = Q(() => $ ? $ > window.innerWidth / 2 : !1, [$]), B = Q(() => I ? I > window.innerHeight / 2 : !1, [I]);
3210
3210
  D(() => {
3211
3211
  var E;
3212
3212
  t && ((E = j.current) == null || E.focus());
@@ -3233,13 +3233,13 @@ const Ci = "_wrapper_uccrb_1", Ni = "_open_uccrb_9", $i = "_dropdown_uccrb_13",
3233
3233
  return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3234
3234
  /* @__PURE__ */ s.jsx(sr, { show: t, onClick: e }),
3235
3235
  r && t && !m && /* @__PURE__ */ s.jsx("button", { ref: f, type: "button", className: w("luminus-dropdown-picker-clear-button", X.clearButton), onClick: () => !m && o(null), style: {
3236
- top: `calc(${S}px + ${T / 2}px - 12px)`,
3236
+ top: `calc(${I}px + ${T / 2}px - 12px)`,
3237
3237
  left: `calc(${$}px - 24px - 8px)`
3238
3238
  }, children: /* @__PURE__ */ s.jsx(z, { variant: "caption", className: "text-danger", children: /* @__PURE__ */ s.jsx(Zt, { size: 16 }) }) }),
3239
3239
  /* @__PURE__ */ s.jsx("div", { className: w("luminus-dropdown-picker", X.wrapper, {
3240
3240
  [X.open]: t
3241
3241
  }), style: {
3242
- top: B ? `calc(${S}px - 50vh - 8px)` : `calc(${N}px + 8px)`,
3242
+ top: B ? `calc(${I}px - 50vh - 8px)` : `calc(${N}px + 8px)`,
3243
3243
  left: R ? `calc(${M}px - ${U})` : $,
3244
3244
  right: R ? `${M}px` : `calc(${$}px + ${U})`,
3245
3245
  width: U,
@@ -3579,9 +3579,9 @@ const Ri = "_item_1dy8x_1", or = {
3579
3579
  D(() => {
3580
3580
  C(n === null ? "" : n.toString());
3581
3581
  }, [n]);
3582
- const [$, M] = P(!1), S = un(e, n ? n.toString() ?? null : null, $);
3582
+ const [$, M] = P(!1), I = un(e, n ? n.toString() ?? null : null, $);
3583
3583
  return /* @__PURE__ */ s.jsxs(t, { withoutLabel: i, label: a ?? "", hidden: u, className: v, children: [
3584
- /* @__PURE__ */ s.jsx(ee.Control, { type: S, placeholder: l ?? a, size: c, value: o ? g : n ?? "", onChange: y, className: v ?? "", hidden: u, disabled: d ?? !1, list: p, onFocus: () => M(!0), onBlur: () => M(!1), step: x }),
3584
+ /* @__PURE__ */ s.jsx(ee.Control, { type: I, placeholder: l ?? a, size: c, value: o ? g : n ?? "", onChange: y, className: v ?? "", hidden: u, disabled: d ?? !1, list: p, onFocus: () => M(!0), onBlur: () => M(!1), step: x }),
3585
3585
  h && n && r && !d && /* @__PURE__ */ s.jsx("div", { className: `luminus-input-remove-icon ${e !== "text" ? "inset" : ""}`, children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: j, children: /* @__PURE__ */ s.jsx(ke, {}) }) })
3586
3586
  ] });
3587
3587
  }, rl = ({
@@ -3635,11 +3635,11 @@ const Ri = "_item_1dy8x_1", or = {
3635
3635
  D(() => {
3636
3636
  c && c(g);
3637
3637
  }, [g, c]);
3638
- const S = Y(null), N = r !== void 0, _ = N && g !== null;
3638
+ const I = Y(null), N = r !== void 0, _ = N && g !== null;
3639
3639
  return /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsxs(t, { withoutLabel: d, label: u ?? "", hidden: v, inputContainerClassName: w({ "luminus-dropdown-select-open": k }), className: b, children: [
3640
3640
  /* @__PURE__ */ s.jsxs(ar, { currentSelection: g, selectedItemNavigateTo: r, children: [
3641
3641
  f && (g == null ? void 0 : g.name) && /* @__PURE__ */ s.jsx(z, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: g.name }),
3642
- /* @__PURE__ */ s.jsxs(ee.Select, { ref: S, size: h, value: (g == null ? void 0 : g.id) ?? "", onChange: (R) => C({
3642
+ /* @__PURE__ */ s.jsxs(ee.Select, { ref: I, size: h, value: (g == null ? void 0 : g.id) ?? "", onChange: (R) => C({
3643
3643
  id: l ? Number(R.target.value) ?? null : R.target.value,
3644
3644
  name: ""
3645
3645
  }), onMouseDown: (R) => {
@@ -3661,7 +3661,7 @@ const Ri = "_item_1dy8x_1", or = {
3661
3661
  j ?? null
3662
3662
  ] }) : null
3663
3663
  ] }),
3664
- S.current && /* @__PURE__ */ s.jsx(_t, { show: k, onCancel: () => y(!1), items: e, currentSelection: g, onSelectionChange: M, onSearchQueryChange: o, texts: a, itemsNameWidth: m, additionalColumns: p, isLoading: i, disabled: x, inputRef: S })
3664
+ I.current && /* @__PURE__ */ s.jsx(_t, { show: k, onCancel: () => y(!1), items: e, currentSelection: g, onSelectionChange: M, onSearchQueryChange: o, texts: a, itemsNameWidth: m, additionalColumns: p, isLoading: i, disabled: x, inputRef: I })
3665
3665
  ] }) });
3666
3666
  }, sl = ({ InputContainer: t = xe, formField: e, label: n, resetsFields: r, type: o, required: a, hidden: i, disabled: l, withoutLabel: c, className: u }) => {
3667
3667
  const { register: d, formState: h, setValue: m } = me(), [p, v] = P(void 0), [x, f] = P(!1);
@@ -3705,12 +3705,12 @@ const Ri = "_item_1dy8x_1", or = {
3705
3705
  ] });
3706
3706
  }, il = ({ InputContainer: t = xe, formField: e, label: n, resetsFields: r, size: o, showClearIcon: a, clearValue: i, required: l, hidden: c, disabled: u, rows: d, withoutLabel: h, customFormControlProps: m, className: p }) => {
3707
3707
  const { register: v, formState: x, setValue: f, watch: j } = me(), [b, g] = P(void 0), [C, k] = P(!1), y = O(() => {
3708
- const S = i ?? null;
3709
- f(e, (S == null ? void 0 : S.toString()) ?? "", { shouldDirty: !0, shouldValidate: C });
3708
+ const I = i ?? null;
3709
+ f(e, (I == null ? void 0 : I.toString()) ?? "", { shouldDirty: !0, shouldValidate: C });
3710
3710
  }, [i, f, e, C]), $ = O(() => {
3711
- const S = e.split(".");
3711
+ const I = e.split(".");
3712
3712
  let N = x.errors;
3713
- S.forEach((_) => {
3713
+ I.forEach((_) => {
3714
3714
  N !== void 0 && (N = N[_]);
3715
3715
  }), g(N);
3716
3716
  }, [x, e]);
@@ -3722,15 +3722,16 @@ const Ri = "_item_1dy8x_1", or = {
3722
3722
  const M = b !== void 0;
3723
3723
  return /* @__PURE__ */ s.jsxs(t, { label: `${n}${l ? " *" : ""}`, hidden: c, withoutLabel: h, isInvalid: M, className: p, children: [
3724
3724
  /* @__PURE__ */ s.jsx(ee.Control, { as: "textarea", size: o, ...v(e, {
3725
+ setValueAs: (I) => I == null || I === "" ? null : I,
3725
3726
  onChange: () => {
3726
- r && r.forEach((S) => f(S, null, { shouldDirty: !0, shouldValidate: C }));
3727
+ r && r.forEach((I) => f(I, null, { shouldDirty: !0, shouldValidate: C }));
3727
3728
  }
3728
3729
  }), isInvalid: M, hidden: c, disabled: u, rows: d ?? 2, className: "w-100", ...m }),
3729
3730
  a && j(e) && /* @__PURE__ */ s.jsx("div", { className: "luminus-input-remove-icon", children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: y, children: /* @__PURE__ */ s.jsx(ke, {}) }) }),
3730
3731
  b && /* @__PURE__ */ s.jsx(ye, { message: b.message })
3731
3732
  ] });
3732
3733
  }, cl = ({ InputContainer: t = xe, type: e, formField: n, label: r, placeholder: o, size: a, resetsFields: i, showClearIcon: l, clearValue: c, required: u, hidden: d, disabled: h, withoutLabel: m, list: p, step: v, CustomOnChangeComponent: x, className: f }) => {
3733
- const { register: j, formState: b, setValue: g, watch: C } = me(), [k, y] = P(void 0), [$, M] = P(!1), S = O(() => {
3734
+ const { register: j, formState: b, setValue: g, watch: C } = me(), [k, y] = P(void 0), [$, M] = P(!1), I = O(() => {
3734
3735
  const L = c ?? null;
3735
3736
  e === "number" ? g(n, L !== null ? Number(L) : null, {
3736
3737
  shouldDirty: !0,
@@ -3762,11 +3763,11 @@ const Ri = "_item_1dy8x_1", or = {
3762
3763
  }), isInvalid: _, hidden: d, disabled: h, list: p, className: "w-100", step: v }),
3763
3764
  x && /* @__PURE__ */ s.jsx("div", { className: "custom-picker-button", children: x })
3764
3765
  ] }),
3765
- l && C(n) && /* @__PURE__ */ s.jsx("div", { className: `luminus-input-remove-icon ${e !== "text" ? "inset" : ""}`, children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: S, children: /* @__PURE__ */ s.jsx(ke, {}) }) }),
3766
+ l && C(n) && /* @__PURE__ */ s.jsx("div", { className: `luminus-input-remove-icon ${e !== "text" ? "inset" : ""}`, children: /* @__PURE__ */ s.jsx(Z, { color: "secondary", size: "sm", onClick: I, children: /* @__PURE__ */ s.jsx(ke, {}) }) }),
3766
3767
  k && /* @__PURE__ */ s.jsx(ye, { message: k.message })
3767
3768
  ] });
3768
3769
  }, ll = ({ InputContainer: t = xe, formField: e, label: n, size: r, defaultSelection: o, resetsFields: a, isNumber: i, required: l, hidden: c, disabled: u, items: d, onSearchQueryChange: h, selectedItemNavigateTo: m, texts: p, dropdownItemsNameWidth: v, isLoading: x, withoutLabel: f, additionalColumns: j, CustomOnChangeComponent: b, displayIdAsName: g, className: C }) => {
3769
- const { formState: k, setValue: y, watch: $, control: M } = me(), [S, N] = P(void 0), [_, T] = P(!1), [W, R] = P(!1), B = $(e) ?? null, L = B === (o == null ? void 0 : o.id) ? o == null ? void 0 : o.name : $(`${e}-DropdownName`), G = Q(() => B == null ? null : { id: B ?? null, name: L ?? "" }, [B, L]), se = O(() => {
3770
+ const { formState: k, setValue: y, watch: $, control: M } = me(), [I, N] = P(void 0), [_, T] = P(!1), [W, R] = P(!1), B = $(e) ?? null, L = B === (o == null ? void 0 : o.id) ? o == null ? void 0 : o.name : $(`${e}-DropdownName`), G = Q(() => B == null ? null : { id: B ?? null, name: L ?? "" }, [B, L]), se = O(() => {
3770
3771
  const H = e.split(".");
3771
3772
  let ce = k.errors;
3772
3773
  H.forEach((Je) => {
@@ -3789,7 +3790,7 @@ const Ri = "_item_1dy8x_1", or = {
3789
3790
  }), y(`${e}-DropdownName`, H.name ?? "");
3790
3791
  }, [y, e, W, i, a, B]), U = O((H) => {
3791
3792
  T(!1), te(H);
3792
- }, [te]), I = O(() => {
3793
+ }, [te]), S = O(() => {
3793
3794
  T(!1);
3794
3795
  }, []);
3795
3796
  D(() => {
@@ -3797,7 +3798,7 @@ const Ri = "_item_1dy8x_1", or = {
3797
3798
  }, [se]), D(() => {
3798
3799
  k.isSubmitted && R(!0);
3799
3800
  }, [k]);
3800
- const E = Y(null), K = S !== void 0, De = m !== void 0, ir = De && G !== null;
3801
+ const E = Y(null), K = I !== void 0, De = m !== void 0, ir = De && G !== null;
3801
3802
  return /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsxs(t, { label: `${n}${l ? " *" : ""}`, hidden: c, withoutLabel: f, isInvalid: K, inputContainerClassName: w({ "luminus-dropdown-select-open": _ }), className: C, children: [
3802
3803
  /* @__PURE__ */ s.jsxs(ar, { currentSelection: G, selectedItemNavigateTo: m, children: [
3803
3804
  g && (G == null ? void 0 : G.name) && /* @__PURE__ */ s.jsx(z, { variant: "caption", className: "d-flex justify-content-end mt-2 luminus-dropdown-selection-name", children: G.name }),
@@ -3817,18 +3818,18 @@ const Ri = "_item_1dy8x_1", or = {
3817
3818
  b ?? null
3818
3819
  ] }) : null
3819
3820
  ] }),
3820
- S && /* @__PURE__ */ s.jsx(ye, { message: S.message }),
3821
- E.current && /* @__PURE__ */ s.jsx(_t, { show: _, onCancel: I, items: d, currentSelection: G, onSelectionChange: U, onSearchQueryChange: h, texts: p, itemsNameWidth: v, additionalColumns: j, displayIdAsName: g, isLoading: x, disabled: u, inputRef: E })
3821
+ I && /* @__PURE__ */ s.jsx(ye, { message: I.message }),
3822
+ E.current && /* @__PURE__ */ s.jsx(_t, { show: _, onCancel: S, items: d, currentSelection: G, onSelectionChange: U, onSearchQueryChange: h, texts: p, itemsNameWidth: v, additionalColumns: j, displayIdAsName: g, isLoading: x, disabled: u, inputRef: E })
3822
3823
  ] }) });
3823
3824
  }, ul = ({ InputContainer: t = xe, label: e, formField: n, hidden: r, required: o, placeholder: a, disabled: i, showClearIcon: l, resetsFields: c, multiple: u, accept: d, withoutLabel: h, className: m }) => {
3824
3825
  const { watch: p, setValue: v, register: x, formState: f } = me(), [j, b] = P(!1), [g, C] = P(void 0), k = O(() => {
3825
3826
  v(n, "");
3826
3827
  }, [v, n]), y = O(() => {
3827
3828
  const M = n.split(".");
3828
- let S = f.errors;
3829
+ let I = f.errors;
3829
3830
  M.forEach((N) => {
3830
- S !== void 0 && (S = S[N]);
3831
- }), C(S);
3831
+ I !== void 0 && (I = I[N]);
3832
+ }), C(I);
3832
3833
  }, [f, n]);
3833
3834
  D(y, [y]), D(() => {
3834
3835
  f.isSubmitted && b(!0);
@@ -3849,16 +3850,16 @@ const Ri = "_item_1dy8x_1", or = {
3849
3850
  o(Object.keys(n.dirtyFields).length > 0);
3850
3851
  }, [n]), r ? /* @__PURE__ */ s.jsx(Ha, { onStorno: e, children: t }) : null;
3851
3852
  }, hl = ({ InputContainer: t = xe, options: e, formField: n, label: r, size: o, resetsFields: a, isNumber: i, required: l, hidden: c, disabled: u, withoutLabel: d, noSortOptions: h, suffixIdToName: m, className: p }) => {
3852
- const { customSelectTexts: v } = F(oe), { formState: x, setValue: f, watch: j, control: b } = me(), [g, C] = P(void 0), [k, y] = P(!1), [$, M] = P(!1), [S, N] = P(""), _ = j(n), T = Q(() => e.find((I) => I.id === _) ?? null, [e, _]), W = O(() => {
3853
- const I = n.split(".");
3853
+ const { customSelectTexts: v } = F(oe), { formState: x, setValue: f, watch: j, control: b } = me(), [g, C] = P(void 0), [k, y] = P(!1), [$, M] = P(!1), [I, N] = P(""), _ = j(n), T = Q(() => e.find((S) => S.id === _) ?? null, [e, _]), W = O(() => {
3854
+ const S = n.split(".");
3854
3855
  let E = x.errors;
3855
- I.forEach((K) => {
3856
+ S.forEach((K) => {
3856
3857
  E !== void 0 && (E = E[K]);
3857
3858
  }), C(E);
3858
- }, [x, n]), R = O((I) => {
3859
- if ((I == null ? void 0 : I.id) === _)
3859
+ }, [x, n]), R = O((S) => {
3860
+ if ((S == null ? void 0 : S.id) === _)
3860
3861
  return;
3861
- if (a && a.forEach((K) => f(K, null, { shouldDirty: !0, shouldValidate: $ })), I === null) {
3862
+ if (a && a.forEach((K) => f(K, null, { shouldDirty: !0, shouldValidate: $ })), S === null) {
3862
3863
  f(n, null, {
3863
3864
  shouldDirty: !0,
3864
3865
  shouldValidate: $
@@ -3866,33 +3867,33 @@ const Ri = "_item_1dy8x_1", or = {
3866
3867
  return;
3867
3868
  }
3868
3869
  let E = null;
3869
- i ? E = (I == null ? void 0 : I.id) !== null && (I == null ? void 0 : I.id) !== "" ? parseInt(I.id.toString(), 10) : null : E = I.id === null || I.id === void 0 || I.id === "" ? null : I.id, f(n, E, {
3870
+ i ? E = (S == null ? void 0 : S.id) !== null && (S == null ? void 0 : S.id) !== "" ? parseInt(S.id.toString(), 10) : null : E = S.id === null || S.id === void 0 || S.id === "" ? null : S.id, f(n, E, {
3870
3871
  shouldDirty: !0,
3871
3872
  shouldValidate: $
3872
3873
  });
3873
- }, [f, n, i, a, _, $]), B = O((I) => {
3874
- y(!1), R(I);
3875
- }, [R]), L = O((I) => {
3876
- N(I);
3874
+ }, [f, n, i, a, _, $]), B = O((S) => {
3875
+ y(!1), R(S);
3876
+ }, [R]), L = O((S) => {
3877
+ N(S);
3877
3878
  }, []);
3878
3879
  D(() => {
3879
3880
  W();
3880
3881
  }, [W]), D(() => {
3881
3882
  x.isSubmitted && M(!0);
3882
3883
  }, [x]);
3883
- const G = O((I) => {
3884
+ const G = O((S) => {
3884
3885
  var E;
3885
- return I === null ? "" : !I.name || I.name.length === 0 ? ((E = I.id) == null ? void 0 : E.toString()) ?? "" : m ? `${I.name} (${I.id})` : I.name;
3886
- }, [m]), se = Q(() => e.map((I) => ({
3887
- id: I.id,
3888
- name: G(I)
3889
- })).filter((I) => {
3886
+ return S === null ? "" : !S.name || S.name.length === 0 ? ((E = S.id) == null ? void 0 : E.toString()) ?? "" : m ? `${S.name} (${S.id})` : S.name;
3887
+ }, [m]), se = Q(() => e.map((S) => ({
3888
+ id: S.id,
3889
+ name: G(S)
3890
+ })).filter((S) => {
3890
3891
  var E;
3891
- return S ? (E = I.name) == null ? void 0 : E.toLowerCase().includes(S.toLowerCase()) : !0;
3892
- }).sort((I, E) => h ? 0 : (I.name ?? "").localeCompare(E.name ?? "")), [e, h, S, G]), te = Y(null), U = g !== void 0;
3892
+ return I ? (E = S.name) == null ? void 0 : E.toLowerCase().includes(I.toLowerCase()) : !0;
3893
+ }).sort((S, E) => h ? 0 : (S.name ?? "").localeCompare(E.name ?? "")), [e, h, I, G]), te = Y(null), U = g !== void 0;
3893
3894
  return /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsxs(t, { label: `${r}${l ? " *" : ""}`, hidden: c, withoutLabel: d, isInvalid: U, inputContainerClassName: w({ "luminus-dropdown-select-open": k }), className: p, children: [
3894
- /* @__PURE__ */ s.jsx(sn, { control: b, name: n, render: () => /* @__PURE__ */ s.jsx(ee.Select, { size: o, onMouseDown: (I) => {
3895
- I.currentTarget.focus(), I.preventDefault();
3895
+ /* @__PURE__ */ s.jsx(sn, { control: b, name: n, render: () => /* @__PURE__ */ s.jsx(ee.Select, { size: o, onMouseDown: (S) => {
3896
+ S.currentTarget.focus(), S.preventDefault();
3896
3897
  }, onClick: () => {
3897
3898
  y(!0);
3898
3899
  }, ref: te, value: _ ?? "", onChange: () => {
@@ -1 +1 @@
1
- "use strict";const r=require("react"),f=require("./NoInputContainer-84nW-1Nk.cjs"),p=()=>{const{isShown:s,text:c,showPrompt:e,hidePrompt:t,resolveRef:n,setOptions:i}=r.useContext(f.PromptContext),a=r.useCallback(o=>{t(),n.current(o)},[t,n]),l=r.useCallback(async(o,u)=>(i(m=>({...m,...u})),e(o),new Promise(m=>{n.current=m})),[n,i,e]);return{isShown:s,text:c,prompt:l,onFinish:a}};let C;const h=()=>{const{show:s,text:c,showConfirm:e,hideConfirm:t}=r.useContext(f.ConfirmContext),n=()=>{t()};return{confirm:async o=>(e(o),new Promise(u=>{C=u})),onConfirm:()=>{n(),C(!0)},onCancel:()=>{n(),C(!1)},show:s,text:c}};exports.useConfirm=h;exports.usePrompt=p;
1
+ "use strict";const r=require("react"),f=require("./NoInputContainer-pmSdlv8f.cjs"),p=()=>{const{isShown:s,text:c,showPrompt:e,hidePrompt:t,resolveRef:n,setOptions:i}=r.useContext(f.PromptContext),a=r.useCallback(o=>{t(),n.current(o)},[t,n]),l=r.useCallback(async(o,u)=>(i(m=>({...m,...u})),e(o),new Promise(m=>{n.current=m})),[n,i,e]);return{isShown:s,text:c,prompt:l,onFinish:a}};let C;const h=()=>{const{show:s,text:c,showConfirm:e,hideConfirm:t}=r.useContext(f.ConfirmContext),n=()=>{t()};return{confirm:async o=>(e(o),new Promise(u=>{C=u})),onConfirm:()=>{n(),C(!0)},onCancel:()=>{n(),C(!1)},show:s,text:c}};exports.useConfirm=h;exports.usePrompt=p;
@@ -1,5 +1,5 @@
1
1
  import { useContext as u, useCallback as l } from "react";
2
- import { al as p, ak as h } from "./NoInputContainer-6brUvTDa.js";
2
+ import { al as p, ak as h } from "./NoInputContainer-D94YvUXW.js";
3
3
  const P = () => {
4
4
  const { isShown: e, text: s, showPrompt: t, hidePrompt: r, resolveRef: o, setOptions: c } = u(p), C = l((n) => {
5
5
  r(), o.current(n);
@@ -1,5 +1,5 @@
1
1
  import { useContext as t, useCallback as i } from "react";
2
- import { aa as n } from "./NoInputContainer-6brUvTDa.js";
2
+ import { aa as n } from "./NoInputContainer-D94YvUXW.js";
3
3
  import "react-hook-form";
4
4
  const p = () => {
5
5
  const { user: s } = t(n);
@@ -1 +1 @@
1
- "use strict";const r=require("react"),t=require("./NoInputContainer-84nW-1Nk.cjs");require("react-hook-form");const o=()=>{const{user:s}=r.useContext(t.UserContext);return{checkUserHasPermissions:r.useCallback(n=>n.every(i=>{var e;return(e=s==null?void 0:s.permissions)==null?void 0:e.includes(i)}),[s])}};exports.usePermissions=o;
1
+ "use strict";const r=require("react"),t=require("./NoInputContainer-pmSdlv8f.cjs");require("react-hook-form");const o=()=>{const{user:s}=r.useContext(t.UserContext);return{checkUserHasPermissions:r.useCallback(n=>n.every(i=>{var e;return(e=s==null?void 0:s.permissions)==null?void 0:e.includes(i)}),[s])}};exports.usePermissions=o;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-luminus-components",
3
- "version": "1.2.81",
3
+ "version": "1.2.83",
4
4
  "description": "Library of React Components reusable in Luminus projects (Fleetman, CAFM)",
5
5
  "type": "module",
6
6
  "repository": {