@react-querybuilder/core 8.14.3-alpha.0 → 8.14.4

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 (37) hide show
  1. package/dist/cjs/react-querybuilder_core.cjs.development.js +6 -4
  2. package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
  3. package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -1
  4. package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
  5. package/dist/formatQuery.d.mts +1 -2
  6. package/dist/formatQuery.d.ts +1 -2
  7. package/dist/formatQuery.js +6 -4
  8. package/dist/formatQuery.js.map +1 -1
  9. package/dist/formatQuery.mjs +6 -4
  10. package/dist/formatQuery.mjs.map +1 -1
  11. package/dist/{import-Bltb2mT4.d.mts → import-BwQqExpO.d.mts} +2 -2
  12. package/dist/{import-B5Iq8XmL.d.ts → import-CrJf23Nf.d.ts} +2 -2
  13. package/dist/{basic-CNIjb6rI.d.mts → index-CYT4Saz-.d.mts} +450 -2
  14. package/dist/{basic-BXJVfD0P.d.ts → index-DBlQeLax.d.ts} +450 -2
  15. package/dist/parseCEL.d.mts +2 -2
  16. package/dist/parseCEL.d.ts +2 -2
  17. package/dist/parseJSONata.d.mts +2 -2
  18. package/dist/parseJSONata.d.ts +2 -2
  19. package/dist/parseJsonLogic.d.mts +2 -3
  20. package/dist/parseJsonLogic.d.ts +2 -3
  21. package/dist/parseMongoDB.d.mts +2 -2
  22. package/dist/parseMongoDB.d.ts +2 -2
  23. package/dist/parseSQL.d.mts +2 -2
  24. package/dist/parseSQL.d.ts +2 -2
  25. package/dist/parseSpEL.d.mts +2 -2
  26. package/dist/parseSpEL.d.ts +2 -2
  27. package/dist/react-querybuilder_core.legacy-esm.js +15 -11
  28. package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
  29. package/dist/react-querybuilder_core.mjs +6 -4
  30. package/dist/react-querybuilder_core.mjs.map +1 -1
  31. package/dist/react-querybuilder_core.production.mjs +1 -1
  32. package/dist/react-querybuilder_core.production.mjs.map +1 -1
  33. package/dist/transformQuery.d.mts +1 -1
  34. package/dist/transformQuery.d.ts +1 -1
  35. package/package.json +10 -9
  36. package/dist/export-6x7MilFR.d.mts +0 -451
  37. package/dist/export-CpJOQuZv.d.ts +0 -451
@@ -1,5 +1,4 @@
1
- import { S as SetRequired, f as RuleGroupTypeAny, v as RuleType } from "./basic-CNIjb6rI.mjs";
2
- import { _ as ValueProcessorOptions, a as FormatQueryOptions, c as NLTranslations, d as RQBJsonLogic, f as RuleGroupProcessor, g as ValueProcessorLegacy, h as ValueProcessorByRule, i as ExportOperatorMap, l as ParameterizedNamedSQL, m as SQLPreset, n as ExportFormat, o as GroupVariantCondition, p as RuleProcessor, r as ExportObjectFormats, s as NLTranslationKey, t as ConstituentWordOrder, u as ParameterizedSQL } from "./export-6x7MilFR.mjs";
1
+ import { D as RuleType, _ as ValueProcessorOptions, a as FormatQueryOptions, c as NLTranslations, d as RQBJsonLogic, f as RuleGroupProcessor, g as ValueProcessorLegacy, h as ValueProcessorByRule, i as ExportOperatorMap, k as SetRequired, l as ParameterizedNamedSQL, m as SQLPreset, n as ExportFormat, o as GroupVariantCondition, p as RuleProcessor, r as ExportObjectFormats, s as NLTranslationKey, t as ConstituentWordOrder, u as ParameterizedSQL, x as RuleGroupTypeAny } from "./index-CYT4Saz-.mjs";
3
2
  import { Column, Operators, SQL, Table } from "drizzle-orm";
4
3
  import { WhereOptions } from "sequelize";
5
4
 
