@react-querybuilder/antd 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.
@@ -20,34 +20,6 @@ type Intersection = UnionToIntersection<Union>;
20
20
  //=> {the(): void; great(arg: string): void; escape: boolean};
21
21
  ```
22
22
 
23
- A more applicable example which could make its way into your library code follows.
24
-
25
- @example
26
- ```
27
- import type {UnionToIntersection} from 'type-fest';
28
-
29
- class CommandOne {
30
- commands: {
31
- a1: () => undefined,
32
- b1: () => undefined,
33
- }
34
- }
35
-
36
- class CommandTwo {
37
- commands: {
38
- a2: (argA: string) => undefined,
39
- b2: (argB: string) => undefined,
40
- }
41
- }
42
-
43
- const union = [new CommandOne(), new CommandTwo()].map(instance => instance.commands);
44
- type Union = typeof union;
45
- //=> {a1(): void; b1(): void} | {a2(argA: string): void; b2(argB: string): void}
46
-
47
- type Intersection = UnionToIntersection<Union>;
48
- //=> {a1(): void; b1(): void; a2(argA: string): void; b2(argB: string): void}
49
- ```
50
-
51
23
  @category Type
52
24
  */
53
25
  type UnionToIntersection<Union> = (
@@ -123,8 +95,8 @@ import type {IsAny} from 'type-fest';
123
95
  const typedObject = {a: 1, b: 2} as const;
124
96
  const anyObject: any = {a: 1, b: 2};
125
97
 
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];
98
+ function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(object: O, key: K) {
99
+ return object[key];
128
100
  }
129
101
 
130
102
  const typedA = get(typedObject, 'a');
@@ -149,17 +121,17 @@ This is useful when writing utility types or schema validators that need to diff
149
121
  ```
150
122
  import type {IsOptionalKeyOf} from 'type-fest';
151
123
 
152
- interface User {
124
+ type User = {
153
125
  name: string;
154
126
  surname: string;
155
127
 
156
128
  luckyNumber?: number;
157
- }
129
+ };
158
130
 
159
- interface Admin {
131
+ type Admin = {
160
132
  name: string;
161
133
  surname?: string;
162
- }
134
+ };
163
135
 
164
136
  type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
165
137
  //=> true
@@ -192,12 +164,12 @@ This is useful when you want to create a new type that contains different type v
192
164
  ```
193
165
  import type {OptionalKeysOf, Except} from 'type-fest';
194
166
 
195
- interface User {
167
+ type User = {
196
168
  name: string;
197
169
  surname: string;
198
170
 
199
171
  luckyNumber?: number;
200
- }
172
+ };
201
173
 
202
174
  const REMOVE_FIELD = Symbol('remove field symbol');
203
175
  type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
@@ -205,12 +177,12 @@ type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKe
205
177
  };
206
178
 
207
179
  const update1: UpdateOperation<User> = {
208
- name: 'Alice'
180
+ name: 'Alice',
209
181
  };
210
182
 
211
183
  const update2: UpdateOperation<User> = {
212
184
  name: 'Bob',
213
- luckyNumber: REMOVE_FIELD
185
+ luckyNumber: REMOVE_FIELD,
214
186
  };
215
187
  ```
216
188
 
@@ -230,17 +202,23 @@ This is useful when you want to create a new type that contains different type v
230
202
  ```
231
203
  import type {RequiredKeysOf} from 'type-fest';
232
204
 
233
- declare function createValidation<Entity extends object, Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>>(field: Key, validator: (value: Entity[Key]) => boolean): ValidatorFn;
205
+ declare function createValidation<
206
+ Entity extends object,
207
+ Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
208
+ >(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
234
209
 
235
- interface User {
210
+ type User = {
236
211
  name: string;
237
212
  surname: string;
238
-
239
213
  luckyNumber?: number;
240
- }
214
+ };
241
215
 
242
216
  const validator1 = createValidation<User>('name', value => value.length < 25);
243
217
  const validator2 = createValidation<User>('surname', value => value.length < 25);
218
+
219
+ // @ts-expect-error
220
+ const validator3 = createValidation<User>('luckyNumber', value => value > 0);
221
+ // Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
244
222
  ```
