@react-querybuilder/core 8.12.0 → 8.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/{basic-o1-sYjK6.d.ts → basic-Cw014pDc.d.mts} +85 -95
  2. package/dist/{basic-DbvrfPNz.d.mts → basic-_KlsCAyT.d.ts} +85 -95
  3. package/dist/{chunk-BxBTb9qk.js → chunk-U64pC571.js} +13 -11
  4. package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +97 -96
  5. package/dist/cjs/react-querybuilder_core.cjs.development.js +15 -9
  6. package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
  7. package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +97 -96
  8. package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -1
  9. package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
  10. package/dist/{convertQuery-Cj4t-LT4.mjs → convertQuery-DAj92cbM.mjs} +3 -3
  11. package/dist/{convertQuery-Cj4t-LT4.mjs.map → convertQuery-DAj92cbM.mjs.map} +1 -1
  12. package/dist/{convertQuery-DuY_BJHy.js → convertQuery-DRldbzhZ.js} +4 -4
  13. package/dist/{convertQuery-DuY_BJHy.js.map → convertQuery-DRldbzhZ.js.map} +1 -1
  14. package/dist/{export-CCULKoP4.d.mts → export-CffjLxEe.d.mts} +2 -2
  15. package/dist/{export-WDHFbiPz.d.ts → export-DRA8O1Wz.d.ts} +2 -2
  16. package/dist/formatQuery.d.mts +2 -2
  17. package/dist/formatQuery.d.ts +2 -2
  18. package/dist/formatQuery.js +19 -13
  19. package/dist/formatQuery.js.map +1 -1
  20. package/dist/formatQuery.mjs +18 -12
  21. package/dist/formatQuery.mjs.map +1 -1
  22. package/dist/{import-BSWb9Vgd.d.ts → import-CWYJkN_w.d.ts} +2 -2
  23. package/dist/{import-CLyHpgk8.d.mts → import-DjHGaGhJ.d.mts} +2 -2
  24. package/dist/{isRuleGroup-Do9KKsmt.js → isRuleGroup-Cjk1Q2mj.js} +2 -2
  25. package/dist/{isRuleGroup-Do9KKsmt.js.map → isRuleGroup-Cjk1Q2mj.js.map} +1 -1
  26. package/dist/{isRuleGroup-BcfwGaIN.mjs → isRuleGroup-DztIOOKa.mjs} +1 -1
  27. package/dist/{isRuleGroup-BcfwGaIN.mjs.map → isRuleGroup-DztIOOKa.mjs.map} +1 -1
  28. package/dist/parseCEL.d.mts +2 -2
  29. package/dist/parseCEL.d.ts +2 -2
  30. package/dist/parseCEL.js +4 -4
  31. package/dist/parseCEL.js.map +1 -1
  32. package/dist/parseCEL.mjs +3 -3
  33. package/dist/parseCEL.mjs.map +1 -1
  34. package/dist/parseJSONata.d.mts +2 -2
  35. package/dist/parseJSONata.d.ts +2 -2
  36. package/dist/parseJSONata.js +12 -6
  37. package/dist/parseJSONata.js.map +1 -1
  38. package/dist/parseJSONata.mjs +3 -3
  39. package/dist/parseJsonLogic.d.mts +3 -3
  40. package/dist/parseJsonLogic.d.ts +3 -3
  41. package/dist/parseJsonLogic.js +4 -4
  42. package/dist/parseJsonLogic.mjs +4 -4
  43. package/dist/parseMongoDB.d.mts +2 -2
  44. package/dist/parseMongoDB.d.ts +2 -2
  45. package/dist/parseMongoDB.js +5 -5
  46. package/dist/parseMongoDB.js.map +1 -1
  47. package/dist/parseMongoDB.mjs +5 -5
  48. package/dist/parseMongoDB.mjs.map +1 -1
  49. package/dist/parseSQL.d.mts +2 -2
  50. package/dist/parseSQL.d.ts +2 -2
  51. package/dist/parseSQL.js +4 -4
  52. package/dist/parseSQL.mjs +3 -3
  53. package/dist/parseSpEL.d.mts +2 -2
  54. package/dist/parseSpEL.d.ts +2 -2
  55. package/dist/parseSpEL.js +58 -7
  56. package/dist/parseSpEL.js.map +1 -1
  57. package/dist/parseSpEL.mjs +3 -3
  58. package/dist/{prepareQueryObjects-BfnyRV5t.mjs → prepareQueryObjects-6Bxx4Bs1.mjs} +3 -3
  59. package/dist/{prepareQueryObjects-BfnyRV5t.mjs.map → prepareQueryObjects-6Bxx4Bs1.mjs.map} +1 -1
  60. package/dist/{prepareQueryObjects-DCtJJrF5.js → prepareQueryObjects-CkN0bTKm.js} +4 -4
  61. package/dist/{prepareQueryObjects-DCtJJrF5.js.map → prepareQueryObjects-CkN0bTKm.js.map} +1 -1
  62. package/dist/react-querybuilder_core.d.mts +97 -96
  63. package/dist/react-querybuilder_core.legacy-esm.d.ts +97 -96
  64. package/dist/react-querybuilder_core.legacy-esm.js +21 -15
  65. package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
  66. package/dist/react-querybuilder_core.mjs +15 -9
  67. package/dist/react-querybuilder_core.mjs.map +1 -1
  68. package/dist/react-querybuilder_core.production.d.mts +97 -96
  69. package/dist/react-querybuilder_core.production.mjs +1 -1
  70. package/dist/react-querybuilder_core.production.mjs.map +1 -1
  71. package/dist/{transformQuery-DvJTAvkh.js → transformQuery-ClBRfnFg.js} +3 -3
  72. package/dist/{transformQuery-DvJTAvkh.js.map → transformQuery-ClBRfnFg.js.map} +1 -1
  73. package/dist/{transformQuery-Bq4iyYsE.mjs → transformQuery-DUpbpqjX.mjs} +2 -2
  74. package/dist/{transformQuery-Bq4iyYsE.mjs.map → transformQuery-DUpbpqjX.mjs.map} +1 -1
  75. package/dist/transformQuery.d.mts +1 -1
  76. package/dist/transformQuery.d.ts +1 -1
  77. package/dist/transformQuery.js +2 -2
  78. package/dist/transformQuery.mjs +2 -2
  79. package/dist/{utils-CoYbYnVo.js → utils-CR1ToTMW.js} +3 -3
  80. package/dist/{utils-CoYbYnVo.js.map → utils-CR1ToTMW.js.map} +1 -1
  81. package/dist/{utils-DxH23QtE.mjs → utils-nQU7WCM9.mjs} +2 -2
  82. package/dist/{utils-DxH23QtE.mjs.map → utils-nQU7WCM9.mjs.map} +1 -1
  83. package/package.json +9 -8
  84. package/dist/chunk-DrjzjjTJ.mjs +0 -23
  85. package/dist/chunk-Dv2ph0Ay.js +0 -23
