@react-querybuilder/datetime 8.10.0 → 8.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/cjs/getDatetimeRuleProcessorSQL-CSxxM8ce.js +2 -0
  2. package/dist/cjs/getDatetimeRuleProcessorSQL-CSxxM8ce.js.map +1 -0
  3. package/dist/cjs/react-querybuilder_datetime.cjs.development.d.ts +1 -1
  4. package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.d.ts +1 -1
  5. package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.d.ts +1 -1
  6. package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.d.ts +1 -1
  7. package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.d.ts +1 -1
  8. package/dist/cjs/react-querybuilder_datetime.cjs.production.d.ts +1 -1
  9. package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.d.ts +1 -1
  10. package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js +1 -1
  11. package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js.map +1 -1
  12. package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.d.ts +1 -1
  13. package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js +1 -1
  14. package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js.map +1 -1
  15. package/dist/cjs/react-querybuilder_datetime.cjs.production.js +1 -1
  16. package/dist/cjs/react-querybuilder_datetime.cjs.production.js.map +1 -1
  17. package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.d.ts +1 -1
  18. package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js +1 -1
  19. package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js.map +1 -1
  20. package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.d.ts +1 -1
  21. package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js +1 -1
  22. package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js.map +1 -1
  23. package/dist/cjs/{types-C3iwOCvi.d.ts → types-A60rB27l.d.ts} +188 -231
  24. package/dist/{getDatetimeRuleProcessorSQL-DS_x8OLw.js → getDatetimeRuleProcessorSQL-B8y0RI7t.js} +7 -7
  25. package/dist/{getDatetimeRuleProcessorSQL-DS_x8OLw.js.map → getDatetimeRuleProcessorSQL-B8y0RI7t.js.map} +1 -1
  26. package/dist/{getDatetimeRuleProcessorSQL-CW5JXMXx.mjs → getDatetimeRuleProcessorSQL-CSl2zGza.mjs} +2 -2
  27. package/dist/{getDatetimeRuleProcessorSQL-CW5JXMXx.mjs.map → getDatetimeRuleProcessorSQL-CSl2zGza.mjs.map} +1 -1
  28. package/dist/react-querybuilder_datetime.d.mts +1 -1
  29. package/dist/react-querybuilder_datetime.date-fns.d.mts +1 -1
  30. package/dist/react-querybuilder_datetime.date-fns.mjs +1 -1
  31. package/dist/react-querybuilder_datetime.dayjs.d.mts +1 -1
  32. package/dist/react-querybuilder_datetime.dayjs.mjs +1 -1
  33. package/dist/react-querybuilder_datetime.jsdate.d.mts +1 -1
  34. package/dist/react-querybuilder_datetime.jsdate.mjs +1 -1
  35. package/dist/react-querybuilder_datetime.legacy-esm.d.ts +1 -1
  36. package/dist/react-querybuilder_datetime.legacy-esm.date-fns.d.ts +1 -1
  37. package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js +1 -1
  38. package/dist/react-querybuilder_datetime.legacy-esm.dayjs.d.ts +1 -1
  39. package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js +1 -1
  40. package/dist/react-querybuilder_datetime.legacy-esm.js +1 -1
  41. package/dist/react-querybuilder_datetime.legacy-esm.jsdate.d.ts +1 -1
  42. package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js +1 -1
  43. package/dist/react-querybuilder_datetime.legacy-esm.luxon.d.ts +1 -1
  44. package/dist/react-querybuilder_datetime.legacy-esm.luxon.js +1 -1
  45. package/dist/react-querybuilder_datetime.luxon.d.mts +1 -1
  46. package/dist/react-querybuilder_datetime.luxon.mjs +1 -1
  47. package/dist/react-querybuilder_datetime.mjs +1 -1
  48. package/dist/react-querybuilder_datetime.production.d.mts +1 -1
  49. package/dist/react-querybuilder_datetime.production.date-fns.d.mts +1 -1
  50. package/dist/react-querybuilder_datetime.production.date-fns.mjs +1 -1
  51. package/dist/react-querybuilder_datetime.production.date-fns.mjs.map +1 -1
  52. package/dist/react-querybuilder_datetime.production.dayjs.d.mts +1 -1
  53. package/dist/react-querybuilder_datetime.production.dayjs.mjs +1 -1
  54. package/dist/react-querybuilder_datetime.production.dayjs.mjs.map +1 -1
  55. package/dist/react-querybuilder_datetime.production.jsdate.d.mts +1 -1
  56. package/dist/react-querybuilder_datetime.production.jsdate.mjs +1 -1
  57. package/dist/react-querybuilder_datetime.production.jsdate.mjs.map +1 -1
  58. package/dist/react-querybuilder_datetime.production.luxon.d.mts +1 -1
  59. package/dist/react-querybuilder_datetime.production.luxon.mjs +1 -1
  60. package/dist/react-querybuilder_datetime.production.luxon.mjs.map +1 -1
  61. package/dist/react-querybuilder_datetime.production.mjs +1 -1
  62. package/dist/react-querybuilder_datetime.production.mjs.map +1 -1
  63. package/dist/{types-Dm-PhQtt.d.ts → types-BjHLhGXX.d.mts} +188 -231
  64. package/dist/{types-BQXdgbuB.d.mts → types-Dq7BlQzI.d.ts} +188 -231
  65. package/package.json +8 -8