245
223
 
246
224
  @category Utilities
@@ -262,29 +240,41 @@ Useful in type utilities, such as checking if something does not occur.
262
240
  ```
263
241
  import type {IsNever, And} from 'type-fest';
264
242
 
265
- // https://github.com/andnp/SimplyTyped/blob/master/src/types/strings.ts
266
- type AreStringsEqual<A extends string, B extends string> =
267
- And<
268
- IsNever<Exclude<A, B>> extends true ? true : false,
269
- IsNever<Exclude<B, A>> extends true ? true : false
270
- >;
271
-
272
- type EndIfEqual<I extends string, O extends string> =
273
- AreStringsEqual<I, O> extends true
274
- ? never
275
- : void;
276
-
277
- function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
278
- if (input === output) {
279
- process.exit(0);
280
- }
281
- }
243
+ type A = IsNever<never>;
244
+ //=> true
282
245
 
283
- endIfEqual('abc', 'abc');
284
- //=> never
246
+ type B = IsNever<any>;
247
+ //=> false
248
+
249
+ type C = IsNever<unknown>;
250
+ //=> false
251
+
252
+ type D = IsNever<never[]>;
253
+ //=> false
254
+
255
+ type E = IsNever<object>;
256
+ //=> false
257
+
258
+ type F = IsNever<string>;
259
+ //=> false
260
+ ```
285
261
 
286
- endIfEqual('abc', '123');
287
- //=> void
262
+ @example
263
+ ```
264
+ import type {IsNever} from 'type-fest';
265
+
266
+ type IsTrue<T> = T extends true ? true : false;
267
+
268
+ // When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
269
+ type A = IsTrue<never>;
270
+ // ^? type A = never
271
+
272
+ // If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
273
+ type IsTrueFixed<T> =
274
+ IsNever<T> extends true ? false : T extends true ? true : false;
275
+
276
+ type B = IsTrueFixed<never>;
277
+ // ^? type B = false
288
278
  ```
289
279
 
290
280
  @category Type Guard
@@ -305,7 +295,7 @@ Note:
305
295
 
306
296
  @example
307
297
  ```
308
- import {If} from 'type-fest';
298
+ import type {If} from 'type-fest';
309
299
 
310
300
  type A = If<true, 'yes', 'no'>;
311
301
  //=> 'yes'
@@ -325,7 +315,7 @@ type E = If<never, 'yes', 'no'>;
325
315
 
326
316
  @example
327
317
  ```
328
- import {If, IsAny, IsNever} from 'type-fest';
318
+ import type {If, IsAny, IsNever} from 'type-fest';
329
319
 
330
320
  type A = If<IsAny<unknown>, 'is any', 'not any'>;
331
321
  //=> 'not any'
@@ -336,7 +326,7 @@ type B = If<IsNever<never>, 'is never', 'not never'>;
336
326
 
337
327
  @example
338
328
  ```
339
- import {If, IsEqual} from 'type-fest';
329
+ import type {If, IsEqual} from 'type-fest';
340
330
 
341
331
  type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
342
332
 
@@ -466,10 +456,11 @@ const literal = {foo: 123, bar: 'hello', baz: 456};
466
456
  const someType: SomeType = literal;
467
457
  const someInterface: SomeInterface = literal;
468
458
 
469
- function fn(object: Record<string, unknown>): void {}
459
+ declare function fn(object: Record<string, unknown>): void;
470
460
 
471
461
  fn(literal); // Good: literal object type is sealed
472
462
  fn(someType); // Good: type is sealed
463
+ // @ts-expect-error
473
464
  fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
474
465
  fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
475
466
  ```
@@ -507,7 +498,7 @@ type Includes<Value extends readonly any[], Item> =
507
498
  @category Type Guard
508
499
  @category Utilities
509
500
  */
510
- 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;
501
+ type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
511
502
  // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
512
503
  type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
513
504
  //#endregion
