@react-querybuilder/datetime 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.
- package/date-fns/package.json +4 -0
- package/dayjs/package.json +4 -0
- package/dist/cjs/{getDatetimeRuleProcessorSQL-B0uQUU_F.js → getDatetimeRuleProcessorSQL-xGETy1ec.js} +1 -1
- package/dist/cjs/{getDatetimeRuleProcessorSQL-B0uQUU_F.js.map → getDatetimeRuleProcessorSQL-xGETy1ec.js.map} +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.d.ts +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.date-fns.d.ts +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.d.ts +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js +10 -6
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.d.ts +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.d.ts +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.d.ts +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.d.ts +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.date-fns.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.d.ts +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.dayjs.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.d.ts +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.jsdate.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.d.ts +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.luxon.js +1 -1
- package/dist/cjs/{types-BF3ibCEu.d.ts → types-BWNR3hk5.d.ts} +96 -95
- package/dist/{getDatetimeRuleProcessorSQL-DfPnCZiT.js → getDatetimeRuleProcessorSQL-CtUjFtho.js} +6 -6
- package/dist/{getDatetimeRuleProcessorSQL-DfPnCZiT.js.map → getDatetimeRuleProcessorSQL-CtUjFtho.js.map} +1 -1
- package/dist/{getDatetimeRuleProcessorSQL-Cf79Th_c.mjs → getDatetimeRuleProcessorSQL-CugqyF_a.mjs} +1 -1
- package/dist/{getDatetimeRuleProcessorSQL-Cf79Th_c.mjs.map → getDatetimeRuleProcessorSQL-CugqyF_a.mjs.map} +1 -1
- package/dist/getDatetimeRuleProcessorSQL-Dcqi5kh5.mjs +2 -0
- package/dist/getDatetimeRuleProcessorSQL-Dcqi5kh5.mjs.map +1 -0
- package/dist/react-querybuilder_datetime.d.mts +1 -1
- package/dist/react-querybuilder_datetime.date-fns.d.mts +1 -1
- package/dist/react-querybuilder_datetime.date-fns.mjs +1 -1
- package/dist/react-querybuilder_datetime.dayjs.d.mts +1 -1
- package/dist/react-querybuilder_datetime.dayjs.mjs +1 -1
- package/dist/react-querybuilder_datetime.jsdate.d.mts +1 -1
- package/dist/react-querybuilder_datetime.jsdate.mjs +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.d.ts +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.d.ts +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.date-fns.js +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.d.ts +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.dayjs.js +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.js +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.d.ts +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.jsdate.js +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.d.ts +1 -1
- package/dist/react-querybuilder_datetime.legacy-esm.luxon.js +1 -1
- package/dist/react-querybuilder_datetime.luxon.d.mts +1 -1
- package/dist/react-querybuilder_datetime.luxon.mjs +1 -1
- package/dist/react-querybuilder_datetime.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.d.mts +1 -1
- package/dist/react-querybuilder_datetime.production.date-fns.d.mts +1 -1
- package/dist/react-querybuilder_datetime.production.date-fns.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.dayjs.d.mts +1 -1
- package/dist/react-querybuilder_datetime.production.dayjs.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.jsdate.d.mts +1 -1
- package/dist/react-querybuilder_datetime.production.jsdate.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.luxon.d.mts +1 -1
- package/dist/react-querybuilder_datetime.production.luxon.mjs +1 -1
- package/dist/react-querybuilder_datetime.production.mjs +1 -1
- package/dist/{types-CU16s8jw.d.ts → types-BO9Xuapi.d.mts} +96 -95
- package/dist/{types-DNawVAiI.d.mts → types-h3_NfrpO.d.ts} +96 -95
- package/jsdate/package.json +4 -0
- package/luxon/package.json +4 -0
- package/package.json +13 -9
- package/dist/chunk-DrjzjjTJ.mjs +0 -23
- package/dist/chunk-Dv2ph0Ay.js +0 -23
|
@@ -18,34 +18,6 @@ type Intersection = UnionToIntersection<Union>;
|
|
|
18
18
|
//=> {the(): void; great(arg: string): void; escape: boolean};
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
-
A more applicable example which could make its way into your library code follows.
|
|
22
|
-
|
|
23
|
-
@example
|
|
24
|
-
```
|
|
25
|
-
import type {UnionToIntersection} from 'type-fest';
|
|
26
|
-
|
|
27
|
-
class CommandOne {
|
|
28
|
-
commands: {
|
|
29
|
-
a1: () => undefined,
|
|
30
|
-
b1: () => undefined,
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
class CommandTwo {
|
|
35
|
-
commands: {
|
|
36
|
-
a2: (argA: string) => undefined,
|
|
37
|
-
b2: (argB: string) => undefined,
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const union = [new CommandOne(), new CommandTwo()].map(instance => instance.commands);
|
|
42
|
-
type Union = typeof union;
|
|
43
|
-
//=> {a1(): void; b1(): void} | {a2(argA: string): void; b2(argB: string): void}
|
|
44
|
-
|
|
45
|
-
type Intersection = UnionToIntersection<Union>;
|
|
46
|
-
//=> {a1(): void; b1(): void; a2(argA: string): void; b2(argB: string): void}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
21
|
@category Type
|
|
50
22
|
*/
|
|
51
23
|
type UnionToIntersection<Union> = (
|
|
@@ -121,8 +93,8 @@ import type {IsAny} from 'type-fest';
|
|
|
121
93
|
const typedObject = {a: 1, b: 2} as const;
|
|
122
94
|
const anyObject: any = {a: 1, b: 2};
|
|
123
95
|
|
|
124
|
-
function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(
|
|
125
|
-
return
|
|
96
|
+
function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(object: O, key: K) {
|
|
97
|
+
return object[key];
|
|
126
98
|
}
|
|
127
99
|
|
|
128
100
|
const typedA = get(typedObject, 'a');
|
|
@@ -147,17 +119,17 @@ This is useful when writing utility types or schema validators that need to diff
|
|
|
147
119
|
```
|
|
148
120
|
import type {IsOptionalKeyOf} from 'type-fest';
|
|
149
121
|
|
|
150
|
-
|
|
122
|
+
type User = {
|
|
151
123
|
name: string;
|
|
152
124
|
surname: string;
|
|
153
125
|
|
|
154
126
|
luckyNumber?: number;
|
|
155
|
-
}
|
|
127
|
+
};
|
|
156
128
|
|
|
157
|
-
|
|
129
|
+
type Admin = {
|
|
158
130
|
name: string;
|
|
159
131
|
surname?: string;
|
|
160
|
-
}
|
|
132
|
+
};
|
|
161
133
|
|
|
162
134
|
type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
|
|
163
135
|
//=> true
|
|
@@ -190,12 +162,12 @@ This is useful when you want to create a new type that contains different type v
|
|
|
190
162
|
```
|
|
191
163
|
import type {OptionalKeysOf, Except} from 'type-fest';
|
|
192
164
|
|
|
193
|
-
|
|
165
|
+
type User = {
|
|
194
166
|
name: string;
|
|
195
167
|
surname: string;
|
|
196
168
|
|
|
197
169
|
luckyNumber?: number;
|
|
198
|
-
}
|
|
170
|
+
};
|
|
199
171
|
|
|
200
172
|
const REMOVE_FIELD = Symbol('remove field symbol');
|
|
201
173
|
type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
|
|
@@ -203,12 +175,12 @@ type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKe
|
|
|
203
175
|
};
|
|
204
176
|
|
|
205
177
|
const update1: UpdateOperation<User> = {
|
|
206
|
-
name: 'Alice'
|
|
178
|
+
name: 'Alice',
|
|
207
179
|
};
|
|
208
180
|
|
|
209
181
|
const update2: UpdateOperation<User> = {
|
|
210
182
|
name: 'Bob',
|
|
211
|
-
luckyNumber: REMOVE_FIELD
|
|
183
|
+
luckyNumber: REMOVE_FIELD,
|
|
212
184
|
};
|
|
213
185
|
```
|
|
214
186
|
|
|
@@ -228,17 +200,23 @@ This is useful when you want to create a new type that contains different type v
|
|
|
228
200
|
```
|
|
229
201
|
import type {RequiredKeysOf} from 'type-fest';
|
|
230
202
|
|
|
231
|
-
declare function createValidation<
|
|
203
|
+
declare function createValidation<
|
|
204
|
+
Entity extends object,
|
|
205
|
+
Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
|
|
206
|
+
>(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
|
|
232
207
|
|
|
233
|
-
|
|
208
|
+
type User = {
|
|
234
209
|
name: string;
|
|
235
210
|
surname: string;
|
|
236
|
-
|
|
237
211
|
luckyNumber?: number;
|
|
238
|
-
}
|
|
212
|
+
};
|
|
239
213
|
|
|
240
214
|
const validator1 = createValidation<User>('name', value => value.length < 25);
|
|
241
215
|
const validator2 = createValidation<User>('surname', value => value.length < 25);
|
|
216
|
+
|
|
217
|
+
// @ts-expect-error
|
|
218
|
+
const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
219
|
+
// Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
|
|
242
220
|
```
|
|
243
221
|
|
|
244
222
|
@category Utilities
|
|
@@ -260,29 +238,41 @@ Useful in type utilities, such as checking if something does not occur.
|
|
|
260
238
|
```
|
|
261
239
|
import type {IsNever, And} from 'type-fest';
|
|
262
240
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
And<
|
|
266
|
-
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
267
|
-
IsNever<Exclude<B, A>> extends true ? true : false
|
|
268
|
-
>;
|
|
269
|
-
|
|
270
|
-
type EndIfEqual<I extends string, O extends string> =
|
|
271
|
-
AreStringsEqual<I, O> extends true
|
|
272
|
-
? never
|
|
273
|
-
: void;
|
|
274
|
-
|
|
275
|
-
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
276
|
-
if (input === output) {
|
|
277
|
-
process.exit(0);
|
|
278
|
-
}
|
|
279
|
-
}
|
|
241
|
+
type A = IsNever<never>;
|
|
242
|
+
//=> true
|
|
280
243
|
|
|
281
|
-
|
|
282
|
-
//=>
|
|
244
|
+
type B = IsNever<any>;
|
|
245
|
+
//=> false
|
|
246
|
+
|
|
247
|
+
type C = IsNever<unknown>;
|
|
248
|
+
//=> false
|
|
249
|
+
|
|
250
|
+
type D = IsNever<never[]>;
|
|
251
|
+
//=> false
|
|
252
|
+
|
|
253
|
+
type E = IsNever<object>;
|
|
254
|
+
//=> false
|
|
283
255
|
|
|
284
|
-
|
|
285
|
-
//=>
|
|
256
|
+
type F = IsNever<string>;
|
|
257
|
+
//=> false
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
@example
|
|
261
|
+
```
|
|
262
|
+
import type {IsNever} from 'type-fest';
|
|
263
|
+
|
|
264
|
+
type IsTrue<T> = T extends true ? true : false;
|
|
265
|
+
|
|
266
|
+
// When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
|
|
267
|
+
type A = IsTrue<never>;
|
|
268
|
+
// ^? type A = never
|
|
269
|
+
|
|
270
|
+
// If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
|
|
271
|
+
type IsTrueFixed<T> =
|
|
272
|
+
IsNever<T> extends true ? false : T extends true ? true : false;
|
|
273
|
+
|
|
274
|
+
type B = IsTrueFixed<never>;
|
|
275
|
+
// ^? type B = false
|
|
286
276
|
```
|
|
287
277
|
|
|
288
278
|
@category Type Guard
|
|
@@ -303,7 +293,7 @@ Note:
|
|
|
303
293
|
|
|
304
294
|
@example
|
|
305
295
|
```
|
|
306
|
-
import {If} from 'type-fest';
|
|
296
|
+
import type {If} from 'type-fest';
|
|
307
297
|
|
|
308
298
|
type A = If<true, 'yes', 'no'>;
|
|
309
299
|
//=> 'yes'
|
|
@@ -323,7 +313,7 @@ type E = If<never, 'yes', 'no'>;
|
|
|
323
313
|
|
|
324
314
|
@example
|
|
325
315
|
```
|
|
326
|
-
import {If, IsAny, IsNever} from 'type-fest';
|
|
316
|
+
import type {If, IsAny, IsNever} from 'type-fest';
|
|
327
317
|
|
|
328
318
|
type A = If<IsAny<unknown>, 'is any', 'not any'>;
|
|
329
319
|
//=> 'not any'
|
|
@@ -334,7 +324,7 @@ type B = If<IsNever<never>, 'is never', 'not never'>;
|
|
|
334
324
|
|
|
335
325
|
@example
|
|
336
326
|
```
|
|
337
|
-
import {If, IsEqual} from 'type-fest';
|
|
327
|
+
import type {If, IsEqual} from 'type-fest';
|
|
338
328
|
|
|
339
329
|
type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
|
|
340
330
|
|
|
@@ -465,10 +455,11 @@ const literal = {foo: 123, bar: 'hello', baz: 456};
|
|
|
465
455
|
const someType: SomeType = literal;
|
|
466
456
|
const someInterface: SomeInterface = literal;
|
|
467
457
|
|
|
468
|
-
function fn(object: Record<string, unknown>): void
|
|
458
|
+
declare function fn(object: Record<string, unknown>): void;
|
|
469
459
|
|
|
470
460
|
fn(literal); // Good: literal object type is sealed
|
|
471
461
|
fn(someType); // Good: type is sealed
|
|
462
|
+
// @ts-expect-error
|
|
472
463
|
fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
|
|
473
464
|
fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
|
|
474
465
|
```
|
|
@@ -506,7 +497,7 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
506
497
|
@category Type Guard
|
|
507
498
|
@category Utilities
|
|
508
499
|
*/
|
|
509
|
-
type IsEqual<A, B> = [A
|
|
500
|
+
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
510
501
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
511
502
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
512
503
|
//#endregion
|
|
@@ -528,6 +519,7 @@ It relies on the fact that an empty object (`{}`) is assignable to an object wit
|
|
|
528
519
|
```
|
|
529
520
|
const indexed: Record<string, unknown> = {}; // Allowed
|
|
530
521
|
|
|
522
|
+
// @ts-expect-error
|
|
531
523
|
const keyed: Record<'foo', unknown> = {}; // Error
|
|
532
524
|
// => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
|
|
533
525
|
```
|
|
@@ -541,16 +533,14 @@ type Indexed = {} extends Record<string, unknown>
|
|
|
541
533
|
// => '✅ `{}` is assignable to `Record<string, unknown>`'
|
|
542
534
|
|
|
543
535
|
type Keyed = {} extends Record<'foo' | 'bar', unknown>
|
|
544
|
-
?
|
|
545
|
-
:
|
|
536
|
+
? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`'
|
|
537
|
+
: '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`';
|
|
546
538
|
// => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"
|
|
547
539
|
```
|
|
548
540
|
|
|
549
541
|
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`...
|
|
550
542
|
|
|
551
543
|
```
|
|
552
|
-
import type {OmitIndexSignature} from 'type-fest';
|
|
553
|
-
|
|
554
544
|
type OmitIndexSignature<ObjectType> = {
|
|
555
545
|
[KeyType in keyof ObjectType // Map each key of `ObjectType`...
|
|
556
546
|
]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
|
|
@@ -560,14 +550,12 @@ type OmitIndexSignature<ObjectType> = {
|
|
|
560
550
|
...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
|
|
561
551
|
|
|
562
552
|
```
|
|
563
|
-
import type {OmitIndexSignature} from 'type-fest';
|
|
564
|
-
|
|
565
553
|
type OmitIndexSignature<ObjectType> = {
|
|
566
554
|
[KeyType in keyof ObjectType
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
555
|
+
// Is `{}` assignable to `Record<KeyType, unknown>`?
|
|
556
|
+
as {} extends Record<KeyType, unknown>
|
|
557
|
+
? never // ✅ `{}` is assignable to `Record<KeyType, unknown>`
|
|
558
|
+
: KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
|
|
571
559
|
]: ObjectType[KeyType];
|
|
572
560
|
};
|
|
573
561
|
```
|
|
@@ -578,21 +566,21 @@ If `{}` is assignable, it means that `KeyType` is an index signature and we want
|
|
|
578
566
|
```
|
|
579
567
|
import type {OmitIndexSignature} from 'type-fest';
|
|
580
568
|
|
|
581
|
-
|
|
569
|
+
type Example = {
|
|
582
570
|
// These index signatures will be removed.
|
|
583
|
-
[x: string]: any
|
|
584
|
-
[x: number]: any
|
|
585
|
-
[x: symbol]: any
|
|
586
|
-
[x: `head-${string}`]: string
|
|
587
|
-
[x: `${string}-tail`]: string
|
|
588
|
-
[x: `head-${string}-tail`]: string
|
|
589
|
-
[x: `${bigint}`]: string
|
|
590
|
-
[x: `embedded-${number}`]: string
|
|
571
|
+
[x: string]: any;
|
|
572
|
+
[x: number]: any;
|
|
573
|
+
[x: symbol]: any;
|
|
574
|
+
[x: `head-${string}`]: string;
|
|
575
|
+
[x: `${string}-tail`]: string;
|
|
576
|
+
[x: `head-${string}-tail`]: string;
|
|
577
|
+
[x: `${bigint}`]: string;
|
|
578
|
+
[x: `embedded-${number}`]: string;
|
|
591
579
|
|
|
592
580
|
// These explicitly defined keys will remain.
|
|
593
581
|
foo: 'bar';
|
|
594
582
|
qux?: 'baz';
|
|
595
|
-
}
|
|
583
|
+
};
|
|
596
584
|
|
|
597
585
|
type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
598
586
|
// => { foo: 'bar'; qux?: 'baz' | undefined; }
|
|
@@ -662,12 +650,12 @@ Merge two types into a new type. Keys of the second type overrides keys of the f
|
|
|
662
650
|
```
|
|
663
651
|
import type {Merge} from 'type-fest';
|
|
664
652
|
|
|
665
|
-
|
|
653
|
+
type Foo = {
|
|
666
654
|
[x: string]: unknown;
|
|
667
655
|
[x: number]: unknown;
|
|
668
656
|
foo: string;
|
|
669
657
|
bar: symbol;
|
|
670
|
-
}
|
|
658
|
+
};
|
|
671
659
|
|
|
672
660
|
type Bar = {
|
|
673
661
|
[x: number]: number;
|
|
@@ -846,12 +834,14 @@ type Foo = {
|
|
|
846
834
|
type FooWithoutA = Except<Foo, 'a'>;
|
|
847
835
|
//=> {b: string}
|
|
848
836
|
|
|
837
|
+
// @ts-expect-error
|
|
849
838
|
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
850
839
|
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
851
840
|
|
|
852
841
|
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
853
842
|
//=> {a: number} & Partial<Record<"b", never>>
|
|
854
843
|
|
|
844
|
+
// @ts-expect-error
|
|
855
845
|
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
856
846
|
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
857
847
|
|
|
@@ -868,12 +858,12 @@ type UserData = {
|
|
|
868
858
|
|
|
869
859
|
// `Omit` clearly doesn't behave as expected in this case:
|
|
870
860
|
type PostPayload = Omit<UserData, 'email'>;
|
|
871
|
-
//=>
|
|
861
|
+
//=> { [x: string]: string; [x: number]: string; }
|
|
872
862
|
|
|
873
863
|
// In situations like this, `Except` works better.
|
|
874
864
|
// It simply removes the `email` key while preserving all the other keys.
|
|
875
|
-
type
|
|
876
|
-
//=>
|
|
865
|
+
type PostPayloadFixed = Except<UserData, 'email'>;
|
|
866
|
+
//=> { [x: string]: string; name: string; role: 'admin' | 'user'; }
|
|
877
867
|
```
|
|
878
868
|
|
|
879
869
|
@category Object
|
|
@@ -895,7 +885,7 @@ type Foo = {
|
|
|
895
885
|
a?: number;
|
|
896
886
|
b: string;
|
|
897
887
|
c?: boolean;
|
|
898
|
-
}
|
|
888
|
+
};
|
|
899
889
|
|
|
900
890
|
type SomeRequired = SetRequired<Foo, 'b' | 'c'>;
|
|
901
891
|
// type SomeRequired = {
|
|
@@ -1638,6 +1628,17 @@ type ZeroOrMoreGroupVariants = RepeatStrings<["xor", "not"]>;
|
|
|
1638
1628
|
*/
|
|
1639
1629
|
type NLTranslationKey = "and" | "or" | "true" | "false" | `groupPrefix${ZeroOrMoreGroupVariants}` | `groupSuffix${ZeroOrMoreGroupVariants}`;
|
|
1640
1630
|
//#endregion
|
|
1631
|
+
//#region ../react-querybuilder/src/redux/getRqbStore.d.ts
|
|
1632
|
+
declare global {
|
|
1633
|
+
var __RQB_DEVTOOLS__: boolean | undefined;
|
|
1634
|
+
}
|
|
1635
|
+
/**
|
|
1636
|
+
* Gets the singleton React Query Builder store instance.
|
|
1637
|
+
* DevTools are enabled if either:
|
|
1638
|
+
* - globalThis.__RQB_DEVTOOLS__ is truthy
|
|
1639
|
+
* - window.__RQB_DEVTOOLS__ is truthy
|
|
1640
|
+
*/
|
|
1641
|
+
//#endregion
|
|
1641
1642
|
//#region src/types.d.ts
|
|
1642
1643
|
interface RQBJsonLogicDateBetween {
|
|
1643
1644
|
dateBetween: [RQBJsonLogic, RQBJsonLogic, RQBJsonLogic];
|
|
@@ -1749,4 +1750,4 @@ type IsDateFieldFunction = (...[rule, opts]: Parameters<RuleProcessor>) => boole
|
|
|
1749
1750
|
type IsDateField = IsDateFieldFunction | Record<string, unknown> | Record<string, unknown>[] | boolean | undefined;
|
|
1750
1751
|
//#endregion
|
|
1751
1752
|
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 };
|
|
1752
|
-
//# sourceMappingURL=types-
|
|
1753
|
+
//# sourceMappingURL=types-h3_NfrpO.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-querybuilder/datetime",
|
|
3
3
|
"description": "Date/time features for react-querybuilder",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.13.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -62,7 +62,11 @@
|
|
|
62
62
|
},
|
|
63
63
|
"types": "./dist/react-querybuilder_datetime.legacy-esm.d.ts",
|
|
64
64
|
"files": [
|
|
65
|
-
"dist"
|
|
65
|
+
"dist",
|
|
66
|
+
"dayjs",
|
|
67
|
+
"date-fns",
|
|
68
|
+
"jsdate",
|
|
69
|
+
"luxon"
|
|
66
70
|
],
|
|
67
71
|
"license": "MIT",
|
|
68
72
|
"sideEffects": false,
|
|
@@ -92,28 +96,28 @@
|
|
|
92
96
|
"@testing-library/react": "^16.3.0",
|
|
93
97
|
"@testing-library/user-event": "14.5.2",
|
|
94
98
|
"@types/luxon": "^3.7.1",
|
|
95
|
-
"@types/react": "^19.2.
|
|
96
|
-
"@vitejs/plugin-react": "^5.1.
|
|
99
|
+
"@types/react": "^19.2.7",
|
|
100
|
+
"@vitejs/plugin-react": "^5.1.1",
|
|
97
101
|
"date-fns": "^4.1.0",
|
|
98
102
|
"dayjs": "^1.11.19",
|
|
99
103
|
"json-logic-js": "^2.0.5",
|
|
100
104
|
"jsonata": "^2.1.0",
|
|
101
105
|
"luxon": "^3.7.2",
|
|
102
106
|
"mongodb-memory-server-core": "^10.3.0",
|
|
103
|
-
"mongoose": "^
|
|
107
|
+
"mongoose": "^9.0.0",
|
|
104
108
|
"react": "^19.2.0",
|
|
105
109
|
"react-dom": "^19.2.0",
|
|
106
|
-
"react-querybuilder": "8.
|
|
110
|
+
"react-querybuilder": "8.13.0",
|
|
107
111
|
"rollup-plugin-visualizer": "^6.0.5",
|
|
108
112
|
"typescript": "^5.9.3",
|
|
109
|
-
"vite": "^7.2.
|
|
113
|
+
"vite": "^7.2.6"
|
|
110
114
|
},
|
|
111
115
|
"peerDependencies": {
|
|
112
116
|
"date-fns": "^4.1.0",
|
|
113
117
|
"dayjs": "^1.11.13",
|
|
114
118
|
"luxon": "^3.5.0",
|
|
115
119
|
"react": ">=18",
|
|
116
|
-
"react-querybuilder": "8.
|
|
120
|
+
"react-querybuilder": "8.13.0"
|
|
117
121
|
},
|
|
118
122
|
"peerDependenciesMeta": {
|
|
119
123
|
"date-fns": {
|
|
@@ -126,5 +130,5 @@
|
|
|
126
130
|
"optional": true
|
|
127
131
|
}
|
|
128
132
|
},
|
|
129
|
-
"gitHead": "
|
|
133
|
+
"gitHead": "96a494f99af53de9de8c647d1895e9d05f3f74a9"
|
|
130
134
|
}
|
package/dist/chunk-DrjzjjTJ.mjs
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
//#endregion
|
package/dist/chunk-Dv2ph0Ay.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
|
|
23
|
-
//#endregion
|