@react-querybuilder/core 8.21.1 → 8.22.0

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 (88) hide show
  1. package/README.md +1 -1
  2. package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +1426 -56
  3. package/dist/cjs/react-querybuilder_core.cjs.development.js +2241 -83
  4. package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
  5. package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +1426 -56
  6. package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -1
  7. package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
  8. package/dist/formatQuery.d.mts +17 -2
  9. package/dist/formatQuery.d.ts +17 -2
  10. package/dist/formatQuery.js +68 -45
  11. package/dist/formatQuery.js.map +1 -1
  12. package/dist/formatQuery.mjs +67 -46
  13. package/dist/formatQuery.mjs.map +1 -1
  14. package/dist/{import-Ddc3d_8q.d.ts → import-6ExjhifL.d.ts} +2 -2
  15. package/dist/{import-BVdxeIBO.d.mts → import-DVWI7Fdh.d.mts} +2 -2
  16. package/dist/{index-BSwFvkeI.d.mts → index-CX9mehdL.d.mts} +15 -1
  17. package/dist/{index-BSwFvkeI.d.ts → index-CX9mehdL.d.ts} +15 -1
  18. package/dist/parseCEL.d.mts +2 -2
  19. package/dist/parseCEL.d.ts +2 -2
  20. package/dist/parseCEL.js +6 -8
  21. package/dist/parseCEL.js.map +1 -1
  22. package/dist/parseCEL.mjs +6 -8
  23. package/dist/parseCEL.mjs.map +1 -1
  24. package/dist/parseCypher.d.mts +1 -1
  25. package/dist/parseCypher.d.ts +1 -1
  26. package/dist/parseCypher.js.map +1 -1
  27. package/dist/parseGremlin.d.mts +1 -1
  28. package/dist/parseGremlin.d.ts +1 -1
  29. package/dist/parseJSONata.d.mts +2 -2
  30. package/dist/parseJSONata.d.ts +2 -2
  31. package/dist/parseJSONata.js +2 -2
  32. package/dist/parseJSONata.js.map +1 -1
  33. package/dist/parseJSONata.mjs +1 -1
  34. package/dist/parseJsonLogic.d.mts +2 -2
  35. package/dist/parseJsonLogic.d.ts +2 -2
  36. package/dist/parseJsonLogic.js +3 -3
  37. package/dist/parseJsonLogic.js.map +1 -1
  38. package/dist/parseJsonLogic.mjs +3 -3
  39. package/dist/parseJsonLogic.mjs.map +1 -1
  40. package/dist/parseMongoDB.d.mts +2 -2
  41. package/dist/parseMongoDB.d.ts +2 -2
  42. package/dist/parseMongoDB.js +2 -2
  43. package/dist/parseMongoDB.mjs +2 -2
  44. package/dist/parseSPARQL.d.mts +1 -1
  45. package/dist/parseSPARQL.d.ts +1 -1
  46. package/dist/parseSPARQL.js +0 -1
  47. package/dist/parseSPARQL.js.map +1 -1
  48. package/dist/parseSPARQL.mjs +0 -1
  49. package/dist/parseSPARQL.mjs.map +1 -1
  50. package/dist/parseSQL.d.mts +2 -2
  51. package/dist/parseSQL.d.ts +2 -2
  52. package/dist/parseSQL.js +54 -62
  53. package/dist/parseSQL.js.map +1 -1
  54. package/dist/parseSQL.mjs +54 -62
  55. package/dist/parseSQL.mjs.map +1 -1
  56. package/dist/parseSpEL.d.mts +2 -2
  57. package/dist/parseSpEL.d.ts +2 -2
  58. package/dist/parseSpEL.js +3 -3
  59. package/dist/parseSpEL.js.map +1 -1
  60. package/dist/parseSpEL.mjs +3 -3
  61. package/dist/parseSpEL.mjs.map +1 -1
  62. package/dist/{prepareQueryObjects-C2-kTZvR.js → prepareQueryObjects-BnGL91Tt.js} +9 -5
  63. package/dist/{prepareQueryObjects-C2-kTZvR.js.map → prepareQueryObjects-BnGL91Tt.js.map} +1 -1
  64. package/dist/{prepareQueryObjects-Q18lHCKl.mjs → prepareQueryObjects-ChINDIap.mjs} +9 -5
  65. package/dist/{prepareQueryObjects-Q18lHCKl.mjs.map → prepareQueryObjects-ChINDIap.mjs.map} +1 -1
  66. package/dist/query-builder-layout.css +1 -1
  67. package/dist/query-builder-layout.css.map +1 -1
  68. package/dist/query-builder.css +1 -1
  69. package/dist/query-builder.css.map +1 -1
  70. package/dist/react-querybuilder_core.d.mts +1426 -56
  71. package/dist/react-querybuilder_core.legacy-esm.d.ts +1426 -56
  72. package/dist/react-querybuilder_core.legacy-esm.js +2279 -92
  73. package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
  74. package/dist/react-querybuilder_core.mjs +2198 -85
  75. package/dist/react-querybuilder_core.mjs.map +1 -1
  76. package/dist/react-querybuilder_core.production.d.mts +1426 -56
  77. package/dist/react-querybuilder_core.production.mjs +1 -1
  78. package/dist/react-querybuilder_core.production.mjs.map +1 -1
  79. package/dist/styles/_layout.scss +5 -2
  80. package/dist/transformQuery.d.mts +1 -1
  81. package/dist/transformQuery.d.ts +1 -1
  82. package/dist/{utils-Dt0D_DMV.mjs → utils-4k-j5FBa.mjs} +20 -3
  83. package/dist/utils-4k-j5FBa.mjs.map +1 -0
  84. package/dist/{utils-DEwV7F6B.js → utils-C79dxwZb.js} +31 -2
  85. package/dist/utils-C79dxwZb.js.map +1 -0
  86. package/package.json +9 -8
  87. package/dist/utils-DEwV7F6B.js.map +0 -1
  88. package/dist/utils-Dt0D_DMV.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { C as FullField, F as OptionList, w as ValueSources } from "./index-BSwFvkeI.js";
