@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.
- package/derivations/package.json +4 -0
- package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +2078 -1665
- package/dist/cjs/react-querybuilder_core.cjs.development.js +1293 -422
- package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +2078 -1665
- package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
- package/dist/{convertQuery-Cw76XFIn.js → convertQuery-BLT0GIhM.js} +17 -8
- package/dist/{convertQuery-Cw76XFIn.js.map → convertQuery-BLT0GIhM.js.map} +1 -1
- package/dist/{convertQuery-D_4J7E-Z.mjs → convertQuery-DaXv3h7S.mjs} +6 -3
- package/dist/{convertQuery-D_4J7E-Z.mjs.map → convertQuery-DaXv3h7S.mjs.map} +1 -1
- package/dist/derivations.d.mts +2902 -0
- package/dist/derivations.d.ts +2902 -0
- package/dist/derivations.js +2845 -0
- package/dist/derivations.js.map +1 -0
- package/dist/derivations.mjs +2678 -0
- package/dist/derivations.mjs.map +1 -0
- package/dist/formatQuery.d.mts +2 -895
- package/dist/formatQuery.d.ts +2 -895
- package/dist/formatQuery.js +120 -140
- package/dist/formatQuery.js.map +1 -1
- package/dist/formatQuery.mjs +8 -28
- package/dist/formatQuery.mjs.map +1 -1
- package/dist/{import-DVWI7Fdh.d.mts → import-BdKPtLzo.d.mts} +2 -2
- package/dist/{import-6ExjhifL.d.ts → import-BfZTwhp2.d.ts} +2 -2
- package/dist/{index-CX9mehdL.d.mts → index-DOIE2pwx.d.mts} +274 -3
- package/dist/{index-CX9mehdL.d.ts → index-DOIE2pwx.d.ts} +274 -3
- package/dist/index-OF2Q1gTp.d.mts +895 -0
- package/dist/index-XueTy_XQ.d.ts +895 -0
- package/dist/isRuleOrGroupValid-CIMZNkt4.mjs +27 -0
- package/dist/isRuleOrGroupValid-CIMZNkt4.mjs.map +1 -0
- package/dist/isRuleOrGroupValid-CtUf4_4x.js +38 -0
- package/dist/isRuleOrGroupValid-CtUf4_4x.js.map +1 -0
- package/dist/{isRuleGroup-CqLThsbu.mjs → objectUtils-DDZ-KhV5.mjs} +25 -2
- package/dist/objectUtils-DDZ-KhV5.mjs.map +1 -0
- package/dist/{isRuleGroup-0JNiQgLg.js → objectUtils-DfnEmDSV.js} +48 -1
- package/dist/objectUtils-DfnEmDSV.js.map +1 -0
- package/dist/parseCEL.d.mts +2 -2
- package/dist/parseCEL.d.ts +2 -2
- package/dist/parseCEL.js +19 -16
- package/dist/parseCEL.js.map +1 -1
- package/dist/parseCEL.mjs +12 -9
- package/dist/parseCEL.mjs.map +1 -1
- package/dist/parseCypher.d.mts +1 -1
- package/dist/parseCypher.d.ts +1 -1
- package/dist/parseGremlin.d.mts +1 -1
- package/dist/parseGremlin.d.ts +1 -1
- package/dist/parseJSONata.d.mts +2 -2
- package/dist/parseJSONata.d.ts +2 -2
- package/dist/parseJSONata.js +17 -14
- package/dist/parseJSONata.js.map +1 -1
- package/dist/parseJSONata.mjs +11 -8
- package/dist/parseJSONata.mjs.map +1 -1
- package/dist/parseJsonLogic.d.mts +2 -2
- package/dist/parseJsonLogic.d.ts +2 -2
- package/dist/parseJsonLogic.js +38 -38
- package/dist/parseJsonLogic.js.map +1 -1
- package/dist/parseJsonLogic.mjs +5 -5
- package/dist/parseMongoDB.d.mts +2 -2
- package/dist/parseMongoDB.d.ts +2 -2
- package/dist/parseMongoDB.js +50 -47
- package/dist/parseMongoDB.js.map +1 -1
- package/dist/parseMongoDB.mjs +35 -32
- package/dist/parseMongoDB.mjs.map +1 -1
- package/dist/parseSPARQL.d.mts +1 -1
- package/dist/parseSPARQL.d.ts +1 -1
- package/dist/parseSQL.d.mts +2 -2
- package/dist/parseSQL.d.ts +2 -2
- package/dist/parseSQL.js +27 -23
- package/dist/parseSQL.js.map +1 -1
- package/dist/parseSQL.mjs +21 -17
- package/dist/parseSQL.mjs.map +1 -1
- package/dist/parseSpEL.d.mts +2 -2
- package/dist/parseSpEL.d.ts +2 -2
- package/dist/parseSpEL.js +17 -14
- package/dist/parseSpEL.js.map +1 -1
- package/dist/parseSpEL.mjs +13 -10
- package/dist/parseSpEL.mjs.map +1 -1
- package/dist/parserUtils-BKPstAaO.mjs +30 -0
- package/dist/parserUtils-BKPstAaO.mjs.map +1 -0
- package/dist/parserUtils-DbBXyAht.js +41 -0
- package/dist/parserUtils-DbBXyAht.js.map +1 -0
- package/dist/{prepareQueryObjects-BnGL91Tt.js → prepareQueryObjects-Dj9cTl9D.js} +90 -63
- package/dist/prepareQueryObjects-Dj9cTl9D.js.map +1 -0
- package/dist/{prepareQueryObjects-ChINDIap.mjs → prepareQueryObjects-Dmyf3Wi_.mjs} +56 -59
- package/dist/prepareQueryObjects-Dmyf3Wi_.mjs.map +1 -0
- package/dist/react-querybuilder_core.d.mts +2078 -1665
- package/dist/react-querybuilder_core.legacy-esm.d.ts +2078 -1665
- package/dist/react-querybuilder_core.legacy-esm.js +1445 -635
- package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_core.mjs +1288 -424
- package/dist/react-querybuilder_core.mjs.map +1 -1
- package/dist/react-querybuilder_core.production.d.mts +2078 -1665
- package/dist/react-querybuilder_core.production.mjs +1 -1
- package/dist/react-querybuilder_core.production.mjs.map +1 -1
- package/dist/transformQuery-B7d9AWUf.d.mts +116 -0
- package/dist/transformQuery-BXDiUBGB.d.ts +116 -0
- package/dist/transformQuery.d.mts +2 -116
- package/dist/transformQuery.d.ts +2 -116
- package/dist/transformQuery.js +3 -4
- package/dist/transformQuery.js.map +1 -1
- package/dist/transformQuery.mjs +1 -2
- package/dist/transformQuery.mjs.map +1 -1
- package/dist/utils-CP5Jqy1P.mjs +1294 -0
- package/dist/utils-CP5Jqy1P.mjs.map +1 -0
- package/dist/utils-e-7KHkjV.js +1779 -0
- package/dist/utils-e-7KHkjV.js.map +1 -0
- package/package.json +33 -22
- package/dist/isRuleGroup-0JNiQgLg.js.map +0 -1
- package/dist/isRuleGroup-CqLThsbu.mjs.map +0 -1
- package/dist/objectUtils-Cr02aGxb.js +0 -27
- package/dist/objectUtils-Cr02aGxb.js.map +0 -1
- package/dist/objectUtils-DBlmJgBf.mjs +0 -16
- package/dist/objectUtils-DBlmJgBf.mjs.map +0 -1
- package/dist/prepareQueryObjects-BnGL91Tt.js.map +0 -1
- package/dist/prepareQueryObjects-ChINDIap.mjs.map +0 -1
- package/dist/utils-4k-j5FBa.mjs +0 -537
- package/dist/utils-4k-j5FBa.mjs.map +0 -1
- package/dist/utils-C79dxwZb.js +0 -752
- package/dist/utils-C79dxwZb.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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-
|
|
26
|
+
//# sourceMappingURL=import-BdKPtLzo.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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-
|
|
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 {
|
|
1990
|
-
//# sourceMappingURL=index-
|
|
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
|