@react-querybuilder/antd 8.10.0 → 8.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,27 +3,8 @@ import { ComponentPropsWithRef, ComponentPropsWithoutRef, ComponentType, Forward
3
3
  import { Button, Select, Switch } from "antd";
4
4
  import { HolderOutlined } from "@ant-design/icons";
5
5
 
6
- //#region ../../node_modules/type-fest/source/observable-like.d.ts
7
- declare global {
8
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
9
- interface SymbolConstructor {
10
- readonly observable: symbol;
11
- }
12
- }
13
-
14
- /**
15
- @remarks
16
- The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
17
- As well, some guidance on making an `Observable` to not include `closed` property.
18
- @see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
19
- @see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
20
- @see https://github.com/benlesh/symbol-observable#making-an-object-observable
21
-
22
- @category Observable
23
- */
24
-
25
- //#endregion
26
6
  //#region ../../node_modules/type-fest/source/union-to-intersection.d.ts
7
+
27
8
  /**
28
9
  Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
29
10
 
@@ -82,7 +63,7 @@ Union extends unknown
82
63
  // Infer the `Intersection` type since TypeScript represents the positional
83
64
  // arguments of unions of functions as an intersection of the union.
84
65
  ) extends ((mergedIntersection: infer Intersection) => void)
85
- // The `& Union` is to allow indexing by the resulting type
66
+ // The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`
86
67
  ? Intersection & Union : never;
87
68
  //#endregion
88
69
  //#region ../../node_modules/type-fest/source/keys-of-union.d.ts
@@ -127,6 +108,80 @@ type KeysOfUnion<ObjectType> =
127
108
  // Hack to fix https://github.com/sindresorhus/type-fest/issues/1008
128
109
  keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;
129
110
  //#endregion
111
+ //#region ../../node_modules/type-fest/source/is-any.d.ts
112
+ /**
113
+ Returns a boolean for whether the given type is `any`.
114
+
115
+ @link https://stackoverflow.com/a/49928360/1490091
116
+
117
+ Useful in type utilities, such as disallowing `any`s to be passed to a function.
118
+
119
+ @example
120
+ ```
121
+ import type {IsAny} from 'type-fest';
122
+
123
+ const typedObject = {a: 1, b: 2} as const;
124
+ const anyObject: any = {a: 1, b: 2};
125
+
126
+ function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
127
+ return obj[key];
128
+ }
129
+
130
+ const typedA = get(typedObject, 'a');
131
+ //=> 1
132
+
133
+ const anyA = get(anyObject, 'a');
134
+ //=> any
135
+ ```
136
+
137
+ @category Type Guard
138
+ @category Utilities
139
+ */
140
+ type IsAny<T$1> = 0 extends 1 & NoInfer<T$1> ? true : false;
141
+ //#endregion
142
+ //#region ../../node_modules/type-fest/source/is-optional-key-of.d.ts
143
+ /**
144
+ Returns a boolean for whether the given key is an optional key of type.
145
+
146
+ This is useful when writing utility types or schema validators that need to differentiate `optional` keys.
147
+
148
+ @example
149
+ ```
150
+ import type {IsOptionalKeyOf} from 'type-fest';
151
+
152
+ interface User {
153
+ name: string;
154
+ surname: string;
155
+
156
+ luckyNumber?: number;
157
+ }
158
+
159
+ interface Admin {
160
+ name: string;
161
+ surname?: string;
162
+ }
163
+
164
+ type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
165
+ //=> true
166
+
167
+ type T2 = IsOptionalKeyOf<User, 'name'>;
168
+ //=> false
169
+
170
+ type T3 = IsOptionalKeyOf<User, 'name' | 'luckyNumber'>;
171
+ //=> boolean
172
+
173
+ type T4 = IsOptionalKeyOf<User | Admin, 'name'>;
174
+ //=> false
175
+
176
+ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
177
+ //=> boolean
178
+ ```
179
+
180
+ @category Type Guard
181
+ @category Utilities
182
+ */
183
+ type IsOptionalKeyOf<Type extends object, Key$1 extends keyof Type> = IsAny<Type | Key$1> extends true ? never : Key$1 extends keyof Type ? Type extends Record<Key$1, Type[Key$1]> ? false : true : false;
184
+ //#endregion
130
185
  //#region ../../node_modules/type-fest/source/optional-keys-of.d.ts
131
186
  /**
132
187
  Extract all optional keys from the given type.
@@ -161,8 +216,8 @@ const update2: UpdateOperation<User> = {
161
216
 
162
217
  @category Utilities
163
218
  */
164
- type OptionalKeysOf<BaseType extends object> = BaseType extends unknown // For distributing `BaseType`
165
- ? (keyof { [Key in keyof BaseType as BaseType extends Record<Key, BaseType[Key]> ? never : Key]: never }) & (keyof BaseType) // Intersect with `keyof BaseType` to ensure result of `OptionalKeysOf<BaseType>` is always assignable to `keyof BaseType`
219
+ type OptionalKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
220
+ ? (keyof { [Key in keyof Type as IsOptionalKeyOf<Type, Key> extends false ? never : Key]: never }) & keyof Type // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
166
221
  : never;
167
222
  //#endregion
168
223
  //#region ../../node_modules/type-fest/source/required-keys-of.d.ts
@@ -190,8 +245,8 @@ const validator2 = createValidation<User>('surname', value => value.length < 25)
190
245
 
191
246
  @category Utilities
192
247
  */
193
- type RequiredKeysOf<BaseType extends object> = BaseType extends unknown // For distributing `BaseType`
194
- ? Exclude<keyof BaseType, OptionalKeysOf<BaseType>> : never;
248
+ type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
249
+ ? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
195
250
  //#endregion
196
251
  //#region ../../node_modules/type-fest/source/is-never.d.ts
197
252
  /**
@@ -235,29 +290,67 @@ endIfEqual('abc', '123');
235
290
  @category Type Guard
236
291
  @category Utilities
237
292
  */
238
- type IsNever<T> = [T] extends [never] ? true : false;
293
+ type IsNever<T$1> = [T$1] extends [never] ? true : false;
239
294
  //#endregion
240
- //#region ../../node_modules/type-fest/source/if-never.d.ts
295
+ //#region ../../node_modules/type-fest/source/if.d.ts
241
296
  /**
242
- An if-else-like type that resolves depending on whether the given type is `never`.
297
+ An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
243
298
 
244
- @see {@link IsNever}
299
+ Use-cases:
300
+ - You can use this in combination with `Is*` types to create an if-else-like experience. For example, `If<IsAny<any>, 'is any', 'not any'>`.
301
+
302
+ Note:
303
+ - Returns a union of if branch and else branch if the given type is `boolean` or `any`. For example, `If<boolean, 'Y', 'N'>` will return `'Y' | 'N'`.
304
+ - Returns the else branch if the given type is `never`. For example, `If<never, 'Y', 'N'>` will return `'N'`.
245
305
 
246
306
  @example
247
307
  ```
248
- import type {IfNever} from 'type-fest';
308
+ import {If} from 'type-fest';
249
309
 
250
- type ShouldBeTrue = IfNever<never>;
251
- //=> true
310
+ type A = If<true, 'yes', 'no'>;
311
+ //=> 'yes'
252
312
 
253
- type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
254
- //=> 'bar'
313
+ type B = If<false, 'yes', 'no'>;
314
+ //=> 'no'
315
+
316
+ type C = If<boolean, 'yes', 'no'>;
317
+ //=> 'yes' | 'no'
318
+
319
+ type D = If<any, 'yes', 'no'>;
320
+ //=> 'yes' | 'no'
321
+
322
+ type E = If<never, 'yes', 'no'>;
323
+ //=> 'no'
324
+ ```
325
+
326
+ @example
327
+ ```
328
+ import {If, IsAny, IsNever} from 'type-fest';
329
+
330
+ type A = If<IsAny<unknown>, 'is any', 'not any'>;
331
+ //=> 'not any'
332
+
333
+ type B = If<IsNever<never>, 'is never', 'not never'>;
334
+ //=> 'is never'
335
+ ```
336
+
337
+ @example
338
+ ```
339
+ import {If, IsEqual} from 'type-fest';
340
+
341
+ type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
342
+
343
+ type A = IfEqual<string, string, 'equal', 'not equal'>;
344
+ //=> 'equal'
345
+
346
+ type B = IfEqual<string, number, 'equal', 'not equal'>;
347
+ //=> 'not equal'
255
348
  ```
256
349
 
257
350
  @category Type Guard
258
351
  @category Utilities
259
352
  */
260
- type IfNever$1<T, TypeIfNever = true, TypeIfNotNever = false> = (IsNever<T> extends true ? TypeIfNever : TypeIfNotNever);
353
+ type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
261
354
  //#endregion
262
355
  //#region ../../node_modules/type-fest/source/unknown-array.d.ts
263
356
  /**
@@ -291,99 +384,7 @@ type UnknownArray = readonly unknown[];
291
384
  /**
292
385
  Returns whether the given array `T` is readonly.
293
386
  */
294
- type IsArrayReadonly<T extends UnknownArray> = IfNever$1<T, false, T extends unknown[] ? false : true>;
295
- /**
296
- An if-else-like type that resolves depending on whether the given array is readonly.
297
-
298
- @see {@link IsArrayReadonly}
299
-
300
- @example
301
- ```
302
- import type {ArrayTail} from 'type-fest';
303
-
304
- type ReadonlyPreservingArrayTail<TArray extends readonly unknown[]> =
305
- ArrayTail<TArray> extends infer Tail
306
- ? IfArrayReadonly<TArray, Readonly<Tail>, Tail>
307
- : never;
308
-
309
- type ReadonlyTail = ReadonlyPreservingArrayTail<readonly [string, number, boolean]>;
310
- //=> readonly [number, boolean]
311
-
312
- type NonReadonlyTail = ReadonlyPreservingArrayTail<[string, number, boolean]>;
313
- //=> [number, boolean]
314
-
315
- type ShouldBeTrue = IfArrayReadonly<readonly unknown[]>;
316
- //=> true
317
-
318
- type ShouldBeBar = IfArrayReadonly<unknown[], 'foo', 'bar'>;
319
- //=> 'bar'
320
- ```
321
- */
322
- type IfArrayReadonly<T extends UnknownArray, TypeIfArrayReadonly = true, TypeIfNotArrayReadonly = false> = IsArrayReadonly<T> extends infer Result ? Result extends true ? TypeIfArrayReadonly : TypeIfNotArrayReadonly : never;
323
- //#endregion
324
- //#region ../../node_modules/type-fest/source/is-any.d.ts
325
- // Can eventually be replaced with the built-in once this library supports
326
- // TS5.4+ only. Tracked in https://github.com/sindresorhus/type-fest/issues/848
327
- type NoInfer<T> = T extends infer U ? U : never;
328
-
329
- /**
330
- Returns a boolean for whether the given type is `any`.
331
-
332
- @link https://stackoverflow.com/a/49928360/1490091
333
-
334
- Useful in type utilities, such as disallowing `any`s to be passed to a function.
335
-
336
- @example
337
- ```
338
- import type {IsAny} from 'type-fest';
339
-
340
- const typedObject = {a: 1, b: 2} as const;
341
- const anyObject: any = {a: 1, b: 2};
342
-
343
- function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
344
- return obj[key];
345
- }
346
-
347
- const typedA = get(typedObject, 'a');
348
- //=> 1
349
-
350
- const anyA = get(anyObject, 'a');
351
- //=> any
352
- ```
353
-
354
- @category Type Guard
355
- @category Utilities
356
- */
357
- type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
358
- //#endregion
359
- //#region ../../node_modules/type-fest/source/is-equal.d.ts
360
- /**
361
- Returns a boolean for whether the two given types are equal.
362
-
363
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
364
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
365
-
366
- Use-cases:
367
- - If you want to make a conditional branch based on the result of a comparison of two types.
368
-
369
- @example
370
- ```
371
- import type {IsEqual} from 'type-fest';
372
-
373
- // This type returns a boolean for whether the given array includes the given item.
374
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
375
- type Includes<Value extends readonly any[], Item> =
376
- Value extends readonly [Value[0], ...infer rest]
377
- ? IsEqual<Value[0], Item> extends true
378
- ? true
379
- : Includes<rest, Item>
380
- : false;
381
- ```
382
-
383
- @category Type Guard
384
- @category Utilities
385
- */
386
- type IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
387
+ type IsArrayReadonly<T$1 extends UnknownArray> = If<IsNever<T$1>, false, T$1 extends unknown[] ? false : true>;
387
388
  //#endregion
388
389
  //#region ../../node_modules/type-fest/source/simplify.d.ts
389
390
  /**
@@ -443,7 +444,38 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
443
444
  @see SimplifyDeep
444
445
  @category Object
445
446
  */
446
- type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
447
+ type Simplify<T$1> = { [KeyType in keyof T$1]: T$1[KeyType] } & {};
448
+ //#endregion
449
+ //#region ../../node_modules/type-fest/source/is-equal.d.ts
450
+ /**
451
+ Returns a boolean for whether the two given types are equal.
452
+
453
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
454
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
455
+
456
+ Use-cases:
457
+ - If you want to make a conditional branch based on the result of a comparison of two types.
458
+
459
+ @example
460
+ ```
461
+ import type {IsEqual} from 'type-fest';
462
+
463
+ // This type returns a boolean for whether the given array includes the given item.
464
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
465
+ type Includes<Value extends readonly any[], Item> =
466
+ Value extends readonly [Value[0], ...infer rest]
467
+ ? IsEqual<Value[0], Item> extends true
468
+ ? true
469
+ : Includes<rest, Item>
470
+ : false;
471
+ ```
472
+
473
+ @category Type Guard
474
+ @category Utilities
475
+ */
476
+ type IsEqual<A, B> = [A, B] extends [infer AA, infer BB] ? [AA] extends [never] ? [BB] extends [never] ? true : false : [BB] extends [never] ? false : _IsEqual<AA, BB> : false;
477
+ // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
478
+ type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
447
479
  //#endregion
448
480
  //#region ../../node_modules/type-fest/source/omit-index-signature.d.ts
449
481
  /**
@@ -626,51 +658,6 @@ export type FooBar = Merge<Foo, Bar>;
626
658
  */
627
659
  type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
628
660
  //#endregion
629
- //#region ../../node_modules/type-fest/source/if-any.d.ts
630
- /**
631
- An if-else-like type that resolves depending on whether the given type is `any`.
632
-
633
- @see {@link IsAny}
634
-
635
- @example
636
- ```
637
- import type {IfAny} from 'type-fest';
638
-
639
- type ShouldBeTrue = IfAny<any>;
640
- //=> true
641
-
642
- type ShouldBeBar = IfAny<'not any', 'foo', 'bar'>;
643
- //=> 'bar'
644
- ```
645
-
646
- @category Type Guard
647
- @category Utilities
648
- */
649
- type IfAny$1<T, TypeIfAny = true, TypeIfNotAny = false> = (IsAny<T> extends true ? TypeIfAny : TypeIfNotAny);
650
- //#endregion
651
- //#region ../../node_modules/type-fest/source/internal/type.d.ts
652
- // Should never happen
653
-
654
- /**
655
- An if-else-like type that resolves depending on whether the given type is `any` or `never`.
656
-
657
- @example
658
- ```
659
- // When `T` is a NOT `any` or `never` (like `string`) => Returns `IfNotAnyOrNever` branch
660
- type A = IfNotAnyOrNever<string, 'VALID', 'IS_ANY', 'IS_NEVER'>;
661
- //=> 'VALID'
662
-
663
- // When `T` is `any` => Returns `IfAny` branch
664
- type B = IfNotAnyOrNever<any, 'VALID', 'IS_ANY', 'IS_NEVER'>;
665
- //=> 'IS_ANY'
666
-
667
- // When `T` is `never` => Returns `IfNever` branch
668
- type C = IfNotAnyOrNever<never, 'VALID', 'IS_ANY', 'IS_NEVER'>;
669
- //=> 'IS_NEVER'
670
- ```
671
- */
672
- type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = IsAny<T> extends true ? IfAny : IsNever<T> extends true ? IfNever : IfNotAnyOrNever;
673
- //#endregion
674
661
  //#region ../../node_modules/type-fest/source/internal/object.d.ts
675
662
  /**
676
663
  Works similar to the built-in `Pick` utility type, except for the following differences:
@@ -709,7 +696,7 @@ type Any = HomomorphicPick<{a: 1; b: 2} | {c: 3}, any>;
709
696
  type IndexSignature = HomomorphicPick<{[k: string]: unknown}, number>;
710
697
  //=> {}
711
698
  */
712
- type HomomorphicPick<T, Keys extends KeysOfUnion<T>> = { [P in keyof T as Extract<P, Keys>]: T[P] };
699
+ type HomomorphicPick<T$1, Keys extends KeysOfUnion<T$1>> = { [P in keyof T$1 as Extract<P, Keys>]: T$1[P] };
713
700
  /**
714
701
  Merges user specified options with default options.
715
702
 
@@ -762,8 +749,7 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
762
749
  // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
763
750
  ```
764
751
  */
765
- type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = IfAny$1<SpecifiedOptions, Defaults, IfNever$1<SpecifiedOptions, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? Extract<SpecifiedOptions[Key], undefined> extends never ? Key : never : Key]: SpecifiedOptions[Key] }> & Required<Options>> // `& Required<Options>` ensures that `ApplyDefaultOptions<SomeOption, ...>` is always assignable to `Required<SomeOption>`
766
- >>;
752
+ type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required<Options>>>>;
767
753
  //#endregion
