@react-querybuilder/core 8.14.3 → 8.15.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 +201 -8
- package/dist/cjs/react-querybuilder_core.cjs.development.js +400 -62
- package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +201 -8
- 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/{convertQuery-CeJSNn37.mjs → convertQuery-BeJJH9BI.mjs} +2 -2
- package/dist/convertQuery-BeJJH9BI.mjs.map +1 -0
- package/dist/{convertQuery-J8LpTG-7.js → convertQuery-Lx2HQa0m.js} +2 -2
- package/dist/convertQuery-Lx2HQa0m.js.map +1 -0
- package/dist/formatQuery.d.mts +24 -3
- package/dist/formatQuery.d.ts +24 -3
- package/dist/formatQuery.js +379 -51
- package/dist/formatQuery.js.map +1 -1
- package/dist/formatQuery.mjs +379 -52
- package/dist/formatQuery.mjs.map +1 -1
- package/dist/{import-Bltb2mT4.d.mts → import-0wp72lLT.d.mts} +2 -2
- package/dist/{import-B5Iq8XmL.d.ts → import-yRVJh7E1.d.ts} +2 -2
- package/dist/{basic-BXJVfD0P.d.ts → index-D5TXNIzF.d.ts} +595 -3
- package/dist/{basic-CNIjb6rI.d.mts → index-Lht_Wq3V.d.mts} +595 -3
- package/dist/{objectUtils-ButT0Mng.js → objectUtils-Bzug_QfX.js} +2 -2
- package/dist/objectUtils-Bzug_QfX.js.map +1 -0
- package/dist/{objectUtils-C0WB-8ex.mjs → objectUtils-D96eEEzL.mjs} +2 -2
- package/dist/objectUtils-D96eEEzL.mjs.map +1 -0
- package/dist/parseCEL.d.mts +2 -2
- package/dist/parseCEL.d.ts +2 -2
- package/dist/parseCEL.js +35 -35
- package/dist/parseCEL.js.map +1 -1
- package/dist/parseCEL.mjs +35 -35
- package/dist/parseCEL.mjs.map +1 -1
- package/dist/parseJSONata.d.mts +2 -2
- package/dist/parseJSONata.d.ts +2 -2
- package/dist/parseJSONata.js +11 -11
- package/dist/parseJSONata.js.map +1 -1
- package/dist/parseJSONata.mjs +11 -11
- package/dist/parseJSONata.mjs.map +1 -1
- package/dist/parseJsonLogic.d.mts +2 -3
- package/dist/parseJsonLogic.d.ts +2 -3
- package/dist/parseJsonLogic.js +6 -6
- package/dist/parseJsonLogic.js.map +1 -1
- package/dist/parseJsonLogic.mjs +6 -6
- package/dist/parseJsonLogic.mjs.map +1 -1
- package/dist/parseMongoDB.d.mts +2 -2
- package/dist/parseMongoDB.d.ts +2 -2
- package/dist/parseMongoDB.js +6 -6
- package/dist/parseMongoDB.js.map +1 -1
- package/dist/parseMongoDB.mjs +6 -6
- package/dist/parseMongoDB.mjs.map +1 -1
- package/dist/parseSQL.d.mts +2 -2
- package/dist/parseSQL.d.ts +2 -2
- package/dist/parseSQL.js +16 -16
- package/dist/parseSQL.js.map +1 -1
- package/dist/parseSQL.mjs +16 -16
- package/dist/parseSQL.mjs.map +1 -1
- package/dist/parseSpEL.d.mts +2 -2
- package/dist/parseSpEL.d.ts +2 -2
- package/dist/parseSpEL.js +10 -10
- package/dist/parseSpEL.js.map +1 -1
- package/dist/parseSpEL.mjs +10 -10
- package/dist/parseSpEL.mjs.map +1 -1
- package/dist/{prepareQueryObjects-DO3qXriW.js → prepareQueryObjects-BoG5Rt8z.js} +6 -6
- package/dist/prepareQueryObjects-BoG5Rt8z.js.map +1 -0
- package/dist/{prepareQueryObjects-BfMlS4ql.mjs → prepareQueryObjects-uA10ZpZX.mjs} +6 -6
- package/dist/prepareQueryObjects-uA10ZpZX.mjs.map +1 -0
- package/dist/query-builder.css +1 -1
- package/dist/query-builder.css.map +1 -1
- package/dist/react-querybuilder_core.d.mts +201 -8
- package/dist/react-querybuilder_core.legacy-esm.d.ts +201 -8
- package/dist/react-querybuilder_core.legacy-esm.js +441 -93
- package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_core.mjs +399 -63
- package/dist/react-querybuilder_core.mjs.map +1 -1
- package/dist/react-querybuilder_core.production.d.mts +201 -8
- package/dist/react-querybuilder_core.production.mjs +1 -1
- package/dist/react-querybuilder_core.production.mjs.map +1 -1
- package/dist/styles/_main.scss +4 -0
- package/dist/transformQuery.d.mts +1 -1
- package/dist/transformQuery.d.ts +1 -1
- package/dist/transformQuery.js +1 -1
- package/dist/transformQuery.mjs +1 -1
- package/dist/{utils-BlMGIhvx.mjs → utils-ChLG90DP.mjs} +3 -3
- package/dist/utils-ChLG90DP.mjs.map +1 -0
- package/dist/{utils-CZRhzje-.js → utils-Qwkq2Q0F.js} +3 -3
- package/dist/utils-Qwkq2Q0F.js.map +1 -0
- package/package.json +12 -16
- package/dist/convertQuery-CeJSNn37.mjs.map +0 -1
- package/dist/convertQuery-J8LpTG-7.js.map +0 -1
- package/dist/export-6x7MilFR.d.mts +0 -451
- package/dist/export-CpJOQuZv.d.ts +0 -451
- package/dist/objectUtils-ButT0Mng.js.map +0 -1
- package/dist/objectUtils-C0WB-8ex.mjs.map +0 -1
- package/dist/prepareQueryObjects-BfMlS4ql.mjs.map +0 -1
- package/dist/prepareQueryObjects-DO3qXriW.js.map +0 -1
- package/dist/utils-BlMGIhvx.mjs.map +0 -1
- package/dist/utils-CZRhzje-.js.map +0 -1
|
@@ -412,6 +412,8 @@ const standardClassnames = {
|
|
|
412
412
|
dndCopy: "dndCopy",
|
|
413
413
|
dndGroup: "dndGroup",
|
|
414
414
|
dndDropNotAllowed: "dndDropNotAllowed",
|
|
415
|
+
dndPreviewPosition: "dndPreviewPosition",
|
|
416
|
+
dndHidden: "dndHidden",
|
|
415
417
|
dragHandle: "queryBuilder-dragHandle",
|
|
416
418
|
disabled: "queryBuilder-disabled",
|
|
417
419
|
muted: "queryBuilder-muted",
|
|
@@ -468,6 +470,8 @@ const defaultControlClassnames = {
|
|
|
468
470
|
dndGroup: "",
|
|
469
471
|
dndCopy: "",
|
|
470
472
|
dndDropNotAllowed: "",
|
|
473
|
+
dndPreviewPosition: "",
|
|
474
|
+
dndHidden: "",
|
|
471
475
|
disabled: "",
|
|
472
476
|
valueListItem: "",
|
|
473
477
|
branches: "",
|
|
@@ -612,7 +616,7 @@ const toArray = (a, { retainEmptyStrings } = {}) => Array.isArray(a) ? a.map((v)
|
|
|
612
616
|
const nullFreeArray = (arr) => arr.every((el) => el === false || (el ?? false) !== false);
|
|
613
617
|
//#endregion
|
|
614
618
|
//#region src/utils/clsx.ts
|
|
615
|
-
|
|
619
|
+
/* v8 ignore start -- @preserve */
|
|
616
620
|
function toVal(mix) {
|
|
617
621
|
let k;
|
|
618
622
|
let y;
|
|
@@ -632,12 +636,13 @@ function toVal(mix) {
|
|
|
632
636
|
}
|
|
633
637
|
return str;
|
|
634
638
|
}
|
|
639
|
+
/* v8 ignore stop -- @preserve */
|
|
635
640
|
/**
|
|
636
641
|
* Vendored/adapted version of the `clsx` package.
|
|
637
642
|
*
|
|
638
643
|
* **NOTE:** Prefer the official package from npm outside the context of React Query Builder.
|
|
639
644
|
*/
|
|
640
|
-
//
|
|
645
|
+
// v8 ignore next
|
|
641
646
|
function clsx(...args) {
|
|
642
647
|
let i = 0;
|
|
643
648
|
let tmp;
|
|
@@ -655,7 +660,7 @@ function clsx(...args) {
|
|
|
655
660
|
/**
|
|
656
661
|
* Converts a value to lowercase if it's a string, otherwise returns the value as is.
|
|
657
662
|
*/
|
|
658
|
-
//
|
|
663
|
+
// v8 ignore next
|
|
659
664
|
const lc = (v) => typeof v === "string" ? v.toLowerCase() : v;
|
|
660
665
|
/**
|
|
661
666
|
* Regex matching numeric strings. Passes for positive/negative integers, decimals,
|
|
@@ -783,8 +788,9 @@ const defaultValidator = (query) => {
|
|
|
783
788
|
* Replace this with your custom rule validator.
|
|
784
789
|
*/
|
|
785
790
|
const validateRule = (rule) => {
|
|
786
|
-
|
|
791
|
+
/* v8 ignore start -- @preserve */
|
|
787
792
|
if (rule.id) result[rule.id];
|
|
793
|
+
/* v8 ignore stop -- @preserve */
|
|
788
794
|
};
|
|
789
795
|
const validateGroup = (rg) => {
|
|
790
796
|
const reasons = [];
|
|
@@ -795,7 +801,7 @@ const defaultValidator = (query) => {
|
|
|
795
801
|
if (invalidICs) reasons.push(groupInvalidReasons.invalidIndependentCombinators);
|
|
796
802
|
}
|
|
797
803
|
if (isRuleGroupType(rg) && !defaultCombinators.map((c) => c.name).includes(rg.combinator) && rg.rules.length > 1) reasons.push(groupInvalidReasons.invalidCombinator);
|
|
798
|
-
/*
|
|
804
|
+
/* v8 ignore else -- @preserve */
|
|
799
805
|
if (rg.id) result[rg.id] = reasons.length > 0 ? {
|
|
800
806
|
valid: false,
|
|
801
807
|
reasons
|
|
@@ -956,7 +962,7 @@ function getFirstOption(arr) {
|
|
|
956
962
|
if (!Array.isArray(arr) || arr.length === 0) return null;
|
|
957
963
|
else if (isFlexibleOptionGroupArray(arr, { allowEmpty: true })) {
|
|
958
964
|
for (const og of arr) if (og.options.length > 0) return og.options[0].value ?? og.options[0].name;
|
|
959
|
-
//
|
|
965
|
+
// v8 ignore next
|
|
960
966
|
return null;
|
|
961
967
|
}
|
|
962
968
|
return arr[0].value ?? arr[0].name;
|
|
@@ -1003,7 +1009,7 @@ const uniqOptList = (originalArray) => {
|
|
|
1003
1009
|
return uniqByIdentifier(originalArray.map((o) => toFullOption(o)));
|
|
1004
1010
|
};
|
|
1005
1011
|
const prepareOptionList = (props) => {
|
|
1006
|
-
//
|
|
1012
|
+
// v8 ignore next
|
|
1007
1013
|
const { optionList: optionListPropOriginal, baseOption = {}, labelMap = {}, placeholder: { placeholderName = "~", placeholderLabel = defaultPlaceholderLabel, placeholderGroupLabel = defaultPlaceholderLabel } = {}, autoSelectOption = true } = props;
|
|
1008
1014
|
const defaultOption = {
|
|
1009
1015
|
id: placeholderName,
|
|
@@ -1151,7 +1157,7 @@ const isRuleOrGroupValid = (rg, validationResult, validator) => {
|
|
|
1151
1157
|
if (typeof validator === "function" && !isRuleGroup(rg)) {
|
|
1152
1158
|
const vr = validator(rg);
|
|
1153
1159
|
if (typeof vr === "boolean") return vr;
|
|
1154
|
-
//
|
|
1160
|
+
// v8 ignore else
|
|
1155
1161
|
if (isValidationResult(vr)) return vr.valid;
|
|
1156
1162
|
}
|
|
1157
1163
|
return true;
|
|
@@ -1270,7 +1276,7 @@ const numerifyValues = (rg, options) => ({
|
|
|
1270
1276
|
};
|
|
1271
1277
|
const valAsArray = toArray(r.value, { retainEmptyStrings: true }).map((v) => parseNumber(v, { parseNumbers }));
|
|
1272
1278
|
if (valAsArray.every((v) => typeof v === "number")) {
|
|
1273
|
-
//
|
|
1279
|
+
// v8 ignore else
|
|
1274
1280
|
if (valAsArray.length > 1) return {
|
|
1275
1281
|
...r,
|
|
1276
1282
|
value: valAsArray
|
|
@@ -1566,7 +1572,8 @@ const mongoDbFallback = { $and: [{ $expr: true }] };
|
|
|
1566
1572
|
* @group Export
|
|
1567
1573
|
*/
|
|
1568
1574
|
const defaultRuleGroupProcessorMongoDBQuery = (ruleGroup, options, meta) => {
|
|
1569
|
-
const { fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1575
|
+
const { context, fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1576
|
+
const { inExpressionContext } = context ?? {};
|
|
1570
1577
|
const processRuleGroup = (rg, outermost) => {
|
|
1571
1578
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermost ? mongoDbFallback : false;
|
|
1572
1579
|
const combinator = `$${lc(rg.combinator)}`;
|
|
@@ -1590,7 +1597,7 @@ const defaultRuleGroupProcessorMongoDBQuery = (ruleGroup, options, meta) => {
|
|
|
1590
1597
|
}, meta);
|
|
1591
1598
|
}).filter(Boolean);
|
|
1592
1599
|
const result = expressions.length > 0 ? expressions.length === 1 && !hasChildRules ? expressions[0] : { [combinator]: expressions } : mongoDbFallback;
|
|
1593
|
-
return rg.not ? { $not: result } : result;
|
|
1600
|
+
return rg.not ? inExpressionContext ? { $not: result } : { $nor: [result] } : result;
|
|
1594
1601
|
};
|
|
1595
1602
|
return processRuleGroup(convertFromIC(ruleGroup), true);
|
|
1596
1603
|
};
|
|
@@ -1631,7 +1638,8 @@ const defaultRuleProcessorMongoDBQuery = (rule, options = {}) => {
|
|
|
1631
1638
|
ruleProcessor: defaultRuleProcessorMongoDBQuery,
|
|
1632
1639
|
context: {
|
|
1633
1640
|
...options.context,
|
|
1634
|
-
avoidFieldsAsKeys: true
|
|
1641
|
+
avoidFieldsAsKeys: true,
|
|
1642
|
+
inExpressionContext: true
|
|
1635
1643
|
}
|
|
1636
1644
|
});
|
|
1637
1645
|
const filteredCount = { $size: { $ifNull: [{ $filter: {
|
|
@@ -1934,22 +1942,22 @@ const defaultValueProcessorByRule = ({ operator, value, valueSource }, { escapeQ
|
|
|
1934
1942
|
* @group Export
|
|
1935
1943
|
*/
|
|
1936
1944
|
const defaultRuleProcessorDrizzle = (rule, _options) => {
|
|
1937
|
-
const opts = _options ?? ( /*
|
|
1938
|
-
//
|
|
1945
|
+
const opts = _options ?? ( /* v8 ignore start -- @preserve */ {});
|
|
1946
|
+
// v8 ignore next
|
|
1939
1947
|
const { parseNumbers, preserveValueOrder, context = {} } = opts;
|
|
1940
1948
|
const { columns, drizzleOperators, useRawFields } = context;
|
|
1941
|
-
if (!columns || !drizzleOperators) return;
|
|
1949
|
+
if (!columns || !drizzleOperators) return void 0;
|
|
1942
1950
|
const { between, eq, gt, gte, inArray, isNotNull, isNull, like, lt, lte, ne, notBetween, notInArray, notLike, sql } = drizzleOperators;
|
|
1943
1951
|
const { field, operator, value, valueSource } = rule;
|
|
1944
1952
|
const column = useRawFields && /[a-z][a-z0-9]*/i.test(field) ? sql.raw(field) : columns[field];
|
|
1945
1953
|
const operatorLC = lc(operator);
|
|
1946
1954
|
const valueIsField = valueSource === "field";
|
|
1947
1955
|
const asFieldOrValue = (v) => valueIsField ? columns[v] : v;
|
|
1948
|
-
if (!column) return;
|
|
1956
|
+
if (!column) return void 0;
|
|
1949
1957
|
const matchEval = processMatchMode(rule);
|
|
1950
1958
|
if (matchEval === false) return;
|
|
1951
1959
|
else if (matchEval) {
|
|
1952
|
-
if (opts.preset !== "postgresql") return;
|
|
1960
|
+
if (opts.preset !== "postgresql") return void 0;
|
|
1953
1961
|
const { mode, threshold } = matchEval;
|
|
1954
1962
|
const arrayElementAlias = "elem_alias";
|
|
1955
1963
|
const nestedArrayFilter = defaultRuleGroupProcessorDrizzle(transformQuery(rule.value, { ruleProcessor: (r) => ({
|
|
@@ -2038,7 +2046,7 @@ const defaultRuleProcessorDrizzle = (rule, _options) => {
|
|
|
2038
2046
|
*/
|
|
2039
2047
|
const defaultRuleGroupProcessorDrizzle = (ruleGroup, options, _meta) => (columns, drizzleOperators) => {
|
|
2040
2048
|
const { fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, validateRule, validationMap } = options;
|
|
2041
|
-
if (!columns || !drizzleOperators) return;
|
|
2049
|
+
if (!columns || !drizzleOperators) return void 0;
|
|
2042
2050
|
const { and, not, or } = drizzleOperators;
|
|
2043
2051
|
const ruleProcessor = defaultRuleProcessorDrizzle;
|
|
2044
2052
|
const processRuleGroup = (rg, _outermost) => {
|
|
@@ -2242,7 +2250,7 @@ const defaultRuleGroupProcessorMongoDB = (ruleGroup, options, meta) => {
|
|
|
2242
2250
|
}, meta);
|
|
2243
2251
|
}).filter(Boolean);
|
|
2244
2252
|
const result = expressions.length > 0 ? expressions.length === 1 && !hasChildRules ? expressions[0] : `${combinator}:[${expressions.join(",")}]` : fallbackExpression;
|
|
2245
|
-
return rg.not ? `"$
|
|
2253
|
+
return rg.not ? `"$nor":[${isBracketed(result) ? result : `{${result}}`}]` : result;
|
|
2246
2254
|
};
|
|
2247
2255
|
const processedQuery = processRuleGroup(convertFromIC(ruleGroup), true);
|
|
2248
2256
|
return isBracketed(processedQuery) ? processedQuery : `{${processedQuery}}`;
|
|
@@ -2257,7 +2265,7 @@ const defaultRuleGroupProcessorMongoDB = (ruleGroup, options, meta) => {
|
|
|
2257
2265
|
const defaultRuleGroupProcessorNL = (ruleGroup, options) => {
|
|
2258
2266
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, translations, validateRule, validationMap } = options;
|
|
2259
2267
|
const processRuleGroup = (rg, outermostOrLonelyInGroup) => {
|
|
2260
|
-
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : "";
|
|
2268
|
+
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : /* v8 ignore next -- @preserve */ "";
|
|
2261
2269
|
const rg2 = isRuleGroupTypeIC(rg) && rg.rules.some((r) => typeof r === "string" && lc(r) === "xor") ? convertFromIC(rg) : rg;
|
|
2262
2270
|
const processedRules = [];
|
|
2263
2271
|
let precedingCombinator = "";
|
|
@@ -2269,7 +2277,7 @@ const defaultRuleGroupProcessorNL = (ruleGroup, options) => {
|
|
|
2269
2277
|
}
|
|
2270
2278
|
if (isRuleGroup(rule)) {
|
|
2271
2279
|
const processedGroup = processRuleGroup(rule, rg2.rules.length === 1 && !(rg2.not || /^xor$/i.test(rg2.combinator ?? "")));
|
|
2272
|
-
//
|
|
2280
|
+
// v8 ignore else
|
|
2273
2281
|
if (processedGroup) {
|
|
2274
2282
|
if (!firstRule && precedingCombinator) {
|
|
2275
2283
|
processedRules.push(precedingCombinator);
|
|
@@ -2345,7 +2353,7 @@ const defaultRuleGroupProcessorParameterized = (ruleGroup, options) => {
|
|
|
2345
2353
|
if (!isPojo(processedRule)) return "";
|
|
2346
2354
|
const { sql, params: customParams } = processedRule;
|
|
2347
2355
|
if (typeof sql !== "string" || !sql) return "";
|
|
2348
|
-
//
|
|
2356
|
+
// v8 ignore else
|
|
2349
2357
|
if (format === "parameterized" && Array.isArray(customParams)) params.push(...customParams);
|
|
2350
2358
|
else if (format === "parameterized_named" && isPojo(customParams)) {
|
|
2351
2359
|
Object.assign(paramsNamed, customParams);
|
|
@@ -2354,7 +2362,7 @@ const defaultRuleGroupProcessorParameterized = (ruleGroup, options) => {
|
|
|
2354
2362
|
return sql;
|
|
2355
2363
|
};
|
|
2356
2364
|
const processRuleGroup = (rg, outermostOrLonelyInGroup) => {
|
|
2357
|
-
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : "";
|
|
2365
|
+
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : /* v8 ignore next -- @preserve */ "";
|
|
2358
2366
|
const processedRules = [];
|
|
2359
2367
|
let precedingCombinator = "";
|
|
2360
2368
|
let firstRule = true;
|
|
@@ -2365,7 +2373,7 @@ const defaultRuleGroupProcessorParameterized = (ruleGroup, options) => {
|
|
|
2365
2373
|
}
|
|
2366
2374
|
if (isRuleGroup(rule)) {
|
|
2367
2375
|
const processedGroup = processRuleGroup(rule, rg.rules.length === 1);
|
|
2368
|
-
//
|
|
2376
|
+
// v8 ignore else
|
|
2369
2377
|
if (processedGroup) {
|
|
2370
2378
|
if (!firstRule && precedingCombinator) {
|
|
2371
2379
|
processedRules.push(precedingCombinator);
|
|
@@ -2448,10 +2456,10 @@ const defaultRuleGroupProcessorPrisma = (ruleGroup, options) => {
|
|
|
2448
2456
|
* @group Export
|
|
2449
2457
|
*/
|
|
2450
2458
|
const defaultRuleGroupProcessorSequelize = (ruleGroup, options) => {
|
|
2451
|
-
//
|
|
2459
|
+
// v8 ignore next
|
|
2452
2460
|
const { fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap, context = {} } = options;
|
|
2453
2461
|
const { sequelizeOperators: Op } = context;
|
|
2454
|
-
if (!Op) return;
|
|
2462
|
+
if (!Op) return void 0;
|
|
2455
2463
|
const processRuleGroup = (rg, _outermost) => {
|
|
2456
2464
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return;
|
|
2457
2465
|
const combinator = rg.combinator.toUpperCase();
|
|
@@ -2474,7 +2482,7 @@ const defaultRuleGroupProcessorSequelize = (ruleGroup, options) => {
|
|
|
2474
2482
|
fieldData
|
|
2475
2483
|
});
|
|
2476
2484
|
}).filter(Boolean);
|
|
2477
|
-
if (expressions.length === 0) return;
|
|
2485
|
+
if (expressions.length === 0) return void 0;
|
|
2478
2486
|
const result = expressions.length === 1 && !hasChildRules ? expressions[0] : { [lc(combinator) === "or" ? Op.or : Op.and]: expressions };
|
|
2479
2487
|
return rg.not ? { [Op.not]: result } : result;
|
|
2480
2488
|
};
|
|
@@ -2490,7 +2498,7 @@ const defaultRuleGroupProcessorSequelize = (ruleGroup, options) => {
|
|
|
2490
2498
|
const defaultRuleGroupProcessorSQL = (ruleGroup, options) => {
|
|
2491
2499
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
2492
2500
|
const processRuleGroup = (rg, outermostOrLonelyInGroup) => {
|
|
2493
|
-
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : "";
|
|
2501
|
+
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : /* v8 ignore next -- @preserve */ "";
|
|
2494
2502
|
const processedRules = [];
|
|
2495
2503
|
let precedingCombinator = "";
|
|
2496
2504
|
let firstRule = true;
|
|
@@ -2501,7 +2509,7 @@ const defaultRuleGroupProcessorSQL = (ruleGroup, options) => {
|
|
|
2501
2509
|
}
|
|
2502
2510
|
if (isRuleGroup(rule)) {
|
|
2503
2511
|
const processedGroup = processRuleGroup(rule, rg.rules.length === 1);
|
|
2504
|
-
//
|
|
2512
|
+
// v8 ignore else
|
|
2505
2513
|
if (processedGroup) {
|
|
2506
2514
|
if (!firstRule && precedingCombinator) {
|
|
2507
2515
|
processedRules.push(precedingCombinator);
|
|
@@ -2537,6 +2545,325 @@ const defaultRuleGroupProcessorSQL = (ruleGroup, options) => {
|
|
|
2537
2545
|
return processRuleGroup(ruleGroup, true);
|
|
2538
2546
|
};
|
|
2539
2547
|
//#endregion
|
|
2548
|
+
//#region src/utils/formatQuery/defaultRuleGroupProcessorDiagnostics.ts
|
|
2549
|
+
const numericInputTypes = new Set([
|
|
2550
|
+
"number",
|
|
2551
|
+
"range",
|
|
2552
|
+
"bigint"
|
|
2553
|
+
]);
|
|
2554
|
+
const dateRegex = /^\d{4}-\d{2}-\d{2}$/;
|
|
2555
|
+
const timeRegex = /^\d{2}:\d{2}(:\d{2}(\.\d+)?)?$/;
|
|
2556
|
+
const monthRegex = /^\d{4}-\d{2}$/;
|
|
2557
|
+
const weekRegex = /^\d{4}-W\d{2}$/;
|
|
2558
|
+
const colorRegex = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i;
|
|
2559
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
2560
|
+
const isValidDateComponents = (y, m, d) => {
|
|
2561
|
+
const date = new Date(Date.UTC(y, m - 1, d));
|
|
2562
|
+
return date.getUTCFullYear() === y && date.getUTCMonth() === m - 1 && date.getUTCDate() === d;
|
|
2563
|
+
};
|
|
2564
|
+
const isValidTimeComponents = (s) => {
|
|
2565
|
+
const parts = s.split(":");
|
|
2566
|
+
const h = Number(parts[0]);
|
|
2567
|
+
const m = Number(parts[1]);
|
|
2568
|
+
const sec = parts[2] ? Number.parseFloat(parts[2]) : 0;
|
|
2569
|
+
return h >= 0 && h <= 23 && m >= 0 && m <= 59 && sec >= 0 && sec < 60;
|
|
2570
|
+
};
|
|
2571
|
+
/**
|
|
2572
|
+
* Checks whether a value is compatible with the given {@link FullField.inputType}.
|
|
2573
|
+
* Returns a diagnostic code string if there is a mismatch, or `undefined` if OK.
|
|
2574
|
+
*/
|
|
2575
|
+
const checkValueTypeMismatch = (value, inputType) => {
|
|
2576
|
+
if (value === null || value === void 0 || value === "") return void 0;
|
|
2577
|
+
if (numericInputTypes.has(inputType)) {
|
|
2578
|
+
const v = typeof value === "string" ? value.trim() : value;
|
|
2579
|
+
if (typeof v === "number" || typeof v === "bigint") return void 0;
|
|
2580
|
+
if (typeof v === "string" && numericRegex.test(v)) return void 0;
|
|
2581
|
+
return "VALUE_TYPE_MISMATCH";
|
|
2582
|
+
}
|
|
2583
|
+
if (inputType === "date") {
|
|
2584
|
+
if (typeof value !== "string") return "VALUE_TYPE_MISMATCH";
|
|
2585
|
+
const v = value.trim();
|
|
2586
|
+
if (!dateRegex.test(v)) return "VALUE_TYPE_MISMATCH";
|
|
2587
|
+
const [y, m, d] = v.split("-").map(Number);
|
|
2588
|
+
return isValidDateComponents(y, m, d) ? void 0 : "VALUE_TYPE_MISMATCH";
|
|
2589
|
+
}
|
|
2590
|
+
if (inputType === "datetime-local") {
|
|
2591
|
+
if (typeof value !== "string") return "VALUE_TYPE_MISMATCH";
|
|
2592
|
+
const base = value.trim().replace(/(Z|[+-]\d{2}:?\d{2}|[+-]\d{2})$/, "");
|
|
2593
|
+
const tIndex = base.indexOf("T");
|
|
2594
|
+
if (tIndex === -1) return "VALUE_TYPE_MISMATCH";
|
|
2595
|
+
const datePart = base.slice(0, tIndex);
|
|
2596
|
+
const timePart = base.slice(tIndex + 1);
|
|
2597
|
+
if (!dateRegex.test(datePart) || !timeRegex.test(timePart)) return "VALUE_TYPE_MISMATCH";
|
|
2598
|
+
const [y, m, d] = datePart.split("-").map(Number);
|
|
2599
|
+
if (!isValidDateComponents(y, m, d)) return "VALUE_TYPE_MISMATCH";
|
|
2600
|
+
return isValidTimeComponents(timePart) ? void 0 : "VALUE_TYPE_MISMATCH";
|
|
2601
|
+
}
|
|
2602
|
+
if (inputType === "time") {
|
|
2603
|
+
if (typeof value !== "string") return "VALUE_TYPE_MISMATCH";
|
|
2604
|
+
const v = value.trim();
|
|
2605
|
+
if (!timeRegex.test(v)) return "VALUE_TYPE_MISMATCH";
|
|
2606
|
+
return isValidTimeComponents(v) ? void 0 : "VALUE_TYPE_MISMATCH";
|
|
2607
|
+
}
|
|
2608
|
+
if (inputType === "month") {
|
|
2609
|
+
if (typeof value !== "string") return "VALUE_TYPE_MISMATCH";
|
|
2610
|
+
const v = value.trim();
|
|
2611
|
+
if (!monthRegex.test(v)) return "VALUE_TYPE_MISMATCH";
|
|
2612
|
+
const m = Number(v.slice(5));
|
|
2613
|
+
return m >= 1 && m <= 12 ? void 0 : "VALUE_TYPE_MISMATCH";
|
|
2614
|
+
}
|
|
2615
|
+
if (inputType === "week") {
|
|
2616
|
+
if (typeof value !== "string") return "VALUE_TYPE_MISMATCH";
|
|
2617
|
+
const v = value.trim();
|
|
2618
|
+
if (!weekRegex.test(v)) return "VALUE_TYPE_MISMATCH";
|
|
2619
|
+
const w = Number(v.slice(6));
|
|
2620
|
+
return w >= 1 && w <= 53 ? void 0 : "VALUE_TYPE_MISMATCH";
|
|
2621
|
+
}
|
|
2622
|
+
if (inputType === "color") {
|
|
2623
|
+
if (typeof value !== "string") return "VALUE_TYPE_MISMATCH";
|
|
2624
|
+
return colorRegex.test(value.trim()) ? void 0 : "VALUE_TYPE_MISMATCH";
|
|
2625
|
+
}
|
|
2626
|
+
if (inputType === "url") {
|
|
2627
|
+
if (typeof value !== "string") return "VALUE_TYPE_MISMATCH";
|
|
2628
|
+
try {
|
|
2629
|
+
new URL(value.trim());
|
|
2630
|
+
return;
|
|
2631
|
+
} catch {
|
|
2632
|
+
return "VALUE_TYPE_MISMATCH";
|
|
2633
|
+
}
|
|
2634
|
+
}
|
|
2635
|
+
if (inputType === "email") {
|
|
2636
|
+
if (typeof value !== "string") return "VALUE_TYPE_MISMATCH";
|
|
2637
|
+
return emailRegex.test(value.trim()) ? void 0 : "VALUE_TYPE_MISMATCH";
|
|
2638
|
+
}
|
|
2639
|
+
};
|
|
2640
|
+
/**
|
|
2641
|
+
* Rule group processor used by {@link formatQuery} for "diagnostics" format.
|
|
2642
|
+
*
|
|
2643
|
+
* Produces a {@link DiagnosticsResult} containing an annotated copy of the query
|
|
2644
|
+
* tree (`query`) with `valid`, `reasons`, `path`, and `level` properties on every
|
|
2645
|
+
* rule and group; a flat `diagnostics` array; aggregate `stats`; and a per-field
|
|
2646
|
+
* `fieldSummary`.
|
|
2647
|
+
*
|
|
2648
|
+
* @group Export
|
|
2649
|
+
*/
|
|
2650
|
+
const defaultRuleGroupProcessorDiagnostics = (ruleGroup, options) => {
|
|
2651
|
+
const { fields: fieldsOption, placeholderFieldName, placeholderOperatorName, placeholderValueName, validateRule, validationMap } = options;
|
|
2652
|
+
const diagnostics = [];
|
|
2653
|
+
const stats = {
|
|
2654
|
+
totalRules: 0,
|
|
2655
|
+
totalGroups: 0,
|
|
2656
|
+
validRules: 0,
|
|
2657
|
+
invalidRules: 0,
|
|
2658
|
+
validGroups: 0,
|
|
2659
|
+
invalidGroups: 0
|
|
2660
|
+
};
|
|
2661
|
+
const fieldSummary = {};
|
|
2662
|
+
const uniqueFields = toFlatOptionArray(fieldsOption);
|
|
2663
|
+
const fieldsByName = /* @__PURE__ */ new Map();
|
|
2664
|
+
for (const f of uniqueFields) fieldsByName.set(f.name, f);
|
|
2665
|
+
const hasFieldsConfig = fieldsByName.size > 0;
|
|
2666
|
+
const processRuleGroup = (rg, path) => {
|
|
2667
|
+
stats.totalGroups++;
|
|
2668
|
+
const level = path.length;
|
|
2669
|
+
const groupValidationEntry = validationMap[rg.id ?? ""];
|
|
2670
|
+
const groupSelfValid = isRuleOrGroupValid(rg, groupValidationEntry);
|
|
2671
|
+
const groupReasons = getReasons(groupValidationEntry);
|
|
2672
|
+
if (rg.muted) diagnostics.push({
|
|
2673
|
+
id: rg.id ?? "",
|
|
2674
|
+
path,
|
|
2675
|
+
code: "MUTED",
|
|
2676
|
+
message: "Group is muted",
|
|
2677
|
+
source: "muted"
|
|
2678
|
+
});
|
|
2679
|
+
else if (!groupSelfValid && groupValidationEntry !== void 0) diagnostics.push({
|
|
2680
|
+
id: rg.id ?? "",
|
|
2681
|
+
path,
|
|
2682
|
+
code: "CUSTOM_VALIDATOR",
|
|
2683
|
+
message: groupReasons ? `Invalid: ${groupReasons.join(", ")}` : "Group failed validation",
|
|
2684
|
+
source: "query-validator"
|
|
2685
|
+
});
|
|
2686
|
+
let allChildrenValid = true;
|
|
2687
|
+
let ruleIndex = 0;
|
|
2688
|
+
const annotatedRules = [];
|
|
2689
|
+
for (const rule of rg.rules) {
|
|
2690
|
+
if (typeof rule === "string") {
|
|
2691
|
+
annotatedRules.push(rule);
|
|
2692
|
+
ruleIndex++;
|
|
2693
|
+
continue;
|
|
2694
|
+
}
|
|
2695
|
+
const childPath = [...path, ruleIndex];
|
|
2696
|
+
if (isRuleGroup(rule)) {
|
|
2697
|
+
const annotatedGroup = processRuleGroup(rule, childPath);
|
|
2698
|
+
if (!annotatedGroup.valid) allChildrenValid = false;
|
|
2699
|
+
annotatedRules.push(annotatedGroup);
|
|
2700
|
+
ruleIndex++;
|
|
2701
|
+
continue;
|
|
2702
|
+
}
|
|
2703
|
+
stats.totalRules++;
|
|
2704
|
+
const childLevel = childPath.length;
|
|
2705
|
+
const [validationResult, fieldValidator] = validateRule(rule);
|
|
2706
|
+
const ruleValid = isRuleOrGroupValid(rule, validationResult, fieldValidator) && rule.field !== placeholderFieldName && rule.operator !== placeholderOperatorName && !(placeholderValueName !== void 0 && rule.value === placeholderValueName);
|
|
2707
|
+
collectRuleDiagnostics(rule, childPath, validationResult, fieldValidator, ruleValid, diagnostics, placeholderFieldName, placeholderOperatorName, placeholderValueName, hasFieldsConfig, fieldsByName);
|
|
2708
|
+
if (!ruleValid) {
|
|
2709
|
+
allChildrenValid = false;
|
|
2710
|
+
stats.invalidRules++;
|
|
2711
|
+
} else stats.validRules++;
|
|
2712
|
+
const fieldName = rule.field;
|
|
2713
|
+
if (!fieldSummary[fieldName]) fieldSummary[fieldName] = {
|
|
2714
|
+
ruleCount: 0,
|
|
2715
|
+
invalidCount: 0
|
|
2716
|
+
};
|
|
2717
|
+
fieldSummary[fieldName].ruleCount++;
|
|
2718
|
+
if (!ruleValid) fieldSummary[fieldName].invalidCount++;
|
|
2719
|
+
const ruleReasons = getReasons(validationResult) ?? getFieldValidatorReasons(rule, fieldValidator);
|
|
2720
|
+
const annotatedRule = {
|
|
2721
|
+
...rule,
|
|
2722
|
+
valid: ruleValid,
|
|
2723
|
+
...ruleReasons ? { reasons: ruleReasons } : null,
|
|
2724
|
+
path: childPath,
|
|
2725
|
+
level: childLevel
|
|
2726
|
+
};
|
|
2727
|
+
annotatedRules.push(annotatedRule);
|
|
2728
|
+
ruleIndex++;
|
|
2729
|
+
}
|
|
2730
|
+
const groupValid = groupSelfValid && allChildrenValid;
|
|
2731
|
+
if (groupValid) stats.validGroups++;
|
|
2732
|
+
else stats.invalidGroups++;
|
|
2733
|
+
if (isRuleGroupType(rg)) return {
|
|
2734
|
+
...rg,
|
|
2735
|
+
valid: groupValid,
|
|
2736
|
+
...groupReasons ? { reasons: groupReasons } : null,
|
|
2737
|
+
path,
|
|
2738
|
+
level,
|
|
2739
|
+
rules: annotatedRules
|
|
2740
|
+
};
|
|
2741
|
+
return {
|
|
2742
|
+
...rg,
|
|
2743
|
+
valid: groupValid,
|
|
2744
|
+
...groupReasons ? { reasons: groupReasons } : null,
|
|
2745
|
+
path,
|
|
2746
|
+
level,
|
|
2747
|
+
rules: annotatedRules
|
|
2748
|
+
};
|
|
2749
|
+
};
|
|
2750
|
+
const query = processRuleGroup(ruleGroup, []);
|
|
2751
|
+
if (hasFieldsConfig) {
|
|
2752
|
+
const referencedFields = new Set(Object.keys(fieldSummary));
|
|
2753
|
+
for (const [fieldName] of fieldsByName) if (!referencedFields.has(fieldName)) diagnostics.push({
|
|
2754
|
+
id: "",
|
|
2755
|
+
path: [],
|
|
2756
|
+
code: "UNREFERENCED_FIELD",
|
|
2757
|
+
message: `Field "${fieldName}" is defined in the fields config but not used in the query`,
|
|
2758
|
+
source: "field-check"
|
|
2759
|
+
});
|
|
2760
|
+
}
|
|
2761
|
+
return {
|
|
2762
|
+
query,
|
|
2763
|
+
diagnostics,
|
|
2764
|
+
stats,
|
|
2765
|
+
fieldSummary
|
|
2766
|
+
};
|
|
2767
|
+
};
|
|
2768
|
+
/**
|
|
2769
|
+
* Collects diagnostic entries for a single rule.
|
|
2770
|
+
*/
|
|
2771
|
+
const collectRuleDiagnostics = (rule, path, validationResult, fieldValidator, ruleValid, diagnostics, placeholderFieldName, placeholderOperatorName, placeholderValueName, hasFieldsConfig, fieldsByName) => {
|
|
2772
|
+
const id = rule.id ?? "";
|
|
2773
|
+
if (rule.muted) diagnostics.push({
|
|
2774
|
+
id,
|
|
2775
|
+
path,
|
|
2776
|
+
code: "MUTED",
|
|
2777
|
+
message: "Rule is muted",
|
|
2778
|
+
source: "muted"
|
|
2779
|
+
});
|
|
2780
|
+
if (rule.field === placeholderFieldName) diagnostics.push({
|
|
2781
|
+
id,
|
|
2782
|
+
path,
|
|
2783
|
+
code: "PLACEHOLDER_FIELD",
|
|
2784
|
+
message: "Rule has a placeholder field",
|
|
2785
|
+
source: "placeholder"
|
|
2786
|
+
});
|
|
2787
|
+
if (rule.operator === placeholderOperatorName) diagnostics.push({
|
|
2788
|
+
id,
|
|
2789
|
+
path,
|
|
2790
|
+
code: "PLACEHOLDER_OPERATOR",
|
|
2791
|
+
message: "Rule has a placeholder operator",
|
|
2792
|
+
source: "placeholder"
|
|
2793
|
+
});
|
|
2794
|
+
if (placeholderValueName !== void 0 && rule.value === placeholderValueName) diagnostics.push({
|
|
2795
|
+
id,
|
|
2796
|
+
path,
|
|
2797
|
+
code: "PLACEHOLDER_VALUE",
|
|
2798
|
+
message: "Rule has a placeholder value",
|
|
2799
|
+
source: "placeholder"
|
|
2800
|
+
});
|
|
2801
|
+
if (!rule.muted && rule.field !== placeholderFieldName && rule.operator !== placeholderOperatorName && !(placeholderValueName !== void 0 && rule.value === placeholderValueName)) {
|
|
2802
|
+
if (typeof validationResult === "boolean" && !validationResult) diagnostics.push({
|
|
2803
|
+
id,
|
|
2804
|
+
path,
|
|
2805
|
+
code: "CUSTOM_VALIDATOR",
|
|
2806
|
+
message: "Rule failed validation",
|
|
2807
|
+
source: "query-validator"
|
|
2808
|
+
});
|
|
2809
|
+
else if (typeof validationResult !== "boolean" && isValidationResult(validationResult) && !validationResult.valid) {
|
|
2810
|
+
const reasons = validationResult.reasons;
|
|
2811
|
+
diagnostics.push({
|
|
2812
|
+
id,
|
|
2813
|
+
path,
|
|
2814
|
+
code: "CUSTOM_VALIDATOR",
|
|
2815
|
+
message: reasons ? `Invalid: ${reasons.join(", ")}` : "Rule failed validation",
|
|
2816
|
+
source: "query-validator"
|
|
2817
|
+
});
|
|
2818
|
+
} else if (!ruleValid && typeof fieldValidator === "function") {
|
|
2819
|
+
const vr = fieldValidator(rule);
|
|
2820
|
+
const reasons = typeof vr !== "boolean" && isValidationResult(vr) && !vr.valid ? vr.reasons : void 0;
|
|
2821
|
+
diagnostics.push({
|
|
2822
|
+
id,
|
|
2823
|
+
path,
|
|
2824
|
+
code: "CUSTOM_VALIDATOR",
|
|
2825
|
+
message: reasons ? `Invalid: ${reasons.join(", ")}` : "Rule failed field validation",
|
|
2826
|
+
source: "field-validator"
|
|
2827
|
+
});
|
|
2828
|
+
}
|
|
2829
|
+
}
|
|
2830
|
+
if (hasFieldsConfig && !fieldsByName.has(rule.field) && rule.field !== placeholderFieldName) diagnostics.push({
|
|
2831
|
+
id,
|
|
2832
|
+
path,
|
|
2833
|
+
code: "UNDEFINED_FIELD",
|
|
2834
|
+
message: `Field "${rule.field}" is not defined in the fields config`,
|
|
2835
|
+
source: "field-check"
|
|
2836
|
+
});
|
|
2837
|
+
if (hasFieldsConfig) {
|
|
2838
|
+
const fieldDef = fieldsByName.get(rule.field);
|
|
2839
|
+
if (fieldDef?.inputType) {
|
|
2840
|
+
const mismatchCode = checkValueTypeMismatch(rule.value, fieldDef.inputType);
|
|
2841
|
+
if (mismatchCode) diagnostics.push({
|
|
2842
|
+
id,
|
|
2843
|
+
path,
|
|
2844
|
+
code: mismatchCode,
|
|
2845
|
+
message: `Value "${rule.value}" is not compatible with input type "${fieldDef.inputType}"`,
|
|
2846
|
+
source: "type-check"
|
|
2847
|
+
});
|
|
2848
|
+
}
|
|
2849
|
+
}
|
|
2850
|
+
};
|
|
2851
|
+
/**
|
|
2852
|
+
* Extracts `reasons` from a validation result, if present.
|
|
2853
|
+
*/
|
|
2854
|
+
const getReasons = (validationResult) => {
|
|
2855
|
+
if (typeof validationResult !== "boolean" && isValidationResult(validationResult) && !validationResult.valid && validationResult.reasons) return validationResult.reasons;
|
|
2856
|
+
};
|
|
2857
|
+
/**
|
|
2858
|
+
* Runs a field-level validator and extracts `reasons` if present.
|
|
2859
|
+
*/
|
|
2860
|
+
const getFieldValidatorReasons = (rule, fieldValidator) => {
|
|
2861
|
+
if (typeof fieldValidator === "function") {
|
|
2862
|
+
const vr = fieldValidator(rule);
|
|
2863
|
+
if (typeof vr !== "boolean" && isValidationResult(vr) && !vr.valid && vr.reasons) return vr.reasons;
|
|
2864
|
+
}
|
|
2865
|
+
};
|
|
2866
|
+
//#endregion
|
|
2540
2867
|
//#region src/utils/formatQuery/defaultRuleProcessorElasticSearch.ts
|
|
2541
2868
|
const rangeOperatorMap = {
|
|
2542
2869
|
"<": "lt",
|
|
@@ -2915,12 +3242,12 @@ const defaultRuleProcessorLDAP = (rule, options = {}) => {
|
|
|
2915
3242
|
return negateIf(`(&(${field}>=${ldapEscape(firstValue)})(${field}<=${ldapEscape(secondValue)}))`, operatorLC === "notbetween");
|
|
2916
3243
|
}
|
|
2917
3244
|
}
|
|
2918
|
-
//
|
|
3245
|
+
// v8 ignore next
|
|
2919
3246
|
return "";
|
|
2920
3247
|
};
|
|
2921
3248
|
//#endregion
|
|
2922
3249
|
//#region src/utils/formatQuery/defaultValueProcessorNL.ts
|
|
2923
|
-
const escapeStringValueQuotes = (v, quoteChar, escapeQuotes) => escapeQuotes && typeof v === "string" ? v.replaceAll(`${quoteChar}`, `${quoteChar}${quoteChar}`) : v;
|
|
3250
|
+
const escapeStringValueQuotes = (v, quoteChar, escapeQuotes) => escapeQuotes && typeof v === "string" ? v.replaceAll(`${quoteChar}`, `${quoteChar}${quoteChar}`) : /* v8 ignore next -- @preserve */ v;
|
|
2924
3251
|
/**
|
|
2925
3252
|
* Default value processor used by {@link formatQuery} for "natural_language" format.
|
|
2926
3253
|
*
|
|
@@ -2938,7 +3265,7 @@ const defaultValueProcessorNL = (rule, opts = {}) => {
|
|
|
2938
3265
|
quoteFieldNamesWith,
|
|
2939
3266
|
fieldIdentifierSeparator
|
|
2940
3267
|
});
|
|
2941
|
-
const t = translations ?? ( /*
|
|
3268
|
+
const t = translations ?? ( /* v8 ignore start -- @preserve */ {});
|
|
2942
3269
|
const orTL = t.or ?? "or";
|
|
2943
3270
|
const trueTL = t.true ?? "true";
|
|
2944
3271
|
const falseTL = t.false ?? "false";
|
|
@@ -2994,7 +3321,7 @@ const defaultExportOperatorMap = {
|
|
|
2994
3321
|
between: ["is between", "is between the values in"],
|
|
2995
3322
|
notbetween: ["is not between", "is not between the values in"]
|
|
2996
3323
|
};
|
|
2997
|
-
/*
|
|
3324
|
+
/* v8 ignore next -- @preserve */
|
|
2998
3325
|
const defaultGetOperators = () => [];
|
|
2999
3326
|
/**
|
|
3000
3327
|
* Default operator processor used by {@link formatQuery} for "natural_language" format.
|
|
@@ -3003,7 +3330,7 @@ const defaultGetOperators = () => [];
|
|
|
3003
3330
|
*/
|
|
3004
3331
|
const defaultOperatorProcessorNL = (rule, opts = {}) => {
|
|
3005
3332
|
const { field, operator, valueSource = "value" } = rule;
|
|
3006
|
-
//
|
|
3333
|
+
// v8 ignore next
|
|
3007
3334
|
const { getOperators = defaultGetOperators, operatorMap: operatorMapParam = defaultExportOperatorMap } = opts;
|
|
3008
3335
|
const mergedOperatorMap = new Map(Object.entries(defaultExportOperatorMap));
|
|
3009
3336
|
for (const [key, value] of Object.entries(operatorMapParam)) mergedOperatorMap.set(lc(key), value);
|
|
@@ -3032,8 +3359,8 @@ const defaultOperatorProcessorNL = (rule, opts = {}) => {
|
|
|
3032
3359
|
*/
|
|
3033
3360
|
const defaultRuleProcessorNL = (rule, opts) => {
|
|
3034
3361
|
const { field, operator } = rule;
|
|
3035
|
-
//
|
|
3036
|
-
const { fieldData, quoteFieldNamesWith = ["", ""], fieldIdentifierSeparator = "", quoteValuesWith = `'`, operatorProcessor = defaultOperatorProcessorNL, valueProcessor = defaultValueProcessorNL, concatOperator = "||", wordOrder = "SVO" } = opts ?? ( /*
|
|
3362
|
+
// v8 ignore next
|
|
3363
|
+
const { fieldData, quoteFieldNamesWith = ["", ""], fieldIdentifierSeparator = "", quoteValuesWith = `'`, operatorProcessor = defaultOperatorProcessorNL, valueProcessor = defaultValueProcessorNL, concatOperator = "||", wordOrder = "SVO" } = opts ?? ( /* v8 ignore start -- @preserve */ {});
|
|
3037
3364
|
const processedField = getQuotedFieldName(fieldData?.label ?? field, {
|
|
3038
3365
|
quoteFieldNamesWith,
|
|
3039
3366
|
fieldIdentifierSeparator
|
|
@@ -3139,7 +3466,7 @@ const defaultRuleProcessorSQL = (rule, opts = {}) => {
|
|
|
3139
3466
|
* @group Export
|
|
3140
3467
|
*/
|
|
3141
3468
|
const defaultRuleProcessorParameterized = (rule, opts, meta) => {
|
|
3142
|
-
//
|
|
3469
|
+
// v8 ignore next
|
|
3143
3470
|
const { fieldData, format, getNextNamedParam, parseNumbers, paramPrefix, paramsKeepPrefix, numberedParams, quoteFieldNamesWith = ["", ""], fieldIdentifierSeparator, concatOperator, operatorProcessor = defaultOperatorProcessorSQL, valueProcessor = defaultValueProcessorByRule } = opts ?? {};
|
|
3144
3471
|
const { processedParams = [] } = meta ?? {};
|
|
3145
3472
|
const parameterized = format === "parameterized";
|
|
@@ -3158,6 +3485,7 @@ const defaultRuleProcessorParameterized = (rule, opts, meta) => {
|
|
|
3158
3485
|
});
|
|
3159
3486
|
const ruleField = wrapFieldName(rule.field);
|
|
3160
3487
|
const matchEval = processMatchMode(rule);
|
|
3488
|
+
/* v8 ignore start -- @preserve */
|
|
3161
3489
|
if (matchEval === false) return;
|
|
3162
3490
|
else if (matchEval) {
|
|
3163
3491
|
if (opts?.preset !== "postgresql") return finalize("");
|
|
@@ -3170,7 +3498,6 @@ const defaultRuleProcessorParameterized = (rule, opts, meta) => {
|
|
|
3170
3498
|
...opts,
|
|
3171
3499
|
fields: []
|
|
3172
3500
|
});
|
|
3173
|
-
// istanbul ignore else
|
|
3174
3501
|
if (Array.isArray(nestedParams)) params.push(...nestedParams);
|
|
3175
3502
|
else Object.assign(paramsNamed, nestedParams);
|
|
3176
3503
|
switch (mode) {
|
|
@@ -3185,6 +3512,7 @@ const defaultRuleProcessorParameterized = (rule, opts, meta) => {
|
|
|
3185
3512
|
}
|
|
3186
3513
|
}
|
|
3187
3514
|
}
|
|
3515
|
+
/* v8 ignore stop -- @preserve */
|
|
3188
3516
|
const value = valueProcessor(rule, {
|
|
3189
3517
|
parseNumbers,
|
|
3190
3518
|
quoteFieldNamesWith,
|
|
@@ -3225,7 +3553,7 @@ const defaultRuleProcessorParameterized = (rule, opts, meta) => {
|
|
|
3225
3553
|
}
|
|
3226
3554
|
let paramValue = rule.value;
|
|
3227
3555
|
if (typeof rule.value === "string") if (shouldRenderAsNumber(rule.value, parseNumbers)) paramValue = parseNumber(rule.value, { parseNumbers });
|
|
3228
|
-
else paramValue = /^'.*'$/g.test(value) ? value.replaceAll(/(^'|'$)/g, "") : value;
|
|
3556
|
+
else paramValue = /^'.*'$/g.test(value) ? value.replaceAll(/(^'|'$)/g, "") : /* v8 ignore next -- @preserve */ value;
|
|
3229
3557
|
let paramName = "";
|
|
3230
3558
|
if (parameterized) params.push(paramValue);
|
|
3231
3559
|
else {
|
|
@@ -3244,9 +3572,9 @@ const processNumber = (value, fallback, parseNumbers) => shouldRenderAsNumber(va
|
|
|
3244
3572
|
*/
|
|
3245
3573
|
const defaultRuleProcessorPrisma = (rule, options = {}) => {
|
|
3246
3574
|
const { field, operator, value, valueSource } = rule;
|
|
3247
|
-
//
|
|
3575
|
+
// v8 ignore next
|
|
3248
3576
|
const { parseNumbers, preserveValueOrder } = options;
|
|
3249
|
-
if (valueSource === "field" || processMatchMode(rule)) return;
|
|
3577
|
+
if (valueSource === "field" || processMatchMode(rule)) return void 0;
|
|
3250
3578
|
const operatorLC = lc(operator);
|
|
3251
3579
|
switch (operatorLC) {
|
|
3252
3580
|
case "=": return { [field]: processNumber(value, value, parseNumbers) };
|
|
@@ -3304,7 +3632,7 @@ const defaultRuleProcessorPrisma = (rule, options = {}) => {
|
|
|
3304
3632
|
*/
|
|
3305
3633
|
const defaultRuleProcessorSequelize = (rule, { parseNumbers, preserveValueOrder, context = {} } = {}) => {
|
|
3306
3634
|
const { sequelizeOperators: Op, sequelizeCol: col, sequelizeFn: fn } = context;
|
|
3307
|
-
if (processMatchMode(rule)) return;
|
|
3635
|
+
if (processMatchMode(rule)) return void 0;
|
|
3308
3636
|
const { field, operator, value, valueSource } = rule;
|
|
3309
3637
|
const valueIsField = valueSource === "field";
|
|
3310
3638
|
const operatorLC = lc(operator);
|
|
@@ -3408,9 +3736,10 @@ const defaultRuleProcessors = {
|
|
|
3408
3736
|
prisma: defaultRuleProcessorPrisma,
|
|
3409
3737
|
sequelize: defaultRuleProcessorSequelize,
|
|
3410
3738
|
spel: defaultRuleProcessorSpEL,
|
|
3411
|
-
sql: defaultRuleProcessorSQL
|
|
3739
|
+
sql: defaultRuleProcessorSQL,
|
|
3740
|
+
diagnostics: defaultRuleProcessorSQL
|
|
3412
3741
|
};
|
|
3413
|
-
/*
|
|
3742
|
+
/* v8 ignore next -- @preserve */
|
|
3414
3743
|
const defaultOperatorProcessor = (r) => r.operator;
|
|
3415
3744
|
const defaultOperatorProcessors = {
|
|
3416
3745
|
cel: defaultOperatorProcessor,
|
|
@@ -3429,7 +3758,8 @@ const defaultOperatorProcessors = {
|
|
|
3429
3758
|
prisma: defaultOperatorProcessor,
|
|
3430
3759
|
sequelize: defaultOperatorProcessor,
|
|
3431
3760
|
spel: defaultOperatorProcessor,
|
|
3432
|
-
sql: defaultOperatorProcessorSQL
|
|
3761
|
+
sql: defaultOperatorProcessorSQL,
|
|
3762
|
+
diagnostics: defaultOperatorProcessor
|
|
3433
3763
|
};
|
|
3434
3764
|
const defaultFallbackExpressions = {
|
|
3435
3765
|
cel: "1 == 1",
|
|
@@ -3503,24 +3833,26 @@ function formatQuery(ruleGroup, optionParam = {}) {
|
|
|
3503
3833
|
const getOperators = (f, m) => toFullOptionList(getOperators_option(f, m) ?? []);
|
|
3504
3834
|
const fallbackExpression = fallbackExpression_option ?? defaultFallbackExpressions[format] ?? defaultFallbackExpressions.sql;
|
|
3505
3835
|
let validationMap = {};
|
|
3506
|
-
//
|
|
3836
|
+
// v8 ignore else
|
|
3507
3837
|
if (typeof validator === "function") {
|
|
3508
3838
|
const validationResult = validator(ruleGroup);
|
|
3509
3839
|
if (typeof validationResult === "boolean") {
|
|
3510
|
-
//
|
|
3511
|
-
if (!validationResult)
|
|
3512
|
-
|
|
3513
|
-
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
|
|
3517
|
-
|
|
3840
|
+
// v8 ignore else
|
|
3841
|
+
if (!validationResult) {
|
|
3842
|
+
if (format !== "diagnostics") return format === "parameterized" ? {
|
|
3843
|
+
sql: fallbackExpression,
|
|
3844
|
+
params: []
|
|
3845
|
+
} : format === "parameterized_named" ? {
|
|
3846
|
+
sql: fallbackExpression,
|
|
3847
|
+
params: {}
|
|
3848
|
+
} : format === "mongodb" ? `{${fallbackExpression}}` : format === "mongodb_query" ? mongoDbFallback : format === "prisma" ? prismaFallback : format === "jsonlogic" ? false : format === "elasticsearch" ? {} : format === "drizzle" || format === "sequelize" ? void 0 : fallbackExpression;
|
|
3849
|
+
}
|
|
3518
3850
|
} else validationMap = validationResult;
|
|
3519
3851
|
}
|
|
3520
3852
|
const validatorMap = {};
|
|
3521
3853
|
const uniqueFields = toFlatOptionArray(fields);
|
|
3522
3854
|
for (const f of uniqueFields)
|
|
3523
|
-
//
|
|
3855
|
+
// v8 ignore else
|
|
3524
3856
|
if (typeof f.validator === "function") validatorMap[f.value ?? f.name] = f.validator;
|
|
3525
3857
|
const validateRule = (rule) => {
|
|
3526
3858
|
let validationResult;
|
|
@@ -3530,7 +3862,7 @@ function formatQuery(ruleGroup, optionParam = {}) {
|
|
|
3530
3862
|
const fieldArr = uniqueFields.filter((f) => f.name === rule.field);
|
|
3531
3863
|
if (fieldArr.length > 0) {
|
|
3532
3864
|
const field = fieldArr[0];
|
|
3533
|
-
//
|
|
3865
|
+
// v8 ignore else
|
|
3534
3866
|
if (typeof field.validator === "function") fieldValidator = field.validator;
|
|
3535
3867
|
}
|
|
3536
3868
|
}
|
|
@@ -3574,6 +3906,7 @@ function formatQuery(ruleGroup, optionParam = {}) {
|
|
|
3574
3906
|
case "prisma": return defaultRuleGroupProcessorPrisma(ruleGroup, finalOptions);
|
|
3575
3907
|
case "drizzle": return defaultRuleGroupProcessorDrizzle(ruleGroup, finalOptions);
|
|
3576
3908
|
case "sequelize": return defaultRuleGroupProcessorSequelize(ruleGroup, finalOptions);
|
|
3909
|
+
case "diagnostics": return defaultRuleGroupProcessorDiagnostics(ruleGroup, finalOptions);
|
|
3577
3910
|
default: return "";
|
|
3578
3911
|
}
|
|
3579
3912
|
}
|
|
@@ -3724,6 +4057,7 @@ const generateAccessibleDescription = (params) => pathsAreEqual([], params.path)
|
|
|
3724
4057
|
//#endregion
|
|
3725
4058
|
//#region src/utils/generateID.ts
|
|
3726
4059
|
const cryptoModule = globalThis.crypto;
|
|
4060
|
+
const uuidV4regex = /^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i;
|
|
3727
4061
|
/**
|
|
3728
4062
|
* Default `id` generator. Generates a valid v4 UUID. Uses `crypto.randomUUID()`
|
|
3729
4063
|
* when available, otherwise uses an alternate method based on `getRandomValues`.
|
|
@@ -3733,11 +4067,11 @@ const cryptoModule = globalThis.crypto;
|
|
|
3733
4067
|
* ```
|
|
3734
4068
|
* @returns Valid v4 UUID
|
|
3735
4069
|
*/
|
|
3736
|
-
//
|
|
4070
|
+
// v8 ignore next
|
|
3737
4071
|
let generateID = () => "00-0-4-2-000".replaceAll(/[^-]/g, (s) => ((Math.random() + Math.trunc(s)) * 65536 >> Number.parseInt(s)).toString(16).padStart(4, "0"));
|
|
3738
|
-
//
|
|
4072
|
+
// v8 ignore else
|
|
3739
4073
|
if (cryptoModule) {
|
|
3740
|
-
//
|
|
4074
|
+
// v8 ignore else
|
|
3741
4075
|
if (typeof cryptoModule.randomUUID === "function") generateID = () => cryptoModule.randomUUID();
|
|
3742
4076
|
else if (typeof cryptoModule.getRandomValues === "function") {
|
|
3743
4077
|
const position19vals = "89ab";
|
|
@@ -3770,7 +4104,7 @@ const dummyFD$1 = {
|
|
|
3770
4104
|
* `FullOption<MatchMode>[]` of all match modes by default.
|
|
3771
4105
|
*/
|
|
3772
4106
|
const getMatchModesUtil = (fieldData, getMatchModes) => {
|
|
3773
|
-
const fd = fieldData ? toFullOption(fieldData) : dummyFD$1;
|
|
4107
|
+
const fd = fieldData ? toFullOption(fieldData) : /* v8 ignore next -- @preserve */ dummyFD$1;
|
|
3774
4108
|
let matchModes = fd.matchModes ?? false;
|
|
3775
4109
|
if (!matchModes && getMatchModes) matchModes = getMatchModes(fd.value, { fieldData: fd });
|
|
3776
4110
|
if (matchModes === true) return defaultMatchModes;
|
|
@@ -3832,7 +4166,7 @@ const getValueSourcesUtil = (fieldData, operator, getValueSources) => {
|
|
|
3832
4166
|
const mergeAnyTranslations = (base, ...otherTranslations) => {
|
|
3833
4167
|
const result = { ...base };
|
|
3834
4168
|
for (const translations of otherTranslations)
|
|
3835
|
-
//
|
|
4169
|
+
// v8 ignore else
|
|
3836
4170
|
if (translations) for (const key of objectKeys(translations)) {
|
|
3837
4171
|
if (isUnsafeKey(key)) continue;
|
|
3838
4172
|
if (result[key]) result[key] = {
|
|
@@ -3893,6 +4227,8 @@ const mergeClassnames = (...args) => ({
|
|
|
3893
4227
|
dndCopy: joinClassnamesByName("dndCopy", args),
|
|
3894
4228
|
dndGroup: joinClassnamesByName("dndGroup", args),
|
|
3895
4229
|
dndDropNotAllowed: joinClassnamesByName("dndDropNotAllowed", args),
|
|
4230
|
+
dndPreviewPosition: joinClassnamesByName("dndPreviewPosition", args),
|
|
4231
|
+
dndHidden: joinClassnamesByName("dndHidden", args),
|
|
3896
4232
|
disabled: joinClassnamesByName("disabled", args),
|
|
3897
4233
|
valueListItem: joinClassnamesByName("valueListItem", args),
|
|
3898
4234
|
matchMode: joinClassnamesByName("matchMode", args),
|
|
@@ -3988,7 +4324,7 @@ const regenerateIDs = (subject, { idGenerator = generateID } = {}) => {
|
|
|
3988
4324
|
...subject,
|
|
3989
4325
|
id: idGenerator()
|
|
3990
4326
|
};
|
|
3991
|
-
//
|
|
4327
|
+
// v8 ignore else
|
|
3992
4328
|
if (Array.isArray(newGroup.rules)) newGroup.rules = subject.rules.map((r) => typeof r === "string" ? r : isRuleGroup(r) ? regenerateIDs(r, { idGenerator }) : regenerateID(r, { idGenerator }));
|
|
3993
4329
|
return newGroup;
|
|
3994
4330
|
};
|
|
@@ -4282,6 +4618,6 @@ const groupInPlace = (query, sourcePathOrID, targetPathOrID, options = {}) => {
|
|
|
4282
4618
|
return query;
|
|
4283
4619
|
};
|
|
4284
4620
|
//#endregion
|
|
4285
|
-
export { LogType, TestID, add, addInPlace, bigIntJsonParseReviver, bigIntJsonStringifyReplacer, celCombinatorMap, clsx, convertFromIC, convertQuery, convertToIC, defaultCELValueProcessor, defaultCombinatorLabelMap, defaultCombinators, defaultCombinatorsExtended, defaultControlClassnames, defaultExportOperatorMap, defaultJoinChar, defaultMatchModes, defaultMongoDBValueProcessor, defaultNLTranslations, defaultOperatorLabelMap, defaultOperatorNegationMap, defaultOperatorProcessorNL, defaultOperatorProcessorSQL, defaultOperators, defaultPlaceholderFieldGroupLabel, defaultPlaceholderFieldLabel, defaultPlaceholderFieldName, defaultPlaceholderLabel, defaultPlaceholderName, defaultPlaceholderOperatorGroupLabel, defaultPlaceholderOperatorLabel, defaultPlaceholderOperatorName, defaultPlaceholderValueGroupLabel, defaultPlaceholderValueLabel, defaultPlaceholderValueName, defaultRuleGroupProcessorCEL, defaultRuleGroupProcessorDrizzle, defaultRuleGroupProcessorElasticSearch, defaultRuleGroupProcessorJSONata, defaultRuleGroupProcessorJsonLogic, defaultRuleGroupProcessorLDAP, defaultRuleGroupProcessorMongoDB, defaultRuleGroupProcessorMongoDBQuery, defaultRuleGroupProcessorNL, defaultRuleGroupProcessorParameterized, defaultRuleGroupProcessorPrisma, defaultRuleGroupProcessorSQL, defaultRuleGroupProcessorSequelize, defaultRuleGroupProcessorSpEL, defaultRuleProcessorCEL, defaultRuleProcessorDrizzle, defaultRuleProcessorElasticSearch, defaultRuleProcessorJSONata, defaultRuleProcessorJsonLogic, defaultRuleProcessorLDAP, defaultRuleProcessorMongoDB, defaultRuleProcessorMongoDBQuery, defaultRuleProcessorNL, defaultRuleProcessorParameterized, defaultRuleProcessorPrisma, defaultRuleProcessorSQL, defaultRuleProcessorSequelize, defaultRuleProcessorSpEL, defaultSpELValueProcessor, defaultTranslations, defaultValidator, defaultValueProcessor, defaultValueProcessorByRule, defaultValueProcessorCELByRule, defaultValueProcessorMongoDBByRule, defaultValueProcessorNL, defaultValueProcessorSpELByRule, filterFieldsByComparator, findID, findPath, formatQuery, formatQueryOptionPresets, generateAccessibleDescription, generateID, getCommonAncestorPath, getFirstOption, getMatchModesUtil, getNLTranslataion, getOption, getParentPath, getParseNumberMethod, getPathOfID, getQuoteFieldNamesWithArray, getQuotedFieldName, getValidationClassNames, getValueSourcesUtil, group, groupInPlace, groupInvalidReasons, insert, insertInPlace, isAncestor, isFlexibleOptionArray, isFlexibleOptionGroupArray, isFullOptionArray, isFullOptionGroupArray, isOptionGroupArray, isPojo, isRuleGroup, isRuleGroupType, isRuleGroupTypeIC, isRuleOrGroupValid, isRuleType, isUnsafeKey, isValidValue, isValidationResult, isValueProcessorLegacy, joinWith, jsonLogicAdditionalOperators, lc, mapSQLOperator, mergeAnyTranslation, mergeAnyTranslations, mergeClassnames, mongoDbFallback, mongoOperators, move, moveInPlace, normalizeConstituentWordOrder, nullFreeArray, nullOrUndefinedOrEmpty, numericRegex, numerifyValues, objectEntries, objectKeys, parseNumber, pathIsDisabled, pathsAreEqual, preferAnyProp, preferFlagProps, preferProp, prepareOptionList, prepareRule, prepareRuleGroup, prepareRuleOrGroup, prismaFallback, prismaOperators, processMatchMode, queryBuilderFlagDefaults, regenerateID, regenerateIDs, remove, removeInPlace, rootPath, shouldRenderAsNumber, splitBy, sqlDialectPresets, standardClassnames, toArray, toFlatOptionArray, toFullOption, toFullOptionList, toFullOptionMap, transformQuery, trimIfString, uniqByIdentifier, uniqByName, uniqOptGroups, uniqOptList, update, updateInPlace };
|
|
4621
|
+
export { LogType, TestID, add, addInPlace, bigIntJsonParseReviver, bigIntJsonStringifyReplacer, celCombinatorMap, clsx, convertFromIC, convertQuery, convertToIC, defaultCELValueProcessor, defaultCombinatorLabelMap, defaultCombinators, defaultCombinatorsExtended, defaultControlClassnames, defaultExportOperatorMap, defaultJoinChar, defaultMatchModes, defaultMongoDBValueProcessor, defaultNLTranslations, defaultOperatorLabelMap, defaultOperatorNegationMap, defaultOperatorProcessorNL, defaultOperatorProcessorSQL, defaultOperators, defaultPlaceholderFieldGroupLabel, defaultPlaceholderFieldLabel, defaultPlaceholderFieldName, defaultPlaceholderLabel, defaultPlaceholderName, defaultPlaceholderOperatorGroupLabel, defaultPlaceholderOperatorLabel, defaultPlaceholderOperatorName, defaultPlaceholderValueGroupLabel, defaultPlaceholderValueLabel, defaultPlaceholderValueName, defaultRuleGroupProcessorCEL, defaultRuleGroupProcessorDiagnostics, defaultRuleGroupProcessorDrizzle, defaultRuleGroupProcessorElasticSearch, defaultRuleGroupProcessorJSONata, defaultRuleGroupProcessorJsonLogic, defaultRuleGroupProcessorLDAP, defaultRuleGroupProcessorMongoDB, defaultRuleGroupProcessorMongoDBQuery, defaultRuleGroupProcessorNL, defaultRuleGroupProcessorParameterized, defaultRuleGroupProcessorPrisma, defaultRuleGroupProcessorSQL, defaultRuleGroupProcessorSequelize, defaultRuleGroupProcessorSpEL, defaultRuleProcessorCEL, defaultRuleProcessorDrizzle, defaultRuleProcessorElasticSearch, defaultRuleProcessorJSONata, defaultRuleProcessorJsonLogic, defaultRuleProcessorLDAP, defaultRuleProcessorMongoDB, defaultRuleProcessorMongoDBQuery, defaultRuleProcessorNL, defaultRuleProcessorParameterized, defaultRuleProcessorPrisma, defaultRuleProcessorSQL, defaultRuleProcessorSequelize, defaultRuleProcessorSpEL, defaultSpELValueProcessor, defaultTranslations, defaultValidator, defaultValueProcessor, defaultValueProcessorByRule, defaultValueProcessorCELByRule, defaultValueProcessorMongoDBByRule, defaultValueProcessorNL, defaultValueProcessorSpELByRule, filterFieldsByComparator, findID, findPath, formatQuery, formatQueryOptionPresets, generateAccessibleDescription, generateID, getCommonAncestorPath, getFirstOption, getMatchModesUtil, getNLTranslataion, getOption, getParentPath, getParseNumberMethod, getPathOfID, getQuoteFieldNamesWithArray, getQuotedFieldName, getValidationClassNames, getValueSourcesUtil, group, groupInPlace, groupInvalidReasons, insert, insertInPlace, isAncestor, isFlexibleOptionArray, isFlexibleOptionGroupArray, isFullOptionArray, isFullOptionGroupArray, isOptionGroupArray, isPojo, isRuleGroup, isRuleGroupType, isRuleGroupTypeIC, isRuleOrGroupValid, isRuleType, isUnsafeKey, isValidValue, isValidationResult, isValueProcessorLegacy, joinWith, jsonLogicAdditionalOperators, lc, mapSQLOperator, mergeAnyTranslation, mergeAnyTranslations, mergeClassnames, mongoDbFallback, mongoOperators, move, moveInPlace, normalizeConstituentWordOrder, nullFreeArray, nullOrUndefinedOrEmpty, numericRegex, numerifyValues, objectEntries, objectKeys, parseNumber, pathIsDisabled, pathsAreEqual, preferAnyProp, preferFlagProps, preferProp, prepareOptionList, prepareRule, prepareRuleGroup, prepareRuleOrGroup, prismaFallback, prismaOperators, processMatchMode, queryBuilderFlagDefaults, regenerateID, regenerateIDs, remove, removeInPlace, rootPath, shouldRenderAsNumber, splitBy, sqlDialectPresets, standardClassnames, toArray, toFlatOptionArray, toFullOption, toFullOptionList, toFullOptionMap, transformQuery, trimIfString, uniqByIdentifier, uniqByName, uniqOptGroups, uniqOptList, update, updateInPlace, uuidV4regex };
|
|
4286
4622
|
|
|
4287
4623
|
//# sourceMappingURL=react-querybuilder_core.mjs.map
|