@dmsi/wedgekit-react 0.0.207 → 0.0.208

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 (42) hide show
  1. package/dist/{chunk-WNQ53SVY.js → chunk-E6Y7ZHQX.js} +45 -1
  2. package/dist/{chunk-RXPS5GVE.js → chunk-EFX3RPW4.js} +3 -3
  3. package/dist/{chunk-WXHRJSDG.js → chunk-ERW3AMED.js} +1 -1
  4. package/dist/{chunk-2JRZCC2K.js → chunk-JITZWSPR.js} +3 -3
  5. package/dist/{chunk-WE55TGZZ.js → chunk-NIHZMIOL.js} +1 -1
  6. package/dist/{chunk-M3433XEJ.js → chunk-T3F37S6Z.js} +15 -1
  7. package/dist/{chunk-2B5T4NCT.js → chunk-UKSJPFN2.js} +2 -2
  8. package/dist/components/DataGridCell.cjs +68 -65
  9. package/dist/components/DataGridCell.js +7 -6
  10. package/dist/components/DateInput.cjs +23 -23
  11. package/dist/components/DateInput.js +4 -4
  12. package/dist/components/DateRangeInput.cjs +23 -23
  13. package/dist/components/DateRangeInput.js +4 -4
  14. package/dist/components/Menu.cjs +38 -35
  15. package/dist/components/Menu.js +6 -4
  16. package/dist/components/MenuOption.cjs +7 -4
  17. package/dist/components/MenuOption.js +5 -2
  18. package/dist/components/Modal.cjs +15 -12
  19. package/dist/components/Modal.js +5 -3
  20. package/dist/components/NestedMenu.cjs +9 -6
  21. package/dist/components/NestedMenu.js +5 -2
  22. package/dist/components/PDFViewer.cjs +22 -19
  23. package/dist/components/PDFViewer.js +5 -3
  24. package/dist/components/ProjectBar.cjs +3 -0
  25. package/dist/components/ProjectBar.js +4 -1
  26. package/dist/components/Time.js +2 -1
  27. package/dist/components/index.cjs +190 -124
  28. package/dist/components/index.js +56 -36
  29. package/dist/components/useMenuSystem.cjs +22 -19
  30. package/dist/components/useMenuSystem.js +5 -2
  31. package/dist/hooks/index.cjs +66 -2
  32. package/dist/hooks/index.js +8 -3
  33. package/dist/utils/index.cjs +25 -0
  34. package/dist/utils/index.js +3 -1
  35. package/package.json +1 -1
  36. package/src/components/DataGrid/index.tsx +57 -31
  37. package/src/hooks/index.ts +1 -0
  38. package/src/hooks/useTableLayout.ts +68 -0
  39. package/src/utils/index.ts +1 -0
  40. package/src/utils/mergeObjectArrays.ts +18 -0
  41. package/src/utils.ts +1 -0
  42. /package/dist/{chunk-6LN6QT6M.js → chunk-VXWSAIB5.js} +0 -0
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Merges two arrays of objects element-wise.
3
+ *
4
+ * @template T The type of the objects in the arrays.
5
+ * @param {T[]} arr1 The first array.
6
+ * @param {T[]} arr2 The second array.
7
+ * @returns {T[]} A new array containing the merged objects.
8
+ */
9
+ export function mergeObjectArrays<T extends object>(arr1: T[], arr2: T[]): T[] {
10
+ const maxLength = Math.max(arr1.length, arr2.length);
11
+
12
+ // Create a new array with a length equal to the longer of the two arrays.
13
+ // For each index, merge the objects from arr1 and arr2.
14
+ return Array.from(
15
+ { length: maxLength },
16
+ (_, i) => ({ ...(arr1[i] || {}), ...(arr2[i] || {}) }) as T,
17
+ );
18
+ }
package/src/utils.ts CHANGED
@@ -21,3 +21,4 @@ export function findDocumentRoot(
21
21
  }
22
22
  return window.document.body;
23
23
  }
24
+ export * from "./utils/index";
File without changes