react-luminus-components 1.5.4 → 1.5.6

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 (60) hide show
  1. package/README.md +349 -349
  2. package/dist/.vite/manifest.json +36 -36
  3. package/dist/{FormDisabledProvider-Dko54lPr.js → FormDisabledProvider-CB-JXGnI.js} +5 -5
  4. package/dist/FormDisabledProvider-DtQ7YOqf.cjs +1 -0
  5. package/dist/ShortcutLinksContext-AgOPPcPf.cjs +281 -0
  6. package/dist/{nivo-bar.es-CTjPolEf.js → ShortcutLinksContext-CNZMOV_j.js} +6925 -6887
  7. package/dist/components/ShortcutLinks/ShortcutLinksSetup/comps/ShortcutLinkSetupItem/comps/ShortcutLinkItemEdit/ShortcutLinkItemEdit.d.ts +2 -1
  8. package/dist/components/UserSettings/FileDownloadUS/FileDownloadUS.d.ts +1 -3
  9. package/dist/components/common/Approvals/Approvals/Approvals.d.ts +17 -0
  10. package/dist/components/common/Approvals/Approvals/comps/ApprovalDetail/ApprovalDetail.d.ts +12 -0
  11. package/dist/components/common/Approvals/Approvals/comps/ApprovalDetail/comps/ApprovalDelegations/ApprovalDelegations.d.ts +9 -0
  12. package/dist/components/common/Approvals/Approvals/comps/ApprovalDetail/comps/ApprovalLevel/ApprovalLevel.d.ts +11 -0
  13. package/dist/components/common/Approvals/Approvals/comps/ApprovalDetail/comps/ApprovalLevel/comps/ChangeEmployeeModal/ChangeEmployeeModal.d.ts +13 -0
  14. package/dist/components/common/Approvals/Approvals/comps/ApprovalDetail/comps/ApprovalLevel/comps/index.d.ts +1 -0
  15. package/dist/components/common/Approvals/Approvals/comps/ApprovalDetail/comps/index.d.ts +2 -0
  16. package/dist/components/common/Approvals/Approvals/comps/index.d.ts +1 -0
  17. package/dist/components/common/Approvals/Delegations/ApprovalsDelegations.d.ts +16 -0
  18. package/dist/components/common/Approvals/Delegations/comps/DelegationModal/DelegationModal.d.ts +14 -0
  19. package/dist/components/common/Approvals/Delegations/comps/DelegationModal/hooks/useDelegationModalApi.d.ts +8 -0
  20. package/dist/components/common/Approvals/Delegations/comps/DelegationsTable/DelegationsTable.d.ts +10 -0
  21. package/dist/components/common/Approvals/Delegations/comps/index.d.ts +2 -0
  22. package/dist/components/common/SettingsFormPicker/SettingsFormPicker.d.ts +4 -3
  23. package/dist/components/common/index.d.ts +2 -0
  24. package/dist/contexts.cjs.js +1 -1
  25. package/dist/contexts.es.js +64 -64
  26. package/dist/hooks.cjs.js +1 -1
  27. package/dist/hooks.es.js +47 -47
  28. package/dist/layout.cjs.js +1 -1
  29. package/dist/layout.es.js +23 -23
  30. package/dist/localStorageUtils-CBQuZzg0.cjs +1 -0
  31. package/dist/localStorageUtils-DBNNyBcc.js +57 -0
  32. package/dist/main.cjs.js +60 -60
  33. package/dist/main.d.ts +1 -0
  34. package/dist/main.es.js +9679 -9408
  35. package/dist/models/api/approval/ApprovalDefinitionIndexModel.d.ts +6 -0
  36. package/dist/models/api/approval/ApprovalDefinitionLevelApproverModel.d.ts +7 -0
  37. package/dist/models/api/approval/ApprovalDefinitionLevelModel.d.ts +8 -0
  38. package/dist/models/api/approval/ApprovalDefinitionModel.d.ts +8 -0
  39. package/dist/models/api/approval/ApprovalDelegationModel.d.ts +12 -0
  40. package/dist/models/index.d.ts +7 -1
  41. package/dist/models/texts/ApprovalTexts.d.ts +44 -0
  42. package/dist/models/types/EmployeePickerBaseProps.d.ts +8 -0
  43. package/dist/models/types/dynamicForms/formPickerTypes/SettingsFormGroup.d.ts +1 -1
  44. package/dist/models/types/dynamicForms/formPickerTypes/SettingsFormItem.d.ts +0 -1
  45. package/dist/models/types/dynamicForms/formPickerTypes/SettingsFormItemWithGroup.d.ts +6 -0
  46. package/dist/models/types/dynamicForms/index.d.ts +1 -0
  47. package/dist/style.css +1 -1
  48. package/dist/useLocalStorageState-B_unZcbQ.cjs +1 -0
  49. package/dist/{useLocalStorageState-BpK3wMPU.js → useLocalStorageState-Uqlj_lt1.js} +10 -10
  50. package/dist/utils/constants/CommonLuminusIconsArray.d.ts +1 -1
  51. package/dist/utils/file/fileUtils.d.ts +2 -0
  52. package/dist/utils.cjs.js +1 -1
  53. package/dist/utils.es.js +80 -85
  54. package/dist/variables.scss +165 -165
  55. package/package.json +123 -123
  56. package/dist/FormDisabledProvider-DEnF17ZC.cjs +0 -1
  57. package/dist/localStorageUtils-CHdu9Xvf.js +0 -46
  58. package/dist/localStorageUtils-DUQHXXBp.cjs +0 -1
  59. package/dist/nivo-bar.es-BBwBFH2s.cjs +0 -281
  60. package/dist/useLocalStorageState-BrwcXD6Y.cjs +0 -1