1
+ import { C as FullField, F as OptionList, w as ValueSources } from "./index-CX9mehdL.js";
2
2
  //#region src/types/import.d.ts
3
3
  /**
4
4
  * Options common to all parsers.
@@ -23,4 +23,4 @@ interface ParserCommonOptions {
23
23
  }
24
24
  //#endregion
25
25
  export { ParserCommonOptions as t };
26
- //# sourceMappingURL=import-Ddc3d_8q.d.ts.map
26
+ //# sourceMappingURL=import-6ExjhifL.d.ts.map
@@ -1,4 +1,4 @@
1
- import { C as FullField, F as OptionList, w as ValueSources } from "./index-BSwFvkeI.mjs";
1
+ import { C as FullField, F as OptionList, w as ValueSources } from "./index-CX9mehdL.mjs";
2
2
  //#region src/types/import.d.ts
3
3
  /**
4
4
  * Options common to all parsers.
@@ -23,4 +23,4 @@ interface ParserCommonOptions {
23
23
  }
24
24
  //#endregion
25
25
  export { ParserCommonOptions as t };
26
- //# sourceMappingURL=import-BVdxeIBO.d.mts.map
26
+ //# sourceMappingURL=import-DVWI7Fdh.d.mts.map
@@ -1628,6 +1628,14 @@ interface ValueProcessorOptions extends FormatQueryOptions {
1628
1628
  * @default false
1629
1629
  */
1630
1630
  parseNumbers?: boolean;
1631
+ /**
1632
+ * Nesting level of the subquery currently being processed. Incremented each time a rule
1633
+ * processor recurses into a rule group stored in a rule's `value` (see `match` modes).
1634
+ * Used to generate collision-free element aliases.
1635
+ *
1636
+ * @default 0
1637
+ */
1638
+ subqueryDepth?: number;
1631
1639
  }