@@ -26,34 +26,6 @@ type Intersection = UnionToIntersection<Union>;
26
26
  //=> {the(): void; great(arg: string): void; escape: boolean};
27
27
  ```
28
28
 
29
- A more applicable example which could make its way into your library code follows.
30
-
31
- @example
32
- ```
33
- import type {UnionToIntersection} from 'type-fest';
34
-
35
- class CommandOne {
36
- commands: {
37
- a1: () => undefined,
38
- b1: () => undefined,
39
- }
40
- }
41
-
42
- class CommandTwo {
43
- commands: {
44
- a2: (argA: string) => undefined,
45
- b2: (argB: string) => undefined,
46
- }
47
- }
48
-
49
- const union = [new CommandOne(), new CommandTwo()].map(instance => instance.commands);
50
- type Union = typeof union;
51
- //=> {a1(): void; b1(): void} | {a2(argA: string): void; b2(argB: string): void}
52
-
53
- type Intersection = UnionToIntersection<Union>;
54
- //=> {a1(): void; b1(): void; a2(argA: string): void; b2(argB: string): void}
55
- ```
56
-
57
29
  @category Type
58
30
  */
59
31
  type UnionToIntersection<Union> = (
@@ -129,8 +101,8 @@ import type {IsAny} from 'type-fest';
129
101
  const typedObject = {a: 1, b: 2} as const;
130
102
  const anyObject: any = {a: 1, b: 2};
131
103
 
132
- function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
133
- return obj[key];
104
+ function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(object: O, key: K) {
105
+ return object[key];
134
106
  }
135
107
 
136
108
  const typedA = get(typedObject, 'a');
@@ -155,17 +127,17 @@ This is useful when writing utility types or schema validators that need to diff
155
127
  ```
