@reltio/components 1.4.1997 → 1.4.1999

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 (228) hide show
  1. package/cjs/UpSetChart/UpSetChart.d.ts +5 -8
  2. package/cjs/UpSetChart/UpSetChart.js +61 -5
  3. package/cjs/UpSetChart/UpSetChart.test.js +198 -0
  4. package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
  5. package/cjs/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +66 -0
  6. package/cjs/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
  7. package/cjs/UpSetChart/components/IntersectionsChart/index.js +5 -0
  8. package/cjs/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
  9. package/cjs/UpSetChart/components/IntersectionsChart/styles.js +32 -0
  10. package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
  11. package/cjs/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +64 -0
  12. package/cjs/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
  13. package/cjs/UpSetChart/components/IntersectionsChartAxis/index.js +5 -0
  14. package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
  15. package/cjs/UpSetChart/components/IntersectionsChartAxis/styles.js +32 -0
  16. package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
  17. package/cjs/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +56 -0
  18. package/cjs/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
  19. package/cjs/UpSetChart/components/IntersectionsMatrix/index.js +5 -0
  20. package/cjs/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
  21. package/cjs/UpSetChart/components/IntersectionsMatrix/styles.js +27 -0
  22. package/cjs/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
  23. package/cjs/UpSetChart/components/SetsChart/SetsChart.js +58 -0
  24. package/cjs/UpSetChart/components/SetsChart/index.d.ts +1 -0
  25. package/cjs/UpSetChart/components/SetsChart/index.js +5 -0
  26. package/cjs/UpSetChart/components/SetsChart/styles.d.ts +1 -0
  27. package/cjs/UpSetChart/components/SetsChart/styles.js +43 -0
  28. package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
  29. package/cjs/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +20 -0
  30. package/cjs/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
  31. package/cjs/UpSetChart/components/SetsChartAxis/index.js +5 -0
  32. package/cjs/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
  33. package/cjs/UpSetChart/components/SetsChartAxis/styles.js +17 -0
  34. package/cjs/UpSetChart/constants.d.ts +16 -3
  35. package/cjs/UpSetChart/constants.js +20 -4
  36. package/cjs/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
  37. package/cjs/UpSetChart/gameOfThrones.test-data.js +26 -0
  38. package/cjs/UpSetChart/helpers.d.ts +20 -0
  39. package/cjs/UpSetChart/helpers.js +127 -0
  40. package/cjs/UpSetChart/styles.d.ts +4 -1
  41. package/cjs/UpSetChart/styles.js +11 -12
  42. package/cjs/UpSetChart/types.d.ts +16 -0
  43. package/cjs/UpSetChart/types.js +2 -0
  44. package/cjs/UpSetChart/useUpSetChartSizes.d.ts +20 -0
  45. package/cjs/UpSetChart/useUpSetChartSizes.js +34 -0
  46. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.d.ts +1 -1
  47. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -1
  48. package/cjs/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +267 -0
  49. package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.d.ts +1 -2
  50. package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.js +1 -1
  51. package/cjs/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.test.js +5 -23
  52. package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.js +2 -2
  53. package/cjs/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.test.js +3 -23
  54. package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.js +2 -2
  55. package/cjs/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.test.js +81 -102
  56. package/cjs/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.d.ts +2 -2
  57. package/cjs/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.js +24 -2
  58. package/cjs/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.js +1 -1
  59. package/cjs/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.test.js +69 -48
  60. package/cjs/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.js +2 -2
  61. package/cjs/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.test.js +123 -107
  62. package/cjs/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.js +2 -2
  63. package/cjs/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.test.js +128 -115
  64. package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.js +1 -1
  65. package/cjs/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +160 -183
  66. package/cjs/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.js +2 -2
  67. package/cjs/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.test.js +44 -28
  68. package/cjs/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.js +4 -5
  69. package/cjs/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.test.js +54 -47
  70. package/cjs/features/activity-log/ActivityLog/ActivityLog.test.js +83 -22
  71. package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.js +1 -1
  72. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +784 -0
  73. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.d.ts +2 -3
  74. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.js +24 -2
  75. package/cjs/features/activity-log/CollapsibleActivityRecords/CollapsibleActivityRecords.test.js +102 -79
  76. package/cjs/features/activity-log/EntityObject/EntityObject.test.js +35 -26
  77. package/cjs/features/activity-log/Field/Field.d.ts +2 -3
  78. package/cjs/features/activity-log/Field/Field.js +24 -2
  79. package/cjs/features/activity-log/PotentialMatchRecord/PotentialMatchRecord.test.js +160 -34
  80. package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.js +1 -1
  81. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.test.js +207 -0
  82. package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +1 -1
  83. package/cjs/features/activity-log/RelationObject/RelationObject.test.js +46 -29
  84. package/cjs/features/activity-log/RelationRecord/RelationRecord.test.js +88 -68
  85. package/esm/UpSetChart/UpSetChart.d.ts +5 -8
  86. package/esm/UpSetChart/UpSetChart.js +38 -5
  87. package/esm/UpSetChart/UpSetChart.test.js +193 -0
  88. package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.d.ts +15 -0
  89. package/esm/UpSetChart/components/IntersectionsChart/IntersectionsChart.js +39 -0
  90. package/esm/UpSetChart/components/IntersectionsChart/index.d.ts +1 -0
  91. package/esm/UpSetChart/components/IntersectionsChart/index.js +1 -0
  92. package/esm/UpSetChart/components/IntersectionsChart/styles.d.ts +1 -0
  93. package/esm/UpSetChart/components/IntersectionsChart/styles.js +29 -0
  94. package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.d.ts +10 -0
  95. package/esm/UpSetChart/components/IntersectionsChartAxis/IntersectionsChartAxis.js +34 -0
  96. package/esm/UpSetChart/components/IntersectionsChartAxis/index.d.ts +1 -0
  97. package/esm/UpSetChart/components/IntersectionsChartAxis/index.js +1 -0
  98. package/esm/UpSetChart/components/IntersectionsChartAxis/styles.d.ts +1 -0
  99. package/esm/UpSetChart/components/IntersectionsChartAxis/styles.js +29 -0
  100. package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.d.ts +13 -0
  101. package/esm/UpSetChart/components/IntersectionsMatrix/IntersectionsMatrix.js +26 -0
  102. package/esm/UpSetChart/components/IntersectionsMatrix/index.d.ts +1 -0
  103. package/esm/UpSetChart/components/IntersectionsMatrix/index.js +1 -0
  104. package/esm/UpSetChart/components/IntersectionsMatrix/styles.d.ts +1 -0
  105. package/esm/UpSetChart/components/IntersectionsMatrix/styles.js +24 -0
  106. package/esm/UpSetChart/components/SetsChart/SetsChart.d.ts +15 -0
  107. package/esm/UpSetChart/components/SetsChart/SetsChart.js +31 -0
  108. package/esm/UpSetChart/components/SetsChart/index.d.ts +1 -0
  109. package/esm/UpSetChart/components/SetsChart/index.js +1 -0
  110. package/esm/UpSetChart/components/SetsChart/styles.d.ts +1 -0
  111. package/esm/UpSetChart/components/SetsChart/styles.js +40 -0
  112. package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.d.ts +6 -0
  113. package/esm/UpSetChart/components/SetsChartAxis/SetsChartAxis.js +13 -0
  114. package/esm/UpSetChart/components/SetsChartAxis/index.d.ts +1 -0
  115. package/esm/UpSetChart/components/SetsChartAxis/index.js +1 -0
  116. package/esm/UpSetChart/components/SetsChartAxis/styles.d.ts +1 -0
  117. package/esm/UpSetChart/components/SetsChartAxis/styles.js +14 -0
  118. package/esm/UpSetChart/constants.d.ts +16 -3
  119. package/esm/UpSetChart/constants.js +19 -3
  120. package/esm/UpSetChart/gameOfThrones.test-data.d.ts +4 -0
  121. package/esm/UpSetChart/gameOfThrones.test-data.js +23 -0
  122. package/esm/UpSetChart/helpers.d.ts +20 -0
  123. package/esm/UpSetChart/helpers.js +120 -0
  124. package/esm/UpSetChart/styles.d.ts +4 -1
  125. package/esm/UpSetChart/styles.js +11 -12
  126. package/esm/UpSetChart/types.d.ts +16 -0
  127. package/esm/UpSetChart/useUpSetChartSizes.d.ts +20 -0
  128. package/esm/UpSetChart/useUpSetChartSizes.js +30 -0
  129. package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.d.ts +1 -1
  130. package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.js +1 -1
  131. package/esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.js +262 -0
  132. package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.d.ts +1 -2
  133. package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.js +1 -1
  134. package/esm/features/activity-log/ActivitiesFactory/components/CommentActivity/CommentActivity.test.js +5 -23
  135. package/esm/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.js +2 -2
  136. package/esm/features/activity-log/ActivitiesFactory/components/GroupActivity/GroupActivity.test.js +3 -23
  137. package/esm/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.js +2 -2
  138. package/esm/features/activity-log/ActivitiesFactory/components/MergeActivity/MergeActivity.test.js +81 -102
  139. package/esm/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.d.ts +2 -2
  140. package/esm/features/activity-log/ActivitiesFactory/components/ObjectLabel/ObjectLabel.js +24 -2
  141. package/esm/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.js +1 -1
  142. package/esm/features/activity-log/ActivitiesFactory/components/PotentialMatchActivity/PotentialMatchActivity.test.js +69 -48
  143. package/esm/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.js +2 -2
  144. package/esm/features/activity-log/ActivitiesFactory/components/ProfileActivity/ProfileActivity.test.js +123 -107
  145. package/esm/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.js +2 -2
  146. package/esm/features/activity-log/ActivitiesFactory/components/RelationActivity/RelationActivity.test.js +128 -115
  147. package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.js +1 -1
  148. package/esm/features/activity-log/ActivitiesFactory/components/SearchActivity/SearchActivity.test.js +160 -183
  149. package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.js +2 -2
  150. package/esm/features/activity-log/ActivitiesFactory/components/SimpleActivity/SimpleActivity.test.js +44 -28
  151. package/esm/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.js +4 -5
  152. package/esm/features/activity-log/ActivitiesFactory/components/SynchronizationIssuesActivity/SynchronizationIssuesActivity.test.js +54 -47
  153. package/esm/features/activity-log/ActivityLog/ActivityLog.test.js +83 -22
  154. package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.js +1 -1
  155. package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.js +779 -0
  156. package/esm/features/activity-log/ActivityTitle/ActivityTitle.d.ts +2 -3
  157. package/esm/features/activity-log/ActivityTitle/ActivityTitle.js +24 -2
  158. package/esm/features/activity-log/CollapsibleActivityRecords/CollapsibleActivityRecords.test.js +104 -58
  159. package/esm/features/activity-log/EntityObject/EntityObject.test.js +35 -26
  160. package/esm/features/activity-log/Field/Field.d.ts +2 -3
  161. package/esm/features/activity-log/Field/Field.js +24 -2
  162. package/esm/features/activity-log/PotentialMatchRecord/PotentialMatchRecord.test.js +160 -34
  163. package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.js +1 -1
  164. package/esm/features/activity-log/RecordUpdates/RecordUpdates.test.js +202 -0
  165. package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.js +1 -1
  166. package/esm/features/activity-log/RelationObject/RelationObject.test.js +46 -29
  167. package/esm/features/activity-log/RelationRecord/RelationRecord.test.js +88 -68
  168. package/package.json +1 -1
  169. package/cjs/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +0 -142
  170. package/cjs/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.js +0 -131
  171. package/cjs/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.js +0 -252
  172. package/cjs/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.js +0 -158
  173. package/cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +0 -135
  174. package/cjs/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.js +0 -65
  175. package/cjs/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.js +0 -119
  176. package/cjs/features/activity-log/ActivityFilterEditor/editor.test-data.d.ts +0 -25
  177. package/cjs/features/activity-log/ActivityFilterEditor/editor.test-data.js +0 -75
  178. package/cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.js +0 -140
  179. package/cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +0 -41
  180. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.d.ts +0 -1
  181. package/cjs/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +0 -87
  182. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.test.d.ts +0 -1
  183. package/cjs/features/activity-log/ActivityTitle/ActivityTitle.test.js +0 -19
  184. package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.d.ts +0 -1
  185. package/cjs/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.js +0 -179
  186. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.specs.d.ts +0 -1
  187. package/cjs/features/activity-log/RecordUpdates/RecordUpdates.specs.js +0 -150
  188. package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.d.ts +0 -1
  189. package/cjs/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.js +0 -124
  190. package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.d.ts +0 -1
  191. package/esm/features/activity-log/ActivityExportButton/ActivityExportButton.specs.js +0 -137
  192. package/esm/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.d.ts +0 -1
  193. package/esm/features/activity-log/ActivityFilterButton/ActivityFilterButton.specs.js +0 -126
  194. package/esm/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.d.ts +0 -1
  195. package/esm/features/activity-log/ActivityFilterEditor/ActivityFilterEditor.specs.js +0 -247
  196. package/esm/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.d.ts +0 -1
  197. package/esm/features/activity-log/ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.js +0 -153
  198. package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.d.ts +0 -1
  199. package/esm/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.js +0 -130
  200. package/esm/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.d.ts +0 -1
  201. package/esm/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.js +0 -60
  202. package/esm/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.d.ts +0 -1
  203. package/esm/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.js +0 -114
  204. package/esm/features/activity-log/ActivityFilterEditor/editor.test-data.d.ts +0 -25
  205. package/esm/features/activity-log/ActivityFilterEditor/editor.test-data.js +0 -72
  206. package/esm/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.d.ts +0 -1
  207. package/esm/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.js +0 -135
  208. package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.d.ts +0 -1
  209. package/esm/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.js +0 -36
  210. package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.d.ts +0 -1
  211. package/esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.specs.js +0 -82
  212. package/esm/features/activity-log/ActivityTitle/ActivityTitle.test.d.ts +0 -1
  213. package/esm/features/activity-log/ActivityTitle/ActivityTitle.test.js +0 -14
  214. package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.d.ts +0 -1
  215. package/esm/features/activity-log/PotentialMatchRecord/components/PotentialMatchField/PotentialMatchField.test.js +0 -151
  216. package/esm/features/activity-log/RecordUpdates/RecordUpdates.specs.d.ts +0 -1
  217. package/esm/features/activity-log/RecordUpdates/RecordUpdates.specs.js +0 -122
  218. package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.d.ts +0 -1
  219. package/esm/features/activity-log/RecordUpdates/components/DeltaField/DeltaField.test.js +0 -119
  220. /package/cjs/{features/activity-log/ActivityExportButton/ActivityExportButton.specs.d.ts → UpSetChart/UpSetChart.test.d.ts} +0 -0
  221. /package/cjs/features/activity-log/{ActivityFilterButton/ActivityFilterButton.specs.d.ts → ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
  222. /package/cjs/features/activity-log/{ActivityFilterEditor/ActivityFilterEditor.specs.d.ts → ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
  223. /package/cjs/features/activity-log/{ActivityFilterEditor/components/ActivitySelector/ActivitySelector.specs.d.ts → RecordUpdates/RecordUpdates.test.d.ts} +0 -0
  224. /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityChangedSelectors/EntityChangedSelectors.specs.d.ts → esm/UpSetChart/UpSetChart.test.d.ts} +0 -0
  225. /package/{cjs/features/activity-log/ActivityFilterEditor/components/EntityTypesSelector/EntityTypesSelector.specs.d.ts → esm/UpSetChart/types.js} +0 -0
  226. /package/{cjs/features/activity-log/ActivityFilterEditor/components/SourceSelector/SourceSelector.specs.d.ts → esm/features/activity-log/ActivitiesFactory/ActivitiesFactory.test.d.ts} +0 -0
  227. /package/{cjs/features/activity-log/ActivityLog/components/ActivityItem/ActivityItem.test.d.ts → esm/features/activity-log/ActivityLogFilter/ActivityLogFilter.test.d.ts} +0 -0
  228. /package/{cjs/features/activity-log/ActivityLog/components/GroupItem/GroupItem.test.d.ts → esm/features/activity-log/RecordUpdates/RecordUpdates.test.d.ts} +0 -0
@@ -0,0 +1,207 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ var __importDefault = (this && this.__importDefault) || function (mod) {
50
+ return (mod && mod.__esModule) ? mod : { "default": mod };
51
+ };
52
+ Object.defineProperty(exports, "__esModule", { value: true });
53
+ var react_1 = __importDefault(require("react"));
54
+ var react_2 = require("@testing-library/react");
55
+ var user_event_1 = __importDefault(require("@testing-library/user-event"));
56
+ var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
57
+ var CollapsibleItemsContext_1 = require("../contexts/CollapsibleItemsContext");
58
+ var RecordUpdates_1 = require("./RecordUpdates");
59
+ var defaultUpdates = [
60
+ {
61
+ type: 'ATTRIBUTE_CHANGED',
62
+ attributeType: 'configuration/entityTypes/HCP/attributes/TextField',
63
+ newValue: { value: 'new text field value', ov: true, id: '3UIcE257b', sources: ['Reltio'] },
64
+ oldValue: { value: 'old text field value', ov: true, id: '3UIcE257b', sources: ['Reltio'] }
65
+ },
66
+ {
67
+ type: 'ATTRIBUTE_ADDED',
68
+ attributeType: 'configuration/entityTypes/HCP/attributes/FirstName',
69
+ newValue: { value: 'added first name value', ov: true, id: 'hsJ2b41', sources: ['Reltio'] }
70
+ },
71
+ {
72
+ type: 'ATTRIBUTE_REMOVED',
73
+ attributeType: 'configuration/entityTypes/HCP/attributes/LastName',
74
+ oldValue: { value: 'removed last name value', ov: true, id: 'Js23Ma09Ui', sources: ['Reltio'] }
75
+ },
76
+ {
77
+ type: 'ATTRIBUTE_CHANGED',
78
+ attributeType: 'configuration/entityTypes/HCP/attributes/Double',
79
+ newValue: { value: '1234.56789', ov: true, id: '83Ks3pOl2', sources: ['Reltio'] },
80
+ oldValue: { value: '98765.4321', ov: true, id: '83Ks3pOl2', sources: ['Reltio'] }
81
+ },
82
+ {
83
+ type: 'ATTRIBUTE_CHANGED',
84
+ attributeType: 'configuration/entityTypes/HCP/attributes/Boolean',
85
+ newValue: { value: 'true', ov: true, id: '3UIcE257b', sources: ['Reltio'] },
86
+ oldValue: { value: 'false', ov: true, id: '3UIcE257b', sources: ['Reltio'] }
87
+ }
88
+ ];
89
+ var defaultProps = {
90
+ recordId: 'record-id',
91
+ updates: defaultUpdates
92
+ };
93
+ var defaultMdmValues = {
94
+ metadata: {
95
+ entityTypes: [
96
+ {
97
+ uri: 'configuration/entityTypes/HCP',
98
+ label: 'HCP',
99
+ attributes: [
100
+ {
101
+ label: 'String',
102
+ name: 'TextField',
103
+ type: 'String',
104
+ uri: 'configuration/entityTypes/HCP/attributes/TextField'
105
+ },
106
+ {
107
+ label: 'First Name',
108
+ name: 'FirstName',
109
+ type: 'String',
110
+ uri: 'configuration/entityTypes/HCP/attributes/FirstName'
111
+ },
112
+ {
113
+ label: 'Last Name',
114
+ name: 'LastName',
115
+ type: 'String',
116
+ uri: 'configuration/entityTypes/HCP/attributes/LastName'
117
+ },
118
+ {
119
+ label: 'Double',
120
+ name: 'Double',
121
+ type: 'Double',
122
+ uri: 'configuration/entityTypes/HCP/attributes/Double'
123
+ },
124
+ {
125
+ label: 'Boolean',
126
+ name: 'Boolean',
127
+ type: 'Boolean',
128
+ uri: 'configuration/entityTypes/HCP/attributes/Boolean'
129
+ }
130
+ ]
131
+ }
132
+ ]
133
+ },
134
+ attributesPresentation: {
135
+ 'configuration/entityTypes/HCP/attributes/Double': {
136
+ thousandSeparator: '-',
137
+ decimalSeparator: '^',
138
+ prefix: '[',
139
+ suffix: ']'
140
+ }
141
+ }
142
+ };
143
+ var setUp = function (_a) {
144
+ var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
145
+ var user = user_event_1.default.setup();
146
+ var Providers = function (_a) {
147
+ var children = _a.children;
148
+ return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
149
+ react_1.default.createElement(CollapsibleItemsContext_1.CollapsibleItemsProvider, null, children)));
150
+ };
151
+ return __assign(__assign({}, (0, react_2.render)(react_1.default.createElement(RecordUpdates_1.RecordUpdates, __assign({}, props)), { wrapper: Providers })), { user: user });
152
+ };
153
+ describe('Record updates tests', function () {
154
+ it('should not render anything if items empty', function () {
155
+ var props = __assign(__assign({}, defaultProps), { updates: [] });
156
+ var container = setUp({ props: props }).container;
157
+ expect(container).toBeEmptyDOMElement();
158
+ });
159
+ it('should render and expand items correctly', function () { return __awaiter(void 0, void 0, void 0, function () {
160
+ var user, deltaFields;
161
+ return __generator(this, function (_a) {
162
+ switch (_a.label) {
163
+ case 0:
164
+ user = setUp().user;
165
+ deltaFields = react_2.screen.getAllByTestId('delta-field');
166
+ expect(deltaFields).toHaveLength(3);
167
+ expect(deltaFields[0]).toHaveTextContent('String:');
168
+ expect(deltaFields[0]).toHaveTextContent('old text field value');
169
+ expect(deltaFields[0]).toHaveTextContent('new text field value');
170
+ expect(deltaFields[0]).toHaveTextContent('edited');
171
+ expect(deltaFields[1]).toHaveTextContent('First Name:');
172
+ expect(deltaFields[1]).toHaveTextContent('added first name value');
173
+ expect(deltaFields[1]).toHaveTextContent('added');
174
+ expect(deltaFields[2]).toHaveTextContent('Last Name:');
175
+ expect(deltaFields[2]).toHaveTextContent('removed last name value');
176
+ expect(deltaFields[2]).toHaveTextContent('deleted');
177
+ return [4 /*yield*/, user.click(react_2.screen.getByRole('button', { name: '2 more updates' }))];
178
+ case 1:
179
+ _a.sent();
180
+ deltaFields = react_2.screen.getAllByTestId('delta-field');
181
+ expect(deltaFields).toHaveLength(5);
182
+ expect(deltaFields[3]).toHaveTextContent('Double:');
183
+ expect(deltaFields[3]).toHaveTextContent('[98-765^4321]');
184
+ expect(deltaFields[3]).toHaveTextContent('[1-234^56789]');
185
+ expect(deltaFields[3]).toHaveTextContent('edited');
186
+ expect(deltaFields[4]).toHaveTextContent('Boolean:');
187
+ expect(deltaFields[4]).toHaveTextContent('No');
188
+ expect(deltaFields[4]).toHaveTextContent('Yes');
189
+ expect(deltaFields[4]).toHaveTextContent('edited');
190
+ expect(react_2.screen.queryByRole('button')).not.toBeInTheDocument();
191
+ return [2 /*return*/];
192
+ }
193
+ });
194
+ }); });
195
+ it('should not render more items link if updates count is 3 or less', function () {
196
+ var props = __assign(__assign({}, defaultProps), { updates: defaultUpdates.slice(0, 3) });
197
+ setUp({ props: props });
198
+ expect(react_2.screen.getAllByTestId('delta-field')).toHaveLength(3);
199
+ expect(react_2.screen.queryByRole('button')).not.toBeInTheDocument();
200
+ });
201
+ it('should render more items link correctly if updates count is 4', function () {
202
+ var props = __assign(__assign({}, defaultProps), { updates: defaultUpdates.slice(0, 4) });
203
+ setUp({ props: props });
204
+ expect(react_2.screen.getAllByTestId('delta-field')).toHaveLength(3);
205
+ react_2.screen.getByRole('button', { name: '1 more update' });
206
+ });
207
+ });
@@ -28,7 +28,7 @@ var DeltaField = function (_a) {
28
28
  var converter = function (value) {
29
29
  return (0, activities_1.stringifyDeltaValue)(value, delta.attributeType, metadata, attributesPresentation);
30
30
  };
31
- return (react_1.default.createElement(Field_1.Field, { fieldName: (attribute === null || attribute === void 0 ? void 0 : attribute.label) || (attribute === null || attribute === void 0 ? void 0 : attribute.name) },
31
+ return (react_1.default.createElement(Field_1.Field, { fieldName: (attribute === null || attribute === void 0 ? void 0 : attribute.label) || (attribute === null || attribute === void 0 ? void 0 : attribute.name), "data-reltio-id": "delta-field" },
32
32
  react_1.default.createElement("span", null,
33
33
  value && converter(value),
34
34
  newValue && oldValue && (react_1.default.createElement(react_1.default.Fragment, null,
@@ -1,39 +1,56 @@
1
1
  "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
2
13
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
14
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
15
  };
5
16
  Object.defineProperty(exports, "__esModule", { value: true });
6
17
  var react_1 = __importDefault(require("react"));
7
- var enzyme_1 = require("enzyme");
18
+ var react_2 = require("@testing-library/react");
19
+ var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
20
+ var types_1 = require("../types");
8
21
  var RelationObject_1 = require("./RelationObject");
9
- describe('RelationObject tests', function () {
22
+ var defaultItem = {
23
+ id: '3vJgNLSN',
24
+ timestamp: 1621847085259,
25
+ objectUri: 'relations/edEnRRW',
26
+ objectType: 'configuration/relationTypes/HasAddress',
27
+ startObjectUri: 'entities/sOoSQYm',
28
+ startObjectLabel: 'start object label',
29
+ endObjectUri: 'entities/1BVkicLG',
30
+ endObjectLabel: 'end object label',
31
+ data: { type: types_1.ActivityTypes.RELATIONSHIP_CHANGED }
32
+ };
33
+ var defaultProps = {
34
+ item: defaultItem
35
+ };
36
+ var defaultMdmValues = {
37
+ uiPath: 'https://reltio.com/nui'
38
+ };
39
+ var setUp = function (_a) {
40
+ var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
41
+ var Providers = function (_a) {
42
+ var children = _a.children;
43
+ return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues }, children));
44
+ };
45
+ return (0, react_2.render)(react_1.default.createElement(RelationObject_1.RelationObject, __assign({}, props)), { wrapper: Providers });
46
+ };
47
+ describe('Relation object tests', function () {
10
48
  it('should render correctly', function () {
11
- var relationItem = {
12
- id: '3vJgNLSN',
13
- user: 'egorshkov',
14
- method: 'POST',
15
- url: '/reltio/api/alenat/entities/sOoSQYm/_update',
16
- clientType: 'Reltio UI',
17
- timestamp: 1621847085259,
18
- objectUri: 'relations/edEnRRW',
19
- objectType: 'configuration/relationTypes/HasAddress',
20
- startObjectUri: 'entities/sOoSQYm',
21
- startObjectLabel: '- cBtCASwtAeEbTxe Agacati',
22
- endObjectUri: 'entities/1BVkicLG',
23
- endObjectLabel: 'cBtCASwtAeEbTxe Agacati Nash',
24
- data: {
25
- type: 'RELATIONSHIP_CHANGED'
26
- },
27
- eventId: '1621847085259_00qpSyx'
28
- };
29
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(RelationObject_1.RelationObject, { item: relationItem }));
30
- var startObjectUri = relationItem.startObjectUri, startObjectLabel = relationItem.startObjectLabel, endObjectUri = relationItem.endObjectUri, endObjectLabel = relationItem.endObjectLabel;
31
- expect(wrapper.find('.delimiter').length).toBe(1);
32
- var links = wrapper.find('EntityUriLink');
33
- expect(links.length).toBe(2);
34
- expect(links.at(0).prop('value')).toBe(startObjectUri);
35
- expect(links.at(0).text()).toBe(startObjectLabel);
36
- expect(links.at(1).prop('value')).toBe(endObjectUri);
37
- expect(links.at(1).text()).toBe(endObjectLabel);
49
+ setUp();
50
+ var links = react_2.screen.getAllByRole('link');
51
+ expect(links[0]).toHaveTextContent('start object label');
52
+ expect(links[0]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/sOoSQYm');
53
+ expect(links[1]).toHaveTextContent('end object label');
54
+ expect(links[1]).toHaveAttribute('href', 'https://reltio.com/nui#p~com.reltio.plugins.entity.default.DefaultPerspective_e~entities/1BVkicLG');
38
55
  });
39
56
  });
@@ -15,79 +15,99 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  var react_1 = __importDefault(require("react"));
18
- var enzyme_1 = require("enzyme");
18
+ var react_2 = require("@testing-library/react");
19
+ var MdmModuleContext_1 = require("../../../contexts/MdmModuleContext");
20
+ var CollapsibleItemsContext_1 = require("../contexts/CollapsibleItemsContext");
21
+ var types_1 = require("../types");
19
22
  var RelationRecord_1 = require("./RelationRecord");
20
- describe('RelationRecord tests', function () {
21
- var deltaCollection = {
22
- ovChanged: true,
23
- delta: [
24
- {
25
- type: 'ATTRIBUTE_CHANGED',
26
- attributeType: 'configuration/entityTypes/HCP/attributes/TextField',
27
- newValue: {
28
- value: 'Str31',
29
- ov: true,
30
- id: '3UIcE257b',
31
- sources: ['Reltio']
32
- },
33
- oldValue: {
34
- value: 'Str1',
35
- ov: true,
36
- id: '3UIcE257b',
37
- sources: ['Reltio']
38
- }
39
- },
40
- {
41
- type: 'ATTRIBUTE_ADDED',
42
- attributeType: 'configuration/entityTypes/HCP/attributes/TestField',
43
- newValue: {
44
- value: 'Test',
45
- ov: true,
46
- id: '3UIcE257b',
47
- sources: ['Reltio']
48
- }
49
- },
23
+ var defaultDeltaCollection = {
24
+ ovChanged: true,
25
+ delta: [
26
+ {
27
+ type: 'ATTRIBUTE_CHANGED',
28
+ attributeType: 'configuration/relationTypes/HasAddress/attributes/TextField',
29
+ newValue: { value: 'new value', ov: true, id: '3UIcE257b', sources: ['Reltio'] },
30
+ oldValue: { value: 'old value', ov: true, id: '3UIcE257b', sources: ['Reltio'] }
31
+ },
32
+ {
33
+ type: 'ATTRIBUTE_ADDED',
34
+ attributeType: 'configuration/relationTypes/HasAddress/attributes/TextField',
35
+ newValue: { value: 'added value', ov: true, id: 'Sdj23PaS', sources: ['Reltio'] }
36
+ },
37
+ {
38
+ type: 'ATTRIBUTE_REMOVED',
39
+ attributeType: 'configuration/relationTypes/HasAddress/attributes/TextField',
40
+ oldValue: { value: 'removed value', ov: true, id: '9m2Nsm3Pa', sources: ['Reltio'] }
41
+ }
42
+ ]
43
+ };
44
+ var defaultItem = {
45
+ id: '3vJgNLSN',
46
+ timestamp: 1621847085259,
47
+ objectUri: 'relations/edEnRRW',
48
+ objectType: 'configuration/relationTypes/HasAddress',
49
+ startObjectUri: 'entities/sOoSQYm',
50
+ startObjectLabel: 'start object label',
51
+ endObjectUri: 'entities/1BVkicLG',
52
+ endObjectLabel: 'end object label',
53
+ data: { type: types_1.ActivityTypes.RELATIONSHIP_CHANGED },
54
+ deltaCollection: defaultDeltaCollection
55
+ };
56
+ var defaultProps = {
57
+ item: defaultItem
58
+ };
59
+ var defaultMdmValues = {
60
+ metadata: {
61
+ entityTypes: [
50
62
  {
51
- type: 'ATTRIBUTE_REMOVED',
52
- attributeType: 'configuration/entityTypes/HCP/attributes/TestField2',
53
- oldValue: {
54
- value: 'Test2',
55
- ov: true,
56
- id: '3UIcE257b',
57
- sources: ['Reltio']
58
- }
63
+ uri: 'configuration/relationTypes/HasAddress',
64
+ label: 'Has address',
65
+ attributes: [
66
+ {
67
+ label: 'String',
68
+ name: 'TextField',
69
+ type: 'String',
70
+ uri: 'configuration/relationTypes/HasAddress/attributes/TextField'
71
+ }
72
+ ]
59
73
  }
60
74
  ]
75
+ },
76
+ uiPath: 'https://reltio.com/nui'
77
+ };
78
+ var setUp = function (_a) {
79
+ var _b = _a === void 0 ? {} : _a, _c = _b.props, props = _c === void 0 ? defaultProps : _c, _d = _b.mdmValues, mdmValues = _d === void 0 ? defaultMdmValues : _d;
80
+ var Providers = function (_a) {
81
+ var children = _a.children;
82
+ return (react_1.default.createElement(MdmModuleContext_1.MdmModuleProvider, { values: mdmValues },
83
+ react_1.default.createElement(CollapsibleItemsContext_1.CollapsibleItemsProvider, null, children)));
61
84
  };
62
- var emptyDeltaCollection = {
63
- ovChanged: false,
64
- delta: undefined
65
- };
66
- var wrapperItem = {
67
- id: '30Y8UsZr',
68
- user: 'alexander.kirsanov',
69
- method: 'PUT',
70
- url: '/reltio/api/alenat/entities/k5nO0xA/attributes/TextField/3UIcE257b',
71
- clientType: 'Reltio UI',
72
- timestamp: 1622096971385,
73
- objectUri: 'entities/k5nO0xA',
74
- objectType: 'configuration/entityTypes/HCP',
75
- objectLabel: 'BulkUpdate_regression_3 Label_test_Long_label_test_long_long_long_long_long - RelationTableViewss - New Address for HCP_Bulk_Update with long_label Londomir',
76
- data: {
77
- type: 'ENTITY_CHANGED'
78
- },
79
- deltaCollection: deltaCollection,
80
- eventId: '1622096971385_03DVkNW'
81
- };
85
+ return (0, react_2.render)(react_1.default.createElement(RelationRecord_1.RelationRecord, __assign({}, props)), { wrapper: Providers });
86
+ };
87
+ describe('Relation record tests', function () {
82
88
  it('should render correctly', function () {
83
- var wrapper = (0, enzyme_1.shallow)(react_1.default.createElement(RelationRecord_1.RelationRecord, { item: wrapperItem }));
84
- expect(wrapper.find('RecordLabel').prop('description')).toBe('');
85
- expect(wrapper.find('RelationObject').length).toBe(1);
86
- expect(wrapper.find('RecordUpdates').length).toBe(1);
87
- expect(wrapper.find('RecordUpdates').prop('updates')).toEqual(wrapperItem.deltaCollection.delta);
88
- wrapper.setProps({ item: __assign(__assign({}, wrapperItem), { deltaCollection: emptyDeltaCollection }) });
89
- expect(wrapper.find('RecordLabel').prop('description')).toBe('Relationship updated');
90
- expect(wrapper.find('RelationObject').length).toBe(1);
91
- expect(wrapper.find('RecordUpdates').prop('updates')).toEqual(emptyDeltaCollection.delta);
89
+ setUp();
90
+ expect(react_2.screen.queryByText('Relationship updated')).not.toBeInTheDocument();
91
+ react_2.screen.getByText('start object label');
92
+ react_2.screen.getByText('end object label');
93
+ var deltaFields = react_2.screen.getAllByTestId('delta-field');
94
+ expect(deltaFields[0]).toHaveTextContent('String:');
95
+ expect(deltaFields[0]).toHaveTextContent('old value');
96
+ expect(deltaFields[0]).toHaveTextContent('new value');
97
+ expect(deltaFields[0]).toHaveTextContent('edited');
98
+ expect(deltaFields[1]).toHaveTextContent('String:');
99
+ expect(deltaFields[1]).toHaveTextContent('added value');
100
+ expect(deltaFields[1]).toHaveTextContent('added');
101
+ expect(deltaFields[2]).toHaveTextContent('String:');
102
+ expect(deltaFields[2]).toHaveTextContent('removed value');
103
+ expect(deltaFields[2]).toHaveTextContent('deleted');
104
+ });
105
+ it('should render correctly without delta', function () {
106
+ var props = __assign(__assign({}, defaultProps), { item: __assign(__assign({}, defaultItem), { deltaCollection: undefined }) });
107
+ setUp({ props: props });
108
+ react_2.screen.getByText('Relationship updated');
109
+ react_2.screen.getByText('start object label');
110
+ react_2.screen.getByText('end object label');
111
+ expect(react_2.screen.queryByTestId('delta-field')).not.toBeInTheDocument();
92
112
  });
93
113
  });
@@ -1,12 +1,9 @@
1
1
  import React from 'react';
2
- type DataItem = {
3
- name: string;
4
- sets: string[];
5
- };
2
+ import { UpSetChartData } from './types';
6
3
  type Props = {
7
- width: number;
8
- height: number;
9
- data: DataItem[];
4
+ data: UpSetChartData;
5
+ width?: number;
6
+ height?: number;
10
7
  };
11
- export declare const UpSetChart: ({ width, height, data }: Props) => React.JSX.Element;
8
+ export declare const UpSetChart: ({ data, width, height }: Props) => React.JSX.Element;
12
9
  export {};
@@ -1,7 +1,40 @@
1
- import React from 'react';
1
+ import React, { useEffect, useMemo, useRef, useState } from 'react';
2
+ import { scaleBand } from 'd3-scale';
3
+ import Tooltip from '@mui/material/Tooltip';
4
+ import { SetsChart } from './components/SetsChart';
5
+ import { IntersectionsMatrix } from './components/IntersectionsMatrix';
6
+ import { IntersectionsChart } from './components/IntersectionsChart';
7
+ import { useUpSetChartSizes } from './useUpSetChartSizes';
8
+ import { GAP_BEFORE_LEFT_BAR, TOP_GAP } from './constants';
9
+ import { findIntersections } from './helpers';
10
+ import { useStyles } from './styles';
2
11
  export var UpSetChart = function (_a) {
3
- var width = _a.width, height = _a.height, data = _a.data;
4
- if (!width || !height || !data)
5
- return null;
6
- return React.createElement("div", null, "UpSet");
12
+ var data = _a.data, width = _a.width, height = _a.height;
13
+ var styles = useStyles({ width: width, height: height });
14
+ var containerRef = useRef(null);
15
+ var _b = useState(null), hoveredSet = _b[0], setHoveredSet = _b[1];
16
+ var _c = useState(null), hoveredIntersection = _c[0], setHoveredIntersection = _c[1];
17
+ var _d = useState([width, height]), _e = _d[0], availableWidth = _e[0], availableHeight = _e[1], setAvailableSize = _d[1];
18
+ var _f = useMemo(function () { return findIntersections(data); }, [data]), intersections = _f.intersections, sets = _f.sets;
19
+ var hoveredElements = (hoveredIntersection === null || hoveredIntersection === void 0 ? void 0 : hoveredIntersection.elements) || (hoveredSet === null || hoveredSet === void 0 ? void 0 : hoveredSet.elements);
20
+ var tooltipTitle = hoveredIntersection === null || hoveredIntersection === void 0 ? void 0 : hoveredIntersection.sets.join(' ∩ ');
21
+ var _g = useUpSetChartSizes({ width: availableWidth, height: availableHeight, intersections: intersections, sets: sets }), labels = _g.labels, svgWidth = _g.svgWidth, svgHeight = _g.svgHeight, intersectionsChartWidth = _g.intersectionsChartWidth, intersectionsChartHeight = _g.intersectionsChartHeight, matrixY = _g.matrixY, matrixHeight = _g.matrixHeight, setsChartWidth = _g.setsChartWidth, leftPadding = _g.leftPadding;
22
+ var matrixXScale = useMemo(function () {
23
+ var domain = intersections.map(function (_, i) { return String(i); });
24
+ return scaleBand([0, intersectionsChartWidth]).domain(domain).paddingInner(0.2);
25
+ }, [intersections, intersectionsChartWidth]);
26
+ var matrixYScale = useMemo(function () {
27
+ var domain = sets.map(function (set) { return set.name; });
28
+ return scaleBand([0, matrixHeight]).domain(domain);
29
+ }, [sets, matrixHeight]);
30
+ useEffect(function () {
31
+ var _a = containerRef.current || {}, clientWidth = _a.clientWidth, clientHeight = _a.clientHeight;
32
+ setAvailableSize([clientWidth || width, clientHeight || height]);
33
+ }, [width, height]);
34
+ return (React.createElement("div", { ref: containerRef, className: styles.wrapper },
35
+ React.createElement(Tooltip, { title: tooltipTitle, followCursor: true },
36
+ React.createElement("svg", { className: styles.svg, width: svgWidth, height: svgHeight },
37
+ React.createElement(IntersectionsMatrix, { xScale: matrixXScale, yScale: matrixYScale, intersections: intersections, sets: sets, transform: "translate(".concat(leftPadding, ",").concat(matrixY, ")"), hoveredIntersection: hoveredIntersection }),
38
+ React.createElement(SetsChart, { yScale: matrixYScale, width: setsChartWidth, sets: sets, labels: labels, hoveredElements: hoveredElements, hoverAreaWidth: svgWidth, transform: "translate(".concat(GAP_BEFORE_LEFT_BAR, ",").concat(matrixY, ")"), onSetHover: setHoveredSet }),
39
+ React.createElement(IntersectionsChart, { xScale: matrixXScale, width: intersectionsChartWidth, height: intersectionsChartHeight, intersections: intersections, highlightedElements: hoveredElements, transform: "translate(".concat(leftPadding, ",").concat(TOP_GAP, ")"), matrixHeight: matrixHeight, onIntersectionHover: setHoveredIntersection })))));
7
40
  };