@gen3/frontend 0.10.73 → 0.10.75

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 (250) hide show
  1. package/dist/cjs/index.js +229 -173
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.d.ts +1 -0
  4. package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.d.ts.map +1 -1
  5. package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.js +3 -3
  6. package/dist/dts/components/Buttons/DownloadButtons/JSONObjectDownloadButton.js.map +1 -1
  7. package/dist/dts/components/Buttons/UploadJSONButton.js +1 -1
  8. package/dist/dts/components/Buttons/UploadJSONButton.js.map +1 -1
  9. package/dist/dts/components/Content/TextContent.d.ts +1 -2
  10. package/dist/dts/components/Content/TextContent.d.ts.map +1 -1
  11. package/dist/dts/components/Content/TextContent.js +5 -8
  12. package/dist/dts/components/Content/TextContent.js.map +1 -1
  13. package/dist/dts/components/CountButton/CountButton.d.ts +19 -0
  14. package/dist/dts/components/CountButton/CountButton.d.ts.map +1 -0
  15. package/dist/dts/components/CountButton/CountButton.js +18 -0
  16. package/dist/dts/components/CountButton/CountButton.js.map +1 -0
  17. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.d.ts +8 -12
  18. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.d.ts.map +1 -1
  19. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.js +17 -11
  20. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.js.map +1 -1
  21. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.unit.test.js +18 -4
  22. package/dist/dts/components/DropdownWithIcon/DropdownWithIcon.unit.test.js.map +1 -1
  23. package/dist/dts/components/ErrorMessage.d.ts +6 -0
  24. package/dist/dts/components/ErrorMessage.d.ts.map +1 -0
  25. package/dist/dts/components/ErrorMessage.js +8 -0
  26. package/dist/dts/components/ErrorMessage.js.map +1 -0
  27. package/dist/dts/components/Login/LoginProvidersPanel.d.ts.map +1 -1
  28. package/dist/dts/components/Login/LoginProvidersPanel.js +5 -8
  29. package/dist/dts/components/Login/LoginProvidersPanel.js.map +1 -1
  30. package/dist/dts/components/MessageCards/ErrorCard.js +1 -1
  31. package/dist/dts/components/MessageCards/ErrorCard.js.map +1 -1
  32. package/dist/dts/components/MessageCards/WarningCard.js +1 -1
  33. package/dist/dts/components/MessageCards/WarningCard.js.map +1 -1
  34. package/dist/dts/components/MessagePanel.d.ts.map +1 -1
  35. package/dist/dts/components/MessagePanel.js +1 -1
  36. package/dist/dts/components/MessagePanel.js.map +1 -1
  37. package/dist/dts/components/Providers/Gen3Provider.d.ts +3 -2
  38. package/dist/dts/components/Providers/Gen3Provider.d.ts.map +1 -1
  39. package/dist/dts/components/Providers/Gen3Provider.js +8 -4
  40. package/dist/dts/components/Providers/Gen3Provider.js.map +1 -1
  41. package/dist/dts/components/Providers/ResourceMonitor.d.ts +1 -1
  42. package/dist/dts/components/Providers/ResourceMonitor.d.ts.map +1 -1
  43. package/dist/dts/components/Providers/ResourceMonitor.js +48 -131
  44. package/dist/dts/components/Providers/ResourceMonitor.js.map +1 -1
  45. package/dist/dts/components/charts/echarts/BarChart.d.ts.map +1 -1
  46. package/dist/dts/components/charts/echarts/BarChart.js +28 -4
  47. package/dist/dts/components/charts/echarts/BarChart.js.map +1 -1
  48. package/dist/dts/components/facets/FacetControlsHeader.d.ts.map +1 -1
  49. package/dist/dts/components/facets/FacetControlsHeader.js +0 -1
  50. package/dist/dts/components/facets/FacetControlsHeader.js.map +1 -1
  51. package/dist/dts/features/CohortBuilder/CohortBuilder.d.ts +1 -0
  52. package/dist/dts/features/CohortBuilder/CohortBuilder.d.ts.map +1 -1
  53. package/dist/dts/features/CohortBuilder/CohortBuilder.js +13 -1
  54. package/dist/dts/features/CohortBuilder/CohortBuilder.js.map +1 -1
  55. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.d.ts +10 -0
  56. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.d.ts.map +1 -0
  57. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.js +53 -0
  58. package/dist/dts/features/CohortBuilder/CohortManager/CohortActions.js.map +1 -0
  59. package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.d.ts +7 -0
  60. package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.d.ts.map +1 -0
  61. package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.js +38 -0
  62. package/dist/dts/features/CohortBuilder/CohortManager/CohortManager.js.map +1 -0
  63. package/dist/dts/features/CohortBuilder/{CohortSelector.d.ts → CohortManager/CohortSelector.d.ts} +4 -1
  64. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.d.ts.map +1 -0
  65. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.js +56 -0
  66. package/dist/dts/features/CohortBuilder/CohortManager/CohortSelector.js.map +1 -0
  67. package/dist/dts/features/CohortBuilder/CohortManager/cohortUtils.d.ts +4 -0
  68. package/dist/dts/features/CohortBuilder/CohortManager/cohortUtils.d.ts.map +1 -0
  69. package/dist/dts/features/CohortBuilder/CohortManager/cohortUtils.js +22 -0
  70. package/dist/dts/features/CohortBuilder/CohortManager/cohortUtils.js.map +1 -0
  71. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.d.ts +1 -0
  72. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.d.ts.map +1 -0
  73. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.js +320 -0
  74. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveCohortModal.js.map +1 -0
  75. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveModal.d.ts +1 -0
  76. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveModal.d.ts.map +1 -0
  77. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveModal.js +2 -0
  78. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveModal.js.map +1 -0
  79. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.d.ts +29 -0
  80. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.d.ts.map +1 -0
  81. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js +85 -0
  82. package/dist/dts/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.js.map +1 -0
  83. package/dist/dts/features/CohortBuilder/CohortPanel.d.ts.map +1 -1
  84. package/dist/dts/features/CohortBuilder/CohortPanel.js +3 -2
  85. package/dist/dts/features/CohortBuilder/CohortPanel.js.map +1 -1
  86. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.d.ts +6 -0
  87. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.d.ts.map +1 -0
  88. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.js +55 -0
  89. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpression.js.map +1 -0
  90. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.d.ts +13 -0
  91. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.d.ts.map +1 -0
  92. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.js +41 -0
  93. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionContext.js.map +1 -0
  94. package/dist/dts/features/CohortBuilder/{QueryExpressionSection.d.ts → QueryExpression/QueryExpressionSection.d.ts} +1 -4
  95. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.d.ts.map +1 -0
  96. package/dist/dts/features/CohortBuilder/{QueryExpressionSection.js → QueryExpression/QueryExpressionSection.js} +36 -28
  97. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionSection.js.map +1 -0
  98. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionsExpandedContext.d.ts.map +1 -0
  99. package/dist/dts/features/CohortBuilder/QueryExpression/QueryExpressionsExpandedContext.js.map +1 -0
  100. package/dist/dts/features/CohortBuilder/{QueryRepresentation.d.ts → QueryExpression/QueryRepresentation.d.ts} +1 -1
  101. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.d.ts.map +1 -0
  102. package/dist/dts/features/CohortBuilder/{QueryRepresentation.js → QueryExpression/QueryRepresentation.js} +23 -30
  103. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentation.js.map +1 -0
  104. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentationLabel.d.ts.map +1 -0
  105. package/dist/dts/features/CohortBuilder/QueryExpression/QueryRepresentationLabel.js.map +1 -0
  106. package/dist/dts/features/CohortBuilder/cohortUtils.d.ts +4 -0
  107. package/dist/dts/features/CohortBuilder/cohortUtils.d.ts.map +1 -0
  108. package/dist/dts/features/CohortBuilder/cohortUtils.js +23 -0
  109. package/dist/dts/features/CohortBuilder/cohortUtils.js.map +1 -0
  110. package/dist/dts/features/CohortBuilder/hooks.d.ts +1 -0
  111. package/dist/dts/features/CohortBuilder/hooks.d.ts.map +1 -1
  112. package/dist/dts/features/CohortBuilder/hooks.js +52 -1
  113. package/dist/dts/features/CohortBuilder/hooks.js.map +1 -1
  114. package/dist/dts/features/CohortBuilder/style.d.ts +6 -0
  115. package/dist/dts/features/CohortBuilder/style.d.ts.map +1 -1
  116. package/dist/dts/features/CohortBuilder/style.js +11 -0
  117. package/dist/dts/features/CohortBuilder/style.js.map +1 -1
  118. package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.d.ts.map +1 -1
  119. package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.js +6 -4
  120. package/dist/dts/features/CohortDiscovery/ChartsAndFacetsPanel.js.map +1 -1
  121. package/dist/dts/features/CohortDiscovery/CohortManager.d.ts.map +1 -0
  122. package/dist/dts/features/CohortDiscovery/CohortManager.js +57 -0
  123. package/dist/dts/features/CohortDiscovery/CohortManager.js.map +1 -0
  124. package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts +23 -0
  125. package/dist/dts/features/CohortDiscovery/CohortSelectors.d.ts.map +1 -0
  126. package/dist/dts/features/CohortDiscovery/CohortSelectors.js +35 -0
  127. package/dist/dts/features/CohortDiscovery/CohortSelectors.js.map +1 -0
  128. package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts +91 -0
  129. package/dist/dts/features/CohortDiscovery/CohortSlice.d.ts.map +1 -0
  130. package/dist/dts/features/CohortDiscovery/CohortSlice.js +93 -0
  131. package/dist/dts/features/CohortDiscovery/CohortSlice.js.map +1 -0
  132. package/dist/dts/features/CohortDiscovery/FilterPanels/createFacetPanel.d.ts.map +1 -1
  133. package/dist/dts/features/CohortDiscovery/IndexPanel.d.ts.map +1 -1
  134. package/dist/dts/features/CohortDiscovery/IndexPanel.js +5 -3
  135. package/dist/dts/features/CohortDiscovery/IndexPanel.js.map +1 -1
  136. package/dist/dts/features/CohortDiscovery/appApi.d.ts +2 -0
  137. package/dist/dts/features/CohortDiscovery/appApi.d.ts.map +1 -1
  138. package/dist/dts/features/CohortDiscovery/appApi.js +2 -0
  139. package/dist/dts/features/CohortDiscovery/appApi.js.map +1 -1
  140. package/dist/dts/features/CohortDiscovery/hooks.d.ts +10 -0
  141. package/dist/dts/features/CohortDiscovery/hooks.d.ts.map +1 -1
  142. package/dist/dts/features/CohortDiscovery/hooks.js +38 -1
  143. package/dist/dts/features/CohortDiscovery/hooks.js.map +1 -1
  144. package/dist/dts/features/CohortDiversity/diversityApi.d.ts +12 -12
  145. package/dist/dts/features/DataLibrary/QueryDetails.d.ts.map +1 -1
  146. package/dist/dts/features/DataLibrary/QueryDetails.js +2 -2
  147. package/dist/dts/features/DataLibrary/QueryDetails.js.map +1 -1
  148. package/dist/dts/features/Dictionary/Dictionary.d.ts.map +1 -1
  149. package/dist/dts/features/Dictionary/Dictionary.js +0 -1
  150. package/dist/dts/features/Dictionary/Dictionary.js.map +1 -1
  151. package/dist/dts/features/Dictionary/index.d.ts +1 -3
  152. package/dist/dts/features/Dictionary/index.d.ts.map +1 -1
  153. package/dist/dts/features/Dictionary/index.js +1 -3
  154. package/dist/dts/features/Dictionary/index.js.map +1 -1
  155. package/dist/dts/features/Workspace/ExternalLogins/ExternalLoginsStatus.d.ts.map +1 -1
  156. package/dist/dts/features/Workspace/ExternalLogins/ExternalLoginsStatus.js +1 -1
  157. package/dist/dts/features/Workspace/ExternalLogins/ExternalLoginsStatus.js.map +1 -1
  158. package/dist/dts/features/Workspace/NotebookCard.d.ts.map +1 -1
  159. package/dist/dts/features/Workspace/NotebookCard.js +8 -30
  160. package/dist/dts/features/Workspace/NotebookCard.js.map +1 -1
  161. package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.d.ts.map +1 -1
  162. package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.js +3 -3
  163. package/dist/dts/features/Workspace/PaymentPanel/PaymentPanel.js.map +1 -1
  164. package/dist/dts/features/Workspace/StatusAndControls.d.ts.map +1 -1
  165. package/dist/dts/features/Workspace/StatusAndControls.js +2 -2
  166. package/dist/dts/features/Workspace/StatusAndControls.js.map +1 -1
  167. package/dist/dts/features/Workspace/Workspace.d.ts.map +1 -1
  168. package/dist/dts/features/Workspace/Workspace.js +1 -0
  169. package/dist/dts/features/Workspace/Workspace.js.map +1 -1
  170. package/dist/dts/features/Workspace/WorkspaceNotebookPanelWithControls.d.ts.map +1 -1
  171. package/dist/dts/features/Workspace/WorkspaceNotebookPanelWithControls.js +1 -3
  172. package/dist/dts/features/Workspace/WorkspaceNotebookPanelWithControls.js.map +1 -1
  173. package/dist/dts/features/Workspace/WorkspacePanel.d.ts.map +1 -1
  174. package/dist/dts/features/Workspace/WorkspacePanel.js +9 -10
  175. package/dist/dts/features/Workspace/WorkspacePanel.js.map +1 -1
  176. package/dist/dts/features/Workspace/WorkspaceProvider.d.ts.map +1 -1
  177. package/dist/dts/features/Workspace/WorkspaceProvider.js +0 -1
  178. package/dist/dts/features/Workspace/WorkspaceProvider.js.map +1 -1
  179. package/dist/dts/features/Workspace/WorkspaceStatusProvider.d.ts +1 -2
  180. package/dist/dts/features/Workspace/WorkspaceStatusProvider.d.ts.map +1 -1
  181. package/dist/dts/features/Workspace/WorkspaceStatusProvider.js +27 -56
  182. package/dist/dts/features/Workspace/WorkspaceStatusProvider.js.map +1 -1
  183. package/dist/dts/features/Workspace/types.d.ts +0 -10
  184. package/dist/dts/features/Workspace/types.d.ts.map +1 -1
  185. package/dist/dts/features/Workspace/types.js +1 -10
  186. package/dist/dts/features/Workspace/types.js.map +1 -1
  187. package/dist/dts/index.d.ts +2 -3
  188. package/dist/dts/index.d.ts.map +1 -1
  189. package/dist/dts/index.js +2 -3
  190. package/dist/dts/index.js.map +1 -1
  191. package/dist/dts/lib/session/session.d.ts.map +1 -1
  192. package/dist/dts/lib/session/session.js +7 -7
  193. package/dist/dts/lib/session/session.js.map +1 -1
  194. package/dist/dts/pages/Theme/index.d.ts.map +1 -1
  195. package/dist/dts/utils/date.d.ts +6 -0
  196. package/dist/dts/utils/date.d.ts.map +1 -1
  197. package/dist/dts/utils/date.js +12 -0
  198. package/dist/dts/utils/date.js.map +1 -1
  199. package/dist/dts/utils/icons.d.ts +18 -0
  200. package/dist/dts/utils/icons.d.ts.map +1 -0
  201. package/dist/dts/utils/icons.js +18 -0
  202. package/dist/dts/utils/icons.js.map +1 -0
  203. package/dist/dts/utils/index.d.ts +0 -1
  204. package/dist/dts/utils/index.d.ts.map +1 -1
  205. package/dist/dts/utils/index.js +0 -1
  206. package/dist/dts/utils/index.js.map +1 -1
  207. package/dist/dts/utils/time.d.ts +0 -15
  208. package/dist/dts/utils/time.d.ts.map +1 -1
  209. package/dist/dts/utils/time.js +0 -105
  210. package/dist/dts/utils/time.js.map +1 -1
  211. package/dist/esm/index.js +231 -175
  212. package/dist/esm/index.js.map +1 -1
  213. package/dist/index.d.ts +15 -45
  214. package/dist/tsconfig.tsbuildinfo +1 -1
  215. package/package.json +3 -3
  216. package/dist/dts/features/CohortBuilder/CohortManager.d.ts.map +0 -1
  217. package/dist/dts/features/CohortBuilder/CohortManager.js +0 -17
  218. package/dist/dts/features/CohortBuilder/CohortManager.js.map +0 -1
  219. package/dist/dts/features/CohortBuilder/CohortSelector.d.ts.map +0 -1
  220. package/dist/dts/features/CohortBuilder/CohortSelector.js +0 -20
  221. package/dist/dts/features/CohortBuilder/CohortSelector.js.map +0 -1
  222. package/dist/dts/features/CohortBuilder/QueryExpressionSection.d.ts.map +0 -1
  223. package/dist/dts/features/CohortBuilder/QueryExpressionSection.js.map +0 -1
  224. package/dist/dts/features/CohortBuilder/QueryExpressionsExpandedContext.d.ts.map +0 -1
  225. package/dist/dts/features/CohortBuilder/QueryExpressionsExpandedContext.js.map +0 -1
  226. package/dist/dts/features/CohortBuilder/QueryRepresentation.d.ts.map +0 -1
  227. package/dist/dts/features/CohortBuilder/QueryRepresentation.js.map +0 -1
  228. package/dist/dts/features/CohortBuilder/QueryRepresentationLabel.d.ts.map +0 -1
  229. package/dist/dts/features/CohortBuilder/QueryRepresentationLabel.js.map +0 -1
  230. package/dist/dts/features/Dictionary/metadata/MetadataDictionary.d.ts +0 -7
  231. package/dist/dts/features/Dictionary/metadata/MetadataDictionary.d.ts.map +0 -1
  232. package/dist/dts/features/Dictionary/metadata/MetadataDictionary.js +0 -39
  233. package/dist/dts/features/Dictionary/metadata/MetadataDictionary.js.map +0 -1
  234. package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.d.ts +0 -9
  235. package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.d.ts.map +0 -1
  236. package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.js +0 -113
  237. package/dist/dts/features/Dictionary/metadata/MetadataPropertiesTable.js.map +0 -1
  238. package/dist/dts/features/Dictionary/metadata/registerApp.d.ts +0 -3
  239. package/dist/dts/features/Dictionary/metadata/registerApp.d.ts.map +0 -1
  240. package/dist/dts/features/Dictionary/metadata/registerApp.js +0 -13
  241. package/dist/dts/features/Dictionary/metadata/registerApp.js.map +0 -1
  242. package/dist/dts/features/Dictionary/metadata/types.d.ts +0 -17
  243. package/dist/dts/features/Dictionary/metadata/types.d.ts.map +0 -1
  244. package/dist/dts/features/Dictionary/metadata/types.js +0 -2
  245. package/dist/dts/features/Dictionary/metadata/types.js.map +0 -1
  246. /package/dist/dts/features/CohortBuilder/{QueryExpressionsExpandedContext.d.ts → QueryExpression/QueryExpressionsExpandedContext.d.ts} +0 -0
  247. /package/dist/dts/features/CohortBuilder/{QueryExpressionsExpandedContext.js → QueryExpression/QueryExpressionsExpandedContext.js} +0 -0
  248. /package/dist/dts/features/CohortBuilder/{QueryRepresentationLabel.d.ts → QueryExpression/QueryRepresentationLabel.d.ts} +0 -0
  249. /package/dist/dts/features/CohortBuilder/{QueryRepresentationLabel.js → QueryExpression/QueryRepresentationLabel.js} +0 -0
  250. /package/dist/dts/features/{CohortBuilder → CohortDiscovery}/CohortManager.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortManager.js","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/CohortManager/CohortManager.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GASxB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAGzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,cAAc,MAAM,kBAAkB,CAAC;AAC9C,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,MAAM,CAAC,IAAM,oBAAoB,GAAG,CAAC,gBAAgB,CAAC,CAAC;AAMvD,IAAM,aAAa,GAAG,UAAC,EAA6B;QAA3B,KAAK,WAAA;IAC5B,IAAM,eAAe,GAAG,eAAe,CAAC,UAAC,KAAgB;QACvD,OAAA,qBAAqB,CAAC,KAAK,CAAC;IAA5B,CAA4B,CAC7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+ import { type FilterSet } from '@gen3/core';
