@react-querybuilder/core 8.9.1 → 8.10.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/arrayUtils-C9sO4qLO.mjs +50 -0
- package/dist/arrayUtils-C9sO4qLO.mjs.map +1 -0
- package/dist/arrayUtils-QxZOZTf6.js +73 -0
- package/dist/arrayUtils-QxZOZTf6.js.map +1 -0
- package/dist/basic-BmpEwexQ.d.mts +363 -0
- package/dist/basic-CDDA-KZa.d.ts +363 -0
- package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +569 -1252
- package/dist/cjs/react-querybuilder_core.cjs.development.js +430 -140
- package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +569 -1252
- 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-BUgyz1GA.mjs +75 -0
- package/dist/convertQuery-BUgyz1GA.mjs.map +1 -0
- package/dist/export-Ccjfea21.d.mts +453 -0
- package/dist/{export-DyrnTh6K.d.ts → export-GUuxJ7zR.d.ts} +3 -2
- package/dist/formatQuery.d.mts +668 -0
- package/dist/formatQuery.d.ts +3 -2
- package/dist/formatQuery.js +217 -87
- package/dist/formatQuery.js.map +1 -1
- package/dist/formatQuery.mjs +2496 -0
- package/dist/formatQuery.mjs.map +1 -0
- package/dist/{import-Cksobmln.d.ts → import-D-hm1phN.d.ts} +2 -2
- package/dist/import-Dxevzw_-.d.mts +28 -0
- package/dist/isRuleGroup-CGe_rb2w.mjs +40 -0
- package/dist/isRuleGroup-CGe_rb2w.mjs.map +1 -0
- package/dist/isRuleGroup-DqAs2x4E.js.map +1 -1
- package/dist/{optGroupUtils-CXLgyg2i.js → optGroupUtils-B0hTpodo.js} +114 -1
- package/dist/optGroupUtils-B0hTpodo.js.map +1 -0
- package/dist/optGroupUtils-DrubUpx0.mjs +185 -0
- package/dist/optGroupUtils-DrubUpx0.mjs.map +1 -0
- package/dist/parseCEL.d.mts +315 -0
- package/dist/parseCEL.d.ts +292 -11
- package/dist/parseCEL.js +114 -30
- package/dist/parseCEL.js.map +1 -1
- package/dist/parseCEL.mjs +2631 -0
- package/dist/parseCEL.mjs.map +1 -0
- package/dist/parseJSONata.d.mts +37 -0
- package/dist/parseJSONata.d.ts +3 -2
- package/dist/parseJSONata.js +49 -77
- package/dist/parseJSONata.js.map +1 -1
- package/dist/parseJSONata.mjs +267 -0
- package/dist/parseJSONata.mjs.map +1 -0
- package/dist/parseJsonLogic.d.mts +37 -0
- package/dist/parseJsonLogic.d.ts +4 -3
- package/dist/parseJsonLogic.js +5 -6
- package/dist/parseJsonLogic.js.map +1 -1
- package/dist/parseJsonLogic.mjs +190 -0
- package/dist/parseJsonLogic.mjs.map +1 -0
- package/dist/parseMongoDB.d.mts +80 -0
- package/dist/parseMongoDB.d.ts +3 -2
- package/dist/parseMongoDB.js +15 -16
- package/dist/parseMongoDB.js.map +1 -1
- package/dist/parseMongoDB.mjs +266 -0
- package/dist/parseMongoDB.mjs.map +1 -0
- package/dist/parseNumber-B_-sR6d5.mjs +24 -0
- package/dist/parseNumber-B_-sR6d5.mjs.map +1 -0
- package/dist/{parseNumber-Bcys1kOH.js → parseNumber-D4iQDxK-.js} +1 -1
- package/dist/{parseNumber-Bcys1kOH.js.map → parseNumber-D4iQDxK-.js.map} +1 -1
- package/dist/parseSQL.d.mts +38 -0
- package/dist/parseSQL.d.ts +3 -2
- package/dist/parseSQL.js +11 -15
- package/dist/parseSQL.js.map +1 -1
- package/dist/parseSQL.mjs +6622 -0
- package/dist/parseSQL.mjs.map +1 -0
- package/dist/parseSpEL.d.mts +35 -0
- package/dist/parseSpEL.d.ts +3 -2
- package/dist/parseSpEL.js +7 -9
- package/dist/parseSpEL.js.map +1 -1
- package/dist/parseSpEL.mjs +272 -0
- package/dist/parseSpEL.mjs.map +1 -0
- package/dist/{prepareQueryObjects-BqFEs4eV.js → prepareQueryObjects-BOUWfel5.js} +4 -5
- package/dist/prepareQueryObjects-BOUWfel5.js.map +1 -0
- package/dist/prepareQueryObjects-CJNpnGcJ.mjs +153 -0
- package/dist/prepareQueryObjects-CJNpnGcJ.mjs.map +1 -0
- package/dist/query-builder-layout.css +1 -1
- package/dist/query-builder-layout.css.map +1 -1
- package/dist/query-builder.css +1 -1
- package/dist/query-builder.css.map +1 -1
- package/dist/react-querybuilder_core.d.mts +569 -1252
- package/dist/react-querybuilder_core.legacy-esm.d.ts +569 -1252
- package/dist/react-querybuilder_core.legacy-esm.js +430 -136
- package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_core.mjs +426 -141
- package/dist/react-querybuilder_core.mjs.map +1 -1
- package/dist/react-querybuilder_core.production.d.mts +569 -1252
- package/dist/react-querybuilder_core.production.mjs +1 -1
- package/dist/react-querybuilder_core.production.mjs.map +1 -1
- package/dist/styles/_layout.scss +61 -17
- package/dist/styles/_main.scss +17 -4
- package/dist/{transformQuery-FL_nlpp5.js → transformQuery-CWDPogO5.js} +1 -1
- package/dist/{transformQuery-FL_nlpp5.js.map → transformQuery-CWDPogO5.js.map} +1 -1
- package/dist/transformQuery-DHvtgDgZ.mjs +41 -0
- package/dist/transformQuery-DHvtgDgZ.mjs.map +1 -0
- package/dist/transformQuery.d.mts +118 -0
- package/dist/transformQuery.d.ts +1 -1
- package/dist/transformQuery.js +1 -1
- package/dist/transformQuery.mjs +4 -0
- package/package.json +78 -28
- package/dist/arrayUtils-D5EoIsKP.js +0 -164
- package/dist/arrayUtils-D5EoIsKP.js.map +0 -1
- package/dist/basic-C8xXKHIA.d.ts +0 -1235
- package/dist/objectUtils-BBZSfZJz.js +0 -17
- package/dist/objectUtils-BBZSfZJz.js.map +0 -1
- package/dist/optGroupUtils-CXLgyg2i.js.map +0 -1
- package/dist/prepareQueryObjects-BqFEs4eV.js.map +0 -1
|
@@ -65,6 +65,108 @@ const defaultPlaceholderValueLabel = defaultPlaceholderLabel;
|
|
|
65
65
|
*/
|
|
66
66
|
const defaultPlaceholderValueGroupLabel = defaultPlaceholderLabel;
|
|
67
67
|
/**
|
|
68
|
+
* Default configuration of translatable strings.
|
|
69
|
+
*
|
|
70
|
+
* @group Defaults
|
|
71
|
+
*/
|
|
72
|
+
const defaultTranslations = {
|
|
73
|
+
fields: {
|
|
74
|
+
title: "Field",
|
|
75
|
+
placeholderName: defaultPlaceholderFieldName,
|
|
76
|
+
placeholderLabel: defaultPlaceholderFieldLabel,
|
|
77
|
+
placeholderGroupLabel: defaultPlaceholderFieldGroupLabel
|
|
78
|
+
},
|
|
79
|
+
operators: {
|
|
80
|
+
title: "Operator",
|
|
81
|
+
placeholderName: defaultPlaceholderOperatorName,
|
|
82
|
+
placeholderLabel: defaultPlaceholderOperatorLabel,
|
|
83
|
+
placeholderGroupLabel: defaultPlaceholderOperatorGroupLabel
|
|
84
|
+
},
|
|
85
|
+
values: {
|
|
86
|
+
title: "Values",
|
|
87
|
+
placeholderName: defaultPlaceholderValueName,
|
|
88
|
+
placeholderLabel: defaultPlaceholderValueLabel,
|
|
89
|
+
placeholderGroupLabel: defaultPlaceholderValueGroupLabel
|
|
90
|
+
},
|
|
91
|
+
matchMode: { title: "Match mode" },
|
|
92
|
+
matchThreshold: { title: "Match threshold" },
|
|
93
|
+
value: { title: "Value" },
|
|
94
|
+
removeRule: {
|
|
95
|
+
label: "⨯",
|
|
96
|
+
title: "Remove rule"
|
|
97
|
+
},
|
|
98
|
+
removeGroup: {
|
|
99
|
+
label: "⨯",
|
|
100
|
+
title: "Remove group"
|
|
101
|
+
},
|
|
102
|
+
addRule: {
|
|
103
|
+
label: "+ Rule",
|
|
104
|
+
title: "Add rule"
|
|
105
|
+
},
|
|
106
|
+
addGroup: {
|
|
107
|
+
label: "+ Group",
|
|
108
|
+
title: "Add group"
|
|
109
|
+
},
|
|
110
|
+
combinators: { title: "Combinator" },
|
|
111
|
+
notToggle: {
|
|
112
|
+
label: "Not",
|
|
113
|
+
title: "Invert this group"
|
|
114
|
+
},
|
|
115
|
+
cloneRule: {
|
|
116
|
+
label: "⧉",
|
|
117
|
+
title: "Clone rule"
|
|
118
|
+
},
|
|
119
|
+
cloneRuleGroup: {
|
|
120
|
+
label: "⧉",
|
|
121
|
+
title: "Clone group"
|
|
122
|
+
},
|
|
123
|
+
shiftActionUp: {
|
|
124
|
+
label: "˄",
|
|
125
|
+
title: "Shift up"
|
|
126
|
+
},
|
|
127
|
+
shiftActionDown: {
|
|
128
|
+
label: "˅",
|
|
129
|
+
title: "Shift down"
|
|
130
|
+
},
|
|
131
|
+
dragHandle: {
|
|
132
|
+
label: "⁞⁞",
|
|
133
|
+
title: "Drag handle"
|
|
134
|
+
},
|
|
135
|
+
lockRule: {
|
|
136
|
+
label: "🔓",
|
|
137
|
+
title: "Lock rule"
|
|
138
|
+
},
|
|
139
|
+
lockGroup: {
|
|
140
|
+
label: "🔓",
|
|
141
|
+
title: "Lock group"
|
|
142
|
+
},
|
|
143
|
+
lockRuleDisabled: {
|
|
144
|
+
label: "🔒",
|
|
145
|
+
title: "Unlock rule"
|
|
146
|
+
},
|
|
147
|
+
lockGroupDisabled: {
|
|
148
|
+
label: "🔒",
|
|
149
|
+
title: "Unlock group"
|
|
150
|
+
},
|
|
151
|
+
muteRule: {
|
|
152
|
+
label: "🔊",
|
|
153
|
+
title: "Mute rule"
|
|
154
|
+
},
|
|
155
|
+
muteGroup: {
|
|
156
|
+
label: "🔊",
|
|
157
|
+
title: "Mute group"
|
|
158
|
+
},
|
|
159
|
+
unmuteRule: {
|
|
160
|
+
label: "🔇",
|
|
161
|
+
title: "Unmute rule"
|
|
162
|
+
},
|
|
163
|
+
unmuteGroup: {
|
|
164
|
+
label: "🔇",
|
|
165
|
+
title: "Unmute group"
|
|
166
|
+
},
|
|
167
|
+
valueSourceSelector: { title: "Value source" }
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
68
170
|
* Default character used to `.join` and `.split` arrays.
|
|
69
171
|
*
|
|
70
172
|
* @group Defaults
|
|
@@ -313,8 +415,11 @@ const standardClassnames = {
|
|
|
313
415
|
dndDropNotAllowed: "dndDropNotAllowed",
|
|
314
416
|
dragHandle: "queryBuilder-dragHandle",
|
|
315
417
|
disabled: "queryBuilder-disabled",
|
|
418
|
+
muted: "queryBuilder-muted",
|
|
316
419
|
lockRule: "rule-lock",
|
|
317
420
|
lockGroup: "ruleGroup-lock",
|
|
421
|
+
muteRule: "rule-mute",
|
|
422
|
+
muteGroup: "ruleGroup-mute",
|
|
318
423
|
valueSource: "rule-valueSource",
|
|
319
424
|
valueListItem: "rule-value-list-item",
|
|
320
425
|
branches: "queryBuilder-branches",
|
|
@@ -349,6 +454,9 @@ const defaultControlClassnames = {
|
|
|
349
454
|
dragHandle: "",
|
|
350
455
|
lockRule: "",
|
|
351
456
|
lockGroup: "",
|
|
457
|
+
muteRule: "",
|
|
458
|
+
muteGroup: "",
|
|
459
|
+
muted: "",
|
|
352
460
|
valueSource: "",
|
|
353
461
|
actionElement: "",
|
|
354
462
|
valueSelector: "",
|
|
@@ -399,6 +507,8 @@ const TestID = {
|
|
|
399
507
|
dragHandle: "drag-handle",
|
|
400
508
|
lockRule: "lock-rule",
|
|
401
509
|
lockGroup: "lock-group",
|
|
510
|
+
muteRule: "mute-rule",
|
|
511
|
+
muteGroup: "mute-group",
|
|
402
512
|
valueSourceSelector: "value-source-selector",
|
|
403
513
|
matchModeEditor: "match-mode-editor"
|
|
404
514
|
};
|
|
@@ -498,6 +608,11 @@ function toVal(mix) {
|
|
|
498
608
|
}
|
|
499
609
|
return str;
|
|
500
610
|
}
|
|
611
|
+
/**
|
|
612
|
+
* Vendored/adapted version of the `clsx` package.
|
|
613
|
+
*
|
|
614
|
+
* **NOTE:** Prefer the official package from npm outside the context of React Query Builder.
|
|
615
|
+
*/
|
|
501
616
|
// istanbul ignore next
|
|
502
617
|
function clsx(...args) {
|
|
503
618
|
let i = 0;
|
|
@@ -536,6 +651,10 @@ const nullOrUndefinedOrEmpty = (value) => value === null || value === void 0 ||
|
|
|
536
651
|
//#endregion
|
|
537
652
|
//#region src/utils/isRuleGroup.ts
|
|
538
653
|
/**
|
|
654
|
+
* Determines if an object is a {@link RuleType} (only checks for a `field` property).
|
|
655
|
+
*/
|
|
656
|
+
const isRuleType = (s) => isPojo(s) && "field" in s && typeof s.field === "string";
|
|
657
|
+
/**
|
|
539
658
|
* Determines if an object is a {@link RuleGroupType} or {@link RuleGroupTypeIC}.
|
|
540
659
|
*/
|
|
541
660
|
const isRuleGroup = (rg) => isPojo(rg) && Array.isArray(rg.rules);
|
|
@@ -658,6 +777,21 @@ const defaultValidator = (query) => {
|
|
|
658
777
|
return result;
|
|
659
778
|
};
|
|
660
779
|
|
|
780
|
+
//#endregion
|
|
781
|
+
//#region src/utils/objectUtils.ts
|
|
782
|
+
/**
|
|
783
|
+
* A strongly-typed version of `Object.keys()`.
|
|
784
|
+
*
|
|
785
|
+
* [Original source](https://github.com/sindresorhus/ts-extras/blob/44f57392c5f027268330771996c4fdf9260b22d6/source/object-keys.ts)
|
|
786
|
+
*/
|
|
787
|
+
const objectKeys = Object.keys;
|
|
788
|
+
/**
|
|
789
|
+
* A strongly-typed version of `Object.entries()`.
|
|
790
|
+
*
|
|
791
|
+
* [Original source](https://github.com/sindresorhus/ts-extras/blob/44f57392c5f027268330771996c4fdf9260b22d6/source/object-entries.ts)
|
|
792
|
+
*/
|
|
793
|
+
const objectEntries = Object.entries;
|
|
794
|
+
|
|
661
795
|
//#endregion
|
|
662
796
|
//#region src/utils/optGroupUtils.ts
|
|
663
797
|
const isOptionWithName = (opt) => isPojo(opt) && "name" in opt && typeof opt.name === "string";
|
|
@@ -834,6 +968,42 @@ const uniqOptList = (originalArray) => {
|
|
|
834
968
|
if (isFlexibleOptionGroupArray(originalArray)) return uniqOptGroups(originalArray);
|
|
835
969
|
return uniqByIdentifier(originalArray.map((o) => toFullOption(o)));
|
|
836
970
|
};
|
|
971
|
+
const prepareOptionList = (props) => {
|
|
972
|
+
// istanbul ignore next
|
|
973
|
+
const { optionList: optionListPropOriginal, baseOption = {}, labelMap = {}, placeholder: { placeholderName = defaultPlaceholderName, placeholderLabel = defaultPlaceholderLabel, placeholderGroupLabel = defaultPlaceholderLabel } = {}, autoSelectOption = true } = props;
|
|
974
|
+
const defaultOption = {
|
|
975
|
+
id: placeholderName,
|
|
976
|
+
name: placeholderName,
|
|
977
|
+
value: placeholderName,
|
|
978
|
+
label: placeholderLabel
|
|
979
|
+
};
|
|
980
|
+
const optionsProp = optionListPropOriginal ?? [defaultOption];
|
|
981
|
+
let optionList = [];
|
|
982
|
+
const opts = Array.isArray(optionsProp) ? toFullOptionList(optionsProp, baseOption, labelMap) : objectKeys(toFullOptionMap(optionsProp, baseOption)).map((opt) => ({
|
|
983
|
+
...optionsProp[opt],
|
|
984
|
+
name: opt,
|
|
985
|
+
value: opt
|
|
986
|
+
})).sort((a, b) => a.label.localeCompare(b.label));
|
|
987
|
+
if (isFlexibleOptionGroupArray(opts)) optionList = autoSelectOption ? uniqOptGroups(opts) : uniqOptGroups([{
|
|
988
|
+
label: placeholderGroupLabel,
|
|
989
|
+
options: [defaultOption]
|
|
990
|
+
}, ...opts]);
|
|
991
|
+
else optionList = autoSelectOption ? uniqByIdentifier(opts) : uniqByIdentifier([defaultOption, ...opts]);
|
|
992
|
+
let optionsMap = {};
|
|
993
|
+
if (!Array.isArray(optionsProp)) {
|
|
994
|
+
const op = toFullOptionMap(optionsProp, baseOption);
|
|
995
|
+
optionsMap = autoSelectOption ? op : {
|
|
996
|
+
...op,
|
|
997
|
+
[placeholderName]: defaultOption
|
|
998
|
+
};
|
|
999
|
+
} else if (isFlexibleOptionGroupArray(optionList)) for (const og of optionList) for (const opt of og.options) optionsMap[opt.value ?? opt.name] = toFullOption(opt, baseOption);
|
|
1000
|
+
else for (const opt of optionList) optionsMap[opt.value ?? opt.name] = toFullOption(opt, baseOption);
|
|
1001
|
+
return {
|
|
1002
|
+
defaultOption,
|
|
1003
|
+
optionList,
|
|
1004
|
+
optionsMap
|
|
1005
|
+
};
|
|
1006
|
+
};
|
|
837
1007
|
|
|
838
1008
|
//#endregion
|
|
839
1009
|
//#region src/utils/filterFieldsByComparator.ts
|
|
@@ -935,9 +1105,11 @@ function transformQuery(query, options = {}) {
|
|
|
935
1105
|
const isValidationResult = (vr) => isPojo(vr) && typeof vr.valid === "boolean";
|
|
936
1106
|
/**
|
|
937
1107
|
* Determines if a rule or group is valid based on a validation result (if defined)
|
|
938
|
-
* or a validator function. Returns `true` if neither are defined
|
|
1108
|
+
* or a validator function. Returns `true` if neither are defined and the `muted`
|
|
1109
|
+
* property is not `true`.
|
|
939
1110
|
*/
|
|
940
1111
|
const isRuleOrGroupValid = (rg, validationResult, validator) => {
|
|
1112
|
+
if (rg.muted) return false;
|
|
941
1113
|
if (typeof validationResult === "boolean") return validationResult;
|
|
942
1114
|
if (isValidationResult(validationResult)) return validationResult.valid;
|
|
943
1115
|
if (typeof validator === "function" && !isRuleGroup(rg)) {
|
|
@@ -1211,19 +1383,45 @@ const defaultRuleGroupProcessorCEL = (ruleGroup, options) => {
|
|
|
1211
1383
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1212
1384
|
const processRuleGroup = (rg, outermost) => {
|
|
1213
1385
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermost ? fallbackExpression : "";
|
|
1214
|
-
const
|
|
1215
|
-
|
|
1216
|
-
|
|
1386
|
+
const processedRules = [];
|
|
1387
|
+
let precedingCombinator = "";
|
|
1388
|
+
let firstRule = true;
|
|
1389
|
+
for (const rule of rg.rules) {
|
|
1390
|
+
if (typeof rule === "string") {
|
|
1391
|
+
precedingCombinator = celCombinatorMap[rule];
|
|
1392
|
+
continue;
|
|
1393
|
+
}
|
|
1394
|
+
if (isRuleGroup(rule)) {
|
|
1395
|
+
const processedGroup = processRuleGroup(rule);
|
|
1396
|
+
if (processedGroup) {
|
|
1397
|
+
if (!firstRule && precedingCombinator) {
|
|
1398
|
+
processedRules.push(precedingCombinator);
|
|
1399
|
+
precedingCombinator = "";
|
|
1400
|
+
}
|
|
1401
|
+
firstRule = false;
|
|
1402
|
+
processedRules.push(processedGroup);
|
|
1403
|
+
}
|
|
1404
|
+
continue;
|
|
1405
|
+
}
|
|
1217
1406
|
const [validationResult, fieldValidator] = validateRule(rule);
|
|
1218
|
-
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName)
|
|
1407
|
+
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName) continue;
|
|
1219
1408
|
const fieldData = getOption(fields, rule.field);
|
|
1220
|
-
|
|
1409
|
+
const processedRule = ruleProcessor(rule, {
|
|
1221
1410
|
...options,
|
|
1222
1411
|
parseNumbers: getParseNumberBoolean(fieldData?.inputType),
|
|
1223
1412
|
escapeQuotes: (rule.valueSource ?? "value") === "value",
|
|
1224
1413
|
fieldData
|
|
1225
1414
|
});
|
|
1226
|
-
|
|
1415
|
+
if (processedRule) {
|
|
1416
|
+
if (!firstRule && precedingCombinator) {
|
|
1417
|
+
processedRules.push(precedingCombinator);
|
|
1418
|
+
precedingCombinator = "";
|
|
1419
|
+
}
|
|
1420
|
+
firstRule = false;
|
|
1421
|
+
processedRules.push(processedRule);
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
const expression = processedRules.join(isRuleGroupType(rg) ? ` ${celCombinatorMap[rg.combinator]} ` : " ");
|
|
1227
1425
|
const [prefix, suffix] = rg.not || !outermost ? [`${rg.not ? "!" : ""}(`, ")"] : ["", ""];
|
|
1228
1426
|
return expression ? `${prefix}${expression}${suffix}` : fallbackExpression;
|
|
1229
1427
|
};
|
|
@@ -1250,11 +1448,10 @@ const defaultRuleProcessorCEL = (rule, opts = {}) => {
|
|
|
1250
1448
|
else if (matchEval) {
|
|
1251
1449
|
const { mode, threshold } = matchEval;
|
|
1252
1450
|
const arrayElementAlias = "elem_alias";
|
|
1253
|
-
const
|
|
1451
|
+
const nestedArrayFilter = defaultRuleGroupProcessorCEL(transformQuery(rule.value, { ruleProcessor: (r) => ({
|
|
1254
1452
|
...r,
|
|
1255
1453
|
field: `${arrayElementAlias}${r.field ? `.${r.field}` : ""}`
|
|
1256
|
-
}) });
|
|
1257
|
-
const nestedArrayFilter = defaultRuleGroupProcessorCEL(celQuery, opts);
|
|
1454
|
+
}) }), opts);
|
|
1258
1455
|
switch (mode) {
|
|
1259
1456
|
case "all": return `${field}.all(${arrayElementAlias}, ${nestedArrayFilter})`;
|
|
1260
1457
|
case "none":
|
|
@@ -1288,8 +1485,7 @@ const defaultRuleProcessorCEL = (rule, opts = {}) => {
|
|
|
1288
1485
|
case "in":
|
|
1289
1486
|
case "notin": {
|
|
1290
1487
|
const [prefix, suffix] = shouldNegate$2(operatorTL) ? ["!(", ")"] : ["", ""];
|
|
1291
|
-
|
|
1292
|
-
return `${prefix}${field} in [${valueAsArray.map((val) => valueIsField || shouldRenderAsNumber(val, parseNumbers) ? `${trimIfString(val)}` : `"${escapeDoubleQuotes(val, escapeQuotes)}"`).join(", ")}]${suffix}`;
|
|
1488
|
+
return `${prefix}${field} in [${toArray(value).map((val) => valueIsField || shouldRenderAsNumber(val, parseNumbers) ? `${trimIfString(val)}` : `"${escapeDoubleQuotes(val, escapeQuotes)}"`).join(", ")}]${suffix}`;
|
|
1293
1489
|
}
|
|
1294
1490
|
case "between":
|
|
1295
1491
|
case "notbetween": {
|
|
@@ -1509,19 +1705,45 @@ const defaultRuleGroupProcessorSpEL = (ruleGroup, options) => {
|
|
|
1509
1705
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1510
1706
|
const processRuleGroup = (rg, outermost) => {
|
|
1511
1707
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermost ? fallbackExpression : "";
|
|
1512
|
-
const
|
|
1513
|
-
|
|
1514
|
-
|
|
1708
|
+
const processedRules = [];
|
|
1709
|
+
let precedingCombinator = "";
|
|
1710
|
+
let firstRule = true;
|
|
1711
|
+
for (const rule of rg.rules) {
|
|
1712
|
+
if (typeof rule === "string") {
|
|
1713
|
+
precedingCombinator = rule;
|
|
1714
|
+
continue;
|
|
1715
|
+
}
|
|
1716
|
+
if (isRuleGroup(rule)) {
|
|
1717
|
+
const processedGroup = processRuleGroup(rule);
|
|
1718
|
+
if (processedGroup) {
|
|
1719
|
+
if (!firstRule && precedingCombinator) {
|
|
1720
|
+
processedRules.push(precedingCombinator);
|
|
1721
|
+
precedingCombinator = "";
|
|
1722
|
+
}
|
|
1723
|
+
firstRule = false;
|
|
1724
|
+
processedRules.push(processedGroup);
|
|
1725
|
+
}
|
|
1726
|
+
continue;
|
|
1727
|
+
}
|
|
1515
1728
|
const [validationResult, fieldValidator] = validateRule(rule);
|
|
1516
|
-
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName)
|
|
1729
|
+
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName) continue;
|
|
1517
1730
|
const fieldData = getOption(fields, rule.field);
|
|
1518
|
-
|
|
1731
|
+
const processedRule = ruleProcessor(rule, {
|
|
1519
1732
|
...options,
|
|
1520
1733
|
parseNumbers: getParseNumberBoolean(fieldData?.inputType),
|
|
1521
1734
|
escapeQuotes: (rule.valueSource ?? "value") === "value",
|
|
1522
1735
|
fieldData
|
|
1523
1736
|
});
|
|
1524
|
-
|
|
1737
|
+
if (processedRule) {
|
|
1738
|
+
if (!firstRule && precedingCombinator) {
|
|
1739
|
+
processedRules.push(precedingCombinator);
|
|
1740
|
+
precedingCombinator = "";
|
|
1741
|
+
}
|
|
1742
|
+
firstRule = false;
|
|
1743
|
+
processedRules.push(processedRule);
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
const expression = processedRules.join(isRuleGroupType(rg) ? ` ${rg.combinator} ` : " ");
|
|
1525
1747
|
const [prefix, suffix] = rg.not || !outermost ? [`${rg.not ? "!" : ""}(`, ")"] : ["", ""];
|
|
1526
1748
|
return expression ? `${prefix}${expression}${suffix}` : fallbackExpression;
|
|
1527
1749
|
};
|
|
@@ -1577,15 +1799,9 @@ const defaultRuleProcessorSpEL = (rule, opts = {}) => {
|
|
|
1577
1799
|
case "contains":
|
|
1578
1800
|
case "doesnotcontain": return wrapInNegation(`${field} matches ${valueIsField || useBareValue ? trimIfString(value) : `'${escapeSingleQuotes(value, escapeQuotes)}'`}`, shouldNegate$1(operatorTL));
|
|
1579
1801
|
case "beginswith":
|
|
1580
|
-
case "doesnotbeginwith": {
|
|
1581
|
-
const valueTL = valueIsField ? `'^'.concat(${trimIfString(value)})` : `'${typeof value === "string" && !value.startsWith("^") || useBareValue ? "^" : ""}${escapeSingleQuotes(value, escapeQuotes)}'`;
|
|
1582
|
-
return wrapInNegation(`${field} matches ${valueTL}`, shouldNegate$1(operatorTL));
|
|
1583
|
-
}
|
|
1802
|
+
case "doesnotbeginwith": return wrapInNegation(`${field} matches ${valueIsField ? `'^'.concat(${trimIfString(value)})` : `'${typeof value === "string" && !value.startsWith("^") || useBareValue ? "^" : ""}${escapeSingleQuotes(value, escapeQuotes)}'`}`, shouldNegate$1(operatorTL));
|
|
1584
1803
|
case "endswith":
|
|
1585
|
-
case "doesnotendwith": {
|
|
1586
|
-
const valueTL = valueIsField ? `${trimIfString(value)}.concat('$')` : `'${escapeSingleQuotes(value, escapeQuotes)}${typeof value === "string" && !value.endsWith("$") || useBareValue ? "$" : ""}'`;
|
|
1587
|
-
return wrapInNegation(`${field} matches ${valueTL}`, shouldNegate$1(operatorTL));
|
|
1588
|
-
}
|
|
1804
|
+
case "doesnotendwith": return wrapInNegation(`${field} matches ${valueIsField ? `${trimIfString(value)}.concat('$')` : `'${escapeSingleQuotes(value, escapeQuotes)}${typeof value === "string" && !value.endsWith("$") || useBareValue ? "$" : ""}'`}`, shouldNegate$1(operatorTL));
|
|
1589
1805
|
case "null": return `${field} == null`;
|
|
1590
1806
|
case "notnull": return `${field} != null`;
|
|
1591
1807
|
case "in":
|
|
@@ -1698,11 +1914,10 @@ const defaultRuleProcessorDrizzle = (rule, _options) => {
|
|
|
1698
1914
|
if (opts.preset !== "postgresql") return;
|
|
1699
1915
|
const { mode, threshold } = matchEval;
|
|
1700
1916
|
const arrayElementAlias = "elem_alias";
|
|
1701
|
-
const
|
|
1917
|
+
const nestedArrayFilter = defaultRuleGroupProcessorDrizzle(transformQuery(rule.value, { ruleProcessor: (r) => ({
|
|
1702
1918
|
...r,
|
|
1703
1919
|
field: arrayElementAlias
|
|
1704
|
-
}) })
|
|
1705
|
-
const nestedArrayFilter = defaultRuleGroupProcessorDrizzle(sqlQuery, {
|
|
1920
|
+
}) }), {
|
|
1706
1921
|
...opts,
|
|
1707
1922
|
context: {
|
|
1708
1923
|
...opts.context,
|
|
@@ -1788,7 +2003,6 @@ const defaultRuleGroupProcessorDrizzle = (ruleGroup, options, _meta) => (columns
|
|
|
1788
2003
|
const { fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, validateRule, validationMap } = options;
|
|
1789
2004
|
if (!columns || !drizzleOperators) return;
|
|
1790
2005
|
const { and, not, or } = drizzleOperators;
|
|
1791
|
-
const query = isRuleGroupType(ruleGroup) ? ruleGroup : convertFromIC(ruleGroup);
|
|
1792
2006
|
const ruleProcessor = defaultRuleProcessorDrizzle;
|
|
1793
2007
|
const processRuleGroup = (rg, _outermost) => {
|
|
1794
2008
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return;
|
|
@@ -1812,7 +2026,7 @@ const defaultRuleGroupProcessorDrizzle = (ruleGroup, options, _meta) => (columns
|
|
|
1812
2026
|
const ruleGroupSQL = rg.combinator === "or" ? or(...processedRules) : and(...processedRules);
|
|
1813
2027
|
return rg.not ? not(ruleGroupSQL) : ruleGroupSQL;
|
|
1814
2028
|
};
|
|
1815
|
-
return processRuleGroup(
|
|
2029
|
+
return processRuleGroup(convertFromIC(ruleGroup), true);
|
|
1816
2030
|
};
|
|
1817
2031
|
|
|
1818
2032
|
//#endregion
|
|
@@ -1824,7 +2038,6 @@ const defaultRuleGroupProcessorDrizzle = (ruleGroup, options, _meta) => (columns
|
|
|
1824
2038
|
*/
|
|
1825
2039
|
const defaultRuleGroupProcessorElasticSearch = (ruleGroup, options) => {
|
|
1826
2040
|
const { fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1827
|
-
const query = convertFromIC(ruleGroup);
|
|
1828
2041
|
const processRuleGroup = (rg) => {
|
|
1829
2042
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return false;
|
|
1830
2043
|
const processedRules = rg.rules.map((rule) => {
|
|
@@ -1841,7 +2054,7 @@ const defaultRuleGroupProcessorElasticSearch = (ruleGroup, options) => {
|
|
|
1841
2054
|
if (processedRules.length === 0) return false;
|
|
1842
2055
|
return { bool: rg.not ? { must_not: /^or$/i.test(rg.combinator) ? { bool: { should: processedRules } } : processedRules } : { [/^or$/i.test(rg.combinator) ? "should" : "must"]: processedRules } };
|
|
1843
2056
|
};
|
|
1844
|
-
const processedRuleGroup = processRuleGroup(
|
|
2057
|
+
const processedRuleGroup = processRuleGroup(convertFromIC(ruleGroup));
|
|
1845
2058
|
return processedRuleGroup === false ? {} : processedRuleGroup;
|
|
1846
2059
|
};
|
|
1847
2060
|
|
|
@@ -1856,19 +2069,45 @@ const defaultRuleGroupProcessorJSONata = (ruleGroup, options) => {
|
|
|
1856
2069
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1857
2070
|
const processRuleGroup = (rg, outermost) => {
|
|
1858
2071
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermost ? fallbackExpression : "";
|
|
1859
|
-
const
|
|
1860
|
-
|
|
1861
|
-
|
|
2072
|
+
const processedRules = [];
|
|
2073
|
+
let precedingCombinator = "";
|
|
2074
|
+
let firstRule = true;
|
|
2075
|
+
for (const rule of rg.rules) {
|
|
2076
|
+
if (typeof rule === "string") {
|
|
2077
|
+
precedingCombinator = rule;
|
|
2078
|
+
continue;
|
|
2079
|
+
}
|
|
2080
|
+
if (isRuleGroup(rule)) {
|
|
2081
|
+
const processedGroup = processRuleGroup(rule);
|
|
2082
|
+
if (processedGroup) {
|
|
2083
|
+
if (!firstRule && precedingCombinator) {
|
|
2084
|
+
processedRules.push(precedingCombinator);
|
|
2085
|
+
precedingCombinator = "";
|
|
2086
|
+
}
|
|
2087
|
+
firstRule = false;
|
|
2088
|
+
processedRules.push(processedGroup);
|
|
2089
|
+
}
|
|
2090
|
+
continue;
|
|
2091
|
+
}
|
|
1862
2092
|
const [validationResult, fieldValidator] = validateRule(rule);
|
|
1863
|
-
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName)
|
|
2093
|
+
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName) continue;
|
|
1864
2094
|
const fieldData = getOption(fields, rule.field);
|
|
1865
|
-
|
|
2095
|
+
const processedRule = ruleProcessor(rule, {
|
|
1866
2096
|
...options,
|
|
1867
2097
|
parseNumbers: getParseNumberBoolean(fieldData?.inputType),
|
|
1868
2098
|
escapeQuotes: (rule.valueSource ?? "value") === "value",
|
|
1869
2099
|
fieldData
|
|
1870
2100
|
});
|
|
1871
|
-
|
|
2101
|
+
if (processedRule) {
|
|
2102
|
+
if (!firstRule && precedingCombinator) {
|
|
2103
|
+
processedRules.push(precedingCombinator);
|
|
2104
|
+
precedingCombinator = "";
|
|
2105
|
+
}
|
|
2106
|
+
firstRule = false;
|
|
2107
|
+
processedRules.push(processedRule);
|
|
2108
|
+
}
|
|
2109
|
+
}
|
|
2110
|
+
const expression = processedRules.join(isRuleGroupType(rg) ? ` ${rg.combinator} ` : " ");
|
|
1872
2111
|
const [prefix, suffix] = rg.not || !outermost ? [`${rg.not ? "$not" : ""}(`, ")"] : ["", ""];
|
|
1873
2112
|
return expression ? `${prefix}${expression}${suffix}` : fallbackExpression;
|
|
1874
2113
|
};
|
|
@@ -1914,7 +2153,6 @@ const defaultRuleGroupProcessorJsonLogic = (ruleGroup, options) => {
|
|
|
1914
2153
|
*/
|
|
1915
2154
|
const defaultRuleGroupProcessorLDAP = (ruleGroup, options) => {
|
|
1916
2155
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1917
|
-
const query = convertFromIC(ruleGroup);
|
|
1918
2156
|
const processRuleGroup = (rg, outermost) => {
|
|
1919
2157
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermost ? fallbackExpression : "";
|
|
1920
2158
|
const rules = rg.rules.map((rule) => {
|
|
@@ -1934,7 +2172,7 @@ const defaultRuleGroupProcessorLDAP = (ruleGroup, options) => {
|
|
|
1934
2172
|
const [prefix, suffix] = rules.length > 1 ? [`${notPrefix}(${rg.combinator === "or" ? "|" : "&"}`, `)${notSuffix}`] : [notPrefix, notSuffix];
|
|
1935
2173
|
return expression ? `${prefix}${expression}${suffix}` : fallbackExpression;
|
|
1936
2174
|
};
|
|
1937
|
-
return processRuleGroup(
|
|
2175
|
+
return processRuleGroup(convertFromIC(ruleGroup), true);
|
|
1938
2176
|
};
|
|
1939
2177
|
|
|
1940
2178
|
//#endregion
|
|
@@ -1989,20 +2227,46 @@ const defaultRuleGroupProcessorNL = (ruleGroup, options) => {
|
|
|
1989
2227
|
const processRuleGroup = (rg, outermostOrLonelyInGroup) => {
|
|
1990
2228
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : "";
|
|
1991
2229
|
const rg2 = isRuleGroupTypeIC(rg) && rg.rules.some((r) => typeof r === "string" && lc(r) === "xor") ? convertFromIC(rg) : rg;
|
|
1992
|
-
const processedRules =
|
|
1993
|
-
|
|
1994
|
-
|
|
2230
|
+
const processedRules = [];
|
|
2231
|
+
let precedingCombinator = "";
|
|
2232
|
+
let firstRule = true;
|
|
2233
|
+
for (const rule of rg2.rules) {
|
|
2234
|
+
if (typeof rule === "string") {
|
|
2235
|
+
precedingCombinator = `, ${translations[rule] ?? rule} `;
|
|
2236
|
+
continue;
|
|
2237
|
+
}
|
|
2238
|
+
if (isRuleGroup(rule)) {
|
|
2239
|
+
const processedGroup = processRuleGroup(rule, rg2.rules.length === 1 && !(rg2.not || /^xor$/i.test(rg2.combinator ?? "")));
|
|
2240
|
+
// istanbul ignore else
|
|
2241
|
+
if (processedGroup) {
|
|
2242
|
+
if (!firstRule && precedingCombinator) {
|
|
2243
|
+
processedRules.push(precedingCombinator);
|
|
2244
|
+
precedingCombinator = "";
|
|
2245
|
+
}
|
|
2246
|
+
firstRule = false;
|
|
2247
|
+
processedRules.push(processedGroup);
|
|
2248
|
+
}
|
|
2249
|
+
continue;
|
|
2250
|
+
}
|
|
1995
2251
|
const [validationResult, fieldValidator] = validateRule(rule);
|
|
1996
|
-
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName)
|
|
2252
|
+
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName) continue;
|
|
1997
2253
|
const escapeQuotes = (rule.valueSource ?? "value") === "value";
|
|
1998
2254
|
const fieldData = getOption(fields, rule.field);
|
|
1999
|
-
|
|
2255
|
+
const processedRule = ruleProcessor(rule, {
|
|
2000
2256
|
...options,
|
|
2001
2257
|
parseNumbers: getParseNumberBoolean(fieldData?.inputType),
|
|
2002
2258
|
escapeQuotes,
|
|
2003
2259
|
fieldData
|
|
2004
2260
|
});
|
|
2005
|
-
|
|
2261
|
+
if (processedRule) {
|
|
2262
|
+
if (!firstRule && precedingCombinator) {
|
|
2263
|
+
processedRules.push(precedingCombinator);
|
|
2264
|
+
precedingCombinator = "";
|
|
2265
|
+
}
|
|
2266
|
+
firstRule = false;
|
|
2267
|
+
processedRules.push(processedRule);
|
|
2268
|
+
}
|
|
2269
|
+
}
|
|
2006
2270
|
if (processedRules.length === 0) return fallbackExpression;
|
|
2007
2271
|
const isXOR = lc(rg2.combinator ?? "") === "xor";
|
|
2008
2272
|
const combinator = isXOR ? rg2.combinator.slice(1) : rg2.combinator;
|
|
@@ -2010,7 +2274,7 @@ const defaultRuleGroupProcessorNL = (ruleGroup, options) => {
|
|
|
2010
2274
|
const [prefixTL, suffixTL] = ["groupPrefix", "groupSuffix"].map((key) => rg2.not ? isXOR ? getNLTranslataion(key, translations, ["not", "xor"]) : getNLTranslataion(key, translations, ["not"]) : isXOR ? getNLTranslataion(key, translations, ["xor"]) : getNLTranslataion(key, translations));
|
|
2011
2275
|
const prefix = mustWrap ? `${prefixTL} (`.trim() : "";
|
|
2012
2276
|
const suffix = mustWrap ? `) ${suffixTL}`.trim() : "";
|
|
2013
|
-
return `${prefix}${processedRules.
|
|
2277
|
+
return `${prefix}${processedRules.join(isRuleGroupType(rg2) ? `, ${translations[combinator] ?? combinator} ` : "")}${suffix}`;
|
|
2014
2278
|
};
|
|
2015
2279
|
return processRuleGroup(ruleGroup, true);
|
|
2016
2280
|
};
|
|
@@ -2060,11 +2324,37 @@ const defaultRuleGroupProcessorParameterized = (ruleGroup, options) => {
|
|
|
2060
2324
|
};
|
|
2061
2325
|
const processRuleGroup = (rg, outermostOrLonelyInGroup) => {
|
|
2062
2326
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : "";
|
|
2063
|
-
const processedRules =
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2327
|
+
const processedRules = [];
|
|
2328
|
+
let precedingCombinator = "";
|
|
2329
|
+
let firstRule = true;
|
|
2330
|
+
for (const rule of rg.rules) {
|
|
2331
|
+
if (typeof rule === "string") {
|
|
2332
|
+
precedingCombinator = rule;
|
|
2333
|
+
continue;
|
|
2334
|
+
}
|
|
2335
|
+
if (isRuleGroup(rule)) {
|
|
2336
|
+
const processedGroup = processRuleGroup(rule, rg.rules.length === 1);
|
|
2337
|
+
// istanbul ignore else
|
|
2338
|
+
if (processedGroup) {
|
|
2339
|
+
if (!firstRule && precedingCombinator) {
|
|
2340
|
+
processedRules.push(precedingCombinator);
|
|
2341
|
+
precedingCombinator = "";
|
|
2342
|
+
}
|
|
2343
|
+
firstRule = false;
|
|
2344
|
+
processedRules.push(processedGroup);
|
|
2345
|
+
}
|
|
2346
|
+
continue;
|
|
2347
|
+
}
|
|
2348
|
+
const processedRule = processRule(rule);
|
|
2349
|
+
if (processedRule) {
|
|
2350
|
+
if (!firstRule && precedingCombinator) {
|
|
2351
|
+
processedRules.push(precedingCombinator);
|
|
2352
|
+
precedingCombinator = "";
|
|
2353
|
+
}
|
|
2354
|
+
firstRule = false;
|
|
2355
|
+
processedRules.push(processedRule);
|
|
2356
|
+
}
|
|
2357
|
+
}
|
|
2068
2358
|
if (processedRules.length === 0) return fallbackExpression;
|
|
2069
2359
|
return `${rg.not ? "NOT " : ""}(${processedRules.join(isRuleGroupType(rg) ? ` ${rg.combinator} ` : " ")})`;
|
|
2070
2360
|
};
|
|
@@ -2173,20 +2463,46 @@ const defaultRuleGroupProcessorSQL = (ruleGroup, options) => {
|
|
|
2173
2463
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
2174
2464
|
const processRuleGroup = (rg, outermostOrLonelyInGroup) => {
|
|
2175
2465
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : "";
|
|
2176
|
-
const processedRules =
|
|
2177
|
-
|
|
2178
|
-
|
|
2466
|
+
const processedRules = [];
|
|
2467
|
+
let precedingCombinator = "";
|
|
2468
|
+
let firstRule = true;
|
|
2469
|
+
for (const rule of rg.rules) {
|
|
2470
|
+
if (typeof rule === "string") {
|
|
2471
|
+
precedingCombinator = rule;
|
|
2472
|
+
continue;
|
|
2473
|
+
}
|
|
2474
|
+
if (isRuleGroup(rule)) {
|
|
2475
|
+
const processedGroup = processRuleGroup(rule, rg.rules.length === 1);
|
|
2476
|
+
// istanbul ignore else
|
|
2477
|
+
if (processedGroup) {
|
|
2478
|
+
if (!firstRule && precedingCombinator) {
|
|
2479
|
+
processedRules.push(precedingCombinator);
|
|
2480
|
+
precedingCombinator = "";
|
|
2481
|
+
}
|
|
2482
|
+
firstRule = false;
|
|
2483
|
+
processedRules.push(processedGroup);
|
|
2484
|
+
}
|
|
2485
|
+
continue;
|
|
2486
|
+
}
|
|
2179
2487
|
const [validationResult, fieldValidator] = validateRule(rule);
|
|
2180
|
-
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName)
|
|
2488
|
+
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName) continue;
|
|
2181
2489
|
const escapeQuotes = (rule.valueSource ?? "value") === "value";
|
|
2182
2490
|
const fieldData = getOption(fields, rule.field);
|
|
2183
|
-
|
|
2491
|
+
const processedRule = ruleProcessor(rule, {
|
|
2184
2492
|
...options,
|
|
2185
2493
|
parseNumbers: getParseNumberBoolean(fieldData?.inputType),
|
|
2186
2494
|
escapeQuotes,
|
|
2187
2495
|
fieldData
|
|
2188
2496
|
});
|
|
2189
|
-
|
|
2497
|
+
if (processedRule) {
|
|
2498
|
+
if (!firstRule && precedingCombinator) {
|
|
2499
|
+
processedRules.push(precedingCombinator);
|
|
2500
|
+
precedingCombinator = "";
|
|
2501
|
+
}
|
|
2502
|
+
firstRule = false;
|
|
2503
|
+
processedRules.push(processedRule);
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2190
2506
|
if (processedRules.length === 0) return fallbackExpression;
|
|
2191
2507
|
return `${rg.not ? "NOT " : ""}(${processedRules.join(isRuleGroupType(rg) ? ` ${rg.combinator} ` : " ")})`;
|
|
2192
2508
|
};
|
|
@@ -2464,10 +2780,7 @@ const defaultRuleProcessorJsonLogic = (rule, options = {}) => {
|
|
|
2464
2780
|
case "null":
|
|
2465
2781
|
case "notnull": return { [`${operatorLC === "notnull" ? "!" : "="}=`]: [fieldObject, null] };
|
|
2466
2782
|
case "in":
|
|
2467
|
-
case "notin": {
|
|
2468
|
-
const valueAsArray = toArray(value).map((v) => fieldOrNumberRenderer(v));
|
|
2469
|
-
return negateIfNotOp(operatorLC, { in: [fieldObject, valueAsArray] });
|
|
2470
|
-
}
|
|
2783
|
+
case "notin": return negateIfNotOp(operatorLC, { in: [fieldObject, toArray(value).map((v) => fieldOrNumberRenderer(v))] });
|
|
2471
2784
|
case "between":
|
|
2472
2785
|
case "notbetween": {
|
|
2473
2786
|
const valueAsArray = toArray(value);
|
|
@@ -2498,20 +2811,11 @@ const defaultRuleProcessorJsonLogic = (rule, options = {}) => {
|
|
|
2498
2811
|
return false;
|
|
2499
2812
|
}
|
|
2500
2813
|
case "contains":
|
|
2501
|
-
case "doesnotcontain": {
|
|
2502
|
-
const jsonRule = { in: [fieldOrNumberRenderer(value), fieldObject] };
|
|
2503
|
-
return negateIfNotOp(operatorLC, jsonRule);
|
|
2504
|
-
}
|
|
2814
|
+
case "doesnotcontain": return negateIfNotOp(operatorLC, { in: [fieldOrNumberRenderer(value), fieldObject] });
|
|
2505
2815
|
case "beginswith":
|
|
2506
|
-
case "doesnotbeginwith": {
|
|
2507
|
-
const jsonRule = { startsWith: [fieldObject, fieldOrNumberRenderer(value)] };
|
|
2508
|
-
return negateIfNotOp(operatorLC, jsonRule);
|
|
2509
|
-
}
|
|
2816
|
+
case "doesnotbeginwith": return negateIfNotOp(operatorLC, { startsWith: [fieldObject, fieldOrNumberRenderer(value)] });
|
|
2510
2817
|
case "endswith":
|
|
2511
|
-
case "doesnotendwith": {
|
|
2512
|
-
const jsonRule = { endsWith: [fieldObject, fieldOrNumberRenderer(value)] };
|
|
2513
|
-
return negateIfNotOp(operatorLC, jsonRule);
|
|
2514
|
-
}
|
|
2818
|
+
case "doesnotendwith": return negateIfNotOp(operatorLC, { endsWith: [fieldObject, fieldOrNumberRenderer(value)] });
|
|
2515
2819
|
}
|
|
2516
2820
|
return false;
|
|
2517
2821
|
};
|
|
@@ -2546,10 +2850,7 @@ const defaultRuleProcessorLDAP = (rule, options = {}) => {
|
|
|
2546
2850
|
case "null":
|
|
2547
2851
|
case "notnull": return negateIf(`(${field}=*)`, operatorLC === "notnull");
|
|
2548
2852
|
case "in":
|
|
2549
|
-
case "notin": {
|
|
2550
|
-
const valueAsArray = toArray(value);
|
|
2551
|
-
return negateIf(`(|${valueAsArray.map((val) => `(${field}=${ldapEscape(val)})`).join("")})`, operatorLC === "notin");
|
|
2552
|
-
}
|
|
2853
|
+
case "notin": return negateIf(`(|${toArray(value).map((val) => `(${field}=${ldapEscape(val)})`).join("")})`, operatorLC === "notin");
|
|
2553
2854
|
case "between":
|
|
2554
2855
|
case "notbetween": {
|
|
2555
2856
|
const valueAsArray = toArray(value);
|
|
@@ -2717,10 +3018,9 @@ const defaultRuleProcessorNL = (rule, opts) => {
|
|
|
2717
3018
|
});
|
|
2718
3019
|
const operatorLC = lc(operator);
|
|
2719
3020
|
if ((operatorLC === "in" || operatorLC === "notin" || operatorLC === "between" || operatorLC === "notbetween") && !value) return "";
|
|
2720
|
-
const processedOperator = operatorProcessor(rule, opts);
|
|
2721
3021
|
const wordOrderMap = {
|
|
2722
3022
|
S: processedField,
|
|
2723
|
-
V:
|
|
3023
|
+
V: operatorProcessor(rule, opts),
|
|
2724
3024
|
O: value
|
|
2725
3025
|
};
|
|
2726
3026
|
return normalizeConstituentWordOrder(wordOrder).map((term) => `${wordOrderMap[term]}`).join(" ").trim();
|
|
@@ -3297,7 +3597,7 @@ const findPath = (path, query) => {
|
|
|
3297
3597
|
target = typeof t === "string" ? null : t;
|
|
3298
3598
|
level++;
|
|
3299
3599
|
}
|
|
3300
|
-
return target;
|
|
3600
|
+
return level < path.length ? null : target;
|
|
3301
3601
|
};
|
|
3302
3602
|
/**
|
|
3303
3603
|
* Returns the {@link RuleType} or {@link RuleGroupType}/{@link RuleGroupTypeIC}
|
|
@@ -3486,6 +3786,26 @@ const getValueSourcesUtil = (fieldData, operator, getValueSources) => {
|
|
|
3486
3786
|
});
|
|
3487
3787
|
};
|
|
3488
3788
|
|
|
3789
|
+
//#endregion
|
|
3790
|
+
//#region src/utils/mergeAnyTranslations.ts
|
|
3791
|
+
/**
|
|
3792
|
+
* Merges any number of partial translations into a single definition.
|
|
3793
|
+
*/
|
|
3794
|
+
const mergeAnyTranslations = (base, ...otherTranslations) => produce(base, (draft) => {
|
|
3795
|
+
for (const translations of otherTranslations)
|
|
3796
|
+
// istanbul ignore else
|
|
3797
|
+
if (translations) for (const t of objectKeys(translations)) if (draft[t]) Object.assign(draft[t], translations[t]);
|
|
3798
|
+
else Object.assign(draft, { [t]: translations[t] });
|
|
3799
|
+
});
|
|
3800
|
+
const mergeAnyTranslation = (el, keyPropContextMap, defaults) => {
|
|
3801
|
+
const finalKeys = objectEntries(keyPropContextMap).map(([key, [pT, cT]]) => [key, pT ?? cT ?? defaults?.[el]?.[key]]).filter((k) => !!k[1]);
|
|
3802
|
+
if (finalKeys.length > 0 || defaults) {
|
|
3803
|
+
const defaultProperties = defaults?.[el] ?? {};
|
|
3804
|
+
const finalObject = Object.assign({}, defaultProperties, Object.fromEntries(finalKeys));
|
|
3805
|
+
return { [el]: finalObject };
|
|
3806
|
+
}
|
|
3807
|
+
};
|
|
3808
|
+
|
|
3489
3809
|
//#endregion
|
|
3490
3810
|
//#region src/utils/mergeClassnames.ts
|
|
3491
3811
|
const joinClassnamesByName = (name, args) => clsx(args.map((c) => clsx(c?.[name])));
|
|
@@ -3513,6 +3833,9 @@ const mergeClassnames = (...args) => ({
|
|
|
3513
3833
|
dragHandle: joinClassnamesByName("dragHandle", args),
|
|
3514
3834
|
lockRule: joinClassnamesByName("lockRule", args),
|
|
3515
3835
|
lockGroup: joinClassnamesByName("lockGroup", args),
|
|
3836
|
+
muteRule: joinClassnamesByName("muteRule", args),
|
|
3837
|
+
muteGroup: joinClassnamesByName("muteGroup", args),
|
|
3838
|
+
muted: joinClassnamesByName("muted", args),
|
|
3516
3839
|
valueSource: joinClassnamesByName("valueSource", args),
|
|
3517
3840
|
actionElement: joinClassnamesByName("actionElement", args),
|
|
3518
3841
|
valueSelector: joinClassnamesByName("valueSelector", args),
|
|
@@ -3532,21 +3855,6 @@ const mergeClassnames = (...args) => ({
|
|
|
3532
3855
|
hasSubQuery: joinClassnamesByName("hasSubQuery", args)
|
|
3533
3856
|
});
|
|
3534
3857
|
|
|
3535
|
-
//#endregion
|
|
3536
|
-
//#region src/utils/objectUtils.ts
|
|
3537
|
-
/**
|
|
3538
|
-
* A strongly-typed version of `Object.keys()`.
|
|
3539
|
-
*
|
|
3540
|
-
* [Original source](https://github.com/sindresorhus/ts-extras/blob/44f57392c5f027268330771996c4fdf9260b22d6/source/object-keys.ts)
|
|
3541
|
-
*/
|
|
3542
|
-
const objectKeys = Object.keys;
|
|
3543
|
-
/**
|
|
3544
|
-
* A strongly-typed version of `Object.entries()`.
|
|
3545
|
-
*
|
|
3546
|
-
* [Original source](https://github.com/sindresorhus/ts-extras/blob/44f57392c5f027268330771996c4fdf9260b22d6/source/object-entries.ts)
|
|
3547
|
-
*/
|
|
3548
|
-
const objectEntries = Object.entries;
|
|
3549
|
-
|
|
3550
3858
|
//#endregion
|
|
3551
3859
|
//#region src/utils/prepareQueryObjects.ts
|
|
3552
3860
|
/**
|
|
@@ -3578,28 +3886,21 @@ const regenerateID = (rule, { idGenerator = generateID } = {}) => structuredClon
|
|
|
3578
3886
|
id: idGenerator()
|
|
3579
3887
|
});
|
|
3580
3888
|
/**
|
|
3581
|
-
* Recursively generates new `id` properties for a group and all its rules and subgroups.
|
|
3889
|
+
* Recursively generates new `id` properties for a rule group and all its rules and subgroups.
|
|
3582
3890
|
*/
|
|
3583
|
-
const regenerateIDs = (
|
|
3584
|
-
if (!isPojo(
|
|
3585
|
-
if (!isRuleGroup(
|
|
3586
|
-
...
|
|
3891
|
+
const regenerateIDs = (subject, { idGenerator = generateID } = {}) => {
|
|
3892
|
+
if (!isPojo(subject)) return subject;
|
|
3893
|
+
if (!isRuleGroup(subject)) return structuredClone({
|
|
3894
|
+
...subject,
|
|
3587
3895
|
id: idGenerator()
|
|
3588
3896
|
});
|
|
3589
|
-
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
...ruleOrGroup,
|
|
3593
|
-
id: idGenerator(),
|
|
3594
|
-
rules: rules$1
|
|
3595
|
-
};
|
|
3596
|
-
}
|
|
3597
|
-
const rules = ruleOrGroup.rules.map((r) => typeof r === "string" ? r : isRuleGroup(r) ? regenerateIDs(r, { idGenerator }) : regenerateID(r, { idGenerator }));
|
|
3598
|
-
return {
|
|
3599
|
-
...ruleOrGroup,
|
|
3600
|
-
id: idGenerator(),
|
|
3601
|
-
rules
|
|
3897
|
+
const newGroup = {
|
|
3898
|
+
...subject,
|
|
3899
|
+
id: idGenerator()
|
|
3602
3900
|
};
|
|
3901
|
+
// istanbul ignore else
|
|
3902
|
+
if (Array.isArray(newGroup.rules)) newGroup.rules = subject.rules.map((r) => typeof r === "string" ? r : isRuleGroup(r) ? regenerateIDs(r, { idGenerator }) : regenerateID(r, { idGenerator }));
|
|
3903
|
+
return newGroup;
|
|
3603
3904
|
};
|
|
3604
3905
|
|
|
3605
3906
|
//#endregion
|
|
@@ -3663,12 +3964,11 @@ const update = (query, prop, value, pathOrID, { resetOnFieldChange = true, reset
|
|
|
3663
3964
|
resetValueSource = true;
|
|
3664
3965
|
resetValue = true;
|
|
3665
3966
|
}
|
|
3666
|
-
const
|
|
3967
|
+
const defaultValueSource = getFirstOption(getValueSourcesUtil({
|
|
3667
3968
|
name: ruleOrGroup.field,
|
|
3668
3969
|
value: ruleOrGroup.field,
|
|
3669
3970
|
label: ""
|
|
3670
|
-
}, ruleOrGroup.operator, getValueSources);
|
|
3671
|
-
const defaultValueSource = getFirstOption(valueSources);
|
|
3971
|
+
}, ruleOrGroup.operator, getValueSources));
|
|
3672
3972
|
if (resetValueSource && ruleOrGroup.valueSource && defaultValueSource !== ruleOrGroup.valueSource || prop === "valueSource" && value !== ruleOrGroup.valueSource) {
|
|
3673
3973
|
resetValue = !!ruleOrGroup.valueSource || !ruleOrGroup.valueSource && value !== defaultValueSource;
|
|
3674
3974
|
ruleOrGroup.valueSource = resetValueSource ? defaultValueSource : value;
|
|
@@ -3713,8 +4013,7 @@ const getNextPath = (query, currentPath, newPathOrShiftDirection) => {
|
|
|
3713
4013
|
return [...getParentPath(parentPath), parentPath.at(-1) + 1];
|
|
3714
4014
|
} else {
|
|
3715
4015
|
const evaluationPath = [...getParentPath(currentPath), currentPath.at(-1) + (ic ? 2 : 1)];
|
|
3716
|
-
|
|
3717
|
-
if (isRuleGroup(entityToEvaluate)) return [...evaluationPath, 0];
|
|
4016
|
+
if (isRuleGroup(findPath(evaluationPath, query))) return [...evaluationPath, 0];
|
|
3718
4017
|
else return [...getParentPath(currentPath), currentPath.at(-1) + (ic ? 3 : 2)];
|
|
3719
4018
|
}
|
|
3720
4019
|
return currentPath;
|
|
@@ -3748,8 +4047,7 @@ const move = (query, oldPathOrID, newPath, { clone = false, combinators = defaul
|
|
|
3748
4047
|
const newNewPath = [...nextPath];
|
|
3749
4048
|
const commonAncestorPath = getCommonAncestorPath(oldPath, nextPath);
|
|
3750
4049
|
if (!clone && oldPath.length === commonAncestorPath.length + 1 && nextPath[commonAncestorPath.length] > oldPath[commonAncestorPath.length]) newNewPath[commonAncestorPath.length] -= independentCombinators ? 2 : 1;
|
|
3751
|
-
const
|
|
3752
|
-
const parentToInsertInto = findPath(newNewParentPath, draft);
|
|
4050
|
+
const parentToInsertInto = findPath(getParentPath(newNewPath), draft);
|
|
3753
4051
|
const newIndex = newNewPath.at(-1);
|
|
3754
4052
|
/**
|
|
3755
4053
|
* This function 1) glosses over the need for type assertions to splice directly
|
|
@@ -3758,15 +4056,9 @@ const move = (query, oldPathOrID, newPath, { clone = false, combinators = defaul
|
|
|
3758
4056
|
const insertRuleOrGroup = (...args) => parentToInsertInto.rules.splice(newIndex, 0, ...args);
|
|
3759
4057
|
if (parentToInsertInto.rules.length === 0 || !independentCombinators) insertRuleOrGroup(ruleOrGroup);
|
|
3760
4058
|
else if (newIndex === 0) if (ruleToRemoveIndex === 0 && oldNextCombinator) insertRuleOrGroup(ruleOrGroup, oldNextCombinator);
|
|
3761
|
-
else
|
|
3762
|
-
const newNextCombinator = parentToInsertInto.rules[1] ?? oldPrevCombinator ?? getFirstOption(combinators);
|
|
3763
|
-
insertRuleOrGroup(ruleOrGroup, newNextCombinator);
|
|
3764
|
-
}
|
|
4059
|
+
else insertRuleOrGroup(ruleOrGroup, parentToInsertInto.rules[1] ?? oldPrevCombinator ?? getFirstOption(combinators));
|
|
3765
4060
|
else if (oldPrevCombinator) insertRuleOrGroup(oldPrevCombinator, ruleOrGroup);
|
|
3766
|
-
else
|
|
3767
|
-
const newPrevCombinator = parentToInsertInto.rules[newIndex - 2] ?? oldNextCombinator ?? getFirstOption(combinators);
|
|
3768
|
-
insertRuleOrGroup(newPrevCombinator, ruleOrGroup);
|
|
3769
|
-
}
|
|
4061
|
+
else insertRuleOrGroup(parentToInsertInto.rules[newIndex - 2] ?? oldNextCombinator ?? getFirstOption(combinators), ruleOrGroup);
|
|
3770
4062
|
});
|
|
3771
4063
|
};
|
|
3772
4064
|
/**
|
|
@@ -3789,17 +4081,11 @@ const insert = (query, ruleOrGroup, path, { combinators = defaultCombinators, co
|
|
|
3789
4081
|
if (parentToInsertInto.rules.length === 0 || !independentCombinators) insertRuleOrGroup(newIndex, rorg);
|
|
3790
4082
|
else if (replace && independentCombinators) insertRuleOrGroup(newIndex + newIndex % 2, rorg);
|
|
3791
4083
|
else if (newIndex === 0) if (rorg.path?.at(-1) === 0 && combinatorSucceeding) insertRuleOrGroup(newIndex, rorg, combinatorSucceeding);
|
|
3792
|
-
else
|
|
3793
|
-
const newNextCombinator = parentToInsertInto.rules[1] ?? combinatorPreceding ?? getFirstOption(combinators);
|
|
3794
|
-
insertRuleOrGroup(newIndex, rorg, newNextCombinator);
|
|
3795
|
-
}
|
|
4084
|
+
else insertRuleOrGroup(newIndex, rorg, parentToInsertInto.rules[1] ?? combinatorPreceding ?? getFirstOption(combinators));
|
|
3796
4085
|
else {
|
|
3797
4086
|
const normalizedNewIndex = newIndex % 2 === 0 ? newIndex - 1 : newIndex;
|
|
3798
4087
|
if (combinatorPreceding) insertRuleOrGroup(normalizedNewIndex, combinatorPreceding, rorg);
|
|
3799
|
-
else
|
|
3800
|
-
const newPrevCombinator = parentToInsertInto.rules[normalizedNewIndex - 2] ?? combinatorSucceeding ?? getFirstOption(combinators);
|
|
3801
|
-
insertRuleOrGroup(normalizedNewIndex, newPrevCombinator, rorg);
|
|
3802
|
-
}
|
|
4088
|
+
else insertRuleOrGroup(normalizedNewIndex, parentToInsertInto.rules[normalizedNewIndex - 2] ?? combinatorSucceeding ?? getFirstOption(combinators), rorg);
|
|
3803
4089
|
}
|
|
3804
4090
|
});
|
|
3805
4091
|
/**
|
|
@@ -3833,8 +4119,7 @@ const group = (query, sourcePathOrID, targetPathOrID, { clone = false, combinato
|
|
|
3833
4119
|
const newNewPath = [...nextPath];
|
|
3834
4120
|
const commonAncestorPath = getCommonAncestorPath(sourcePath, nextPath);
|
|
3835
4121
|
if (!clone && sourcePath.length === commonAncestorPath.length + 1 && nextPath[commonAncestorPath.length] > sourcePath[commonAncestorPath.length]) newNewPath[commonAncestorPath.length] -= independentCombinators ? 2 : 1;
|
|
3836
|
-
const
|
|
3837
|
-
const parentOfTargetPath = findPath(newNewParentPath, draft);
|
|
4122
|
+
const parentOfTargetPath = findPath(getParentPath(newNewPath), draft);
|
|
3838
4123
|
const targetPathIndex = newNewPath.at(-1);
|
|
3839
4124
|
parentOfTargetPath.rules.splice(targetPathIndex, 1, prepareRuleOrGroup(independentCombinators ? { rules: [
|
|
3840
4125
|
targetRuleOrGroup,
|
|
@@ -3848,5 +4133,5 @@ const group = (query, sourcePathOrID, targetPathOrID, { clone = false, combinato
|
|
|
3848
4133
|
};
|
|
3849
4134
|
|
|
3850
4135
|
//#endregion
|
|
3851
|
-
export { LogType, TestID, add, 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, 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, groupInvalidReasons, insert, isAncestor, isFlexibleOptionArray, isFlexibleOptionGroupArray, isFullOptionArray, isFullOptionGroupArray, isOptionGroupArray, isPojo, isRuleGroup, isRuleGroupType, isRuleGroupTypeIC, isRuleOrGroupValid, isValidValue, isValidationResult, isValueProcessorLegacy, joinWith, jsonLogicAdditionalOperators, lc, mapSQLOperator, mergeClassnames, mongoDbFallback, mongoOperators, move, normalizeConstituentWordOrder, nullFreeArray, nullOrUndefinedOrEmpty, numericRegex, numerifyValues, objectEntries, objectKeys, parseNumber, pathIsDisabled, pathsAreEqual, prepareRule, prepareRuleGroup, prepareRuleOrGroup, prismaFallback, prismaOperators, processMatchMode, regenerateID, regenerateIDs, remove, rootPath, shouldRenderAsNumber, splitBy, sqlDialectPresets, standardClassnames, toArray, toFlatOptionArray, toFullOption, toFullOptionList, toFullOptionMap, transformQuery, trimIfString, uniqByIdentifier, uniqByName, uniqOptGroups, uniqOptList, update };
|
|
4136
|
+
export { LogType, TestID, add, 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, groupInvalidReasons, insert, isAncestor, isFlexibleOptionArray, isFlexibleOptionGroupArray, isFullOptionArray, isFullOptionGroupArray, isOptionGroupArray, isPojo, isRuleGroup, isRuleGroupType, isRuleGroupTypeIC, isRuleOrGroupValid, isRuleType, isValidValue, isValidationResult, isValueProcessorLegacy, joinWith, jsonLogicAdditionalOperators, lc, mapSQLOperator, mergeAnyTranslation, mergeAnyTranslations, mergeClassnames, mongoDbFallback, mongoOperators, move, normalizeConstituentWordOrder, nullFreeArray, nullOrUndefinedOrEmpty, numericRegex, numerifyValues, objectEntries, objectKeys, parseNumber, pathIsDisabled, pathsAreEqual, prepareOptionList, prepareRule, prepareRuleGroup, prepareRuleOrGroup, prismaFallback, prismaOperators, processMatchMode, regenerateID, regenerateIDs, remove, rootPath, shouldRenderAsNumber, splitBy, sqlDialectPresets, standardClassnames, toArray, toFlatOptionArray, toFullOption, toFullOptionList, toFullOptionMap, transformQuery, trimIfString, uniqByIdentifier, uniqByName, uniqOptGroups, uniqOptList, update };
|
|
3852
4137
|
//# sourceMappingURL=react-querybuilder_core.mjs.map
|