@@ -1,5 +1,4 @@
1
- import { S as SetRequired, f as RuleGroupTypeAny, v as RuleType } from "./basic-BXJVfD0P.js";
2
- import { _ as ValueProcessorOptions, a as FormatQueryOptions, c as NLTranslations, d as RQBJsonLogic, f as RuleGroupProcessor, g as ValueProcessorLegacy, h as ValueProcessorByRule, i as ExportOperatorMap, l as ParameterizedNamedSQL, m as SQLPreset, n as ExportFormat, o as GroupVariantCondition, p as RuleProcessor, r as ExportObjectFormats, s as NLTranslationKey, t as ConstituentWordOrder, u as ParameterizedSQL } from "./export-CpJOQuZv.js";
1
+ import { D as RuleType, _ as ValueProcessorOptions, a as FormatQueryOptions, c as NLTranslations, d as RQBJsonLogic, f as RuleGroupProcessor, g as ValueProcessorLegacy, h as ValueProcessorByRule, i as ExportOperatorMap, k as SetRequired, l as ParameterizedNamedSQL, m as SQLPreset, n as ExportFormat, o as GroupVariantCondition, p as RuleProcessor, r as ExportObjectFormats, s as NLTranslationKey, t as ConstituentWordOrder, u as ParameterizedSQL, x as RuleGroupTypeAny } from "./index-DBlQeLax.js";
3
2
  import { Column, Operators, SQL, Table } from "drizzle-orm";
4
3
  import { WhereOptions } from "sequelize";
5
4
 
@@ -174,7 +174,8 @@ const mongoDbFallback = { $and: [{ $expr: true }] };
174
174
  * @group Export
175
175
  */
176
176
  const defaultRuleGroupProcessorMongoDBQuery = (ruleGroup, options, meta) => {
177
- const { fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
177
+ const { context, fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
178
+ const { inExpressionContext } = context ?? {};
178
179
  const processRuleGroup = (rg, outermost) => {
179
180
  if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermost ? mongoDbFallback : false;
180
181
  const combinator = `$${require_objectUtils.lc(rg.combinator)}`;
@@ -198,7 +199,7 @@ const defaultRuleGroupProcessorMongoDBQuery = (ruleGroup, options, meta) => {
198
199
  }, meta);
199
200
  }).filter(Boolean);
200
201
  const result = expressions.length > 0 ? expressions.length === 1 && !hasChildRules ? expressions[0] : { [combinator]: expressions } : mongoDbFallback;
201
- return rg.not ? { $not: result } : result;
202
+ return rg.not ? inExpressionContext ? { $not: result } : { $nor: [result] } : result;
202
203
  };
203
204
  return processRuleGroup(require_convertQuery.convertFromIC(ruleGroup), true);
204
205
  };
@@ -239,7 +240,8 @@ const defaultRuleProcessorMongoDBQuery = (rule, options = {}) => {
239
240
  ruleProcessor: defaultRuleProcessorMongoDBQuery,
240
241
  context: {
241
242
  ...options.context,
242
- avoidFieldsAsKeys: true
243
+ avoidFieldsAsKeys: true,
244
+ inExpressionContext: true
243
245
  }
244
246
  });
245
247
  const filteredCount = { $size: { $ifNull: [{ $filter: {
@@ -850,7 +852,7 @@ const defaultRuleGroupProcessorMongoDB = (ruleGroup, options, meta) => {
850
852
  }, meta);
851
853
  }).filter(Boolean);
852
854
  const result = expressions.length > 0 ? expressions.length === 1 && !hasChildRules ? expressions[0] : `${combinator}:[${expressions.join(",")}]` : fallbackExpression;
853
- return rg.not ? `"$not":${isBracketed(result) ? result : `{${result}}`}` : result;
855
+ return rg.not ? `"$nor":[${isBracketed(result) ? result : `{${result}}`}]` : result;
854
856
  };
855
857
  const processedQuery = processRuleGroup(require_convertQuery.convertFromIC(ruleGroup), true);
856
858
  return isBracketed(processedQuery) ? processedQuery : `{${processedQuery}}`;