768
754
  //#region ../../node_modules/type-fest/source/except.d.ts
769
755
  /**
@@ -793,7 +779,7 @@ type Filtered = Filter<'bar', 'foo'>;
793
779
 
794
780
  @see {Except}
795
781
  */
796
- type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
782
+ type Filter<KeyType$1, ExcludeType> = IsEqual<KeyType$1, ExcludeType> extends true ? never : (KeyType$1 extends ExcludeType ? never : KeyType$1);
797
783
  type ExceptOptions = {
798
784
  /**
799
785
  Disallow assigning non-specified properties.
@@ -862,38 +848,6 @@ type PostPayload = Except<UserData, 'email'>;
862
848
  type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
863
849
  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>> : {});
864
850
  //#endregion
865
- //#region ../../node_modules/type-fest/source/require-at-least-one.d.ts
866
- /**
867
- Create a type that requires at least one of the given keys. The remaining keys are kept as is.
868
-
869
- @example
870
- ```
871
- import type {RequireAtLeastOne} from 'type-fest';
872
-
873
- type Responder = {
874
- text?: () => string;
875
- json?: () => string;
876
- secure?: boolean;
877
- };
878
-
879
- const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
880
- json: () => '{"message": "ok"}',
881
- secure: true
882
- };
883
- ```
884
-
885
- @category Object
886
- */
887
- type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, IfNever$1<KeysType, never, _RequireAtLeastOne<ObjectType, IfAny$1<KeysType, keyof ObjectType, KeysType>>>>;
888
- type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = {
889
- // For each `Key` in `KeysType` make a mapped type:
890
- [Key in KeysType]-?: Required<Pick<ObjectType, Key>> &
891
- // 1. Make `Key`'s type required
892
- // 2. Make all other keys in `KeysType` optional
893
- Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] &
894
- // 3. Add the remaining keys not in `KeysType`
895
- Except<ObjectType, KeysType>;
896
- //#endregion
897
851
  //#region ../../node_modules/type-fest/source/set-required.d.ts
898
852
  /**
899
853
  Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type.
@@ -924,11 +878,13 @@ type ArrayExample = SetRequired<[number?, number?, number?], 0 | 1>;
924
878
 
925
879
  @category Object
926
880
  */
927
- type SetRequired<BaseType, Keys extends keyof BaseType> = BaseType extends UnknownArray ? SetArrayRequired<BaseType, Keys> extends infer ResultantArray ? IfArrayReadonly<BaseType, Readonly<ResultantArray>, ResultantArray> : never : Simplify<
881
+ type SetRequired<BaseType, Keys extends keyof BaseType> = (BaseType extends ((...arguments_: never) => any) ? (...arguments_: Parameters<BaseType>) => ReturnType<BaseType> : unknown) & _SetRequired<BaseType, Keys>;
882
+ type _SetRequired<BaseType, Keys extends keyof BaseType> = BaseType extends UnknownArray ? SetArrayRequired<BaseType, Keys> extends infer ResultantArray ? If<IsArrayReadonly<BaseType>, Readonly<ResultantArray>, ResultantArray> : never : Simplify<
928
883
  // Pick just the keys that are optional from the base type.
929
884
  Except<BaseType, Keys> &
930
885
  // Pick the keys that should be required from the base type and make them required.
931
886
  Required<HomomorphicPick<BaseType, Keys>>>;
887
+
932
888
  /**
933
889
  Remove the optional modifier from the specified keys in an array.
934
890
  */
@@ -982,6 +938,7 @@ type AllNonNullable = SetNonNullable<Foo>;
982
938
  type SetNonNullable<BaseType, Keys extends keyof BaseType = keyof BaseType> = { [Key in keyof BaseType]: Key extends Keys ? NonNullable<BaseType[Key]> : BaseType[Key] };
983
939
  //#endregion
984
940
  //#region ../core/src/types/options.d.ts
941
+ type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = { [Key in KeysType]-?: Required<Pick<ObjectType, Key>> & Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] & Except<ObjectType, KeysType>;
985
942
  type StringUnionToFullOptionArray<Op extends string> = Array<Op extends unknown ? FullOption<Op> : never>;
986
943
  /**
987
944
  * Extracts the type of the identifying property from a {@link Option},
@@ -989,11 +946,11 @@ type StringUnionToFullOptionArray<Op extends string> = Array<Op extends unknown
989
946
  *
990
947
  * @group Option Lists
991
948
  */
992
- type GetOptionIdentifierType<Opt extends BaseOption> = Opt extends Option<infer NameType> | ValueOption<infer NameType> ? NameType : string;
949
+ type GetOptionIdentifierType<Opt$1 extends BaseOption> = Opt$1 extends Option<infer NameType> | ValueOption<infer NameType> ? NameType : string;
993
950
  /**
994
951
  * Adds an `unknown` index property to an interface.
995
952
  */
996
- type WithUnknownIndex<T> = T & {
953
+ type WithUnknownIndex<T$1> = T$1 & {
997
954
  [key: string]: unknown;
998
955
  };
999
956
  /**
@@ -1025,8 +982,8 @@ type Option<N extends string = string> = Simplify<WithUnknownIndex<SetRequired<B
1025
982
  type ValueOption<N extends string = string> = Simplify<WithUnknownIndex<SetRequired<BaseOption<N>, "value">>>;
1026
983
  /**
1027
984
  * A generic {@link Option} with either a `name` or `value` as its primary identifier.
1028
- * {@link OptionList}-type props on the {@link QueryBuilder} component accept this type,
1029
- * but corresponding props passed down to subcomponents will always be translated
985
+ * {@link OptionList}-type props on the {@link react-querybuilder!QueryBuilder QueryBuilder} component accept this type,
986
+ * but corresponding props passed down to subcomponents will always be augmented
1030
987
  * to {@link FullOption} first.
1031
988
  *
1032
989
  * @group Option Lists
@@ -1038,11 +995,11 @@ type FlexibleOption<N extends string = string> = Simplify<WithUnknownIndex<Requi
1038
995
  *
1039
996
  * @group Option Lists
1040
997
  */
1041
- type ToFlexibleOption<Opt extends BaseOption | string> = WithUnknownIndex<RequireAtLeastOne<Opt extends string ? FlexibleOption<Opt> : Opt, "name" | "value">>;
998
+ type ToFlexibleOption<Opt$1 extends BaseOption | string> = WithUnknownIndex<RequireAtLeastOne<Opt$1 extends string ? FlexibleOption<Opt$1> : Opt$1, "name" | "value">>;
1042
999
  /**
1043
1000
  * A generic {@link Option} requiring both `name` _and_ `value` properties.
1044
1001
  * Props that extend {@link OptionList} accept {@link BaseOption}, but
1045
- * corresponding props sent to subcomponents will always be translated to this
1002
+ * corresponding props sent to subcomponents will always be augmented to this
1046
1003
  * type first to ensure both `name` and `value` are available.
1047
1004
  *
1048
1005
  * NOTE: Do not extend from this type directly. Use {@link BaseFullOption}
@@ -1066,45 +1023,45 @@ type BaseFullOption<N extends string = string> = Simplify<SetRequired<BaseOption
1066
1023
  *
1067
1024
  * @group Option Lists
1068
1025
  */
1069
- type ToFullOption<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt : Opt extends BaseOption<infer IdentifierType> ? WithUnknownIndex<Opt & FullOption<IdentifierType>> : never;
1026
+ type ToFullOption<Opt$1 extends BaseOption> = Opt$1 extends BaseFullOption ? Opt$1 : Opt$1 extends BaseOption<infer IdentifierType> ? WithUnknownIndex<Opt$1 & FullOption<IdentifierType>> : never;
1070
1027
  /**
1071
1028
  * A group of {@link Option}s, usually within an {@link OptionList}.
1072
1029
  *
1073
1030
  * @group Option Lists
1074
1031
  */
1075
- interface OptionGroup<Opt extends BaseOption = FlexibleOption> {
1032
+ interface OptionGroup<Opt$1 extends BaseOption = FlexibleOption> {
1076
1033
  label: string;
1077
- options: WithUnknownIndex<Opt>[];
1034
+ options: WithUnknownIndex<Opt$1>[];
1078
1035
  }
1079
1036
  /**
1080
1037
  * A group of {@link BaseOption}s, usually within a {@link FlexibleOptionList}.
1081
1038
  *
1082
1039
  * @group Option Lists
1083
1040
  */
1084
- type FlexibleOptionGroup<Opt extends BaseOption | string = BaseOption> = {
1041
+ type FlexibleOptionGroup<Opt$1 extends BaseOption | string = BaseOption> = {
1085
1042
  label: string;
1086
- options: (Opt extends BaseFullOption ? Opt : ToFlexibleOption<Opt>)[];
1043
+ options: (Opt$1 extends BaseFullOption ? Opt$1 : ToFlexibleOption<Opt$1>)[];
1087
1044
  };
1088
1045
  /**
1089
1046
  * Either an array of {@link Option}s or an array of {@link OptionGroup}s.
1090
1047
  *
1091
1048
  * @group Option Lists
1092
1049
  */
1093
- type OptionList<Opt extends Option = Option> = Opt[] | OptionGroup<Opt>[];
1050
+ type OptionList<Opt$1 extends Option = Option> = Opt$1[] | OptionGroup<Opt$1>[];
1094
1051
  /**
1095
1052
  * An array of options or option groups, like {@link OptionList} but the option type
1096
1053
  * may use either `name` or `value` as the primary identifier.
1097
1054
  *
1098
1055
  * @group Option Lists
1099
1056
  */
1100
- type FlexibleOptionList<Opt extends BaseOption> = ToFlexibleOption<Opt>[] | FlexibleOptionGroup<ToFlexibleOption<Opt>>[];
1057
+ type FlexibleOptionList<Opt$1 extends BaseOption> = ToFlexibleOption<Opt$1>[] | FlexibleOptionGroup<ToFlexibleOption<Opt$1>>[];
1101
1058
  /**
1102
1059
  * An array of options or option groups, like {@link OptionList} but the option type
1103
1060
  * may use either `name` or `value` as the primary identifier.
1104
1061
  *
1105
1062
  * @group Option Lists
1106
1063
  */
1107
- type FlexibleOptionListProp<Opt extends BaseOption> = (ToFlexibleOption<Opt> | GetOptionIdentifierType<Opt>)[] | FlexibleOptionGroup<ToFlexibleOption<Opt> | GetOptionIdentifierType<Opt>>[];
1064
+ type FlexibleOptionListProp<Opt$1 extends BaseOption> = (ToFlexibleOption<Opt$1> | GetOptionIdentifierType<Opt$1>)[] | FlexibleOptionGroup<ToFlexibleOption<Opt$1> | GetOptionIdentifierType<Opt$1>>[];
1108
1065
  /**
1109
1066
  * An array of options or option groups, like {@link OptionList}, but using
1110
1067
  * {@link FullOption} instead of {@link Option}. This means that every member is
@@ -1112,13 +1069,13 @@ type FlexibleOptionListProp<Opt extends BaseOption> = (ToFlexibleOption<Opt> | G
1112
1069
  *
1113
1070
  * @group Option Lists
1114
1071
  */
1115
- type FullOptionList<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt[] | OptionGroup<Opt>[] : ToFullOption<Opt>[] | OptionGroup<ToFullOption<Opt>>[];
1072
+ type FullOptionList<Opt$1 extends BaseOption> = Opt$1 extends BaseFullOption ? Opt$1[] | OptionGroup<Opt$1>[] : ToFullOption<Opt$1>[] | OptionGroup<ToFullOption<Opt$1>>[];
1116
1073
  /**
1117
1074
  * Map of option identifiers to their respective {@link Option}.
1118
1075
  *
1119
1076
  * @group Option Lists
1120
1077
  */
1121
- type BaseOptionMap<V extends BaseOption = BaseOption, K extends string = GetOptionIdentifierType<V>> = { [k in K]?: ToFlexibleOption<V> };
1078
+ type BaseOptionMap<V$1 extends BaseOption = BaseOption, K$1 extends string = GetOptionIdentifierType<V$1>> = { [k in K$1]?: ToFlexibleOption<V$1> };
1122
1079
  //#endregion
1123
1080
  //#region ../core/src/types/ruleGroups.d.ts
1124
1081
  /**
@@ -1139,10 +1096,10 @@ interface CommonRuleAndGroupProperties {
1139
1096
  * The main rule type. The `field`, `operator`, and `value` properties
1140
1097
  * can be narrowed with generics.
1141
1098
  */
1142
- interface RuleType<F extends string = string, O extends string = string, V = any, C extends string = string> extends CommonRuleAndGroupProperties {
1099
+ interface RuleType<F extends string = string, O extends string = string, V$1 = any, C extends string = string> extends CommonRuleAndGroupProperties {
1143
1100
  field: F;
1144
1101
  operator: O;
1145
- value: V;
1102
+ value: V$1;
1146
1103
  valueSource?: ValueSource;
1147
1104
  match?: MatchConfig;
1148
1105
  /**
@@ -1154,15 +1111,15 @@ interface RuleType<F extends string = string, O extends string = string, V = any
1154
1111
  * The main rule group type. This type is used for query definitions as well as
1155
1112
  * all sub-groups of queries.
1156
1113
  */
1157
- interface RuleGroupType<R extends RuleType = RuleType, C extends string = string> extends CommonRuleAndGroupProperties {
1114
+ interface RuleGroupType<R$1 extends RuleType = RuleType, C extends string = string> extends CommonRuleAndGroupProperties {
1158
1115
  combinator: C;
1159
- rules: RuleGroupArray<RuleGroupType<R, C>, R>;
1116
+ rules: RuleGroupArray<RuleGroupType<R$1, C>, R$1>;
1160
1117
  not?: boolean;
1161
1118
  }
1162
1119
  /**
1163
1120
  * The type of the `rules` array in a {@link RuleGroupType}.
1164
1121
  */
1165
- type RuleGroupArray<RG extends RuleGroupType = RuleGroupType, R extends RuleType = RuleType> = (R | RG)[];
1122
+ type RuleGroupArray<RG$1 extends RuleGroupType = RuleGroupType, R$1 extends RuleType = RuleType> = (R$1 | RG$1)[];
1166
1123
  //#endregion
1167
1124
  //#region ../core/src/types/ruleGroupsIC.utils.d.ts
1168
1125
  type MAXIMUM_ALLOWED_BOUNDARY = 80;
@@ -1173,9 +1130,9 @@ type MappedTuple<Tuple extends Array<unknown>, Result extends Array<unknown> = [
1173
1130
  * The main rule group interface when using independent combinators. This type is used
1174
1131
  * for query definitions as well as all sub-groups of queries.
1175
1132
  */
1176
- interface RuleGroupTypeIC<R extends RuleType = RuleType, C extends string = string> extends Except<RuleGroupType<R, C>, "combinator" | "rules"> {
1133
+ interface RuleGroupTypeIC<R$1 extends RuleType = RuleType, C extends string = string> extends Except<RuleGroupType<R$1, C>, "combinator" | "rules"> {
1177
1134
  combinator?: undefined;
1178
- rules: RuleGroupICArray<RuleGroupTypeIC<R, C>, R, C>;
1135
+ rules: RuleGroupICArray<RuleGroupTypeIC<R$1, C>, R$1, C>;
1179
1136
  /**
1180
1137
  * Only used when adding a rule to a query that uses independent combinators
1181
1138
  */
@@ -1184,11 +1141,11 @@ interface RuleGroupTypeIC<R extends RuleType = RuleType, C extends string = stri
1184
1141
  /**
1185
1142
  * Shorthand for "either {@link RuleGroupType} or {@link RuleGroupTypeIC}".
1186
1143
  */
1187
- type RuleGroupTypeAny<R extends RuleType = RuleType, C extends string = string> = RuleGroupType<R, C> | RuleGroupTypeIC<R, C>;
1144
+ type RuleGroupTypeAny<R$1 extends RuleType = RuleType, C extends string = string> = RuleGroupType<R$1, C> | RuleGroupTypeIC<R$1, C>;
1188
1145
  /**
1189
1146
  * The type of the `rules` array in a {@link RuleGroupTypeIC}.
1190
1147
  */
1191
- type RuleGroupICArray<RG extends RuleGroupTypeIC = RuleGroupTypeIC, R extends RuleType = RuleType, C extends string = string> = [R | RG] | [R | RG, ...MappedTuple<[C, R | RG]>] | ((R | RG)[] & {
1148
+ type RuleGroupICArray<RG$1 extends RuleGroupTypeIC = RuleGroupTypeIC, R$1 extends RuleType = RuleType, C extends string = string> = [R$1 | RG$1] | [R$1 | RG$1, ...MappedTuple<[C, R$1 | RG$1]>] | ((R$1 | RG$1)[] & {
1192
1149
  length: 0;
1193
1150
  });
1194
1151
  /**
@@ -1198,7 +1155,7 @@ type RuleOrGroupArray = RuleGroupArray | RuleGroupICArray;
1198
1155
  /**
1199
1156
  * Converts a narrowed rule group type to its most generic form.
1200
1157
  */
1201
- type GenericizeRuleGroupType<RG> = RG extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
1158
+ type GenericizeRuleGroupType<RG$1> = RG$1 extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
1202
1159
  //#endregion
1203
1160
  //#region ../core/src/types/validation.d.ts
1204
1161
  /**
@@ -1237,7 +1194,7 @@ type Classname = string | string[] | Record<string, any>;
1237
1194
  */
1238
1195
  type ValueSource = "value" | "field";
1239
1196
  /**
1240
- * Type of {@link ValueEditor} that will be displayed.
1197
+ * Type of {@link react-querybuilder!ValueEditor ValueEditor} that will be displayed.
1241
1198
  */
1242
1199
  type ValueEditorType = "text" | "select" | "checkbox" | "radio" | "textarea" | "switch" | "multiselect" | null;
1243
1200
  /**
@@ -1254,7 +1211,7 @@ type ToOptionArrays<Sources extends readonly string[]> = Sources extends unknown
1254
1211
  label: string;
1255
1212
  } } : never;
1256
1213
  type ToFlexibleOptionArrays<Sources extends readonly string[]> = Sources extends unknown ? { [K in keyof Sources]: FlexibleOption<Sources[K]> } : never;
1257
- type WithOptionalClassName<T> = T & {
1214
+ type WithOptionalClassName<T$1> = T$1 & {
1258
1215
  className?: Classname;
1259
1216
  };
1260
1217
  /**
@@ -1280,24 +1237,24 @@ type ValueChangeEventHandler = (value?: any, context?: any) => void;
1280
1237
  /**
1281
1238
  * Base for all Field types/interfaces.
1282
1239
  */
1283
- interface BaseFullField<FieldName extends string = string, OperatorName extends string = string, ValueName extends string = string, OperatorObj extends FullOption = FullOption<OperatorName>, ValueObj extends FullOption = FullOption<ValueName>> extends WithOptionalClassName<BaseFullOption<FieldName>> {
1240
+ interface BaseFullField<FieldName extends string = string, OperatorName$1 extends string = string, ValueName extends string = string, OperatorObj extends FullOption = FullOption<OperatorName$1>, ValueObj extends FullOption = FullOption<ValueName>> extends WithOptionalClassName<BaseFullOption<FieldName>> {
1284
1241
  id?: string;
1285
- operators?: FlexibleOptionList<OperatorObj> | OperatorName[] | FlexibleOption<OperatorName>[] | (OperatorName | FlexibleOption<OperatorName>)[];
1286
- valueEditorType?: ValueEditorType | ((operator: OperatorName) => ValueEditorType);
1287
- valueSources?: ValueSources | ValueSourceFlexibleOptions | ((operator: OperatorName) => ValueSources | ValueSourceFlexibleOptions);
1242
+ operators?: FlexibleOptionList<OperatorObj> | OperatorName$1[] | FlexibleOption<OperatorName$1>[] | (OperatorName$1 | FlexibleOption<OperatorName$1>)[];
1243
+ valueEditorType?: ValueEditorType | ((operator: OperatorName$1) => ValueEditorType);
1244
+ valueSources?: ValueSources | ValueSourceFlexibleOptions | ((operator: OperatorName$1) => ValueSources | ValueSourceFlexibleOptions);
1288
1245
  inputType?: InputType | null;
1289
1246
  values?: FlexibleOptionList<ValueObj>;
1290
1247
  matchModes?: boolean | MatchMode[] | FlexibleOption<MatchMode>[];
1291
1248
  /** Properties of items in the value. */
1292
1249
  subproperties?: FlexibleOptionList<FullField>;
1293
- defaultOperator?: OperatorName;
1250
+ defaultOperator?: OperatorName$1;
1294
1251
  defaultValue?: any;
1295
1252
  placeholder?: string;
1296
1253
  validator?: RuleValidator;
1297
1254
  comparator?: string | ((f: FullField, operator: string) => boolean);
1298
1255
  }
1299
1256
  /**
1300
- * Full field definition used in the `fields` prop of {@link QueryBuilder}.
1257
+ * Full field definition used in the `fields` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
1301
1258
  * This type requires both `name` and `value`, but the `fields` prop itself
1302
1259
  * can use a {@link FlexibleOption} where only one of `name` or `value` is
1303
1260
  * required (along with `label`), or {@link Field} where only `name` and
@@ -1308,15 +1265,15 @@ interface BaseFullField<FieldName extends string = string, OperatorName extends
1308
1265
  *
1309
1266
  * @group Option Lists
1310
1267
  */
1311
- 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>>;
1268
+ type FullField<FieldName extends string = string, OperatorName$1 extends string = string, ValueName extends string = string, OperatorObj extends FullOption = FullOption<OperatorName$1>, ValueObj extends FullOption = FullOption<ValueName>> = Simplify<FullOption<FieldName> & BaseFullField<FieldName, OperatorName$1, ValueName, OperatorObj, ValueObj>>;
1312
1269
  /**
1313
1270
  * Allowed values of the {@link FullOperator} property `arity`. A value of `"unary"` or
1314
- * a number less than two will cause the default {@link ValueEditor} to render `null`.
1271
+ * a number less than two will cause the default {@link react-querybuilder!ValueEditor ValueEditor} to render `null`.
1315
1272
  */
1316
1273
  type Arity = number | "unary" | "binary" | "ternary";
1317
1274
  /**
1318
1275
  * Full operator definition used in the `operators`/`getOperators` props of
1319
- * {@link QueryBuilder}. This type requires both `name` and `value`, but the
1276
+ * {@link react-querybuilder!QueryBuilder QueryBuilder}. This type requires both `name` and `value`, but the
1320
1277
  * `operators`/`getOperators` props themselves can use a {@link FlexibleOption}
1321
1278
  * where only one of `name` or `value` is required, or {@link FullOperator} where
1322
1279
  * only `name` is required.
@@ -1329,7 +1286,7 @@ interface FullOperator<N extends string = string> extends WithOptionalClassName<
1329
1286
  arity?: Arity;
1330
1287
  }
1331
1288
  /**
1332
- * Full combinator definition used in the `combinators` prop of {@link QueryBuilder}.
1289
+ * Full combinator definition used in the `combinators` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
1333
1290
  * This type requires both `name` and `value`, but the `combinators` prop itself
1334
1291
  * can use a {@link FlexibleOption} where only one of `name` or `value` is required,
1335
1292
  * or {@link Combinator} where only `name` is required.
@@ -1346,12 +1303,12 @@ type ParseNumberMethodName = "enhanced" | "native" | "strict";
1346
1303
 
1347
1304
  type ParseNumbersModerationLevel = "-limited" | "";
1348
1305
  /**
1349
- * Options for the `parseNumbers` prop of {@link QueryBuilder}.
1306
+ * Options for the `parseNumbers` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
1350
1307
  */
1351
1308
  type ParseNumbersPropConfig = boolean | `${ParseNumberMethodName}${ParseNumbersModerationLevel}`;
1352
1309
  /**
1353
- * Signature of `accessibleDescriptionGenerator` prop, used by {@link QueryBuilder} to generate
1354
- * accessible descriptions for each {@link RuleGroup}.
1310
+ * Signature of `accessibleDescriptionGenerator` prop, used by {@link react-querybuilder!QueryBuilder QueryBuilder} to generate
1311
+ * accessible descriptions for each {@link react-querybuilder!RuleGroup RuleGroup}.
1355
1312
  */
1356
1313
  type AccessibleDescriptionGenerator = (props: {
1357
1314
  path: Path;
@@ -1361,7 +1318,7 @@ type AccessibleDescriptionGenerator = (props: {
1361
1318
  //#region ../core/src/types/dnd.d.ts
1362
1319
  type DropEffect = "move" | "copy";
1363
1320
  //#endregion
1364
- //#region ../core/src/types/props.d.ts
1321
+ //#region ../core/src/types/queryBuilder.d.ts
1365
1322
  /**
1366
1323
  * Base interface for all rule subcomponents.
1367
1324
  *
@@ -1631,6 +1588,113 @@ interface QueryActions {
1631
1588
  moveRule(oldPath: Path, newPath: Path | "up" | "down", clone?: boolean, context?: any): void;
1632
1589
  groupRule(sourcePath: Path, targetPath: Path, clone?: boolean, context?: any): void;
1633
1590
  }
1591
+ interface QueryBuilderFlags {
1592
+ /**
1593
+ * Set to `false` to avoid calling the `onQueryChange` callback
1594
+ * when the component mounts.
1595
+ *
1596
+ * @default true
1597
+ */
1598
+ enableMountQueryChange?: boolean;
1599
+ /**
1600
+ * Enables drag-and-drop features.
1601
+ *
1602
+ * @default false
1603
+ */
1604
+ enableDragAndDrop?: boolean;
1605
+ /**
1606
+ * Enables debug logging for query builders (and React DnD when applicable).
1607
+ *
1608
+ * @default false
1609
+ */
1610
+ debugMode?: boolean;
1611
+ /**
1612
+ * Show group combinator selectors in the body of the group, between each child rule/group,
1613
+ * instead of in the group header.
1614
+ *
1615
+ * @default false
1616
+ */
1617
+ showCombinatorsBetweenRules?: boolean;
1618
+ /**
1619
+ * Show the "not" (aka inversion) toggle for rule groups.
1620
+ *
1621
+ * @default false
1622
+ */
1623
+ showNotToggle?: boolean;
1624
+ /**
1625
+ * Show the "Shift up"/"Shift down" actions.
1626
+ *
1627
+ * @default false
1628
+ */
1629
+ showShiftActions?: boolean;
1630
+ /**
1631
+ * Show the "Clone rule" and "Clone group" buttons.
1632
+ *
1633
+ * @default false
1634
+ */
1635
+ showCloneButtons?: boolean;
1636
+ /**
1637
+ * Show the "Lock rule" and "Lock group" buttons.
1638
+ *
1639
+ * @default false
1640
+ */
1641
+ showLockButtons?: boolean;
1642
+ /**
1643
+ * Show the "Mute rule" and "Mute group" buttons.
1644
+ *
1645
+ * @default false
1646
+ */
1647
+ showMuteButtons?: boolean;
1648
+ /**
1649
+ * Reset the `operator` and `value` when the `field` changes.
1650
+ *
1651
+ * @default true
1652
+ */
1653
+ resetOnFieldChange?: boolean;
1654
+ /**
1655
+ * Reset the `value` when the `operator` changes.
1656
+ *
1657
+ * @default false
1658
+ */
1659
+ resetOnOperatorChange?: boolean;
1660
+ /**
1661
+ * Select the first field in the array automatically.
1662
+ *
1663
+ * @default true
1664
+ */
1665
+ autoSelectField?: boolean;
1666
+ /**
1667
+ * Select the first operator in the array automatically.
1668
+ *
1669
+ * @default true
1670
+ */
1671
+ autoSelectOperator?: boolean;
1672
+ /**
1673
+ * Select the first value in the array automatically. Only applicable when the value editor renders a select list.
1674
+ *
1675
+ * @default false
1676
+ */
1677
+ autoSelectValue?: boolean;
1678
+ /**
1679
+ * Adds a new default rule automatically to each new group.
1680
+ *
1681
+ * @default false
1682
+ */
1683
+ addRuleToNewGroups?: boolean;
1684
+ /**
1685
+ * Store list-type values as native arrays instead of comma-separated strings.
1686
+ *
1687
+ * @default false
1688
+ */
1689
+ listsAsArrays?: boolean;
1690
+ /**
1691
+ * Prevent _any_ assignment of standard classes to elements. This includes conditional
1692
+ * and event-based classes for validation, drag-and-drop, etc.
1693
+ *
1694
+ * @default false
1695
+ */
1696
+ suppressStandardClassnames?: boolean;
1697
+ }
1634
1698
  //#endregion
1635
1699
  //#region ../core/src/utils/queryTools.d.ts
1636
1700
  /**
@@ -2305,19 +2369,12 @@ interface RuleProps<F extends string = string, O extends string = string> extend
2305
2369
  *
2306
2370
  * @group Props
2307
2371
  */
2308
- interface QueryBuilderContextProps<F extends FullField, O extends string> {
2372
+ interface QueryBuilderContextProps<F extends FullField = FullField, O extends string = string> extends QueryBuilderFlags {
2309
2373
  /**
2310
2374
  * Defines replacement components.
2311
2375
  */
2312
2376
  controlElements?: ControlElementsProp<F, O>;
2313
2377
  /**
2314
- * Set to `false` to avoid calling the `onQueryChange` callback
2315
- * when the component mounts.
2316
- *
2317
- * @default true
2318
- */
2319
- enableMountQueryChange?: boolean;
2320
- /**
2321
2378
  * This can be used to assign specific CSS classes to various controls
2322
2379
  * that are rendered by {@link QueryBuilder}.
2323
2380
  */
@@ -2327,23 +2384,11 @@ interface QueryBuilderContextProps<F extends FullField, O extends string> {
2327
2384
  * controls that are rendered by {@link QueryBuilder}.
2328
2385
  */
2329
2386
  translations?: Partial<Translations>;
2330
- /**
2331
- * Enables drag-and-drop features.
2332
- *
2333
- * @default false
2334
- */
2335
- enableDragAndDrop?: boolean;
2336
- /**
2337
- * Enables debug logging for {@link QueryBuilder} (and React DnD when applicable).
2338
- *
2339
- * @default false
2340
- */
2341
- debugMode?: boolean;
2342
2387
  }
2343
2388
  /**
2344
2389
  * @group Props
2345
2390
  */
2346
- interface QueryBuilderContextProviderProps extends QueryBuilderContextProps<FullField, string> {
2391
+ interface QueryBuilderContextProviderProps extends QueryBuilderContextProps {
2347
2392
  children?: ReactNode;
2348
2393
  }
2349
2394
  /**
@@ -2367,15 +2412,15 @@ type QueryBuilderContextProvider<ExtraProps extends object = Record<string, any>
2367
2412
  *
2368
2413
  * @group Props
2369
2414
  */
2370
- type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O extends FullOperator, C extends FullCombinator> = RG extends RuleGroupType<infer R> | RuleGroupTypeIC<infer R> ? QueryBuilderContextProps<F, GetOptionIdentifierType<O>> & {
2415
+ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O extends FullOperator, C extends FullCombinator> = RG$1 extends RuleGroupType<infer R> | RuleGroupTypeIC<infer R> ? QueryBuilderContextProps<F, GetOptionIdentifierType<O>> & {
2371
2416
  /**
2372
2417
  * Initial query object for uncontrolled components.
2373
2418
  */
2374
- defaultQuery?: RG;
2419
+ defaultQuery?: RG$1;
2375
2420
  /**
2376
2421
  * Query object for controlled components.
2377
2422
  */
2378
- query?: RG;
2423
+ query?: RG$1;
2379
2424
  /**
2380
2425
  * List of valid {@link FullField}s.
2381
2426
  *
@@ -2527,7 +2572,7 @@ type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O exten
2527
2572
  */
2528
2573
  getSubQueryBuilderProps?(field: GetOptionIdentifierType<F>, misc: {
2529
2574
  fieldData: F;
2530
- }): QueryBuilderProps<GenericizeRuleGroupType<RG>, FullOption, FullOption, FullOption>;
2575
+ }): QueryBuilderProps<GenericizeRuleGroupType<RG$1>, FullOption, FullOption, FullOption>;
2531
2576
  /**
2532
2577
  * The return value of this function will be used to apply classnames to the
2533
2578
  * outer `<div>` of the given {@link Rule}.
@@ -2539,56 +2584,56 @@ type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O exten
2539
2584
  * The return value of this function will be used to apply classnames to the
2540
2585
  * outer `<div>` of the given {@link RuleGroup}.
2541
2586
  */
2542
- getRuleGroupClassname?(ruleGroup: RG): Classname;
2587
+ getRuleGroupClassname?(ruleGroup: RG$1): Classname;
2543
2588
  /**
2544
2589
  * This callback is invoked before a new rule is added. The function should either manipulate
2545
2590
  * the rule and return the new object, return `true` to allow the addition to proceed as normal,
2546
2591
  * or return `false` to cancel the addition of the rule.
2547
2592
  */
2548
- onAddRule?(rule: R, parentPath: Path, query: RG, context?: any): RuleType | boolean;
2593
+ onAddRule?(rule: R, parentPath: Path, query: RG$1, context?: any): RuleType | boolean;
2549
2594
  /**
2550
2595
  * This callback is invoked before a new group is added. The function should either manipulate
2551
2596
  * the group and return the new object, return `true` to allow the addition to proceed as normal,
2552
2597
  * or return `false` to cancel the addition of the group.
2553
2598
  */
2554
- onAddGroup?(ruleGroup: RG, parentPath: Path, query: RG, context?: any): RG | boolean;
2599
+ onAddGroup?(ruleGroup: RG$1, parentPath: Path, query: RG$1, context?: any): RG$1 | boolean;
2555
2600
  /**
2556
2601
  * This callback is invoked before a rule is moved or shifted. The function should return
2557
2602
  * `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
2558
2603
  * a new query object (presumably based on `query` or `nextQuery`) which will become the new
2559
2604
  * query state.
2560
2605
  */
2561
- onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
2606
+ onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG$1, nextQuery: RG$1, options: MoveOptions, context?: any): RG$1 | boolean;
2562
2607
  /**
2563
2608
  * This callback is invoked before a group is moved or shifted. The function should return
2564
2609
  * `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
2565
2610
  * a new query object (presumably based on `query` or `nextQuery`) which will become the new
2566
2611
  * query state.
2567
2612
  */
2568
- onMoveGroup?(ruleGroup: RG, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
2613
+ onMoveGroup?(ruleGroup: RG$1, fromPath: Path, toPath: Path | "up" | "down", query: RG$1, nextQuery: RG$1, options: MoveOptions, context?: any): RG$1 | boolean;
2569
2614
  /**
2570
2615
  * This callback is invoked before a rule is grouped with another object. The function should
2571
2616
  * return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
2572
2617
  * or a new query object (presumably based on `query` or `nextQuery`) which will become the new
2573
2618
  * query state.
2574
2619
  */
2575
- onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
2620
+ onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG$1, nextQuery: RG$1, options: GroupOptions, context?: any): RG$1 | boolean;
2576
2621
  /**
2577
2622
  * This callback is invoked before a group is grouped with another object. The function should
2578
2623
  * return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
2579
2624
  * or a new query object (presumably based on `query` or `nextQuery`) which will become the new
2580
2625
  * query state.
2581
2626
  */
2582
- onGroupGroup?(ruleGroup: RG, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
2627
+ onGroupGroup?(ruleGroup: RG$1, fromPath: Path, toPath: Path, query: RG$1, nextQuery: RG$1, options: GroupOptions, context?: any): RG$1 | boolean;
2583
2628
  /**
2584
2629
  * This callback is invoked before a rule or group is removed. The function should return
2585
2630
  * `true` if the rule or group should be removed or `false` if it should not be removed.
2586
2631
  */
2587
- onRemove?(ruleOrGroup: R | RG, path: Path, query: RG, context?: any): boolean;
2632
+ onRemove?(ruleOrGroup: R | RG$1, path: Path, query: RG$1, context?: any): boolean;
2588
2633
  /**
2589
2634
  * This callback is invoked anytime the query state is updated.
2590
2635
  */
2591
- onQueryChange?(query: RG): void;
2636
+ onQueryChange?(query: RG$1): void;
2592
2637
  /**
2593
2638
  * Each log object will be passed to this function when `debugMode` is `true`.
2594
2639
  *
@@ -2596,90 +2641,20 @@ type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O exten
2596
2641
  */
2597
2642
  onLog?(obj: any): void;
2598
2643
  /**
2599
- * Show group combinator selectors in the body of the group, between each child rule/group,
2600
- * instead of in the group header.
2601
- *
2602
- * @default false
2603
- */
2604
- showCombinatorsBetweenRules?: boolean;
2605
- /**
2606
2644
  * @deprecated As of v7, this prop is ignored. To enable independent combinators, use
2607
2645
  * {@link RuleGroupTypeIC} for the `query` or `defaultQuery` prop. The query builder
2608
2646
  * will detect the query type and behave accordingly.
2609
2647
  */
2610
2648
  independentCombinators?: boolean;
2611
2649
  /**
2612
- * Show the "not" (aka inversion) toggle for rule groups.
2613
- *
2614
- * @default false
2615
- */
2616
- showNotToggle?: boolean;
2617
- /**
2618
- * Show the "Shift up"/"Shift down" actions.
2619
- *
2620
- * @default false
2621
- */
2622
- showShiftActions?: boolean;
2623
- /**
2624
- * Show the "Clone rule" and "Clone group" buttons.
2625
- *
2626
- * @default false
2627
- */
2628
- showCloneButtons?: boolean;
2629
- /**
2630
- * Show the "Lock rule" and "Lock group" buttons.
2631
- *
2632
- * @default false
2633
- */
2634
- showLockButtons?: boolean;
2635
- /**
2636
- * Show the "Mute rule" and "Mute group" buttons.
2637
- *
2638
- * @default false
2639
- */
2640
- showMuteButtons?: boolean;
2641
- /**
2642
- * Reset the `operator` and `value` when the `field` changes.
2643
- *
2644
- * @default true
2645
- */
2646
- resetOnFieldChange?: boolean;
2647
- /**
2648
- * Reset the `value` when the `operator` changes.
2649
- *
2650
- * @default false
2651
- */
2652
- resetOnOperatorChange?: boolean;
2653
- /**
2654
- * Select the first field in the array automatically.
2655
- *
2656
- * @default true
2657
- */
2658
- autoSelectField?: boolean;
2659
- /**
2660
- * Select the first operator in the array automatically.
2661
- *
2662
- * @default true
2663
- */
2664
- autoSelectOperator?: boolean;
2665
- /**
2666
- * Select the first value in the array automatically. Only applicable when the value editor renders a select list.
2667
- *
2668
- * @default false
2669
- */
2670
- autoSelectValue?: boolean;
2671
- /**
2672
- * Adds a new default rule automatically to each new group.
2673
- *
2674
- * @default false
2675
- */
2676
- addRuleToNewGroups?: boolean;
2677
- /**
2678
- * Store list-type values as native arrays instead of comma-separated strings.
2650
+ * Disables the entire query builder if true, or the rules and groups at
2651
+ * the specified paths (as well as all child rules/groups and subcomponents)
2652
+ * if an array of paths is provided. If the root path is specified (`disabled={[[]]}`),
2653
+ * no changes to the query are allowed.
2679
2654
  *
2680
2655
  * @default false
2681
2656
  */
2682
- listsAsArrays?: boolean;
2657
+ disabled?: boolean | Path[];
2683
2658
  /**
2684
2659
  * Store values as numbers whenever possible.
2685
2660
  *
@@ -2705,15 +2680,6 @@ type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O exten
2705
2680
  */
2706
2681
  parseNumbers?: ParseNumbersPropConfig;
2707
2682
  /**
2708
- * Disables the entire query builder if true, or the rules and groups at
2709
- * the specified paths (as well as all child rules/groups and subcomponents)
2710
- * if an array of paths is provided. If the root path is specified (`disabled={[[]]}`),
2711
- * no changes to the query are allowed.
2712
- *
2713
- * @default false
2714
- */
2715
- disabled?: boolean | Path[];
2716
- /**
2717
2683
  * Query validation function.
2718
2684
  */
2719
2685
  validator?: QueryValidator;
@@ -2730,11 +2696,6 @@ type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O exten
2730
2696
  */
2731
2697
  accessibleDescriptionGenerator?: AccessibleDescriptionGenerator;
2732
2698
  /**
2733
- * Prevent _any_ assignment of standard classes to elements. This includes conditional
2734
- * and event-based classes for validation, drag-and-drop, etc.
2735
- */
2736
- suppressStandardClassnames?: boolean;
2737
- /**
2738
2699
  * Maximum number of levels deep the query is allowed to go. The minimum is 1; values
2739
2700
  * less than 1 will be ignored.
2740
2701
  */
@@ -2746,7 +2707,7 @@ type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O exten
2746
2707
  } : never;
2747
2708
  //#endregion
2748
2709
  //#region src/AntDActionElement.d.ts
2749
- type RemoveDataIndexKeys<T> = { [K in keyof T as `data-${string}` extends K ? never : K]: T[K] };
2710
+ type RemoveDataIndexKeys<T$1> = { [K in keyof T$1 as `data-${string}` extends K ? never : K]: T$1[K] };
2750
2711
  /**
2751
2712
  * @group Props
2752
2713
  */