156
128
  import type {IsOptionalKeyOf} from 'type-fest';
157
129
 
158
- interface User {
130
+ type User = {
159
131
  name: string;
160
132
  surname: string;
161
133
 
162
134
  luckyNumber?: number;
163
- }
135
+ };
164
136
 
165
- interface Admin {
137
+ type Admin = {
166
138
  name: string;
167
139
  surname?: string;
168
- }
140
+ };
169
141
 
170
142
  type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
171
143
  //=> true
@@ -198,12 +170,12 @@ This is useful when you want to create a new type that contains different type v
198
170
  ```
199
171
  import type {OptionalKeysOf, Except} from 'type-fest';
200
172
 
201
- interface User {
173
+ type User = {
202
174
  name: string;
203
175
  surname: string;
204
176
 
205
177
  luckyNumber?: number;
206
- }
178
+ };
207
179
 
208
180
  const REMOVE_FIELD = Symbol('remove field symbol');
209
181
  type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
@@ -211,12 +183,12 @@ type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKe
211
183
  };
212
184
 
213
185
  const update1: UpdateOperation<User> = {
214
- name: 'Alice'
186
+ name: 'Alice',
215
187
  };
216
188
 
217
189
  const update2: UpdateOperation<User> = {
218
190
  name: 'Bob',
219
- luckyNumber: REMOVE_FIELD
191
+ luckyNumber: REMOVE_FIELD,
220
192
  };
221
193
  ```
222
194
 
@@ -236,17 +208,23 @@ This is useful when you want to create a new type that contains different type v
236
208
  ```
237
209
  import type {RequiredKeysOf} from 'type-fest';
238
210
 
239
- declare function createValidation<Entity extends object, Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>>(field: Key, validator: (value: Entity[Key]) => boolean): ValidatorFn;
211
+ declare function createValidation<
212
+ Entity extends object,
213
+ Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
214
+ >(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
240
215
 
241
- interface User {
216
+ type User = {
242
217
  name: string;
243
218
  surname: string;
244
-
245
219
  luckyNumber?: number;
246
- }
220
+ };
247
221
 
248
222
  const validator1 = createValidation<User>('name', value => value.length < 25);
249
223
  const validator2 = createValidation<User>('surname', value => value.length < 25);
224
+
225
+ // @ts-expect-error
226
+ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
227
+ // Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
250
228
  ```
251
229
 
252
230
  @category Utilities
@@ -268,29 +246,41 @@ Useful in type utilities, such as checking if something does not occur.
268
246
  ```
269
247
  import type {IsNever, And} from 'type-fest';
270
248
 
271
- // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
272
- type AreStringsEqual<A extends string, B extends string> =
273
- And<
274
- IsNever<Exclude<A, B>> extends true ? true : false,
275
- IsNever<Exclude<B, A>> extends true ? true : false
276
- >;
277
-
278
- type EndIfEqual<I extends string, O extends string> =
279
- AreStringsEqual<I, O> extends true
280
- ? never
281
- : void;
282
-
283
- function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
284
- if (input === output) {
285
- process.exit(0);
286
- }
287
- }
249
+ type A = IsNever<never>;
250
+ //=> true
288
251
 
289
- endIfEqual('abc', 'abc');
290
- //=> never
252
+ type B = IsNever<any>;
253
+ //=> false
254
+
255
+ type C = IsNever<unknown>;
256
+ //=> false
257
+
258
+ type D = IsNever<never[]>;
259
+ //=> false
260
+
261
+ type E = IsNever<object>;
262
+ //=> false
263
+
264
+ type F = IsNever<string>;
265
+ //=> false
266
+ ```
291
267
 
292
- endIfEqual('abc', '123');
293
- //=> void
268
+ @example
269
+ ```
270
+ import type {IsNever} from 'type-fest';
271
+
272
+ type IsTrue<T> = T extends true ? true : false;
273
+
274
+ // When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
275
+ type A = IsTrue<never>;
276
+ // ^? type A = never
277
+
278
+ // If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
279
+ type IsTrueFixed<T> =
280
+ IsNever<T> extends true ? false : T extends true ? true : false;
281
+
282
+ type B = IsTrueFixed<never>;
283
+ // ^? type B = false
294
284
  ```
295
285
 
296
286
  @category Type Guard
@@ -311,7 +301,7 @@ Note:
311
301
 
312
302
  @example