@@ -529,6 +520,7 @@ It relies on the fact that an empty object (`{}`) is assignable to an object wit
529
520
  ```
530
521
  const indexed: Record<string, unknown> = {}; // Allowed
531
522
 
523
+ // @ts-expect-error
532
524
  const keyed: Record<'foo', unknown> = {}; // Error
533
525
  // => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
534
526
  ```
@@ -542,16 +534,14 @@ type Indexed = {} extends Record<string, unknown>
542
534
  // => '✅ `{}` is assignable to `Record<string, unknown>`'
543
535
 
544
536
  type Keyed = {} extends Record<'foo' | 'bar', unknown>
545
- ? "✅ `{}` is assignable to `Record<'foo' | 'bar', unknown>`"
546
- : "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`";
537
+ ? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`'
538
+ : '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`';
547
539
  // => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"
548
540
  ```
549
541
 
550
542
  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`...
551
543
 
552
544
  ```
553
- import type {OmitIndexSignature} from 'type-fest';
554
-
555
545
  type OmitIndexSignature<ObjectType> = {
556
546
  [KeyType in keyof ObjectType // Map each key of `ObjectType`...
557
547
  ]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
@@ -561,14 +551,12 @@ type OmitIndexSignature<ObjectType> = {
561
551
  ...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
562
552
 
563
553
  ```
564
- import type {OmitIndexSignature} from 'type-fest';
565
-
566
554
  type OmitIndexSignature<ObjectType> = {
567
555
  [KeyType in keyof ObjectType
568
- // Is `{}` assignable to `Record<KeyType, unknown>`?
569
- as {} extends Record<KeyType, unknown>
570
- ? ... // ✅ `{}` is assignable to `Record<KeyType, unknown>`
571
- : ... // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
556
+ // Is `{}` assignable to `Record<KeyType, unknown>`?
557
+ as {} extends Record<KeyType, unknown>
558
+ ? never // ✅ `{}` is assignable to `Record<KeyType, unknown>`
559
+ : KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
572
560
  ]: ObjectType[KeyType];
573
561
  };
574
562
  ```
@@ -579,21 +567,21 @@ If `{}` is assignable, it means that `KeyType` is an index signature and we want
579
567
  ```
580
568
  import type {OmitIndexSignature} from 'type-fest';
581
569
 
582
- interface Example {
570
+ type Example = {
583
571
  // These index signatures will be removed.
584
- [x: string]: any
585
- [x: number]: any
586
- [x: symbol]: any
587
- [x: `head-${string}`]: string
588
- [x: `${string}-tail`]: string
589
- [x: `head-${string}-tail`]: string
590
- [x: `${bigint}`]: string
591
- [x: `embedded-${number}`]: string
572
+ [x: string]: any;
573
+ [x: number]: any;
574
+ [x: symbol]: any;
575
+ [x: `head-${string}`]: string;
576
+ [x: `${string}-tail`]: string;
577
+ [x: `head-${string}-tail`]: string;
578
+ [x: `${bigint}`]: string;
579
+ [x: `embedded-${number}`]: string;
592
580
 
593
581
  // These explicitly defined keys will remain.
594
582
  foo: 'bar';
595
583
  qux?: 'baz';
596
- }
584
+ };
597
585
 
598
586
  type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
599
587
  // => { foo: 'bar'; qux?: 'baz' | undefined; }
