@react-querybuilder/datetime 8.11.2 → 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-COEhnVIZ.js → getDatetimeRuleProcessorSQL-Dkg4HEtH.js} +2 -31
- package/dist/cjs/{getDatetimeRuleProcessorSQL-COEhnVIZ.js.map → getDatetimeRuleProcessorSQL-Dkg4HEtH.js.map} +1 -1
- package/dist/cjs/getDatetimeRuleProcessorSQL-xGETy1ec.js +2 -0
- package/dist/cjs/{getDatetimeRuleProcessorSQL-CSxxM8ce.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.date-fns.js +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.d.ts +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js +30 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.dayjs.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.js +2 -2
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.d.ts +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.jsdate.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.d.ts +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.development.luxon.js +2 -2
- 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.date-fns.js.map +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.dayjs.js.map +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_datetime.cjs.production.js.map +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/react-querybuilder_datetime.cjs.production.luxon.js.map +1 -1
- package/dist/cjs/{types-A60rB27l.d.ts → types-BWNR3hk5.d.ts} +134 -98
- package/dist/{getDatetimeRuleProcessorSQL-B8y0RI7t.js → getDatetimeRuleProcessorSQL-CtUjFtho.js} +6 -6
- package/dist/{getDatetimeRuleProcessorSQL-B8y0RI7t.js.map → getDatetimeRuleProcessorSQL-CtUjFtho.js.map} +1 -1
- package/dist/{getDatetimeRuleProcessorSQL-CSl2zGza.mjs → getDatetimeRuleProcessorSQL-CugqyF_a.mjs} +1 -1
- package/dist/{getDatetimeRuleProcessorSQL-CSl2zGza.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-BjHLhGXX.d.mts → types-BO9Xuapi.d.mts} +155 -118
- package/dist/{types-Dq7BlQzI.d.ts → types-h3_NfrpO.d.ts} +155 -118
- package/jsdate/package.json +4 -0
- package/luxon/package.json +4 -0
- package/package.json +16 -12
- package/dist/cjs/getDatetimeRuleProcessorSQL-CSxxM8ce.js +0 -2
|
@@ -17,34 +17,6 @@ type Intersection = UnionToIntersection<Union>;
|
|
|
17
17
|
//=> {the(): void; great(arg: string): void; escape: boolean};
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
A more applicable example which could make its way into your library code follows.
|
|
21
|
-
|
|
22
|
-
@example
|
|
23
|
-
```
|
|
24
|
-
import type {UnionToIntersection} from 'type-fest';
|
|
25
|
-
|
|
26
|
-
class CommandOne {
|
|
27
|
-
commands: {
|
|
28
|
-
a1: () => undefined,
|
|
29
|
-
b1: () => undefined,
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
class CommandTwo {
|
|
34
|
-
commands: {
|
|
35
|
-
a2: (argA: string) => undefined,
|
|
36
|
-
b2: (argB: string) => undefined,
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const union = [new CommandOne(), new CommandTwo()].map(instance => instance.commands);
|
|
41
|
-
type Union = typeof union;
|
|
42
|
-
//=> {a1(): void; b1(): void} | {a2(argA: string): void; b2(argB: string): void}
|
|
43
|
-
|
|
44
|
-
type Intersection = UnionToIntersection<Union>;
|
|
45
|
-
//=> {a1(): void; b1(): void; a2(argA: string): void; b2(argB: string): void}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
20
|
@category Type
|
|
49
21
|
*/
|
|
50
22
|
type UnionToIntersection<Union> = (
|
|
@@ -120,8 +92,8 @@ import type {IsAny} from 'type-fest';
|
|
|
120
92
|
const typedObject = {a: 1, b: 2} as const;
|
|
121
93
|
const anyObject: any = {a: 1, b: 2};
|
|
122
94
|
|
|
123
|
-
function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(
|
|
124
|
-
return
|
|
95
|
+
function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(object: O, key: K) {
|
|
96
|
+
return object[key];
|
|
125
97
|
}
|
|
126
98
|
|
|
127
99
|
const typedA = get(typedObject, 'a');
|
|
@@ -146,17 +118,17 @@ This is useful when writing utility types or schema validators that need to diff
|
|
|
146
118
|
```
|
|
147
119
|
import type {IsOptionalKeyOf} from 'type-fest';
|
|
148
120
|
|
|
149
|
-
|
|
121
|
+
type User = {
|
|
150
122
|
name: string;
|
|
151
123
|
surname: string;
|
|
152
124
|
|
|
153
125
|
luckyNumber?: number;
|
|
154
|
-
}
|
|
126
|
+
};
|
|
155
127
|
|
|
156
|
-
|
|
128
|
+
type Admin = {
|
|
157
129
|
name: string;
|
|
158
130
|
surname?: string;
|
|
159
|
-
}
|
|
131
|
+
};
|
|
160
132
|
|
|
161
133
|
type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
|
|
162
134
|
//=> true
|
|
@@ -189,12 +161,12 @@ This is useful when you want to create a new type that contains different type v
|
|
|
189
161
|
```
|
|
190
162
|
import type {OptionalKeysOf, Except} from 'type-fest';
|
|
191
163
|
|
|
192
|
-
|
|
164
|
+
type User = {
|
|
193
165
|
name: string;
|
|
194
166
|
surname: string;
|
|
195
167
|
|
|
196
168
|
luckyNumber?: number;
|
|
197
|
-
}
|
|
169
|
+
};
|
|
198
170
|
|
|
199
171
|
const REMOVE_FIELD = Symbol('remove field symbol');
|
|
200
172
|
type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
|
|
@@ -202,12 +174,12 @@ type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKe
|
|
|
202
174
|
};
|
|
203
175
|
|
|
204
176
|
const update1: UpdateOperation<User> = {
|
|
205
|
-
name: 'Alice'
|
|
177
|
+
name: 'Alice',
|
|
206
178
|
};
|
|
207
179
|
|
|
208
180
|
const update2: UpdateOperation<User> = {
|
|
209
181
|
name: 'Bob',
|
|
210
|
-
luckyNumber: REMOVE_FIELD
|
|
182
|
+
luckyNumber: REMOVE_FIELD,
|
|
211
183
|
};
|
|
212
184
|
```
|
|
213
185
|
|
|
@@ -227,17 +199,23 @@ This is useful when you want to create a new type that contains different type v
|
|
|
227
199
|
```
|
|
228
200
|
import type {RequiredKeysOf} from 'type-fest';
|
|
229
201
|
|
|
230
|
-
declare function createValidation<
|
|
202
|
+
declare function createValidation<
|
|
203
|
+
Entity extends object,
|
|
204
|
+
Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
|
|
205
|
+
>(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
|
|
231
206
|
|
|
232
|
-
|
|
207
|
+
type User = {
|
|
233
208
|
name: string;
|
|
234
209
|
surname: string;
|
|
235
|
-
|
|
236
210
|
luckyNumber?: number;
|
|
237
|
-
}
|
|
211
|
+
};
|
|
238
212
|
|
|
239
213
|
const validator1 = createValidation<User>('name', value => value.length < 25);
|
|
240
214
|
const validator2 = createValidation<User>('surname', value => value.length < 25);
|
|
215
|
+
|
|
216
|
+
// @ts-expect-error
|
|
217
|
+
const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
218
|
+
// Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
|
|
241
219
|
```
|
|
242
220
|
|
|
243
221
|
@category Utilities
|
|
@@ -259,29 +237,41 @@ Useful in type utilities, such as checking if something does not occur.
|
|
|
259
237
|
```
|
|
260
238
|
import type {IsNever, And} from 'type-fest';
|
|
261
239
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
And<
|
|
265
|
-
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
266
|
-
IsNever<Exclude<B, A>> extends true ? true : false
|
|
267
|
-
>;
|
|
268
|
-
|
|
269
|
-
type EndIfEqual<I extends string, O extends string> =
|
|
270
|
-
AreStringsEqual<I, O> extends true
|
|
271
|
-
? never
|
|
272
|
-
: void;
|
|
273
|
-
|
|
274
|
-
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
275
|
-
if (input === output) {
|
|
276
|
-
process.exit(0);
|
|
277
|
-
}
|
|
278
|
-
}
|
|
240
|
+
type A = IsNever<never>;
|
|
241
|
+
//=> true
|
|
279
242
|
|
|
280
|
-
|
|
281
|
-
//=>
|
|
243
|
+
type B = IsNever<any>;
|
|
244
|
+
//=> false
|
|
245
|
+
|
|
246
|
+
type C = IsNever<unknown>;
|
|
247
|
+
//=> false
|
|
248
|
+
|
|
249
|
+
type D = IsNever<never[]>;
|
|
250
|
+
//=> false
|
|
251
|
+
|
|
252
|
+
type E = IsNever<object>;
|
|
253
|
+
//=> false
|
|
254
|
+
|
|
255
|
+
type F = IsNever<string>;
|
|
256
|
+
//=> false
|
|
257
|
+
```
|
|
282
258
|
|
|
283
|
-
|
|
284
|
-
|
|
259
|
+
@example
|
|
260
|
+
```
|
|
261
|
+
import type {IsNever} from 'type-fest';
|
|
262
|
+
|
|
263
|
+
type IsTrue<T> = T extends true ? true : false;
|
|
264
|
+
|
|
265
|
+
// When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
|
|
266
|
+
type A = IsTrue<never>;
|
|
267
|
+
// ^? type A = never
|
|
268
|
+
|
|
269
|
+
// If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
|
|
270
|
+
type IsTrueFixed<T> =
|
|
271
|
+
IsNever<T> extends true ? false : T extends true ? true : false;
|
|
272
|
+
|
|
273
|
+
type B = IsTrueFixed<never>;
|
|
274
|
+
// ^? type B = false
|
|
285
275
|
```
|
|
286
276
|
|
|
287
277
|
@category Type Guard
|
|
@@ -302,7 +292,7 @@ Note:
|
|
|
302
292
|
|
|
303
293
|
@example
|
|
304
294
|
```
|
|
305
|
-
import {If} from 'type-fest';
|
|
295
|
+
import type {If} from 'type-fest';
|
|
306
296
|
|
|
307
297
|
type A = If<true, 'yes', 'no'>;
|
|
308
298
|
//=> 'yes'
|
|
@@ -322,7 +312,7 @@ type E = If<never, 'yes', 'no'>;
|
|
|
322
312
|
|
|
323
313
|
@example
|
|
324
314
|
```
|
|
325
|
-
import {If, IsAny, IsNever} from 'type-fest';
|
|
315
|
+
import type {If, IsAny, IsNever} from 'type-fest';
|
|
326
316
|
|
|
327
317
|
type A = If<IsAny<unknown>, 'is any', 'not any'>;
|
|
328
318
|
//=> 'not any'
|
|
@@ -333,7 +323,7 @@ type B = If<IsNever<never>, 'is never', 'not never'>;
|
|
|
333
323
|
|
|
334
324
|
@example
|
|
335
325
|
```
|
|
336
|
-
import {If, IsEqual} from 'type-fest';
|
|
326
|
+
import type {If, IsEqual} from 'type-fest';
|
|
337
327
|
|
|
338
328
|
type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
|
|
339
329
|
|
|
@@ -344,6 +334,41 @@ type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
|
344
334
|
//=> 'not equal'
|
|
345
335
|
```
|
|
346
336
|
|
|
337
|
+
Note: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:
|
|
338
|
+
|
|
339
|
+
@example
|
|
340
|
+
```
|
|
341
|
+
import type {If, IsEqual, StringRepeat} from 'type-fest';
|
|
342
|
+
|
|
343
|
+
type HundredZeroes = StringRepeat<'0', 100>;
|
|
344
|
+
|
|
345
|
+
// The following implementation is not tail recursive
|
|
346
|
+
type Includes<S extends string, Char extends string> =
|
|
347
|
+
S extends `${infer First}${infer Rest}`
|
|
348
|
+
? If<IsEqual<First, Char>,
|
|
349
|
+
'found',
|
|
350
|
+
Includes<Rest, Char>>
|
|
351
|
+
: 'not found';
|
|
352
|
+
|
|
353
|
+
// Hence, instantiations with long strings will fail
|
|
354
|
+
// @ts-expect-error
|
|
355
|
+
type Fails = Includes<HundredZeroes, '1'>;
|
|
356
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
357
|
+
// Error: Type instantiation is excessively deep and possibly infinite.
|
|
358
|
+
|
|
359
|
+
// However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
|
|
360
|
+
type IncludesWithoutIf<S extends string, Char extends string> =
|
|
361
|
+
S extends `${infer First}${infer Rest}`
|
|
362
|
+
? IsEqual<First, Char> extends true
|
|
363
|
+
? 'found'
|
|
364
|
+
: IncludesWithoutIf<Rest, Char>
|
|
365
|
+
: 'not found';
|
|
366
|
+
|
|
367
|
+
// Now, instantiations with long strings will work
|
|
368
|
+
type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
369
|
+
//=> 'not found'
|
|
370
|
+
```
|
|
371
|
+
|
|
347
372
|
@category Type Guard
|
|
348
373
|
@category Utilities
|
|
349
374
|
*/
|
|
@@ -429,16 +454,17 @@ const literal = {foo: 123, bar: 'hello', baz: 456};
|
|
|
429
454
|
const someType: SomeType = literal;
|
|
430
455
|
const someInterface: SomeInterface = literal;
|
|
431
456
|
|
|
432
|
-
function fn(object: Record<string, unknown>): void
|
|
457
|
+
declare function fn(object: Record<string, unknown>): void;
|
|
433
458
|
|
|
434
459
|
fn(literal); // Good: literal object type is sealed
|
|
435
460
|
fn(someType); // Good: type is sealed
|
|
461
|
+
// @ts-expect-error
|
|
436
462
|
fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
|
|
437
463
|
fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
|
|
438
464
|
```
|
|
439
465
|
|
|
440
466
|
@link https://github.com/microsoft/TypeScript/issues/15300
|
|
441
|
-
@see SimplifyDeep
|
|
467
|
+
@see {@link SimplifyDeep}
|
|
442
468
|
@category Object
|
|
443
469
|
*/
|
|
444
470
|
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
@@ -470,7 +496,7 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
470
496
|
@category Type Guard
|
|
471
497
|
@category Utilities
|
|
472
498
|
*/
|
|
473
|
-
type IsEqual<A, B> = [A
|
|
499
|
+
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
474
500
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
475
501
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
476
502
|
//#endregion
|
|
@@ -492,6 +518,7 @@ It relies on the fact that an empty object (`{}`) is assignable to an object wit
|
|
|
492
518
|
```
|
|
493
519
|
const indexed: Record<string, unknown> = {}; // Allowed
|
|
494
520
|
|
|
521
|
+
// @ts-expect-error
|
|
495
522
|
const keyed: Record<'foo', unknown> = {}; // Error
|
|
496
523
|
// => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
|
|
497
524
|
```
|
|
@@ -505,16 +532,14 @@ type Indexed = {} extends Record<string, unknown>
|
|
|
505
532
|
// => '✅ `{}` is assignable to `Record<string, unknown>`'
|
|
506
533
|
|
|
507
534
|
type Keyed = {} extends Record<'foo' | 'bar', unknown>
|
|
508
|
-
?
|
|
509
|
-
:
|
|
535
|
+
? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`'
|
|
536
|
+
: '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`';
|
|
510
537
|
// => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"
|
|
511
538
|
```
|
|
512
539
|
|
|
513
540
|
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`...
|
|
514
541
|
|
|
515
542
|
```
|
|
516
|
-
import type {OmitIndexSignature} from 'type-fest';
|
|
517
|
-
|
|
518
543
|
type OmitIndexSignature<ObjectType> = {
|
|
519
544
|
[KeyType in keyof ObjectType // Map each key of `ObjectType`...
|
|
520
545
|
]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
|
|
@@ -524,14 +549,12 @@ type OmitIndexSignature<ObjectType> = {
|
|
|
524
549
|
...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
|
|
525
550
|
|
|
526
551
|
```
|
|
527
|
-
import type {OmitIndexSignature} from 'type-fest';
|
|
528
|
-
|
|
529
552
|
type OmitIndexSignature<ObjectType> = {
|
|
530
553
|
[KeyType in keyof ObjectType
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
554
|
+
// Is `{}` assignable to `Record<KeyType, unknown>`?
|
|
555
|
+
as {} extends Record<KeyType, unknown>
|
|
556
|
+
? never // ✅ `{}` is assignable to `Record<KeyType, unknown>`
|
|
557
|
+
: KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
|
|
535
558
|
]: ObjectType[KeyType];
|
|
536
559
|
};
|
|
537
560
|
```
|
|
@@ -542,27 +565,27 @@ If `{}` is assignable, it means that `KeyType` is an index signature and we want
|
|
|
542
565
|
```
|
|
543
566
|
import type {OmitIndexSignature} from 'type-fest';
|
|
544
567
|
|
|
545
|
-
|
|
568
|
+
type Example = {
|
|
546
569
|
// These index signatures will be removed.
|
|
547
|
-
[x: string]: any
|
|
548
|
-
[x: number]: any
|
|
549
|
-
[x: symbol]: any
|
|
550
|
-
[x: `head-${string}`]: string
|
|
551
|
-
[x: `${string}-tail`]: string
|
|
552
|
-
[x: `head-${string}-tail`]: string
|
|
553
|
-
[x: `${bigint}`]: string
|
|
554
|
-
[x: `embedded-${number}`]: string
|
|
570
|
+
[x: string]: any;
|
|
571
|
+
[x: number]: any;
|
|
572
|
+
[x: symbol]: any;
|
|
573
|
+
[x: `head-${string}`]: string;
|
|
574
|
+
[x: `${string}-tail`]: string;
|
|
575
|
+
[x: `head-${string}-tail`]: string;
|
|
576
|
+
[x: `${bigint}`]: string;
|
|
577
|
+
[x: `embedded-${number}`]: string;
|
|
555
578
|
|
|
556
579
|
// These explicitly defined keys will remain.
|
|
557
580
|
foo: 'bar';
|
|
558
581
|
qux?: 'baz';
|
|
559
|
-
}
|
|
582
|
+
};
|
|
560
583
|
|
|
561
584
|
type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
562
585
|
// => { foo: 'bar'; qux?: 'baz' | undefined; }
|
|
563
586
|
```
|
|
564
587
|
|
|
565
|
-
@see PickIndexSignature
|
|
588
|
+
@see {@link PickIndexSignature}
|
|
566
589
|
@category Object
|
|
567
590
|
*/
|
|
568
591
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
@@ -610,7 +633,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
610
633
|
// }
|
|
611
634
|
```
|
|
612
635
|
|
|
613
|
-
@see OmitIndexSignature
|
|
636
|
+
@see {@link OmitIndexSignature}
|
|
614
637
|
@category Object
|
|
615
638
|
*/
|
|
616
639
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
@@ -626,12 +649,12 @@ Merge two types into a new type. Keys of the second type overrides keys of the f
|
|
|
626
649
|
```
|
|
627
650
|
import type {Merge} from 'type-fest';
|
|
628
651
|
|
|
629
|
-
|
|
652
|
+
type Foo = {
|
|
630
653
|
[x: string]: unknown;
|
|
631
654
|
[x: number]: unknown;
|
|
632
655
|
foo: string;
|
|
633
656
|
bar: symbol;
|
|
634
|
-
}
|
|
657
|
+
};
|
|
635
658
|
|
|
636
659
|
type Bar = {
|
|
637
660
|
[x: number]: number;
|
|
@@ -810,12 +833,14 @@ type Foo = {
|
|
|
810
833
|
type FooWithoutA = Except<Foo, 'a'>;
|
|
811
834
|
//=> {b: string}
|
|
812
835
|
|
|
836
|
+
// @ts-expect-error
|
|
813
837
|
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
814
838
|
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
815
839
|
|
|
816
840
|
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
817
841
|
//=> {a: number} & Partial<Record<"b", never>>
|
|
818
842
|
|
|
843
|
+
// @ts-expect-error
|
|
819
844
|
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
820
845
|
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
821
846
|
|
|
@@ -832,12 +857,12 @@ type UserData = {
|
|
|
832
857
|
|
|
833
858
|
// `Omit` clearly doesn't behave as expected in this case:
|
|
834
859
|
type PostPayload = Omit<UserData, 'email'>;
|
|
835
|
-
//=>
|
|
860
|
+
//=> { [x: string]: string; [x: number]: string; }
|
|
836
861
|
|
|
837
862
|
// In situations like this, `Except` works better.
|
|
838
863
|
// It simply removes the `email` key while preserving all the other keys.
|
|
839
|
-
type
|
|
840
|
-
//=>
|
|
864
|
+
type PostPayloadFixed = Except<UserData, 'email'>;
|
|
865
|
+
//=> { [x: string]: string; name: string; role: 'admin' | 'user'; }
|
|
841
866
|
```
|
|
842
867
|
|
|
843
868
|
@category Object
|
|
@@ -859,7 +884,7 @@ type Foo = {
|
|
|
859
884
|
a?: number;
|
|
860
885
|
b: string;
|
|
861
886
|
c?: boolean;
|
|
862
|
-
}
|
|
887
|
+
};
|
|
863
888
|
|
|
864
889
|
type SomeRequired = SetRequired<Foo, 'b' | 'c'>;
|
|
865
890
|
// type SomeRequired = {
|
|
@@ -1602,6 +1627,17 @@ type ZeroOrMoreGroupVariants = RepeatStrings<["xor", "not"]>;
|
|
|
1602
1627
|
*/
|
|
1603
1628
|
type NLTranslationKey = "and" | "or" | "true" | "false" | `groupPrefix${ZeroOrMoreGroupVariants}` | `groupSuffix${ZeroOrMoreGroupVariants}`;
|
|
1604
1629
|
//#endregion
|
|
1630
|
+
//#region ../react-querybuilder/src/redux/getRqbStore.d.ts
|
|
1631
|
+
declare global {
|
|
1632
|
+
var __RQB_DEVTOOLS__: boolean | undefined;
|
|
1633
|
+
}
|
|
1634
|
+
/**
|
|
1635
|
+
* Gets the singleton React Query Builder store instance.
|
|
1636
|
+
* DevTools are enabled if either:
|
|
1637
|
+
* - globalThis.__RQB_DEVTOOLS__ is truthy
|
|
1638
|
+
* - window.__RQB_DEVTOOLS__ is truthy
|
|
1639
|
+
*/
|
|
1640
|
+
//#endregion
|
|
1605
1641
|
//#region src/types.d.ts
|
|
1606
1642
|
interface RQBJsonLogicDateBetween {
|
|
1607
1643
|
dateBetween: [RQBJsonLogic, RQBJsonLogic, RQBJsonLogic];
|
|
@@ -1713,4 +1749,4 @@ type IsDateFieldFunction = (...[rule, opts]: Parameters<RuleProcessor>) => boole
|
|
|
1713
1749
|
type IsDateField = IsDateFieldFunction | Record<string, unknown> | Record<string, unknown>[] | boolean | undefined;
|
|
1714
1750
|
//#endregion
|
|
1715
1751
|
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-
|
|
1752
|
+
//# sourceMappingURL=types-BWNR3hk5.d.ts.map
|
package/dist/{getDatetimeRuleProcessorSQL-B8y0RI7t.js → getDatetimeRuleProcessorSQL-CtUjFtho.js}
RENAMED
|
@@ -117,7 +117,7 @@ const getDatetimeRuleProcessorMongoDBQuery = (apiFns) => (rule, options) => {
|
|
|
117
117
|
};
|
|
118
118
|
|
|
119
119
|
//#endregion
|
|
120
|
-
//#region \0@oxc-project+runtime@0.
|
|
120
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/typeof.js
|
|
121
121
|
function _typeof(o) {
|
|
122
122
|
"@babel/helpers - typeof";
|
|
123
123
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
@@ -128,7 +128,7 @@ function _typeof(o) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
//#endregion
|
|
131
|
-
//#region \0@oxc-project+runtime@0.
|
|
131
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/toPrimitive.js
|
|
132
132
|
function toPrimitive(t, r) {
|
|
133
133
|
if ("object" != _typeof(t) || !t) return t;
|
|
134
134
|
var e = t[Symbol.toPrimitive];
|
|
@@ -141,14 +141,14 @@ function toPrimitive(t, r) {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
//#endregion
|
|
144
|
-
//#region \0@oxc-project+runtime@0.
|
|
144
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/toPropertyKey.js
|
|
145
145
|
function toPropertyKey(t) {
|
|
146
146
|
var i = toPrimitive(t, "string");
|
|
147
147
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
148
148
|
}
|
|
149
149
|
|
|
150
150
|
//#endregion
|
|
151
|
-
//#region \0@oxc-project+runtime@0.
|
|
151
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/defineProperty.js
|
|
152
152
|
function _defineProperty(e, r, t) {
|
|
153
153
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
154
154
|
value: t,
|
|
@@ -159,7 +159,7 @@ function _defineProperty(e, r, t) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
//#endregion
|
|
162
|
-
//#region \0@oxc-project+runtime@0.
|
|
162
|
+
//#region \0@oxc-project+runtime@0.99.0/helpers/objectSpread2.js
|
|
163
163
|
function ownKeys(e, r) {
|
|
164
164
|
var t = Object.keys(e);
|
|
165
165
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -381,4 +381,4 @@ const getDatetimeRuleProcessorSQL = (apiFns) => (rule, options) => {
|
|
|
381
381
|
|
|
382
382
|
//#endregion
|
|
383
383
|
export { getDatetimeValueProcessorOracle as a, defaultDateTimeNLOperatorMap as c, getDatetimeRuleProcessorCEL as d, getDatetimeJsonLogicOperations as f, getDatetimeValueProcessorMySQL as i, getDatetimeRuleProcessorNL as l, processIsDateField as m, getDatetimeValueProcessorANSI as n, getDatetimeValueProcessorPostgreSQL as o, isISOStringDateOnly as p, getDatetimeValueProcessorMSSQL as r, datetimeValueProcessorNL as s, getDatetimeRuleProcessorSQL as t, getDatetimeRuleProcessorMongoDBQuery as u };
|
|
384
|
-
//# sourceMappingURL=getDatetimeRuleProcessorSQL-
|
|
384
|
+
//# sourceMappingURL=getDatetimeRuleProcessorSQL-CtUjFtho.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getDatetimeRuleProcessorSQL-B8y0RI7t.js","names":["defaultIsDateField: IsDateFieldFunction","defaultDateTimeNLOperatorMap: ExportOperatorMap","datetimeValueProcessorNL: ValueProcessorByRule"],"sources":["../src/utils.ts","../src/getDatetimeJsonLogicOperations.ts","../src/getDatetimeRuleProcessorCEL.ts","../src/getDatetimeRuleProcessorMongoDBQuery.ts","../src/getDatetimeRuleProcessorNL.ts","../src/getDatetimeRuleProcessorSQL.ts"],"sourcesContent":["import type { RuleProcessor } from 'react-querybuilder';\nimport type { IsDateField, IsDateFieldFunction } from './types';\n\nexport const isISOStringDateOnly = (\n date: unknown\n): date is `${number}${number}${number}${number}-${number}${number}-${number}${number}` =>\n typeof date === 'string' && /^\\d{4}-\\d{2}-\\d{2}$/.test(date);\n\nexport const defaultIsDateField: IsDateFieldFunction = (\n ...[rule, opts]: Parameters<RuleProcessor>\n): boolean =>\n rule.operator !== 'contains' &&\n rule.operator !== 'beginsWith' &&\n rule.operator !== 'endsWith' &&\n rule.operator !== 'doesNotContain' &&\n rule.operator !== 'doesNotBeginWith' &&\n rule.operator !== 'doesNotEndWith' &&\n rule.operator !== 'null' &&\n rule.operator !== 'notNull' &&\n /^(?:date|datetime|datetimeoffset|timestamp)\\b/i.test(opts?.fieldData?.datatype as string);\n\nexport const processIsDateField = (\n isDateField: IsDateField,\n ...[rule, opts]: Parameters<RuleProcessor>\n): boolean => {\n if (typeof isDateField === 'boolean') {\n return isDateField;\n }\n\n if (typeof isDateField === 'function') {\n return isDateField(rule, opts);\n }\n\n if (Array.isArray(isDateField)) {\n return isDateField.some(condition =>\n Object.entries(condition).every(([key, value]) => opts?.fieldData?.[key] === value)\n );\n }\n\n if (typeof isDateField === 'object') {\n return Object.entries(isDateField).every(([key, value]) => opts?.fieldData?.[key] === value);\n }\n\n return defaultIsDateField(rule, opts);\n};\n","import type { RQBDateTimeLibraryAPI, RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom operations for use with JsonLogic objects generated by\n * {@link datetimeRuleProcessorJsonLogic}.\n */\nexport const getDatetimeJsonLogicOperations = ({\n isAfter,\n isBefore,\n isSame,\n}: RQBDateTimeLibraryAPI): RQBJsonLogicDateTimeOperations => ({\n dateAfter: (a, b) => isAfter(a, b),\n dateBefore: (a, b) => isBefore(a, b),\n dateBetween: (a, b, c) =>\n isSame(b, a) ||\n isSame(b, c) ||\n (isAfter(b, a) && isBefore(b, c)) ||\n (isAfter(b, c) && isBefore(b, a)),\n dateNotBetween: (a, b, c) =>\n !isSame(b, a) &&\n !isSame(b, c) &&\n ((isBefore(a, c) && (isBefore(b, a) || isAfter(b, c))) ||\n (isAfter(a, c) && (isBefore(b, c) || isAfter(b, a)))),\n dateIn: (a, b) => b.some(v => isSame(a, v)),\n dateNotIn: (a, b) => b.every(v => !isSame(a, v)),\n dateNotOn: (a, b) => !isSame(a, b),\n dateOn: (a, b) => isSame(a, b),\n dateOnOrAfter: (a, b) => isAfter(a, b) || isSame(a, b),\n dateOnOrBefore: (a, b) => isBefore(a, b) || isSame(a, b),\n});\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorCEL, lc, toArray } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { processIsDateField } from './utils';\n\nconst shouldNegate = (op: string) => /^(does)?not/i.test(op);\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"cel\" format.\n */\nexport const getDatetimeRuleProcessorCEL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* istanbul ignore next */ {};\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorCEL(rule, opts);\n }\n\n const ts = (d: string | Date) => `timestamp(\"${apiFns.toISOString(d)}\")`;\n\n const operatorTL = lc(rule.operator.replace(/^=$/, '=='));\n\n switch (operatorTL) {\n case '<':\n case '<=':\n case '==':\n case '!=':\n case '>':\n case '>=':\n return `${rule.field} ${operatorTL} ${ts(rule.value)}`;\n }\n\n const valueAsArray: string[] = toArray(rule.value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map(v => apiFns.toDate(v))\n .filter(dateVal => apiFns.isValid(dateVal));\n\n switch (operatorTL) {\n case 'in':\n case 'notin': {\n if (valueAsDateArray.length === 0) return '';\n const [prefix, suffix] = shouldNegate(operatorTL) ? ['!(', ')'] : ['', ''];\n return `${prefix}${rule.field} in [${valueAsDateArray\n .map(val => ts(val))\n .join(', ')}]${suffix}`;\n }\n\n case 'between':\n case 'notbetween': {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const [firstDate, secondDate] = apiFns.isBefore(first, second)\n ? [first, second]\n : [second, first];\n return operatorTL === 'between'\n ? `(${rule.field} >= ${ts(firstDate)} && ${rule.field} <= ${ts(secondDate)})`\n : `(${rule.field} < ${ts(firstDate)} || ${rule.field} > ${ts(secondDate)})`;\n }\n }\n\n return defaultRuleProcessorCEL(rule, opts);\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorMongoDBQuery, mongoOperators, toArray } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { processIsDateField } from './utils';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"mongodb_query\" format.\n */\nexport const getDatetimeRuleProcessorMongoDBQuery =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* istanbul ignore next */ {};\n const { field, operator, value, valueSource } = rule;\n\n if (valueSource === 'field' || !processIsDateField(opts.context?.isDateField, rule, opts)) {\n return defaultRuleProcessorMongoDBQuery(rule, opts);\n }\n\n if (operator === '=') {\n return { [field]: apiFns.toDate(value) };\n }\n\n switch (operator) {\n case '<':\n case '<=':\n case '!=':\n case '>':\n case '>=':\n return { [field]: { [mongoOperators[operator]]: apiFns.toDate(value) } };\n }\n\n const valueAsArray: string[] = toArray(rule.value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map(v => apiFns.toDate(v))\n .filter(dateVal => apiFns.isValid(dateVal));\n\n switch (operator) {\n case 'in':\n case 'notIn':\n return { [field]: { [mongoOperators[operator]]: valueAsDateArray } };\n\n case 'between':\n case 'notBetween': {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const orderedArray = apiFns.isBefore(first, second) ? [first, second] : [second, first];\n return operator === 'between'\n ? { [field]: { $gte: orderedArray[0], $lte: orderedArray[1] } }\n : {\n $or: [{ [field]: { $lt: orderedArray[0] } }, { [field]: { $gt: orderedArray[1] } }],\n };\n }\n }\n\n return defaultRuleProcessorMongoDBQuery(rule, opts);\n };\n","import type { ExportOperatorMap, RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport {\n defaultOperatorProcessorNL,\n defaultRuleProcessorNL,\n getQuotedFieldName,\n lc,\n normalizeConstituentWordOrder,\n toArray,\n} from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly, processIsDateField } from './utils';\n\nexport const defaultDateTimeNLOperatorMap: ExportOperatorMap = {\n // '=': 'is',\n // '!=': 'is not',\n '<': 'is before',\n '>': 'is after',\n '<=': 'is on or before',\n '>=': 'is on or after',\n in: ['is one of the dates', 'is the same as a date in'],\n notin: ['is not one of the dates', 'is not the same as any date in'],\n between: ['is between', 'is between the dates in'],\n notbetween: ['is not between', 'is not between the dates in'],\n};\n\n/**\n * Generates a value processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"natural_language\" format.\n */\nexport const datetimeValueProcessorNL: ValueProcessorByRule = (rule, opts) => {\n if (isISOStringDateOnly(opts?.context?.originalValue)) {\n return new Intl.DateTimeFormat(opts?.context?.locales, {\n dateStyle: 'full',\n ...opts?.context?.dateFormat,\n }).format(rule.value);\n }\n return new Intl.DateTimeFormat(opts?.context?.locales, {\n dateStyle: 'full',\n timeStyle: 'long',\n ...opts?.context?.dateTimeFormat,\n }).format(rule.value);\n};\n\n/**\n * Generates a rule processor with date/time features for use by {@link @react-querybuilder/core!formatQuery formatQuery} with\n * the \"natural_language\" format.\n */\nexport const getDatetimeRuleProcessorNL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* istanbul ignore next */ {};\n const operatorLowerCase = lc(rule.operator);\n let finalValue = '';\n\n // istanbul ignore next\n const {\n fieldData,\n quoteFieldNamesWith = ['', ''] as [string, string],\n fieldIdentifierSeparator = '',\n operatorProcessor = defaultOperatorProcessorNL,\n // valueProcessor = datetimeValueProcessorNL,\n wordOrder = 'SVO',\n context = {},\n operatorMap = defaultDateTimeNLOperatorMap,\n } = opts;\n\n if (!processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorNL(rule, opts);\n }\n\n if (rule.valueSource === 'field') {\n return defaultRuleProcessorNL(rule, { ...opts, operatorMap: defaultDateTimeNLOperatorMap });\n }\n\n if (\n (operatorLowerCase === 'in' ||\n operatorLowerCase === 'notin' ||\n operatorLowerCase === 'between' ||\n operatorLowerCase === 'notbetween') &&\n !rule.value\n ) {\n return '';\n }\n\n const valueAsArray: string[] = toArray(rule.value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map((v): [string, Date] => [v, apiFns.toDate(v)])\n .filter(v => apiFns.isValid(v[1]));\n\n switch (operatorLowerCase) {\n case 'in':\n case 'notin':\n {\n if (valueAsDateArray.length === 0) return '';\n finalValue = `(${valueAsDateArray\n .map(value =>\n datetimeValueProcessorNL(\n { field: rule.field, operator: '=', value: value[1] },\n { ...opts, context: { ...context, originalValue: value[0] } }\n )\n )\n .join(', ')})`;\n }\n break;\n\n case 'between':\n case 'notbetween':\n {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const orderedArray = apiFns.isBefore(first[1], second[1])\n ? [first, second]\n : [second, first];\n finalValue = orderedArray\n .map(([originalValue, value]) =>\n datetimeValueProcessorNL(\n { field: rule.field, operator: '=', value },\n { ...opts, context: { ...context, originalValue } }\n )\n )\n .join(` ${opts.translations?.and ?? 'and'} `);\n }\n break;\n\n default: {\n const [originalValue, value] = valueAsDateArray[0] ?? ['', ''];\n finalValue = originalValue\n ? datetimeValueProcessorNL(\n { field: rule.field, operator: '=', value },\n { ...opts, context: { ...context, originalValue } }\n )\n : '';\n }\n }\n\n const processedField = getQuotedFieldName(fieldData?.label ?? rule.field, {\n quoteFieldNamesWith,\n fieldIdentifierSeparator,\n });\n\n const processedOperator = operatorProcessor(rule, {\n ...opts,\n operatorMap: { ...defaultDateTimeNLOperatorMap, ...operatorMap },\n });\n\n const wordOrderMap = {\n S: processedField,\n V: processedOperator,\n O: finalValue,\n };\n\n return normalizeConstituentWordOrder(wordOrder)\n .map(term => `${wordOrderMap[term]}`)\n .join(' ')\n .trim();\n };\n","import type { RuleProcessor, SQLPreset, ValueProcessorByRule } from 'react-querybuilder';\nimport {\n defaultRuleProcessorSQL,\n defaultValueProcessorByRule,\n getQuotedFieldName,\n lc,\n mapSQLOperator,\n toArray,\n} from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly, processIsDateField } from './utils';\n\n/**\n * Generates a value processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"sql\" format and \"ansi\" preset.\n */\nexport const getDatetimeValueProcessorANSI =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n if (isISOStringDateOnly(opts?.context?.originalValue)) {\n return defaultValueProcessorByRule({ ...rule, value: toISOStringDateOnly(rule.value) }, opts);\n }\n return defaultValueProcessorByRule({ ...rule, value: toISOString(rule.value as Date) }, opts);\n };\n\n/**\n * Generates a value processor with date/time features for use by {@link @react-querybuilder/core!formatQuery formatQuery} with\n * the \"sql\" format and \"mssql\" preset.\n */\nexport const getDatetimeValueProcessorMSSQL =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n const datatype = /^(?:small)?datetime/i.test(opts?.fieldData?.datatype as string)\n ? 'datetimeoffset'\n : 'date';\n const value =\n datatype === 'datetimeoffset' ? toISOString(rule.value) : toISOStringDateOnly(rule.value);\n return defaultValueProcessorByRule(\n { ...rule, value },\n { ...opts, wrapValueWith: [`cast(`, ` as ${datatype})`] }\n );\n };\n\n/**\n * Generates a value processor with date/time features for use by {@link @react-querybuilder/core!formatQuery formatQuery} with\n * the \"sql\" format and \"mysql\" preset.\n */\nexport const getDatetimeValueProcessorMySQL =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n const datatype = /^(?:datetime|timestamp)/i.test(opts?.fieldData?.datatype as string)\n ? 'datetime'\n : 'date';\n const value =\n datatype === 'datetime' ? toISOString(rule.value) : toISOStringDateOnly(rule.value);\n return defaultValueProcessorByRule(\n { ...rule, value },\n { ...opts, wrapValueWith: [`cast(`, ` as ${datatype})`] }\n );\n };\n\n/**\n * Generates a value processor with date/time features for use by {@link @react-querybuilder/core!formatQuery formatQuery} with\n * the \"sql\" format and \"oracle\" preset.\n */\nexport const getDatetimeValueProcessorOracle =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n // Oracle date format for _reading_ ISO 8601: 'YYYY-MM-DD\"T\"HH24:MI:SS.ff3\"Z\"'\n const datatype = /^timestamp/i.test(opts?.fieldData?.datatype as string) ? 'timestamp' : 'date';\n const value =\n datatype === 'timestamp'\n ? toISOString(rule.value).replaceAll('T', ' ').replace('Z', ' UTC')\n : toISOStringDateOnly(rule.value);\n return defaultValueProcessorByRule(\n { ...rule, value },\n { ...opts, wrapValueWith: [datatype, ``] }\n );\n };\n\n/**\n * Generates a value processor with date/time features for use by {@link @react-querybuilder/core!formatQuery formatQuery} with\n * the \"sql\" format and \"postgresql\" preset.\n */\nexport const getDatetimeValueProcessorPostgreSQL =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n const datatype = /^timestamp/i.test(opts?.fieldData?.datatype as string) ? 'timestamp' : 'date';\n const value =\n datatype === 'timestamp' ? toISOString(rule.value) : toISOStringDateOnly(rule.value);\n return defaultValueProcessorByRule(\n { ...rule, value },\n { ...opts, wrapValueWith: [datatype, ``] }\n );\n };\n\nconst presetToValueProcessorMap = {\n ansi: getDatetimeValueProcessorANSI,\n mssql: getDatetimeValueProcessorMSSQL,\n mysql: getDatetimeValueProcessorMySQL,\n oracle: getDatetimeValueProcessorOracle,\n postgresql: getDatetimeValueProcessorPostgreSQL,\n sqlite: getDatetimeValueProcessorANSI,\n} satisfies Record<SQLPreset, (apiFns: RQBDateTimeLibraryAPI) => ValueProcessorByRule>;\n\n/**\n * Generates a rule processor with date/time features for use by {@link @react-querybuilder/core!formatQuery formatQuery} with\n * the \"sql\" format.\n */\nexport const getDatetimeRuleProcessorSQL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* istanbul ignore next */ {};\n const operator = mapSQLOperator(rule.operator);\n const operatorLowerCase = lc(operator);\n // istanbul ignore next\n const {\n quoteFieldNamesWith = ['', ''] as [string, string],\n fieldIdentifierSeparator = '',\n context = {},\n } = opts;\n let finalValue = '';\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorSQL(rule, opts);\n }\n\n const valueProcessor = presetToValueProcessorMap[opts.preset!](apiFns);\n\n const valueAsArray: string[] = toArray(rule.value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map((v): [string, Date] => [v, apiFns.toDate(v)])\n .filter(v => apiFns.isValid(v[1]));\n\n switch (operatorLowerCase) {\n case 'in':\n case 'not in':\n {\n if (valueAsDateArray.length === 0) return '';\n finalValue = `(${valueAsDateArray\n .map(value =>\n valueProcessor(\n { field: rule.field, operator: '=', value: value[1] },\n { ...opts, context: { originalValue: value[0] } }\n )\n )\n .join(', ')})`;\n }\n break;\n\n case 'between':\n case 'not between':\n {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const orderedArray = apiFns.isBefore(first[1], second[1])\n ? [first, second]\n : [second, first];\n finalValue = orderedArray\n .map(([originalValue, value]) =>\n valueProcessor(\n { field: rule.field, operator: '=', value },\n { ...opts, context: { originalValue } }\n )\n )\n .join(' and ');\n }\n break;\n\n default: {\n const [originalValue, value] = valueAsDateArray[0] ?? ['', ''];\n finalValue = valueProcessor(\n { field: rule.field, operator: '=', value },\n { ...opts, context: { originalValue } }\n );\n }\n }\n\n return `${getQuotedFieldName(rule.field, { quoteFieldNamesWith, fieldIdentifierSeparator })} ${operator} ${finalValue}`.trim();\n };\n"],"mappings":";;;AAGA,MAAa,uBACX,SAEA,OAAO,SAAS,YAAY,sBAAsB,KAAK,KAAK;AAE9D,MAAaA,sBACX,GAAG,CAAC,MAAM,UAEV;;aAAK,aAAa,cAClB,KAAK,aAAa,gBAClB,KAAK,aAAa,cAClB,KAAK,aAAa,oBAClB,KAAK,aAAa,sBAClB,KAAK,aAAa,oBAClB,KAAK,aAAa,UAClB,KAAK,aAAa,aAClB,iDAAiD,4DAAK,KAAM,6EAAW,SAAmB;;AAE5F,MAAa,sBACX,aACA,GAAG,CAAC,MAAM,UACE;AACZ,KAAI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AM,CAAC,OAAO,UAAU;AAIxB,kBAHqB,OAAO,SAAS,MAAM,IAAI,OAAO,GAAG,GACrD,CAAC,OAAO,OAAO,GACf,CAAC,QAAQ,MAAM,EAEhB,KAAK,CAAC,eAAe,WACpB,eACE;KAAE,OAAO,KAAK;KAAO,UAAU;KAAK;KAAO,oCACtC,aAAM,SAAS,EAAE,eAAe,IACtC,CACF,CACA,KAAK,QAAQ;;AAElB;EAEF,SAAS;;GACP,MAAM,CAAC,eAAe,+BAAS,iBAAiB,qEAAM,CAAC,IAAI,GAAG;AAC9D,gBAAa,eACX;IAAE,OAAO,KAAK;IAAO,UAAU;IAAK;IAAO,oCACtC,aAAM,SAAS,EAAE,eAAe,IACtC;;;AAIL,QAAO,GAAG,mBAAmB,KAAK,OAAO;EAAE;EAAqB;EAA0B,CAAC,CAAC,GAAG,SAAS,GAAG,aAAa,MAAM"}
|
|
1
|
+
{"version":3,"file":"getDatetimeRuleProcessorSQL-CtUjFtho.js","names":["defaultIsDateField: IsDateFieldFunction","defaultDateTimeNLOperatorMap: ExportOperatorMap","datetimeValueProcessorNL: ValueProcessorByRule"],"sources":["../src/utils.ts","../src/getDatetimeJsonLogicOperations.ts","../src/getDatetimeRuleProcessorCEL.ts","../src/getDatetimeRuleProcessorMongoDBQuery.ts","../src/getDatetimeRuleProcessorNL.ts","../src/getDatetimeRuleProcessorSQL.ts"],"sourcesContent":["import type { RuleProcessor } from 'react-querybuilder';\nimport type { IsDateField, IsDateFieldFunction } from './types';\n\nexport const isISOStringDateOnly = (\n date: unknown\n): date is `${number}${number}${number}${number}-${number}${number}-${number}${number}` =>\n typeof date === 'string' && /^\\d{4}-\\d{2}-\\d{2}$/.test(date);\n\nexport const defaultIsDateField: IsDateFieldFunction = (\n ...[rule, opts]: Parameters<RuleProcessor>\n): boolean =>\n rule.operator !== 'contains' &&\n rule.operator !== 'beginsWith' &&\n rule.operator !== 'endsWith' &&\n rule.operator !== 'doesNotContain' &&\n rule.operator !== 'doesNotBeginWith' &&\n rule.operator !== 'doesNotEndWith' &&\n rule.operator !== 'null' &&\n rule.operator !== 'notNull' &&\n /^(?:date|datetime|datetimeoffset|timestamp)\\b/i.test(opts?.fieldData?.datatype as string);\n\nexport const processIsDateField = (\n isDateField: IsDateField,\n ...[rule, opts]: Parameters<RuleProcessor>\n): boolean => {\n if (typeof isDateField === 'boolean') {\n return isDateField;\n }\n\n if (typeof isDateField === 'function') {\n return isDateField(rule, opts);\n }\n\n if (Array.isArray(isDateField)) {\n return isDateField.some(condition =>\n Object.entries(condition).every(([key, value]) => opts?.fieldData?.[key] === value)\n );\n }\n\n if (typeof isDateField === 'object') {\n return Object.entries(isDateField).every(([key, value]) => opts?.fieldData?.[key] === value);\n }\n\n return defaultIsDateField(rule, opts);\n};\n","import type { RQBDateTimeLibraryAPI, RQBJsonLogicDateTimeOperations } from './types';\n\n/**\n * Custom operations for use with JsonLogic objects generated by\n * {@link datetimeRuleProcessorJsonLogic}.\n */\nexport const getDatetimeJsonLogicOperations = ({\n isAfter,\n isBefore,\n isSame,\n}: RQBDateTimeLibraryAPI): RQBJsonLogicDateTimeOperations => ({\n dateAfter: (a, b) => isAfter(a, b),\n dateBefore: (a, b) => isBefore(a, b),\n dateBetween: (a, b, c) =>\n isSame(b, a) ||\n isSame(b, c) ||\n (isAfter(b, a) && isBefore(b, c)) ||\n (isAfter(b, c) && isBefore(b, a)),\n dateNotBetween: (a, b, c) =>\n !isSame(b, a) &&\n !isSame(b, c) &&\n ((isBefore(a, c) && (isBefore(b, a) || isAfter(b, c))) ||\n (isAfter(a, c) && (isBefore(b, c) || isAfter(b, a)))),\n dateIn: (a, b) => b.some(v => isSame(a, v)),\n dateNotIn: (a, b) => b.every(v => !isSame(a, v)),\n dateNotOn: (a, b) => !isSame(a, b),\n dateOn: (a, b) => isSame(a, b),\n dateOnOrAfter: (a, b) => isAfter(a, b) || isSame(a, b),\n dateOnOrBefore: (a, b) => isBefore(a, b) || isSame(a, b),\n});\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorCEL, lc, toArray } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { processIsDateField } from './utils';\n\nconst shouldNegate = (op: string) => /^(does)?not/i.test(op);\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"cel\" format.\n */\nexport const getDatetimeRuleProcessorCEL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* istanbul ignore next */ {};\n const { context = {} } = opts;\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorCEL(rule, opts);\n }\n\n const ts = (d: string | Date) => `timestamp(\"${apiFns.toISOString(d)}\")`;\n\n const operatorTL = lc(rule.operator.replace(/^=$/, '=='));\n\n switch (operatorTL) {\n case '<':\n case '<=':\n case '==':\n case '!=':\n case '>':\n case '>=':\n return `${rule.field} ${operatorTL} ${ts(rule.value)}`;\n }\n\n const valueAsArray: string[] = toArray(rule.value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map(v => apiFns.toDate(v))\n .filter(dateVal => apiFns.isValid(dateVal));\n\n switch (operatorTL) {\n case 'in':\n case 'notin': {\n if (valueAsDateArray.length === 0) return '';\n const [prefix, suffix] = shouldNegate(operatorTL) ? ['!(', ')'] : ['', ''];\n return `${prefix}${rule.field} in [${valueAsDateArray\n .map(val => ts(val))\n .join(', ')}]${suffix}`;\n }\n\n case 'between':\n case 'notbetween': {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const [firstDate, secondDate] = apiFns.isBefore(first, second)\n ? [first, second]\n : [second, first];\n return operatorTL === 'between'\n ? `(${rule.field} >= ${ts(firstDate)} && ${rule.field} <= ${ts(secondDate)})`\n : `(${rule.field} < ${ts(firstDate)} || ${rule.field} > ${ts(secondDate)})`;\n }\n }\n\n return defaultRuleProcessorCEL(rule, opts);\n };\n","import type { RuleProcessor } from 'react-querybuilder';\nimport { defaultRuleProcessorMongoDBQuery, mongoOperators, toArray } from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { processIsDateField } from './utils';\n\n/**\n * Generates a rule processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"mongodb_query\" format.\n */\nexport const getDatetimeRuleProcessorMongoDBQuery =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* istanbul ignore next */ {};\n const { field, operator, value, valueSource } = rule;\n\n if (valueSource === 'field' || !processIsDateField(opts.context?.isDateField, rule, opts)) {\n return defaultRuleProcessorMongoDBQuery(rule, opts);\n }\n\n if (operator === '=') {\n return { [field]: apiFns.toDate(value) };\n }\n\n switch (operator) {\n case '<':\n case '<=':\n case '!=':\n case '>':\n case '>=':\n return { [field]: { [mongoOperators[operator]]: apiFns.toDate(value) } };\n }\n\n const valueAsArray: string[] = toArray(rule.value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map(v => apiFns.toDate(v))\n .filter(dateVal => apiFns.isValid(dateVal));\n\n switch (operator) {\n case 'in':\n case 'notIn':\n return { [field]: { [mongoOperators[operator]]: valueAsDateArray } };\n\n case 'between':\n case 'notBetween': {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const orderedArray = apiFns.isBefore(first, second) ? [first, second] : [second, first];\n return operator === 'between'\n ? { [field]: { $gte: orderedArray[0], $lte: orderedArray[1] } }\n : {\n $or: [{ [field]: { $lt: orderedArray[0] } }, { [field]: { $gt: orderedArray[1] } }],\n };\n }\n }\n\n return defaultRuleProcessorMongoDBQuery(rule, opts);\n };\n","import type { ExportOperatorMap, RuleProcessor, ValueProcessorByRule } from 'react-querybuilder';\nimport {\n defaultOperatorProcessorNL,\n defaultRuleProcessorNL,\n getQuotedFieldName,\n lc,\n normalizeConstituentWordOrder,\n toArray,\n} from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly, processIsDateField } from './utils';\n\nexport const defaultDateTimeNLOperatorMap: ExportOperatorMap = {\n // '=': 'is',\n // '!=': 'is not',\n '<': 'is before',\n '>': 'is after',\n '<=': 'is on or before',\n '>=': 'is on or after',\n in: ['is one of the dates', 'is the same as a date in'],\n notin: ['is not one of the dates', 'is not the same as any date in'],\n between: ['is between', 'is between the dates in'],\n notbetween: ['is not between', 'is not between the dates in'],\n};\n\n/**\n * Generates a value processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"natural_language\" format.\n */\nexport const datetimeValueProcessorNL: ValueProcessorByRule = (rule, opts) => {\n if (isISOStringDateOnly(opts?.context?.originalValue)) {\n return new Intl.DateTimeFormat(opts?.context?.locales, {\n dateStyle: 'full',\n ...opts?.context?.dateFormat,\n }).format(rule.value);\n }\n return new Intl.DateTimeFormat(opts?.context?.locales, {\n dateStyle: 'full',\n timeStyle: 'long',\n ...opts?.context?.dateTimeFormat,\n }).format(rule.value);\n};\n\n/**\n * Generates a rule processor with date/time features for use by {@link @react-querybuilder/core!formatQuery formatQuery} with\n * the \"natural_language\" format.\n */\nexport const getDatetimeRuleProcessorNL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* istanbul ignore next */ {};\n const operatorLowerCase = lc(rule.operator);\n let finalValue = '';\n\n // istanbul ignore next\n const {\n fieldData,\n quoteFieldNamesWith = ['', ''] as [string, string],\n fieldIdentifierSeparator = '',\n operatorProcessor = defaultOperatorProcessorNL,\n // valueProcessor = datetimeValueProcessorNL,\n wordOrder = 'SVO',\n context = {},\n operatorMap = defaultDateTimeNLOperatorMap,\n } = opts;\n\n if (!processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorNL(rule, opts);\n }\n\n if (rule.valueSource === 'field') {\n return defaultRuleProcessorNL(rule, { ...opts, operatorMap: defaultDateTimeNLOperatorMap });\n }\n\n if (\n (operatorLowerCase === 'in' ||\n operatorLowerCase === 'notin' ||\n operatorLowerCase === 'between' ||\n operatorLowerCase === 'notbetween') &&\n !rule.value\n ) {\n return '';\n }\n\n const valueAsArray: string[] = toArray(rule.value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map((v): [string, Date] => [v, apiFns.toDate(v)])\n .filter(v => apiFns.isValid(v[1]));\n\n switch (operatorLowerCase) {\n case 'in':\n case 'notin':\n {\n if (valueAsDateArray.length === 0) return '';\n finalValue = `(${valueAsDateArray\n .map(value =>\n datetimeValueProcessorNL(\n { field: rule.field, operator: '=', value: value[1] },\n { ...opts, context: { ...context, originalValue: value[0] } }\n )\n )\n .join(', ')})`;\n }\n break;\n\n case 'between':\n case 'notbetween':\n {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const orderedArray = apiFns.isBefore(first[1], second[1])\n ? [first, second]\n : [second, first];\n finalValue = orderedArray\n .map(([originalValue, value]) =>\n datetimeValueProcessorNL(\n { field: rule.field, operator: '=', value },\n { ...opts, context: { ...context, originalValue } }\n )\n )\n .join(` ${opts.translations?.and ?? 'and'} `);\n }\n break;\n\n default: {\n const [originalValue, value] = valueAsDateArray[0] ?? ['', ''];\n finalValue = originalValue\n ? datetimeValueProcessorNL(\n { field: rule.field, operator: '=', value },\n { ...opts, context: { ...context, originalValue } }\n )\n : '';\n }\n }\n\n const processedField = getQuotedFieldName(fieldData?.label ?? rule.field, {\n quoteFieldNamesWith,\n fieldIdentifierSeparator,\n });\n\n const processedOperator = operatorProcessor(rule, {\n ...opts,\n operatorMap: { ...defaultDateTimeNLOperatorMap, ...operatorMap },\n });\n\n const wordOrderMap = {\n S: processedField,\n V: processedOperator,\n O: finalValue,\n };\n\n return normalizeConstituentWordOrder(wordOrder)\n .map(term => `${wordOrderMap[term]}`)\n .join(' ')\n .trim();\n };\n","import type { RuleProcessor, SQLPreset, ValueProcessorByRule } from 'react-querybuilder';\nimport {\n defaultRuleProcessorSQL,\n defaultValueProcessorByRule,\n getQuotedFieldName,\n lc,\n mapSQLOperator,\n toArray,\n} from 'react-querybuilder';\nimport type { RQBDateTimeLibraryAPI } from './types';\nimport { isISOStringDateOnly, processIsDateField } from './utils';\n\n/**\n * Generates a value processor with date/time features for use by\n * {@link @react-querybuilder/core!formatQuery formatQuery} with the \"sql\" format and \"ansi\" preset.\n */\nexport const getDatetimeValueProcessorANSI =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n if (isISOStringDateOnly(opts?.context?.originalValue)) {\n return defaultValueProcessorByRule({ ...rule, value: toISOStringDateOnly(rule.value) }, opts);\n }\n return defaultValueProcessorByRule({ ...rule, value: toISOString(rule.value as Date) }, opts);\n };\n\n/**\n * Generates a value processor with date/time features for use by {@link @react-querybuilder/core!formatQuery formatQuery} with\n * the \"sql\" format and \"mssql\" preset.\n */\nexport const getDatetimeValueProcessorMSSQL =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n const datatype = /^(?:small)?datetime/i.test(opts?.fieldData?.datatype as string)\n ? 'datetimeoffset'\n : 'date';\n const value =\n datatype === 'datetimeoffset' ? toISOString(rule.value) : toISOStringDateOnly(rule.value);\n return defaultValueProcessorByRule(\n { ...rule, value },\n { ...opts, wrapValueWith: [`cast(`, ` as ${datatype})`] }\n );\n };\n\n/**\n * Generates a value processor with date/time features for use by {@link @react-querybuilder/core!formatQuery formatQuery} with\n * the \"sql\" format and \"mysql\" preset.\n */\nexport const getDatetimeValueProcessorMySQL =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n const datatype = /^(?:datetime|timestamp)/i.test(opts?.fieldData?.datatype as string)\n ? 'datetime'\n : 'date';\n const value =\n datatype === 'datetime' ? toISOString(rule.value) : toISOStringDateOnly(rule.value);\n return defaultValueProcessorByRule(\n { ...rule, value },\n { ...opts, wrapValueWith: [`cast(`, ` as ${datatype})`] }\n );\n };\n\n/**\n * Generates a value processor with date/time features for use by {@link @react-querybuilder/core!formatQuery formatQuery} with\n * the \"sql\" format and \"oracle\" preset.\n */\nexport const getDatetimeValueProcessorOracle =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n // Oracle date format for _reading_ ISO 8601: 'YYYY-MM-DD\"T\"HH24:MI:SS.ff3\"Z\"'\n const datatype = /^timestamp/i.test(opts?.fieldData?.datatype as string) ? 'timestamp' : 'date';\n const value =\n datatype === 'timestamp'\n ? toISOString(rule.value).replaceAll('T', ' ').replace('Z', ' UTC')\n : toISOStringDateOnly(rule.value);\n return defaultValueProcessorByRule(\n { ...rule, value },\n { ...opts, wrapValueWith: [datatype, ``] }\n );\n };\n\n/**\n * Generates a value processor with date/time features for use by {@link @react-querybuilder/core!formatQuery formatQuery} with\n * the \"sql\" format and \"postgresql\" preset.\n */\nexport const getDatetimeValueProcessorPostgreSQL =\n ({ toISOStringDateOnly, toISOString }: RQBDateTimeLibraryAPI): ValueProcessorByRule =>\n (rule, opts) => {\n const datatype = /^timestamp/i.test(opts?.fieldData?.datatype as string) ? 'timestamp' : 'date';\n const value =\n datatype === 'timestamp' ? toISOString(rule.value) : toISOStringDateOnly(rule.value);\n return defaultValueProcessorByRule(\n { ...rule, value },\n { ...opts, wrapValueWith: [datatype, ``] }\n );\n };\n\nconst presetToValueProcessorMap = {\n ansi: getDatetimeValueProcessorANSI,\n mssql: getDatetimeValueProcessorMSSQL,\n mysql: getDatetimeValueProcessorMySQL,\n oracle: getDatetimeValueProcessorOracle,\n postgresql: getDatetimeValueProcessorPostgreSQL,\n sqlite: getDatetimeValueProcessorANSI,\n} satisfies Record<SQLPreset, (apiFns: RQBDateTimeLibraryAPI) => ValueProcessorByRule>;\n\n/**\n * Generates a rule processor with date/time features for use by {@link @react-querybuilder/core!formatQuery formatQuery} with\n * the \"sql\" format.\n */\nexport const getDatetimeRuleProcessorSQL =\n (apiFns: RQBDateTimeLibraryAPI): RuleProcessor =>\n (rule, options) => {\n const opts = options ?? /* istanbul ignore next */ {};\n const operator = mapSQLOperator(rule.operator);\n const operatorLowerCase = lc(operator);\n // istanbul ignore next\n const {\n quoteFieldNamesWith = ['', ''] as [string, string],\n fieldIdentifierSeparator = '',\n context = {},\n } = opts;\n let finalValue = '';\n\n if (rule.valueSource === 'field' || !processIsDateField(context.isDateField, rule, opts)) {\n return defaultRuleProcessorSQL(rule, opts);\n }\n\n const valueProcessor = presetToValueProcessorMap[opts.preset!](apiFns);\n\n const valueAsArray: string[] = toArray(rule.value, { retainEmptyStrings: false });\n const valueAsDateArray = valueAsArray\n .map((v): [string, Date] => [v, apiFns.toDate(v)])\n .filter(v => apiFns.isValid(v[1]));\n\n switch (operatorLowerCase) {\n case 'in':\n case 'not in':\n {\n if (valueAsDateArray.length === 0) return '';\n finalValue = `(${valueAsDateArray\n .map(value =>\n valueProcessor(\n { field: rule.field, operator: '=', value: value[1] },\n { ...opts, context: { originalValue: value[0] } }\n )\n )\n .join(', ')})`;\n }\n break;\n\n case 'between':\n case 'not between':\n {\n if (valueAsDateArray.length < 2) return '';\n const [first, second] = valueAsDateArray;\n const orderedArray = apiFns.isBefore(first[1], second[1])\n ? [first, second]\n : [second, first];\n finalValue = orderedArray\n .map(([originalValue, value]) =>\n valueProcessor(\n { field: rule.field, operator: '=', value },\n { ...opts, context: { originalValue } }\n )\n )\n .join(' and ');\n }\n break;\n\n default: {\n const [originalValue, value] = valueAsDateArray[0] ?? ['', ''];\n finalValue = valueProcessor(\n { field: rule.field, operator: '=', value },\n { ...opts, context: { originalValue } }\n );\n }\n }\n\n return `${getQuotedFieldName(rule.field, { quoteFieldNamesWith, fieldIdentifierSeparator })} ${operator} ${finalValue}`.trim();\n };\n"],"mappings":";;;AAGA,MAAa,uBACX,SAEA,OAAO,SAAS,YAAY,sBAAsB,KAAK,KAAK;AAE9D,MAAaA,sBACX,GAAG,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AG,QAAO;AAC1C,gBAAa,IAAI,iBACd,KAAI,UACH,eACE;IAAE,OAAO,KAAK;IAAO,UAAU;IAAK,OAAO,MAAM;IAAI,oCAChD,aAAM,SAAS,EAAE,eAAe,MAAM,IAAI,IAChD,CACF,CACA,KAAK,KAAK,CAAC;AAEhB;EAEF,KAAK;EACL,KAAK;GACH;AACE,QAAI,iBAAiB,SAAS,EAAG,QAAO;IACxC,MAAM,CAAC,OAAO,UAAU;AAIxB,kBAHqB,OAAO,SAAS,MAAM,IAAI,OAAO,GAAG,GACrD,CAAC,OAAO,OAAO,GACf,CAAC,QAAQ,MAAM,EAEhB,KAAK,CAAC,eAAe,WACpB,eACE;KAAE,OAAO,KAAK;KAAO,UAAU;KAAK;KAAO,oCACtC,aAAM,SAAS,EAAE,eAAe,IACtC,CACF,CACA,KAAK,QAAQ;;AAElB;EAEF,SAAS;;GACP,MAAM,CAAC,eAAe,+BAAS,iBAAiB,qEAAM,CAAC,IAAI,GAAG;AAC9D,gBAAa,eACX;IAAE,OAAO,KAAK;IAAO,UAAU;IAAK;IAAO,oCACtC,aAAM,SAAS,EAAE,eAAe,IACtC;;;AAIL,QAAO,GAAG,mBAAmB,KAAK,OAAO;EAAE;EAAqB;EAA0B,CAAC,CAAC,GAAG,SAAS,GAAG,aAAa,MAAM"}
|
package/dist/{getDatetimeRuleProcessorSQL-CSl2zGza.mjs → getDatetimeRuleProcessorSQL-CugqyF_a.mjs}
RENAMED
|
@@ -362,4 +362,4 @@ const getDatetimeRuleProcessorSQL = (apiFns) => (rule, options) => {
|
|
|
362
362
|
|
|
363
363
|
//#endregion
|
|
364
364
|
export { getDatetimeValueProcessorOracle as a, defaultDateTimeNLOperatorMap as c, getDatetimeRuleProcessorCEL as d, getDatetimeJsonLogicOperations as f, getDatetimeValueProcessorMySQL as i, getDatetimeRuleProcessorNL as l, processIsDateField as m, getDatetimeValueProcessorANSI as n, getDatetimeValueProcessorPostgreSQL as o, isISOStringDateOnly as p, getDatetimeValueProcessorMSSQL as r, datetimeValueProcessorNL as s, getDatetimeRuleProcessorSQL as t, getDatetimeRuleProcessorMongoDBQuery as u };
|
|
365
|
-
//# sourceMappingURL=getDatetimeRuleProcessorSQL-
|
|
365
|
+
//# sourceMappingURL=getDatetimeRuleProcessorSQL-CugqyF_a.mjs.map
|