313
303
  ```
314
- import {If} from 'type-fest';
304
+ import type {If} from 'type-fest';
315
305
 
316
306
  type A = If<true, 'yes', 'no'>;
317
307
  //=> 'yes'
@@ -331,7 +321,7 @@ type E = If<never, 'yes', 'no'>;
331
321
 
332
322
  @example
333
323
  ```
334
- import {If, IsAny, IsNever} from 'type-fest';
324
+ import type {If, IsAny, IsNever} from 'type-fest';
335
325
 
336
326
  type A = If<IsAny<unknown>, 'is any', 'not any'>;
337
327
  //=> 'not any'
@@ -342,7 +332,7 @@ type B = If<IsNever<never>, 'is never', 'not never'>;
342
332
 
343
333
  @example
344
334
  ```
345
- import {If, IsEqual} from 'type-fest';
335
+ import type {If, IsEqual} from 'type-fest';
346
336
 
347
337
  type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
348
338
 
@@ -535,10 +525,11 @@ const literal = {foo: 123, bar: 'hello', baz: 456};
535
525
  const someType: SomeType = literal;
536
526
  const someInterface: SomeInterface = literal;
537
527
 
538
- function fn(object: Record<string, unknown>): void {}
528
+ declare function fn(object: Record<string, unknown>): void;
539
529
 
540
530
  fn(literal); // Good: literal object type is sealed
541
531
  fn(someType); // Good: type is sealed
532
+ // @ts-expect-error
542
533
  fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
543
534
  fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
544
535
  ```
@@ -576,7 +567,7 @@ type Includes<Value extends readonly any[], Item> =
576
567
  @category Type Guard
577
568
  @category Utilities
578
569
  */
579
- type IsEqual<A$1, B$1> = [A$1, B$1] extends [infer AA, infer BB] ? [AA] extends [never] ? [BB] extends [never] ? true : false : [BB] extends [never] ? false : _IsEqual<AA, BB> : false;
570
+ type IsEqual<A$1, B$1> = [A$1] extends [B$1] ? [B$1] extends [A$1] ? _IsEqual<A$1, B$1> : false : false;
580
571
  // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
581
572
  type _IsEqual<A$1, B$1> = (<G>() => G extends A$1 & G | G ? 1 : 2) extends (<G>() => G extends B$1 & G | G ? 1 : 2) ? true : false;
582
573
  //#endregion
@@ -598,6 +589,7 @@ It relies on the fact that an empty object (`{}`) is assignable to an object wit
598
589
  ```
599
590
  const indexed: Record<string, unknown> = {}; // Allowed
600
591
 
592
+ // @ts-expect-error
601
593
  const keyed: Record<'foo', unknown> = {}; // Error
602
594
  // => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
603
595
  ```
@@ -611,16 +603,14 @@ type Indexed = {} extends Record<string, unknown>
611
603
  // => '✅ `{}` is assignable to `Record<string, unknown>`'
612
604
 
613
605
  type Keyed = {} extends Record<'foo' | 'bar', unknown>
614
- ? "✅ `{}` is assignable to `Record<'foo' | 'bar', unknown>`"
615
- : "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`";
606
+ ? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`'
607
+ : '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`';
616
608
  // => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"
617
609
  ```
618
610
 
619
611
  Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`...
620
612
 
621
613
  ```
622
- import type {OmitIndexSignature} from 'type-fest';
623
-
624
614
  type OmitIndexSignature<ObjectType> = {
625
615
  [KeyType in keyof ObjectType // Map each key of `ObjectType`...
626
616
  ]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
@@ -630,14 +620,12 @@ type OmitIndexSignature<ObjectType> = {
630
620
  ...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
631
621
 
632
622
  ```
633
- import type {OmitIndexSignature} from 'type-fest';
634
-
635
623
  type OmitIndexSignature<ObjectType> = {
636
624
  [KeyType in keyof ObjectType
637
- // Is `{}` assignable to `Record<KeyType, unknown>`?
638
- as {} extends Record<KeyType, unknown>
639
- ? ... // ✅ `{}` is assignable to `Record<KeyType, unknown>`
640
- : ... // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
625
+ // Is `{}` assignable to `Record<KeyType, unknown>`?
626
+ as {} extends Record<KeyType, unknown>
627
+ ? never // ✅ `{}` is assignable to `Record<KeyType, unknown>`
628
+ : KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
641
629
  ]: ObjectType[KeyType];
642
630
  };
