@react-querybuilder/core 8.22.5 → 8.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +16 -13
  76. package/dist/parseSpEL.js.map +1 -1
  77. package/dist/parseSpEL.mjs +12 -9
  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
@@ -1,4 +1,4 @@
1
- import { C as FullField, F as OptionList, w as ValueSources } from "./index-CX9mehdL.mjs";
1
+ import { Cn as OptionList, Et as ValueSources, lt as FullField } from "./index-DOIE2pwx.mjs";
2
2
  //#region src/types/import.d.ts
3
3
  /**
4
4
  * Options common to all parsers.
@@ -23,4 +23,4 @@ interface ParserCommonOptions {
23
23
  }
24
24
  //#endregion
25
25
  export { ParserCommonOptions as t };
26
- //# sourceMappingURL=import-DVWI7Fdh.d.mts.map
26
+ //# sourceMappingURL=import-BdKPtLzo.d.mts.map
@@ -1,4 +1,4 @@
1
- import { C as FullField, F as OptionList, w as ValueSources } from "./index-CX9mehdL.js";
1
+ import { Cn as OptionList, Et as ValueSources, lt as FullField } from "./index-DOIE2pwx.js";
2
2
  //#region src/types/import.d.ts
3
3
  /**
4
4
  * Options common to all parsers.
@@ -23,4 +23,4 @@ interface ParserCommonOptions {
23
23
  }
24
24
  //#endregion
25
25
  export { ParserCommonOptions as t };
26
- //# sourceMappingURL=import-6ExjhifL.d.ts.map
26
+ //# sourceMappingURL=import-BfZTwhp2.d.ts.map
@@ -1,4 +1,4 @@
1
- import { JsonLogicLessThan, JsonLogicLessThanOrEqual, RulesLogic, RulesLogic as JsonLogicRulesLogic } from "json-logic-js";
1
+ import { JsonLogicAll, JsonLogicAnd, JsonLogicDoubleNegation, JsonLogicEqual, JsonLogicGreaterThan, JsonLogicGreaterThanOrEqual, JsonLogicInArray, JsonLogicInString, JsonLogicLessThan, JsonLogicLessThanOrEqual, JsonLogicNegation, JsonLogicNone, JsonLogicNotEqual, JsonLogicOr, JsonLogicSome, JsonLogicStrictEqual, JsonLogicStrictNotEqual, JsonLogicVar, ReservedOperations as JsonLogicReservedOperations, RulesLogic, RulesLogic as JsonLogicRulesLogic } from "json-logic-js";
2
2
  //#region ../../node_modules/type-fest/source/union-to-intersection.d.ts
3
3
  /**
4
4
  Convert a union type to an intersection type.
@@ -905,6 +905,36 @@ type PostPayloadFixed = Except<UserData, 'email'>;
905
905
  type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
906
906
  type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Required<ExceptOptions>> = { [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType]; } & (Options['requireExactProps'] extends true ? Partial<Record<KeysType, never>> : {});
907
907
  //#endregion
908
+ //#region ../../node_modules/type-fest/source/set-optional.d.ts
909
+ /**
910
+ Create a type that makes the given keys optional, while keeping the remaining keys as is.
911
+
912
+ Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are optional.
913
+
914
+ @example
915
+ ```
916
+ import type {SetOptional} from 'type-fest';
917
+
918
+ type Foo = {
919
+ a: number;
920
+ b?: string;
921
+ c: boolean;
922
+ };
923
+
924
+ type SomeOptional = SetOptional<Foo, 'b' | 'c'>;
925
+ //=> {a: number; b?: string; c?: boolean}
926
+ ```
927
+
928
+ @category Object
929
+ */
930
+ type SetOptional<BaseType, Keys extends keyof BaseType> = (BaseType extends ((...arguments_: never) => any) ? (...arguments_: Parameters<BaseType>) => ReturnType<BaseType> : unknown) & _SetOptional<BaseType, Keys>;
931
+ type _SetOptional<BaseType, Keys extends keyof BaseType> = BaseType extends unknown // To distribute `BaseType` when it's a union type.
932
+ ? Simplify<
933
+ // Pick just the keys that are readonly from the base type.
934
+ Except<BaseType, Keys> &
935
+ // Pick the keys that should be mutable from the base type and make them mutable.
936
+ Partial<HomomorphicPick<BaseType, Keys>>> : never;
937
+ //#endregion
908
938
  //#region ../../node_modules/type-fest/source/set-required.d.ts
