@react-querybuilder/core 8.14.4 → 8.16.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 (123) hide show
  1. package/README.md +114 -53
  2. package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +288 -22
  3. package/dist/cjs/react-querybuilder_core.cjs.development.js +796 -77
  4. package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
  5. package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +288 -22
  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/{convertQuery-CeJSNn37.mjs → convertQuery-BeJJH9BI.mjs} +2 -2
  9. package/dist/convertQuery-BeJJH9BI.mjs.map +1 -0
  10. package/dist/{convertQuery-J8LpTG-7.js → convertQuery-Lx2HQa0m.js} +2 -2
  11. package/dist/convertQuery-Lx2HQa0m.js.map +1 -0
  12. package/dist/formatQuery.d.mts +89 -2
  13. package/dist/formatQuery.d.ts +89 -2
  14. package/dist/formatQuery.js +775 -66
  15. package/dist/formatQuery.js.map +1 -1
  16. package/dist/formatQuery.mjs +768 -67
  17. package/dist/formatQuery.mjs.map +1 -1
  18. package/dist/{import-BwQqExpO.d.mts → import-BHlzBLM_.d.mts} +2 -2
  19. package/dist/{import-CrJf23Nf.d.ts → import-C6imciDf.d.ts} +2 -2
  20. package/dist/{index-CYT4Saz-.d.mts → index-Cjapnb-H.d.ts} +161 -10
  21. package/dist/{index-DBlQeLax.d.ts → index-D-Iej37L.d.mts} +161 -10
  22. package/dist/{objectUtils-ButT0Mng.js → objectUtils-Bzug_QfX.js} +2 -2
  23. package/dist/objectUtils-Bzug_QfX.js.map +1 -0
  24. package/dist/{objectUtils-C0WB-8ex.mjs → objectUtils-D96eEEzL.mjs} +2 -2
  25. package/dist/objectUtils-D96eEEzL.mjs.map +1 -0
  26. package/dist/parseCEL.d.mts +2 -2
  27. package/dist/parseCEL.d.ts +2 -2
  28. package/dist/parseCEL.js +35 -35
  29. package/dist/parseCEL.js.map +1 -1
  30. package/dist/parseCEL.mjs +35 -35
  31. package/dist/parseCEL.mjs.map +1 -1
  32. package/dist/parseCypher.d.mts +49 -0
  33. package/dist/parseCypher.d.ts +49 -0
  34. package/dist/parseCypher.js +578 -0
  35. package/dist/parseCypher.js.map +1 -0
  36. package/dist/parseCypher.mjs +575 -0
  37. package/dist/parseCypher.mjs.map +1 -0
  38. package/dist/parseGremlin.d.mts +35 -0
  39. package/dist/parseGremlin.d.ts +35 -0
  40. package/dist/parseGremlin.js +192 -0
  41. package/dist/parseGremlin.js.map +1 -0
  42. package/dist/parseGremlin.mjs +191 -0
  43. package/dist/parseGremlin.mjs.map +1 -0
  44. package/dist/parseJSONata.d.mts +2 -2
  45. package/dist/parseJSONata.d.ts +2 -2
  46. package/dist/parseJSONata.js +11 -11
  47. package/dist/parseJSONata.js.map +1 -1
  48. package/dist/parseJSONata.mjs +11 -11
  49. package/dist/parseJSONata.mjs.map +1 -1
  50. package/dist/parseJsonLogic.d.mts +2 -2
  51. package/dist/parseJsonLogic.d.ts +2 -2
  52. package/dist/parseJsonLogic.js +6 -6
  53. package/dist/parseJsonLogic.js.map +1 -1
  54. package/dist/parseJsonLogic.mjs +6 -6
  55. package/dist/parseJsonLogic.mjs.map +1 -1
  56. package/dist/parseMongoDB.d.mts +2 -2
  57. package/dist/parseMongoDB.d.ts +2 -2
  58. package/dist/parseMongoDB.js +6 -6
  59. package/dist/parseMongoDB.js.map +1 -1
  60. package/dist/parseMongoDB.mjs +6 -6
  61. package/dist/parseMongoDB.mjs.map +1 -1
  62. package/dist/parseSPARQL.d.mts +34 -0
  63. package/dist/parseSPARQL.d.ts +34 -0
  64. package/dist/parseSPARQL.js +253 -0
  65. package/dist/parseSPARQL.js.map +1 -0
  66. package/dist/parseSPARQL.mjs +251 -0
  67. package/dist/parseSPARQL.mjs.map +1 -0
  68. package/dist/parseSQL.d.mts +2 -2
  69. package/dist/parseSQL.d.ts +2 -2
  70. package/dist/parseSQL.js +16 -16
  71. package/dist/parseSQL.js.map +1 -1
  72. package/dist/parseSQL.mjs +16 -16
  73. package/dist/parseSQL.mjs.map +1 -1
  74. package/dist/parseSpEL.d.mts +2 -2
  75. package/dist/parseSpEL.d.ts +2 -2
  76. package/dist/parseSpEL.js +10 -10
  77. package/dist/parseSpEL.js.map +1 -1
  78. package/dist/parseSpEL.mjs +10 -10
  79. package/dist/parseSpEL.mjs.map +1 -1
  80. package/dist/{prepareQueryObjects-DO3qXriW.js → prepareQueryObjects-BoG5Rt8z.js} +6 -6
  81. package/dist/prepareQueryObjects-BoG5Rt8z.js.map +1 -0
  82. package/dist/{prepareQueryObjects-BfMlS4ql.mjs → prepareQueryObjects-uA10ZpZX.mjs} +6 -6
  83. package/dist/prepareQueryObjects-uA10ZpZX.mjs.map +1 -0
  84. package/dist/query-builder.css +1 -1
  85. package/dist/query-builder.css.map +1 -1
  86. package/dist/react-querybuilder_core.d.mts +288 -22
  87. package/dist/react-querybuilder_core.legacy-esm.d.ts +288 -22
  88. package/dist/react-querybuilder_core.legacy-esm.js +833 -108
  89. package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
  90. package/dist/react-querybuilder_core.mjs +788 -78
  91. package/dist/react-querybuilder_core.mjs.map +1 -1
  92. package/dist/react-querybuilder_core.production.d.mts +288 -22
  93. package/dist/react-querybuilder_core.production.mjs +1 -1
  94. package/dist/react-querybuilder_core.production.mjs.map +1 -1
  95. package/dist/styles/_main.scss +4 -0
  96. package/dist/transformQuery.d.mts +1 -1
  97. package/dist/transformQuery.d.ts +1 -1
  98. package/dist/transformQuery.js +1 -1
  99. package/dist/transformQuery.mjs +1 -1
  100. package/dist/{utils-BlMGIhvx.mjs → utils-ChLG90DP.mjs} +3 -3
  101. package/dist/utils-ChLG90DP.mjs.map +1 -0
  102. package/dist/{utils-CZRhzje-.js → utils-Qwkq2Q0F.js} +3 -3
  103. package/dist/utils-Qwkq2Q0F.js.map +1 -0
  104. package/formatQuery/package.json +1 -1
  105. package/package.json +53 -14
  106. package/parseCEL/package.json +1 -1
  107. package/parseCypher/package.json +4 -0
  108. package/parseGremlin/package.json +4 -0
  109. package/parseJSONata/package.json +1 -1
  110. package/parseJsonLogic/package.json +1 -1
  111. package/parseMongoDB/package.json +1 -1
  112. package/parseSPARQL/package.json +4 -0
  113. package/parseSQL/package.json +1 -1
  114. package/parseSpEL/package.json +1 -1
  115. package/transformQuery/package.json +1 -1
  116. package/dist/convertQuery-CeJSNn37.mjs.map +0 -1
  117. package/dist/convertQuery-J8LpTG-7.js.map +0 -1
  118. package/dist/objectUtils-ButT0Mng.js.map +0 -1
  119. package/dist/objectUtils-C0WB-8ex.mjs.map +0 -1
  120. package/dist/prepareQueryObjects-BfMlS4ql.mjs.map +0 -1
  121. package/dist/prepareQueryObjects-DO3qXriW.js.map +0 -1
  122. package/dist/utils-BlMGIhvx.mjs.map +0 -1
  123. package/dist/utils-CZRhzje-.js.map +0 -1