643
631
  ```
@@ -648,21 +636,21 @@ If `{}` is assignable, it means that `KeyType` is an index signature and we want
648
636
  ```
649
637
  import type {OmitIndexSignature} from 'type-fest';
650
638
 
651
- interface Example {
639
+ type Example = {
652
640
  // These index signatures will be removed.
653
- [x: string]: any
654
- [x: number]: any
655
- [x: symbol]: any
656
- [x: `head-${string}`]: string
657
- [x: `${string}-tail`]: string
658
- [x: `head-${string}-tail`]: string
659
- [x: `${bigint}`]: string
660
- [x: `embedded-${number}`]: string
641
+ [x: string]: any;
642
+ [x: number]: any;
643
+ [x: symbol]: any;
644
+ [x: `head-${string}`]: string;
645
+ [x: `${string}-tail`]: string;
646
+ [x: `head-${string}-tail`]: string;
647
+ [x: `${bigint}`]: string;
648
+ [x: `embedded-${number}`]: string;
661
649
 
662
650
  // These explicitly defined keys will remain.
663
651
  foo: 'bar';
664
652
  qux?: 'baz';
665
- }
653
+ };
666
654
 
667
655
  type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
668
656
  // => { foo: 'bar'; qux?: 'baz' | undefined; }
@@ -732,12 +720,12 @@ Merge two types into a new type. Keys of the second type overrides keys of the f
732
720
  ```
733
721
  import type {Merge} from 'type-fest';
734
722
 
735
- interface Foo {
723
+ type Foo = {
736
724
  [x: string]: unknown;
737
725
  [x: number]: unknown;
738
726
  foo: string;
739
727
  bar: symbol;
740
- }
728
+ };
741
729
 
742
730
  type Bar = {
743
731
  [x: number]: number;
@@ -916,12 +904,14 @@ type Foo = {
916
904
  type FooWithoutA = Except<Foo, 'a'>;
917
905
  //=> {b: string}
918
906
 
907
+ // @ts-expect-error
919
908
  const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
920
909
  //=> errors: 'a' does not exist in type '{ b: string; }'
921
910
 
922
911
  type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
923
912
  //=> {a: number} & Partial<Record<"b", never>>
924
913
 
914
+ // @ts-expect-error
925
915
  const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
926
916
  //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
927
917
 
@@ -938,12 +928,12 @@ type UserData = {
938
928
 
939
929
  // `Omit` clearly doesn't behave as expected in this case:
940
930
  type PostPayload = Omit<UserData, 'email'>;
941
- //=> type PostPayload = { [x: string]: string; [x: number]: string; }
931
+ //=> { [x: string]: string; [x: number]: string; }
942
932
 
943
933
  // In situations like this, `Except` works better.
944
934
  // It simply removes the `email` key while preserving all the other keys.
945
- type PostPayload = Except<UserData, 'email'>;
946
- //=> type PostPayload = { [x: string]: string; name: string; role: 'admin' | 'user'; }
935
+ type PostPayloadFixed = Except<UserData, 'email'>;
936
+ //=> { [x: string]: string; name: string; role: 'admin' | 'user'; }
947
937
  ```
948
938
 
949
939
  @category Object
@@ -967,7 +957,7 @@ type Responder = {
967
957
 
968
958
  const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
969
959
  json: () => '{"message": "ok"}',
970
- secure: true
960
+ secure: true,
971
961
  };
