@react-querybuilder/core 8.13.0 → 8.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{basic-_KlsCAyT.d.ts → basic-Dxm6jWFu.d.ts} +10 -10
- package/dist/{basic-Cw014pDc.d.mts → basic-GFsWfi0Z.d.mts} +10 -10
- package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +23 -23
- package/dist/cjs/react-querybuilder_core.cjs.development.js +24 -1
- package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +23 -23
- 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/{export-DRA8O1Wz.d.ts → export-6VbkhCrf.d.ts} +2 -2
- package/dist/{export-CffjLxEe.d.mts → export-_wipiqJZ.d.mts} +2 -2
- package/dist/formatQuery.d.mts +2 -2
- package/dist/formatQuery.d.ts +2 -2
- package/dist/formatQuery.js +24 -1
- package/dist/formatQuery.js.map +1 -1
- package/dist/formatQuery.mjs +24 -1
- package/dist/formatQuery.mjs.map +1 -1
- package/dist/{import-CWYJkN_w.d.ts → import-D8M7awTx.d.ts} +2 -2
- package/dist/{import-DjHGaGhJ.d.mts → import-DRmutNSr.d.mts} +2 -2
- package/dist/parseCEL.d.mts +2 -2
- package/dist/parseCEL.d.ts +2 -2
- package/dist/parseCEL.js +6 -6
- package/dist/parseCEL.js.map +1 -1
- package/dist/parseCEL.mjs +1 -1
- package/dist/parseJSONata.d.mts +2 -2
- package/dist/parseJSONata.d.ts +2 -2
- package/dist/parseJSONata.js +3 -3
- package/dist/parseJSONata.js.map +1 -1
- package/dist/parseJSONata.mjs +1 -2
- package/dist/parseJSONata.mjs.map +1 -1
- package/dist/parseJsonLogic.d.mts +3 -3
- package/dist/parseJsonLogic.d.ts +3 -3
- package/dist/parseJsonLogic.js +1 -1
- package/dist/parseJsonLogic.mjs +1 -1
- package/dist/parseMongoDB.d.mts +2 -2
- package/dist/parseMongoDB.d.ts +2 -2
- package/dist/parseMongoDB.js +1 -1
- package/dist/parseMongoDB.mjs +1 -1
- package/dist/parseSQL.d.mts +2 -2
- package/dist/parseSQL.d.ts +2 -2
- package/dist/parseSQL.js +6 -6
- package/dist/parseSQL.js.map +1 -1
- package/dist/parseSQL.mjs +1 -1
- package/dist/parseSpEL.d.mts +2 -2
- package/dist/parseSpEL.d.ts +2 -2
- package/dist/parseSpEL.js +1 -1
- package/dist/parseSpEL.mjs +1 -1
- package/dist/{prepareQueryObjects-6Bxx4Bs1.mjs → prepareQueryObjects-BBayjIn2.mjs} +2 -5
- package/dist/prepareQueryObjects-BBayjIn2.mjs.map +1 -0
- package/dist/{prepareQueryObjects-CkN0bTKm.js → prepareQueryObjects-BxWvIPI4.js} +2 -5
- package/dist/prepareQueryObjects-BxWvIPI4.js.map +1 -0
- package/dist/react-querybuilder_core.d.mts +23 -23
- package/dist/react-querybuilder_core.legacy-esm.d.ts +23 -23
- package/dist/react-querybuilder_core.legacy-esm.js +28 -8
- package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_core.mjs +24 -1
- package/dist/react-querybuilder_core.mjs.map +1 -1
- package/dist/react-querybuilder_core.production.d.mts +23 -23
- package/dist/react-querybuilder_core.production.mjs +1 -1
- package/dist/react-querybuilder_core.production.mjs.map +1 -1
- package/dist/transformQuery.d.mts +1 -1
- package/dist/transformQuery.d.ts +1 -1
- package/dist/transformQuery.js +0 -1
- package/dist/transformQuery.mjs +0 -1
- package/dist/utils-CR1ToTMW.js.map +1 -1
- package/dist/utils-nQU7WCM9.mjs.map +1 -1
- package/package.json +14 -14
- package/dist/prepareQueryObjects-6Bxx4Bs1.mjs.map +0 -1
- package/dist/prepareQueryObjects-CkN0bTKm.js.map +0 -1
|
@@ -963,7 +963,7 @@ type FlexibleOption<N extends string = string> = Simplify<WithUnknownIndex<Requi
|
|
|
963
963
|
*
|
|
964
964
|
* @group Option Lists
|
|
965
965
|
*/
|
|
966
|
-
type ToFlexibleOption<Opt
|
|
966
|
+
type ToFlexibleOption<Opt extends BaseOption | string> = WithUnknownIndex<RequireAtLeastOne<Opt extends string ? FlexibleOption<Opt> : Opt, "name" | "value">>;
|
|
967
967
|
/**
|
|
968
968
|
* A generic {@link Option} requiring both `name` _and_ `value` properties.
|
|
969
969
|
* Props that extend {@link OptionList} accept {@link BaseOption}, but
|
|
@@ -991,38 +991,38 @@ type BaseFullOption<N extends string = string> = Simplify<SetRequired<BaseOption
|
|
|
991
991
|
*
|
|
992
992
|
* @group Option Lists
|
|
993
993
|
*/
|
|
994
|
-
type ToFullOption<Opt
|
|
994
|
+
type ToFullOption<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt : Opt extends BaseOption<infer IdentifierType> ? WithUnknownIndex<Opt & FullOption<IdentifierType>> : never;
|
|
995
995
|
/**
|
|
996
996
|
* A group of {@link Option}s, usually within an {@link OptionList}.
|
|
997
997
|
*
|
|
998
998
|
* @group Option Lists
|
|
999
999
|
*/
|
|
1000
|
-
interface OptionGroup<Opt
|
|
1000
|
+
interface OptionGroup<Opt extends BaseOption = FlexibleOption> {
|
|
1001
1001
|
label: string;
|
|
1002
|
-
options: WithUnknownIndex<Opt
|
|
1002
|
+
options: WithUnknownIndex<Opt>[];
|
|
1003
1003
|
}
|
|
1004
1004
|
/**
|
|
1005
1005
|
* A group of {@link BaseOption}s, usually within a {@link FlexibleOptionList}.
|
|
1006
1006
|
*
|
|
1007
1007
|
* @group Option Lists
|
|
1008
1008
|
*/
|
|
1009
|
-
type FlexibleOptionGroup<Opt
|
|
1009
|
+
type FlexibleOptionGroup<Opt extends BaseOption | string = BaseOption> = {
|
|
1010
1010
|
label: string;
|
|
1011
|
-
options: (Opt
|
|
1011
|
+
options: (Opt extends BaseFullOption ? Opt : ToFlexibleOption<Opt>)[];
|
|
1012
1012
|
};
|
|
1013
1013
|
/**
|
|
1014
1014
|
* Either an array of {@link Option}s or an array of {@link OptionGroup}s.
|
|
1015
1015
|
*
|
|
1016
1016
|
* @group Option Lists
|
|
1017
1017
|
*/
|
|
1018
|
-
type OptionList<Opt
|
|
1018
|
+
type OptionList<Opt extends Option = Option> = Opt[] | OptionGroup<Opt>[];
|
|
1019
1019
|
/**
|
|
1020
1020
|
* An array of options or option groups, like {@link OptionList} but the option type
|
|
1021
1021
|
* may use either `name` or `value` as the primary identifier.
|
|
1022
1022
|
*
|
|
1023
1023
|
* @group Option Lists
|
|
1024
1024
|
*/
|
|
1025
|
-
type FlexibleOptionList<Opt
|
|
1025
|
+
type FlexibleOptionList<Opt extends BaseOption> = ToFlexibleOption<Opt>[] | FlexibleOptionGroup<ToFlexibleOption<Opt>>[];
|
|
1026
1026
|
/**
|
|
1027
1027
|
* An array of options or option groups, like {@link OptionList}, but using
|
|
1028
1028
|
* {@link FullOption} instead of {@link Option}. This means that every member is
|
|
@@ -1030,7 +1030,7 @@ type FlexibleOptionList<Opt$1 extends BaseOption> = ToFlexibleOption<Opt$1>[] |
|
|
|
1030
1030
|
*
|
|
1031
1031
|
* @group Option Lists
|
|
1032
1032
|
*/
|
|
1033
|
-
type FullOptionList<Opt
|
|
1033
|
+
type FullOptionList<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt[] | OptionGroup<Opt>[] : ToFullOption<Opt>[] | OptionGroup<ToFullOption<Opt>>[];
|
|
1034
1034
|
//#endregion
|
|
1035
1035
|
//#region src/types/ruleGroups.d.ts
|
|
1036
1036
|
/**
|
|
@@ -1279,4 +1279,4 @@ type ParseNumbersModerationLevel = "-limited" | "";
|
|
|
1279
1279
|
type ParseNumbersPropConfig = boolean | `${ParseNumberMethodName}${ParseNumbersModerationLevel}`;
|
|
1280
1280
|
//#endregion
|
|
1281
1281
|
export { Except as C, SetRequired as S, RuleGroupType as _, ValueSource as a, FullOptionList as b, RuleValidator as c, DefaultRuleGroupTypeIC as d, RuleGroupTypeAny as f, DefaultRuleGroupType as g, DefaultOperatorName as h, ParseNumbersPropConfig as i, ValidationMap as l, DefaultCombinatorName as m, FullOperator as n, ValueSources as o, RuleGroupTypeIC as p, InputType as r, QueryValidator as s, FullField as t, ValidationResult as u, RuleType as v, OptionList as x, FlexibleOptionList as y };
|
|
1282
|
-
//# sourceMappingURL=basic-
|
|
1282
|
+
//# sourceMappingURL=basic-Dxm6jWFu.d.ts.map
|
|
@@ -963,7 +963,7 @@ type FlexibleOption<N extends string = string> = Simplify<WithUnknownIndex<Requi
|
|
|
963
963
|
*
|
|
964
964
|
* @group Option Lists
|
|
965
965
|
*/
|
|
966
|
-
type ToFlexibleOption<Opt
|
|
966
|
+
type ToFlexibleOption<Opt extends BaseOption | string> = WithUnknownIndex<RequireAtLeastOne<Opt extends string ? FlexibleOption<Opt> : Opt, "name" | "value">>;
|
|
967
967
|
/**
|
|
968
968
|
* A generic {@link Option} requiring both `name` _and_ `value` properties.
|
|
969
969
|
* Props that extend {@link OptionList} accept {@link BaseOption}, but
|
|
@@ -991,38 +991,38 @@ type BaseFullOption<N extends string = string> = Simplify<SetRequired<BaseOption
|
|
|
991
991
|
*
|
|
992
992
|
* @group Option Lists
|
|
993
993
|
*/
|
|
994
|
-
type ToFullOption<Opt
|
|
994
|
+
type ToFullOption<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt : Opt extends BaseOption<infer IdentifierType> ? WithUnknownIndex<Opt & FullOption<IdentifierType>> : never;
|
|
995
995
|
/**
|
|
996
996
|
* A group of {@link Option}s, usually within an {@link OptionList}.
|
|
997
997
|
*
|
|
998
998
|
* @group Option Lists
|
|
999
999
|
*/
|
|
1000
|
-
interface OptionGroup<Opt
|
|
1000
|
+
interface OptionGroup<Opt extends BaseOption = FlexibleOption> {
|
|
1001
1001
|
label: string;
|
|
1002
|
-
options: WithUnknownIndex<Opt
|
|
1002
|
+
options: WithUnknownIndex<Opt>[];
|
|
1003
1003
|
}
|
|
1004
1004
|
/**
|
|
1005
1005
|
* A group of {@link BaseOption}s, usually within a {@link FlexibleOptionList}.
|
|
1006
1006
|
*
|
|
1007
1007
|
* @group Option Lists
|
|
1008
1008
|
*/
|
|
1009
|
-
type FlexibleOptionGroup<Opt
|
|
1009
|
+
type FlexibleOptionGroup<Opt extends BaseOption | string = BaseOption> = {
|
|
1010
1010
|
label: string;
|
|
1011
|
-
options: (Opt
|
|
1011
|
+
options: (Opt extends BaseFullOption ? Opt : ToFlexibleOption<Opt>)[];
|
|
1012
1012
|
};
|
|
1013
1013
|
/**
|
|
1014
1014
|
* Either an array of {@link Option}s or an array of {@link OptionGroup}s.
|
|
1015
1015
|
*
|
|
1016
1016
|
* @group Option Lists
|
|
1017
1017
|
*/
|
|
1018
|
-
type OptionList<Opt
|
|
1018
|
+
type OptionList<Opt extends Option = Option> = Opt[] | OptionGroup<Opt>[];
|
|
1019
1019
|
/**
|
|
1020
1020
|
* An array of options or option groups, like {@link OptionList} but the option type
|
|
1021
1021
|
* may use either `name` or `value` as the primary identifier.
|
|
1022
1022
|
*
|
|
1023
1023
|
* @group Option Lists
|
|
1024
1024
|
*/
|
|
1025
|
-
type FlexibleOptionList<Opt
|
|
1025
|
+
type FlexibleOptionList<Opt extends BaseOption> = ToFlexibleOption<Opt>[] | FlexibleOptionGroup<ToFlexibleOption<Opt>>[];
|
|
1026
1026
|
/**
|
|
1027
1027
|
* An array of options or option groups, like {@link OptionList}, but using
|
|
1028
1028
|
* {@link FullOption} instead of {@link Option}. This means that every member is
|
|
@@ -1030,7 +1030,7 @@ type FlexibleOptionList<Opt$1 extends BaseOption> = ToFlexibleOption<Opt$1>[] |
|
|
|
1030
1030
|
*
|
|
1031
1031
|
* @group Option Lists
|
|
1032
1032
|
*/
|
|
1033
|
-
type FullOptionList<Opt
|
|
1033
|
+
type FullOptionList<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt[] | OptionGroup<Opt>[] : ToFullOption<Opt>[] | OptionGroup<ToFullOption<Opt>>[];
|
|
1034
1034
|
//#endregion
|
|
1035
1035
|
//#region src/types/ruleGroups.d.ts
|
|
1036
1036
|
/**
|
|
@@ -1279,4 +1279,4 @@ type ParseNumbersModerationLevel = "-limited" | "";
|
|
|
1279
1279
|
type ParseNumbersPropConfig = boolean | `${ParseNumberMethodName}${ParseNumbersModerationLevel}`;
|
|
1280
1280
|
//#endregion
|
|
1281
1281
|
export { Except as C, SetRequired as S, RuleGroupType as _, ValueSource as a, FullOptionList as b, RuleValidator as c, DefaultRuleGroupTypeIC as d, RuleGroupTypeAny as f, DefaultRuleGroupType as g, DefaultOperatorName as h, ParseNumbersPropConfig as i, ValidationMap as l, DefaultCombinatorName as m, FullOperator as n, ValueSources as o, RuleGroupTypeIC as p, InputType as r, QueryValidator as s, FullField as t, ValidationResult as u, RuleType as v, OptionList as x, FlexibleOptionList as y };
|
|
1282
|
-
//# sourceMappingURL=basic-
|
|
1282
|
+
//# sourceMappingURL=basic-GFsWfi0Z.d.mts.map
|
|
@@ -567,9 +567,9 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
567
567
|
@category Type Guard
|
|
568
568
|
@category Utilities
|
|
569
569
|
*/
|
|
570
|
-
type IsEqual<A
|
|
570
|
+
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
571
571
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
572
|
-
type _IsEqual<A
|
|
572
|
+
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
573
573
|
//#endregion
|
|
574
574
|
//#region ../../node_modules/type-fest/source/omit-index-signature.d.ts
|
|
575
575
|
/**
|
|
@@ -963,7 +963,7 @@ const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
|
|
|
963
963
|
|
|
964
964
|
@category Object
|
|
965
965
|
*/
|
|
966
|
-
type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, If<IsNever<KeysType>, never, _RequireAtLeastOne<ObjectType, If<IsAny<KeysType>, keyof ObjectType, KeysType>>>>;
|
|
966
|
+
type RequireAtLeastOne$1<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, If<IsNever<KeysType>, never, _RequireAtLeastOne<ObjectType, If<IsAny<KeysType>, keyof ObjectType, KeysType>>>>;
|
|
967
967
|
type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = {
|
|
968
968
|
// For each `Key` in `KeysType` make a mapped type:
|
|
969
969
|
[Key in KeysType]-?: Required<Pick<ObjectType, Key>> &
|
|
@@ -1105,7 +1105,7 @@ type SetArrayRequired<TArray extends UnknownArray, Keys, Counter extends any[] =
|
|
|
1105
1105
|
: never; // Should never happen
|
|
1106
1106
|
//#endregion
|
|
1107
1107
|
//#region src/types/options.d.ts
|
|
1108
|
-
type RequireAtLeastOne
|
|
1108
|
+
type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = { [Key in KeysType]-?: Required<Pick<ObjectType, Key>> & Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] & Except<ObjectType, KeysType>;
|
|
1109
1109
|
type StringUnionToFlexibleOptionArray<Op extends string> = Array<Op extends unknown ? FlexibleOption<Op> : never>;
|
|
1110
1110
|
type StringUnionToFullOptionArray<Op extends string> = Array<Op extends unknown ? FullOption<Op> : never>;
|
|
1111
1111
|
/**
|
|
@@ -1120,7 +1120,7 @@ type GetOptionType<OL extends FlexibleOptionList<FullOption>> = OL extends Flexi
|
|
|
1120
1120
|
*
|
|
1121
1121
|
* @group Option Lists
|
|
1122
1122
|
*/
|
|
1123
|
-
type GetOptionIdentifierType<Opt
|
|
1123
|
+
type GetOptionIdentifierType<Opt extends BaseOption> = Opt extends Option<infer NameType> | ValueOption<infer NameType> ? NameType : string;
|
|
1124
1124
|
/**
|
|
1125
1125
|
* Adds an `unknown` index property to an interface.
|
|
1126
1126
|
*/
|
|
@@ -1162,14 +1162,14 @@ type ValueOption<N extends string = string> = Simplify<WithUnknownIndex<SetRequi
|
|
|
1162
1162
|
*
|
|
1163
1163
|
* @group Option Lists
|
|
1164
1164
|
*/
|
|
1165
|
-
type FlexibleOption<N extends string = string> = Simplify<WithUnknownIndex<RequireAtLeastOne
|
|
1165
|
+
type FlexibleOption<N extends string = string> = Simplify<WithUnknownIndex<RequireAtLeastOne<BaseOption<N>, "name" | "value">>>;
|
|
1166
1166
|
/**
|
|
1167
1167
|
* Utility type to turn an {@link Option}, {@link ValueOption}, or {@link BaseOption}
|
|
1168
1168
|
* into a {@link FlexibleOption}.
|
|
1169
1169
|
*
|
|
1170
1170
|
* @group Option Lists
|
|
1171
1171
|
*/
|
|
1172
|
-
type ToFlexibleOption<Opt
|
|
1172
|
+
type ToFlexibleOption<Opt extends BaseOption | string> = WithUnknownIndex<RequireAtLeastOne<Opt extends string ? FlexibleOption<Opt> : Opt, "name" | "value">>;
|
|
1173
1173
|
/**
|
|
1174
1174
|
* A generic {@link Option} requiring both `name` _and_ `value` properties.
|
|
1175
1175
|
* Props that extend {@link OptionList} accept {@link BaseOption}, but
|
|
@@ -1197,7 +1197,7 @@ type BaseFullOption<N extends string = string> = Simplify<SetRequired<BaseOption
|
|
|
1197
1197
|
*
|
|
1198
1198
|
* @group Option Lists
|
|
1199
1199
|
*/
|
|
1200
|
-
type ToFullOption<Opt
|
|
1200
|
+
type ToFullOption<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt : Opt extends BaseOption<infer IdentifierType> ? WithUnknownIndex<Opt & FullOption<IdentifierType>> : never;
|
|
1201
1201
|
/**
|
|
1202
1202
|
* @deprecated Renamed to {@link Option}.
|
|
1203
1203
|
*
|
|
@@ -1209,39 +1209,39 @@ type NameLabelPair<N extends string = string> = Option<N>;
|
|
|
1209
1209
|
*
|
|
1210
1210
|
* @group Option Lists
|
|
1211
1211
|
*/
|
|
1212
|
-
interface OptionGroup<Opt
|
|
1212
|
+
interface OptionGroup<Opt extends BaseOption = FlexibleOption> {
|
|
1213
1213
|
label: string;
|
|
1214
|
-
options: WithUnknownIndex<Opt
|
|
1214
|
+
options: WithUnknownIndex<Opt>[];
|
|
1215
1215
|
}
|
|
1216
1216
|
/**
|
|
1217
1217
|
* A group of {@link BaseOption}s, usually within a {@link FlexibleOptionList}.
|
|
1218
1218
|
*
|
|
1219
1219
|
* @group Option Lists
|
|
1220
1220
|
*/
|
|
1221
|
-
type FlexibleOptionGroup<Opt
|
|
1221
|
+
type FlexibleOptionGroup<Opt extends BaseOption | string = BaseOption> = {
|
|
1222
1222
|
label: string;
|
|
1223
|
-
options: (Opt
|
|
1223
|
+
options: (Opt extends BaseFullOption ? Opt : ToFlexibleOption<Opt>)[];
|
|
1224
1224
|
};
|
|
1225
1225
|
/**
|
|
1226
1226
|
* Either an array of {@link Option}s or an array of {@link OptionGroup}s.
|
|
1227
1227
|
*
|
|
1228
1228
|
* @group Option Lists
|
|
1229
1229
|
*/
|
|
1230
|
-
type OptionList<Opt
|
|
1230
|
+
type OptionList<Opt extends Option = Option> = Opt[] | OptionGroup<Opt>[];
|
|
1231
1231
|
/**
|
|
1232
1232
|
* An array of options or option groups, like {@link OptionList} but the option type
|
|
1233
1233
|
* may use either `name` or `value` as the primary identifier.
|
|
1234
1234
|
*
|
|
1235
1235
|
* @group Option Lists
|
|
1236
1236
|
*/
|
|
1237
|
-
type FlexibleOptionList<Opt
|
|
1237
|
+
type FlexibleOptionList<Opt extends BaseOption> = ToFlexibleOption<Opt>[] | FlexibleOptionGroup<ToFlexibleOption<Opt>>[];
|
|
1238
1238
|
/**
|
|
1239
1239
|
* An array of options or option groups, like {@link OptionList} but the option type
|
|
1240
1240
|
* may use either `name` or `value` as the primary identifier.
|
|
1241
1241
|
*
|
|
1242
1242
|
* @group Option Lists
|
|
1243
1243
|
*/
|
|
1244
|
-
type FlexibleOptionListProp<Opt
|
|
1244
|
+
type FlexibleOptionListProp<Opt extends BaseOption> = (ToFlexibleOption<Opt> | GetOptionIdentifierType<Opt>)[] | FlexibleOptionGroup<ToFlexibleOption<Opt> | GetOptionIdentifierType<Opt>>[];
|
|
1245
1245
|
/**
|
|
1246
1246
|
* An array of options or option groups, like {@link OptionList}, but using
|
|
1247
1247
|
* {@link FullOption} instead of {@link Option}. This means that every member is
|
|
@@ -1249,7 +1249,7 @@ type FlexibleOptionListProp<Opt$1 extends BaseOption> = (ToFlexibleOption<Opt$1>
|
|
|
1249
1249
|
*
|
|
1250
1250
|
* @group Option Lists
|
|
1251
1251
|
*/
|
|
1252
|
-
type FullOptionList<Opt
|
|
1252
|
+
type FullOptionList<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt[] | OptionGroup<Opt>[] : ToFullOption<Opt>[] | OptionGroup<ToFullOption<Opt>>[];
|
|
1253
1253
|
/**
|
|
1254
1254
|
* Map of option identifiers to their respective {@link Option}.
|
|
1255
1255
|
*
|
|
@@ -1317,7 +1317,7 @@ type RuleGroupArray<RG extends RuleGroupType = RuleGroupType, R extends RuleType
|
|
|
1317
1317
|
* All updateable properties of rules and groups (everything except
|
|
1318
1318
|
* `id`, `path`, and `rules`).
|
|
1319
1319
|
*/
|
|
1320
|
-
type UpdateableProperties = Exclude<keyof (RuleType & RuleGroupType), "id" | "path" | "rules"
|
|
1320
|
+
type UpdateableProperties = Exclude<keyof (RuleType & RuleGroupType), "id" | "path" | "rules"> | (string & {});
|
|
1321
1321
|
/**
|
|
1322
1322
|
* The type of the `rules` array in a {@link DefaultRuleGroupType}.
|
|
1323
1323
|
*/
|
|
@@ -3719,14 +3719,14 @@ declare const objectEntries: <Type extends Record<PropertyKey, unknown>>(value:
|
|
|
3719
3719
|
*
|
|
3720
3720
|
* @group Option Lists
|
|
3721
3721
|
*/
|
|
3722
|
-
declare function toFullOption<Opt
|
|
3722
|
+
declare function toFullOption<Opt extends BaseOption>(opt: Opt | string, baseProperties?: Record<string, unknown>, labelMap?: Record<string, unknown>): ToFullOption<Opt>;
|
|
3723
3723
|
/**
|
|
3724
3724
|
* Converts an {@link OptionList} or {@link FlexibleOptionList} into a {@link FullOptionList}.
|
|
3725
3725
|
* Lists of full options are left unchanged.
|
|
3726
3726
|
*
|
|
3727
3727
|
* @group Option Lists
|
|
3728
3728
|
*/
|
|
3729
|
-
declare function toFullOptionList<Opt
|
|
3729
|
+
declare function toFullOptionList<Opt extends BaseOption>(optList: unknown[], baseProperties?: Record<string, unknown>, labelMap?: Record<string, unknown>): FullOptionList<Opt>;
|
|
3730
3730
|
/**
|
|
3731
3731
|
* Converts a {@link FlexibleOptionList} into a {@link FullOptionList}.
|
|
3732
3732
|
* Lists of full options are left unchanged.
|
|
@@ -3752,7 +3752,7 @@ declare const uniqByName: <T extends {
|
|
|
3752
3752
|
*
|
|
3753
3753
|
* @group Option Lists
|
|
3754
3754
|
*/
|
|
3755
|
-
declare const uniqByIdentifier: <T extends RequireAtLeastOne<{
|
|
3755
|
+
declare const uniqByIdentifier: <T extends RequireAtLeastOne$1<{
|
|
3756
3756
|
name: string;
|
|
3757
3757
|
value: string;
|
|
3758
3758
|
}, "name" | "value">>(originalArray: T[]) => T[];
|
|
@@ -3808,9 +3808,9 @@ declare function getOption<OptType extends Option>(arr: FlexibleOptionList<OptTy
|
|
|
3808
3808
|
*
|
|
3809
3809
|
* @group Option Lists
|
|
3810
3810
|
*/
|
|
3811
|
-
declare function getFirstOption<Opt
|
|
3812
|
-
declare function getFirstOption<Opt
|
|
3813
|
-
declare function getFirstOption<Opt
|
|
3811
|
+
declare function getFirstOption<Opt extends FullOption>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
|
|
3812
|
+
declare function getFirstOption<Opt extends ValueOption>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
|
|
3813
|
+
declare function getFirstOption<Opt extends Option>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
|
|
3814
3814
|
/**
|
|
3815
3815
|
* Flattens {@link FlexibleOptionGroup} arrays into {@link BaseOption} arrays.
|
|
3816
3816
|
* If the array is already flat, it is returned as is.
|
|
@@ -2585,7 +2585,30 @@ const defaultRuleProcessorElasticSearch = (rule, options = {}) => {
|
|
|
2585
2585
|
const { field, operator, value, valueSource } = rule;
|
|
2586
2586
|
const { parseNumbers, preserveValueOrder } = options;
|
|
2587
2587
|
const operatorLC = lc(operator);
|
|
2588
|
-
|
|
2588
|
+
const matchEval = processMatchMode(rule);
|
|
2589
|
+
if (matchEval === false) return false;
|
|
2590
|
+
else if (matchEval) {
|
|
2591
|
+
const { mode } = matchEval;
|
|
2592
|
+
const subQuery = defaultRuleGroupProcessorElasticSearch(transformQuery(rule.value, { ruleProcessor: (r) => ({
|
|
2593
|
+
...r,
|
|
2594
|
+
field: r.field ? `${field}.${r.field}` : field
|
|
2595
|
+
}) }), options);
|
|
2596
|
+
if (Object.keys(subQuery).length === 0) return false;
|
|
2597
|
+
switch (mode) {
|
|
2598
|
+
case "some": return { nested: {
|
|
2599
|
+
path: field,
|
|
2600
|
+
query: subQuery
|
|
2601
|
+
} };
|
|
2602
|
+
case "none": return { bool: { must_not: { nested: {
|
|
2603
|
+
path: field,
|
|
2604
|
+
query: subQuery
|
|
2605
|
+
} } } };
|
|
2606
|
+
case "all":
|
|
2607
|
+
case "atleast":
|
|
2608
|
+
case "atmost":
|
|
2609
|
+
case "exactly": return false;
|
|
2610
|
+
}
|
|
2611
|
+
}
|
|
2589
2612
|
if (valueSource === "field") {
|
|
2590
2613
|
if (toArray(value).some((v) => typeof v !== "string")) return false;
|
|
2591
2614
|
const fieldForScript = escapeSQ(field);
|