909
939
  /**
910
940
  Create a type that makes the given keys required, while keeping the remaining keys as is.
@@ -954,6 +984,21 @@ type SetArrayRequired<TArray extends UnknownArray, Keys, Counter extends any[] =
954
984
  //#endregion
955
985
  //#region src/types/options.d.ts
956
986
  type RequireAtLeastOne<O, K extends keyof O> = { [P in K]-?: Required<Pick<O, P>> & Partial<Pick<O, Exclude<K, P>>>; }[K] & Except<O, K>;
987
+ type StringUnionToFlexibleOptionArray<Op extends string> = Array<Op extends unknown ? FlexibleOption<Op> : never>;
988
+ type StringUnionToFullOptionArray<Op extends string> = Array<Op extends unknown ? FullOption<Op> : never>;
989
+ /**
990
+ * Extracts the {@link Option} type from a {@link FlexibleOptionList}.
991
+ *
992
+ * @group Option Lists
993
+ */
994
+ type GetOptionType<OL extends FlexibleOptionList<FullOption>> = OL extends FlexibleOptionList<infer Opt> ? Opt : never;
995
+ /**
996
+ * Extracts the type of the identifying property from a {@link Option},
997
+ * {@link ValueOption}, or {@link FullOption}.
998
+ *
999
+ * @group Option Lists
1000
+ */
1001
+ type GetOptionIdentifierType<Opt extends BaseOption> = Opt extends Option<infer NameType> | ValueOption<infer NameType> ? NameType : string;
957
1002
  /**
958
1003
  * Adds an `unknown` index property to an interface.
959
1004
  */