@@ -1,26 +1,7 @@
1
1
  import { RulesLogic } from "json-logic-js";
2
2
 
3
- //#region ../../node_modules/type-fest/source/observable-like.d.ts
4
- declare global {
5
- // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
6
- interface SymbolConstructor {
7
- readonly observable: symbol;
8
- }
9
- }
10
-
11
- /**
12
- @remarks
13
- The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
14
- As well, some guidance on making an `Observable` to not include `closed` property.
15
- @see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
16
- @see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
17
- @see https://github.com/benlesh/symbol-observable#making-an-object-observable
18
-
19
- @category Observable
20
- */
21
-
22
- //#endregion
23
3
  //#region ../../node_modules/type-fest/source/union-to-intersection.d.ts
4
+
24
5
  /**
25
6
  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).
26
7
 
@@ -79,7 +60,7 @@ Union extends unknown
79
60
  // Infer the `Intersection` type since TypeScript represents the positional
80
61
  // arguments of unions of functions as an intersection of the union.
81
62
  ) extends ((mergedIntersection: infer Intersection) => void)
82
- // The `& Union` is to allow indexing by the resulting type
63
+ // The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`
83
64
  ? Intersection & Union : never;
84
65
  //#endregion
85
66
  //#region ../../node_modules/type-fest/source/keys-of-union.d.ts
@@ -124,6 +105,80 @@ type KeysOfUnion<ObjectType> =
124
105
  // Hack to fix https://github.com/sindresorhus/type-fest/issues/1008
125
106
  keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;
126
107
  //#endregion
108
+ //#region ../../node_modules/type-fest/source/is-any.d.ts
109
+ /**
110
+ Returns a boolean for whether the given type is `any`.
111
+
112
+ @link https://stackoverflow.com/a/49928360/1490091
113
+
114
+ Useful in type utilities, such as disallowing `any`s to be passed to a function.
115
+
116
+ @example
117
+ ```
118
+ import type {IsAny} from 'type-fest';
119
+
120
+ const typedObject = {a: 1, b: 2} as const;
121
+ const anyObject: any = {a: 1, b: 2};
122
+
123
+ function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
124
+ return obj[key];
125
+ }
126
+
127
+ const typedA = get(typedObject, 'a');
128
+ //=> 1
129
+
130
+ const anyA = get(anyObject, 'a');
131
+ //=> any
132
+ ```
133
+
134
+ @category Type Guard
135
+ @category Utilities
136
+ */
137
+ type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
138
+ //#endregion
139
+ //#region ../../node_modules/type-fest/source/is-optional-key-of.d.ts
140
+ /**
141
+ Returns a boolean for whether the given key is an optional key of type.
142
+
143
+ This is useful when writing utility types or schema validators that need to differentiate `optional` keys.
144
+
145
+ @example
146
+ ```
147
+ import type {IsOptionalKeyOf} from 'type-fest';
148
+
149
+ interface User {
150
+ name: string;
151
+ surname: string;
152
+
153
+ luckyNumber?: number;
154
+ }
155
+
156
+ interface Admin {
157
+ name: string;
158
+ surname?: string;
159
+ }
160
+
161
+ type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
162
+ //=> true
163
+
164
+ type T2 = IsOptionalKeyOf<User, 'name'>;
165
+ //=> false
166
+
167
+ type T3 = IsOptionalKeyOf<User, 'name' | 'luckyNumber'>;
168
+ //=> boolean
169
+
170
+ type T4 = IsOptionalKeyOf<User | Admin, 'name'>;
171
+ //=> false
172
+
173
+ type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
174
+ //=> boolean
175
+ ```
176
+
177
+ @category Type Guard
178
+ @category Utilities
179
+ */
180
+ 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;
181
+ //#endregion
127
182
  //#region ../../node_modules/type-fest/source/optional-keys-of.d.ts
128
183
  /**
129
184
  Extract all optional keys from the given type.
@@ -158,8 +213,8 @@ const update2: UpdateOperation<User> = {
158
213
 
159
214
  @category Utilities
160
215
  */
