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