@@ -981,6 +1026,12 @@ interface BaseOption<N extends string = string> {
981
1026
  * @group Option Lists
982
1027
  */
983
1028
  type Option<N extends string = string> = Simplify<WithUnknownIndex<SetRequired<BaseOption<N>, "name">>>;
1029
+ /**
1030
+ * Like {@link Option} but requiring `value` instead of `name`.
1031
+ *
1032
+ * @group Option Lists
1033
+ */
1034
+ type ValueOption<N extends string = string> = Simplify<WithUnknownIndex<SetRequired<BaseOption<N>, "value">>>;
984
1035
  /**
985
1036
  * A generic {@link Option} with either a `name` or `value` as its primary identifier.
986
1037
  * {@link OptionList}-type props on the {@link react-querybuilder!QueryBuilder QueryBuilder} component accept this type,
@@ -1025,6 +1076,12 @@ type BaseFullOption<N extends string = string> = Simplify<SetRequired<BaseOption
1025
1076
  * @group Option Lists
1026
1077
  */
1027
1078
  type ToFullOption<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt : Opt extends BaseOption<infer IdentifierType> ? WithUnknownIndex<Opt & FullOption<IdentifierType>> : never;
1079
+ /**
1080
+ * @deprecated Renamed to {@link Option}.
1081
+ *
1082
+ * @group Option Lists
1083
+ */
1084
+ type NameLabelPair<N extends string = string> = Option<N>;
1028
1085
  /**
1029
1086
  * A group of {@link Option}s, usually within an {@link OptionList}.
1030
1087
  *
@@ -1056,6 +1113,13 @@ type OptionList<Opt extends Option = Option> = Opt[] | OptionGroup<Opt>[];
1056
1113
  * @group Option Lists
1057
1114
  */
1058
1115
  type FlexibleOptionList<Opt extends BaseOption> = ToFlexibleOption<Opt>[] | FlexibleOptionGroup<ToFlexibleOption<Opt>>[];
1116
+ /**
1117
+ * An array of options or option groups, like {@link OptionList} but the option type
1118
+ * may use either `name` or `value` as the primary identifier.
1119
+ *
1120
+ * @group Option Lists
1121
+ */
1122
+ type FlexibleOptionListProp<Opt extends BaseOption> = (ToFlexibleOption<Opt> | GetOptionIdentifierType<Opt>)[] | FlexibleOptionGroup<ToFlexibleOption<Opt> | GetOptionIdentifierType<Opt>>[];
1059
1123
  /**
1060
1124
  * An array of options or option groups, like {@link OptionList}, but using
1061
1125
  * {@link FullOption} instead of {@link Option}. This means that every member is
@@ -1064,6 +1128,25 @@ type FlexibleOptionList<Opt extends BaseOption> = ToFlexibleOption<Opt>[] | Flex
1064
1128
  * @group Option Lists
1065
1129
  */
1066
1130
  type FullOptionList<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt[] | OptionGroup<Opt>[] : ToFullOption<Opt>[] | OptionGroup<ToFullOption<Opt>>[];
1131
+ /**
1132
+ * Map of option identifiers to their respective {@link Option}.
1133
+ *
1134
+ * @group Option Lists
1135
+ */
1136
+ type BaseOptionMap<V extends BaseOption = BaseOption, K extends string = GetOptionIdentifierType<V>> = { [k in K]?: ToFlexibleOption<V>; };
1137
+ /**
1138
+ * Map of option identifiers to their respective {@link FullOption}.
1139
+ *
1140
+ * @group Option Lists
1141
+ */
1142
+ type FullOptionMap<V extends BaseFullOption, K extends string = GetOptionIdentifierType<V>> = { [k in K]?: V; };
1143
+ /**
1144
+ * Map of option identifiers to their respective {@link FullOption}.
1145
+ * Must include all possible strings from the identifier type.
1146
+ *
1147
+ * @group Option Lists
1148
+ */
1149
+ type FullOptionRecord<V extends BaseFullOption, K extends string = GetOptionIdentifierType<V>> = Record<K, V>;
1067
1150
  //#endregion
1068
1151
  //#region src/types/expression.d.ts
1069
1152
  /**
@@ -1144,6 +1227,16 @@ interface RuleGroupType<R extends RuleType = RuleType, C extends string = string
1144
1227
  * The type of the `rules` array in a {@link RuleGroupType}.
1145
1228
  */
1146
1229
  type RuleGroupArray<RG extends RuleGroupType = RuleGroupType, R extends RuleType = RuleType> = (R | RG)[];
1230
+ /**
1231
+ * All updateable properties of rules and groups (everything except
1232
+ * `id`, `path`, and `rules`).
1233
+ */
1234
+ type UpdateableProperties = Exclude<keyof (RuleType & RuleGroupType), "id" | "path" | "rules"> | (string & {});
1235
+ /**
1236
+ * A map of {@link UpdateableProperties} to their new values, for updating
1237
+ * multiple properties of a rule or group in a single operation.
1238
+ */
1239
+ type UpdateValueMap = Partial<Record<UpdateableProperties, any>>;
1147
1240
  /**
1148
1241
  * The type of the `rules` array in a {@link DefaultRuleGroupType}.
1149
1242
  */
@@ -1177,6 +1270,24 @@ type DefaultCombinatorNameExtended = DefaultCombinatorName | "xor";
1177
1270
  * @group Option Lists
1178
1271
  */
1179
1272
  type DefaultOperatorName = "=" | "!=" | "<" | ">" | "<=" | ">=" | "contains" | "beginsWith" | "endsWith" | "doesNotContain" | "doesNotBeginWith" | "doesNotEndWith" | "null" | "notNull" | "in" | "notIn" | "between" | "notBetween";
1273
+ /**
1274
+ * A {@link FullCombinator} definition with a {@link DefaultCombinatorName} `name` property.
1275
+ *
1276
+ * @group Option Lists
1277
+ */
1278
+ type DefaultCombinator = FullCombinator<DefaultCombinatorName>;
1279
+ /**
1280
+ * A {@link FullCombinator} definition with a {@link DefaultCombinatorNameExtended} `name` property.
1281
+ *
1282
+ * @group Option Lists
1283
+ */
1284
+ type DefaultCombinatorExtended = FullCombinator<DefaultCombinatorNameExtended>;
1285
+ /**
1286
+ * An {@link FullOperator} definition with a {@link DefaultOperatorName} `name` property.
1287
+ *
1288
+ * @group Option Lists
1289
+ */
1290
+ type DefaultOperator = FullOperator<DefaultOperatorName>;
1180
1291
  //#endregion
1181
1292
  //#region src/types/ruleGroupsIC.utils.d.ts
1182
1293
  type MAXIMUM_ALLOWED_BOUNDARY = 80;
@@ -1205,10 +1316,18 @@ type RuleGroupTypeAny<R extends RuleType = RuleType, C extends string = string>
1205
1316
  type RuleGroupICArray<RG extends RuleGroupTypeIC = RuleGroupTypeIC, R extends RuleType = RuleType, C extends string = string> = [R | RG] | [R | RG, ...MappedTuple<[C, R | RG]>] | ((R | RG)[] & {
1206
1317
  length: 0;
1207
1318
  });
1319
+ /**
1320
+ * Shorthand for "either {@link RuleGroupArray} or {@link RuleGroupICArray}".
1321
+ */
1322
+ type RuleOrGroupArray = RuleGroupArray | RuleGroupICArray;
1208
1323
  /**
1209
1324
  * The type of the `rules` array in a {@link DefaultRuleGroupTypeIC}.
1210
1325
  */
1211
1326
  type DefaultRuleGroupICArray<F extends string = string> = RuleGroupICArray<DefaultRuleGroupTypeIC<F>, DefaultRuleType<F>, DefaultCombinatorName>;
1327
+ /**
1328
+ * Shorthand for "either {@link DefaultRuleGroupArray} or {@link DefaultRuleGroupICArray}".
1329
+ */
1330
+ type DefaultRuleOrGroupArray<F extends string = string> = DefaultRuleGroupArray<F> | DefaultRuleGroupICArray<F>;
1212
1331
  /**
1213
1332
  * {@link RuleGroupTypeIC} with combinators limited to
1214
1333
  * {@link DefaultCombinatorName} and rules limited to {@link DefaultRuleType}.
@@ -1216,6 +1335,44 @@ type DefaultRuleGroupICArray<F extends string = string> = RuleGroupICArray<Defau
1216
1335
  interface DefaultRuleGroupTypeIC<F extends string = string> extends RuleGroupTypeIC<DefaultRuleType<F>> {
1217
1336
  rules: DefaultRuleGroupICArray<F>;
1218
1337
  }
1338
+ /**
1339
+ * Shorthand for "either {@link DefaultRuleGroupType} or {@link DefaultRuleGroupTypeIC}".
1340
+ */
1341
+ type DefaultRuleGroupTypeAny<F extends string = string> = DefaultRuleGroupType<F> | DefaultRuleGroupTypeIC<F>;
1342
+ /**
1343
+ * Determines if a type extending {@link RuleGroupTypeAny} is actually
1344
+ * {@link RuleGroupType} or {@link RuleGroupTypeIC}.
1345
+ */
1346
+ type GetRuleGroupType<RG> = RG extends {
1347
+ combinator: string;
1348
+ } ? RuleGroupType : RuleGroupTypeIC;
1349
+ /**
1350
+ * Determines the {@link RuleType} of a given {@link RuleGroupType}
1351
+ * or {@link RuleGroupTypeIC}. If the field and operator name types of
1352
+ * the rule type extend the identifier types of the provided Field and
1353
+ * Operator types, the given rule type is returned as is. Otherwise,
1354
+ * the rule type has its field and operator types narrowed to the
1355
+ * identifier types of the provided Field and Operator types.
1356
+ */
1357
+ type GetRuleTypeFromGroupWithFieldAndOperator<RG extends RuleGroupTypeAny, F extends BaseOption, O extends BaseOption> = RG extends RuleGroupType<infer RT> | RuleGroupTypeIC<infer RT> ? RT extends RuleType<infer RuleFieldName, infer RuleOperatorName, infer RuleValueName, infer RuleCombinatorName> ? RuleFieldName extends GetOptionIdentifierType<F> ? RuleOperatorName extends GetOptionIdentifierType<O> ? RuleType<RuleFieldName, RuleOperatorName, RuleValueName, RuleCombinatorName> : RuleType<RuleFieldName, GetOptionIdentifierType<O>, RuleValueName, RuleCombinatorName> : RuleOperatorName extends GetOptionIdentifierType<O> ? RuleType<GetOptionIdentifierType<F>, RuleOperatorName, RuleValueName, RuleCombinatorName> : RuleType<GetOptionIdentifierType<F>, GetOptionIdentifierType<O>, RuleValueName, RuleCombinatorName> : never : never;
1358
+ /**
1359
+ * Converts a narrowed rule group type to its most generic form.
1360
+ */
1361
+ type GenericizeRuleGroupType<RG> = RG extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
1362
+ /**
1363
+ * Converts a {@link RuleGroupType} extension to the corresponding
1364
+ * {@link RuleGroupTypeIC} type, preserving any additional properties.
1365
+ * If the type already extends {@link RuleGroupTypeIC}, it is returned as-is.
1366
+ */
1367
+ type ToRuleGroupTypeIC<T extends RuleGroupTypeAny> = T extends RuleGroupTypeIC ? T : T extends DefaultRuleGroupType<infer F> ? DefaultRuleGroupTypeIC<F> : T extends RuleGroupType<infer R, infer C> ? RuleGroupTypeIC<R, C> & Omit<T, keyof RuleGroupType<R, C>> : T;
1368
+ /**
1369
+ * Converts a {@link RuleGroupTypeIC} extension to the corresponding
1370
+ * {@link RuleGroupType} type, preserving any additional properties.
1371
+ * If the type already extends {@link RuleGroupType} (non-IC), it is returned as-is.
1372
+ */
1373
+ type ToRuleGroupType<T extends RuleGroupTypeAny> = T extends {
1374
+ combinator: string;
1375
+ } ? T : T extends DefaultRuleGroupTypeIC<infer F> ? DefaultRuleGroupType<F> : T extends RuleGroupTypeIC<infer R, infer C> ? RuleGroupType<R, C> & Omit<T, keyof RuleGroupTypeIC<R, C>> : T;
1219
1376
  //#endregion
1220
1377
  //#region src/types/validation.d.ts
1221
1378
  /**
@@ -1264,6 +1421,12 @@ type ValueEditorType = "text" | "select" | "checkbox" | "radio" | "textarea" | "
1264
1421
  */
1265
1422
  type ValueSources = [ValueSource, ...ValueSource[]];
1266
1423
  type ValueSourceFlexibleOptions = ToFlexibleOptionArrays<ValueSources>;
1424
+ type ValueSourceFullOptions = ToOptionArrays<ValueSources>;
1425
+ type ToOptionArrays<Sources extends readonly string[]> = Sources extends unknown ? { [K in keyof Sources]: {
1426
+ name: Sources[K];
1427
+ value: Sources[K];
1428
+ label: string;
1429
+ }; } : never;
1267
1430
  type ToFlexibleOptionArrays<Sources extends readonly string[]> = Sources extends unknown ? { [K in keyof Sources]: FlexibleOption; } : never;
1268
1431
  type WithOptionalClassName<T> = T & {
1269
1432
  className?: Classname;
@@ -1285,6 +1448,9 @@ interface MatchConfig {
1285
1448
  threshold?: number | null | undefined;
1286
1449
  }
1287
1450
  type MatchMode = "all" | "some" | "none" | "atLeast" | "atMost" | "exactly";
1451
+ type MatchModeOptions = StringUnionToFullOptionArray<MatchMode>;
1452
+ type ActionElementEventHandler = (event?: any, context?: any) => void;
1453
+ type ValueChangeEventHandler = (value?: any, context?: any) => void;
1288
1454
  /**
1289
1455
  * Base for all Field types/interfaces.
1290
1456
  */
@@ -1317,6 +1483,40 @@ interface BaseFullField<FieldName extends string = string, OperatorName extends
1317
1483
  * @group Option Lists
1318
1484
  */
1319
1485
  type FullField<FieldName extends string = string, OperatorName extends string = string, ValueName extends string = string, OperatorObj extends FullOption = FullOption<OperatorName>, ValueObj extends FullOption = FullOption<ValueName>> = Simplify<FullOption<FieldName> & BaseFullField<FieldName, OperatorName, ValueName, OperatorObj, ValueObj>>;
1486
+ /**
1487
+ * Field definition used in the `fields` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
1488
+ * This type is an extension of {@link FullField} where only `name` and
1489
+ * `label` are required.
1490
+ *
1491
+ * The `name`/`value`, `operators`, and `values` properties of this interface
1492
+ * can be narrowed with generics.
1493
+ *
1494
+ * @group Option Lists
1495
+ */
1496
+ type Field<FieldName extends string = string, OperatorName extends string = string, ValueName extends string = string, OperatorObj extends FullOption = FullOption<OperatorName>> = WithUnknownIndex<{
1497
+ value?: FieldName;
1498
+ } & Pick<BaseFullField<FieldName, OperatorName, ValueName, OperatorObj>, Exclude<keyof BaseFullField, "value">>>;
1499
+ /**
1500
+ * Field definition used in the `fields` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
1501
+ * This type is an extension of {@link FullField} where only `value` and
1502
+ * `label` are required.
1503
+ *
1504
+ * The `name`/`value`, `operators`, and `values` properties of this interface
1505
+ * can be narrowed with generics.
1506
+ *
1507
+ * @group Option Lists
1508
+ */
1509
+ type FieldByValue<FieldName extends string = string, OperatorName extends string = string, ValueName extends string = string, OperatorObj extends FullOption = FullOption<OperatorName>> = WithUnknownIndex<{
1510
+ name?: FieldName;
1511
+ } & Pick<BaseFullField<FieldName, OperatorName, ValueName, OperatorObj>, Exclude<keyof BaseFullField, "name">>>;
1512
+ /**
1513
+ * Utility type to make one or more properties required.
1514
+ */
1515
+ type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P]; };
1516
+ /**
1517
+ * Utility type to make all properties non-nullable.
1518
+ */
1519
+ type RemoveNullability<T extends Record<string, unknown>> = { [k in keyof T]: NonNullable<T[k]>; };
1320
1520
  /**
1321
1521
  * Allowed values of the {@link FullOperator} property `arity`. A value of `"unary"` or
1322
1522
  * a number less than two will cause the default {@link react-querybuilder!ValueEditor ValueEditor} to render `null`.
@@ -1336,12 +1536,79 @@ type Arity = number | "unary" | "binary" | "ternary";
1336
1536
  interface FullOperator<N extends string = string> extends WithOptionalClassName<FullOption<N>> {
1337
1537
  arity?: Arity;
1338
1538
  }
1539
+ /**
1540
+ * Operator definition used in the `operators`/`getOperators` props of
1541
+ * {@link react-querybuilder!QueryBuilder QueryBuilder}. This type is an extension of {@link FullOperator}
1542
+ * where only `name` and `label` are required.
1543
+ *
1544
+ * The `name`/`value` properties of this interface can be narrowed with generics.
1545
+ *
1546
+ * @group Option Lists
1547
+ */
1548
+ type Operator<N extends string = string> = WithUnknownIndex<SetOptional<BaseFullOption<N>, "value"> & WithOptionalClassName<{
1549
+ arity?: Arity;
1550
+ }>>;
1551
+ /**
1552
+ * Operator definition used in the `operators`/`getOperators` props of
1553
+ * {@link react-querybuilder!QueryBuilder QueryBuilder}. This type is an extension of {@link FullOperator}
1554
+ * where only `value` and `label` are required.
1555
+ *
1556
+ * The `name`/`value` properties of this interface can be narrowed with generics.
1557
+ *
1558
+ * @group Option Lists
1559
+ */
1560
+ type OperatorByValue<N extends string = string> = WithUnknownIndex<SetOptional<BaseFullOption<N>, "name"> & WithOptionalClassName<{
1561
+ arity?: Arity;
1562
+ }>>;
1563
+ /**
1564
+ * Full combinator definition used in the `combinators` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
1565
+ * This type requires both `name` and `value`, but the `combinators` prop itself
1566
+ * can use a {@link FlexibleOption} where only one of `name` or `value` is required,
1567
+ * or {@link Combinator} where only `name` is required.
1568
+ *
1569
+ * The `name`/`value` properties of this interface can be narrowed with generics.
1570
+ *
1571
+ * @group Option Lists
1572
+ */
1573
+ type FullCombinator<N extends string = string> = WithOptionalClassName<FullOption<N>>;
1574
+ /**
1575
+ * Combinator definition used in the `combinators` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
1576
+ * This type is an extension of {@link FullCombinator} where only `name` and
1577
+ * `label` are required.
1578
+ *
1579
+ * The `name`/`value` properties of this interface can be narrowed with generics.
1580
+ *
1581
+ * @group Option Lists
1582
+ */
1583
+ type Combinator<N extends string = string> = WithUnknownIndex<WithOptionalClassName<SetOptional<BaseFullOption<N>, "value">>>;
1584
+ /**
1585
+ * Combinator definition used in the `combinators` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
1586
+ * This type is an extension of {@link FullCombinator} where only `value` and
1587
+ * `label` are required.
1588
+ *
1589
+ * The `name`/`value` properties of this interface can be narrowed with generics.
1590
+ *
1591
+ * @group Option Lists
1592
+ */
1593
+ type CombinatorByValue<N extends string = string> = WithUnknownIndex<WithOptionalClassName<SetOptional<BaseFullOption<N>, "name">>>;
1339
1594
  type ParseNumberMethodName = "enhanced" | "native" | "strict";
