react-luminus-components 1.5.5 → 1.5.7

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 (47) hide show
  1. package/dist/.vite/manifest.json +32 -32
  2. package/dist/{FormDisabledProvider-CgpUjxI0.js → FormDisabledProvider-CB-JXGnI.js} +5 -5
  3. package/dist/{FormDisabledProvider-6S4xKAVc.cjs → FormDisabledProvider-DtQ7YOqf.cjs} +1 -1
  4. package/dist/{ShortcutLinksContext-DG4gWgPW.cjs → ShortcutLinksContext-AgOPPcPf.cjs} +17 -17
  5. package/dist/{ShortcutLinksContext-CQY8nrGK.js → ShortcutLinksContext-CNZMOV_j.js} +61 -60
  6. package/dist/components/common/Approvals/Approvals/Approvals.d.ts +17 -0
  7. package/dist/components/common/Approvals/Approvals/comps/ApprovalDetail/ApprovalDetail.d.ts +12 -0
  8. package/dist/components/common/Approvals/Approvals/comps/ApprovalDetail/comps/ApprovalDelegations/ApprovalDelegations.d.ts +9 -0
  9. package/dist/components/common/Approvals/Approvals/comps/ApprovalDetail/comps/ApprovalLevel/ApprovalLevel.d.ts +11 -0
  10. package/dist/components/common/Approvals/Approvals/comps/ApprovalDetail/comps/ApprovalLevel/comps/ChangeEmployeeModal/ChangeEmployeeModal.d.ts +13 -0
  11. package/dist/components/common/Approvals/Approvals/comps/ApprovalDetail/comps/ApprovalLevel/comps/index.d.ts +1 -0
  12. package/dist/components/common/Approvals/Approvals/comps/ApprovalDetail/comps/index.d.ts +2 -0
  13. package/dist/components/common/Approvals/Approvals/comps/index.d.ts +1 -0
  14. package/dist/components/common/Approvals/Delegations/ApprovalsDelegations.d.ts +16 -0
  15. package/dist/components/common/Approvals/Delegations/comps/DelegationModal/DelegationModal.d.ts +14 -0
  16. package/dist/components/common/Approvals/Delegations/comps/DelegationModal/hooks/useDelegationModalApi.d.ts +8 -0
  17. package/dist/components/common/Approvals/Delegations/comps/DelegationsTable/DelegationsTable.d.ts +10 -0
  18. package/dist/components/common/Approvals/Delegations/comps/index.d.ts +2 -0
  19. package/dist/components/common/index.d.ts +2 -0
  20. package/dist/contexts.cjs.js +1 -1
  21. package/dist/contexts.es.js +38 -38
  22. package/dist/hooks.cjs.js +1 -1
  23. package/dist/hooks.es.js +13 -13
  24. package/dist/layout.cjs.js +1 -1
  25. package/dist/layout.es.js +10 -10
  26. package/dist/localStorageUtils-CBQuZzg0.cjs +1 -0
  27. package/dist/localStorageUtils-DBNNyBcc.js +57 -0
  28. package/dist/main.cjs.js +53 -53
  29. package/dist/main.d.ts +1 -0
  30. package/dist/main.es.js +5257 -4993
  31. package/dist/models/api/approval/ApprovalDefinitionIndexModel.d.ts +6 -0
  32. package/dist/models/api/approval/ApprovalDefinitionLevelApproverModel.d.ts +7 -0
  33. package/dist/models/api/approval/ApprovalDefinitionLevelModel.d.ts +8 -0
  34. package/dist/models/api/approval/ApprovalDefinitionModel.d.ts +8 -0
  35. package/dist/models/api/approval/ApprovalDelegationModel.d.ts +11 -0
  36. package/dist/models/api/approval/ApprovalPersonModel.d.ts +3 -3
  37. package/dist/models/index.d.ts +6 -0
  38. package/dist/models/texts/ApprovalTexts.d.ts +44 -0
  39. package/dist/models/types/EmployeePickerBaseProps.d.ts +8 -0
  40. package/dist/{useLocalStorageState--TbsAeFu.cjs → useLocalStorageState-B_unZcbQ.cjs} +1 -1
  41. package/dist/{useLocalStorageState-KRZlwyU3.js → useLocalStorageState-Uqlj_lt1.js} +1 -1
  42. package/dist/utils/constants/CommonLuminusIconsArray.d.ts +1 -1
  43. package/dist/utils.cjs.js +1 -1
  44. package/dist/utils.es.js +74 -81
  45. package/package.json +1 -1
  46. package/dist/localStorageUtils-CHdu9Xvf.js +0 -46
  47. package/dist/localStorageUtils-DUQHXXBp.cjs +0 -1
