@react-querybuilder/core 8.10.0 → 8.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{arrayUtils-C9sO4qLO.mjs → arrayUtils-A_OXU9W1.mjs} +3 -3
- package/dist/{arrayUtils-C9sO4qLO.mjs.map → arrayUtils-A_OXU9W1.mjs.map} +1 -1
- package/dist/{basic-CDDA-KZa.d.ts → basic-DEc65Kng.d.mts} +21 -21
- package/dist/{basic-BmpEwexQ.d.mts → basic-Dd_M2f3M.d.ts} +21 -21
- package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +412 -278
- package/dist/cjs/react-querybuilder_core.cjs.development.js +53 -1
- package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +412 -278
- package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
- package/dist/{convertQuery-BUgyz1GA.mjs → convertQuery-CqX3rPvj.mjs} +3 -3
- package/dist/{convertQuery-BUgyz1GA.mjs.map → convertQuery-CqX3rPvj.mjs.map} +1 -1
- package/dist/{export-Ccjfea21.d.mts → export-Dy4FckB-.d.ts} +6 -6
- package/dist/{export-GUuxJ7zR.d.ts → export-t1V2N8pz.d.mts} +6 -6
- package/dist/formatQuery.d.mts +2 -2
- package/dist/formatQuery.d.ts +2 -2
- package/dist/formatQuery.mjs +6 -6
- package/dist/{import-Dxevzw_-.d.mts → import-Cz8canKo.d.mts} +3 -3
- package/dist/{import-D-hm1phN.d.ts → import-DtS9Ocx5.d.ts} +3 -3
- package/dist/{isRuleGroup-CGe_rb2w.mjs → isRuleGroup-CYcfPgbg.mjs} +2 -2
- package/dist/{isRuleGroup-CGe_rb2w.mjs.map → isRuleGroup-CYcfPgbg.mjs.map} +1 -1
- package/dist/lexer-C53tqS2p.js +406 -0
- package/dist/lexer-C53tqS2p.js.map +1 -0
- package/dist/optGroupUtils-B0hTpodo.js.map +1 -1
- package/dist/{optGroupUtils-DrubUpx0.mjs → optGroupUtils-VeZ3k7-1.mjs} +3 -3
- package/dist/optGroupUtils-VeZ3k7-1.mjs.map +1 -0
- package/dist/parseCEL.d.mts +2 -2
- package/dist/parseCEL.d.ts +2 -2
- package/dist/parseCEL.js +760 -1095
- package/dist/parseCEL.js.map +1 -1
- package/dist/parseCEL.mjs +763 -1099
- package/dist/parseCEL.mjs.map +1 -1
- package/dist/parseJSONata.d.mts +2 -2
- package/dist/parseJSONata.d.ts +2 -2
- package/dist/parseJSONata.mjs +3 -3
- package/dist/parseJsonLogic.d.mts +3 -3
- package/dist/parseJsonLogic.d.ts +3 -3
- package/dist/parseJsonLogic.mjs +5 -5
- package/dist/parseMongoDB.d.mts +2 -2
- package/dist/parseMongoDB.d.ts +2 -2
- package/dist/parseMongoDB.mjs +5 -5
- package/dist/{parseNumber-B_-sR6d5.mjs → parseNumber-CXdMVNFx.mjs} +2 -2
- package/dist/{parseNumber-B_-sR6d5.mjs.map → parseNumber-CXdMVNFx.mjs.map} +1 -1
- package/dist/parseSQL.d.mts +2 -2
- package/dist/parseSQL.d.ts +2 -2
- package/dist/parseSQL.js +2680 -3021
- package/dist/parseSQL.js.map +1 -1
- package/dist/parseSQL.mjs +2684 -3026
- package/dist/parseSQL.mjs.map +1 -1
- package/dist/parseSpEL.d.mts +2 -2
- package/dist/parseSpEL.d.ts +2 -2
- package/dist/parseSpEL.mjs +4 -4
- package/dist/{prepareQueryObjects-CJNpnGcJ.mjs → prepareQueryObjects-DPCC-iHp.mjs} +4 -4
- package/dist/{prepareQueryObjects-CJNpnGcJ.mjs.map → prepareQueryObjects-DPCC-iHp.mjs.map} +1 -1
- package/dist/query-builder.css +1 -1
- package/dist/query-builder.css.map +1 -1
- package/dist/react-querybuilder_core.d.mts +412 -278
- package/dist/react-querybuilder_core.legacy-esm.d.ts +412 -278
- package/dist/react-querybuilder_core.legacy-esm.js +57 -9
- package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_core.mjs +50 -2
- package/dist/react-querybuilder_core.mjs.map +1 -1
- package/dist/react-querybuilder_core.production.d.mts +412 -278
- package/dist/react-querybuilder_core.production.mjs +1 -1
- package/dist/react-querybuilder_core.production.mjs.map +1 -1
- package/dist/styles/_main.scss +5 -0
- package/dist/{transformQuery-DHvtgDgZ.mjs → transformQuery-DCCpjtyq.mjs} +3 -3
- package/dist/{transformQuery-DHvtgDgZ.mjs.map → transformQuery-DCCpjtyq.mjs.map} +1 -1
- package/dist/transformQuery.d.mts +1 -1
- package/dist/transformQuery.d.ts +1 -1
- package/dist/transformQuery.mjs +2 -2
- package/package.json +9 -9
- package/dist/optGroupUtils-DrubUpx0.mjs.map +0 -1
|
@@ -9,26 +9,6 @@ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/
|
|
|
9
9
|
@category Type
|
|
10
10
|
*/
|
|
11
11
|
type Primitive = null | undefined | string | number | boolean | symbol | bigint;
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region ../../node_modules/type-fest/source/observable-like.d.ts
|
|
14
|
-
declare global {
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
|
|
16
|
-
interface SymbolConstructor {
|
|
17
|
-
readonly observable: symbol;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
@remarks
|
|
23
|
-
The TC39 observable proposal defines a `closed` property, but some implementations (such as xstream) do not as of 10/08/2021.
|
|
24
|
-
As well, some guidance on making an `Observable` to not include `closed` property.
|
|
25
|
-
@see https://github.com/tc39/proposal-observable/blob/master/src/Observable.js#L129-L130
|
|
26
|
-
@see https://github.com/staltz/xstream/blob/6c22580c1d84d69773ee4b0905df44ad464955b3/src/index.ts#L79-L85
|
|
27
|
-
@see https://github.com/benlesh/symbol-observable#making-an-object-observable
|
|
28
|
-
|
|
29
|
-
@category Observable
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
12
|
//#endregion
|
|
33
13
|
//#region ../../node_modules/type-fest/source/union-to-intersection.d.ts
|
|
34
14
|
/**
|
|
@@ -89,7 +69,7 @@ Union extends unknown
|
|
|
89
69
|
// Infer the `Intersection` type since TypeScript represents the positional
|
|
90
70
|
// arguments of unions of functions as an intersection of the union.
|
|
91
71
|
) extends ((mergedIntersection: infer Intersection) => void)
|
|
92
|
-
// The `& Union` is to
|
|
72
|
+
// The `& Union` is to ensure result of `UnionToIntersection<A | B>` is always assignable to `A | B`
|
|
93
73
|
? Intersection & Union : never;
|
|
94
74
|
//#endregion
|
|
95
75
|
//#region ../../node_modules/type-fest/source/keys-of-union.d.ts
|
|
@@ -134,6 +114,80 @@ type KeysOfUnion<ObjectType> =
|
|
|
134
114
|
// Hack to fix https://github.com/sindresorhus/type-fest/issues/1008
|
|
135
115
|
keyof UnionToIntersection<ObjectType extends unknown ? Record<keyof ObjectType, never> : never>;
|
|
136
116
|
//#endregion
|
|
117
|
+
//#region ../../node_modules/type-fest/source/is-any.d.ts
|
|
118
|
+
/**
|
|
119
|
+
Returns a boolean for whether the given type is `any`.
|
|
120
|
+
|
|
121
|
+
@link https://stackoverflow.com/a/49928360/1490091
|
|
122
|
+
|
|
123
|
+
Useful in type utilities, such as disallowing `any`s to be passed to a function.
|
|
124
|
+
|
|
125
|
+
@example
|
|
126
|
+
```
|
|
127
|
+
import type {IsAny} from 'type-fest';
|
|
128
|
+
|
|
129
|
+
const typedObject = {a: 1, b: 2} as const;
|
|
130
|
+
const anyObject: any = {a: 1, b: 2};
|
|
131
|
+
|
|
132
|
+
function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
|
|
133
|
+
return obj[key];
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
const typedA = get(typedObject, 'a');
|
|
137
|
+
//=> 1
|
|
138
|
+
|
|
139
|
+
const anyA = get(anyObject, 'a');
|
|
140
|
+
//=> any
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
@category Type Guard
|
|
144
|
+
@category Utilities
|
|
145
|
+
*/
|
|
146
|
+
type IsAny<T$1> = 0 extends 1 & NoInfer<T$1> ? true : false;
|
|
147
|
+
//#endregion
|
|
148
|
+
//#region ../../node_modules/type-fest/source/is-optional-key-of.d.ts
|
|
149
|
+
/**
|
|
150
|
+
Returns a boolean for whether the given key is an optional key of type.
|
|
151
|
+
|
|
152
|
+
This is useful when writing utility types or schema validators that need to differentiate `optional` keys.
|
|
153
|
+
|
|
154
|
+
@example
|
|
155
|
+
```
|
|
156
|
+
import type {IsOptionalKeyOf} from 'type-fest';
|
|
157
|
+
|
|
158
|
+
interface User {
|
|
159
|
+
name: string;
|
|
160
|
+
surname: string;
|
|
161
|
+
|
|
162
|
+
luckyNumber?: number;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
interface Admin {
|
|
166
|
+
name: string;
|
|
167
|
+
surname?: string;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
type T1 = IsOptionalKeyOf<User, 'luckyNumber'>;
|
|
171
|
+
//=> true
|
|
172
|
+
|
|
173
|
+
type T2 = IsOptionalKeyOf<User, 'name'>;
|
|
174
|
+
//=> false
|
|
175
|
+
|
|
176
|
+
type T3 = IsOptionalKeyOf<User, 'name' | 'luckyNumber'>;
|
|
177
|
+
//=> boolean
|
|
178
|
+
|
|
179
|
+
type T4 = IsOptionalKeyOf<User | Admin, 'name'>;
|
|
180
|
+
//=> false
|
|
181
|
+
|
|
182
|
+
type T5 = IsOptionalKeyOf<User | Admin, 'surname'>;
|
|
183
|
+
//=> boolean
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
@category Type Guard
|
|
187
|
+
@category Utilities
|
|
188
|
+
*/
|
|
189
|
+
type IsOptionalKeyOf<Type$1 extends object, Key$1 extends keyof Type$1> = IsAny<Type$1 | Key$1> extends true ? never : Key$1 extends keyof Type$1 ? Type$1 extends Record<Key$1, Type$1[Key$1]> ? false : true : false;
|
|
190
|
+
//#endregion
|
|
137
191
|
//#region ../../node_modules/type-fest/source/optional-keys-of.d.ts
|
|
138
192
|
/**
|
|
139
193
|
Extract all optional keys from the given type.
|
|
@@ -168,8 +222,8 @@ const update2: UpdateOperation<User> = {
|
|
|
168
222
|
|
|
169
223
|
@category Utilities
|
|
170
224
|
*/
|
|
171
|
-
type OptionalKeysOf<
|
|
172
|
-
? (keyof { [Key in keyof
|
|
225
|
+
type OptionalKeysOf<Type$1 extends object> = Type$1 extends unknown // For distributing `Type`
|
|
226
|
+
? (keyof { [Key in keyof Type$1 as IsOptionalKeyOf<Type$1, Key> extends false ? never : Key]: never }) & keyof Type$1 // Intersect with `keyof Type` to ensure result of `OptionalKeysOf<Type>` is always assignable to `keyof Type`
|
|
173
227
|
: never;
|
|
174
228
|
//#endregion
|
|
175
229
|
//#region ../../node_modules/type-fest/source/required-keys-of.d.ts
|
|
@@ -197,8 +251,8 @@ const validator2 = createValidation<User>('surname', value => value.length < 25)
|
|
|
197
251
|
|
|
198
252
|
@category Utilities
|
|
199
253
|
*/
|
|
200
|
-
type RequiredKeysOf<
|
|
201
|
-
? Exclude<keyof
|
|
254
|
+
type RequiredKeysOf<Type$1 extends object> = Type$1 extends unknown // For distributing `Type`
|
|
255
|
+
? Exclude<keyof Type$1, OptionalKeysOf<Type$1>> : never;
|
|
202
256
|
//#endregion
|
|
203
257
|
//#region ../../node_modules/type-fest/source/is-never.d.ts
|
|
204
258
|
/**
|
|
@@ -242,29 +296,67 @@ endIfEqual('abc', '123');
|
|
|
242
296
|
@category Type Guard
|
|
243
297
|
@category Utilities
|
|
244
298
|
*/
|
|
245
|
-
type IsNever<T> = [T] extends [never] ? true : false;
|
|
299
|
+
type IsNever<T$1> = [T$1] extends [never] ? true : false;
|
|
246
300
|
//#endregion
|
|
247
|
-
//#region ../../node_modules/type-fest/source/if
|
|
301
|
+
//#region ../../node_modules/type-fest/source/if.d.ts
|
|
248
302
|
/**
|
|
249
|
-
An if-else-like type that resolves depending on whether the given type is `
|
|
303
|
+
An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`.
|
|
304
|
+
|
|
305
|
+
Use-cases:
|
|
306
|
+
- You can use this in combination with `Is*` types to create an if-else-like experience. For example, `If<IsAny<any>, 'is any', 'not any'>`.
|
|
250
307
|
|
|
251
|
-
|
|
308
|
+
Note:
|
|
309
|
+
- Returns a union of if branch and else branch if the given type is `boolean` or `any`. For example, `If<boolean, 'Y', 'N'>` will return `'Y' | 'N'`.
|
|
310
|
+
- Returns the else branch if the given type is `never`. For example, `If<never, 'Y', 'N'>` will return `'N'`.
|
|
252
311
|
|
|
253
312
|
@example
|
|
254
313
|
```
|
|
255
|
-
import
|
|
314
|
+
import {If} from 'type-fest';
|
|
256
315
|
|
|
257
|
-
type
|
|
258
|
-
//=>
|
|
316
|
+
type A = If<true, 'yes', 'no'>;
|
|
317
|
+
//=> 'yes'
|
|
259
318
|
|
|
260
|
-
type
|
|
261
|
-
//=> '
|
|
319
|
+
type B = If<false, 'yes', 'no'>;
|
|
320
|
+
//=> 'no'
|
|
321
|
+
|
|
322
|
+
type C = If<boolean, 'yes', 'no'>;
|
|
323
|
+
//=> 'yes' | 'no'
|
|
324
|
+
|
|
325
|
+
type D = If<any, 'yes', 'no'>;
|
|
326
|
+
//=> 'yes' | 'no'
|
|
327
|
+
|
|
328
|
+
type E = If<never, 'yes', 'no'>;
|
|
329
|
+
//=> 'no'
|
|
330
|
+
```
|
|
331
|
+
|
|
332
|
+
@example
|
|
333
|
+
```
|
|
334
|
+
import {If, IsAny, IsNever} from 'type-fest';
|
|
335
|
+
|
|
336
|
+
type A = If<IsAny<unknown>, 'is any', 'not any'>;
|
|
337
|
+
//=> 'not any'
|
|
338
|
+
|
|
339
|
+
type B = If<IsNever<never>, 'is never', 'not never'>;
|
|
340
|
+
//=> 'is never'
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
@example
|
|
344
|
+
```
|
|
345
|
+
import {If, IsEqual} from 'type-fest';
|
|
346
|
+
|
|
347
|
+
type IfEqual<T, U, IfBranch, ElseBranch> = If<IsEqual<T, U>, IfBranch, ElseBranch>;
|
|
348
|
+
|
|
349
|
+
type A = IfEqual<string, string, 'equal', 'not equal'>;
|
|
350
|
+
//=> 'equal'
|
|
351
|
+
|
|
352
|
+
type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
353
|
+
//=> 'not equal'
|
|
262
354
|
```
|
|
263
355
|
|
|
264
356
|
@category Type Guard
|
|
265
357
|
@category Utilities
|
|
266
358
|
*/
|
|
267
|
-
type
|
|
359
|
+
type If<Type$1 extends boolean, IfBranch, ElseBranch> = IsNever<Type$1> extends true ? ElseBranch : Type$1 extends true ? IfBranch : ElseBranch;
|
|
268
360
|
//#endregion
|
|
269
361
|
//#region ../../node_modules/type-fest/source/unknown-array.d.ts
|
|
270
362
|
/**
|
|
@@ -293,104 +385,48 @@ type C = IsArray<string>;
|
|
|
293
385
|
*/
|
|
294
386
|
type UnknownArray = readonly unknown[];
|
|
295
387
|
//#endregion
|
|
296
|
-
//#region ../../node_modules/type-fest/source/internal/
|
|
297
|
-
|
|
388
|
+
//#region ../../node_modules/type-fest/source/internal/type.d.ts
|
|
298
389
|
/**
|
|
299
|
-
|
|
390
|
+
Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
300
391
|
*/
|
|
301
|
-
type
|
|
392
|
+
type BuiltIns = Primitive | void | Date | RegExp;
|
|
302
393
|
/**
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
@see {@link IsArrayReadonly}
|
|
306
|
-
|
|
307
|
-
@example
|
|
308
|
-
```
|
|
309
|
-
import type {ArrayTail} from 'type-fest';
|
|
310
|
-
|
|
311
|
-
type ReadonlyPreservingArrayTail<TArray extends readonly unknown[]> =
|
|
312
|
-
ArrayTail<TArray> extends infer Tail
|
|
313
|
-
? IfArrayReadonly<TArray, Readonly<Tail>, Tail>
|
|
314
|
-
: never;
|
|
315
|
-
|
|
316
|
-
type ReadonlyTail = ReadonlyPreservingArrayTail<readonly [string, number, boolean]>;
|
|
317
|
-
//=> readonly [number, boolean]
|
|
318
|
-
|
|
319
|
-
type NonReadonlyTail = ReadonlyPreservingArrayTail<[string, number, boolean]>;
|
|
320
|
-
//=> [number, boolean]
|
|
394
|
+
Test if the given function has multiple call signatures.
|
|
321
395
|
|
|
322
|
-
|
|
323
|
-
//=> true
|
|
396
|
+
Needed to handle the case of a single call signature with properties.
|
|
324
397
|
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
```
|
|
398
|
+
Multiple call signatures cannot currently be supported due to a TypeScript limitation.
|
|
399
|
+
@see https://github.com/microsoft/TypeScript/issues/29732
|
|
328
400
|
*/
|
|
329
|
-
type
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
// TS5.4+ only. Tracked in https://github.com/sindresorhus/type-fest/issues/848
|
|
334
|
-
type NoInfer<T> = T extends infer U ? U : never;
|
|
335
|
-
|
|
401
|
+
type HasMultipleCallSignatures<T$1 extends (...arguments_: any[]) => unknown> = T$1 extends {
|
|
402
|
+
(...arguments_: infer A): unknown;
|
|
403
|
+
(...arguments_: infer B): unknown;
|
|
404
|
+
} ? B extends A ? A extends B ? false : true : true : false;
|
|
336
405
|
/**
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
@link https://stackoverflow.com/a/49928360/1490091
|
|
340
|
-
|
|
341
|
-
Useful in type utilities, such as disallowing `any`s to be passed to a function.
|
|
406
|
+
An if-else-like type that resolves depending on whether the given type is `any` or `never`.
|
|
342
407
|
|
|
343
408
|
@example
|
|
344
409
|
```
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
const anyObject: any = {a: 1, b: 2};
|
|
349
|
-
|
|
350
|
-
function get<O extends (IsAny<O> extends true ? {} : Record<string, number>), K extends keyof O = keyof O>(obj: O, key: K) {
|
|
351
|
-
return obj[key];
|
|
352
|
-
}
|
|
410
|
+
// When `T` is a NOT `any` or `never` (like `string`) => Returns `IfNotAnyOrNever` branch
|
|
411
|
+
type A = IfNotAnyOrNever<string, 'VALID', 'IS_ANY', 'IS_NEVER'>;
|
|
412
|
+
//=> 'VALID'
|
|
353
413
|
|
|
354
|
-
|
|
355
|
-
|
|
414
|
+
// When `T` is `any` => Returns `IfAny` branch
|
|
415
|
+
type B = IfNotAnyOrNever<any, 'VALID', 'IS_ANY', 'IS_NEVER'>;
|
|
416
|
+
//=> 'IS_ANY'
|
|
356
417
|
|
|
357
|
-
|
|
358
|
-
|
|
418
|
+
// When `T` is `never` => Returns `IfNever` branch
|
|
419
|
+
type C = IfNotAnyOrNever<never, 'VALID', 'IS_ANY', 'IS_NEVER'>;
|
|
420
|
+
//=> 'IS_NEVER'
|
|
359
421
|
```
|
|
360
|
-
|
|
361
|
-
@category Type Guard
|
|
362
|
-
@category Utilities
|
|
363
422
|
*/
|
|
364
|
-
type
|
|
423
|
+
type IfNotAnyOrNever<T$1, IfNotAnyOrNever$1, IfAny = any, IfNever = never> = If<IsAny<T$1>, IfAny, If<IsNever<T$1>, IfNever, IfNotAnyOrNever$1>>;
|
|
365
424
|
//#endregion
|
|
366
|
-
//#region ../../node_modules/type-fest/source/
|
|
425
|
+
//#region ../../node_modules/type-fest/source/internal/array.d.ts
|
|
367
426
|
/**
|
|
368
|
-
Returns
|
|
369
|
-
|
|
370
|
-
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
371
|
-
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
372
|
-
|
|
373
|
-
Use-cases:
|
|
374
|
-
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
375
|
-
|
|
376
|
-
@example
|
|
377
|
-
```
|
|
378
|
-
import type {IsEqual} from 'type-fest';
|
|
379
|
-
|
|
380
|
-
// This type returns a boolean for whether the given array includes the given item.
|
|
381
|
-
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
382
|
-
type Includes<Value extends readonly any[], Item> =
|
|
383
|
-
Value extends readonly [Value[0], ...infer rest]
|
|
384
|
-
? IsEqual<Value[0], Item> extends true
|
|
385
|
-
? true
|
|
386
|
-
: Includes<rest, Item>
|
|
387
|
-
: false;
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
@category Type Guard
|
|
391
|
-
@category Utilities
|
|
427
|
+
Returns whether the given array `T` is readonly.
|
|
392
428
|
*/
|
|
393
|
-
type
|
|
429
|
+
type IsArrayReadonly<T$1 extends UnknownArray> = If<IsNever<T$1>, false, T$1 extends unknown[] ? false : true>;
|
|
394
430
|
//#endregion
|
|
395
431
|
//#region ../../node_modules/type-fest/source/simplify.d.ts
|
|
396
432
|
/**
|
|
@@ -450,7 +486,38 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
450
486
|
@see SimplifyDeep
|
|
451
487
|
@category Object
|
|
452
488
|
*/
|
|
453
|
-
type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {};
|
|
489
|
+
type Simplify<T$1> = { [KeyType in keyof T$1]: T$1[KeyType] } & {};
|
|
490
|
+
//#endregion
|
|
491
|
+
//#region ../../node_modules/type-fest/source/is-equal.d.ts
|
|
492
|
+
/**
|
|
493
|
+
Returns a boolean for whether the two given types are equal.
|
|
494
|
+
|
|
495
|
+
@link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
|
|
496
|
+
@link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
|
|
497
|
+
|
|
498
|
+
Use-cases:
|
|
499
|
+
- If you want to make a conditional branch based on the result of a comparison of two types.
|
|
500
|
+
|
|
501
|
+
@example
|
|
502
|
+
```
|
|
503
|
+
import type {IsEqual} from 'type-fest';
|
|
504
|
+
|
|
505
|
+
// This type returns a boolean for whether the given array includes the given item.
|
|
506
|
+
// `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
|
|
507
|
+
type Includes<Value extends readonly any[], Item> =
|
|
508
|
+
Value extends readonly [Value[0], ...infer rest]
|
|
509
|
+
? IsEqual<Value[0], Item> extends true
|
|
510
|
+
? true
|
|
511
|
+
: Includes<rest, Item>
|
|
512
|
+
: false;
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
@category Type Guard
|
|
516
|
+
@category Utilities
|
|
517
|
+
*/
|
|
518
|
+
type IsEqual<A$1, B$1> = [A$1, B$1] extends [infer AA, infer BB] ? [AA] extends [never] ? [BB] extends [never] ? true : false : [BB] extends [never] ? false : _IsEqual<AA, BB> : false;
|
|
519
|
+
// This version fails the `equalWrappedTupleIntersectionToBeNeverAndNeverExpanded` test in `test-d/is-equal.ts`.
|
|
520
|
+
type _IsEqual<A$1, B$1> = (<G>() => G extends A$1 & G | G ? 1 : 2) extends (<G>() => G extends B$1 & G | G ? 1 : 2) ? true : false;
|
|
454
521
|
//#endregion
|
|
455
522
|
//#region ../../node_modules/type-fest/source/omit-index-signature.d.ts
|
|
456
523
|
/**
|
|
@@ -633,67 +700,6 @@ export type FooBar = Merge<Foo, Bar>;
|
|
|
633
700
|
*/
|
|
634
701
|
type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>;
|
|
635
702
|
//#endregion
|
|
636
|
-
//#region ../../node_modules/type-fest/source/if-any.d.ts
|
|
637
|
-
/**
|
|
638
|
-
An if-else-like type that resolves depending on whether the given type is `any`.
|
|
639
|
-
|
|
640
|
-
@see {@link IsAny}
|
|
641
|
-
|
|
642
|
-
@example
|
|
643
|
-
```
|
|
644
|
-
import type {IfAny} from 'type-fest';
|
|
645
|
-
|
|
646
|
-
type ShouldBeTrue = IfAny<any>;
|
|
647
|
-
//=> true
|
|
648
|
-
|
|
649
|
-
type ShouldBeBar = IfAny<'not any', 'foo', 'bar'>;
|
|
650
|
-
//=> 'bar'
|
|
651
|
-
```
|
|
652
|
-
|
|
653
|
-
@category Type Guard
|
|
654
|
-
@category Utilities
|
|
655
|
-
*/
|
|
656
|
-
type IfAny$1<T, TypeIfAny = true, TypeIfNotAny = false> = (IsAny<T> extends true ? TypeIfAny : TypeIfNotAny);
|
|
657
|
-
//#endregion
|
|
658
|
-
//#region ../../node_modules/type-fest/source/internal/type.d.ts
|
|
659
|
-
/**
|
|
660
|
-
Matches any primitive, `void`, `Date`, or `RegExp` value.
|
|
661
|
-
*/
|
|
662
|
-
type BuiltIns = Primitive | void | Date | RegExp;
|
|
663
|
-
/**
|
|
664
|
-
Test if the given function has multiple call signatures.
|
|
665
|
-
|
|
666
|
-
Needed to handle the case of a single call signature with properties.
|
|
667
|
-
|
|
668
|
-
Multiple call signatures cannot currently be supported due to a TypeScript limitation.
|
|
669
|
-
@see https://github.com/microsoft/TypeScript/issues/29732
|
|
670
|
-
*/
|
|
671
|
-
type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T extends {
|
|
672
|
-
(...arguments_: infer A): unknown;
|
|
673
|
-
(...arguments_: infer B): unknown;
|
|
674
|
-
} ? B extends A ? A extends B ? false : true : true : false;
|
|
675
|
-
// Should never happen
|
|
676
|
-
|
|
677
|
-
/**
|
|
678
|
-
An if-else-like type that resolves depending on whether the given type is `any` or `never`.
|
|
679
|
-
|
|
680
|
-
@example
|
|
681
|
-
```
|
|
682
|
-
// When `T` is a NOT `any` or `never` (like `string`) => Returns `IfNotAnyOrNever` branch
|
|
683
|
-
type A = IfNotAnyOrNever<string, 'VALID', 'IS_ANY', 'IS_NEVER'>;
|
|
684
|
-
//=> 'VALID'
|
|
685
|
-
|
|
686
|
-
// When `T` is `any` => Returns `IfAny` branch
|
|
687
|
-
type B = IfNotAnyOrNever<any, 'VALID', 'IS_ANY', 'IS_NEVER'>;
|
|
688
|
-
//=> 'IS_ANY'
|
|
689
|
-
|
|
690
|
-
// When `T` is `never` => Returns `IfNever` branch
|
|
691
|
-
type C = IfNotAnyOrNever<never, 'VALID', 'IS_ANY', 'IS_NEVER'>;
|
|
692
|
-
//=> 'IS_NEVER'
|
|
693
|
-
```
|
|
694
|
-
*/
|
|
695
|
-
type IfNotAnyOrNever<T, IfNotAnyOrNever, IfAny = any, IfNever = never> = IsAny<T> extends true ? IfAny : IsNever<T> extends true ? IfNever : IfNotAnyOrNever;
|
|
696
|
-
//#endregion
|
|
697
703
|
//#region ../../node_modules/type-fest/source/internal/object.d.ts
|
|
698
704
|
/**
|
|
699
705
|
Works similar to the built-in `Pick` utility type, except for the following differences:
|
|
@@ -732,7 +738,7 @@ type Any = HomomorphicPick<{a: 1; b: 2} | {c: 3}, any>;
|
|
|
732
738
|
type IndexSignature = HomomorphicPick<{[k: string]: unknown}, number>;
|
|
733
739
|
//=> {}
|
|
734
740
|
*/
|
|
735
|
-
type HomomorphicPick<T, Keys extends KeysOfUnion<T>> = { [P in keyof T as Extract<P, Keys>]: T[P] };
|
|
741
|
+
type HomomorphicPick<T$1, Keys extends KeysOfUnion<T$1>> = { [P in keyof T$1 as Extract<P, Keys>]: T$1[P] };
|
|
736
742
|
/**
|
|
737
743
|
Merges user specified options with default options.
|
|
738
744
|
|
|
@@ -785,8 +791,7 @@ type Result = ApplyDefaultOptions<PathsOptions, DefaultPathsOptions, SpecifiedOp
|
|
|
785
791
|
// Types of property 'leavesOnly' are incompatible. Type 'string' is not assignable to type 'boolean'.
|
|
786
792
|
```
|
|
787
793
|
*/
|
|
788
|
-
type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> =
|
|
789
|
-
>>;
|
|
794
|
+
type ApplyDefaultOptions<Options extends object, Defaults extends Simplify<Omit<Required<Options>, RequiredKeysOf<Options>> & Partial<Record<RequiredKeysOf<Options>, never>>>, SpecifiedOptions extends Options> = If<IsAny<SpecifiedOptions>, Defaults, If<IsNever<SpecifiedOptions>, Defaults, Simplify<Merge<Defaults, { [Key in keyof SpecifiedOptions as Key extends OptionalKeysOf<Options> ? undefined extends SpecifiedOptions[Key] ? never : Key : Key]: SpecifiedOptions[Key] }> & Required<Options>>>>;
|
|
790
795
|
//#endregion
|
|
791
796
|
//#region ../../node_modules/type-fest/source/except.d.ts
|
|
792
797
|
/**
|
|
@@ -816,7 +821,7 @@ type Filtered = Filter<'bar', 'foo'>;
|
|
|
816
821
|
|
|
817
822
|
@see {Except}
|
|
818
823
|
*/
|
|
819
|
-
type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
|
|
824
|
+
type Filter<KeyType$1, ExcludeType> = IsEqual<KeyType$1, ExcludeType> extends true ? never : (KeyType$1 extends ExcludeType ? never : KeyType$1);
|
|
820
825
|
type ExceptOptions = {
|
|
821
826
|
/**
|
|
822
827
|
Disallow assigning non-specified properties.
|
|
@@ -907,7 +912,7 @@ const responder: RequireAtLeastOne<Responder, 'text' | 'json'> = {
|
|
|
907
912
|
|
|
908
913
|
@category Object
|
|
909
914
|
*/
|
|
910
|
-
type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType,
|
|
915
|
+
type RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType = keyof ObjectType> = IfNotAnyOrNever<ObjectType, If<IsNever<KeysType>, never, _RequireAtLeastOne<ObjectType, If<IsAny<KeysType>, keyof ObjectType, KeysType>>>>;
|
|
911
916
|
type _RequireAtLeastOne<ObjectType, KeysType extends keyof ObjectType> = {
|
|
912
917
|
// For each `Key` in `KeysType` make a mapped type:
|
|
913
918
|
[Key in KeysType]-?: Required<Pick<ObjectType, Key>> &
|
|
@@ -918,8 +923,6 @@ Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] &
|
|
|
918
923
|
Except<ObjectType, KeysType>;
|
|
919
924
|
//#endregion
|
|
920
925
|
//#region ../../node_modules/type-fest/source/required-deep.d.ts
|
|
921
|
-
type ExcludeUndefined<T> = Exclude<T, undefined>;
|
|
922
|
-
|
|
923
926
|
/**
|
|
924
927
|
Create a type from another type with all keys and nested keys set to required.
|
|
925
928
|
|
|
@@ -933,23 +936,23 @@ import type {RequiredDeep} from 'type-fest';
|
|
|
933
936
|
|
|
934
937
|
type Settings = {
|
|
935
938
|
textEditor?: {
|
|
936
|
-
fontSize?: number
|
|
937
|
-
fontColor?: string
|
|
939
|
+
fontSize?: number;
|
|
940
|
+
fontColor?: string;
|
|
938
941
|
fontWeight?: number | undefined;
|
|
939
|
-
}
|
|
940
|
-
autocomplete?: boolean
|
|
942
|
+
};
|
|
943
|
+
autocomplete?: boolean;
|
|
941
944
|
autosave?: boolean | undefined;
|
|
942
945
|
};
|
|
943
946
|
|
|
944
947
|
type RequiredSettings = RequiredDeep<Settings>;
|
|
945
|
-
|
|
948
|
+
//=> {
|
|
946
949
|
// textEditor: {
|
|
947
950
|
// fontSize: number;
|
|
948
951
|
// fontColor: string;
|
|
949
|
-
// fontWeight: number;
|
|
950
|
-
// }
|
|
952
|
+
// fontWeight: number | undefined;
|
|
953
|
+
// };
|
|
951
954
|
// autocomplete: boolean;
|
|
952
|
-
// autosave: boolean;
|
|
955
|
+
// autosave: boolean | undefined;
|
|
953
956
|
// }
|
|
954
957
|
```
|
|
955
958
|
|
|
@@ -961,11 +964,7 @@ Note that types containing overloaded functions are not made deeply required due
|
|
|
961
964
|
@category Set
|
|
962
965
|
@category Map
|
|
963
966
|
*/
|
|
964
|
-
type RequiredDeep<T
|
|
965
|
-
? ItemType[] extends E // Test for arrays (non-tuples) specifically
|
|
966
|
-
? Array<RequiredDeep<ItemType>> // Recreate relevant array type to prevent eager evaluation of circular reference
|
|
967
|
-
: RequiredObjectDeep<E> // Tuples behave properly
|
|
968
|
-
: RequiredObjectDeep<E> : unknown;
|
|
967
|
+
type RequiredDeep<T$1> = T$1 extends BuiltIns ? T$1 : T$1 extends Map<infer KeyType, infer ValueType> ? Map<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T$1 extends Set<infer ItemType> ? Set<RequiredDeep<ItemType>> : T$1 extends ReadonlyMap<infer KeyType, infer ValueType> ? ReadonlyMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T$1 extends ReadonlySet<infer ItemType> ? ReadonlySet<RequiredDeep<ItemType>> : T$1 extends WeakMap<infer KeyType, infer ValueType> ? WeakMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T$1 extends WeakSet<infer ItemType> ? WeakSet<RequiredDeep<ItemType>> : T$1 extends Promise<infer ValueType> ? Promise<RequiredDeep<ValueType>> : T$1 extends ((...arguments_: any[]) => unknown) ? IsNever<keyof T$1> extends true ? T$1 : HasMultipleCallSignatures<T$1> extends true ? T$1 : ((...arguments_: Parameters<T$1>) => ReturnType<T$1>) & RequiredObjectDeep<T$1> : T$1 extends object ? RequiredObjectDeep<T$1> : unknown;
|
|
969
968
|
type RequiredObjectDeep<ObjectType extends object> = { [KeyType in keyof ObjectType]-?: RequiredDeep<ObjectType[KeyType]> };
|
|
970
969
|
//#endregion
|
|
971
970
|
//#region ../../node_modules/type-fest/source/set-optional.d.ts
|
|
@@ -994,7 +993,8 @@ type SomeOptional = SetOptional<Foo, 'b' | 'c'>;
|
|
|
994
993
|
|
|
995
994
|
@category Object
|
|
996
995
|
*/
|
|
997
|
-
type SetOptional<BaseType, Keys extends keyof BaseType> = BaseType extends
|
|
996
|
+
type SetOptional<BaseType, Keys extends keyof BaseType> = (BaseType extends ((...arguments_: never) => any) ? (...arguments_: Parameters<BaseType>) => ReturnType<BaseType> : unknown) & _SetOptional<BaseType, Keys>;
|
|
997
|
+
type _SetOptional<BaseType, Keys extends keyof BaseType> = BaseType extends unknown // To distribute `BaseType` when it's a union type.
|
|
998
998
|
? Simplify<
|
|
999
999
|
// Pick just the keys that are readonly from the base type.
|
|
1000
1000
|
Except<BaseType, Keys> &
|
|
@@ -1031,11 +1031,13 @@ type ArrayExample = SetRequired<[number?, number?, number?], 0 | 1>;
|
|
|
1031
1031
|
|
|
1032
1032
|
@category Object
|
|
1033
1033
|
*/
|
|
1034
|
-
type SetRequired<BaseType, Keys extends keyof BaseType> = BaseType extends
|
|
1034
|
+
type SetRequired<BaseType, Keys extends keyof BaseType> = (BaseType extends ((...arguments_: never) => any) ? (...arguments_: Parameters<BaseType>) => ReturnType<BaseType> : unknown) & _SetRequired<BaseType, Keys>;
|
|
1035
|
+
type _SetRequired<BaseType, Keys extends keyof BaseType> = BaseType extends UnknownArray ? SetArrayRequired<BaseType, Keys> extends infer ResultantArray ? If<IsArrayReadonly<BaseType>, Readonly<ResultantArray>, ResultantArray> : never : Simplify<
|
|
1035
1036
|
// Pick just the keys that are optional from the base type.
|
|
1036
1037
|
Except<BaseType, Keys> &
|
|
1037
1038
|
// Pick the keys that should be required from the base type and make them required.
|
|
1038
1039
|
Required<HomomorphicPick<BaseType, Keys>>>;
|
|
1040
|
+
|
|
1039
1041
|
/**
|
|
1040
1042
|
Remove the optional modifier from the specified keys in an array.
|
|
1041
1043
|
*/
|
|
@@ -1052,6 +1054,7 @@ type SetArrayRequired<TArray extends UnknownArray, Keys, Counter extends any[] =
|
|
|
1052
1054
|
: never; // Should never happen
|
|
1053
1055
|
//#endregion
|
|
1054
1056
|
//#region src/types/options.d.ts
|
|
1057
|
+
type RequireAtLeastOne$1<ObjectType, KeysType extends keyof ObjectType> = { [Key in KeysType]-?: Required<Pick<ObjectType, Key>> & Partial<Pick<ObjectType, Exclude<KeysType, Key>>> }[KeysType] & Except<ObjectType, KeysType>;
|
|
1055
1058
|
type StringUnionToFlexibleOptionArray<Op extends string> = Array<Op extends unknown ? FlexibleOption<Op> : never>;
|
|
1056
1059
|
type StringUnionToFullOptionArray<Op extends string> = Array<Op extends unknown ? FullOption<Op> : never>;
|
|
1057
1060
|
/**
|
|
@@ -1059,18 +1062,18 @@ type StringUnionToFullOptionArray<Op extends string> = Array<Op extends unknown
|
|
|
1059
1062
|
*
|
|
1060
1063
|
* @group Option Lists
|
|
1061
1064
|
*/
|
|
1062
|
-
type GetOptionType<OL extends FlexibleOptionList<FullOption>> = OL extends FlexibleOptionList<infer Opt> ? Opt : never;
|
|
1065
|
+
type GetOptionType<OL$1 extends FlexibleOptionList<FullOption>> = OL$1 extends FlexibleOptionList<infer Opt> ? Opt : never;
|
|
1063
1066
|
/**
|
|
1064
1067
|
* Extracts the type of the identifying property from a {@link Option},
|
|
1065
1068
|
* {@link ValueOption}, or {@link FullOption}.
|
|
1066
1069
|
*
|
|
1067
1070
|
* @group Option Lists
|
|
1068
1071
|
*/
|
|
1069
|
-
type GetOptionIdentifierType<Opt extends BaseOption> = Opt extends Option<infer NameType> | ValueOption<infer NameType> ? NameType : string;
|
|
1072
|
+
type GetOptionIdentifierType<Opt$1 extends BaseOption> = Opt$1 extends Option<infer NameType> | ValueOption<infer NameType> ? NameType : string;
|
|
1070
1073
|
/**
|
|
1071
1074
|
* Adds an `unknown` index property to an interface.
|
|
1072
1075
|
*/
|
|
1073
|
-
type WithUnknownIndex<T> = T & {
|
|
1076
|
+
type WithUnknownIndex<T$1> = T$1 & {
|
|
1074
1077
|
[key: string]: unknown;
|
|
1075
1078
|
};
|
|
1076
1079
|
/**
|
|
@@ -1102,24 +1105,24 @@ type Option<N extends string = string> = Simplify<WithUnknownIndex<SetRequired<B
|
|
|
1102
1105
|
type ValueOption<N extends string = string> = Simplify<WithUnknownIndex<SetRequired<BaseOption<N>, "value">>>;
|
|
1103
1106
|
/**
|
|
1104
1107
|
* A generic {@link Option} with either a `name` or `value` as its primary identifier.
|
|
1105
|
-
* {@link OptionList}-type props on the {@link QueryBuilder} component accept this type,
|
|
1106
|
-
* but corresponding props passed down to subcomponents will always be
|
|
1108
|
+
* {@link OptionList}-type props on the {@link react-querybuilder!QueryBuilder QueryBuilder} component accept this type,
|
|
1109
|
+
* but corresponding props passed down to subcomponents will always be augmented
|
|
1107
1110
|
* to {@link FullOption} first.
|
|
1108
1111
|
*
|
|
1109
1112
|
* @group Option Lists
|
|
1110
1113
|
*/
|
|
1111
|
-
type FlexibleOption<N extends string = string> = Simplify<WithUnknownIndex<RequireAtLeastOne<BaseOption<N>, "name" | "value">>>;
|
|
1114
|
+
type FlexibleOption<N extends string = string> = Simplify<WithUnknownIndex<RequireAtLeastOne$1<BaseOption<N>, "name" | "value">>>;
|
|
1112
1115
|
/**
|
|
1113
1116
|
* Utility type to turn an {@link Option}, {@link ValueOption}, or {@link BaseOption}
|
|
1114
1117
|
* into a {@link FlexibleOption}.
|
|
1115
1118
|
*
|
|
1116
1119
|
* @group Option Lists
|
|
1117
1120
|
*/
|
|
1118
|
-
type ToFlexibleOption<Opt extends BaseOption | string> = WithUnknownIndex<RequireAtLeastOne<Opt extends string ? FlexibleOption<Opt> : Opt, "name" | "value">>;
|
|
1121
|
+
type ToFlexibleOption<Opt$1 extends BaseOption | string> = WithUnknownIndex<RequireAtLeastOne$1<Opt$1 extends string ? FlexibleOption<Opt$1> : Opt$1, "name" | "value">>;
|
|
1119
1122
|
/**
|
|
1120
1123
|
* A generic {@link Option} requiring both `name` _and_ `value` properties.
|
|
1121
1124
|
* Props that extend {@link OptionList} accept {@link BaseOption}, but
|
|
1122
|
-
* corresponding props sent to subcomponents will always be
|
|
1125
|
+
* corresponding props sent to subcomponents will always be augmented to this
|
|
1123
1126
|
* type first to ensure both `name` and `value` are available.
|
|
1124
1127
|
*
|
|
1125
1128
|
* NOTE: Do not extend from this type directly. Use {@link BaseFullOption}
|
|
@@ -1143,7 +1146,7 @@ type BaseFullOption<N extends string = string> = Simplify<SetRequired<BaseOption
|
|
|
1143
1146
|
*
|
|
1144
1147
|
* @group Option Lists
|
|
1145
1148
|
*/
|
|
1146
|
-
type ToFullOption<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt : Opt extends BaseOption<infer IdentifierType> ? WithUnknownIndex<Opt & FullOption<IdentifierType>> : never;
|
|
1149
|
+
type ToFullOption<Opt$1 extends BaseOption> = Opt$1 extends BaseFullOption ? Opt$1 : Opt$1 extends BaseOption<infer IdentifierType> ? WithUnknownIndex<Opt$1 & FullOption<IdentifierType>> : never;
|
|
1147
1150
|
/**
|
|
1148
1151
|
* @deprecated Renamed to {@link Option}.
|
|
1149
1152
|
*
|
|
@@ -1155,39 +1158,39 @@ type NameLabelPair<N extends string = string> = Option<N>;
|
|
|
1155
1158
|
*
|
|
1156
1159
|
* @group Option Lists
|
|
1157
1160
|
*/
|
|
1158
|
-
interface OptionGroup<Opt extends BaseOption = FlexibleOption> {
|
|
1161
|
+
interface OptionGroup<Opt$1 extends BaseOption = FlexibleOption> {
|
|
1159
1162
|
label: string;
|
|
1160
|
-
options: WithUnknownIndex<Opt>[];
|
|
1163
|
+
options: WithUnknownIndex<Opt$1>[];
|
|
1161
1164
|
}
|
|
1162
1165
|
/**
|
|
1163
1166
|
* A group of {@link BaseOption}s, usually within a {@link FlexibleOptionList}.
|
|
1164
1167
|
*
|
|
1165
1168
|
* @group Option Lists
|
|
1166
1169
|
*/
|
|
1167
|
-
type FlexibleOptionGroup<Opt extends BaseOption | string = BaseOption> = {
|
|
1170
|
+
type FlexibleOptionGroup<Opt$1 extends BaseOption | string = BaseOption> = {
|
|
1168
1171
|
label: string;
|
|
1169
|
-
options: (Opt extends BaseFullOption ? Opt : ToFlexibleOption<Opt>)[];
|
|
1172
|
+
options: (Opt$1 extends BaseFullOption ? Opt$1 : ToFlexibleOption<Opt$1>)[];
|
|
1170
1173
|
};
|
|
1171
1174
|
/**
|
|
1172
1175
|
* Either an array of {@link Option}s or an array of {@link OptionGroup}s.
|
|
1173
1176
|
*
|
|
1174
1177
|
* @group Option Lists
|
|
1175
1178
|
*/
|
|
1176
|
-
type OptionList<Opt extends Option = Option> = Opt[] | OptionGroup<Opt>[];
|
|
1179
|
+
type OptionList<Opt$1 extends Option = Option> = Opt$1[] | OptionGroup<Opt$1>[];
|
|
1177
1180
|
/**
|
|
1178
1181
|
* An array of options or option groups, like {@link OptionList} but the option type
|
|
1179
1182
|
* may use either `name` or `value` as the primary identifier.
|
|
1180
1183
|
*
|
|
1181
1184
|
* @group Option Lists
|
|
1182
1185
|
*/
|
|
1183
|
-
type FlexibleOptionList<Opt extends BaseOption> = ToFlexibleOption<Opt>[] | FlexibleOptionGroup<ToFlexibleOption<Opt>>[];
|
|
1186
|
+
type FlexibleOptionList<Opt$1 extends BaseOption> = ToFlexibleOption<Opt$1>[] | FlexibleOptionGroup<ToFlexibleOption<Opt$1>>[];
|
|
1184
1187
|
/**
|
|
1185
1188
|
* An array of options or option groups, like {@link OptionList} but the option type
|
|
1186
1189
|
* may use either `name` or `value` as the primary identifier.
|
|
1187
1190
|
*
|
|
1188
1191
|
* @group Option Lists
|
|
1189
1192
|
*/
|
|
1190
|
-
type FlexibleOptionListProp<Opt extends BaseOption> = (ToFlexibleOption<Opt> | GetOptionIdentifierType<Opt>)[] | FlexibleOptionGroup<ToFlexibleOption<Opt> | GetOptionIdentifierType<Opt>>[];
|
|
1193
|
+
type FlexibleOptionListProp<Opt$1 extends BaseOption> = (ToFlexibleOption<Opt$1> | GetOptionIdentifierType<Opt$1>)[] | FlexibleOptionGroup<ToFlexibleOption<Opt$1> | GetOptionIdentifierType<Opt$1>>[];
|
|
1191
1194
|
/**
|
|
1192
1195
|
* An array of options or option groups, like {@link OptionList}, but using
|
|
1193
1196
|
* {@link FullOption} instead of {@link Option}. This means that every member is
|
|
@@ -1195,26 +1198,26 @@ type FlexibleOptionListProp<Opt extends BaseOption> = (ToFlexibleOption<Opt> | G
|
|
|
1195
1198
|
*
|
|
1196
1199
|
* @group Option Lists
|
|
1197
1200
|
*/
|
|
1198
|
-
type FullOptionList<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt[] | OptionGroup<Opt>[] : ToFullOption<Opt>[] | OptionGroup<ToFullOption<Opt>>[];
|
|
1201
|
+
type FullOptionList<Opt$1 extends BaseOption> = Opt$1 extends BaseFullOption ? Opt$1[] | OptionGroup<Opt$1>[] : ToFullOption<Opt$1>[] | OptionGroup<ToFullOption<Opt$1>>[];
|
|
1199
1202
|
/**
|
|
1200
1203
|
* Map of option identifiers to their respective {@link Option}.
|
|
1201
1204
|
*
|
|
1202
1205
|
* @group Option Lists
|
|
1203
1206
|
*/
|
|
1204
|
-
type BaseOptionMap<V extends BaseOption = BaseOption, K extends string = GetOptionIdentifierType<V>> = { [k in K]?: ToFlexibleOption<V> };
|
|
1207
|
+
type BaseOptionMap<V$1 extends BaseOption = BaseOption, K$1 extends string = GetOptionIdentifierType<V$1>> = { [k in K$1]?: ToFlexibleOption<V$1> };
|
|
1205
1208
|
/**
|
|
1206
1209
|
* Map of option identifiers to their respective {@link FullOption}.
|
|
1207
1210
|
*
|
|
1208
1211
|
* @group Option Lists
|
|
1209
1212
|
*/
|
|
1210
|
-
type FullOptionMap<V extends BaseFullOption, K extends string = GetOptionIdentifierType<V>> = { [k in K]?: V };
|
|
1213
|
+
type FullOptionMap<V$1 extends BaseFullOption, K$1 extends string = GetOptionIdentifierType<V$1>> = { [k in K$1]?: V$1 };
|
|
1211
1214
|
/**
|
|
1212
1215
|
* Map of option identifiers to their respective {@link FullOption}.
|
|
1213
1216
|
* Must include all possible strings from the identifier type.
|
|
1214
1217
|
*
|
|
1215
1218
|
* @group Option Lists
|
|
1216
1219
|
*/
|
|
1217
|
-
type FullOptionRecord<V extends BaseFullOption, K extends string = GetOptionIdentifierType<V>> = Record<K, V>;
|
|
1220
|
+
type FullOptionRecord<V$1 extends BaseFullOption, K$1 extends string = GetOptionIdentifierType<V$1>> = Record<K$1, V$1>;
|
|
1218
1221
|
//#endregion
|
|
1219
1222
|
//#region src/types/ruleGroups.d.ts
|
|
1220
1223
|
/**
|
|
@@ -1235,10 +1238,10 @@ interface CommonRuleAndGroupProperties {
|
|
|
1235
1238
|
* The main rule type. The `field`, `operator`, and `value` properties
|
|
1236
1239
|
* can be narrowed with generics.
|
|
1237
1240
|
*/
|
|
1238
|
-
interface RuleType<F extends string = string, O extends string = string, V = any, C extends string = string> extends CommonRuleAndGroupProperties {
|
|
1239
|
-
field: F;
|
|
1240
|
-
operator: O;
|
|
1241
|
-
value: V;
|
|
1241
|
+
interface RuleType<F$1 extends string = string, O$1 extends string = string, V$1 = any, C extends string = string> extends CommonRuleAndGroupProperties {
|
|
1242
|
+
field: F$1;
|
|
1243
|
+
operator: O$1;
|
|
1244
|
+
value: V$1;
|
|
1242
1245
|
valueSource?: ValueSource;
|
|
1243
1246
|
match?: MatchConfig;
|
|
1244
1247
|
/**
|
|
@@ -1250,15 +1253,15 @@ interface RuleType<F extends string = string, O extends string = string, V = any
|
|
|
1250
1253
|
* The main rule group type. This type is used for query definitions as well as
|
|
1251
1254
|
* all sub-groups of queries.
|
|
1252
1255
|
*/
|
|
1253
|
-
interface RuleGroupType<R extends RuleType = RuleType, C extends string = string> extends CommonRuleAndGroupProperties {
|
|
1256
|
+
interface RuleGroupType<R$1 extends RuleType = RuleType, C extends string = string> extends CommonRuleAndGroupProperties {
|
|
1254
1257
|
combinator: C;
|
|
1255
|
-
rules: RuleGroupArray<RuleGroupType<R, C>, R>;
|
|
1258
|
+
rules: RuleGroupArray<RuleGroupType<R$1, C>, R$1>;
|
|
1256
1259
|
not?: boolean;
|
|
1257
1260
|
}
|
|
1258
1261
|
/**
|
|
1259
1262
|
* The type of the `rules` array in a {@link RuleGroupType}.
|
|
1260
1263
|
*/
|
|
1261
|
-
type RuleGroupArray<RG extends RuleGroupType = RuleGroupType, R extends RuleType = RuleType> = (R | RG)[];
|
|
1264
|
+
type RuleGroupArray<RG$1 extends RuleGroupType = RuleGroupType, R$1 extends RuleType = RuleType> = (R$1 | RG$1)[];
|
|
1262
1265
|
/**
|
|
1263
1266
|
* All updateable properties of rules and groups (everything except
|
|
1264
1267
|
* `id`, `path`, and `rules`).
|
|
@@ -1267,18 +1270,18 @@ type UpdateableProperties = Exclude<keyof (RuleType & RuleGroupType), "id" | "pa
|
|
|
1267
1270
|
/**
|
|
1268
1271
|
* The type of the `rules` array in a {@link DefaultRuleGroupType}.
|
|
1269
1272
|
*/
|
|
1270
|
-
type DefaultRuleGroupArray<F extends string = string> = RuleGroupArray<DefaultRuleGroupType, DefaultRuleType<F>>;
|
|
1273
|
+
type DefaultRuleGroupArray<F$1 extends string = string> = RuleGroupArray<DefaultRuleGroupType, DefaultRuleType<F$1>>;
|
|
1271
1274
|
/**
|
|
1272
1275
|
* {@link RuleGroupType} with the `combinator` property limited to
|
|
1273
1276
|
* {@link DefaultCombinatorNameExtended} and `rules` limited to {@link DefaultRuleType}.
|
|
1274
1277
|
*/
|
|
1275
|
-
type DefaultRuleGroupType<F extends string = string> = RuleGroupType<DefaultRuleType<F>, DefaultCombinatorNameExtended> & {
|
|
1276
|
-
rules: DefaultRuleGroupArray<F>;
|
|
1278
|
+
type DefaultRuleGroupType<F$1 extends string = string> = RuleGroupType<DefaultRuleType<F$1>, DefaultCombinatorNameExtended> & {
|
|
1279
|
+
rules: DefaultRuleGroupArray<F$1>;
|
|
1277
1280
|
};
|
|
1278
1281
|
/**
|
|
1279
1282
|
* {@link RuleType} with the `operator` property limited to {@link DefaultOperatorName}.
|
|
1280
1283
|
*/
|
|
1281
|
-
type DefaultRuleType<F extends string = string> = RuleType<F, DefaultOperatorName>;
|
|
1284
|
+
type DefaultRuleType<F$1 extends string = string> = RuleType<F$1, DefaultOperatorName>;
|
|
1282
1285
|
/**
|
|
1283
1286
|
* Default allowed values for the `combinator` property.
|
|
1284
1287
|
*
|
|
@@ -1325,9 +1328,9 @@ type MappedTuple<Tuple extends Array<unknown>, Result extends Array<unknown> = [
|
|
|
1325
1328
|
* The main rule group interface when using independent combinators. This type is used
|
|
1326
1329
|
* for query definitions as well as all sub-groups of queries.
|
|
1327
1330
|
*/
|
|
1328
|
-
interface RuleGroupTypeIC<R extends RuleType = RuleType, C extends string = string> extends Except<RuleGroupType<R, C>, "combinator" | "rules"> {
|
|
1331
|
+
interface RuleGroupTypeIC<R$1 extends RuleType = RuleType, C extends string = string> extends Except<RuleGroupType<R$1, C>, "combinator" | "rules"> {
|
|
1329
1332
|
combinator?: undefined;
|
|
1330
|
-
rules: RuleGroupICArray<RuleGroupTypeIC<R, C>, R, C>;
|
|
1333
|
+
rules: RuleGroupICArray<RuleGroupTypeIC<R$1, C>, R$1, C>;
|
|
1331
1334
|
/**
|
|
1332
1335
|
* Only used when adding a rule to a query that uses independent combinators
|
|
1333
1336
|
*/
|
|
@@ -1336,11 +1339,11 @@ interface RuleGroupTypeIC<R extends RuleType = RuleType, C extends string = stri
|
|
|
1336
1339
|
/**
|
|
1337
1340
|
* Shorthand for "either {@link RuleGroupType} or {@link RuleGroupTypeIC}".
|
|
1338
1341
|
*/
|
|
1339
|
-
type RuleGroupTypeAny<R extends RuleType = RuleType, C extends string = string> = RuleGroupType<R, C> | RuleGroupTypeIC<R, C>;
|
|
1342
|
+
type RuleGroupTypeAny<R$1 extends RuleType = RuleType, C extends string = string> = RuleGroupType<R$1, C> | RuleGroupTypeIC<R$1, C>;
|
|
1340
1343
|
/**
|
|
1341
1344
|
* The type of the `rules` array in a {@link RuleGroupTypeIC}.
|
|
1342
1345
|
*/
|
|
1343
|
-
type RuleGroupICArray<RG extends RuleGroupTypeIC = RuleGroupTypeIC, R extends RuleType = RuleType, C extends string = string> = [R | RG] | [R | RG, ...MappedTuple<[C, R | RG]>] | ((R | RG)[] & {
|
|
1346
|
+
type RuleGroupICArray<RG$1 extends RuleGroupTypeIC = RuleGroupTypeIC, R$1 extends RuleType = RuleType, C extends string = string> = [R$1 | RG$1] | [R$1 | RG$1, ...MappedTuple<[C, R$1 | RG$1]>] | ((R$1 | RG$1)[] & {
|
|
1344
1347
|
length: 0;
|
|
1345
1348
|
});
|
|
1346
1349
|
/**
|
|
@@ -1350,27 +1353,27 @@ type RuleOrGroupArray = RuleGroupArray | RuleGroupICArray;
|
|
|
1350
1353
|
/**
|
|
1351
1354
|
* The type of the `rules` array in a {@link DefaultRuleGroupTypeIC}.
|
|
1352
1355
|
*/
|
|
1353
|
-
type DefaultRuleGroupICArray<F extends string = string> = RuleGroupICArray<DefaultRuleGroupTypeIC<F>, DefaultRuleType<F>, DefaultCombinatorName>;
|
|
1356
|
+
type DefaultRuleGroupICArray<F$1 extends string = string> = RuleGroupICArray<DefaultRuleGroupTypeIC<F$1>, DefaultRuleType<F$1>, DefaultCombinatorName>;
|
|
1354
1357
|
/**
|
|
1355
1358
|
* Shorthand for "either {@link DefaultRuleGroupArray} or {@link DefaultRuleGroupICArray}".
|
|
1356
1359
|
*/
|
|
1357
|
-
type DefaultRuleOrGroupArray<F extends string = string> = DefaultRuleGroupArray<F> | DefaultRuleGroupICArray<F>;
|
|
1360
|
+
type DefaultRuleOrGroupArray<F$1 extends string = string> = DefaultRuleGroupArray<F$1> | DefaultRuleGroupICArray<F$1>;
|
|
1358
1361
|
/**
|
|
1359
1362
|
* {@link RuleGroupTypeIC} with combinators limited to
|
|
1360
1363
|
* {@link DefaultCombinatorName} and rules limited to {@link DefaultRuleType}.
|
|
1361
1364
|
*/
|
|
1362
|
-
interface DefaultRuleGroupTypeIC<F extends string = string> extends RuleGroupTypeIC<DefaultRuleType<F>> {
|
|
1363
|
-
rules: DefaultRuleGroupICArray<F>;
|
|
1365
|
+
interface DefaultRuleGroupTypeIC<F$1 extends string = string> extends RuleGroupTypeIC<DefaultRuleType<F$1>> {
|
|
1366
|
+
rules: DefaultRuleGroupICArray<F$1>;
|
|
1364
1367
|
}
|
|
1365
1368
|
/**
|
|
1366
1369
|
* Shorthand for "either {@link DefaultRuleGroupType} or {@link DefaultRuleGroupTypeIC}".
|
|
1367
1370
|
*/
|
|
1368
|
-
type DefaultRuleGroupTypeAny<F extends string = string> = DefaultRuleGroupType<F> | DefaultRuleGroupTypeIC<F>;
|
|
1371
|
+
type DefaultRuleGroupTypeAny<F$1 extends string = string> = DefaultRuleGroupType<F$1> | DefaultRuleGroupTypeIC<F$1>;
|
|
1369
1372
|
/**
|
|
1370
1373
|
* Determines if a type extending {@link RuleGroupTypeAny} is actually
|
|
1371
1374
|
* {@link RuleGroupType} or {@link RuleGroupTypeIC}.
|
|
1372
1375
|
*/
|
|
1373
|
-
type GetRuleGroupType<RG> = RG extends {
|
|
1376
|
+
type GetRuleGroupType<RG$1> = RG$1 extends {
|
|
1374
1377
|
combinator: string;
|
|
1375
1378
|
} ? RuleGroupType : RuleGroupTypeIC;
|
|
1376
1379
|
/**
|
|
@@ -1381,11 +1384,11 @@ type GetRuleGroupType<RG> = RG extends {
|
|
|
1381
1384
|
* the rule type has its field and operator types narrowed to the
|
|
1382
1385
|
* identifier types of the provided Field and Operator types.
|
|
1383
1386
|
*/
|
|
1384
|
-
type GetRuleTypeFromGroupWithFieldAndOperator<RG extends RuleGroupTypeAny, F extends BaseOption, O extends BaseOption> = RG extends RuleGroupType<infer RT> | RuleGroupTypeIC<infer RT> ? RT extends RuleType<infer RuleFieldName, infer RuleOperatorName, infer RuleValueName, infer RuleCombinatorName> ? RuleFieldName extends GetOptionIdentifierType<F> ? RuleOperatorName extends GetOptionIdentifierType<O> ? RuleType<RuleFieldName, RuleOperatorName, RuleValueName, RuleCombinatorName> : RuleType<RuleFieldName, GetOptionIdentifierType<O>, RuleValueName, RuleCombinatorName> : RuleOperatorName extends GetOptionIdentifierType<O> ? RuleType<GetOptionIdentifierType<F>, RuleOperatorName, RuleValueName, RuleCombinatorName> : RuleType<GetOptionIdentifierType<F>, GetOptionIdentifierType<O>, RuleValueName, RuleCombinatorName> : never : never;
|
|
1387
|
+
type GetRuleTypeFromGroupWithFieldAndOperator<RG$1 extends RuleGroupTypeAny, F$1 extends BaseOption, O$1 extends BaseOption> = RG$1 extends RuleGroupType<infer RT> | RuleGroupTypeIC<infer RT> ? RT extends RuleType<infer RuleFieldName, infer RuleOperatorName, infer RuleValueName, infer RuleCombinatorName> ? RuleFieldName extends GetOptionIdentifierType<F$1> ? RuleOperatorName extends GetOptionIdentifierType<O$1> ? RuleType<RuleFieldName, RuleOperatorName, RuleValueName, RuleCombinatorName> : RuleType<RuleFieldName, GetOptionIdentifierType<O$1>, RuleValueName, RuleCombinatorName> : RuleOperatorName extends GetOptionIdentifierType<O$1> ? RuleType<GetOptionIdentifierType<F$1>, RuleOperatorName, RuleValueName, RuleCombinatorName> : RuleType<GetOptionIdentifierType<F$1>, GetOptionIdentifierType<O$1>, RuleValueName, RuleCombinatorName> : never : never;
|
|
1385
1388
|
/**
|
|
1386
1389
|
* Converts a narrowed rule group type to its most generic form.
|
|
1387
1390
|
*/
|
|
1388
|
-
type GenericizeRuleGroupType<RG> = RG extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
|
|
1391
|
+
type GenericizeRuleGroupType<RG$1> = RG$1 extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
|
|
1389
1392
|
//#endregion
|
|
1390
1393
|
//#region src/types/validation.d.ts
|
|
1391
1394
|
/**
|
|
@@ -1424,7 +1427,7 @@ type Classname = string | string[] | Record<string, any>;
|
|
|
1424
1427
|
*/
|
|
1425
1428
|
type ValueSource = "value" | "field";
|
|
1426
1429
|
/**
|
|
1427
|
-
* Type of {@link ValueEditor} that will be displayed.
|
|
1430
|
+
* Type of {@link react-querybuilder!ValueEditor ValueEditor} that will be displayed.
|
|
1428
1431
|
*/
|
|
1429
1432
|
type ValueEditorType = "text" | "select" | "checkbox" | "radio" | "textarea" | "switch" | "multiselect" | null;
|
|
1430
1433
|
/**
|
|
@@ -1441,7 +1444,7 @@ type ToOptionArrays<Sources extends readonly string[]> = Sources extends unknown
|
|
|
1441
1444
|
label: string;
|
|
1442
1445
|
} } : never;
|
|
1443
1446
|
type ToFlexibleOptionArrays<Sources extends readonly string[]> = Sources extends unknown ? { [K in keyof Sources]: FlexibleOption<Sources[K]> } : never;
|
|
1444
|
-
type WithOptionalClassName<T> = T & {
|
|
1447
|
+
type WithOptionalClassName<T$1> = T$1 & {
|
|
1445
1448
|
className?: Classname;
|
|
1446
1449
|
};
|
|
1447
1450
|
/**
|
|
@@ -1484,7 +1487,7 @@ interface BaseFullField<FieldName extends string = string, OperatorName extends
|
|
|
1484
1487
|
comparator?: string | ((f: FullField, operator: string) => boolean);
|
|
1485
1488
|
}
|
|
1486
1489
|
/**
|
|
1487
|
-
* Full field definition used in the `fields` prop of {@link QueryBuilder}.
|
|
1490
|
+
* Full field definition used in the `fields` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
1488
1491
|
* This type requires both `name` and `value`, but the `fields` prop itself
|
|
1489
1492
|
* can use a {@link FlexibleOption} where only one of `name` or `value` is
|
|
1490
1493
|
* required (along with `label`), or {@link Field} where only `name` and
|
|
@@ -1497,7 +1500,7 @@ interface BaseFullField<FieldName extends string = string, OperatorName extends
|
|
|
1497
1500
|
*/
|
|
1498
1501
|
type FullField<FieldName extends string = string, OperatorName extends string = string, ValueName extends string = string, OperatorObj extends FullOption = FullOption<OperatorName>, ValueObj extends FullOption = FullOption<ValueName>> = Simplify<FullOption<FieldName> & BaseFullField<FieldName, OperatorName, ValueName, OperatorObj, ValueObj>>;
|
|
1499
1502
|
/**
|
|
1500
|
-
* Field definition used in the `fields` prop of {@link QueryBuilder}.
|
|
1503
|
+
* Field definition used in the `fields` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
1501
1504
|
* This type is an extension of {@link FullField} where only `name` and
|
|
1502
1505
|
* `label` are required.
|
|
1503
1506
|
*
|
|
@@ -1510,7 +1513,7 @@ type Field<FieldName extends string = string, OperatorName extends string = stri
|
|
|
1510
1513
|
value?: FieldName;
|
|
1511
1514
|
} & Pick<BaseFullField<FieldName, OperatorName, ValueName, OperatorObj>, Exclude<keyof BaseFullField, "value">>>;
|
|
1512
1515
|
/**
|
|
1513
|
-
* Field definition used in the `fields` prop of {@link QueryBuilder}.
|
|
1516
|
+
* Field definition used in the `fields` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
1514
1517
|
* This type is an extension of {@link FullField} where only `value` and
|
|
1515
1518
|
* `label` are required.
|
|
1516
1519
|
*
|
|
@@ -1525,19 +1528,19 @@ type FieldByValue<FieldName extends string = string, OperatorName extends string
|
|
|
1525
1528
|
/**
|
|
1526
1529
|
* Utility type to make one or more properties required.
|
|
1527
1530
|
*/
|
|
1528
|
-
type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P] };
|
|
1531
|
+
type WithRequired<T$1, K$1 extends keyof T$1> = T$1 & { [P in K$1]-?: T$1[P] };
|
|
1529
1532
|
/**
|
|
1530
1533
|
* Utility type to make all properties non-nullable.
|
|
1531
1534
|
*/
|
|
1532
|
-
type RemoveNullability<T extends Record<string, unknown>> = { [k in keyof T]: NonNullable<T[k]> };
|
|
1535
|
+
type RemoveNullability<T$1 extends Record<string, unknown>> = { [k in keyof T$1]: NonNullable<T$1[k]> };
|
|
1533
1536
|
/**
|
|
1534
1537
|
* Allowed values of the {@link FullOperator} property `arity`. A value of `"unary"` or
|
|
1535
|
-
* a number less than two will cause the default {@link ValueEditor} to render `null`.
|
|
1538
|
+
* a number less than two will cause the default {@link react-querybuilder!ValueEditor ValueEditor} to render `null`.
|
|
1536
1539
|
*/
|
|
1537
1540
|
type Arity = number | "unary" | "binary" | "ternary";
|
|
1538
1541
|
/**
|
|
1539
1542
|
* Full operator definition used in the `operators`/`getOperators` props of
|
|
1540
|
-
* {@link QueryBuilder}. This type requires both `name` and `value`, but the
|
|
1543
|
+
* {@link react-querybuilder!QueryBuilder QueryBuilder}. This type requires both `name` and `value`, but the
|
|
1541
1544
|
* `operators`/`getOperators` props themselves can use a {@link FlexibleOption}
|
|
1542
1545
|
* where only one of `name` or `value` is required, or {@link FullOperator} where
|
|
1543
1546
|
* only `name` is required.
|
|
@@ -1551,7 +1554,7 @@ interface FullOperator<N extends string = string> extends WithOptionalClassName<
|
|
|
1551
1554
|
}
|
|
1552
1555
|
/**
|
|
1553
1556
|
* Operator definition used in the `operators`/`getOperators` props of
|
|
1554
|
-
* {@link QueryBuilder}. This type is an extension of {@link FullOperator}
|
|
1557
|
+
* {@link react-querybuilder!QueryBuilder QueryBuilder}. This type is an extension of {@link FullOperator}
|
|
1555
1558
|
* where only `name` and `label` are required.
|
|
1556
1559
|
*
|
|
1557
1560
|
* The `name`/`value` properties of this interface can be narrowed with generics.
|
|
@@ -1563,7 +1566,7 @@ type Operator<N extends string = string> = WithUnknownIndex<SetOptional<BaseFull
|
|
|
1563
1566
|
}>>;
|
|
1564
1567
|
/**
|
|
1565
1568
|
* Operator definition used in the `operators`/`getOperators` props of
|
|
1566
|
-
* {@link QueryBuilder}. This type is an extension of {@link FullOperator}
|
|
1569
|
+
* {@link react-querybuilder!QueryBuilder QueryBuilder}. This type is an extension of {@link FullOperator}
|
|
1567
1570
|
* where only `value` and `label` are required.
|
|
1568
1571
|
*
|
|
1569
1572
|
* The `name`/`value` properties of this interface can be narrowed with generics.
|
|
@@ -1574,7 +1577,7 @@ type OperatorByValue<N extends string = string> = WithUnknownIndex<SetOptional<B
|
|
|
1574
1577
|
arity?: Arity;
|
|
1575
1578
|
}>>;
|
|
1576
1579
|
/**
|
|
1577
|
-
* Full combinator definition used in the `combinators` prop of {@link QueryBuilder}.
|
|
1580
|
+
* Full combinator definition used in the `combinators` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
1578
1581
|
* This type requires both `name` and `value`, but the `combinators` prop itself
|
|
1579
1582
|
* can use a {@link FlexibleOption} where only one of `name` or `value` is required,
|
|
1580
1583
|
* or {@link Combinator} where only `name` is required.
|
|
@@ -1585,7 +1588,7 @@ type OperatorByValue<N extends string = string> = WithUnknownIndex<SetOptional<B
|
|
|
1585
1588
|
*/
|
|
1586
1589
|
type FullCombinator<N extends string = string> = WithOptionalClassName<FullOption<N>>;
|
|
1587
1590
|
/**
|
|
1588
|
-
* Combinator definition used in the `combinators` prop of {@link QueryBuilder}.
|
|
1591
|
+
* Combinator definition used in the `combinators` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
1589
1592
|
* This type is an extension of {@link FullCombinator} where only `name` and
|
|
1590
1593
|
* `label` are required.
|
|
1591
1594
|
*
|
|
@@ -1595,7 +1598,7 @@ type FullCombinator<N extends string = string> = WithOptionalClassName<FullOptio
|
|
|
1595
1598
|
*/
|
|
1596
1599
|
type Combinator<N extends string = string> = WithUnknownIndex<WithOptionalClassName<SetOptional<BaseFullOption<N>, "value">>>;
|
|
1597
1600
|
/**
|
|
1598
|
-
* Combinator definition used in the `combinators` prop of {@link QueryBuilder}.
|
|
1601
|
+
* Combinator definition used in the `combinators` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
1599
1602
|
* This type is an extension of {@link FullCombinator} where only `value` and
|
|
1600
1603
|
* `label` are required.
|
|
1601
1604
|
*
|
|
@@ -1611,12 +1614,12 @@ type ParseNumberMethodName = "enhanced" | "native" | "strict";
|
|
|
1611
1614
|
type ParseNumberMethod = boolean | ParseNumberMethodName;
|
|
1612
1615
|
type ParseNumbersModerationLevel = "-limited" | "";
|
|
1613
1616
|
/**
|
|
1614
|
-
* Options for the `parseNumbers` prop of {@link QueryBuilder}.
|
|
1617
|
+
* Options for the `parseNumbers` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
1615
1618
|
*/
|
|
1616
1619
|
type ParseNumbersPropConfig = boolean | `${ParseNumberMethodName}${ParseNumbersModerationLevel}`;
|
|
1617
1620
|
/**
|
|
1618
|
-
* Signature of `accessibleDescriptionGenerator` prop, used by {@link QueryBuilder} to generate
|
|
1619
|
-
* accessible descriptions for each {@link RuleGroup}.
|
|
1621
|
+
* Signature of `accessibleDescriptionGenerator` prop, used by {@link react-querybuilder!QueryBuilder QueryBuilder} to generate
|
|
1622
|
+
* accessible descriptions for each {@link react-querybuilder!RuleGroup RuleGroup}.
|
|
1620
1623
|
*/
|
|
1621
1624
|
type AccessibleDescriptionGenerator = (props: {
|
|
1622
1625
|
path: Path;
|
|
@@ -1764,11 +1767,11 @@ interface FormatQueryOptions {
|
|
|
1764
1767
|
quoteValuesWith?: string;
|
|
1765
1768
|
/**
|
|
1766
1769
|
* Validator function for the entire query. Can be the same function passed
|
|
1767
|
-
* as `validator` prop to {@link QueryBuilder}.
|
|
1770
|
+
* as `validator` prop to {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
1768
1771
|
*/
|
|
1769
1772
|
validator?: QueryValidator;
|
|
1770
1773
|
/**
|
|
1771
|
-
* This can be the same {@link FullField} array passed to {@link QueryBuilder}, but
|
|
1774
|
+
* This can be the same {@link FullField} array passed to {@link react-querybuilder!QueryBuilder QueryBuilder}, but
|
|
1772
1775
|
* really all you need to provide is the `name` and `validator` for each field.
|
|
1773
1776
|
*
|
|
1774
1777
|
* The full field object from this array, where the field's identifying property
|
|
@@ -1776,7 +1779,7 @@ interface FormatQueryOptions {
|
|
|
1776
1779
|
*/
|
|
1777
1780
|
fields?: FlexibleOptionList<FullField>;
|
|
1778
1781
|
/**
|
|
1779
|
-
* This can be the same `getOperators` function passed to {@link QueryBuilder}.
|
|
1782
|
+
* This can be the same `getOperators` function passed to {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
1780
1783
|
*
|
|
1781
1784
|
* The full operator object from this array, where the operator's identifying property
|
|
1782
1785
|
* matches the rule's `operator`, will be passed to the rule processor.
|
|
@@ -2110,7 +2113,7 @@ type NLTranslationKey = "and" | "or" | "true" | "false" | `groupPrefix${ZeroOrMo
|
|
|
2110
2113
|
*/
|
|
2111
2114
|
type NLTranslations = Partial<Record<NLTranslationKey, string>>;
|
|
2112
2115
|
//#endregion
|
|
2113
|
-
//#region src/types/
|
|
2116
|
+
//#region src/types/queryBuilder.d.ts
|
|
2114
2117
|
/**
|
|
2115
2118
|
* Base interface for all rule subcomponents.
|
|
2116
2119
|
*
|
|
@@ -2386,6 +2389,113 @@ interface QueryActions {
|
|
|
2386
2389
|
moveRule(oldPath: Path, newPath: Path | "up" | "down", clone?: boolean, context?: any): void;
|
|
2387
2390
|
groupRule(sourcePath: Path, targetPath: Path, clone?: boolean, context?: any): void;
|
|
2388
2391
|
}
|
|
2392
|
+
interface QueryBuilderFlags {
|
|
2393
|
+
/**
|
|
2394
|
+
* Set to `false` to avoid calling the `onQueryChange` callback
|
|
2395
|
+
* when the component mounts.
|
|
2396
|
+
*
|
|
2397
|
+
* @default true
|
|
2398
|
+
*/
|
|
2399
|
+
enableMountQueryChange?: boolean;
|
|
2400
|
+
/**
|
|
2401
|
+
* Enables drag-and-drop features.
|
|
2402
|
+
*
|
|
2403
|
+
* @default false
|
|
2404
|
+
*/
|
|
2405
|
+
enableDragAndDrop?: boolean;
|
|
2406
|
+
/**
|
|
2407
|
+
* Enables debug logging for query builders (and React DnD when applicable).
|
|
2408
|
+
*
|
|
2409
|
+
* @default false
|
|
2410
|
+
*/
|
|
2411
|
+
debugMode?: boolean;
|
|
2412
|
+
/**
|
|
2413
|
+
* Show group combinator selectors in the body of the group, between each child rule/group,
|
|
2414
|
+
* instead of in the group header.
|
|
2415
|
+
*
|
|
2416
|
+
* @default false
|
|
2417
|
+
*/
|
|
2418
|
+
showCombinatorsBetweenRules?: boolean;
|
|
2419
|
+
/**
|
|
2420
|
+
* Show the "not" (aka inversion) toggle for rule groups.
|
|
2421
|
+
*
|
|
2422
|
+
* @default false
|
|
2423
|
+
*/
|
|
2424
|
+
showNotToggle?: boolean;
|
|
2425
|
+
/**
|
|
2426
|
+
* Show the "Shift up"/"Shift down" actions.
|
|
2427
|
+
*
|
|
2428
|
+
* @default false
|
|
2429
|
+
*/
|
|
2430
|
+
showShiftActions?: boolean;
|
|
2431
|
+
/**
|
|
2432
|
+
* Show the "Clone rule" and "Clone group" buttons.
|
|
2433
|
+
*
|
|
2434
|
+
* @default false
|
|
2435
|
+
*/
|
|
2436
|
+
showCloneButtons?: boolean;
|
|
2437
|
+
/**
|
|
2438
|
+
* Show the "Lock rule" and "Lock group" buttons.
|
|
2439
|
+
*
|
|
2440
|
+
* @default false
|
|
2441
|
+
*/
|
|
2442
|
+
showLockButtons?: boolean;
|
|
2443
|
+
/**
|
|
2444
|
+
* Show the "Mute rule" and "Mute group" buttons.
|
|
2445
|
+
*
|
|
2446
|
+
* @default false
|
|
2447
|
+
*/
|
|
2448
|
+
showMuteButtons?: boolean;
|
|
2449
|
+
/**
|
|
2450
|
+
* Reset the `operator` and `value` when the `field` changes.
|
|
2451
|
+
*
|
|
2452
|
+
* @default true
|
|
2453
|
+
*/
|
|
2454
|
+
resetOnFieldChange?: boolean;
|
|
2455
|
+
/**
|
|
2456
|
+
* Reset the `value` when the `operator` changes.
|
|
2457
|
+
*
|
|
2458
|
+
* @default false
|
|
2459
|
+
*/
|
|
2460
|
+
resetOnOperatorChange?: boolean;
|
|
2461
|
+
/**
|
|
2462
|
+
* Select the first field in the array automatically.
|
|
2463
|
+
*
|
|
2464
|
+
* @default true
|
|
2465
|
+
*/
|
|
2466
|
+
autoSelectField?: boolean;
|
|
2467
|
+
/**
|
|
2468
|
+
* Select the first operator in the array automatically.
|
|
2469
|
+
*
|
|
2470
|
+
* @default true
|
|
2471
|
+
*/
|
|
2472
|
+
autoSelectOperator?: boolean;
|
|
2473
|
+
/**
|
|
2474
|
+
* Select the first value in the array automatically. Only applicable when the value editor renders a select list.
|
|
2475
|
+
*
|
|
2476
|
+
* @default false
|
|
2477
|
+
*/
|
|
2478
|
+
autoSelectValue?: boolean;
|
|
2479
|
+
/**
|
|
2480
|
+
* Adds a new default rule automatically to each new group.
|
|
2481
|
+
*
|
|
2482
|
+
* @default false
|
|
2483
|
+
*/
|
|
2484
|
+
addRuleToNewGroups?: boolean;
|
|
2485
|
+
/**
|
|
2486
|
+
* Store list-type values as native arrays instead of comma-separated strings.
|
|
2487
|
+
*
|
|
2488
|
+
* @default false
|
|
2489
|
+
*/
|
|
2490
|
+
listsAsArrays?: boolean;
|
|
2491
|
+
/**
|
|
2492
|
+
* Prevent _any_ assignment of standard classes to elements. This includes conditional
|
|
2493
|
+
* and event-based classes for validation, drag-and-drop, etc.
|
|
2494
|
+
*
|
|
2495
|
+
* @default false
|
|
2496
|
+
*/
|
|
2497
|
+
suppressStandardClassnames?: boolean;
|
|
2498
|
+
}
|
|
2389
2499
|
//#endregion
|
|
2390
2500
|
//#region src/defaults.d.ts
|
|
2391
2501
|
/**
|
|
@@ -2612,6 +2722,13 @@ declare const LogType: {
|
|
|
2612
2722
|
* @group Defaults
|
|
2613
2723
|
*/
|
|
2614
2724
|
declare const rootPath: Path;
|
|
2725
|
+
/**
|
|
2726
|
+
* Default values for all `boolean`
|
|
2727
|
+
* {@link react-querybuilder!QueryBuilder QueryBuilder} options.
|
|
2728
|
+
*
|
|
2729
|
+
* @group Defaults
|
|
2730
|
+
*/
|
|
2731
|
+
declare const queryBuilderFlagDefaults: Required<QueryBuilderFlags>;
|
|
2615
2732
|
//#endregion
|
|
2616
2733
|
//#region src/utils/arrayUtils.d.ts
|
|
2617
2734
|
/**
|
|
@@ -2706,7 +2823,7 @@ declare function convertQuery(query: RuleGroupTypeIC): RuleGroupType;
|
|
|
2706
2823
|
//#endregion
|
|
2707
2824
|
//#region src/utils/defaultValidator.d.ts
|
|
2708
2825
|
/**
|
|
2709
|
-
* This is an example validation function you can pass to {@link QueryBuilder} in the
|
|
2826
|
+
* This is an example validation function you can pass to {@link react-querybuilder!QueryBuilder QueryBuilder} in the
|
|
2710
2827
|
* `validator` prop. It assumes that you want to validate groups, and has a no-op
|
|
2711
2828
|
* for validating rules which you can replace with your own implementation.
|
|
2712
2829
|
*/
|
|
@@ -3513,7 +3630,7 @@ declare const nullOrUndefinedOrEmpty: (value: unknown) => value is null | undefi
|
|
|
3513
3630
|
* type ObjectKeys<T extends object> = `${Exclude<keyof T, symbol>}`;
|
|
3514
3631
|
* ```
|
|
3515
3632
|
*/
|
|
3516
|
-
type ObjectKeys<T extends object> = Exclude<keyof T, symbol>;
|
|
3633
|
+
type ObjectKeys<T$1 extends object> = Exclude<keyof T$1, symbol>;
|
|
3517
3634
|
/**
|
|
3518
3635
|
* A strongly-typed version of `Object.keys()`.
|
|
3519
3636
|
*
|
|
@@ -3534,14 +3651,14 @@ declare const objectEntries: <Type extends Record<PropertyKey, unknown>>(value:
|
|
|
3534
3651
|
*
|
|
3535
3652
|
* @group Option Lists
|
|
3536
3653
|
*/
|
|
3537
|
-
declare function toFullOption<Opt extends BaseOption>(opt: Opt | string, baseProperties?: Record<string, unknown>, labelMap?: Record<string, unknown>): ToFullOption<Opt>;
|
|
3654
|
+
declare function toFullOption<Opt$1 extends BaseOption>(opt: Opt$1 | string, baseProperties?: Record<string, unknown>, labelMap?: Record<string, unknown>): ToFullOption<Opt$1>;
|
|
3538
3655
|
/**
|
|
3539
3656
|
* Converts an {@link OptionList} or {@link FlexibleOptionList} into a {@link FullOptionList}.
|
|
3540
3657
|
* Lists of full options are left unchanged.
|
|
3541
3658
|
*
|
|
3542
3659
|
* @group Option Lists
|
|
3543
3660
|
*/
|
|
3544
|
-
declare function toFullOptionList<Opt extends BaseOption>(optList: unknown[], baseProperties?: Record<string, unknown>, labelMap?: Record<string, unknown>): FullOptionList<Opt>;
|
|
3661
|
+
declare function toFullOptionList<Opt$1 extends BaseOption>(optList: unknown[], baseProperties?: Record<string, unknown>, labelMap?: Record<string, unknown>): FullOptionList<Opt$1>;
|
|
3545
3662
|
/**
|
|
3546
3663
|
* Converts a {@link FlexibleOptionList} into a {@link FullOptionList}.
|
|
3547
3664
|
* Lists of full options are left unchanged.
|
|
@@ -3623,9 +3740,9 @@ declare function getOption<OptType extends Option>(arr: FlexibleOptionList<OptTy
|
|
|
3623
3740
|
*
|
|
3624
3741
|
* @group Option Lists
|
|
3625
3742
|
*/
|
|
3626
|
-
declare function getFirstOption<Opt extends FullOption>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
|
|
3627
|
-
declare function getFirstOption<Opt extends ValueOption>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
|
|
3628
|
-
declare function getFirstOption<Opt extends Option>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
|
|
3743
|
+
declare function getFirstOption<Opt$1 extends FullOption>(arr?: OptionGroup<Opt$1>[] | Opt$1[]): GetOptionIdentifierType<Opt$1> | null;
|
|
3744
|
+
declare function getFirstOption<Opt$1 extends ValueOption>(arr?: OptionGroup<Opt$1>[] | Opt$1[]): GetOptionIdentifierType<Opt$1> | null;
|
|
3745
|
+
declare function getFirstOption<Opt$1 extends Option>(arr?: OptionGroup<Opt$1>[] | Opt$1[]): GetOptionIdentifierType<Opt$1> | null;
|
|
3629
3746
|
/**
|
|
3630
3747
|
* Flattens {@link FlexibleOptionGroup} arrays into {@link BaseOption} arrays.
|
|
3631
3748
|
* If the array is already flat, it is returned as is.
|
|
@@ -3647,14 +3764,14 @@ declare const uniqOptGroups: <T extends BaseOption>(originalArray: FlexibleOptio
|
|
|
3647
3764
|
* @group Option Lists
|
|
3648
3765
|
*/
|
|
3649
3766
|
declare const uniqOptList: <T extends BaseOption>(originalArray: FlexibleOptionList<T>) => WithUnknownIndex<BaseOption & FullOption>[] | OptionGroup<ToFullOption<T>>[];
|
|
3650
|
-
interface PreparedOptionList<O extends FullOption> {
|
|
3767
|
+
interface PreparedOptionList<O$1 extends FullOption> {
|
|
3651
3768
|
defaultOption: FullOption;
|
|
3652
|
-
optionList: O[] | OptionGroup<O>[];
|
|
3769
|
+
optionList: O$1[] | OptionGroup<O$1>[];
|
|
3653
3770
|
optionsMap: Partial<FullOptionRecord<FullOption>>;
|
|
3654
3771
|
}
|
|
3655
|
-
interface PrepareOptionListParams<O extends FullOption> {
|
|
3772
|
+
interface PrepareOptionListParams<O$1 extends FullOption> {
|
|
3656
3773
|
placeholder?: Placeholder;
|
|
3657
|
-
optionList?: FlexibleOptionListProp<O> | BaseOptionMap<O>;
|
|
3774
|
+
optionList?: FlexibleOptionListProp<O$1> | BaseOptionMap<O$1>;
|
|
3658
3775
|
baseOption?: Record<string, unknown>;
|
|
3659
3776
|
labelMap?: Record<string, string>;
|
|
3660
3777
|
autoSelectOption?: boolean;
|
|
@@ -3727,6 +3844,23 @@ declare const getCommonAncestorPath: (path1: Path, path2: Path) => Path;
|
|
|
3727
3844
|
*/
|
|
3728
3845
|
declare const pathIsDisabled: (path: Path, query: RuleGroupTypeAny) => boolean;
|
|
3729
3846
|
//#endregion
|
|
3847
|
+
//#region src/utils/preferProp.d.ts
|
|
3848
|
+
/**
|
|
3849
|
+
* For given default, prop, and context values, return the first provided of prop,
|
|
3850
|
+
* context, and default, in that order.
|
|
3851
|
+
*/
|
|
3852
|
+
declare const preferProp: (def: boolean, prop?: boolean, context?: boolean, doNotFinalize?: boolean) => boolean;
|
|
3853
|
+
/**
|
|
3854
|
+
* For given default, prop, and context values, return the first provided of prop,
|
|
3855
|
+
* context, and default, in that order.
|
|
3856
|
+
*/
|
|
3857
|
+
declare const preferAnyProp: (def?: any, prop?: any, context?: any) => any;
|
|
3858
|
+
/**
|
|
3859
|
+
* For a given set of defaults, props, and context values, return the first provided of prop,
|
|
3860
|
+
* context, and default—in that order—for each property in the defaults object.
|
|
3861
|
+
*/
|
|
3862
|
+
declare const preferFlagProps: (props?: QueryBuilderFlags, contextVals?: QueryBuilderFlags, finalize?: boolean) => QueryBuilderFlags;
|
|
3863
|
+
//#endregion
|
|
3730
3864
|
//#region src/utils/prepareQueryObjects.d.ts
|
|
3731
3865
|
/**
|
|
3732
3866
|
* Options for {@link prepareRule}/{@link prepareRuleGroup}.
|
|
@@ -3990,7 +4124,7 @@ declare const regenerateIDs: <RG>(subject: RG, {
|
|
|
3990
4124
|
/**
|
|
3991
4125
|
* Options object for {@link index!transformQuery transformQuery}.
|
|
3992
4126
|
*/
|
|
3993
|
-
interface TransformQueryOptions<RG extends RuleGroupTypeAny = RuleGroupType> {
|
|
4127
|
+
interface TransformQueryOptions<RG$1 extends RuleGroupTypeAny = RuleGroupType> {
|
|
3994
4128
|
/**
|
|
3995
4129
|
* When a rule is encountered in the hierarchy, it will be replaced
|
|
3996
4130
|
* with the result of this function.
|
|
@@ -4004,7 +4138,7 @@ interface TransformQueryOptions<RG extends RuleGroupTypeAny = RuleGroupType> {
|
|
|
4004
4138
|
*
|
|
4005
4139
|
* @defaultValue `rg => rg`
|
|
4006
4140
|
*/
|
|
4007
|
-
ruleGroupProcessor?: (ruleGroup: RG) => Record<string, any>;
|
|
4141
|
+
ruleGroupProcessor?: (ruleGroup: RG$1) => Record<string, any>;
|
|
4008
4142
|
/**
|
|
4009
4143
|
* For each rule and group in the query, any properties matching a key
|
|
4010
4144
|
* in this object will be renamed to the corresponding value. To retain both
|
|
@@ -4099,5 +4233,5 @@ declare function transformQuery(query: RuleGroupType, options?: TransformQueryOp
|
|
|
4099
4233
|
*/
|
|
4100
4234
|
declare function transformQuery(query: RuleGroupTypeIC, options?: TransformQueryOptions<RuleGroupTypeIC>): any;
|
|
4101
4235
|
//#endregion
|
|
4102
|
-
export { AccessibleDescriptionGenerator, ActionElementEventHandler, AddOptions, Arity, BaseFullOption, BaseOption, BaseOptionMap, BaseTranslation, BaseTranslationWithLabel, BaseTranslationWithPlaceholders, BaseTranslations, BaseTranslationsFull, Classname, Classnames, Combinator, CombinatorByValue, CommonRuleAndGroupProperties, CommonRuleSubComponentProps, ConstituentWordOrder, ConstituentWordOrderString, DefaultCombinator, DefaultCombinatorExtended, DefaultCombinatorName, DefaultCombinatorNameExtended, DefaultCombinators, DefaultCombinatorsExtended, DefaultMatchModes, DefaultOperator, DefaultOperatorName, DefaultOperators, DefaultRuleGroupArray, DefaultRuleGroupICArray, DefaultRuleGroupType, DefaultRuleGroupTypeAny, DefaultRuleGroupTypeIC, DefaultRuleOrGroupArray, DefaultRuleType, DndDropTargetType, DragCollection, DraggedItem, DropCollection, DropEffect, DropResult, ExportFormat, ExportObjectFormats, ExportOperatorMap, Field, FieldByValue, FindPathReturnType, FlexibleOption, FlexibleOptionGroup, FlexibleOptionList, FlexibleOptionListProp, FormatQueryFinalOptions, FormatQueryOptions, FormatQueryValidateRule, FullCombinator, FullField, FullOperator, FullOption, FullOptionList, FullOptionMap, FullOptionRecord, GenericizeRuleGroupType, GetOptionIdentifierType, GetOptionType, GetRuleGroupType, GetRuleTypeFromGroupWithFieldAndOperator, GroupOptions, GroupVariantCondition, InputType, InsertOptions, type JsonLogicAll, type JsonLogicAnd, type JsonLogicDoubleNegation, type JsonLogicEqual, type JsonLogicGreaterThan, type JsonLogicGreaterThanOrEqual, type JsonLogicInArray, type JsonLogicInString, type JsonLogicLessThan, type JsonLogicLessThanOrEqual, type JsonLogicNegation, type JsonLogicNone, type JsonLogicNotEqual, type JsonLogicOr, type JsonLogicReservedOperations, type JsonLogicRulesLogic, type JsonLogicSome, type JsonLogicStrictEqual, type JsonLogicStrictNotEqual, type JsonLogicVar, LogType, MatchConfig, MatchMode, MatchModeOptions, MoveOptions, NLTranslationKey, NLTranslations, NameLabelPair, Operator, OperatorByValue, Option, OptionGroup, OptionList, ParameterizedNamedSQL, ParameterizedSQL, ParseNumberMethod, ParseNumberOptions, ParseNumbersPropConfig, Path, Placeholder, PrepareOptionListParams, PreparedOptionList, PreparerOptions, QueryActions, QueryValidator, RQBJsonLogic, RQBJsonLogicEndsWith, RQBJsonLogicStartsWith, RQBJsonLogicVar, RegenerateIdOptions, RemoveNullability, RuleGroupArray, RuleGroupICArray, RuleGroupProcessor, RuleGroupType, RuleGroupTypeAny, RuleGroupTypeIC, RuleOrGroupArray, RuleProcessor, RuleType, RuleValidator, SQLPreset, StringUnionToFlexibleOptionArray, StringUnionToFullOptionArray, TestID, ToFlexibleOption, ToFullOption, TransformQueryOptions, UpdateOptions, UpdateableProperties, ValidationMap, ValidationResult, ValueChangeEventHandler, ValueEditorType, ValueOption, ValueProcessor, ValueProcessorByRule, ValueProcessorLegacy, ValueProcessorOptions, ValueSource, ValueSourceFlexibleOptions, ValueSourceFullOptions, ValueSources, WithRequired, WithUnknownIndex, add, bigIntJsonParseReviver, bigIntJsonStringifyReplacer, celCombinatorMap, clsx, convertFromIC, convertQuery, convertToIC, defaultCELValueProcessor, defaultCombinatorLabelMap, defaultCombinators, defaultCombinatorsExtended, defaultControlClassnames, defaultExportOperatorMap, defaultJoinChar, defaultMatchModes, defaultMongoDBValueProcessor, defaultNLTranslations, defaultOperatorLabelMap, defaultOperatorNegationMap, defaultOperatorProcessorNL, defaultOperatorProcessorSQL, defaultOperators, defaultPlaceholderFieldGroupLabel, defaultPlaceholderFieldLabel, defaultPlaceholderFieldName, defaultPlaceholderLabel, defaultPlaceholderName, defaultPlaceholderOperatorGroupLabel, defaultPlaceholderOperatorLabel, defaultPlaceholderOperatorName, defaultPlaceholderValueGroupLabel, defaultPlaceholderValueLabel, defaultPlaceholderValueName, defaultRuleGroupProcessorCEL, defaultRuleGroupProcessorDrizzle, defaultRuleGroupProcessorElasticSearch, defaultRuleGroupProcessorJSONata, defaultRuleGroupProcessorJsonLogic, defaultRuleGroupProcessorLDAP, defaultRuleGroupProcessorMongoDB, defaultRuleGroupProcessorMongoDBQuery, defaultRuleGroupProcessorNL, defaultRuleGroupProcessorParameterized, defaultRuleGroupProcessorPrisma, defaultRuleGroupProcessorSQL, defaultRuleGroupProcessorSequelize, defaultRuleGroupProcessorSpEL, defaultRuleProcessorCEL, defaultRuleProcessorDrizzle, defaultRuleProcessorElasticSearch, defaultRuleProcessorJSONata, defaultRuleProcessorJsonLogic, defaultRuleProcessorLDAP, defaultRuleProcessorMongoDB, defaultRuleProcessorMongoDBQuery, defaultRuleProcessorNL, defaultRuleProcessorParameterized, defaultRuleProcessorPrisma, defaultRuleProcessorSQL, defaultRuleProcessorSequelize, defaultRuleProcessorSpEL, defaultSpELValueProcessor, defaultTranslations, defaultValidator, defaultValueProcessor, defaultValueProcessorByRule, defaultValueProcessorCELByRule, defaultValueProcessorMongoDBByRule, defaultValueProcessorNL, defaultValueProcessorSpELByRule, filterFieldsByComparator, findID, findPath, formatQuery, formatQueryOptionPresets, generateAccessibleDescription, generateID, getCommonAncestorPath, getFirstOption, getMatchModesUtil, getNLTranslataion, getOption, getParentPath, getParseNumberMethod, getPathOfID, getQuoteFieldNamesWithArray, getQuotedFieldName, getValidationClassNames, getValueSourcesUtil, group, groupInvalidReasons, insert, isAncestor, isFlexibleOptionArray, isFlexibleOptionGroupArray, isFullOptionArray, isFullOptionGroupArray, isOptionGroupArray, isPojo, isRuleGroup, isRuleGroupType, isRuleGroupTypeIC, isRuleOrGroupValid, isRuleType, isValidValue, isValidationResult, isValueProcessorLegacy, joinWith, jsonLogicAdditionalOperators, lc, mapSQLOperator, mergeAnyTranslation, mergeAnyTranslations, mergeClassnames, mongoDbFallback, mongoOperators, move, normalizeConstituentWordOrder, nullFreeArray, nullOrUndefinedOrEmpty, numericRegex, numerifyValues, objectEntries, objectKeys, parseNumber, pathIsDisabled, pathsAreEqual, prepareOptionList, prepareRule, prepareRuleGroup, prepareRuleOrGroup, prismaFallback, prismaOperators, processMatchMode, regenerateID, regenerateIDs, remove, rootPath, shouldRenderAsNumber, splitBy, sqlDialectPresets, standardClassnames, toArray, toFlatOptionArray, toFullOption, toFullOptionList, toFullOptionMap, transformQuery, trimIfString, uniqByIdentifier, uniqByName, uniqOptGroups, uniqOptList, update };
|
|
4236
|
+
export { AccessibleDescriptionGenerator, ActionElementEventHandler, AddOptions, Arity, BaseFullOption, BaseOption, BaseOptionMap, BaseTranslation, BaseTranslationWithLabel, BaseTranslationWithPlaceholders, BaseTranslations, BaseTranslationsFull, Classname, Classnames, Combinator, CombinatorByValue, CommonRuleAndGroupProperties, CommonRuleSubComponentProps, ConstituentWordOrder, ConstituentWordOrderString, DefaultCombinator, DefaultCombinatorExtended, DefaultCombinatorName, DefaultCombinatorNameExtended, DefaultCombinators, DefaultCombinatorsExtended, DefaultMatchModes, DefaultOperator, DefaultOperatorName, DefaultOperators, DefaultRuleGroupArray, DefaultRuleGroupICArray, DefaultRuleGroupType, DefaultRuleGroupTypeAny, DefaultRuleGroupTypeIC, DefaultRuleOrGroupArray, DefaultRuleType, DndDropTargetType, DragCollection, DraggedItem, DropCollection, DropEffect, DropResult, ExportFormat, ExportObjectFormats, ExportOperatorMap, Field, FieldByValue, FindPathReturnType, FlexibleOption, FlexibleOptionGroup, FlexibleOptionList, FlexibleOptionListProp, FormatQueryFinalOptions, FormatQueryOptions, FormatQueryValidateRule, FullCombinator, FullField, FullOperator, FullOption, FullOptionList, FullOptionMap, FullOptionRecord, GenericizeRuleGroupType, GetOptionIdentifierType, GetOptionType, GetRuleGroupType, GetRuleTypeFromGroupWithFieldAndOperator, GroupOptions, GroupVariantCondition, InputType, InsertOptions, type JsonLogicAll, type JsonLogicAnd, type JsonLogicDoubleNegation, type JsonLogicEqual, type JsonLogicGreaterThan, type JsonLogicGreaterThanOrEqual, type JsonLogicInArray, type JsonLogicInString, type JsonLogicLessThan, type JsonLogicLessThanOrEqual, type JsonLogicNegation, type JsonLogicNone, type JsonLogicNotEqual, type JsonLogicOr, type JsonLogicReservedOperations, type JsonLogicRulesLogic, type JsonLogicSome, type JsonLogicStrictEqual, type JsonLogicStrictNotEqual, type JsonLogicVar, LogType, MatchConfig, MatchMode, MatchModeOptions, MoveOptions, NLTranslationKey, NLTranslations, NameLabelPair, Operator, OperatorByValue, Option, OptionGroup, OptionList, ParameterizedNamedSQL, ParameterizedSQL, ParseNumberMethod, ParseNumberOptions, ParseNumbersPropConfig, Path, Placeholder, PrepareOptionListParams, PreparedOptionList, PreparerOptions, QueryActions, QueryBuilderFlags, QueryValidator, RQBJsonLogic, RQBJsonLogicEndsWith, RQBJsonLogicStartsWith, RQBJsonLogicVar, RegenerateIdOptions, RemoveNullability, RuleGroupArray, RuleGroupICArray, RuleGroupProcessor, RuleGroupType, RuleGroupTypeAny, RuleGroupTypeIC, RuleOrGroupArray, RuleProcessor, RuleType, RuleValidator, SQLPreset, StringUnionToFlexibleOptionArray, StringUnionToFullOptionArray, TestID, ToFlexibleOption, ToFullOption, TransformQueryOptions, UpdateOptions, UpdateableProperties, ValidationMap, ValidationResult, ValueChangeEventHandler, ValueEditorType, ValueOption, ValueProcessor, ValueProcessorByRule, ValueProcessorLegacy, ValueProcessorOptions, ValueSource, ValueSourceFlexibleOptions, ValueSourceFullOptions, ValueSources, WithRequired, WithUnknownIndex, add, bigIntJsonParseReviver, bigIntJsonStringifyReplacer, celCombinatorMap, clsx, convertFromIC, convertQuery, convertToIC, defaultCELValueProcessor, defaultCombinatorLabelMap, defaultCombinators, defaultCombinatorsExtended, defaultControlClassnames, defaultExportOperatorMap, defaultJoinChar, defaultMatchModes, defaultMongoDBValueProcessor, defaultNLTranslations, defaultOperatorLabelMap, defaultOperatorNegationMap, defaultOperatorProcessorNL, defaultOperatorProcessorSQL, defaultOperators, defaultPlaceholderFieldGroupLabel, defaultPlaceholderFieldLabel, defaultPlaceholderFieldName, defaultPlaceholderLabel, defaultPlaceholderName, defaultPlaceholderOperatorGroupLabel, defaultPlaceholderOperatorLabel, defaultPlaceholderOperatorName, defaultPlaceholderValueGroupLabel, defaultPlaceholderValueLabel, defaultPlaceholderValueName, defaultRuleGroupProcessorCEL, defaultRuleGroupProcessorDrizzle, defaultRuleGroupProcessorElasticSearch, defaultRuleGroupProcessorJSONata, defaultRuleGroupProcessorJsonLogic, defaultRuleGroupProcessorLDAP, defaultRuleGroupProcessorMongoDB, defaultRuleGroupProcessorMongoDBQuery, defaultRuleGroupProcessorNL, defaultRuleGroupProcessorParameterized, defaultRuleGroupProcessorPrisma, defaultRuleGroupProcessorSQL, defaultRuleGroupProcessorSequelize, defaultRuleGroupProcessorSpEL, defaultRuleProcessorCEL, defaultRuleProcessorDrizzle, defaultRuleProcessorElasticSearch, defaultRuleProcessorJSONata, defaultRuleProcessorJsonLogic, defaultRuleProcessorLDAP, defaultRuleProcessorMongoDB, defaultRuleProcessorMongoDBQuery, defaultRuleProcessorNL, defaultRuleProcessorParameterized, defaultRuleProcessorPrisma, defaultRuleProcessorSQL, defaultRuleProcessorSequelize, defaultRuleProcessorSpEL, defaultSpELValueProcessor, defaultTranslations, defaultValidator, defaultValueProcessor, defaultValueProcessorByRule, defaultValueProcessorCELByRule, defaultValueProcessorMongoDBByRule, defaultValueProcessorNL, defaultValueProcessorSpELByRule, filterFieldsByComparator, findID, findPath, formatQuery, formatQueryOptionPresets, generateAccessibleDescription, generateID, getCommonAncestorPath, getFirstOption, getMatchModesUtil, getNLTranslataion, getOption, getParentPath, getParseNumberMethod, getPathOfID, getQuoteFieldNamesWithArray, getQuotedFieldName, getValidationClassNames, getValueSourcesUtil, group, groupInvalidReasons, insert, isAncestor, isFlexibleOptionArray, isFlexibleOptionGroupArray, isFullOptionArray, isFullOptionGroupArray, isOptionGroupArray, isPojo, isRuleGroup, isRuleGroupType, isRuleGroupTypeIC, isRuleOrGroupValid, isRuleType, isValidValue, isValidationResult, isValueProcessorLegacy, joinWith, jsonLogicAdditionalOperators, lc, mapSQLOperator, mergeAnyTranslation, mergeAnyTranslations, mergeClassnames, mongoDbFallback, mongoOperators, move, normalizeConstituentWordOrder, nullFreeArray, nullOrUndefinedOrEmpty, numericRegex, numerifyValues, objectEntries, objectKeys, parseNumber, pathIsDisabled, pathsAreEqual, preferAnyProp, preferFlagProps, preferProp, prepareOptionList, prepareRule, prepareRuleGroup, prepareRuleOrGroup, prismaFallback, prismaOperators, processMatchMode, queryBuilderFlagDefaults, regenerateID, regenerateIDs, remove, rootPath, shouldRenderAsNumber, splitBy, sqlDialectPresets, standardClassnames, toArray, toFlatOptionArray, toFullOption, toFullOptionList, toFullOptionMap, transformQuery, trimIfString, uniqByIdentifier, uniqByName, uniqOptGroups, uniqOptList, update };
|
|
4103
4237
|
//# sourceMappingURL=react-querybuilder_core.production.d.mts.map
|