package/dist/parseCEL.js CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_utils = require("./utils-CZRhzje-.js");
3
- const require_objectUtils = require("./objectUtils-ButT0Mng.js");
4
- const require_prepareQueryObjects = require("./prepareQueryObjects-DO3qXriW.js");
2
+ const require_utils = require("./utils-Qwkq2Q0F.js");
3
+ const require_objectUtils = require("./objectUtils-Bzug_QfX.js");
4
+ const require_prepareQueryObjects = require("./prepareQueryObjects-BoG5Rt8z.js");
5
5
  require("./parseJSONata.js");
6
6
  let _ts_jison_parser = require("@ts-jison/parser");
7
7
  let _ts_jison_lexer = require("@ts-jison/lexer");
@@ -2019,42 +2019,42 @@ const isCELMap = (expr) => expr.type === "Map";
2019
2019
  const isCELIdentifier = (expr) => expr.type === "Identifier";
2020
2020
  const isCELNegation = (expr) => expr.type === "Negation";
2021
2021
  const isCELMember = (expr) => expr.type === "Member";
2022
- // istanbul ignore next
2022
+ // v8 ignore next
2023
2023
  const isCELAddition = (expr) => expr.type === "Addition";
2024
2024
  const isCELBooleanLiteral = (expr) => expr.type === "BooleanLiteral";