1595
+ /**
1596
+ * Parsing algorithms used by {@link parseNumber}.
1597
+ */
1598
+ type ParseNumberMethod = boolean | ParseNumberMethodName;
1340
1599
  type ParseNumbersModerationLevel = "-limited" | "";
1341
1600
  /**
1342
1601
  * Options for the `parseNumbers` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
1343
1602
  */
1344
1603
  type ParseNumbersPropConfig = boolean | `${ParseNumberMethodName}${ParseNumbersModerationLevel}`;
1604
+ /**
1605
+ * Signature of `accessibleDescriptionGenerator` prop, used by {@link react-querybuilder!QueryBuilder QueryBuilder} to generate
1606
+ * accessible descriptions for each {@link react-querybuilder!RuleGroup RuleGroup}.
1607
+ */
1608
+ type AccessibleDescriptionGenerator = (props: {
1609
+ path: Path;
1610
+ qbId: string;
1611
+ }) => string;
1345
1612
  //#endregion
1346
1613
  //#region src/types/export.d.ts
1347
1614
  /**
@@ -1673,6 +1940,10 @@ type ValueProcessorByRule = (rule: RuleType, options?: ValueProcessorOptions) =>
1673
1940
  * @group Export
1674
1941
  */
1675
1942
  type ValueProcessorLegacy = (field: string, operator: string, value: any, valueSource?: ValueSource) => string;
