react-luminus-components 1.4.14 → 1.4.16

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.
@@ -9,4 +9,5 @@ export * from './object/objectUtils';
9
9
  export * from './search/searchUtils';
10
10
  export * from './text/string';
11
11
  export * from './text/textUtils';
12
+ export * from './route/apiPathUtils';
12
13
  export { default as CommonLuminusIconsArray } from './constants/CommonLuminusIconsArray';
@@ -0,0 +1,8 @@
1
+ import { PathParam } from 'react-router-dom';
2
+
3
+ export declare const generateApiPath: <Path extends string>(originalPath: Path, params?: {
4
+ path?: { [key in PathParam<Path>]: string | number | null; };
5
+ query?: {
6
+ [key: string]: string | number | boolean | null | undefined;
7
+ };
8
+ }) => string;
package/dist/utils.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-B2J2n2kF.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 f=require("./numberUtils-BY7ziQF8.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})}),h=({cell:{value:t}})=>e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t==null?void 0:t.toLocaleString("cs-CZ")}),d=({cell:{value:t}})=>{const i=e.format(new Date(t),"dd.MM.yyyy");return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:t?i:""})},S=(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 m=r.toString(16).length===1?"0"+r.toString(16):r.toString(16),c=o.toString(16).length===1?"0"+o.toString(16):o.toString(16),u=s.toString(16).length===1?"0"+s.toString(16):s.toString(16);return(n?"#":"")+m+c+u},p=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 l(t,i){t.setValue(i,null)}function F(t,i){i.forEach(n=>{l(t,n)})}const 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"];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.limitNumber=f.limitNumber;exports.CommonLuminusIconsArray=x;exports.adjustBrightness=S;exports.dateValueFormat=d;exports.hookFormSetNull=l;exports.hookFormSetNulls=F;exports.numFormat=h;exports.valueTooltip=g;exports.vclToHex=p;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./ShortcutLinksContext-B2J2n2kF.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 m=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?"#":"")+m+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 c(t,i){t.setValue(i,null)}function F(t,i){i.forEach(n=>{c(t,n)})}const 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"];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=F;exports.numFormat=h;exports.valueTooltip=f;exports.vclToHex=S;
package/dist/utils.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { j as i, aA as f, V as g } from "./ShortcutLinksContext-BjRebgUy.js";
2
- import { c9 as I, c7 as M, c8 as k, c6 as w, c5 as L, bP as E, bQ as P, b2 as z, bX as B, bM as W, b$ as A, b9 as G, c4 as U, cb as Y, bW as Q, bR as Z, aR as $, bT as H, aS as X, bS as _, bU as q, bV as J, c0 as K, bm as tt, bN as et, b_ as st, bO as rt, cc as at, bF as ot, bZ as it, c1 as nt, bY as lt, b1 as ct, ce as mt, c2 as ft, a0 as gt, c3 as ut, aQ as ht, ca as pt, cd as bt } from "./ShortcutLinksContext-BjRebgUy.js";
2
+ import { c9 as I, c7 as M, c8 as k, c6 as w, c5 as L, bP as P, bQ as E, b2 as z, bX as A, bM as B, b$ as W, b9 as G, c4 as U, cb as Y, bW as Q, bR as Z, aR as $, bT as H, aS as X, bS as _, bU as q, bV as J, c0 as K, bm as tt, bN as et, b_ as st, bO as rt, cc as at, bF as ot, bZ as it, c1 as nt, bY as lt, b1 as ct, ce as mt, c2 as ft, a0 as gt, c3 as ht, aQ as ut, ca as pt, cd as bt } from "./ShortcutLinksContext-BjRebgUy.js";
3
3
  import "react";
4
4
  import "@azure/msal-browser";
5
5
  import "@azure/msal-react";
@@ -7,7 +7,7 @@ import "react-router-dom";
7
7
  import "react-dom";
8
8
  import "react-hook-form";
9
9
  import "react-flexmonster";
10
- import { l as St } from "./numberUtils-Bwf8nio8.js";
10
+ import { g as St, l as Ft } from "./apiPathUtils-DiqvB8mF.js";
11
11
  const D = ({ cell: { value: t } }) => /* @__PURE__ */ i.jsx(f, { text: t, placement: "bottom", children: /* @__PURE__ */ i.jsx("div", { className: "w-100 text-truncate", children: t }) }), O = ({ cell: { value: t } }) => /* @__PURE__ */ i.jsx(i.Fragment, { children: t == null ? void 0 : t.toLocaleString("cs-CZ") }), N = ({ cell: { value: t } }) => {
12
12
  const s = g(new Date(t), "dd.MM.yyyy");
13
13
  return /* @__PURE__ */ i.jsx(i.Fragment, { children: t ? s : "" });
@@ -24,12 +24,12 @@ const D = ({ cell: { value: t } }) => /* @__PURE__ */ i.jsx(f, { text: t, placem
24
24
  o.push(s.slice(e, e + 2));
25
25
  return `#${o.reverse().join("")}`;
26
26
  };
27
- function u(t, s) {
27
+ function h(t, s) {
28
28
  t.setValue(s, null);
29
29
  }
30
30
  function R(t, s) {
31
31
  s.forEach((o) => {
32
- u(t, o);
32
+ h(t, o);
33
33
  });
34
34
  }
35
35
  const T = [
@@ -67,16 +67,17 @@ export {
67
67
  k as buildOrgUnitString,
68
68
  w as buildVehicleNameString,
69
69
  L as capitalizeFirstLetter,
70
- E as compareDate,
71
- P as compareDateTime,
70
+ P as compareDate,
71
+ E as compareDateTime,
72
72
  N as dateValueFormat,
73
73
  z as extractErrorsFromResponse,
74
- B as extractFilename,
75
- W as extractPermissionsFromResponse,
76
- A as fixNameIdNulls,
74
+ A as extractFilename,
75
+ B as extractPermissionsFromResponse,
76
+ W as fixNameIdNulls,
77
77
  G as formatDate,
78
78
  U as formatDateTime,
79
79
  Y as formatFileSize,
80
+ St as generateApiPath,
80
81
  Q as getDateString,
81
82
  Z as getDaysDifference,
82
83
  $ as getFirstDayOfMonth,
@@ -86,14 +87,14 @@ export {
86
87
  q as getLastDayOfOffsetMonth,
87
88
  J as getLastDayOfYear,
88
89
  K as hasOnlyNullValues,
89
- u as hookFormSetNull,
90
+ h as hookFormSetNull,
90
91
  R as hookFormSetNulls,
91
92
  tt as hookFormSetServerErrors,
92
93
  et as isISODate,
93
94
  st as isPrimitive,
94
95
  rt as isValidDate,
95
96
  at as joinStrings,
96
- St as limitNumber,
97
+ Ft as limitNumber,
97
98
  ot as msToStartOfNextDay,
98
99
  O as numFormat,
99
100
  it as openFileFromResponse,
@@ -103,8 +104,8 @@ export {
103
104
  mt as shortenText,
104
105
  ft as stringContains,
105
106
  gt as stringSearchWithin,
106
- ut as stringStartsWith,
107
- ht as trimIsoDate,
107
+ ht as stringStartsWith,
108
+ ut as trimIsoDate,
108
109
  pt as truncateText,
109
110
  bt as urlfyArray,
110
111
  D as valueTooltip,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-luminus-components",
3
- "version": "1.4.14",
3
+ "version": "1.4.16",
4
4
  "description": "Library of React Components reusable in Luminus projects (Fleetman, CAFM)",
5
5
  "type": "module",
6
6
  "repository": {
@@ -1 +0,0 @@
1
- "use strict";const u=(r,i,e)=>{let t=r;return i!==void 0&&(t=Math.max(t,i)),e!==void 0&&(t=Math.min(t,e)),t};exports.limitNumber=u;
@@ -1,7 +0,0 @@
1
- const l = (r, i, e) => {
2
- let t = r;
3
- return i !== void 0 && (t = Math.max(t, i)), e !== void 0 && (t = Math.min(t, e)), t;
4
- };
5
- export {
6
- l
7
- };