@@ -663,12 +651,12 @@ Merge two types into a new type. Keys of the second type overrides keys of the f
663
651
  ```
664
652
  import type {Merge} from 'type-fest';
665
653
 
666
- interface Foo {
654
+ type Foo = {
667
655
  [x: string]: unknown;
668
656
  [x: number]: unknown;
669
657
  foo: string;
670
658
  bar: symbol;
671
- }
659
+ };
672
660
 
673
661
  type Bar = {
674
662
  [x: number]: number;
@@ -847,12 +835,14 @@ type Foo = {
847
835
  type FooWithoutA = Except<Foo, 'a'>;
848
836
  //=> {b: string}
849
837
 
838
+ // @ts-expect-error
850
839
  const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
851
840
  //=> errors: 'a' does not exist in type '{ b: string; }'
852
841
 
853
842
  type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
854
843
  //=> {a: number} & Partial<Record<"b", never>>
855
844
 
845
+ // @ts-expect-error
856
846
  const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
857
847
  //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
858
848
 
@@ -869,12 +859,12 @@ type UserData = {
869
859
 
870
860
  // `Omit` clearly doesn't behave as expected in this case:
871
861
  type PostPayload = Omit<UserData, 'email'>;
872
- //=> type PostPayload = { [x: string]: string; [x: number]: string; }
862
+ //=> { [x: string]: string; [x: number]: string; }
873
863
 
874
864
  // In situations like this, `Except` works better.
875
865
  // It simply removes the `email` key while preserving all the other keys.
876
- type PostPayload = Except<UserData, 'email'>;
877
- //=> type PostPayload = { [x: string]: string; name: string; role: 'admin' | 'user'; }
866
+ type PostPayloadFixed = Except<UserData, 'email'>;
867
+ //=> { [x: string]: string; name: string; role: 'admin' | 'user'; }
878
868
  ```
879
869
 
880
870
  @category Object
@@ -896,7 +886,7 @@ type Foo = {
896
886
  a?: number;
897
887
  b: string;
898
888
  c?: boolean;
899
- }
889
+ };
900
890
 
901
891
  type SomeRequired = SetRequired<Foo, 'b' | 'c'>;
902
892
  // type SomeRequired = {
@@ -950,7 +940,7 @@ type Foo = {
950
940
  a: number | null;
951
941
  b: string | undefined;
952
942
  c?: boolean | null;
953
- }
943
+ };
954
944
 
955
945
  type SomeNonNullable = SetNonNullable<Foo, 'b' | 'c'>;
956
946
  // type SomeNonNullable = {
@@ -2744,6 +2734,17 @@ type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O exten
2744
2734
  context?: any;
2745
2735
  } : never;
2746
2736
  //#endregion
2737
+ //#region ../react-querybuilder/src/redux/getRqbStore.d.ts
2738
+ declare global {
2739
+ var __RQB_DEVTOOLS__: boolean | undefined;
2740
+ }
2741
+ /**
2742
+ * Gets the singleton React Query Builder store instance.
2743
+ * DevTools are enabled if either:
2744
+ * - globalThis.__RQB_DEVTOOLS__ is truthy
2745
+ * - window.__RQB_DEVTOOLS__ is truthy
2746
+ */
2747
+ //#endregion
2747
2748
  //#region src/AntDActionElement.d.ts
2748
2749
  type RemoveDataIndexKeys<T$1> = { [K in keyof T$1 as `data-${string}` extends K ? never : K]: T$1[K] };
