react-luminus-components 1.4.41 → 1.4.42

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.
@@ -3,7 +3,7 @@ import { default as XlsImportResult } from '../../../models/api/imports/XlsImpor
3
3
  type Props = {
4
4
  result: XlsImportResult;
5
5
  onClose?: () => void;
6
- tableIdentifier: string;
6
+ tableIdentifier: number;
7
7
  BnfTableComponent: React.ElementType;
8
8
  };
9
9
  declare const Result: ({ result, onClose, tableIdentifier, BnfTableComponent }: Props) => import("react").JSX.Element | null;
@@ -6,7 +6,7 @@ type LocalizationImportProps = OtherSettingsPageProps & {
6
6
  readonly id: string;
7
7
  readonly name: string;
8
8
  }>;
9
- tableIdentifier: string;
9
+ tableIdentifier: number;
10
10
  SettingsOutlet: React.ElementType;
11
11
  BnfTableComponent: React.ElementType;
12
12
  importLocalization: (data: {
@@ -124,6 +124,8 @@ export type { default as XlsImportResult } from './api/imports/XlsImportResult';
124
124
  export type { default as OtherSettingsPageProps } from './ui/imports/OtherSettingsPageProps';
125
125
  export type { default as LocalizationUpdateItemModel } from './api/localization/LocalizationUpdateItemModel';
126
126
  export type { default as LocalizationUpdateModel } from './api/localization/LocalizationUpdateModel';
127
+ export type { default as FileStructureDirectory } from './ui/localization/FileStructureDirectory';
128
+ export type { default as FileStructureFile } from './ui/localization/FileStructureFile';
127
129
  export type { default as WrappedPromise } from './ui/promiseWrapper/WrappedPromise';
128
130
  export type { default as AuthToken } from './types/auth/AuthToken';
129
131
  export type { default as NotifTargetModel } from './types/notifCenter/NotifTargetModel';
@@ -0,0 +1,9 @@
1
+ import { default as FileStructureFile } from './FileStructureFile';
2
+
3
+ type FileStructureDirectory = {
4
+ directoryName: string;
5
+ directoryPath: string;
6
+ directoryTranslationKey: string;
7
+ files: Array<FileStructureDirectory | FileStructureFile>;
8
+ };
9
+ export default FileStructureDirectory;
@@ -0,0 +1,6 @@
1
+ type FileStructureFile = {
2
+ path: string;
3
+ nameTranslationKey: string;
4
+ type?: string;
5
+ };
6
+ export default FileStructureFile;
@@ -0,0 +1,9 @@
1
+ import { AxiosResponse } from 'axios';
2
+
3
+ export declare const responsePromiseWrapper: <T>(responsePromise: Promise<AxiosResponse<T, number>>) => Promise<{
4
+ status: "success";
5
+ data: T;
6
+ } | {
7
+ status: "error";
8
+ error: any;
9
+ }>;
@@ -10,4 +10,6 @@ export * from './search/searchUtils';
10
10
  export * from './text/string';
11
11
  export * from './text/textUtils';
12
12
  export * from './route/apiPathUtils';
13
+ export * from './localizationUtils/localizationUtils';
14
+ export * from './apiUtils/apiUtils';
13
15
  export { default as CommonLuminusIconsArray } from './constants/CommonLuminusIconsArray';
@@ -0,0 +1,3 @@
1
+ import { FileStructureDirectory } from '../../models/index';
2
+
3
+ export declare const isFileStructureDirectory: (obj: any) => obj is FileStructureDirectory;
package/dist/utils.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nivo-bar.es-HlDpK5cq.cjs");require("react");require("@azure/msal-browser");require("@azure/msal-react");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");const l=require("./apiPathUtils-CkTRKCPh.cjs"),f=({cell:{value:t}})=>e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:t,placement:"bottom",children:e.jsxRuntimeExports.jsx("div",{className:"w-100 text-truncate",children:t})}),h=({cell:{value:t}})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t==null?void 0:t.toLocaleString("cs-CZ")}),p=({cell:{value:t}})=>{const i=e.format(new Date(t),"dd.MM.yyyy");return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t?i:""})},d=(t,i)=>{let n=!1,a=t;t[0]==="#"&&(a=t.slice(1),n=!0);let r=parseInt(a.substring(0,2),16),o=parseInt(a.substring(2,4),16),s=parseInt(a.substring(4,6),16);r+=i,o+=i,s+=i,r>255?r=255:r<0&&(r=0),o>255?o=255:o<0&&(o=0),s>255?s=255:s<0&&(s=0);const c=r.toString(16).length===1?"0"+r.toString(16):r.toString(16),u=o.toString(16).length===1?"0"+o.toString(16):o.toString(16),g=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return(n?"#":"")+c+u+g},S=t=>{const i=t.slice(3),n=[];for(let r=0;r<i.length;r+=2)n.push(i.slice(r,r+2));return`#${n.reverse().join("")}`};function m(t,i){t.setValue(i,null)}function F(t,i){i.forEach(n=>{m(t,n)})}const D=["edit","delete","info","warning","check","check-simple","add","cancel","cancel-simple","danger","chevron-left","chevron-right","chevron-up","chevron-down","chevron-double-left","chevron-double-right","folder","folder-filled","file-download","file-upload","star-outline","save","link","pending","resizer-horizontal","qr-code","phone","mail","mail-envelope","dashboard","user","role","close","search","plus","minus"];exports.atobUtf8=e.atobUtf8;exports.buildEmployeeNameString=e.buildEmployeeNameString;exports.buildOrgUnitString=e.buildOrgUnitString;exports.buildVehicleNameString=e.buildVehicleNameString;exports.capitalizeFirstLetter=e.capitalizeFirstLetter;exports.compareDate=e.compareDate;exports.compareDateTime=e.compareDateTime;exports.extractErrorsFromResponse=e.extractErrorsFromResponse;exports.extractFilename=e.extractFilename;exports.extractPermissionsFromResponse=e.extractPermissionsFromResponse;exports.fixNameIdNulls=e.fixNameIdNulls;exports.formatDate=e.formatDate;exports.formatDateTime=e.formatDateTime;exports.formatFileSize=e.formatFileSize;exports.getDateString=e.getDateString;exports.getDaysDifference=e.getDaysDifference;exports.getFirstDayOfMonth=e.getFirstDayOfMonth;exports.getFirstDayOfOffsetMonth=e.getFirstDayOfOffsetMonth;exports.getFirstDayOfYear=e.getFirstDayOfYear;exports.getLastDayOfMonth=e.getLastDayOfMonth;exports.getLastDayOfOffsetMonth=e.getLastDayOfOffsetMonth;exports.getLastDayOfYear=e.getLastDayOfYear;exports.hasOnlyNullValues=e.hasOnlyNullValues;exports.hookFormSetServerErrors=e.hookFormSetServerErrors;exports.isISODate=e.isISODate;exports.isPrimitive=e.isPrimitive;exports.isValidDate=e.isValidDate;exports.joinStrings=e.joinStrings;exports.msToStartOfNextDay=e.msToStartOfNextDay;exports.openFileFromResponse=e.openFileFromResponse;exports.replaceNullValuesOnlyObjectsWithNulls=e.replaceNullValuesOnlyObjectsWithNulls;exports.saveFile=e.saveFile;exports.saveFileFromResponse=e.saveFileFromResponse;exports.shortenText=e.shortenText;exports.stringContains=e.stringContains;exports.stringSearchWithin=e.stringSearchWithin;exports.stringStartsWith=e.stringStartsWith;exports.trimIsoDate=e.trimIsoDate;exports.truncateText=e.truncateText;exports.urlfyArray=e.urlfyArray;exports.generateApiPath=l.generateApiPath;exports.limitNumber=l.limitNumber;exports.CommonLuminusIconsArray=D;exports.adjustBrightness=d;exports.dateValueFormat=p;exports.hookFormSetNull=m;exports.hookFormSetNulls=F;exports.numFormat=h;exports.valueTooltip=f;exports.vclToHex=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./nivo-bar.es-HlDpK5cq.cjs");require("react");require("@azure/msal-browser");require("@azure/msal-react");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");const l=require("./apiPathUtils-CkTRKCPh.cjs"),f=({cell:{value:t}})=>e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:t,placement:"bottom",children:e.jsxRuntimeExports.jsx("div",{className:"w-100 text-truncate",children:t})}),h=({cell:{value:t}})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t==null?void 0:t.toLocaleString("cs-CZ")}),p=({cell:{value:t}})=>{const r=e.format(new Date(t),"dd.MM.yyyy");return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t?r:""})},d=(t,r)=>{let i=!1,a=t;t[0]==="#"&&(a=t.slice(1),i=!0);let s=parseInt(a.substring(0,2),16),o=parseInt(a.substring(2,4),16),n=parseInt(a.substring(4,6),16);s+=r,o+=r,n+=r,s>255?s=255:s<0&&(s=0),o>255?o=255:o<0&&(o=0),n>255?n=255:n<0&&(n=0);const u=s.toString(16).length===1?"0"+s.toString(16):s.toString(16),m=o.toString(16).length===1?"0"+o.toString(16):o.toString(16),g=n.toString(16).length===1?"0"+n.toString(16):n.toString(16);return(i?"#":"")+u+m+g},y=t=>{const r=t.slice(3),i=[];for(let s=0;s<r.length;s+=2)i.push(r.slice(s,s+2));return`#${i.reverse().join("")}`};function c(t,r){t.setValue(r,null)}function S(t,r){r.forEach(i=>{c(t,i)})}const F=t=>typeof t.directoryName=="string"&&typeof t.directoryPath=="string"&&typeof t.directoryTranslationKey=="string"&&Array.isArray(t.files),D=async t=>{let r={status:"pending"};try{r={status:"success",data:(await t).data}}catch(i){r={status:"error",error:i}}return r},x=["edit","delete","info","warning","check","check-simple","add","cancel","cancel-simple","danger","chevron-left","chevron-right","chevron-up","chevron-down","chevron-double-left","chevron-double-right","folder","folder-filled","file-download","file-upload","star-outline","save","link","pending","resizer-horizontal","qr-code","phone","mail","mail-envelope","dashboard","user","role","close","search","plus","minus"];exports.atobUtf8=e.atobUtf8;exports.buildEmployeeNameString=e.buildEmployeeNameString;exports.buildOrgUnitString=e.buildOrgUnitString;exports.buildVehicleNameString=e.buildVehicleNameString;exports.capitalizeFirstLetter=e.capitalizeFirstLetter;exports.compareDate=e.compareDate;exports.compareDateTime=e.compareDateTime;exports.extractErrorsFromResponse=e.extractErrorsFromResponse;exports.extractFilename=e.extractFilename;exports.extractPermissionsFromResponse=e.extractPermissionsFromResponse;exports.fixNameIdNulls=e.fixNameIdNulls;exports.formatDate=e.formatDate;exports.formatDateTime=e.formatDateTime;exports.formatFileSize=e.formatFileSize;exports.getDateString=e.getDateString;exports.getDaysDifference=e.getDaysDifference;exports.getFirstDayOfMonth=e.getFirstDayOfMonth;exports.getFirstDayOfOffsetMonth=e.getFirstDayOfOffsetMonth;exports.getFirstDayOfYear=e.getFirstDayOfYear;exports.getLastDayOfMonth=e.getLastDayOfMonth;exports.getLastDayOfOffsetMonth=e.getLastDayOfOffsetMonth;exports.getLastDayOfYear=e.getLastDayOfYear;exports.hasOnlyNullValues=e.hasOnlyNullValues;exports.hookFormSetServerErrors=e.hookFormSetServerErrors;exports.isISODate=e.isISODate;exports.isPrimitive=e.isPrimitive;exports.isValidDate=e.isValidDate;exports.joinStrings=e.joinStrings;exports.msToStartOfNextDay=e.msToStartOfNextDay;exports.openFileFromResponse=e.openFileFromResponse;exports.replaceNullValuesOnlyObjectsWithNulls=e.replaceNullValuesOnlyObjectsWithNulls;exports.saveFile=e.saveFile;exports.saveFileFromResponse=e.saveFileFromResponse;exports.shortenText=e.shortenText;exports.stringContains=e.stringContains;exports.stringSearchWithin=e.stringSearchWithin;exports.stringStartsWith=e.stringStartsWith;exports.trimIsoDate=e.trimIsoDate;exports.truncateText=e.truncateText;exports.urlfyArray=e.urlfyArray;exports.generateApiPath=l.generateApiPath;exports.limitNumber=l.limitNumber;exports.CommonLuminusIconsArray=x;exports.adjustBrightness=d;exports.dateValueFormat=p;exports.hookFormSetNull=c;exports.hookFormSetNulls=S;exports.isFileStructureDirectory=F;exports.numFormat=h;exports.responsePromiseWrapper=D;exports.valueTooltip=f;exports.vclToHex=y;
package/dist/utils.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { j as i, aC as f, V as g } from "./nivo-bar.es-1Kl6HG1T.js";
2
- import { cc as V, ca as k, cb as w, c9 as L, c8 as M, bS as P, bT as E, bh as z, b_ as B, bP as W, c2 as A, bm as G, c7 as U, ce as Y, bZ as Z, bU as $, ba as q, bW as H, bb as Q, bV as X, bX as _, bY as J, c3 as K, bv as ee, bQ as te, c1 as se, bR as re, cf as ae, bI as oe, c0 as ie, c4 as ne, b$ as le, bg as ce, ch as me, c5 as fe, ah as ge, c6 as he, b9 as ue, cd as pe, cg as de } from "./nivo-bar.es-1Kl6HG1T.js";
2
+ import { cc as w, ca as k, cb as L, c9 as M, c8 as A, bS as E, bT as W, bh as z, b_ as B, bP as G, c2 as U, bm as Y, c7 as Z, ce as $, bZ as q, bU as H, ba as K, bW as Q, bb as X, bV as _, bX as J, bY as ee, c3 as te, bv as se, bQ as re, c1 as ae, bR as oe, cf as ie, bI as ne, c0 as le, c4 as ce, b$ as me, bg as fe, ch as ge, c5 as ue, ah as pe, c6 as he, b9 as de, cd as be, cg as ye } from "./nivo-bar.es-1Kl6HG1T.js";
3
3
  import "react";