@@ -0,0 +1,6 @@
1
+ export default interface ApprovalDefinitionIndexModel {
2
+ id: number;
3
+ name: string | null;
4
+ levelCount: number;
5
+ lastExecutionDate: string | null;
6
+ }
@@ -0,0 +1,7 @@
1
+ export default interface ApprovalDefinitionLevelApproverModel {
2
+ id: number;
3
+ role: string | null;
4
+ employeeId: number | null;
5
+ employeeName: string | null;
6
+ scale: number;
7
+ }
@@ -0,0 +1,8 @@
1
+ import { default as ApprovalDefinitionLevelApproverModel } from './ApprovalDefinitionLevelApproverModel';
2
+
3
+ export default interface ApprovalDefinitionLevelModel {
4
+ id: number;
5
+ threshold: number;
6
+ index: number;
7
+ approvers: ApprovalDefinitionLevelApproverModel[];
8
+ }
@@ -0,0 +1,8 @@
1
+ import { default as ApprovalDefinitionLevelModel } from './ApprovalDefinitionLevelModel';
2
+
3
+ export default interface ApprovalDefinitionModel {
4
+ id: number;
5
+ name: string | null;
6
+ levels: ApprovalDefinitionLevelModel[];
7
+ lastExecutionDate: string | null;
8
+ }
@@ -0,0 +1,11 @@
1
+ import { default as NameIdIntModel } from '../../types/NameIdIntModel';
2
+
3
+ export default interface ApprovalDelegationModel {
4
+ id: number | null;
5
+ employee: NameIdIntModel | null;
6
+ delegate: NameIdIntModel | null;
7
+ dateFrom: string | null;
8
+ dateTo: string | null;
9
+ approval: NameIdIntModel | null;
10
+ includeExisting: boolean | null;
11
+ }
@@ -1,10 +1,10 @@
1
- import { default as EmployeeSmallModel } from '../employee/EmployeeSmallModel';
1
+ import { default as NameIdIntModel } from '../../types/NameIdIntModel';
2
2
  import { default as ApprovalState } from './ApprovalState';
3
3
 