2025
2025
  const isCELBytesLiteral = (expr) => expr.type === "BytesLiteral";
2026
- // istanbul ignore next
2026
+ // v8 ignore next
2027
2027
  const isCELConditionalExpr = (expr) => expr.type === "ConditionalExpr";
2028
- // istanbul ignore next
2028
+ // v8 ignore next
2029
2029
  const isCELDivision = (expr) => expr.type === "Division";
2030
- // istanbul ignore next
2030
+ // v8 ignore next
2031
2031
  const isCELDynamicPropertyAccessor = (expr) => expr.type === "DynamicPropertyAccessor";
2032
- // istanbul ignore next
2032
+ // v8 ignore next
2033
2033
  const isCELExpressionList = (expr) => expr.type === "ExpressionList";
2034
- // istanbul ignore next
2034
+ // v8 ignore next
2035
2035
  const isCELFieldInit = (expr) => expr.type === "FieldInit";
2036
- // istanbul ignore next
2036
+ // v8 ignore next
2037
2037
  const isCELFieldInits = (expr) => expr.type === "FieldInits";
2038
- // istanbul ignore next
2038
+ // v8 ignore next
2039
2039
  const isCELFieldsObject = (expr) => expr.type === "FieldsObject";
2040
2040
  const isCELFloatLiteral = (expr) => expr.type === "FloatLiteral";
2041
- // istanbul ignore next
2041
+ // v8 ignore next
2042
2042
  const isCELFunctionCall = (expr) => expr.type === "FunctionCall";
2043
2043
  const isCELIntegerLiteral = (expr) => expr.type === "IntegerLiteral";
2044
- // istanbul ignore next
2044
+ // v8 ignore next
2045
2045
  const isCELMapInit = (expr) => expr.type === "MapInit";
2046
- // istanbul ignore next
2046
+ // v8 ignore next
2047
2047
  const isCELMapInits = (expr) => expr.type === "MapInits";
2048
- // istanbul ignore next
2048
+ // v8 ignore next
2049
2049
  const isCELModulo = (expr) => expr.type === "Modulo";
2050
- // istanbul ignore next
2050
+ // v8 ignore next
2051
2051
  const isCELMultiplication = (expr) => expr.type === "Multiplication";
2052
- // istanbul ignore next
2052
+ // v8 ignore next
2053
2053
  const isCELNegative = (expr) => expr.type === "Negative";
2054
2054
  const isCELNullLiteral = (expr) => expr.type === "NullLiteral";
2055
- // istanbul ignore next
2055
+ // v8 ignore next
2056
2056
  const isCELProperty = (expr) => expr.type === "Property";
2057
- // istanbul ignore next
2057
+ // v8 ignore next
2058
2058
  const isCELSubtraction = (expr) => expr.type === "Subtraction";
2059
2059
  const isCELUnsignedIntegerLiteral = (expr) => expr.type === "UnsignedIntegerLiteral";
