react-luminus-components 1.2.57 → 1.2.59

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,13 +1,13 @@
1
- import { j as s, t as re, c as ae, g as Jn, T as Zn, a as er, b as x, s as xt, E as tr, d as nr, e as rr, f as or, h as sr, u as ge, i as V, k as ar, l as ir, m as cr, n as lr, o as ur, p as dr, q as hr, r as mr, v as st, w as at, x as fr, y as pr, z as gr, P as be, F as ue, A as wr, B as xr, C as it, S as yt, D as De, G as Pe, H as ct, I as yr, J as Gt, K as $e, L as Re, O as vt, M as vr, N as ie, Q as br, R as _r, U as Bt, V as lt, W as ut, X as Q, Y as jr, Z as Vt, _ as kr, $ as Ut, a0 as Cr, a1 as Nr, a2 as $r, a3 as Ir, a4 as Kt, a5 as je, a6 as Sr, a7 as Tr, a8 as Er, a9 as Or, aa as Mr, ab as Xe, ac as Ge, ad as zt, ae as we, af as Dr } from "./NoInputContainer-aBkWfzUA.js";
2
- import { ah as Kc, ag as zc } from "./NoInputContainer-aBkWfzUA.js";
1
+ import { j as s, t as re, c as ae, g as Jn, T as Zn, a as er, b as x, s as xt, E as tr, d as nr, e as rr, f as or, h as sr, u as ge, i as V, k as ar, l as ir, m as cr, n as lr, o as ur, p as dr, q as hr, r as mr, v as st, w as at, x as fr, y as pr, z as gr, P as be, F as ue, A as wr, B as xr, C as it, S as yt, D as De, G as Pe, H as ct, I as yr, J as Gt, K as $e, L as Re, O as vt, M as vr, N as ie, Q as br, R as _r, U as Bt, V as lt, W as ut, X as Q, Y as jr, Z as Vt, _ as kr, $ as Ut, a0 as Cr, a1 as Nr, a2 as $r, a3 as Ir, a4 as Kt, a5 as je, a6 as Sr, a7 as Tr, a8 as Er, a9 as Or, aa as Mr, ab as Xe, ac as Ge, ad as zt, ae as we, af as Dr } from "./NoInputContainer-vBsdl4By.js";
2
+ import { ah as Kc, ag as zc } from "./NoInputContainer-vBsdl4By.js";
3
3
  import * as A from "react";
4
- import Z, { useCallback as O, useMemo as z, useEffect as D, useRef as Y, useState as P, useReducer as Qt, useContext as R, createElement as Pr } from "react";
5
- import { d as Xt, u as Ar, q as bt, E as Ae, M as Fe } from "./EventType-DeYmiWCO.js";
6
- import { L as Xc } from "./EventType-DeYmiWCO.js";
4
+ import Z, { useCallback as O, useMemo as z, useEffect as D, useRef as Y, useState as P, useReducer as Qt, useContext as q, createElement as Pr } from "react";
5
+ import { d as Xt, u as Ar, q as bt, E as Ae, M as Fe } from "./EventType-BITUq9bG.js";
6
+ import { L as Xc } from "./EventType-BITUq9bG.js";
7
7
  import { useFormContext as de, Controller as Jt } from "react-hook-form";
8
8
  import { m as Fr, a as Zt } from "./textUtils-BbxuIsKq.js";
9
9
  import { u as en, a as tn, b as nn } from "./useFormControlType-BAFqxupC.js";
