@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
|
@@ -689,7 +689,7 @@ const isRuleGroupType = (rg) => isRuleGroup(rg) && typeof rg.combinator === "str
|
|
|
689
689
|
*/
|
|
690
690
|
const isRuleGroupTypeIC = (rg) => isRuleGroup(rg) && rg.combinator === void 0;
|
|
691
691
|
//#endregion
|
|
692
|
-
//#region \0@oxc-project+runtime@0.
|
|
692
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/typeof.js
|
|
693
693
|
function _typeof(o) {
|
|
694
694
|
"@babel/helpers - typeof";
|
|
695
695
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
|
|
@@ -699,7 +699,7 @@ function _typeof(o) {
|
|
|
699
699
|
}, _typeof(o);
|
|
700
700
|
}
|
|
701
701
|
//#endregion
|
|
702
|
-
//#region \0@oxc-project+runtime@0.
|
|
702
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/toPrimitive.js
|
|
703
703
|
function toPrimitive(t, r) {
|
|
704
704
|
if ("object" != _typeof(t) || !t) return t;
|
|
705
705
|
var e = t[Symbol.toPrimitive];
|
|
@@ -711,13 +711,13 @@ function toPrimitive(t, r) {
|
|
|
711
711
|
return ("string" === r ? String : Number)(t);
|
|
712
712
|
}
|
|
713
713
|
//#endregion
|
|
714
|
-
//#region \0@oxc-project+runtime@0.
|
|
714
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/toPropertyKey.js
|
|
715
715
|
function toPropertyKey(t) {
|
|
716
716
|
var i = toPrimitive(t, "string");
|
|
717
717
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
718
718
|
}
|
|
719
719
|
//#endregion
|
|
720
|
-
//#region \0@oxc-project+runtime@0.
|
|
720
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/defineProperty.js
|
|
721
721
|
function _defineProperty(e, r, t) {
|
|
722
722
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
723
723
|
value: t,
|
|
@@ -727,7 +727,7 @@ function _defineProperty(e, r, t) {
|
|
|
727
727
|
}) : e[r] = t, e;
|
|
728
728
|
}
|
|
729
729
|
//#endregion
|
|
730
|
-
//#region \0@oxc-project+runtime@0.
|
|
730
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/objectSpread2.js
|
|
731
731
|
function ownKeys(e, r) {
|
|
732
732
|
var t = Object.keys(e);
|
|
733
733
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -750,7 +750,7 @@ function _objectSpread2(e) {
|
|
|
750
750
|
return e;
|
|
751
751
|
}
|
|
752
752
|
//#endregion
|
|
753
|
-
//#region \0@oxc-project+runtime@0.
|
|
753
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/objectWithoutPropertiesLoose.js
|
|
754
754
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
755
755
|
if (null == r) return {};
|
|
756
756
|
var t = {};
|
|
@@ -761,7 +761,7 @@ function _objectWithoutPropertiesLoose(r, e) {
|
|
|
761
761
|
return t;
|
|
762
762
|
}
|
|
763
763
|
//#endregion
|
|
764
|
-
//#region \0@oxc-project+runtime@0.
|
|
764
|
+
//#region \0@oxc-project+runtime@0.122.0/helpers/objectWithoutProperties.js
|
|
765
765
|
function _objectWithoutProperties(e, t) {
|
|
766
766
|
if (null == e) return {};
|
|
767
767
|
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
@@ -1634,7 +1634,8 @@ const mongoDbFallback = { $and: [{ $expr: true }] };
|
|
|
1634
1634
|
* @group Export
|
|
1635
1635
|
*/
|
|
1636
1636
|
const defaultRuleGroupProcessorMongoDBQuery = (ruleGroup, options, meta) => {
|
|
1637
|
-
const { fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1637
|
+
const { context, fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1638
|
+
const { inExpressionContext } = context !== null && context !== void 0 ? context : {};
|
|
1638
1639
|
const processRuleGroup = (rg, outermost) => {
|
|
1639
1640
|
var _rg$id;
|
|
1640
1641
|
if (!isRuleOrGroupValid(rg, validationMap[(_rg$id = rg.id) !== null && _rg$id !== void 0 ? _rg$id : ""])) return outermost ? mongoDbFallback : false;
|
|
@@ -1658,7 +1659,7 @@ const defaultRuleGroupProcessorMongoDBQuery = (ruleGroup, options, meta) => {
|
|
|
1658
1659
|
}), meta);
|
|
1659
1660
|
}).filter(Boolean);
|
|
1660
1661
|
const result = expressions.length > 0 ? expressions.length === 1 && !hasChildRules ? expressions[0] : { [combinator]: expressions } : mongoDbFallback;
|
|
1661
|
-
return rg.not ? { $not: result } : result;
|
|
1662
|
+
return rg.not ? inExpressionContext ? { $not: result } : { $nor: [result] } : result;
|
|
1662
1663
|
};
|
|
1663
1664
|
return processRuleGroup(convertFromIC(ruleGroup), true);
|
|
1664
1665
|
};
|
|
@@ -1686,7 +1687,10 @@ const defaultRuleProcessorMongoDBQuery = (rule, options = {}) => {
|
|
|
1686
1687
|
}));
|
|
1687
1688
|
const subQueryWithAggCtx = defaultRuleGroupProcessorMongoDBQuery(transformQuery(value, { ruleProcessor: (r) => _objectSpread2(_objectSpread2({}, r), {}, { field: r.field ? `$item.${r.field}` : "$item" }) }), _objectSpread2(_objectSpread2({}, options), {}, {
|
|
1688
1689
|
ruleProcessor: defaultRuleProcessorMongoDBQuery,
|
|
1689
|
-
context: _objectSpread2(_objectSpread2({}, options.context), {}, {
|
|
1690
|
+
context: _objectSpread2(_objectSpread2({}, options.context), {}, {
|
|
1691
|
+
avoidFieldsAsKeys: true,
|
|
1692
|
+
inExpressionContext: true
|
|
1693
|
+
})
|
|
1690
1694
|
}));
|
|
1691
1695
|
const filteredCount = { $size: { $ifNull: [{ $filter: {
|
|
1692
1696
|
input: `$${field}`,
|
|
@@ -2287,7 +2291,7 @@ const defaultRuleGroupProcessorMongoDB = (ruleGroup, options, meta) => {
|
|
|
2287
2291
|
}), meta);
|
|
2288
2292
|
}).filter(Boolean);
|
|
2289
2293
|
const result = expressions.length > 0 ? expressions.length === 1 && !hasChildRules ? expressions[0] : `${combinator}:[${expressions.join(",")}]` : fallbackExpression;
|
|
2290
|
-
return rg.not ? `"$
|
|
2294
|
+
return rg.not ? `"$nor":[${isBracketed(result) ? result : `{${result}}`}]` : result;
|
|
2291
2295
|
};
|
|
2292
2296
|
const processedQuery = processRuleGroup(convertFromIC(ruleGroup), true);
|
|
2293
2297
|
return isBracketed(processedQuery) ? processedQuery : `{${processedQuery}}`;
|