@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
package/dist/formatQuery.mjs
CHANGED
|
@@ -173,7 +173,8 @@ const mongoDbFallback = { $and: [{ $expr: true }] };
|
|
|
173
173
|
* @group Export
|
|
174
174
|
*/
|
|
175
175
|
const defaultRuleGroupProcessorMongoDBQuery = (ruleGroup, options, meta) => {
|
|
176
|
-
const { fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
176
|
+
const { context, fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
177
|
+
const { inExpressionContext } = context ?? {};
|
|
177
178
|
const processRuleGroup = (rg, outermost) => {
|
|
178
179
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermost ? mongoDbFallback : false;
|
|
179
180
|
const combinator = `$${lc(rg.combinator)}`;
|
|
@@ -197,7 +198,7 @@ const defaultRuleGroupProcessorMongoDBQuery = (ruleGroup, options, meta) => {
|
|
|
197
198
|
}, meta);
|
|
198
199
|
}).filter(Boolean);
|
|
199
200
|
const result = expressions.length > 0 ? expressions.length === 1 && !hasChildRules ? expressions[0] : { [combinator]: expressions } : mongoDbFallback;
|
|
200
|
-
return rg.not ? { $not: result } : result;
|
|
201
|
+
return rg.not ? inExpressionContext ? { $not: result } : { $nor: [result] } : result;
|
|
201
202
|
};
|
|
202
203
|
return processRuleGroup(convertFromIC(ruleGroup), true);
|
|
203
204
|
};
|
|
@@ -238,7 +239,8 @@ const defaultRuleProcessorMongoDBQuery = (rule, options = {}) => {
|
|
|
238
239
|
ruleProcessor: defaultRuleProcessorMongoDBQuery,
|
|
239
240
|
context: {
|
|
240
241
|
...options.context,
|
|
241
|
-
avoidFieldsAsKeys: true
|
|
242
|
+
avoidFieldsAsKeys: true,
|
|
243
|
+
inExpressionContext: true
|
|
242
244
|
}
|
|
243
245
|
});
|
|
244
246
|
const filteredCount = { $size: { $ifNull: [{ $filter: {
|
|
@@ -849,7 +851,7 @@ const defaultRuleGroupProcessorMongoDB = (ruleGroup, options, meta) => {
|
|
|
849
851
|
}, meta);
|
|
850
852
|
}).filter(Boolean);
|
|
851
853
|
const result = expressions.length > 0 ? expressions.length === 1 && !hasChildRules ? expressions[0] : `${combinator}:[${expressions.join(",")}]` : fallbackExpression;
|
|
852
|
-
return rg.not ? `"$
|
|
854
|
+
return rg.not ? `"$nor":[${isBracketed(result) ? result : `{${result}}`}]` : result;
|
|
853
855
|
};
|
|
854
856
|
const processedQuery = processRuleGroup(convertFromIC(ruleGroup), true);
|
|
855
857
|
return isBracketed(processedQuery) ? processedQuery : `{${processedQuery}}`;
|