@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
|
@@ -1567,7 +1567,8 @@ const mongoDbFallback = { $and: [{ $expr: true }] };
|
|
|
1567
1567
|
* @group Export
|
|
1568
1568
|
*/
|
|
1569
1569
|
const defaultRuleGroupProcessorMongoDBQuery = (ruleGroup, options, meta) => {
|
|
1570
|
-
const { fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1570
|
+
const { context, fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1571
|
+
const { inExpressionContext } = context ?? {};
|
|
1571
1572
|
const processRuleGroup = (rg, outermost) => {
|
|
1572
1573
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermost ? mongoDbFallback : false;
|
|
1573
1574
|
const combinator = `$${lc(rg.combinator)}`;
|
|
@@ -1591,7 +1592,7 @@ const defaultRuleGroupProcessorMongoDBQuery = (ruleGroup, options, meta) => {
|
|
|
1591
1592
|
}, meta);
|
|
1592
1593
|
}).filter(Boolean);
|
|
1593
1594
|
const result = expressions.length > 0 ? expressions.length === 1 && !hasChildRules ? expressions[0] : { [combinator]: expressions } : mongoDbFallback;
|
|
1594
|
-
return rg.not ? { $not: result } : result;
|
|
1595
|
+
return rg.not ? inExpressionContext ? { $not: result } : { $nor: [result] } : result;
|
|
1595
1596
|
};
|
|
1596
1597
|
return processRuleGroup(convertFromIC(ruleGroup), true);
|
|
1597
1598
|
};
|
|
@@ -1632,7 +1633,8 @@ const defaultRuleProcessorMongoDBQuery = (rule, options = {}) => {
|
|
|
1632
1633
|
ruleProcessor: defaultRuleProcessorMongoDBQuery,
|
|
1633
1634
|
context: {
|
|
1634
1635
|
...options.context,
|
|
1635
|
-
avoidFieldsAsKeys: true
|
|
1636
|
+
avoidFieldsAsKeys: true,
|
|
1637
|
+
inExpressionContext: true
|
|
1636
1638
|
}
|
|
1637
1639
|
});
|
|
1638
1640
|
const filteredCount = { $size: { $ifNull: [{ $filter: {
|
|
@@ -2243,7 +2245,7 @@ const defaultRuleGroupProcessorMongoDB = (ruleGroup, options, meta) => {
|
|
|
2243
2245
|
}, meta);
|
|
2244
2246
|
}).filter(Boolean);
|
|
2245
2247
|
const result = expressions.length > 0 ? expressions.length === 1 && !hasChildRules ? expressions[0] : `${combinator}:[${expressions.join(",")}]` : fallbackExpression;
|
|
2246
|
-
return rg.not ? `"$
|
|
2248
|
+
return rg.not ? `"$nor":[${isBracketed(result) ? result : `{${result}}`}]` : result;
|
|
2247
2249
|
};
|
|
2248
2250
|
const processedQuery = processRuleGroup(convertFromIC(ruleGroup), true);
|
|
2249
2251
|
return isBracketed(processedQuery) ? processedQuery : `{${processedQuery}}`;
|