4
4
  export default interface ApprovalPersonModel {
5
5
  id: number;
6
- approver: EmployeeSmallModel;
7
- delegatedApprover: EmployeeSmallModel;
6
+ approver: NameIdIntModel;
7
+ delegatedApprover: NameIdIntModel;
8
8
  state: ApprovalState;
9
9
  responseDate: string | null;
10
10
  automaticApproval: boolean;
@@ -117,6 +117,11 @@ export type { default as ApprovalLevelModel } from './api/approval/ApprovalLevel
117
117
  export type { default as ApprovalPersonModel } from './api/approval/ApprovalPersonModel';
118
118
  export { default as ApprovalState } from './api/approval/ApprovalState';
119
119
  export type { default as ApprovalTimelineModel } from './api/approval/ApprovalTimelineModel';
120
+ export type { default as ApprovalDefinitionIndexModel } from './api/approval/ApprovalDefinitionIndexModel';
121
+ export type { default as ApprovalDefinitionModel } from './api/approval/ApprovalDefinitionModel';
122
+ export type { default as ApprovalDefinitionLevelModel } from './api/approval/ApprovalDefinitionLevelModel';
123
+ export type { default as ApprovalDefinitionLevelApproverModel } from './api/approval/ApprovalDefinitionLevelApproverModel';
124
+ export type { default as ApprovalDelegationModel } from './api/approval/ApprovalDelegationModel';
120
125
  export type { default as EmployeeSmallModel } from './api/employee/EmployeeSmallModel';
121
126
  export type { default as LocalStorageSettingsModel } from './api/localStorageSettings/LocalStorageSettingsModel';
122
127
  export type { default as ReloadDataWithReturnType } from './types/useGetApiData/ReloadDataWithReturnType';
@@ -137,3 +142,4 @@ export type { default as NotificationHistoryUserDto } from './types/notifCenter/
137
142
  export type { default as NotificationModel } from './types/notifCenter/NotificationModel';
138
143
  export type { default as NotificationTarget } from './types/notifCenter/NotificationTarget';
139
144
  export type { default as NotificationTemplate } from './types/notifCenter/NotificationTemplate';
145
+ export type { default as EmployeePickerBaseProps } from './types/EmployeePickerBaseProps';
@@ -8,5 +8,49 @@ type ApprovalTexts = {
8
8
  getThresholdText: (threshold: number) => string;
9
9
  startDate: string;
10
10
  finishedDate: string;
11
+ definitions: {
12
+ title: string;
13
+ delegationsDefinitions: string;
14
+ lastExecuted: string;
15
+ nthLevel: (level: number) => string;
16
+ levelThresholdInfo: (threshold: number) => string | React.ReactNode;
17
+ approverThresholdInfo: (threshold: number, value: number) => string | React.ReactNode;
18
+ changeEmployeeTitle: string;
19
+ changeEmployeeSuccess: string;
20
+ changeEmployeeNewEmployee: string;
21
+ changeEmployeeConfirm: string;
22
+ };
23
+ delegations: {
24
+ title: string;
25
+ noDelegations: string;
26
+ createDelegation: string;
27
+ showArchived: string;
28
+ hideArchived: string;
29
+ table: {
30
+ approval: string;
31
+ employee: string;
32
+ delegate: string;
33
+ dateFrom: string;
34
+ dateTo: string;
35
+ dateGroup: string;
36
+ };
37
+ delegateExistingsConfirmMessage: string;
38
+ editSuccess: string;
39
+ createSuccess: string;
40
+ deleteSuccess: string;
41
+ deleteConfirm: string;
42
+ detailTitle: string;
43
+ newTitle: string;
44
+ delete: string;
45
+ save: string;
46
+ create: string;
47
+ detail: {
48
+ approval: string;
49
+ employee: string;
50
+ delegate: string;
51
+ dateFrom: string;
52
+ dateTo: string;
53
+ };
54
+ };
11
55
  };
12
56
  export default ApprovalTexts;
@@ -0,0 +1,8 @@
1
+ import { default as NameIdIntModel } from './NameIdIntModel';
2
+
3
+ export default interface EmployeePickerBaseProps {
4
+ formField: string;
5
+ defaultSelection: NameIdIntModel | null;
6
+ label: string;
7
+ required?: boolean;
8
+ }
@@ -1 +1 @@
1
- "use strict";const S=require("./ShortcutLinksContext-DG4gWgPW.cjs"),t=require("react");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const r={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},m=(e,{loadOnInit:u=r.loadOnInit,enabled:n=r.enabled,silent:a=r.silent,nullStateBeforeLoad:c=r.nullStateBeforeLoad,nullStateOnFail:i=r.nullStateOnFail,customApiUrl:o,customBearerToken:I,dataTransformer:g}=r)=>{const C=S.useAxios({silent:a,customToken:I,differentBaseUrl:o}),[O,L]=t.useState(!1),{startLoading:b,stopLoading:D}=t.useContext(S.LoadingContext),R=t.useRef(0),{isAuthenticated:q}=S.useAuth(),p=t.useCallback(s=>{b(s),L(()=>!0)},[b]),x=t.useCallback(s=>{D(s),L(()=>!1)},[D]),[$,d]=t.useState(null),l=t.useCallback(async(s,h)=>{if(!q()||n===!1)return null;!a&&p(`loadData-${e}-${h}`),c&&d(null);let k;try{const f=await C.get(e,{signal:s}),A=g?g(f.data):f.data;d(A),k=A}catch(f){throw i&&d(null),f}finally{!a&&x(`loadData-${e}-${h}`)}return k},[q,n,a,p,e,c,C,g,i,x]),w=t.useCallback(async()=>{l()},[l]),y=t.useCallback(async()=>l(),[l]);return t.useEffect(()=>{if(u===!1)return;const s=new AbortController;return l(s.signal,++R.current),()=>{s.abort()}},[l,u]),{data:$,setData:d,reloadData:w,isLoading:O,reloadDataWithReturn:y}},v=(e,u)=>{const n=t.useCallback(()=>{const o=localStorage.getItem(e);return o!=null&&o!=="undefined"?JSON.parse(o):u},[u,e]),[a,c]=t.useState(n);t.useEffect(()=>{localStorage.setItem(e,JSON.stringify(a))},[e,a]);const i=t.useCallback(()=>{c(n)},[n]);return[a,c,i]};exports.useGetApiData=m;exports.useLocalStorageState=v;
1
+ "use strict";const S=require("./ShortcutLinksContext-AgOPPcPf.cjs"),t=require("react");require("react-router-dom");require("react-dom");require("react-hook-form");require("react-flexmonster");require("@azure/msal-browser");require("@azure/msal-react");const r={loadOnInit:!0,silent:!1,enabled:!0,nullStateBeforeLoad:!0,nullStateOnFail:!1},m=(e,{loadOnInit:u=r.loadOnInit,enabled:n=r.enabled,silent:a=r.silent,nullStateBeforeLoad:c=r.nullStateBeforeLoad,nullStateOnFail:i=r.nullStateOnFail,customApiUrl:o,customBearerToken:I,dataTransformer:g}=r)=>{const C=S.useAxios({silent:a,customToken:I,differentBaseUrl:o}),[O,L]=t.useState(!1),{startLoading:b,stopLoading:D}=t.useContext(S.LoadingContext),R=t.useRef(0),{isAuthenticated:q}=S.useAuth(),p=t.useCallback(s=>{b(s),L(()=>!0)},[b]),x=t.useCallback(s=>{D(s),L(()=>!1)},[D]),[$,d]=t.useState(null),l=t.useCallback(async(s,h)=>{if(!q()||n===!1)return null;!a&&p(`loadData-${e}-${h}`),c&&d(null);let k;try{const f=await C.get(e,{signal:s}),A=g?g(f.data):f.data;d(A),k=A}catch(f){throw i&&d(null),f}finally{!a&&x(`loadData-${e}-${h}`)}return k},[q,n,a,p,e,c,C,g,i,x]),w=t.useCallback(async()=>{l()},[l]),y=t.useCallback(async()=>l(),[l]);return t.useEffect(()=>{if(u===!1)return;const s=new AbortController;return l(s.signal,++R.current),()=>{s.abort()}},[l,u]),{data:$,setData:d,reloadData:w,isLoading:O,reloadDataWithReturn:y}},v=(e,u)=>{const n=t.useCallback(()=>{const o=localStorage.getItem(e);return o!=null&&o!=="undefined"?JSON.parse(o):u},[u,e]),[a,c]=t.useState(n);t.useEffect(()=>{localStorage.setItem(e,JSON.stringify(a))},[e,a]);const i=t.useCallback(()=>{c(n)},[n]);return[a,c,i]};exports.useGetApiData=m;exports.useLocalStorageState=v;
@@ -1,4 +1,4 @@
1
- import { aw as J, aX as N, ar as E } from "./ShortcutLinksContext-CQY8nrGK.js";
1
+ import { aw as J, aX as N, ar as E } from "./ShortcutLinksContext-CNZMOV_j.js";
2
2
  import { useState as p, useContext as F, useRef as G, useCallback as e, useEffect as O } from "react";
3
3
  import "react-router-dom";
4
4
  import "react-dom";
@@ -1,2 +1,2 @@
1
- declare const CommonLuminusIconsArray: readonly ["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"];
1
+ declare const CommonLuminusIconsArray: readonly ["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", "menu", "arrow-right"];
2
2
  export default CommonLuminusIconsArray;
package/dist/utils.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-DG4gWgPW.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("./localStorageUtils-DUQHXXBp.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})}),p=({cell:{value:t}})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t==null?void 0:t.toLocaleString("cs-CZ")}),h=({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},S=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 y(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),x=async t=>{let r={status:"pending"};try{r={status:"success",data:(await t).data}}catch(i){r={status:"error",error:i}}return r},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.isExtensionOpenable=e.isExtensionOpenable;exports.isFileOpenable=e.isFileOpenable;exports.isISODate=e.isISODate;exports.isPrimitive=e.isPrimitive;exports.isValidDate=e.isValidDate;exports.joinStrings=e.joinStrings;exports.msToStartOfNextDay=e.msToStartOfNextDay;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.dumpLocalStorage=l.dumpLocalStorage;exports.generateApiPath=l.generateApiPath;exports.limitNumber=l.limitNumber;exports.restoreLocalStorage=l.restoreLocalStorage;exports.CommonLuminusIconsArray=D;exports.adjustBrightness=d;exports.dateValueFormat=h;exports.hookFormSetNull=c;exports.hookFormSetNulls=y;exports.isFileStructureDirectory=F;exports.numFormat=p;exports.responsePromiseWrapper=x;exports.valueTooltip=f;exports.vclToHex=S;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-AgOPPcPf.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 a=require("./localStorageUtils-CBQuZzg0.cjs"),g=({cell:{value:t}})=>e.jsxRuntimeExports.jsx(e.SimpleTooltip,{text:t,placement:"bottom",children:e.jsxRuntimeExports.jsx("div",{className:"w-100 text-truncate",children:t})}),f=({cell:{value:t}})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t==null?void 0:t.toLocaleString("cs-CZ")}),p=({cell:{value:t}})=>{const s=e.format(new Date(t),"dd.MM.yyyy");return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t?s:""})},h=(t,s)=>{let i=!1,l=t;t[0]==="#"&&(l=t.slice(1),i=!0);let r=parseInt(l.substring(0,2),16),o=parseInt(l.substring(2,4),16),n=parseInt(l.substring(4,6),16);r+=s,o+=s,n+=s,r>255?r=255:r<0&&(r=0),o>255?o=255:o<0&&(o=0),n>255?n=255:n<0&&(n=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),m=n.toString(16).length===1?"0"+n.toString(16):n.toString(16);return(i?"#":"")+c+u+m},d=t=>{const s=t.slice(3),i=[];for(let r=0;r<s.length;r+=2)i.push(s.slice(r,r+2));return`#${i.reverse().join("")}`},S=t=>typeof t.directoryName=="string"&&typeof t.directoryPath=="string"&&typeof t.directoryTranslationKey=="string"&&Array.isArray(t.files),y=async t=>{let s={status:"pending"};try{s={status:"success",data:(await t).data}}catch(i){s={status:"error",error:i}}return s},F=["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","menu","arrow-right"];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.isExtensionOpenable=e.isExtensionOpenable;exports.isFileOpenable=e.isFileOpenable;exports.isISODate=e.isISODate;exports.isPrimitive=e.isPrimitive;exports.isValidDate=e.isValidDate;exports.joinStrings=e.joinStrings;exports.msToStartOfNextDay=e.msToStartOfNextDay;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.dumpLocalStorage=a.dumpLocalStorage;exports.generateApiPath=a.generateApiPath;exports.hookFormSetNull=a.hookFormSetNull;exports.hookFormSetNulls=a.hookFormSetNulls;exports.limitNumber=a.limitNumber;exports.restoreLocalStorage=a.restoreLocalStorage;exports.CommonLuminusIconsArray=F;exports.adjustBrightness=h;exports.dateValueFormat=p;exports.isFileStructureDirectory=S;exports.numFormat=f;exports.responsePromiseWrapper=y;exports.valueTooltip=g;exports.vclToHex=d;
package/dist/utils.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import { j as i, ao as f, U as g } from "./ShortcutLinksContext-CQY8nrGK.js";
2
- import { cc as C, ca as V, cb as k, c9 as E, c8 as M, bS as A, bT as W, a_ as z, b_ as B, bP as U, c2 as G, b6 as Y, c7 as Z, ce as _, bZ as H, bU as $, aI as q, bW as J, aJ as K, bV as Q, bX as X, bY as ee, c3 as te, bl as se, c0 as re, b$ as ae, bQ as oe, c1 as ie, bR as ne, cf as le, bI as ce, c4 as me, aT as fe, aZ as ge, ch as ue, c5 as pe, _ as de, c6 as he, aH as ye, cd as be, cg as Se } from "./ShortcutLinksContext-CQY8nrGK.js";
1
+ import { j as i, ao as g, U as p } from "./ShortcutLinksContext-CNZMOV_j.js";
2
+ import { cd as j, cb as C, cc as P, ca as k, c9 as M, bU as V, bV as A, a_ as E, c0 as W, bR as z, bn as B, b6 as U, c8 as G, cf as Y, b$ as Z, bW as _, aI as H, bY as K, aJ as $, bX as q, bZ as J, b_ as X, c4 as Q, bl as ee, c2 as te, c1 as se, bS as re, c3 as ae, bT as oe, cg as ie, bK as ne, c5 as le, aT as ce, aZ as me, ci as ge, c6 as pe, _ as fe, c7 as ue, aH as de, ce as he, ch as ye } from "./ShortcutLinksContext-CNZMOV_j.js";
3
3
  import "react";
4
4
  import "@azure/msal-browser";
5
5
  import "@azure/msal-react";
@@ -7,40 +7,31 @@ import "react-router-dom";
7
7
  import "react-dom";
8
8
  import "react-hook-form";
9
9
  import "react-flexmonster";
10
- import { d as Fe, g as De, l as Oe, r as Ne } from "./localStorageUtils-CHdu9Xvf.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) => {
10
+ import { d as be, g as xe, h as Fe, a as De, l as Oe, r as Ne } from "./localStorageUtils-DBNNyBcc.js";
11
+ const F = ({ cell: { value: e } }) => /* @__PURE__ */ i.jsx(g, { text: e, placement: "bottom", children: /* @__PURE__ */ i.jsx("div", { className: "w-100 text-truncate", children: e }) }), D = ({ cell: { value: e } }) => /* @__PURE__ */ i.jsx(i.Fragment, { children: e == null ? void 0 : e.toLocaleString("cs-CZ") }), O = ({ cell: { value: e } }) => {
12
+ const s = p(new Date(e), "dd.MM.yyyy");
13
+ return /* @__PURE__ */ i.jsx(i.Fragment, { children: e ? s : "" });
14
+ }, N = (e, s) => {
15
15
  let r = !1, n = e;
16
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);
17
+ let t = parseInt(n.substring(0, 2), 16), a = parseInt(n.substring(2, 4), 16), o = parseInt(n.substring(4, 6), 16);
18
+ t += s, a += s, o += s, t > 255 ? t = 255 : t < 0 && (t = 0), a > 255 ? a = 255 : a < 0 && (a = 0), o > 255 ? o = 255 : o < 0 && (o = 0);
19
+ const l = t.toString(16).length === 1 ? "0" + t.toString(16) : t.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
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));
21
+ }, v = (e) => {
22
+ const s = e.slice(3), r = [];
23
+ for (let t = 0; t < s.length; t += 2)
24
+ r.push(s.slice(t, t + 2));
25
25
  return `#${r.reverse().join("")}`;
26
- };
27
- function u(e, t) {
28
- e.setValue(t, null);
29
- }
30
- function I(e, t) {
31
- t.forEach((r) => {
32
- u(e, r);
33
- });
34
- }
35
- const L = (e) => typeof e.directoryName == "string" && typeof e.directoryPath == "string" && typeof e.directoryTranslationKey == "string" && Array.isArray(e.files), P = async (e) => {
36
- let t = { status: "pending" };
26
+ }, T = (e) => typeof e.directoryName == "string" && typeof e.directoryPath == "string" && typeof e.directoryTranslationKey == "string" && Array.isArray(e.files), w = async (e) => {
27
+ let s = { status: "pending" };
37
28
  try {
38
- t = { status: "success", data: (await e).data };
29
+ s = { status: "success", data: (await e).data };
39
30
  } catch (r) {
40
- t = { status: "error", error: r };
31
+ s = { status: "error", error: r };
41
32
  }
42
- return t;
43
- }, R = [
33
+ return s;
34
+ }, I = [
44
35
  "edit",
45
36
  "delete",
46
37
  "info",
@@ -76,62 +67,64 @@ const L = (e) => typeof e.directoryName == "string" && typeof e.directoryPath ==
76
67
  "close",
77
68
  "search",
78
69
  "plus",
79
- "minus"
70
+ "minus",
71
+ "menu",
72
+ "arrow-right"
80
73
  ];
