@finos/legend-cube-builder 0.0.0-stage → 0.0.3

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 (379) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +64 -2
  3. package/docs/adding-an-operation.md +92 -0
  4. package/docs/hosting.md +79 -0
  5. package/docs/testing.md +83 -0
  6. package/lib/__lib__/LegendCubeCommand.d.ts +26 -0
  7. package/lib/__lib__/LegendCubeCommand.d.ts.map +1 -0
  8. package/lib/__lib__/LegendCubeCommand.js +40 -0
  9. package/lib/__lib__/LegendCubeCommand.js.map +1 -0
  10. package/lib/__lib__/LegendCubeHelpText.d.ts +19 -0
  11. package/lib/__lib__/LegendCubeHelpText.d.ts.map +1 -0
  12. package/lib/__lib__/LegendCubeHelpText.js +35 -0
  13. package/lib/__lib__/LegendCubeHelpText.js.map +1 -0
  14. package/lib/__lib__/LegendCubeLabels.d.ts +87 -0
  15. package/lib/__lib__/LegendCubeLabels.d.ts.map +1 -0
  16. package/lib/__lib__/LegendCubeLabels.js +128 -0
  17. package/lib/__lib__/LegendCubeLabels.js.map +1 -0
  18. package/lib/__lib__/LegendCubeTesting.d.ts +33 -0
  19. package/lib/__lib__/LegendCubeTesting.d.ts.map +1 -0
  20. package/lib/__lib__/LegendCubeTesting.js +34 -0
  21. package/lib/__lib__/LegendCubeTesting.js.map +1 -0
  22. package/lib/__test-utils__/CubeCanvasTestUtils.d.ts +24 -0
  23. package/lib/__test-utils__/CubeCanvasTestUtils.d.ts.map +1 -0
  24. package/lib/__test-utils__/CubeCanvasTestUtils.js +37 -0
  25. package/lib/__test-utils__/CubeCanvasTestUtils.js.map +1 -0
  26. package/lib/__test-utils__/CubeEngineTestSupport.d.ts +47 -0
  27. package/lib/__test-utils__/CubeEngineTestSupport.d.ts.map +1 -0
  28. package/lib/__test-utils__/CubeEngineTestSupport.js +106 -0
  29. package/lib/__test-utils__/CubeEngineTestSupport.js.map +1 -0
  30. package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts +31 -0
  31. package/lib/__test-utils__/CubeNorthwindTestQueries.d.ts.map +1 -0
  32. package/lib/__test-utils__/CubeNorthwindTestQueries.js +102 -0
  33. package/lib/__test-utils__/CubeNorthwindTestQueries.js.map +1 -0
  34. package/lib/__test-utils__/CubeOperationsTestUtils.d.ts +42 -0
  35. package/lib/__test-utils__/CubeOperationsTestUtils.d.ts.map +1 -0
  36. package/lib/__test-utils__/CubeOperationsTestUtils.js +92 -0
  37. package/lib/__test-utils__/CubeOperationsTestUtils.js.map +1 -0
  38. package/lib/__test-utils__/CubePageTestUtils.d.ts +33 -0
  39. package/lib/__test-utils__/CubePageTestUtils.d.ts.map +1 -0
  40. package/lib/__test-utils__/CubePageTestUtils.js +68 -0
  41. package/lib/__test-utils__/CubePageTestUtils.js.map +1 -0
  42. package/lib/__test-utils__/CubeTestApplication.d.ts +30 -0
  43. package/lib/__test-utils__/CubeTestApplication.d.ts.map +1 -0
  44. package/lib/__test-utils__/CubeTestApplication.js +57 -0
  45. package/lib/__test-utils__/CubeTestApplication.js.map +1 -0
  46. package/lib/__test-utils__/FakeCubeEngine.d.ts +41 -0
  47. package/lib/__test-utils__/FakeCubeEngine.d.ts.map +1 -0
  48. package/lib/__test-utils__/FakeCubeEngine.js +91 -0
  49. package/lib/__test-utils__/FakeCubeEngine.js.map +1 -0
  50. package/lib/components/CubeButton.d.ts +20 -0
  51. package/lib/components/CubeButton.d.ts.map +1 -0
  52. package/lib/components/CubeButton.js +24 -0
  53. package/lib/components/CubeButton.js.map +1 -0
  54. package/lib/components/CubeEditor.d.ts +31 -0
  55. package/lib/components/CubeEditor.d.ts.map +1 -0
  56. package/lib/components/CubeEditor.js +90 -0
  57. package/lib/components/CubeEditor.js.map +1 -0
  58. package/lib/components/CubeNodeIcon.d.ts +23 -0
  59. package/lib/components/CubeNodeIcon.d.ts.map +1 -0
  60. package/lib/components/CubeNodeIcon.js +42 -0
  61. package/lib/components/CubeNodeIcon.js.map +1 -0
  62. package/lib/components/canvas/CubeCanvas.d.ts +37 -0
  63. package/lib/components/canvas/CubeCanvas.d.ts.map +1 -0
  64. package/lib/components/canvas/CubeCanvas.js +137 -0
  65. package/lib/components/canvas/CubeCanvas.js.map +1 -0
  66. package/lib/components/canvas/CubeCanvasContext.d.ts +19 -0
  67. package/lib/components/canvas/CubeCanvasContext.d.ts.map +1 -0
  68. package/lib/components/canvas/CubeCanvasContext.js +22 -0
  69. package/lib/components/canvas/CubeCanvasContext.js.map +1 -0
  70. package/lib/components/canvas/CubeCanvasContextMenu.d.ts +28 -0
  71. package/lib/components/canvas/CubeCanvasContextMenu.d.ts.map +1 -0
  72. package/lib/components/canvas/CubeCanvasContextMenu.js +35 -0
  73. package/lib/components/canvas/CubeCanvasContextMenu.js.map +1 -0
  74. package/lib/components/canvas/CubeCanvasDnd.d.ts +43 -0
  75. package/lib/components/canvas/CubeCanvasDnd.d.ts.map +1 -0
  76. package/lib/components/canvas/CubeCanvasDnd.js +51 -0
  77. package/lib/components/canvas/CubeCanvasDnd.js.map +1 -0
  78. package/lib/components/canvas/CubeCanvasEdge.d.ts +24 -0
  79. package/lib/components/canvas/CubeCanvasEdge.d.ts.map +1 -0
  80. package/lib/components/canvas/CubeCanvasEdge.js +33 -0
  81. package/lib/components/canvas/CubeCanvasEdge.js.map +1 -0
  82. package/lib/components/canvas/CubeCanvasElements.d.ts +66 -0
  83. package/lib/components/canvas/CubeCanvasElements.d.ts.map +1 -0
  84. package/lib/components/canvas/CubeCanvasElements.js +97 -0
  85. package/lib/components/canvas/CubeCanvasElements.js.map +1 -0
  86. package/lib/components/canvas/CubeCanvasLayout.d.ts +32 -0
  87. package/lib/components/canvas/CubeCanvasLayout.d.ts.map +1 -0
  88. package/lib/components/canvas/CubeCanvasLayout.js +63 -0
  89. package/lib/components/canvas/CubeCanvasLayout.js.map +1 -0
  90. package/lib/components/canvas/CubeCanvasNode.d.ts +29 -0
  91. package/lib/components/canvas/CubeCanvasNode.d.ts.map +1 -0
  92. package/lib/components/canvas/CubeCanvasNode.js +75 -0
  93. package/lib/components/canvas/CubeCanvasNode.js.map +1 -0
  94. package/lib/components/editors/CubeColumnPicker.d.ts +47 -0
  95. package/lib/components/editors/CubeColumnPicker.d.ts.map +1 -0
  96. package/lib/components/editors/CubeColumnPicker.js +56 -0
  97. package/lib/components/editors/CubeColumnPicker.js.map +1 -0
  98. package/lib/components/editors/CubeDistinctEditor.d.ts +23 -0
  99. package/lib/components/editors/CubeDistinctEditor.d.ts.map +1 -0
  100. package/lib/components/editors/CubeDistinctEditor.js +24 -0
  101. package/lib/components/editors/CubeDistinctEditor.js.map +1 -0
  102. package/lib/components/editors/CubeFilterEditor.d.ts +26 -0
  103. package/lib/components/editors/CubeFilterEditor.d.ts.map +1 -0
  104. package/lib/components/editors/CubeFilterEditor.js +90 -0
  105. package/lib/components/editors/CubeFilterEditor.js.map +1 -0
  106. package/lib/components/editors/CubeIntegerField.d.ts +29 -0
  107. package/lib/components/editors/CubeIntegerField.d.ts.map +1 -0
  108. package/lib/components/editors/CubeIntegerField.js +30 -0
  109. package/lib/components/editors/CubeIntegerField.js.map +1 -0
  110. package/lib/components/editors/CubeJoinEditor.d.ts +26 -0
  111. package/lib/components/editors/CubeJoinEditor.d.ts.map +1 -0
  112. package/lib/components/editors/CubeJoinEditor.js +84 -0
  113. package/lib/components/editors/CubeJoinEditor.js.map +1 -0
  114. package/lib/components/editors/CubeNodeEditorPanel.d.ts +29 -0
  115. package/lib/components/editors/CubeNodeEditorPanel.d.ts.map +1 -0
  116. package/lib/components/editors/CubeNodeEditorPanel.js +72 -0
  117. package/lib/components/editors/CubeNodeEditorPanel.js.map +1 -0
  118. package/lib/components/editors/CubeNodeEditorRegistry.d.ts +44 -0
  119. package/lib/components/editors/CubeNodeEditorRegistry.d.ts.map +1 -0
  120. package/lib/components/editors/CubeNodeEditorRegistry.js +43 -0
  121. package/lib/components/editors/CubeNodeEditorRegistry.js.map +1 -0
  122. package/lib/components/editors/CubeRenameEditor.d.ts +26 -0
  123. package/lib/components/editors/CubeRenameEditor.d.ts.map +1 -0
  124. package/lib/components/editors/CubeRenameEditor.js +58 -0
  125. package/lib/components/editors/CubeRenameEditor.js.map +1 -0
  126. package/lib/components/editors/CubeRestrictEditor.d.ts +26 -0
  127. package/lib/components/editors/CubeRestrictEditor.d.ts.map +1 -0
  128. package/lib/components/editors/CubeRestrictEditor.js +23 -0
  129. package/lib/components/editors/CubeRestrictEditor.js.map +1 -0
  130. package/lib/components/editors/CubeRowCountEditor.d.ts +25 -0
  131. package/lib/components/editors/CubeRowCountEditor.d.ts.map +1 -0
  132. package/lib/components/editors/CubeRowCountEditor.js +38 -0
  133. package/lib/components/editors/CubeRowCountEditor.js.map +1 -0
  134. package/lib/components/editors/CubeSliceEditor.d.ts +25 -0
  135. package/lib/components/editors/CubeSliceEditor.d.ts.map +1 -0
  136. package/lib/components/editors/CubeSliceEditor.js +40 -0
  137. package/lib/components/editors/CubeSliceEditor.js.map +1 -0
  138. package/lib/components/editors/CubeSortEditor.d.ts +27 -0
  139. package/lib/components/editors/CubeSortEditor.d.ts.map +1 -0
  140. package/lib/components/editors/CubeSortEditor.js +72 -0
  141. package/lib/components/editors/CubeSortEditor.js.map +1 -0
  142. package/lib/components/editors/CubeSourceEditor.d.ts +25 -0
  143. package/lib/components/editors/CubeSourceEditor.d.ts.map +1 -0
  144. package/lib/components/editors/CubeSourceEditor.js +41 -0
  145. package/lib/components/editors/CubeSourceEditor.js.map +1 -0
  146. package/lib/components/editors/CubeValueEditor.d.ts +40 -0
  147. package/lib/components/editors/CubeValueEditor.d.ts.map +1 -0
  148. package/lib/components/editors/CubeValueEditor.js +178 -0
  149. package/lib/components/editors/CubeValueEditor.js.map +1 -0
  150. package/lib/components/grid/CubeGridRegion.d.ts +23 -0
  151. package/lib/components/grid/CubeGridRegion.d.ts.map +1 -0
  152. package/lib/components/grid/CubeGridRegion.js +94 -0
  153. package/lib/components/grid/CubeGridRegion.js.map +1 -0
  154. package/lib/components/grid/CubeGridValues.d.ts +25 -0
  155. package/lib/components/grid/CubeGridValues.d.ts.map +1 -0
  156. package/lib/components/grid/CubeGridValues.js +95 -0
  157. package/lib/components/grid/CubeGridValues.js.map +1 -0
  158. package/lib/components/grid/CubeResultGrid.d.ts +39 -0
  159. package/lib/components/grid/CubeResultGrid.d.ts.map +1 -0
  160. package/lib/components/grid/CubeResultGrid.js +86 -0
  161. package/lib/components/grid/CubeResultGrid.js.map +1 -0
  162. package/lib/components/palette/CubePalette.d.ts +29 -0
  163. package/lib/components/palette/CubePalette.d.ts.map +1 -0
  164. package/lib/components/palette/CubePalette.js +73 -0
  165. package/lib/components/palette/CubePalette.js.map +1 -0
  166. package/lib/components/show-pure/CubeShowPureDialog.d.ts +23 -0
  167. package/lib/components/show-pure/CubeShowPureDialog.d.ts.map +1 -0
  168. package/lib/components/show-pure/CubeShowPureDialog.js +37 -0
  169. package/lib/components/show-pure/CubeShowPureDialog.js.map +1 -0
  170. package/lib/components/source-picker/CubeSourcePicker.d.ts +22 -0
  171. package/lib/components/source-picker/CubeSourcePicker.d.ts.map +1 -0
  172. package/lib/components/source-picker/CubeSourcePicker.js +89 -0
  173. package/lib/components/source-picker/CubeSourcePicker.js.map +1 -0
  174. package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts +26 -0
  175. package/lib/components/spec-transfer/CubeSpecTransferDialog.d.ts.map +1 -0
  176. package/lib/components/spec-transfer/CubeSpecTransferDialog.js +45 -0
  177. package/lib/components/spec-transfer/CubeSpecTransferDialog.js.map +1 -0
  178. package/lib/graph-manager/CubeEngine.d.ts +128 -0
  179. package/lib/graph-manager/CubeEngine.d.ts.map +1 -0
  180. package/lib/graph-manager/CubeEngine.js +61 -0
  181. package/lib/graph-manager/CubeEngine.js.map +1 -0
  182. package/lib/graph-manager/CubeModelOutlineHelper.d.ts +33 -0
  183. package/lib/graph-manager/CubeModelOutlineHelper.d.ts.map +1 -0
  184. package/lib/graph-manager/CubeModelOutlineHelper.js +45 -0
  185. package/lib/graph-manager/CubeModelOutlineHelper.js.map +1 -0
  186. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts +26 -0
  187. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.d.ts.map +1 -0
  188. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js +22 -0
  189. package/lib/graph-manager/protocol/pure/CubeEngineBuilder.js.map +1 -0
  190. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts +27 -0
  191. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.d.ts.map +1 -0
  192. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js +76 -0
  193. package/lib/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.js.map +1 -0
  194. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts +27 -0
  195. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.d.ts.map +1 -0
  196. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js +82 -0
  197. package/lib/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.js.map +1 -0
  198. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts +32 -0
  199. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.d.ts.map +1 -0
  200. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js +195 -0
  201. package/lib/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.js.map +1 -0
  202. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts +20 -0
  203. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.d.ts.map +1 -0
  204. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js +174 -0
  205. package/lib/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.js.map +1 -0
  206. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts +24 -0
  207. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.d.ts.map +1 -0
  208. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js +43 -0
  209. package/lib/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.js.map +1 -0
  210. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts +45 -0
  211. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.d.ts.map +1 -0
  212. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js +171 -0
  213. package/lib/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.js.map +1 -0
  214. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts +22 -0
  215. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.d.ts.map +1 -0
  216. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js +79 -0
  217. package/lib/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.js.map +1 -0
  218. package/lib/index.css +17 -0
  219. package/lib/index.css.map +1 -0
  220. package/lib/index.d.ts +25 -0
  221. package/lib/index.d.ts.map +1 -0
  222. package/lib/index.js +24 -0
  223. package/lib/index.js.map +1 -0
  224. package/lib/stores/CubeEditorState.d.ts +236 -0
  225. package/lib/stores/CubeEditorState.d.ts.map +1 -0
  226. package/lib/stores/CubeEditorState.js +632 -0
  227. package/lib/stores/CubeEditorState.js.map +1 -0
  228. package/lib/stores/CubeExecutionState.d.ts +67 -0
  229. package/lib/stores/CubeExecutionState.d.ts.map +1 -0
  230. package/lib/stores/CubeExecutionState.js +212 -0
  231. package/lib/stores/CubeExecutionState.js.map +1 -0
  232. package/lib/stores/CubeGridQuickActions.d.ts +40 -0
  233. package/lib/stores/CubeGridQuickActions.d.ts.map +1 -0
  234. package/lib/stores/CubeGridQuickActions.js +86 -0
  235. package/lib/stores/CubeGridQuickActions.js.map +1 -0
  236. package/lib/stores/CubeHost.d.ts +31 -0
  237. package/lib/stores/CubeHost.d.ts.map +1 -0
  238. package/lib/stores/CubeHost.js +17 -0
  239. package/lib/stores/CubeHost.js.map +1 -0
  240. package/lib/stores/CubeNodeEditorState.d.ts +103 -0
  241. package/lib/stores/CubeNodeEditorState.d.ts.map +1 -0
  242. package/lib/stores/CubeNodeEditorState.js +262 -0
  243. package/lib/stores/CubeNodeEditorState.js.map +1 -0
  244. package/lib/stores/CubeShowPureState.d.ts +41 -0
  245. package/lib/stores/CubeShowPureState.d.ts.map +1 -0
  246. package/lib/stores/CubeShowPureState.js +100 -0
  247. package/lib/stores/CubeShowPureState.js.map +1 -0
  248. package/lib/stores/CubeSourcePickerState.d.ts +98 -0
  249. package/lib/stores/CubeSourcePickerState.d.ts.map +1 -0
  250. package/lib/stores/CubeSourcePickerState.js +334 -0
  251. package/lib/stores/CubeSourcePickerState.js.map +1 -0
  252. package/lib/stores/CubeSpecTransferState.d.ts +60 -0
  253. package/lib/stores/CubeSpecTransferState.d.ts.map +1 -0
  254. package/lib/stores/CubeSpecTransferState.js +167 -0
  255. package/lib/stores/CubeSpecTransferState.js.map +1 -0
  256. package/lib/stores/LocalModelCatalog.d.ts +37 -0
  257. package/lib/stores/LocalModelCatalog.d.ts.map +1 -0
  258. package/lib/stores/LocalModelCatalog.js +49 -0
  259. package/lib/stores/LocalModelCatalog.js.map +1 -0
  260. package/lib/stores/editors/CubeFilterDraft.d.ts +61 -0
  261. package/lib/stores/editors/CubeFilterDraft.d.ts.map +1 -0
  262. package/lib/stores/editors/CubeFilterDraft.js +186 -0
  263. package/lib/stores/editors/CubeFilterDraft.js.map +1 -0
  264. package/lib/stores/editors/CubeIntegerText.d.ts +24 -0
  265. package/lib/stores/editors/CubeIntegerText.d.ts.map +1 -0
  266. package/lib/stores/editors/CubeIntegerText.js +33 -0
  267. package/lib/stores/editors/CubeIntegerText.js.map +1 -0
  268. package/lib/stores/editors/CubeJoinDraft.d.ts +71 -0
  269. package/lib/stores/editors/CubeJoinDraft.d.ts.map +1 -0
  270. package/lib/stores/editors/CubeJoinDraft.js +145 -0
  271. package/lib/stores/editors/CubeJoinDraft.js.map +1 -0
  272. package/lib/stores/editors/CubeNodeDraft.d.ts +38 -0
  273. package/lib/stores/editors/CubeNodeDraft.d.ts.map +1 -0
  274. package/lib/stores/editors/CubeNodeDraft.js +35 -0
  275. package/lib/stores/editors/CubeNodeDraft.js.map +1 -0
  276. package/lib/stores/editors/CubeNodeDraftRegistry.d.ts +35 -0
  277. package/lib/stores/editors/CubeNodeDraftRegistry.d.ts.map +1 -0
  278. package/lib/stores/editors/CubeNodeDraftRegistry.js +55 -0
  279. package/lib/stores/editors/CubeNodeDraftRegistry.js.map +1 -0
  280. package/lib/stores/editors/CubeRenameDraft.d.ts +44 -0
  281. package/lib/stores/editors/CubeRenameDraft.d.ts.map +1 -0
  282. package/lib/stores/editors/CubeRenameDraft.js +79 -0
  283. package/lib/stores/editors/CubeRenameDraft.js.map +1 -0
  284. package/lib/stores/editors/CubeRestrictDraft.d.ts +37 -0
  285. package/lib/stores/editors/CubeRestrictDraft.d.ts.map +1 -0
  286. package/lib/stores/editors/CubeRestrictDraft.js +73 -0
  287. package/lib/stores/editors/CubeRestrictDraft.js.map +1 -0
  288. package/lib/stores/editors/CubeRowCountDraft.d.ts +42 -0
  289. package/lib/stores/editors/CubeRowCountDraft.d.ts.map +1 -0
  290. package/lib/stores/editors/CubeRowCountDraft.js +55 -0
  291. package/lib/stores/editors/CubeRowCountDraft.js.map +1 -0
  292. package/lib/stores/editors/CubeSliceDraft.d.ts +42 -0
  293. package/lib/stores/editors/CubeSliceDraft.d.ts.map +1 -0
  294. package/lib/stores/editors/CubeSliceDraft.js +72 -0
  295. package/lib/stores/editors/CubeSliceDraft.js.map +1 -0
  296. package/lib/stores/editors/CubeSortDraft.d.ts +49 -0
  297. package/lib/stores/editors/CubeSortDraft.d.ts.map +1 -0
  298. package/lib/stores/editors/CubeSortDraft.js +99 -0
  299. package/lib/stores/editors/CubeSortDraft.js.map +1 -0
  300. package/lib/stores/fixtures/CubeNorthwindModel.d.ts +23 -0
  301. package/lib/stores/fixtures/CubeNorthwindModel.d.ts.map +1 -0
  302. package/lib/stores/fixtures/CubeNorthwindModel.js +338 -0
  303. package/lib/stores/fixtures/CubeNorthwindModel.js.map +1 -0
  304. package/package.json +81 -3
  305. package/src/__lib__/LegendCubeCommand.ts +44 -0
  306. package/src/__lib__/LegendCubeHelpText.ts +58 -0
  307. package/src/__lib__/LegendCubeLabels.ts +171 -0
  308. package/src/__lib__/LegendCubeTesting.ts +33 -0
  309. package/src/__test-utils__/CubeCanvasTestUtils.ts +53 -0
  310. package/src/__test-utils__/CubeEngineTestSupport.ts +172 -0
  311. package/src/__test-utils__/CubeNorthwindTestQueries.ts +165 -0
  312. package/src/__test-utils__/CubeOperationsTestUtils.ts +177 -0
  313. package/src/__test-utils__/CubePageTestUtils.tsx +96 -0
  314. package/src/__test-utils__/CubeTestApplication.ts +82 -0
  315. package/src/__test-utils__/FakeCubeEngine.ts +145 -0
  316. package/src/components/CubeButton.tsx +35 -0
  317. package/src/components/CubeEditor.tsx +239 -0
  318. package/src/components/CubeNodeIcon.tsx +64 -0
  319. package/src/components/canvas/CubeCanvas.tsx +262 -0
  320. package/src/components/canvas/CubeCanvasContext.ts +31 -0
  321. package/src/components/canvas/CubeCanvasContextMenu.tsx +89 -0
  322. package/src/components/canvas/CubeCanvasDnd.ts +82 -0
  323. package/src/components/canvas/CubeCanvasEdge.tsx +57 -0
  324. package/src/components/canvas/CubeCanvasElements.ts +153 -0
  325. package/src/components/canvas/CubeCanvasLayout.ts +88 -0
  326. package/src/components/canvas/CubeCanvasNode.tsx +149 -0
  327. package/src/components/editors/CubeColumnPicker.tsx +138 -0
  328. package/src/components/editors/CubeDistinctEditor.tsx +28 -0
  329. package/src/components/editors/CubeFilterEditor.tsx +309 -0
  330. package/src/components/editors/CubeIntegerField.tsx +51 -0
  331. package/src/components/editors/CubeJoinEditor.tsx +247 -0
  332. package/src/components/editors/CubeNodeEditorPanel.tsx +215 -0
  333. package/src/components/editors/CubeNodeEditorRegistry.ts +81 -0
  334. package/src/components/editors/CubeRenameEditor.tsx +143 -0
  335. package/src/components/editors/CubeRestrictEditor.tsx +103 -0
  336. package/src/components/editors/CubeRowCountEditor.tsx +53 -0
  337. package/src/components/editors/CubeSliceEditor.tsx +69 -0
  338. package/src/components/editors/CubeSortEditor.tsx +206 -0
  339. package/src/components/editors/CubeSourceEditor.tsx +106 -0
  340. package/src/components/editors/CubeValueEditor.tsx +333 -0
  341. package/src/components/grid/CubeGridRegion.tsx +275 -0
  342. package/src/components/grid/CubeGridValues.ts +125 -0
  343. package/src/components/grid/CubeResultGrid.tsx +138 -0
  344. package/src/components/palette/CubePalette.tsx +177 -0
  345. package/src/components/show-pure/CubeShowPureDialog.tsx +101 -0
  346. package/src/components/source-picker/CubeSourcePicker.tsx +304 -0
  347. package/src/components/spec-transfer/CubeSpecTransferDialog.tsx +157 -0
  348. package/src/graph-manager/CubeEngine.ts +169 -0
  349. package/src/graph-manager/CubeModelOutlineHelper.ts +58 -0
  350. package/src/graph-manager/protocol/pure/CubeEngineBuilder.ts +34 -0
  351. package/src/graph-manager/protocol/pure/v1/V1_CubeEngineErrors.ts +109 -0
  352. package/src/graph-manager/protocol/pure/v1/V1_CubeExecutionResultReader.ts +115 -0
  353. package/src/graph-manager/protocol/pure/v1/V1_CubeLambdaSerializer.ts +257 -0
  354. package/src/graph-manager/protocol/pure/v1/V1_CubeModelOutlineBuilder.ts +243 -0
  355. package/src/graph-manager/protocol/pure/v1/V1_CubeRelationTypeAdapter.ts +58 -0
  356. package/src/graph-manager/protocol/pure/v1/V1_LegendCubeEngine.ts +278 -0
  357. package/src/graph-manager/protocol/pure/v1/__test-utils__/V1_CubeEngineTestUtils.ts +127 -0
  358. package/src/index.ts +41 -0
  359. package/src/stores/CubeEditorState.ts +807 -0
  360. package/src/stores/CubeExecutionState.ts +288 -0
  361. package/src/stores/CubeGridQuickActions.ts +129 -0
  362. package/src/stores/CubeHost.ts +32 -0
  363. package/src/stores/CubeNodeEditorState.ts +324 -0
  364. package/src/stores/CubeShowPureState.ts +118 -0
  365. package/src/stores/CubeSourcePickerState.ts +426 -0
  366. package/src/stores/CubeSpecTransferState.ts +198 -0
  367. package/src/stores/LocalModelCatalog.ts +70 -0
  368. package/src/stores/editors/CubeFilterDraft.ts +241 -0
  369. package/src/stores/editors/CubeIntegerText.ts +34 -0
  370. package/src/stores/editors/CubeJoinDraft.ts +224 -0
  371. package/src/stores/editors/CubeNodeDraft.ts +46 -0
  372. package/src/stores/editors/CubeNodeDraftRegistry.ts +83 -0
  373. package/src/stores/editors/CubeRenameDraft.ts +110 -0
  374. package/src/stores/editors/CubeRestrictDraft.ts +83 -0
  375. package/src/stores/editors/CubeRowCountDraft.ts +69 -0
  376. package/src/stores/editors/CubeSliceDraft.ts +87 -0
  377. package/src/stores/editors/CubeSortDraft.ts +135 -0
  378. package/src/stores/fixtures/CubeNorthwindModel.ts +355 -0
  379. package/tsconfig.json +133 -0
