react-luminus-components 1.5.1 → 1.5.3

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.
@@ -21,13 +21,13 @@
21
21
  "file": "ShortcutLinksContext-CH9KdcxB.js",
22
22
  "name": "ShortcutLinksContext"
23
23
  },
24
- "_apiPathUtils-CkTRKCPh.cjs": {
25
- "file": "apiPathUtils-CkTRKCPh.cjs",
26
- "name": "apiPathUtils"
24
+ "_localStorageUtils-CHdu9Xvf.js": {
25
+ "file": "localStorageUtils-CHdu9Xvf.js",
26
+ "name": "localStorageUtils"
27
27
  },
28
- "_apiPathUtils-DiqvB8mF.js": {
29
- "file": "apiPathUtils-DiqvB8mF.js",
30
- "name": "apiPathUtils"
28
+ "_localStorageUtils-DUQHXXBp.cjs": {
29
+ "file": "localStorageUtils-DUQHXXBp.cjs",
30
+ "name": "localStorageUtils"
31
31
  },
32
32
  "_useLocalStorageState-C-xR82iw.js": {
33
33
  "file": "useLocalStorageState-C-xR82iw.js",
@@ -92,7 +92,7 @@
92
92
  "_FormDisabledProvider-BPet3cgR.cjs",
93
93
  "_useRenderDraggableInPortal-QPCaw-E_.cjs",
94
94
  "_useLocalStorageState-CAHDOgis.cjs",
95
- "_apiPathUtils-CkTRKCPh.cjs"
95
+ "_localStorageUtils-DUQHXXBp.cjs"
96
96
  ]
97
97
  },
98
98
  "src/utils/index.ts": {
@@ -102,7 +102,7 @@
102
102
  "isEntry": true,
103
103
  "imports": [
104
104
  "_ShortcutLinksContext-CFDCR0fQ.cjs",
105
- "_apiPathUtils-CkTRKCPh.cjs"
105
+ "_localStorageUtils-DUQHXXBp.cjs"
106
106
  ]
107
107
  },
108
108
  "style.css": {
@@ -0,0 +1,8 @@
1
+ type Props = {
2
+ show: boolean;
3
+ handleClose: () => void;
4
+ onConfirm: () => void;
5
+ apiCreateBackup: string;
6
+ };
7
+ declare const CreateBackupModal: ({ show, handleClose, onConfirm, apiCreateBackup }: Props) => import("react").JSX.Element;
8
+ export default CreateBackupModal;
@@ -0,0 +1,9 @@
1
+ type Props = {
2
+ apiUrls?: {
3
+ apiGetBackups?: string;
4
+ apiCreateBackup?: string;
5
+ apiDeleteBackup?: string;
6
+ };
7
+ };
8
+ declare const LocalStorageBackupUS: ({ apiUrls: { apiGetBackups, apiCreateBackup, apiDeleteBackup, }, }: Props) => import("react").JSX.Element;
9
+ export default LocalStorageBackupUS;
@@ -1 +1,2 @@
1
1
  export { default as FileDownloadUS } from './FileDownloadUS/FileDownloadUS';
2
+ export { default as LocalStorageBackupUS } from './LocalStorageBackupUS/LocalStorageBackupUS';
@@ -0,0 +1,46 @@
1
+ import { generatePath as u } from "react-router-dom";
2
+ const S = (o, t, r) => {
3
+ let e = o;
4
+ return t !== void 0 && (e = Math.max(e, t)), r !== void 0 && (e = Math.min(e, r)), e;
5
+ }, i = (o, t, r = !0) => Object.keys(o).reduce((e, n) => {
6
+ const c = o[n];
7
+ return r && (c == null || c === "") || (e[n] = t(c, n)), e;
8
+ }, {}), g = (o, t) => {
9
+ const r = t != null && t.query ? new URLSearchParams(i(t.query, (e) => (e == null ? void 0 : e.toString()) ?? "")) : null;
10
+ return `${u(o, t != null && t.path ? i(t.path, (e) => (e == null ? void 0 : e.toString()) ?? null) : void 0)}${r && r.size > 0 ? `?${r.toString()}` : ""}`;
11
+ }, l = [
12
+ { key: "msal", mode: "includes" },
13
+ { key: "token", mode: "exact" },
14
+ { key: "user", mode: "exact" },
15
+ { key: "user-delegation", mode: "exact" }
16
+ ], a = (o = !0) => {
17
+ const t = {};
18
+ for (let r = 0; r < localStorage.length; r++) {
19
+ const e = localStorage.key(r);
20
+ if (e && !(o && l.some(({ key: n, mode: c }) => c === "includes" ? e.includes(n) : e === n)))
21
+ try {
22
+ t[e] = JSON.parse(localStorage.getItem(e));
23
+ } catch {
24
+ t[e] = localStorage.getItem(e);
25
+ }
26
+ }
27
+ return t;
28
+ }, d = (o) => {
29
+ try {
30
+ const t = JSON.parse(o);
31
+ if (typeof t != "object" || t === null)
32
+ return !1;
33
+ Object.entries(t).forEach(([r, e]) => {
34
+ localStorage.setItem(r, JSON.stringify(e));
35
+ });
36
+ } catch {
37
+ return !1;
38
+ }
39
+ return !0;
40
+ };
41
+ export {
42
+ a as d,
43
+ g,
44
+ S as l,
45
+ d as r
46
+ };
@@ -0,0 +1 @@
1
+ "use strict";const i=require("react-router-dom"),l=(o,t,r)=>{let e=o;return t!==void 0&&(e=Math.max(e,t)),r!==void 0&&(e=Math.min(e,r)),e},u=(o,t,r=!0)=>Object.keys(o).reduce((e,n)=>{const c=o[n];return r&&(c==null||c==="")||(e[n]=t(c,n)),e},{}),s=(o,t)=>{const r=t!=null&&t.query?new URLSearchParams(u(t.query,e=>(e==null?void 0:e.toString())??"")):null;return`${i.generatePath(o,t!=null&&t.path?u(t.path,e=>(e==null?void 0:e.toString())??null):void 0)}${r&&r.size>0?`?${r.toString()}`:""}`},S=[{key:"msal",mode:"includes"},{key:"token",mode:"exact"},{key:"user",mode:"exact"},{key:"user-delegation",mode:"exact"}],g=(o=!0)=>{const t={};for(let r=0;r<localStorage.length;r++){const e=localStorage.key(r);if(e&&!(o&&S.some(({key:n,mode:c})=>c==="includes"?e.includes(n):e===n)))try{t[e]=JSON.parse(localStorage.getItem(e))}catch{t[e]=localStorage.getItem(e)}}return t},a=o=>{try{const t=JSON.parse(o);if(typeof t!="object"||t===null)return!1;Object.entries(t).forEach(([r,e])=>{localStorage.setItem(r,JSON.stringify(e))})}catch{return!1}return!0};exports.dumpLocalStorage=g;exports.generateApiPath=s;exports.limitNumber=l;exports.restoreLocalStorage=a;