10
- import { S as Zc } from "./SimpleTooltip-2wXZeyP7.js";
10
+ import { S as Zc } from "./SimpleTooltip-D_EP1VLp.js";
11
11
  const wc = ({ fileLoader: t, fileName: e, children: n }) => {
12
12
  const r = O(async () => {
13
13
  var c;
@@ -1537,7 +1537,7 @@ function is(t, e) {
1537
1537
  const cs = () => {
1538
1538
  };
1539
1539
  function fn(t = {}) {
1540
- const e = R(Ve), [n, r] = cr(), o = Y(!1), {
1540
+ const e = q(Ve), [n, r] = cr(), o = Y(!1), {
1541
1541
  flip: a,
1542
1542
  offset: i,
1543
1543
  rootCloseEvent: c,
@@ -1605,7 +1605,7 @@ const Le = {
1605
1605
  }, gn = /* @__PURE__ */ Z.createContext(Le), ls = /* @__PURE__ */ Z.createContext(!1);
1606
1606
  let us = !!(typeof window < "u" && window.document && window.document.createElement), Ze = /* @__PURE__ */ new WeakMap();
1607
1607
  function ds(t = !1) {
1608
- let e = R(gn), n = Y(null);
1608
+ let e = q(gn), n = Y(null);
1609
1609
  if (n.current === null && !t) {
1610
1610
  var r, o;
1611
1611
  let a = (o = Z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED) === null || o === void 0 || (r = o.ReactCurrentOwner) === null || r === void 0 ? void 0 : r.current;
@@ -1621,7 +1621,7 @@ function ds(t = !1) {
1621
1621
  return n.current;
1622
1622
  }
1623
1623
  function hs(t) {
1624
- let e = R(gn);
1624
+ let e = q(gn);
1625
1625
  e === Le && !us && console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");
1626
1626
  let n = ds(!!t), r = e === Le && process.env.NODE_ENV === "test" ? "react-aria" : `react-aria${e.prefix}`;
1627
1627
  return t || `${r}-${n}`;
@@ -1642,7 +1642,7 @@ function ws(t) {
1642
1642
  };
1643
1643
  }
1644
1644
  function xs() {
1645
- return typeof Z.useSyncExternalStore == "function" ? Z.useSyncExternalStore(ws, ps, gs) : R(ls);
1645
+ return typeof Z.useSyncExternalStore == "function" ? Z.useSyncExternalStore(ws, ps, gs) : q(ls);
1646
1646
  }
1647
1647
  const wn = (t) => {
1648
1648
  var e;
@@ -1655,7 +1655,7 @@ function xn() {
1655
1655
  toggle: n = St,
1656
1656
  setToggle: r,
1657
1657
  menuElement: o
1658
- } = R(Ve) || {}, a = O((c) => {
1658
+ } = q(Ve) || {}, a = O((c) => {
1659
1659
  n(!e, c);
1660
1660
  }, [e, n]), i = {
1661
1661
  id: t,
@@ -1695,7 +1695,7 @@ function bn({
1695
1695
  disabled: r,
1696
1696
  onClick: o
1697
1697
  }) {
1698
- const a = R(nt), i = R(vn), {
1698
+ const a = q(nt), i = q(vn), {
1699
1699
  activeKey: c
1700
1700
  } = i || {}, l = Tt(t, e), u = n == null && t != null ? Tt(c) === l : n;
1701
1701
  return [{
@@ -1745,7 +1745,7 @@ function Ee({
1745
1745
  placement: i = "bottom-start",
1746
1746
  children: c
1747
1747
  }) {
1748
- const l = hr(), [u, d] = os(e, t, r), [h, m] = Et(), g = h.current, [b, w] = Et(), f = b.current, j = Ar(u), v = Y(null), p = Y(!1), C = R(nt), k = O((_, T, F = T == null ? void 0 : T.type) => {
1748
+ const l = hr(), [u, d] = os(e, t, r), [h, m] = Et(), g = h.current, [b, w] = Et(), f = b.current, j = Ar(u), v = Y(null), p = Y(!1), C = q(nt), k = O((_, T, F = T == null ? void 0 : T.type) => {
1749
1749
  d(_, {
1750
1750
  originalEvent: T,
1751
1751
  source: F
@@ -1781,22 +1781,22 @@ function Ee({
1781
1781
  if (!h.current)
1782
1782
  return null;
1783
1783
  const F = bt(h.current, o);
1784
- let q = F.indexOf(_) + T;
1785
- return q = Math.max(0, Math.min(q, F.length)), F[q];
1784
+ let W = F.indexOf(_) + T;
1785
+ return W = Math.max(0, Math.min(W, F.length)), F[W];
1786
1786
  };
1787
1787
  return zo(O(() => l.document, [l]), "keydown", (_) => {
1788
1788
  var T, F;
1789
1789
  const {
1790
- key: q
1791
- } = _, H = _.target, W = (T = h.current) == null ? void 0 : T.contains(H), B = (F = b.current) == null ? void 0 : F.contains(H);
1792
- if (/input|textarea/i.test(H.tagName) && (q === " " || q !== "Escape" && W || q === "Escape" && H.type === "search") || !W && !B || q === "Tab" && (!h.current || !u))
1790
+ key: W
1791
+ } = _, H = _.target, R = (T = h.current) == null ? void 0 : T.contains(H), B = (F = b.current) == null ? void 0 : F.contains(H);
1792
+ if (/input|textarea/i.test(H.tagName) && (W === " " || W !== "Escape" && R || W === "Escape" && H.type === "search") || !R && !B || W === "Tab" && (!h.current || !u))
1793
1793
  return;
1794
1794
  v.current = _.type;
1795
1795
  const te = {
1796
1796
  originalEvent: _,
1797
1797
  source: _.type
1798
1798
  };
1799
- switch (q) {
1799
+ switch (W) {
1800
1800
  case "ArrowUp": {
1801
1801
  const U = N(H, -1);
1802
1802
  U && U.focus && U.focus(), _.preventDefault();
@@ -1819,7 +1819,7 @@ function Ee({
1819
1819
  });
1820
1820
  break;
1821
1821
  case "Escape":
1822
- q === "Escape" && (_.preventDefault(), _.stopPropagation()), d(!1, te);
1822
+ W === "Escape" && (_.preventDefault(), _.stopPropagation()), d(!1, te);
1823
1823
  break;
1824
1824
  }
1825
1825
  }), /* @__PURE__ */ s.jsx(nt.Provider, {
@@ -1930,13 +1930,13 @@ const Tn = /* @__PURE__ */ A.forwardRef(({
1930
1930
  ...d
1931
1931
  }, h) => {
1932
1932
  let m = !1;
1933
- const g = R($n), b = V(t, "dropdown-menu"), {
1933
+ const g = q($n), b = V(t, "dropdown-menu"), {
1934
1934
  align: w,
1935
1935
  drop: f,
1936
1936
  isRTL: j
1937
- } = R(ht);
1937
+ } = q(ht);
1938
1938
  n = n || w;
1939
- const v = R(Ue), p = [];
1939
+ const v = q(Ue), p = [];
1940
1940
  if (n)
1941
1941
  if (typeof n == "object") {
1942
1942
  const _ = Object.keys(n);
@@ -1989,7 +1989,7 @@ const En = /* @__PURE__ */ A.forwardRef(({
1989
1989
  as: o = hn,
1990
1990
  ...a
1991
1991
  }, i) => {
1992
- const c = V(t, "dropdown-toggle"), l = R(Ve);
1992
+ const c = V(t, "dropdown-toggle"), l = q(Ve);
1993
1993
  r !== void 0 && (a.bsPrefix = r);
1994
1994
  const [u] = xn();
1995
1995
  return u.ref = st(u.ref, In(i, "DropdownToggle")), /* @__PURE__ */ s.jsx(o, {
@@ -2016,7 +2016,7 @@ const On = /* @__PURE__ */ A.forwardRef((t, e) => {
2016
2016
  ...g
2017
2017
  } = pr(t, {
2018
2018
  show: "onToggle"
2019
- }), b = R(Ue), w = V(n, "dropdown"), f = gr(), j = ($) => m === !1 ? $ === "click" : m === "inside" ? $ !== "rootClose" : m === "outside" ? $ !== "select" : !0, v = ge(($, M) => {
2019
+ }), b = q(Ue), w = V(n, "dropdown"), f = gr(), j = ($) => m === !1 ? $ === "click" : m === "inside" ? $ !== "rootClose" : m === "outside" ? $ !== "select" : !0, v = ge(($, M) => {
2020
2020
  var S, N;
2021
2021
  !((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) && (l == null || l($, M)));
2022
2022
  }), C = Sn(i === "end", r, f), k = z(() => ({
@@ -2095,7 +2095,7 @@ const Oe = /* @__PURE__ */ A.forwardRef(({
2095
2095
  }, l) => {
2096
2096
  const {
2097
2097
  controlId: u
2098
- } = R(ue);
2098
+ } = q(ue);
2099
2099
  return e = V(e, "form-check-input"), /* @__PURE__ */ s.jsx(i, {
2100
2100
  ...c,
2101
2101
  ref: l,
@@ -2113,7 +2113,7 @@ const Ye = /* @__PURE__ */ A.forwardRef(({
2113
2113
  }, o) => {
2114
2114
  const {
2115
2115
  controlId: a
2116
- } = R(ue);
2116
+ } = q(ue);
2117
2117
  return t = V(t, "form-check-label"), /* @__PURE__ */ s.jsx("label", {
2118
2118
  ...r,
2119
2119
  ref: o,
@@ -2147,7 +2147,7 @@ const Mn = /* @__PURE__ */ A.forwardRef(({
2147
2147
  e = V(e, "form-check"), n = V(n, "form-switch");
2148
2148
  const {
2149
2149
  controlId: C
2150
- } = R(ue), k = z(() => ({
2150
+ } = q(ue), k = z(() => ({
2151
2151
  controlId: t || C
2152
2152
  }), [C, t]), y = !f && w != null && w !== !1 || ns(f, Ye), $ = /* @__PURE__ */ s.jsx(Oe, {
2153
2153
  ...v,
@@ -2197,7 +2197,7 @@ const He = Object.assign(Mn, {
2197
2197
  }, m) => {
2198
2198
  const {
2199
2199
  controlId: g
2200
- } = R(ue);
2200
+ } = q(ue);
2201
2201
  return t = V(t, "form-control"), process.env.NODE_ENV !== "production" && at(g == null || !o, "`controlId` is ignored on `<FormControl>` when `id` is specified."), /* @__PURE__ */ s.jsx(d, {
2202
2202
  ...h,
2203
2203
  type: e,
@@ -2234,7 +2234,7 @@ const Fn = /* @__PURE__ */ A.forwardRef(({
2234
2234
  }, c) => {
2235
2235
  const {
2236
2236
  controlId: l
2237
- } = R(ue);
2237
+ } = q(ue);
2238
2238
  e = V(e, "form-label");
2239
2239
  let u = "col-form-label";
2240
2240
  typeof n == "string" && (u = `${u} ${u}-${n}`);
@@ -2264,7 +2264,7 @@ const Wn = /* @__PURE__ */ A.forwardRef(({
2264
2264
  }, o) => {
2265
2265
  const {
2266
2266
  controlId: a
2267
- } = R(ue);
2267
+ } = q(ue);
2268
2268
  return t = V(t, "form-range"), /* @__PURE__ */ s.jsx("input", {
2269
2269
  ...r,
2270
2270
  type: "range",
@@ -2286,7 +2286,7 @@ const Rn = /* @__PURE__ */ A.forwardRef(({
2286
2286
  }, l) => {
2287
2287
  const {
2288
2288
  controlId: u
2289
- } = R(ue);
2289
+ } = q(ue);
2290
2290
  return t = V(t, "form-select"), /* @__PURE__ */ s.jsx("select", {
2291
2291
  ...c,
2292
2292
  size: n,
@@ -2810,14 +2810,14 @@ const va = "_button_1wjon_1", ba = "_filled_1wjon_7", _a = "_sm_1wjon_13", ja =
2810
2810
  md: ja,
2811
2811
  lg: ka
2812
2812
  }, Pt = ({ variant: t = "filled", color: e = "primary", size: n = "md", className: r, children: o, ...a }) => {
2813
- const { LinkComponent: i } = R(ie);
2813
+ const { LinkComponent: i } = q(ie);
2814
2814
  return a.as === "link" ? /* @__PURE__ */ s.jsx(i, { to: a.href ?? "/", className: x(`luminus-primary-button ${e} btn ${t === "outlined" ? `btn-outline-${e}` : `btn-${e}`} ${r ?? ""}`, ve.button, ve[t], ve[n]), ...a, children: o }) : a.as === "button" || a.as === void 0 ? /* @__PURE__ */ s.jsx("button", { type: "button", className: x(`luminus-primary-button ${e} btn ${t === "outlined" ? `btn-outline-${e}` : `btn-${e}`} ${r ?? ""}`, ve.button, ve[t], ve[n]), ...a, children: o }) : null;
2815
2815
  }, Ca = "_submit-container_a9slg_1", Na = "_spacer_a9slg_14", At = {
2816
2816
  "submit-container": "_submit-container_a9slg_1",
2817
2817
  submitContainer: Ca,
2818
2818
  spacer: Na
2819
2819
  }, $a = ({ children: t, onStorno: e }) => {
2820
- const { formSubmitTexts: n } = R(ie);
2820
+ const { formSubmitTexts: n } = q(ie);
2821
2821
  return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
2822
2822
  /* @__PURE__ */ s.jsx("div", { className: At.spacer }),
2823
2823
  /* @__PURE__ */ s.jsxs("div", { className: x("luminus-floating-submit-container shadow", At.submitContainer), children: [
@@ -2841,7 +2841,7 @@ const va = "_button_1wjon_1", ba = "_filled_1wjon_7", _a = "_sm_1wjon_13", ja =
2841
2841
  children: r,
2842
2842
  ...o
2843
2843
  }) => {
2844
- const { LinkComponent: a } = R(ie);
2844
+ const { LinkComponent: a } = q(ie);
2845
2845
  return o.as === "link" ? /* @__PURE__ */ s.jsxs(a, { to: o.href ?? "/", className: x(`luminus-context-button btn text-${t} ${n ?? ""}`, ot.button), ...o, children: [
2846
2846
  e,
2847
2847
  r
@@ -2933,7 +2933,7 @@ const va = "_button_1wjon_1", ba = "_filled_1wjon_7", _a = "_sm_1wjon_13", ja =
2933
2933
  widgetEditOverlay: Ba
2934
2934
  }, vc = ({ availableWidgets: t, editMode: e, defaultDashboardConfig: n }) => {
2935
2935
  var d;
2936
- const { homeDashboardTexts: r } = R(ie), { dashboardConfig: o, onChangeDashboardConfig: a } = Fa(n), i = O((h, m) => {
2936
+ const { homeDashboardTexts: r } = q(ie), { dashboardConfig: o, onChangeDashboardConfig: a } = Fa(n), i = O((h, m) => {
2937
2937
  var g, b;
2938
2938
  h === ((g = o.widgets) == null ? void 0 : g.length) ? a({
2939
2939
  ...o,
@@ -3100,7 +3100,7 @@ const ri = "_wrapper_uccrb_1", oi = "_open_uccrb_9", si = "_dropdown_uccrb_13",
3100
3100
  clearButton: pi
3101
3101
  }, wt = ({ show: t, onCancel: e, items: n, currentSelection: r, onSelectionChange: o, onSearchQueryChange: a, texts: i, itemsNameWidth: c, additionalColumns: l, displayIdAsName: u = !1, autoHideSearch: d = !1, allItemsLength: h, disabled: m, isLoading: g = !1, inputRef: b }) => {
3102
3102
  var I;
3103
- const w = Y(null), f = Y(null), j = Y(null), [v, p] = P(""), [C] = Un(v, 500), [, k] = P(!1), y = (I = b.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, F = 5, q = z(() => $ ? $ > window.innerWidth / 2 : !1, [$]), H = z(() => S ? S > window.innerHeight / 2 : !1, [S]);
3103
+ const w = Y(null), f = Y(null), j = Y(null), [v, p] = P(""), [C] = Un(v, 500), [, k] = P(!1), y = (I = b.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, F = 5, W = z(() => $ ? $ > window.innerWidth / 2 : !1, [$]), H = z(() => S ? S > window.innerHeight / 2 : !1, [S]);
3104
3104
  D(() => {
3105
3105
  var E;
3106
3106
  t && ((E = j.current) == null || E.focus());
@@ -3109,7 +3109,7 @@ const ri = "_wrapper_uccrb_1", oi = "_open_uccrb_9", si = "_dropdown_uccrb_13",
3109
3109
  }, [t]), D(() => {
3110
3110
  a(C);
3111
3111
  }, [C, a]);
3112
- const W = O((E) => {
3112
+ const R = O((E) => {
3113
3113
  switch (E.key) {
3114
3114
  case "Escape":
3115
3115
  E.stopPropagation(), e();
@@ -3122,7 +3122,7 @@ const ri = "_wrapper_uccrb_1", oi = "_open_uccrb_9", si = "_dropdown_uccrb_13",
3122
3122
  window.removeEventListener("scroll", B);
3123
3123
  }), [B]), D(() => (window.addEventListener("resize", B), () => {
3124
3124
  window.removeEventListener("resize", B);
3125
- }), [B]), en(W), tn([w, f], e);
3125
+ }), [B]), en(R), tn([w, f], e);
3126
3126
  const oe = c ?? (l && l.length > 0 ? 250 : 0), te = (l == null ? void 0 : l.reduce((E, K) => E + (K.width ?? 100), 0)) ?? 0, U = `calc(max(${_}px, ${oe}px + ${te}px))`;
3127
3127
  return /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
3128
3128
  /* @__PURE__ */ s.jsx(zn, { show: t, onClick: e }),
@@ -3134,8 +3134,8 @@ const ri = "_wrapper_uccrb_1", oi = "_open_uccrb_9", si = "_dropdown_uccrb_13",
3134
3134
  [X.open]: t
3135
3135
  }), style: {
3136
3136
  top: H ? `calc(${S}px - 50vh - 8px)` : `calc(${N}px + 8px)`,
3137
- left: q ? `calc(${M}px - ${U})` : $,
3138
- right: q ? `${M}px` : `calc(${$}px + ${U})`,
3137
+ left: W ? `calc(${M}px - ${U})` : $,
3138
+ right: W ? `${M}px` : `calc(${$}px + ${U})`,
3139
3139
  width: U,
3140
3140
  justifyContent: H ? "flex-end" : "flex-start"
3141
3141
  }, children: /* @__PURE__ */ s.jsx("div", { ref: w, className: x("shadow rounded", X.dropdown), children: !m && /* @__PURE__ */ s.jsxs(s.Fragment, { children: [
@@ -3208,7 +3208,7 @@ const wi = "_item_1dy8x_1", Kn = {
3208
3208
  header: Ei,
3209
3209
  item: Oi
3210
3210
  }, Mi = ({ show: t, query: e, onCancel: n, groups: r, isLoading: o, searchTypes: a }) => {
3211
- const { LinkComponent: i, appSearchTexts: c } = R(ie), l = Y(null), u = O((d) => {
3211
+ const { LinkComponent: i, appSearchTexts: c } = q(ie), l = Y(null), u = O((d) => {
3212
3212
  var m;
3213
3213
  const h = (m = a.find((g) => g.key === d.type)) == null ? void 0 : m.toPath;
3214
3214
  return h ? `${h}/${d.searchKey}` : "/not-found";
@@ -3269,7 +3269,7 @@ const wi = "_item_1dy8x_1", Kn = {
3269
3269
  l();
3270
3270
  }, [l]), { isLoading: r, searchItems: a };
3271
3271
  }, Cc = ({ searchTypes: t, navigateFunction: e }) => {
3272
- const { appSearchTexts: n } = R(ie), [r, o] = P(t.length > 0 ? t[0] : null), [a, i] = P(""), [c, l] = Un(a, 500), { isLoading: u, searchItems: d } = qi(r, c), [h, m] = P(!1);
3272
+ const { appSearchTexts: n } = q(ie), [r, o] = P(t.length > 0 ? t[0] : null), [a, i] = P(""), [c, l] = Un(a, 500), { isLoading: u, searchItems: d } = qi(r, c), [h, m] = P(!1);
3273
3273
  return D(() => {
3274
3274
  (d.length > 0 || u) && m(!0);
3275
3275
  }, [d, u]), /* @__PURE__ */ s.jsx(ee, { onSubmit: (g) => {
@@ -3419,7 +3419,7 @@ const wi = "_item_1dy8x_1", Kn = {
3419
3419
  u.length > 0 && e(Array.from(u));
3420
3420
  }, icon: /* @__PURE__ */ s.jsx(Kt, { style: { fontSize: 18 } }), multiple: !0, children: n ?? null }) : null;
3421
3421
  }, Ic = ({ appAccessPermissions: t, children: e }) => {
3422
- const { NavigateComponent: n } = R(ie), { useMsal: r, msalScopes: o } = R(Tr), { isAuthenticated: a } = Er(), { user: i } = R(Or), c = i && (t == null ? void 0 : t.every((l) => {
3422
+ const { NavigateComponent: n } = q(ie), { useMsal: r, msalScopes: o } = q(Tr), { isAuthenticated: a } = Er(), { user: i } = q(Or), c = i && (t == null ? void 0 : t.every((l) => {
3423
3423
  var u;
3424
3424
  return (u = i.permissions) == null ? void 0 : u.includes(l);
3425
3425
  }));
@@ -3431,7 +3431,7 @@ const wi = "_item_1dy8x_1", Kn = {
3431
3431
  /* @__PURE__ */ s.jsx(Xe.Header, { as: "h3", children: t }),
3432
3432
  /* @__PURE__ */ s.jsx(Xe.Body, { children: e })
3433
3433
  ] }), trigger: o ?? "hover", rootClose: !0, children: r }), Qn = ({ currentSelection: t, selectedItemNavigateTo: e, children: n }) => {
3434
- const { LinkComponent: r } = R(ie);
3434
+ const { LinkComponent: r } = q(ie);
3435
3435
  if (!t || !t.id || !e)
3436
3436
  return /* @__PURE__ */ s.jsx("div", { className: "luminus-input-container position-relative w-100", children: n });
3437
3437
  const o = e(t);
@@ -3510,10 +3510,10 @@ const wi = "_item_1dy8x_1", Kn = {
3510
3510
  D(() => {
3511
3511
  C(n);
3512
3512
  }, [n]);
3513
- const $ = O((q) => {
3514
- C(q);
3515
- }, []), M = O((q) => {
3516
- y(!1), $(q);
3513
+ const $ = O((W) => {
3514
+ C(W);
3515
+ }, []), M = O((W) => {
3516
+ y(!1), $(W);
3517
3517
  }, [$]);
3518
3518
  D(() => {
3519
3519
  l && l(p);
@@ -3522,11 +3522,11 @@ const wi = "_item_1dy8x_1", Kn = {
3522
3522
  return /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsxs(t, { withoutLabel: d, label: u ?? "", hidden: b, inputContainerClassName: x({ "luminus-dropdown-select-open": k }), className: v, children: [
3523
3523
  /* @__PURE__ */ s.jsxs(Qn, { currentSelection: p, selectedItemNavigateTo: r, children: [
3524
3524
  f && (p == null ? void 0 : p.name) && /* @__PURE__ */ s.jsx(Q, { variant: "caption", className: "luminus-dropdown-selection-name d-flex justify-content-end mt-2", children: p.name }),
3525
- /* @__PURE__ */ s.jsxs(ee.Select, { ref: S, size: h, value: (p == null ? void 0 : p.id) ?? "", onChange: (q) => C({
3526
- id: c ? Number(q.target.value) ?? null : q.target.value,
3525
+ /* @__PURE__ */ s.jsxs(ee.Select, { ref: S, size: h, value: (p == null ? void 0 : p.id) ?? "", onChange: (W) => C({
3526
+ id: c ? Number(W.target.value) ?? null : W.target.value,
3527
3527
  name: ""
3528
- }), onMouseDown: (q) => {
3529
- q.currentTarget.focus(), q.preventDefault();
3528
+ }), onMouseDown: (W) => {
3529
+ W.currentTarget.focus(), W.preventDefault();
3530
3530
  }, onClick: () => {
3531
3531
  !N && !w && y(!0);
3532
3532
  }, className: x("w-100", {
@@ -3538,7 +3538,9 @@ const wi = "_item_1dy8x_1", Kn = {
3538
3538
  p && /* @__PURE__ */ s.jsx("option", { value: p.id ?? void 0, children: p.name && ((F = p.name) == null ? void 0 : F.length) > 0 ? p.name : p.id })
3539
3539
  ] }),
3540
3540
  j || !w && N ? /* @__PURE__ */ s.jsxs("div", { className: "custom-picker-button", children: [
3541
- !j && !w && N && /* @__PURE__ */ s.jsx(J, { size: "sm", color: "secondary", onClick: () => y(!0), children: /* @__PURE__ */ s.jsx(zt, {}) }),
3541
+ !j && !w && N && /* @__PURE__ */ s.jsx(J, { size: "sm", color: "secondary", onClick: (W) => {
3542
+ W.preventDefault(), W.stopPropagation(), y(!0);
3543
+ }, children: /* @__PURE__ */ s.jsx(zt, {}) }),
3542
3544
  j ?? null
3543
3545
  ] }) : null
3544
3546
  ] }),
@@ -3612,15 +3614,15 @@ const wi = "_item_1dy8x_1", Kn = {
3612
3614
  ] });
3613
3615
  }, Fc = ({ InputContainer: t = we, type: e, formField: n, label: r, placeholder: o, size: a, resetsFields: i, showClearIcon: c, clearValue: l, required: u, hidden: d, disabled: h, withoutLabel: m, list: g, step: b, CustomOnChangeComponent: w, className: f }) => {
3614
3616
  const { register: j, formState: v, setValue: p, watch: C } = de(), [k, y] = P(void 0), [$, M] = P(!1), S = O(() => {
3615
- const W = l ?? null;
3616
- e === "number" ? p(n, W !== null ? Number(W) : null, {
3617
+ const R = l ?? null;
3618
+ e === "number" ? p(n, R !== null ? Number(R) : null, {
3617
3619
  shouldDirty: !0,
3618
3620
  shouldValidate: $
3619
- }) : p(n, (W == null ? void 0 : W.toString()) ?? "", { shouldDirty: !0, shouldValidate: $ });
3621
+ }) : p(n, (R == null ? void 0 : R.toString()) ?? "", { shouldDirty: !0, shouldValidate: $ });
3620
3622
  }, [l, e, p, n, $]), N = O(() => {
3621
- const W = n.split(".");
3623
+ const R = n.split(".");
3622
3624
  let B = v.errors;
3623
- W.forEach((oe) => {
3625
+ R.forEach((oe) => {
3624
3626
  B !== void 0 && (B = B[oe]);
3625
3627
  }), y(B);
3626
3628
  }, [v, n]);
@@ -3629,15 +3631,15 @@ const wi = "_item_1dy8x_1", Kn = {
3629
3631
  }, [N]), D(() => {
3630
3632
  v.isSubmitted && M(!0);
3631
3633
  }, [v]);
3632
- const _ = k !== void 0, [T, F] = P(!1), q = C(n), H = nn(e, q ?? null, T);
3634
+ const _ = k !== void 0, [T, F] = P(!1), W = C(n), H = nn(e, W ?? null, T);
3633
3635
  return /* @__PURE__ */ s.jsxs(t, { label: `${r}${u ? " *" : ""}`, hidden: d, withoutLabel: m, isInvalid: _, className: f, children: [
3634
3636
  /* @__PURE__ */ s.jsxs("div", { className: "luminus-input-container position-relative w-100", children: [
3635
3637
  /* @__PURE__ */ s.jsx(ee.Control, { type: H, placeholder: o ?? r, size: a, onFocus: () => {
3636
3638
  F(!0);
3637
3639
  }, ...j(n, {
3638
- setValueAs: (W) => e === "number" ? W == null || W === "" ? null : Number(W) : W == null || W === "" ? null : W,
3640
+ setValueAs: (R) => e === "number" ? R == null || R === "" ? null : Number(R) : R == null || R === "" ? null : R,
3639
3641
  onChange: () => {
3640
- i && i.forEach((W) => p(W, null, { shouldDirty: !0, shouldValidate: $ }));
3642
+ i && i.forEach((R) => p(R, null, { shouldDirty: !0, shouldValidate: $ }));
3641
3643
  },
3642
3644
  onBlur: () => F(!1)
3643
3645
  }), isInvalid: _, hidden: d, disabled: h, list: g, className: "w-100", step: b }),
@@ -3647,7 +3649,7 @@ const wi = "_item_1dy8x_1", Kn = {
3647
3649
  k && /* @__PURE__ */ s.jsx(xe, { message: k.message })
3648
3650
  ] });
3649
3651
  }, Wc = ({ InputContainer: t = we, formField: e, label: n, size: r, defaultSelection: o, resetsFields: a, isNumber: i, required: c, hidden: l, disabled: u, items: d, onSearchQueryChange: h, selectedItemNavigateTo: m, texts: g, dropdownItemsNameWidth: b, isLoading: w, withoutLabel: f, additionalColumns: j, CustomOnChangeComponent: v, displayIdAsName: p, className: C }) => {
3650
- const { formState: k, setValue: y, watch: $, control: M } = de(), [S, N] = P(void 0), [_, T] = P(!1), [F, q] = P(!1), H = $(e) ?? null, W = H === (o == null ? void 0 : o.id) ? o == null ? void 0 : o.name : $(`${e}-DropdownName`), B = z(() => H == null ? null : { id: H ?? null, name: W ?? "" }, [H, W]), oe = O(() => {
3652
+ const { formState: k, setValue: y, watch: $, control: M } = de(), [S, N] = P(void 0), [_, T] = P(!1), [F, W] = P(!1), H = $(e) ?? null, R = H === (o == null ? void 0 : o.id) ? o == null ? void 0 : o.name : $(`${e}-DropdownName`), B = z(() => H == null ? null : { id: H ?? null, name: R ?? "" }, [H, R]), oe = O(() => {
3651
3653
  const G = e.split(".");
3652
3654
  let ce = k.errors;
3653
3655
  G.forEach((Qe) => {
@@ -3676,7 +3678,7 @@ const wi = "_item_1dy8x_1", Kn = {
3676
3678
  D(() => {
3677
3679
  oe();
3678
3680
  }, [oe]), D(() => {
3679
- k.isSubmitted && q(!0);
3681
+ k.isSubmitted && W(!0);
3680
3682
  }, [k]);
3681
3683
  const E = Y(null), K = S !== void 0, Me = m !== void 0, Xn = Me && B !== null;
3682
3684
  return /* @__PURE__ */ s.jsx(s.Fragment, { children: /* @__PURE__ */ s.jsxs(t, { label: `${n}${c ? " *" : ""}`, hidden: l, withoutLabel: f, isInvalid: K, inputContainerClassName: x({ "luminus-dropdown-select-open": _ }), className: C, children: [
@@ -3690,7 +3692,7 @@ const wi = "_item_1dy8x_1", Kn = {
3690
3692
  }, isInvalid: K, hidden: l, className: x("w-100", {
3691
3693
  "luminus-dropdown-picker-disabled": u,
3692
3694
  "luminus-dropdown-picker-link": Xn
3693
- }), children: /* @__PURE__ */ s.jsx("option", { value: H, children: p ? H : (W == null ? void 0 : W.length) > 0 ? W : H }) }) }),
3695
+ }), children: /* @__PURE__ */ s.jsx("option", { value: H, children: p ? H : (R == null ? void 0 : R.length) > 0 ? R : H }) }) }),
3694
3696
  v || !u && Me ? /* @__PURE__ */ s.jsxs("div", { className: "custom-picker-button", children: [
3695
3697
  !v && !u && Me && /* @__PURE__ */ s.jsx(J, { size: "sm", color: "secondary", onClick: (G) => {
3696
3698
  G.preventDefault(), G.stopPropagation(), T(!0);
@@ -3730,13 +3732,13 @@ const wi = "_item_1dy8x_1", Kn = {
3730
3732
  o(Object.keys(n.dirtyFields).length > 0);
3731
3733
  }, [n]), r ? /* @__PURE__ */ s.jsx($a, { onStorno: e, children: t }) : null;
3732
3734
  }, Lc = ({ InputContainer: t = we, options: e, formField: n, label: r, size: o, resetsFields: a, isNumber: i, required: c, hidden: l, disabled: u, withoutLabel: d, noSortOptions: h, suffixIdToName: m, className: g }) => {
3733
- const { customSelectTexts: b } = R(ie), { formState: w, setValue: f, watch: j, control: v } = de(), [p, C] = P(void 0), [k, y] = P(!1), [$, M] = P(!1), [S, N] = P(""), _ = j(n), T = z(() => e.find((I) => I.id === _) ?? null, [e, _]), F = O(() => {
3735
+ const { customSelectTexts: b } = q(ie), { formState: w, setValue: f, watch: j, control: v } = de(), [p, C] = P(void 0), [k, y] = P(!1), [$, M] = P(!1), [S, N] = P(""), _ = j(n), T = z(() => e.find((I) => I.id === _) ?? null, [e, _]), F = O(() => {
3734
3736
  const I = n.split(".");
3735
3737
  let E = w.errors;
3736
3738
  I.forEach((K) => {
3737
3739
  E !== void 0 && (E = E[K]);
3738
3740
  }), C(E);
3739
- }, [w, n]), q = O((I) => {
3741
+ }, [w, n]), W = O((I) => {
3740
3742
  if ((I == null ? void 0 : I.id) === _)
3741
3743
  return;
3742
3744
  if (a && a.forEach((K) => f(K, null, { shouldDirty: !0, shouldValidate: $ })), I === null) {
@@ -3752,8 +3754,8 @@ const wi = "_item_1dy8x_1", Kn = {
3752
3754
  shouldValidate: $
3753
3755
  });
3754
3756
  }, [f, n, i, a, _, $]), H = O((I) => {
3755
- y(!1), q(I);
3756
- }, [q]), W = O((I) => {
3757
+ y(!1), W(I);
3758
+ }, [W]), R = O((I) => {
3757
3759
  N(I);
3758
3760
  }, []);
3759
3761
  D(() => {
@@ -3779,7 +3781,7 @@ const wi = "_item_1dy8x_1", Kn = {
3779
3781
  }, ref: te, value: _ ?? "", onChange: () => {
3780
3782
  }, isInvalid: U, hidden: l, disabled: u, className: "w-100", children: /* @__PURE__ */ s.jsx("option", { value: (T == null ? void 0 : T.id) ?? "", children: B(T) }) }) }),
3781
3783
  p && /* @__PURE__ */ s.jsx(xe, { message: p.message }),
3782
- te.current && /* @__PURE__ */ s.jsx(wt, { show: k, onCancel: () => y(!1), items: oe, currentSelection: T ?? null, onSelectionChange: H, onSearchQueryChange: W, texts: b, disabled: u, inputRef: te, autoHideSearch: !0, allItemsLength: e.length })
3784
+ te.current && /* @__PURE__ */ s.jsx(wt, { show: k, onCancel: () => y(!1), items: oe, currentSelection: T ?? null, onSelectionChange: H, onSearchQueryChange: R, texts: b, disabled: u, inputRef: te, autoHideSearch: !0, allItemsLength: e.length })
3783
3785
  ] }) });
3784
3786
  }, Yc = ({ cell: { value: t } }) => /* @__PURE__ */ s.jsx(s.Fragment, { children: t ? /* @__PURE__ */ s.jsx(Dr, { name: t, size: 21, fontSize: 12 }) : /* @__PURE__ */ s.jsx(s.Fragment, {}) }), ic = "_tab-panel_so0nf_1", cc = "_full-height-no-overflow_so0nf_5", Ht = {
3785
3787
  "tab-panel": "_tab-panel_so0nf_1",
@@ -1 +1 @@
1
- "use strict";const r=require("react"),f=require("./NoInputContainer-BIP9GWLZ.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-C_KMMuq-.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 l, useCallback as u } from "react";
2
- import { aj as p, ak as h } from "./NoInputContainer-aBkWfzUA.js";
2
+ import { aj as p, ak as h } from "./NoInputContainer-vBsdl4By.js";
3
3
  const P = () => {
4
4
  const { isShown: e, text: s, showPrompt: t, hidePrompt: r, resolveRef: o, setOptions: c } = l(p), C = u((n) => {
5
5
  r(), o.current(n);
@@ -1,5 +1,5 @@
1
1
  import { useContext as t, useCallback as i } from "react";
2
- import { a9 as n } from "./NoInputContainer-aBkWfzUA.js";
2
+ import { a9 as n } from "./NoInputContainer-vBsdl4By.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-BIP9GWLZ.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-C_KMMuq-.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.57",
3
+ "version": "1.2.59",
4
4
  "description": "Library of React Components reusable in Luminus projects (Fleetman, CAFM)",
5
5
  "type": "module",
6
6
  "repository": {