@react-querybuilder/core 8.22.5 → 8.23.1

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.
Files changed (120) hide show
  1. package/derivations/package.json +4 -0
  2. package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +2078 -1665
  3. package/dist/cjs/react-querybuilder_core.cjs.development.js +1293 -422
  4. package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
  5. package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +2078 -1665
  6. package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -1
  7. package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
  8. package/dist/{convertQuery-Cw76XFIn.js → convertQuery-BLT0GIhM.js} +17 -8
  9. package/dist/{convertQuery-Cw76XFIn.js.map → convertQuery-BLT0GIhM.js.map} +1 -1
  10. package/dist/{convertQuery-D_4J7E-Z.mjs → convertQuery-DaXv3h7S.mjs} +6 -3
  11. package/dist/{convertQuery-D_4J7E-Z.mjs.map → convertQuery-DaXv3h7S.mjs.map} +1 -1
  12. package/dist/derivations.d.mts +2902 -0
  13. package/dist/derivations.d.ts +2902 -0
  14. package/dist/derivations.js +2845 -0
  15. package/dist/derivations.js.map +1 -0
  16. package/dist/derivations.mjs +2678 -0
  17. package/dist/derivations.mjs.map +1 -0
  18. package/dist/formatQuery.d.mts +2 -895
  19. package/dist/formatQuery.d.ts +2 -895
  20. package/dist/formatQuery.js +120 -140
  21. package/dist/formatQuery.js.map +1 -1
  22. package/dist/formatQuery.mjs +8 -28
  23. package/dist/formatQuery.mjs.map +1 -1
  24. package/dist/{import-DVWI7Fdh.d.mts → import-BdKPtLzo.d.mts} +2 -2
  25. package/dist/{import-6ExjhifL.d.ts → import-BfZTwhp2.d.ts} +2 -2
  26. package/dist/{index-CX9mehdL.d.mts → index-DOIE2pwx.d.mts} +274 -3
  27. package/dist/{index-CX9mehdL.d.ts → index-DOIE2pwx.d.ts} +274 -3
  28. package/dist/index-OF2Q1gTp.d.mts +895 -0
  29. package/dist/index-XueTy_XQ.d.ts +895 -0
  30. package/dist/isRuleOrGroupValid-CIMZNkt4.mjs +27 -0
  31. package/dist/isRuleOrGroupValid-CIMZNkt4.mjs.map +1 -0
  32. package/dist/isRuleOrGroupValid-CtUf4_4x.js +38 -0
  33. package/dist/isRuleOrGroupValid-CtUf4_4x.js.map +1 -0
  34. package/dist/{isRuleGroup-CqLThsbu.mjs → objectUtils-DDZ-KhV5.mjs} +25 -2
  35. package/dist/objectUtils-DDZ-KhV5.mjs.map +1 -0
  36. package/dist/{isRuleGroup-0JNiQgLg.js → objectUtils-DfnEmDSV.js} +48 -1
  37. package/dist/objectUtils-DfnEmDSV.js.map +1 -0
  38. package/dist/parseCEL.d.mts +2 -2
  39. package/dist/parseCEL.d.ts +2 -2
  40. package/dist/parseCEL.js +19 -16
  41. package/dist/parseCEL.js.map +1 -1
  42. package/dist/parseCEL.mjs +12 -9
  43. package/dist/parseCEL.mjs.map +1 -1
  44. package/dist/parseCypher.d.mts +1 -1
  45. package/dist/parseCypher.d.ts +1 -1
  46. package/dist/parseGremlin.d.mts +1 -1
  47. package/dist/parseGremlin.d.ts +1 -1
  48. package/dist/parseJSONata.d.mts +2 -2
  49. package/dist/parseJSONata.d.ts +2 -2
  50. package/dist/parseJSONata.js +17 -14
  51. package/dist/parseJSONata.js.map +1 -1
  52. package/dist/parseJSONata.mjs +11 -8
  53. package/dist/parseJSONata.mjs.map +1 -1
  54. package/dist/parseJsonLogic.d.mts +2 -2
  55. package/dist/parseJsonLogic.d.ts +2 -2
  56. package/dist/parseJsonLogic.js +38 -38
  57. package/dist/parseJsonLogic.js.map +1 -1
  58. package/dist/parseJsonLogic.mjs +5 -5
  59. package/dist/parseMongoDB.d.mts +2 -2
  60. package/dist/parseMongoDB.d.ts +2 -2
  61. package/dist/parseMongoDB.js +50 -47
  62. package/dist/parseMongoDB.js.map +1 -1
  63. package/dist/parseMongoDB.mjs +35 -32
  64. package/dist/parseMongoDB.mjs.map +1 -1
  65. package/dist/parseSPARQL.d.mts +1 -1
  66. package/dist/parseSPARQL.d.ts +1 -1
  67. package/dist/parseSQL.d.mts +2 -2
  68. package/dist/parseSQL.d.ts +2 -2
  69. package/dist/parseSQL.js +27 -23
  70. package/dist/parseSQL.js.map +1 -1
  71. package/dist/parseSQL.mjs +21 -17
  72. package/dist/parseSQL.mjs.map +1 -1
  73. package/dist/parseSpEL.d.mts +2 -2
  74. package/dist/parseSpEL.d.ts +2 -2
  75. package/dist/parseSpEL.js +17 -14
  76. package/dist/parseSpEL.js.map +1 -1
  77. package/dist/parseSpEL.mjs +13 -10
  78. package/dist/parseSpEL.mjs.map +1 -1
  79. package/dist/parserUtils-BKPstAaO.mjs +30 -0
  80. package/dist/parserUtils-BKPstAaO.mjs.map +1 -0
  81. package/dist/parserUtils-DbBXyAht.js +41 -0
  82. package/dist/parserUtils-DbBXyAht.js.map +1 -0
  83. package/dist/{prepareQueryObjects-BnGL91Tt.js → prepareQueryObjects-Dj9cTl9D.js} +90 -63
  84. package/dist/prepareQueryObjects-Dj9cTl9D.js.map +1 -0
  85. package/dist/{prepareQueryObjects-ChINDIap.mjs → prepareQueryObjects-Dmyf3Wi_.mjs} +56 -59
  86. package/dist/prepareQueryObjects-Dmyf3Wi_.mjs.map +1 -0
  87. package/dist/react-querybuilder_core.d.mts +2078 -1665
  88. package/dist/react-querybuilder_core.legacy-esm.d.ts +2078 -1665
  89. package/dist/react-querybuilder_core.legacy-esm.js +1445 -635
  90. package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
  91. package/dist/react-querybuilder_core.mjs +1288 -424
  92. package/dist/react-querybuilder_core.mjs.map +1 -1
  93. package/dist/react-querybuilder_core.production.d.mts +2078 -1665
  94. package/dist/react-querybuilder_core.production.mjs +1 -1
  95. package/dist/react-querybuilder_core.production.mjs.map +1 -1
  96. package/dist/transformQuery-B7d9AWUf.d.mts +116 -0
  97. package/dist/transformQuery-BXDiUBGB.d.ts +116 -0
  98. package/dist/transformQuery.d.mts +2 -116
  99. package/dist/transformQuery.d.ts +2 -116
  100. package/dist/transformQuery.js +3 -4
  101. package/dist/transformQuery.js.map +1 -1
  102. package/dist/transformQuery.mjs +1 -2
  103. package/dist/transformQuery.mjs.map +1 -1
  104. package/dist/utils-CP5Jqy1P.mjs +1294 -0
  105. package/dist/utils-CP5Jqy1P.mjs.map +1 -0
  106. package/dist/utils-e-7KHkjV.js +1779 -0
  107. package/dist/utils-e-7KHkjV.js.map +1 -0
  108. package/package.json +33 -22
  109. package/dist/isRuleGroup-0JNiQgLg.js.map +0 -1
  110. package/dist/isRuleGroup-CqLThsbu.mjs.map +0 -1
  111. package/dist/objectUtils-Cr02aGxb.js +0 -27
  112. package/dist/objectUtils-Cr02aGxb.js.map +0 -1
  113. package/dist/objectUtils-DBlmJgBf.mjs +0 -16
  114. package/dist/objectUtils-DBlmJgBf.mjs.map +0 -1
  115. package/dist/prepareQueryObjects-BnGL91Tt.js.map +0 -1
  116. package/dist/prepareQueryObjects-ChINDIap.mjs.map +0 -1
  117. package/dist/utils-4k-j5FBa.mjs +0 -537
  118. package/dist/utils-4k-j5FBa.mjs.map +0 -1
  119. package/dist/utils-C79dxwZb.js +0 -752
  120. package/dist/utils-C79dxwZb.js.map +0 -1
