@finos/legend-query-builder 4.14.55 → 4.14.56

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. package/lib/__lib__/QueryBuilderTesting.d.ts +5 -1
  2. package/lib/__lib__/QueryBuilderTesting.d.ts.map +1 -1
  3. package/lib/__lib__/QueryBuilderTesting.js +10 -1
  4. package/lib/__lib__/QueryBuilderTesting.js.map +1 -1
  5. package/lib/components/QueryBuilder.js +3 -3
  6. package/lib/components/QueryBuilder.js.map +1 -1
  7. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts +9 -1
  8. package/lib/components/QueryBuilderPropertyExpressionEditor.d.ts.map +1 -1
  9. package/lib/components/QueryBuilderPropertyExpressionEditor.js +10 -8
  10. package/lib/components/QueryBuilderPropertyExpressionEditor.js.map +1 -1
  11. package/lib/components/QueryLoader.js +3 -3
  12. package/lib/components/QueryLoader.js.map +1 -1
  13. package/lib/components/execution-plan/ExecutionPlanViewer.js +2 -2
  14. package/lib/components/execution-plan/ExecutionPlanViewer.js.map +1 -1
  15. package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts +12 -2
  16. package/lib/components/explorer/QueryBuilderExplorerPanel.d.ts.map +1 -1
  17. package/lib/components/explorer/QueryBuilderExplorerPanel.js +4 -4
  18. package/lib/components/explorer/QueryBuilderExplorerPanel.js.map +1 -1
  19. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.js +2 -2
  20. package/lib/components/explorer/QueryBuilderFunctionsExplorerPanel.js.map +1 -1
  21. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +1 -1
  22. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  23. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +55 -45
  24. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  25. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +2 -2
  26. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  27. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js +5 -5
  28. package/lib/components/fetch-structure/QueryBuilderTDSWindowPanel.js.map +1 -1
  29. package/lib/components/filter/QueryBuilderFilterPanel.js +3 -3
  30. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  31. package/lib/components/result/QueryBuilderResultPanel.js +3 -3
  32. package/lib/components/result/QueryBuilderResultPanel.js.map +1 -1
  33. package/lib/index.css +2 -2
  34. package/lib/index.css.map +1 -1
  35. package/lib/index.d.ts +12 -0
  36. package/lib/index.d.ts.map +1 -1
  37. package/lib/index.js +12 -0
  38. package/lib/index.js.map +1 -1
  39. package/lib/package.json +3 -3
  40. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts +4 -2
  41. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
  42. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +12 -4
  43. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
  44. package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts +2 -1
  45. package/lib/stores/filter/QueryBuilderFilterStateBuilder.d.ts.map +1 -1
  46. package/lib/stores/filter/QueryBuilderFilterStateBuilder.js +15 -0
  47. package/lib/stores/filter/QueryBuilderFilterStateBuilder.js.map +1 -1
  48. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts +3 -2
  49. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.d.ts.map +1 -1
  50. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js +1 -1
  51. package/lib/stores/filter/QueryBuilderFilterValueSpecificationBuilder.js.map +1 -1
  52. package/package.json +11 -11
  53. package/src/__lib__/QueryBuilderTesting.ts +10 -1
  54. package/src/components/QueryBuilder.tsx +5 -5
  55. package/src/components/QueryBuilderPropertyExpressionEditor.tsx +35 -16
  56. package/src/components/QueryLoader.tsx +5 -5
  57. package/src/components/execution-plan/ExecutionPlanViewer.tsx +3 -3
  58. package/src/components/explorer/QueryBuilderExplorerPanel.tsx +5 -5
  59. package/src/components/explorer/QueryBuilderFunctionsExplorerPanel.tsx +3 -3
  60. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +181 -160
  61. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +3 -3
  62. package/src/components/fetch-structure/QueryBuilderTDSWindowPanel.tsx +9 -9
  63. package/src/components/filter/QueryBuilderFilterPanel.tsx +5 -5
  64. package/src/components/result/QueryBuilderResultPanel.tsx +5 -5
  65. package/src/index.ts +24 -2
  66. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +15 -3
  67. package/src/stores/filter/QueryBuilderFilterStateBuilder.ts +39 -0
  68. package/src/stores/filter/QueryBuilderFilterValueSpecificationBuilder.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finos/legend-query-builder",
3
- "version": "4.14.55",
3
+ "version": "4.14.56",
4
4
  "description": "Legend query builder core",
5
5
  "keywords": [
6
6
  "legend",
@@ -42,20 +42,20 @@
42
42
  "test:watch": "jest --watch"
43
43
  },