3
+ export declare const UnsavedIcon: ({ label }: {
4
+ label: string;
5
+ }) => JSX.Element;
3
6
  interface CohortSelectorProps {
4
7
  showSelectedCohorts?: boolean;
5
8
  readonly index: string;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortSelector.d.ts","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/CohortManager/CohortSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAEL,KAAK,SAAS,EASf,MAAM,YAAY,CAAC;AAIpB,eAAO,MAAM,WAAW,cAAe;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,KAAG,GAAG,CAAC,OAM9D,CAAC;AAEF,UAAU,mBAAmB;IAC3B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;CAC7B;AAED,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA0FjD,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Select, Tooltip } from '@mantine/core';
3
+ import { Icon } from '@iconify/react';
4
+ import { useCoreDispatch, setCohortFilter, useCoreSelector, selectAvailableCohorts, selectCurrentCohortModified, selectCurrentCohortSaved, setActiveCohort, selectCurrentCohortId, } from '@gen3/core';
5
+ import { useDeepCompareCallback, useDeepCompareMemo } from 'use-deep-compare';
6
+ export var UnsavedIcon = function (_a) {
7
+ var label = _a.label;
8
+ return (_jsx(Tooltip, { label: label, withArrow: true, children: _jsx("span", { className: "leading-0 pointer-events-auto", children: _jsx(Icon, { icon: "gen3:cohort-unsaved", "aria-hidden": "true", height: "1.0rem" }) }) }));
9
+ };
10
+ var CohortSelector = function (_a) {
11
+ var index = _a.index, filters = _a.filters;
12
+ var coreDispatch = useCoreDispatch();
13
+ var cohorts = useCoreSelector(selectAvailableCohorts);
14
+ var currentCohortId = useCoreSelector(selectCurrentCohortId);
15
+ var currentCohortModified = useCoreSelector(selectCurrentCohortModified);
16
+ var currentCohortSaved = useCoreSelector(selectCurrentCohortSaved);
17
+ var cohortStatusMessage = currentCohortSaved
18
+ ? 'Changes not saved'
19
+ : 'Cohort not saved';
20
+ var isSavedUnchanged = currentCohortSaved && !currentCohortModified;
21
+ var getData = useDeepCompareCallback(function () {
22
+ return filters;
23
+ }, [filters]);
24
+ var handleCohortChange = useDeepCompareCallback(function (id) {
25
+ coreDispatch(setActiveCohort(id));
26
+ }, [coreDispatch]);
27
+ var cohortList = useDeepCompareMemo(function () {
28
+ return cohorts
29
+ .sort(function (a, b) {
30
+ return a.modified_datetime <= b.modified_datetime ? 1 : -1;
31
+ })
32
+ .map(function (x) { return ({
33
+ value: x.id,
34
+ label: x.name,
35
+ isSavedUnchanged: x.saved && !x.modified,
36
+ cohortStatusMessage: x.saved
37
+ ? 'Changes not saved'
38
+ : 'Cohort not saved',
39
+ }); });
40
+ }, [cohorts]);
41
+ var setCohort = useDeepCompareCallback(function (data) {
42
+ var jsonForm = JSON.parse(data);
43
+ coreDispatch(setCohortFilter({ index: index, filters: jsonForm }));
44
+ }, [index, coreDispatch]);
45
+ return (_jsxs("div", { className: "flex flex-col pt-5", "data-testid": "cohort-list-dropdown", children: [_jsx(Select, { data: cohortList, searchable: true, clearable: false, value: currentCohortId, onChange: function (id) {
46
+ if (id !== null) {
47
+ handleCohortChange(id);
48
+ }
49
+ }, classNames: {
50
+ root: 'border-secondary-darkest w-56 md:w-80',
51
+ input: 'text-heading font-medium text-primary-darkest rounded-l-none h-[48px] border-primary border-l-2',
52
+ option: 'text-heading font-normal text-primary-darkest data-selected:bg-primary-lighter hover:bg-accent-lightest hover:text-accent-contrast-lightest my-0.5',
53
+ }, "aria-label": "Select cohort", "data-testid": "switchButton", rightSection: _jsxs("div", { className: "flex gap-1 items-center", children: [!isSavedUnchanged && _jsx(UnsavedIcon, { label: cohortStatusMessage }), _jsx(Icon, { icon: "gen3:caret-down", height: "1.0rem", className: "text-primary" })] }), rightSectionWidth: !isSavedUnchanged ? 45 : 30, styles: { section: { pointerEvents: 'none' } } }), _jsx("div", { className: "ml-auto text-heading text-sm font-semibold mt-0.85 text-primary-contrast ".concat(!isSavedUnchanged ? 'visible' : 'invisible'), children: cohortStatusMessage })] }));
54
+ };
55
+ export default CohortSelector;
56
+ //# sourceMappingURL=CohortSelector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortSelector.js","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/CohortManager/CohortSelector.tsx"],"names":[],"mappings":";AACA,OAAO,EAAS,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AAEtC,OAAO,EAGL,eAAe,EACf,eAAe,EACf,eAAe,EACf,sBAAsB,EACtB,2BAA2B,EAC3B,wBAAwB,EACxB,eAAe,EACf,qBAAqB,GACtB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG9E,MAAM,CAAC,IAAM,WAAW,GAAG,UAAC,EAA4B;QAA1B,KAAK,WAAA;IAAuC,OAAA,CACxE,KAAC,OAAO,IAAC,KAAK,EAAE,KAAK,EAAE,SAAS,kBAC9B,eAAM,SAAS,EAAC,+BAA+B,YAC7C,KAAC,IAAI,IAAC,IAAI,EAAC,qBAAqB,iBAAa,MAAM,EAAC,MAAM,EAAC,QAAQ,GAAG,GACjE,GACC,CACX;AANyE,CAMzE,CAAC;AAQF,IAAM,cAAc,GAAkC,UAAC,EAAkB;QAAhB,KAAK,WAAA,EAAE,OAAO,aAAA;IACrE,IAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,IAAM,OAAO,GAAG,eAAe,CAAC,sBAAsB,CA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 +1,4 @@
1
+ import { NextRouter } from 'next/router';
2
+ export declare const exportCohort: (caseIds: readonly Record<string, any>[], cohortName: string) => void;
3
+ export declare const removeQueryParamsFromRouter: (router: NextRouter, removeList?: string[]) => void;
4
+ //# sourceMappingURL=cohortUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cohortUtils.d.ts","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/CohortManager/cohortUtils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,eAAO,MAAM,YAAY,YACd,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,cAC3B,MAAM,SAWnB,CAAC;AAEF,eAAO,MAAM,2BAA2B,WAC9B,UAAU,eACN,MAAM,EAAE,KACnB,IAeF,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { getFormattedTimestamp } from '../../../utils/date';
2
+ import saveAs from 'file-saver';
3
+ export var exportCohort = function (caseIds, cohortName) {
4
+ var tsv = "id\n".concat(caseIds.map(function (c) { return c.case_id; }).join('\n'));
5
+ var blob = new Blob([tsv], { type: 'text/tsv' });
6
+ saveAs(blob, "cohort_".concat(cohortName.replace(/[^A-Za-z0-9_.]/g, '_'), ".").concat(getFormattedTimestamp(), ".tsv"));
7
+ };
8
+ export var removeQueryParamsFromRouter = function (router, removeList) {
9
+ if (removeList === void 0) { removeList = []; }
10
+ if (removeList.length > 0) {
11
+ removeList.forEach(function (param) { return delete router.query[param]; });
12
+ }
13
+ else {
14
+ // Remove all
15
+ Object.keys(router.query).forEach(function (param) { return delete router.query[param]; });
16
+ }
17
+ router.replace({
18
+ pathname: router.pathname,
19
+ query: router.query,
20
+ }, undefined, { shallow: true });
21
+ };
22
+ //# sourceMappingURL=cohortUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cohortUtils.js","sourceRoot":"","sources":["../../../../../src/features/CohortBuilder/CohortManager/cohortUtils.ts"],"names":[],"mappings":"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AC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=SaveCohortModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveCohortModal.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CohortBuilder/CohortManager/modals/SaveCohortModal.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,320 @@
1
+ "use strict";
2
+ // import { useState, useCallback } from 'react';
3
+ // import { useDeepCompareEffect } from 'use-deep-compare';
4
+ // import { FetchBaseQueryError } from '@reduxjs/toolkit/dist/query';
5
+ // import { Modal, Button } from '@mantine/core';
6
+ // import {
7
+ // removeCohort,
8
+ // copyToSavedCohort,
9
+ // setCohortMessage,
10
+ // buildCohortGqlOperator,
11
+ // setCurrentCohortId,
12
+ // updateCohortName,
13
+ // useCoreDispatch,
14
+ // useAddCohortMutation,
15
+ // FilterSet,
16
+ // addNewSavedCohort,
17
+ // buildGqlOperationToFilterSet,
18
+ // NullCountsData,
19
+ // useCoreSelector,
20
+ // selectAvailableCohorts,
21
+ // useGetCohortsByContextIdQuery,
22
+ // useLazyGetCohortByIdQuery,
23
+ // discardCohortChanges,
24
+ // showModal,
25
+ // Modals,
26
+ // type Cohort,
27
+ // fetchCohortCaseCounts,
28
+ // useCreateCaseSetFromFiltersMutation,
29
+ // } from '@gen3/core';
30
+ // import { SaveOrCreateEntityBody } from './SaveOrCreateEntityModal';
31
+ // import ModalButtonContainer from '@/components/StyledComponents/ModalButtonContainer';
32
+ // import { INVALID_COHORT_NAMES } from '@/features/cohortBuilder/utils';
33
+ // import { omit } from 'lodash';
34
+ //
35
+ // /**
36
+ // * SaveCohortModal handles saving a user's cohort
37
+ // * @param initialName - populates inital value of name field
38
+ // * @param onClose - callback triggered when modal closes
39
+ // * @param cohortId - id of existing cohort we are saving, if undefined we are not saving a cohort that already exists
40
+ // * @param filters - the filters associated with the cohort
41
+ // * @param caseFilters - the case filters to use for the cohort
42
+ // * @param createStaticCohort - whether to create a case set from the filters so the cases in the cohort remain static
43
+ // * @param setAsCurrent - whether to set the new cohort as the user's current cohort, should not also pass in cohortId
44
+ // * @param saveAs - whether to save existing cohort as new cohort, requires cohortId
45
+ // * @category Modals
46
+ // */
47
+ // const SaveCohortModal = ({
48
+ // opened,
49
+ // initialName = '',
50
+ // onClose,
51
+ // cohortId,
52
+ // filters,
53
+ // caseFilters,
54
+ // createStaticCohort = false,
55
+ // setAsCurrent = false,
56
+ // saveAs = false,
57
+ // }: {
58
+ // opened: boolean;
59
+ // initialName?: string;
60
+ // onClose: () => void;
61
+ // cohortId?: string;
62
+ // filters: FilterSet;
63
+ // caseFilters?: FilterSet;
64
+ // createStaticCohort?: boolean;
65
+ // setAsCurrent?: boolean;
66
+ // saveAs?: boolean;
67
+ // }): JSX.Element => {
68
+ // const coreDispatch = useCoreDispatch();
69
+ // const [showReplaceCohort, setShowReplaceCohort] = useState(false);
70
+ // const [cohortReplaced, setCohortReplaced] = useState(false);
71
+ // const [enteredName, setEnteredName] = useState<string>();
72
+ // const [addCohort, { isLoading }] = useAddCohortMutation();
73
+ // const [cohortSavedMessage, setCohortSavedMessage] = useState<string[]>();
74
+ // const cohorts = useCoreSelector((state) => selectAvailableCohorts(state));
75
+ // const [createSet] = useCreateCaseSetFromFiltersMutation();
76
+ //
77
+ // const {
78
+ // data: cohortsListData,
79
+ // isSuccess: cohortListSuccess,
80
+ // isLoading: cohortListLoading,
81
+ // } = useGetCohortsByContextIdQuery(null, { skip: !cohortReplaced });
82
+ //
83
+ // const closeModal = useCallback(() => {
84
+ // onClose();
85
+ // // Reset modal state on close
86
+ // setShowReplaceCohort(false);
87
+ // setCohortReplaced(false);
88
+ // setEnteredName(undefined);
89
+ // setCohortSavedMessage(undefined);
90
+ // }, [onClose]);
91
+ //
92
+ // useDeepCompareEffect(() => {
93
+ // if (opened && cohortListSuccess && cohortReplaced) {
94
+ // // Remove replaced cohort
95
+ // const updatedCohortIds = (cohortsListData || []).map(
96
+ // (cohort: Cohort) => cohort.id,
97
+ // );
98
+ // const outdatedCohortsIds = cohorts
99
+ // .filter((c) => c.saved && !updatedCohortIds.includes(c.id))
100
+ // .map((c) => c.id);
101
+ // for (const id of outdatedCohortsIds) {
102
+ // coreDispatch(removeCohort({ id }));
103
+ // }
104
+ //
105
+ // coreDispatch(setCohortMessage(cohortSavedMessage));
106
+ // closeModal();
107
+ // }
108
+ // }, [
109
+ // cohortListSuccess,
110
+ // cohortReplaced,
111
+ // cohortsListData,
112
+ // cohorts,
113
+ // coreDispatch,
114
+ // opened,
115
+ // closeModal,
116
+ // cohortSavedMessage,
117
+ // ]);
118
+ // const [fetchSavedFilters] = useLazyGetCohortByIdQuery();
119
+ //
120
+ // const saveAction = async (newName: string, replace: boolean) => {
121
+ // const prevCohort = cohortId;
122
+ // let cohortFilters = filters;
123
+ //
124
+ // const addBody = {
125
+ // name: newName,
126
+ // filters: {},
127
+ // };
128
+ //
129
+ // await addCohort({ cohort: addBody, delete_existing: replace })
130
+ // .unwrap()
131
+ // .then(async (payload) => {
132
+ // let tempCohortMsg: string[];
133
+ // if (prevCohort) {
134
+ // if (saveAs) {
135
+ // coreDispatch(
136
+ // addNewSavedCohort({
137
+ // id: payload.id,
138
+ // name: payload.name,
139
+ // filters: buildGqlOperationToFilterSet(payload.filters),
140
+ // caseSet: { status: 'uninitialized' },
141
+ // counts: {
142
+ // ...NullCountsData,
143
+ // },
144
+ // modified_datetime: payload.modified_datetime,
145
+ // saved: true,
146
+ // modified: false,
147
+ // }),
148
+ // );
149
+ // coreDispatch(setCurrentCohortId(payload.id));
150
+ // tempCohortMsg = [`savedCohort|${newName}|${payload.id}`];
151
+ // } else {
152
+ // coreDispatch(
153
+ // copyToSavedCohort({
154
+ // sourceId: prevCohort,
155
+ // destId: payload.id,
156
+ // }),
157
+ // );
158
+ // // NOTE: the current cohort can not be undefined. Setting the id to a cohort
159
+ // // which does not exist will cause this
160
+ // // Therefore, copy the unsaved cohort to the new cohort id received from
161
+ // // the BE.
162
+ //
163
+ // // possible that the caseCount are undefined or pending so
164
+ // // re-request counts.
165
+ // coreDispatch(fetchCohortCaseCounts(payload.id)); // fetch counts for new cohort
166
+ //
167
+ // tempCohortMsg = [`savedCurrentCohort|${newName}|${payload.id}`];
168
+ //
169
+ // coreDispatch(
170
+ // removeCohort({
171
+ // shouldShowMessage: false,
172
+ // id: prevCohort,
173
+ // }),
174
+ // );
175
+ // coreDispatch(setCurrentCohortId(payload.id));
176
+ // coreDispatch(updateCohortName(newName));
177
+ // }
178
+ // } else {
179
+ // coreDispatch(
180
+ // addNewSavedCohort({
181
+ // id: payload.id,
182
+ // name: payload.name,
183
+ // filters: buildGqlOperationToFilterSet(payload.filters),
184
+ // caseSet: { status: 'uninitialized' },
185
+ // counts: {
186
+ // ...NullCountsData,
187
+ // },
188
+ // modified_datetime: payload.modified_datetime,
189
+ // saved: true,
190
+ // modified: false,
191
+ // }),
192
+ // );
193
+ //
194
+ // if (setAsCurrent) {
195
+ // coreDispatch(setCurrentCohortId(payload.id));
196
+ // tempCohortMsg = [`savedCohort|${newName}|${payload.id}`];
197
+ // } else {
198
+ // tempCohortMsg = [
199
+ // `savedCohortSetCurrent|${payload.name}|${payload.id}`,
200
+ // ];
201
+ // }
202
+ // }
203
+ //
204
+ // if (saveAs && initialName !== newName) {
205
+ // // Should discard local changes from current cohort when saving as
206
+ // await fetchSavedFilters(prevCohort)
207
+ // .unwrap()
208
+ // .then((payload) => {
209
+ // coreDispatch(
210
+ // discardCohortChanges({
211
+ // filters: buildGqlOperationToFilterSet(payload.filters),
212
+ // showMessage: false,
213
+ // id: prevCohort,
214
+ // }),
215
+ // );
216
+ // });
217
+ // }
218
+ //
219
+ // // Need to wait for request removing outdated cohorts to finish when replacing cohort
220
+ // if (replace) {
221
+ // setCohortSavedMessage(tempCohortMsg);
222
+ // setCohortReplaced(true);
223
+ // } else {
224
+ // coreDispatch(setCohortMessage(tempCohortMsg));
225
+ // closeModal();
226
+ // }
227
+ // })
228
+ // .catch((e: FetchBaseQueryError) => {
229
+ // if (
230
+ // (e.data as { message: string })?.message ===
231
+ // 'Bad Request: Name must be unique (case-insensitive)'
232
+ // ) {
233
+ // setShowReplaceCohort(true);
234
+ // } else {
235
+ // onClose();
236
+ // coreDispatch(showModal({ modal: Modals.SaveCohortErrorModal }));
237
+ // }
238
+ // });
239
+ // };
240
+ //
241
+ // const UpdateBody = () => (
242
+ // <>
243
+ // <div className="p-4">
244
+ // <p className="font-content text-sm">
245
+ // A saved cohort with same name already exists. Are you sure you want to
246
+ // replace it?
247
+ // </p>
248
+ // <p className="text-xs font-content mt-1">
249
+ // You cannot undo this action.
250
+ // </p>
251
+ // </div>
252
+ // <ModalButtonContainer data-testid="modal-button-container">
253
+ // <Button
254
+ // variant="outline"
255
+ // className={'bg-white'}
256
+ // color="secondary"
257
+ // onClick={() => setShowReplaceCohort(false)}
258
+ // >
259
+ // Cancel
260
+ // </Button>
261
+ // <Button
262
+ // variant={'filled'}
263
+ // color="secondary"
264
+ // onClick={() => {
265
+ // saveAction(enteredName, true);
266
+ // }}
267
+ // data-testid="replace-cohort-button"
268
+ // loading={isLoading || cohortListLoading}
269
+ // >
270
+ // Replace
271
+ // </Button>
272
+ // </ModalButtonContainer>
273
+ // </>
274
+ // );
275
+ //
276
+ // return (
277
+ // <Modal
278
+ // opened={opened}
279
+ // onClose={showReplaceCohort ? () => setShowReplaceCohort(false) : onClose}
280
+ // title={
281
+ // showReplaceCohort
282
+ // ? 'Replace Existing Cohort'
283
+ // : saveAs
284
+ // ? 'Save Cohort As'
285
+ // : 'Save Cohort'
286
+ // }
287
+ // size="md"
288
+ // classNames={{
289
+ // content: 'p-0',
290
+ // title: 'text-xl',
291
+ // }}
292
+ // >
293
+ // {showReplaceCohort ? (
294
+ // <UpdateBody />
295
+ // ) : (
296
+ // <SaveOrCreateEntityBody
297
+ // entity="cohort"
298
+ // action="Save"
299
+ // initialName={initialName}
300
+ // onClose={onClose}
301
+ // onActionClick={(name: string) => {
302
+ // saveAction(name, false);
303
+ // setEnteredName(name);
304
+ // }}
305
+ // descriptionMessage={
306
+ // saveAs
307
+ // ? 'Provide a name to save your current cohort as a new cohort'
308
+ // : 'Provide a name to save the cohort.'
309
+ // }
310
+ // closeOnAction={false}
311
+ // loading={isLoading}
312
+ // disallowedNames={INVALID_COHORT_NAMES}
313
+ // />
314
+ // )}
315
+ // </Modal>
316
+ // );
317
+ // };
318
+ //
319
+ // export default SaveCohortModal;
320
+ //# sourceMappingURL=SaveCohortModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveCohortModal.js","sourceRoot":"","sources":["../../../../../../src/features/CohortBuilder/CohortManager/modals/SaveCohortModal.tsx"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,2DAA2D;AAC3D,qEAAqE;AACrE,iDAAiD;AACjD,WAAW;AACX,kBAAkB;AAClB,uBAAuB;AACvB,sBAAsB;AACtB,4BAA4B;AAC5B,wBAAwB;AACxB,sBAAsB;AACtB,qBAAqB;AACrB,0BAA0B;AAC1B,eAAe;AACf,uBAAuB;AACvB,kCAAkC;AAClC,oBAAoB;AACpB,qBAAqB;AACrB,4BAA4B;AAC5B,mCAAmC;AACnC,+BAA+B;AAC/B,0BAA0B;AAC1B,eAAe;AACf,YAAY;AACZ,iBAAiB;AACjB,2BAA2B;AAC3B,yCAAyC;AACzC,uBAAuB;AACvB,sEAAsE;AACtE,yFAAyF;AACzF,yEAAyE;AACzE,iCAAiC;AACjC,EAAE;AACF,MAAM;AACN,oDAAoD;AACpD,+DAA+D;AAC/D,2DAA2D;AAC3D,wHAAwH;AACxH,6DAA6D;AAC7D,iEAAiE;AACjE,wHAAwH;AACxH,wHAAwH;AACxH,sFAAsF;AACtF,sBAAsB;AACtB,MAAM;AACN,6BAA6B;AAC7B,YAAY;AACZ,sBAAsB;AACtB,aAAa;AACb,cAAc;AACd,aAAa;AACb,iBAAiB;AACjB,gCAAgC;AAChC,0BAA0B;AAC1B,oBAAoB;AACpB,OAAO;AACP,qBAAqB;AACrB,0BAA0B;AAC1B,yBAAyB;AAC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,"file":"SaveModal.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CohortBuilder/CohortManager/modals/SaveModal.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=SaveModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveModal.js","sourceRoot":"","sources":["../../../../../../src/features/CohortBuilder/CohortManager/modals/SaveModal.tsx"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ interface SaveOrCreateEntityModalProps {
2
+ entity: string;
3
+ action?: string;
4
+ initialName?: string;
5
+ opened: boolean;
6
+ onClose: () => void;
7
+ onActionClick: (name: string) => void;
8
+ onNameChange?: (name: string) => boolean;
9
+ descriptionMessage?: string;
10
+ additionalDuplicateMessage?: string;
11
+ disallowedNames?: string[];
12
+ }
13
+ export declare const SaveOrCreateEntityModal: ({ entity, action, initialName, opened, onClose, onActionClick, onNameChange, descriptionMessage, additionalDuplicateMessage, disallowedNames, }: SaveOrCreateEntityModalProps) => JSX.Element;
14
+ interface SaveOrCreateEntityBodyProps {
15
+ entity: string;
16
+ action?: string;
17
+ initialName?: string;
18
+ onClose: () => void;
19
+ onActionClick: (name: string) => void;
20
+ onNameChange?: (name: string) => boolean;
21
+ descriptionMessage?: string;
22
+ additionalDuplicateMessage?: string;
23
+ closeOnAction?: boolean;
24
+ loading?: boolean;
25
+ disallowedNames?: string[];
26
+ }
27
+ export declare const SaveOrCreateEntityBody: ({ action, initialName, onClose, onActionClick, onNameChange, descriptionMessage, additionalDuplicateMessage, closeOnAction, loading, disallowedNames, }: SaveOrCreateEntityBodyProps) => JSX.Element;
28
+ export {};
29
+ //# sourceMappingURL=SaveOrCreateEntityModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveOrCreateEntityModal.d.ts","sourceRoot":"","sources":["../../../../../../src/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.tsx"],"names":[],"mappings":"AAMA,UAAU,4BAA4B;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACzC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AACD,eAAO,MAAM,uBAAuB,oJAWjC,4BAA4B,KAAG,GAAG,CAAC,OAsBrC,CAAC;AAEF,UAAU,2BAA2B;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;IACzC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,EAAE,CAAC;CAC5B;AAED,eAAO,MAAM,sBAAsB,4JAWhC,2BAA2B,KAAG,GAAG,CAAC,OA+GpC,CAAC"}
@@ -0,0 +1,85 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
24
+ import { upperFirst } from 'lodash';
25
+ import { Box, Button, Group, Modal, TextInput, Loader } from '@mantine/core';
26
+ import { useForm } from '@mantine/form';
27
+ import ErrorMessage from '../../../../components/ErrorMessage';
28
+ import { WarningIconMessage } from '../../../../utils/icons';
29
+ export var SaveOrCreateEntityModal = function (_a) {
30
+ var entity = _a.entity, _b = _a.action, action = _b === void 0 ? 'Save' : _b, _c = _a.initialName, initialName = _c === void 0 ? '' : _c, opened = _a.opened, onClose = _a.onClose, onActionClick = _a.onActionClick, onNameChange = _a.onNameChange, descriptionMessage = _a.descriptionMessage, additionalDuplicateMessage = _a.additionalDuplicateMessage, _d = _a.disallowedNames, disallowedNames = _d === void 0 ? [] : _d;
31
+ return (_jsx(Modal, { title: "".concat(upperFirst(action), " ").concat(upperFirst(entity)), opened: opened, padding: 0, radius: "md", onClose: onClose, children: _jsx(SaveOrCreateEntityBody, { entity: entity, action: action, initialName: initialName, onClose: onClose, onActionClick: onActionClick, onNameChange: onNameChange, descriptionMessage: descriptionMessage, additionalDuplicateMessage: additionalDuplicateMessage, disallowedNames: disallowedNames }) }));
32
+ };
33
+ export var SaveOrCreateEntityBody = function (_a) {
34
+ var _b;
35
+ var _c = _a.action, action = _c === void 0 ? 'Save' : _c, _d = _a.initialName, initialName = _d === void 0 ? '' : _d, onClose = _a.onClose, onActionClick = _a.onActionClick, onNameChange = _a.onNameChange, descriptionMessage = _a.descriptionMessage, additionalDuplicateMessage = _a.additionalDuplicateMessage, _e = _a.closeOnAction, closeOnAction = _e === void 0 ? true : _e, _f = _a.loading, loading = _f === void 0 ? false : _f, _g = _a.disallowedNames, disallowedNames = _g === void 0 ? [] : _g;
36
+ var validationMessages = {
37
+ emptyField: 'Please fill out this field.',
38
+ invalidName: function (value) {
39
+ return "".concat(value, " is not a valid name for a saved cohort. Please try another name.");
40
+ },
41
+ };
42
+ var form = useForm({
43
+ initialValues: {
44
+ name: initialName,
45
+ },
46
+ validate: {
47
+ name: function (value) {
48
+ if (value.length === 0) {
49
+ return validationMessages.emptyField;
50
+ }
51
+ else if (disallowedNames.includes(value.trim().toLowerCase())) {
52
+ return validationMessages.invalidName(value);
53
+ }
54
+ return null;
55
+ },
56
+ },
57
+ });
58
+ // ignoring this error object as new one is being defined below
59
+ var _h = form.getInputProps('name'), _ = _h.error, inputProps = __rest(_h, ["error"]);
60
+ var validationError = form.errors.name;
61
+ var error = validationError && (_jsx(ErrorMessage, { message: validationError }));
62
+ var description = Object.keys(form.errors).length === 0 &&
63
+ (onNameChange && !onNameChange((((_b = form === null || form === void 0 ? void 0 : form.values) === null || _b === void 0 ? void 0 : _b.name) || '').trim()) ? (_jsxs("span", { className: "text-warningColorText", children: [_jsx(WarningIconMessage, { className: "text-warningColor inline mr-0.5" }), "A", ' ', "Cohort with the same name already exists.", ' ', additionalDuplicateMessage && additionalDuplicateMessage] })) : (_jsx("span", { children: "Maximum 100 characters" })));
64
+ var handleActionClick = function () {
65
+ var _a;
66
+ if (form.validate().hasErrors || loading)
67
+ return;
68
+ onActionClick((((_a = form === null || form === void 0 ? void 0 : form.values) === null || _a === void 0 ? void 0 : _a.name) || '').trim());
69
+ if (closeOnAction) {
70
+ onClose();
71
+ }
72
+ };
73
+ return (_jsxs(_Fragment, { children: [_jsxs(Box, { className: "font-content mt-1 mr-6 mb-5 ml-3", children: [_jsx("p", { className: "mb-2 text-sm font-content", children: descriptionMessage && descriptionMessage }), _jsx(TextInput, __assign({ withAsterisk: true, label: "Name", placeholder: "New Cohort Name", description: description, classNames: {
74
+ description: 'mt-1',
75
+ input: 'font-content data-[invalid=true]:text-utility-error data-[invalid=true]:border-utility-error',
76
+ error: 'text-utility-error',
77
+ }, "data-autofocus": true, maxLength: 100, error: error, inputWrapperOrder: ['label', 'input', 'error', 'description'] }, inputProps, { "aria-required": true, "data-testid": "textbox-name-input-field" }))] }), _jsx(Box, { style: {
78
+ backgroundColor: 'var(--mantine-color-base-1)',
79
+ padding: 'var(--mantine-spacing-md)',
80
+ borderRadius: 'var(--mantine-radius-md)',
81
+ borderTopRightRadius: 0,
82
+ borderTopLeftRadius: 0,
83
+ }, children: _jsxs(Group, { justify: "flex-end", children: [_jsx(Button, { "data-testid": "button-cancel-save", variant: "outline", classNames: { root: 'bg-base-max' }, color: "secondary", onClick: onClose, children: "Cancel" }), _jsx(Button, { variant: "filled", color: "secondary", onClick: handleActionClick, "data-testid": "button-save-name", leftSection: loading ? _jsx(Loader, { size: 15, color: "white" }) : undefined, children: upperFirst(action) })] }) })] }));
84
+ };
85
+ //# sourceMappingURL=SaveOrCreateEntityModal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SaveOrCreateEntityModal.js","sourceRoot":"","sources":["../../../../../../src/features/CohortBuilder/CohortManager/modals/SaveOrCreateEntityModal.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACpC,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,YAAY,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,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UAAU,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,EACnC,KAAK,EAAC,WAAW,EACjB,OAAO,EAAE,OAAO,uBAGT,EACT,KAAC,MAAM,IACL,OAAO,EAAC,QAAQ,EAChB,KAAK,EAAC,WAAW,EACjB,OAAO,EAAE,iBAAiB,iBACd,kBAAkB,EAC9B,WAAW,EACT,OAAO,CAAC,CAAC,CAAC,KAAC,MAAM,IAAC,IAAI,EAAE,EAAE,EAAE,KAAK,EAAC,OAAO,GAAG,CAAC,CAAC,CAAC,SAAS,YAGzD,UAAU,CAAC,MAAM,CAAC,GACZ,IACH,GACJ,IACL,CACJ,CAAC;AACJ,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"CohortPanel.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortBuilder/CohortPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,iBAAiB,EAA8B,MAAM,SAAS,CAAC;AA2G7E;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,6FASrB,iBAAiB,KAAG,GAAG,CAAC,OA6N1B,CAAC"}
1
+ {"version":3,"file":"CohortPanel.d.ts","sourceRoot":"","sources":["../../../../src/features/CohortBuilder/CohortPanel.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,KAAK,iBAAiB,EAA8B,MAAM,SAAS,CAAC;AA4G7E;;;;;;;GAOG;AACH,eAAO,MAAM,WAAW,6FASrB,iBAAiB,KAAG,GAAG,CAAC,OA6N1B,CAAC"}