@react-querybuilder/core 8.17.0 → 8.18.0
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.d.ts +36 -3
- package/dist/cjs/react-querybuilder_core.cjs.development.js +14 -9
- package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +36 -3
- 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 +3 -1
- package/dist/formatQuery.d.ts +3 -1
- package/dist/formatQuery.js +10 -8
- package/dist/formatQuery.js.map +1 -1
- package/dist/formatQuery.mjs +10 -8
- package/dist/formatQuery.mjs.map +1 -1
- package/dist/{import-CSHMjlid.d.ts → import-Qs1-kgv5.d.ts} +2 -2
- package/dist/{import-BQ5xaW6i.d.mts → import-ShTj5IdB.d.mts} +2 -2
- package/dist/{index-CREDWM32.d.ts → index-DlVg-QXo.d.mts} +32 -3
- package/dist/{index-CREDWM32.d.mts → index-DlVg-QXo.d.ts} +32 -3
- package/dist/parseCEL.d.mts +7 -7
- package/dist/parseCEL.d.ts +7 -7
- package/dist/parseCEL.js +3 -3
- package/dist/parseCEL.js.map +1 -1
- package/dist/parseCEL.mjs +3 -3
- package/dist/parseCEL.mjs.map +1 -1
- package/dist/parseCypher.d.mts +1 -1
- package/dist/parseCypher.d.ts +1 -1
- package/dist/parseGremlin.d.mts +1 -1
- package/dist/parseGremlin.d.ts +1 -1
- package/dist/parseJSONata.d.mts +2 -2
- package/dist/parseJSONata.d.ts +2 -2
- package/dist/parseJsonLogic.d.mts +2 -2
- package/dist/parseJsonLogic.d.ts +2 -2
- package/dist/parseJsonLogic.js +7 -7
- package/dist/parseJsonLogic.js.map +1 -1
- package/dist/parseJsonLogic.mjs +7 -7
- package/dist/parseJsonLogic.mjs.map +1 -1
- package/dist/parseMongoDB.d.mts +2 -2
- package/dist/parseMongoDB.d.ts +2 -2
- package/dist/parseSPARQL.d.mts +1 -1
- package/dist/parseSPARQL.d.ts +1 -1
- 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.d.mts +36 -3
- package/dist/react-querybuilder_core.legacy-esm.d.ts +36 -3
- package/dist/react-querybuilder_core.legacy-esm.js +14 -9
- package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_core.mjs +14 -9
- package/dist/react-querybuilder_core.mjs.map +1 -1
- package/dist/react-querybuilder_core.production.d.mts +36 -3
- 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/dist/utils-01WaTGBL.mjs.map +1 -1
- package/dist/utils-ZlKseh1X.js.map +1 -1
- package/package.json +6 -6
package/dist/formatQuery.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as SetRequired, O as RuleType, S as RuleGroupTypeAny, _ as ValueProcessorLegacy, a as ExportOperatorMap, c as NLTranslationKey, d as ParameterizedSQL, f as RQBJsonLogic, g as ValueProcessorByRule, h as SQLPreset, i as ExportObjectFormats, l as NLTranslations, m as RuleProcessor, n as DiagnosticsResult, o as FormatQueryOptions, p as RuleGroupProcessor, r as ExportFormat, s as GroupVariantCondition, t as ConstituentWordOrder, u as ParameterizedNamedSQL, v as ValueProcessorOptions } from "./index-
|
|
1
|
+
import { A as SetRequired, O as RuleType, S as RuleGroupTypeAny, _ as ValueProcessorLegacy, a as ExportOperatorMap, c as NLTranslationKey, d as ParameterizedSQL, f as RQBJsonLogic, g as ValueProcessorByRule, h as SQLPreset, i as ExportObjectFormats, l as NLTranslations, m as RuleProcessor, n as DiagnosticsResult, o as FormatQueryOptions, p as RuleGroupProcessor, r as ExportFormat, s as GroupVariantCondition, t as ConstituentWordOrder, u as ParameterizedNamedSQL, v as ValueProcessorOptions } from "./index-DlVg-QXo.mjs";
|
|
2
2
|
import { Column, Operators, SQL, Table } from "drizzle-orm";
|
|
3
3
|
import { WhereOptions } from "sequelize";
|
|
4
4
|
import { eq } from "@tanstack/db";
|
|
@@ -761,6 +761,8 @@ declare const bigIntJsonParseReviver: (_key: string, value: unknown) => unknown;
|
|
|
761
761
|
/**
|
|
762
762
|
* Default value processor used by {@link formatQuery} for "sql" format.
|
|
763
763
|
*
|
|
764
|
+
* @deprecated Prefer {@link defaultValueProcessorByRule}.
|
|
765
|
+
*
|
|
764
766
|
* @group Export
|
|
765
767
|
*/
|
|
766
768
|
declare const defaultValueProcessor: ValueProcessorLegacy;
|
package/dist/formatQuery.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as SetRequired, O as RuleType, S as RuleGroupTypeAny, _ as ValueProcessorLegacy, a as ExportOperatorMap, c as NLTranslationKey, d as ParameterizedSQL, f as RQBJsonLogic, g as ValueProcessorByRule, h as SQLPreset, i as ExportObjectFormats, l as NLTranslations, m as RuleProcessor, n as DiagnosticsResult, o as FormatQueryOptions, p as RuleGroupProcessor, r as ExportFormat, s as GroupVariantCondition, t as ConstituentWordOrder, u as ParameterizedNamedSQL, v as ValueProcessorOptions } from "./index-
|
|
1
|
+
import { A as SetRequired, O as RuleType, S as RuleGroupTypeAny, _ as ValueProcessorLegacy, a as ExportOperatorMap, c as NLTranslationKey, d as ParameterizedSQL, f as RQBJsonLogic, g as ValueProcessorByRule, h as SQLPreset, i as ExportObjectFormats, l as NLTranslations, m as RuleProcessor, n as DiagnosticsResult, o as FormatQueryOptions, p as RuleGroupProcessor, r as ExportFormat, s as GroupVariantCondition, t as ConstituentWordOrder, u as ParameterizedNamedSQL, v as ValueProcessorOptions } from "./index-DlVg-QXo.js";
|
|
2
2
|
import { Column, Operators, SQL, Table } from "drizzle-orm";
|
|
3
3
|
import { WhereOptions } from "sequelize";
|
|
4
4
|
import { eq } from "@tanstack/db";
|
|
@@ -761,6 +761,8 @@ declare const bigIntJsonParseReviver: (_key: string, value: unknown) => unknown;
|
|
|
761
761
|
/**
|
|
762
762
|
* Default value processor used by {@link formatQuery} for "sql" format.
|
|
763
763
|
*
|
|
764
|
+
* @deprecated Prefer {@link defaultValueProcessorByRule}.
|
|
765
|
+
*
|
|
764
766
|
* @group Export
|
|
765
767
|
*/
|
|
766
768
|
declare const defaultValueProcessor: ValueProcessorLegacy;
|
package/dist/formatQuery.js
CHANGED
|
@@ -114,7 +114,7 @@ const defaultRuleProcessorCEL = (rule, opts = {}) => {
|
|
|
114
114
|
const totalCount = `double(${field}.size())`;
|
|
115
115
|
const filteredCount = `${field}.filter(${arrayElementAlias}, ${nestedArrayFilter}).size()`;
|
|
116
116
|
const op = mode === "atleast" ? ">=" : mode === "atmost" ? "<=" : "==";
|
|
117
|
-
if (threshold > 0 && threshold < 1) return
|
|
117
|
+
if (threshold > 0 && threshold < 1) return `double(${filteredCount}) ${op} (${totalCount} * ${threshold})`;
|
|
118
118
|
return `${filteredCount} ${op} ${threshold}`;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
@@ -615,7 +615,7 @@ const defaultRuleProcessorDrizzle = (rule, _options) => {
|
|
|
615
615
|
if (!columns || !drizzleOperators) return void 0;
|
|
616
616
|
const { between, eq, gt, gte, inArray, isNotNull, isNull, like, lt, lte, ne, notBetween, notInArray, notLike, sql } = drizzleOperators;
|
|
617
617
|
const { field, operator, value, valueSource } = rule;
|
|
618
|
-
const column = useRawFields &&
|
|
618
|
+
const column = useRawFields && /^[a-z_][a-z0-9_.]*$/i.test(field) ? sql.raw(field) : columns[field];
|
|
619
619
|
const operatorLC = require_objectUtils.lc(operator);
|
|
620
620
|
const valueIsField = valueSource === "field";
|
|
621
621
|
const asFieldOrValue = (v) => valueIsField ? columns[v] : v;
|
|
@@ -648,7 +648,7 @@ const defaultRuleProcessorDrizzle = (rule, _options) => {
|
|
|
648
648
|
case "atmost":
|
|
649
649
|
case "exactly": {
|
|
650
650
|
const op = mode === "atleast" ? ">=" : mode === "atmost" ? "<=" : "=";
|
|
651
|
-
return threshold > 0 && threshold < 1 ? sql`(select count(*) / array_length(${column}, 1) from unnest(${column}) as ${sql.raw(arrayElementAlias)} where ${nestedArrayFilter({}, drizzleOperators)}) ${sql.raw(`${op} ${threshold}`)}` : sql`(select count(*) from unnest(${column}) as ${sql.raw(arrayElementAlias)} where ${nestedArrayFilter({}, drizzleOperators)}) ${sql.raw(`${op} ${threshold}`)}`;
|
|
651
|
+
return threshold > 0 && threshold < 1 ? sql`(select count(*)::float / array_length(${column}, 1) from unnest(${column}) as ${sql.raw(arrayElementAlias)} where ${nestedArrayFilter({}, drizzleOperators)}) ${sql.raw(`${op} ${threshold}`)}` : sql`(select count(*) from unnest(${column}) as ${sql.raw(arrayElementAlias)} where ${nestedArrayFilter({}, drizzleOperators)}) ${sql.raw(`${op} ${threshold}`)}`;
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
654
|
}
|
|
@@ -996,7 +996,7 @@ const defaultRuleGroupProcessorMongoDB = (ruleGroup, options, meta) => {
|
|
|
996
996
|
const defaultRuleGroupProcessorNL = (ruleGroup, options) => {
|
|
997
997
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, translations, validateRule, validationMap } = options;
|
|
998
998
|
const processRuleGroup = (rg, outermostOrLonelyInGroup) => {
|
|
999
|
-
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression :
|
|
999
|
+
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : "";
|
|
1000
1000
|
const rg2 = require_objectUtils.isRuleGroupTypeIC(rg) && rg.rules.some((r) => typeof r === "string" && require_objectUtils.lc(r) === "xor") ? require_convertQuery.convertFromIC(rg) : rg;
|
|
1001
1001
|
const processedRules = [];
|
|
1002
1002
|
let precedingCombinator = "";
|
|
@@ -1094,7 +1094,7 @@ const defaultRuleGroupProcessorParameterized = (ruleGroup, options) => {
|
|
|
1094
1094
|
return sql;
|
|
1095
1095
|
};
|
|
1096
1096
|
const processRuleGroup = (rg, outermostOrLonelyInGroup) => {
|
|
1097
|
-
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression :
|
|
1097
|
+
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : "";
|
|
1098
1098
|
const processedRules = [];
|
|
1099
1099
|
let precedingCombinator = "";
|
|
1100
1100
|
let firstRule = true;
|
|
@@ -1287,7 +1287,7 @@ const defaultRuleGroupProcessorSPARQL = (ruleGroup, options) => {
|
|
|
1287
1287
|
const defaultRuleGroupProcessorSQL = (ruleGroup, options) => {
|
|
1288
1288
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1289
1289
|
const processRuleGroup = (rg, outermostOrLonelyInGroup) => {
|
|
1290
|
-
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression :
|
|
1290
|
+
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : "";
|
|
1291
1291
|
const processedRules = [];
|
|
1292
1292
|
let precedingCombinator = "";
|
|
1293
1293
|
let firstRule = true;
|
|
@@ -2491,7 +2491,7 @@ const defaultRuleProcessorSQL = (rule, opts = {}) => {
|
|
|
2491
2491
|
case "atmost":
|
|
2492
2492
|
case "exactly": {
|
|
2493
2493
|
const op = mode === "atleast" ? ">=" : mode === "atmost" ? "<=" : "=";
|
|
2494
|
-
return `(select count(*)${threshold > 0 && threshold < 1 ?
|
|
2494
|
+
return `(select count(*)${threshold > 0 && threshold < 1 ? `::float / array_length(${ruleField}, 1)` : ""} from unnest(${ruleField}) as ${wrapFieldName(arrayElementAlias)} where ${nestedArrayFilter}) ${op} ${threshold}`;
|
|
2495
2495
|
}
|
|
2496
2496
|
}
|
|
2497
2497
|
}
|
|
@@ -2558,7 +2558,7 @@ const defaultRuleProcessorParameterized = (rule, opts, meta) => {
|
|
|
2558
2558
|
case "atmost":
|
|
2559
2559
|
case "exactly": {
|
|
2560
2560
|
const op = mode === "atleast" ? ">=" : mode === "atmost" ? "<=" : "=";
|
|
2561
|
-
return finalize(`(select count(*)${threshold > 0 && threshold < 1 ?
|
|
2561
|
+
return finalize(`(select count(*)${threshold > 0 && threshold < 1 ? `::float / array_length(${ruleField}, 1)` : ""} from unnest(${ruleField}) as ${wrapFieldName(arrayElementAlias)} where ${nestedSQL}) ${op} ${threshold}`);
|
|
2562
2562
|
}
|
|
2563
2563
|
}
|
|
2564
2564
|
}
|
|
@@ -3060,6 +3060,8 @@ const generateValueProcessor = (vpbr) => (field, operator, value, valueSource) =
|
|
|
3060
3060
|
/**
|
|
3061
3061
|
* Default value processor used by {@link formatQuery} for "sql" format.
|
|
3062
3062
|
*
|
|
3063
|
+
* @deprecated Prefer {@link defaultValueProcessorByRule}.
|
|
3064
|
+
*
|
|
3063
3065
|
* @group Export
|
|
3064
3066
|
*/
|
|
3065
3067
|
const defaultValueProcessor = generateValueProcessor(defaultValueProcessorByRule);
|