44
44
  "dependencies": {
45
- "@finos/legend-application": "15.1.12",
46
- "@finos/legend-art": "7.1.40",
47
- "@finos/legend-graph": "31.10.7",
48
- "@finos/legend-lego": "1.2.43",
49
- "@finos/legend-server-depot": "6.0.47",
50
- "@finos/legend-shared": "10.0.42",
51
- "@finos/legend-storage": "3.0.92",
45
+ "@finos/legend-application": "15.1.13",
46
+ "@finos/legend-art": "7.1.41",
47
+ "@finos/legend-graph": "31.10.8",
48
+ "@finos/legend-lego": "1.2.44",
49
+ "@finos/legend-server-depot": "6.0.48",
50
+ "@finos/legend-shared": "10.0.43",
51
+ "@finos/legend-storage": "3.0.93",
52
52
  "@testing-library/dom": "10.2.0",
53
53
  "@testing-library/react": "16.0.0",
54
54
  "@types/react": "18.3.3",
55
55
  "@types/react-dom": "18.3.0",
56
56
  "chart.js": "4.4.3",
57
- "mathjs": "13.0.0",
58
- "mobx": "6.12.4",
57
+ "mathjs": "13.0.1",
58
+ "mobx": "6.12.5",
59
59
  "mobx-react-lite": "4.0.7",
60
60
  "monaco-editor": "0.50.0",
61
61
  "react": "18.3.1",
@@ -66,7 +66,7 @@
66
66
  "sql-formatter": "15.3.2"
67
67
  },