2749
2750
  /**
@@ -13,32 +13,10 @@ import weekYear from "dayjs/plugin/weekYear.js";
13
13
  import weekday from "dayjs/plugin/weekday.js";
14
14
 
15
15
  //#region rolldown:runtime
16
- var __create = Object.create;
17
- var __defProp = Object.defineProperty;
18
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
19
- var __getOwnPropNames = Object.getOwnPropertyNames;
20
- var __getProtoOf = Object.getPrototypeOf;
21
- var __hasOwnProp = Object.prototype.hasOwnProperty;
22
- var __commonJS = (cb, mod) => function() {
23
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
24
- };
25
- var __copyProps = (to, from, except, desc) => {
26
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
27
- key = keys[i];
28
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
29
- get: ((k) => from[k]).bind(null, key),
30
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
31
- });
32
- }
33
- return to;
34
- };
35
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
36
- value: mod,
37
- enumerable: true
38
- }) : target, mod));
16
+ var __commonJSMin = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
39
17
 
40
18
  //#endregion
41
- //#region \0@oxc-project+runtime@0.96.0/helpers/objectWithoutPropertiesLoose.js
19
+ //#region \0@oxc-project+runtime@0.99.0/helpers/objectWithoutPropertiesLoose.js
42
20
  function _objectWithoutPropertiesLoose(r, e) {
43
21
  if (null == r) return {};
44
22
  var t = {};
@@ -50,7 +28,7 @@ function _objectWithoutPropertiesLoose(r, e) {
50
28
  }
51
29
 
52
30
  //#endregion
53
- //#region \0@oxc-project+runtime@0.96.0/helpers/objectWithoutProperties.js
31
+ //#region \0@oxc-project+runtime@0.99.0/helpers/objectWithoutProperties.js
54
32
  function _objectWithoutProperties(e, t) {
55
33
  if (null == e) return {};
56
34
  var o, r, i = _objectWithoutPropertiesLoose(e, t);
@@ -62,7 +40,7 @@ function _objectWithoutProperties(e, t) {
62
40
  }
63
41
 
64
42
  //#endregion
65
- //#region \0@oxc-project+runtime@0.96.0/helpers/typeof.js
43
+ //#region \0@oxc-project+runtime@0.99.0/helpers/typeof.js
66
44
  function _typeof(o) {
67
45
  "@babel/helpers - typeof";
68
46
  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
@@ -73,7 +51,7 @@ function _typeof(o) {
73
51
  }
74
52
 
75
53
  //#endregion
76
- //#region \0@oxc-project+runtime@0.96.0/helpers/toPrimitive.js
54
+ //#region \0@oxc-project+runtime@0.99.0/helpers/toPrimitive.js
77
55
  function toPrimitive(t, r) {
78
56
  if ("object" != _typeof(t) || !t) return t;
79
57
  var e = t[Symbol.toPrimitive];
@@ -86,14 +64,14 @@ function toPrimitive(t, r) {
86
64
  }
87
65
 
88
66
  //#endregion
89
- //#region \0@oxc-project+runtime@0.96.0/helpers/toPropertyKey.js
67
+ //#region \0@oxc-project+runtime@0.99.0/helpers/toPropertyKey.js
90
68
  function toPropertyKey(t) {
91
69
  var i = toPrimitive(t, "string");
92
70
  return "symbol" == _typeof(i) ? i : i + "";
93
71
  }
94
72
 
95
73
  //#endregion
96
- //#region \0@oxc-project+runtime@0.96.0/helpers/defineProperty.js
74
+ //#region \0@oxc-project+runtime@0.99.0/helpers/defineProperty.js
97
75
  function _defineProperty(e, r, t) {
98
76
  return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
99
77
  value: t,
@@ -104,7 +82,7 @@ function _defineProperty(e, r, t) {
104
82
  }
105
83
 
106
84
  //#endregion
107
- //#region \0@oxc-project+runtime@0.96.0/helpers/objectSpread2.js
85
+ //#region \0@oxc-project+runtime@0.99.0/helpers/objectSpread2.js
108
86
  function ownKeys(e, r) {
109
87
  var t = Object.keys(e);
110
88
  if (Object.getOwnPropertySymbols) {
@@ -240,7 +218,7 @@ const AntDShiftActions = ({ shiftUp, shiftDown, shiftUpDisabled, shiftDownDisabl
240
218
 
241
219
  //#endregion
242
220
  //#region ../../node_modules/rc-util/lib/warning.js
243
- var require_warning = /* @__PURE__ */ __commonJS({ "../../node_modules/rc-util/lib/warning.js": ((exports) => {
221
+ var require_warning = /* @__PURE__ */ __commonJSMin(((exports) => {
244
222
  Object.defineProperty(exports, "__esModule", { value: true });
245
223
  exports.default = void 0;
246
224
  exports.noteOnce = noteOnce$1;
@@ -303,11 +281,11 @@ var require_warning = /* @__PURE__ */ __commonJS({ "../../node_modules/rc-util/l
303
281
  warningOnce.resetWarned = resetWarned;
304
282
  warningOnce.noteOnce = noteOnce$1;
305
283
  exports.default = warningOnce;
306
- }) });
284
+ }));
307
285
 
308
286
  //#endregion
309
287
  //#region src/dayjs.ts
310
- var import_warning = /* @__PURE__ */ __toESM(require_warning());
288
+ var import_warning = require_warning();
311
289
  dayjs.extend(customParseFormat);
312
290
  dayjs.extend(advancedFormat);
313
291
  dayjs.extend(weekday);