4
4
  import "@azure/msal-browser";
5
5
  import "@azure/msal-react";
@@ -7,32 +7,40 @@ import "react-router-dom";
7
7
  import "react-dom";
8
8
  import "react-hook-form";
9
9
  import "react-flexmonster";
10
- import { g as Se, l as Fe } from "./apiPathUtils-DiqvB8mF.js";
11
- const D = ({ cell: { value: e } }) => /* @__PURE__ */ i.jsx(f, { text: e, placement: "bottom", children: /* @__PURE__ */ i.jsx("div", { className: "w-100 text-truncate", children: e }) }), O = ({ cell: { value: e } }) => /* @__PURE__ */ i.jsx(i.Fragment, { children: e == null ? void 0 : e.toLocaleString("cs-CZ") }), v = ({ cell: { value: e } }) => {
12
- const s = g(new Date(e), "dd.MM.yyyy");
13
- return /* @__PURE__ */ i.jsx(i.Fragment, { children: e ? s : "" });
14
- }, N = (e, s) => {
15
- let o = !1, n = e;
16
- e[0] === "#" && (n = e.slice(1), o = !0);
17
- let t = parseInt(n.substring(0, 2), 16), r = parseInt(n.substring(2, 4), 16), a = parseInt(n.substring(4, 6), 16);
18
- t += s, r += s, a += s, t > 255 ? t = 255 : t < 0 && (t = 0), r > 255 ? r = 255 : r < 0 && (r = 0), a > 255 ? a = 255 : a < 0 && (a = 0);
19
- const l = t.toString(16).length === 1 ? "0" + t.toString(16) : t.toString(16), c = r.toString(16).length === 1 ? "0" + r.toString(16) : r.toString(16), m = a.toString(16).length === 1 ? "0" + a.toString(16) : a.toString(16);
20
- return (o ? "#" : "") + l + c + m;
21
- }, j = (e) => {
22
- const s = e.slice(3), o = [];
23
- for (let t = 0; t < s.length; t += 2)
24
- o.push(s.slice(t, t + 2));
25
- return `#${o.reverse().join("")}`;
10
+ import { g as Fe, l as xe } from "./apiPathUtils-DiqvB8mF.js";
11
+ const D = ({ cell: { value: e } }) => /* @__PURE__ */ i.jsx(f, { text: e, placement: "bottom", children: /* @__PURE__ */ i.jsx("div", { className: "w-100 text-truncate", children: e }) }), O = ({ cell: { value: e } }) => /* @__PURE__ */ i.jsx(i.Fragment, { children: e == null ? void 0 : e.toLocaleString("cs-CZ") }), N = ({ cell: { value: e } }) => {
12
+ const t = g(new Date(e), "dd.MM.yyyy");
13
+ return /* @__PURE__ */ i.jsx(i.Fragment, { children: e ? t : "" });
14
+ }, v = (e, t) => {
15
+ let r = !1, n = e;
16
+ e[0] === "#" && (n = e.slice(1), r = !0);
17
+ let s = parseInt(n.substring(0, 2), 16), a = parseInt(n.substring(2, 4), 16), o = parseInt(n.substring(4, 6), 16);
18
+ s += t, a += t, o += t, s > 255 ? s = 255 : s < 0 && (s = 0), a > 255 ? a = 255 : a < 0 && (a = 0), o > 255 ? o = 255 : o < 0 && (o = 0);
19
+ const l = s.toString(16).length === 1 ? "0" + s.toString(16) : s.toString(16), c = a.toString(16).length === 1 ? "0" + a.toString(16) : a.toString(16), m = o.toString(16).length === 1 ? "0" + o.toString(16) : o.toString(16);
20
+ return (r ? "#" : "") + l + c + m;
21
+ }, T = (e) => {
22
+ const t = e.slice(3), r = [];
23
+ for (let s = 0; s < t.length; s += 2)
24
+ r.push(t.slice(s, s + 2));
25
+ return `#${r.reverse().join("")}`;
26
26
  };
27
- function h(e, s) {
28
- e.setValue(s, null);
27
+ function u(e, t) {
28
+ e.setValue(t, null);
29
29
  }
30
- function R(e, s) {
31
- s.forEach((o) => {
32
- h(e, o);
30
+ function R(e, t) {
31
+ t.forEach((r) => {
32
+ u(e, r);
33
33
  });
34
34
  }
35
- const T = [
35
+ const C = (e) => typeof e.directoryName == "string" && typeof e.directoryPath == "string" && typeof e.directoryTranslationKey == "string" && Array.isArray(e.files), I = async (e) => {
36
+ let t = { status: "pending" };
37
+ try {
38
+ t = { status: "success", data: (await e).data };
39
+ } catch (r) {
40
+ t = { status: "error", error: r };
41
+ }
42
+ return t;
43
+ }, P = [
36
44
  "edit",
37
45
  "delete",
38
46
  "info",
@@ -71,54 +79,56 @@ const T = [
71
79
  "minus"
72
80
  ];
73
81
  export {
74
- T as CommonLuminusIconsArray,
75
- N as adjustBrightness,
76
- V as atobUtf8,
82
+ P as CommonLuminusIconsArray,
83
+ v as adjustBrightness,
84
+ w as atobUtf8,
77
85
  k as buildEmployeeNameString,
78
- w as buildOrgUnitString,
79
- L as buildVehicleNameString,
80
- M as capitalizeFirstLetter,
81
- P as compareDate,
82
- E as compareDateTime,
83
- v as dateValueFormat,
86
+ L as buildOrgUnitString,
87
+ M as buildVehicleNameString,
88
+ A as capitalizeFirstLetter,
89
+ E as compareDate,
90
+ W as compareDateTime,
91
+ N as dateValueFormat,
84
92
  z as extractErrorsFromResponse,
85
93
  B as extractFilename,
86
- W as extractPermissionsFromResponse,
87
- A as fixNameIdNulls,
88
- G as formatDate,
89
- U as formatDateTime,
90
- Y as formatFileSize,
91
- Se as generateApiPath,
92
- Z as getDateString,
93
- $ as getDaysDifference,
94
- q as getFirstDayOfMonth,
95
- H as getFirstDayOfOffsetMonth,
96
- Q as getFirstDayOfYear,
97
- X as getLastDayOfMonth,
98
- _ as getLastDayOfOffsetMonth,
99
- J as getLastDayOfYear,
100
- K as hasOnlyNullValues,
101
- h as hookFormSetNull,
94
+ G as extractPermissionsFromResponse,
95
+ U as fixNameIdNulls,
96
+ Y as formatDate,
97
+ Z as formatDateTime,
98
+ $ as formatFileSize,
99
+ Fe as generateApiPath,
100
+ q as getDateString,
101
+ H as getDaysDifference,
102
+ K as getFirstDayOfMonth,
103
+ Q as getFirstDayOfOffsetMonth,
104
+ X as getFirstDayOfYear,
105
+ _ as getLastDayOfMonth,
106
+ J as getLastDayOfOffsetMonth,
107
+ ee as getLastDayOfYear,
108
+ te as hasOnlyNullValues,
109
+ u as hookFormSetNull,
102
110
  R as hookFormSetNulls,
103
- ee as hookFormSetServerErrors,
104
- te as isISODate,
105
- se as isPrimitive,
106
- re as isValidDate,
107
- ae as joinStrings,
108
- Fe as limitNumber,
109
- oe as msToStartOfNextDay,
111
+ se as hookFormSetServerErrors,
112
+ C as isFileStructureDirectory,
113
+ re as isISODate,
114
+ ae as isPrimitive,
115
+ oe as isValidDate,
116
+ ie as joinStrings,
117
+ xe as limitNumber,
118
+ ne as msToStartOfNextDay,
110
119
  O as numFormat,
111
- ie as openFileFromResponse,
112
- ne as replaceNullValuesOnlyObjectsWithNulls,
113
- le as saveFile,
114
- ce as saveFileFromResponse,
115
- me as shortenText,
116
- fe as stringContains,
117
- ge as stringSearchWithin,
120
+ le as openFileFromResponse,
121
+ ce as replaceNullValuesOnlyObjectsWithNulls,
122
+ I as responsePromiseWrapper,
123
+ me as saveFile,
124
+ fe as saveFileFromResponse,
125
+ ge as shortenText,
126
+ ue as stringContains,
127
+ pe as stringSearchWithin,
118
128
  he as stringStartsWith,
119
- ue as trimIsoDate,
120
- pe as truncateText,
121
- de as urlfyArray,
129
+ de as trimIsoDate,
130
+ be as truncateText,
131
+ ye as urlfyArray,
122
132
  D as valueTooltip,
123
- j as vclToHex
133
+ T as vclToHex
124
134
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-luminus-components",
3
- "version": "1.4.41",
3
+ "version": "1.4.42",
4
4
  "description": "Library of React Components reusable in Luminus projects (Fleetman, CAFM)",
5
5
  "type": "module",
6
6
  "repository": {