@react-querybuilder/antd 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/dist/cjs/react-querybuilder_antd.cjs.development.d.ts +155 -116
- package/dist/cjs/react-querybuilder_antd.cjs.development.js +21 -20
- package/dist/cjs/react-querybuilder_antd.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_antd.cjs.production.d.ts +155 -116
- package/dist/cjs/react-querybuilder_antd.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_antd.cjs.production.js.map +1 -1
- package/dist/react-querybuilder_antd.d.mts +155 -116
- package/dist/react-querybuilder_antd.legacy-esm.d.ts +155 -116
- package/dist/react-querybuilder_antd.legacy-esm.js +13 -33
- package/dist/react-querybuilder_antd.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_antd.mjs +11 -31
- package/dist/react-querybuilder_antd.mjs.map +1 -1
- package/dist/react-querybuilder_antd.production.d.mts +155 -116
- package/dist/react-querybuilder_antd.production.mjs +1 -1
- package/dist/react-querybuilder_antd.production.mjs.map +1 -1
- package/package.json +9 -10
|
@@ -20,34 +20,6 @@ type Intersection = UnionToIntersection<Union>;
|
|
|
20
20
|
//=> {the(): void; great(arg: string): void; escape: boolean};
|
|
21
21
|
```
|
|
22
22
|
|
|
23
|
-
A more applicable example which could make its way into your library code follows.
|
|
24
|
-
|
|
25
|
-
@example
|
|
26
|
-
```
|
|
27
|
-
import type {UnionToIntersection} from 'type-fest';
|
|
28
|
-
|
|
29
|
-
class CommandOne {
|
|
30
|
-
commands: {
|
|
31
|
-
a1: () => undefined,
|
|
32
|
-
b1: () => undefined,
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
class CommandTwo {
|
|
37
|
-
commands: {
|
|
38
|
-
a2: (argA: string) => undefined,
|
|
39
|
-
b2: (argB: string) => undefined,
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const union = [new CommandOne(), new CommandTwo()].map(instance => instance.commands);
|
|
44
|
-
type Union = typeof union;
|
|
45
|
-
//=> {a1(): void; b1(): void} | {a2(argA: string): void; b2(argB: string): void}
|
|
46
|
-
|
|
47
|
-
type Intersection = UnionToIntersection<Union>;
|
|
48
|
-
//=> {a1(): void; b1(): void; a2(argA: string): void; b2(argB: string): void}
|
|
49
|
-
```
|
|
50
|
-
|
|
51
23
|
@category Type
|
|
52
24
|
*/
|
|
53
25
|
type UnionToIntersection<Union> = (
|
|
@@ -123,8 +95,8 @@ import type {IsAny} from 'type-fest';
|
|
|
123
95
|
const typedObject = {a: 1, b: 2} as const;
|
|
124
96
|
const anyObject: any = {a: 1, b: 2};
|
|
125
97
|
|
|
126
|
-
function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(
|
|
127
|
-
return
|
|
98
|
+
function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(object: O, key: K) {
|
|
99
|
+
return object[key];
|
|
128
100
|
}
|
|
129
101
|
|
|
130
102
|
const typedA = get(typedObject, 'a');
|
|
@@ -149,17 +121,17 @@ This is useful when writing utility types or schema validators that need to diff
|
|
|
149
121
|
```
|
|
150
122
|
import type {IsOptionalKeyOf} from 'type-fest';
|
|
151
123
|
|
|
152
|
-
|
|
124
|
+
type User = {
|
|
153
125
|
name: string;
|
|
154
126
|
surname: string;
|
|
155
127
|
|
|
156
128
|
luckyNumber?: number;
|
|
157
|
-
}
|
|
129
|
+
};
|
|
158
130
|
|
|
159
|
-
|
|
131
|
+
type Admin = {
|
|
160
132
|
name: string;
|
|
161
133
|
surname?: string;
|
|
162
|
-
}
|
|
134
|
+
};
|
|
163
135
|
|
|
164
136
|
type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
|
|
165
137
|
//=> true
|
|
@@ -192,12 +164,12 @@ This is useful when you want to create a new type that contains different type v
|
|
|
192
164
|
```
|
|
193
165
|
import type {OptionalKeysOf, Except} from 'type-fest';
|
|
194
166
|
|
|
195
|
-
|
|
167
|
+
type User = {
|
|
196
168
|
name: string;
|
|
197
169
|
surname: string;
|
|
198
170
|
|
|
199
171
|
luckyNumber?: number;
|
|
200
|
-
}
|
|
172
|
+
};
|
|
201
173
|
|
|
202
174
|
const REMOVE_FIELD = Symbol('remove field symbol');
|
|
203
175
|
type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKeysOf<Entity>> & {
|
|
@@ -205,12 +177,12 @@ type UpdateOperation<Entity extends object> = Except<Partial<Entity>, OptionalKe
|
|
|
205
177
|
};
|
|
206
178
|
|
|
207
179
|
const update1: UpdateOperation<User> = {
|
|
208
|
-
name: 'Alice'
|
|
180
|
+
name: 'Alice',
|
|
209
181
|
};
|
|
210
182
|
|
|
211
183
|
const update2: UpdateOperation<User> = {
|
|
212
184
|
name: 'Bob',
|
|
213
|
-
luckyNumber: REMOVE_FIELD
|
|
185
|
+
luckyNumber: REMOVE_FIELD,
|
|
214
186
|
};
|
|
215
187
|
```
|
|
216
188
|
|
|
@@ -230,17 +202,23 @@ This is useful when you want to create a new type that contains different type v
|
|
|
230
202
|
```
|
|
231
203
|
import type {RequiredKeysOf} from 'type-fest';
|
|
232
204
|
|
|
233
|
-
declare function createValidation<
|
|
205
|
+
declare function createValidation<
|
|
206
|
+
Entity extends object,
|
|
207
|
+
Key extends RequiredKeysOf<Entity> = RequiredKeysOf<Entity>,
|
|
208
|
+
>(field: Key, validator: (value: Entity[Key]) => boolean): (entity: Entity) => boolean;
|
|
234
209
|
|
|
235
|
-
|
|
210
|
+
type User = {
|
|
236
211
|
name: string;
|
|
237
212
|
surname: string;
|
|
238
|
-
|
|
239
213
|
luckyNumber?: number;
|
|
240
|
-
}
|
|
214
|
+
};
|
|
241
215
|
|
|
242
216
|
const validator1 = createValidation<User>('name', value => value.length < 25);
|
|
243
217
|
const validator2 = createValidation<User>('surname', value => value.length < 25);
|
|
218
|
+
|
|
219
|
+
// @ts-expect-error
|
|
220
|
+
const validator3 = createValidation<User>('luckyNumber', value => value > 0);
|
|
221
|
+
// Error: Argument of type '"luckyNumber"' is not assignable to parameter of type '"name" | "surname"'.
|
|
244
222
|
```
|
|
245
223
|
|
|
246
224
|
@category Utilities
|
|
@@ -262,29 +240,41 @@ Useful in type utilities, such as checking if something does not occur.
|
|
|
262
240
|
```
|
|
263
241
|
import type {IsNever, And} from 'type-fest';
|
|
264
242
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
And<
|
|
268
|
-
IsNever<Exclude<A, B>> extends true ? true : false,
|
|
269
|
-
IsNever<Exclude<B, A>> extends true ? true : false
|
|
270
|
-
>;
|
|
271
|
-
|
|
272
|
-
type EndIfEqual<I extends string, O extends string> =
|
|
273
|
-
AreStringsEqual<I, O> extends true
|
|
274
|
-
? never
|
|
275
|
-
: void;
|
|
276
|
-
|
|
277
|
-
function endIfEqual<I extends string, O extends string>(input: I, output: O): EndIfEqual<I, O> {
|
|
278
|
-
if (input === output) {
|
|
279
|
-
process.exit(0);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
243
|
+
type A = IsNever<never>;
|
|
244
|
+
//=> true
|
|
282
245
|
|
|
283
|
-
|
|
284
|
-
//=>
|
|
246
|
+
type B = IsNever<any>;
|
|
247
|
+
//=> false
|
|
248
|
+
|
|
249
|
+
type C = IsNever<unknown>;
|
|
250
|
+
//=> false
|
|
251
|
+
|
|
252
|
+
type D = IsNever<never[]>;
|
|
253
|
+
//=> false
|
|
254
|
+
|
|
255
|
+
type E = IsNever<object>;
|
|
256
|
+
//=> false
|
|
257
|
+
|
|
258
|
+
type F = IsNever<string>;
|
|
259
|
+
//=> false
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
@example
|
|
263
|
+
```
|
|
264
|
+
import type {IsNever} from 'type-fest';
|
|
285
265
|
|
|
286
|
-
|
|
287
|
-
|
|
266
|
+
type IsTrue<T> = T extends true ? true : false;
|
|
267
|
+
|
|
268
|
+
// When a distributive conditional is instantiated with `never`, the entire conditional results in `never`.
|
|
269
|
+
type A = IsTrue<never>;
|
|
270
|
+
// ^? type A = never
|
|
271
|
+
|
|
272
|
+
// If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional.
|
|
273
|
+
type IsTrueFixed<T> =
|
|
274
|
+
IsNever<T> extends true ? false : T extends true ? true : false;
|
|
275
|
+
|
|
276
|
+
type B = IsTrueFixed<never>;
|
|
277
|
+
// ^? type B = false
|
|
288
278
|
```
|
|
289
279
|
|
|
290
280
|
@category Type Guard
|
|
@@ -305,7 +295,7 @@ Note:
|
|
|
305
295
|
|
|
306
296
|
@example
|
|
307
297
|
```
|
|
308
|
-
import {If} from 'type-fest';
|
|
298
|
+
import type {If} from 'type-fest';
|
|
309
299
|
|
|
310
300
|
type A = If<true, 'yes', 'no'>;
|
|
311
301
|
//=> 'yes'
|
|
@@ -325,7 +315,7 @@ type E = If<never, 'yes', 'no'>;
|
|
|
325
315
|
|
|
326
316
|
@example
|
|
327
317
|
```
|
|
328
|
-
import {If, IsAny, IsNever} from 'type-fest';
|
|
318
|
+
import type {If, IsAny, IsNever} from 'type-fest';
|
|
329
319
|
|
|
330
320
|
type A = If<IsAny<unknown>, 'is any', 'not any'>;
|
|
331
321
|
//=> 'not any'
|
|
@@ -336,7 +326,7 @@ type B = If<IsNever<never>, 'is never', 'not never'>;
|
|
|
336
326
|
|
|
337
327
|
@example
|
|
338
328
|
```
|
|
339
|
-
import {If, IsEqual} from 'type-fest';
|
|
329
|
+
import type {If, IsEqual} from 'type-fest';
|
|
340
330
|
|
|
341
331
|
type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
|
|
342
332
|
|
|
@@ -347,6 +337,41 @@ type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
|
347
337
|
//=> 'not equal'
|
|
348
338
|
```
|
|
349
339
|
|
|
340
|
+
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:
|
|
341
|
+
|
|
342
|
+
@example
|
|
343
|
+
```
|
|
344
|
+
import type {If, IsEqual, StringRepeat} from 'type-fest';
|
|
345
|
+
|
|
346
|
+
type HundredZeroes = StringRepeat<'0', 100>;
|
|
347
|
+
|
|
348
|
+
// The following implementation is not tail recursive
|
|
349
|
+
type Includes<S extends string, Char extends string> =
|
|
350
|
+
S extends `${infer First}${infer Rest}`
|
|
351
|
+
? If<IsEqual<First, Char>,
|
|
352
|
+
'found',
|
|
353
|
+
Includes<Rest, Char>>
|
|
354
|
+
: 'not found';
|
|
355
|
+
|
|
356
|
+
// Hence, instantiations with long strings will fail
|
|
357
|
+
// @ts-expect-error
|
|
358
|
+
type Fails = Includes<HundredZeroes, '1'>;
|
|
359
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
360
|
+
// Error: Type instantiation is excessively deep and possibly infinite.
|
|
361
|
+
|
|
362
|
+
// However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
|
|
363
|
+
type IncludesWithoutIf<S extends string, Char extends string> =
|
|
364
|
+
S extends `${infer First}${infer Rest}`
|
|
365
|
+
? IsEqual<First, Char> extends true
|
|
366
|
+
? 'found'
|
|
367
|
+
: IncludesWithoutIf<Rest, Char>
|
|
368
|
+
: 'not found';
|
|
369
|
+
|
|
370
|
+
// Now, instantiations with long strings will work
|
|
371
|
+
type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
372
|
+
//=> 'not found'
|
|
373
|
+
```
|
|
374
|
+
|
|
350
375
|
@category Type Guard
|
|
351
376
|
@category Utilities
|
|
352
377
|
*/
|
|
@@ -380,7 +405,6 @@ type C = IsArray<string>;
|
|
|
380
405
|
type UnknownArray = readonly unknown[];
|
|
381
406
|
//#endregion
|
|
382
407
|
//#region ../../node_modules/type-fest/source/internal/array.d.ts
|
|
383
|
-
|
|
384
408
|
/**
|
|
385
409
|
Returns whether the given array `T` is readonly.
|
|
386
410
|
*/
|
|
@@ -432,16 +456,17 @@ const literal = {foo: 123, bar: 'hello', baz: 456};
|
|
|
432
456
|
const someType: SomeType = literal;
|
|
433
457
|
const someInterface: SomeInterface = literal;
|
|
434
458
|
|
|
435
|
-
function fn(object: Record<string, unknown>): void
|
|
459
|
+
declare function fn(object: Record<string, unknown>): void;
|
|
436
460
|
|
|
437
461
|
fn(literal); // Good: literal object type is sealed
|
|
438
462
|
fn(someType); // Good: type is sealed
|
|
463
|
+
// @ts-expect-error
|
|
439
464
|
fn(someInterface); // Error: Index signature for type 'string' is missing in type 'someInterface'. Because `interface` can be re-opened
|
|
440
465
|
fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface` into a `type`
|
|
441
466
|
```
|
|
442
467
|
|
|
443
468
|
@link https://github.com/microsoft/TypeScript/issues/15300
|
|
444
|
-
@see SimplifyDeep
|
|
469
|
+
@see {@link SimplifyDeep}
|
|
445
470
|
@category Object
|
|
446
471
|
*/
|
|
447
472
|
type Simplify<T$1> = { [KeyType in keyof T$1]: T$1[KeyType] } & {};
|
|
@@ -473,7 +498,7 @@ type Includes<Value extends readonly any[], Item> =
|
|
|
473
498
|
@category Type Guard
|
|
474
499
|
@category Utilities
|
|
475
500
|
*/
|
|
476
|
-
type IsEqual<A, B> = [A
|
|
501
|
+
type IsEqual<A, B> = [A] extends [B] ? [B] extends [A] ? _IsEqual<A, B> : false : false;
|
|
477
502
|
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
478
503
|
type _IsEqual<A, B> = (<G>() => G extends A & G | G ? 1 : 2) extends (<G>() => G extends B & G | G ? 1 : 2) ? true : false;
|
|
479
504
|
//#endregion
|
|
@@ -495,6 +520,7 @@ It relies on the fact that an empty object (`{}`) is assignable to an object wit
|
|
|
495
520
|
```
|
|
496
521
|
const indexed: Record<string, unknown> = {}; // Allowed
|
|
497
522
|
|
|
523
|
+
// @ts-expect-error
|
|
498
524
|
const keyed: Record<'foo', unknown> = {}; // Error
|
|
499
525
|
// => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar
|
|
500
526
|
```
|
|
@@ -508,16 +534,14 @@ type Indexed = {} extends Record<string, unknown>
|
|
|
508
534
|
// => '✅ `{}` is assignable to `Record<string, unknown>`'
|
|
509
535
|
|
|
510
536
|
type Keyed = {} extends Record<'foo' | 'bar', unknown>
|
|
511
|
-
?
|
|
512
|
-
:
|
|
537
|
+
? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`'
|
|
538
|
+
: '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`';
|
|
513
539
|
// => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`"
|
|
514
540
|
```
|
|
515
541
|
|
|
516
542
|
Using a [mapped type](https://www.typescriptlang.org/docs/handbook/2/mapped-types.html#further-exploration), you can then check for each `KeyType` of `ObjectType`...
|
|
517
543
|
|
|
518
544
|
```
|
|
519
|
-
import type {OmitIndexSignature} from 'type-fest';
|
|
520
|
-
|
|
521
545
|
type OmitIndexSignature<ObjectType> = {
|
|
522
546
|
[KeyType in keyof ObjectType // Map each key of `ObjectType`...
|
|
523
547
|
]: ObjectType[KeyType]; // ...to its original value, i.e. `OmitIndexSignature<Foo> == Foo`.
|
|
@@ -527,14 +551,12 @@ type OmitIndexSignature<ObjectType> = {
|
|
|
527
551
|
...whether an empty object (`{}`) would be assignable to an object with that `KeyType` (`Record<KeyType, unknown>`)...
|
|
528
552
|
|
|
529
553
|
```
|
|
530
|
-
import type {OmitIndexSignature} from 'type-fest';
|
|
531
|
-
|
|
532
554
|
type OmitIndexSignature<ObjectType> = {
|
|
533
555
|
[KeyType in keyof ObjectType
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
556
|
+
// Is `{}` assignable to `Record<KeyType, unknown>`?
|
|
557
|
+
as {} extends Record<KeyType, unknown>
|
|
558
|
+
? never // ✅ `{}` is assignable to `Record<KeyType, unknown>`
|
|
559
|
+
: KeyType // ❌ `{}` is NOT assignable to `Record<KeyType, unknown>`
|
|
538
560
|
]: ObjectType[KeyType];
|
|
539
561
|
};
|
|
540
562
|
```
|
|
@@ -545,27 +567,27 @@ If `{}` is assignable, it means that `KeyType` is an index signature and we want
|
|
|
545
567
|
```
|
|
546
568
|
import type {OmitIndexSignature} from 'type-fest';
|
|
547
569
|
|
|
548
|
-
|
|
570
|
+
type Example = {
|
|
549
571
|
// These index signatures will be removed.
|
|
550
|
-
[x: string]: any
|
|
551
|
-
[x: number]: any
|
|
552
|
-
[x: symbol]: any
|
|
553
|
-
[x: `head-${string}`]: string
|
|
554
|
-
[x: `${string}-tail`]: string
|
|
555
|
-
[x: `head-${string}-tail`]: string
|
|
556
|
-
[x: `${bigint}`]: string
|
|
557
|
-
[x: `embedded-${number}`]: string
|
|
572
|
+
[x: string]: any;
|
|
573
|
+
[x: number]: any;
|
|
574
|
+
[x: symbol]: any;
|
|
575
|
+
[x: `head-${string}`]: string;
|
|
576
|
+
[x: `${string}-tail`]: string;
|
|
577
|
+
[x: `head-${string}-tail`]: string;
|
|
578
|
+
[x: `${bigint}`]: string;
|
|
579
|
+
[x: `embedded-${number}`]: string;
|
|
558
580
|
|
|
559
581
|
// These explicitly defined keys will remain.
|
|
560
582
|
foo: 'bar';
|
|
561
583
|
qux?: 'baz';
|
|
562
|
-
}
|
|
584
|
+
};
|
|
563
585
|
|
|
564
586
|
type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
565
587
|
// => { foo: 'bar'; qux?: 'baz' | undefined; }
|
|
566
588
|
```
|
|
567
589
|
|
|
568
|
-
@see PickIndexSignature
|
|
590
|
+
@see {@link PickIndexSignature}
|
|
569
591
|
@category Object
|
|
570
592
|
*/
|
|
571
593
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
@@ -613,7 +635,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
613
635
|
// }
|
|
614
636
|
```
|
|
615
637
|
|
|
616
|
-
@see OmitIndexSignature
|
|
638
|
+
@see {@link OmitIndexSignature}
|
|
617
639
|
@category Object
|
|
618
640
|
*/
|
|
619
641
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
@@ -629,12 +651,12 @@ Merge two types into a new type. Keys of the second type overrides keys of the f
|
|
|
629
651
|
```
|
|
630
652
|
import type {Merge} from 'type-fest';
|
|
631
653
|
|
|
632
|
-
|
|
654
|
+
type Foo = {
|
|
633
655
|
[x: string]: unknown;
|
|
634
656
|
[x: number]: unknown;
|
|
635
657
|
foo: string;
|
|
636
658
|
bar: symbol;
|
|
637
|
-
}
|
|
659
|
+
};
|
|
638
660
|
|
|
639
661
|
type Bar = {
|
|
640
662
|
[x: number]: number;
|
|
@@ -813,12 +835,14 @@ type Foo = {
|
|
|
813
835
|
type FooWithoutA = Except<Foo, 'a'>;
|
|
814
836
|
//=> {b: string}
|
|
815
837
|
|
|
838
|
+
// @ts-expect-error
|
|
816
839
|
const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
|
|
817
840
|
//=> errors: 'a' does not exist in type '{ b: string; }'
|
|
818
841
|
|
|
819
842
|
type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
|
|
820
843
|
//=> {a: number} & Partial<Record<"b", never>>
|
|
821
844
|
|
|
845
|
+
// @ts-expect-error
|
|
822
846
|
const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
|
|
823
847
|
//=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
|
|
824
848
|
|
|
@@ -835,12 +859,12 @@ type UserData = {
|
|
|
835
859
|
|
|
836
860
|
// `Omit` clearly doesn't behave as expected in this case:
|
|
837
861
|
type PostPayload = Omit<UserData, 'email'>;
|
|
838
|
-
//=>
|
|
862
|
+
//=> { [x: string]: string; [x: number]: string; }
|
|
839
863
|
|
|
840
864
|
// In situations like this, `Except` works better.
|
|
841
865
|
// It simply removes the `email` key while preserving all the other keys.
|
|
842
|
-
type
|
|
843
|
-
//=>
|
|
866
|
+
type PostPayloadFixed = Except<UserData, 'email'>;
|
|
867
|
+
//=> { [x: string]: string; name: string; role: 'admin' | 'user'; }
|
|
844
868
|
```
|
|
845
869
|
|
|
846
870
|
@category Object
|
|
@@ -862,7 +886,7 @@ type Foo = {
|
|
|
862
886
|
a?: number;
|
|
863
887
|
b: string;
|
|
864
888
|
c?: boolean;
|
|
865
|
-
}
|
|
889
|
+
};
|
|
866
890
|
|
|
867
891
|
type SomeRequired = SetRequired<Foo, 'b' | 'c'>;
|
|
868
892
|
// type SomeRequired = {
|
|
@@ -916,7 +940,7 @@ type Foo = {
|
|
|
916
940
|
a: number | null;
|
|
917
941
|
b: string | undefined;
|
|
918
942
|
c?: boolean | null;
|
|
919
|
-
}
|
|
943
|
+
};
|
|
920
944
|
|
|
921
945
|
type SomeNonNullable = SetNonNullable<Foo, 'b' | 'c'>;
|
|
922
946
|
// type SomeNonNullable = {
|
|
@@ -1119,7 +1143,7 @@ interface RuleGroupType<R$1 extends RuleType = RuleType, C extends string = stri
|
|
|
1119
1143
|
/**
|
|
1120
1144
|
* The type of the `rules` array in a {@link RuleGroupType}.
|
|
1121
1145
|
*/
|
|
1122
|
-
type RuleGroupArray<RG
|
|
1146
|
+
type RuleGroupArray<RG extends RuleGroupType = RuleGroupType, R$1 extends RuleType = RuleType> = (R$1 | RG)[];
|
|
1123
1147
|
//#endregion
|
|
1124
1148
|
//#region ../core/src/types/ruleGroupsIC.utils.d.ts
|
|
1125
1149
|
type MAXIMUM_ALLOWED_BOUNDARY = 80;
|
|
@@ -1145,7 +1169,7 @@ type RuleGroupTypeAny<R$1 extends RuleType = RuleType, C extends string = string
|
|
|
1145
1169
|
/**
|
|
1146
1170
|
* The type of the `rules` array in a {@link RuleGroupTypeIC}.
|
|
1147
1171
|
*/
|
|
1148
|
-
type RuleGroupICArray<RG
|
|
1172
|
+
type RuleGroupICArray<RG extends RuleGroupTypeIC = RuleGroupTypeIC, R$1 extends RuleType = RuleType, C extends string = string> = [R$1 | RG] | [R$1 | RG, ...MappedTuple<[C, R$1 | RG]>] | ((R$1 | RG)[] & {
|
|
1149
1173
|
length: 0;
|
|
1150
1174
|
});
|
|
1151
1175
|
/**
|
|
@@ -1155,7 +1179,7 @@ type RuleOrGroupArray = RuleGroupArray | RuleGroupICArray;
|
|
|
1155
1179
|
/**
|
|
1156
1180
|
* Converts a narrowed rule group type to its most generic form.
|
|
1157
1181
|
*/
|
|
1158
|
-
type GenericizeRuleGroupType<RG
|
|
1182
|
+
type GenericizeRuleGroupType<RG> = RG extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
|
|
1159
1183
|
//#endregion
|
|
1160
1184
|
//#region ../core/src/types/validation.d.ts
|
|
1161
1185
|
/**
|
|
@@ -1493,9 +1517,13 @@ interface Classnames {
|
|
|
1493
1517
|
*/
|
|
1494
1518
|
branches: Classname;
|
|
1495
1519
|
/**
|
|
1496
|
-
* Classname(s) rules that render a subquery.
|
|
1520
|
+
* Classname(s) applied to rules that render a subquery.
|
|
1497
1521
|
*/
|
|
1498
1522
|
hasSubQuery: Classname;
|
|
1523
|
+
/**
|
|
1524
|
+
* Classname(s) applied to async components in their "loading" state.
|
|
1525
|
+
*/
|
|
1526
|
+
loading: Classname;
|
|
1499
1527
|
}
|
|
1500
1528
|
/**
|
|
1501
1529
|
* Placeholder strings for option lists.
|
|
@@ -2412,15 +2440,15 @@ type QueryBuilderContextProvider<ExtraProps extends object = Record<string, any>
|
|
|
2412
2440
|
*
|
|
2413
2441
|
* @group Props
|
|
2414
2442
|
*/
|
|
2415
|
-
type QueryBuilderProps<RG
|
|
2443
|
+
type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O extends FullOperator, C extends FullCombinator> = RG extends RuleGroupType<infer R> | RuleGroupTypeIC<infer R> ? QueryBuilderContextProps<F, GetOptionIdentifierType<O>> & {
|
|
2416
2444
|
/**
|
|
2417
2445
|
* Initial query object for uncontrolled components.
|
|
2418
2446
|
*/
|
|
2419
|
-
defaultQuery?: RG
|
|
2447
|
+
defaultQuery?: RG;
|
|
2420
2448
|
/**
|
|
2421
2449
|
* Query object for controlled components.
|
|
2422
2450
|
*/
|
|
2423
|
-
query?: RG
|
|
2451
|
+
query?: RG;
|
|
2424
2452
|
/**
|
|
2425
2453
|
* List of valid {@link FullField}s.
|
|
2426
2454
|
*
|
|
@@ -2572,7 +2600,7 @@ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O ext
|
|
|
2572
2600
|
*/
|
|
2573
2601
|
getSubQueryBuilderProps?(field: GetOptionIdentifierType<F>, misc: {
|
|
2574
2602
|
fieldData: F;
|
|
2575
|
-
}): QueryBuilderProps<GenericizeRuleGroupType<RG
|
|
2603
|
+
}): QueryBuilderProps<GenericizeRuleGroupType<RG>, FullOption, FullOption, FullOption>;
|
|
2576
2604
|
/**
|
|
2577
2605
|
* The return value of this function will be used to apply classnames to the
|
|
2578
2606
|
* outer `<div>` of the given {@link Rule}.
|
|
@@ -2584,56 +2612,56 @@ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O ext
|
|
|
2584
2612
|
* The return value of this function will be used to apply classnames to the
|
|
2585
2613
|
* outer `<div>` of the given {@link RuleGroup}.
|
|
2586
2614
|
*/
|
|
2587
|
-
getRuleGroupClassname?(ruleGroup: RG
|
|
2615
|
+
getRuleGroupClassname?(ruleGroup: RG): Classname;
|
|
2588
2616
|
/**
|
|
2589
2617
|
* This callback is invoked before a new rule is added. The function should either manipulate
|
|
2590
2618
|
* the rule and return the new object, return `true` to allow the addition to proceed as normal,
|
|
2591
2619
|
* or return `false` to cancel the addition of the rule.
|
|
2592
2620
|
*/
|
|
2593
|
-
onAddRule?(rule: R, parentPath: Path, query: RG
|
|
2621
|
+
onAddRule?(rule: R, parentPath: Path, query: RG, context?: any): RuleType | boolean;
|
|
2594
2622
|
/**
|
|
2595
2623
|
* This callback is invoked before a new group is added. The function should either manipulate
|
|
2596
2624
|
* the group and return the new object, return `true` to allow the addition to proceed as normal,
|
|
2597
2625
|
* or return `false` to cancel the addition of the group.
|
|
2598
2626
|
*/
|
|
2599
|
-
onAddGroup?(ruleGroup: RG
|
|
2627
|
+
onAddGroup?(ruleGroup: RG, parentPath: Path, query: RG, context?: any): RG | boolean;
|
|
2600
2628
|
/**
|
|
2601
2629
|
* This callback is invoked before a rule is moved or shifted. The function should return
|
|
2602
2630
|
* `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
|
|
2603
2631
|
* a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2604
2632
|
* query state.
|
|
2605
2633
|
*/
|
|
2606
|
-
onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG
|
|
2634
|
+
onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
|
|
2607
2635
|
/**
|
|
2608
2636
|
* This callback is invoked before a group is moved or shifted. The function should return
|
|
2609
2637
|
* `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
|
|
2610
2638
|
* a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2611
2639
|
* query state.
|
|
2612
2640
|
*/
|
|
2613
|
-
onMoveGroup?(ruleGroup: RG
|
|
2641
|
+
onMoveGroup?(ruleGroup: RG, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
|
|
2614
2642
|
/**
|
|
2615
2643
|
* This callback is invoked before a rule is grouped with another object. The function should
|
|
2616
2644
|
* return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
|
|
2617
2645
|
* or a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2618
2646
|
* query state.
|
|
2619
2647
|
*/
|
|
2620
|
-
onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG
|
|
2648
|
+
onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
|
|
2621
2649
|
/**
|
|
2622
2650
|
* This callback is invoked before a group is grouped with another object. The function should
|
|
2623
2651
|
* return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
|
|
2624
2652
|
* or a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2625
2653
|
* query state.
|
|
2626
2654
|
*/
|
|
2627
|
-
onGroupGroup?(ruleGroup: RG
|
|
2655
|
+
onGroupGroup?(ruleGroup: RG, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
|
|
2628
2656
|
/**
|
|
2629
2657
|
* This callback is invoked before a rule or group is removed. The function should return
|
|
2630
2658
|
* `true` if the rule or group should be removed or `false` if it should not be removed.
|
|
2631
2659
|
*/
|
|
2632
|
-
onRemove?(ruleOrGroup: R | RG
|
|
2660
|
+
onRemove?(ruleOrGroup: R | RG, path: Path, query: RG, context?: any): boolean;
|
|
2633
2661
|
/**
|
|
2634
2662
|
* This callback is invoked anytime the query state is updated.
|
|
2635
2663
|
*/
|
|
2636
|
-
onQueryChange?(query: RG
|
|
2664
|
+
onQueryChange?(query: RG): void;
|
|
2637
2665
|
/**
|
|
2638
2666
|
* Each log object will be passed to this function when `debugMode` is `true`.
|
|
2639
2667
|
*
|
|
@@ -2706,6 +2734,17 @@ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O ext
|
|
|
2706
2734
|
context?: any;
|
|
2707
2735
|
} : never;
|
|
2708
2736
|
//#endregion
|
|
2737
|
+
//#region ../react-querybuilder/src/redux/getRqbStore.d.ts
|
|
2738
|
+
declare global {
|
|
2739
|
+
var __RQB_DEVTOOLS__: boolean | undefined;
|
|
2740
|
+
}
|
|
2741
|
+
/**
|
|
2742
|
+
* Gets the singleton React Query Builder store instance.
|
|
2743
|
+
* DevTools are enabled if either:
|
|
2744
|
+
* - globalThis.__RQB_DEVTOOLS__ is truthy
|
|
2745
|
+
* - window.__RQB_DEVTOOLS__ is truthy
|
|
2746
|
+
*/
|
|
2747
|
+
//#endregion
|
|
2709
2748
|
//#region src/AntDActionElement.d.ts
|
|
2710
2749
|
type RemoveDataIndexKeys<T$1> = { [K in keyof T$1 as `data-${string}` extends K ? never : K]: T$1[K] };
|
|
2711
2750
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`@ant-design/icons`)
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require(`@ant-design/icons`),u=require(`react`);u=c(u);let d=require(`react-querybuilder`),f=require(`antd`),p=require(`antd/es/date-picker/generatePicker/index.js`);p=c(p);let m=require(`dayjs`);m=c(m);let h=require(`dayjs/plugin/advancedFormat.js`);h=c(h);let g=require(`dayjs/plugin/customParseFormat.js`);g=c(g);let _=require(`dayjs/plugin/localeData.js`);_=c(_);let v=require(`dayjs/plugin/weekOfYear.js`);v=c(v);let y=require(`dayjs/plugin/weekYear.js`);y=c(y);let b=require(`dayjs/plugin/weekday.js`);b=c(b);const x=({className:e,handleOnClick:t,label:n,title:r,disabled:i,disabledTranslation:a,testID:o,level:s,path:c,context:l,validation:d,ruleOrGroup:p,schema:m,...h})=>u.createElement(f.Button,{type:`primary`,className:e,title:a&&i?a.title:r,onClick:e=>t(e),disabled:i&&!a,...h},a&&i?a.label:n),S=(0,u.forwardRef)(({className:e,title:t,testID:n,level:r,path:i,label:a,disabled:o,context:s,validation:c,schema:d,ruleOrGroup:f,...p},m)=>u.createElement(l.HolderOutlined,{className:e,title:t,...p,ref:m})),C=({className:e,handleOnChange:t,label:n,checked:r,title:i,disabled:a,path:o,context:s,validation:c,testID:l,schema:d,ruleGroup:p,...m})=>u.createElement(f.Switch,{title:i,className:e,onChange:e=>t(e),checked:!!r,disabled:a,checkedChildren:n,unCheckedChildren:`=`,...m}),w=({shiftUp:e,shiftDown:t,shiftUpDisabled:n,shiftDownDisabled:r,disabled:i,className:a,labels:o,titles:s,testID:c})=>u.createElement(`div`,{"data-testid":c,className:a},u.createElement(f.Button,{type:`primary`,size:`small`,title:s?.shiftUp,onClick:e,disabled:i||n},o?.shiftUp),u.createElement(f.Button,{type:`primary`,size:`small`,title:s?.shiftDown,onClick:t,disabled:i||r},o?.shiftDown));var T=o((e=>{Object.defineProperty(e,`__esModule`,{value:!0}),e.default=void 0,e.noteOnce=l,e.preMessage=void 0;var t={},n=[],r=e.preMessage=function(e){n.push(e)};function i(e,t){if(process.env.NODE_ENV!==`production`&&!e&&console!==void 0){var r=n.reduce(function(e,t){return t(e??``,`warning`)},t);r&&console.error(`Warning: ${r}`)}}function a(e,t){if(process.env.NODE_ENV!==`production`&&!e&&console!==void 0){var r=n.reduce(function(e,t){return t(e??``,`note`)},t);r&&console.warn(`Note: ${r}`)}}function o(){t={}}function s(e,n,r){!n&&!t[r]&&(e(!1,r),t[r]=!0)}function c(e,t){s(i,e,t)}function l(e,t){s(a,e,t)}c.preMessage=r,c.resetWarned=o,c.noteOnce=l,e.default=c})),E=T();m.default.extend(g.default),m.default.extend(h.default),m.default.extend(b.default),m.default.extend(_.default),m.default.extend(v.default),m.default.extend(y.default),m.default.extend((e,t)=>{let n=t.prototype,r=n.format;n.format=function(e){let t=(e||``).replace(`Wo`,`wo`);return r.bind(this)(t)}});const D={bn_BD:`bn-bd`,by_BY:`be`,en_GB:`en-gb`,en_US:`en`,fr_BE:`fr`,fr_CA:`fr-ca`,hy_AM:`hy-am`,kmr_IQ:`ku`,nl_BE:`nl-be`,pt_BR:`pt-br`,zh_CN:`zh-cn`,zh_HK:`zh-hk`,zh_TW:`zh-tw`},O=e=>D[e]||e.split(`_`)[0],k=()=>{(0,E.noteOnce)(!1,`Not match any format. Please help to fire a issue about this.`)},A={getNow:()=>(0,m.default)(),getFixedDate:e=>(0,m.default)(e,[`YYYY-M-DD`,`YYYY-MM-DD`]),getEndDate:e=>e.endOf(`month`),getWeekDay:e=>{let t=e.locale(`en`);return t.weekday()+t.localeData().firstDayOfWeek()},getYear:e=>e.year(),getMonth:e=>e.month(),getDate:e=>e.date(),getHour:e=>e.hour(),getMinute:e=>e.minute(),getSecond:e=>e.second(),getMillisecond:e=>e.millisecond(),addYear:(e,t)=>e.add(t,`year`),addMonth:(e,t)=>e.add(t,`month`),addDate:(e,t)=>e.add(t,`day`),setYear:(e,t)=>e.year(t),setMonth:(e,t)=>e.month(t),setDate:(e,t)=>e.date(t),setHour:(e,t)=>e.hour(t),setMinute:(e,t)=>e.minute(t),setSecond:(e,t)=>e.second(t),setMillisecond:(e,t)=>e.millisecond(t),isAfter:(e,t)=>e.isAfter(t),isValidate:e=>e.isValid(),locale:{getWeekFirstDay:e=>(0,m.default)().locale(O(e)).localeData().firstDayOfWeek(),getWeekFirstDate:(e,t)=>t.locale(O(e)).weekday(0),getWeek:(e,t)=>t.locale(O(e)).week(),getShortWeekDays:e=>(0,m.default)().locale(O(e)).localeData().weekdaysMin(),getShortMonths:e=>(0,m.default)().locale(O(e)).localeData().monthsShort(),format:(e,t,n)=>t.locale(O(e)).format(n),parse:(e,t,n)=>{let r=O(e);for(let e of n){let n=t;if(e.includes(`wo`)||e.includes(`Wo`)){let e=n.split(`-`)[0],t=n.split(`-`)[1],i=(0,m.default)(e,`YYYY`).startOf(`year`).locale(r);for(let e=0;e<=52;e+=1){let n=i.add(e,`week`);if(n.format(`Wo`)===t)return n}return k(),null}let i=(0,m.default)(n,e,!0).locale(r);if(i.isValid())return i}return t&&k(),null}}};var j=A;const M=(0,p.default)(j),N=e=>{let{fieldData:t,operator:n,value:r,handleOnChange:i,title:a,className:o,type:s,inputType:c,values:l=[],listsAsArrays:p,separator:h,valueSource:g,disabled:_,testID:v,selectorComponent:y=e.schema.controls.valueSelector,extraProps:b,parseNumbers:x,...S}=e,{valueAsArray:C,multiValueHandler:w,bigIntValueHandler:T,valueListItemClassName:E,inputTypeCoerced:D}=(0,d.useValueEditor)(e);if(n===`null`||n===`notNull`)return null;let O=t?.placeholder??``;if((n===`between`||n===`notBetween`)&&(s===`select`||s===`text`)&&D!==`date`&&D!==`datetime-local`){if(s===`text`){let e=[`from`,`to`].map((e,t)=>D===`time`?u.createElement(M.TimePicker,{key:e,value:C[t]?(0,m.default)(C[t],`HH:mm:ss`):null,className:E,disabled:_,placeholder:O,onChange:e=>w(e?.format(`HH:mm:ss`)??``,t),...b}):D===`number`?u.createElement(f.InputNumber,{key:e,type:D,value:C[t]??``,className:E,disabled:_,placeholder:O,onChange:e=>w(e,t),...b}):u.createElement(f.Input,{key:e,type:D,value:C[t]??``,className:E,disabled:_,placeholder:O,onChange:e=>w(e.target.value,t),...b}));return u.createElement(`span`,{"data-testid":v,className:o,title:a},e[0],h,e[1])}return u.createElement(d.ValueEditor,{...e,skipHook:!0})}switch(s){case`select`:case`multiselect`:return u.createElement(y,{...S,className:o,title:a,value:r,disabled:_,listsAsArrays:p,multiple:s===`multiselect`,handleOnChange:i,options:l,...b});case`textarea`:return u.createElement(f.Input.TextArea,{value:r,title:a,className:o,disabled:_,placeholder:O,onChange:e=>i(e.target.value),...b});case`switch`:return u.createElement(f.Switch,{checked:!!r,title:a,className:o,disabled:_,onChange:e=>i(e),...b});case`checkbox`:return u.createElement(`span`,{title:a,className:o},u.createElement(f.Checkbox,{type:`checkbox`,disabled:_,onChange:e=>i(e.target.checked),checked:!!r,...b}));case`radio`:return u.createElement(`span`,{className:o,title:a},l.map(e=>u.createElement(f.Radio,{key:e.name,value:e.name,checked:r===e.name,disabled:_,onChange:e=>i(e.target.value),...b},e.label)))}switch(D){case`date`:case`datetime-local`:{if(n===`between`||n===`notBetween`){let e=C.slice(0,2).map(e=>(0,m.default)(e));return u.createElement(M.RangePicker,{value:e.every(e=>e.isValid())?e:void 0,showTime:D===`datetime-local`,className:o,disabled:_,placeholder:[O,O],onChange:e=>{let t=`YYYY-MM-DD${D===`datetime-local`?`THH:mm:ss`:``}`,n=e?.map(e=>e?.isValid()?e.format(t):void 0);i(n?p?n:(0,d.joinWith)(n,`,`):e)},...b})}let e=(0,m.default)(r);return u.createElement(M,{value:e.isValid()?e:void 0,showTime:D===`datetime-local`,className:o,disabled:_,placeholder:O,onChange:(e,t)=>i(t),...b})}case`time`:{let e=(0,m.default)(r,`HH:mm:ss`);return u.createElement(M.TimePicker,{value:e.isValid()?e:void 0,className:o,disabled:_,placeholder:O,onChange:e=>i(e?.format(`HH:mm:ss`)??``),...b})}case`number`:return u.createElement(f.InputNumber,{type:D,value:r,title:a,className:o,disabled:_,placeholder:O,onChange:i,...b})}return c===`bigint`?u.createElement(f.Input,{"data-testid":v,type:D,placeholder:O,value:`${r}`,title:a,className:o,disabled:_,onChange:e=>T(e.target.value),...b}):u.createElement(f.Input,{type:D,value:r,title:a,className:o,disabled:_,placeholder:O,onChange:e=>i(e.target.value),...b})},P=({className:e,handleOnChange:t,options:n,value:r,title:i,disabled:a,multiple:o,listsAsArrays:s,testID:c,rule:l,ruleGroup:p,rules:m,level:h,path:g,context:_,validation:v,operator:y,field:b,fieldData:x,schema:S,...C})=>{let{onChange:w}=(0,d.useValueSelector)({handleOnChange:t,listsAsArrays:!1,multiple:!1,value:r}),{onChange:T,val:E}=(0,d.useValueSelector)({handleOnChange:t,listsAsArrays:o||s,multiple:o,value:r}),D=u.useCallback(e=>{o&&!s&&Array.isArray(e)?w((0,d.joinWith)(e)):T(e)},[s,o,w,T]);return u.createElement(f.Select,{...o?{mode:`multiple`,allowClear:!0}:{},title:i,className:e,popupMatchSelectWidth:!1,disabled:a,value:E,onChange:D,optionFilterProp:`label`,options:n,...C})},F={actionElement:x,dragHandle:S,notToggle:C,shiftActions:w,valueEditor:N,valueSelector:P},I={removeGroup:{label:u.createElement(l.CloseOutlined,null)},removeRule:{label:u.createElement(l.CloseOutlined,null)},cloneRule:{label:u.createElement(l.CopyOutlined,null)},cloneRuleGroup:{label:u.createElement(l.CopyOutlined,null)},lockGroup:{label:u.createElement(l.UnlockOutlined,null)},lockRule:{label:u.createElement(l.UnlockOutlined,null)},lockGroupDisabled:{label:u.createElement(l.LockOutlined,null)},lockRuleDisabled:{label:u.createElement(l.LockOutlined,null)},shiftActionUp:{label:u.createElement(l.UpOutlined,null)},shiftActionDown:{label:u.createElement(l.DownOutlined,null)}},L=(0,d.getCompatContextProvider)({controlElements:F,translations:I});exports.AntDActionElement=x,exports.AntDDragHandle=S,exports.AntDNotToggle=C,exports.AntDShiftActions=w,exports.AntDValueEditor=N,exports.AntDValueSelector=P,exports.QueryBuilderAntD=L,exports.antdControlElements=F,exports.antdTranslations=I;
|
|
2
2
|
//# sourceMappingURL=react-querybuilder_antd.cjs.production.js.map
|