@addsign/moje-agenda-shared-lib 0.0.87 → 0.0.88
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.
- package/dist/components/Calendar.js +3 -3
- package/dist/components/Calendar.js.map +1 -1
- package/dist/components/datatable/DataTableServer.js +8 -7
- package/dist/components/datatable/DataTableServer.js.map +1 -1
- package/dist/components/datatable/Resizable.js +0 -5
- package/dist/components/datatable/Resizable.js.map +1 -1
- package/dist/utils/getFullName.js +1 -1
- package/dist/utils/getFullName.js.map +1 -1
- package/package.json +1 -1
|
@@ -57,11 +57,6 @@ const Resizable = ({
|
|
|
57
57
|
if (!node) {
|
|
58
58
|
return;
|
|
59
59
|
}
|
|
60
|
-
console.log(
|
|
61
|
-
"%clibcomponentsdatatableResizable.tsx:87 setuju width",
|
|
62
|
-
"color: #007acc;",
|
|
63
|
-
width
|
|
64
|
-
);
|
|
65
60
|
const parent = node.parentElement;
|
|
66
61
|
if (node.parentNode !== ((_b = (_a = node.parentNode) == null ? void 0 : _a.parentNode) == null ? void 0 : _b.lastChild)) {
|
|
67
62
|
parent == null ? void 0 : parent.style.setProperty("width", `${width}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Resizable.js","sources":["../../../lib/components/datatable/Resizable.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\r\n\r\ninterface IResizableProps {\r\n tableId: string;\r\n colKey: string;\r\n children: any;\r\n defaultWidth: string;\r\n}\r\n\r\nexport const Resizable = ({\r\n tableId,\r\n colKey,\r\n defaultWidth,\r\n children,\r\n}: IResizableProps) => {\r\n const [node, setNode] = React.useState<HTMLElement | null>(null);\r\n\r\n const [width, setWidth] = useState(() => {\r\n const storageKey = `datatable:${tableId}`;\r\n const storedData = localStorage.getItem(storageKey);\r\n const data = storedData ? JSON.parse(storedData) : {};\r\n\r\n const columnWidths = data.columnWidths || {};\r\n const storedWidth = columnWidths[colKey];\r\n return storedWidth ? storedWidth : defaultWidth;\r\n });\r\n\r\n //storing sizes\r\n useEffect(() => {\r\n const storageKey = `datatable:${tableId}`;\r\n const storedData = localStorage.getItem(storageKey);\r\n const data = storedData ? JSON.parse(storedData) : {};\r\n\r\n data.columnWidths = data.columnWidths || {};\r\n data.columnWidths[colKey] = width;\r\n\r\n localStorage.setItem(storageKey, JSON.stringify(data));\r\n }, [width, tableId, colKey, defaultWidth]);\r\n\r\n const ref = React.useCallback((nodeEle: HTMLElement) => {\r\n setNode(nodeEle);\r\n }, []);\r\n\r\n const handleMouseDown = React.useCallback(\r\n (e: MouseEvent) => {\r\n if (!node) {\r\n return;\r\n }\r\n\r\n const parent = node.parentElement;\r\n const startPos = {\r\n x: e.clientX,\r\n y: e.clientY,\r\n };\r\n // const styles = window.getComputedStyle(parent);\r\n const styles = parent ? window.getComputedStyle(parent) : null;\r\n\r\n const w = parseInt(styles?.width || \"0\", 10);\r\n\r\n const handleMouseMove = (e: MouseEvent) => {\r\n const dx = e.clientX - startPos.x;\r\n const newWidth = w + dx + \"px\";\r\n\r\n parent?.style.setProperty(\"width\", newWidth);\r\n setWidth(newWidth);\r\n };\r\n\r\n const handleMouseUp = () => {\r\n document.removeEventListener(\"mousemove\", handleMouseMove);\r\n document.removeEventListener(\"mouseup\", handleMouseUp);\r\n };\r\n\r\n document.addEventListener(\"mousemove\", handleMouseMove);\r\n document.addEventListener(\"mouseup\", handleMouseUp);\r\n },\r\n [node]\r\n );\r\n\r\n React.useEffect(() => {\r\n if (!node) {\r\n return;\r\n }\r\n
|
|
1
|
+
{"version":3,"file":"Resizable.js","sources":["../../../lib/components/datatable/Resizable.tsx"],"sourcesContent":["import React, { useEffect, useState } from \"react\";\r\n\r\ninterface IResizableProps {\r\n tableId: string;\r\n colKey: string;\r\n children: any;\r\n defaultWidth: string;\r\n}\r\n\r\nexport const Resizable = ({\r\n tableId,\r\n colKey,\r\n defaultWidth,\r\n children,\r\n}: IResizableProps) => {\r\n const [node, setNode] = React.useState<HTMLElement | null>(null);\r\n\r\n const [width, setWidth] = useState(() => {\r\n const storageKey = `datatable:${tableId}`;\r\n const storedData = localStorage.getItem(storageKey);\r\n const data = storedData ? JSON.parse(storedData) : {};\r\n\r\n const columnWidths = data.columnWidths || {};\r\n const storedWidth = columnWidths[colKey];\r\n return storedWidth ? storedWidth : defaultWidth;\r\n });\r\n\r\n //storing sizes\r\n useEffect(() => {\r\n const storageKey = `datatable:${tableId}`;\r\n const storedData = localStorage.getItem(storageKey);\r\n const data = storedData ? JSON.parse(storedData) : {};\r\n\r\n data.columnWidths = data.columnWidths || {};\r\n data.columnWidths[colKey] = width;\r\n\r\n localStorage.setItem(storageKey, JSON.stringify(data));\r\n }, [width, tableId, colKey, defaultWidth]);\r\n\r\n const ref = React.useCallback((nodeEle: HTMLElement) => {\r\n setNode(nodeEle);\r\n }, []);\r\n\r\n const handleMouseDown = React.useCallback(\r\n (e: MouseEvent) => {\r\n if (!node) {\r\n return;\r\n }\r\n\r\n const parent = node.parentElement;\r\n const startPos = {\r\n x: e.clientX,\r\n y: e.clientY,\r\n };\r\n // const styles = window.getComputedStyle(parent);\r\n const styles = parent ? window.getComputedStyle(parent) : null;\r\n\r\n const w = parseInt(styles?.width || \"0\", 10);\r\n\r\n const handleMouseMove = (e: MouseEvent) => {\r\n const dx = e.clientX - startPos.x;\r\n const newWidth = w + dx + \"px\";\r\n\r\n parent?.style.setProperty(\"width\", newWidth);\r\n setWidth(newWidth);\r\n };\r\n\r\n const handleMouseUp = () => {\r\n document.removeEventListener(\"mousemove\", handleMouseMove);\r\n document.removeEventListener(\"mouseup\", handleMouseUp);\r\n };\r\n\r\n document.addEventListener(\"mousemove\", handleMouseMove);\r\n document.addEventListener(\"mouseup\", handleMouseUp);\r\n },\r\n [node]\r\n );\r\n\r\n React.useEffect(() => {\r\n if (!node) {\r\n return;\r\n }\r\n\r\n const parent = node.parentElement;\r\n if (node.parentNode !== node.parentNode?.parentNode?.lastChild) {\r\n parent?.style.setProperty(\"width\", `${width}`);\r\n } else {\r\n parent?.style.setProperty(\"width\", `auto`);\r\n }\r\n\r\n node.addEventListener(\"mousedown\", handleMouseDown);\r\n\r\n return () => {\r\n node.removeEventListener(\"mousedown\", handleMouseDown);\r\n };\r\n }, [node, handleMouseDown, tableId]);\r\n\r\n return children({ ref });\r\n};\r\n"],"names":["React","e"],"mappings":";AASO,MAAM,YAAY,CAAC;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAuB;AACrB,QAAM,CAAC,MAAM,OAAO,IAAIA,eAAM,SAA6B,IAAI;AAE/D,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,MAAM;AACjC,UAAA,aAAa,aAAa,OAAO;AACjC,UAAA,aAAa,aAAa,QAAQ,UAAU;AAClD,UAAM,OAAO,aAAa,KAAK,MAAM,UAAU,IAAI;AAE7C,UAAA,eAAe,KAAK,gBAAgB;AACpC,UAAA,cAAc,aAAa,MAAM;AACvC,WAAO,cAAc,cAAc;AAAA,EAAA,CACpC;AAGD,YAAU,MAAM;AACR,UAAA,aAAa,aAAa,OAAO;AACjC,UAAA,aAAa,aAAa,QAAQ,UAAU;AAClD,UAAM,OAAO,aAAa,KAAK,MAAM,UAAU,IAAI;AAE9C,SAAA,eAAe,KAAK,gBAAgB,CAAA;AACpC,SAAA,aAAa,MAAM,IAAI;AAE5B,iBAAa,QAAQ,YAAY,KAAK,UAAU,IAAI,CAAC;AAAA,KACpD,CAAC,OAAO,SAAS,QAAQ,YAAY,CAAC;AAEzC,QAAM,MAAMA,eAAM,YAAY,CAAC,YAAyB;AACtD,YAAQ,OAAO;AAAA,EACjB,GAAG,CAAE,CAAA;AAEL,QAAM,kBAAkBA,eAAM;AAAA,IAC5B,CAAC,MAAkB;AACjB,UAAI,CAAC,MAAM;AACT;AAAA,MACF;AAEA,YAAM,SAAS,KAAK;AACpB,YAAM,WAAW;AAAA,QACf,GAAG,EAAE;AAAA,QACL,GAAG,EAAE;AAAA,MAAA;AAGP,YAAM,SAAS,SAAS,OAAO,iBAAiB,MAAM,IAAI;AAE1D,YAAM,IAAI,UAAS,iCAAQ,UAAS,KAAK,EAAE;AAErC,YAAA,kBAAkB,CAACC,OAAkB;AACnC,cAAA,KAAKA,GAAE,UAAU,SAAS;AAC1B,cAAA,WAAW,IAAI,KAAK;AAElB,yCAAA,MAAM,YAAY,SAAS;AACnC,iBAAS,QAAQ;AAAA,MAAA;AAGnB,YAAM,gBAAgB,MAAM;AACjB,iBAAA,oBAAoB,aAAa,eAAe;AAChD,iBAAA,oBAAoB,WAAW,aAAa;AAAA,MAAA;AAG9C,eAAA,iBAAiB,aAAa,eAAe;AAC7C,eAAA,iBAAiB,WAAW,aAAa;AAAA,IACpD;AAAA,IACA,CAAC,IAAI;AAAA,EAAA;AAGPD,iBAAM,UAAU,MAAM;;AACpB,QAAI,CAAC,MAAM;AACT;AAAA,IACF;AAEA,UAAM,SAAS,KAAK;AACpB,QAAI,KAAK,iBAAe,gBAAK,eAAL,mBAAiB,eAAjB,mBAA6B,YAAW;AAC9D,uCAAQ,MAAM,YAAY,SAAS,GAAG,KAAK;AAAA,IAAE,OACxC;AACG,uCAAA,MAAM,YAAY,SAAS;AAAA,IACrC;AAEK,SAAA,iBAAiB,aAAa,eAAe;AAElD,WAAO,MAAM;AACN,WAAA,oBAAoB,aAAa,eAAe;AAAA,IAAA;AAAA,EAEtD,GAAA,CAAC,MAAM,iBAAiB,OAAO,CAAC;AAE5B,SAAA,SAAS,EAAE,IAAA,CAAK;AACzB;"}
|
|
@@ -22,7 +22,7 @@ const getFullNameList = (employee, showEmplNumb = false, highlighManagers = true
|
|
|
22
22
|
if (!employee) {
|
|
23
23
|
return "Neobsazené systemizované místo";
|
|
24
24
|
}
|
|
25
|
-
const fullName = ((employee == null ? void 0 : employee.lastName) || "") + " " + ((employee == null ? void 0 : employee.firstName) || "") + ((employee == null ? void 0 : employee.degreeBefore) ? "
|
|
25
|
+
const fullName = ((employee == null ? void 0 : employee.lastName) || "") + " " + ((employee == null ? void 0 : employee.firstName) || "") + ((employee == null ? void 0 : employee.degreeBefore) ? " " + (employee == null ? void 0 : employee.degreeBefore) : "") + ((employee == null ? void 0 : employee.degreeAfter) ? " " + (employee == null ? void 0 : employee.degreeAfter) : "") + (showEmplNumb ? " (" + (employee == null ? void 0 : employee.employeeId) + ")" : "");
|
|
26
26
|
if (highlighManagers) {
|
|
27
27
|
if ((employee == null ? void 0 : employee.manager) == "1") {
|
|
28
28
|
return /* @__PURE__ */ jsxs("span", { className: "font-bold", children: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getFullName.js","sources":["../../lib/utils/getFullName.tsx"],"sourcesContent":["// userDataFetcher.ts\r\n\r\nimport { IEmployee, IPositionEmployee } from \"../types\";\r\n\r\nconst getFullName = (\r\n employee: IEmployee,\r\n showEmplNumb: boolean = false,\r\n highlighManagers: boolean = true\r\n) => {\r\n if (!employee) {\r\n return \"Neobsazené systemizované místo\";\r\n }\r\n const fullName =\r\n (employee?.degreeBefore ? employee?.degreeBefore + \" \" : \"\") +\r\n (employee?.firstName || \"\") +\r\n \" \" +\r\n (employee?.lastName || \"\") +\r\n (employee?.degreeAfter ? \" \" + employee?.degreeAfter : \"\") +\r\n (showEmplNumb ? \" (\" + employee?.employeeId + \")\" : \"\");\r\n\r\n if (highlighManagers) {\r\n if (employee?.manager == \"1\") {\r\n return <span className=\"font-bold\"> {fullName} </span>;\r\n } else {\r\n return fullName;\r\n }\r\n } else {\r\n return fullName;\r\n }\r\n};\r\nconst getFullNameList = (\r\n employee: IEmployee,\r\n showEmplNumb: boolean = false,\r\n highlighManagers: boolean = true\r\n) => {\r\n if (!employee) {\r\n return \"Neobsazené systemizované místo\";\r\n }\r\n const fullName =\r\n (employee?.lastName || \"\") +\r\n \" \" +\r\n (employee?.firstName || \"\") +\r\n (employee?.degreeBefore ? \"
|
|
1
|
+
{"version":3,"file":"getFullName.js","sources":["../../lib/utils/getFullName.tsx"],"sourcesContent":["// userDataFetcher.ts\r\n\r\nimport { IEmployee, IPositionEmployee } from \"../types\";\r\n\r\nconst getFullName = (\r\n employee: IEmployee,\r\n showEmplNumb: boolean = false,\r\n highlighManagers: boolean = true\r\n) => {\r\n if (!employee) {\r\n return \"Neobsazené systemizované místo\";\r\n }\r\n const fullName =\r\n (employee?.degreeBefore ? employee?.degreeBefore + \" \" : \"\") +\r\n (employee?.firstName || \"\") +\r\n \" \" +\r\n (employee?.lastName || \"\") +\r\n (employee?.degreeAfter ? \" \" + employee?.degreeAfter : \"\") +\r\n (showEmplNumb ? \" (\" + employee?.employeeId + \")\" : \"\");\r\n\r\n if (highlighManagers) {\r\n if (employee?.manager == \"1\") {\r\n return <span className=\"font-bold\"> {fullName} </span>;\r\n } else {\r\n return fullName;\r\n }\r\n } else {\r\n return fullName;\r\n }\r\n};\r\nconst getFullNameList = (\r\n employee: IEmployee,\r\n showEmplNumb: boolean = false,\r\n highlighManagers: boolean = true\r\n) => {\r\n if (!employee) {\r\n return \"Neobsazené systemizované místo\";\r\n }\r\n const fullName =\r\n (employee?.lastName || \"\") +\r\n \" \" +\r\n (employee?.firstName || \"\") +\r\n (employee?.degreeBefore ? \" \" + employee?.degreeBefore : \"\") +\r\n (employee?.degreeAfter ? \" \" + employee?.degreeAfter : \"\") +\r\n (showEmplNumb ? \" (\" + employee?.employeeId + \")\" : \"\");\r\n\r\n if (highlighManagers) {\r\n if (employee?.manager == \"1\") {\r\n return <span className=\"font-bold\"> {fullName} </span>;\r\n } else {\r\n return fullName;\r\n }\r\n } else {\r\n return fullName;\r\n }\r\n};\r\n\r\nconst getFullNamePositionWithEmployee = (\r\n position: IPositionEmployee,\r\n showEmplNumb: boolean = false,\r\n highlighManagers: boolean = true\r\n) => {\r\n if (!position.employee)\r\n return \"Neobsazená pozice (\" + position.positionNumber + \")\";\r\n return getFullName(position.employee, showEmplNumb, highlighManagers);\r\n};\r\nconst getFullNameListPositionWithEmployee = (\r\n position: IPositionEmployee,\r\n showEmplNumb: boolean = false,\r\n highlighManagers: boolean = true\r\n) => {\r\n if (!position.employee)\r\n return \"Neobsazená pozice (\" + position.positionNumber + \")\";\r\n return getFullNameList(position.employee, showEmplNumb, highlighManagers);\r\n};\r\nexport {};\r\n\r\nexport {\r\n getFullName,\r\n getFullNameList,\r\n getFullNamePositionWithEmployee,\r\n getFullNameListPositionWithEmployee,\r\n};\r\n"],"names":[],"mappings":";AAIA,MAAM,cAAc,CAClB,UACA,eAAwB,OACxB,mBAA4B,SACzB;AACH,MAAI,CAAC,UAAU;AACN,WAAA;AAAA,EACT;AACM,QAAA,aACH,qCAAU,iBAAe,qCAAU,gBAAe,MAAM,QACxD,qCAAU,cAAa,MACxB,QACC,qCAAU,aAAY,QACtB,qCAAU,eAAc,OAAM,qCAAU,eAAc,OACtD,eAAe,QAAO,qCAAU,cAAa,MAAM;AAEtD,MAAI,kBAAkB;AAChB,SAAA,qCAAU,YAAW,KAAK;AACrB,aAAA,qBAAC,QAAK,EAAA,WAAU,aAAY,UAAA;AAAA,QAAA;AAAA,QAAE;AAAA,QAAS;AAAA,MAAC,EAAA,CAAA;AAAA,IAAA,OAC1C;AACE,aAAA;AAAA,IACT;AAAA,EAAA,OACK;AACE,WAAA;AAAA,EACT;AACF;AACA,MAAM,kBAAkB,CACtB,UACA,eAAwB,OACxB,mBAA4B,SACzB;AACH,MAAI,CAAC,UAAU;AACN,WAAA;AAAA,EACT;AACM,QAAA,aACH,qCAAU,aAAY,MACvB,QACC,qCAAU,cAAa,QACvB,qCAAU,gBAAe,OAAM,qCAAU,gBAAe,QACxD,qCAAU,eAAc,OAAM,qCAAU,eAAc,OACtD,eAAe,QAAO,qCAAU,cAAa,MAAM;AAEtD,MAAI,kBAAkB;AAChB,SAAA,qCAAU,YAAW,KAAK;AACrB,aAAA,qBAAC,QAAK,EAAA,WAAU,aAAY,UAAA;AAAA,QAAA;AAAA,QAAE;AAAA,QAAS;AAAA,MAAC,EAAA,CAAA;AAAA,IAAA,OAC1C;AACE,aAAA;AAAA,IACT;AAAA,EAAA,OACK;AACE,WAAA;AAAA,EACT;AACF;AAEA,MAAM,kCAAkC,CACtC,UACA,eAAwB,OACxB,mBAA4B,SACzB;AACH,MAAI,CAAC,SAAS;AACL,WAAA,wBAAwB,SAAS,iBAAiB;AAC3D,SAAO,YAAY,SAAS,UAAU,cAAc,gBAAgB;AACtE;AACA,MAAM,sCAAsC,CAC1C,UACA,eAAwB,OACxB,mBAA4B,SACzB;AACH,MAAI,CAAC,SAAS;AACL,WAAA,wBAAwB,SAAS,iBAAiB;AAC3D,SAAO,gBAAgB,SAAS,UAAU,cAAc,gBAAgB;AAC1E;"}
|