1943
+ /**
1944
+ * @group Export
1945
+ */
1946
+ type ValueProcessor = ValueProcessorLegacy;
1676
1947
  /**
1677
1948
  * Function to produce a result that {@link formatQuery} uses when processing a
1678
1949
  * {@link RuleType} object.
@@ -1986,5 +2257,5 @@ type NLTranslationKey = "and" | "or" | "true" | "false" | "ruleSeparator" | "bet
1986
2257
  */
1987
2258
  type NLTranslations = Partial<Record<NLTranslationKey, string>>;
1988
2259
  //#endregion
1989
- export { DefaultOperatorName as A, FullField as C, RuleGroupTypeIC as D, RuleGroupTypeAny as E, OptionList as F, SetRequired as I, Except as L, RuleGroupType as M, RuleType as N, DefaultCombinatorName as O, ExpressionNode as P, Merge as R, ValueProcessorOptions as S, DefaultRuleGroupTypeIC as T, RuleGroupProcessor as _, DiagnosticsResult as a, ValueProcessorByRule as b, ExportOperatorMap as c, NLTranslationKey as d, NLTranslations as f, RQBJsonLogicVar as g, RQBJsonLogic as h, ConstituentWordOrder as i, DefaultRuleGroupType as j, DefaultCombinatorNameExtended as k, FormatQueryOptions as l, ParameterizedSQL as m, JsonLogicLessThanOrEqual as n, ExportFormat as o, ParameterizedNamedSQL as p, JsonLogicRulesLogic as r, ExportObjectFormats as s, JsonLogicLessThan as t, GroupVariantCondition as u, RuleProcessor as v, ValueSources as w, ValueProcessorLegacy as x, SQLPreset as y };
1990
- //# sourceMappingURL=index-CX9mehdL.d.mts.map
2260
+ export { ValueProcessorOptions as $, DefaultRuleGroupType as $t, FormatQueryFinalOptions as A, SetRequired as An, ValidationMap as At, RQBJsonLogicStartsWith as B, RuleGroupTypeAny as Bt, DiagnosticEntry as C, OptionList as Cn, ValueSource as Ct, ExportFormat as D, ToFullOption as Dn, WithRequired as Dt, DiagnosticsStats as E, ToFlexibleOption as En, ValueSources as Et, NLTranslations as F, IsNever as Fn, DefaultRuleOrGroupArray as Ft, RuleGroupICDiagnosticsArray as G, CommonRuleAndGroupProperties as Gt, RuleDiagnosticsResult as H, RuleOrGroupArray as Ht, ParameterizedNamedSQL as I, IsAny as In, GenericizeRuleGroupType as It, RuleProcessor as J, DefaultCombinatorName as Jt, RuleGroupICDiagnosticsResult as K, DefaultCombinator as Kt, ParameterizedSQL as L, GetRuleGroupType as Lt, FormatQueryValidateRule as M, Merge as Mn, DefaultRuleGroupICArray as Mt, GroupVariantCondition as N, Simplify as Nn, DefaultRuleGroupTypeAny as Nt, ExportObjectFormats as O, ValueOption as On, QueryValidator as Ot, NLTranslationKey as P, If as Pn, DefaultRuleGroupTypeIC as Pt, ValueProcessorLegacy as Q, DefaultRuleGroupArray as Qt, RQBJsonLogic as R, GetRuleTypeFromGroupWithFieldAndOperator as Rt, ConstituentWordOrderString as S, OptionGroup as Sn, ValueEditorType as St, DiagnosticsResult as T, StringUnionToFullOptionArray as Tn, ValueSourceFullOptions as Tt, RuleGroupDiagnosticsArray as U, ToRuleGroupType as Ut, RQBJsonLogicVar as V, RuleGroupTypeIC as Vt, RuleGroupDiagnosticsResult as W, ToRuleGroupTypeIC as Wt, ValueProcessor as X, DefaultOperator as Xt, SQLPreset as Y, DefaultCombinatorNameExtended as Yt, ValueProcessorByRule as Z, DefaultOperatorName as Zt, JsonLogicSome as _, FullOptionRecord as _n, ParseNumberMethod as _t, JsonLogicGreaterThan as a, UpdateableProperties as an, CombinatorByValue as at, JsonLogicVar as b, NameLabelPair as bn, RemoveNullability as bt, JsonLogicInString as c, BaseOption as cn, FullCombinator as ct, JsonLogicNegation as d, FlexibleOptionGroup as dn, InputType as dt, DefaultRuleType as en, AccessibleDescriptionGenerator as et, JsonLogicNone as f, FlexibleOptionList as fn, MatchConfig as ft, JsonLogicRulesLogic as g, FullOptionMap as gn, OperatorByValue as gt, JsonLogicReservedOperations as h, FullOptionList as hn, Operator as ht, JsonLogicEqual as i, UpdateValueMap as in, Combinator as it, FormatQueryOptions as j, Except as jn, ValidationResult as jt, ExportOperatorMap as k, WithUnknownIndex as kn, RuleValidator as kt, JsonLogicLessThan as l, BaseOptionMap as ln, FullField as lt, JsonLogicOr as m, FullOption as mn, MatchModeOptions as mt, JsonLogicAnd as n, RuleGroupType as nn, Arity as nt, JsonLogicGreaterThanOrEqual as o, ExpressionNode as on, Field as ot, JsonLogicNotEqual as p, FlexibleOptionListProp as pn, MatchMode as pt, RuleGroupProcessor as q, DefaultCombinatorExtended as qt, JsonLogicDoubleNegation as r, RuleType as rn, Classname as rt, JsonLogicInArray as s, BaseFullOption as sn, FieldByValue as st, JsonLogicAll as t, RuleGroupArray as tn, ActionElementEventHandler as tt, JsonLogicLessThanOrEqual as u, FlexibleOption as un, FullOperator as ut, JsonLogicStrictEqual as v, GetOptionIdentifierType as vn, ParseNumbersPropConfig as vt, DiagnosticsFieldSummaryEntry as w, StringUnionToFlexibleOptionArray as wn, ValueSourceFlexibleOptions as wt, ConstituentWordOrder as x, Option as xn, ValueChangeEventHandler as xt, JsonLogicStrictNotEqual as y, GetOptionType as yn, Path as yt, RQBJsonLogicEndsWith as z, RuleGroupICArray as zt };
2261
+ //# sourceMappingURL=index-DOIE2pwx.d.mts.map