@@ -0,0 +1,56 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2026-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { CalendarIcon, clsx, HashtagIcon, ListIcon, QuestionIcon, StringTypeIcon, ToggleIcon, } from '@finos/legend-art';
18
+ import { TypeFamily, } from '@finos/legend-cube';
19
+ import { getColumnTypeLabel } from '../../__lib__/LegendCubeLabels.js';
20
+ const FAMILY_ICONS = {
21
+ [TypeFamily.STRING]: StringTypeIcon,
22
+ [TypeFamily.BOOLEAN]: ToggleIcon,
23
+ [TypeFamily.INTEGER]: HashtagIcon,
24
+ [TypeFamily.FLOAT]: HashtagIcon,
25
+ [TypeFamily.DECIMAL]: HashtagIcon,
26
+ [TypeFamily.NUMBER]: HashtagIcon,
27
+ [TypeFamily.STRICT_DATE]: CalendarIcon,
28
+ [TypeFamily.DATETIME]: CalendarIcon,
29
+ [TypeFamily.DATE]: CalendarIcon,
30
+ [TypeFamily.ENUM]: ListIcon,
31
+ };
32
+ /** The icon of a column type's family: text, number, date, ...; a question mark for the rest */
33
+ export const CubeColumnTypeIcon = (props) => {
34
+ const Icon = FAMILY_ICONS[props.type.family] ?? QuestionIcon;
35
+ return _jsx(Icon, { className: clsx('shrink-0', props.className) });
36
+ };
37
+ /**
38
+ * Picks a column of an input schema, in schema order (spec §17.5: only the
39
+ * columns of the actual input). Each option names its type, e.g.
40
+ * `CUSTOMER_ID: Varchar(5)?`; the picked column's type shows beside, with
41
+ * its family's icon and its full type in the tooltip. A column the input
42
+ * doesn't have stays shown, so the problem can be seen and fixed. A column
43
+ * the editor can't take here is shown, with the reason `isColumnDisabled`
44
+ * gives after its type, but can't be picked.
45
+ */
46
+ export const CubeColumnPicker = (props) => {
47
+ const { label, schema, value, onChange, disabled, invalid, isColumnDisabled, } = props;
48
+ const picked = value ? schema.lookup(value) : undefined;
49
+ return (_jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [_jsxs("select", { "aria-label": label, "aria-invalid": Boolean(invalid) || (Boolean(value) && !picked), className: clsx('h-6 min-w-0 flex-1 rounded-sm border bg-[var(--color-bg-input)] px-1 text-base', invalid || (value && !picked)
50
+ ? 'border-[var(--color-status-error)]'
51
+ : 'border-[var(--color-border-default)]'), value: value ?? '', disabled: disabled, onChange: (event) => onChange(event.target.value), children: [!picked && (_jsx("option", { value: value ?? '', disabled: true, children: value ? `${value} (not in the input)` : 'Pick a column' })), schema.columns.map((column) => {
52
+ const reason = isColumnDisabled?.(column);
53
+ return (_jsx("option", { value: column.name, title: column.type.fullName, disabled: reason !== undefined, children: `${column.name}: ${getColumnTypeLabel(column)}${reason === undefined ? '' : ` (${reason})`}` }, column.name));
54
+ })] }), picked && (_jsxs("span", { className: "flex shrink-0 items-center gap-1 text-sm text-[var(--color-text-secondary)]", title: picked.type.fullName, children: [_jsx(CubeColumnTypeIcon, { type: picked.type }), getColumnTypeLabel(picked)] }))] }));
55
+ };
56
+ //# sourceMappingURL=CubeColumnPicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeColumnPicker.js","sourceRoot":"","sources":["../../../src/components/editors/CubeColumnPicker.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,YAAY,EACZ,cAAc,EACd,UAAU,GACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAIL,UAAU,GACX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAEvE,MAAM,YAAY,GAEd;IACF,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,cAAc;IACnC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,UAAU;IAChC,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,WAAW;IACjC,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,WAAW;IAC/B,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,WAAW;IACjC,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,WAAW;IAChC,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,YAAY;IACtC,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,YAAY;IACnC,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,YAAY;IAC/B,CAAC,UAAU,CAAC,IAAI,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KAAK,qBAAqB,CAAC,CAAC,CAAC,eAAe,GACjD,CACV,EACA,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;wBAC7B,MAAM,MAAM,GAAG,gBAAgB,EAAE,CAAC,MAAM,CAAC,CAAC;wBAC1C,OAAO,CACL,iBAEE,KAAK,EAAE,MAAM,CAAC,IAAI,EAClB,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,EAC3B,QAAQ,EAAE,MAAM,KAAK,SAAS,YAE7B,GAAG,MAAM,CAAC,IAAI,KAAK,kBAAkB,CAAC,MAAM,CAAC,GAAG,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,MAAM,GAAG,EAAE,IALxF,MAAM,CAAC,IAAI,CAMT,CACV,CAAC;oBACJ,CAAC,CAAC,IACK,EACR,MAAM,IAAI,CACT,gBACE,SAAS,EAAC,6EAA6E,EACvF,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,QAAQ,aAE3B,KAAC,kBAAkB,IAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAI,EACxC,kBAAkB,CAAC,MAAM,CAAC,IACtB,CACR,IACG,CACP,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * The Distinct editor (spec §17.6: "nothing — description only"). Distinct
18
+ * has no settings, so it has no draft, and the panel shows no Apply or Cancel.
19
+ */
20
+ export declare const CubeDistinctEditor: (() => import("react/jsx-runtime").JSX.Element) & {
21
+ displayName: string;
22
+ };
23
+ //# sourceMappingURL=CubeDistinctEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeDistinctEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeDistinctEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;CAI7B,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2026-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { observer } from 'mobx-react-lite';
18
+ import { DISTINCT_EDITOR_TEXT } from '../../__lib__/LegendCubeLabels.js';
19
+ /**
20
+ * The Distinct editor (spec §17.6: "nothing — description only"). Distinct
21
+ * has no settings, so it has no draft, and the panel shows no Apply or Cancel.
22
+ */
23
+ export const CubeDistinctEditor = observer(() => (_jsx("div", { className: "text-base text-[var(--color-text-secondary)]", children: DISTINCT_EDITOR_TEXT })));
24
+ //# sourceMappingURL=CubeDistinctEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeDistinctEditor.js","sourceRoot":"","sources":["../../../src/components/editors/CubeDistinctEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAEzE;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,CAC/C,cAAK,SAAS,EAAC,8CAA8C,YAC1D,oBAAoB,GACjB,CACP,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { CubeNodeEditorProps } from './CubeNodeEditorRegistry.js';
17
+ /**
18
+ * The Filter editor (spec §8.5): conditions of a column, an operator and a
19
+ * value, in And/Or groups, each of which can be negated. Operators follow
20
+ * the column's type; values are read as its type, and text that isn't one is
21
+ * kept, marked, to be fixed. Blank conditions are not stored.
22
+ */
23
+ export declare const CubeFilterEditor: ((props: CubeNodeEditorProps) => import("react/jsx-runtime").JSX.Element) & {
24
+ displayName: string;
25
+ };
26
+ //# sourceMappingURL=CubeFilterEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeFilterEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeFilterEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA4BH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAmPvE;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,WAAoB,mBAAmB;;CAiBlE,CAAC"}
@@ -0,0 +1,90 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2026-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { clsx, TimesIcon } from '@finos/legend-art';
18
+ import { ColumnComparisonFilter, CompositeFilter, CompositeFilterOperator, FILTER_OPERATOR_DESCRIPTIONS, getAvailableOperators, getFilterValueShape, isExactFloatComparison, isFilterOperator, MESSAGE_FILTER_UNSUPPORTED, NEGATIVE_OPERATORS, NotFilter, } from '@finos/legend-cube';
19
+ import { guaranteeType } from '@finos/legend-shared';
20
+ import { observer } from 'mobx-react-lite';
21
+ import { FILTER_FLOAT_COMPARISON_HINT, FILTER_NULL_NOTE, } from '../../__lib__/LegendCubeLabels.js';
22
+ import { LEGEND_CUBE_TEST_ID } from '../../__lib__/LegendCubeTesting.js';
23
+ import { CubeFilterDraft } from '../../stores/editors/CubeFilterDraft.js';
24
+ import { CubeButton } from '../CubeButton.js';
25
+ import { CubeColumnPicker } from './CubeColumnPicker.js';
26
+ import { CubeValueEditor } from './CubeValueEditor.js';
27
+ const SMALL_BUTTON = 'flex h-6 shrink-0 items-center justify-center rounded-sm px-1 text-sm text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] disabled:text-[var(--color-text-disabled)]';
28
+ const CubeRemoveRuleButton = (props) => (_jsx("button", { className: SMALL_BUTTON, "aria-label": props.label, title: props.label, disabled: props.readOnly, onClick: () => props.draft.removeRule(props.rule.key), children: _jsx(TimesIcon, {}) }));
29
+ /**
30
+ * A condition: column, operator and its negation and removal on one line,
31
+ * the value below, with the whole width of the panel
32
+ */
33
+ const CubeFilterCondition = observer((props) => {
34
+ const { draft, schema, readOnly, rule, negation } = props;
35
+ const type = schema.type(rule.columnName);
36
+ const operators = type ? getAvailableOperators(type) : [];
37
+ const shape = getFilterValueShape(rule.operator);
38
+ const isNegated = negation !== undefined || NEGATIVE_OPERATORS.includes(rule.operator);
39
+ return (_jsxs("li", { className: "flex flex-col gap-1 py-1", "data-testid": LEGEND_CUBE_TEST_ID.FILTER_CONDITION, children: [_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("div", { className: "min-w-0 flex-1", children: _jsx(CubeColumnPicker, { label: "Filter column", schema: schema, value: rule.columnName, disabled: readOnly, onChange: (name) => draft.setColumn(rule.key, name, schema) }) }), _jsxs("select", { "aria-label": "Filter operator", className: "h-6 min-w-0 max-w-[45%] shrink rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] px-1 text-base", value: rule.operator, disabled: readOnly || !type, onChange: (event) => {
40
+ if (isFilterOperator(event.target.value)) {
41
+ draft.setOperator(rule.key, event.target.value);
42
+ }
43
+ }, children: [!operators.includes(rule.operator) && (_jsx("option", { value: rule.operator, disabled: true, children: FILTER_OPERATOR_DESCRIPTIONS[rule.operator] })), operators.map((operator) => (_jsx("option", { value: operator, children: FILTER_OPERATOR_DESCRIPTIONS[operator] }, operator)))] }), _jsx("button", { className: clsx(SMALL_BUTTON, {
44
+ 'text-[var(--color-accent)]': isNegated,
45
+ }), "aria-label": "Negate the condition", "aria-pressed": isNegated, title: "Negate the condition, e.g. is and is not", disabled: readOnly || !type,
46
+ // a condition in a Not leaves it; otherwise its operator turns
47
+ onClick: () => draft.toggleNegation(negation?.key ?? rule.key), children: "Not" }), _jsx(CubeRemoveRuleButton, { ...props, label: "Remove the condition" })] }), type && shape !== 'none' && (_jsx("div", { className: "flex min-w-0", children: _jsx(CubeValueEditor, { label: "Filter value", type: type, shape: shape, value: rule.value, disabled: readOnly, onChange: (value) => draft.setValue(rule.key, value) }) })), type && isExactFloatComparison(rule.operator, type) && (_jsx("div", { className: "text-sm text-[var(--color-text-secondary)]", children: FILTER_FLOAT_COMPARISON_HINT }))] }));
48
+ });
49
+ /** Any rule of the tree, by kind */
50
+ const CubeFilterRuleEditor = observer((props) => {
51
+ const { rule } = props;
52
+ if (rule instanceof ColumnComparisonFilter) {
53
+ return _jsx(CubeFilterCondition, { ...props, rule: rule });
54
+ }
55
+ if (rule instanceof CompositeFilter) {
56
+ return (_jsx("li", { children: _jsx(CubeFilterGroup, { ...props, group: rule, isTop: false }) }));
57
+ }
58
+ if (rule instanceof NotFilter) {
59
+ return (_jsxs("li", { className: "flex items-start gap-1", children: [_jsx("button", { className: clsx(SMALL_BUTTON, 'text-[var(--color-accent)]'), "aria-label": "Remove the negation", "aria-pressed": true, title: "Remove the negation", disabled: props.readOnly, onClick: () => props.draft.toggleNegation(rule.key), children: "Not" }), _jsx("ul", { className: "min-w-0 flex-1", children: _jsx(CubeFilterRuleEditor, { ...props, rule: rule.rule, negation: rule }) })] }));
60
+ }
61
+ // a rule this version can't read stays as it is
62
+ return (_jsxs("li", { className: "flex items-center gap-1 py-1 text-base text-[var(--color-status-warn)]", children: [_jsx("span", { className: "flex-1", children: MESSAGE_FILTER_UNSUPPORTED }), _jsx(CubeRemoveRuleButton, { ...props, label: "Remove the filter" })] }));
63
+ });
64
+ /** An And/Or group: its rules, and buttons to add to it */
65
+ const CubeFilterGroup = observer((props) => {
66
+ const { draft, readOnly, group, isTop, negation } = props;
67
+ return (_jsxs("div", { className: clsx('flex flex-col gap-1', {
68
+ 'rounded-sm border border-[var(--color-border-subtle)] p-1': !isTop,
69
+ }), children: [_jsxs("div", { className: "flex items-center gap-1 text-sm", children: [_jsxs("select", { "aria-label": isTop ? 'Combine the conditions with' : 'Combine the group with', className: "h-6 rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] px-1 text-base", value: group.operator, disabled: readOnly, onChange: (event) => draft.setGroupOperator(group.key, event.target.value === CompositeFilterOperator.OR
70
+ ? CompositeFilterOperator.OR
71
+ : CompositeFilterOperator.AND), children: [_jsx("option", { value: CompositeFilterOperator.AND, children: "All of (and)" }), _jsx("option", { value: CompositeFilterOperator.OR, children: "Any of (or)" })] }), _jsx("span", { className: "flex-1" }), !isTop && (_jsxs(_Fragment, { children: [_jsx("button", { className: clsx(SMALL_BUTTON, {
72
+ 'text-[var(--color-accent)]': negation !== undefined,
73
+ }), "aria-label": "Negate the group", "aria-pressed": negation !== undefined, title: "Keep the rows the group doesn't match", disabled: readOnly,
74
+ // a group in a Not leaves it
75
+ onClick: () => draft.toggleNegation(negation?.key ?? group.key), children: "Not" }), _jsx(CubeRemoveRuleButton, { ...props, rule: group, label: "Remove the group" })] }))] }), _jsx("ul", { className: "flex flex-col pl-2", children: group.rules.map((rule) => (_jsx(CubeFilterRuleEditor, { ...props, rule: rule,
76
+ // the group's Not is not its rules'
77
+ negation: undefined }, rule.key))) }), _jsxs("div", { className: "flex gap-1", children: [_jsx(CubeButton, { disabled: readOnly, onClick: () => draft.addCondition(group.key), children: isTop ? 'Add condition' : 'Add condition to the group' }), _jsx(CubeButton, { disabled: readOnly, onClick: () => draft.addGroup(group.key), children: isTop ? 'Add group' : 'Add group to the group' })] })] }));
78
+ });
79
+ /**
80
+ * The Filter editor (spec §8.5): conditions of a column, an operator and a
81
+ * value, in And/Or groups, each of which can be negated. Operators follow
82
+ * the column's type; values are read as its type, and text that isn't one is
83
+ * kept, marked, to be fixed. Blank conditions are not stored.
84
+ */
85
+ export const CubeFilterEditor = observer((props) => {
86
+ const draft = guaranteeType(props.draft, CubeFilterDraft);
87
+ const [schema] = props.inputSchemas;
88
+ return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx(CubeFilterGroup, { draft: draft, schema: schema, readOnly: props.readOnly, group: draft.tree, isTop: true }), _jsx("div", { className: "text-sm text-[var(--color-text-secondary)]", children: FILTER_NULL_NOTE })] }));
89
+ });
90
+ //# sourceMappingURL=CubeFilterEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,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AI,EACjB,KAAK,EAAE,IAAI,GACX,EACF,cAAK,SAAS,EAAC,4CAA4C,YACxD,gBAAgB,GACb,IACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ /**
17
+ * A field for a whole number, such as a size or a row index. It shows the
18
+ * text as typed and reports every keystroke, so the panel checks the edited
19
+ * node as the user types. Enter and Escape do nothing special: Apply is the
20
+ * panel's, and Ctrl+Z is the field's own undo.
21
+ */
22
+ export declare const CubeIntegerField: React.FC<{
23
+ label: string;
24
+ text: string;
25
+ invalid: boolean;
26
+ disabled: boolean;
27
+ onChange: (text: string) => void;
28
+ }>;
29
+ //# sourceMappingURL=CubeIntegerField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeIntegerField.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeIntegerField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAClC,CAoBA,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2026-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { clsx } from '@finos/legend-art';
18
+ /**
19
+ * A field for a whole number, such as a size or a row index. It shows the
20
+ * text as typed and reports every keystroke, so the panel checks the edited
21
+ * node as the user types. Enter and Escape do nothing special: Apply is the
22
+ * panel's, and Ctrl+Z is the field's own undo.
23
+ */
24
+ export const CubeIntegerField = (props) => {
25
+ const { label, text, invalid, disabled, onChange } = props;
26
+ return (_jsx("input", { "aria-label": label, "aria-invalid": invalid, className: clsx('h-6 w-24 rounded-sm border bg-[var(--color-bg-input)] px-1 text-base', invalid
27
+ ? 'border-[var(--color-status-error)] text-[var(--color-status-error)]'
28
+ : 'border-[var(--color-border-default)]'), type: "text", inputMode: "numeric", spellCheck: false, value: text, disabled: disabled, onChange: (event) => onChange(event.target.value) }));
29
+ };
30
+ //# sourceMappingURL=CubeIntegerField.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeIntegerField.js","sourceRoot":"","sources":["../../../src/components/editors/CubeIntegerField.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAMxB,CAAC,KAAK,EAAE,EAAE;IACb,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC3D,OAAO,CACL,8BACc,KAAK,kBACH,OAAO,EACrB,SAAS,EAAE,IAAI,CACb,sEAAsE,EACtE,OAAO;YACL,CAAC,CAAC,qEAAqE;YACvE,CAAC,CAAC,sCAAsC,CAC3C,EACD,IAAI,EAAC,MAAM,EACX,SAAS,EAAC,SAAS,EACnB,UAAU,EAAE,KAAK,EACjB,KAAK,EAAE,IAAI,EACX,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,GACjD,CACH,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { CubeNodeEditorProps } from './CubeNodeEditorRegistry.js';
17
+ /**
18
+ * The Join editor (spec §17.6): the join type, pairs of key columns, a left
19
+ * one from the Left input and a right one from the Right input, and Swap
20
+ * Inputs. A pair whose types can't be compared is marked; one on a column
21
+ * Cube can't type is warned about, not blocked.
22
+ */
23
+ export declare const CubeJoinEditor: ((props: CubeNodeEditorProps) => import("react/jsx-runtime").JSX.Element) & {
24
+ displayName: string;
25
+ };
26
+ //# sourceMappingURL=CubeJoinEditor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeJoinEditor.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeJoinEditor.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA4BH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAgFvE;;;;;GAKG;AACH,eAAO,MAAM,cAAc,WAAoB,mBAAmB;;CAsHhE,CAAC"}
@@ -0,0 +1,84 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2026-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { TimesIcon } from '@finos/legend-art';
18
+ import { areCompatibleTypes, getDuplicateJoinColumns, isJoinType, JOIN_TYPE_LABELS, JOIN_TYPES, planJoinDuplicateFix, } from '@finos/legend-cube';
19
+ import { guaranteeType, noop } from '@finos/legend-shared';
20
+ import { flowResult } from 'mobx';
21
+ import { observer } from 'mobx-react-lite';
22
+ import { useEffect } from 'react';
23
+ import { CUBE_TABLE_FLAG_LABELS, READ_ONLY_CUBE_TITLE, } from '../../__lib__/LegendCubeLabels.js';
24
+ import { CubeTableFlag } from '../../graph-manager/CubeEngine.js';
25
+ import { CubeJoinDraft, isUntypedColumn, } from '../../stores/editors/CubeJoinDraft.js';
26
+ import { CubeButton } from '../CubeButton.js';
27
+ import { CubeColumnPicker } from './CubeColumnPicker.js';
28
+ const TYPE_UNKNOWN = CUBE_TABLE_FLAG_LABELS[CubeTableFlag.TYPE_UNKNOWN];
29
+ const CubeJoinKeyRow = observer((props) => {
30
+ const { editorProps, draft, pair, index, leftSchema, rightSchema } = props;
31
+ const { editorState, readOnly } = editorProps;
32
+ const { query } = editorState.document;
33
+ const { analysis, modelOutline } = editorState;
34
+ const [leftId, rightId] = query.getInputIds(draft.original.id);
35
+ const leftType = leftSchema.type(pair.left);
36
+ const rightType = rightSchema.type(pair.right);
37
+ const isIncompatible = leftType !== undefined &&
38
+ rightType !== undefined &&
39
+ !areCompatibleTypes(leftType, rightType);
40
+ const isUntyped = (leftId !== undefined &&
41
+ Boolean(pair.left) &&
42
+ isUntypedColumn(modelOutline, query, analysis, leftId, pair.left)) ||
43
+ (rightId !== undefined &&
44
+ Boolean(pair.right) &&
45
+ isUntypedColumn(modelOutline, query, analysis, rightId, pair.right));
46
+ const position = index + 1;
47
+ return (_jsxs("li", { className: "flex flex-col gap-1 border-b border-[var(--color-border-subtle)] py-1", children: [_jsxs("div", { className: "grid grid-cols-[1fr_auto_1fr_auto] items-center gap-1", children: [_jsx(CubeColumnPicker, { label: `Left join column ${position}`, schema: leftSchema, value: pair.left, invalid: isIncompatible, disabled: readOnly, onChange: (name) => draft.setLeftColumn(pair.key, name) }), _jsx("span", { className: "text-[var(--color-text-secondary)]", children: "=" }), _jsx(CubeColumnPicker, { label: `Right join column ${position}`, schema: rightSchema, value: pair.right, invalid: isIncompatible, disabled: readOnly, onChange: (name) => draft.setRightColumn(pair.key, name) }), _jsx("button", { className: "flex h-6 w-6 items-center justify-center text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)] disabled:text-[var(--color-text-disabled)]", "aria-label": `Remove join columns ${position}`, title: "Remove these join columns", disabled: readOnly, onClick: () => draft.removePair(pair.key), children: _jsx(TimesIcon, {}) })] }), isIncompatible && (_jsx("div", { className: "text-sm text-[var(--color-status-error)]", children: `${leftType.displayName} and ${rightType.displayName} can't be compared` })), isUntyped && (_jsx("div", { className: "text-sm text-[var(--color-status-warn)]", title: TYPE_UNKNOWN.description, children: `${TYPE_UNKNOWN.label}: the column's real type is not known to Cube, so the engine may not match its values` }))] }));
48
+ });
49
+ /**
50
+ * The Join editor (spec §17.6): the join type, pairs of key columns, a left
51
+ * one from the Left input and a right one from the Right input, and Swap
52
+ * Inputs. A pair whose types can't be compared is marked; one on a column
53
+ * Cube can't type is warned about, not blocked.
54
+ */
55
+ export const CubeJoinEditor = observer((props) => {
56
+ const { editorState, inputSchemas, readOnly } = props;
57
+ const draft = guaranteeType(props.draft, CubeJoinDraft);
58
+ const [leftSchema, rightSchema] = inputSchemas;
59
+ const model = editorState.document.context?.model;
60
+ useEffect(() => {
61
+ flowResult(editorState.loadModelOutline()).catch(noop());
62
+ }, [editorState, model]);
63
+ const edited = draft.build();
64
+ const duplicates = getDuplicateJoinColumns(leftSchema, rightSchema, edited.leftColumns, edited.rightColumns);
65
+ // the names the autofix would give, to show beside each shared column
66
+ const fix = duplicates.length
67
+ ? planJoinDuplicateFix(edited, leftSchema, rightSchema)
68
+ : undefined;
69
+ const canAddPair = !readOnly &&
70
+ draft.pairs.length <
71
+ Math.min(leftSchema.columns.length, rightSchema.columns.length);
72
+ return (_jsxs("div", { className: "flex flex-col gap-2 text-base", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsxs("label", { className: "flex items-center gap-2", children: ["Join type", _jsx("select", { className: "h-6 rounded-sm border border-[var(--color-border-default)] bg-[var(--color-bg-input)] px-1 text-base", value: draft.joinType, disabled: readOnly, onChange: (event) => {
73
+ if (isJoinType(event.target.value)) {
74
+ draft.setJoinType(event.target.value);
75
+ }
76
+ }, children: JOIN_TYPES.map((joinType) => (_jsx("option", { value: joinType, children: JOIN_TYPE_LABELS[joinType] }, joinType))) })] }), _jsx("span", { className: "flex-1" }), _jsx(CubeButton, { title: "Swap the Left and Right inputs; the join columns follow them. Applies your changes too.", disabled: !editorState.nodeEditor.canSwapInputs, onClick: () => editorState.nodeEditor.swapInputs(), children: "Swap Inputs" })] }), _jsxs("div", { className: "grid grid-cols-[1fr_auto_1fr_auto] gap-1 text-sm text-[var(--color-text-secondary)]", children: [_jsx("span", { children: "Left" }), _jsx("span", {}), _jsx("span", { children: "Right" }), _jsx("span", {})] }), _jsx("ul", { "aria-label": "Join columns", children: draft.pairs.map((pair, index) => (_jsx(CubeJoinKeyRow, { editorProps: props, draft: draft, pair: pair, index: index, leftSchema: leftSchema, rightSchema: rightSchema }, pair.key))) }), _jsx("div", { children: _jsx(CubeButton, { title: canAddPair
77
+ ? 'Add a pair of join columns'
78
+ : 'Every column of an input is already a join column', disabled: !canAddPair, onClick: () => draft.addPair(), children: "Add join columns" }) }), duplicates.length > 0 && (_jsxs("div", { className: "text-sm text-[var(--color-status-warn)]", children: [_jsx("div", { children: "In both inputs and not joined on, so the output can't keep both:" }), _jsx("ul", { "aria-label": "Columns in both inputs", children: duplicates.map((name, index) => (_jsx("li", { className: "font-mono", children: fix
79
+ ? `${name} → ${fix.left[index]?.to} (Left), ${fix.right[index]?.to} (Right)`
80
+ : name }, name))) }), _jsx("div", { className: "mt-1", children: _jsx(CubeButton, { title: readOnly
81
+ ? READ_ONLY_CUBE_TITLE
82
+ : 'Add a Rename before each input that gives these columns new names. Applies your changes too, as one step to undo.', disabled: !editorState.nodeEditor.canRenameDuplicateColumns, onClick: () => editorState.nodeEditor.renameDuplicateColumns(), children: "Rename them" }) })] }))] }));
83
+ });
84
+ //# sourceMappingURL=CubeJoinEditor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeJoinEditor.js","sourceRoot":"","sources":["../../../src/components/editors/CubeJoinEditor.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACvB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,oBAAoB,GAErB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAA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,EACV,KAAK,EAAE,KAAK,EACZ,UAAU,EAAE,UAAU,EACtB,WAAW,EAAE,WAAW,IANnB,IAAI,CAAC,GAAG,CAOb,CACH,CAAC,GACC,EACL,wBACE,KAAC,UAAU,IACT,KAAK,EACH,UAAU;wBACR,CAAC,CAAC,4BAA4B;wBAC9B,CAAC,CAAC,mDAAmD,EAEzD,QAAQ,EAAE,CAAC,UAAU,EACrB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,iCAGnB,GACT,EACL,UAAU,CAAC,MAAM,GAAG,CAAC,IAAI,CACxB,eAAK,SAAS,EAAC,yCAAyC,aACtD,6FAGM,EACN,2BAAe,wBAAwB,YACpC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC/B,aAAe,SAAS,EAAC,WAAW,YACjC,GAAG;gCACF,CAAC,CAAC,GAAG,IAAI,MAAM,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE,YAAY,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,EAAE,UAAU;gCAC5E,CAAC,CAAC,IAAI,IAHD,IAAI,CAIR,CACN,CAAC,GACC,EACL,cAAK,SAAS,EAAC,MAAM,YACnB,KAAC,UAAU,IACT,KAAK,EACH,QAAQ;gCACN,CAAC,CAAC,oBAAoB;gCACtB,CAAC,CAAC,mHAAmH,EAEzH,QAAQ,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,yBAAyB,EAC3D,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,UAAU,CAAC,sBAAsB,EAAE,4BAGnD,GACT,IACF,CACP,IACG,CACP,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Copyright (c) 2026-present, Goldman Sachs
3
+ *
4
+ * Licensed under the Apache License, Version 2.0 (the "License");
5
+ * you may not use this file except in compliance with the License.
6
+ * You may obtain a copy of the License at
7
+ *
8
+ * http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software
11
+ * distributed under the License is distributed on an "AS IS" BASIS,
12
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ * See the License for the specific language governing permissions and
14
+ * limitations under the License.
15
+ */
16
+ import type { CubeEditorState } from '../../stores/CubeEditorState.js';
17
+ /**
18
+ * The node editor, in a side panel (spec §17.5): the node's label and id, its
19
+ * help, Select, and its type's editor. Edits stay in the panel until Apply
20
+ * or closing it; Cancel drops them. While an input is missing or invalid,
21
+ * the panel shows why instead of the editor, since there would be no
22
+ * columns to pick.
23
+ */
24
+ export declare const CubeNodeEditorPanel: ((props: {
25
+ editorState: CubeEditorState;
26
+ }) => import("react/jsx-runtime").JSX.Element | null) & {
27
+ displayName: string;
28
+ };
29
+ //# sourceMappingURL=CubeNodeEditorPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeNodeEditorPanel.d.ts","sourceRoot":"","sources":["../../../src/components/editors/CubeNodeEditorPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiBH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAgBvE;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,WACtB;IAAE,WAAW,EAAE,eAAe,CAAA;CAAE;;CA+JzC,CAAC"}
@@ -0,0 +1,72 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * Copyright (c) 2026-present, Goldman Sachs
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { QuestionCircleIcon, TimesIcon, WarningIcon } from '@finos/legend-art';
18
+ import { isIncompleteError, isSchemasError, UnknownNode, } from '@finos/legend-cube';
19
+ import { observer } from 'mobx-react-lite';
20
+ import { CUBE_NODE_HELP_TEXT, SELECT_NODE_TOOLTIP, } from '../../__lib__/LegendCubeHelpText.js';
21
+ import { READ_ONLY_CUBE_TITLE } from '../../__lib__/LegendCubeLabels.js';
22
+ import { LEGEND_CUBE_TEST_ID } from '../../__lib__/LegendCubeTesting.js';
23
+ import { CUBE_NODE_DRAFT_FACTORIES } from '../../stores/editors/CubeNodeDraftRegistry.js';
24
+ import { CubeButton } from '../CubeButton.js';
25
+ import { CubeNodeIcon } from '../CubeNodeIcon.js';
26
+ import { CUBE_NODE_EDITORS } from './CubeNodeEditorRegistry.js';
27
+ /** The problems of the edited node against its inputs, as Apply would leave it */
28
+ const validateEdited = (node, inputSchemas) => {
29
+ const errors = [];
30
+ node.validate(inputSchemas, errors);
31
+ return [...new Set(errors)];
32
+ };
33
+ /**
34
+ * The node editor, in a side panel (spec §17.5): the node's label and id, its
35
+ * help, Select, and its type's editor. Edits stay in the panel until Apply
36
+ * or closing it; Cancel drops them. While an input is missing or invalid,
37
+ * the panel shows why instead of the editor, since there would be no
38
+ * columns to pick.
39
+ */
40
+ export const CubeNodeEditorPanel = observer((props) => {
41
+ const { editorState } = props;
42
+ const { nodeEditor, readOnly } = editorState;
43
+ const { node, draft, edited } = nodeEditor;
44
+ if (!node || !draft || !edited) {
45
+ return null;
46
+ }
47
+ const { query } = editorState.document;
48
+ const definition = editorState.registry.get(node.type);
49
+ const isCapture = query.selected === node.id;
50
+ const inputProblems = editorState
51
+ .getNodeErrors(node.id)
52
+ .filter((error) => isSchemasError(error) || isIncompleteError(error));
53
+ const inputSchemas = query
54
+ .getInputIds(node.id)
55
+ .map((inputId) => inputId === undefined
56
+ ? undefined
57
+ : editorState.analysis.schemas.get(inputId))
58
+ .filter((schema) => schema !== undefined);
59
+ const Editor = CUBE_NODE_EDITORS.get(node.type);
60
+ const isEditable = CUBE_NODE_DRAFT_FACTORIES.has(node.type);
61
+ const problems = isEditable && !inputProblems.length
62
+ ? validateEdited(edited, inputSchemas)
63
+ : [];
64
+ const warnings = editorState.getNodeWarnings(node);
65
+ return (_jsxs("div", { className: "flex h-full flex-col border-l border-[var(--color-border-default)] bg-[var(--color-bg-panel)]", "data-testid": LEGEND_CUBE_TEST_ID.NODE_EDITOR, children: [_jsxs("div", { className: "flex h-8 shrink-0 items-center gap-2 border-b border-[var(--color-border-default)] bg-[var(--color-bg-panel-header)] px-2", children: [_jsx(CubeNodeIcon, { icon: definition?.icon, className: "shrink-0 text-[var(--color-text-secondary)]" }), _jsx("span", { className: "min-w-0 truncate text-lg font-medium", children: definition?.label ?? 'Unknown' }), _jsx("span", { className: "shrink-0 text-base text-[var(--color-text-muted)]", children: node.id }), definition?.beta && (_jsx("span", { className: "shrink-0 rounded-sm bg-[var(--color-accent)] px-1 text-xs font-medium text-[var(--color-text-on-accent)]", children: "BETA" })), _jsx("span", { className: "shrink-0 text-[var(--color-text-secondary)]", title: CUBE_NODE_HELP_TEXT[node.type] ??
66
+ CUBE_NODE_HELP_TEXT[UnknownNode.TYPE], role: "img", "aria-label": "Help", children: _jsx(QuestionCircleIcon, {}) }), _jsx("span", { className: "flex-1" }), isCapture ? (_jsx("span", { className: "shrink-0 text-base text-[var(--color-text-secondary)]", title: SELECT_NODE_TOOLTIP, children: "(Selected)" })) : (_jsx("button", { className: "shrink-0 text-base text-[var(--color-accent)] underline", title: SELECT_NODE_TOOLTIP, onClick: () => editorState.select(node.id), children: "Select" })), _jsx("button", { className: "flex h-6 w-6 shrink-0 items-center justify-center text-[var(--color-text-secondary)] hover:text-[var(--color-text-primary)]", title: nodeEditor.hasChanges && !readOnly
67
+ ? 'Close, applying the changes'
68
+ : 'Close', "aria-label": "Close the editor", onClick: () => nodeEditor.close(), children: _jsx(TimesIcon, {}) })] }), _jsxs("div", { className: "min-h-0 flex-1 overflow-auto p-2", children: [warnings.map((warning) => (_jsxs("div", { className: "mb-2 flex gap-1 text-sm text-[var(--color-status-warn)]", role: "status", children: [_jsx(WarningIcon, { className: "mt-0.5 shrink-0", "aria-hidden": true }), _jsx("span", { children: warning })] }, warning))), inputProblems.length ? (_jsx("div", { className: "text-base text-[var(--color-status-warn)]", role: "alert", children: inputProblems.map((problem) => (_jsx("div", { children: problem }, problem))) })) : Editor ? (_jsx(Editor, { editorState: editorState, draft: draft, inputSchemas: inputSchemas, readOnly: readOnly })) : (_jsx("div", { className: "text-base text-[var(--color-text-secondary)]", children: `${node.describe()}: this node can't be edited.` })), problems.length > 0 && (_jsx("div", { className: "mt-3 border-t border-[var(--color-border-subtle)] pt-2 text-base text-[var(--color-status-error)]", role: "alert", "aria-label": "Problems", children: problems.map((problem) => (_jsx("div", { children: problem }, problem))) }))] }), isEditable && (_jsxs("div", { className: "flex h-10 shrink-0 items-center justify-end gap-2 border-t border-[var(--color-border-default)] px-2", children: [_jsx(CubeButton, { title: "Drop the changes and close", onClick: () => nodeEditor.cancel(), children: "Cancel" }), _jsx(CubeButton, { primary: true, title: readOnly
69
+ ? READ_ONLY_CUBE_TITLE
70
+ : 'Store the changes, as one step to undo', disabled: readOnly || !nodeEditor.hasChanges, onClick: () => nodeEditor.apply(), children: "Apply" })] }))] }));
71
+ });
72
+ //# sourceMappingURL=CubeNodeEditorPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CubeNodeEditorPanel.js","sourceRoot":"","sources":["../../../src/components/editors/CubeNodeEditorPanel.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EACL,iBAAiB,EACjB,cAAc,EAGd,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAA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