@finos/legend-query-builder 4.9.4 → 4.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. package/lib/__lib__/QueryBuilderTesting.d.ts +4 -1
  2. package/lib/__lib__/QueryBuilderTesting.d.ts.map +1 -1
  3. package/lib/__lib__/QueryBuilderTesting.js +5 -1
  4. package/lib/__lib__/QueryBuilderTesting.js.map +1 -1
  5. package/lib/components/QueryBuilderResultPanel.d.ts.map +1 -1
  6. package/lib/components/QueryBuilderResultPanel.js +80 -90
  7. package/lib/components/QueryBuilderResultPanel.js.map +1 -1
  8. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts +1 -0
  9. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.d.ts.map +1 -1
  10. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js +13 -1
  11. package/lib/components/__test-utils__/QueryBuilderComponentTestUtils.js.map +1 -1
  12. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts +2 -2
  13. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.d.ts.map +1 -1
  14. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js +42 -24
  15. package/lib/components/fetch-structure/QueryBuilderPostFilterPanel.js.map +1 -1
  16. package/lib/components/fetch-structure/QueryBuilderTDSPanel.d.ts.map +1 -1
  17. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js +1 -1
  18. package/lib/components/fetch-structure/QueryBuilderTDSPanel.js.map +1 -1
  19. package/lib/components/filter/QueryBuilderFilterPanel.d.ts +3 -2
  20. package/lib/components/filter/QueryBuilderFilterPanel.d.ts.map +1 -1
  21. package/lib/components/filter/QueryBuilderFilterPanel.js +145 -8
  22. package/lib/components/filter/QueryBuilderFilterPanel.js.map +1 -1
  23. package/lib/index.css +16 -0
  24. package/lib/package.json +1 -1
  25. package/lib/stores/QueryBuilderConstantsState.d.ts +5 -1
  26. package/lib/stores/QueryBuilderConstantsState.d.ts.map +1 -1
  27. package/lib/stores/QueryBuilderConstantsState.js +14 -1
  28. package/lib/stores/QueryBuilderConstantsState.js.map +1 -1
  29. package/lib/stores/QueryBuilderResultState.d.ts +3 -0
  30. package/lib/stores/QueryBuilderResultState.d.ts.map +1 -1
  31. package/lib/stores/QueryBuilderResultState.js +31 -2
  32. package/lib/stores/QueryBuilderResultState.js.map +1 -1
  33. package/lib/stores/QueryBuilderStateHashUtils.d.ts +2 -0
  34. package/lib/stores/QueryBuilderStateHashUtils.d.ts.map +1 -1
  35. package/lib/stores/QueryBuilderStateHashUtils.js +2 -0
  36. package/lib/stores/QueryBuilderStateHashUtils.js.map +1 -1
  37. package/lib/stores/QueryBuilderValueSpecificationBuilder.d.ts.map +1 -1
  38. package/lib/stores/QueryBuilderValueSpecificationBuilder.js +3 -23
  39. package/lib/stores/QueryBuilderValueSpecificationBuilder.js.map +1 -1
  40. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterOperator.js +1 -1
  41. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterOperator.js.map +1 -1
  42. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts +31 -5
  43. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.d.ts.map +1 -1
  44. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js +125 -30
  45. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.js.map +1 -1
  46. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.d.ts.map +1 -1
  47. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.js +21 -8
  48. package/lib/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.js.map +1 -1
  49. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorValueSpecificationBuilder.d.ts +3 -1
  50. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorValueSpecificationBuilder.d.ts.map +1 -1
  51. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorValueSpecificationBuilder.js +20 -17
  52. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorValueSpecificationBuilder.js.map +1 -1
  53. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.d.ts.map +1 -1
  54. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js +4 -6
  55. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.js.map +1 -1
  56. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.d.ts.map +1 -1
  57. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js +4 -6
  58. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.js.map +1 -1
  59. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.d.ts +1 -1
  60. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.d.ts.map +1 -1
  61. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js +10 -10
  62. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.js.map +1 -1
  63. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.d.ts.map +1 -1
  64. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js +10 -10
  65. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.js.map +1 -1
  66. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.d.ts.map +1 -1
  67. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.js +5 -5
  68. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.js.map +1 -1
  69. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.d.ts +1 -1
  70. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.d.ts.map +1 -1
  71. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.js +32 -27
  72. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.js.map +1 -1
  73. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.d.ts.map +1 -1
  74. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js +10 -5
  75. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.js.map +1 -1
  76. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.d.ts.map +1 -1
  77. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js +10 -10
  78. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.js.map +1 -1
  79. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.d.ts.map +1 -1
  80. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.js +5 -5
  81. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.js.map +1 -1
  82. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.d.ts.map +1 -1
  83. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js +4 -6
  84. package/lib/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.js.map +1 -1
  85. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.d.ts.map +1 -1
  86. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js +17 -3
  87. package/lib/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.js.map +1 -1
  88. package/lib/stores/filter/QueryBuilderFilterState.d.ts +7 -1
  89. package/lib/stores/filter/QueryBuilderFilterState.d.ts.map +1 -1
  90. package/lib/stores/filter/QueryBuilderFilterState.js +27 -0
  91. package/lib/stores/filter/QueryBuilderFilterState.js.map +1 -1
  92. package/package.json +5 -5
  93. package/src/__lib__/QueryBuilderTesting.ts +5 -1
  94. package/src/components/QueryBuilderResultPanel.tsx +127 -135
  95. package/src/components/__test-utils__/QueryBuilderComponentTestUtils.tsx +25 -1
  96. package/src/components/fetch-structure/QueryBuilderPostFilterPanel.tsx +102 -49
  97. package/src/components/fetch-structure/QueryBuilderTDSPanel.tsx +6 -2
  98. package/src/components/filter/QueryBuilderFilterPanel.tsx +239 -21
  99. package/src/stores/QueryBuilderConstantsState.ts +30 -0
  100. package/src/stores/QueryBuilderResultState.ts +36 -1
  101. package/src/stores/QueryBuilderStateHashUtils.ts +2 -0
  102. package/src/stores/QueryBuilderValueSpecificationBuilder.ts +4 -50
  103. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterOperator.ts +1 -1
  104. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterState.ts +180 -34
  105. package/src/stores/fetch-structure/tds/post-filter/QueryBuilderPostFilterStateBuilder.ts +38 -9
  106. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperatorValueSpecificationBuilder.ts +36 -20
  107. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Contain.ts +5 -6
  108. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_EndWith.ts +6 -6
  109. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_Equal.ts +12 -13
  110. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThan.ts +10 -9
  111. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_GreaterThanEqual.ts +5 -4
  112. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_In.ts +48 -43
  113. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_IsEmpty.ts +12 -4
  114. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThan.ts +10 -9
  115. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_LessThanEqual.ts +5 -4
  116. package/src/stores/fetch-structure/tds/post-filter/operators/QueryBuilderPostFilterOperator_StartWith.ts +6 -6
  117. package/src/stores/fetch-structure/tds/projection/QueryBuilderProjectionColumnState.ts +26 -4
  118. package/src/stores/filter/QueryBuilderFilterState.ts +40 -1