1632
1640
  /**
1633
1641
  * Options object curated by {@link formatQuery} and passed to a {@link RuleGroupProcessor}.
@@ -1645,6 +1653,12 @@ interface FormatQueryFinalOptions extends Required<Except<FormatQueryOptions, "c
1645
1653
  validateRule: FormatQueryValidateRule;
1646
1654
  validationMap: ValidationMap;
1647
1655
  context?: Record<string, unknown>;
1656
+ /**
1657
+ * @see {@link ValueProcessorOptions.subqueryDepth}
1658
+ *
1659
+ * @default 0
1660
+ */
1661
+ subqueryDepth?: number;
1648
1662
  }
1649
1663
  /**
1650
1664
  * Function that produces a processed value for a given {@link RuleType}.
@@ -1973,4 +1987,4 @@ type NLTranslationKey = "and" | "or" | "true" | "false" | "ruleSeparator" | "bet
1973
1987
  type NLTranslations = Partial<Record<NLTranslationKey, string>>;
1974
1988
  //#endregion
1975
1989
  export { DefaultOperatorName as A, FullField as C, RuleGroupTypeIC as D, RuleGroupTypeAny as E, OptionList as F, SetRequired as I, Except as L, RuleGroupType as M, RuleType as N, DefaultCombinatorName as O, ExpressionNode as P, Merge as R, ValueProcessorOptions as S, DefaultRuleGroupTypeIC as T, RuleGroupProcessor as _, DiagnosticsResult as a, ValueProcessorByRule as b, ExportOperatorMap as c, NLTranslationKey as d, NLTranslations as f, RQBJsonLogicVar as g, RQBJsonLogic as h, ConstituentWordOrder as i, DefaultRuleGroupType as j, DefaultCombinatorNameExtended as k, FormatQueryOptions as l, ParameterizedSQL as m, JsonLogicLessThanOrEqual as n, ExportFormat as o, ParameterizedNamedSQL as p, JsonLogicRulesLogic as r, ExportObjectFormats as s, JsonLogicLessThan as t, GroupVariantCondition as u, RuleProcessor as v, ValueSources as w, ValueProcessorLegacy as x, SQLPreset as y };
1976
- //# sourceMappingURL=index-BSwFvkeI.d.mts.map
1990
+ //# sourceMappingURL=index-CX9mehdL.d.mts.map
@@ -1628,6 +1628,14 @@ interface ValueProcessorOptions extends FormatQueryOptions {
1628
1628
  * @default false
1629
1629
  */
1630
1630
  parseNumbers?: boolean;
1631
+ /**
1632
+ * Nesting level of the subquery currently being processed. Incremented each time a rule
1633
+ * processor recurses into a rule group stored in a rule's `value` (see `match` modes).
1634
+ * Used to generate collision-free element aliases.
1635
+ *
1636
+ * @default 0
1637
+ */
1638
+ subqueryDepth?: number;
1631
1639
  }
1632
1640
  /**
1633
1641
  * Options object curated by {@link formatQuery} and passed to a {@link RuleGroupProcessor}.
@@ -1645,6 +1653,12 @@ interface FormatQueryFinalOptions extends Required<Except<FormatQueryOptions, "c
1645
1653
  validateRule: FormatQueryValidateRule;
1646
1654
  validationMap: ValidationMap;
1647
1655
  context?: Record<string, unknown>;
1656
+ /**
1657
+ * @see {@link ValueProcessorOptions.subqueryDepth}
1658
+ *
1659
+ * @default 0
1660
+ */
1661
+ subqueryDepth?: number;
1648
1662
  }