161
- type OptionalKeysOf<BaseType extends object> = BaseType extends unknown // For distributing `BaseType`
162
- ? (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`
216
+ type OptionalKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
217
+ ? (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`
163
218
  : never;
164
219
  //#endregion
165
220
  //#region ../../node_modules/type-fest/source/required-keys-of.d.ts
@@ -187,8 +242,8 @@ const validator2 = createValidation<User>('surname', value => value.length < 25)
187
242
 
188
243
  @category Utilities
189
244
  */
190
- type RequiredKeysOf<BaseType extends object> = BaseType extends unknown // For distributing `BaseType`
191
- ? Exclude<keyof BaseType, OptionalKeysOf<BaseType>> : never;
245
+ type RequiredKeysOf<Type extends object> = Type extends unknown // For distributing `Type`
246
+ ? Exclude<keyof Type, OptionalKeysOf<Type>> : never;
192
247
  //#endregion
193
248
  //#region ../../node_modules/type-fest/source/is-never.d.ts
194
249
  /**
@@ -234,27 +289,65 @@ endIfEqual('abc', '123');
234
289
  */
235
290
  type IsNever<T> = [T] extends [never] ? true : false;
236
291
  //#endregion
237
- //#region ../../node_modules/type-fest/source/if-never.d.ts
292
+ //#region ../../node_modules/type-fest/source/if.d.ts
238
293
  /**
239
- An if-else-like type that resolves depending on whether the given type is `never`.
294
+ An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
295
+
296
+ Use-cases:
297
+ - 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'>`.
240
298
 
241
- @see {@link IsNever}
299
+ Note:
300
+ - 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'`.
301
+ - Returns the else branch if the given type is `never`. For example, `If<never, 'Y', 'N'>` will return `'N'`.
242
302
 
243
303
  @example
244
304
  ```
245
- import type {IfNever} from 'type-fest';
305
+ import {If} from 'type-fest';
246
306
 
247
- type ShouldBeTrue = IfNever<never>;
248
- //=> true
307
+ type A = If<true, 'yes', 'no'>;
308
+ //=> 'yes'
249
309
 
250
- type ShouldBeBar = IfNever<'not never', 'foo', 'bar'>;
251
- //=> 'bar'
310
+ type B = If<false, 'yes', 'no'>;
311
+ //=> 'no'
312
+
313
+ type C = If<boolean, 'yes', 'no'>;
314
+ //=> 'yes' | 'no'
315
+
316
+ type D = If<any, 'yes', 'no'>;
317
+ //=> 'yes' | 'no'
318
+
319
+ type E = If<never, 'yes', 'no'>;
320
+ //=> 'no'
321
+ ```
322
+
323
+ @example
324
+ ```
325
+ import {If, IsAny, IsNever} from 'type-fest';
326
+
327
+ type A = If<IsAny<unknown>, 'is any', 'not any'>;
328
+ //=> 'not any'
329
+
330
+ type B = If<IsNever<never>, 'is never', 'not never'>;
331
+ //=> 'is never'
332
+ ```
333
+
334
+ @example
335
+ ```
336
+ import {If, IsEqual} from 'type-fest';
337
+
338
+ type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
339
+
340
+ type A = IfEqual<string, string, 'equal', 'not equal'>;
341
+ //=> 'equal'
342
+
343
+ type B = IfEqual<string, number, 'equal', 'not equal'>;
344
+ //=> 'not equal'
252
345
  ```
253
346
 
254
347
  @category Type Guard
255
348
  @category Utilities
256
349
  */
257
- type IfNever$1<T, TypeIfNever = true, TypeIfNotNever = false> = (IsNever<T> extends true ? TypeIfNever : TypeIfNotNever);
350
+ type If<Type extends boolean, IfBranch, ElseBranch> = IsNever<Type> extends true ? ElseBranch : Type extends true ? IfBranch : ElseBranch;
258
351
  //#endregion
259
352
  //#region ../../node_modules/type-fest/source/unknown-array.d.ts
260
353
  /**
@@ -288,99 +381,7 @@ type UnknownArray = readonly unknown[];
288
381
  /**
289
382
  Returns whether the given array `T` is readonly.
290
383
  */
291
- type IsArrayReadonly<T extends UnknownArray> = IfNever$1<T, false, T extends unknown[] ? false : true>;
292
- /**
293
- An if-else-like type that resolves depending on whether the given array is readonly.
294
-
295
- @see {@link IsArrayReadonly}
296
-
297
- @example
298
- ```
299
- import type {ArrayTail} from 'type-fest';
300
-
301
- type ReadonlyPreservingArrayTail<TArray extends readonly unknown[]> =
302
- ArrayTail<TArray> extends infer Tail
303
- ? IfArrayReadonly<TArray, Readonly<Tail>, Tail>
304
- : never;
305
-
306
- type ReadonlyTail = ReadonlyPreservingArrayTail<readonly [string, number, boolean]>;
307
- //=> readonly [number, boolean]
308
-
309
- type NonReadonlyTail = ReadonlyPreservingArrayTail<[string, number, boolean]>;
310
- //=> [number, boolean]
311
-
312
- type ShouldBeTrue = IfArrayReadonly<readonly unknown[]>;
313
- //=> true
314
-
315
- type ShouldBeBar = IfArrayReadonly<unknown[], 'foo', 'bar'>;
316
- //=> 'bar'
317
- ```
318
- */
319
- type IfArrayReadonly<T extends UnknownArray, TypeIfArrayReadonly = true, TypeIfNotArrayReadonly = false> = IsArrayReadonly<T> extends infer Result ? Result extends true ? TypeIfArrayReadonly : TypeIfNotArrayReadonly : never;
320
- //#endregion
321
- //#region ../../node_modules/type-fest/source/is-any.d.ts
322
- // Can eventually be replaced with the built-in once this library supports
323
- // TS5.4+ only. Tracked in https://github.com/sindresorhus/type-fest/issues/848
324
- type NoInfer<T> = T extends infer U ? U : never;
325
-
326
- /**
327
- Returns a boolean for whether the given type is `any`.
328
-
329
- @link https://stackoverflow.com/a/49928360/1490091
330
-
331
- Useful in type utilities, such as disallowing `any`s to be passed to a function.
332
-
333
- @example
334
- ```
335
- import type {IsAny} from 'type-fest';
336
-
337
- const typedObject = {a: 1, b: 2} as const;
338
- const anyObject: any = {a: 1, b: 2};
339
-
340
- function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
341
- return obj[key];
342
- }
343
-
344
- const typedA = get(typedObject, 'a');
345
- //=> 1
346
-
347
- const anyA = get(anyObject, 'a');
348
- //=> any
349
- ```
350
-
351
- @category Type Guard
352
- @category Utilities
353
- */
354
- type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
355
- //#endregion
356
- //#region ../../node_modules/type-fest/source/is-equal.d.ts
357
- /**
358
- Returns a boolean for whether the two given types are equal.
359
-
360
- @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
361
- @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
362
-
363
- Use-cases:
364
- - If you want to make a conditional branch based on the result of a comparison of two types.
365
-
366
- @example
367
- ```
368
- import type {IsEqual} from 'type-fest';
369
-
370
- // This type returns a boolean for whether the given array includes the given item.
371
- // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
372
- type Includes<Value extends readonly any[], Item> =
373
- Value extends readonly [Value[0], ...infer rest]
374
- ? IsEqual<Value[0], Item> extends true
375
- ? true
376
- : Includes<rest, Item>
377
- : false;
378
- ```
379
-
380
- @category Type Guard
381
- @category Utilities
382
- */
383
- type IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
384
+ type IsArrayReadonly<T extends UnknownArray> = If<IsNever<T>, false, T extends unknown[] ? false : true>;
384
385
  //#endregion
385
386
  //#region ../../node_modules/type-fest/source/simplify.d.ts
386
387
  /**
@@ -442,6 +443,37 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
442
443
  */
443
444
  type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
444
445
  //#endregion
446
+ //#region ../../node_modules/type-fest/source/is-equal.d.ts
447
+ /**
448
+ Returns a boolean for whether the two given types are equal.
449
+
450
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
451
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
452
+
453
+ Use-cases:
454
+ - If you want to make a conditional branch based on the result of a comparison of two types.
455
+
456
+ @example
457
+ ```
458
+ import type {IsEqual} from 'type-fest';
459
+
460
+ // This type returns a boolean for whether the given array includes the given item.
461
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
462
+ type Includes<Value extends readonly any[], Item> =
463
+ Value extends readonly [Value[0], ...infer rest]
464
+ ? IsEqual<Value[0], Item> extends true
465
+ ? true
466
+ : Includes<rest, Item>
467
+ : false;
468
+ ```
469
+
470
+ @category Type Guard
471
+ @category Utilities
472
+ */
473
+ 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;
474
+ // This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
475
+ type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
476
+ //#endregion
445
477
  //#region ../../node_modules/type-fest/source/omit-index-signature.d.ts
446
478
  /**
447
479
  Omit any index signatures from the given object type, leaving only explicitly defined properties.
@@ -623,51 +655,6 @@ export type FooBar = Merge<Foo, Bar>;
623
655
  */
624
656
  type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
625
657
  //#endregion
626
- //#region ../../node_modules/type-fest/source/if-any.d.ts
627
- /**
628
- An if-else-like type that resolves depending on whether the given type is `any`.
629
-
630
- @see {@link IsAny}
631
-
632
- @example
633
- ```
634
- import type {IfAny} from 'type-fest';
635
-
636
- type ShouldBeTrue = IfAny<any>;
637
- //=> true
638
-
639
- type ShouldBeBar = IfAny<'not any', 'foo', 'bar'>;
640
- //=> 'bar'
641
- ```
642
-
643
- @category Type Guard
644
- @category Utilities
645
- */
646
- type IfAny$1<T, TypeIfAny = true, TypeIfNotAny = false> = (IsAny<T> extends true ? TypeIfAny : TypeIfNotAny);
647
- //#endregion
648
- //#region ../../node_modules/type-fest/source/internal/type.d.ts
649
- // Should never happen
650
-
651
- /**
652
- An if-else-like type that resolves depending on whether the given type is `any` or `never`.
653
-
654
- @example
655
- ```
656
- // When `T` is a NOT `any` or `never` (like `string`) => Returns `IfNotAnyOrNever` branch
657
- type A = IfNotAnyOrNever<string, 'VALID', 'IS_ANY', 'IS_NEVER'>;
658
- //=> 'VALID'
659
-
660
- // When `T` is `any` => Returns `IfAny` branch
661
- type B = IfNotAnyOrNever<any, 'VALID', 'IS_ANY', 'IS_NEVER'>;
662
- //=> 'IS_ANY'
663
-
664
- // When `T` is `never` => Returns `IfNever` branch
665
- type C = IfNotAnyOrNever<never, 'VALID', 'IS_ANY', 'IS_NEVER'>;
666
- //=> 'IS_NEVER'
667
- ```
668
- */
669
- type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = IsAny<T> extends true ? IfAny : IsNever<T> extends true ? IfNever : IfNotAnyOrNever;
670
- //#endregion
671
658
  //#region ../../node_modules/type-fest/source/internal/object.d.ts
672
659
  /**
673
660
  Works similar to the built-in `Pick` utility type, except for the following differences:
@@ -759,8 +746,7 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
759
746
  // Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
760
747
  ```
761
748
  */
762
- 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>`
763
- >>;
749
+ 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>>>>;
764
750
  //#endregion
765
751
  //#region ../../node_modules/type-fest/source/except.d.ts
766
752
  /**
@@ -790,7 +776,7 @@ type Filtered = Filter<'bar', 'foo'>;
790
776
 
791
777
  @see {Except}
792
778
  */
793
- type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
779
+ type Filter<KeyType$1, ExcludeType> = IsEqual<KeyType$1, ExcludeType> extends true ? never : (KeyType$1 extends ExcludeType ? never : KeyType$1);
794
780
  type ExceptOptions = {
795
781
  /**
796
782
  Disallow assigning non-specified properties.
@@ -859,38 +845,6 @@ type PostPayload = Except<UserData, 'email'>;
859
845
  type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {}> = _Except<ObjectType, KeysType, ApplyDefaultOptions<ExceptOptions, DefaultExceptOptions, Options>>;
860
846
  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>> : {});
861
847
  //#endregion
862
- //#region ../../node_modules/type-fest/source/require-at-least-one.d.ts
863
- /**
864
- Create a type that requires at least one of the given keys. The remaining keys are kept as is.
865
-
866
- @example
867
- ```
868
- import type {RequireAtLeastOne} from 'type-fest';
869
-
870
- type Responder = {
871
- text?: () => string;
872
- json?: () => string;
873
- secure?: boolean;
874
- };
875
-
876
- const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
877
- json: () => '{"message": "ok"}',
878
- secure: true
879
- };
880
- ```
881
-
882
- @category Object
883
- */
884
- type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, IfNever$1<KeysType, never, _RequireAtLeastOne<ObjectType, IfAny$1<KeysType, keyof ObjectType, KeysType>>>>;
885
- type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = {
886
- // For each `Key` in `KeysType` make a mapped type:
887
- [Key in KeysType]-?: Required<Pick<ObjectType, Key>> &
888
- // 1. Make `Key`'s type required
889
- // 2. Make all other keys in `KeysType` optional
890
- Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] &
891
- // 3. Add the remaining keys not in `KeysType`
892
- Except<ObjectType, KeysType>;
893
- //#endregion
894
848
  //#region ../../node_modules/type-fest/source/set-required.d.ts
895
849
  /**
896
850
  Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type.
@@ -921,11 +875,13 @@ type ArrayExample = SetRequired<[number?, number?, number?], 0 | 1>;
921
875
 
922
876
  @category Object
923
877
  */
924
- type SetRequired<BaseType, Keys extends keyof BaseType> = BaseType extends UnknownArray ? SetArrayRequired<BaseType, Keys> extends infer ResultantArray ? IfArrayReadonly<BaseType, Readonly<ResultantArray>, ResultantArray> : never : Simplify<
878
+ type SetRequired<BaseType, Keys extends keyof BaseType> = (BaseType extends ((...arguments_: never) => any) ? (...arguments_: Parameters<BaseType>) => ReturnType<BaseType> : unknown) & _SetRequired<BaseType, Keys>;
879
+ type _SetRequired<BaseType, Keys extends keyof BaseType> = BaseType extends UnknownArray ? SetArrayRequired<BaseType, Keys> extends infer ResultantArray ? If<IsArrayReadonly<BaseType>, Readonly<ResultantArray>, ResultantArray> : never : Simplify<
925
880
  // Pick just the keys that are optional from the base type.
926
881
  Except<BaseType, Keys> &
927
882
  // Pick the keys that should be required from the base type and make them required.
928
883
  Required<HomomorphicPick<BaseType, Keys>>>;
884
+
929
885
  /**
930
886
  Remove the optional modifier from the specified keys in an array.
931
887
  */
@@ -942,6 +898,7 @@ type SetArrayRequired<TArray extends UnknownArray, Keys, Counter extends any[] =
942
898
  : never; // Should never happen
943
899
  //#endregion
944
900
  //#region ../core/src/types/options.d.ts
901
+ type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = { [Key in KeysType]-?: Required<Pick<ObjectType, Key>> & Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] & Except<ObjectType, KeysType>;
945
902
  /**
946
903
  * Adds an `unknown` index property to an interface.
947
904
  */
@@ -964,8 +921,8 @@ interface BaseOption<N extends string = string> {
964
921
  }
965
922
  /**
966
923
  * A generic {@link Option} with either a `name` or `value` as its primary identifier.
967
- * {@link OptionList}-type props on the {@link QueryBuilder} component accept this type,
968
- * but corresponding props passed down to subcomponents will always be translated
924
+ * {@link OptionList}-type props on the {@link react-querybuilder!QueryBuilder QueryBuilder} component accept this type,
925
+ * but corresponding props passed down to subcomponents will always be augmented
969
926
  * to {@link FullOption} first.
970
927
  *
971
928
  * @group Option Lists
@@ -977,11 +934,11 @@ type FlexibleOption<N extends string = string> = Simplify<WithUnknownIndex<Requi
977
934
  *
978
935
  * @group Option Lists
979
936
  */
980
- type ToFlexibleOption<Opt extends BaseOption | string> = WithUnknownIndex<RequireAtLeastOne<Opt extends string ? FlexibleOption<Opt> : Opt, "name" | "value">>;
937
+ type ToFlexibleOption<Opt$1 extends BaseOption | string> = WithUnknownIndex<RequireAtLeastOne<Opt$1 extends string ? FlexibleOption<Opt$1> : Opt$1, "name" | "value">>;
981
938
  /**
982
939
  * A generic {@link Option} requiring both `name` _and_ `value` properties.
983
940
  * Props that extend {@link OptionList} accept {@link BaseOption}, but
984
- * corresponding props sent to subcomponents will always be translated to this
941
+ * corresponding props sent to subcomponents will always be augmented to this
985
942
  * type first to ensure both `name` and `value` are available.
986
943
  *
987
944
  * NOTE: Do not extend from this type directly. Use {@link BaseFullOption}
@@ -1005,24 +962,24 @@ type BaseFullOption<N extends string = string> = Simplify<SetRequired<BaseOption
1005
962
  *
1006
963
  * @group Option Lists
1007
964
  */
1008
- type ToFullOption<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt : Opt extends BaseOption<infer IdentifierType> ? WithUnknownIndex<Opt & FullOption<IdentifierType>> : never;
965
+ type ToFullOption<Opt$1 extends BaseOption> = Opt$1 extends BaseFullOption ? Opt$1 : Opt$1 extends BaseOption<infer IdentifierType> ? WithUnknownIndex<Opt$1 & FullOption<IdentifierType>> : never;
1009
966
  /**
1010
967
  * A group of {@link Option}s, usually within an {@link OptionList}.
1011
968
  *
1012
969
  * @group Option Lists
1013
970
  */
1014
- interface OptionGroup<Opt extends BaseOption = FlexibleOption> {
971
+ interface OptionGroup<Opt$1 extends BaseOption = FlexibleOption> {
1015
972
  label: string;
1016
- options: WithUnknownIndex<Opt>[];
973
+ options: WithUnknownIndex<Opt$1>[];
1017
974
  }
1018
975
  /**
1019
976
  * A group of {@link BaseOption}s, usually within a {@link FlexibleOptionList}.
1020
977
  *
1021
978
  * @group Option Lists
1022
979
  */
1023
- type FlexibleOptionGroup<Opt extends BaseOption | string = BaseOption> = {
980
+ type FlexibleOptionGroup<Opt$1 extends BaseOption | string = BaseOption> = {
1024
981
  label: string;
1025
- options: (Opt extends BaseFullOption ? Opt : ToFlexibleOption<Opt>)[];
982
+ options: (Opt$1 extends BaseFullOption ? Opt$1 : ToFlexibleOption<Opt$1>)[];
1026
983
  };
1027
984
  /**
1028
985
  * An array of options or option groups, like {@link OptionList} but the option type
@@ -1030,7 +987,7 @@ type FlexibleOptionGroup<Opt extends BaseOption | string = BaseOption> = {
1030
987
  *
1031
988
  * @group Option Lists
1032
989
  */
1033
- type FlexibleOptionList<Opt extends BaseOption> = ToFlexibleOption<Opt>[] | FlexibleOptionGroup<ToFlexibleOption<Opt>>[];
990
+ type FlexibleOptionList<Opt$1 extends BaseOption> = ToFlexibleOption<Opt$1>[] | FlexibleOptionGroup<ToFlexibleOption<Opt$1>>[];
1034
991
  /**
1035
992
  * An array of options or option groups, like {@link OptionList}, but using
1036
993
  * {@link FullOption} instead of {@link Option}. This means that every member is
@@ -1038,7 +995,7 @@ type FlexibleOptionList<Opt extends BaseOption> = ToFlexibleOption<Opt>[] | Flex
1038
995
  *
1039
996
  * @group Option Lists
1040
997
  */
1041
- type FullOptionList<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt[] | OptionGroup<Opt>[] : ToFullOption<Opt>[] | OptionGroup<ToFullOption<Opt>>[];
998
+ type FullOptionList<Opt$1 extends BaseOption> = Opt$1 extends BaseFullOption ? Opt$1[] | OptionGroup<Opt$1>[] : ToFullOption<Opt$1>[] | OptionGroup<ToFullOption<Opt$1>>[];
1042
999
  //#endregion
1043
1000
  //#region ../core/src/types/ruleGroups.d.ts
1044
1001
  /**
@@ -1059,10 +1016,10 @@ interface CommonRuleAndGroupProperties {
1059
1016
  * The main rule type. The `field`, `operator`, and `value` properties
1060
1017
  * can be narrowed with generics.
1061
1018
  */
1062
- interface RuleType<F extends string = string, O extends string = string, V = any, C extends string = string> extends CommonRuleAndGroupProperties {
1019
+ interface RuleType<F extends string = string, O extends string = string, V$1 = any, C extends string = string> extends CommonRuleAndGroupProperties {
1063
1020
  field: F;
1064
1021
  operator: O;
1065
- value: V;
1022
+ value: V$1;
1066
1023
  valueSource?: ValueSource;
1067
1024
  match?: MatchConfig;
1068
1025
  /**
@@ -1155,7 +1112,7 @@ type Classname = string | string[] | Record<string, any>;
1155
1112
  */
1156
1113
  type ValueSource = "value" | "field";
1157
1114
  /**
1158
- * Type of {@link ValueEditor} that will be displayed.
1115
+ * Type of {@link react-querybuilder!ValueEditor ValueEditor} that will be displayed.
1159
1116
  */
1160
1117
  type ValueEditorType = "text" | "select" | "checkbox" | "radio" | "textarea" | "switch" | "multiselect" | null;
1161
1118
  /**
@@ -1206,7 +1163,7 @@ interface BaseFullField<FieldName extends string = string, OperatorName extends
1206
1163
  comparator?: string | ((f: FullField, operator: string) => boolean);
1207
1164
  }
1208
1165
  /**
1209
- * Full field definition used in the `fields` prop of {@link QueryBuilder}.
1166
+ * Full field definition used in the `fields` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
1210
1167
  * This type requires both `name` and `value`, but the `fields` prop itself
1211
1168
  * can use a {@link FlexibleOption} where only one of `name` or `value` is
1212
1169
  * required (along with `label`), or {@link Field} where only `name` and
@@ -1220,12 +1177,12 @@ interface BaseFullField<FieldName extends string = string, OperatorName extends
1220
1177
  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>>;
1221
1178
  /**
1222
1179
  * Allowed values of the {@link FullOperator} property `arity`. A value of `"unary"` or
1223
- * a number less than two will cause the default {@link ValueEditor} to render `null`.
1180
+ * a number less than two will cause the default {@link react-querybuilder!ValueEditor ValueEditor} to render `null`.
1224
1181
  */
1225
1182
  type Arity = number | "unary" | "binary" | "ternary";
1226
1183
  /**
1227
1184
  * Full operator definition used in the `operators`/`getOperators` props of
1228
- * {@link QueryBuilder}. This type requires both `name` and `value`, but the
1185
+ * {@link react-querybuilder!QueryBuilder QueryBuilder}. This type requires both `name` and `value`, but the
1229
1186
  * `operators`/`getOperators` props themselves can use a {@link FlexibleOption}
1230
1187
  * where only one of `name` or `value` is required, or {@link FullOperator} where
1231
1188
  * only `name` is required.
@@ -1244,7 +1201,7 @@ type ParseNumberMethodName = "enhanced" | "native" | "strict";
1244
1201
 
1245
1202
  type ParseNumbersModerationLevel = "-limited" | "";
1246
1203
  /**
1247
- * Options for the `parseNumbers` prop of {@link QueryBuilder}.
1204
+ * Options for the `parseNumbers` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
1248
1205
  */
1249
1206
  type ParseNumbersPropConfig = boolean | `${ParseNumberMethodName}${ParseNumbersModerationLevel}`;
1250
1207
  //#endregion
@@ -1352,11 +1309,11 @@ interface FormatQueryOptions {
1352
1309
  quoteValuesWith?: string;
1353
1310
  /**
1354
1311
  * Validator function for the entire query. Can be the same function passed
1355
- * as `validator` prop to {@link QueryBuilder}.
1312
+ * as `validator` prop to {@link react-querybuilder!QueryBuilder QueryBuilder}.
1356
1313
  */
1357
1314
  validator?: QueryValidator;
1358
1315
  /**
1359
- * This can be the same {@link FullField} array passed to {@link QueryBuilder}, but
1316
+ * This can be the same {@link FullField} array passed to {@link react-querybuilder!QueryBuilder QueryBuilder}, but
1360
1317
  * really all you need to provide is the `name` and `validator` for each field.
1361
1318
  *
1362
1319
  * The full field object from this array, where the field's identifying property
@@ -1364,7 +1321,7 @@ interface FormatQueryOptions {
1364
1321
  */
1365
1322
  fields?: FlexibleOptionList<FullField>;
1366
1323
  /**
1367
- * This can be the same `getOperators` function passed to {@link QueryBuilder}.
1324
+ * This can be the same `getOperators` function passed to {@link react-querybuilder!QueryBuilder QueryBuilder}.
1368
1325
  *
1369
1326
  * The full operator object from this array, where the operator's identifying property
1370
1327
  * matches the rule's `operator`, will be passed to the rule processor.
@@ -1755,5 +1712,5 @@ type RQBJsonLogicDateTimeOperations = {
1755
1712
  type IsDateFieldFunction = (...[rule, opts]: Parameters<RuleProcessor>) => boolean;
1756
1713
  type IsDateField = IsDateFieldFunction | Record<string, unknown> | Record<string, unknown>[] | boolean | undefined;
1757
1714
  //#endregion
1758
- export { ExportOperatorMap, IsDateField, IsDateFieldFunction, RQBDateTimeJsonLogic, RQBDateTimeLibraryAPI, RQBJsonLogicDateAfter, RQBJsonLogicDateBefore, RQBJsonLogicDateBetween, RQBJsonLogicDateIn, RQBJsonLogicDateNotBetween, RQBJsonLogicDateNotIn, RQBJsonLogicDateNotOn, RQBJsonLogicDateOn, RQBJsonLogicDateOnOrAfter, RQBJsonLogicDateOnOrBefore, RQBJsonLogicDateTimeOperations, RuleProcessor, ValueProcessorByRule };
1759
- //# sourceMappingURL=types-BQXdgbuB.d.mts.map
1715
+ export { RuleProcessor as _, RQBJsonLogicDateAfter as a, RQBJsonLogicDateIn as c, RQBJsonLogicDateNotOn as d, RQBJsonLogicDateOn as f, ExportOperatorMap as g, RQBJsonLogicDateTimeOperations as h, RQBDateTimeLibraryAPI as i, RQBJsonLogicDateNotBetween as l, RQBJsonLogicDateOnOrBefore as m, IsDateFieldFunction as n, RQBJsonLogicDateBefore as o, RQBJsonLogicDateOnOrAfter as p, RQBDateTimeJsonLogic as r, RQBJsonLogicDateBetween as s, IsDateField as t, RQBJsonLogicDateNotIn as u, ValueProcessorByRule as v };
1716
+ //# sourceMappingURL=types-Dq7BlQzI.d.ts.map