@@ -466,6 +466,7 @@ export class QueryBuilderFilterState
466
466
  addNodeFromNode: action,
467
467
  replaceBlankNodeWithNode: action,
468
468
  addGroupConditionNodeFromNode: action,
469
+ newGroupConditionFromNode: action,
469
470
  newGroupWithConditionFromNode: action,
470
471
  removeNodeAndPruneBranch: action,
471
472
  pruneTree: action,
@@ -514,7 +515,7 @@ export class QueryBuilderFilterState
514
515
  return rootId ? this.getNode(rootId) : undefined;
515
516
  }
516
517
 
517
- private getParentNode(
518
+ getParentNode(
518
519
  node: QueryBuilderFilterTreeNodeData,
519
520
  ): QueryBuilderFilterTreeOperationNodeData | undefined {
520
521
  return node.parentId
@@ -635,6 +636,44 @@ export class QueryBuilderFilterState
635
636
  this.addNodeFromNode(newGroupNode, fromNode);
636
637
  }
637
638
 
639
+ /**
640
+ *
641
+ * Function to create group condition from node where either of the
642
+ * child nodes of group condition is `exists` node
643
+ */
644
+ newGroupConditionFromNode(
645
+ fromNode:
646
+ | QueryBuilderFilterTreeConditionNodeData
647
+ | QueryBuilderFilterTreeExistsNodeData,
648
+ node?:
649
+ | QueryBuilderFilterTreeConditionNodeData
650
+ | QueryBuilderFilterTreeExistsNodeData
651
+ | undefined,
652
+ operation?: QUERY_BUILDER_GROUP_OPERATION | undefined,
653
+ ): QueryBuilderFilterTreeGroupNodeData {
654
+ const fromNodeParent = this.getParentNode(fromNode);
655
+ const newGroupNode = new QueryBuilderFilterTreeGroupNodeData(
656
+ undefined,
657
+ operation ?? QUERY_BUILDER_GROUP_OPERATION.AND,
658
+ );
659
+ this.nodes.set(newGroupNode.id, newGroupNode);
660
+ fromNodeParent?.removeChildNode(fromNode);
661
+ newGroupNode.addChildNode(fromNode);
662
+ if (node) {
663
+ this.nodes.set(node.id, node);
664
+ newGroupNode.addChildNode(node);
665
+ }
666
+ newGroupNode.lambdaParameterName =
667
+ fromNodeParent?.lambdaParameterName ?? this.lambdaParameterName;
668
+ if (fromNodeParent) {
669
+ fromNodeParent.addChildNode(newGroupNode);
670
+ } else {
671
+ deleteEntry(this.rootIds, fromNode.id);
672
+ this.addRootNode(newGroupNode);
673
+ }
674
+ return newGroupNode;
675
+ }
676
+
638
677
  newGroupWithConditionFromNode(
639
678
  node: QueryBuilderFilterTreeNodeData | undefined,
640
679
  fromNode: QueryBuilderFilterTreeNodeData | undefined,