68
68
  "devDependencies": {
69
- "@finos/legend-dev-utils": "2.1.10",
69
+ "@finos/legend-dev-utils": "2.1.11",
70
70
  "@jest/globals": "29.7.0",
71
71
  "cross-env": "7.0.3",
72
72
  "eslint": "8.57.0",
@@ -36,13 +36,22 @@ export enum QUERY_BUILDER_TEST_ID {
36
36
  QUERY_BUILDER_FILTER_TREE_CONDITION_NODE_VALUE = 'query-builder-filter-tree__condition-node__value',
37
37
  // post filter
38
38
  QUERY_BUILDER_POST_FILTER_PANEL = 'query__builder__post__filter-panel',
39
- QUERY_BUILDER_POST_FILTER_TREE_NODE_CONTENT = 'query__builder__post__filter-tree-node__content',
39
+ QUERY_BUILDER_POST_FILTER_TREE = 'query__builder__post__filter__tree',
40
+ QUERY_BUILDER_POST_FILTER_TREE_NODE_BLOCK = 'query__builder__post__filter__tree__node-block',
41
+ QUERY_BUILDER_POST_FILTER_TREE_NODE_CHILDREN = 'query__builder__post__filter__tree__node-children',
42
+ QUERY_BUILDER_POST_FILTER_TREE_NODE_CONTAINER = 'query__builder__post__filter__tree__node-container',
43
+ QUERY_BUILDER_POST_FILTER_TREE_NODE_CONTENT = 'query__builder__post__filter__tree__node-content',
44
+ // window function panel
40
45
  QUERY_BUILDER_WINDOW_GROUPBY = 'query__builder__window',
46
+ // explorer panel
41
47
  QUERY_BUILDER_EXPLORER = 'query__builder__explorer',
42
48
  QUERY_BUILDER_PROPERTY_SEARCH_PANEL = 'query__builder__property__search__panel',
43
49
  QUERY_BUILDER_PERCENTILE_PANEL = 'query__builder__percentile__panel',
50
+ // parameter panel
44
51
  QUERY_BUILDER_PARAMETERS = 'query-builder__parameters',
52
+ // constant panel
45
53
  QUERY_BUILDER_CONSTANTS = 'query-builder__constants',
54
+ // other
46
55
  QUERY_BUILDER_TOOLTIP_ICON = 'query-builder__tooltip__icon',
47
56
  // result panel
48
57
  QUERY_BUILDER_RESULT_VALUES = 'QUERY_BUILDER_RESULT_VALUES',
@@ -21,7 +21,7 @@ import {
21
21
  ResizablePanel,
22
22
  ResizablePanelSplitter,
23
23
  HackerIcon,
24
- DropdownMenu,
24
+ ControlledDropdownMenu,
25
25
  MenuContent,
26
26
  MenuContentItem,
27
27
  MenuContentItemIcon,
@@ -602,7 +602,7 @@ export const QueryBuilder = observer(
602
602
  {actionConfig.renderer(queryBuilderState)}
603
603
  </Fragment>
604
604
  ))}
605
- <DropdownMenu
605
+ <ControlledDropdownMenu
606
606
  className="query-builder__header__advanced-dropdown"
607
607
  title="Show Advanced Menu..."
608
608
  content={
@@ -902,8 +902,8 @@ export const QueryBuilder = observer(
902
902
  Advanced
903
903
  </div>
904
904
  <CaretDownIcon className="query-builder__header__advanced-dropdown__icon" />
905
- </DropdownMenu>
906
- <DropdownMenu
905
+ </ControlledDropdownMenu>
906
+ <ControlledDropdownMenu
907
907
  className="query-builder__header__advanced-dropdown"
908
908
  content={
909
909
  <MenuContent>
@@ -960,7 +960,7 @@ export const QueryBuilder = observer(
960
960
  Help...
961
961
  </div>
962
962
  <CaretDownIcon className="query-builder__header__advanced-dropdown__icon" />
963
- </DropdownMenu>
963
+ </ControlledDropdownMenu>
964
964
  </div>
965
965
  </div>
966
966
  <div className="query-builder__main">
@@ -376,10 +376,36 @@ export const QueryBuilderPropertyExpressionEditor = observer(
376
376
  },
377
377
  );
378
378
 
379
+ export const QueryBuilderPropertyNameDisplay = observer(
380
+ (props: {
381
+ columnName: string;
382
+ title: string;
383
+ error?: boolean | undefined;
384
+ setIsEditingColumnName?: ((isEditing: boolean) => void) | undefined;
385
+ }) => {
386
+ const { columnName, title, error, setIsEditingColumnName } = props;
387
+ return (
388
+ <div className="query-builder__property__name__display" title={title}>
389
+ <span
390
+ className={clsx('query-builder__property__name__display__content', {
391
+ 'query-builder__property__name__display__content--error': error,
392
+ 'editable-value': setIsEditingColumnName,
393
+ })}
394
+ onClick={() => {
395
+ setIsEditingColumnName?.(true);
396
+ }}
397
+ >
398
+ {columnName}
399
+ </span>
400
+ </div>
401
+ );
402
+ },
403
+ );
404
+
379
405
  export const QueryBuilderEditablePropertyName = observer(
380
406
  (props: {
381
407
  columnName: string;
382
- setColumnName?: ((columnName: string) => void) | undefined;
408
+ setColumnName: ((columnName: string) => void) | undefined;
383
409
  error: string | undefined;
384
410
  title: string;
385
411
  defaultColumnName: string;
@@ -435,21 +461,14 @@ export const QueryBuilderEditablePropertyName = observer(
435
461
  />
436
462
  </div>
437
463
  ) : (
438
- <div className="query-builder__property__name__display" title={title}>
439
- <span
440
- className={clsx('query-builder__property__name__display__content', {
441
- 'query-builder__property__name__display__content--error': error,
442
- 'editable-value': setColumnName,
443
- })}
444
- onClick={() => {
445
- if (setColumnName) {
446
- setIsEditingColumnName(true);
447
- }
448
- }}
449
- >
450
- {columnName}
451
- </span>
452
- </div>
464
+ <QueryBuilderPropertyNameDisplay
465
+ columnName={columnName}
466
+ title={title}
467
+ error={Boolean(error)}
468
+ setIsEditingColumnName={
469
+ setColumnName ? setIsEditingColumnName : undefined
470
+ }
471
+ />
453
472
  );
454
473
  },
455
474
  );
@@ -26,7 +26,7 @@ import {
26
26
  clsx,
27
27
  SearchIcon,
28
28
  TimesIcon,
29
- DropdownMenu,
29
+ ControlledDropdownMenu,
30
30
  MenuContent,
31
31
  MenuContentItem,
32
32
  BlankPanelContent,
@@ -474,7 +474,7 @@ export const QueryLoader = observer(
474
474
  </div>
475
475
  </div>
476
476
  </div>
477
- <DropdownMenu
477
+ <ControlledDropdownMenu
478
478
  className="query-loader__result__actions-menu"
479
479
  title="More Actions..."
480
480
  content={
@@ -518,7 +518,7 @@ export const QueryLoader = observer(
518
518
  }}
519
519
  >
520
520
  <MoreVerticalIcon />
521
- </DropdownMenu>
521
+ </ControlledDropdownMenu>
522
522
  <div className="query-loader__result__arrow">
523
523
  <ThinChevronRightIcon />
524
524
  </div>
@@ -555,7 +555,7 @@ export const QueryLoader = observer(
555
555
  {templateQuery.description}
556
556
  </div>
557
557
  </div>
558
- <DropdownMenu
558
+ <ControlledDropdownMenu
559
559
  className="query-loader__result__actions-menu"
560
560
  title="More Actions..."
561
561
  content={
@@ -585,7 +585,7 @@ export const QueryLoader = observer(
585
585
  }}
586
586
  >
587
587
  <MoreVerticalIcon />
588
- </DropdownMenu>
588
+ </ControlledDropdownMenu>
589
589
  <div className="query-loader__result__arrow">
590
590
  <ThinChevronRightIcon />
591
591
  </div>
@@ -28,7 +28,7 @@ import {
28
28
  ChevronRightIcon,
29
29
  MenuContentItem,
30
30
  MenuContent,
31
- DropdownMenu,
31
+ ControlledDropdownMenu,
32
32
  BlankPanelContent,
33
33
  PanelContent,
34
34
  ModalHeader,
@@ -684,7 +684,7 @@ const ExecutionPlanViewPanel = observer(
684
684
  {executionPlanState.selectedNode.label}
685
685
  </button>
686
686
  </div>
687
- <DropdownMenu
687
+ <ControlledDropdownMenu
688
688
  className="execution-plan-viewer__panel__view-mode__type"
689
689
  title="View as..."
690
690
  content={
@@ -717,7 +717,7 @@ const ExecutionPlanViewPanel = observer(
717
717
  <div className="execution-plan-viewer__panel__view-mode__type__label">
718
718
  {executionPlanState.viewMode}
719
719
  </div>
720
- </DropdownMenu>
720
+ </ControlledDropdownMenu>
721
721
  </div>
722
722
  <div className="panel__content execution-plan-viewer__panel__content">
723
723
  {executionPlanState.viewMode === EXECUTION_PLAN_VIEW_MODE.JSON &&
@@ -26,7 +26,7 @@ import {
26
26
  Dialog,
27
27
  TreeView,
28
28
  BlankPanelContent,
29
- DropdownMenu,
29
+ ControlledDropdownMenu,
30
30
  ContextMenu,
31
31
  MenuContent,
32
32
  MenuContentItem,
@@ -106,7 +106,7 @@ import { getClassPropertyIcon } from '@finos/legend-lego/graph-editor';
106
106
  import { QueryBuilderRootClassInfoTooltip } from '../shared/QueryBuilderRootClassInfoTooltip.js';
107
107
  import { QueryBuilderTelemetryHelper } from '../../__lib__/QueryBuilderTelemetryHelper.js';
108
108
 
109
- const checkForDeprecatedNode = (
109
+ export const checkForDeprecatedNode = (
110
110
  node: QueryBuilderExplorerTreeNodeData,
111
111
  graph: PureModel,
112
112
  treeData: TreeData<QueryBuilderExplorerTreeNodeData>,
@@ -754,7 +754,7 @@ const QueryBuilderExplorerTreeNodeView = observer(
754
754
  * 4. Class Subtypes
755
755
  * Note: Derived property nodes will be ranked lower for each relevant return type
756
756
  */
757
- const getQueryBuilderExplorerTreeNodeSortRank = (
757
+ export const getQueryBuilderExplorerTreeNodeSortRank = (
758
758
  node: QueryBuilderExplorerTreeNodeData,
759
759
  ): number => {
760
760
  if (node instanceof QueryBuilderExplorerTreeSubTypeNodeData) {
@@ -928,7 +928,7 @@ export const QueryBuilderExplorerPanel = observer(
928
928
  <PanelHeaderActionItem onClick={collapseTree} title="Collapse Tree">
929
929
  <CompressIcon />
930
930
  </PanelHeaderActionItem>
931
- <DropdownMenu
931
+ <ControlledDropdownMenu
932
932
  className="panel__header__action"
933
933
  title="Show Options Menu..."
934
934
  content={
@@ -972,7 +972,7 @@ export const QueryBuilderExplorerPanel = observer(
972
972
  }}
973
973
  >
974
974
  <MoreVerticalIcon className="query-builder__icon__more-options" />
975
- </DropdownMenu>
975
+ </ControlledDropdownMenu>
976
976
  </PanelHeaderActions>
977
977
  {propertySearchPanelState.isSearchPanelOpen && (
978
978
  <QueryBuilderPropertySearchPanel
@@ -32,7 +32,7 @@ import {
32
32
  TreeView,
33
33
  BlankPanelContent,
34
34
  MenuContentItem,
35
- DropdownMenu,
35
+ ControlledDropdownMenu,
36
36
  MenuContent,
37
37
  CheckIcon,
38
38
  MenuContentItemIcon,
@@ -454,7 +454,7 @@ export const QueryBuilderFunctionsExplorerPanel = observer(
454
454
  />
455
455
  )}
456
456
  </div>
457
- <DropdownMenu
457
+ <ControlledDropdownMenu
458
458
  className="panel__header__action"
459
459
  title="Show Options Menu..."
460
460
  content={
@@ -476,7 +476,7 @@ export const QueryBuilderFunctionsExplorerPanel = observer(
476
476
  }}
477
477
  >
478
478
  <MoreVerticalIcon className="query-builder__icon__more-options" />
479
- </DropdownMenu>
479
+ </ControlledDropdownMenu>
480
480
  </div>
481
481
  </div>
482
482
  <div className="panel__content query-builder__functions-explorer__content">