@react-querybuilder/core 8.14.3 → 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.
- package/dist/cjs/react-querybuilder_core.cjs.development.js +6 -4
- package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
- package/dist/formatQuery.d.mts +1 -2
- package/dist/formatQuery.d.ts +1 -2
- package/dist/formatQuery.js +6 -4
- package/dist/formatQuery.js.map +1 -1
- package/dist/formatQuery.mjs +6 -4
- package/dist/formatQuery.mjs.map +1 -1
- package/dist/{import-Bltb2mT4.d.mts → import-BwQqExpO.d.mts} +2 -2
- package/dist/{import-B5Iq8XmL.d.ts → import-CrJf23Nf.d.ts} +2 -2
- package/dist/{basic-CNIjb6rI.d.mts → index-CYT4Saz-.d.mts} +450 -2
- package/dist/{basic-BXJVfD0P.d.ts → index-DBlQeLax.d.ts} +450 -2
- package/dist/parseCEL.d.mts +2 -2
- package/dist/parseCEL.d.ts +2 -2
- package/dist/parseJSONata.d.mts +2 -2
- package/dist/parseJSONata.d.ts +2 -2
- package/dist/parseJsonLogic.d.mts +2 -3
- package/dist/parseJsonLogic.d.ts +2 -3
- package/dist/parseMongoDB.d.mts +2 -2
- package/dist/parseMongoDB.d.ts +2 -2
- package/dist/parseSQL.d.mts +2 -2
- package/dist/parseSQL.d.ts +2 -2
- package/dist/parseSpEL.d.mts +2 -2
- package/dist/parseSpEL.d.ts +2 -2
- package/dist/react-querybuilder_core.legacy-esm.js +15 -11
- package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_core.mjs +6 -4
- package/dist/react-querybuilder_core.mjs.map +1 -1
- package/dist/react-querybuilder_core.production.mjs +1 -1
- package/dist/react-querybuilder_core.production.mjs.map +1 -1
- package/dist/transformQuery.d.mts +1 -1
- package/dist/transformQuery.d.ts +1 -1
- package/package.json +7 -6
- package/dist/export-6x7MilFR.d.mts +0 -451
- package/dist/export-CpJOQuZv.d.ts +0 -451
|
@@ -1566,7 +1566,8 @@ const mongoDbFallback = { $and: [{ $expr: true }] };
|
|
|
1566
1566
|
* @group Export
|
|
1567
1567
|
*/
|
|
1568
1568
|
const defaultRuleGroupProcessorMongoDBQuery = (ruleGroup, options, meta) => {
|
|
1569
|
-
const { fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1569
|
+
const { context, fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1570
|
+
const { inExpressionContext } = context ?? {};
|
|
1570
1571
|
const processRuleGroup = (rg, outermost) => {
|
|
1571
1572
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermost ? mongoDbFallback : false;
|
|
1572
1573
|
const combinator = `$${lc(rg.combinator)}`;
|
|
@@ -1590,7 +1591,7 @@ const defaultRuleGroupProcessorMongoDBQuery = (ruleGroup, options, meta) => {
|
|
|
1590
1591
|
}, meta);
|
|
1591
1592
|
}).filter(Boolean);
|
|
1592
1593
|
const result = expressions.length > 0 ? expressions.length === 1 && !hasChildRules ? expressions[0] : { [combinator]: expressions } : mongoDbFallback;
|
|
1593
|
-
return rg.not ? { $not: result } : result;
|
|
1594
|
+
return rg.not ? inExpressionContext ? { $not: result } : { $nor: [result] } : result;
|
|
1594
1595
|
};
|
|
1595
1596
|
return processRuleGroup(convertFromIC(ruleGroup), true);
|
|
1596
1597
|
};
|
|
@@ -1631,7 +1632,8 @@ const defaultRuleProcessorMongoDBQuery = (rule, options = {}) => {
|
|
|
1631
1632
|
ruleProcessor: defaultRuleProcessorMongoDBQuery,
|
|
1632
1633
|
context: {
|
|
1633
1634
|
...options.context,
|
|
1634
|
-
avoidFieldsAsKeys: true
|
|
1635
|
+
avoidFieldsAsKeys: true,
|
|
1636
|
+
inExpressionContext: true
|
|
1635
1637
|
}
|
|
1636
1638
|
});
|
|
1637
1639
|
const filteredCount = { $size: { $ifNull: [{ $filter: {
|
|
@@ -2242,7 +2244,7 @@ const defaultRuleGroupProcessorMongoDB = (ruleGroup, options, meta) => {
|
|
|
2242
2244
|
}, meta);
|
|
2243
2245
|
}).filter(Boolean);
|
|
2244
2246
|
const result = expressions.length > 0 ? expressions.length === 1 && !hasChildRules ? expressions[0] : `${combinator}:[${expressions.join(",")}]` : fallbackExpression;
|
|
2245
|
-
return rg.not ? `"$
|
|
2247
|
+
return rg.not ? `"$nor":[${isBracketed(result) ? result : `{${result}}`}]` : result;
|
|
2246
2248
|
};
|
|
2247
2249
|
const processedQuery = processRuleGroup(convertFromIC(ruleGroup), true);
|
|
2248
2250
|
return isBracketed(processedQuery) ? processedQuery : `{${processedQuery}}`;
|