81
74
  export {
82
- R as CommonLuminusIconsArray,
83
- v as adjustBrightness,
84
- C as atobUtf8,
85
- V as buildEmployeeNameString,
86
- k as buildOrgUnitString,
87
- E as buildVehicleNameString,
75
+ I as CommonLuminusIconsArray,
76
+ N as adjustBrightness,
77
+ j as atobUtf8,
78
+ C as buildEmployeeNameString,
79
+ P as buildOrgUnitString,
80
+ k as buildVehicleNameString,
88
81
  M as capitalizeFirstLetter,
89
- A as compareDate,
90
- W as compareDateTime,
91
- N as dateValueFormat,
92
- Fe as dumpLocalStorage,
93
- z as extractErrorsFromResponse,
94
- B as extractFilename,
95
- U as extractPermissionsFromResponse,
96
- G as fixNameIdNulls,
97
- Y as formatDate,
98
- Z as formatDateTime,
99
- _ as formatFileSize,
100
- De as generateApiPath,
101
- H as getDateString,
102
- $ as getDaysDifference,
103
- q as getFirstDayOfMonth,
104
- J as getFirstDayOfOffsetMonth,
105
- K as getFirstDayOfYear,
106
- Q as getLastDayOfMonth,
107
- X as getLastDayOfOffsetMonth,
108
- ee as getLastDayOfYear,
109
- te as hasOnlyNullValues,
110
- u as hookFormSetNull,
111
- I as hookFormSetNulls,
112
- se as hookFormSetServerErrors,
113
- re as isExtensionOpenable,
114
- ae as isFileOpenable,
115
- L as isFileStructureDirectory,
116
- oe as isISODate,
117
- ie as isPrimitive,
118
- ne as isValidDate,
119
- le as joinStrings,
82
+ V as compareDate,
83
+ A as compareDateTime,
84
+ O as dateValueFormat,
85
+ be as dumpLocalStorage,
86
+ E as extractErrorsFromResponse,
87
+ W as extractFilename,
88
+ z as extractPermissionsFromResponse,
89
+ B as fixNameIdNulls,
90
+ U as formatDate,
91
+ G as formatDateTime,
92
+ Y as formatFileSize,
93
+ xe as generateApiPath,
94
+ Z as getDateString,
95
+ _ as getDaysDifference,
96
+ H as getFirstDayOfMonth,
97
+ K as getFirstDayOfOffsetMonth,
98
+ $ as getFirstDayOfYear,
99
+ q as getLastDayOfMonth,
100
+ J as getLastDayOfOffsetMonth,
101
+ X as getLastDayOfYear,
102
+ Q as hasOnlyNullValues,
103
+ Fe as hookFormSetNull,
104
+ De as hookFormSetNulls,
105
+ ee as hookFormSetServerErrors,
106
+ te as isExtensionOpenable,
107
+ se as isFileOpenable,
108
+ T as isFileStructureDirectory,
109
+ re as isISODate,
110
+ ae as isPrimitive,
111
+ oe as isValidDate,
112
+ ie as joinStrings,
120
113
  Oe as limitNumber,
121
- ce as msToStartOfNextDay,
122
- O as numFormat,
123
- me as replaceNullValuesOnlyObjectsWithNulls,
124
- P as responsePromiseWrapper,
114
+ ne as msToStartOfNextDay,
115
+ D as numFormat,
116
+ le as replaceNullValuesOnlyObjectsWithNulls,
117
+ w as responsePromiseWrapper,
125
118
  Ne as restoreLocalStorage,
126
- fe as saveFile,
127
- ge as saveFileFromResponse,
128
- ue as shortenText,
119
+ ce as saveFile,
120
+ me as saveFileFromResponse,
121
+ ge as shortenText,
129
122
  pe as stringContains,
130
- de as stringSearchWithin,
131
- he as stringStartsWith,
132
- ye as trimIsoDate,
133
- be as truncateText,
134
- Se as urlfyArray,
135
- D as valueTooltip,
136
- T as vclToHex
123
+ fe as stringSearchWithin,
124
+ ue as stringStartsWith,
125
+ de as trimIsoDate,
126
+ he as truncateText,
127
+ ye as urlfyArray,
128
+ F as valueTooltip,
129
+ v as vclToHex
137
130
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-luminus-components",
3
- "version": "1.5.5",
3
+ "version": "1.5.7",
4
4
  "description": "Library of React Components reusable in Luminus projects (Fleetman, CAFM)",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1,46 +0,0 @@
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
- };
@@ -1 +0,0 @@
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;