972
962
  ```
973
963
 
@@ -1042,7 +1032,7 @@ type Foo = {
1042
1032
  a: number;
1043
1033
  b?: string;
1044
1034
  c: boolean;
1045
- }
1035
+ };
1046
1036
 
1047
1037
  type SomeOptional = SetOptional<Foo, 'b' | 'c'>;
1048
1038
  // type SomeOptional = {
@@ -1076,7 +1066,7 @@ type Foo = {
1076
1066
  a?: number;
1077
1067
  b: string;
1078
1068
  c?: boolean;
1079
- }
1069
+ };
1080
1070
 
1081
1071
  type SomeRequired = SetRequired<Foo, 'b' | 'c'>;
1082
1072
  // type SomeRequired = {
@@ -3922,6 +3912,17 @@ declare const getCommonAncestorPath: (path1: Path, path2: Path) => Path;
3922
3912
  */
3923
3913
  declare const pathIsDisabled: (path: Path, query: RuleGroupTypeAny) => boolean;
3924
3914
  //#endregion
3915
+ //#region ../react-querybuilder/src/redux/getRqbStore.d.ts
3916
+ declare global {
3917
+ var __RQB_DEVTOOLS__: boolean | undefined;
3918
+ }
3919
+ /**
3920
+ * Gets the singleton React Query Builder store instance.
3921
+ * DevTools are enabled if either:
3922
+ * - globalThis.__RQB_DEVTOOLS__ is truthy
3923
+ * - window.__RQB_DEVTOOLS__ is truthy
3924
+ */
3925
+ //#endregion
3925
3926
  //#region src/utils/preferProp.d.ts
3926
3927
  /**
3927
3928
  * For given default, prop, and context values, return the first provided of prop,
@@ -750,7 +750,7 @@ const convertFromIC = (rg) => {
750
750
  */
751
751
  const convertToIC = (rg) => {
752
752
  if (isRuleGroupTypeIC(rg)) return rg;
753
- const { combinator,...queryWithoutCombinator } = rg;
753
+ const { combinator, ...queryWithoutCombinator } = rg;
754
754
  const rules = [];
755
755
  const { length } = rg.rules;
756
756
  for (const [idx, r] of rg.rules.entries()) {
@@ -2959,7 +2959,8 @@ const defaultValueProcessorNL = (rule, opts = {}) => {
2959
2959
  const valueAsArray = toArray(rule.value);
2960
2960
  if (valueAsArray.length === 0) return "";
2961
2961
  const valStringArray = valueAsArray.map((v) => valueIsField ? wrapFieldName(getOption(fields ?? [], v)?.label ?? v) : shouldRenderAsNumber(v, parseNumbers) ? `${trimIfString(v)}` : `${wrapAndEscape(v)}`);
2962
- return `${valStringArray.slice(0, -1).join(", ")}${valStringArray.length > 2 ? "," : ""} ${orTL} ${valStringArray.at(-1)}`;
2962
+ if (valStringArray.length === 1) return valStringArray[0];
2963
+ return `(${`${valStringArray.slice(0, -1).join(", ")}${valStringArray.length > 2 ? "," : ""} ${orTL} ${valStringArray.at(-1)}`})`;
2963
2964
  }
2964
2965
  }
2965
2966
  if (typeof rule.value === "boolean") return rule.value ? trueTL : falseTL;
@@ -3004,17 +3005,22 @@ const defaultOperatorProcessorNL = (rule, opts = {}) => {
3004
3005
  const { field, operator, valueSource = "value" } = rule;
3005
3006
  // istanbul ignore next
3006
3007
  const { getOperators = defaultGetOperators, operatorMap: operatorMapParam = defaultExportOperatorMap } = opts;
3007
- const mapOperatorMap = new Map(Object.entries(defaultExportOperatorMap));
3008
- for (const [key, value] of Object.entries(operatorMapParam)) mapOperatorMap.set(lc(key), value);
3009
- const operatorMap = Object.fromEntries(mapOperatorMap);
3008
+ const mergedOperatorMap = new Map(Object.entries(defaultExportOperatorMap));
3009
+ for (const [key, value] of Object.entries(operatorMapParam)) mergedOperatorMap.set(lc(key), value);
3010
+ const operatorMap = Object.fromEntries(mergedOperatorMap);
3011
+ const operatorLC = lc(operator);
3012
+ var normalizedOperator = operator;
3013
+ const hasSingleValue = toArray(rule.value).length === 1;
3014
+ if (operatorLC === "in" && hasSingleValue) normalizedOperator = "=";
3015
+ else if (operatorLC === "notin" && hasSingleValue) normalizedOperator = "!=";
3010
3016
  const { value: operatorNL, label } = getOption(toFullOptionList(getOperators(field, { fieldData: opts.fieldData ?? {
3011
3017
  name: field,
3012
3018
  value: field,
3013
3019
  label: field
3014
- } }) ?? []), operator) ?? {
3015
- name: operator,
3016
- value: operator,
3017
- label: operator
3020
+ } }) ?? []), normalizedOperator) ?? {
3021
+ name: normalizedOperator,
3022
+ value: normalizedOperator,
3023
+ label: normalizedOperator
3018
3024
  };
3019
3025
  const operatorTL = operatorMap[operatorNL] ?? operatorMap[lc(operatorNL)] ?? [label, label];
3020
3026
  return typeof operatorTL === "string" ? operatorTL : operatorTL[valueSource === "field" ? 1 : 0];