1649
1663
  /**
1650
1664
  * Function that produces a processed value for a given {@link RuleType}.
@@ -1973,4 +1987,4 @@ type NLTranslationKey = "and" | "or" | "true" | "false" | "ruleSeparator" | "bet
1973
1987
  type NLTranslations = Partial<Record<NLTranslationKey, string>>;
1974
1988
  //#endregion
1975
1989
  export { DefaultOperatorName as A, FullField as C, RuleGroupTypeIC as D, RuleGroupTypeAny as E, OptionList as F, SetRequired as I, Except as L, RuleGroupType as M, RuleType as N, DefaultCombinatorName as O, ExpressionNode as P, Merge as R, ValueProcessorOptions as S, DefaultRuleGroupTypeIC as T, RuleGroupProcessor as _, DiagnosticsResult as a, ValueProcessorByRule as b, ExportOperatorMap as c, NLTranslationKey as d, NLTranslations as f, RQBJsonLogicVar as g, RQBJsonLogic as h, ConstituentWordOrder as i, DefaultRuleGroupType as j, DefaultCombinatorNameExtended as k, FormatQueryOptions as l, ParameterizedSQL as m, JsonLogicLessThanOrEqual as n, ExportFormat as o, ParameterizedNamedSQL as p, JsonLogicRulesLogic as r, ExportObjectFormats as s, JsonLogicLessThan as t, GroupVariantCondition as u, RuleProcessor as v, ValueSources as w, ValueProcessorLegacy as x, SQLPreset as y };
1976
- //# sourceMappingURL=index-BSwFvkeI.d.ts.map
1990
+ //# sourceMappingURL=index-CX9mehdL.d.ts.map
@@ -1,5 +1,5 @@
1
- import { A as DefaultOperatorName, D as RuleGroupTypeIC, L as Except, M as RuleGroupType, N as RuleType, O as DefaultCombinatorName, P as ExpressionNode, T as DefaultRuleGroupTypeIC, j as DefaultRuleGroupType } from "./index-BSwFvkeI.mjs";
2
- import { t as ParserCommonOptions } from "./import-BVdxeIBO.mjs";
1
+ import { A as DefaultOperatorName, D as RuleGroupTypeIC, L as Except, M as RuleGroupType, N as RuleType, O as DefaultCombinatorName, P as ExpressionNode, T as DefaultRuleGroupTypeIC, j as DefaultRuleGroupType } from "./index-CX9mehdL.mjs";
2
+ import { t as ParserCommonOptions } from "./import-DVWI7Fdh.mjs";
3
3
  //#region src/utils/parseCEL/types.d.ts
4
4
  type CELExpressionType = "Addition" | "BooleanLiteral" | "BytesLiteral" | "ConditionalAnd" | "ConditionalExpr" | "ConditionalOr" | "Division" | "DynamicPropertyAccessor" | "ExpressionGroup" | "ExpressionList" | "FieldInit" | "FieldInits" | "MessageInit" | "FloatLiteral" | "FunctionCall" | "Identifier" | "IntegerLiteral" | "List" | "Map" | "MapInit" | "MapInits" | "Member" | "Modulo" | "Multiplication" | "Negation" | "Negative" | "NullLiteral" | "Property" | "Relation" | "StringLiteral" | "Subtraction" | "Unary" | "UnsignedIntegerLiteral" | "LikeExpression" | "SubqueryExpression";
5
5
  type CELRelop = "==" | ">=" | ">" | "<=" | "<" | "!=" | "in";
@@ -1,5 +1,5 @@
1
- import { A as DefaultOperatorName, D as RuleGroupTypeIC, L as Except, M as RuleGroupType, N as RuleType, O as DefaultCombinatorName, P as ExpressionNode, T as DefaultRuleGroupTypeIC, j as DefaultRuleGroupType } from "./index-BSwFvkeI.js";
2
- import { t as ParserCommonOptions } from "./import-Ddc3d_8q.js";
1
+ import { A as DefaultOperatorName, D as RuleGroupTypeIC, L as Except, M as RuleGroupType, N as RuleType, O as DefaultCombinatorName, P as ExpressionNode, T as DefaultRuleGroupTypeIC, j as DefaultRuleGroupType } from "./index-CX9mehdL.js";
2
+ import { t as ParserCommonOptions } from "./import-6ExjhifL.js";
3
3
  //#region src/utils/parseCEL/types.d.ts
4
4
  type CELExpressionType = "Addition" | "BooleanLiteral" | "BytesLiteral" | "ConditionalAnd" | "ConditionalExpr" | "ConditionalOr" | "Division" | "DynamicPropertyAccessor" | "ExpressionGroup" | "ExpressionList" | "FieldInit" | "FieldInits" | "MessageInit" | "FloatLiteral" | "FunctionCall" | "Identifier" | "IntegerLiteral" | "List" | "Map" | "MapInit" | "MapInits" | "Member" | "Modulo" | "Multiplication" | "Negation" | "Negative" | "NullLiteral" | "Property" | "Relation" | "StringLiteral" | "Subtraction" | "Unary" | "UnsignedIntegerLiteral" | "LikeExpression" | "SubqueryExpression";
5
5
  type CELRelop = "==" | ">=" | ">" | "<=" | "<" | "!=" | "in";
package/dist/parseCEL.js CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_utils = require("./utils-DEwV7F6B.js");
2
+ const require_utils = require("./utils-C79dxwZb.js");
3
3
  const require_isRuleGroup = require("./isRuleGroup-0JNiQgLg.js");
4
- const require_prepareQueryObjects = require("./prepareQueryObjects-C2-kTZvR.js");
4
+ const require_prepareQueryObjects = require("./prepareQueryObjects-BnGL91Tt.js");
5
5
  let _ts_jison_parser = require("@ts-jison/parser");
6
6
  let _ts_jison_lexer = require("@ts-jison/lexer");
7
7
  //#region src/utils/parseCEL/celParser.ts
@@ -1804,7 +1804,6 @@ var CELParser = class extends _ts_jison_parser.JisonParser {
1804
1804
  left: $$[$0 - 2],
1805
1805
  right: $$[$0]
1806
1806
  });
1807
- break;
1808
1807
  }
1809
1808
  }
1810
1809
  };
@@ -1998,9 +1997,7 @@ var CELLexer = class extends _ts_jison_lexer.JisonLexer {
1998
1997
  case 54: return 14;
1999
1998
  case 55: return 5;
2000
1999
  case 56: return "INVALID";
2001
- case 57:
2002
- console.log(yy_.yytext);
2003
- break;
2000
+ case 57: console.log(yy_.yytext);
2004
2001
  }
2005
2002
  }
2006
2003
  };
@@ -2072,7 +2069,7 @@ const extractSubqueryComponents = (expr) => {
2072
2069
  return {
2073
2070
  field,
2074
2071
  method,
2075
- alias: isCELIdentifier(aliasExpr) ? aliasExpr.value : /* v8 ignore next -- @preserve */ null,
2072
+ alias: isCELIdentifier(aliasExpr) ? aliasExpr.value : /* v8 ignore next -- @preserve */ null,
2076
2073
  condition: conditionExpr
2077
2074
  };
2078
2075
  };
@@ -2384,7 +2381,8 @@ function parseCEL(cel, options = {}) {
2384
2381
  const field = getCELIdentifierFromNegatedChain(expr.left).replace(/^!+/, "");
2385
2382
  const method = expr.right.value;
2386
2383
  const [aliasExpr, conditionExpr] = expr.list.value;
2387
- const transformedCondition = transformAliasInExpression(conditionExpr, isCELIdentifier(aliasExpr) ? aliasExpr.value : /* v8 ignore next -- @preserve */ null);
2384
+ const alias = isCELIdentifier(aliasExpr) ? aliasExpr.value : /* v8 ignore next -- @preserve */ null;
2385
+ const transformedCondition = transformAliasInExpression(conditionExpr, alias);
2388
2386
  const subqueryValue = processCELExpression(transformedCondition);
2389
2387
  // v8 ignore else
2390
2388
  if (subqueryValue && fieldIsValid(field, "=")) {