2060
2060
  const isCELIdentifierOrChain = (expr) => isCELIdentifier(expr) || isCELDynamicPropertyAccessor(expr) || isCELMember(expr) && !!expr.left && !!expr.right && !expr.list && !expr.value && isCELIdentifierOrChain(expr.left) && isCELIdentifier(expr.right);
@@ -2065,7 +2065,7 @@ const isCELNegatedLikeExpression = (expr) => isCELMember(expr) && !!expr.left &&
2065
2065
  const isCELSubqueryExpression = (expr) => isCELMember(expr) && !!expr.left && !!expr.right && !!expr.list && isCELIdentifierOrChain(expr.left) && isCELIdentifier(expr.right) && (expr.right.value === "all" || expr.right.value === "exists") && expr.list.value.length >= 2;
2066
2066
  const isCELNegatedSubqueryExpression = (expr) => isCELMember(expr) && !!expr.left && !!expr.right && !!expr.list && isCELNegatedIdentifierOrChain(expr.left) && isCELIdentifier(expr.right) && (expr.right.value === "all" || expr.right.value === "exists") && expr.list.value.length >= 2;
2067
2067
  const extractSubqueryComponents = (expr) => {
2068
- // istanbul ignore next
2068
+ // v8 ignore next
2069
2069
  if (!isCELSubqueryExpression(expr)) return null;
2070
2070
  const field = getCELIdentifierFromChain(expr.left);
2071
2071
  const method = expr.right.value;
@@ -2073,7 +2073,7 @@ const extractSubqueryComponents = (expr) => {
2073
2073
  return {
2074
2074
  field,
2075
2075
  method,
2076
- alias: isCELIdentifier(aliasExpr) ? aliasExpr.value : null,
2076
+ alias: isCELIdentifier(aliasExpr) ? aliasExpr.value : /* v8 ignore next -- @preserve */ null,
2077
2077
  condition: conditionExpr
2078
2078
  };
2079
2079
  };
@@ -2081,14 +2081,14 @@ const getCELIdentifierFromChain = (expr) => {
2081
2081
  if (isCELIdentifier(expr)) return expr.value;
2082
2082
  if (isCELDynamicPropertyAccessor(expr)) {
2083
2083
  const leftField = getCELIdentifierFromChain(expr.left);
2084
- // istanbul ignore else
2084
+ // v8 ignore else
2085
2085
  if (isCELStringLiteral(expr.right)) return `${leftField}["${evalCELLiteralValue(expr.right)}"]`;
2086
- // istanbul ignore next
2086
+ // v8 ignore next
2087
2087
  return `${leftField}[${expr.right.type}]`;
2088
2088
  }
2089
- // istanbul ignore else
2089
+ // v8 ignore else
2090
2090
  if (expr.left && expr.right && isCELIdentifier(expr.right) && (isCELIdentifier(expr.left) || isCELMember(expr.left) || isCELDynamicPropertyAccessor(expr.left))) return `${getCELIdentifierFromChain(expr.left)}.${expr.right.value}`;
2091
- // istanbul ignore next
2091
+ // v8 ignore next
2092
2092
  return expr.type;
2093
2093
  };
2094
2094
  const getCELIdentifierFromNegatedChain = (expr) => {
@@ -2153,17 +2153,17 @@ const celGenerateMixedAndOrList = (expr) => {
2153
2153
  return returnArray;
2154
2154
  };
2155
2155
  const isPrimitiveArrayUsage = (expr, alias) => {
2156
- // istanbul ignore next
2156
+ // v8 ignore next
2157
2157
  if (!alias) return false;
2158
2158
  if (isCELIdentifier(expr) && expr.value === alias) return true;
2159
2159
  if (isCELLikeExpression(expr) && isCELIdentifier(expr.left) && expr.left.value === alias) return true;
2160
2160
  if (isCELRelation(expr) || isCELConditionalAnd(expr) || isCELConditionalOr(expr)) return isPrimitiveArrayUsage(expr.left, alias) || isPrimitiveArrayUsage(expr.right, alias);
2161
- // istanbul ignore next
2161
+ // v8 ignore next
2162
2162
  if (isCELExpressionGroup(expr) || isCELNegation(expr)) return isPrimitiveArrayUsage(expr.value, alias);
2163
2163
  return false;
2164
2164
  };
2165
2165
  const transformAliasInExpressionInternal = (expr, alias, isPrimitive) => {
2166
- // istanbul ignore next
2166
+ // v8 ignore next
2167
2167
  if (!alias) return expr;
2168
2168
  if (isCELIdentifier(expr) && expr.value === alias) return {
2169
2169
  type: "Identifier",
@@ -2207,7 +2207,7 @@ const transformAliasInExpressionInternal = (expr, alias, isPrimitive) => {
2207
2207
  };
2208
2208
  if (isCELMember(expr) && expr.left && expr.right) {
2209
2209
  const transformedLeft = transformAliasInExpressionInternal(expr.left, alias, isPrimitive);
2210
- // istanbul ignore else
2210
+ // v8 ignore else
2211
2211
  if (transformedLeft !== expr.left) return {
2212
2212
  type: "Member",
2213
2213
  left: transformedLeft,
@@ -2244,7 +2244,7 @@ const transformAliasInExpressionInternal = (expr, alias, isPrimitive) => {
2244
2244
  return expr;
2245
2245
  };
2246
2246
  const transformAliasInExpression = (expr, alias) => {
2247
- // istanbul ignore next
2247
+ // v8 ignore next
2248
2248
  if (!alias) return expr;
2249
2249
  return transformAliasInExpressionInternal(expr, alias, isPrimitiveArrayUsage(expr, alias));
2250
2250
  };
@@ -2267,7 +2267,7 @@ function parseCEL(cel, options = {}) {
2267
2267
  };
2268
2268
  const processCELExpression = (expr, processOpts = {}) => {
2269
2269
  const { forwardNegation: forwardedNegation, groupOnlyIfNecessary } = processOpts;
2270
- /* istanbul ignore if */
2270
+ /* v8 ignore if -- @preserve */
2271
2271
  if (isCELNegation(expr) || isCELNegatedLikeExpression(expr)) {
2272
2272
  const negate = isCELNegation(expr) ? expr.negations % 2 === 1 : (getCELIdentifierFromNegatedChain(expr.left).match(/^!+/)?.[0].length ?? 0) % 2 === 1;
2273
2273
  const negatedExpr = isCELNegation(expr) && isCELExpressionGroup(expr.value) && isCELLikeExpression(expr.value.value) ? processCELExpression(expr.value.value, { forwardNegation: negate }) : isCELNegatedLikeExpression(expr) ? processCELExpression({
@@ -2322,7 +2322,7 @@ function parseCEL(cel, options = {}) {
2322
2322
  };
2323
2323
  return processCELExpression(exp);
2324
2324
  }).filter(Boolean);
2325
- /* istanbul ignore else */
2325
+ /* v8 ignore else -- @preserve */
2326
2326
  if (rules.length > 0) return {
2327
2327
  combinator,
2328
2328
  rules
@@ -2347,7 +2347,7 @@ function parseCEL(cel, options = {}) {
2347
2347
  };
2348
2348
  } else if (isCELSubqueryExpression(expr)) {
2349
2349
  const components = extractSubqueryComponents(expr);
2350
- // istanbul ignore else
2350
+ // v8 ignore else
2351
2351
  if (components) {
2352
2352
  const { field, method, alias, condition } = components;
2353
2353
  const matchMode = method === "all" ? "all" : "some";
@@ -2369,8 +2369,8 @@ function parseCEL(cel, options = {}) {
2369
2369
  const field = getCELIdentifierFromNegatedChain(expr.left).replace(/^!+/, "");
2370
2370
  const method = expr.right.value;
2371
2371
  const [aliasExpr, conditionExpr] = expr.list.value;
2372
- const subqueryValue = processCELExpression(transformAliasInExpression(conditionExpr, isCELIdentifier(aliasExpr) ? aliasExpr.value : null));
2373
- // istanbul ignore else
2372
+ const subqueryValue = processCELExpression(transformAliasInExpression(conditionExpr, isCELIdentifier(aliasExpr) ? aliasExpr.value : /* v8 ignore next -- @preserve */ null));
2373
+ // v8 ignore else
2374
2374
  if (subqueryValue && fieldIsValid(field, "=")) {
2375
2375
  const ruleGroupValue = require_objectUtils.isRuleGroup(subqueryValue) ? subqueryValue : ic ? { rules: [subqueryValue] } : {
2376
2376
  combinator: "and",