package/dist/layout.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { aM as T, j as n, c as i, Y as C, aA as A, bt as S, aC as q, bA as $, bB as O } from "./nivo-bar.es-CTjPolEf.js";
2
- import { aq as Bn, bC as Cn } from "./nivo-bar.es-CTjPolEf.js";
1
+ import { bw as T, j as n, c as i, Y as C, ao as S, bb as $, a2 as q, bC as A, bD as O } from "./ShortcutLinksContext-CNZMOV_j.js";
2
+ import { b9 as Bn, bE as Cn } from "./ShortcutLinksContext-CNZMOV_j.js";
3
3
  import { useState as L, useRef as R, useMemo as P, useEffect as D } from "react";
4
4
  import { Link as B } from "react-router-dom";
5
5
  import "react-hook-form";
@@ -7,13 +7,13 @@ import "react-flexmonster";
7
7
  import "@azure/msal-browser";
8
8
  import "@azure/msal-react";
9
9
  import "react-dom";
10
- const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm_10", E = "_nav-button_o72rm_13", G = "_child_o72rm_21", H = "_text_o72rm_26", U = "_icon_o72rm_36", W = "_collapse-icon_o72rm_42", Y = "_collapsed_o72rm_52", J = "_collapse-icon-mini_o72rm_55", Q = "_expanded_o72rm_86", V = "_children-container_o72rm_92", X = "_visible_o72rm_100", Z = "_children_o72rm_92", nn = "_mobile_o72rm_112", s = {
10
+ const E = "_side-menu-item_o72rm_1", F = "_disabled_o72rm_6", K = "_hidden_o72rm_10", z = "_nav-button_o72rm_13", G = "_child_o72rm_21", H = "_text_o72rm_26", U = "_icon_o72rm_36", W = "_collapse-icon_o72rm_42", Y = "_collapsed_o72rm_52", J = "_collapse-icon-mini_o72rm_55", Q = "_expanded_o72rm_86", V = "_children-container_o72rm_92", X = "_visible_o72rm_100", Z = "_children_o72rm_92", nn = "_mobile_o72rm_112", s = {
11
11
  "side-menu-item": "_side-menu-item_o72rm_1",
12
- sideMenuItem: F,
13
- disabled: K,
14
- hidden: z,
12
+ sideMenuItem: E,
13
+ disabled: F,
14
+ hidden: K,
15
15
  "nav-button": "_nav-button_o72rm_13",
16
- navButton: E,
16
+ navButton: z,
17
17
  child: G,
18
18
  text: H,
19
19
  icon: U,
@@ -28,15 +28,15 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
28
28
  visible: X,
29
29
  children: Z,
30
30
  mobile: nn
31
- }, en = ({ item: e, menuExpanded: l, useTooltips: r, children: c }) => e.tooltip && !l && r ? /* @__PURE__ */ n.jsx(A, { text: e.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ n.jsx("div", { children: c }) }) : c, w = ({ item: e, menuExpanded: l, collapsed: r, onCollapse: c, currentPath: u, useHover: a, useTooltips: b, isMobile: g, disableMode: d }) => {
32
- var y, k, M, N;
31
+ }, en = ({ item: e, menuExpanded: l, useTooltips: r, children: c }) => e.tooltip && !l && r ? /* @__PURE__ */ n.jsx(S, { text: e.tooltip, placement: "top", delay: { show: 1e3, hide: 0 }, children: /* @__PURE__ */ n.jsx("div", { children: c }) }) : c, w = ({ item: e, menuExpanded: l, collapsed: r, onCollapse: c, currentPath: u, useHover: a, useTooltips: b, isMobile: g, disableMode: d }) => {
32
+ var y, k, N, M;
33
33
  const [f, v] = L(!1), [h] = u.split("?"), j = e.linkTo === h || ((y = e.children) == null ? void 0 : y.some((o) => o.linkTo === h)), m = R(null);
34
34
  return T([m], () => r && c()), /* @__PURE__ */ n.jsxs("li", { ref: m, className: i("luminus-side-menu-item", s.sideMenuItem, { [s.mobile]: g }, {
35
35
  [s.expanded]: l
36
36
  }, { active: f || j }, { open: r && e.children }, {
37
37
  [d === "disable" ? s.disabled : s.hidden]: e.disabled || e.notPermitted || ((k = e.children) == null ? void 0 : k.every((o) => o.notPermitted || o.disabled))
38
38
  }, {
39
- [d === "disable" ? "disabled" : "hidden"]: e.disabled || e.notPermitted || ((M = e.children) == null ? void 0 : M.every((o) => o.notPermitted || o.disabled))
39
+ [d === "disable" ? "disabled" : "hidden"]: e.disabled || e.notPermitted || ((N = e.children) == null ? void 0 : N.every((o) => o.notPermitted || o.disabled))
40
40
  }), onMouseEnter: () => v(!0), onMouseLeave: () => v(!1), children: [
41
41
  /* @__PURE__ */ n.jsx(en, { item: e, menuExpanded: l, useTooltips: b, children: e.children ? /* @__PURE__ */ n.jsx(n.Fragment, { children: /* @__PURE__ */ n.jsxs("button", { type: "button", className: i("nav-link", s.navButton), onClick: () => {
42
42
  c();
@@ -55,7 +55,7 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
55
55
  ] }) }),
56
56
  /* @__PURE__ */ n.jsx("div", { className: i("children-container", s.childrenContainer, {
57
57
  [s.visible]: r
58
- }), children: /* @__PURE__ */ n.jsx("div", { className: i("shadow rounded children", s.children), children: (N = e.children) == null ? void 0 : N.map((o) => /* @__PURE__ */ n.jsx(B, { to: o.disabled || o.notPermitted ? "/" : o.linkTo ?? "/", className: i("nav-link child rounded", s.navButton, s.child, {
58
+ }), children: /* @__PURE__ */ n.jsx("div", { className: i("shadow rounded children", s.children), children: (M = e.children) == null ? void 0 : M.map((o) => /* @__PURE__ */ n.jsx(B, { to: o.disabled || o.notPermitted ? "/" : o.linkTo ?? "/", className: i("nav-link child rounded", s.navButton, s.child, {
59
59
  [d === "disable" ? s.disabled : s.hidden]: o.disabled || o.notPermitted
60
60
  }, {
61
61
  [d === "disable" ? "disabled" : "hidden"]: o.disabled || o.notPermitted
@@ -75,8 +75,8 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
75
75
  onlyLogo: an,
76
76
  mobile: dn,
77
77
  divider: cn
78
- }, _n = 14, Mn = ({ headerItem: e, searchItem: l, shortcutsItem: r, mainItems: c, secondaryItems: u, expanded: a, setExpanded: b, currentPath: g, useHover: d, useTooltips: f, disableMode: v = "disable" }) => {
79
- const [h, j] = L(-1), { checkUserHasPermissions: m } = S(), y = P(() => c.map((t) => {
78
+ }, _n = 14, Nn = ({ headerItem: e, searchItem: l, shortcutsItem: r, mainItems: c, secondaryItems: u, expanded: a, setExpanded: b, currentPath: g, useHover: d, useTooltips: f, disableMode: v = "disable" }) => {
79
+ const [h, j] = L(-1), { checkUserHasPermissions: m } = $(), y = P(() => c.map((t) => {
80
80
  var _;
81
81
  return {
82
82
  ...t,
@@ -97,22 +97,22 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
97
97
  notPermitted: !m(x.permissions ?? [], "any")
98
98
  }))
99
99
  };
100
- }), [u, m]), M = (t) => {
100
+ }), [u, m]), N = (t) => {
101
101
  j(t === h ? -1 : t);
102
102
  };
103
103
  D(() => {
104
104
  a || j(-1);
105
105
  }, [a]);
106
- const N = R(null);
107
- T([N], () => b(!1));
106
+ const M = R(null);
107
+ T([M], () => b(!1));
108
108
  const { isMobile: o } = q();
109
- return /* @__PURE__ */ n.jsxs("section", { ref: N, className: i("luminus-side-menu shadow", p.sideMenu, { [p.mobile]: o }, {
109
+ return /* @__PURE__ */ n.jsxs("section", { ref: M, className: i("luminus-side-menu shadow", p.sideMenu, { [p.mobile]: o }, {
110
110
  [p.expand]: a
111
111
  }, { expand: a }), onMouseEnter: () => d && b(!0), onMouseLeave: () => d && b(!1), children: [
112
112
  /* @__PURE__ */ n.jsx("div", { className: i("sidebar-header", p.sidebarHeader, {
113
113
  [p.onlyLogo]: d
114
114
  }), role: d ? void 0 : "button", onClick: d ? void 0 : () => b(!a), children: d ? e : a ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
115
- /* @__PURE__ */ n.jsx($, {}),
115
+ /* @__PURE__ */ n.jsx(A, {}),
116
116
  e
117
117
  ] }) : /* @__PURE__ */ n.jsx(O, {}) }),
118
118
  a && (l || r) ? /* @__PURE__ */ n.jsxs("div", { className: "mb-3 d-flex flex-column gap-3", children: [
@@ -122,9 +122,9 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
122
122
  /* @__PURE__ */ n.jsxs("ul", { className: i(p.sideMenuContent, {
123
123
  [p.noTopMargin]: [...y, ...k].length > _n
124
124
  }), children: [
125
- y.map((t, _) => /* @__PURE__ */ n.jsx(w, { item: t, menuExpanded: a, collapsed: _ === h, onCollapse: () => M(_), currentPath: g, useHover: d, useTooltips: f, isMobile: o, disableMode: v }, t.title)),
125
+ y.map((t, _) => /* @__PURE__ */ n.jsx(w, { item: t, menuExpanded: a, collapsed: _ === h, onCollapse: () => N(_), currentPath: g, useHover: d, useTooltips: f, isMobile: o, disableMode: v }, t.title)),
126
126
  /* @__PURE__ */ n.jsx("hr", { className: i("divider", p.divider) }),
127
- k.map((t, _) => /* @__PURE__ */ n.jsx(w, { item: t, menuExpanded: a, collapsed: _ === h, onCollapse: () => M(_), currentPath: g, useHover: d, useTooltips: f, isMobile: o, disableMode: v }, t.title))
127
+ k.map((t, _) => /* @__PURE__ */ n.jsx(w, { item: t, menuExpanded: a, collapsed: _ === h, onCollapse: () => N(_), currentPath: g, useHover: d, useTooltips: f, isMobile: o, disableMode: v }, t.title))
128
128
  ] })
129
129
  ] });
130
130
  }, mn = "_top-bar_lnmq0_1", pn = "_top-bar-brand_lnmq0_12", I = {
@@ -132,7 +132,7 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
132
132
  topBar: mn,
133
133
  "top-bar-brand": "_top-bar-brand_lnmq0_12",
134
134
  topBarBrand: pn
135
- }, Nn = ({ appName: e, leftOffset: l, leftContent: r, centerContent: c, rightContent: u }) => /* @__PURE__ */ n.jsx("nav", { className: i("luminus-top-bar shadow", I.topBar), style: {
135
+ }, Mn = ({ appName: e, leftOffset: l, leftContent: r, centerContent: c, rightContent: u }) => /* @__PURE__ */ n.jsx("nav", { className: i("luminus-top-bar shadow", I.topBar), style: {
136
136
  width: l ? `calc(100% - ${l}px)` : void 0,
137
137
  left: l ? `${l}px` : void 0
138
138
  }, children: /* @__PURE__ */ n.jsxs("div", { className: "w-100 row g-0", children: [
@@ -146,6 +146,6 @@ const F = "_side-menu-item_o72rm_1", K = "_disabled_o72rm_6", z = "_hidden_o72rm
146
146
  export {
147
147
  Bn as PageContainer,
148
148
  Cn as SideContentBar,
149
- Mn as SideMenu,
150
- Nn as TopBar
149
+ Nn as SideMenu,
150
+ Mn as TopBar
151
151
  };
@@ -0,0 +1 @@
1
+ "use strict";const i=require("react-router-dom"),s=(r,t,o)=>{let e=r;return t!==void 0&&(e=Math.max(e,t)),o!==void 0&&(e=Math.min(e,o)),e};function l(r,t){r.setValue(t,null)}function S(r,t){t.forEach(o=>{l(r,o)})}const c=(r,t,o=!0)=>Object.keys(r).reduce((e,n)=>{const u=r[n];return o&&(u==null||u==="")||(e[n]=t(u,n)),e},{}),a=(r,t)=>{const o=t!=null&&t.query?new URLSearchParams(c(t.query,e=>(e==null?void 0:e.toString())??"")):null;return`${i.generatePath(r,t!=null&&t.path?c(t.path,e=>(e==null?void 0:e.toString())??null):void 0)}${o&&o.size>0?`?${o.toString()}`:""}`},g=[{key:"msal",mode:"includes"},{key:"token",mode:"exact"},{key:"user",mode:"exact"},{key:"user-delegation",mode:"exact"}],h=(r=!0)=>{const t={};for(let o=0;o<localStorage.length;o++){const e=localStorage.key(o);if(e&&!(r&&g.some(({key:n,mode:u})=>u==="includes"?e.includes(n):e===n)))try{t[e]=JSON.parse(localStorage.getItem(e))}catch{t[e]=localStorage.getItem(e)}}return t},d=r=>{try{const t=JSON.parse(r);if(typeof t!="object"||t===null)return!1;Object.entries(t).forEach(([o,e])=>{localStorage.setItem(o,JSON.stringify(e))})}catch{return!1}return!0};exports.dumpLocalStorage=h;exports.generateApiPath=a;exports.hookFormSetNull=l;exports.hookFormSetNulls=S;exports.limitNumber=s;exports.restoreLocalStorage=d;
@@ -0,0 +1,57 @@
1
+ import { generatePath as l } from "react-router-dom";
2
+ const S = (r, t, o) => {
3
+ let e = r;
4
+ return t !== void 0 && (e = Math.max(e, t)), o !== void 0 && (e = Math.min(e, o)), e;
5
+ };
6
+ function i(r, t) {
7
+ r.setValue(t, null);
8
+ }
9
+ function g(r, t) {
10
+ t.forEach((o) => {
11
+ i(r, o);
12
+ });
13
+ }
14
+ const u = (r, t, o = !0) => Object.keys(r).reduce((e, n) => {
15
+ const c = r[n];
16
+ return o && (c == null || c === "") || (e[n] = t(c, n)), e;
17
+ }, {}), f = (r, t) => {
18
+ const o = t != null && t.query ? new URLSearchParams(u(t.query, (e) => (e == null ? void 0 : e.toString()) ?? "")) : null;
19
+ return `${l(r, t != null && t.path ? u(t.path, (e) => (e == null ? void 0 : e.toString()) ?? null) : void 0)}${o && o.size > 0 ? `?${o.toString()}` : ""}`;
20
+ }, s = [
21
+ { key: "msal", mode: "includes" },
22
+ { key: "token", mode: "exact" },
23
+ { key: "user", mode: "exact" },
24
+ { key: "user-delegation", mode: "exact" }
25
+ ], d = (r = !0) => {
26
+ const t = {};
27
+ for (let o = 0; o < localStorage.length; o++) {
28
+ const e = localStorage.key(o);
29
+ if (e && !(r && s.some(({ key: n, mode: c }) => c === "includes" ? e.includes(n) : e === n)))
30
+ try {
31
+ t[e] = JSON.parse(localStorage.getItem(e));
32
+ } catch {
33
+ t[e] = localStorage.getItem(e);
34
+ }
35
+ }
36
+ return t;
37
+ }, h = (r) => {
38
+ try {
39
+ const t = JSON.parse(r);
40
+ if (typeof t != "object" || t === null)
41
+ return !1;
42
+ Object.entries(t).forEach(([o, e]) => {
43
+ localStorage.setItem(o, JSON.stringify(e));
44
+ });
45
+ } catch {
46
+ return !1;
47
+ }
48
+ return !0;
49
+ };
50
+ export {
51
+ g as a,
52
+ d,
53
+ f as g,
54
+ i as h,
55
+ S as l,
56
+ h as r
57
+ };