@@ -0,0 +1,2902 @@
1
+ import { $ as ValueProcessorOptions, $t as DefaultRuleGroupType, A as FormatQueryFinalOptions, An as SetRequired, At as ValidationMap, B as RQBJsonLogicStartsWith, Bt as RuleGroupTypeAny, C as DiagnosticEntry, Cn as OptionList, Ct as ValueSource, D as ExportFormat, Dn as ToFullOption, Dt as WithRequired, E as DiagnosticsStats, En as ToFlexibleOption, Et as ValueSources, F as NLTranslations, Fn as IsNever, Ft as DefaultRuleOrGroupArray, G as RuleGroupICDiagnosticsArray, Gt as CommonRuleAndGroupProperties, H as RuleDiagnosticsResult, Ht as RuleOrGroupArray, I as ParameterizedNamedSQL, In as IsAny, It as GenericizeRuleGroupType, J as RuleProcessor, Jt as DefaultCombinatorName, K as RuleGroupICDiagnosticsResult, Kt as DefaultCombinator, L as ParameterizedSQL, Lt as GetRuleGroupType, M as FormatQueryValidateRule, Mt as DefaultRuleGroupICArray, N as GroupVariantCondition, Nn as Simplify, Nt as DefaultRuleGroupTypeAny, O as ExportObjectFormats, On as ValueOption, Ot as QueryValidator, P as NLTranslationKey, Pn as If, Pt as DefaultRuleGroupTypeIC, Q as ValueProcessorLegacy, Qt as DefaultRuleGroupArray, R as RQBJsonLogic, Rt as GetRuleTypeFromGroupWithFieldAndOperator, S as ConstituentWordOrderString, Sn as OptionGroup, St as ValueEditorType, T as DiagnosticsResult, Tn as StringUnionToFullOptionArray, Tt as ValueSourceFullOptions, U as RuleGroupDiagnosticsArray, Ut as ToRuleGroupType, V as RQBJsonLogicVar, Vt as RuleGroupTypeIC, W as RuleGroupDiagnosticsResult, Wt as ToRuleGroupTypeIC, X as ValueProcessor, Xt as DefaultOperator, Y as SQLPreset, Yt as DefaultCombinatorNameExtended, Z as ValueProcessorByRule, Zt as DefaultOperatorName, _ as JsonLogicSome, _n as FullOptionRecord, _t as ParseNumberMethod, a as JsonLogicGreaterThan, an as UpdateableProperties, at as CombinatorByValue, b as JsonLogicVar, bn as NameLabelPair, bt as RemoveNullability, c as JsonLogicInString, cn as BaseOption, ct as FullCombinator, d as JsonLogicNegation, dn as FlexibleOptionGroup, dt as InputType, en as DefaultRuleType, et as AccessibleDescriptionGenerator, f as JsonLogicNone, fn as FlexibleOptionList, ft as MatchConfig, g as JsonLogicRulesLogic, gn as FullOptionMap, gt as OperatorByValue, h as JsonLogicReservedOperations, hn as FullOptionList, ht as Operator, i as JsonLogicEqual, in as UpdateValueMap, it as Combinator, j as FormatQueryOptions, jn as Except, jt as ValidationResult, k as ExportOperatorMap, kn as WithUnknownIndex, kt as RuleValidator, l as JsonLogicLessThan, ln as BaseOptionMap, lt as FullField, m as JsonLogicOr, mn as FullOption, mt as MatchModeOptions, n as JsonLogicAnd, nn as RuleGroupType, nt as Arity, o as JsonLogicGreaterThanOrEqual, on as ExpressionNode, ot as Field, p as JsonLogicNotEqual, pn as FlexibleOptionListProp, pt as MatchMode, q as RuleGroupProcessor, qt as DefaultCombinatorExtended, r as JsonLogicDoubleNegation, rn as RuleType, rt as Classname, s as JsonLogicInArray, sn as BaseFullOption, st as FieldByValue, t as JsonLogicAll, tn as RuleGroupArray, tt as ActionElementEventHandler, u as JsonLogicLessThanOrEqual, un as FlexibleOption, ut as FullOperator, v as JsonLogicStrictEqual, vn as GetOptionIdentifierType, vt as ParseNumbersPropConfig, w as DiagnosticsFieldSummaryEntry, wn as StringUnionToFlexibleOptionArray, wt as ValueSourceFlexibleOptions, x as ConstituentWordOrder, xn as Option, xt as ValueChangeEventHandler, y as JsonLogicStrictNotEqual, yn as GetOptionType, yt as Path, z as RQBJsonLogicEndsWith, zt as RuleGroupICArray } from "./index-DOIE2pwx.js";
2
+ import "./index-XueTy_XQ.js";
3
+ import { n as transformQuery, t as TransformQueryOptions } from "./transformQuery-BXDiUBGB.js";
4
+ import "immer";
5
+ //#region src/controlPropKeys.d.ts
6
+ /**
7
+ * Runtime data describing the set of query builder controls and the props each one receives.
8
+ *
9
+ * These live in `@react-querybuilder/core` (not `react-querybuilder`) so that non-React ports
10
+ * can consume them without a React dependency.
11
+ *
12
+ * Nothing here can drift from the React implementation unnoticed:
13
+ * `react-querybuilder`'s `types/controlPropKeys.test.ts` gates {@link controlKeys} against
14
+ * `defaultControlElements` and `ControlElementsProp`, and every entry of
15
+ * {@link controlPropKeys} against the corresponding props interface—both at runtime and at
16
+ * compile time, in both directions.
17
+ */
18
+ /**
19
+ * The name of every query builder control, alphabetized.
20
+ *
21
+ * @group Props
22
+ */
23
+ declare const controlKeys: readonly ["actionElement", "addGroupAction", "addRuleAction", "cloneGroupAction", "cloneRuleAction", "combinatorSelector", "dragHandle", "fieldSelector", "inlineCombinator", "lockGroupAction", "lockRuleAction", "matchModeEditor", "muteGroupAction", "muteRuleAction", "notToggle", "operatorSelector", "removeGroupAction", "removeRuleAction", "rule", "ruleGroup", "ruleGroupBodyElements", "ruleGroupHeaderElements", "shiftActions", "undoRedoActions", "valueEditor", "valueSelector", "valueSourceSelector"];
24
+ /**
25
+ * The name of a query builder control.
26
+ *
27
+ * @group Props
28
+ */
29
+ type ControlKey = (typeof controlKeys)[number];
30
+ /**
31
+ * The full set of prop names each default control receives. Ports can use this to declare
32
+ * every prop explicitly instead of relying on fall-through/attribute inheritance.
33
+ *
34
+ * Each array is the complete, alphabetized key set of the control's props interface in
35
+ * `react-querybuilder`. The lists are written out in full rather than composed from shared
36
+ * bases because `--isolatedDeclarations` cannot infer array types built with spreads. A
37
+ * compile-time gate in `react-querybuilder` (`types/controlPropKeys.test.ts`) fails the build
38
+ * if any list drifts from its interface in either direction.
39
+ *
40
+ * @group Props
41
+ */
42
+ declare const controlPropKeys: {
43
+ readonly actionElement: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
44
+ readonly addGroupAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
45
+ readonly addRuleAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
46
+ readonly cloneGroupAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
47
+ readonly cloneRuleAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
48
+ readonly combinatorSelector: readonly ["className", "context", "disabled", "handleOnChange", "level", "options", "path", "ruleGroup", "rules", "schema", "testID", "title", "validation", "value"];
49
+ readonly dragHandle: readonly ["className", "context", "disabled", "dragHandleAttributes", "label", "level", "path", "ruleOrGroup", "schema", "testID", "title", "validation"];
50
+ readonly fieldSelector: readonly ["className", "context", "disabled", "handleOnChange", "level", "operator", "options", "path", "rule", "schema", "testID", "title", "validation", "value"];
51
+ readonly inlineCombinator: readonly ["className", "component", "context", "disabled", "handleOnChange", "level", "options", "path", "ruleGroup", "rules", "schema", "testID", "title", "validation", "value"];
52
+ readonly lockGroupAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
53
+ readonly lockRuleAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
54
+ readonly matchModeEditor: readonly ["className", "classNames", "context", "disabled", "field", "fieldData", "handleOnChange", "level", "match", "numericEditorComponent", "options", "path", "rule", "schema", "selectorComponent", "testID", "thresholdPlaceholder", "title", "validation", "value"];
55
+ readonly muteGroupAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
56
+ readonly muteRuleAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
57
+ readonly notToggle: readonly ["checked", "className", "context", "disabled", "handleOnChange", "label", "level", "path", "ruleGroup", "schema", "testID", "title", "validation"];
58
+ readonly operatorSelector: readonly ["className", "context", "disabled", "field", "fieldData", "handleOnChange", "level", "options", "path", "rule", "schema", "testID", "title", "validation", "value"];
59
+ readonly removeGroupAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
60
+ readonly removeRuleAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
61
+ readonly rule: readonly ["actions", "context", "disabled", "dndRef", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "field", "groupItems", "id", "isDragging", "isOver", "operator", "parentDisabled", "parentMuted", "path", "rule", "schema", "shiftDownDisabled", "shiftUpDisabled", "translations", "value", "valueSource"];
62
+ readonly ruleGroup: readonly ["actions", "combinator", "context", "disabled", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "dropRef", "groupItems", "id", "isDragging", "isOver", "not", "parentDisabled", "parentMuted", "path", "previewRef", "ruleGroup", "rules", "schema", "shiftDownDisabled", "shiftUpDisabled", "translations"];
63
+ readonly ruleGroupBodyElements: readonly ["accessibleDescription", "actions", "addGroup", "addRule", "classNames", "cloneGroup", "combinator", "context", "disabled", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "dropRef", "groupItems", "id", "isDragging", "isOver", "muted", "not", "onCombinatorChange", "onGroupAdd", "onIndependentCombinatorChange", "onNotToggleChange", "outerClassName", "parentDisabled", "parentMuted", "path", "pathsMemo", "previewRef", "removeGroup", "ruleGroup", "rules", "schema", "shiftDownDisabled", "shiftGroupDown", "shiftGroupUp", "shiftUpDisabled", "toggleLockGroup", "toggleMuteGroup", "translations", "validationClassName", "validationResult"];
64
+ readonly ruleGroupHeaderElements: readonly ["accessibleDescription", "actions", "addGroup", "addRule", "classNames", "cloneGroup", "combinator", "context", "disabled", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "dropRef", "groupItems", "id", "isDragging", "isOver", "muted", "not", "onCombinatorChange", "onGroupAdd", "onIndependentCombinatorChange", "onNotToggleChange", "outerClassName", "parentDisabled", "parentMuted", "path", "pathsMemo", "previewRef", "removeGroup", "ruleGroup", "rules", "schema", "shiftDownDisabled", "shiftGroupDown", "shiftGroupUp", "shiftUpDisabled", "toggleLockGroup", "toggleMuteGroup", "translations", "validationClassName", "validationResult"];
65
+ readonly shiftActions: readonly ["className", "context", "disabled", "labels", "level", "path", "ruleOrGroup", "schema", "shiftDown", "shiftDownDisabled", "shiftUp", "shiftUpDisabled", "testID", "title", "titles", "validation"];
66
+ readonly undoRedoActions: readonly ["className", "classNames", "context", "disabled", "labels", "level", "path", "ruleOrGroup", "schema", "testID", "title", "titles", "validation"];
67
+ readonly valueEditor: readonly ["className", "context", "disabled", "field", "fieldData", "handleOnChange", "inputType", "level", "listsAsArrays", "operator", "parseNumbers", "path", "rule", "schema", "selectorComponent", "separator", "skipHook", "testID", "title", "type", "validation", "value", "valueSource", "values"];
68
+ readonly valueSelector: readonly ["className", "context", "disabled", "handleOnChange", "level", "listsAsArrays", "multiple", "options", "path", "schema", "testID", "title", "validation", "value"];
69
+ readonly valueSourceSelector: readonly ["className", "context", "disabled", "field", "fieldData", "handleOnChange", "level", "options", "path", "rule", "schema", "testID", "title", "validation", "value"];
70
+ };
71
+ /**
72
+ * Which bulk override, if any, applies to each control: `"action"` for controls that a supplied
73
+ * `actionElement` replaces, `"selector"` for controls that a supplied `valueSelector` replaces,
74
+ * and `null` for controls that neither replaces.
75
+ *
76
+ * `actionElement` and `valueSelector` are themselves `null`—they are the _source_ of a bulk
77
+ * override, not a target of one.
78
+ *
79
+ * Replaces name-suffix sniffing (`key.endsWith('Action')`), which would silently misclassify a
80
+ * future control named e.g. `pathSelector`, and which disagrees between implementations about
81
+ * whether `shiftActions`/`undoRedoActions` (plural) match. They do not: neither receives the
82
+ * `actionElement` bulk override.
83
+ *
84
+ * @group Props
85
+ */
86
+ declare const controlKind: {
87
+ readonly actionElement: null;
88
+ readonly addGroupAction: "action";
89
+ readonly addRuleAction: "action";
90
+ readonly cloneGroupAction: "action";
91
+ readonly cloneRuleAction: "action";
92
+ readonly combinatorSelector: "selector";
93
+ readonly dragHandle: null;
94
+ readonly fieldSelector: "selector";
95
+ readonly inlineCombinator: null;
96
+ readonly lockGroupAction: "action";
97
+ readonly lockRuleAction: "action";
98
+ readonly matchModeEditor: null;
99
+ readonly muteGroupAction: "action";
100
+ readonly muteRuleAction: "action";
101
+ readonly notToggle: null;
102
+ readonly operatorSelector: "selector";
103
+ readonly removeGroupAction: "action";
104
+ readonly removeRuleAction: "action";
105
+ readonly rule: null;
106
+ readonly ruleGroup: null;
107
+ readonly ruleGroupBodyElements: null;
108
+ readonly ruleGroupHeaderElements: null;
109
+ readonly shiftActions: null;
110
+ readonly undoRedoActions: null;
111
+ readonly valueEditor: null;
112
+ readonly valueSelector: null;
113
+ readonly valueSourceSelector: "selector";
114
+ };
115
+ //#endregion
116
+ //#region ../../node_modules/type-fest/source/primitive.d.ts
117
+ /**
118
+ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive).
119
+
120
+ @category Type
121
+ */
122
+ type Primitive = null | undefined | string | number | boolean | symbol | bigint;
123
+ //#endregion
124
+ //#region ../../node_modules/type-fest/source/internal/type.d.ts
125
+ /**
126
+ Matches any primitive, `void`, `Date`, or `RegExp` value.
127
+ */
128
+ type BuiltIns = Primitive | void | Date | RegExp;
129
+ /**
130
+ Test if the given function has multiple call signatures.
131
+
132
+ Needed to handle the case of a single call signature with properties.
133
+
134
+ Multiple call signatures cannot currently be supported due to a TypeScript limitation.
135
+ @see https://github.com/microsoft/TypeScript/issues/29732
136
+ */
137
+ type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T extends {
138
+ (...arguments_: infer A): unknown;
139
+ (...arguments_: infer B): unknown;
140
+ } ? B extends A ? A extends B ? false : true : true : false;
141
+ /**
142
+ An if-else-like type that resolves depending on whether the given type is `any` or `never`.
143
+
144
+ @example
145
+ ```
146
+ // When `T` is neither `any` nor `never` (like `string`) => Returns `IfNot` branch
147
+ type A = IfNotAnyOrNever<string, {ifNot: 'VALID'; ifAny: 'IS_ANY'; ifNever: 'IS_NEVER'}>;
148
+ //=> 'VALID'
149
+
150
+ // When `T` is `any` => Returns `IfAny` branch
151
+ type B = IfNotAnyOrNever<any, {ifNot: 'VALID'; ifAny: 'IS_ANY'; ifNever: 'IS_NEVER'}>;
152
+ //=> 'IS_ANY'
153
+
154
+ // When `T` is `never` => Returns `IfNever` branch
155
+ type C = IfNotAnyOrNever<never, {ifNot: 'VALID'; ifAny: 'IS_ANY'; ifNever: 'IS_NEVER'}>;
156
+ //=> 'IS_NEVER'
157
+ ```
158
+
159
+ Note: Wrapping a tail-recursive type with `IfNotAnyOrNever` makes the implementation non-tail-recursive. To fix this, move the recursion into a helper type. Refer to the following example:
160
+
161
+ @example
162
+ ```ts
163
+ import type {StringRepeat} from 'type-fest';
164
+
165
+ type NineHundredNinetyNineSpaces = StringRepeat<' ', 999>;
166
+
167
+ // The following implementation is not tail recursive
168
+ type TrimLeft<S extends string> = IfNotAnyOrNever<S, {ifNot: S extends ` ${infer R}` ? TrimLeft<R> : S}>;
169
+
170
+ // Hence, instantiations with long strings will fail
171
+ // @ts-expect-error
172
+ type T1 = TrimLeft<NineHundredNinetyNineSpaces>;
173
+ // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
174
+ // Error: Type instantiation is excessively deep and possibly infinite.
175
+
176
+ // To fix this, move the recursion into a helper type
177
+ type TrimLeftOptimised<S extends string> = IfNotAnyOrNever<S, {ifNot: _TrimLeftOptimised<S>}>;
178
+
179
+ type _TrimLeftOptimised<S extends string> = S extends ` ${infer R}` ? _TrimLeftOptimised<R> : S;
180
+
181
+ type T2 = TrimLeftOptimised<NineHundredNinetyNineSpaces>;
182
+ //=> ''
183
+ ```
184
+ */
185
+ type IfNotAnyOrNever<T, Cases extends {
186
+ ifNot: unknown;
187
+ ifAny?: unknown;
188
+ ifNever?: unknown;
189
+ }> = IsAny<T> extends true ? 'ifAny' extends keyof Cases ? Cases['ifAny'] : any : IsNever<T> extends true ? 'ifNever' extends keyof Cases ? Cases['ifNever'] : never : Cases['ifNot'];
190
+ //#endregion
191
+ //#region ../../node_modules/type-fest/source/require-at-least-one.d.ts
192
+ /**
193
+ Create a type that requires at least one of the given keys, while keeping the remaining keys as is.
194
+
195
+ @example
196
+ ```
197
+ import type {RequireAtLeastOne} from 'type-fest';
198
+
199
+ type Responder = {
200
+ text?: () => string;
201
+ json?: () => string;
202
+ secure?: boolean;
203
+ };
204
+
205
+ const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
206
+ json: () => '{"message": "ok"}',
207
+ secure: true,
208
+ };
209
+ ```
210
+
211
+ @category Object
212
+ */
213
+ type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, {
214
+ ifNot: If<IsNever<KeysType>, never, _RequireAtLeastOne<ObjectType, If<IsAny<KeysType>, keyof ObjectType, KeysType>>>;
215
+ }>;
216
+ type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = { [
217
+ // For each `Key` in `KeysType` make a mapped type:
218
+ Key in KeysType]-?: Required<Pick<ObjectType, Key>> // 1. Make `Key`'s type required
219
+ & Partial<Pick<ObjectType, Exclude<KeysType, Key>>> // 2. Make all other keys in `KeysType` optional
220
+ ; }[KeysType] & Except<ObjectType, KeysType>; // 3. Add the remaining keys not in `KeysType`
221
+ //#endregion
222
+ //#region ../../node_modules/type-fest/source/required-deep.d.ts
223
+ /**
224
+ Create a deeply required version of another type.
225
+
226
+ Use-cases:
227
+ - Creating optional configuration interfaces where the underlying implementation still requires all options to be fully specified.
228
+ - Modeling the resulting type after a deep merge with a set of defaults.
229
+
230
+ Use [`Required<T>`](https://www.typescriptlang.org/docs/handbook/utility-types.html#requiredtype) if you only need one level deep.
231
+
232
+ @example
233
+ ```
234
+ import type {RequiredDeep} from 'type-fest';
235
+
236
+ type Settings = {
237
+ textEditor?: {
238
+ fontSize?: number;
239
+ fontColor?: string;
240
+ fontWeight?: number | undefined;
241
+ };
242
+ autocomplete?: boolean;
243
+ autosave?: boolean | undefined;
244
+ };
245
+
246
+ type RequiredSettings = RequiredDeep<Settings>;
247
+ //=> {
248
+ // textEditor: {
249
+ // fontSize: number;
250
+ // fontColor: string;
251
+ // fontWeight: number | undefined;
252
+ // };
253
+ // autocomplete: boolean;
254
+ // autosave: boolean | undefined;
255
+ // }
256
+ ```
257
+
258
+ Note that types containing overloaded functions are not made deeply required due to a [TypeScript limitation](https://github.com/microsoft/TypeScript/issues/29732).
259
+
260
+ @category Utilities
261
+ @category Object
262
+ @category Array
263
+ @category Set
264
+ @category Map
265
+ */
266
+ type RequiredDeep<T> = T extends BuiltIns ? T : T extends Map<infer KeyType, infer ValueType> ? Map<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T extends Set<infer ItemType> ? Set<RequiredDeep<ItemType>> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? ReadonlyMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T extends ReadonlySet<infer ItemType> ? ReadonlySet<RequiredDeep<ItemType>> : T extends WeakMap<infer KeyType, infer ValueType> ? WeakMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T extends WeakSet<infer ItemType> ? WeakSet<RequiredDeep<ItemType>> : T extends Promise<infer ValueType> ? Promise<RequiredDeep<ValueType>> : T extends ((...arguments_: any[]) => unknown) ? IsNever<keyof T> extends true ? T : HasMultipleCallSignatures<T> extends true ? T : ((...arguments_: Parameters<T>) => ReturnType<T>) & RequiredObjectDeep<T> : T extends object ? Simplify<RequiredObjectDeep<T>> // `Simplify` to prevent `RequiredObjectDeep` from appearing in the resulting type
267
+ : unknown;
268
+ type RequiredObjectDeep<ObjectType extends object> = { [KeyType in keyof ObjectType]-?: RequiredDeep<ObjectType[KeyType]>; };
269
+ //#endregion
270
+ //#region src/types/dnd.d.ts
271
+ type DndDropTargetType = "rule" | "ruleGroup" | "inlineCombinator";
272
+ type DraggedItem = (RuleType & {
273
+ path: Path;
274
+ qbId: string;
275
+ }) | (RuleGroupTypeAny & {
276
+ path: Path;
277
+ qbId: string;
278
+ });
279
+ type DropEffect = "move" | "copy";
280
+ interface DropResult {
281
+ path: Path;
282
+ type: DndDropTargetType;
283
+ dropEffect?: DropEffect;
284
+ groupItems?: boolean;
285
+ qbId: string;
286
+ getQuery: () => RuleGroupTypeAny;
287
+ dispatchQuery: (query: RuleGroupTypeAny) => void;
288
+ }
289
+ interface DragCollection {
290
+ isDragging: boolean;
291
+ dragMonitorId: string | symbol;
292
+ }
293
+ interface DropCollection {
294
+ dropNotAllowed: boolean;
295
+ isOver: boolean;
296
+ dropMonitorId: string | symbol;
297
+ dropEffect?: DropEffect;
298
+ groupItems?: boolean;
299
+ }
300
+ //#endregion
301
+ //#region src/types/history.d.ts
302
+ /**
303
+ * Options controlling how query changes are recorded for undo/redo.
304
+ *
305
+ * Shared by the `react-querybuilder/history` entry point and the
306
+ * {@link index!QueryManager QueryManager} utility.
307
+ */
308
+ interface QueryHistoryOptions {
309
+ /**
310
+ * Maximum number of undo steps to retain. Older entries are discarded.
311
+ *
312
+ * @default 50
313
+ */
314
+ maxHistory?: number;
315
+ /**
316
+ * Consecutive changes to the same property of the same rule within this many milliseconds
317
+ * are merged into a single undo step, so that (for example) typing a multi-character value
318
+ * produces one history entry rather than one per keystroke.
319
+ *
320
+ * Set to `0` to record every change separately.
321
+ *
322
+ * @default 500
323
+ */
324
+ coalesceMs?: number;
325
+ }
326
+ //#endregion
327
+ //#region src/types/queryBuilder.d.ts
328
+ /**
329
+ * Base interface for all rule subcomponents.
330
+ *
331
+ * @group Props
332
+ */
333
+ interface CommonRuleSubComponentProps {
334
+ rule: RuleType;
335
+ }
336
+ /**
337
+ * Classnames applied to each component.
338
+ *
339
+ * @group Props
340
+ */
341
+ interface Classnames {
342
+ /**
343
+ * Classnames applied to the root `<div>` element.
344
+ */
345
+ queryBuilder: Classname;
346
+ /**
347
+ * Classnames applied to the `<div>` containing the RuleGroup.
348
+ */
349
+ ruleGroup: Classname;
350
+ /**
351
+ * Classnames applied to the `<div>` containing the RuleGroup header controls.
352
+ */
353
+ header: Classname;
354
+ /**
355
+ * Classnames applied to the `<div>` containing the RuleGroup child rules/groups.
356
+ */
357
+ body: Classname;
358
+ /**
359
+ * Classnames applied to the `<select>` control for combinators.
360
+ */
361
+ combinators: Classname;
362
+ /**
363
+ * Classnames applied to the `<button>` to add a Rule.
364
+ */
365
+ addRule: Classname;
366
+ /**
367
+ * Classnames applied to the `<button>` to add a RuleGroup.
368
+ */
369
+ addGroup: Classname;
370
+ /**
371
+ * Classnames applied to the `<button>` to clone a Rule.
372
+ */
373
+ cloneRule: Classname;
374
+ /**
375
+ * Classnames applied to the `<button>` to clone a RuleGroup.
376
+ */
377
+ cloneGroup: Classname;
378
+ /**
379
+ * Classnames applied to the `<button>` to remove a RuleGroup.
380
+ */
381
+ removeGroup: Classname;
382
+ /**
383
+ * Classnames applied to the `<div>` containing the Rule.
384
+ */
385
+ rule: Classname;
386
+ /**
387
+ * Classnames applied to the `<select>` control for fields.
388
+ */
389
+ fields: Classname;
390
+ /**
391
+ * Classnames applied to the `<select>` control for match modes.
392
+ */
393
+ matchMode: Classname;
394
+ /**
395
+ * Classnames applied to the `<input>` for match thresholds.
396
+ */
397
+ matchThreshold: Classname;
398
+ /**
399
+ * Classnames applied to the `<select>` control for operators.
400
+ */
401
+ operators: Classname;
402
+ /**
403
+ * Classnames applied to the `<input>` for the rule value.
404
+ */
405
+ value: Classname;
406
+ /**
407
+ * Classnames applied to the `<button>` to remove a Rule.
408
+ */
409
+ removeRule: Classname;
410
+ /**
411
+ * Classnames applied to the `<label>` on the "not" toggle.
412
+ */
413
+ notToggle: Classname;
414
+ /**
415
+ * Classnames applied to the `<span>` handle for dragging rules/groups.
416
+ */
417
+ shiftActions: Classname;
418
+ /**
419
+ * Classname(s) to be applied to the undo/redo actions container.
420
+ */
421
+ undoRedoActions: Classname;
422
+ /**
423
+ * Classname(s) to be applied to the "undo" button.
424
+ */
425
+ undoAction: Classname;
426
+ /**
427
+ * Classname(s) to be applied to the "redo" button.
428
+ */
429
+ redoAction: Classname;
430
+ /**
431
+ * Classnames applied to the `<span>` handle for dragging rules/groups.
432
+ */
433
+ dragHandle: Classname;
434
+ /**
435
+ * Classnames applied to the `<button>` to lock/disable a Rule.
436
+ */
437
+ lockRule: Classname;
438
+ /**
439
+ * Classnames applied to the `<button>` to lock/disable a RuleGroup.
440
+ */
441
+ lockGroup: Classname;
442
+ /**
443
+ * Classnames applied to the `<button>` to mute a Rule.
444
+ */
445
+ muteRule: Classname;
446
+ /**
447
+ * Classnames applied to the `<button>` to mute a RuleGroup.
448
+ */
449
+ muteGroup: Classname;
450
+ /**
451
+ * Classnames applied to the `<select>` control for value sources.
452
+ */
453
+ valueSource: Classname;
454
+ /**
455
+ * Classnames applied to all action elements.
456
+ */
457
+ actionElement: Classname;
458
+ /**
459
+ * Classnames applied to all select elements.
460
+ */
461
+ valueSelector: Classname;
462
+ /**
463
+ * Classname(s) applied to inline combinator elements.
464
+ */
465
+ betweenRules: Classname;
466
+ /**
467
+ * Classname(s) applied to valid rules and groups.
468
+ */
469
+ valid: Classname;
470
+ /**
471
+ * Classname(s) applied to invalid rules and groups.
472
+ */
473
+ invalid: Classname;
474
+ /**
475
+ * Classname(s) applied to rules and groups while being dragged.
476
+ */
477
+ dndDragging: Classname;
478
+ /**
479
+ * Classname(s) applied to rules and groups hovered over by a dragged element.
480
+ */
481
+ dndOver: Classname;
482
+ /**
483
+ * Classname(s) applied to rules and groups hovered over by a dragged element
484
+ * when the drop effect is "copy" (modifier key is pressed).
485
+ */
486
+ dndCopy: Classname;
487
+ /**
488
+ * Classname(s) applied to rules and groups hovered over by a dragged element
489
+ * when the Ctrl key is pressed, indicating the items will form a new group.
490
+ */
491
+ dndGroup: Classname;
492
+ /**
493
+ * Classname(s) applied to rules and groups that cannot accept a drop from
494
+ * the dragged element hovering over it.
495
+ */
496
+ dndDropNotAllowed: Classname;
497
+ /**
498
+ * Classname(s) applied to a rule or group at its prospective position
499
+ * during an active drag when `updateWhileDragging` is enabled.
500
+ */
501
+ dndPreviewPosition: Classname;
502
+ /**
503
+ * Classname(s) applied to a dragged rule or group at its original position
504
+ * to hide it when `updateWhileDragging` is enabled.
505
+ */
506
+ dndHidden: Classname;
507
+ /**
508
+ * Classname(s) applied to disabled elements.
509
+ */
510
+ disabled: Classname;
511
+ /**
512
+ * Classname(s) applied to muted elements.
513
+ */
514
+ muted: Classname;
515
+ /**
516
+ * Classname(s) applied to each element in a series of value editors.
517
+ */
518
+ valueListItem: Classname;
519
+ /**
520
+ * Not applied, but see CSS styles.
521
+ */
522
+ branches: Classname;
523
+ /**
524
+ * Classname(s) applied to rules that render a subquery.
525
+ */
526
+ hasSubQuery: Classname;
527
+ /**
528
+ * Classname(s) applied to async components in their "loading" state.
529
+ */
530
+ loading: Classname;
531
+ /**
532
+ * Classname(s) applied to value editors for relative date/time values.
533
+ */
534
+ valueDateTimeRelative: Classname;
535
+ }
536
+ /**
537
+ * Placeholder strings for option lists.
538
+ *
539
+ * @group Props
540
+ */
541
+ interface Placeholder {
542
+ /**
543
+ * Value for the placeholder field option if autoSelectField is false,
544
+ * or the placeholder operator option if autoSelectOperator is false.
545
+ */
546
+ placeholderName?: string;
547
+ /**
548
+ * Label for the placeholder field option if autoSelectField is false,
549
+ * or the placeholder operator option if autoSelectOperator is false.
550
+ */
551
+ placeholderLabel?: string;
552
+ /**
553
+ * Label for the placeholder field optgroup if autoSelectField is false,
554
+ * or the placeholder operator optgroup if autoSelectOperator is false.
555
+ */
556
+ placeholderGroupLabel?: string;
557
+ }
558
+ /**
559
+ * A translation for a component with `title` only.
560
+ *
561
+ * @group Props
562
+ */
563
+ interface BaseTranslation {
564
+ title?: string;
565
+ }
566
+ /**
567
+ * A translation for a component with `title` and `label`.
568
+ *
569
+ * @group Props
570
+ */
571
+ interface BaseTranslationWithLabel<LabelType = string> extends BaseTranslation {
572
+ label?: LabelType;
573
+ }
574
+ /**
575
+ * A translation for a component with `title` and a placeholder.
576
+ *
577
+ * @group Props
578
+ */
579
+ interface BaseTranslationWithPlaceholders extends BaseTranslation, Placeholder {}
580
+ /**
581
+ * The shape of the `translations` prop.
582
+ *
583
+ * @group Props
584
+ */
585
+ interface BaseTranslations<LabelType = string> {
586
+ fields: BaseTranslationWithPlaceholders;
587
+ operators: BaseTranslationWithPlaceholders;
588
+ values: BaseTranslationWithPlaceholders;
589
+ matchMode: BaseTranslation;
590
+ matchThreshold: BaseTranslation & {
591
+ placeholderName?: string;
592
+ };
593
+ value: BaseTranslation;
594
+ removeRule: BaseTranslationWithLabel<LabelType>;
595
+ removeGroup: BaseTranslationWithLabel<LabelType>;
596
+ addRule: BaseTranslationWithLabel<LabelType>;
597
+ addGroup: BaseTranslationWithLabel<LabelType>;
598
+ combinators: BaseTranslation;
599
+ notToggle: BaseTranslationWithLabel<LabelType>;
600
+ cloneRule: BaseTranslationWithLabel<LabelType>;
601
+ cloneRuleGroup: BaseTranslationWithLabel<LabelType>;
602
+ shiftActionUp: BaseTranslationWithLabel<LabelType>;
603
+ shiftActionDown: BaseTranslationWithLabel<LabelType>;
604
+ undo: BaseTranslationWithLabel<LabelType>;
605
+ redo: BaseTranslationWithLabel<LabelType>;
606
+ dragHandle: BaseTranslationWithLabel<LabelType>;
607
+ lockRule: BaseTranslationWithLabel<LabelType>;
608
+ lockGroup: BaseTranslationWithLabel<LabelType>;
609
+ lockRuleDisabled: BaseTranslationWithLabel<LabelType>;
610
+ lockGroupDisabled: BaseTranslationWithLabel<LabelType>;
611
+ muteRule: BaseTranslationWithLabel<LabelType>;
612
+ muteGroup: BaseTranslationWithLabel<LabelType>;
613
+ unmuteRule: BaseTranslationWithLabel<LabelType>;
614
+ unmuteGroup: BaseTranslationWithLabel<LabelType>;
615
+ valueSourceSelector: BaseTranslation;
616
+ }
617
+ /**
618
+ * The full `translations` interface with all properties required.
619
+ *
620
+ * @group Props
621
+ */
622
+ type BaseTranslationsFull<LabelType = string> = RequiredDeep<BaseTranslations<LabelType>>;
623
+ /**
624
+ * Functions included in the `actions` prop passed to every subcomponent.
625
+ *
626
+ * @group Props
627
+ */
628
+ interface QueryActions {
629
+ onGroupAdd(group: RuleGroupTypeAny, parentPath: Path, context?: any): void;
630
+ onGroupRemove(path: Path): void;
631
+ onPropChange(prop: Exclude<keyof RuleType | keyof RuleGroupType, "id" | "path">, value: any, path: Path, context?: any): void;
632
+ onRuleAdd(rule: RuleType, parentPath: Path, context?: any): void;
633
+ onRuleRemove(path: Path): void;
634
+ moveRule(oldPath: Path, newPath: Path | "up" | "down", clone?: boolean, context?: any): void;
635
+ groupRule(sourcePath: Path, targetPath: Path, clone?: boolean, context?: any): void;
636
+ }
637
+ interface QueryBuilderFlags {
638
+ /**
639
+ * Set to `false` to avoid calling the `onQueryChange` callback
640
+ * when the component mounts.
641
+ *
642
+ * @default true
643
+ */
644
+ enableMountQueryChange?: boolean;
645
+ /**
646
+ * By default, when the last `QueryBuilder` component using a given `qbId` unmounts, its
647
+ * query is removed from the internal Redux store. Set this to `true` to retain the query
648
+ * state after unmount, which allows a subsequent `QueryBuilder` with the same `qbId` to
649
+ * pick up where the previous one left off.
650
+ *
651
+ * Only meaningful in conjunction with an explicit `qbId` prop, since automatically generated
652
+ * `qbId`s are never reused.
653
+ *
654
+ * @default false
655
+ */
656
+ preserveQueryStateOnUnmount?: boolean;
657
+ /**
658
+ * Enables drag-and-drop features.
659
+ *
660
+ * @default false
661
+ */
662
+ enableDragAndDrop?: boolean;
663
+ /**
664
+ * Enables debug logging for query builders (and React DnD when applicable).
665
+ *
666
+ * @default false
667
+ */
668
+ debugMode?: boolean;
669
+ /**
670
+ * Show group combinator selectors in the body of the group, between each child rule/group,
671
+ * instead of in the group header.
672
+ *
673
+ * @default false
674
+ */
675
+ showCombinatorsBetweenRules?: boolean;
676
+ /**
677
+ * Show the "not" (aka inversion) toggle for rule groups.
678
+ *
679
+ * @default false
680
+ */
681
+ showNotToggle?: boolean;
682
+ /**
683
+ * Show the "Shift up"/"Shift down" actions.
684
+ *
685
+ * @default false
686
+ */
687
+ showShiftActions?: boolean;
688
+ /**
689
+ * Show the "Undo"/"Redo" actions in the header of the outermost group.
690
+ *
691
+ * Requires the `QueryBuilderHistory` component from `react-querybuilder/history`, which
692
+ * provides the controls and records the history they navigate. Defaults to `true` when a
693
+ * `QueryBuilderHistory` ancestor is present (pass `false` explicitly to opt out).
694
+ *
695
+ * @default false
696
+ */
697
+ showUndoRedo?: boolean;
698
+ /**
699
+ * Show the "Clone rule" and "Clone group" buttons.
700
+ *
701
+ * @default false
702
+ */
703
+ showCloneButtons?: boolean;
704
+ /**
705
+ * Show the "Lock rule" and "Lock group" buttons.
706
+ *
707
+ * @default false
708
+ */
709
+ showLockButtons?: boolean;
710
+ /**
711
+ * Show the "Mute rule" and "Mute group" buttons.
712
+ *
713
+ * @default false
714
+ */
715
+ showMuteButtons?: boolean;
716
+ /**
717
+ * Reset the `operator` and `value` when the `field` changes.
718
+ *
719
+ * @default true
720
+ */
721
+ resetOnFieldChange?: boolean;
722
+ /**
723
+ * Reset the `value` when the `operator` changes.
724
+ *
725
+ * @default false
726
+ */
727
+ resetOnOperatorChange?: boolean;
728
+ /**
729
+ * Select the first field in the array automatically.
730
+ *
731
+ * @default true
732
+ */
733
+ autoSelectField?: boolean;
734
+ /**
735
+ * Select the first operator in the array automatically.
736
+ *
737
+ * @default true
738
+ */
739
+ autoSelectOperator?: boolean;
740
+ /**
741
+ * Select the first value in the array automatically. Only applicable when the value editor renders a select list.
742
+ *
743
+ * @default false
744
+ */
745
+ autoSelectValue?: boolean;
746
+ /**
747
+ * Adds a new default rule automatically to each new group.
748
+ *
749
+ * @default false
750
+ */
751
+ addRuleToNewGroups?: boolean;
752
+ /**
753
+ * Store list-type values as native arrays instead of comma-separated strings.
754
+ *
755
+ * @default false
756
+ */
757
+ listsAsArrays?: boolean;
758
+ /**
759
+ * Prevent _any_ assignment of standard classes to elements. This includes conditional
760
+ * and event-based classes for validation, drag-and-drop, etc.
761
+ *
762
+ * @default false
763
+ */
764
+ suppressStandardClassnames?: boolean;
765
+ }
766
+ //#endregion
767
+ //#region src/defaults.d.ts
768
+ /**
769
+ * @group Defaults
770
+ */
771
+ declare const defaultPlaceholderName = "~";
772
+ /**
773
+ * @group Defaults
774
+ */
775
+ declare const defaultPlaceholderLabel = "------";
776
+ /**
777
+ * Default `name` for placeholder option in the `fields` array.
778
+ *
779
+ * @group Defaults
780
+ */
781
+ declare const defaultPlaceholderFieldName: typeof defaultPlaceholderName;
782
+ /**
783
+ * Default `label` for placeholder option in the `fields` array.
784
+ *
785
+ * @group Defaults
786
+ */
787
+ declare const defaultPlaceholderFieldLabel: typeof defaultPlaceholderLabel;
788
+ /**
789
+ * Default `label` for placeholder option group in the `fields` array.
790
+ *
791
+ * @group Defaults
792
+ */
793
+ declare const defaultPlaceholderFieldGroupLabel: typeof defaultPlaceholderLabel;
794
+ /**
795
+ * Default `name` for placeholder option in the `operators` array.
796
+ *
797
+ * @group Defaults
798
+ */
799
+ declare const defaultPlaceholderOperatorName: typeof defaultPlaceholderName;
800
+ /**
801
+ * Default `label` for placeholder option in the `operators` array.
802
+ *
803
+ * @group Defaults
804
+ */
805
+ declare const defaultPlaceholderOperatorLabel: typeof defaultPlaceholderLabel;
806
+ /**
807
+ * Default `label` for placeholder option group in the `operators` array.
808
+ *
809
+ * @group Defaults
810
+ */
811
+ declare const defaultPlaceholderOperatorGroupLabel: typeof defaultPlaceholderLabel;
812
+ /**
813
+ * Default `name` for placeholder option in the `values` array.
814
+ *
815
+ * @group Defaults
816
+ */
817
+ declare const defaultPlaceholderValueName: typeof defaultPlaceholderName;
818
+ /**
819
+ * Default `label` for placeholder option in the `values` array.
820
+ *
821
+ * @group Defaults
822
+ */
823
+ declare const defaultPlaceholderValueLabel: typeof defaultPlaceholderLabel;
824
+ /**
825
+ * Default `label` for placeholder option group in the `values` array.
826
+ *
827
+ * @group Defaults
828
+ */
829
+ declare const defaultPlaceholderValueGroupLabel: typeof defaultPlaceholderLabel;
830
+ /**
831
+ * Default configuration of translatable strings.
832
+ *
833
+ * @group Defaults
834
+ */
835
+ declare const defaultTranslations: BaseTranslationsFull;
836
+ /**
837
+ * Default character used to `.join` and `.split` arrays.
838
+ *
839
+ * @group Defaults
840
+ */
841
+ declare const defaultJoinChar = ",";
842
+ type DefaultOperators = StringUnionToFullOptionArray<DefaultOperatorName>;
843
+ declare const defaultOperatorLabelMap: Record<DefaultOperatorName, string>;
844
+ declare const defaultCombinatorLabelMap: Record<DefaultCombinatorNameExtended, string>;
845
+ /**
846
+ * Default operator list.
847
+ *
848
+ * @group Defaults
849
+ */
850
+ declare const defaultOperators: DefaultOperators;
851
+ /**
852
+ * Map of default operators to their respective opposite/negating operators.
853
+ *
854
+ * @group Defaults
855
+ */
856
+ declare const defaultOperatorNegationMap: Record<DefaultOperatorName, DefaultOperatorName>;
857
+ /**
858
+ * Relational/comparison operators (`=`, `!=`, `<`, `>`, `<=`, `>=`).
859
+ *
860
+ * @group Defaults
861
+ */
862
+ declare const relationalOperators: Set<DefaultOperatorName>;
863
+ /**
864
+ * Substring/text-matching operators (`contains`, `beginsWith`, `endsWith`, and negations).
865
+ *
866
+ * @group Defaults
867
+ */
868
+ declare const substringOperators: Set<DefaultOperatorName>;
869
+ /**
870
+ * Null-check operators (`null`, `notNull`).
871
+ *
872
+ * @group Defaults
873
+ */
874
+ declare const nullOperators: Set<DefaultOperatorName>;
875
+ /**
876
+ * List-membership operators (`in`, `notIn`).
877
+ *
878
+ * @group Defaults
879
+ */
880
+ declare const inOperators: Set<DefaultOperatorName>;
881
+ /**
882
+ * Range operators (`between`, `notBetween`).
883
+ *
884
+ * @group Defaults
885
+ */
886
+ declare const betweenOperators: Set<DefaultOperatorName>;
887
+ type DefaultCombinators = StringUnionToFullOptionArray<DefaultCombinatorName>;
888
+ /**
889
+ * Default combinator list.
890
+ *
891
+ * @group Defaults
892
+ */
893
+ declare const defaultCombinators: DefaultCombinators;
894
+ type DefaultCombinatorsExtended = StringUnionToFullOptionArray<DefaultCombinatorNameExtended>;
895
+ /**
896
+ * Default combinator list, with `XOR` added.
897
+ *
898
+ * @group Defaults
899
+ */
900
+ declare const defaultCombinatorsExtended: DefaultCombinatorsExtended;
901
+ type DefaultMatchModes = StringUnionToFullOptionArray<MatchMode>;
902
+ /**
903
+ * Default match modes.
904
+ *
905
+ * @group Defaults
906
+ */
907
+ declare const defaultMatchModes: DefaultMatchModes;
908
+ /**
909
+ * Standard classnames applied to each component.
910
+ *
911
+ * @group Defaults
912
+ */
913
+ declare const standardClassnames: {
914
+ readonly queryBuilder: "queryBuilder";
915
+ readonly ruleGroup: "ruleGroup";
916
+ readonly header: "ruleGroup-header";
917
+ readonly body: "ruleGroup-body";
918
+ readonly combinators: "ruleGroup-combinators";
919
+ readonly addRule: "ruleGroup-addRule";
920
+ readonly addGroup: "ruleGroup-addGroup";
921
+ readonly cloneRule: "rule-cloneRule";
922
+ readonly cloneGroup: "ruleGroup-cloneGroup";
923
+ readonly removeGroup: "ruleGroup-remove";
924
+ readonly notToggle: "ruleGroup-notToggle";
925
+ readonly rule: "rule";
926
+ readonly fields: "rule-fields";
927
+ readonly matchMode: "rule-matchMode";
928
+ readonly matchThreshold: "rule-matchThreshold";
929
+ readonly operators: "rule-operators";
930
+ readonly value: "rule-value";
931
+ readonly removeRule: "rule-remove";
932
+ readonly betweenRules: "betweenRules";
933
+ readonly valid: "queryBuilder-valid";
934
+ readonly invalid: "queryBuilder-invalid";
935
+ readonly shiftActions: "shiftActions";
936
+ readonly undoRedoActions: "undoRedoActions";
937
+ readonly undoAction: "undoRedoActions-undo";
938
+ readonly redoAction: "undoRedoActions-redo";
939
+ readonly dndDragging: "dndDragging";
940
+ readonly dndOver: "dndOver";
941
+ readonly dndCopy: "dndCopy";
942
+ readonly dndGroup: "dndGroup";
943
+ readonly dndDropNotAllowed: "dndDropNotAllowed";
944
+ readonly dndPreviewPosition: "dndPreviewPosition";
945
+ readonly dndHidden: "dndHidden";
946
+ readonly dragHandle: "queryBuilder-dragHandle";
947
+ readonly disabled: "queryBuilder-disabled";
948
+ readonly muted: "queryBuilder-muted";
949
+ readonly lockRule: "rule-lock";
950
+ readonly lockGroup: "ruleGroup-lock";
951
+ readonly muteRule: "rule-mute";
952
+ readonly muteGroup: "ruleGroup-mute";
953
+ readonly valueSource: "rule-valueSource";
954
+ readonly valueListItem: "rule-value-list-item";
955
+ readonly branches: "queryBuilder-branches";
956
+ readonly justified: "queryBuilder-justified";
957
+ readonly responsive: "queryBuilder-responsive";
958
+ readonly hasSubQuery: "rule-hasSubQuery";
959
+ readonly loading: "queryBuilder-loading";
960
+ readonly valueDateTimeRelative: "rule-value-dateTimeRelative";
961
+ };
962
+ /**
963
+ * Default classnames for each component.
964
+ *
965
+ * @group Defaults
966
+ */
967
+ declare const defaultControlClassnames: Classnames;
968
+ /**
969
+ * Default reason codes for a group being invalid.
970
+ *
971
+ * @group Defaults
972
+ */
973
+ declare const groupInvalidReasons: {
974
+ readonly empty: "empty";
975
+ readonly invalidCombinator: "invalid combinator";
976
+ readonly invalidIndependentCombinators: "invalid independent combinators";
977
+ };
978
+ /**
979
+ * Component identifiers for testing.
980
+ *
981
+ * @group Defaults
982
+ */
983
+ declare const TestID: {
984
+ readonly rule: "rule";
985
+ readonly ruleGroup: "rule-group";
986
+ readonly inlineCombinator: "inline-combinator";
987
+ readonly addGroup: "add-group";
988
+ readonly removeGroup: "remove-group";
989
+ readonly cloneGroup: "clone-group";
990
+ readonly cloneRule: "clone-rule";
991
+ readonly addRule: "add-rule";
992
+ readonly removeRule: "remove-rule";
993
+ readonly combinators: "combinators";
994
+ readonly fields: "fields";
995
+ readonly operators: "operators";
996
+ readonly valueEditor: "value-editor";
997
+ readonly notToggle: "not-toggle";
998
+ readonly shiftActions: "shift-actions";
999
+ readonly undoRedoActions: "undo-redo-actions";
1000
+ readonly undoAction: "undo-action";
1001
+ readonly redoAction: "redo-action";
1002
+ readonly dragHandle: "drag-handle";
1003
+ readonly lockRule: "lock-rule";
1004
+ readonly lockGroup: "lock-group";
1005
+ readonly muteRule: "mute-rule";
1006
+ readonly muteGroup: "mute-group";
1007
+ readonly valueSourceSelector: "value-source-selector";
1008
+ readonly matchModeEditor: "match-mode-editor";
1009
+ };
1010
+ declare const LogType: {
1011
+ readonly parentPathDisabled: "action aborted: parent path disabled";
1012
+ readonly pathDisabled: "action aborted: path is disabled";
1013
+ readonly queryUpdate: "query updated";
1014
+ readonly onAddRuleFalse: "onAddRule callback returned false";
1015
+ readonly onAddGroupFalse: "onAddGroup callback returned false";
1016
+ readonly onGroupRuleFalse: "onGroupRule callback returned false";
1017
+ readonly onGroupGroupFalse: "onGroupGroup callback returned false";
1018
+ readonly onMoveRuleFalse: "onMoveRule callback returned false";
1019
+ readonly onMoveGroupFalse: "onMoveGroup callback returned false";
1020
+ readonly onRemoveFalse: "onRemove callback returned false";
1021
+ readonly add: "rule or group added";
1022
+ readonly remove: "rule or group removed";
1023
+ readonly update: "rule or group updated";
1024
+ readonly move: "rule or group moved";
1025
+ readonly group: "rule or group grouped with another";
1026
+ };
1027
+ /**
1028
+ * The {@link Path} of the root group.
1029
+ *
1030
+ * @group Defaults
1031
+ */
1032
+ declare const rootPath: Path;
1033
+ /**
1034
+ * Default values for all `boolean`
1035
+ * {@link react-querybuilder!QueryBuilder QueryBuilder} options.
1036
+ *
1037
+ * @group Defaults
1038
+ */
1039
+ declare const queryBuilderFlagDefaults: Required<QueryBuilderFlags>;
1040
+ /**
1041
+ * Default maximum number of undo steps retained by query history.
1042
+ *
1043
+ * @group Defaults
1044
+ */
1045
+ declare const defaultMaxHistory = 50;
1046
+ /**
1047
+ * Default time window (in milliseconds) within which consecutive changes to the same
1048
+ * property of the same rule are coalesced into a single undo step.
1049
+ *
1050
+ * @group Defaults
1051
+ */
1052
+ declare const defaultCoalesceMs = 500;
1053
+ //#endregion
1054
+ //#region src/utils/queryTools.d.ts
1055
+ /**
1056
+ * Why a query tool returned the query unmodified. Query tools never throw; when they cannot
1057
+ * carry out an operation they return the original query and report the reason through
1058
+ * {@link AbortOptions.onAbort}.
1059
+ *
1060
+ * `"same-location"` and `"no-change"` describe operations that were valid but had nothing to
1061
+ * do, so they are not errors. Every other reason indicates a target that could not be used.
1062
+ *
1063
+ * @group Query Tools
1064
+ */
1065
+ type AbortReason = "target-not-found" | "parent-not-found" | "parent-not-a-group" | "destination-not-found" | "root-not-allowed" | "not-a-combinator-slot" | "same-location" | "no-change" | "target-disabled" | "parent-disabled" | "max-levels-exceeded";
1066
+ /**
1067
+ * Details about an aborted query tool operation.
1068
+ *
1069
+ * @group Query Tools
1070
+ */
1071
+ interface AbortInfo {
1072
+ /** Why the operation was aborted. */
1073
+ reason: AbortReason;
1074
+ /** The query tool that aborted. */
1075
+ operation: "add" | "remove" | "update" | "move" | "insert" | "group";
1076
+ /** The path or `id` that could not be used, when the reason relates to a specific target. */
1077
+ pathOrID?: Path | string;
1078
+ }
1079
+ /**
1080
+ * Options that block a mutation before it is attempted.
1081
+ *
1082
+ * `disabled` is a property of the query itself, so honoring it is a matter of data integrity
1083
+ * rather than presentation: a query saved with a locked rule should stay locked when it is
1084
+ * loaded again. It is opt-in here only to preserve the existing behavior of the standalone
1085
+ * query tools; {@link QueryManager} enables it by default.
1086
+ *
1087
+ * @group Query Tools
1088
+ */
1089
+ interface GuardOptions {
1090
+ /**
1091
+ * Abort when the target (or its parent, for `add`/`insert`) is disabled, either directly or
1092
+ * by descending from a disabled group. Defaults to `false`.
1093
+ *
1094
+ * Updating a rule or group's own `disabled` property is always permitted, since it is the
1095
+ * only way to re-enable it.
1096
+ */
1097
+ respectDisabled?: boolean;
1098
+ /**
1099
+ * Paths that are disabled without the corresponding rule or group carrying a `disabled`
1100
+ * property, mirroring the array form of the `QueryBuilder` `disabled` prop. A path is treated
1101
+ * as disabled if it appears here or descends from a path that does.
1102
+ *
1103
+ * Like the `disabled` property, this is only honored when `respectDisabled` is `true`, and
1104
+ * updating a rule or group's own `disabled` property is still permitted.
1105
+ */
1106
+ disabledPaths?: Path[];
1107
+ /** Abort every mutation, as though the entire query were disabled. Defaults to `false`. */
1108
+ queryDisabled?: boolean;
1109
+ /**
1110
+ * The maximum depth at which a group may be added. A group whose parent path is already this
1111
+ * deep is rejected by `add` and `insert`. Rules are unaffected. Defaults to `Infinity`.
1112
+ */
1113
+ maxLevels?: number;
1114
+ }
1115
+ /**
1116
+ * Options for reporting aborted query tool operations.
1117
+ *
1118
+ * @group Query Tools
1119
+ */
1120
+ interface AbortOptions extends GuardOptions {
1121
+ /**
1122
+ * Called when the operation returns the query unmodified, with the reason why. Query tools
1123
+ * never throw, so this is the only way to distinguish "the target was invalid" from
1124
+ * "the operation had nothing to do".
1125
+ */
1126
+ onAbort?: (info: AbortInfo) => void;
1127
+ }
1128
+ /**
1129
+ * Options shared by every query tool.
1130
+ *
1131
+ * @group Query Tools
1132
+ */
1133
+ interface QueryToolOptions extends AbortOptions {
1134
+ /**
1135
+ * Set `false` to skip immer's auto-freeze on the returned query, e.g. when the query will be
1136
+ * handed to a framework that wraps it in a proxy (Vue `reactive`, Solid stores) or otherwise
1137
+ * needs to mutate it. Ignored by the `*InPlace` variants, which never freeze.
1138
+ *
1139
+ * @default true
1140
+ */
1141
+ freeze?: boolean;
1142
+ }
1143
+ /**
1144
+ * Whether a mutation targeting `pathOrID` is blocked by the given guards, and why.
1145
+ * Returns `null` when the mutation may proceed.
1146
+ *
1147
+ * Exported so that callers which run their own logic before mutating—such as a UI layer that
1148
+ * invokes a confirmation callback—can apply the same rules without duplicating them.
1149
+ *
1150
+ * @group Query Tools
1151
+ */
1152
+ declare const getGuardAbortReason: (query: RuleGroupTypeAny, pathOrID: Path | string | undefined, guards?: GuardOptions, { asParent }?: {
1153
+ asParent?: boolean;
1154
+ }) => AbortReason | null;
1155
+ /**
1156
+ * Whether adding a group beneath `parentPath` would exceed `maxLevels`.
1157
+ *
1158
+ * @group Query Tools
1159
+ */
1160
+ declare const exceedsMaxLevels: (parentPath: Path | undefined, { maxLevels }?: GuardOptions) => boolean;
1161
+ /**
1162
+ * Options for {@link add}.
1163
+ *
1164
+ * @group Query Tools
1165
+ */
1166
+ interface AddOptions extends QueryToolOptions {
1167
+ /**
1168
+ * If the query extends `RuleGroupTypeIC` (i.e. the query has independent
1169
+ * combinators), then the first combinator in this list will be inserted
1170
+ * before the new rule/group if the parent group is not empty. This option
1171
+ * is overridden by `combinatorPreceding`.
1172
+ */
1173
+ combinators?: OptionList;
1174
+ /**
1175
+ * If the query extends `RuleGroupTypeIC` (i.e. the query has independent
1176
+ * combinators), then this combinator will be inserted before the new rule/group
1177
+ * if the parent group is not empty. This option will supersede `combinators`.
1178
+ */
1179
+ combinatorPreceding?: string;
1180
+ /**
1181
+ * ID generator.
1182
+ */
1183
+ idGenerator?: () => string;
1184
+ }
1185
+ interface AddMethod {
1186
+ <RG extends RuleGroupTypeAny>(query: RG, ruleOrGroup: RG | RuleType, parentPathOrID: Path | string, options?: AddOptions): RG;
1187
+ }
1188
+ /**
1189
+ * Adds a rule or group to a query without mutating the original query.
1190
+ *
1191
+ * @returns A new query with the rule or group added.
1192
+ *
1193
+ * @group Query Tools
1194
+ */
1195
+ declare const add: AddMethod;
1196
+ /**
1197
+ * Adds a rule or group to a query in place.
1198
+ *
1199
+ * @returns The query (mutated in place) with the rule or group added.
1200
+ *
1201
+ * @group Query Tools
1202
+ */
1203
+ declare const addInPlace: AddMethod;
1204
+ /**
1205
+ * Options for {@link update}.
1206
+ *
1207
+ * @group Query Tools
1208
+ */
1209
+ interface UpdateOptions extends QueryToolOptions {
1210
+ /**
1211
+ * When updating the `field` of a rule, the rule's `operator`, `value`, and `valueSource`
1212
+ * will be reset to their respective defaults. Defaults to `true`.
1213
+ */
1214
+ resetOnFieldChange?: boolean;
1215
+ /**
1216
+ * When updating the `operator` of a rule, the rule's `value` and `valueSource`
1217
+ * will be reset to their respective defaults. Defaults to `false`.
1218
+ */
1219
+ resetOnOperatorChange?: boolean;
1220
+ /**
1221
+ * Determines the default operator name for a given field.
1222
+ */
1223
+ getRuleDefaultOperator?: (field: string) => string;
1224
+ /**
1225
+ * Determines the valid value sources for a given field and operator.
1226
+ */
1227
+ getValueSources?: (field: string, operator: string) => ValueSources | ValueSourceFlexibleOptions;
1228
+ /**
1229
+ * Gets the default value for a given rule, in case the value needs to be reset.
1230
+ */
1231
+ getRuleDefaultValue?: (rule: RuleType) => any;
1232
+ /**
1233
+ * Determines the valid match modes for a given field.
1234
+ */
1235
+ getMatchModes?: (field: string) => MatchModeOptions;
1236
+ }
1237
+ interface UpdateMethod {
1238
+ /**
1239
+ * Updates a single property of a rule or group.
1240
+ */
1241
+ <RG extends RuleGroupTypeAny>(query: RG, prop: UpdateableProperties, value: any, pathOrID: Path | string, options?: UpdateOptions): RG;
1242
+ /**
1243
+ * Updates multiple properties of a rule or group using parallel arrays of
1244
+ * property names and corresponding values.
1245
+ */
1246
+ <RG extends RuleGroupTypeAny>(query: RG, props: UpdateableProperties[], values: any[], pathOrID: Path | string, options?: UpdateOptions): RG;
1247
+ /**
1248
+ * Updates multiple properties of a rule or group using a map of property
1249
+ * names to their new values.
1250
+ */
1251
+ <RG extends RuleGroupTypeAny>(query: RG, props: UpdateValueMap, pathOrID: Path | string, options?: UpdateOptions): RG;
1252
+ }
1253
+ /**
1254
+ * Updates one or more properties of a rule or group within a query without
1255
+ * mutating the original query. Properties may be supplied individually
1256
+ * (`prop`, `value`), as parallel arrays (`props`, `values`), or as a
1257
+ * property-to-value map. For multi-property updates, `field`, `operator`, and
1258
+ * `valueSource` are applied before `value`, so an explicit `value` is never
1259
+ * reset by a change to one of those properties.
1260
+ *
1261
+ * @returns A new query with the rule or group properties updated.
1262
+ *
1263
+ * @group Query Tools
1264
+ */
1265
+ declare const update: UpdateMethod;
1266
+ /**
1267
+ * Updates one or more properties of a rule or group within a query in place.
1268
+ * See {@link update} for the supported argument forms and ordering semantics.
1269
+ *
1270
+ * @returns The query (mutated in place) with the rule or group properties updated.
1271
+ *
1272
+ * @group Query Tools
1273
+ */
1274
+ declare const updateInPlace: UpdateMethod;
1275
+ /**
1276
+ * Options for {@link remove}.
1277
+ *
1278
+ * @group Query Tools
1279
+ */
1280
+ interface RemoveOptions extends QueryToolOptions {}
1281
+ interface RemoveMethod {
1282
+ <RG extends RuleGroupTypeAny>(query: RG, pathOrID: Path | string, options?: RemoveOptions): RG;
1283
+ }
1284
+ /**
1285
+ * Removes a rule or group from a query without mutating the original query.
1286
+ *
1287
+ * @returns A new query with the rule or group removed.
1288
+ *
1289
+ * @group Query Tools
1290
+ */
1291
+ declare const remove: RemoveMethod;
1292
+ /**
1293
+ * Removes a rule or group from a query in place.
1294
+ *
1295
+ * @returns The query (mutated in place) with the rule or group removed.
1296
+ *
1297
+ * @group Query Tools
1298
+ */
1299
+ declare const removeInPlace: RemoveMethod;
1300
+ /**
1301
+ * Options for {@link move}.
1302
+ *
1303
+ * @group Query Tools
1304
+ */
1305
+ interface MoveOptions extends QueryToolOptions {
1306
+ /**
1307
+ * When `true`, the source rule/group will not be removed from its original path.
1308
+ */
1309
+ clone?: boolean;
1310
+ /**
1311
+ * If the query extends `RuleGroupTypeIC` (i.e. the query is using independent
1312
+ * combinators), then the first combinator in this list will be inserted before
1313
+ * the rule/group if necessary.
1314
+ */
1315
+ combinators?: OptionList;
1316
+ /**
1317
+ * ID generator.
1318
+ */
1319
+ idGenerator?: () => string;
1320
+ }
1321
+ interface MoveMethod {
1322
+ <RG extends RuleGroupTypeAny>(query: RG, oldPathOrID: Path | string, newPath: Path | "up" | "down", options?: MoveOptions): RG;
1323
+ }
1324
+ /**
1325
+ * Moves a rule or group from one path to another without mutating the original query.
1326
+ * In the options parameter, pass `{ clone: true }` to copy instead of move.
1327
+ *
1328
+ * @returns A new query with the rule or group moved or cloned.
1329
+ *
1330
+ * @group Query Tools
1331
+ */
1332
+ declare const move: MoveMethod;
1333
+ /**
1334
+ * Moves a rule or group from one path to another in place.
1335
+ * In the options parameter, pass `{ clone: true }` to copy instead of move.
1336
+ *
1337
+ * @returns The query (mutated in place) with the rule or group moved or cloned.
1338
+ *
1339
+ * @group Query Tools
1340
+ */
1341
+ declare const moveInPlace: MoveMethod;
1342
+ /**
1343
+ * Options for {@link insert}.
1344
+ *
1345
+ * @group Query Tools
1346
+ */
1347
+ interface InsertOptions extends QueryToolOptions {
1348
+ /**
1349
+ * If the query extends `RuleGroupTypeIC` (i.e. the query has independent
1350
+ * combinators), then the first combinator in this list will be inserted
1351
+ * before the new rule/group if the parent group is not empty. This option
1352
+ * is overridden by `combinatorPreceding`.
1353
+ */
1354
+ combinators?: OptionList;
1355
+ /**
1356
+ * If the query extends `RuleGroupTypeIC` (i.e. the query has independent
1357
+ * combinators), then this combinator will be inserted before the new rule/group
1358
+ * if the parent group is not empty and the new rule/group is not the first in the
1359
+ * group (`path.at(-1) > 0`). This option will supersede `combinators`.
1360
+ */
1361
+ combinatorPreceding?: string;
1362
+ /**
1363
+ * If the query extends `RuleGroupTypeIC` (i.e. the query has independent
1364
+ * combinators), then this combinator will be inserted after the new rule/group
1365
+ * if the parent group is not empty and the new rule/group is the first in the
1366
+ * group (`path.at(-1) === 0`). This option will supersede `combinators`.
1367
+ */
1368
+ combinatorSucceeding?: string;
1369
+ /**
1370
+ * ID generator.
1371
+ *
1372
+ * @default generateID
1373
+ */
1374
+ idGenerator?: () => string;
1375
+ /**
1376
+ * When `true`, the new rule/group will replace the rule/group at `path`.
1377
+ */
1378
+ replace?: boolean;
1379
+ }
1380
+ interface InsertMethod {
1381
+ <RG extends RuleGroupTypeAny>(query: RG, ruleOrGroup: RG | RuleType, path: number[], options?: InsertOptions): RG;
1382
+ }
1383
+ /**
1384
+ * Inserts a rule or group into a query without mutating the original query.
1385
+ *
1386
+ * @returns A new query with the rule or group inserted.
1387
+ *
1388
+ * @group Query Tools
1389
+ */
1390
+ declare const insert: InsertMethod;
1391
+ /**
1392
+ * Inserts a rule or group into a query in place.
1393
+ *
1394
+ * @returns The query (mutated in place) with the rule or group inserted.
1395
+ *
1396
+ * @group Query Tools
1397
+ */
1398
+ declare const insertInPlace: InsertMethod;
1399
+ /**
1400
+ * Options for {@link group}.
1401
+ *
1402
+ * @group Query Tools
1403
+ */
1404
+ interface GroupOptions extends QueryToolOptions {
1405
+ /**
1406
+ * When `true`, the source rule/group will not be removed from its original path.
1407
+ */
1408
+ clone?: boolean;
1409
+ /**
1410
+ * If the query extends `RuleGroupTypeIC` (i.e. the query is using independent
1411
+ * combinators), then the first combinator in this list will be inserted between
1412
+ * the two rules/groups.
1413
+ */
1414
+ combinators?: OptionList;
1415
+ /**
1416
+ * ID generator.
1417
+ */
1418
+ idGenerator?: () => string;
1419
+ }
1420
+ interface GroupMethod {
1421
+ <RG extends RuleGroupTypeAny>(query: RG, sourcePathOrID: Path | string, targetPathOrID: Path | string, options?: GroupOptions): RG;
1422
+ }
1423
+ /**
1424
+ * Creates a new group at a target path with its `rules` array containing the current
1425
+ * objects at the target path and the source path without mutating the original query.
1426
+ * In the options parameter, pass `{ clone: true }` to copy the source rule/group instead of move.
1427
+ *
1428
+ * @returns A new query with the rules or groups grouped.
1429
+ *
1430
+ * @group Query Tools
1431
+ */
1432
+ declare const group: GroupMethod;
1433
+ /**
1434
+ * Creates a new group at a target path with its `rules` array containing the current
1435
+ * objects at the target path and the source path in place.
1436
+ * In the options parameter, pass `{ clone: true }` to copy the source rule/group instead of move.
1437
+ *
1438
+ * @returns The query (mutated in place) with the rules or groups grouped.
1439
+ *
1440
+ * @group Query Tools
1441
+ */
1442
+ declare const groupInPlace: GroupMethod;
1443
+ //#endregion
1444
+ //#region src/utils/abortReasons.d.ts
1445
+ /**
1446
+ * Abort reasons that {@link QueryManager}'s `strict` mode treats as errors. The remaining
1447
+ * reasons—`"same-location"` and `"no-change"`—describe valid operations that had nothing to do,
1448
+ * so they are reported to `onInvalidTarget` but never throw.
1449
+ *
1450
+ * Declared apart from `QueryManager` so the `@react-querybuilder/core/derivations` entry point can
1451
+ * export it without putting the manager in its module graph.
1452
+ *
1453
+ * @group Query Tools
1454
+ */
1455
+ declare const strictAbortReasons: readonly AbortReason[];
1456
+ //#endregion
1457
+ //#region src/utils/arrayUtils.d.ts
1458
+ /**
1459
+ * Splits a string by a given character (see {@link defaultJoinChar}). Escaped characters
1460
+ * (characters preceded by a backslash) will not apply to the split, and the backslash will
1461
+ * be removed in the array element. Inverse of {@link joinWith}.
1462
+ *
1463
+ * @example
1464
+ * splitBy('this\\,\\,that,,the other,,,\\,')
1465
+ * // or
1466
+ * splitBy('this\\,\\,that,,the other,,,\\,', ',')
1467
+ * // would return
1468
+ * ['this,,that', '', 'the other', '', '', ',']
1469
+ */
1470
+ declare const splitBy: (str?: string, splitChar?: string) => string[];
1471
+ /**
1472
+ * Joins an array of strings using the given character (see {@link defaultJoinChar}). When
1473
+ * the given character appears in an array element, a backslash will be added just before it
1474
+ * to distinguish it from the join character. Effectively the inverse of {@link splitBy}.
1475
+ *
1476
+ * TIP: The join character can actually be a string of any length. Only the first character
1477
+ * will be searched for in the array elements and preceded by a backslash.
1478
+ *
1479
+ * @example
1480
+ * joinWith(['this,,that', '', 'the other', '', '', ','], ', ')
1481
+ * // would return
1482
+ * 'this\\,\\,that, , the other, , , \\,'
1483
+ */
1484
+ declare const joinWith: (strArr: unknown[], joinChar?: string) => string;
1485
+ type IsUnknown<T> = unknown extends T ? true : false;
1486
+ type Trimmed<T> = IsUnknown<T> extends true ? string : T;
1487
+ /**
1488
+ * Trims the value if it is a string. Otherwise returns the value as is.
1489
+ */
1490
+ declare const trimIfString: <T>(val: T) => Trimmed<T>;
1491
+ type ToArrayResult<T> = IsUnknown<T> extends true ? string[] : T extends readonly (infer U)[] ? Trimmed<U>[] : T extends string ? string[] : T extends number ? number[] : never[];
1492
+ /**
1493
+ * Splits a string by comma then trims each element. Arrays are returned as is except
1494
+ * any string elements are trimmed.
1495
+ */
1496
+ declare const toArray: <T>(a: T, { retainEmptyStrings }?: {
1497
+ retainEmptyStrings?: boolean;
1498
+ }) => ToArrayResult<T>;
1499
+ /**
1500
+ * Determines if an array is free of `null`/`undefined`.
1501
+ */
1502
+ declare const nullFreeArray: <T>(arr: T[]) => arr is Exclude<T, null>[];
1503
+ //#endregion
1504
+ //#region ../../node_modules/clsx/clsx.d.mts
1505
+ type ClassValue = ClassArray | ClassDictionary | string | number | bigint | null | boolean | undefined;
1506
+ type ClassDictionary = Record<string, any>;
1507
+ type ClassArray = ClassValue[];
1508
+ declare function clsx(...inputs: ClassValue[]): string;
1509
+ //#endregion
1510
+ //#region src/utils/coalesce.d.ts
1511
+ /**
1512
+ * Determines whether a change should be absorbed into the current history entry instead of
1513
+ * pushing a new one. This is the exact rule {@link QueryManager} applies when recording history,
1514
+ * exposed so non-React implementations can manage their own history stacks without
1515
+ * reimplementing (and drifting from) the semantics.
1516
+ *
1517
+ * A change coalesces only when all three hold:
1518
+ * - the change is not structural (rules/groups added, removed, moved, or reordered)
1519
+ * - its signature matches the previously recorded signature
1520
+ * - it occurred within `coalesceMs` of the previous recording
1521
+ *
1522
+ * Note that {@link unchangedSignature} is not handled here. A change with no observable
1523
+ * difference is never recorded at all, which is a separate decision made before this check.
1524
+ *
1525
+ * @param prevSig Signature of the previously recorded change, or `undefined` if there is none.
1526
+ * @param nextSig Signature of the change being recorded, from {@link signatureOf}.
1527
+ * @param prevAt Timestamp of the previous recording.
1528
+ * @param now Timestamp of the change being recorded.
1529
+ * @param coalesceMs Coalescing window in milliseconds.
1530
+ */
1531
+ declare const shouldCoalesce: (prevSig: string | undefined, nextSig: string, prevAt: number, now: number, coalesceMs?: number) => boolean;
1532
+ //#endregion
1533
+ //#region src/utils/convertQuery.d.ts
1534
+ /**
1535
+ * Converts a {@link RuleGroupTypeIC} to {@link RuleGroupType}.
1536
+ *
1537
+ * This function is idempotent: {@link RuleGroupType} queries will be
1538
+ * returned as-is.
1539
+ *
1540
+ * @group Query Tools
1541
+ */
1542
+ declare const convertFromIC: <RG extends RuleGroupTypeAny>(rg: RG) => ToRuleGroupType<RG>;
1543
+ /**
1544
+ * Converts a {@link RuleGroupType} to {@link RuleGroupTypeIC}.
1545
+ *
1546
+ * This function is idempotent: {@link RuleGroupTypeIC} queries will be
1547
+ * returned as-is.
1548
+ *
1549
+ * @group Query Tools
1550
+ */
1551
+ declare const convertToIC: <RG extends RuleGroupTypeAny>(rg: RG) => ToRuleGroupTypeIC<RG>;
1552
+ /**
1553
+ * Converts a {@link RuleGroupType} to {@link RuleGroupTypeIC}. For a more explicit
1554
+ * operation, use {@link convertToIC}.
1555
+ *
1556
+ * @group Query Tools
1557
+ */
1558
+ declare function convertQuery(query: RuleGroupType): RuleGroupTypeIC;
1559
+ /**
1560
+ * Converts a {@link RuleGroupTypeIC} to {@link RuleGroupType}. For a more explicit
1561
+ * operation, use {@link convertFromIC}.
1562
+ *
1563
+ * @group Query Tools
1564
+ */
1565
+ declare function convertQuery(query: RuleGroupTypeIC): RuleGroupType;
1566
+ //#endregion
1567
+ //#region src/utils/defaultValidator.d.ts
1568
+ /**
1569
+ * This is an example validation function you can pass to {@link react-querybuilder!QueryBuilder QueryBuilder} in the
1570
+ * `validator` prop. It assumes that you want to validate groups, and has a no-op
1571
+ * for validating rules which you can replace with your own implementation.
1572
+ */
1573
+ declare const defaultValidator: QueryValidator;
1574
+ //#endregion
1575
+ //#region src/utils/deriveClassNames.d.ts
1576
+ /** Classname keys that have both a standard class and a `controlClassnames` entry. */
1577
+ type StandardClassnameKey = keyof typeof standardClassnames & keyof Classnames;
1578
+ /**
1579
+ * A classname applied only when `when` returns true for the current state.
1580
+ *
1581
+ * `key` is used to look up both the standard classname and the corresponding `controlClassnames`
1582
+ * entry. Set `standardOnly` when the standard class is conditional but no custom class
1583
+ * corresponds to it.
1584
+ */
1585
+ interface ClassnameCondition<S> {
1586
+ key: StandardClassnameKey;
1587
+ when: (state: S) => boolean | undefined;
1588
+ standardOnly?: boolean;
1589
+ }
1590
+ /**
1591
+ * How one derived classname is composed: the `controlClassnames` keys that contribute to it (in
1592
+ * application order, after the standard classname), plus any state-dependent classes.
1593
+ */
1594
+ interface ClassnameSpec<S> {
1595
+ sources: readonly (keyof Classnames)[];
1596
+ conditions?: readonly ClassnameCondition<S>[];
1597
+ }
1598
+ /** Keys of the `classNames` object returned for a rule. */
1599
+ type RuleClassnameKey = "shiftActions" | "dragHandle" | "fields" | "matchMode" | "matchThreshold" | "operators" | "valueSource" | "value" | "cloneRule" | "lockRule" | "muteRule" | "removeRule" | "valueListItem";
1600
+ /** Keys of the `classNames` object returned for a rule group. */
1601
+ type RuleGroupClassnameKey = "header" | "shiftActions" | "undoRedoActions" | "undoAction" | "redoAction" | "dragHandle" | "combinators" | "notToggle" | "addRule" | "addGroup" | "cloneGroup" | "lockGroup" | "muteGroup" | "removeGroup" | "body";
1602
+ /** Drag-and-drop state that can contribute conditional classnames. */
1603
+ interface DndClassNameState {
1604
+ isDragging?: boolean;
1605
+ isOver?: boolean;
1606
+ dropEffect?: "move" | "copy";
1607
+ groupItems?: boolean;
1608
+ dropNotAllowed?: boolean;
1609
+ }
1610
+ /** State that contributes conditional classnames to a rule's wrapper element. */
1611
+ interface RuleClassNameState extends DndClassNameState {
1612
+ disabled?: boolean;
1613
+ muted?: boolean;
1614
+ hasSubQuery?: boolean;
1615
+ }
1616
+ /** State that contributes conditional classnames to the query builder's wrapper element. */
1617
+ interface QueryBuilderClassNameState {
1618
+ disabled?: boolean;
1619
+ validationResult?: boolean | ValidationMap;
1620
+ }
1621
+ /** Options common to every classname derivation. */
1622
+ interface DeriveClassNamesOptions {
1623
+ /** The merged `controlClassnames` for the query builder. */
1624
+ classNames: Partial<Classnames> | undefined;
1625
+ /** When `true`, standard (`rule`, `ruleGroup-*`, etc.) classnames are omitted. */
1626
+ suppressStandardClassnames?: boolean;
1627
+ }
1628
+ /**
1629
+ * Classnames for each element rendered by a rule. This is the framework-agnostic core of the
1630
+ * `classNames` object returned by the `useRule` hook.
1631
+ *
1632
+ * @group Query Tools
1633
+ */
1634
+ declare const deriveRuleClassNames: (options: DeriveClassNamesOptions) => Record<RuleClassnameKey, string>;
1635
+ /**
1636
+ * The classname for a single element of a rule, composed from the same table as
1637
+ * {@link deriveRuleClassNames}. Useful where only one is needed, such as the items of a
1638
+ * multi-value editor.
1639
+ *
1640
+ * @group Query Tools
1641
+ */
1642
+ declare const deriveRuleClassName: (key: RuleClassnameKey, options: DeriveClassNamesOptions) => string;
1643
+ /**
1644
+ * Classnames for each element rendered by a rule group, including its conditionally-classed
1645
+ * `header`. This is the framework-agnostic core of the `classNames` object returned by the
1646
+ * `useRuleGroup` hook.
1647
+ *
1648
+ * @group Query Tools
1649
+ */
1650
+ declare const deriveRuleGroupClassNames: (options: DeriveClassNamesOptions & DndClassNameState) => Record<RuleGroupClassnameKey, string>;
1651
+ /** Inputs common to every outer (wrapper) classname derivation. */
1652
+ interface OuterClassNameOptionsBase extends DeriveClassNamesOptions {
1653
+ /**
1654
+ * Classnames contributed by the rule or group itself and its configuration, applied first.
1655
+ * For a rule that is the rule/field/operator classnames; for a group, the group and combinator
1656
+ * classnames.
1657
+ */
1658
+ leadingClassNames?: (Classname | null)[];
1659
+ /** Appended last, as produced by `getValidationClassNames`. */
1660
+ validationClassName?: Classname;
1661
+ }
1662
+ /** Inputs to {@link deriveRuleOuterClassName} and {@link deriveRuleGroupOuterClassName}. */
1663
+ interface OuterClassNameOptions extends OuterClassNameOptionsBase, RuleClassNameState {}
1664
+ /**
1665
+ * The outer (wrapper) classname for a rule, including every conditional state class.
1666
+ *
1667
+ * @group Query Tools
1668
+ */
1669
+ declare const deriveRuleOuterClassName: (options: OuterClassNameOptions) => string;
1670
+ /**
1671
+ * The outer (wrapper) classname for a rule group, including every conditional state class.
1672
+ *
1673
+ * A group reflects fewer drag-and-drop states than a rule—`dndOver`, `dndCopy`,
1674
+ * `dndDropNotAllowed`, and `hasSubQuery` do not apply—so this is not interchangeable with
1675
+ * {@link deriveRuleOuterClassName}.
1676
+ *
1677
+ * @group Query Tools
1678
+ */
1679
+ declare const deriveRuleGroupOuterClassName: (options: OuterClassNameOptions) => string;
1680
+ /**
1681
+ * The outer (wrapper) classname for the query builder itself, including the conditional
1682
+ * `disabled`, `valid`, and `invalid` state classes.
1683
+ *
1684
+ * @group Query Tools
1685
+ */
1686
+ declare const deriveQueryBuilderClassNames: (options: OuterClassNameOptionsBase & QueryBuilderClassNameState) => string;
1687
+ //#endregion
1688
+ //#region src/utils/deriveRuleContext.d.ts
1689
+ /**
1690
+ * Functions used by {@link deriveRuleContext} to resolve a rule's configuration. Each corresponds
1691
+ * to the `QueryBuilder` prop (or `useQueryBuilderSetup` output) of the same name.
1692
+ */
1693
+ interface RuleContextResolvers<F extends FullField = FullField> {
1694
+ fields: OptionList<F>;
1695
+ fieldMap: Partial<FullOptionRecord<FullField>>;
1696
+ getInputType: (field: string, operator: string, misc: {
1697
+ fieldData: F;
1698
+ }) => InputType | null;
1699
+ getMatchModes: (field: string, misc: {
1700
+ fieldData: F;
1701
+ }) => MatchModeOptions;
1702
+ getOperators: (field: string, misc: {
1703
+ fieldData: F;
1704
+ }) => OptionList<FullOperator>;
1705
+ getParameters: (field: string, operator: string, misc: {
1706
+ fieldData: F;
1707
+ }) => FlexibleOptionList<Option>;
1708
+ getValueEditorType: (field: string, operator: string, misc: {
1709
+ fieldData: F;
1710
+ }) => ValueEditorType;
1711
+ getValues: (field: string, operator: string, misc: {
1712
+ fieldData: F;
1713
+ }) => FlexibleOptionList<Option>;
1714
+ getValueSources: (field: string, operator: string, misc: {
1715
+ fieldData: F;
1716
+ }) => ValueSourceFullOptions;
1717
+ getSubQueryBuilderProps?: (field: string, misc: {
1718
+ fieldData: F;
1719
+ }) => Record<string, unknown>;
1720
+ }
1721
+ /**
1722
+ * Everything {@link deriveRuleContext} resolves for a single rule.
1723
+ */
1724
+ interface RuleContext<F extends FullField = FullField> {
1725
+ fieldData: F;
1726
+ hideValueControls: boolean;
1727
+ inputType: InputType | null;
1728
+ matchModes: MatchModeOptions;
1729
+ operatorObject: FullOperator | undefined;
1730
+ operators: OptionList<FullOperator>;
1731
+ parameters: FlexibleOptionList<Option> | null;
1732
+ validationResult: boolean | ValidationResult;
1733
+ valueEditorType: ValueEditorType;
1734
+ values: FlexibleOptionList<Option>;
1735
+ valueSourceOptions: ValueSourceFullOptions;
1736
+ valueSources: ValueSources;
1737
+ subQueryBuilderProps: Record<string, unknown>;
1738
+ }
1739
+ /**
1740
+ * Resolves the field configuration for a rule's `field`, falling back to a minimal option object
1741
+ * when the field isn't present in the field map.
1742
+ */
1743
+ declare const getFieldData: (field: string, fieldMap: Partial<FullOptionRecord<FullField>>) => FullField;
1744
+ /**
1745
+ * The input type for a rule. A field's own `inputType` takes precedence over `getInputType`.
1746
+ */
1747
+ declare const getRuleInputType: <F extends FullField = FullField>(field: string, operator: string, fieldData: F, getInputType: RuleContextResolvers<F>["getInputType"]) => InputType | null;
1748
+ /**
1749
+ * Whether the value editor(s) should be hidden for an operator, based on its `arity`.
1750
+ */
1751
+ declare const hideValueControlsForOperator: (operatorObject?: FullOperator) => boolean;
1752
+ /**
1753
+ * The subset of a rule that determines its configuration. Accepting only these properties (rather
1754
+ * than the whole rule) lets React callers keep granular memoization dependencies, so editing a
1755
+ * rule's `value` doesn't recompute its operators, value sources, or option lists.
1756
+ */
1757
+ type RuleFacet = Pick<RuleType, "field" | "operator" | "valueSource">;
1758
+ /**
1759
+ * Value source options for a rule. A `valueSource` present on the rule but absent from the
1760
+ * configured list is appended, so the current selection is always representable.
1761
+ */
1762
+ declare const getRuleValueSourceOptions: <F extends FullField = FullField>(rule: RuleFacet, fieldData: F, getValueSources: RuleContextResolvers<F>["getValueSources"]) => ValueSourceFullOptions;
1763
+ /**
1764
+ * Normalizes the result of `getParameters` to a non-empty list or `null`.
1765
+ */
1766
+ declare const getParametersAsList: (parameters: FlexibleOptionList<Option>) => FlexibleOptionList<Option> | null;
1767
+ /**
1768
+ * The value editor type for a rule. `valueSource: "field"` always uses a select list, and
1769
+ * `valueSource: "parameter"` uses a (multi)select when parameters are available.
1770
+ */
1771
+ declare const getRuleValueEditorType: <F extends FullField = FullField>(rule: RuleFacet, fieldData: F, parametersAsList: FlexibleOptionList<Option> | null, getValueEditorType: RuleContextResolvers<F>["getValueEditorType"]) => ValueEditorType;
1772
+ /**
1773
+ * The option list presented by a rule's value editor, resolved from its `valueSource`.
1774
+ */
1775
+ declare const getRuleValues: <F extends FullField = FullField>(rule: RuleFacet, fieldData: F, fields: OptionList<F>, parametersAsList: FlexibleOptionList<Option> | null, getValues: RuleContextResolvers<F>["getValues"]) => FlexibleOptionList<Option>;
1776
+ /**
1777
+ * The validation result for a rule: the entry from a query-level {@link ValidationMap} if present,
1778
+ * otherwise the field's own `validator` result, otherwise `null`.
1779
+ */
1780
+ declare const getRuleValidationResult: (rule: RuleType, fieldData: FullField, validationMap?: ValidationMap, id?: string) => boolean | ValidationResult;
1781
+ /**
1782
+ * Resolves everything about a single rule that depends on the field/operator configuration:
1783
+ * its field data, operators, value editor type, value list, value sources, match modes, and
1784
+ * validation result.
1785
+ *
1786
+ * This is the framework-agnostic core of the `useRule` hook, shared with
1787
+ * {@link QueryManager.getRuleContext} so that non-React implementations derive identical results.
1788
+ * It performs no memoization; callers are responsible for caching as appropriate.
1789
+ *
1790
+ * @group Query Tools
1791
+ */
1792
+ declare const deriveRuleContext: <F extends FullField = FullField>(rule: RuleType, resolvers: RuleContextResolvers<F>, options?: {
1793
+ validationMap?: ValidationMap;
1794
+ id?: string;
1795
+ }) => RuleContext<F>;
1796
+ /**
1797
+ * Everything {@link deriveRuleGroupContext} resolves for a single rule group.
1798
+ */
1799
+ interface RuleGroupContext<C extends FullCombinator = FullCombinator> {
1800
+ combinator: string;
1801
+ combinatorObject: C | undefined;
1802
+ combinators: FullOptionList<C>;
1803
+ /** The `className` of the selected combinator, or `null` for independent combinators. */
1804
+ combinatorBasedClassName: Classname | null;
1805
+ independentCombinators: boolean;
1806
+ validationResult: boolean | ValidationResult;
1807
+ }
1808
+ /**
1809
+ * The effective combinator for a group: its own `combinator` when it has one, otherwise the
1810
+ * first configured combinator (which is the case for groups with independent combinators).
1811
+ *
1812
+ * This intentionally covers only the current property-based API. The `RuleGroup` component
1813
+ * additionally falls back to its deprecated `combinator` prop; that fallback stays in the hook.
1814
+ */
1815
+ declare const getRuleGroupCombinator: <C extends FullCombinator = FullCombinator>(ruleGroup: RuleGroupTypeAny, combinators: FullOptionList<C>) => string;
1816
+ /**
1817
+ * Resolves everything about a rule group that depends on the combinator configuration, plus its
1818
+ * validation result.
1819
+ *
1820
+ * Note that unlike {@link deriveRuleContext}, there is no field-level validator fallback—a
1821
+ * group's validation result comes only from the query-level {@link ValidationMap}.
1822
+ *
1823
+ * @group Query Tools
1824
+ */
1825
+ declare const deriveRuleGroupContext: <C extends FullCombinator = FullCombinator>(ruleGroup: RuleGroupTypeAny, combinators: FullOptionList<C>, options?: {
1826
+ validationMap?: ValidationMap;
1827
+ id?: string;
1828
+ }) => RuleGroupContext<C>;
1829
+ //#endregion
1830
+ //#region src/utils/deriveValueEditor.d.ts
1831
+ /**
1832
+ * Whether an operator's value is a list of two bounds.
1833
+ *
1834
+ * @group Value Editors
1835
+ */
1836
+ declare const isBetweenOperator: (operator: string) => boolean;
1837
+ /**
1838
+ * Determines whether a rule's `value` needs to be collapsed to a single element because it no
1839
+ * longer represents a list, and what it should become.
1840
+ *
1841
+ * This happens when the value is an array (or a comma-containing string in a `number` input,
1842
+ * which `<input type="number">` can't display) while the operator is not one of the multi-value
1843
+ * operators and the editor is not a multiselect—typically right after the operator changes from
1844
+ * `"in"` or `"between"` to something else.
1845
+ *
1846
+ * The React `useValueEditor` hook applies the result in an effect; other implementations may
1847
+ * apply it wherever is idiomatic.
1848
+ *
1849
+ * @group Value Editors
1850
+ */
1851
+ declare const getValueEditorReset: ({ skipHook, type, operator, value, inputType }: {
1852
+ skipHook?: boolean;
1853
+ type?: string;
1854
+ operator: string;
1855
+ value: unknown;
1856
+ inputType?: InputType | null;
1857
+ }) => {
1858
+ reset: boolean;
1859
+ value: unknown;
1860
+ };
1861
+ /**
1862
+ * Produces the next value for a series of value editors when the editor at `index` changes.
1863
+ *
1864
+ * For `between`/`notBetween`, editing the first bound guarantees an array of at least two
1865
+ * elements, seeding the second from the first available option. The result is a comma-joined
1866
+ * string unless `listsAsArrays` is `true`.
1867
+ *
1868
+ * @group Value Editors
1869
+ */
1870
+ declare const getMultiValueUpdate: ({ value, index, valueAsArray, operator, values, listsAsArrays, parseNumberMethod }: {
1871
+ value: unknown;
1872
+ index: number;
1873
+ valueAsArray: unknown[];
1874
+ operator: string;
1875
+ values?: any[];
1876
+ listsAsArrays?: boolean;
1877
+ parseNumberMethod?: ParseNumberMethod;
1878
+ }) => unknown;
1879
+ /**
1880
+ * Coerces a value to a `bigint`, falling back to the parsed number when it can't be represented
1881
+ * as one (an empty string or a decimal, for example).
1882
+ *
1883
+ * @group Value Editors
1884
+ */
1885
+ declare const coerceBigIntValue: (value: unknown, parseNumberMethod?: ParseNumberMethod) => unknown;
1886
+ /**
1887
+ * The `type` attribute an `<input>` should use for a rule. `bigint` values and the `in`/`notIn`
1888
+ * operators (whose value is a comma-separated list) both require a text input.
1889
+ *
1890
+ * @group Value Editors
1891
+ */
1892
+ declare const coerceInputType: (inputType: InputType | null | undefined, operator: string) => InputType;
1893
+ /**
1894
+ * Produces the next value for a value selector. Multiselect values are normalized to an array
1895
+ * first, then comma-joined unless `listsAsArrays` is `true`. Single-select values pass through.
1896
+ *
1897
+ * @group Value Editors
1898
+ */
1899
+ declare const getValueSelectorUpdate: (value: string | string[], { multiple, listsAsArrays }?: {
1900
+ multiple?: boolean;
1901
+ listsAsArrays?: boolean;
1902
+ }) => string | string[];
1903
+ /**
1904
+ * Normalizes a value selector's current value for display. Multiselect values become an array of
1905
+ * strings so they match option names, which are always strings (e.g. `[42]` becomes `["42"]`).
1906
+ *
1907
+ * @group Value Editors
1908
+ */
1909
+ declare const normalizeValueSelectorValue: (value: unknown, multiple?: boolean) => any;
1910
+ //#endregion
1911
+ //#region src/utils/filterFieldsByComparator.d.ts
1912
+ /**
1913
+ * For a given {@link FullField}, returns the `fields` list filtered for
1914
+ * other fields that match by `comparator`. Only fields *other than the
1915
+ * one in question* will ever be included, even if `comparator` is `null`
1916
+ * or `undefined`. If `comparator` is a string, fields with the same value
1917
+ * for that property will be included. If `comparator` is a function, each
1918
+ * field will be passed to the function along with the `operator` and fields
1919
+ * for which the function returns `true` will be included.
1920
+ *
1921
+ * @group Option Lists
1922
+ */
1923
+ declare const filterFieldsByComparator: (field: FullField, fields: OptionList<FullField>, operator: string) => FullField[] | {
1924
+ options: WithUnknownIndex<FullField>[];
1925
+ label: string;
1926
+ }[];
1927
+ //#endregion
1928
+ //#region src/utils/generateAccessibleDescription.d.ts
1929
+ /**
1930
+ * The default `accessibleDescriptionGenerator`. Produces the `aria-label` for a rule group:
1931
+ * `"Query builder"` for the root group, `"Rule group at path 0-1"` for any other.
1932
+ *
1933
+ * @group Accessibility
1934
+ */
1935
+ declare const generateAccessibleDescription: AccessibleDescriptionGenerator;
1936
+ //#endregion
1937
+ //#region src/utils/generateID.d.ts
1938
+ type UUID = `${string}-${string}-${string}-${string}-${string}`;
1939
+ declare const uuidV4regex: RegExp;
1940
+ /**
1941
+ * Default `id` generator. Generates a valid v4 UUID. Uses `crypto.randomUUID()`
1942
+ * when available, otherwise uses an alternate method based on `getRandomValues`.
1943
+ * The returned string is guaranteed to match this regex:
1944
+ * ```
1945
+ * /^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i
1946
+ * ```
1947
+ * @returns Valid v4 UUID
1948
+ */
1949
+ declare let generateID: () => UUID;
1950
+ //#endregion
1951
+ //#region src/utils/getMatchModesUtil.d.ts
1952
+ /**
1953
+ * Utility function to get the match modes array for the given
1954
+ * field. If the field definition does not define a `matchModes`
1955
+ * property, the `getMatchModes` prop is used. Returns
1956
+ * `FullOption<MatchMode>[]` of all match modes by default.
1957
+ */
1958
+ declare const getMatchModesUtil: <F extends FullField>(fieldData: F, getMatchModes?: (field: GetOptionIdentifierType<F>, misc: {
1959
+ fieldData: F;
1960
+ }) => boolean | MatchMode[] | FlexibleOption<MatchMode>[]) => MatchModeOptions;
1961
+ //#endregion
1962
+ //#region src/utils/getParseNumberMethod.d.ts
1963
+ declare const getParseNumberMethod: ({ parseNumbers, inputType }: {
1964
+ parseNumbers?: ParseNumbersPropConfig;
1965
+ inputType?: InputType | null;
1966
+ }) => ParseNumberMethod;
1967
+ //#endregion
1968
+ //#region src/utils/getRuleDefaultValue.d.ts
1969
+ /** Options for {@link getRuleDefaultValue}. */
1970
+ interface GetRuleDefaultValueOptions<F extends FullField = FullField> {
1971
+ /** Resolved field configuration for `rule.field` (e.g. `fieldMap[rule.field] ?? {}`). */
1972
+ fieldData: F;
1973
+ /** Full field list, used to seed a comparator-valid field when `valueSource` is `'field'`. */
1974
+ fields: FullOptionList<F>;
1975
+ /** Resolves the editor type for the field/operator (drives select/radio/checkbox defaults). */
1976
+ getValueEditorType: (field: string, operator: string, meta: {
1977
+ fieldData: F;
1978
+ }) => ValueEditorType;
1979
+ /** Resolves the value option list for the field/operator. */
1980
+ getValues: (field: string, operator: string, meta: {
1981
+ fieldData: F;
1982
+ }) => FullOptionList<Option>;
1983
+ /** Optional escape hatch overriding the computed default. */
1984
+ getDefaultValue?: (rule: RuleType, meta: {
1985
+ fieldData: F;
1986
+ }) => unknown;
1987
+ /** Named parameter options, used to seed a default when `valueSource` is `'parameter'`. */
1988
+ getParameters?: (field: string, operator: string, meta: {
1989
+ fieldData: F;
1990
+ }) => FullOptionList<Option> | null;
1991
+ /** When `true`, multi-value defaults are arrays instead of comma-joined strings. */
1992
+ listsAsArrays?: boolean;
1993
+ }
1994
+ /**
1995
+ * Computes the default `value` for a rule given its `field`/`operator`/`valueSource`, mirroring
1996
+ * the precedence the {@link react-querybuilder!QueryBuilder QueryBuilder} applies: a field's
1997
+ * `defaultValue`, then a `getDefaultValue` override, then a value derived from the field/operator's
1998
+ * value list and editor type (first option for `select`/`radio`, `false` for `checkbox`, paired for
1999
+ * `between`/`notBetween`), or a comparator-valid field when `valueSource` is `'field'`. Falls back
2000
+ * to `''`.
2001
+ *
2002
+ * @group Option Lists
2003
+ */
2004
+ declare const getRuleDefaultValue$1: <F extends FullField = FullField>(rule: RuleType, options: GetRuleDefaultValueOptions<F>) => unknown;
2005
+ //#endregion
2006
+ //#region src/utils/getValidationClassNames.d.ts
2007
+ /**
2008
+ * Gets the standard classname for valid or invalid components
2009
+ * based on the given validation result.
2010
+ */
2011
+ declare const getValidationClassNames: (validationResult: boolean | ValidationResult) => "" | (typeof standardClassnames)["valid"] | (typeof standardClassnames)["invalid"];
2012
+ //#endregion
2013
+ //#region src/utils/getValueSourcesUtil.d.ts
2014
+ /**
2015
+ * Utility function to get the value sources array for the given
2016
+ * field and operator. If the field definition does not define a
2017
+ * `valueSources` property, the `getValueSources` prop is used.
2018
+ * Returns `[FullOption<"value">]` by default.
2019
+ */
2020
+ declare const getValueSourcesUtil: <F extends FullField, O extends string>(fieldData: F, operator: string, getValueSources?: (field: GetOptionIdentifierType<F>, operator: O, misc: {
2021
+ fieldData: F;
2022
+ }) => ValueSources | ValueSourceFlexibleOptions) => ValueSourceFullOptions;
2023
+ //#endregion
2024
+ //#region src/utils/immerInstances.d.ts
2025
+ /**
2026
+ * Globally enables or disables immer's auto-freeze, i.e. the deep freeze applied to every query
2027
+ * returned by {@link add}, {@link update}, {@link remove}, {@link move}, {@link insert}, and
2028
+ * {@link group}.
2029
+ *
2030
+ * Re-exported from immer so that consumers mixing these tools with their own `produce` calls can
2031
+ * switch both at once. Prefer the per-call `freeze` option, or the {@link QueryManager} option of
2032
+ * the same name, when the change should not be process-wide. A per-call `freeze: false` wins
2033
+ * regardless of this setting; a per-call `freeze: true` does not re-enable freezing once this has
2034
+ * turned it off, since it selects immer's default instance.
2035
+ *
2036
+ * @group Query Tools
2037
+ */
2038
+ declare const setAutoFreeze: (autoFreeze: boolean) => void;
2039
+ //#endregion
2040
+ //#region src/utils/isRuleGroup.d.ts
2041
+ /**
2042
+ * Determines if an object is a {@link RuleType} (only checks for a `field` property).
2043
+ */
2044
+ declare const isRuleType: (s: unknown) => s is RuleType;
2045
+ /**
2046
+ * Determines if an object is a {@link RuleGroupType} or {@link RuleGroupTypeIC}.
2047
+ */
2048
+ declare const isRuleGroup: (rg: unknown) => rg is RuleGroupTypeAny;
2049
+ /**
2050
+ * Determines if an object is a {@link RuleGroupType}.
2051
+ */
2052
+ declare const isRuleGroupType: (rg: unknown) => rg is RuleGroupType;
2053
+ /**
2054
+ * Determines if an object is a {@link RuleGroupTypeIC}.
2055
+ */
2056
+ declare const isRuleGroupTypeIC: (rg: unknown) => rg is RuleGroupTypeIC;
2057
+ //#endregion
2058
+ //#region src/utils/isRuleOrGroupValid.d.ts
2059
+ /**
2060
+ * Determines if an object is useful as a validation result.
2061
+ */
2062
+ declare const isValidationResult: (vr?: ValidationResult) => vr is ValidationResult;
2063
+ /**
2064
+ * Determines if a rule or group is valid based on a validation result (if defined)
2065
+ * or a validator function. Returns `true` if neither are defined and the `muted`
2066
+ * property is not `true`.
2067
+ */
2068
+ declare const isRuleOrGroupValid: (rg: RuleType | RuleGroupTypeAny, validationResult?: boolean | ValidationResult, validator?: RuleValidator) => boolean;
2069
+ //#endregion
2070
+ //#region src/utils/mergeAnyTranslations.d.ts
2071
+ /**
2072
+ * Merges any number of partial translations into a single definition.
2073
+ */
2074
+ declare const mergeAnyTranslations: (base: Record<string, Record<string, unknown>>, ...otherTranslations: (Record<string, Record<string, unknown>> | undefined)[]) => Record<string, Record<string, unknown>>;
2075
+ declare const mergeAnyTranslation: (el: string, keyPropContextMap: Record<string, [unknown, unknown]>, defaults?: Record<string, Record<string, unknown>>) => Record<string, Record<string, unknown>> | undefined;
2076
+ //#endregion
2077
+ //#region src/utils/mergeClassnames.d.ts
2078
+ type MergeClassnamesParams = (Partial<Classnames> | undefined)[];
2079
+ /**
2080
+ * Merges a list of partial {@link Classnames} definitions into a single definition.
2081
+ */
2082
+ declare const mergeClassnames: (...args: MergeClassnamesParams) => Classnames;
2083
+ //#endregion
2084
+ //#region src/utils/misc.d.ts
2085
+ /**
2086
+ * Converts a value to lowercase if it's a string, otherwise returns the value as is.
2087
+ */
2088
+ declare const lc: <T>(v: T) => T;
2089
+ /**
2090
+ * Regex matching numeric strings. Passes for positive/negative integers, decimals,
2091
+ * and E notation, with optional surrounding whitespace.
2092
+ */
2093
+ declare const numericRegex: RegExp;
2094
+ /**
2095
+ * Determines if a variable is a plain old JavaScript object, aka POJO.
2096
+ */
2097
+ declare const isPojo: (obj: unknown) => obj is Record<string, any>;
2098
+ /**
2099
+ * Simple helper to determine whether a value is null, undefined, or an empty string.
2100
+ */
2101
+ declare const nullOrUndefinedOrEmpty: (value: unknown) => value is null | undefined | "";
2102
+ //#endregion
2103
+ //#region src/utils/objectUtils.d.ts
2104
+ /**
2105
+ * Original looked like this (not sure why template string is used):
2106
+ * ```
2107
+ * type ObjectKeys<T extends object> = `${Exclude<keyof T, symbol>}`;
2108
+ * ```
2109
+ */
2110
+ type ObjectKeys<T extends object> = Exclude<keyof T, symbol>;
2111
+ /**
2112
+ * A strongly-typed version of `Object.keys()`.
2113
+ *
2114
+ * [Original source](https://github.com/sindresorhus/ts-extras/blob/44f57392c5f027268330771996c4fdf9260b22d6/source/object-keys.ts)
2115
+ */
2116
+ declare const objectKeys: <Type extends object>(value: Type) => Array<ObjectKeys<Type>>;
2117
+ /**
2118
+ * A strongly-typed version of `Object.entries()`.
2119
+ *
2120
+ * [Original source](https://github.com/sindresorhus/ts-extras/blob/44f57392c5f027268330771996c4fdf9260b22d6/source/object-entries.ts)
2121
+ */
2122
+ declare const objectEntries: <Type extends Record<PropertyKey, unknown>>(value: Type) => Array<[ObjectKeys<Type>, Type[ObjectKeys<Type>]]>;
2123
+ /**
2124
+ * Returns `true` if the key could cause prototype pollution when used
2125
+ * as a property name in bracket-notation assignment.
2126
+ */
2127
+ declare const isUnsafeKey: (key: unknown) => boolean;
2128
+ //#endregion
2129
+ //#region src/utils/optGroupUtils.d.ts
2130
+ /**
2131
+ * Converts an {@link Option} or {@link ValueOption} (i.e., {@link BaseOption})
2132
+ * into a {@link FullOption}. Full options are left unchanged.
2133
+ *
2134
+ * @group Option Lists
2135
+ */
2136
+ declare function toFullOption<Opt extends BaseOption>(opt: Opt | string, baseProperties?: Record<string, unknown>, labelMap?: Record<string, unknown>): ToFullOption<Opt>;
2137
+ /**
2138
+ * Converts an {@link OptionList} or {@link FlexibleOptionList} into a {@link FullOptionList}.
2139
+ * Lists of full options are left unchanged.
2140
+ *
2141
+ * @group Option Lists
2142
+ */
2143
+ declare function toFullOptionList<Opt extends BaseOption>(optList: unknown[], baseProperties?: Record<string, unknown>, labelMap?: Record<string, unknown>): FullOptionList<Opt>;
2144
+ /**
2145
+ * Converts a {@link FlexibleOptionList} into a {@link FullOptionList}.
2146
+ * Lists of full options are left unchanged.
2147
+ *
2148
+ * @group Option Lists
2149
+ */
2150
+ declare function toFullOptionMap<OptMap extends BaseOptionMap>(optMap: OptMap, baseProperties?: Record<string, unknown>): OptMap extends BaseOptionMap<infer V, infer K> ? Partial<Record<K, ToFullOption<V>>> : never;
2151
+ /**
2152
+ * @deprecated Renamed to {@link uniqByIdentifier}.
2153
+ *
2154
+ * @group Option Lists
2155
+ */
2156
+ declare const uniqByName: <T extends {
2157
+ name: string;
2158
+ value?: string;
2159
+ } | {
2160
+ name?: string;
2161
+ value: string;
2162
+ }>(originalArray: T[]) => T[];
2163
+ /**
2164
+ * Generates a new array of objects with duplicates removed based
2165
+ * on the identifying property (`value` or `name`)
2166
+ *
2167
+ * @group Option Lists
2168
+ */
2169
+ declare const uniqByIdentifier: <T extends RequireAtLeastOne<{
2170
+ name: string;
2171
+ value: string;
2172
+ }, "name" | "value">>(originalArray: T[]) => T[];
2173
+ /**
2174
+ * Determines if an {@link OptionList} is an {@link OptionGroup} array.
2175
+ *
2176
+ * @group Option Lists
2177
+ */
2178
+ declare const isOptionGroupArray: (arr: unknown) => arr is OptionGroup<BaseOption>[];
2179
+ /**
2180
+ * Determines if an array is a flat array of {@link FlexibleOption}.
2181
+ *
2182
+ * @group Option Lists
2183
+ */
2184
+ declare const isFlexibleOptionArray: (arr: unknown) => arr is FlexibleOption[];
2185
+ /**
2186
+ * Determines if an array is a flat array of {@link FullOption}.
2187
+ *
2188
+ * @group Option Lists
2189
+ */
2190
+ declare const isFullOptionArray: (arr: unknown) => arr is FullOption[];
2191
+ /**
2192
+ * Determines if a {@link FlexibleOptionList} is a {@link FlexibleOptionGroup} array.
2193
+ *
2194
+ * @group Option Lists
2195
+ */
2196
+ declare const isFlexibleOptionGroupArray: (arr: unknown, { allowEmpty }?: {
2197
+ allowEmpty?: boolean;
2198
+ }) => arr is FlexibleOptionGroup[];
2199
+ /**
2200
+ * Determines if a {@link FlexibleOptionList} is a {@link OptionGroup} array of {@link FullOption}.
2201
+ *
2202
+ * @group Option Lists
2203
+ */
2204
+ declare const isFullOptionGroupArray: (arr: unknown, { allowEmpty }?: {
2205
+ allowEmpty?: boolean;
2206
+ }) => arr is OptionGroup<FullOption>[];
2207
+ /**
2208
+ * Gets the option from an {@link OptionList} with the given `name`. Handles
2209
+ * {@link Option} arrays as well as {@link OptionGroup} arrays.
2210
+ *
2211
+ * @group Option Lists
2212
+ */
2213
+ declare function getOption<OptType extends FullOption>(arr: FullOptionList<OptType>, name: string): OptType | undefined;
2214
+ declare function getOption<OptType extends ValueOption>(arr: FlexibleOptionList<OptType>, name: string): OptType | undefined;
2215
+ declare function getOption<OptType extends Option>(arr: FlexibleOptionList<OptType>, name: string): OptType | undefined;
2216
+ /**
2217
+ * Gets the first option from an {@link OptionList}.
2218
+ *
2219
+ * @group Option Lists
2220
+ */
2221
+ declare function getFirstOption<Opt extends FullOption>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
2222
+ declare function getFirstOption<Opt extends ValueOption>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
2223
+ declare function getFirstOption<Opt extends Option>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
2224
+ /**
2225
+ * Flattens {@link FlexibleOptionGroup} arrays into {@link BaseOption} arrays.
2226
+ * If the array is already flat, it is returned as is.
2227
+ *
2228
+ * @group Option Lists
2229
+ */
2230
+ declare const toFlatOptionArray: <T extends FullOption>(arr: FullOptionList<T>) => T[];
2231
+ /**
2232
+ * Generates a new {@link OptionGroup} array with duplicates
2233
+ * removed based on the identifying property (`value` or `name`).
2234
+ *
2235
+ * @group Option Lists
2236
+ */
2237
+ declare const uniqOptGroups: <T extends BaseOption>(originalArray: FlexibleOptionGroup<T>[]) => OptionGroup<ToFullOption<T>>[];
2238
+ /**
2239
+ * Generates a new {@link Option} or {@link OptionGroup} array with duplicates
2240
+ * removed based on the identifier property (`value` or `name`).
2241
+ *
2242
+ * @group Option Lists
2243
+ */
2244
+ declare const uniqOptList: <T extends BaseOption>(originalArray: FlexibleOptionList<T>) => WithUnknownIndex<BaseOption & FullOption>[] | OptionGroup<ToFullOption<T>>[];
2245
+ /** Result of {@link prepareOptionList}. */
2246
+ interface PreparedOptionList<O extends FullOption> {
2247
+ defaultOption: FullOption;
2248
+ optionList: FullOptionList<O>;
2249
+ optionsMap: Partial<FullOptionRecord<O>>;
2250
+ }
2251
+ /** Parameters for {@link prepareOptionList}. */
2252
+ interface PrepareOptionListParams<O extends FullOption> {
2253
+ placeholder?: Placeholder;
2254
+ optionList?: FlexibleOptionListProp<O> | BaseOptionMap<O>;
2255
+ baseOption?: Record<string, unknown>;
2256
+ labelMap?: Record<string, string>;
2257
+ autoSelectOption?: boolean;
2258
+ }
2259
+ /**
2260
+ * Normalizes any accepted option list shape—array, option groups, or a record—into a
2261
+ * `FullOptionList`, applying `baseOption` properties and (when `autoSelectOption` is `false`)
2262
+ * a leading placeholder option. Also returns the flattened lookup map and the option that
2263
+ * should be selected by default.
2264
+ *
2265
+ * Note: `labelMap` overrides only apply to array/option group input (where string options are
2266
+ * expanded); record input derives labels from the record values themselves.
2267
+ *
2268
+ * This is the same normalization `<QueryBuilder />` applies to `fields`, `operators`,
2269
+ * `combinators`, and value lists, so a non-React implementation resolves options identically.
2270
+ *
2271
+ * @group Option Lists
2272
+ */
2273
+ declare const prepareOptionList: <O extends FullOption>(props: PrepareOptionListParams<O>) => PreparedOptionList<O>;
2274
+ //#endregion
2275
+ //#region src/utils/optionResolvers.d.ts
2276
+ /**
2277
+ * Options shared by the resolvers below that produce a normalized option list.
2278
+ */
2279
+ interface ResolveOptionListOptions {
2280
+ /**
2281
+ * Prepended as an empty placeholder option when `autoSelectOption` is `false`. Supplied by the
2282
+ * `translations` prop in React; omit it where translations don't apply.
2283
+ */
2284
+ placeholder?: Placeholder;
2285
+ /** Properties applied to every option in the resulting list. */
2286
+ baseOption?: Record<string, unknown>;
2287
+ /** When `false`, an empty placeholder option is prepended. */
2288
+ autoSelectOption?: boolean;
2289
+ }
2290
+ /**
2291
+ * Resolves the operator list for a field, applying the same precedence as the `QueryBuilder`
2292
+ * component: the field's own `operators`, then the `getOperators` callback, then the
2293
+ * query-level operator list.
2294
+ *
2295
+ * @group Option Lists
2296
+ */
2297
+ declare const resolveOperatorList: <F extends FullField = FullField, O extends FullOperator = FullOperator>({ field, fieldData, getOperators, operators, placeholder, baseOption, autoSelectOption }: {
2298
+ field: string;
2299
+ fieldData: F;
2300
+ getOperators?: (field: string, misc: {
2301
+ fieldData: F;
2302
+ }) => FlexibleOptionList<O> | null;
2303
+ operators: FullOptionList<O>;
2304
+ } & ResolveOptionListOptions) => FullOptionList<O>;
2305
+ /**
2306
+ * Resolves the default operator for a field, applying the same precedence as the `QueryBuilder`
2307
+ * component: the field's own `defaultOperator`, then the `getDefaultOperator` option (a string or
2308
+ * a function), then the first available operator.
2309
+ *
2310
+ * @group Option Lists
2311
+ */
2312
+ declare const resolveDefaultOperator: <F extends FullField = FullField>({ field, fieldData, getDefaultOperator, getOperators }: {
2313
+ field: string;
2314
+ fieldData: F;
2315
+ getDefaultOperator?: string | ((field: string, misc: {
2316
+ fieldData: F;
2317
+ }) => string);
2318
+ /** Produces the operator list for the field, i.e. {@link resolveOperatorList} already bound. */
2319
+ getOperators: (field: string, misc: {
2320
+ fieldData: F;
2321
+ }) => FullOptionList<FullOperator>;
2322
+ }) => string;
2323
+ /**
2324
+ * Resolves the value editor type for a field/operator pair, applying the same precedence as the
2325
+ * `QueryBuilder` component: the field's own `valueEditorType` (a string or a function of the
2326
+ * operator), then the `getValueEditorType` callback, then `"text"`.
2327
+ *
2328
+ * @group Option Lists
2329
+ */
2330
+ declare const resolveValueEditorType: <F extends FullField = FullField>({ field, operator, fieldData, getValueEditorType }: {
2331
+ field: string;
2332
+ operator: string;
2333
+ fieldData: F;
2334
+ getValueEditorType?: (field: string, operator: string, misc: {
2335
+ fieldData: F;
2336
+ }) => ValueEditorType;
2337
+ }) => ValueEditorType;
2338
+ /**
2339
+ * Resolves the value option list for a field/operator pair, applying the same precedence as the
2340
+ * `QueryBuilder` component: the field's own `values`, then the `getValues` callback, then an
2341
+ * empty list.
2342
+ *
2343
+ * @group Option Lists
2344
+ */
2345
+ declare const resolveValueList: <F extends FullField = FullField>({ field, operator, fieldData, getValues, placeholder, baseOption, autoSelectOption }: {
2346
+ field: string;
2347
+ operator: string;
2348
+ fieldData: F;
2349
+ getValues?: (field: string, operator: string, misc: {
2350
+ fieldData: F;
2351
+ }) => FlexibleOptionList<Option> | null;
2352
+ } & ResolveOptionListOptions) => FullOptionList<Option>;
2353
+ //#endregion
2354
+ //#region src/utils/pathUtils.d.ts
2355
+ /**
2356
+ * Return type for {@link findPath}.
2357
+ */
2358
+ type FindPathReturnType = RuleGroupTypeAny | RuleType | null;
2359
+ /**
2360
+ * Returns the {@link RuleType} or {@link RuleGroupType}/{@link RuleGroupTypeIC}
2361
+ * at the given path within a query.
2362
+ */
2363
+ declare const findPath: (path: Path, query: RuleGroupTypeAny) => FindPathReturnType;
2364
+ /**
2365
+ * Returns the {@link RuleType} or {@link RuleGroupType}/{@link RuleGroupTypeIC}
2366
+ * with the given `id` within a query.
2367
+ */
2368
+ declare const findID: (id: string, query: RuleGroupTypeAny) => FindPathReturnType;
2369
+ /**
2370
+ * Returns the {@link Path} of the {@link RuleType} or {@link RuleGroupType}/{@link RuleGroupTypeIC}
2371
+ * with the given `id` within a query.
2372
+ */
2373
+ declare const getPathOfID: (id: string, query: RuleGroupTypeAny) => Path | null;
2374
+ /**
2375
+ * Truncates the last element of an array and returns the result as a new array.
2376
+ */
2377
+ declare const getParentPath: (path: Path) => Path;
2378
+ /**
2379
+ * Determines if two paths (each `Path`) are equivalent.
2380
+ */
2381
+ declare const pathsAreEqual: (path1: Path, path2: Path) => boolean;
2382
+ /**
2383
+ * Determines if the first path is an ancestor of the second path. The first path must
2384
+ * be shorter and exactly match the second path up through the length of the first path.
2385
+ */
2386
+ declare const isAncestor: (maybeAncestor: Path, path: Path) => boolean;
2387
+ /**
2388
+ * Finds the deepest/longest path that two paths have in common.
2389
+ */
2390
+ declare const getCommonAncestorPath: (path1: Path, path2: Path) => Path;
2391
+ /**
2392
+ * Determines if the rule or group at the specified path is either disabled itself
2393
+ * or disabled by an ancestor group.
2394
+ */
2395
+ declare const pathIsDisabled: (path: Path, query: RuleGroupTypeAny) => boolean;
2396
+ /**
2397
+ * Determines if the rule or group at the specified path is disabled by `disabledPaths`—the array
2398
+ * form of the `QueryBuilder` `disabled` prop, which disables nodes by position rather than by a
2399
+ * `disabled` property on the node itself. A path is disabled if it appears in `disabledPaths` or
2400
+ * descends from a path that does.
2401
+ *
2402
+ * @group Paths
2403
+ */
2404
+ declare const pathIsDisabledByPaths: (path: Path, disabledPaths?: Path[]) => boolean;
2405
+ /** The path of a child rule or group, and whether it is disabled. */ interface PathInfo {
2406
+ path: Path;
2407
+ disabled: boolean;
2408
+ }
2409
+ /**
2410
+ * Builds the {@link PathInfo} for each child of a group at `path`. A child is disabled if its
2411
+ * parent is disabled or if its own path appears in `disabledPaths`.
2412
+ *
2413
+ * @group Paths
2414
+ */
2415
+ declare const derivePathInfo: (path: Path, childCount: number, { disabled, disabledPaths }?: {
2416
+ disabled?: boolean;
2417
+ disabledPaths?: Path[];
2418
+ }) => PathInfo[];
2419
+ //#endregion
2420
+ //#region src/utils/QueryManager.d.ts
2421
+ /**
2422
+ * The `getDefaultField` option: either a field name or a function that picks one.
2423
+ *
2424
+ * Named separately from {@link QueryManagerOptions} so callers building the option value
2425
+ * conditionally can annotate the intermediate. TypeScript cannot reconcile the two arms of a
2426
+ * ternary against an inline union, which otherwise forces a cast.
2427
+ *
2428
+ * @group Query Tools
2429
+ */
2430
+ type DefaultFieldProp<F extends FullField = FullField> = string | ((fieldsData: FullOptionList<F>) => string);
2431
+ /**
2432
+ * The `getDefaultOperator` option: either an operator name or a function that picks one.
2433
+ *
2434
+ * Named separately from {@link QueryManagerOptions} for the same reason as
2435
+ * {@link DefaultFieldProp}.
2436
+ *
2437
+ * @group Query Tools
2438
+ */
2439
+ type DefaultOperatorProp<F extends FullField = FullField> = string | ((field: string, misc: {
2440
+ fieldData: F;
2441
+ }) => string);
2442
+ /**
2443
+ * Options for {@link QueryManager}. Mirrors the subset of
2444
+ * {@link react-querybuilder!QueryBuilder QueryBuilder} props that affect query
2445
+ * _structure_ rather than rendering, so the same configuration objects can drive both.
2446
+ *
2447
+ * @group Query Tools
2448
+ */
2449
+ interface QueryManagerOptions<F extends FullField = FullField, O extends FullOperator = FullOperator, C extends FullCombinator = FullCombinator> {
2450
+ /** The fields available for rules. Accepts the same shapes as the `fields` prop. */
2451
+ fields?: FlexibleOptionListProp<F> | BaseOptionMap<F>;
2452
+ /** The operators available for rules. Accepts the same shapes as the `operators` prop. */
2453
+ operators?: FlexibleOptionListProp<O> | BaseOptionMap<O>;
2454
+ /** The combinators available for groups. Defaults to `defaultCombinators`. */
2455
+ combinators?: FlexibleOptionListProp<C> | BaseOptionMap<C>;
2456
+ /** Properties applied to every field in `fields`. */
2457
+ baseField?: Record<string, unknown>;
2458
+ /** Properties applied to every operator in `operators`. */
2459
+ baseOperator?: Record<string, unknown>;
2460
+ /** Properties applied to every combinator in `combinators`. */
2461
+ baseCombinator?: Record<string, unknown>;
2462
+ /** When `false`, an empty placeholder option is prepended to the field list. */
2463
+ autoSelectField?: boolean;
2464
+ /** When `false`, an empty placeholder option is prepended to each operator list. */
2465
+ autoSelectOperator?: boolean;
2466
+ /** When `false`, an empty placeholder option is prepended to each value list. */
2467
+ autoSelectValue?: boolean;
2468
+ /**
2469
+ * Translations, accepting the same shape as the `translations` prop. Only the placeholder
2470
+ * properties of `fields`, `operators`, and `values` are used, and only when the corresponding
2471
+ * `autoSelect*` option is `false`; the remaining keys describe UI elements that have no
2472
+ * meaning outside the `QueryBuilder` component. Labels are typed as `unknown` so the React
2473
+ * `Translations` type, whose labels are `ReactNode`, can be passed as-is.
2474
+ */
2475
+ translations?: Partial<BaseTranslations<unknown>>;
2476
+ /** The default `field` for rules created by {@link QueryManager.createRule}. */
2477
+ getDefaultField?: DefaultFieldProp<F>;
2478
+ /** The default `operator` for a given field. */
2479
+ getDefaultOperator?: DefaultOperatorProp<F>;
2480
+ /** Overrides the computed default `value` for a new rule. */
2481
+ getDefaultValue?: (rule: RuleType, misc: {
2482
+ fieldData: F;
2483
+ }) => unknown;
2484
+ /** The operators available for a given field. */
2485
+ getOperators?: (field: string, misc: {
2486
+ fieldData: F;
2487
+ }) => FlexibleOptionList<O> | null;
2488
+ /** The value editor type for a given field/operator, which informs the default value. */
2489
+ getValueEditorType?: (field: string, operator: string, misc: {
2490
+ fieldData: F;
2491
+ }) => ValueEditorType;
2492
+ /** The value list for a given field/operator, which informs the default value. */
2493
+ getValues?: (field: string, operator: string, misc: {
2494
+ fieldData: F;
2495
+ }) => FlexibleOptionList<Option>;
2496
+ /** The valid value sources for a given field/operator. */
2497
+ getValueSources?: (field: string, operator: string, misc: {
2498
+ fieldData: F;
2499
+ }) => ValueSources | ValueSourceFlexibleOptions;
2500
+ /** The valid match modes for a given field. */
2501
+ getMatchModes?: (field: string, misc: {
2502
+ fieldData: F;
2503
+ }) => boolean | MatchMode[] | FlexibleOption<MatchMode>[];
2504
+ /** The named parameters available for a given field/operator. */
2505
+ getParameters?: (field: string, operator: string, misc: {
2506
+ fieldData: F;
2507
+ }) => FlexibleOptionList<Option> | null;
2508
+ /** When `true`, multi-value defaults are arrays instead of comma-joined strings. */
2509
+ listsAsArrays?: boolean;
2510
+ /** When `true`, groups created by {@link QueryManager.createRuleGroup} contain one new rule. */
2511
+ addRuleToNewGroups?: boolean;
2512
+ /**
2513
+ * When updating a rule's `field`, reset its `operator`, `value`, and `valueSource` to their
2514
+ * defaults. Defaults to `true`, matching the `QueryBuilder` prop of the same name.
2515
+ */
2516
+ resetOnFieldChange?: boolean;
2517
+ /**
2518
+ * When updating a rule's `operator`, reset its `value` to the default. Defaults to `false`,
2519
+ * matching the `QueryBuilder` prop of the same name.
2520
+ */
2521
+ resetOnOperatorChange?: boolean;
2522
+ /**
2523
+ * The maximum depth at which groups may be added. As with the `QueryBuilder` prop of the same
2524
+ * name, a non-positive value means unlimited. Defaults to `Infinity`.
2525
+ */
2526
+ maxLevels?: number;
2527
+ /**
2528
+ * Honor `disabled` properties within the query, so mutations targeting a disabled rule or
2529
+ * group (or a descendant of a disabled group) are aborted. Updating a node's own `disabled`
2530
+ * property is always permitted. Defaults to `true`, matching the `QueryBuilder` component;
2531
+ * pass `false` to mutate freely regardless of the property.
2532
+ */
2533
+ respectDisabled?: boolean;
2534
+ /**
2535
+ * Paths that are disabled without the corresponding rule or group carrying a `disabled`
2536
+ * property. This mirrors the array form of the `QueryBuilder` `disabled` prop
2537
+ * (e.g. `disabled={[[2]]}`), which disables nodes by position rather than by data.
2538
+ *
2539
+ * A path is treated as disabled if it appears here or descends from a path that does. Honored
2540
+ * only when `respectDisabled` is `true`; as with the `disabled` property, a node's own
2541
+ * `disabled` can always be changed so it is never permanently locked.
2542
+ */
2543
+ disabledPaths?: Path[];
2544
+ /** Abort every mutation, as though the entire query were disabled. Defaults to `false`. */
2545
+ queryDisabled?: boolean;
2546
+ /** The input type for a given field/operator, surfaced by {@link QueryManager.getRuleContext}. */
2547
+ getInputType?: (field: string, operator: string, misc: {
2548
+ fieldData: F;
2549
+ }) => InputType | null;
2550
+ /** Extra props for a subquery builder, surfaced by {@link QueryManager.getRuleContext}. */
2551
+ getSubQueryBuilderProps?: (field: string, misc: {
2552
+ fieldData: F;
2553
+ }) => Record<string, unknown>;
2554
+ /**
2555
+ * Enables undo/redo recording. Pass `true` for the defaults, or an object to configure
2556
+ * `maxHistory` and/or `coalesceMs`. Disabled by default, so instances that never undo
2557
+ * retain no extra references.
2558
+ */
2559
+ history?: boolean | QueryHistoryOptions;
2560
+ /**
2561
+ * Throw a {@link QueryManagerError} when a mutation is aborted because its target could not
2562
+ * be used. Disabled by default, in which case such mutations are silent no-ops. Can be
2563
+ * overridden per call.
2564
+ */
2565
+ strict?: boolean;
2566
+ /**
2567
+ * Called whenever a mutation is aborted, including for the non-error reasons
2568
+ * `"same-location"` and `"no-change"`. Can be overridden per call.
2569
+ */
2570
+ onInvalidTarget?: (info: AbortInfo) => void;
2571
+ /**
2572
+ * Deep-freeze everything the manager hands out—the query, the field list, the field map, and
2573
+ * the combinator list—so accidental mutation throws in strict mode. Defaults to `true`.
2574
+ *
2575
+ * Pass `false` when the manager's output is handed to a framework that wraps objects in
2576
+ * proxies (Vue `reactive`, Solid stores) or otherwise needs to mutate them. This also disables
2577
+ * immer's auto-freeze for mutations made through the manager.
2578
+ *
2579
+ * The shallow copy returned by {@link QueryManager.getOptions} is frozen either way: it is a
2580
+ * one-level copy that no framework proxy is placed inside, so freezing it costs nothing and
2581
+ * still prevents callers from mutating the options snapshot they were handed.
2582
+ */
2583
+ freeze?: boolean;
2584
+ /** Validates the query. Defaults to {@link defaultValidator}. */
2585
+ validator?: QueryValidator;
2586
+ /** Generates `id` properties for new rules and groups. Defaults to {@link generateID}. */
2587
+ idGenerator?: () => string;
2588
+ /**
2589
+ * Clock used to time history coalescing. Defaults to `Date.now`.
2590
+ *
2591
+ * @internal Test seam. Exists so that history recording can be compared against the
2592
+ * `react-querybuilder/history` implementation without depending on wall-clock timing.
2593
+ */
2594
+ now?: () => number;
2595
+ }
2596
+ //#endregion
2597
+ //#region src/utils/optionsEqual.d.ts
2598
+ /**
2599
+ * Structural equality for {@link QueryManagerOptions} values. Arrays and plain objects are
2600
+ * compared by value; everything else — functions, class instances, `Map`s, `Date`s — by
2601
+ * identity.
2602
+ *
2603
+ * That split is what makes an options object rebuilt on every render compare equal as long as
2604
+ * its _data_ did not change, which is the entire point: a caller that passes object literals
2605
+ * (`fields={[...]}`, `translations={{...}}`) hands a fresh identity to every reconfigure, so an
2606
+ * identity-only comparison would report a change every time.
2607
+ *
2608
+ * Comparing functions by identity is deliberate rather than a limitation. Two functions cannot
2609
+ * be proven equivalent, so a caller that rebuilds `getDefaultValue` per render must either
2610
+ * memoize it or accept the reconfigure.
2611
+ */
2612
+ declare const valuesEqual: (a: unknown, b: unknown) => boolean;
2613
+ /**
2614
+ * Whether two {@link QueryManagerOptions} objects describe the same configuration, per
2615
+ * {@link valuesEqual}: data by value, functions by identity.
2616
+ *
2617
+ * {@link QueryManager.reconfigure} uses this to gate itself, so most callers never need it
2618
+ * directly. It is exported for framework adapters that decide whether to _call_ `reconfigure`
2619
+ * at all — skipping the call avoids building the merged options object in the first place.
2620
+ *
2621
+ * Nested option objects (`history`, `translations`, …) are descended into rather than compared
2622
+ * by identity, so `{ history: { maxHistory: 10 } }` rebuilt per render compares equal.
2623
+ */
2624
+ declare const optionsEqual: <F extends FullField = FullField, O extends FullOperator = FullOperator, C extends FullCombinator = FullCombinator>(a: Partial<QueryManagerOptions<F, O, C>> | undefined, b: Partial<QueryManagerOptions<F, O, C>> | undefined) => boolean;
2625
+ //#endregion
2626
+ //#region src/utils/parseNumber.d.ts
2627
+ /**
2628
+ * Options object for {@link parseNumber}.
2629
+ */
2630
+ interface ParseNumberOptions {
2631
+ parseNumbers?: ParseNumberMethod;
2632
+ /**
2633
+ * Generates a `bigint` value if the string represents a valid integer
2634
+ * outside the safe boundaries of the `number` type.
2635
+ */
2636
+ bigIntOnOverflow?: boolean;
2637
+ }
2638
+ /**
2639
+ * Converts a string to a number. Uses native `parseFloat` if `parseNumbers` is "native",
2640
+ * otherwise uses [`numeric-quantity`](https://jakeboone02.github.io/numeric-quantity/).
2641
+ * If that returns `NaN`, the string is returned unchanged. Numeric values are returned
2642
+ * as-is regardless of the `parseNumbers` option.
2643
+ */
2644
+ declare const parseNumber: (val: unknown, { parseNumbers, bigIntOnOverflow }?: ParseNumberOptions) => any;
2645
+ //#endregion
2646
+ //#region src/utils/preferProp.d.ts
2647
+ /**
2648
+ * For given default, prop, and context values, return the first provided of prop,
2649
+ * context, and default, in that order.
2650
+ */
2651
+ declare const preferProp: (def: boolean, prop?: boolean, context?: boolean, doNotFinalize?: boolean) => boolean;
2652
+ /**
2653
+ * For given default, prop, and context values, return the first provided of prop,
2654
+ * context, and default, in that order.
2655
+ */
2656
+ declare const preferAnyProp: (def?: any, prop?: any, context?: any) => any;
2657
+ /**
2658
+ * For a given set of defaults, props, and context values, return the first provided of prop,
2659
+ * context, and default—in that order—for each property in the defaults object.
2660
+ */
2661
+ declare const preferFlagProps: (props?: QueryBuilderFlags, contextVals?: QueryBuilderFlags, finalize?: boolean) => QueryBuilderFlags;
2662
+ //#endregion
2663
+ //#region src/utils/prepareQueryObjects.d.ts
2664
+ /**
2665
+ * Options for {@link prepareRule}/{@link prepareRuleGroup}.
2666
+ */
2667
+ interface PreparerOptions {
2668
+ idGenerator?: () => string;
2669
+ }
2670
+ /**
2671
+ * Ensures that a rule is valid by adding an `id` property if it does not already exist.
2672
+ */
2673
+ declare const prepareRule: (rule: RuleType, { idGenerator }?: PreparerOptions) => RuleType;
2674
+ /**
2675
+ * Ensures that a rule group is valid by recursively adding an `id` property to the group itself
2676
+ * and all its rules and subgroups where one does not already exist.
2677
+ */
2678
+ declare const prepareRuleGroup: <RG extends RuleGroupTypeAny>(queryObject: RG, { idGenerator }?: PreparerOptions) => RG;
2679
+ /**
2680
+ * Ensures that a rule or group is valid. See {@link prepareRule} and {@link prepareRuleGroup}.
2681
+ */
2682
+ declare const prepareRuleOrGroup: (rg: RuleGroupTypeAny | RuleType, { idGenerator }?: PreparerOptions) => RuleGroupType | RuleGroupTypeIC | RuleType;
2683
+ /**
2684
+ * Resolves the query a query builder should render from the available sources, in precedence
2685
+ * order: the controlled `query`, then whatever is already in the store, then the uncontrolled
2686
+ * `defaultQuery`, then a freshly created empty group.
2687
+ *
2688
+ * The result is prepared with {@link prepareRuleGroup} unless it already has an `id`, which is
2689
+ * taken to mean it has been prepared before—most often because the caller is passing back the
2690
+ * object it received from `onQueryChange`.
2691
+ *
2692
+ * @group Query Tools
2693
+ */
2694
+ declare const resolveCandidateQuery: <RG extends RuleGroupTypeAny>(sources: {
2695
+ query?: RG;
2696
+ storeQuery?: RG;
2697
+ defaultQuery?: RG;
2698
+ fallbackQuery: RG;
2699
+ }, options?: {
2700
+ idGenerator?: () => string;
2701
+ }) => RG;
2702
+ //#endregion
2703
+ //#region src/utils/queryActions.d.ts
2704
+ /**
2705
+ * Confirmation callbacks invoked before a mutation is applied. Their return values are
2706
+ * interpreted differently depending on the operation:
2707
+ *
2708
+ * - `onAddRule`/`onAddGroup` may return `true` to proceed, a falsy value to cancel, or a
2709
+ * _replacement rule/group_ to add instead of the one provided.
2710
+ * - `onMoveRule`/`onMoveGroup`/`onGroupRule`/`onGroupGroup` may return `true` to proceed, a
2711
+ * falsy value to cancel, or a _replacement query_ to apply instead of the computed one.
2712
+ * - `onRemove` is boolean only.
2713
+ *
2714
+ * @group Query Tools
2715
+ */
2716
+ interface QueryActionCallbacks {
2717
+ onAddRule?: (rule: RuleType, parentPath: Path, query: any, context?: any) => RuleType | boolean;
2718
+ onAddGroup?: (ruleGroup: any, parentPath: Path, query: any, context?: any) => RuleGroupTypeAny | boolean;
2719
+ onRemove?: (ruleOrGroup: any, path: Path, query: any, context?: any) => boolean;
2720
+ onMoveRule?: (...args: any[]) => RuleGroupTypeAny | boolean;
2721
+ onMoveGroup?: (...args: any[]) => RuleGroupTypeAny | boolean;
2722
+ onGroupRule?: (...args: any[]) => RuleGroupTypeAny | boolean;
2723
+ onGroupGroup?: (...args: any[]) => RuleGroupTypeAny | boolean;
2724
+ }
2725
+ /**
2726
+ * Configuration for {@link createQueryActions}.
2727
+ *
2728
+ * @group Query Tools
2729
+ */
2730
+ interface QueryActionsConfig extends QueryActionCallbacks {
2731
+ /** Identifier included in every log payload. */
2732
+ qbId?: string;
2733
+ combinators?: OptionList;
2734
+ idGenerator?: () => string;
2735
+ /** The maximum depth at which groups may be added. Defaults to `Infinity`. */
2736
+ maxLevels?: number;
2737
+ /** Abort every mutation, as though the entire query were disabled. */
2738
+ queryDisabled?: boolean;
2739
+ /**
2740
+ * Honor `disabled` properties within the query. Defaults to `true`, matching the
2741
+ * `QueryBuilder` component; a node's own `disabled` property can always be changed.
2742
+ */
2743
+ respectDisabled?: boolean;
2744
+ /**
2745
+ * Paths disabled by position rather than by a `disabled` property on the node itself, mirroring
2746
+ * the array form of the `QueryBuilder` `disabled` prop. Honored only when `respectDisabled` is
2747
+ * `true`; as with the `disabled` property, a node's own `disabled` can always be changed.
2748
+ */
2749
+ disabledPaths?: Path[];
2750
+ resetOnFieldChange?: boolean;
2751
+ resetOnOperatorChange?: boolean;
2752
+ getRuleDefaultOperator?: (field: string) => string;
2753
+ getValueSources?: (field: string, operator: string) => ValueSourceFullOptions;
2754
+ getRuleDefaultValue?: (rule: RuleType) => any;
2755
+ getMatchModes?: (field: string) => MatchModeOptions;
2756
+ /**
2757
+ * Set `false` to skip immer's auto-freeze on the queries these handlers return, matching the
2758
+ * option of the same name on the query tools and {@link QueryManager}.
2759
+ *
2760
+ * Deep-freezing throws on the reactive proxies used by signals-based frameworks (Svelte
2761
+ * `$state`, Vue `reactive`), so an adapter whose storage may hand a proxied query to these
2762
+ * handlers has to turn it off.
2763
+ *
2764
+ * @default true
2765
+ */
2766
+ freeze?: boolean;
2767
+ /** Receives a structured event for every action, applied or aborted. */
2768
+ onLog?: (payload: Record<string, any>) => void;
2769
+ }
2770
+ /**
2771
+ * The six mutations a query builder performs. Each takes the current query and returns the next
2772
+ * one, or `undefined` when the mutation was aborted—because the target is disabled, a
2773
+ * confirmation callback declined, or a depth limit was reached.
2774
+ *
2775
+ * @group Query Tools
2776
+ */
2777
+ interface QueryActionHandlers {
2778
+ addRule: (query: any, rule: RuleType, parentPath: Path, context?: any) => any;
2779
+ addGroup: (query: any, ruleGroup: any, parentPath: Path, context?: any) => any;
2780
+ propChange: (query: any, prop: UpdateableProperties, value: any, path: Path) => any;
2781
+ removeRuleOrGroup: (query: any, path: Path, context?: any) => any;
2782
+ moveRule: (query: any, oldPath: Path, newPath: Path | "up" | "down", clone?: boolean, context?: any) => any;
2783
+ groupRule: (query: any, sourcePath: Path, targetPath: Path, clone?: boolean, context?: any) => any;
2784
+ }
2785
+ /**
2786
+ * Builds the query builder's six mutation handlers as pure functions of the current query.
2787
+ *
2788
+ * This is the framework-agnostic core of the action handlers in `useQueryBuilderSchema`. It owns
2789
+ * the policy that surrounds the query tools—disabled gating, the confirmation callback protocol,
2790
+ * `maxLevels`, and debug logging—so an implementation only has to supply its own storage: read
2791
+ * the current query, call the action, and apply a non-`undefined` result.
2792
+ *
2793
+ * @group Query Tools
2794
+ */
2795
+ declare const createQueryActions: (config?: QueryActionsConfig) => QueryActionHandlers;
2796
+ //#endregion
2797
+ //#region src/utils/regenerateIDs.d.ts
2798
+ /**
2799
+ * Options object for {@link regenerateID}/{@link regenerateIDs}.
2800
+ */
2801
+ interface RegenerateIdOptions {
2802
+ idGenerator?: () => string;
2803
+ }
2804
+ /**
2805
+ * Generates a new `id` property for a rule.
2806
+ */
2807
+ declare const regenerateID: <R extends RuleType>(rule: R, { idGenerator }?: RegenerateIdOptions) => SetRequired<R, "id">;
2808
+ /**
2809
+ * Recursively generates new `id` properties for a rule group and all its rules and subgroups.
2810
+ */
2811
+ declare const regenerateIDs: <RG>(subject: RG, { idGenerator }?: RegenerateIdOptions) => RG & {
2812
+ id: string;
2813
+ };
2814
+ //#endregion
2815
+ //#region src/utils/ruleFactory.d.ts
2816
+ /**
2817
+ * Everything {@link createRule} needs to produce a new rule. Each member corresponds to the
2818
+ * `QueryBuilder` prop (or `useQueryBuilderSetup` output) of the same name.
2819
+ */
2820
+ interface CreateRuleOptions<F extends FullField = FullField> {
2821
+ fields: FullOptionList<F>;
2822
+ getDefaultField?: string | ((fieldsData: FullOptionList<F>) => string);
2823
+ /** Produces the default operator for a field, i.e. `resolveDefaultOperator` already bound. */
2824
+ getRuleDefaultOperator: (field: string) => string;
2825
+ /** Produces the value sources for a field/operator pair. */
2826
+ getValueSources: (field: string, operator: string, misc: {
2827
+ fieldData: F;
2828
+ }) => ValueSourceFullOptions;
2829
+ /** Produces the match modes for a field. */
2830
+ getMatchModes: (field: string, misc: {
2831
+ fieldData: F;
2832
+ }) => MatchModeOptions;
2833
+ /** Produces the default `value` for an otherwise-complete rule. */
2834
+ getRuleDefaultValue: (rule: RuleType) => unknown;
2835
+ idGenerator?: () => string;
2836
+ }
2837
+ /**
2838
+ * Creates a rule from the given configuration, applying the same precedence as the
2839
+ * `QueryBuilder` component. The `value` is computed in a second pass, once `field`, `operator`,
2840
+ * and `valueSource` are known, since the default value depends on all three.
2841
+ *
2842
+ * @group Query Tools
2843
+ */
2844
+ declare const createRule: <F extends FullField = FullField>({ fields, getDefaultField, getRuleDefaultOperator, getValueSources, getMatchModes, getRuleDefaultValue, idGenerator }: CreateRuleOptions<F>) => RuleType;
2845
+ /**
2846
+ * Everything {@link createRuleGroup} needs to produce a new group.
2847
+ */
2848
+ interface CreateRuleGroupOptions<C extends FullCombinator = FullCombinator> {
2849
+ combinators: FullOptionList<C>;
2850
+ /** When `true`, the new group contains one new rule. */
2851
+ addRuleToNewGroups?: boolean;
2852
+ /** Produces that rule, i.e. {@link createRule} already bound. */
2853
+ createRule: () => RuleType;
2854
+ idGenerator?: () => string;
2855
+ }
2856
+ /**
2857
+ * Creates a group from the given configuration. Pass `true` for `independentCombinators` to omit
2858
+ * the `combinator` property.
2859
+ *
2860
+ * The group's own `id` is generated _before_ any contained rule's, matching the order the
2861
+ * `QueryBuilder` component has always used. This is observable when `idGenerator` is
2862
+ * deterministic, as it often is in tests.
2863
+ *
2864
+ * @group Query Tools
2865
+ */
2866
+ declare const createRuleGroup: <C extends FullCombinator = FullCombinator>({ combinators, addRuleToNewGroups, createRule: createRuleMain, idGenerator }: CreateRuleGroupOptions<C>, independentCombinators?: boolean) => RuleGroupTypeAny;
2867
+ //#endregion
2868
+ //#region src/utils/signature.d.ts
2869
+ /**
2870
+ * Signature returned when a change alters the _shape_ of the query—rules or groups added,
2871
+ * removed, moved, or reordered—rather than the properties of a single node. Structural changes
2872
+ * never coalesce with each other, so each one produces its own history entry.
2873
+ */
2874
+ declare const structuralSignature = "~structural";
2875
+ /**
2876
+ * Signature returned when two queries differ by reference only, with no observable difference
2877
+ * in their properties.
2878
+ */
2879
+ declare const unchangedSignature = "";
2880
+ /**
2881
+ * Describes _what changed_ between two versions of a query as a short string, so that
2882
+ * consecutive edits to the same property of the same rule (e.g. typing in a value editor) can
2883
+ * be recognized and coalesced into a single history entry.
2884
+ *
2885
+ * Returns {@link structuralSignature} for changes to the shape of the query, {@link unchangedSignature} when the
2886
+ * two queries differ by reference only, and `"<id>:<props>"` otherwise.
2887
+ *
2888
+ * The walk prunes on reference equality, so it costs O(depth) rather than O(size) for the
2889
+ * single-node edits that make up the overwhelming majority of changes.
2890
+ *
2891
+ * Note that this relies on the structural sharing that Immer—and therefore every query
2892
+ * produced by RQB's own update functions—guarantees: nodes that did not change keep their
2893
+ * identity. A query that has been wholly rebuilt (deep-cloned, round-tripped through JSON,
2894
+ * re-parsed from a string) shares no identity with its predecessor, so it is reported as
2895
+ * {@link structuralSignature} and will not coalesce. That is a graceful degradation—every change simply
2896
+ * gets its own history entry—but controlled components that clone the query on every change
2897
+ * will not benefit from coalescing.
2898
+ */
2899
+ declare const signatureOf: (prev: RuleGroupTypeAny, next: RuleGroupTypeAny) => string;
2900
+ //#endregion
2901
+ export { AbortInfo, AbortOptions, AbortReason, AccessibleDescriptionGenerator, ActionElementEventHandler, AddMethod, AddOptions, Arity, BaseFullOption, BaseOption, BaseOptionMap, BaseTranslation, BaseTranslationWithLabel, BaseTranslationWithPlaceholders, BaseTranslations, BaseTranslationsFull, Classname, ClassnameCondition, ClassnameSpec, Classnames, Combinator, CombinatorByValue, CommonRuleAndGroupProperties, CommonRuleSubComponentProps, ConstituentWordOrder, ConstituentWordOrderString, ControlKey, CreateRuleGroupOptions, CreateRuleOptions, DefaultCombinator, DefaultCombinatorExtended, DefaultCombinatorName, DefaultCombinatorNameExtended, DefaultCombinators, DefaultCombinatorsExtended, DefaultMatchModes, DefaultOperator, DefaultOperatorName, DefaultOperators, DefaultRuleGroupArray, DefaultRuleGroupICArray, DefaultRuleGroupType, DefaultRuleGroupTypeAny, DefaultRuleGroupTypeIC, DefaultRuleOrGroupArray, DefaultRuleType, DeriveClassNamesOptions, DiagnosticEntry, DiagnosticsFieldSummaryEntry, DiagnosticsResult, DiagnosticsStats, DndClassNameState, DndDropTargetType, DragCollection, DraggedItem, DropCollection, DropEffect, DropResult, ExportFormat, ExportObjectFormats, ExportOperatorMap, ExpressionNode, Field, FieldByValue, FindPathReturnType, FlexibleOption, FlexibleOptionGroup, FlexibleOptionList, FlexibleOptionListProp, FormatQueryFinalOptions, FormatQueryOptions, FormatQueryValidateRule, FullCombinator, FullField, FullOperator, FullOption, FullOptionList, FullOptionMap, FullOptionRecord, GenericizeRuleGroupType, GetOptionIdentifierType, GetOptionType, GetRuleDefaultValueOptions, GetRuleGroupType, GetRuleTypeFromGroupWithFieldAndOperator, GroupMethod, GroupOptions, GroupVariantCondition, GuardOptions, InputType, InsertMethod, InsertOptions, type JsonLogicAll, type JsonLogicAnd, type JsonLogicDoubleNegation, type JsonLogicEqual, type JsonLogicGreaterThan, type JsonLogicGreaterThanOrEqual, type JsonLogicInArray, type JsonLogicInString, type JsonLogicLessThan, type JsonLogicLessThanOrEqual, type JsonLogicNegation, type JsonLogicNone, type JsonLogicNotEqual, type JsonLogicOr, type JsonLogicReservedOperations, type JsonLogicRulesLogic, type JsonLogicSome, type JsonLogicStrictEqual, type JsonLogicStrictNotEqual, type JsonLogicVar, LogType, MatchConfig, MatchMode, MatchModeOptions, MoveMethod, MoveOptions, NLTranslationKey, NLTranslations, NameLabelPair, Operator, OperatorByValue, Option, OptionGroup, OptionList, OuterClassNameOptions, OuterClassNameOptionsBase, ParameterizedNamedSQL, ParameterizedSQL, ParseNumberMethod, ParseNumberOptions, ParseNumbersPropConfig, Path, PathInfo, Placeholder, PrepareOptionListParams, PreparedOptionList, PreparerOptions, QueryActionCallbacks, QueryActionHandlers, QueryActions, QueryActionsConfig, QueryBuilderClassNameState, QueryBuilderFlags, QueryHistoryOptions, QueryToolOptions, QueryValidator, RQBJsonLogic, RQBJsonLogicEndsWith, RQBJsonLogicStartsWith, RQBJsonLogicVar, RegenerateIdOptions, RemoveMethod, RemoveNullability, RemoveOptions, ResolveOptionListOptions, RuleClassNameState, RuleClassnameKey, RuleContext, RuleContextResolvers, RuleDiagnosticsResult, RuleFacet, RuleGroupArray, RuleGroupClassnameKey, RuleGroupContext, RuleGroupDiagnosticsArray, RuleGroupDiagnosticsResult, RuleGroupICArray, RuleGroupICDiagnosticsArray, RuleGroupICDiagnosticsResult, RuleGroupProcessor, RuleGroupType, RuleGroupTypeAny, RuleGroupTypeIC, RuleOrGroupArray, RuleProcessor, RuleType, RuleValidator, SQLPreset, StringUnionToFlexibleOptionArray, StringUnionToFullOptionArray, TestID, ToFlexibleOption, ToFullOption, ToRuleGroupType, ToRuleGroupTypeIC, TransformQueryOptions, UpdateMethod, UpdateOptions, UpdateValueMap, UpdateableProperties, ValidationMap, ValidationResult, ValueChangeEventHandler, ValueEditorType, ValueOption, ValueProcessor, ValueProcessorByRule, ValueProcessorLegacy, ValueProcessorOptions, ValueSource, ValueSourceFlexibleOptions, ValueSourceFullOptions, ValueSources, WithRequired, WithUnknownIndex, add, addInPlace, betweenOperators, clsx, coerceBigIntValue, coerceInputType, controlKeys, controlKind, controlPropKeys, convertFromIC, convertQuery, convertToIC, createQueryActions, createRule, createRuleGroup, defaultCoalesceMs, defaultCombinatorLabelMap, defaultCombinators, defaultCombinatorsExtended, defaultControlClassnames, defaultJoinChar, defaultMatchModes, defaultMaxHistory, defaultOperatorLabelMap, defaultOperatorNegationMap, defaultOperators, defaultPlaceholderFieldGroupLabel, defaultPlaceholderFieldLabel, defaultPlaceholderFieldName, defaultPlaceholderLabel, defaultPlaceholderName, defaultPlaceholderOperatorGroupLabel, defaultPlaceholderOperatorLabel, defaultPlaceholderOperatorName, defaultPlaceholderValueGroupLabel, defaultPlaceholderValueLabel, defaultPlaceholderValueName, defaultTranslations, defaultValidator, derivePathInfo, deriveQueryBuilderClassNames, deriveRuleClassName, deriveRuleClassNames, deriveRuleContext, deriveRuleGroupClassNames, deriveRuleGroupContext, deriveRuleGroupOuterClassName, deriveRuleOuterClassName, exceedsMaxLevels, filterFieldsByComparator, findID, findPath, generateAccessibleDescription, generateID, getCommonAncestorPath, getFieldData, getFirstOption, getGuardAbortReason, getMatchModesUtil, getMultiValueUpdate, getOption, getParametersAsList, getParentPath, getParseNumberMethod, getPathOfID, getRuleDefaultValue$1 as getRuleDefaultValue, getRuleGroupCombinator, getRuleInputType, getRuleValidationResult, getRuleValueEditorType, getRuleValueSourceOptions, getRuleValues, getValidationClassNames, getValueEditorReset, getValueSelectorUpdate, getValueSourcesUtil, group, groupInPlace, groupInvalidReasons, hideValueControlsForOperator, inOperators, insert, insertInPlace, isAncestor, isBetweenOperator, isFlexibleOptionArray, isFlexibleOptionGroupArray, isFullOptionArray, isFullOptionGroupArray, isOptionGroupArray, isPojo, isRuleGroup, isRuleGroupType, isRuleGroupTypeIC, isRuleOrGroupValid, isRuleType, isUnsafeKey, isValidationResult, joinWith, lc, mergeAnyTranslation, mergeAnyTranslations, mergeClassnames, move, moveInPlace, normalizeValueSelectorValue, nullFreeArray, nullOperators, nullOrUndefinedOrEmpty, numericRegex, objectEntries, objectKeys, optionsEqual, parseNumber, pathIsDisabled, pathIsDisabledByPaths, pathsAreEqual, preferAnyProp, preferFlagProps, preferProp, prepareOptionList, prepareRule, prepareRuleGroup, prepareRuleOrGroup, queryBuilderFlagDefaults, regenerateID, regenerateIDs, relationalOperators, remove, removeInPlace, resolveCandidateQuery, resolveDefaultOperator, resolveOperatorList, resolveValueEditorType, resolveValueList, rootPath, setAutoFreeze, shouldCoalesce, signatureOf, splitBy, standardClassnames, strictAbortReasons, structuralSignature, substringOperators, toArray, toFlatOptionArray, toFullOption, toFullOptionList, toFullOptionMap, transformQuery, trimIfString, unchangedSignature, uniqByIdentifier, uniqByName, uniqOptGroups, uniqOptList, update, updateInPlace, uuidV4regex, valuesEqual };
2902
+ //# sourceMappingURL=derivations.d.ts.map