@react-querybuilder/core 8.9.2 → 8.11.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-BF1P8iHS.mjs → arrayUtils-A_OXU9W1.mjs} +3 -75
- package/dist/arrayUtils-A_OXU9W1.mjs.map +1 -0
- package/dist/arrayUtils-QxZOZTf6.js +73 -0
- package/dist/arrayUtils-QxZOZTf6.js.map +1 -0
- package/dist/basic-DEc65Kng.d.mts +363 -0
- package/dist/basic-Dd_M2f3M.d.ts +363 -0
- package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +806 -1366
- package/dist/cjs/react-querybuilder_core.cjs.development.js +455 -116
- package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +806 -1366
- 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-H7RhQiIc.mjs → convertQuery-CqX3rPvj.mjs} +3 -3
- package/dist/{convertQuery-H7RhQiIc.mjs.map → convertQuery-CqX3rPvj.mjs.map} +1 -1
- package/dist/{export-DyrnTh6K.d.ts → export-Dy4FckB-.d.ts} +7 -6
- package/dist/{export-r-V7bU31.d.mts → export-t1V2N8pz.d.mts} +7 -6
- package/dist/formatQuery.d.mts +3 -2
- package/dist/formatQuery.d.ts +3 -2
- package/dist/formatQuery.js +217 -87
- package/dist/formatQuery.js.map +1 -1
- package/dist/formatQuery.mjs +217 -87
- package/dist/formatQuery.mjs.map +1 -1
- package/dist/{import-Cksobmln.d.ts → import-Cz8canKo.d.mts} +3 -3
- package/dist/{import-BwbbP4oU.d.mts → import-DtS9Ocx5.d.ts} +3 -3
- package/dist/{isRuleGroup-CnhYpLOM.mjs → isRuleGroup-CYcfPgbg.mjs} +2 -2
- package/dist/{isRuleGroup-CnhYpLOM.mjs.map → isRuleGroup-CYcfPgbg.mjs.map} +1 -1
- package/dist/lexer-C53tqS2p.js +406 -0
- package/dist/lexer-C53tqS2p.js.map +1 -0
- package/dist/{optGroupUtils-CXLgyg2i.js → optGroupUtils-B0hTpodo.js} +114 -1
- package/dist/optGroupUtils-B0hTpodo.js.map +1 -0
- package/dist/{optGroupUtils-Duv-M8rf.mjs → optGroupUtils-VeZ3k7-1.mjs} +86 -3
- package/dist/optGroupUtils-VeZ3k7-1.mjs.map +1 -0
- package/dist/parseCEL.d.mts +292 -11
- package/dist/parseCEL.d.ts +292 -11
- package/dist/parseCEL.js +874 -1125
- package/dist/parseCEL.js.map +1 -1
- package/dist/parseCEL.mjs +828 -1126
- package/dist/parseCEL.mjs.map +1 -1
- package/dist/parseJSONata.d.mts +3 -2
- package/dist/parseJSONata.d.ts +3 -2
- package/dist/parseJSONata.js +49 -77
- package/dist/parseJSONata.js.map +1 -1
- package/dist/parseJSONata.mjs +4 -5
- package/dist/parseJSONata.mjs.map +1 -1
- package/dist/parseJsonLogic.d.mts +4 -3
- package/dist/parseJsonLogic.d.ts +4 -3
- package/dist/parseJsonLogic.js +5 -6
- package/dist/parseJsonLogic.js.map +1 -1
- package/dist/parseJsonLogic.mjs +5 -6
- package/dist/parseJsonLogic.mjs.map +1 -1
- package/dist/parseMongoDB.d.mts +3 -2
- package/dist/parseMongoDB.d.ts +3 -2
- package/dist/parseMongoDB.js +15 -16
- package/dist/parseMongoDB.js.map +1 -1
- package/dist/parseMongoDB.mjs +5 -6
- package/dist/parseMongoDB.mjs.map +1 -1
- package/dist/{parseNumber-BtGKa58z.mjs → parseNumber-CXdMVNFx.mjs} +2 -2
- package/dist/{parseNumber-BtGKa58z.mjs.map → parseNumber-CXdMVNFx.mjs.map} +1 -1
- 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 +3 -2
- package/dist/parseSQL.d.ts +3 -2
- package/dist/parseSQL.js +2691 -3036
- package/dist/parseSQL.js.map +1 -1
- package/dist/parseSQL.mjs +2691 -3037
- package/dist/parseSQL.mjs.map +1 -1
- package/dist/parseSpEL.d.mts +3 -2
- package/dist/parseSpEL.d.ts +3 -2
- package/dist/parseSpEL.js +7 -9
- package/dist/parseSpEL.js.map +1 -1
- package/dist/parseSpEL.mjs +5 -6
- package/dist/parseSpEL.mjs.map +1 -1
- package/dist/{prepareQueryObjects-BqFEs4eV.js → prepareQueryObjects-BOUWfel5.js} +4 -5
- package/dist/prepareQueryObjects-BOUWfel5.js.map +1 -0
- package/dist/{prepareQueryObjects-CS6Wmhmf.mjs → prepareQueryObjects-DPCC-iHp.mjs} +6 -7
- package/dist/prepareQueryObjects-DPCC-iHp.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 +806 -1366
- package/dist/react-querybuilder_core.legacy-esm.d.ts +806 -1366
- package/dist/react-querybuilder_core.legacy-esm.js +455 -114
- package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_core.mjs +448 -117
- package/dist/react-querybuilder_core.mjs.map +1 -1
- package/dist/react-querybuilder_core.production.d.mts +806 -1366
- 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 +22 -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-DdMvmrCh.mjs → transformQuery-DCCpjtyq.mjs} +3 -3
- package/dist/{transformQuery-DdMvmrCh.mjs.map → transformQuery-DCCpjtyq.mjs.map} +1 -1
- package/dist/transformQuery.d.mts +1 -1
- package/dist/transformQuery.d.ts +1 -1
- package/dist/transformQuery.js +1 -1
- package/dist/transformQuery.mjs +2 -2
- package/package.json +14 -12
- package/dist/arrayUtils-BF1P8iHS.mjs.map +0 -1
- package/dist/arrayUtils-D5EoIsKP.js +0 -164
- package/dist/arrayUtils-D5EoIsKP.js.map +0 -1
- package/dist/basic-BfD-7CN3.d.mts +0 -1235
- 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/objectUtils-BtWdcZVG.mjs +0 -11
- package/dist/objectUtils-BtWdcZVG.mjs.map +0 -1
- package/dist/optGroupUtils-CXLgyg2i.js.map +0 -1
- package/dist/optGroupUtils-Duv-M8rf.mjs.map +0 -1
- package/dist/prepareQueryObjects-BqFEs4eV.js.map +0 -1
- package/dist/prepareQueryObjects-CS6Wmhmf.mjs.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
|
};
|
|
@@ -425,6 +535,31 @@ const LogType = {
|
|
|
425
535
|
* @group Defaults
|
|
426
536
|
*/
|
|
427
537
|
const rootPath = [];
|
|
538
|
+
/**
|
|
539
|
+
* Default values for all `boolean`
|
|
540
|
+
* {@link react-querybuilder!QueryBuilder QueryBuilder} options.
|
|
541
|
+
*
|
|
542
|
+
* @group Defaults
|
|
543
|
+
*/
|
|
544
|
+
const queryBuilderFlagDefaults = {
|
|
545
|
+
addRuleToNewGroups: false,
|
|
546
|
+
autoSelectField: true,
|
|
547
|
+
autoSelectOperator: true,
|
|
548
|
+
autoSelectValue: false,
|
|
549
|
+
debugMode: false,
|
|
550
|
+
enableDragAndDrop: false,
|
|
551
|
+
enableMountQueryChange: true,
|
|
552
|
+
listsAsArrays: false,
|
|
553
|
+
resetOnFieldChange: true,
|
|
554
|
+
resetOnOperatorChange: false,
|
|
555
|
+
showCloneButtons: false,
|
|
556
|
+
showCombinatorsBetweenRules: false,
|
|
557
|
+
showLockButtons: false,
|
|
558
|
+
showMuteButtons: false,
|
|
559
|
+
showNotToggle: false,
|
|
560
|
+
showShiftActions: false,
|
|
561
|
+
suppressStandardClassnames: false
|
|
562
|
+
};
|
|
428
563
|
|
|
429
564
|
//#endregion
|
|
430
565
|
//#region src/utils/arrayUtils.ts
|
|
@@ -633,7 +768,7 @@ function convertQuery(query) {
|
|
|
633
768
|
//#endregion
|
|
634
769
|
//#region src/utils/defaultValidator.ts
|
|
635
770
|
/**
|
|
636
|
-
* This is an example validation function you can pass to {@link QueryBuilder} in the
|
|
771
|
+
* This is an example validation function you can pass to {@link react-querybuilder!QueryBuilder QueryBuilder} in the
|
|
637
772
|
* `validator` prop. It assumes that you want to validate groups, and has a no-op
|
|
638
773
|
* for validating rules which you can replace with your own implementation.
|
|
639
774
|
*/
|
|
@@ -667,6 +802,21 @@ const defaultValidator = (query) => {
|
|
|
667
802
|
return result;
|
|
668
803
|
};
|
|
669
804
|
|
|
805
|
+
//#endregion
|
|
806
|
+
//#region src/utils/objectUtils.ts
|
|
807
|
+
/**
|
|
808
|
+
* A strongly-typed version of `Object.keys()`.
|
|
809
|
+
*
|
|
810
|
+
* [Original source](https://github.com/sindresorhus/ts-extras/blob/44f57392c5f027268330771996c4fdf9260b22d6/source/object-keys.ts)
|
|
811
|
+
*/
|
|
812
|
+
const objectKeys = Object.keys;
|
|
813
|
+
/**
|
|
814
|
+
* A strongly-typed version of `Object.entries()`.
|
|
815
|
+
*
|
|
816
|
+
* [Original source](https://github.com/sindresorhus/ts-extras/blob/44f57392c5f027268330771996c4fdf9260b22d6/source/object-entries.ts)
|
|
817
|
+
*/
|
|
818
|
+
const objectEntries = Object.entries;
|
|
819
|
+
|
|
670
820
|
//#endregion
|
|
671
821
|
//#region src/utils/optGroupUtils.ts
|
|
672
822
|
const isOptionWithName = (opt) => isPojo(opt) && "name" in opt && typeof opt.name === "string";
|
|
@@ -843,6 +993,42 @@ const uniqOptList = (originalArray) => {
|
|
|
843
993
|
if (isFlexibleOptionGroupArray(originalArray)) return uniqOptGroups(originalArray);
|
|
844
994
|
return uniqByIdentifier(originalArray.map((o) => toFullOption(o)));
|
|
845
995
|
};
|
|
996
|
+
const prepareOptionList = (props) => {
|
|
997
|
+
// istanbul ignore next
|
|
998
|
+
const { optionList: optionListPropOriginal, baseOption = {}, labelMap = {}, placeholder: { placeholderName = defaultPlaceholderName, placeholderLabel = defaultPlaceholderLabel, placeholderGroupLabel = defaultPlaceholderLabel } = {}, autoSelectOption = true } = props;
|
|
999
|
+
const defaultOption = {
|
|
1000
|
+
id: placeholderName,
|
|
1001
|
+
name: placeholderName,
|
|
1002
|
+
value: placeholderName,
|
|
1003
|
+
label: placeholderLabel
|
|
1004
|
+
};
|
|
1005
|
+
const optionsProp = optionListPropOriginal ?? [defaultOption];
|
|
1006
|
+
let optionList = [];
|
|
1007
|
+
const opts = Array.isArray(optionsProp) ? toFullOptionList(optionsProp, baseOption, labelMap) : objectKeys(toFullOptionMap(optionsProp, baseOption)).map((opt) => ({
|
|
1008
|
+
...optionsProp[opt],
|
|
1009
|
+
name: opt,
|
|
1010
|
+
value: opt
|
|
1011
|
+
})).sort((a, b) => a.label.localeCompare(b.label));
|
|
1012
|
+
if (isFlexibleOptionGroupArray(opts)) optionList = autoSelectOption ? uniqOptGroups(opts) : uniqOptGroups([{
|
|
1013
|
+
label: placeholderGroupLabel,
|
|
1014
|
+
options: [defaultOption]
|
|
1015
|
+
}, ...opts]);
|
|
1016
|
+
else optionList = autoSelectOption ? uniqByIdentifier(opts) : uniqByIdentifier([defaultOption, ...opts]);
|
|
1017
|
+
let optionsMap = {};
|
|
1018
|
+
if (!Array.isArray(optionsProp)) {
|
|
1019
|
+
const op = toFullOptionMap(optionsProp, baseOption);
|
|
1020
|
+
optionsMap = autoSelectOption ? op : {
|
|
1021
|
+
...op,
|
|
1022
|
+
[placeholderName]: defaultOption
|
|
1023
|
+
};
|
|
1024
|
+
} else if (isFlexibleOptionGroupArray(optionList)) for (const og of optionList) for (const opt of og.options) optionsMap[opt.value ?? opt.name] = toFullOption(opt, baseOption);
|
|
1025
|
+
else for (const opt of optionList) optionsMap[opt.value ?? opt.name] = toFullOption(opt, baseOption);
|
|
1026
|
+
return {
|
|
1027
|
+
defaultOption,
|
|
1028
|
+
optionList,
|
|
1029
|
+
optionsMap
|
|
1030
|
+
};
|
|
1031
|
+
};
|
|
846
1032
|
|
|
847
1033
|
//#endregion
|
|
848
1034
|
//#region src/utils/filterFieldsByComparator.ts
|
|
@@ -944,9 +1130,11 @@ function transformQuery(query, options = {}) {
|
|
|
944
1130
|
const isValidationResult = (vr) => isPojo(vr) && typeof vr.valid === "boolean";
|
|
945
1131
|
/**
|
|
946
1132
|
* Determines if a rule or group is valid based on a validation result (if defined)
|
|
947
|
-
* or a validator function. Returns `true` if neither are defined
|
|
1133
|
+
* or a validator function. Returns `true` if neither are defined and the `muted`
|
|
1134
|
+
* property is not `true`.
|
|
948
1135
|
*/
|
|
949
1136
|
const isRuleOrGroupValid = (rg, validationResult, validator) => {
|
|
1137
|
+
if (rg.muted) return false;
|
|
950
1138
|
if (typeof validationResult === "boolean") return validationResult;
|
|
951
1139
|
if (isValidationResult(validationResult)) return validationResult.valid;
|
|
952
1140
|
if (typeof validator === "function" && !isRuleGroup(rg)) {
|
|
@@ -1220,19 +1408,45 @@ const defaultRuleGroupProcessorCEL = (ruleGroup, options) => {
|
|
|
1220
1408
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1221
1409
|
const processRuleGroup = (rg, outermost) => {
|
|
1222
1410
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermost ? fallbackExpression : "";
|
|
1223
|
-
const
|
|
1224
|
-
|
|
1225
|
-
|
|
1411
|
+
const processedRules = [];
|
|
1412
|
+
let precedingCombinator = "";
|
|
1413
|
+
let firstRule = true;
|
|
1414
|
+
for (const rule of rg.rules) {
|
|
1415
|
+
if (typeof rule === "string") {
|
|
1416
|
+
precedingCombinator = celCombinatorMap[rule];
|
|
1417
|
+
continue;
|
|
1418
|
+
}
|
|
1419
|
+
if (isRuleGroup(rule)) {
|
|
1420
|
+
const processedGroup = processRuleGroup(rule);
|
|
1421
|
+
if (processedGroup) {
|
|
1422
|
+
if (!firstRule && precedingCombinator) {
|
|
1423
|
+
processedRules.push(precedingCombinator);
|
|
1424
|
+
precedingCombinator = "";
|
|
1425
|
+
}
|
|
1426
|
+
firstRule = false;
|
|
1427
|
+
processedRules.push(processedGroup);
|
|
1428
|
+
}
|
|
1429
|
+
continue;
|
|
1430
|
+
}
|
|
1226
1431
|
const [validationResult, fieldValidator] = validateRule(rule);
|
|
1227
|
-
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName)
|
|
1432
|
+
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName) continue;
|
|
1228
1433
|
const fieldData = getOption(fields, rule.field);
|
|
1229
|
-
|
|
1434
|
+
const processedRule = ruleProcessor(rule, {
|
|
1230
1435
|
...options,
|
|
1231
1436
|
parseNumbers: getParseNumberBoolean(fieldData?.inputType),
|
|
1232
1437
|
escapeQuotes: (rule.valueSource ?? "value") === "value",
|
|
1233
1438
|
fieldData
|
|
1234
1439
|
});
|
|
1235
|
-
|
|
1440
|
+
if (processedRule) {
|
|
1441
|
+
if (!firstRule && precedingCombinator) {
|
|
1442
|
+
processedRules.push(precedingCombinator);
|
|
1443
|
+
precedingCombinator = "";
|
|
1444
|
+
}
|
|
1445
|
+
firstRule = false;
|
|
1446
|
+
processedRules.push(processedRule);
|
|
1447
|
+
}
|
|
1448
|
+
}
|
|
1449
|
+
const expression = processedRules.join(isRuleGroupType(rg) ? ` ${celCombinatorMap[rg.combinator]} ` : " ");
|
|
1236
1450
|
const [prefix, suffix] = rg.not || !outermost ? [`${rg.not ? "!" : ""}(`, ")"] : ["", ""];
|
|
1237
1451
|
return expression ? `${prefix}${expression}${suffix}` : fallbackExpression;
|
|
1238
1452
|
};
|
|
@@ -1259,11 +1473,10 @@ const defaultRuleProcessorCEL = (rule, opts = {}) => {
|
|
|
1259
1473
|
else if (matchEval) {
|
|
1260
1474
|
const { mode, threshold } = matchEval;
|
|
1261
1475
|
const arrayElementAlias = "elem_alias";
|
|
1262
|
-
const
|
|
1476
|
+
const nestedArrayFilter = defaultRuleGroupProcessorCEL(transformQuery(rule.value, { ruleProcessor: (r) => ({
|
|
1263
1477
|
...r,
|
|
1264
1478
|
field: `${arrayElementAlias}${r.field ? `.${r.field}` : ""}`
|
|
1265
|
-
}) });
|
|
1266
|
-
const nestedArrayFilter = defaultRuleGroupProcessorCEL(celQuery, opts);
|
|
1479
|
+
}) }), opts);
|
|
1267
1480
|
switch (mode) {
|
|
1268
1481
|
case "all": return `${field}.all(${arrayElementAlias}, ${nestedArrayFilter})`;
|
|
1269
1482
|
case "none":
|
|
@@ -1297,8 +1510,7 @@ const defaultRuleProcessorCEL = (rule, opts = {}) => {
|
|
|
1297
1510
|
case "in":
|
|
1298
1511
|
case "notin": {
|
|
1299
1512
|
const [prefix, suffix] = shouldNegate$2(operatorTL) ? ["!(", ")"] : ["", ""];
|
|
1300
|
-
|
|
1301
|
-
return `${prefix}${field} in [${valueAsArray.map((val) => valueIsField || shouldRenderAsNumber(val, parseNumbers) ? `${trimIfString(val)}` : `"${escapeDoubleQuotes(val, escapeQuotes)}"`).join(", ")}]${suffix}`;
|
|
1513
|
+
return `${prefix}${field} in [${toArray(value).map((val) => valueIsField || shouldRenderAsNumber(val, parseNumbers) ? `${trimIfString(val)}` : `"${escapeDoubleQuotes(val, escapeQuotes)}"`).join(", ")}]${suffix}`;
|
|
1302
1514
|
}
|
|
1303
1515
|
case "between":
|
|
1304
1516
|
case "notbetween": {
|
|
@@ -1518,19 +1730,45 @@ const defaultRuleGroupProcessorSpEL = (ruleGroup, options) => {
|
|
|
1518
1730
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1519
1731
|
const processRuleGroup = (rg, outermost) => {
|
|
1520
1732
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermost ? fallbackExpression : "";
|
|
1521
|
-
const
|
|
1522
|
-
|
|
1523
|
-
|
|
1733
|
+
const processedRules = [];
|
|
1734
|
+
let precedingCombinator = "";
|
|
1735
|
+
let firstRule = true;
|
|
1736
|
+
for (const rule of rg.rules) {
|
|
1737
|
+
if (typeof rule === "string") {
|
|
1738
|
+
precedingCombinator = rule;
|
|
1739
|
+
continue;
|
|
1740
|
+
}
|
|
1741
|
+
if (isRuleGroup(rule)) {
|
|
1742
|
+
const processedGroup = processRuleGroup(rule);
|
|
1743
|
+
if (processedGroup) {
|
|
1744
|
+
if (!firstRule && precedingCombinator) {
|
|
1745
|
+
processedRules.push(precedingCombinator);
|
|
1746
|
+
precedingCombinator = "";
|
|
1747
|
+
}
|
|
1748
|
+
firstRule = false;
|
|
1749
|
+
processedRules.push(processedGroup);
|
|
1750
|
+
}
|
|
1751
|
+
continue;
|
|
1752
|
+
}
|
|
1524
1753
|
const [validationResult, fieldValidator] = validateRule(rule);
|
|
1525
|
-
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName)
|
|
1754
|
+
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName) continue;
|
|
1526
1755
|
const fieldData = getOption(fields, rule.field);
|
|
1527
|
-
|
|
1756
|
+
const processedRule = ruleProcessor(rule, {
|
|
1528
1757
|
...options,
|
|
1529
1758
|
parseNumbers: getParseNumberBoolean(fieldData?.inputType),
|
|
1530
1759
|
escapeQuotes: (rule.valueSource ?? "value") === "value",
|
|
1531
1760
|
fieldData
|
|
1532
1761
|
});
|
|
1533
|
-
|
|
1762
|
+
if (processedRule) {
|
|
1763
|
+
if (!firstRule && precedingCombinator) {
|
|
1764
|
+
processedRules.push(precedingCombinator);
|
|
1765
|
+
precedingCombinator = "";
|
|
1766
|
+
}
|
|
1767
|
+
firstRule = false;
|
|
1768
|
+
processedRules.push(processedRule);
|
|
1769
|
+
}
|
|
1770
|
+
}
|
|
1771
|
+
const expression = processedRules.join(isRuleGroupType(rg) ? ` ${rg.combinator} ` : " ");
|
|
1534
1772
|
const [prefix, suffix] = rg.not || !outermost ? [`${rg.not ? "!" : ""}(`, ")"] : ["", ""];
|
|
1535
1773
|
return expression ? `${prefix}${expression}${suffix}` : fallbackExpression;
|
|
1536
1774
|
};
|
|
@@ -1586,15 +1824,9 @@ const defaultRuleProcessorSpEL = (rule, opts = {}) => {
|
|
|
1586
1824
|
case "contains":
|
|
1587
1825
|
case "doesnotcontain": return wrapInNegation(`${field} matches ${valueIsField || useBareValue ? trimIfString(value) : `'${escapeSingleQuotes(value, escapeQuotes)}'`}`, shouldNegate$1(operatorTL));
|
|
1588
1826
|
case "beginswith":
|
|
1589
|
-
case "doesnotbeginwith": {
|
|
1590
|
-
const valueTL = valueIsField ? `'^'.concat(${trimIfString(value)})` : `'${typeof value === "string" && !value.startsWith("^") || useBareValue ? "^" : ""}${escapeSingleQuotes(value, escapeQuotes)}'`;
|
|
1591
|
-
return wrapInNegation(`${field} matches ${valueTL}`, shouldNegate$1(operatorTL));
|
|
1592
|
-
}
|
|
1827
|
+
case "doesnotbeginwith": return wrapInNegation(`${field} matches ${valueIsField ? `'^'.concat(${trimIfString(value)})` : `'${typeof value === "string" && !value.startsWith("^") || useBareValue ? "^" : ""}${escapeSingleQuotes(value, escapeQuotes)}'`}`, shouldNegate$1(operatorTL));
|
|
1593
1828
|
case "endswith":
|
|
1594
|
-
case "doesnotendwith": {
|
|
1595
|
-
const valueTL = valueIsField ? `${trimIfString(value)}.concat('$')` : `'${escapeSingleQuotes(value, escapeQuotes)}${typeof value === "string" && !value.endsWith("$") || useBareValue ? "$" : ""}'`;
|
|
1596
|
-
return wrapInNegation(`${field} matches ${valueTL}`, shouldNegate$1(operatorTL));
|
|
1597
|
-
}
|
|
1829
|
+
case "doesnotendwith": return wrapInNegation(`${field} matches ${valueIsField ? `${trimIfString(value)}.concat('$')` : `'${escapeSingleQuotes(value, escapeQuotes)}${typeof value === "string" && !value.endsWith("$") || useBareValue ? "$" : ""}'`}`, shouldNegate$1(operatorTL));
|
|
1598
1830
|
case "null": return `${field} == null`;
|
|
1599
1831
|
case "notnull": return `${field} != null`;
|
|
1600
1832
|
case "in":
|
|
@@ -1707,11 +1939,10 @@ const defaultRuleProcessorDrizzle = (rule, _options) => {
|
|
|
1707
1939
|
if (opts.preset !== "postgresql") return;
|
|
1708
1940
|
const { mode, threshold } = matchEval;
|
|
1709
1941
|
const arrayElementAlias = "elem_alias";
|
|
1710
|
-
const
|
|
1942
|
+
const nestedArrayFilter = defaultRuleGroupProcessorDrizzle(transformQuery(rule.value, { ruleProcessor: (r) => ({
|
|
1711
1943
|
...r,
|
|
1712
1944
|
field: arrayElementAlias
|
|
1713
|
-
}) })
|
|
1714
|
-
const nestedArrayFilter = defaultRuleGroupProcessorDrizzle(sqlQuery, {
|
|
1945
|
+
}) }), {
|
|
1715
1946
|
...opts,
|
|
1716
1947
|
context: {
|
|
1717
1948
|
...opts.context,
|
|
@@ -1797,7 +2028,6 @@ const defaultRuleGroupProcessorDrizzle = (ruleGroup, options, _meta) => (columns
|
|
|
1797
2028
|
const { fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, validateRule, validationMap } = options;
|
|
1798
2029
|
if (!columns || !drizzleOperators) return;
|
|
1799
2030
|
const { and, not, or } = drizzleOperators;
|
|
1800
|
-
const query = isRuleGroupType(ruleGroup) ? ruleGroup : convertFromIC(ruleGroup);
|
|
1801
2031
|
const ruleProcessor = defaultRuleProcessorDrizzle;
|
|
1802
2032
|
const processRuleGroup = (rg, _outermost) => {
|
|
1803
2033
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return;
|
|
@@ -1821,7 +2051,7 @@ const defaultRuleGroupProcessorDrizzle = (ruleGroup, options, _meta) => (columns
|
|
|
1821
2051
|
const ruleGroupSQL = rg.combinator === "or" ? or(...processedRules) : and(...processedRules);
|
|
1822
2052
|
return rg.not ? not(ruleGroupSQL) : ruleGroupSQL;
|
|
1823
2053
|
};
|
|
1824
|
-
return processRuleGroup(
|
|
2054
|
+
return processRuleGroup(convertFromIC(ruleGroup), true);
|
|
1825
2055
|
};
|
|
1826
2056
|
|
|
1827
2057
|
//#endregion
|
|
@@ -1833,7 +2063,6 @@ const defaultRuleGroupProcessorDrizzle = (ruleGroup, options, _meta) => (columns
|
|
|
1833
2063
|
*/
|
|
1834
2064
|
const defaultRuleGroupProcessorElasticSearch = (ruleGroup, options) => {
|
|
1835
2065
|
const { fields, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1836
|
-
const query = convertFromIC(ruleGroup);
|
|
1837
2066
|
const processRuleGroup = (rg) => {
|
|
1838
2067
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return false;
|
|
1839
2068
|
const processedRules = rg.rules.map((rule) => {
|
|
@@ -1850,7 +2079,7 @@ const defaultRuleGroupProcessorElasticSearch = (ruleGroup, options) => {
|
|
|
1850
2079
|
if (processedRules.length === 0) return false;
|
|
1851
2080
|
return { bool: rg.not ? { must_not: /^or$/i.test(rg.combinator) ? { bool: { should: processedRules } } : processedRules } : { [/^or$/i.test(rg.combinator) ? "should" : "must"]: processedRules } };
|
|
1852
2081
|
};
|
|
1853
|
-
const processedRuleGroup = processRuleGroup(
|
|
2082
|
+
const processedRuleGroup = processRuleGroup(convertFromIC(ruleGroup));
|
|
1854
2083
|
return processedRuleGroup === false ? {} : processedRuleGroup;
|
|
1855
2084
|
};
|
|
1856
2085
|
|
|
@@ -1865,19 +2094,45 @@ const defaultRuleGroupProcessorJSONata = (ruleGroup, options) => {
|
|
|
1865
2094
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1866
2095
|
const processRuleGroup = (rg, outermost) => {
|
|
1867
2096
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermost ? fallbackExpression : "";
|
|
1868
|
-
const
|
|
1869
|
-
|
|
1870
|
-
|
|
2097
|
+
const processedRules = [];
|
|
2098
|
+
let precedingCombinator = "";
|
|
2099
|
+
let firstRule = true;
|
|
2100
|
+
for (const rule of rg.rules) {
|
|
2101
|
+
if (typeof rule === "string") {
|
|
2102
|
+
precedingCombinator = rule;
|
|
2103
|
+
continue;
|
|
2104
|
+
}
|
|
2105
|
+
if (isRuleGroup(rule)) {
|
|
2106
|
+
const processedGroup = processRuleGroup(rule);
|
|
2107
|
+
if (processedGroup) {
|
|
2108
|
+
if (!firstRule && precedingCombinator) {
|
|
2109
|
+
processedRules.push(precedingCombinator);
|
|
2110
|
+
precedingCombinator = "";
|
|
2111
|
+
}
|
|
2112
|
+
firstRule = false;
|
|
2113
|
+
processedRules.push(processedGroup);
|
|
2114
|
+
}
|
|
2115
|
+
continue;
|
|
2116
|
+
}
|
|
1871
2117
|
const [validationResult, fieldValidator] = validateRule(rule);
|
|
1872
|
-
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName)
|
|
2118
|
+
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName) continue;
|
|
1873
2119
|
const fieldData = getOption(fields, rule.field);
|
|
1874
|
-
|
|
2120
|
+
const processedRule = ruleProcessor(rule, {
|
|
1875
2121
|
...options,
|
|
1876
2122
|
parseNumbers: getParseNumberBoolean(fieldData?.inputType),
|
|
1877
2123
|
escapeQuotes: (rule.valueSource ?? "value") === "value",
|
|
1878
2124
|
fieldData
|
|
1879
2125
|
});
|
|
1880
|
-
|
|
2126
|
+
if (processedRule) {
|
|
2127
|
+
if (!firstRule && precedingCombinator) {
|
|
2128
|
+
processedRules.push(precedingCombinator);
|
|
2129
|
+
precedingCombinator = "";
|
|
2130
|
+
}
|
|
2131
|
+
firstRule = false;
|
|
2132
|
+
processedRules.push(processedRule);
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
const expression = processedRules.join(isRuleGroupType(rg) ? ` ${rg.combinator} ` : " ");
|
|
1881
2136
|
const [prefix, suffix] = rg.not || !outermost ? [`${rg.not ? "$not" : ""}(`, ")"] : ["", ""];
|
|
1882
2137
|
return expression ? `${prefix}${expression}${suffix}` : fallbackExpression;
|
|
1883
2138
|
};
|
|
@@ -1923,7 +2178,6 @@ const defaultRuleGroupProcessorJsonLogic = (ruleGroup, options) => {
|
|
|
1923
2178
|
*/
|
|
1924
2179
|
const defaultRuleGroupProcessorLDAP = (ruleGroup, options) => {
|
|
1925
2180
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
1926
|
-
const query = convertFromIC(ruleGroup);
|
|
1927
2181
|
const processRuleGroup = (rg, outermost) => {
|
|
1928
2182
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermost ? fallbackExpression : "";
|
|
1929
2183
|
const rules = rg.rules.map((rule) => {
|
|
@@ -1943,7 +2197,7 @@ const defaultRuleGroupProcessorLDAP = (ruleGroup, options) => {
|
|
|
1943
2197
|
const [prefix, suffix] = rules.length > 1 ? [`${notPrefix}(${rg.combinator === "or" ? "|" : "&"}`, `)${notSuffix}`] : [notPrefix, notSuffix];
|
|
1944
2198
|
return expression ? `${prefix}${expression}${suffix}` : fallbackExpression;
|
|
1945
2199
|
};
|
|
1946
|
-
return processRuleGroup(
|
|
2200
|
+
return processRuleGroup(convertFromIC(ruleGroup), true);
|
|
1947
2201
|
};
|
|
1948
2202
|
|
|
1949
2203
|
//#endregion
|
|
@@ -1998,20 +2252,46 @@ const defaultRuleGroupProcessorNL = (ruleGroup, options) => {
|
|
|
1998
2252
|
const processRuleGroup = (rg, outermostOrLonelyInGroup) => {
|
|
1999
2253
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : "";
|
|
2000
2254
|
const rg2 = isRuleGroupTypeIC(rg) && rg.rules.some((r) => typeof r === "string" && lc(r) === "xor") ? convertFromIC(rg) : rg;
|
|
2001
|
-
const processedRules =
|
|
2002
|
-
|
|
2003
|
-
|
|
2255
|
+
const processedRules = [];
|
|
2256
|
+
let precedingCombinator = "";
|
|
2257
|
+
let firstRule = true;
|
|
2258
|
+
for (const rule of rg2.rules) {
|
|
2259
|
+
if (typeof rule === "string") {
|
|
2260
|
+
precedingCombinator = `, ${translations[rule] ?? rule} `;
|
|
2261
|
+
continue;
|
|
2262
|
+
}
|
|
2263
|
+
if (isRuleGroup(rule)) {
|
|
2264
|
+
const processedGroup = processRuleGroup(rule, rg2.rules.length === 1 && !(rg2.not || /^xor$/i.test(rg2.combinator ?? "")));
|
|
2265
|
+
// istanbul ignore else
|
|
2266
|
+
if (processedGroup) {
|
|
2267
|
+
if (!firstRule && precedingCombinator) {
|
|
2268
|
+
processedRules.push(precedingCombinator);
|
|
2269
|
+
precedingCombinator = "";
|
|
2270
|
+
}
|
|
2271
|
+
firstRule = false;
|
|
2272
|
+
processedRules.push(processedGroup);
|
|
2273
|
+
}
|
|
2274
|
+
continue;
|
|
2275
|
+
}
|
|
2004
2276
|
const [validationResult, fieldValidator] = validateRule(rule);
|
|
2005
|
-
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName)
|
|
2277
|
+
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName) continue;
|
|
2006
2278
|
const escapeQuotes = (rule.valueSource ?? "value") === "value";
|
|
2007
2279
|
const fieldData = getOption(fields, rule.field);
|
|
2008
|
-
|
|
2280
|
+
const processedRule = ruleProcessor(rule, {
|
|
2009
2281
|
...options,
|
|
2010
2282
|
parseNumbers: getParseNumberBoolean(fieldData?.inputType),
|
|
2011
2283
|
escapeQuotes,
|
|
2012
2284
|
fieldData
|
|
2013
2285
|
});
|
|
2014
|
-
|
|
2286
|
+
if (processedRule) {
|
|
2287
|
+
if (!firstRule && precedingCombinator) {
|
|
2288
|
+
processedRules.push(precedingCombinator);
|
|
2289
|
+
precedingCombinator = "";
|
|
2290
|
+
}
|
|
2291
|
+
firstRule = false;
|
|
2292
|
+
processedRules.push(processedRule);
|
|
2293
|
+
}
|
|
2294
|
+
}
|
|
2015
2295
|
if (processedRules.length === 0) return fallbackExpression;
|
|
2016
2296
|
const isXOR = lc(rg2.combinator ?? "") === "xor";
|
|
2017
2297
|
const combinator = isXOR ? rg2.combinator.slice(1) : rg2.combinator;
|
|
@@ -2019,7 +2299,7 @@ const defaultRuleGroupProcessorNL = (ruleGroup, options) => {
|
|
|
2019
2299
|
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));
|
|
2020
2300
|
const prefix = mustWrap ? `${prefixTL} (`.trim() : "";
|
|
2021
2301
|
const suffix = mustWrap ? `) ${suffixTL}`.trim() : "";
|
|
2022
|
-
return `${prefix}${processedRules.
|
|
2302
|
+
return `${prefix}${processedRules.join(isRuleGroupType(rg2) ? `, ${translations[combinator] ?? combinator} ` : "")}${suffix}`;
|
|
2023
2303
|
};
|
|
2024
2304
|
return processRuleGroup(ruleGroup, true);
|
|
2025
2305
|
};
|
|
@@ -2069,11 +2349,37 @@ const defaultRuleGroupProcessorParameterized = (ruleGroup, options) => {
|
|
|
2069
2349
|
};
|
|
2070
2350
|
const processRuleGroup = (rg, outermostOrLonelyInGroup) => {
|
|
2071
2351
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : "";
|
|
2072
|
-
const processedRules =
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2352
|
+
const processedRules = [];
|
|
2353
|
+
let precedingCombinator = "";
|
|
2354
|
+
let firstRule = true;
|
|
2355
|
+
for (const rule of rg.rules) {
|
|
2356
|
+
if (typeof rule === "string") {
|
|
2357
|
+
precedingCombinator = rule;
|
|
2358
|
+
continue;
|
|
2359
|
+
}
|
|
2360
|
+
if (isRuleGroup(rule)) {
|
|
2361
|
+
const processedGroup = processRuleGroup(rule, rg.rules.length === 1);
|
|
2362
|
+
// istanbul ignore else
|
|
2363
|
+
if (processedGroup) {
|
|
2364
|
+
if (!firstRule && precedingCombinator) {
|
|
2365
|
+
processedRules.push(precedingCombinator);
|
|
2366
|
+
precedingCombinator = "";
|
|
2367
|
+
}
|
|
2368
|
+
firstRule = false;
|
|
2369
|
+
processedRules.push(processedGroup);
|
|
2370
|
+
}
|
|
2371
|
+
continue;
|
|
2372
|
+
}
|
|
2373
|
+
const processedRule = processRule(rule);
|
|
2374
|
+
if (processedRule) {
|
|
2375
|
+
if (!firstRule && precedingCombinator) {
|
|
2376
|
+
processedRules.push(precedingCombinator);
|
|
2377
|
+
precedingCombinator = "";
|
|
2378
|
+
}
|
|
2379
|
+
firstRule = false;
|
|
2380
|
+
processedRules.push(processedRule);
|
|
2381
|
+
}
|
|
2382
|
+
}
|
|
2077
2383
|
if (processedRules.length === 0) return fallbackExpression;
|
|
2078
2384
|
return `${rg.not ? "NOT " : ""}(${processedRules.join(isRuleGroupType(rg) ? ` ${rg.combinator} ` : " ")})`;
|
|
2079
2385
|
};
|
|
@@ -2182,20 +2488,46 @@ const defaultRuleGroupProcessorSQL = (ruleGroup, options) => {
|
|
|
2182
2488
|
const { fields, fallbackExpression, getParseNumberBoolean, placeholderFieldName, placeholderOperatorName, placeholderValueName, ruleProcessor, validateRule, validationMap } = options;
|
|
2183
2489
|
const processRuleGroup = (rg, outermostOrLonelyInGroup) => {
|
|
2184
2490
|
if (!isRuleOrGroupValid(rg, validationMap[rg.id ?? ""])) return outermostOrLonelyInGroup ? fallbackExpression : "";
|
|
2185
|
-
const processedRules =
|
|
2186
|
-
|
|
2187
|
-
|
|
2491
|
+
const processedRules = [];
|
|
2492
|
+
let precedingCombinator = "";
|
|
2493
|
+
let firstRule = true;
|
|
2494
|
+
for (const rule of rg.rules) {
|
|
2495
|
+
if (typeof rule === "string") {
|
|
2496
|
+
precedingCombinator = rule;
|
|
2497
|
+
continue;
|
|
2498
|
+
}
|
|
2499
|
+
if (isRuleGroup(rule)) {
|
|
2500
|
+
const processedGroup = processRuleGroup(rule, rg.rules.length === 1);
|
|
2501
|
+
// istanbul ignore else
|
|
2502
|
+
if (processedGroup) {
|
|
2503
|
+
if (!firstRule && precedingCombinator) {
|
|
2504
|
+
processedRules.push(precedingCombinator);
|
|
2505
|
+
precedingCombinator = "";
|
|
2506
|
+
}
|
|
2507
|
+
firstRule = false;
|
|
2508
|
+
processedRules.push(processedGroup);
|
|
2509
|
+
}
|
|
2510
|
+
continue;
|
|
2511
|
+
}
|
|
2188
2512
|
const [validationResult, fieldValidator] = validateRule(rule);
|
|
2189
|
-
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName)
|
|
2513
|
+
if (!isRuleOrGroupValid(rule, validationResult, fieldValidator) || rule.field === placeholderFieldName || rule.operator === placeholderOperatorName || placeholderValueName !== void 0 && rule.value === placeholderValueName) continue;
|
|
2190
2514
|
const escapeQuotes = (rule.valueSource ?? "value") === "value";
|
|
2191
2515
|
const fieldData = getOption(fields, rule.field);
|
|
2192
|
-
|
|
2516
|
+
const processedRule = ruleProcessor(rule, {
|
|
2193
2517
|
...options,
|
|
2194
2518
|
parseNumbers: getParseNumberBoolean(fieldData?.inputType),
|
|
2195
2519
|
escapeQuotes,
|
|
2196
2520
|
fieldData
|
|
2197
2521
|
});
|
|
2198
|
-
|
|
2522
|
+
if (processedRule) {
|
|
2523
|
+
if (!firstRule && precedingCombinator) {
|
|
2524
|
+
processedRules.push(precedingCombinator);
|
|
2525
|
+
precedingCombinator = "";
|
|
2526
|
+
}
|
|
2527
|
+
firstRule = false;
|
|
2528
|
+
processedRules.push(processedRule);
|
|
2529
|
+
}
|
|
2530
|
+
}
|
|
2199
2531
|
if (processedRules.length === 0) return fallbackExpression;
|
|
2200
2532
|
return `${rg.not ? "NOT " : ""}(${processedRules.join(isRuleGroupType(rg) ? ` ${rg.combinator} ` : " ")})`;
|
|
2201
2533
|
};
|
|
@@ -2473,10 +2805,7 @@ const defaultRuleProcessorJsonLogic = (rule, options = {}) => {
|
|
|
2473
2805
|
case "null":
|
|
2474
2806
|
case "notnull": return { [`${operatorLC === "notnull" ? "!" : "="}=`]: [fieldObject, null] };
|
|
2475
2807
|
case "in":
|
|
2476
|
-
case "notin": {
|
|
2477
|
-
const valueAsArray = toArray(value).map((v) => fieldOrNumberRenderer(v));
|
|
2478
|
-
return negateIfNotOp(operatorLC, { in: [fieldObject, valueAsArray] });
|
|
2479
|
-
}
|
|
2808
|
+
case "notin": return negateIfNotOp(operatorLC, { in: [fieldObject, toArray(value).map((v) => fieldOrNumberRenderer(v))] });
|
|
2480
2809
|
case "between":
|
|
2481
2810
|
case "notbetween": {
|
|
2482
2811
|
const valueAsArray = toArray(value);
|
|
@@ -2507,20 +2836,11 @@ const defaultRuleProcessorJsonLogic = (rule, options = {}) => {
|
|
|
2507
2836
|
return false;
|
|
2508
2837
|
}
|
|
2509
2838
|
case "contains":
|
|
2510
|
-
case "doesnotcontain": {
|
|
2511
|
-
const jsonRule = { in: [fieldOrNumberRenderer(value), fieldObject] };
|
|
2512
|
-
return negateIfNotOp(operatorLC, jsonRule);
|
|
2513
|
-
}
|
|
2839
|
+
case "doesnotcontain": return negateIfNotOp(operatorLC, { in: [fieldOrNumberRenderer(value), fieldObject] });
|
|
2514
2840
|
case "beginswith":
|
|
2515
|
-
case "doesnotbeginwith": {
|
|
2516
|
-
const jsonRule = { startsWith: [fieldObject, fieldOrNumberRenderer(value)] };
|
|
2517
|
-
return negateIfNotOp(operatorLC, jsonRule);
|
|
2518
|
-
}
|
|
2841
|
+
case "doesnotbeginwith": return negateIfNotOp(operatorLC, { startsWith: [fieldObject, fieldOrNumberRenderer(value)] });
|
|
2519
2842
|
case "endswith":
|
|
2520
|
-
case "doesnotendwith": {
|
|
2521
|
-
const jsonRule = { endsWith: [fieldObject, fieldOrNumberRenderer(value)] };
|
|
2522
|
-
return negateIfNotOp(operatorLC, jsonRule);
|
|
2523
|
-
}
|
|
2843
|
+
case "doesnotendwith": return negateIfNotOp(operatorLC, { endsWith: [fieldObject, fieldOrNumberRenderer(value)] });
|
|
2524
2844
|
}
|
|
2525
2845
|
return false;
|
|
2526
2846
|
};
|
|
@@ -2555,10 +2875,7 @@ const defaultRuleProcessorLDAP = (rule, options = {}) => {
|
|
|
2555
2875
|
case "null":
|
|
2556
2876
|
case "notnull": return negateIf(`(${field}=*)`, operatorLC === "notnull");
|
|
2557
2877
|
case "in":
|
|
2558
|
-
case "notin": {
|
|
2559
|
-
const valueAsArray = toArray(value);
|
|
2560
|
-
return negateIf(`(|${valueAsArray.map((val) => `(${field}=${ldapEscape(val)})`).join("")})`, operatorLC === "notin");
|
|
2561
|
-
}
|
|
2878
|
+
case "notin": return negateIf(`(|${toArray(value).map((val) => `(${field}=${ldapEscape(val)})`).join("")})`, operatorLC === "notin");
|
|
2562
2879
|
case "between":
|
|
2563
2880
|
case "notbetween": {
|
|
2564
2881
|
const valueAsArray = toArray(value);
|
|
@@ -2726,10 +3043,9 @@ const defaultRuleProcessorNL = (rule, opts) => {
|
|
|
2726
3043
|
});
|
|
2727
3044
|
const operatorLC = lc(operator);
|
|
2728
3045
|
if ((operatorLC === "in" || operatorLC === "notin" || operatorLC === "between" || operatorLC === "notbetween") && !value) return "";
|
|
2729
|
-
const processedOperator = operatorProcessor(rule, opts);
|
|
2730
3046
|
const wordOrderMap = {
|
|
2731
3047
|
S: processedField,
|
|
2732
|
-
V:
|
|
3048
|
+
V: operatorProcessor(rule, opts),
|
|
2733
3049
|
O: value
|
|
2734
3050
|
};
|
|
2735
3051
|
return normalizeConstituentWordOrder(wordOrder).map((term) => `${wordOrderMap[term]}`).join(" ").trim();
|
|
@@ -3495,6 +3811,26 @@ const getValueSourcesUtil = (fieldData, operator, getValueSources) => {
|
|
|
3495
3811
|
});
|
|
3496
3812
|
};
|
|
3497
3813
|
|
|
3814
|
+
//#endregion
|
|
3815
|
+
//#region src/utils/mergeAnyTranslations.ts
|
|
3816
|
+
/**
|
|
3817
|
+
* Merges any number of partial translations into a single definition.
|
|
3818
|
+
*/
|
|
3819
|
+
const mergeAnyTranslations = (base, ...otherTranslations) => produce(base, (draft) => {
|
|
3820
|
+
for (const translations of otherTranslations)
|
|
3821
|
+
// istanbul ignore else
|
|
3822
|
+
if (translations) for (const t of objectKeys(translations)) if (draft[t]) Object.assign(draft[t], translations[t]);
|
|
3823
|
+
else Object.assign(draft, { [t]: translations[t] });
|
|
3824
|
+
});
|
|
3825
|
+
const mergeAnyTranslation = (el, keyPropContextMap, defaults) => {
|
|
3826
|
+
const finalKeys = objectEntries(keyPropContextMap).map(([key, [pT, cT]]) => [key, pT ?? cT ?? defaults?.[el]?.[key]]).filter((k) => !!k[1]);
|
|
3827
|
+
if (finalKeys.length > 0 || defaults) {
|
|
3828
|
+
const defaultProperties = defaults?.[el] ?? {};
|
|
3829
|
+
const finalObject = Object.assign({}, defaultProperties, Object.fromEntries(finalKeys));
|
|
3830
|
+
return { [el]: finalObject };
|
|
3831
|
+
}
|
|
3832
|
+
};
|
|
3833
|
+
|
|
3498
3834
|
//#endregion
|
|
3499
3835
|
//#region src/utils/mergeClassnames.ts
|
|
3500
3836
|
const joinClassnamesByName = (name, args) => clsx(args.map((c) => clsx(c?.[name])));
|
|
@@ -3522,6 +3858,9 @@ const mergeClassnames = (...args) => ({
|
|
|
3522
3858
|
dragHandle: joinClassnamesByName("dragHandle", args),
|
|
3523
3859
|
lockRule: joinClassnamesByName("lockRule", args),
|
|
3524
3860
|
lockGroup: joinClassnamesByName("lockGroup", args),
|
|
3861
|
+
muteRule: joinClassnamesByName("muteRule", args),
|
|
3862
|
+
muteGroup: joinClassnamesByName("muteGroup", args),
|
|
3863
|
+
muted: joinClassnamesByName("muted", args),
|
|
3525
3864
|
valueSource: joinClassnamesByName("valueSource", args),
|
|
3526
3865
|
actionElement: joinClassnamesByName("actionElement", args),
|
|
3527
3866
|
valueSelector: joinClassnamesByName("valueSelector", args),
|
|
@@ -3542,19 +3881,27 @@ const mergeClassnames = (...args) => ({
|
|
|
3542
3881
|
});
|
|
3543
3882
|
|
|
3544
3883
|
//#endregion
|
|
3545
|
-
//#region src/utils/
|
|
3884
|
+
//#region src/utils/preferProp.ts
|
|
3885
|
+
const preferPropDefaultTrue = (prop, context) => prop === false ? false : prop ? true : !(context === false);
|
|
3886
|
+
const preferPropDefaultFalse = (prop, context) => prop ? true : prop === false ? false : !!context;
|
|
3546
3887
|
/**
|
|
3547
|
-
*
|
|
3548
|
-
*
|
|
3549
|
-
* [Original source](https://github.com/sindresorhus/ts-extras/blob/44f57392c5f027268330771996c4fdf9260b22d6/source/object-keys.ts)
|
|
3888
|
+
* For given default, prop, and context values, return the first provided of prop,
|
|
3889
|
+
* context, and default, in that order.
|
|
3550
3890
|
*/
|
|
3551
|
-
const
|
|
3891
|
+
const preferProp = (def, prop, context, doNotFinalize) => !doNotFinalize ? def ? preferPropDefaultTrue(prop, context) : preferPropDefaultFalse(prop, context) : prop ?? context;
|
|
3552
3892
|
/**
|
|
3553
|
-
*
|
|
3554
|
-
*
|
|
3555
|
-
* [Original source](https://github.com/sindresorhus/ts-extras/blob/44f57392c5f027268330771996c4fdf9260b22d6/source/object-entries.ts)
|
|
3893
|
+
* For given default, prop, and context values, return the first provided of prop,
|
|
3894
|
+
* context, and default, in that order.
|
|
3556
3895
|
*/
|
|
3557
|
-
const
|
|
3896
|
+
const preferAnyProp = (def, prop, context) => prop !== void 0 && prop != null ? prop : context !== void 0 && context != null ? context : def;
|
|
3897
|
+
/**
|
|
3898
|
+
* For a given set of defaults, props, and context values, return the first provided of prop,
|
|
3899
|
+
* context, and default—in that order—for each property in the defaults object.
|
|
3900
|
+
*/
|
|
3901
|
+
const preferFlagProps = (props = {}, contextVals = {}, finalize) => objectEntries(queryBuilderFlagDefaults).reduce((acc, [key, def]) => {
|
|
3902
|
+
acc[key] = preferProp(def, props[key], contextVals[key], !finalize);
|
|
3903
|
+
return acc;
|
|
3904
|
+
}, {});
|
|
3558
3905
|
|
|
3559
3906
|
//#endregion
|
|
3560
3907
|
//#region src/utils/prepareQueryObjects.ts
|
|
@@ -3665,12 +4012,11 @@ const update = (query, prop, value, pathOrID, { resetOnFieldChange = true, reset
|
|
|
3665
4012
|
resetValueSource = true;
|
|
3666
4013
|
resetValue = true;
|
|
3667
4014
|
}
|
|
3668
|
-
const
|
|
4015
|
+
const defaultValueSource = getFirstOption(getValueSourcesUtil({
|
|
3669
4016
|
name: ruleOrGroup.field,
|
|
3670
4017
|
value: ruleOrGroup.field,
|
|
3671
4018
|
label: ""
|
|
3672
|
-
}, ruleOrGroup.operator, getValueSources);
|
|
3673
|
-
const defaultValueSource = getFirstOption(valueSources);
|
|
4019
|
+
}, ruleOrGroup.operator, getValueSources));
|
|
3674
4020
|
if (resetValueSource && ruleOrGroup.valueSource && defaultValueSource !== ruleOrGroup.valueSource || prop === "valueSource" && value !== ruleOrGroup.valueSource) {
|
|
3675
4021
|
resetValue = !!ruleOrGroup.valueSource || !ruleOrGroup.valueSource && value !== defaultValueSource;
|
|
3676
4022
|
ruleOrGroup.valueSource = resetValueSource ? defaultValueSource : value;
|
|
@@ -3715,8 +4061,7 @@ const getNextPath = (query, currentPath, newPathOrShiftDirection) => {
|
|
|
3715
4061
|
return [...getParentPath(parentPath), parentPath.at(-1) + 1];
|
|
3716
4062
|
} else {
|
|
3717
4063
|
const evaluationPath = [...getParentPath(currentPath), currentPath.at(-1) + (ic ? 2 : 1)];
|
|
3718
|
-
|
|
3719
|
-
if (isRuleGroup(entityToEvaluate)) return [...evaluationPath, 0];
|
|
4064
|
+
if (isRuleGroup(findPath(evaluationPath, query))) return [...evaluationPath, 0];
|
|
3720
4065
|
else return [...getParentPath(currentPath), currentPath.at(-1) + (ic ? 3 : 2)];
|
|
3721
4066
|
}
|
|
3722
4067
|
return currentPath;
|
|
@@ -3750,8 +4095,7 @@ const move = (query, oldPathOrID, newPath, { clone = false, combinators = defaul
|
|
|
3750
4095
|
const newNewPath = [...nextPath];
|
|
3751
4096
|
const commonAncestorPath = getCommonAncestorPath(oldPath, nextPath);
|
|
3752
4097
|
if (!clone && oldPath.length === commonAncestorPath.length + 1 && nextPath[commonAncestorPath.length] > oldPath[commonAncestorPath.length]) newNewPath[commonAncestorPath.length] -= independentCombinators ? 2 : 1;
|
|
3753
|
-
const
|
|
3754
|
-
const parentToInsertInto = findPath(newNewParentPath, draft);
|
|
4098
|
+
const parentToInsertInto = findPath(getParentPath(newNewPath), draft);
|
|
3755
4099
|
const newIndex = newNewPath.at(-1);
|
|
3756
4100
|
/**
|
|
3757
4101
|
* This function 1) glosses over the need for type assertions to splice directly
|
|
@@ -3760,15 +4104,9 @@ const move = (query, oldPathOrID, newPath, { clone = false, combinators = defaul
|
|
|
3760
4104
|
const insertRuleOrGroup = (...args) => parentToInsertInto.rules.splice(newIndex, 0, ...args);
|
|
3761
4105
|
if (parentToInsertInto.rules.length === 0 || !independentCombinators) insertRuleOrGroup(ruleOrGroup);
|
|
3762
4106
|
else if (newIndex === 0) if (ruleToRemoveIndex === 0 && oldNextCombinator) insertRuleOrGroup(ruleOrGroup, oldNextCombinator);
|
|
3763
|
-
else
|
|
3764
|
-
const newNextCombinator = parentToInsertInto.rules[1] ?? oldPrevCombinator ?? getFirstOption(combinators);
|
|
3765
|
-
insertRuleOrGroup(ruleOrGroup, newNextCombinator);
|
|
3766
|
-
}
|
|
4107
|
+
else insertRuleOrGroup(ruleOrGroup, parentToInsertInto.rules[1] ?? oldPrevCombinator ?? getFirstOption(combinators));
|
|
3767
4108
|
else if (oldPrevCombinator) insertRuleOrGroup(oldPrevCombinator, ruleOrGroup);
|
|
3768
|
-
else
|
|
3769
|
-
const newPrevCombinator = parentToInsertInto.rules[newIndex - 2] ?? oldNextCombinator ?? getFirstOption(combinators);
|
|
3770
|
-
insertRuleOrGroup(newPrevCombinator, ruleOrGroup);
|
|
3771
|
-
}
|
|
4109
|
+
else insertRuleOrGroup(parentToInsertInto.rules[newIndex - 2] ?? oldNextCombinator ?? getFirstOption(combinators), ruleOrGroup);
|
|
3772
4110
|
});
|
|
3773
4111
|
};
|
|
3774
4112
|
/**
|
|
@@ -3791,17 +4129,11 @@ const insert = (query, ruleOrGroup, path, { combinators = defaultCombinators, co
|
|
|
3791
4129
|
if (parentToInsertInto.rules.length === 0 || !independentCombinators) insertRuleOrGroup(newIndex, rorg);
|
|
3792
4130
|
else if (replace && independentCombinators) insertRuleOrGroup(newIndex + newIndex % 2, rorg);
|
|
3793
4131
|
else if (newIndex === 0) if (rorg.path?.at(-1) === 0 && combinatorSucceeding) insertRuleOrGroup(newIndex, rorg, combinatorSucceeding);
|
|
3794
|
-
else
|
|
3795
|
-
const newNextCombinator = parentToInsertInto.rules[1] ?? combinatorPreceding ?? getFirstOption(combinators);
|
|
3796
|
-
insertRuleOrGroup(newIndex, rorg, newNextCombinator);
|
|
3797
|
-
}
|
|
4132
|
+
else insertRuleOrGroup(newIndex, rorg, parentToInsertInto.rules[1] ?? combinatorPreceding ?? getFirstOption(combinators));
|
|
3798
4133
|
else {
|
|
3799
4134
|
const normalizedNewIndex = newIndex % 2 === 0 ? newIndex - 1 : newIndex;
|
|
3800
4135
|
if (combinatorPreceding) insertRuleOrGroup(normalizedNewIndex, combinatorPreceding, rorg);
|
|
3801
|
-
else
|
|
3802
|
-
const newPrevCombinator = parentToInsertInto.rules[normalizedNewIndex - 2] ?? combinatorSucceeding ?? getFirstOption(combinators);
|
|
3803
|
-
insertRuleOrGroup(normalizedNewIndex, newPrevCombinator, rorg);
|
|
3804
|
-
}
|
|
4136
|
+
else insertRuleOrGroup(normalizedNewIndex, parentToInsertInto.rules[normalizedNewIndex - 2] ?? combinatorSucceeding ?? getFirstOption(combinators), rorg);
|
|
3805
4137
|
}
|
|
3806
4138
|
});
|
|
3807
4139
|
/**
|
|
@@ -3835,8 +4167,7 @@ const group = (query, sourcePathOrID, targetPathOrID, { clone = false, combinato
|
|
|
3835
4167
|
const newNewPath = [...nextPath];
|
|
3836
4168
|
const commonAncestorPath = getCommonAncestorPath(sourcePath, nextPath);
|
|
3837
4169
|
if (!clone && sourcePath.length === commonAncestorPath.length + 1 && nextPath[commonAncestorPath.length] > sourcePath[commonAncestorPath.length]) newNewPath[commonAncestorPath.length] -= independentCombinators ? 2 : 1;
|
|
3838
|
-
const
|
|
3839
|
-
const parentOfTargetPath = findPath(newNewParentPath, draft);
|
|
4170
|
+
const parentOfTargetPath = findPath(getParentPath(newNewPath), draft);
|
|
3840
4171
|
const targetPathIndex = newNewPath.at(-1);
|
|
3841
4172
|
parentOfTargetPath.rules.splice(targetPathIndex, 1, prepareRuleOrGroup(independentCombinators ? { rules: [
|
|
3842
4173
|
targetRuleOrGroup,
|
|
@@ -3850,5 +4181,5 @@ const group = (query, sourcePathOrID, targetPathOrID, { clone = false, combinato
|
|
|
3850
4181
|
};
|
|
3851
4182
|
|
|
3852
4183
|
//#endregion
|
|
3853
|
-
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, isRuleType, 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 };
|
|
4184
|
+
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, preferAnyProp, preferFlagProps, preferProp, prepareOptionList, prepareRule, prepareRuleGroup, prepareRuleOrGroup, prismaFallback, prismaOperators, processMatchMode, queryBuilderFlagDefaults, regenerateID, regenerateIDs, remove, rootPath, shouldRenderAsNumber, splitBy, sqlDialectPresets, standardClassnames, toArray, toFlatOptionArray, toFullOption, toFullOptionList, toFullOptionMap, transformQuery, trimIfString, uniqByIdentifier, uniqByName, uniqOptGroups, uniqOptList, update };
|
|
3854
4185
|
//# sourceMappingURL=react-querybuilder_core.mjs.map
|