@react-querybuilder/core 8.23.1 → 8.24.1
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_core.cjs.development.d.ts +516 -455
- package/dist/cjs/react-querybuilder_core.cjs.development.js +169 -6
- package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +516 -455
- package/dist/cjs/react-querybuilder_core.cjs.production.js +74 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
- package/dist/derivations.d.mts +290 -239
- package/dist/derivations.d.ts +290 -239
- package/dist/derivations.js +137 -4
- package/dist/derivations.js.map +1 -1
- package/dist/derivations.mjs +136 -5
- package/dist/derivations.mjs.map +1 -1
- package/dist/formatQuery.d.mts +1 -1
- package/dist/formatQuery.d.ts +1 -1
- package/dist/formatQuery.js +7 -4
- package/dist/formatQuery.js.map +1 -1
- package/dist/formatQuery.mjs +7 -4
- package/dist/formatQuery.mjs.map +1 -1
- package/dist/{import-BfZTwhp2.d.ts → import-BCkipOTY.d.ts} +2 -2
- package/dist/{import-BdKPtLzo.d.mts → import-C9el4B_K.d.mts} +2 -2
- package/dist/{index-DOIE2pwx.d.ts → index-BExDPYEG.d.mts} +10 -8
- package/dist/{index-DOIE2pwx.d.mts → index-BExDPYEG.d.ts} +10 -8
- package/dist/{index-XueTy_XQ.d.ts → index-icv8DBhg.d.mts} +5 -3
- package/dist/{index-OF2Q1gTp.d.mts → index-yXGVO31H.d.ts} +5 -3
- package/dist/parseCEL.d.mts +112 -112
- package/dist/parseCEL.d.ts +112 -112
- package/dist/parseCEL.js +4 -4
- package/dist/parseCEL.js.map +1 -1
- package/dist/parseCEL.mjs +4 -4
- package/dist/parseCEL.mjs.map +1 -1
- package/dist/parseCypher.d.mts +8 -8
- package/dist/parseCypher.d.ts +8 -8
- package/dist/parseGremlin.d.mts +5 -5
- package/dist/parseGremlin.d.ts +5 -5
- package/dist/parseJSONata.d.mts +39 -39
- package/dist/parseJSONata.d.ts +39 -39
- package/dist/parseJSONata.js +2 -2
- package/dist/parseJSONata.mjs +2 -2
- package/dist/parseJsonLogic.d.mts +10 -10
- package/dist/parseJsonLogic.d.ts +10 -10
- package/dist/parseJsonLogic.js +3 -3
- package/dist/parseJsonLogic.mjs +3 -3
- package/dist/parseMongoDB.d.mts +9 -9
- package/dist/parseMongoDB.d.ts +9 -9
- package/dist/parseMongoDB.js +3 -3
- package/dist/parseMongoDB.mjs +3 -3
- package/dist/parseSPARQL.d.mts +5 -5
- package/dist/parseSPARQL.d.ts +5 -5
- package/dist/parseSQL.d.mts +63 -63
- package/dist/parseSQL.d.ts +63 -63
- package/dist/parseSQL.js +4 -4
- package/dist/parseSQL.js.map +1 -1
- package/dist/parseSQL.mjs +4 -4
- package/dist/parseSQL.mjs.map +1 -1
- package/dist/parseSpEL.d.mts +57 -57
- package/dist/parseSpEL.d.ts +57 -57
- package/dist/parseSpEL.js +3 -3
- package/dist/parseSpEL.mjs +3 -3
- package/dist/{parserUtils-DbBXyAht.js → parserUtils-2VtG7m8L.js} +3 -3
- package/dist/{parserUtils-DbBXyAht.js.map → parserUtils-2VtG7m8L.js.map} +1 -1
- package/dist/{parserUtils-BKPstAaO.mjs → parserUtils-BlafvoFb.mjs} +3 -3
- package/dist/{parserUtils-BKPstAaO.mjs.map → parserUtils-BlafvoFb.mjs.map} +1 -1
- package/dist/{prepareQueryObjects-Dj9cTl9D.js → prepareQueryObjects-DJ_VjOLb.js} +2 -2
- package/dist/{prepareQueryObjects-Dj9cTl9D.js.map → prepareQueryObjects-DJ_VjOLb.js.map} +1 -1
- package/dist/{prepareQueryObjects-Dmyf3Wi_.mjs → prepareQueryObjects-DawsH4e3.mjs} +2 -2
- package/dist/{prepareQueryObjects-Dmyf3Wi_.mjs.map → prepareQueryObjects-DawsH4e3.mjs.map} +1 -1
- package/dist/react-querybuilder_core.d.mts +516 -455
- package/dist/react-querybuilder_core.legacy-esm.d.ts +516 -455
- package/dist/react-querybuilder_core.legacy-esm.js +172 -14
- package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_core.mjs +168 -7
- package/dist/react-querybuilder_core.mjs.map +1 -1
- package/dist/react-querybuilder_core.production.d.mts +516 -455
- package/dist/react-querybuilder_core.production.mjs +74 -1
- package/dist/react-querybuilder_core.production.mjs.map +1 -1
- package/dist/{transformQuery-B7d9AWUf.d.mts → transformQuery-B6PRLRkS.d.mts} +2 -2
- package/dist/{transformQuery-BXDiUBGB.d.ts → transformQuery-DVjJZXnB.d.ts} +2 -2
- package/dist/transformQuery.d.mts +1 -1
- package/dist/transformQuery.d.ts +1 -1
- package/dist/{utils-e-7KHkjV.js → utils-B4E1-ZvU.js} +12 -2
- package/dist/utils-B4E1-ZvU.js.map +1 -0
- package/dist/{utils-CP5Jqy1P.mjs → utils-DLZCoyAh.mjs} +12 -2
- package/dist/utils-DLZCoyAh.mjs.map +1 -0
- package/package.json +20 -19
- package/dist/utils-CP5Jqy1P.mjs.map +0 -1
- package/dist/utils-e-7KHkjV.js.map +0 -1
|
@@ -18,13 +18,13 @@ import { JsonLogicAll, JsonLogicAnd, JsonLogicDoubleNegation, JsonLogicEqual, Js
|
|
|
18
18
|
*
|
|
19
19
|
* @group Props
|
|
20
20
|
*/
|
|
21
|
-
declare const controlKeys: readonly ["actionElement", "addGroupAction", "addRuleAction", "cloneGroupAction", "cloneRuleAction", "combinatorSelector", "dragHandle", "fieldSelector", "inlineCombinator", "lockGroupAction", "lockRuleAction", "matchModeEditor", "muteGroupAction", "muteRuleAction", "notToggle", "operatorSelector", "removeGroupAction", "removeRuleAction", "rule", "ruleGroup", "ruleGroupBodyElements", "ruleGroupHeaderElements", "shiftActions", "undoRedoActions", "valueEditor", "valueSelector", "valueSourceSelector"];
|
|
21
|
+
export declare const controlKeys: readonly ["actionElement", "addGroupAction", "addRuleAction", "cloneGroupAction", "cloneRuleAction", "combinatorSelector", "dragHandle", "fieldSelector", "inlineCombinator", "lockGroupAction", "lockRuleAction", "matchModeEditor", "muteGroupAction", "muteRuleAction", "notToggle", "operatorSelector", "removeGroupAction", "removeRuleAction", "rule", "ruleGroup", "ruleGroupBodyElements", "ruleGroupHeaderElements", "shiftActions", "undoRedoActions", "ungroupAction", "valueEditor", "valueSelector", "valueSourceSelector"];
|
|
22
22
|
/**
|
|
23
23
|
* The name of a query builder control.
|
|
24
24
|
*
|
|
25
25
|
* @group Props
|
|
26
26
|
*/
|
|
27
|
-
type ControlKey = (typeof controlKeys)[number];
|
|
27
|
+
export type ControlKey = (typeof controlKeys)[number];
|
|
28
28
|
/**
|
|
29
29
|
* The full set of prop names each default control receives. Ports can use this to declare
|
|
30
30
|
* every prop explicitly instead of relying on fall-through/attribute inheritance.
|
|
@@ -37,7 +37,7 @@ type ControlKey = (typeof controlKeys)[number];
|
|
|
37
37
|
*
|
|
38
38
|
* @group Props
|
|
39
39
|
*/
|
|
40
|
-
declare const controlPropKeys: {
|
|
40
|
+
export declare const controlPropKeys: {
|
|
41
41
|
readonly actionElement: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
|
|
42
42
|
readonly addGroupAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
|
|
43
43
|
readonly addRuleAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
|
|
@@ -58,10 +58,11 @@ declare const controlPropKeys: {
|
|
|
58
58
|
readonly removeRuleAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
|
|
59
59
|
readonly rule: readonly ["actions", "context", "disabled", "dndRef", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "field", "groupItems", "id", "isDragging", "isOver", "operator", "parentDisabled", "parentMuted", "path", "rule", "schema", "shiftDownDisabled", "shiftUpDisabled", "translations", "value", "valueSource"];
|
|
60
60
|
readonly ruleGroup: readonly ["actions", "combinator", "context", "disabled", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "dropRef", "groupItems", "id", "isDragging", "isOver", "not", "parentDisabled", "parentMuted", "path", "previewRef", "ruleGroup", "rules", "schema", "shiftDownDisabled", "shiftUpDisabled", "translations"];
|
|
61
|
-
readonly ruleGroupBodyElements: readonly ["accessibleDescription", "actions", "addGroup", "addRule", "classNames", "cloneGroup", "combinator", "context", "disabled", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "dropRef", "groupItems", "id", "isDragging", "isOver", "muted", "not", "onCombinatorChange", "onGroupAdd", "onIndependentCombinatorChange", "onNotToggleChange", "outerClassName", "parentDisabled", "parentMuted", "path", "pathsMemo", "previewRef", "removeGroup", "ruleGroup", "rules", "schema", "shiftDownDisabled", "shiftGroupDown", "shiftGroupUp", "shiftUpDisabled", "toggleLockGroup", "toggleMuteGroup", "translations", "validationClassName", "validationResult"];
|
|
62
|
-
readonly ruleGroupHeaderElements: readonly ["accessibleDescription", "actions", "addGroup", "addRule", "classNames", "cloneGroup", "combinator", "context", "disabled", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "dropRef", "groupItems", "id", "isDragging", "isOver", "muted", "not", "onCombinatorChange", "onGroupAdd", "onIndependentCombinatorChange", "onNotToggleChange", "outerClassName", "parentDisabled", "parentMuted", "path", "pathsMemo", "previewRef", "removeGroup", "ruleGroup", "rules", "schema", "shiftDownDisabled", "shiftGroupDown", "shiftGroupUp", "shiftUpDisabled", "toggleLockGroup", "toggleMuteGroup", "translations", "validationClassName", "validationResult"];
|
|
61
|
+
readonly ruleGroupBodyElements: readonly ["accessibleDescription", "actions", "addGroup", "addRule", "classNames", "cloneGroup", "combinator", "context", "disabled", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "dropRef", "groupItems", "id", "isDragging", "isOver", "muted", "not", "onCombinatorChange", "onGroupAdd", "onIndependentCombinatorChange", "onNotToggleChange", "outerClassName", "parentDisabled", "parentMuted", "path", "pathsMemo", "previewRef", "removeGroup", "ruleGroup", "rules", "schema", "shiftDownDisabled", "shiftGroupDown", "shiftGroupUp", "shiftUpDisabled", "toggleLockGroup", "toggleMuteGroup", "translations", "ungroup", "validationClassName", "validationResult"];
|
|
62
|
+
readonly ruleGroupHeaderElements: readonly ["accessibleDescription", "actions", "addGroup", "addRule", "classNames", "cloneGroup", "combinator", "context", "disabled", "dragHandleAttributes", "dragMonitorId", "dragRef", "dropEffect", "dropMonitorId", "dropNotAllowed", "dropRef", "groupItems", "id", "isDragging", "isOver", "muted", "not", "onCombinatorChange", "onGroupAdd", "onIndependentCombinatorChange", "onNotToggleChange", "outerClassName", "parentDisabled", "parentMuted", "path", "pathsMemo", "previewRef", "removeGroup", "ruleGroup", "rules", "schema", "shiftDownDisabled", "shiftGroupDown", "shiftGroupUp", "shiftUpDisabled", "toggleLockGroup", "toggleMuteGroup", "translations", "ungroup", "validationClassName", "validationResult"];
|
|
63
63
|
readonly shiftActions: readonly ["className", "context", "disabled", "labels", "level", "path", "ruleOrGroup", "schema", "shiftDown", "shiftDownDisabled", "shiftUp", "shiftUpDisabled", "testID", "title", "titles", "validation"];
|
|
64
64
|
readonly undoRedoActions: readonly ["className", "classNames", "context", "disabled", "labels", "level", "path", "ruleOrGroup", "schema", "testID", "title", "titles", "validation"];
|
|
65
|
+
readonly ungroupAction: readonly ["className", "context", "disabled", "disabledTranslation", "handleOnClick", "label", "level", "path", "ruleOrGroup", "rules", "schema", "testID", "title", "validation"];
|
|
65
66
|
readonly valueEditor: readonly ["className", "context", "disabled", "field", "fieldData", "handleOnChange", "inputType", "level", "listsAsArrays", "operator", "parseNumbers", "path", "rule", "schema", "selectorComponent", "separator", "skipHook", "testID", "title", "type", "validation", "value", "valueSource", "values"];
|
|
66
67
|
readonly valueSelector: readonly ["className", "context", "disabled", "handleOnChange", "level", "listsAsArrays", "multiple", "options", "path", "schema", "testID", "title", "validation", "value"];
|
|
67
68
|
readonly valueSourceSelector: readonly ["className", "context", "disabled", "field", "fieldData", "handleOnChange", "level", "options", "path", "rule", "schema", "testID", "title", "validation", "value"];
|
|
@@ -81,7 +82,7 @@ declare const controlPropKeys: {
|
|
|
81
82
|
*
|
|
82
83
|
* @group Props
|
|
83
84
|
*/
|
|
84
|
-
declare const controlKind: {
|
|
85
|
+
export declare const controlKind: {
|
|
85
86
|
readonly actionElement: null;
|
|
86
87
|
readonly addGroupAction: "action";
|
|
87
88
|
readonly addRuleAction: "action";
|
|
@@ -106,6 +107,7 @@ declare const controlKind: {
|
|
|
106
107
|
readonly ruleGroupHeaderElements: null;
|
|
107
108
|
readonly shiftActions: null;
|
|
108
109
|
readonly undoRedoActions: null;
|
|
110
|
+
readonly ungroupAction: "action";
|
|
109
111
|
readonly valueEditor: null;
|
|
110
112
|
readonly valueSelector: null;
|
|
111
113
|
readonly valueSourceSelector: "selector";
|
|
@@ -1237,38 +1239,40 @@ Required<HomomorphicPick<BaseType, Keys>>>;
|
|
|
1237
1239
|
Remove the optional modifier from the specified keys in an array.
|
|
1238
1240
|
*/
|
|
1239
1241
|
type SetArrayRequired<TArray extends UnknownArray, Keys, Counter extends any[] = [], Accumulator extends UnknownArray = []> = TArray extends unknown // For distributing `TArray` when it's a union
|
|
1240
|
-
? keyof TArray
|
|
1241
|
-
//
|
|
1242
|
-
// `
|
|
1243
|
-
[
|
|
1244
|
-
? `${Counter['length']}` extends `${Keys & (string | number)}` // If the current index needs to be required
|
|
1242
|
+
? '0' extends keyof TArray ? TArray extends readonly [(infer First)?, ...infer Rest] ?
|
|
1243
|
+
// A tuple allows fewer than one element only when its first element is optional. Written in exactly this shape because equivalent ones, such as `[] extends TArray`, are several times slower.
|
|
1244
|
+
// Unlike the other array loops, this one has no `any` guard above it, so the check is wrapped in tuples to stop `any` from matching both branches.
|
|
1245
|
+
[TArray] extends [readonly [unknown, ...unknown[]]] ? SetArrayRequired<Rest, Keys, [...Counter, any], [...Accumulator, First]> : `${Counter['length']}` extends `${Keys & (string | number)}` // If the current index needs to be required
|
|
1245
1246
|
? SetArrayRequired<Rest, Keys, [...Counter, any], [...Accumulator, First]> :
|
|
1246
1247
|
// If the current element is optional, but it doesn't need to be required,
|
|
1247
1248
|
// then we can exit early, since no further elements can now be made required.
|
|
1248
|
-
[...Accumulator, ...TArray] :
|
|
1249
|
-
:
|
|
1249
|
+
[...Accumulator, ...TArray] : never // Should never happen, since `[(infer F)?, ...infer R]` is a top-type for arrays.
|
|
1250
|
+
:
|
|
1251
|
+
// Exit if `TArray` is empty (e.g., []), or
|
|
1252
|
+
// `TArray` contains no non-rest elements preceding the rest element (e.g., `[...string[]]` or `[...string[], string]`).
|
|
1253
|
+
[...Accumulator, ...TArray] : never; // Should never happen
|
|
1250
1254
|
//#endregion
|
|
1251
1255
|
//#region src/types/options.d.ts
|
|
1252
1256
|
type RequireAtLeastOne<O, K extends keyof O> = { [P in K]-?: Required<Pick<O, P>> & Partial<Pick<O, Exclude<K, P>>>; }[K] & Except<O, K>;
|
|
1253
|
-
type StringUnionToFlexibleOptionArray<Op extends string> = Array<Op extends unknown ? FlexibleOption<Op> : never>;
|
|
1254
|
-
type StringUnionToFullOptionArray<Op extends string> = Array<Op extends unknown ? FullOption<Op> : never>;
|
|
1257
|
+
export type StringUnionToFlexibleOptionArray<Op extends string> = Array<Op extends unknown ? FlexibleOption<Op> : never>;
|
|
1258
|
+
export type StringUnionToFullOptionArray<Op extends string> = Array<Op extends unknown ? FullOption<Op> : never>;
|
|
1255
1259
|
/**
|
|
1256
1260
|
* Extracts the {@link Option} type from a {@link FlexibleOptionList}.
|
|
1257
1261
|
*
|
|
1258
1262
|
* @group Option Lists
|
|
1259
1263
|
*/
|
|
1260
|
-
type GetOptionType<OL extends FlexibleOptionList<FullOption>> = OL extends FlexibleOptionList<infer Opt> ? Opt : never;
|
|
1264
|
+
export type GetOptionType<OL extends FlexibleOptionList<FullOption>> = OL extends FlexibleOptionList<infer Opt> ? Opt : never;
|
|
1261
1265
|
/**
|
|
1262
1266
|
* Extracts the type of the identifying property from a {@link Option},
|
|
1263
1267
|
* {@link ValueOption}, or {@link FullOption}.
|
|
1264
1268
|
*
|
|
1265
1269
|
* @group Option Lists
|
|
1266
1270
|
*/
|
|
1267
|
-
type GetOptionIdentifierType<Opt extends BaseOption> = Opt extends Option<infer NameType> | ValueOption<infer NameType> ? NameType : string;
|
|
1271
|
+
export type GetOptionIdentifierType<Opt extends BaseOption> = Opt extends Option<infer NameType> | ValueOption<infer NameType> ? NameType : string;
|
|
1268
1272
|
/**
|
|
1269
1273
|
* Adds an `unknown` index property to an interface.
|
|
1270
1274
|
*/
|
|
1271
|
-
type WithUnknownIndex<T> = T & {
|
|
1275
|
+
export type WithUnknownIndex<T> = T & {
|
|
1272
1276
|
[key: string]: unknown;
|
|
1273
1277
|
};
|
|
1274
1278
|
/**
|
|
@@ -1279,7 +1283,7 @@ type WithUnknownIndex<T> = T & {
|
|
|
1279
1283
|
*
|
|
1280
1284
|
* @group Option Lists
|
|
1281
1285
|
*/
|
|
1282
|
-
interface BaseOption<N extends string = string> {
|
|
1286
|
+
export interface BaseOption<N extends string = string> {
|
|
1283
1287
|
name?: N;
|
|
1284
1288
|
value?: N;
|
|
1285
1289
|
label: string;
|
|
@@ -1291,13 +1295,13 @@ interface BaseOption<N extends string = string> {
|
|
|
1291
1295
|
*
|
|
1292
1296
|
* @group Option Lists
|
|
1293
1297
|
*/
|
|
1294
|
-
type Option<N extends string = string> = Simplify<WithUnknownIndex<SetRequired<BaseOption<N>, "name">>>;
|
|
1298
|
+
export type Option<N extends string = string> = Simplify<WithUnknownIndex<SetRequired<BaseOption<N>, "name">>>;
|
|
1295
1299
|
/**
|
|
1296
1300
|
* Like {@link Option} but requiring `value` instead of `name`.
|
|
1297
1301
|
*
|
|
1298
1302
|
* @group Option Lists
|
|
1299
1303
|
*/
|
|
1300
|
-
type ValueOption<N extends string = string> = Simplify<WithUnknownIndex<SetRequired<BaseOption<N>, "value">>>;
|
|
1304
|
+
export type ValueOption<N extends string = string> = Simplify<WithUnknownIndex<SetRequired<BaseOption<N>, "value">>>;
|
|
1301
1305
|
/**
|
|
1302
1306
|
* A generic {@link Option} with either a `name` or `value` as its primary identifier.
|
|
1303
1307
|
* {@link OptionList}-type props on the {@link react-querybuilder!QueryBuilder QueryBuilder} component accept this type,
|
|
@@ -1306,14 +1310,14 @@ type ValueOption<N extends string = string> = Simplify<WithUnknownIndex<SetRequi
|
|
|
1306
1310
|
*
|
|
1307
1311
|
* @group Option Lists
|
|
1308
1312
|
*/
|
|
1309
|
-
type FlexibleOption<N extends string = string> = Simplify<WithUnknownIndex<RequireAtLeastOne<BaseOption<N>, "name" | "value">>>;
|
|
1313
|
+
export type FlexibleOption<N extends string = string> = Simplify<WithUnknownIndex<RequireAtLeastOne<BaseOption<N>, "name" | "value">>>;
|
|
1310
1314
|
/**
|
|
1311
1315
|
* Utility type to turn an {@link Option}, {@link ValueOption}, or {@link BaseOption}
|
|
1312
1316
|
* into a {@link FlexibleOption}.
|
|
1313
1317
|
*
|
|
1314
1318
|
* @group Option Lists
|
|
1315
1319
|
*/
|
|
1316
|
-
type ToFlexibleOption<Opt extends BaseOption | string> = WithUnknownIndex<RequireAtLeastOne<Opt extends string ? FlexibleOption<Opt> : Opt, "name" | "value">>;
|
|
1320
|
+
export type ToFlexibleOption<Opt extends BaseOption | string> = WithUnknownIndex<RequireAtLeastOne<Opt extends string ? FlexibleOption<Opt> : Opt, "name" | "value">>;
|
|
1317
1321
|
/**
|
|
1318
1322
|
* A generic {@link Option} requiring both `name` _and_ `value` properties.
|
|
1319
1323
|
* Props that extend {@link OptionList} accept {@link BaseOption}, but
|
|
@@ -1327,33 +1331,33 @@ type ToFlexibleOption<Opt extends BaseOption | string> = WithUnknownIndex<Requir
|
|
|
1327
1331
|
*
|
|
1328
1332
|
* @group Option Lists
|
|
1329
1333
|
*/
|
|
1330
|
-
type FullOption<N extends string = string> = Simplify<WithUnknownIndex<SetRequired<BaseOption<N>, "name" | "value">>>;
|
|
1334
|
+
export type FullOption<N extends string = string> = Simplify<WithUnknownIndex<SetRequired<BaseOption<N>, "name" | "value">>>;
|
|
1331
1335
|
/**
|
|
1332
1336
|
* This type is identical to {@link FullOption} but without the `unknown` index
|
|
1333
1337
|
* property. Extend from this type instead of {@link FullOption} directly.
|
|
1334
1338
|
*
|
|
1335
1339
|
* @group Option Lists
|
|
1336
1340
|
*/
|
|
1337
|
-
type BaseFullOption<N extends string = string> = Simplify<SetRequired<BaseOption<N>, "name" | "value">>;
|
|
1341
|
+
export type BaseFullOption<N extends string = string> = Simplify<SetRequired<BaseOption<N>, "name" | "value">>;
|
|
1338
1342
|
/**
|
|
1339
1343
|
* Utility type to turn an {@link Option}, {@link ValueOption} or
|
|
1340
1344
|
* {@link BaseOption} into a {@link FullOption}.
|
|
1341
1345
|
*
|
|
1342
1346
|
* @group Option Lists
|
|
1343
1347
|
*/
|
|
1344
|
-
type ToFullOption<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt : Opt extends BaseOption<infer IdentifierType> ? WithUnknownIndex<Opt & FullOption<IdentifierType>> : never;
|
|
1348
|
+
export type ToFullOption<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt : Opt extends BaseOption<infer IdentifierType> ? WithUnknownIndex<Opt & FullOption<IdentifierType>> : never;
|
|
1345
1349
|
/**
|
|
1346
1350
|
* @deprecated Renamed to {@link Option}.
|
|
1347
1351
|
*
|
|
1348
1352
|
* @group Option Lists
|
|
1349
1353
|
*/
|
|
1350
|
-
type NameLabelPair<N extends string = string> = Option<N>;
|
|
1354
|
+
export type NameLabelPair<N extends string = string> = Option<N>;
|
|
1351
1355
|
/**
|
|
1352
1356
|
* A group of {@link Option}s, usually within an {@link OptionList}.
|
|
1353
1357
|
*
|
|
1354
1358
|
* @group Option Lists
|
|
1355
1359
|
*/
|
|
1356
|
-
interface OptionGroup<Opt extends BaseOption = FlexibleOption> {
|
|
1360
|
+
export interface OptionGroup<Opt extends BaseOption = FlexibleOption> {
|
|
1357
1361
|
label: string;
|
|
1358
1362
|
options: WithUnknownIndex<Opt>[];
|
|
1359
1363
|
}
|
|
@@ -1362,7 +1366,7 @@ interface OptionGroup<Opt extends BaseOption = FlexibleOption> {
|
|
|
1362
1366
|
*
|
|
1363
1367
|
* @group Option Lists
|
|
1364
1368
|
*/
|
|
1365
|
-
type FlexibleOptionGroup<Opt extends BaseOption | string = BaseOption> = {
|
|
1369
|
+
export type FlexibleOptionGroup<Opt extends BaseOption | string = BaseOption> = {
|
|
1366
1370
|
label: string;
|
|
1367
1371
|
options: (Opt extends BaseFullOption ? Opt : ToFlexibleOption<Opt>)[];
|
|
1368
1372
|
};
|
|
@@ -1371,21 +1375,21 @@ type FlexibleOptionGroup<Opt extends BaseOption | string = BaseOption> = {
|
|
|
1371
1375
|
*
|
|
1372
1376
|
* @group Option Lists
|
|
1373
1377
|
*/
|
|
1374
|
-
type OptionList<Opt extends Option = Option> = Opt[] | OptionGroup<Opt>[];
|
|
1378
|
+
export type OptionList<Opt extends Option = Option> = Opt[] | OptionGroup<Opt>[];
|
|
1375
1379
|
/**
|
|
1376
1380
|
* An array of options or option groups, like {@link OptionList} but the option type
|
|
1377
1381
|
* may use either `name` or `value` as the primary identifier.
|
|
1378
1382
|
*
|
|
1379
1383
|
* @group Option Lists
|
|
1380
1384
|
*/
|
|
1381
|
-
type FlexibleOptionList<Opt extends BaseOption> = ToFlexibleOption<Opt>[] | FlexibleOptionGroup<ToFlexibleOption<Opt>>[];
|
|
1385
|
+
export type FlexibleOptionList<Opt extends BaseOption> = ToFlexibleOption<Opt>[] | FlexibleOptionGroup<ToFlexibleOption<Opt>>[];
|
|
1382
1386
|
/**
|
|
1383
1387
|
* An array of options or option groups, like {@link OptionList} but the option type
|
|
1384
1388
|
* may use either `name` or `value` as the primary identifier.
|
|
1385
1389
|
*
|
|
1386
1390
|
* @group Option Lists
|
|
1387
1391
|
*/
|
|
1388
|
-
type FlexibleOptionListProp<Opt extends BaseOption> = (ToFlexibleOption<Opt> | GetOptionIdentifierType<Opt>)[] | FlexibleOptionGroup<ToFlexibleOption<Opt> | GetOptionIdentifierType<Opt>>[];
|
|
1392
|
+
export type FlexibleOptionListProp<Opt extends BaseOption> = (ToFlexibleOption<Opt> | GetOptionIdentifierType<Opt>)[] | FlexibleOptionGroup<ToFlexibleOption<Opt> | GetOptionIdentifierType<Opt>>[];
|
|
1389
1393
|
/**
|
|
1390
1394
|
* An array of options or option groups, like {@link OptionList}, but using
|
|
1391
1395
|
* {@link FullOption} instead of {@link Option}. This means that every member is
|
|
@@ -1393,26 +1397,26 @@ type FlexibleOptionListProp<Opt extends BaseOption> = (ToFlexibleOption<Opt> | G
|
|
|
1393
1397
|
*
|
|
1394
1398
|
* @group Option Lists
|
|
1395
1399
|
*/
|
|
1396
|
-
type FullOptionList<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt[] | OptionGroup<Opt>[] : ToFullOption<Opt>[] | OptionGroup<ToFullOption<Opt>>[];
|
|
1400
|
+
export type FullOptionList<Opt extends BaseOption> = Opt extends BaseFullOption ? Opt[] | OptionGroup<Opt>[] : ToFullOption<Opt>[] | OptionGroup<ToFullOption<Opt>>[];
|
|
1397
1401
|
/**
|
|
1398
1402
|
* Map of option identifiers to their respective {@link Option}.
|
|
1399
1403
|
*
|
|
1400
1404
|
* @group Option Lists
|
|
1401
1405
|
*/
|
|
1402
|
-
type BaseOptionMap<V extends BaseOption = BaseOption, K extends string = GetOptionIdentifierType<V>> = { [k in K]?: ToFlexibleOption<V>; };
|
|
1406
|
+
export type BaseOptionMap<V extends BaseOption = BaseOption, K extends string = GetOptionIdentifierType<V>> = { [k in K]?: ToFlexibleOption<V>; };
|
|
1403
1407
|
/**
|
|
1404
1408
|
* Map of option identifiers to their respective {@link FullOption}.
|
|
1405
1409
|
*
|
|
1406
1410
|
* @group Option Lists
|
|
1407
1411
|
*/
|
|
1408
|
-
type FullOptionMap<V extends BaseFullOption, K extends string = GetOptionIdentifierType<V>> = { [k in K]?: V; };
|
|
1412
|
+
export type FullOptionMap<V extends BaseFullOption, K extends string = GetOptionIdentifierType<V>> = { [k in K]?: V; };
|
|
1409
1413
|
/**
|
|
1410
1414
|
* Map of option identifiers to their respective {@link FullOption}.
|
|
1411
1415
|
* Must include all possible strings from the identifier type.
|
|
1412
1416
|
*
|
|
1413
1417
|
* @group Option Lists
|
|
1414
1418
|
*/
|
|
1415
|
-
type FullOptionRecord<V extends BaseFullOption, K extends string = GetOptionIdentifierType<V>> = Record<K, V>;
|
|
1419
|
+
export type FullOptionRecord<V extends BaseFullOption, K extends string = GetOptionIdentifierType<V>> = Record<K, V>;
|
|
1416
1420
|
//#endregion
|
|
1417
1421
|
//#region src/types/expression.d.ts
|
|
1418
1422
|
/**
|
|
@@ -1424,7 +1428,7 @@ type FullOptionRecord<V extends BaseFullOption, K extends string = GetOptionIden
|
|
|
1424
1428
|
* {@link RuleType.lhs} and, for the right-hand side, in `value` when `valueSource` is
|
|
1425
1429
|
* `"expression"`) but does not interpret them.
|
|
1426
1430
|
*/
|
|
1427
|
-
type ExpressionNode = {
|
|
1431
|
+
export type ExpressionNode = {
|
|
1428
1432
|
kind: "field";
|
|
1429
1433
|
field: string;
|
|
1430
1434
|
} | {
|
|
@@ -1444,7 +1448,7 @@ type ExpressionNode = {
|
|
|
1444
1448
|
/**
|
|
1445
1449
|
* Properties common to both rules and groups.
|
|
1446
1450
|
*/
|
|
1447
|
-
interface CommonRuleAndGroupProperties {
|
|
1451
|
+
export interface CommonRuleAndGroupProperties {
|
|
1448
1452
|
path?: Path;
|
|
1449
1453
|
id?: string;
|
|
1450
1454
|
disabled?: boolean;
|
|
@@ -1459,7 +1463,7 @@ interface CommonRuleAndGroupProperties {
|
|
|
1459
1463
|
* The main rule type. The `field`, `operator`, and `value` properties
|
|
1460
1464
|
* can be narrowed with generics.
|
|
1461
1465
|
*/
|
|
1462
|
-
interface RuleType<F extends string = string, O extends string = string, V = any, C extends string = string, M = Record<string, any>> extends CommonRuleAndGroupProperties {
|
|
1466
|
+
export interface RuleType<F extends string = string, O extends string = string, V = any, C extends string = string, M = Record<string, any>> extends CommonRuleAndGroupProperties {
|
|
1463
1467
|
field: F;
|
|
1464
1468
|
operator: O;
|
|
1465
1469
|
value: V;
|
|
@@ -1484,7 +1488,7 @@ interface RuleType<F extends string = string, O extends string = string, V = any
|
|
|
1484
1488
|
* The main rule group type. This type is used for query definitions as well as
|
|
1485
1489
|
* all sub-groups of queries.
|
|
1486
1490
|
*/
|
|
1487
|
-
interface RuleGroupType<R extends RuleType = RuleType, C extends string = string> extends CommonRuleAndGroupProperties {
|
|
1491
|
+
export interface RuleGroupType<R extends RuleType = RuleType, C extends string = string> extends CommonRuleAndGroupProperties {
|
|
1488
1492
|
combinator: C;
|
|
1489
1493
|
rules: RuleGroupArray<RuleGroupType<R, C>, R>;
|
|
1490
1494
|
not?: boolean;
|
|
@@ -1492,68 +1496,68 @@ interface RuleGroupType<R extends RuleType = RuleType, C extends string = string
|
|
|
1492
1496
|
/**
|
|
1493
1497
|
* The type of the `rules` array in a {@link RuleGroupType}.
|
|
1494
1498
|
*/
|
|
1495
|
-
type RuleGroupArray<RG extends RuleGroupType = RuleGroupType, R extends RuleType = RuleType> = (R | RG)[];
|
|
1499
|
+
export type RuleGroupArray<RG extends RuleGroupType = RuleGroupType, R extends RuleType = RuleType> = (R | RG)[];
|
|
1496
1500
|
/**
|
|
1497
1501
|
* All updateable properties of rules and groups (everything except
|
|
1498
1502
|
* `id`, `path`, and `rules`).
|
|
1499
1503
|
*/
|
|
1500
|
-
type UpdateableProperties = Exclude<keyof (RuleType & RuleGroupType), "id" | "path" | "rules"> | (string & {});
|
|
1504
|
+
export type UpdateableProperties = Exclude<keyof (RuleType & RuleGroupType), "id" | "path" | "rules"> | (string & {});
|
|
1501
1505
|
/**
|
|
1502
1506
|
* A map of {@link UpdateableProperties} to their new values, for updating
|
|
1503
1507
|
* multiple properties of a rule or group in a single operation.
|
|
1504
1508
|
*/
|
|
1505
|
-
type UpdateValueMap = Partial<Record<UpdateableProperties, any>>;
|
|
1509
|
+
export type UpdateValueMap = Partial<Record<UpdateableProperties, any>>;
|
|
1506
1510
|
/**
|
|
1507
1511
|
* The type of the `rules` array in a {@link DefaultRuleGroupType}.
|
|
1508
1512
|
*/
|
|
1509
|
-
type DefaultRuleGroupArray<F extends string = string> = RuleGroupArray<DefaultRuleGroupType, DefaultRuleType<F>>;
|
|
1513
|
+
export type DefaultRuleGroupArray<F extends string = string> = RuleGroupArray<DefaultRuleGroupType, DefaultRuleType<F>>;
|
|
1510
1514
|
/**
|
|
1511
1515
|
* {@link RuleGroupType} with the `combinator` property limited to
|
|
1512
1516
|
* {@link DefaultCombinatorNameExtended} and `rules` limited to {@link DefaultRuleType}.
|
|
1513
1517
|
*/
|
|
1514
|
-
type DefaultRuleGroupType<F extends string = string> = RuleGroupType<DefaultRuleType<F>, DefaultCombinatorNameExtended> & {
|
|
1518
|
+
export type DefaultRuleGroupType<F extends string = string> = RuleGroupType<DefaultRuleType<F>, DefaultCombinatorNameExtended> & {
|
|
1515
1519
|
rules: DefaultRuleGroupArray<F>;
|
|
1516
1520
|
};
|
|
1517
1521
|
/**
|
|
1518
1522
|
* {@link RuleType} with the `operator` property limited to {@link DefaultOperatorName}.
|
|
1519
1523
|
*/
|
|
1520
|
-
type DefaultRuleType<F extends string = string> = RuleType<F, DefaultOperatorName>;
|
|
1524
|
+
export type DefaultRuleType<F extends string = string> = RuleType<F, DefaultOperatorName>;
|
|
1521
1525
|
/**
|
|
1522
1526
|
* Default allowed values for the `combinator` property.
|
|
1523
1527
|
*
|
|
1524
1528
|
* @group Option Lists
|
|
1525
1529
|
*/
|
|
1526
|
-
type DefaultCombinatorName = "and" | "or";
|
|
1530
|
+
export type DefaultCombinatorName = "and" | "or";
|
|
1527
1531
|
/**
|
|
1528
1532
|
* Default allowed values for the `combinator` property, plus `"xor"`.
|
|
1529
1533
|
*
|
|
1530
1534
|
* @group Option Lists
|
|
1531
1535
|
*/
|
|
1532
|
-
type DefaultCombinatorNameExtended = DefaultCombinatorName | "xor";
|
|
1536
|
+
export type DefaultCombinatorNameExtended = DefaultCombinatorName | "xor";
|
|
1533
1537
|
/**
|
|
1534
1538
|
* Default values for the `operator` property.
|
|
1535
1539
|
*
|
|
1536
1540
|
* @group Option Lists
|
|
1537
1541
|
*/
|
|
1538
|
-
type DefaultOperatorName = "=" | "!=" | "<" | ">" | "<=" | ">=" | "contains" | "beginsWith" | "endsWith" | "doesNotContain" | "doesNotBeginWith" | "doesNotEndWith" | "null" | "notNull" | "in" | "notIn" | "between" | "notBetween";
|
|
1542
|
+
export type DefaultOperatorName = "=" | "!=" | "<" | ">" | "<=" | ">=" | "contains" | "beginsWith" | "endsWith" | "doesNotContain" | "doesNotBeginWith" | "doesNotEndWith" | "null" | "notNull" | "in" | "notIn" | "between" | "notBetween";
|
|
1539
1543
|
/**
|
|
1540
1544
|
* A {@link FullCombinator} definition with a {@link DefaultCombinatorName} `name` property.
|
|
1541
1545
|
*
|
|
1542
1546
|
* @group Option Lists
|
|
1543
1547
|
*/
|
|
1544
|
-
type DefaultCombinator = FullCombinator<DefaultCombinatorName>;
|
|
1548
|
+
export type DefaultCombinator = FullCombinator<DefaultCombinatorName>;
|
|
1545
1549
|
/**
|
|
1546
1550
|
* A {@link FullCombinator} definition with a {@link DefaultCombinatorNameExtended} `name` property.
|
|
1547
1551
|
*
|
|
1548
1552
|
* @group Option Lists
|
|
1549
1553
|
*/
|
|
1550
|
-
type DefaultCombinatorExtended = FullCombinator<DefaultCombinatorNameExtended>;
|
|
1554
|
+
export type DefaultCombinatorExtended = FullCombinator<DefaultCombinatorNameExtended>;
|
|
1551
1555
|
/**
|
|
1552
1556
|
* An {@link FullOperator} definition with a {@link DefaultOperatorName} `name` property.
|
|
1553
1557
|
*
|
|
1554
1558
|
* @group Option Lists
|
|
1555
1559
|
*/
|
|
1556
|
-
type DefaultOperator = FullOperator<DefaultOperatorName>;
|
|
1560
|
+
export type DefaultOperator = FullOperator<DefaultOperatorName>;
|
|
1557
1561
|
//#endregion
|
|
1558
1562
|
//#region src/types/ruleGroupsIC.utils.d.ts
|
|
1559
1563
|
type MAXIMUM_ALLOWED_BOUNDARY = 80;
|
|
@@ -1564,7 +1568,7 @@ type MappedTuple<Tuple extends Array<unknown>, Result extends Array<unknown> = [
|
|
|
1564
1568
|
* The main rule group interface when using independent combinators. This type is used
|
|
1565
1569
|
* for query definitions as well as all sub-groups of queries.
|
|
1566
1570
|
*/
|
|
1567
|
-
interface RuleGroupTypeIC<R extends RuleType = RuleType, C extends string = string> extends Except<RuleGroupType<R, C>, "combinator" | "rules"> {
|
|
1571
|
+
export interface RuleGroupTypeIC<R extends RuleType = RuleType, C extends string = string> extends Except<RuleGroupType<R, C>, "combinator" | "rules"> {
|
|
1568
1572
|
combinator?: undefined;
|
|
1569
1573
|
rules: RuleGroupICArray<RuleGroupTypeIC<R, C>, R, C>;
|
|
1570
1574
|
/**
|
|
@@ -1575,41 +1579,41 @@ interface RuleGroupTypeIC<R extends RuleType = RuleType, C extends string = stri
|
|
|
1575
1579
|
/**
|
|
1576
1580
|
* Shorthand for "either {@link RuleGroupType} or {@link RuleGroupTypeIC}".
|
|
1577
1581
|
*/
|
|
1578
|
-
type RuleGroupTypeAny<R extends RuleType = RuleType, C extends string = string> = RuleGroupType<R, C> | RuleGroupTypeIC<R, C>;
|
|
1582
|
+
export type RuleGroupTypeAny<R extends RuleType = RuleType, C extends string = string> = RuleGroupType<R, C> | RuleGroupTypeIC<R, C>;
|
|
1579
1583
|
/**
|
|
1580
1584
|
* The type of the `rules` array in a {@link RuleGroupTypeIC}.
|
|
1581
1585
|
*/
|
|
1582
|
-
type RuleGroupICArray<RG extends RuleGroupTypeIC = RuleGroupTypeIC, R extends RuleType = RuleType, C extends string = string> = [R | RG] | [R | RG, ...MappedTuple<[C, R | RG]>] | ((R | RG)[] & {
|
|
1586
|
+
export type RuleGroupICArray<RG extends RuleGroupTypeIC = RuleGroupTypeIC, R extends RuleType = RuleType, C extends string = string> = [R | RG] | [R | RG, ...MappedTuple<[C, R | RG]>] | ((R | RG)[] & {
|
|
1583
1587
|
length: 0;
|
|
1584
1588
|
});
|
|
1585
1589
|
/**
|
|
1586
1590
|
* Shorthand for "either {@link RuleGroupArray} or {@link RuleGroupICArray}".
|
|
1587
1591
|
*/
|
|
1588
|
-
type RuleOrGroupArray = RuleGroupArray | RuleGroupICArray;
|
|
1592
|
+
export type RuleOrGroupArray = RuleGroupArray | RuleGroupICArray;
|
|
1589
1593
|
/**
|
|
1590
1594
|
* The type of the `rules` array in a {@link DefaultRuleGroupTypeIC}.
|
|
1591
1595
|
*/
|
|
1592
|
-
type DefaultRuleGroupICArray<F extends string = string> = RuleGroupICArray<DefaultRuleGroupTypeIC<F>, DefaultRuleType<F>, DefaultCombinatorName>;
|
|
1596
|
+
export type DefaultRuleGroupICArray<F extends string = string> = RuleGroupICArray<DefaultRuleGroupTypeIC<F>, DefaultRuleType<F>, DefaultCombinatorName>;
|
|
1593
1597
|
/**
|
|
1594
1598
|
* Shorthand for "either {@link DefaultRuleGroupArray} or {@link DefaultRuleGroupICArray}".
|
|
1595
1599
|
*/
|
|
1596
|
-
type DefaultRuleOrGroupArray<F extends string = string> = DefaultRuleGroupArray<F> | DefaultRuleGroupICArray<F>;
|
|
1600
|
+
export type DefaultRuleOrGroupArray<F extends string = string> = DefaultRuleGroupArray<F> | DefaultRuleGroupICArray<F>;
|
|
1597
1601
|
/**
|
|
1598
1602
|
* {@link RuleGroupTypeIC} with combinators limited to
|
|
1599
1603
|
* {@link DefaultCombinatorName} and rules limited to {@link DefaultRuleType}.
|
|
1600
1604
|
*/
|
|
1601
|
-
interface DefaultRuleGroupTypeIC<F extends string = string> extends RuleGroupTypeIC<DefaultRuleType<F>> {
|
|
1605
|
+
export interface DefaultRuleGroupTypeIC<F extends string = string> extends RuleGroupTypeIC<DefaultRuleType<F>> {
|
|
1602
1606
|
rules: DefaultRuleGroupICArray<F>;
|
|
1603
1607
|
}
|
|
1604
1608
|
/**
|
|
1605
1609
|
* Shorthand for "either {@link DefaultRuleGroupType} or {@link DefaultRuleGroupTypeIC}".
|
|
1606
1610
|
*/
|
|
1607
|
-
type DefaultRuleGroupTypeAny<F extends string = string> = DefaultRuleGroupType<F> | DefaultRuleGroupTypeIC<F>;
|
|
1611
|
+
export type DefaultRuleGroupTypeAny<F extends string = string> = DefaultRuleGroupType<F> | DefaultRuleGroupTypeIC<F>;
|
|
1608
1612
|
/**
|
|
1609
1613
|
* Determines if a type extending {@link RuleGroupTypeAny} is actually
|
|
1610
1614
|
* {@link RuleGroupType} or {@link RuleGroupTypeIC}.
|
|
1611
1615
|
*/
|
|
1612
|
-
type GetRuleGroupType<RG> = RG extends {
|
|
1616
|
+
export type GetRuleGroupType<RG> = RG extends {
|
|
1613
1617
|
combinator: string;
|
|
1614
1618
|
} ? RuleGroupType : RuleGroupTypeIC;
|
|
1615
1619
|
/**
|
|
@@ -1620,23 +1624,23 @@ type GetRuleGroupType<RG> = RG extends {
|
|
|
1620
1624
|
* the rule type has its field and operator types narrowed to the
|
|
1621
1625
|
* identifier types of the provided Field and Operator types.
|
|
1622
1626
|
*/
|
|
1623
|
-
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;
|
|
1627
|
+
export 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;
|
|
1624
1628
|
/**
|
|
1625
1629
|
* Converts a narrowed rule group type to its most generic form.
|
|
1626
1630
|
*/
|
|
1627
|
-
type GenericizeRuleGroupType<RG> = RG extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
|
|
1631
|
+
export type GenericizeRuleGroupType<RG> = RG extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
|
|
1628
1632
|
/**
|
|
1629
1633
|
* Converts a {@link RuleGroupType} extension to the corresponding
|
|
1630
1634
|
* {@link RuleGroupTypeIC} type, preserving any additional properties.
|
|
1631
1635
|
* If the type already extends {@link RuleGroupTypeIC}, it is returned as-is.
|
|
1632
1636
|
*/
|
|
1633
|
-
type ToRuleGroupTypeIC<T extends RuleGroupTypeAny> = T extends RuleGroupTypeIC ? T : T extends DefaultRuleGroupType<infer F> ? DefaultRuleGroupTypeIC<F> : T extends RuleGroupType<infer R, infer C> ? RuleGroupTypeIC<R, C> & Omit<T, keyof RuleGroupType<R, C>> : T;
|
|
1637
|
+
export type ToRuleGroupTypeIC<T extends RuleGroupTypeAny> = T extends RuleGroupTypeIC ? T : T extends DefaultRuleGroupType<infer F> ? DefaultRuleGroupTypeIC<F> : T extends RuleGroupType<infer R, infer C> ? RuleGroupTypeIC<R, C> & Omit<T, keyof RuleGroupType<R, C>> : T;
|
|
1634
1638
|
/**
|
|
1635
1639
|
* Converts a {@link RuleGroupTypeIC} extension to the corresponding
|
|
1636
1640
|
* {@link RuleGroupType} type, preserving any additional properties.
|
|
1637
1641
|
* If the type already extends {@link RuleGroupType} (non-IC), it is returned as-is.
|
|
1638
1642
|
*/
|
|
1639
|
-
type ToRuleGroupType<T extends RuleGroupTypeAny> = T extends {
|
|
1643
|
+
export type ToRuleGroupType<T extends RuleGroupTypeAny> = T extends {
|
|
1640
1644
|
combinator: string;
|
|
1641
1645
|
} ? T : T extends DefaultRuleGroupTypeIC<infer F> ? DefaultRuleGroupType<F> : T extends RuleGroupTypeIC<infer R, infer C> ? RuleGroupType<R, C> & Omit<T, keyof RuleGroupTypeIC<R, C>> : T;
|
|
1642
1646
|
//#endregion
|
|
@@ -1644,50 +1648,50 @@ type ToRuleGroupType<T extends RuleGroupTypeAny> = T extends {
|
|
|
1644
1648
|
/**
|
|
1645
1649
|
* Object with a `valid` boolean value and optional `reasons`.
|
|
1646
1650
|
*/
|
|
1647
|
-
interface ValidationResult {
|
|
1651
|
+
export interface ValidationResult {
|
|
1648
1652
|
valid: boolean;
|
|
1649
1653
|
reasons?: any[];
|
|
1650
1654
|
}
|
|
1651
1655
|
/**
|
|
1652
1656
|
* Map of rule/group `id` to its respective {@link ValidationResult}.
|
|
1653
1657
|
*/
|
|
1654
|
-
type ValidationMap = Record<string, boolean | ValidationResult>;
|
|
1658
|
+
export type ValidationMap = Record<string, boolean | ValidationResult>;
|
|
1655
1659
|
/**
|
|
1656
1660
|
* Function that validates a query.
|
|
1657
1661
|
*/
|
|
1658
|
-
type QueryValidator = (query: RuleGroupTypeAny) => boolean | ValidationMap;
|
|
1662
|
+
export type QueryValidator = (query: RuleGroupTypeAny) => boolean | ValidationMap;
|
|
1659
1663
|
/**
|
|
1660
1664
|
* Function that validates a rule.
|
|
1661
1665
|
*/
|
|
1662
|
-
type RuleValidator = (rule: RuleType) => boolean | ValidationResult;
|
|
1666
|
+
export type RuleValidator = (rule: RuleType) => boolean | ValidationResult;
|
|
1663
1667
|
//#endregion
|
|
1664
1668
|
//#region src/types/basic.d.ts
|
|
1665
1669
|
/**
|
|
1666
1670
|
* @see https://react-querybuilder.js.org/docs/tips/path
|
|
1667
1671
|
*/
|
|
1668
|
-
type Path = number[];
|
|
1672
|
+
export type Path = number[];
|
|
1669
1673
|
/**
|
|
1670
1674
|
* String of classnames, array of classname strings, or object where the
|
|
1671
1675
|
* keys are classnames and those with truthy values will be included.
|
|
1672
1676
|
* Suitable for passing to the `clsx` package.
|
|
1673
1677
|
*/
|
|
1674
|
-
type Classname = string | string[] | Record<string, any>;
|
|
1678
|
+
export type Classname = string | string[] | Record<string, any>;
|
|
1675
1679
|
/**
|
|
1676
1680
|
* A source for the `value` property of a rule.
|
|
1677
1681
|
*/
|
|
1678
|
-
type ValueSource = "value" | "field" | "expression" | "parameter";
|
|
1682
|
+
export type ValueSource = "value" | "field" | "expression" | "parameter";
|
|
1679
1683
|
/**
|
|
1680
1684
|
* Type of {@link react-querybuilder!ValueEditor ValueEditor} that will be displayed.
|
|
1681
1685
|
*/
|
|
1682
|
-
type ValueEditorType = "text" | "select" | "checkbox" | "radio" | "textarea" | "switch" | "multiselect" | null;
|
|
1686
|
+
export type ValueEditorType = "text" | "select" | "checkbox" | "radio" | "textarea" | "switch" | "multiselect" | null;
|
|
1683
1687
|
/**
|
|
1684
1688
|
* A valid array of potential value sources.
|
|
1685
1689
|
*
|
|
1686
1690
|
* @see {@link ValueSource}
|
|
1687
1691
|
*/
|
|
1688
|
-
type ValueSources = [ValueSource, ...ValueSource[]];
|
|
1689
|
-
type ValueSourceFlexibleOptions = ToFlexibleOptionArrays<ValueSources>;
|
|
1690
|
-
type ValueSourceFullOptions = ToOptionArrays<ValueSources>;
|
|
1692
|
+
export type ValueSources = [ValueSource, ...ValueSource[]];
|
|
1693
|
+
export type ValueSourceFlexibleOptions = ToFlexibleOptionArrays<ValueSources>;
|
|
1694
|
+
export type ValueSourceFullOptions = ToOptionArrays<ValueSources>;
|
|
1691
1695
|
type ToOptionArrays<Sources extends readonly string[]> = Sources extends unknown ? { [K in keyof Sources]: {
|
|
1692
1696
|
name: Sources[K];
|
|
1693
1697
|
value: Sources[K];
|
|
@@ -1700,7 +1704,7 @@ type WithOptionalClassName<T> = T & {
|
|
|
1700
1704
|
/**
|
|
1701
1705
|
* HTML5 input types
|
|
1702
1706
|
*/
|
|
1703
|
-
type InputType = "button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week" | "bigint" | (string & {});
|
|
1707
|
+
export type InputType = "button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week" | "bigint" | (string & {});
|
|
1704
1708
|
/**
|
|
1705
1709
|
* Quantification mode describing how many elements of the value array must pass
|
|
1706
1710
|
* the filter for the rule itself to pass.
|
|
@@ -1709,14 +1713,14 @@ type InputType = "button" | "checkbox" | "color" | "date" | "datetime-local" | "
|
|
|
1709
1713
|
* a percentage if the number is less than 1. Non-numeric values and numbers less
|
|
1710
1714
|
* than 0 will be ignored.
|
|
1711
1715
|
*/
|
|
1712
|
-
interface MatchConfig {
|
|
1716
|
+
export interface MatchConfig {
|
|
1713
1717
|
mode: MatchMode;
|
|
1714
1718
|
threshold?: number | null | undefined;
|
|
1715
1719
|
}
|
|
1716
|
-
type MatchMode = "all" | "some" | "none" | "atLeast" | "atMost" | "exactly";
|
|
1717
|
-
type MatchModeOptions = StringUnionToFullOptionArray<MatchMode>;
|
|
1718
|
-
type ActionElementEventHandler = (event?: any, context?: any) => void;
|
|
1719
|
-
type ValueChangeEventHandler = (value?: any, context?: any) => void;
|
|
1720
|
+
export type MatchMode = "all" | "some" | "none" | "atLeast" | "atMost" | "exactly";
|
|
1721
|
+
export type MatchModeOptions = StringUnionToFullOptionArray<MatchMode>;
|
|
1722
|
+
export type ActionElementEventHandler = (event?: any, context?: any) => void;
|
|
1723
|
+
export type ValueChangeEventHandler = (value?: any, context?: any) => void;
|
|
1720
1724
|
/**
|
|
1721
1725
|
* Base for all Field types/interfaces.
|
|
1722
1726
|
*/
|
|
@@ -1748,7 +1752,7 @@ interface BaseFullField<FieldName extends string = string, OperatorName extends
|
|
|
1748
1752
|
*
|
|
1749
1753
|
* @group Option Lists
|
|
1750
1754
|
*/
|
|
1751
|
-
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>>;
|
|
1755
|
+
export 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>>;
|
|
1752
1756
|
/**
|
|
1753
1757
|
* Field definition used in the `fields` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
1754
1758
|
* This type is an extension of {@link FullField} where only `name` and
|
|
@@ -1759,7 +1763,7 @@ type FullField<FieldName extends string = string, OperatorName extends string =
|
|
|
1759
1763
|
*
|
|
1760
1764
|
* @group Option Lists
|
|
1761
1765
|
*/
|
|
1762
|
-
type Field<FieldName extends string = string, OperatorName extends string = string, ValueName extends string = string, OperatorObj extends FullOption = FullOption<OperatorName>> = WithUnknownIndex<{
|
|
1766
|
+
export type Field<FieldName extends string = string, OperatorName extends string = string, ValueName extends string = string, OperatorObj extends FullOption = FullOption<OperatorName>> = WithUnknownIndex<{
|
|
1763
1767
|
value?: FieldName;
|
|
1764
1768
|
} & Pick<BaseFullField<FieldName, OperatorName, ValueName, OperatorObj>, Exclude<keyof BaseFullField, "value">>>;
|
|
1765
1769
|
/**
|
|
@@ -1772,22 +1776,22 @@ type Field<FieldName extends string = string, OperatorName extends string = stri
|
|
|
1772
1776
|
*
|
|
1773
1777
|
* @group Option Lists
|
|
1774
1778
|
*/
|
|
1775
|
-
type FieldByValue<FieldName extends string = string, OperatorName extends string = string, ValueName extends string = string, OperatorObj extends FullOption = FullOption<OperatorName>> = WithUnknownIndex<{
|
|
1779
|
+
export type FieldByValue<FieldName extends string = string, OperatorName extends string = string, ValueName extends string = string, OperatorObj extends FullOption = FullOption<OperatorName>> = WithUnknownIndex<{
|
|
1776
1780
|
name?: FieldName;
|
|
1777
1781
|
} & Pick<BaseFullField<FieldName, OperatorName, ValueName, OperatorObj>, Exclude<keyof BaseFullField, "name">>>;
|
|
1778
1782
|
/**
|
|
1779
1783
|
* Utility type to make one or more properties required.
|
|
1780
1784
|
*/
|
|
1781
|
-
type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P]; };
|
|
1785
|
+
export type WithRequired<T, K extends keyof T> = T & { [P in K]-?: T[P]; };
|
|
1782
1786
|
/**
|
|
1783
1787
|
* Utility type to make all properties non-nullable.
|
|
1784
1788
|
*/
|
|
1785
|
-
type RemoveNullability<T extends Record<string, unknown>> = { [k in keyof T]: NonNullable<T[k]>; };
|
|
1789
|
+
export type RemoveNullability<T extends Record<string, unknown>> = { [k in keyof T]: NonNullable<T[k]>; };
|
|
1786
1790
|
/**
|
|
1787
1791
|
* Allowed values of the {@link FullOperator} property `arity`. A value of `"unary"` or
|
|
1788
1792
|
* a number less than two will cause the default {@link react-querybuilder!ValueEditor ValueEditor} to render `null`.
|
|
1789
1793
|
*/
|
|
1790
|
-
type Arity = number | "unary" | "binary" | "ternary";
|
|
1794
|
+
export type Arity = number | "unary" | "binary" | "ternary";
|
|
1791
1795
|
/**
|
|
1792
1796
|
* Full operator definition used in the `operators`/`getOperators` props of
|
|
1793
1797
|
* {@link react-querybuilder!QueryBuilder QueryBuilder}. This type requires both `name` and `value`, but the
|
|
@@ -1799,7 +1803,7 @@ type Arity = number | "unary" | "binary" | "ternary";
|
|
|
1799
1803
|
*
|
|
1800
1804
|
* @group Option Lists
|
|
1801
1805
|
*/
|
|
1802
|
-
interface FullOperator<N extends string = string> extends WithOptionalClassName<FullOption<N>> {
|
|
1806
|
+
export interface FullOperator<N extends string = string> extends WithOptionalClassName<FullOption<N>> {
|
|
1803
1807
|
arity?: Arity;
|
|
1804
1808
|
}
|
|
1805
1809
|
/**
|
|
@@ -1811,7 +1815,7 @@ interface FullOperator<N extends string = string> extends WithOptionalClassName<
|
|
|
1811
1815
|
*
|
|
1812
1816
|
* @group Option Lists
|
|
1813
1817
|
*/
|
|
1814
|
-
type Operator<N extends string = string> = WithUnknownIndex<SetOptional<BaseFullOption<N>, "value"> & WithOptionalClassName<{
|
|
1818
|
+
export type Operator<N extends string = string> = WithUnknownIndex<SetOptional<BaseFullOption<N>, "value"> & WithOptionalClassName<{
|
|
1815
1819
|
arity?: Arity;
|
|
1816
1820
|
}>>;
|
|
1817
1821
|
/**
|
|
@@ -1823,7 +1827,7 @@ type Operator<N extends string = string> = WithUnknownIndex<SetOptional<BaseFull
|
|
|
1823
1827
|
*
|
|
1824
1828
|
* @group Option Lists
|
|
1825
1829
|
*/
|
|
1826
|
-
type OperatorByValue<N extends string = string> = WithUnknownIndex<SetOptional<BaseFullOption<N>, "name"> & WithOptionalClassName<{
|
|
1830
|
+
export type OperatorByValue<N extends string = string> = WithUnknownIndex<SetOptional<BaseFullOption<N>, "name"> & WithOptionalClassName<{
|
|
1827
1831
|
arity?: Arity;
|
|
1828
1832
|
}>>;
|
|
1829
1833
|
/**
|
|
@@ -1836,7 +1840,7 @@ type OperatorByValue<N extends string = string> = WithUnknownIndex<SetOptional<B
|
|
|
1836
1840
|
*
|
|
1837
1841
|
* @group Option Lists
|
|
1838
1842
|
*/
|
|
1839
|
-
type FullCombinator<N extends string = string> = WithOptionalClassName<FullOption<N>>;
|
|
1843
|
+
export type FullCombinator<N extends string = string> = WithOptionalClassName<FullOption<N>>;
|
|
1840
1844
|
/**
|
|
1841
1845
|
* Combinator definition used in the `combinators` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
1842
1846
|
* This type is an extension of {@link FullCombinator} where only `name` and
|
|
@@ -1846,7 +1850,7 @@ type FullCombinator<N extends string = string> = WithOptionalClassName<FullOptio
|
|
|
1846
1850
|
*
|
|
1847
1851
|
* @group Option Lists
|
|
1848
1852
|
*/
|
|
1849
|
-
type Combinator<N extends string = string> = WithUnknownIndex<WithOptionalClassName<SetOptional<BaseFullOption<N>, "value">>>;
|
|
1853
|
+
export type Combinator<N extends string = string> = WithUnknownIndex<WithOptionalClassName<SetOptional<BaseFullOption<N>, "value">>>;
|
|
1850
1854
|
/**
|
|
1851
1855
|
* Combinator definition used in the `combinators` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
1852
1856
|
* This type is an extension of {@link FullCombinator} where only `value` and
|
|
@@ -1856,37 +1860,37 @@ type Combinator<N extends string = string> = WithUnknownIndex<WithOptionalClassN
|
|
|
1856
1860
|
*
|
|
1857
1861
|
* @group Option Lists
|
|
1858
1862
|
*/
|
|
1859
|
-
type CombinatorByValue<N extends string = string> = WithUnknownIndex<WithOptionalClassName<SetOptional<BaseFullOption<N>, "name">>>;
|
|
1863
|
+
export type CombinatorByValue<N extends string = string> = WithUnknownIndex<WithOptionalClassName<SetOptional<BaseFullOption<N>, "name">>>;
|
|
1860
1864
|
type ParseNumberMethodName = "enhanced" | "native" | "strict";
|
|
1861
1865
|
/**
|
|
1862
1866
|
* Parsing algorithms used by {@link parseNumber}.
|
|
1863
1867
|
*/
|
|
1864
|
-
type ParseNumberMethod = boolean | ParseNumberMethodName;
|
|
1868
|
+
export type ParseNumberMethod = boolean | ParseNumberMethodName;
|
|
1865
1869
|
type ParseNumbersModerationLevel = "-limited" | "";
|
|
1866
1870
|
/**
|
|
1867
1871
|
* Options for the `parseNumbers` prop of {@link react-querybuilder!QueryBuilder QueryBuilder}.
|
|
1868
1872
|
*/
|
|
1869
|
-
type ParseNumbersPropConfig = boolean | `${ParseNumberMethodName}${ParseNumbersModerationLevel}`;
|
|
1873
|
+
export type ParseNumbersPropConfig = boolean | `${ParseNumberMethodName}${ParseNumbersModerationLevel}`;
|
|
1870
1874
|
/**
|
|
1871
1875
|
* Signature of `accessibleDescriptionGenerator` prop, used by {@link react-querybuilder!QueryBuilder QueryBuilder} to generate
|
|
1872
1876
|
* accessible descriptions for each {@link react-querybuilder!RuleGroup RuleGroup}.
|
|
1873
1877
|
*/
|
|
1874
|
-
type AccessibleDescriptionGenerator = (props: {
|
|
1878
|
+
export type AccessibleDescriptionGenerator = (props: {
|
|
1875
1879
|
path: Path;
|
|
1876
1880
|
qbId: string;
|
|
1877
1881
|
}) => string;
|
|
1878
1882
|
//#endregion
|
|
1879
1883
|
//#region src/types/dnd.d.ts
|
|
1880
|
-
type DndDropTargetType = "rule" | "ruleGroup" | "inlineCombinator";
|
|
1881
|
-
type DraggedItem = (RuleType & {
|
|
1884
|
+
export type DndDropTargetType = "rule" | "ruleGroup" | "inlineCombinator";
|
|
1885
|
+
export type DraggedItem = (RuleType & {
|
|
1882
1886
|
path: Path;
|
|
1883
1887
|
qbId: string;
|
|
1884
1888
|
}) | (RuleGroupTypeAny & {
|
|
1885
1889
|
path: Path;
|
|
1886
1890
|
qbId: string;
|
|
1887
1891
|
});
|
|
1888
|
-
type DropEffect = "move" | "copy";
|
|
1889
|
-
interface DropResult {
|
|
1892
|
+
export type DropEffect = "move" | "copy";
|
|
1893
|
+
export interface DropResult {
|
|
1890
1894
|
path: Path;
|
|
1891
1895
|
type: DndDropTargetType;
|
|
1892
1896
|
dropEffect?: DropEffect;
|
|
@@ -1895,11 +1899,11 @@ interface DropResult {
|
|
|
1895
1899
|
getQuery: () => RuleGroupTypeAny;
|
|
1896
1900
|
dispatchQuery: (query: RuleGroupTypeAny) => void;
|
|
1897
1901
|
}
|
|
1898
|
-
interface DragCollection {
|
|
1902
|
+
export interface DragCollection {
|
|
1899
1903
|
isDragging: boolean;
|
|
1900
1904
|
dragMonitorId: string | symbol;
|
|
1901
1905
|
}
|
|
1902
|
-
interface DropCollection {
|
|
1906
|
+
export interface DropCollection {
|
|
1903
1907
|
dropNotAllowed: boolean;
|
|
1904
1908
|
isOver: boolean;
|
|
1905
1909
|
dropMonitorId: string | symbol;
|
|
@@ -1913,19 +1917,19 @@ interface DropCollection {
|
|
|
1913
1917
|
*
|
|
1914
1918
|
* @group Export
|
|
1915
1919
|
*/
|
|
1916
|
-
type ExportFormat = "json" | "sql" | "json_without_ids" | "parameterized" | "parameterized_named" | "mongodb" | "mongodb_query" | "cel" | "jsonlogic" | "spel" | "elasticsearch" | "jsonata" | "natural_language" | "ldap" | "drizzle" | "tanstack_db" | "prisma" | "sequelize" | "cypher" | "gql" | "sparql" | "gremlin" | "diagnostics";
|
|
1920
|
+
export type ExportFormat = "json" | "sql" | "json_without_ids" | "parameterized" | "parameterized_named" | "mongodb" | "mongodb_query" | "cel" | "jsonlogic" | "spel" | "elasticsearch" | "jsonata" | "natural_language" | "ldap" | "drizzle" | "tanstack_db" | "prisma" | "sequelize" | "cypher" | "gql" | "sparql" | "gremlin" | "diagnostics";
|
|
1917
1921
|
/**
|
|
1918
1922
|
* Export formats for {@link formatQuery} that produce objects instead of strings.
|
|
1919
1923
|
*
|
|
1920
1924
|
* @group Export
|
|
1921
1925
|
*/
|
|
1922
|
-
type ExportObjectFormats = "parameterized" | "parameterized_named" | "jsonlogic" | "elasticsearch" | "jsonata" | "mongodb_query" | "diagnostics";
|
|
1926
|
+
export type ExportObjectFormats = "parameterized" | "parameterized_named" | "jsonlogic" | "elasticsearch" | "jsonata" | "mongodb_query" | "diagnostics";
|
|
1923
1927
|
/**
|
|
1924
1928
|
* Available presets for the "sql" export format.
|
|
1925
1929
|
*
|
|
1926
1930
|
* @group Export
|
|
1927
1931
|
*/
|
|
1928
|
-
type SQLPreset = "ansi" | "sqlite" | "postgresql" | "mysql" | "mssql" | "oracle";
|
|
1932
|
+
export type SQLPreset = "ansi" | "sqlite" | "postgresql" | "mysql" | "mssql" | "oracle";
|
|
1929
1933
|
/**
|
|
1930
1934
|
* A map of operators to strings to be used in the output of {@link formatQuery}. If the
|
|
1931
1935
|
* result can differ based on the `valueSource`, the key should map to an array where the
|
|
@@ -1934,13 +1938,13 @@ type SQLPreset = "ansi" | "sqlite" | "postgresql" | "mysql" | "mssql" | "oracle"
|
|
|
1934
1938
|
*
|
|
1935
1939
|
* @group Export
|
|
1936
1940
|
*/
|
|
1937
|
-
type ExportOperatorMap = Partial<Record<Lowercase<DefaultOperatorName> | DefaultOperatorName, string | [string, string]>>;
|
|
1941
|
+
export type ExportOperatorMap = Partial<Record<Lowercase<DefaultOperatorName> | DefaultOperatorName, string | [string, string]>>;
|
|
1938
1942
|
/**
|
|
1939
1943
|
* Options object shape for {@link formatQuery}.
|
|
1940
1944
|
*
|
|
1941
1945
|
* @group Export
|
|
1942
1946
|
*/
|
|
1943
|
-
interface FormatQueryOptions {
|
|
1947
|
+
export interface FormatQueryOptions {
|
|
1944
1948
|
/**
|
|
1945
1949
|
* The {@link ExportFormat}.
|
|
1946
1950
|
*/
|
|
@@ -2160,7 +2164,7 @@ interface FormatQueryOptions {
|
|
|
2160
2164
|
*
|
|
2161
2165
|
* @group Export
|
|
2162
2166
|
*/
|
|
2163
|
-
interface ValueProcessorOptions extends FormatQueryOptions {
|
|
2167
|
+
export interface ValueProcessorOptions extends FormatQueryOptions {
|
|
2164
2168
|
valueProcessor?: ValueProcessorByRule;
|
|
2165
2169
|
escapeQuotes?: boolean;
|
|
2166
2170
|
/**
|
|
@@ -2206,7 +2210,7 @@ interface ValueProcessorOptions extends FormatQueryOptions {
|
|
|
2206
2210
|
*
|
|
2207
2211
|
* @group Export
|
|
2208
2212
|
*/
|
|
2209
|
-
interface FormatQueryFinalOptions extends Required<Except<FormatQueryOptions, "context" | "valueProcessor" | "validator" | "placeholderValueName" | "ruleGroupProcessor" | "parseNumbers" | "getParameters">> {
|
|
2213
|
+
export interface FormatQueryFinalOptions extends Required<Except<FormatQueryOptions, "context" | "valueProcessor" | "validator" | "placeholderValueName" | "ruleGroupProcessor" | "parseNumbers" | "getParameters">> {
|
|
2210
2214
|
getParameters?: FormatQueryOptions["getParameters"];
|
|
2211
2215
|
fields: FullOptionList<FullField>;
|
|
2212
2216
|
getParseNumberBoolean: (inputType?: InputType | null) => boolean | undefined;
|
|
@@ -2229,18 +2233,18 @@ interface FormatQueryFinalOptions extends Required<Except<FormatQueryOptions, "c
|
|
|
2229
2233
|
*
|
|
2230
2234
|
* @group Export
|
|
2231
2235
|
*/
|
|
2232
|
-
type ValueProcessorByRule = (rule: RuleType, options?: ValueProcessorOptions) => string;
|
|
2236
|
+
export type ValueProcessorByRule = (rule: RuleType, options?: ValueProcessorOptions) => string;
|
|
2233
2237
|
/**
|
|
2234
2238
|
* Function that produces a processed value for a given `field`, `operator`, `value`,
|
|
2235
2239
|
* and `valueSource`.
|
|
2236
2240
|
*
|
|
2237
2241
|
* @group Export
|
|
2238
2242
|
*/
|
|
2239
|
-
type ValueProcessorLegacy = (field: string, operator: string, value: any, valueSource?: ValueSource) => string;
|
|
2243
|
+
export type ValueProcessorLegacy = (field: string, operator: string, value: any, valueSource?: ValueSource) => string;
|
|
2240
2244
|
/**
|
|
2241
2245
|
* @group Export
|
|
2242
2246
|
*/
|
|
2243
|
-
type ValueProcessor = ValueProcessorLegacy;
|
|
2247
|
+
export type ValueProcessor = ValueProcessorLegacy;
|
|
2244
2248
|
/**
|
|
2245
2249
|
* Function to produce a result that {@link formatQuery} uses when processing a
|
|
2246
2250
|
* {@link RuleType} object.
|
|
@@ -2270,7 +2274,7 @@ type ValueProcessor = ValueProcessorLegacy;
|
|
|
2270
2274
|
*
|
|
2271
2275
|
* @group Export
|
|
2272
2276
|
*/
|
|
2273
|
-
type RuleProcessor = (rule: RuleType, options?: ValueProcessorOptions, meta?: {
|
|
2277
|
+
export type RuleProcessor = (rule: RuleType, options?: ValueProcessorOptions, meta?: {
|
|
2274
2278
|
processedParams?: Record<string, any> | any[];
|
|
2275
2279
|
context?: Record<string, any>;
|
|
2276
2280
|
}) => any;
|
|
@@ -2304,7 +2308,7 @@ type RuleProcessor = (rule: RuleType, options?: ValueProcessorOptions, meta?: {
|
|
|
2304
2308
|
*
|
|
2305
2309
|
* @group Export
|
|
2306
2310
|
*/
|
|
2307
|
-
type RuleGroupProcessor<TResult = unknown> = (ruleGroup: RuleGroupTypeAny, options: FormatQueryFinalOptions, meta?: {
|
|
2311
|
+
export type RuleGroupProcessor<TResult = unknown> = (ruleGroup: RuleGroupTypeAny, options: FormatQueryFinalOptions, meta?: {
|
|
2308
2312
|
processedParams?: Record<string, any> | any[];
|
|
2309
2313
|
context?: Record<string, any>;
|
|
2310
2314
|
}) => TResult;
|
|
@@ -2313,13 +2317,13 @@ type RuleGroupProcessor<TResult = unknown> = (ruleGroup: RuleGroupTypeAny, optio
|
|
|
2313
2317
|
*
|
|
2314
2318
|
* @group Export
|
|
2315
2319
|
*/
|
|
2316
|
-
type FormatQueryValidateRule = (rule: RuleType) => readonly [boolean | ValidationResult | undefined, RuleValidator | undefined];
|
|
2320
|
+
export type FormatQueryValidateRule = (rule: RuleType) => readonly [boolean | ValidationResult | undefined, RuleValidator | undefined];
|
|
2317
2321
|
/**
|
|
2318
2322
|
* Object produced by {@link formatQuery} for the `"parameterized"` format.
|
|
2319
2323
|
*
|
|
2320
2324
|
* @group Export
|
|
2321
2325
|
*/
|
|
2322
|
-
interface ParameterizedSQL {
|
|
2326
|
+
export interface ParameterizedSQL {
|
|
2323
2327
|
/** The SQL `WHERE` clause fragment with `?` placeholders for each value. */
|
|
2324
2328
|
sql: string;
|
|
2325
2329
|
/**
|
|
@@ -2333,7 +2337,7 @@ interface ParameterizedSQL {
|
|
|
2333
2337
|
*
|
|
2334
2338
|
* @group Export
|
|
2335
2339
|
*/
|
|
2336
|
-
interface ParameterizedNamedSQL {
|
|
2340
|
+
export interface ParameterizedNamedSQL {
|
|
2337
2341
|
/** The SQL `WHERE` clause fragment with bind variable placeholders for each value. */
|
|
2338
2342
|
sql: string;
|
|
2339
2343
|
/**
|
|
@@ -2349,7 +2353,7 @@ interface ParameterizedNamedSQL {
|
|
|
2349
2353
|
*
|
|
2350
2354
|
* @group Export
|
|
2351
2355
|
*/
|
|
2352
|
-
type RuleDiagnosticsResult<F extends string = string, O extends string = string, V = any, C extends string = string> = RuleType<F, O, V, C> & {
|
|
2356
|
+
export type RuleDiagnosticsResult<F extends string = string, O extends string = string, V = any, C extends string = string> = RuleType<F, O, V, C> & {
|
|
2353
2357
|
/** Whether the rule passed all validation checks. */
|
|
2354
2358
|
valid: boolean;
|
|
2355
2359
|
/**
|
|
@@ -2368,7 +2372,7 @@ type RuleDiagnosticsResult<F extends string = string, O extends string = string,
|
|
|
2368
2372
|
*
|
|
2369
2373
|
* @group Export
|
|
2370
2374
|
*/
|
|
2371
|
-
type RuleGroupDiagnosticsArray<RG extends RuleGroupDiagnosticsResult = RuleGroupDiagnosticsResult, R extends RuleDiagnosticsResult = RuleDiagnosticsResult> = RuleGroupArray<RG, R>;
|
|
2375
|
+
export type RuleGroupDiagnosticsArray<RG extends RuleGroupDiagnosticsResult = RuleGroupDiagnosticsResult, R extends RuleDiagnosticsResult = RuleDiagnosticsResult> = RuleGroupArray<RG, R>;
|
|
2372
2376
|
/**
|
|
2373
2377
|
* A {@link RuleGroupType} annotated with diagnostics results, as produced
|
|
2374
2378
|
* by {@link formatQuery} for the `"diagnostics"` format.
|
|
@@ -2377,7 +2381,7 @@ type RuleGroupDiagnosticsArray<RG extends RuleGroupDiagnosticsResult = RuleGroup
|
|
|
2377
2381
|
*
|
|
2378
2382
|
* @group Export
|
|
2379
2383
|
*/
|
|
2380
|
-
interface RuleGroupDiagnosticsResult<R extends RuleDiagnosticsResult = RuleDiagnosticsResult, C extends string = string> extends Omit<RuleGroupType<R, C>, "rules"> {
|
|
2384
|
+
export interface RuleGroupDiagnosticsResult<R extends RuleDiagnosticsResult = RuleDiagnosticsResult, C extends string = string> extends Omit<RuleGroupType<R, C>, "rules"> {
|
|
2381
2385
|
/** Whether the group and all of its descendants are valid. */
|
|
2382
2386
|
valid: boolean;
|
|
2383
2387
|
/**
|
|
@@ -2399,7 +2403,7 @@ interface RuleGroupDiagnosticsResult<R extends RuleDiagnosticsResult = RuleDiagn
|
|
|
2399
2403
|
*
|
|
2400
2404
|
* @group Export
|
|
2401
2405
|
*/
|
|
2402
|
-
type RuleGroupICDiagnosticsArray<RG extends RuleGroupICDiagnosticsResult = RuleGroupICDiagnosticsResult, R extends RuleDiagnosticsResult = RuleDiagnosticsResult, C extends string = string> = RuleGroupICArray<RG, R, C>;
|
|
2406
|
+
export type RuleGroupICDiagnosticsArray<RG extends RuleGroupICDiagnosticsResult = RuleGroupICDiagnosticsResult, R extends RuleDiagnosticsResult = RuleDiagnosticsResult, C extends string = string> = RuleGroupICArray<RG, R, C>;
|
|
2403
2407
|
/**
|
|
2404
2408
|
* A {@link RuleGroupTypeIC} annotated with diagnostics results, as produced
|
|
2405
2409
|
* by {@link formatQuery} for the `"diagnostics"` format (independent combinators).
|
|
@@ -2408,7 +2412,7 @@ type RuleGroupICDiagnosticsArray<RG extends RuleGroupICDiagnosticsResult = RuleG
|
|
|
2408
2412
|
*
|
|
2409
2413
|
* @group Export
|
|
2410
2414
|
*/
|
|
2411
|
-
interface RuleGroupICDiagnosticsResult<R extends RuleDiagnosticsResult = RuleDiagnosticsResult, C extends string = string> extends Omit<RuleGroupTypeIC<R, C>, "rules"> {
|
|
2415
|
+
export interface RuleGroupICDiagnosticsResult<R extends RuleDiagnosticsResult = RuleDiagnosticsResult, C extends string = string> extends Omit<RuleGroupTypeIC<R, C>, "rules"> {
|
|
2412
2416
|
/** Whether the group and all of its descendants are valid. */
|
|
2413
2417
|
valid: boolean;
|
|
2414
2418
|
/**
|
|
@@ -2428,7 +2432,7 @@ interface RuleGroupICDiagnosticsResult<R extends RuleDiagnosticsResult = RuleDia
|
|
|
2428
2432
|
*
|
|
2429
2433
|
* @group Export
|
|
2430
2434
|
*/
|
|
2431
|
-
interface DiagnosticEntry {
|
|
2435
|
+
export interface DiagnosticEntry {
|
|
2432
2436
|
/** The `id` of the rule or group this diagnostic pertains to. */
|
|
2433
2437
|
id: string;
|
|
2434
2438
|
/** The path to the rule or group within the query tree. */
|
|
@@ -2454,7 +2458,7 @@ interface DiagnosticEntry {
|
|
|
2454
2458
|
*
|
|
2455
2459
|
* @group Export
|
|
2456
2460
|
*/
|
|
2457
|
-
interface DiagnosticsStats {
|
|
2461
|
+
export interface DiagnosticsStats {
|
|
2458
2462
|
totalRules: number;
|
|
2459
2463
|
totalGroups: number;
|
|
2460
2464
|
validRules: number;
|
|
@@ -2467,7 +2471,7 @@ interface DiagnosticsStats {
|
|
|
2467
2471
|
*
|
|
2468
2472
|
* @group Export
|
|
2469
2473
|
*/
|
|
2470
|
-
interface DiagnosticsFieldSummaryEntry {
|
|
2474
|
+
export interface DiagnosticsFieldSummaryEntry {
|
|
2471
2475
|
/** Number of rules referencing this field. */
|
|
2472
2476
|
ruleCount: number;
|
|
2473
2477
|
/** Number of invalid rules referencing this field. */
|
|
@@ -2478,7 +2482,7 @@ interface DiagnosticsFieldSummaryEntry {
|
|
|
2478
2482
|
*
|
|
2479
2483
|
* @group Export
|
|
2480
2484
|
*/
|
|
2481
|
-
interface DiagnosticsResult {
|
|
2485
|
+
export interface DiagnosticsResult {
|
|
2482
2486
|
/** The annotated query tree with `valid`, `path`, and `level` on every node. */
|
|
2483
2487
|
query: RuleGroupDiagnosticsResult | RuleGroupICDiagnosticsResult;
|
|
2484
2488
|
/** A flat array of all diagnostic entries across the tree. */
|
|
@@ -2491,19 +2495,19 @@ interface DiagnosticsResult {
|
|
|
2491
2495
|
/**
|
|
2492
2496
|
* @group Export
|
|
2493
2497
|
*/
|
|
2494
|
-
interface RQBJsonLogicStartsWith {
|
|
2498
|
+
export interface RQBJsonLogicStartsWith {
|
|
2495
2499
|
startsWith: [RQBJsonLogic, RQBJsonLogic, ...RQBJsonLogic[]];
|
|
2496
2500
|
}
|
|
2497
2501
|
/**
|
|
2498
2502
|
* @group Export
|
|
2499
2503
|
*/
|
|
2500
|
-
interface RQBJsonLogicEndsWith {
|
|
2504
|
+
export interface RQBJsonLogicEndsWith {
|
|
2501
2505
|
endsWith: [RQBJsonLogic, RQBJsonLogic, ...RQBJsonLogic[]];
|
|
2502
2506
|
}
|
|
2503
2507
|
/**
|
|
2504
2508
|
* @group Export
|
|
2505
2509
|
*/
|
|
2506
|
-
interface RQBJsonLogicVar {
|
|
2510
|
+
export interface RQBJsonLogicVar {
|
|
2507
2511
|
var: string;
|
|
2508
2512
|
}
|
|
2509
2513
|
/**
|
|
@@ -2512,7 +2516,7 @@ interface RQBJsonLogicVar {
|
|
|
2512
2516
|
*
|
|
2513
2517
|
* @group Export
|
|
2514
2518
|
*/
|
|
2515
|
-
type RQBJsonLogic = RulesLogic<RQBJsonLogicStartsWith | RQBJsonLogicEndsWith>;
|
|
2519
|
+
export type RQBJsonLogic = RulesLogic<RQBJsonLogicStartsWith | RQBJsonLogicEndsWith>;
|
|
2516
2520
|
/**
|
|
2517
2521
|
* Constituent word order (as array) for the "natural_language" format.
|
|
2518
2522
|
*
|
|
@@ -2522,7 +2526,7 @@ type RQBJsonLogic = RulesLogic<RQBJsonLogicStartsWith | RQBJsonLogicEndsWith>;
|
|
|
2522
2526
|
*
|
|
2523
2527
|
* @group Export
|
|
2524
2528
|
*/
|
|
2525
|
-
type ConstituentWordOrder = ["S", "V", "O"] | ["S", "O", "V"] | ["O", "S", "V"] | ["O", "V", "S"] | ["V", "S", "O"] | ["V", "O", "S"];
|
|
2529
|
+
export type ConstituentWordOrder = ["S", "V", "O"] | ["S", "O", "V"] | ["O", "S", "V"] | ["O", "V", "S"] | ["V", "S", "O"] | ["V", "O", "S"];
|
|
2526
2530
|
/**
|
|
2527
2531
|
* Constituent word order (as string) for the "natural_language" format.
|
|
2528
2532
|
*
|
|
@@ -2532,7 +2536,7 @@ type ConstituentWordOrder = ["S", "V", "O"] | ["S", "O", "V"] | ["O", "S", "V"]
|
|
|
2532
2536
|
*
|
|
2533
2537
|
* @group Export
|
|
2534
2538
|
*/
|
|
2535
|
-
type ConstituentWordOrderString = "SVO" | "SOV" | "OSV" | "OVS" | "VSO" | "VOS";
|
|
2539
|
+
export type ConstituentWordOrderString = "SVO" | "SOV" | "OSV" | "OVS" | "VSO" | "VOS";
|
|
2536
2540
|
type RepeatStrings<S extends string[], Depth extends number[] = []> = Depth["length"] extends 2 ? "" : "" | `_${S[number]}${RepeatStrings<S, [...Depth, 1]>}`;
|
|
2537
2541
|
type ZeroOrMoreGroupVariants = RepeatStrings<["xor", "not"]>;
|
|
2538
2542
|
/**
|
|
@@ -2540,19 +2544,19 @@ type ZeroOrMoreGroupVariants = RepeatStrings<["xor", "not"]>;
|
|
|
2540
2544
|
*
|
|
2541
2545
|
* @group Export
|
|
2542
2546
|
*/
|
|
2543
|
-
type GroupVariantCondition = "not" | "xor";
|
|
2547
|
+
export type GroupVariantCondition = "not" | "xor";
|
|
2544
2548
|
/**
|
|
2545
2549
|
* Keys for the `translations` config object used by the "natural_language" format.
|
|
2546
2550
|
*
|
|
2547
2551
|
* @group Export
|
|
2548
2552
|
*/
|
|
2549
|
-
type NLTranslationKey = "and" | "or" | "true" | "false" | "ruleSeparator" | "betweenAnd" | "afterSubject" | "afterVerb" | "afterObject" | "listSeparator" | `groupPrefix${ZeroOrMoreGroupVariants}` | `groupSuffix${ZeroOrMoreGroupVariants}`;
|
|
2553
|
+
export type NLTranslationKey = "and" | "or" | "true" | "false" | "ruleSeparator" | "betweenAnd" | "afterSubject" | "afterVerb" | "afterObject" | "listSeparator" | `groupPrefix${ZeroOrMoreGroupVariants}` | `groupSuffix${ZeroOrMoreGroupVariants}`;
|
|
2550
2554
|
/**
|
|
2551
2555
|
* `translations` config object for "natural_language" format.
|
|
2552
2556
|
*
|
|
2553
2557
|
* @group Export
|
|
2554
2558
|
*/
|
|
2555
|
-
type NLTranslations = Partial<Record<NLTranslationKey, string>>;
|
|
2559
|
+
export type NLTranslations = Partial<Record<NLTranslationKey, string>>;
|
|
2556
2560
|
//#endregion
|
|
2557
2561
|
//#region src/types/history.d.ts
|
|
2558
2562
|
/**
|
|
@@ -2561,7 +2565,7 @@ type NLTranslations = Partial<Record<NLTranslationKey, string>>;
|
|
|
2561
2565
|
* Shared by the `react-querybuilder/history` entry point and the
|
|
2562
2566
|
* {@link index!QueryManager QueryManager} utility.
|
|
2563
2567
|
*/
|
|
2564
|
-
interface QueryHistoryOptions {
|
|
2568
|
+
export interface QueryHistoryOptions {
|
|
2565
2569
|
/**
|
|
2566
2570
|
* Maximum number of undo steps to retain. Older entries are discarded.
|
|
2567
2571
|
*
|
|
@@ -2586,7 +2590,7 @@ interface QueryHistoryOptions {
|
|
|
2586
2590
|
*
|
|
2587
2591
|
* @group Props
|
|
2588
2592
|
*/
|
|
2589
|
-
interface CommonRuleSubComponentProps {
|
|
2593
|
+
export interface CommonRuleSubComponentProps {
|
|
2590
2594
|
rule: RuleType;
|
|
2591
2595
|
}
|
|
2592
2596
|
/**
|
|
@@ -2594,7 +2598,7 @@ interface CommonRuleSubComponentProps {
|
|
|
2594
2598
|
*
|
|
2595
2599
|
* @group Props
|
|
2596
2600
|
*/
|
|
2597
|
-
interface Classnames {
|
|
2601
|
+
export interface Classnames {
|
|
2598
2602
|
/**
|
|
2599
2603
|
* Classnames applied to the root `<div>` element.
|
|
2600
2604
|
*/
|
|
@@ -2631,6 +2635,10 @@ interface Classnames {
|
|
|
2631
2635
|
* Classnames applied to the `<button>` to clone a RuleGroup.
|
|
2632
2636
|
*/
|
|
2633
2637
|
cloneGroup: Classname;
|
|
2638
|
+
/**
|
|
2639
|
+
* Classnames applied to the `<button>` to ungroup a RuleGroup.
|
|
2640
|
+
*/
|
|
2641
|
+
ungroup: Classname;
|
|
2634
2642
|
/**
|
|
2635
2643
|
* Classnames applied to the `<button>` to remove a RuleGroup.
|
|
2636
2644
|
*/
|
|
@@ -2794,7 +2802,7 @@ interface Classnames {
|
|
|
2794
2802
|
*
|
|
2795
2803
|
* @group Props
|
|
2796
2804
|
*/
|
|
2797
|
-
interface Placeholder {
|
|
2805
|
+
export interface Placeholder {
|
|
2798
2806
|
/**
|
|
2799
2807
|
* Value for the placeholder field option if autoSelectField is false,
|
|
2800
2808
|
* or the placeholder operator option if autoSelectOperator is false.
|
|
@@ -2816,7 +2824,7 @@ interface Placeholder {
|
|
|
2816
2824
|
*
|
|
2817
2825
|
* @group Props
|
|
2818
2826
|
*/
|
|
2819
|
-
interface BaseTranslation {
|
|
2827
|
+
export interface BaseTranslation {
|
|
2820
2828
|
title?: string;
|
|
2821
2829
|
}
|
|
2822
2830
|
/**
|
|
@@ -2824,7 +2832,7 @@ interface BaseTranslation {
|
|
|
2824
2832
|
*
|
|
2825
2833
|
* @group Props
|
|
2826
2834
|
*/
|
|
2827
|
-
interface BaseTranslationWithLabel<LabelType = string> extends BaseTranslation {
|
|
2835
|
+
export interface BaseTranslationWithLabel<LabelType = string> extends BaseTranslation {
|
|
2828
2836
|
label?: LabelType;
|
|
2829
2837
|
}
|
|
2830
2838
|
/**
|
|
@@ -2832,13 +2840,13 @@ interface BaseTranslationWithLabel<LabelType = string> extends BaseTranslation {
|
|
|
2832
2840
|
*
|
|
2833
2841
|
* @group Props
|
|
2834
2842
|
*/
|
|
2835
|
-
interface BaseTranslationWithPlaceholders extends BaseTranslation, Placeholder {}
|
|
2843
|
+
export interface BaseTranslationWithPlaceholders extends BaseTranslation, Placeholder {}
|
|
2836
2844
|
/**
|
|
2837
2845
|
* The shape of the `translations` prop.
|
|
2838
2846
|
*
|
|
2839
2847
|
* @group Props
|
|
2840
2848
|
*/
|
|
2841
|
-
interface BaseTranslations<LabelType = string> {
|
|
2849
|
+
export interface BaseTranslations<LabelType = string> {
|
|
2842
2850
|
fields: BaseTranslationWithPlaceholders;
|
|
2843
2851
|
operators: BaseTranslationWithPlaceholders;
|
|
2844
2852
|
values: BaseTranslationWithPlaceholders;
|
|
@@ -2855,6 +2863,7 @@ interface BaseTranslations<LabelType = string> {
|
|
|
2855
2863
|
notToggle: BaseTranslationWithLabel<LabelType>;
|
|
2856
2864
|
cloneRule: BaseTranslationWithLabel<LabelType>;
|
|
2857
2865
|
cloneRuleGroup: BaseTranslationWithLabel<LabelType>;
|
|
2866
|
+
ungroupRuleGroup: BaseTranslationWithLabel<LabelType>;
|
|
2858
2867
|
shiftActionUp: BaseTranslationWithLabel<LabelType>;
|
|
2859
2868
|
shiftActionDown: BaseTranslationWithLabel<LabelType>;
|
|
2860
2869
|
undo: BaseTranslationWithLabel<LabelType>;
|
|
@@ -2875,13 +2884,13 @@ interface BaseTranslations<LabelType = string> {
|
|
|
2875
2884
|
*
|
|
2876
2885
|
* @group Props
|
|
2877
2886
|
*/
|
|
2878
|
-
type BaseTranslationsFull<LabelType = string> = RequiredDeep<BaseTranslations<LabelType>>;
|
|
2887
|
+
export type BaseTranslationsFull<LabelType = string> = RequiredDeep<BaseTranslations<LabelType>>;
|
|
2879
2888
|
/**
|
|
2880
2889
|
* Functions included in the `actions` prop passed to every subcomponent.
|
|
2881
2890
|
*
|
|
2882
2891
|
* @group Props
|
|
2883
2892
|
*/
|
|
2884
|
-
interface QueryActions {
|
|
2893
|
+
export interface QueryActions {
|
|
2885
2894
|
onGroupAdd(group: RuleGroupTypeAny, parentPath: Path, context?: any): void;
|
|
2886
2895
|
onGroupRemove(path: Path): void;
|
|
2887
2896
|
onPropChange(prop: Exclude<keyof RuleType | keyof RuleGroupType, "id" | "path">, value: any, path: Path, context?: any): void;
|
|
@@ -2889,8 +2898,9 @@ interface QueryActions {
|
|
|
2889
2898
|
onRuleRemove(path: Path): void;
|
|
2890
2899
|
moveRule(oldPath: Path, newPath: Path | "up" | "down", clone?: boolean, context?: any): void;
|
|
2891
2900
|
groupRule(sourcePath: Path, targetPath: Path, clone?: boolean, context?: any): void;
|
|
2901
|
+
ungroupRuleGroup(path: Path, context?: any): void;
|
|
2892
2902
|
}
|
|
2893
|
-
interface QueryBuilderFlags {
|
|
2903
|
+
export interface QueryBuilderFlags {
|
|
2894
2904
|
/**
|
|
2895
2905
|
* Set to `false` to avoid calling the `onQueryChange` callback
|
|
2896
2906
|
* when the component mounts.
|
|
@@ -2957,6 +2967,13 @@ interface QueryBuilderFlags {
|
|
|
2957
2967
|
* @default false
|
|
2958
2968
|
*/
|
|
2959
2969
|
showCloneButtons?: boolean;
|
|
2970
|
+
/**
|
|
2971
|
+
* Show the "Ungroup" button on each non-root group, which replaces the group with its
|
|
2972
|
+
* own rules in the parent group.
|
|
2973
|
+
*
|
|
2974
|
+
* @default false
|
|
2975
|
+
*/
|
|
2976
|
+
showUngroupButtons?: boolean;
|
|
2960
2977
|
/**
|
|
2961
2978
|
* Show the "Lock rule" and "Lock group" buttons.
|
|
2962
2979
|
*
|
|
@@ -3024,149 +3041,149 @@ interface QueryBuilderFlags {
|
|
|
3024
3041
|
/**
|
|
3025
3042
|
* @group Defaults
|
|
3026
3043
|
*/
|
|
3027
|
-
declare const defaultPlaceholderName = "~";
|
|
3044
|
+
export declare const defaultPlaceholderName = "~";
|
|
3028
3045
|
/**
|
|
3029
3046
|
* @group Defaults
|
|
3030
3047
|
*/
|
|
3031
|
-
declare const defaultPlaceholderLabel = "------";
|
|
3048
|
+
export declare const defaultPlaceholderLabel = "------";
|
|
3032
3049
|
/**
|
|
3033
3050
|
* Default `name` for placeholder option in the `fields` array.
|
|
3034
3051
|
*
|
|
3035
3052
|
* @group Defaults
|
|
3036
3053
|
*/
|
|
3037
|
-
declare const defaultPlaceholderFieldName: typeof defaultPlaceholderName;
|
|
3054
|
+
export declare const defaultPlaceholderFieldName: typeof defaultPlaceholderName;
|
|
3038
3055
|
/**
|
|
3039
3056
|
* Default `label` for placeholder option in the `fields` array.
|
|
3040
3057
|
*
|
|
3041
3058
|
* @group Defaults
|
|
3042
3059
|
*/
|
|
3043
|
-
declare const defaultPlaceholderFieldLabel: typeof defaultPlaceholderLabel;
|
|
3060
|
+
export declare const defaultPlaceholderFieldLabel: typeof defaultPlaceholderLabel;
|
|
3044
3061
|
/**
|
|
3045
3062
|
* Default `label` for placeholder option group in the `fields` array.
|
|
3046
3063
|
*
|
|
3047
3064
|
* @group Defaults
|
|
3048
3065
|
*/
|
|
3049
|
-
declare const defaultPlaceholderFieldGroupLabel: typeof defaultPlaceholderLabel;
|
|
3066
|
+
export declare const defaultPlaceholderFieldGroupLabel: typeof defaultPlaceholderLabel;
|
|
3050
3067
|
/**
|
|
3051
3068
|
* Default `name` for placeholder option in the `operators` array.
|
|
3052
3069
|
*
|
|
3053
3070
|
* @group Defaults
|
|
3054
3071
|
*/
|
|
3055
|
-
declare const defaultPlaceholderOperatorName: typeof defaultPlaceholderName;
|
|
3072
|
+
export declare const defaultPlaceholderOperatorName: typeof defaultPlaceholderName;
|
|
3056
3073
|
/**
|
|
3057
3074
|
* Default `label` for placeholder option in the `operators` array.
|
|
3058
3075
|
*
|
|
3059
3076
|
* @group Defaults
|
|
3060
3077
|
*/
|
|
3061
|
-
declare const defaultPlaceholderOperatorLabel: typeof defaultPlaceholderLabel;
|
|
3078
|
+
export declare const defaultPlaceholderOperatorLabel: typeof defaultPlaceholderLabel;
|
|
3062
3079
|
/**
|
|
3063
3080
|
* Default `label` for placeholder option group in the `operators` array.
|
|
3064
3081
|
*
|
|
3065
3082
|
* @group Defaults
|
|
3066
3083
|
*/
|
|
3067
|
-
declare const defaultPlaceholderOperatorGroupLabel: typeof defaultPlaceholderLabel;
|
|
3084
|
+
export declare const defaultPlaceholderOperatorGroupLabel: typeof defaultPlaceholderLabel;
|
|
3068
3085
|
/**
|
|
3069
3086
|
* Default `name` for placeholder option in the `values` array.
|
|
3070
3087
|
*
|
|
3071
3088
|
* @group Defaults
|
|
3072
3089
|
*/
|
|
3073
|
-
declare const defaultPlaceholderValueName: typeof defaultPlaceholderName;
|
|
3090
|
+
export declare const defaultPlaceholderValueName: typeof defaultPlaceholderName;
|
|
3074
3091
|
/**
|
|
3075
3092
|
* Default `label` for placeholder option in the `values` array.
|
|
3076
3093
|
*
|
|
3077
3094
|
* @group Defaults
|
|
3078
3095
|
*/
|
|
3079
|
-
declare const defaultPlaceholderValueLabel: typeof defaultPlaceholderLabel;
|
|
3096
|
+
export declare const defaultPlaceholderValueLabel: typeof defaultPlaceholderLabel;
|
|
3080
3097
|
/**
|
|
3081
3098
|
* Default `label` for placeholder option group in the `values` array.
|
|
3082
3099
|
*
|
|
3083
3100
|
* @group Defaults
|
|
3084
3101
|
*/
|
|
3085
|
-
declare const defaultPlaceholderValueGroupLabel: typeof defaultPlaceholderLabel;
|
|
3102
|
+
export declare const defaultPlaceholderValueGroupLabel: typeof defaultPlaceholderLabel;
|
|
3086
3103
|
/**
|
|
3087
3104
|
* Default configuration of translatable strings.
|
|
3088
3105
|
*
|
|
3089
3106
|
* @group Defaults
|
|
3090
3107
|
*/
|
|
3091
|
-
declare const defaultTranslations: BaseTranslationsFull;
|
|
3108
|
+
export declare const defaultTranslations: BaseTranslationsFull;
|
|
3092
3109
|
/**
|
|
3093
3110
|
* Default character used to `.join` and `.split` arrays.
|
|
3094
3111
|
*
|
|
3095
3112
|
* @group Defaults
|
|
3096
3113
|
*/
|
|
3097
|
-
declare const defaultJoinChar = ",";
|
|
3098
|
-
type DefaultOperators = StringUnionToFullOptionArray<DefaultOperatorName>;
|
|
3099
|
-
declare const defaultOperatorLabelMap: Record<DefaultOperatorName, string>;
|
|
3100
|
-
declare const defaultCombinatorLabelMap: Record<DefaultCombinatorNameExtended, string>;
|
|
3114
|
+
export declare const defaultJoinChar = ",";
|
|
3115
|
+
export type DefaultOperators = StringUnionToFullOptionArray<DefaultOperatorName>;
|
|
3116
|
+
export declare const defaultOperatorLabelMap: Record<DefaultOperatorName, string>;
|
|
3117
|
+
export declare const defaultCombinatorLabelMap: Record<DefaultCombinatorNameExtended, string>;
|
|
3101
3118
|
/**
|
|
3102
3119
|
* Default operator list.
|
|
3103
3120
|
*
|
|
3104
3121
|
* @group Defaults
|
|
3105
3122
|
*/
|
|
3106
|
-
declare const defaultOperators: DefaultOperators;
|
|
3123
|
+
export declare const defaultOperators: DefaultOperators;
|
|
3107
3124
|
/**
|
|
3108
3125
|
* Map of default operators to their respective opposite/negating operators.
|
|
3109
3126
|
*
|
|
3110
3127
|
* @group Defaults
|
|
3111
3128
|
*/
|
|
3112
|
-
declare const defaultOperatorNegationMap: Record<DefaultOperatorName, DefaultOperatorName>;
|
|
3129
|
+
export declare const defaultOperatorNegationMap: Record<DefaultOperatorName, DefaultOperatorName>;
|
|
3113
3130
|
/**
|
|
3114
3131
|
* Relational/comparison operators (`=`, `!=`, `<`, `>`, `<=`, `>=`).
|
|
3115
3132
|
*
|
|
3116
3133
|
* @group Defaults
|
|
3117
3134
|
*/
|
|
3118
|
-
declare const relationalOperators: Set<DefaultOperatorName>;
|
|
3135
|
+
export declare const relationalOperators: Set<DefaultOperatorName>;
|
|
3119
3136
|
/**
|
|
3120
3137
|
* Substring/text-matching operators (`contains`, `beginsWith`, `endsWith`, and negations).
|
|
3121
3138
|
*
|
|
3122
3139
|
* @group Defaults
|
|
3123
3140
|
*/
|
|
3124
|
-
declare const substringOperators: Set<DefaultOperatorName>;
|
|
3141
|
+
export declare const substringOperators: Set<DefaultOperatorName>;
|
|
3125
3142
|
/**
|
|
3126
3143
|
* Null-check operators (`null`, `notNull`).
|
|
3127
3144
|
*
|
|
3128
3145
|
* @group Defaults
|
|
3129
3146
|
*/
|
|
3130
|
-
declare const nullOperators: Set<DefaultOperatorName>;
|
|
3147
|
+
export declare const nullOperators: Set<DefaultOperatorName>;
|
|
3131
3148
|
/**
|
|
3132
3149
|
* List-membership operators (`in`, `notIn`).
|
|
3133
3150
|
*
|
|
3134
3151
|
* @group Defaults
|
|
3135
3152
|
*/
|
|
3136
|
-
declare const inOperators: Set<DefaultOperatorName>;
|
|
3153
|
+
export declare const inOperators: Set<DefaultOperatorName>;
|
|
3137
3154
|
/**
|
|
3138
3155
|
* Range operators (`between`, `notBetween`).
|
|
3139
3156
|
*
|
|
3140
3157
|
* @group Defaults
|
|
3141
3158
|
*/
|
|
3142
|
-
declare const betweenOperators: Set<DefaultOperatorName>;
|
|
3143
|
-
type DefaultCombinators = StringUnionToFullOptionArray<DefaultCombinatorName>;
|
|
3159
|
+
export declare const betweenOperators: Set<DefaultOperatorName>;
|
|
3160
|
+
export type DefaultCombinators = StringUnionToFullOptionArray<DefaultCombinatorName>;
|
|
3144
3161
|
/**
|
|
3145
3162
|
* Default combinator list.
|
|
3146
3163
|
*
|
|
3147
3164
|
* @group Defaults
|
|
3148
3165
|
*/
|
|
3149
|
-
declare const defaultCombinators: DefaultCombinators;
|
|
3150
|
-
type DefaultCombinatorsExtended = StringUnionToFullOptionArray<DefaultCombinatorNameExtended>;
|
|
3166
|
+
export declare const defaultCombinators: DefaultCombinators;
|
|
3167
|
+
export type DefaultCombinatorsExtended = StringUnionToFullOptionArray<DefaultCombinatorNameExtended>;
|
|
3151
3168
|
/**
|
|
3152
3169
|
* Default combinator list, with `XOR` added.
|
|
3153
3170
|
*
|
|
3154
3171
|
* @group Defaults
|
|
3155
3172
|
*/
|
|
3156
|
-
declare const defaultCombinatorsExtended: DefaultCombinatorsExtended;
|
|
3157
|
-
type DefaultMatchModes = StringUnionToFullOptionArray<MatchMode>;
|
|
3173
|
+
export declare const defaultCombinatorsExtended: DefaultCombinatorsExtended;
|
|
3174
|
+
export type DefaultMatchModes = StringUnionToFullOptionArray<MatchMode>;
|
|
3158
3175
|
/**
|
|
3159
3176
|
* Default match modes.
|
|
3160
3177
|
*
|
|
3161
3178
|
* @group Defaults
|
|
3162
3179
|
*/
|
|
3163
|
-
declare const defaultMatchModes: DefaultMatchModes;
|
|
3180
|
+
export declare const defaultMatchModes: DefaultMatchModes;
|
|
3164
3181
|
/**
|
|
3165
3182
|
* Standard classnames applied to each component.
|
|
3166
3183
|
*
|
|
3167
3184
|
* @group Defaults
|
|
3168
3185
|
*/
|
|
3169
|
-
declare const standardClassnames: {
|
|
3186
|
+
export declare const standardClassnames: {
|
|
3170
3187
|
readonly queryBuilder: "queryBuilder";
|
|
3171
3188
|
readonly ruleGroup: "ruleGroup";
|
|
3172
3189
|
readonly header: "ruleGroup-header";
|
|
@@ -3176,6 +3193,7 @@ declare const standardClassnames: {
|
|
|
3176
3193
|
readonly addGroup: "ruleGroup-addGroup";
|
|
3177
3194
|
readonly cloneRule: "rule-cloneRule";
|
|
3178
3195
|
readonly cloneGroup: "ruleGroup-cloneGroup";
|
|
3196
|
+
readonly ungroup: "ruleGroup-ungroup";
|
|
3179
3197
|
readonly removeGroup: "ruleGroup-remove";
|
|
3180
3198
|
readonly notToggle: "ruleGroup-notToggle";
|
|
3181
3199
|
readonly rule: "rule";
|
|
@@ -3220,13 +3238,13 @@ declare const standardClassnames: {
|
|
|
3220
3238
|
*
|
|
3221
3239
|
* @group Defaults
|
|
3222
3240
|
*/
|
|
3223
|
-
declare const defaultControlClassnames: Classnames;
|
|
3241
|
+
export declare const defaultControlClassnames: Classnames;
|
|
3224
3242
|
/**
|
|
3225
3243
|
* Default reason codes for a group being invalid.
|
|
3226
3244
|
*
|
|
3227
3245
|
* @group Defaults
|
|
3228
3246
|
*/
|
|
3229
|
-
declare const groupInvalidReasons: {
|
|
3247
|
+
export declare const groupInvalidReasons: {
|
|
3230
3248
|
readonly empty: "empty";
|
|
3231
3249
|
readonly invalidCombinator: "invalid combinator";
|
|
3232
3250
|
readonly invalidIndependentCombinators: "invalid independent combinators";
|
|
@@ -3236,13 +3254,14 @@ declare const groupInvalidReasons: {
|
|
|
3236
3254
|
*
|
|
3237
3255
|
* @group Defaults
|
|
3238
3256
|
*/
|
|
3239
|
-
declare const TestID: {
|
|
3257
|
+
export declare const TestID: {
|
|
3240
3258
|
readonly rule: "rule";
|
|
3241
3259
|
readonly ruleGroup: "rule-group";
|
|
3242
3260
|
readonly inlineCombinator: "inline-combinator";
|
|
3243
3261
|
readonly addGroup: "add-group";
|
|
3244
3262
|
readonly removeGroup: "remove-group";
|
|
3245
3263
|
readonly cloneGroup: "clone-group";
|
|
3264
|
+
readonly ungroup: "ungroup";
|
|
3246
3265
|
readonly cloneRule: "clone-rule";
|
|
3247
3266
|
readonly addRule: "add-rule";
|
|
3248
3267
|
readonly removeRule: "remove-rule";
|
|
@@ -3263,7 +3282,7 @@ declare const TestID: {
|
|
|
3263
3282
|
readonly valueSourceSelector: "value-source-selector";
|
|
3264
3283
|
readonly matchModeEditor: "match-mode-editor";
|
|
3265
3284
|
};
|
|
3266
|
-
declare const LogType: {
|
|
3285
|
+
export declare const LogType: {
|
|
3267
3286
|
readonly parentPathDisabled: "action aborted: parent path disabled";
|
|
3268
3287
|
readonly pathDisabled: "action aborted: path is disabled";
|
|
3269
3288
|
readonly queryUpdate: "query updated";
|
|
@@ -3274,38 +3293,40 @@ declare const LogType: {
|
|
|
3274
3293
|
readonly onMoveRuleFalse: "onMoveRule callback returned false";
|
|
3275
3294
|
readonly onMoveGroupFalse: "onMoveGroup callback returned false";
|
|
3276
3295
|
readonly onRemoveFalse: "onRemove callback returned false";
|
|
3296
|
+
readonly onUngroupFalse: "onUngroup callback returned false";
|
|
3277
3297
|
readonly add: "rule or group added";
|
|
3278
3298
|
readonly remove: "rule or group removed";
|
|
3279
3299
|
readonly update: "rule or group updated";
|
|
3280
3300
|
readonly move: "rule or group moved";
|
|
3281
3301
|
readonly group: "rule or group grouped with another";
|
|
3302
|
+
readonly ungroup: "group replaced by its own rules";
|
|
3282
3303
|
};
|
|
3283
3304
|
/**
|
|
3284
3305
|
* The {@link Path} of the root group.
|
|
3285
3306
|
*
|
|
3286
3307
|
* @group Defaults
|
|
3287
3308
|
*/
|
|
3288
|
-
declare const rootPath: Path;
|
|
3309
|
+
export declare const rootPath: Path;
|
|
3289
3310
|
/**
|
|
3290
3311
|
* Default values for all `boolean`
|
|
3291
3312
|
* {@link react-querybuilder!QueryBuilder QueryBuilder} options.
|
|
3292
3313
|
*
|
|
3293
3314
|
* @group Defaults
|
|
3294
3315
|
*/
|
|
3295
|
-
declare const queryBuilderFlagDefaults: Required<QueryBuilderFlags>;
|
|
3316
|
+
export declare const queryBuilderFlagDefaults: Required<QueryBuilderFlags>;
|
|
3296
3317
|
/**
|
|
3297
3318
|
* Default maximum number of undo steps retained by query history.
|
|
3298
3319
|
*
|
|
3299
3320
|
* @group Defaults
|
|
3300
3321
|
*/
|
|
3301
|
-
declare const defaultMaxHistory = 50;
|
|
3322
|
+
export declare const defaultMaxHistory = 50;
|
|
3302
3323
|
/**
|
|
3303
3324
|
* Default time window (in milliseconds) within which consecutive changes to the same
|
|
3304
3325
|
* property of the same rule are coalesced into a single undo step.
|
|
3305
3326
|
*
|
|
3306
3327
|
* @group Defaults
|
|
3307
3328
|
*/
|
|
3308
|
-
declare const defaultCoalesceMs = 500;
|
|
3329
|
+
export declare const defaultCoalesceMs = 500;
|
|
3309
3330
|
//#endregion
|
|
3310
3331
|
//#region src/utils/queryTools.d.ts
|
|
3311
3332
|
/**
|
|
@@ -3318,17 +3339,17 @@ declare const defaultCoalesceMs = 500;
|
|
|
3318
3339
|
*
|
|
3319
3340
|
* @group Query Tools
|
|
3320
3341
|
*/
|
|
3321
|
-
type AbortReason = "target-not-found" | "parent-not-found" | "parent-not-a-group" | "destination-not-found" | "root-not-allowed" | "not-a-combinator-slot" | "same-location" | "no-change" | "target-disabled" | "parent-disabled" | "max-levels-exceeded";
|
|
3342
|
+
export type AbortReason = "target-not-found" | "parent-not-found" | "parent-not-a-group" | "target-not-a-group" | "destination-not-found" | "root-not-allowed" | "not-a-combinator-slot" | "same-location" | "no-change" | "target-disabled" | "parent-disabled" | "max-levels-exceeded";
|
|
3322
3343
|
/**
|
|
3323
3344
|
* Details about an aborted query tool operation.
|
|
3324
3345
|
*
|
|
3325
3346
|
* @group Query Tools
|
|
3326
3347
|
*/
|
|
3327
|
-
interface AbortInfo {
|
|
3348
|
+
export interface AbortInfo {
|
|
3328
3349
|
/** Why the operation was aborted. */
|
|
3329
3350
|
reason: AbortReason;
|
|
3330
3351
|
/** The query tool that aborted. */
|
|
3331
|
-
operation: "add" | "remove" | "update" | "move" | "insert" | "group";
|
|
3352
|
+
operation: "add" | "remove" | "update" | "move" | "insert" | "group" | "ungroup";
|
|
3332
3353
|
/** The path or `id` that could not be used, when the reason relates to a specific target. */
|
|
3333
3354
|
pathOrID?: Path | string;
|
|
3334
3355
|
}
|
|
@@ -3342,7 +3363,7 @@ interface AbortInfo {
|
|
|
3342
3363
|
*
|
|
3343
3364
|
* @group Query Tools
|
|
3344
3365
|
*/
|
|
3345
|
-
interface GuardOptions {
|
|
3366
|
+
export interface GuardOptions {
|
|
3346
3367
|
/**
|
|
3347
3368
|
* Abort when the target (or its parent, for `add`/`insert`) is disabled, either directly or
|
|
3348
3369
|
* by descending from a disabled group. Defaults to `false`.
|
|
@@ -3373,7 +3394,7 @@ interface GuardOptions {
|
|
|
3373
3394
|
*
|
|
3374
3395
|
* @group Query Tools
|
|
3375
3396
|
*/
|
|
3376
|
-
interface AbortOptions extends GuardOptions {
|
|
3397
|
+
export interface AbortOptions extends GuardOptions {
|
|
3377
3398
|
/**
|
|
3378
3399
|
* Called when the operation returns the query unmodified, with the reason why. Query tools
|
|
3379
3400
|
* never throw, so this is the only way to distinguish "the target was invalid" from
|
|
@@ -3386,7 +3407,7 @@ interface AbortOptions extends GuardOptions {
|
|
|
3386
3407
|
*
|
|
3387
3408
|
* @group Query Tools
|
|
3388
3409
|
*/
|
|
3389
|
-
interface QueryToolOptions extends AbortOptions {
|
|
3410
|
+
export interface QueryToolOptions extends AbortOptions {
|
|
3390
3411
|
/**
|
|
3391
3412
|
* Set `false` to skip immer's auto-freeze on the returned query, e.g. when the query will be
|
|
3392
3413
|
* handed to a framework that wraps it in a proxy (Vue `reactive`, Solid stores) or otherwise
|
|
@@ -3405,7 +3426,7 @@ interface QueryToolOptions extends AbortOptions {
|
|
|
3405
3426
|
*
|
|
3406
3427
|
* @group Query Tools
|
|
3407
3428
|
*/
|
|
3408
|
-
declare const getGuardAbortReason: (query: RuleGroupTypeAny, pathOrID: Path | string | undefined, guards?: GuardOptions, { asParent }?: {
|
|
3429
|
+
export declare const getGuardAbortReason: (query: RuleGroupTypeAny, pathOrID: Path | string | undefined, guards?: GuardOptions, { asParent }?: {
|
|
3409
3430
|
asParent?: boolean;
|
|
3410
3431
|
}) => AbortReason | null;
|
|
3411
3432
|
/**
|
|
@@ -3413,13 +3434,13 @@ declare const getGuardAbortReason: (query: RuleGroupTypeAny, pathOrID: Path | st
|
|
|
3413
3434
|
*
|
|
3414
3435
|
* @group Query Tools
|
|
3415
3436
|
*/
|
|
3416
|
-
declare const exceedsMaxLevels: (parentPath: Path | undefined, { maxLevels }?: GuardOptions) => boolean;
|
|
3437
|
+
export declare const exceedsMaxLevels: (parentPath: Path | undefined, { maxLevels }?: GuardOptions) => boolean;
|
|
3417
3438
|
/**
|
|
3418
3439
|
* Options for {@link add}.
|
|
3419
3440
|
*
|
|
3420
3441
|
* @group Query Tools
|
|
3421
3442
|
*/
|
|
3422
|
-
interface AddOptions extends QueryToolOptions {
|
|
3443
|
+
export interface AddOptions extends QueryToolOptions {
|
|
3423
3444
|
/**
|
|
3424
3445
|
* If the query extends `RuleGroupTypeIC` (i.e. the query has independent
|
|
3425
3446
|
* combinators), then the first combinator in this list will be inserted
|
|
@@ -3438,7 +3459,7 @@ interface AddOptions extends QueryToolOptions {
|
|
|
3438
3459
|
*/
|
|
3439
3460
|
idGenerator?: () => string;
|
|
3440
3461
|
}
|
|
3441
|
-
interface AddMethod {
|
|
3462
|
+
export interface AddMethod {
|
|
3442
3463
|
<RG extends RuleGroupTypeAny>(query: RG, ruleOrGroup: RG | RuleType, parentPathOrID: Path | string, options?: AddOptions): RG;
|
|
3443
3464
|
}
|
|
3444
3465
|
/**
|
|
@@ -3448,7 +3469,7 @@ interface AddMethod {
|
|
|
3448
3469
|
*
|
|
3449
3470
|
* @group Query Tools
|
|
3450
3471
|
*/
|
|
3451
|
-
declare const add: AddMethod;
|
|
3472
|
+
export declare const add: AddMethod;
|
|
3452
3473
|
/**
|
|
3453
3474
|
* Adds a rule or group to a query in place.
|
|
3454
3475
|
*
|
|
@@ -3456,13 +3477,13 @@ declare const add: AddMethod;
|
|
|
3456
3477
|
*
|
|
3457
3478
|
* @group Query Tools
|
|
3458
3479
|
*/
|
|
3459
|
-
declare const addInPlace: AddMethod;
|
|
3480
|
+
export declare const addInPlace: AddMethod;
|
|
3460
3481
|
/**
|
|
3461
3482
|
* Options for {@link update}.
|
|
3462
3483
|
*
|
|
3463
3484
|
* @group Query Tools
|
|
3464
3485
|
*/
|
|
3465
|
-
interface UpdateOptions extends QueryToolOptions {
|
|
3486
|
+
export interface UpdateOptions extends QueryToolOptions {
|
|
3466
3487
|
/**
|
|
3467
3488
|
* When updating the `field` of a rule, the rule's `operator`, `value`, and `valueSource`
|
|
3468
3489
|
* will be reset to their respective defaults. Defaults to `true`.
|
|
@@ -3490,7 +3511,7 @@ interface UpdateOptions extends QueryToolOptions {
|
|
|
3490
3511
|
*/
|
|
3491
3512
|
getMatchModes?: (field: string) => MatchModeOptions;
|
|
3492
3513
|
}
|
|
3493
|
-
interface UpdateMethod {
|
|
3514
|
+
export interface UpdateMethod {
|
|
3494
3515
|
/**
|
|
3495
3516
|
* Updates a single property of a rule or group.
|
|
3496
3517
|
*/
|
|
@@ -3518,7 +3539,7 @@ interface UpdateMethod {
|
|
|
3518
3539
|
*
|
|
3519
3540
|
* @group Query Tools
|
|
3520
3541
|
*/
|
|
3521
|
-
declare const update: UpdateMethod;
|
|
3542
|
+
export declare const update: UpdateMethod;
|
|
3522
3543
|
/**
|
|
3523
3544
|
* Updates one or more properties of a rule or group within a query in place.
|
|
3524
3545
|
* See {@link update} for the supported argument forms and ordering semantics.
|
|
@@ -3527,14 +3548,14 @@ declare const update: UpdateMethod;
|
|
|
3527
3548
|
*
|
|
3528
3549
|
* @group Query Tools
|
|
3529
3550
|
*/
|
|
3530
|
-
declare const updateInPlace: UpdateMethod;
|
|
3551
|
+
export declare const updateInPlace: UpdateMethod;
|
|
3531
3552
|
/**
|
|
3532
3553
|
* Options for {@link remove}.
|
|
3533
3554
|
*
|
|
3534
3555
|
* @group Query Tools
|
|
3535
3556
|
*/
|
|
3536
|
-
interface RemoveOptions extends QueryToolOptions {}
|
|
3537
|
-
interface RemoveMethod {
|
|
3557
|
+
export interface RemoveOptions extends QueryToolOptions {}
|
|
3558
|
+
export interface RemoveMethod {
|
|
3538
3559
|
<RG extends RuleGroupTypeAny>(query: RG, pathOrID: Path | string, options?: RemoveOptions): RG;
|
|
3539
3560
|
}
|
|
3540
3561
|
/**
|
|
@@ -3544,7 +3565,7 @@ interface RemoveMethod {
|
|
|
3544
3565
|
*
|
|
3545
3566
|
* @group Query Tools
|
|
3546
3567
|
*/
|
|
3547
|
-
declare const remove: RemoveMethod;
|
|
3568
|
+
export declare const remove: RemoveMethod;
|
|
3548
3569
|
/**
|
|
3549
3570
|
* Removes a rule or group from a query in place.
|
|
3550
3571
|
*
|
|
@@ -3552,13 +3573,41 @@ declare const remove: RemoveMethod;
|
|
|
3552
3573
|
*
|
|
3553
3574
|
* @group Query Tools
|
|
3554
3575
|
*/
|
|
3555
|
-
declare const removeInPlace: RemoveMethod;
|
|
3576
|
+
export declare const removeInPlace: RemoveMethod;
|
|
3577
|
+
/**
|
|
3578
|
+
* Options for {@link ungroup}.
|
|
3579
|
+
*
|
|
3580
|
+
* @group Query Tools
|
|
3581
|
+
*/
|
|
3582
|
+
export interface UngroupOptions extends QueryToolOptions {}
|
|
3583
|
+
export interface UngroupMethod {
|
|
3584
|
+
<RG extends RuleGroupTypeAny>(query: RG, pathOrID: Path | string, options?: UngroupOptions): RG;
|
|
3585
|
+
}
|
|
3586
|
+
/**
|
|
3587
|
+
* Replaces a group with its own rules in its parent group, without mutating the original query.
|
|
3588
|
+
*
|
|
3589
|
+
* The group's `combinator`, `not`, `id`, `muted`, and `disabled` properties are discarded; its
|
|
3590
|
+
* rules keep their `id`s since they remain in the same query. An empty group is simply removed.
|
|
3591
|
+
*
|
|
3592
|
+
* @returns A new query with the group's rules promoted into its parent group.
|
|
3593
|
+
*
|
|
3594
|
+
* @group Query Tools
|
|
3595
|
+
*/
|
|
3596
|
+
export declare const ungroup: UngroupMethod;
|
|
3597
|
+
/**
|
|
3598
|
+
* Replaces a group with its own rules in its parent group, in place.
|
|
3599
|
+
*
|
|
3600
|
+
* @returns The query (mutated in place) with the group's rules promoted into its parent group.
|
|
3601
|
+
*
|
|
3602
|
+
* @group Query Tools
|
|
3603
|
+
*/
|
|
3604
|
+
export declare const ungroupInPlace: UngroupMethod;
|
|
3556
3605
|
/**
|
|
3557
3606
|
* Options for {@link move}.
|
|
3558
3607
|
*
|
|
3559
3608
|
* @group Query Tools
|
|
3560
3609
|
*/
|
|
3561
|
-
interface MoveOptions extends QueryToolOptions {
|
|
3610
|
+
export interface MoveOptions extends QueryToolOptions {
|
|
3562
3611
|
/**
|
|
3563
3612
|
* When `true`, the source rule/group will not be removed from its original path.
|
|
3564
3613
|
*/
|
|
@@ -3574,7 +3623,7 @@ interface MoveOptions extends QueryToolOptions {
|
|
|
3574
3623
|
*/
|
|
3575
3624
|
idGenerator?: () => string;
|
|
3576
3625
|
}
|
|
3577
|
-
interface MoveMethod {
|
|
3626
|
+
export interface MoveMethod {
|
|
3578
3627
|
<RG extends RuleGroupTypeAny>(query: RG, oldPathOrID: Path | string, newPath: Path | "up" | "down", options?: MoveOptions): RG;
|
|
3579
3628
|
}
|
|
3580
3629
|
/**
|
|
@@ -3585,7 +3634,7 @@ interface MoveMethod {
|
|
|
3585
3634
|
*
|
|
3586
3635
|
* @group Query Tools
|
|
3587
3636
|
*/
|
|
3588
|
-
declare const move: MoveMethod;
|
|
3637
|
+
export declare const move: MoveMethod;
|
|
3589
3638
|
/**
|
|
3590
3639
|
* Moves a rule or group from one path to another in place.
|
|
3591
3640
|
* In the options parameter, pass `{ clone: true }` to copy instead of move.
|
|
@@ -3594,13 +3643,13 @@ declare const move: MoveMethod;
|
|
|
3594
3643
|
*
|
|
3595
3644
|
* @group Query Tools
|
|
3596
3645
|
*/
|
|
3597
|
-
declare const moveInPlace: MoveMethod;
|
|
3646
|
+
export declare const moveInPlace: MoveMethod;
|
|
3598
3647
|
/**
|
|
3599
3648
|
* Options for {@link insert}.
|
|
3600
3649
|
*
|
|
3601
3650
|
* @group Query Tools
|
|
3602
3651
|
*/
|
|
3603
|
-
interface InsertOptions extends QueryToolOptions {
|
|
3652
|
+
export interface InsertOptions extends QueryToolOptions {
|
|
3604
3653
|
/**
|
|
3605
3654
|
* If the query extends `RuleGroupTypeIC` (i.e. the query has independent
|
|
3606
3655
|
* combinators), then the first combinator in this list will be inserted
|
|
@@ -3633,7 +3682,7 @@ interface InsertOptions extends QueryToolOptions {
|
|
|
3633
3682
|
*/
|
|
3634
3683
|
replace?: boolean;
|
|
3635
3684
|
}
|
|
3636
|
-
interface InsertMethod {
|
|
3685
|
+
export interface InsertMethod {
|
|
3637
3686
|
<RG extends RuleGroupTypeAny>(query: RG, ruleOrGroup: RG | RuleType, path: number[], options?: InsertOptions): RG;
|
|
3638
3687
|
}
|
|
3639
3688
|
/**
|
|
@@ -3643,7 +3692,7 @@ interface InsertMethod {
|
|
|
3643
3692
|
*
|
|
3644
3693
|
* @group Query Tools
|
|
3645
3694
|
*/
|
|
3646
|
-
declare const insert: InsertMethod;
|
|
3695
|
+
export declare const insert: InsertMethod;
|
|
3647
3696
|
/**
|
|
3648
3697
|
* Inserts a rule or group into a query in place.
|
|
3649
3698
|
*
|
|
@@ -3651,13 +3700,13 @@ declare const insert: InsertMethod;
|
|
|
3651
3700
|
*
|
|
3652
3701
|
* @group Query Tools
|
|
3653
3702
|
*/
|
|
3654
|
-
declare const insertInPlace: InsertMethod;
|
|
3703
|
+
export declare const insertInPlace: InsertMethod;
|
|
3655
3704
|
/**
|
|
3656
3705
|
* Options for {@link group}.
|
|
3657
3706
|
*
|
|
3658
3707
|
* @group Query Tools
|
|
3659
3708
|
*/
|
|
3660
|
-
interface GroupOptions extends QueryToolOptions {
|
|
3709
|
+
export interface GroupOptions extends QueryToolOptions {
|
|
3661
3710
|
/**
|
|
3662
3711
|
* When `true`, the source rule/group will not be removed from its original path.
|
|
3663
3712
|
*/
|
|
@@ -3673,7 +3722,7 @@ interface GroupOptions extends QueryToolOptions {
|
|
|
3673
3722
|
*/
|
|
3674
3723
|
idGenerator?: () => string;
|
|
3675
3724
|
}
|
|
3676
|
-
interface GroupMethod {
|
|
3725
|
+
export interface GroupMethod {
|
|
3677
3726
|
<RG extends RuleGroupTypeAny>(query: RG, sourcePathOrID: Path | string, targetPathOrID: Path | string, options?: GroupOptions): RG;
|
|
3678
3727
|
}
|
|
3679
3728
|
/**
|
|
@@ -3685,7 +3734,7 @@ interface GroupMethod {
|
|
|
3685
3734
|
*
|
|
3686
3735
|
* @group Query Tools
|
|
3687
3736
|
*/
|
|
3688
|
-
declare const group: GroupMethod;
|
|
3737
|
+
export declare const group: GroupMethod;
|
|
3689
3738
|
/**
|
|
3690
3739
|
* Creates a new group at a target path with its `rules` array containing the current
|
|
3691
3740
|
* objects at the target path and the source path in place.
|
|
@@ -3695,7 +3744,7 @@ declare const group: GroupMethod;
|
|
|
3695
3744
|
*
|
|
3696
3745
|
* @group Query Tools
|
|
3697
3746
|
*/
|
|
3698
|
-
declare const groupInPlace: GroupMethod;
|
|
3747
|
+
export declare const groupInPlace: GroupMethod;
|
|
3699
3748
|
//#endregion
|
|
3700
3749
|
//#region src/utils/abortReasons.d.ts
|
|
3701
3750
|
/**
|
|
@@ -3708,7 +3757,7 @@ declare const groupInPlace: GroupMethod;
|
|
|
3708
3757
|
*
|
|
3709
3758
|
* @group Query Tools
|
|
3710
3759
|
*/
|
|
3711
|
-
declare const strictAbortReasons: readonly AbortReason[];
|
|
3760
|
+
export declare const strictAbortReasons: readonly AbortReason[];
|
|
3712
3761
|
//#endregion
|
|
3713
3762
|
//#region src/utils/arrayUtils.d.ts
|
|
3714
3763
|
/**
|
|
@@ -3723,7 +3772,7 @@ declare const strictAbortReasons: readonly AbortReason[];
|
|
|
3723
3772
|
* // would return
|
|
3724
3773
|
* ['this,,that', '', 'the other', '', '', ',']
|
|
3725
3774
|
*/
|
|
3726
|
-
declare const splitBy: (str?: string, splitChar?: string) => string[];
|
|
3775
|
+
export declare const splitBy: (str?: string, splitChar?: string) => string[];
|
|
3727
3776
|
/**
|
|
3728
3777
|
* Joins an array of strings using the given character (see {@link defaultJoinChar}). When
|
|
3729
3778
|
* the given character appears in an array element, a backslash will be added just before it
|
|
@@ -3737,31 +3786,31 @@ declare const splitBy: (str?: string, splitChar?: string) => string[];
|
|
|
3737
3786
|
* // would return
|
|
3738
3787
|
* 'this\\,\\,that, , the other, , , \\,'
|
|
3739
3788
|
*/
|
|
3740
|
-
declare const joinWith: (strArr: unknown[], joinChar?: string) => string;
|
|
3789
|
+
export declare const joinWith: (strArr: unknown[], joinChar?: string) => string;
|
|
3741
3790
|
type IsUnknown<T> = unknown extends T ? true : false;
|
|
3742
3791
|
type Trimmed<T> = IsUnknown<T> extends true ? string : T;
|
|
3743
3792
|
/**
|
|
3744
3793
|
* Trims the value if it is a string. Otherwise returns the value as is.
|
|
3745
3794
|
*/
|
|
3746
|
-
declare const trimIfString: <T>(val: T) => Trimmed<T>;
|
|
3795
|
+
export declare const trimIfString: <T>(val: T) => Trimmed<T>;
|
|
3747
3796
|
type ToArrayResult<T> = IsUnknown<T> extends true ? string[] : T extends readonly (infer U)[] ? Trimmed<U>[] : T extends string ? string[] : T extends number ? number[] : never[];
|
|
3748
3797
|
/**
|
|
3749
3798
|
* Splits a string by comma then trims each element. Arrays are returned as is except
|
|
3750
3799
|
* any string elements are trimmed.
|
|
3751
3800
|
*/
|
|
3752
|
-
declare const toArray: <T>(a: T, { retainEmptyStrings }?: {
|
|
3801
|
+
export declare const toArray: <T>(a: T, { retainEmptyStrings }?: {
|
|
3753
3802
|
retainEmptyStrings?: boolean;
|
|
3754
3803
|
}) => ToArrayResult<T>;
|
|
3755
3804
|
/**
|
|
3756
3805
|
* Determines if an array is free of `null`/`undefined`.
|
|
3757
3806
|
*/
|
|
3758
|
-
declare const nullFreeArray: <T>(arr: T[]) => arr is Exclude<T, null>[];
|
|
3807
|
+
export declare const nullFreeArray: <T>(arr: T[]) => arr is Exclude<T, null>[];
|
|
3759
3808
|
//#endregion
|
|
3760
3809
|
//#region ../../node_modules/clsx/clsx.d.mts
|
|
3761
3810
|
type ClassValue = ClassArray | ClassDictionary | string | number | bigint | null | boolean | undefined;
|
|
3762
3811
|
type ClassDictionary = Record<string, any>;
|
|
3763
3812
|
type ClassArray = ClassValue[];
|
|
3764
|
-
declare function clsx(...inputs: ClassValue[]): string;
|
|
3813
|
+
export declare function clsx(...inputs: ClassValue[]): string;
|
|
3765
3814
|
//#endregion
|
|
3766
3815
|
//#region src/utils/coalesce.d.ts
|
|
3767
3816
|
/**
|
|
@@ -3784,7 +3833,7 @@ declare function clsx(...inputs: ClassValue[]): string;
|
|
|
3784
3833
|
* @param now Timestamp of the change being recorded.
|
|
3785
3834
|
* @param coalesceMs Coalescing window in milliseconds.
|
|
3786
3835
|
*/
|
|
3787
|
-
declare const shouldCoalesce: (prevSig: string | undefined, nextSig: string, prevAt: number, now: number, coalesceMs?: number) => boolean;
|
|
3836
|
+
export declare const shouldCoalesce: (prevSig: string | undefined, nextSig: string, prevAt: number, now: number, coalesceMs?: number) => boolean;
|
|
3788
3837
|
//#endregion
|
|
3789
3838
|
//#region src/utils/convertQuery.d.ts
|
|
3790
3839
|
/**
|
|
@@ -3795,7 +3844,7 @@ declare const shouldCoalesce: (prevSig: string | undefined, nextSig: string, pre
|
|
|
3795
3844
|
*
|
|
3796
3845
|
* @group Query Tools
|
|
3797
3846
|
*/
|
|
3798
|
-
declare const convertFromIC: <RG extends RuleGroupTypeAny>(rg: RG) => ToRuleGroupType<RG>;
|
|
3847
|
+
export declare const convertFromIC: <RG extends RuleGroupTypeAny>(rg: RG) => ToRuleGroupType<RG>;
|
|
3799
3848
|
/**
|
|
3800
3849
|
* Converts a {@link RuleGroupType} to {@link RuleGroupTypeIC}.
|
|
3801
3850
|
*
|
|
@@ -3804,7 +3853,7 @@ declare const convertFromIC: <RG extends RuleGroupTypeAny>(rg: RG) => ToRuleGrou
|
|
|
3804
3853
|
*
|
|
3805
3854
|
* @group Query Tools
|
|
3806
3855
|
*/
|
|
3807
|
-
declare const convertToIC: <RG extends RuleGroupTypeAny>(rg: RG) => ToRuleGroupTypeIC<RG>;
|
|
3856
|
+
export declare const convertToIC: <RG extends RuleGroupTypeAny>(rg: RG) => ToRuleGroupTypeIC<RG>;
|
|
3808
3857
|
/**
|
|
3809
3858
|
* Converts a {@link RuleGroupType} to {@link RuleGroupTypeIC}. For a more explicit
|
|
3810
3859
|
* operation, use {@link convertToIC}.
|
|
@@ -3830,7 +3879,7 @@ type StandardClassnameKey = keyof typeof standardClassnames & keyof Classnames;
|
|
|
3830
3879
|
* entry. Set `standardOnly` when the standard class is conditional but no custom class
|
|
3831
3880
|
* corresponds to it.
|
|
3832
3881
|
*/
|
|
3833
|
-
interface ClassnameCondition<S> {
|
|
3882
|
+
export interface ClassnameCondition<S> {
|
|
3834
3883
|
key: StandardClassnameKey;
|
|
3835
3884
|
when: (state: S) => boolean | undefined;
|
|
3836
3885
|
standardOnly?: boolean;
|
|
@@ -3839,16 +3888,16 @@ interface ClassnameCondition<S> {
|
|
|
3839
3888
|
* How one derived classname is composed: the `controlClassnames` keys that contribute to it (in
|
|
3840
3889
|
* application order, after the standard classname), plus any state-dependent classes.
|
|
3841
3890
|
*/
|
|
3842
|
-
interface ClassnameSpec<S> {
|
|
3891
|
+
export interface ClassnameSpec<S> {
|
|
3843
3892
|
sources: readonly (keyof Classnames)[];
|
|
3844
3893
|
conditions?: readonly ClassnameCondition<S>[];
|
|
3845
3894
|
}
|
|
3846
3895
|
/** Keys of the `classNames` object returned for a rule. */
|
|
3847
|
-
type RuleClassnameKey = "shiftActions" | "dragHandle" | "fields" | "matchMode" | "matchThreshold" | "operators" | "valueSource" | "value" | "cloneRule" | "lockRule" | "muteRule" | "removeRule" | "valueListItem";
|
|
3896
|
+
export type RuleClassnameKey = "shiftActions" | "dragHandle" | "fields" | "matchMode" | "matchThreshold" | "operators" | "valueSource" | "value" | "cloneRule" | "lockRule" | "muteRule" | "removeRule" | "valueListItem";
|
|
3848
3897
|
/** Keys of the `classNames` object returned for a rule group. */
|
|
3849
|
-
type RuleGroupClassnameKey = "header" | "shiftActions" | "undoRedoActions" | "undoAction" | "redoAction" | "dragHandle" | "combinators" | "notToggle" | "addRule" | "addGroup" | "cloneGroup" | "lockGroup" | "muteGroup" | "removeGroup" | "body";
|
|
3898
|
+
export type RuleGroupClassnameKey = "header" | "shiftActions" | "undoRedoActions" | "undoAction" | "redoAction" | "dragHandle" | "combinators" | "notToggle" | "addRule" | "addGroup" | "cloneGroup" | "ungroup" | "lockGroup" | "muteGroup" | "removeGroup" | "body";
|
|
3850
3899
|
/** Drag-and-drop state that can contribute conditional classnames. */
|
|
3851
|
-
interface DndClassNameState {
|
|
3900
|
+
export interface DndClassNameState {
|
|
3852
3901
|
isDragging?: boolean;
|
|
3853
3902
|
isOver?: boolean;
|
|
3854
3903
|
dropEffect?: "move" | "copy";
|
|
@@ -3856,18 +3905,18 @@ interface DndClassNameState {
|
|
|
3856
3905
|
dropNotAllowed?: boolean;
|
|
3857
3906
|
}
|
|
3858
3907
|
/** State that contributes conditional classnames to a rule's wrapper element. */
|
|
3859
|
-
interface RuleClassNameState extends DndClassNameState {
|
|
3908
|
+
export interface RuleClassNameState extends DndClassNameState {
|
|
3860
3909
|
disabled?: boolean;
|
|
3861
3910
|
muted?: boolean;
|
|
3862
3911
|
hasSubQuery?: boolean;
|
|
3863
3912
|
}
|
|
3864
3913
|
/** State that contributes conditional classnames to the query builder's wrapper element. */
|
|
3865
|
-
interface QueryBuilderClassNameState {
|
|
3914
|
+
export interface QueryBuilderClassNameState {
|
|
3866
3915
|
disabled?: boolean;
|
|
3867
3916
|
validationResult?: boolean | ValidationMap;
|
|
3868
3917
|
}
|
|
3869
3918
|
/** Options common to every classname derivation. */
|
|
3870
|
-
interface DeriveClassNamesOptions {
|
|
3919
|
+
export interface DeriveClassNamesOptions {
|
|
3871
3920
|
/** The merged `controlClassnames` for the query builder. */
|
|
3872
3921
|
classNames: Partial<Classnames> | undefined;
|
|
3873
3922
|
/** When `true`, standard (`rule`, `ruleGroup-*`, etc.) classnames are omitted. */
|
|
@@ -3879,7 +3928,7 @@ interface DeriveClassNamesOptions {
|
|
|
3879
3928
|
*
|
|
3880
3929
|
* @group Query Tools
|
|
3881
3930
|
*/
|
|
3882
|
-
declare const deriveRuleClassNames: (options: DeriveClassNamesOptions) => Record<RuleClassnameKey, string>;
|
|
3931
|
+
export declare const deriveRuleClassNames: (options: DeriveClassNamesOptions) => Record<RuleClassnameKey, string>;
|
|
3883
3932
|
/**
|
|
3884
3933
|
* The classname for a single element of a rule, composed from the same table as
|
|
3885
3934
|
* {@link deriveRuleClassNames}. Useful where only one is needed, such as the items of a
|
|
@@ -3887,7 +3936,7 @@ declare const deriveRuleClassNames: (options: DeriveClassNamesOptions) => Record
|
|
|
3887
3936
|
*
|
|
3888
3937
|
* @group Query Tools
|
|
3889
3938
|
*/
|
|
3890
|
-
declare const deriveRuleClassName: (key: RuleClassnameKey, options: DeriveClassNamesOptions) => string;
|
|
3939
|
+
export declare const deriveRuleClassName: (key: RuleClassnameKey, options: DeriveClassNamesOptions) => string;
|
|
3891
3940
|
/**
|
|
3892
3941
|
* Classnames for each element rendered by a rule group, including its conditionally-classed
|
|
3893
3942
|
* `header`. This is the framework-agnostic core of the `classNames` object returned by the
|
|
@@ -3895,9 +3944,9 @@ declare const deriveRuleClassName: (key: RuleClassnameKey, options: DeriveClassN
|
|
|
3895
3944
|
*
|
|
3896
3945
|
* @group Query Tools
|
|
3897
3946
|
*/
|
|
3898
|
-
declare const deriveRuleGroupClassNames: (options: DeriveClassNamesOptions & DndClassNameState) => Record<RuleGroupClassnameKey, string>;
|
|
3947
|
+
export declare const deriveRuleGroupClassNames: (options: DeriveClassNamesOptions & DndClassNameState) => Record<RuleGroupClassnameKey, string>;
|
|
3899
3948
|
/** Inputs common to every outer (wrapper) classname derivation. */
|
|
3900
|
-
interface OuterClassNameOptionsBase extends DeriveClassNamesOptions {
|
|
3949
|
+
export interface OuterClassNameOptionsBase extends DeriveClassNamesOptions {
|
|
3901
3950
|
/**
|
|
3902
3951
|
* Classnames contributed by the rule or group itself and its configuration, applied first.
|
|
3903
3952
|
* For a rule that is the rule/field/operator classnames; for a group, the group and combinator
|
|
@@ -3908,13 +3957,13 @@ interface OuterClassNameOptionsBase extends DeriveClassNamesOptions {
|
|
|
3908
3957
|
validationClassName?: Classname;
|
|
3909
3958
|
}
|
|
3910
3959
|
/** Inputs to {@link deriveRuleOuterClassName} and {@link deriveRuleGroupOuterClassName}. */
|
|
3911
|
-
interface OuterClassNameOptions extends OuterClassNameOptionsBase, RuleClassNameState {}
|
|
3960
|
+
export interface OuterClassNameOptions extends OuterClassNameOptionsBase, RuleClassNameState {}
|
|
3912
3961
|
/**
|
|
3913
3962
|
* The outer (wrapper) classname for a rule, including every conditional state class.
|
|
3914
3963
|
*
|
|
3915
3964
|
* @group Query Tools
|
|
3916
3965
|
*/
|
|
3917
|
-
declare const deriveRuleOuterClassName: (options: OuterClassNameOptions) => string;
|
|
3966
|
+
export declare const deriveRuleOuterClassName: (options: OuterClassNameOptions) => string;
|
|
3918
3967
|
/**
|
|
3919
3968
|
* The outer (wrapper) classname for a rule group, including every conditional state class.
|
|
3920
3969
|
*
|
|
@@ -3924,14 +3973,14 @@ declare const deriveRuleOuterClassName: (options: OuterClassNameOptions) => stri
|
|
|
3924
3973
|
*
|
|
3925
3974
|
* @group Query Tools
|
|
3926
3975
|
*/
|
|
3927
|
-
declare const deriveRuleGroupOuterClassName: (options: OuterClassNameOptions) => string;
|
|
3976
|
+
export declare const deriveRuleGroupOuterClassName: (options: OuterClassNameOptions) => string;
|
|
3928
3977
|
/**
|
|
3929
3978
|
* The outer (wrapper) classname for the query builder itself, including the conditional
|
|
3930
3979
|
* `disabled`, `valid`, and `invalid` state classes.
|
|
3931
3980
|
*
|
|
3932
3981
|
* @group Query Tools
|
|
3933
3982
|
*/
|
|
3934
|
-
declare const deriveQueryBuilderClassNames: (options: OuterClassNameOptionsBase & QueryBuilderClassNameState) => string;
|
|
3983
|
+
export declare const deriveQueryBuilderClassNames: (options: OuterClassNameOptionsBase & QueryBuilderClassNameState) => string;
|
|
3935
3984
|
//#endregion
|
|
3936
3985
|
//#region src/utils/defaultValidator.d.ts
|
|
3937
3986
|
/**
|
|
@@ -3939,14 +3988,14 @@ declare const deriveQueryBuilderClassNames: (options: OuterClassNameOptionsBase
|
|
|
3939
3988
|
* `validator` prop. It assumes that you want to validate groups, and has a no-op
|
|
3940
3989
|
* for validating rules which you can replace with your own implementation.
|
|
3941
3990
|
*/
|
|
3942
|
-
declare const defaultValidator: QueryValidator;
|
|
3991
|
+
export declare const defaultValidator: QueryValidator;
|
|
3943
3992
|
//#endregion
|
|
3944
3993
|
//#region src/utils/deriveRuleContext.d.ts
|
|
3945
3994
|
/**
|
|
3946
3995
|
* Functions used by {@link deriveRuleContext} to resolve a rule's configuration. Each corresponds
|
|
3947
3996
|
* to the `QueryBuilder` prop (or `useQueryBuilderSetup` output) of the same name.
|
|
3948
3997
|
*/
|
|
3949
|
-
interface RuleContextResolvers<F extends FullField = FullField> {
|
|
3998
|
+
export interface RuleContextResolvers<F extends FullField = FullField> {
|
|
3950
3999
|
fields: OptionList<F>;
|
|
3951
4000
|
fieldMap: Partial<FullOptionRecord<FullField>>;
|
|
3952
4001
|
getInputType: (field: string, operator: string, misc: {
|
|
@@ -3977,7 +4026,7 @@ interface RuleContextResolvers<F extends FullField = FullField> {
|
|
|
3977
4026
|
/**
|
|
3978
4027
|
* Everything {@link deriveRuleContext} resolves for a single rule.
|
|
3979
4028
|
*/
|
|
3980
|
-
interface RuleContext<F extends FullField = FullField> {
|
|
4029
|
+
export interface RuleContext<F extends FullField = FullField> {
|
|
3981
4030
|
fieldData: F;
|
|
3982
4031
|
hideValueControls: boolean;
|
|
3983
4032
|
inputType: InputType | null;
|
|
@@ -3996,44 +4045,44 @@ interface RuleContext<F extends FullField = FullField> {
|
|
|
3996
4045
|
* Resolves the field configuration for a rule's `field`, falling back to a minimal option object
|
|
3997
4046
|
* when the field isn't present in the field map.
|
|
3998
4047
|
*/
|
|
3999
|
-
declare const getFieldData: (field: string, fieldMap: Partial<FullOptionRecord<FullField>>) => FullField;
|
|
4048
|
+
export declare const getFieldData: (field: string, fieldMap: Partial<FullOptionRecord<FullField>>) => FullField;
|
|
4000
4049
|
/**
|
|
4001
4050
|
* The input type for a rule. A field's own `inputType` takes precedence over `getInputType`.
|
|
4002
4051
|
*/
|
|
4003
|
-
declare const getRuleInputType: <F extends FullField = FullField>(field: string, operator: string, fieldData: F, getInputType: RuleContextResolvers<F>["getInputType"]) => InputType | null;
|
|
4052
|
+
export declare const getRuleInputType: <F extends FullField = FullField>(field: string, operator: string, fieldData: F, getInputType: RuleContextResolvers<F>["getInputType"]) => InputType | null;
|
|
4004
4053
|
/**
|
|
4005
4054
|
* Whether the value editor(s) should be hidden for an operator, based on its `arity`.
|
|
4006
4055
|
*/
|
|
4007
|
-
declare const hideValueControlsForOperator: (operatorObject?: FullOperator) => boolean;
|
|
4056
|
+
export declare const hideValueControlsForOperator: (operatorObject?: FullOperator) => boolean;
|
|
4008
4057
|
/**
|
|
4009
4058
|
* The subset of a rule that determines its configuration. Accepting only these properties (rather
|
|
4010
4059
|
* than the whole rule) lets React callers keep granular memoization dependencies, so editing a
|
|
4011
4060
|
* rule's `value` doesn't recompute its operators, value sources, or option lists.
|
|
4012
4061
|
*/
|
|
4013
|
-
type RuleFacet = Pick<RuleType, "field" | "operator" | "valueSource">;
|
|
4062
|
+
export type RuleFacet = Pick<RuleType, "field" | "operator" | "valueSource">;
|
|
4014
4063
|
/**
|
|
4015
4064
|
* Value source options for a rule. A `valueSource` present on the rule but absent from the
|
|
4016
4065
|
* configured list is appended, so the current selection is always representable.
|
|
4017
4066
|
*/
|
|
4018
|
-
declare const getRuleValueSourceOptions: <F extends FullField = FullField>(rule: RuleFacet, fieldData: F, getValueSources: RuleContextResolvers<F>["getValueSources"]) => ValueSourceFullOptions;
|
|
4067
|
+
export declare const getRuleValueSourceOptions: <F extends FullField = FullField>(rule: RuleFacet, fieldData: F, getValueSources: RuleContextResolvers<F>["getValueSources"]) => ValueSourceFullOptions;
|
|
4019
4068
|
/**
|
|
4020
4069
|
* Normalizes the result of `getParameters` to a non-empty list or `null`.
|
|
4021
4070
|
*/
|
|
4022
|
-
declare const getParametersAsList: (parameters: FlexibleOptionList<Option>) => FlexibleOptionList<Option> | null;
|
|
4071
|
+
export declare const getParametersAsList: (parameters: FlexibleOptionList<Option>) => FlexibleOptionList<Option> | null;
|
|
4023
4072
|
/**
|
|
4024
4073
|
* The value editor type for a rule. `valueSource: "field"` always uses a select list, and
|
|
4025
4074
|
* `valueSource: "parameter"` uses a (multi)select when parameters are available.
|
|
4026
4075
|
*/
|
|
4027
|
-
declare const getRuleValueEditorType: <F extends FullField = FullField>(rule: RuleFacet, fieldData: F, parametersAsList: FlexibleOptionList<Option> | null, getValueEditorType: RuleContextResolvers<F>["getValueEditorType"]) => ValueEditorType;
|
|
4076
|
+
export declare const getRuleValueEditorType: <F extends FullField = FullField>(rule: RuleFacet, fieldData: F, parametersAsList: FlexibleOptionList<Option> | null, getValueEditorType: RuleContextResolvers<F>["getValueEditorType"]) => ValueEditorType;
|
|
4028
4077
|
/**
|
|
4029
4078
|
* The option list presented by a rule's value editor, resolved from its `valueSource`.
|
|
4030
4079
|
*/
|
|
4031
|
-
declare const getRuleValues: <F extends FullField = FullField>(rule: RuleFacet, fieldData: F, fields: OptionList<F>, parametersAsList: FlexibleOptionList<Option> | null, getValues: RuleContextResolvers<F>["getValues"]) => FlexibleOptionList<Option>;
|
|
4080
|
+
export declare const getRuleValues: <F extends FullField = FullField>(rule: RuleFacet, fieldData: F, fields: OptionList<F>, parametersAsList: FlexibleOptionList<Option> | null, getValues: RuleContextResolvers<F>["getValues"]) => FlexibleOptionList<Option>;
|
|
4032
4081
|
/**
|
|
4033
4082
|
* The validation result for a rule: the entry from a query-level {@link ValidationMap} if present,
|
|
4034
4083
|
* otherwise the field's own `validator` result, otherwise `null`.
|
|
4035
4084
|
*/
|
|
4036
|
-
declare const getRuleValidationResult: (rule: RuleType, fieldData: FullField, validationMap?: ValidationMap, id?: string) => boolean | ValidationResult;
|
|
4085
|
+
export declare const getRuleValidationResult: (rule: RuleType, fieldData: FullField, validationMap?: ValidationMap, id?: string) => boolean | ValidationResult;
|
|
4037
4086
|
/**
|
|
4038
4087
|
* Resolves everything about a single rule that depends on the field/operator configuration:
|
|
4039
4088
|
* its field data, operators, value editor type, value list, value sources, match modes, and
|
|
@@ -4045,14 +4094,14 @@ declare const getRuleValidationResult: (rule: RuleType, fieldData: FullField, va
|
|
|
4045
4094
|
*
|
|
4046
4095
|
* @group Query Tools
|
|
4047
4096
|
*/
|
|
4048
|
-
declare const deriveRuleContext: <F extends FullField = FullField>(rule: RuleType, resolvers: RuleContextResolvers<F>, options?: {
|
|
4097
|
+
export declare const deriveRuleContext: <F extends FullField = FullField>(rule: RuleType, resolvers: RuleContextResolvers<F>, options?: {
|
|
4049
4098
|
validationMap?: ValidationMap;
|
|
4050
4099
|
id?: string;
|
|
4051
4100
|
}) => RuleContext<F>;
|
|
4052
4101
|
/**
|
|
4053
4102
|
* Everything {@link deriveRuleGroupContext} resolves for a single rule group.
|
|
4054
4103
|
*/
|
|
4055
|
-
interface RuleGroupContext<C extends FullCombinator = FullCombinator> {
|
|
4104
|
+
export interface RuleGroupContext<C extends FullCombinator = FullCombinator> {
|
|
4056
4105
|
combinator: string;
|
|
4057
4106
|
combinatorObject: C | undefined;
|
|
4058
4107
|
combinators: FullOptionList<C>;
|
|
@@ -4068,7 +4117,7 @@ interface RuleGroupContext<C extends FullCombinator = FullCombinator> {
|
|
|
4068
4117
|
* This intentionally covers only the current property-based API. The `RuleGroup` component
|
|
4069
4118
|
* additionally falls back to its deprecated `combinator` prop; that fallback stays in the hook.
|
|
4070
4119
|
*/
|
|
4071
|
-
declare const getRuleGroupCombinator: <C extends FullCombinator = FullCombinator>(ruleGroup: RuleGroupTypeAny, combinators: FullOptionList<C>) => string;
|
|
4120
|
+
export declare const getRuleGroupCombinator: <C extends FullCombinator = FullCombinator>(ruleGroup: RuleGroupTypeAny, combinators: FullOptionList<C>) => string;
|
|
4072
4121
|
/**
|
|
4073
4122
|
* Resolves everything about a rule group that depends on the combinator configuration, plus its
|
|
4074
4123
|
* validation result.
|
|
@@ -4078,7 +4127,7 @@ declare const getRuleGroupCombinator: <C extends FullCombinator = FullCombinator
|
|
|
4078
4127
|
*
|
|
4079
4128
|
* @group Query Tools
|
|
4080
4129
|
*/
|
|
4081
|
-
declare const deriveRuleGroupContext: <C extends FullCombinator = FullCombinator>(ruleGroup: RuleGroupTypeAny, combinators: FullOptionList<C>, options?: {
|
|
4130
|
+
export declare const deriveRuleGroupContext: <C extends FullCombinator = FullCombinator>(ruleGroup: RuleGroupTypeAny, combinators: FullOptionList<C>, options?: {
|
|
4082
4131
|
validationMap?: ValidationMap;
|
|
4083
4132
|
id?: string;
|
|
4084
4133
|
}) => RuleGroupContext<C>;
|
|
@@ -4089,7 +4138,7 @@ declare const deriveRuleGroupContext: <C extends FullCombinator = FullCombinator
|
|
|
4089
4138
|
*
|
|
4090
4139
|
* @group Value Editors
|
|
4091
4140
|
*/
|
|
4092
|
-
declare const isBetweenOperator: (operator: string) => boolean;
|
|
4141
|
+
export declare const isBetweenOperator: (operator: string) => boolean;
|
|
4093
4142
|
/**
|
|
4094
4143
|
* Determines whether a rule's `value` needs to be collapsed to a single element because it no
|
|
4095
4144
|
* longer represents a list, and what it should become.
|
|
@@ -4104,7 +4153,7 @@ declare const isBetweenOperator: (operator: string) => boolean;
|
|
|
4104
4153
|
*
|
|
4105
4154
|
* @group Value Editors
|
|
4106
4155
|
*/
|
|
4107
|
-
declare const getValueEditorReset: ({ skipHook, type, operator, value, inputType }: {
|
|
4156
|
+
export declare const getValueEditorReset: ({ skipHook, type, operator, value, inputType }: {
|
|
4108
4157
|
skipHook?: boolean;
|
|
4109
4158
|
type?: string;
|
|
4110
4159
|
operator: string;
|
|
@@ -4123,7 +4172,7 @@ declare const getValueEditorReset: ({ skipHook, type, operator, value, inputType
|
|
|
4123
4172
|
*
|
|
4124
4173
|
* @group Value Editors
|
|
4125
4174
|
*/
|
|
4126
|
-
declare const getMultiValueUpdate: ({ value, index, valueAsArray, operator, values, listsAsArrays, parseNumberMethod }: {
|
|
4175
|
+
export declare const getMultiValueUpdate: ({ value, index, valueAsArray, operator, values, listsAsArrays, parseNumberMethod }: {
|
|
4127
4176
|
value: unknown;
|
|
4128
4177
|
index: number;
|
|
4129
4178
|
valueAsArray: unknown[];
|
|
@@ -4138,21 +4187,21 @@ declare const getMultiValueUpdate: ({ value, index, valueAsArray, operator, valu
|
|
|
4138
4187
|
*
|
|
4139
4188
|
* @group Value Editors
|
|
4140
4189
|
*/
|
|
4141
|
-
declare const coerceBigIntValue: (value: unknown, parseNumberMethod?: ParseNumberMethod) => unknown;
|
|
4190
|
+
export declare const coerceBigIntValue: (value: unknown, parseNumberMethod?: ParseNumberMethod) => unknown;
|
|
4142
4191
|
/**
|
|
4143
4192
|
* The `type` attribute an `<input>` should use for a rule. `bigint` values and the `in`/`notIn`
|
|
4144
4193
|
* operators (whose value is a comma-separated list) both require a text input.
|
|
4145
4194
|
*
|
|
4146
4195
|
* @group Value Editors
|
|
4147
4196
|
*/
|
|
4148
|
-
declare const coerceInputType: (inputType: InputType | null | undefined, operator: string) => InputType;
|
|
4197
|
+
export declare const coerceInputType: (inputType: InputType | null | undefined, operator: string) => InputType;
|
|
4149
4198
|
/**
|
|
4150
4199
|
* Produces the next value for a value selector. Multiselect values are normalized to an array
|
|
4151
4200
|
* first, then comma-joined unless `listsAsArrays` is `true`. Single-select values pass through.
|
|
4152
4201
|
*
|
|
4153
4202
|
* @group Value Editors
|
|
4154
4203
|
*/
|
|
4155
|
-
declare const getValueSelectorUpdate: (value: string | string[], { multiple, listsAsArrays }?: {
|
|
4204
|
+
export declare const getValueSelectorUpdate: (value: string | string[], { multiple, listsAsArrays }?: {
|
|
4156
4205
|
multiple?: boolean;
|
|
4157
4206
|
listsAsArrays?: boolean;
|
|
4158
4207
|
}) => string | string[];
|
|
@@ -4162,7 +4211,7 @@ declare const getValueSelectorUpdate: (value: string | string[], { multiple, lis
|
|
|
4162
4211
|
*
|
|
4163
4212
|
* @group Value Editors
|
|
4164
4213
|
*/
|
|
4165
|
-
declare const normalizeValueSelectorValue: (value: unknown, multiple?: boolean) => any;
|
|
4214
|
+
export declare const normalizeValueSelectorValue: (value: unknown, multiple?: boolean) => any;
|
|
4166
4215
|
//#endregion
|
|
4167
4216
|
//#region src/utils/filterFieldsByComparator.d.ts
|
|
4168
4217
|
/**
|
|
@@ -4176,7 +4225,7 @@ declare const normalizeValueSelectorValue: (value: unknown, multiple?: boolean)
|
|
|
4176
4225
|
*
|
|
4177
4226
|
* @group Option Lists
|
|
4178
4227
|
*/
|
|
4179
|
-
declare const filterFieldsByComparator: (field: FullField, fields: OptionList<FullField>, operator: string) => FullField[] | {
|
|
4228
|
+
export declare const filterFieldsByComparator: (field: FullField, fields: OptionList<FullField>, operator: string) => FullField[] | {
|
|
4180
4229
|
options: WithUnknownIndex<FullField>[];
|
|
4181
4230
|
label: string;
|
|
4182
4231
|
}[];
|
|
@@ -4187,7 +4236,7 @@ declare const filterFieldsByComparator: (field: FullField, fields: OptionList<Fu
|
|
|
4187
4236
|
*
|
|
4188
4237
|
* @group Export
|
|
4189
4238
|
*/
|
|
4190
|
-
declare const defaultRuleProcessorCEL: RuleProcessor;
|
|
4239
|
+
export declare const defaultRuleProcessorCEL: RuleProcessor;
|
|
4191
4240
|
//#endregion
|
|
4192
4241
|
//#region src/utils/formatQuery/defaultRuleProcessorMongoDB.d.ts
|
|
4193
4242
|
/**
|
|
@@ -4197,7 +4246,7 @@ declare const defaultRuleProcessorCEL: RuleProcessor;
|
|
|
4197
4246
|
*
|
|
4198
4247
|
* @group Export
|
|
4199
4248
|
*/
|
|
4200
|
-
declare const defaultRuleProcessorMongoDB: RuleProcessor;
|
|
4249
|
+
export declare const defaultRuleProcessorMongoDB: RuleProcessor;
|
|
4201
4250
|
//#endregion
|
|
4202
4251
|
//#region src/utils/formatQuery/defaultRuleProcessorSpEL.d.ts
|
|
4203
4252
|
/**
|
|
@@ -4205,7 +4254,7 @@ declare const defaultRuleProcessorMongoDB: RuleProcessor;
|
|
|
4205
4254
|
*
|
|
4206
4255
|
* @group Export
|
|
4207
4256
|
*/
|
|
4208
|
-
declare const defaultRuleProcessorSpEL: RuleProcessor;
|
|
4257
|
+
export declare const defaultRuleProcessorSpEL: RuleProcessor;
|
|
4209
4258
|
//#endregion
|
|
4210
4259
|
//#region src/utils/formatQuery/defaultValueProcessorByRule.d.ts
|
|
4211
4260
|
/**
|
|
@@ -4213,7 +4262,7 @@ declare const defaultRuleProcessorSpEL: RuleProcessor;
|
|
|
4213
4262
|
*
|
|
4214
4263
|
* @group Export
|
|
4215
4264
|
*/
|
|
4216
|
-
declare const defaultValueProcessorByRule: ValueProcessorByRule;
|
|
4265
|
+
export declare const defaultValueProcessorByRule: ValueProcessorByRule;
|
|
4217
4266
|
//#endregion
|
|
4218
4267
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorCEL.d.ts
|
|
4219
4268
|
/**
|
|
@@ -4221,7 +4270,7 @@ declare const defaultValueProcessorByRule: ValueProcessorByRule;
|
|
|
4221
4270
|
*
|
|
4222
4271
|
* @group Export
|
|
4223
4272
|
*/
|
|
4224
|
-
declare const defaultRuleGroupProcessorCEL: RuleGroupProcessor<string>;
|
|
4273
|
+
export declare const defaultRuleGroupProcessorCEL: RuleGroupProcessor<string>;
|
|
4225
4274
|
//#endregion
|
|
4226
4275
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorCypher.d.ts
|
|
4227
4276
|
/**
|
|
@@ -4229,7 +4278,7 @@ declare const defaultRuleGroupProcessorCEL: RuleGroupProcessor<string>;
|
|
|
4229
4278
|
*
|
|
4230
4279
|
* @group Export
|
|
4231
4280
|
*/
|
|
4232
|
-
declare const cypherCombinatorMap: {
|
|
4281
|
+
export declare const cypherCombinatorMap: {
|
|
4233
4282
|
and: "AND";
|
|
4234
4283
|
or: "OR";
|
|
4235
4284
|
};
|
|
@@ -4238,7 +4287,7 @@ declare const cypherCombinatorMap: {
|
|
|
4238
4287
|
*
|
|
4239
4288
|
* @group Export
|
|
4240
4289
|
*/
|
|
4241
|
-
declare const defaultRuleGroupProcessorCypher: RuleGroupProcessor<string>;
|
|
4290
|
+
export declare const defaultRuleGroupProcessorCypher: RuleGroupProcessor<string>;
|
|
4242
4291
|
//#endregion
|
|
4243
4292
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorDrizzle.d.ts
|
|
4244
4293
|
/**
|
|
@@ -4248,7 +4297,7 @@ declare const defaultRuleGroupProcessorCypher: RuleGroupProcessor<string>;
|
|
|
4248
4297
|
*
|
|
4249
4298
|
* @group Export
|
|
4250
4299
|
*/
|
|
4251
|
-
interface DrizzleOperatorsLike {
|
|
4300
|
+
export interface DrizzleOperatorsLike {
|
|
4252
4301
|
and: (...conditions: any[]) => any;
|
|
4253
4302
|
or: (...conditions: any[]) => any;
|
|
4254
4303
|
not: (...conditions: any[]) => any;
|
|
@@ -4260,7 +4309,7 @@ interface DrizzleOperatorsLike {
|
|
|
4260
4309
|
*
|
|
4261
4310
|
* @group Export
|
|
4262
4311
|
*/
|
|
4263
|
-
type DrizzleWhereCallback = <Ops extends DrizzleOperatorsLike>(columns: object, drizzleOperators: Ops) => ReturnType<Ops["and"]>;
|
|
4312
|
+
export type DrizzleWhereCallback = <Ops extends DrizzleOperatorsLike>(columns: object, drizzleOperators: Ops) => ReturnType<Ops["and"]>;
|
|
4264
4313
|
/**
|
|
4265
4314
|
* Default rule group processor used by {@link formatQuery} for the "drizzle" format. The returned
|
|
4266
4315
|
* function can be assigned to the `where` property in the Drizzle relational queries API.
|
|
@@ -4273,7 +4322,7 @@ type DrizzleWhereCallback = <Ops extends DrizzleOperatorsLike>(columns: object,
|
|
|
4273
4322
|
*
|
|
4274
4323
|
* @group Export
|
|
4275
4324
|
*/
|
|
4276
|
-
declare const defaultRuleGroupProcessorDrizzle: RuleGroupProcessor<DrizzleWhereCallback>;
|
|
4325
|
+
export declare const defaultRuleGroupProcessorDrizzle: RuleGroupProcessor<DrizzleWhereCallback>;
|
|
4277
4326
|
//#endregion
|
|
4278
4327
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorElasticSearch.d.ts
|
|
4279
4328
|
/**
|
|
@@ -4281,7 +4330,7 @@ declare const defaultRuleGroupProcessorDrizzle: RuleGroupProcessor<DrizzleWhereC
|
|
|
4281
4330
|
*
|
|
4282
4331
|
* @group Export
|
|
4283
4332
|
*/
|
|
4284
|
-
declare const defaultRuleGroupProcessorElasticSearch: RuleGroupProcessor<Record<string, unknown>>;
|
|
4333
|
+
export declare const defaultRuleGroupProcessorElasticSearch: RuleGroupProcessor<Record<string, unknown>>;
|
|
4285
4334
|
//#endregion
|
|
4286
4335
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorGremlin.d.ts
|
|
4287
4336
|
/**
|
|
@@ -4289,11 +4338,13 @@ declare const defaultRuleGroupProcessorElasticSearch: RuleGroupProcessor<Record<
|
|
|
4289
4338
|
*
|
|
4290
4339
|
* At the top level, filter rules produce chained `.has()` steps (implicit AND).
|
|
4291
4340
|
* Nested groups use `.and()` / `.or()` / `.not()` compound traversals with
|
|
4292
|
-
* `__` anonymous traversal prefixes.
|
|
4341
|
+
* `__` anonymous traversal prefixes. Since `not()` accepts exactly one
|
|
4342
|
+
* traversal, negated groups with multiple predicates wrap them in a single
|
|
4343
|
+
* `__.and()`/`__.or()` sub-traversal.
|
|
4293
4344
|
*
|
|
4294
4345
|
* @group Export
|
|
4295
4346
|
*/
|
|
4296
|
-
declare const defaultRuleGroupProcessorGremlin: RuleGroupProcessor<string>;
|
|
4347
|
+
export declare const defaultRuleGroupProcessorGremlin: RuleGroupProcessor<string>;
|
|
4297
4348
|
//#endregion
|
|
4298
4349
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorJSONata.d.ts
|
|
4299
4350
|
/**
|
|
@@ -4301,7 +4352,7 @@ declare const defaultRuleGroupProcessorGremlin: RuleGroupProcessor<string>;
|
|
|
4301
4352
|
*
|
|
4302
4353
|
* @group Export
|
|
4303
4354
|
*/
|
|
4304
|
-
declare const defaultRuleGroupProcessorJSONata: RuleGroupProcessor<string>;
|
|
4355
|
+
export declare const defaultRuleGroupProcessorJSONata: RuleGroupProcessor<string>;
|
|
4305
4356
|
//#endregion
|
|
4306
4357
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorJsonLogic.d.ts
|
|
4307
4358
|
/**
|
|
@@ -4309,7 +4360,7 @@ declare const defaultRuleGroupProcessorJSONata: RuleGroupProcessor<string>;
|
|
|
4309
4360
|
*
|
|
4310
4361
|
* @group Export
|
|
4311
4362
|
*/
|
|
4312
|
-
declare const defaultRuleGroupProcessorJsonLogic: RuleGroupProcessor<RQBJsonLogic>;
|
|
4363
|
+
export declare const defaultRuleGroupProcessorJsonLogic: RuleGroupProcessor<RQBJsonLogic>;
|
|
4313
4364
|
//#endregion
|
|
4314
4365
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorLDAP.d.ts
|
|
4315
4366
|
/**
|
|
@@ -4317,7 +4368,7 @@ declare const defaultRuleGroupProcessorJsonLogic: RuleGroupProcessor<RQBJsonLogi
|
|
|
4317
4368
|
*
|
|
4318
4369
|
* @group Export
|
|
4319
4370
|
*/
|
|
4320
|
-
declare const defaultRuleGroupProcessorLDAP: RuleGroupProcessor<string>;
|
|
4371
|
+
export declare const defaultRuleGroupProcessorLDAP: RuleGroupProcessor<string>;
|
|
4321
4372
|
//#endregion
|
|
4322
4373
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorMongoDB.d.ts
|
|
4323
4374
|
/**
|
|
@@ -4327,7 +4378,7 @@ declare const defaultRuleGroupProcessorLDAP: RuleGroupProcessor<string>;
|
|
|
4327
4378
|
*
|
|
4328
4379
|
* @group Export
|
|
4329
4380
|
*/
|
|
4330
|
-
declare const defaultRuleGroupProcessorMongoDB: RuleGroupProcessor<string>;
|
|
4381
|
+
export declare const defaultRuleGroupProcessorMongoDB: RuleGroupProcessor<string>;
|
|
4331
4382
|
//#endregion
|
|
4332
4383
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorMongoDBQuery.d.ts
|
|
4333
4384
|
/**
|
|
@@ -4335,7 +4386,7 @@ declare const defaultRuleGroupProcessorMongoDB: RuleGroupProcessor<string>;
|
|
|
4335
4386
|
*
|
|
4336
4387
|
* @group Export
|
|
4337
4388
|
*/
|
|
4338
|
-
declare const mongoDbFallback: {
|
|
4389
|
+
export declare const mongoDbFallback: {
|
|
4339
4390
|
readonly $and: readonly [{
|
|
4340
4391
|
readonly $expr: true;
|
|
4341
4392
|
}];
|
|
@@ -4345,7 +4396,7 @@ declare const mongoDbFallback: {
|
|
|
4345
4396
|
*
|
|
4346
4397
|
* @group Export
|
|
4347
4398
|
*/
|
|
4348
|
-
declare const defaultRuleGroupProcessorMongoDBQuery: RuleGroupProcessor;
|
|
4399
|
+
export declare const defaultRuleGroupProcessorMongoDBQuery: RuleGroupProcessor;
|
|
4349
4400
|
//#endregion
|
|
4350
4401
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorNL.d.ts
|
|
4351
4402
|
/**
|
|
@@ -4353,7 +4404,7 @@ declare const defaultRuleGroupProcessorMongoDBQuery: RuleGroupProcessor;
|
|
|
4353
4404
|
*
|
|
4354
4405
|
* @group Export
|
|
4355
4406
|
*/
|
|
4356
|
-
declare const defaultRuleGroupProcessorNL: RuleGroupProcessor<string>;
|
|
4407
|
+
export declare const defaultRuleGroupProcessorNL: RuleGroupProcessor<string>;
|
|
4357
4408
|
//#endregion
|
|
4358
4409
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorParameterized.d.ts
|
|
4359
4410
|
/**
|
|
@@ -4362,7 +4413,7 @@ declare const defaultRuleGroupProcessorNL: RuleGroupProcessor<string>;
|
|
|
4362
4413
|
*
|
|
4363
4414
|
* @group Export
|
|
4364
4415
|
*/
|
|
4365
|
-
declare const defaultRuleGroupProcessorParameterized: RuleGroupProcessor<ParameterizedSQL | ParameterizedNamedSQL>;
|
|
4416
|
+
export declare const defaultRuleGroupProcessorParameterized: RuleGroupProcessor<ParameterizedSQL | ParameterizedNamedSQL>;
|
|
4366
4417
|
//#endregion
|
|
4367
4418
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorPrisma.d.ts
|
|
4368
4419
|
/**
|
|
@@ -4370,13 +4421,13 @@ declare const defaultRuleGroupProcessorParameterized: RuleGroupProcessor<Paramet
|
|
|
4370
4421
|
*
|
|
4371
4422
|
* @group Export
|
|
4372
4423
|
*/
|
|
4373
|
-
declare const prismaFallback: {};
|
|
4424
|
+
export declare const prismaFallback: {};
|
|
4374
4425
|
/**
|
|
4375
4426
|
* Rule group processor used by {@link formatQuery} for "prisma" format.
|
|
4376
4427
|
*
|
|
4377
4428
|
* @group Export
|
|
4378
4429
|
*/
|
|
4379
|
-
declare const defaultRuleGroupProcessorPrisma: RuleGroupProcessor<Record<string, unknown> | undefined>;
|
|
4430
|
+
export declare const defaultRuleGroupProcessorPrisma: RuleGroupProcessor<Record<string, unknown> | undefined>;
|
|
4380
4431
|
//#endregion
|
|
4381
4432
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorSequelize.d.ts
|
|
4382
4433
|
/**
|
|
@@ -4387,7 +4438,7 @@ declare const defaultRuleGroupProcessorPrisma: RuleGroupProcessor<Record<string,
|
|
|
4387
4438
|
*
|
|
4388
4439
|
* @group Export
|
|
4389
4440
|
*/
|
|
4390
|
-
interface SequelizeWhereOptionsLike {
|
|
4441
|
+
export interface SequelizeWhereOptionsLike {
|
|
4391
4442
|
[key: string | symbol]: unknown;
|
|
4392
4443
|
}
|
|
4393
4444
|
/**
|
|
@@ -4395,7 +4446,7 @@ interface SequelizeWhereOptionsLike {
|
|
|
4395
4446
|
*
|
|
4396
4447
|
* @group Export
|
|
4397
4448
|
*/
|
|
4398
|
-
declare const defaultRuleGroupProcessorSequelize: RuleGroupProcessor<SequelizeWhereOptionsLike | undefined>;
|
|
4449
|
+
export declare const defaultRuleGroupProcessorSequelize: RuleGroupProcessor<SequelizeWhereOptionsLike | undefined>;
|
|
4399
4450
|
//#endregion
|
|
4400
4451
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorSPARQL.d.ts
|
|
4401
4452
|
/**
|
|
@@ -4405,7 +4456,7 @@ declare const defaultRuleGroupProcessorSequelize: RuleGroupProcessor<SequelizeWh
|
|
|
4405
4456
|
*
|
|
4406
4457
|
* @group Export
|
|
4407
4458
|
*/
|
|
4408
|
-
declare const defaultRuleGroupProcessorSPARQL: RuleGroupProcessor<string>;
|
|
4459
|
+
export declare const defaultRuleGroupProcessorSPARQL: RuleGroupProcessor<string>;
|
|
4409
4460
|
//#endregion
|
|
4410
4461
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorSpEL.d.ts
|
|
4411
4462
|
/**
|
|
@@ -4413,7 +4464,7 @@ declare const defaultRuleGroupProcessorSPARQL: RuleGroupProcessor<string>;
|
|
|
4413
4464
|
*
|
|
4414
4465
|
* @group Export
|
|
4415
4466
|
*/
|
|
4416
|
-
declare const defaultRuleGroupProcessorSpEL: RuleGroupProcessor<string>;
|
|
4467
|
+
export declare const defaultRuleGroupProcessorSpEL: RuleGroupProcessor<string>;
|
|
4417
4468
|
//#endregion
|
|
4418
4469
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorSQL.d.ts
|
|
4419
4470
|
/**
|
|
@@ -4421,7 +4472,7 @@ declare const defaultRuleGroupProcessorSpEL: RuleGroupProcessor<string>;
|
|
|
4421
4472
|
*
|
|
4422
4473
|
* @group Export
|
|
4423
4474
|
*/
|
|
4424
|
-
declare const defaultRuleGroupProcessorSQL: RuleGroupProcessor<string>;
|
|
4475
|
+
export declare const defaultRuleGroupProcessorSQL: RuleGroupProcessor<string>;
|
|
4425
4476
|
//#endregion
|
|
4426
4477
|
//#region src/utils/formatQuery/tanStackDbTypes.d.ts
|
|
4427
4478
|
/**
|
|
@@ -4443,7 +4494,7 @@ type TanStackDbWhereCallback = (refs: Record<string, unknown>) => TanStackDbWher
|
|
|
4443
4494
|
*
|
|
4444
4495
|
* @group Export
|
|
4445
4496
|
*/
|
|
4446
|
-
declare const defaultRuleGroupProcessorTanStackDB: RuleGroupProcessor<TanStackDbWhereCallback>;
|
|
4497
|
+
export declare const defaultRuleGroupProcessorTanStackDB: RuleGroupProcessor<TanStackDbWhereCallback>;
|
|
4447
4498
|
//#endregion
|
|
4448
4499
|
//#region src/utils/formatQuery/defaultRuleGroupProcessorDiagnostics.d.ts
|
|
4449
4500
|
/**
|
|
@@ -4456,7 +4507,7 @@ declare const defaultRuleGroupProcessorTanStackDB: RuleGroupProcessor<TanStackDb
|
|
|
4456
4507
|
*
|
|
4457
4508
|
* @group Export
|
|
4458
4509
|
*/
|
|
4459
|
-
declare const defaultRuleGroupProcessorDiagnostics: RuleGroupProcessor<DiagnosticsResult>;
|
|
4510
|
+
export declare const defaultRuleGroupProcessorDiagnostics: RuleGroupProcessor<DiagnosticsResult>;
|
|
4460
4511
|
//#endregion
|
|
4461
4512
|
//#region src/utils/formatQuery/defaultRuleProcessorCypher.d.ts
|
|
4462
4513
|
/**
|
|
@@ -4464,7 +4515,7 @@ declare const defaultRuleGroupProcessorDiagnostics: RuleGroupProcessor<Diagnosti
|
|
|
4464
4515
|
*
|
|
4465
4516
|
* @group Export
|
|
4466
4517
|
*/
|
|
4467
|
-
declare const defaultRuleProcessorCypher: RuleProcessor;
|
|
4518
|
+
export declare const defaultRuleProcessorCypher: RuleProcessor;
|
|
4468
4519
|
//#endregion
|
|
4469
4520
|
//#region src/utils/formatQuery/defaultRuleProcessorDrizzle.d.ts
|
|
4470
4521
|
/**
|
|
@@ -4472,7 +4523,7 @@ declare const defaultRuleProcessorCypher: RuleProcessor;
|
|
|
4472
4523
|
*
|
|
4473
4524
|
* @group Export
|
|
4474
4525
|
*/
|
|
4475
|
-
declare const defaultRuleProcessorDrizzle: RuleProcessor;
|
|
4526
|
+
export declare const defaultRuleProcessorDrizzle: RuleProcessor;
|
|
4476
4527
|
//#endregion
|
|
4477
4528
|
//#region src/utils/formatQuery/defaultRuleProcessorElasticSearch.d.ts
|
|
4478
4529
|
/**
|
|
@@ -4480,7 +4531,7 @@ declare const defaultRuleProcessorDrizzle: RuleProcessor;
|
|
|
4480
4531
|
*
|
|
4481
4532
|
* @group Export
|
|
4482
4533
|
*/
|
|
4483
|
-
declare const defaultRuleProcessorElasticSearch: RuleProcessor;
|
|
4534
|
+
export declare const defaultRuleProcessorElasticSearch: RuleProcessor;
|
|
4484
4535
|
//#endregion
|
|
4485
4536
|
//#region src/utils/formatQuery/defaultRuleProcessorGremlin.d.ts
|
|
4486
4537
|
/**
|
|
@@ -4490,7 +4541,7 @@ declare const defaultRuleProcessorElasticSearch: RuleProcessor;
|
|
|
4490
4541
|
*
|
|
4491
4542
|
* @group Export
|
|
4492
4543
|
*/
|
|
4493
|
-
declare const defaultRuleProcessorGremlin: RuleProcessor;
|
|
4544
|
+
export declare const defaultRuleProcessorGremlin: RuleProcessor;
|
|
4494
4545
|
//#endregion
|
|
4495
4546
|
//#region src/utils/formatQuery/defaultRuleProcessorJSONata.d.ts
|
|
4496
4547
|
/**
|
|
@@ -4498,7 +4549,7 @@ declare const defaultRuleProcessorGremlin: RuleProcessor;
|
|
|
4498
4549
|
*
|
|
4499
4550
|
* @group Export
|
|
4500
4551
|
*/
|
|
4501
|
-
declare const defaultRuleProcessorJSONata: RuleProcessor;
|
|
4552
|
+
export declare const defaultRuleProcessorJSONata: RuleProcessor;
|
|
4502
4553
|
//#endregion
|
|
4503
4554
|
//#region src/utils/formatQuery/defaultRuleProcessorJsonLogic.d.ts
|
|
4504
4555
|
/**
|
|
@@ -4506,7 +4557,7 @@ declare const defaultRuleProcessorJSONata: RuleProcessor;
|
|
|
4506
4557
|
*
|
|
4507
4558
|
* @group Export
|
|
4508
4559
|
*/
|
|
4509
|
-
declare const defaultRuleProcessorJsonLogic: RuleProcessor;
|
|
4560
|
+
export declare const defaultRuleProcessorJsonLogic: RuleProcessor;
|
|
4510
4561
|
//#endregion
|
|
4511
4562
|
//#region src/utils/formatQuery/defaultRuleProcessorLDAP.d.ts
|
|
4512
4563
|
/**
|
|
@@ -4514,7 +4565,7 @@ declare const defaultRuleProcessorJsonLogic: RuleProcessor;
|
|
|
4514
4565
|
*
|
|
4515
4566
|
* @group Export
|
|
4516
4567
|
*/
|
|
4517
|
-
declare const defaultRuleProcessorLDAP: RuleProcessor;
|
|
4568
|
+
export declare const defaultRuleProcessorLDAP: RuleProcessor;
|
|
4518
4569
|
//#endregion
|
|
4519
4570
|
//#region src/utils/formatQuery/defaultRuleProcessorMongoDBQuery.d.ts
|
|
4520
4571
|
/**
|
|
@@ -4522,7 +4573,7 @@ declare const defaultRuleProcessorLDAP: RuleProcessor;
|
|
|
4522
4573
|
*
|
|
4523
4574
|
* @group Export
|
|
4524
4575
|
*/
|
|
4525
|
-
declare const defaultRuleProcessorMongoDBQuery: RuleProcessor;
|
|
4576
|
+
export declare const defaultRuleProcessorMongoDBQuery: RuleProcessor;
|
|
4526
4577
|
//#endregion
|
|
4527
4578
|
//#region src/utils/formatQuery/defaultRuleProcessorNL.d.ts
|
|
4528
4579
|
/**
|
|
@@ -4530,19 +4581,19 @@ declare const defaultRuleProcessorMongoDBQuery: RuleProcessor;
|
|
|
4530
4581
|
*
|
|
4531
4582
|
* @group Export
|
|
4532
4583
|
*/
|
|
4533
|
-
declare const defaultExportOperatorMap: ExportOperatorMap;
|
|
4584
|
+
export declare const defaultExportOperatorMap: ExportOperatorMap;
|
|
4534
4585
|
/**
|
|
4535
4586
|
* Default operator processor used by {@link formatQuery} for "natural_language" format.
|
|
4536
4587
|
*
|
|
4537
4588
|
* @group Export
|
|
4538
4589
|
*/
|
|
4539
|
-
declare const defaultOperatorProcessorNL: RuleProcessor;
|
|
4590
|
+
export declare const defaultOperatorProcessorNL: RuleProcessor;
|
|
4540
4591
|
/**
|
|
4541
4592
|
* Default rule processor used by {@link formatQuery} for "natural_language" format.
|
|
4542
4593
|
*
|
|
4543
4594
|
* @group Export
|
|
4544
4595
|
*/
|
|
4545
|
-
declare const defaultRuleProcessorNL: RuleProcessor;
|
|
4596
|
+
export declare const defaultRuleProcessorNL: RuleProcessor;
|
|
4546
4597
|
//#endregion
|
|
4547
4598
|
//#region src/utils/formatQuery/defaultRuleProcessorParameterized.d.ts
|
|
4548
4599
|
/**
|
|
@@ -4551,7 +4602,7 @@ declare const defaultRuleProcessorNL: RuleProcessor;
|
|
|
4551
4602
|
*
|
|
4552
4603
|
* @group Export
|
|
4553
4604
|
*/
|
|
4554
|
-
declare const defaultRuleProcessorParameterized: RuleProcessor;
|
|
4605
|
+
export declare const defaultRuleProcessorParameterized: RuleProcessor;
|
|
4555
4606
|
//#endregion
|
|
4556
4607
|
//#region src/utils/formatQuery/defaultRuleProcessorPrisma.d.ts
|
|
4557
4608
|
/**
|
|
@@ -4559,7 +4610,7 @@ declare const defaultRuleProcessorParameterized: RuleProcessor;
|
|
|
4559
4610
|
*
|
|
4560
4611
|
* @group Export
|
|
4561
4612
|
*/
|
|
4562
|
-
declare const defaultRuleProcessorPrisma: RuleProcessor;
|
|
4613
|
+
export declare const defaultRuleProcessorPrisma: RuleProcessor;
|
|
4563
4614
|
//#endregion
|
|
4564
4615
|
//#region src/utils/formatQuery/defaultRuleProcessorSequelize.d.ts
|
|
4565
4616
|
/**
|
|
@@ -4567,20 +4618,20 @@ declare const defaultRuleProcessorPrisma: RuleProcessor;
|
|
|
4567
4618
|
*
|
|
4568
4619
|
* @group Export
|
|
4569
4620
|
*/
|
|
4570
|
-
declare const defaultRuleProcessorSequelize: RuleProcessor;
|
|
4621
|
+
export declare const defaultRuleProcessorSequelize: RuleProcessor;
|
|
4571
4622
|
//#endregion
|
|
4572
4623
|
//#region src/utils/formatQuery/defaultRuleProcessorSPARQL.d.ts
|
|
4573
4624
|
/** Auto-prefix a SPARQL variable name with `?` unless it's already prefixed, a URI, or a prefixed name.
|
|
4574
4625
|
*
|
|
4575
4626
|
* @group Export
|
|
4576
4627
|
*/
|
|
4577
|
-
declare const sparqlVar: (name: string) => string;
|
|
4628
|
+
export declare const sparqlVar: (name: string) => string;
|
|
4578
4629
|
/**
|
|
4579
4630
|
* Default rule processor used by {@link formatQuery} for "sparql" format.
|
|
4580
4631
|
*
|
|
4581
4632
|
* @group Export
|
|
4582
4633
|
*/
|
|
4583
|
-
declare const defaultRuleProcessorSPARQL: RuleProcessor;
|
|
4634
|
+
export declare const defaultRuleProcessorSPARQL: RuleProcessor;
|
|
4584
4635
|
//#endregion
|
|
4585
4636
|
//#region src/utils/formatQuery/defaultRuleProcessorSQL.d.ts
|
|
4586
4637
|
/**
|
|
@@ -4588,13 +4639,13 @@ declare const defaultRuleProcessorSPARQL: RuleProcessor;
|
|
|
4588
4639
|
*
|
|
4589
4640
|
* @group Export
|
|
4590
4641
|
*/
|
|
4591
|
-
declare const defaultOperatorProcessorSQL: RuleProcessor;
|
|
4642
|
+
export declare const defaultOperatorProcessorSQL: RuleProcessor;
|
|
4592
4643
|
/**
|
|
4593
4644
|
* Default rule processor used by {@link formatQuery} for "sql" format.
|
|
4594
4645
|
*
|
|
4595
4646
|
* @group Export
|
|
4596
4647
|
*/
|
|
4597
|
-
declare const defaultRuleProcessorSQL: RuleProcessor;
|
|
4648
|
+
export declare const defaultRuleProcessorSQL: RuleProcessor;
|
|
4598
4649
|
//#endregion
|
|
4599
4650
|
//#region src/utils/formatQuery/defaultRuleProcessorTanStackDB.d.ts
|
|
4600
4651
|
/**
|
|
@@ -4602,7 +4653,7 @@ declare const defaultRuleProcessorSQL: RuleProcessor;
|
|
|
4602
4653
|
*
|
|
4603
4654
|
* @group Export
|
|
4604
4655
|
*/
|
|
4605
|
-
declare const defaultRuleProcessorTanStackDB: RuleProcessor;
|
|
4656
|
+
export declare const defaultRuleProcessorTanStackDB: RuleProcessor;
|
|
4606
4657
|
//#endregion
|
|
4607
4658
|
//#region src/utils/formatQuery/defaultValueProcessorNL.d.ts
|
|
4608
4659
|
/**
|
|
@@ -4610,7 +4661,7 @@ declare const defaultRuleProcessorTanStackDB: RuleProcessor;
|
|
|
4610
4661
|
*
|
|
4611
4662
|
* @group Export
|
|
4612
4663
|
*/
|
|
4613
|
-
declare const defaultValueProcessorNL: ValueProcessorByRule;
|
|
4664
|
+
export declare const defaultValueProcessorNL: ValueProcessorByRule;
|
|
4614
4665
|
//#endregion
|
|
4615
4666
|
//#region src/utils/formatQuery/formatQuery.d.ts
|
|
4616
4667
|
/**
|
|
@@ -4618,13 +4669,13 @@ declare const defaultValueProcessorNL: ValueProcessorByRule;
|
|
|
4618
4669
|
*
|
|
4619
4670
|
* @group Export
|
|
4620
4671
|
*/
|
|
4621
|
-
declare const sqlDialectPresets: Record<SQLPreset, FormatQueryOptions>;
|
|
4672
|
+
export declare const sqlDialectPresets: Record<SQLPreset, FormatQueryOptions>;
|
|
4622
4673
|
/**
|
|
4623
4674
|
* A collection of option presets for {@link formatQuery}.
|
|
4624
4675
|
*
|
|
4625
4676
|
* @group Export
|
|
4626
4677
|
*/
|
|
4627
|
-
declare const formatQueryOptionPresets: Record<string, FormatQueryOptions>;
|
|
4678
|
+
export declare const formatQueryOptionPresets: Record<string, FormatQueryOptions>;
|
|
4628
4679
|
/**
|
|
4629
4680
|
* Generates a formatted (indented two spaces) JSON string from a query object.
|
|
4630
4681
|
*
|
|
@@ -4788,7 +4839,7 @@ declare function formatQuery(ruleGroup: RuleGroupTypeAny, options: FormatQueryOp
|
|
|
4788
4839
|
*
|
|
4789
4840
|
* @group Export
|
|
4790
4841
|
*/
|
|
4791
|
-
declare const mapSQLOperator: (rqbOperator: string) => string;
|
|
4842
|
+
export declare const mapSQLOperator: (rqbOperator: string) => string;
|
|
4792
4843
|
/**
|
|
4793
4844
|
* Returns a preset-aware SQL string-concatenation function. Emits `CONCAT(a, b, ...)` when
|
|
4794
4845
|
* `concatOperator` is `"CONCAT"` (case-insensitive), otherwise joins with the infix operator
|
|
@@ -4796,7 +4847,7 @@ declare const mapSQLOperator: (rqbOperator: string) => string;
|
|
|
4796
4847
|
*
|
|
4797
4848
|
* @group Export
|
|
4798
4849
|
*/
|
|
4799
|
-
declare const getSQLConcat: (concatOperator?: string) => (...values: string[]) => string;
|
|
4850
|
+
export declare const getSQLConcat: (concatOperator?: string) => (...values: string[]) => string;
|
|
4800
4851
|
/**
|
|
4801
4852
|
* Returns the `[prefix, suffix]` `LIKE` wildcards for a string-match operator (e.g. `contains`
|
|
4802
4853
|
* → `['%', '%']`, `beginsWith` → `['', '%']`, `endsWith` → `['%', '']`). Unknown operators
|
|
@@ -4804,7 +4855,7 @@ declare const getSQLConcat: (concatOperator?: string) => (...values: string[]) =
|
|
|
4804
4855
|
*
|
|
4805
4856
|
* @group Export
|
|
4806
4857
|
*/
|
|
4807
|
-
declare const getLikeWildcards: (operatorLC: string) => [string, string];
|
|
4858
|
+
export declare const getLikeWildcards: (operatorLC: string) => [string, string];
|
|
4808
4859
|
/**
|
|
4809
4860
|
* Wraps an already-serialized SQL fragment (a quoted field name or an expression) with the
|
|
4810
4861
|
* `LIKE` wildcards for the given (lowercase) string-match operator, concatenating the literal
|
|
@@ -4813,7 +4864,7 @@ declare const getLikeWildcards: (operatorLC: string) => [string, string];
|
|
|
4813
4864
|
*
|
|
4814
4865
|
* @group Export
|
|
4815
4866
|
*/
|
|
4816
|
-
declare const wrapLikeFragment: (fragment: string, operatorLC: string, { concatOperator, quoteValuesWith, wrapValueWith }?: {
|
|
4867
|
+
export declare const wrapLikeFragment: (fragment: string, operatorLC: string, { concatOperator, quoteValuesWith, wrapValueWith }?: {
|
|
4817
4868
|
concatOperator?: string;
|
|
4818
4869
|
quoteValuesWith?: string;
|
|
4819
4870
|
wrapValueWith?: [string, string];
|
|
@@ -4823,7 +4874,7 @@ declare const wrapLikeFragment: (fragment: string, operatorLC: string, { concatO
|
|
|
4823
4874
|
*
|
|
4824
4875
|
* @group Export
|
|
4825
4876
|
*/
|
|
4826
|
-
declare const mongoOperators: {
|
|
4877
|
+
export declare const mongoOperators: {
|
|
4827
4878
|
"=": string;
|
|
4828
4879
|
"!=": string;
|
|
4829
4880
|
"<": string;
|
|
@@ -4839,7 +4890,7 @@ declare const mongoOperators: {
|
|
|
4839
4890
|
*
|
|
4840
4891
|
* @group Export
|
|
4841
4892
|
*/
|
|
4842
|
-
declare const prismaOperators: {
|
|
4893
|
+
export declare const prismaOperators: {
|
|
4843
4894
|
"=": string;
|
|
4844
4895
|
"!=": string;
|
|
4845
4896
|
"<": string;
|
|
@@ -4854,7 +4905,7 @@ declare const prismaOperators: {
|
|
|
4854
4905
|
*
|
|
4855
4906
|
* @group Export
|
|
4856
4907
|
*/
|
|
4857
|
-
declare const celCombinatorMap: {
|
|
4908
|
+
export declare const celCombinatorMap: {
|
|
4858
4909
|
and: "&&";
|
|
4859
4910
|
or: "||";
|
|
4860
4911
|
};
|
|
@@ -4872,7 +4923,7 @@ declare const celCombinatorMap: {
|
|
|
4872
4923
|
*
|
|
4873
4924
|
* @group Export
|
|
4874
4925
|
*/
|
|
4875
|
-
declare const jsonLogicAdditionalOperators: Record<"startsWith" | "endsWith", (a: string, b: string) => boolean>;
|
|
4926
|
+
export declare const jsonLogicAdditionalOperators: Record<"startsWith" | "endsWith", (a: string, b: string) => boolean>;
|
|
4876
4927
|
/**
|
|
4877
4928
|
* Returns a new query object with all `string`-type `value` properties converted
|
|
4878
4929
|
* to `number` where appropriate.
|
|
@@ -4881,13 +4932,13 @@ declare const jsonLogicAdditionalOperators: Record<"startsWith" | "endsWith", (a
|
|
|
4881
4932
|
*
|
|
4882
4933
|
* @group Export
|
|
4883
4934
|
*/
|
|
4884
|
-
declare const numerifyValues: (rg: RuleGroupTypeAny, options: SetRequired<FormatQueryOptions, "fields">) => RuleGroupTypeAny;
|
|
4935
|
+
export declare const numerifyValues: (rg: RuleGroupTypeAny, options: SetRequired<FormatQueryOptions, "fields">) => RuleGroupTypeAny;
|
|
4885
4936
|
/**
|
|
4886
4937
|
* Determines whether a value is _anything_ except an empty `string` or `NaN`.
|
|
4887
4938
|
*
|
|
4888
4939
|
* @group Export
|
|
4889
4940
|
*/
|
|
4890
|
-
declare const isValidValue: (value: unknown) => boolean;
|
|
4941
|
+
export declare const isValidValue: (value: unknown) => boolean;
|
|
4891
4942
|
/**
|
|
4892
4943
|
* Determines whether {@link formatQuery} should render the given value as a number.
|
|
4893
4944
|
* As long as `parseNumbers` is `true`, `number` and `bigint` values will return `true` and
|
|
@@ -4895,7 +4946,7 @@ declare const isValidValue: (value: unknown) => boolean;
|
|
|
4895
4946
|
*
|
|
4896
4947
|
* @group Export
|
|
4897
4948
|
*/
|
|
4898
|
-
declare const shouldRenderAsNumber: (value: unknown, parseNumbers?: boolean) => boolean;
|
|
4949
|
+
export declare const shouldRenderAsNumber: (value: unknown, parseNumbers?: boolean) => boolean;
|
|
4899
4950
|
/**
|
|
4900
4951
|
* Used by {@link formatQuery} to determine whether the given value processor is a
|
|
4901
4952
|
* "legacy" value processor by counting the number of arguments. Legacy value
|
|
@@ -4904,7 +4955,7 @@ declare const shouldRenderAsNumber: (value: unknown, parseNumbers?: boolean) =>
|
|
|
4904
4955
|
*
|
|
4905
4956
|
* @group Export
|
|
4906
4957
|
*/
|
|
4907
|
-
declare const isValueProcessorLegacy: (valueProcessor: ValueProcessorLegacy | ValueProcessorByRule) => valueProcessor is ValueProcessorLegacy;
|
|
4958
|
+
export declare const isValueProcessorLegacy: (valueProcessor: ValueProcessorLegacy | ValueProcessorByRule) => valueProcessor is ValueProcessorLegacy;
|
|
4908
4959
|
/**
|
|
4909
4960
|
* Converts the `quoteFieldNamesWith` option into an array of two strings.
|
|
4910
4961
|
* If the option is a string, the array elements are both that string.
|
|
@@ -4914,14 +4965,14 @@ declare const isValueProcessorLegacy: (valueProcessor: ValueProcessorLegacy | Va
|
|
|
4914
4965
|
*
|
|
4915
4966
|
* @group Export
|
|
4916
4967
|
*/
|
|
4917
|
-
declare const getQuoteFieldNamesWithArray: (quoteFieldNamesWith?: null | string | [string, string]) => [string, string];
|
|
4968
|
+
export declare const getQuoteFieldNamesWithArray: (quoteFieldNamesWith?: null | string | [string, string]) => [string, string];
|
|
4918
4969
|
/**
|
|
4919
4970
|
* Given a field name and relevant {@link ValueProcessorOptions}, returns the field name
|
|
4920
4971
|
* wrapped in the configured quote character(s).
|
|
4921
4972
|
*
|
|
4922
4973
|
* @group Export
|
|
4923
4974
|
*/
|
|
4924
|
-
declare const getQuotedFieldName: (fieldName: string, { quoteFieldNamesWith, fieldIdentifierSeparator }: ValueProcessorOptions) => string;
|
|
4975
|
+
export declare const getQuotedFieldName: (fieldName: string, { quoteFieldNamesWith, fieldIdentifierSeparator }: ValueProcessorOptions) => string;
|
|
4925
4976
|
/**
|
|
4926
4977
|
* Given a [Constituent word order](https://en.wikipedia.org/wiki/Word_order#Constituent_word_orders)
|
|
4927
4978
|
* like "svo" or "sov", returns a permutation of `["S", "V", "O"]` based on the first occurrence of
|
|
@@ -4931,7 +4982,7 @@ declare const getQuotedFieldName: (fieldName: string, { quoteFieldNamesWith, fie
|
|
|
4931
4982
|
*
|
|
4932
4983
|
* @group Export
|
|
4933
4984
|
*/
|
|
4934
|
-
declare const normalizeConstituentWordOrder: (input: string) => ConstituentWordOrder;
|
|
4985
|
+
export declare const normalizeConstituentWordOrder: (input: string) => ConstituentWordOrder;
|
|
4935
4986
|
/**
|
|
4936
4987
|
* Prefixes a named-parameter value with the given `paramPrefix` unless the value already
|
|
4937
4988
|
* begins with it. Used by {@link formatQuery} to render rules whose `valueSource` is
|
|
@@ -4939,27 +4990,27 @@ declare const normalizeConstituentWordOrder: (input: string) => ConstituentWordO
|
|
|
4939
4990
|
*
|
|
4940
4991
|
* @group Export
|
|
4941
4992
|
*/
|
|
4942
|
-
declare const withParamPrefix: (value: unknown, paramPrefix?: string) => string;
|
|
4993
|
+
export declare const withParamPrefix: (value: unknown, paramPrefix?: string) => string;
|
|
4943
4994
|
/**
|
|
4944
4995
|
* Strips a leading `paramPrefix` from a named-parameter value if present. Inverse of
|
|
4945
4996
|
* {@link withParamPrefix}; used to normalize parameter names for validation/lookup.
|
|
4946
4997
|
*
|
|
4947
4998
|
* @group Export
|
|
4948
4999
|
*/
|
|
4949
|
-
declare const stripParamPrefix: (value: unknown, paramPrefix?: string) => string;
|
|
5000
|
+
export declare const stripParamPrefix: (value: unknown, paramPrefix?: string) => string;
|
|
4950
5001
|
/**
|
|
4951
5002
|
* Default translations used by {@link formatQuery} for "natural_language" format.
|
|
4952
5003
|
*
|
|
4953
5004
|
* @group Export
|
|
4954
5005
|
*/
|
|
4955
|
-
declare const defaultNLTranslations: NLTranslations;
|
|
5006
|
+
export declare const defaultNLTranslations: NLTranslations;
|
|
4956
5007
|
/**
|
|
4957
5008
|
* Used by {@link formatQuery} to get a translation based on certain conditions
|
|
4958
5009
|
* for the "natural_language" format.
|
|
4959
5010
|
*
|
|
4960
5011
|
* @group Export
|
|
4961
5012
|
*/
|
|
4962
|
-
declare const getNLTranslataion: (key: NLTranslationKey, translations: NLTranslations, conditions?: GroupVariantCondition[]) => string;
|
|
5013
|
+
export declare const getNLTranslataion: (key: NLTranslationKey, translations: NLTranslations, conditions?: GroupVariantCondition[]) => string;
|
|
4963
5014
|
type ProcessedMatchMode = {
|
|
4964
5015
|
mode: "all";
|
|
4965
5016
|
threshold?: number | null | undefined;
|
|
@@ -4991,12 +5042,12 @@ type ProcessedMatchMode = {
|
|
|
4991
5042
|
* 1. `threshold` is required and invalid, or
|
|
4992
5043
|
* 2. `value` is not a valid rule group.
|
|
4993
5044
|
*/
|
|
4994
|
-
declare const processMatchMode: (rule: RuleType) => null | false | ProcessedMatchMode;
|
|
5045
|
+
export declare const processMatchMode: (rule: RuleType) => null | false | ProcessedMatchMode;
|
|
4995
5046
|
/**
|
|
4996
5047
|
* Base alias assigned to the element binding of a subquery generated for a rule's
|
|
4997
5048
|
* {@link MatchMode `match` mode} (e.g. `unnest(field) as elem_alias`).
|
|
4998
5049
|
*/
|
|
4999
|
-
declare const subqueryElementAliasBase = "elem_alias";
|
|
5050
|
+
export declare const subqueryElementAliasBase = "elem_alias";
|
|
5000
5051
|
/**
|
|
5001
5052
|
* Returns the element alias for a subquery at the given nesting depth. Depth 0 (the common,
|
|
5002
5053
|
* non-nested case) uses {@link subqueryElementAliasBase} unchanged; deeper levels are suffixed
|
|
@@ -5006,7 +5057,7 @@ declare const subqueryElementAliasBase = "elem_alias";
|
|
|
5006
5057
|
*
|
|
5007
5058
|
* @group Export
|
|
5008
5059
|
*/
|
|
5009
|
-
declare const getSubqueryElementAlias: (subqueryDepth?: number) => string;
|
|
5060
|
+
export declare const getSubqueryElementAlias: (subqueryDepth?: number) => string;
|
|
5010
5061
|
/**
|
|
5011
5062
|
* "Replacer" method for JSON.stringify's second argument. Converts `bigint` values to
|
|
5012
5063
|
* objects with a `$bigint` property having a value of a string representation of
|
|
@@ -5016,7 +5067,7 @@ declare const getSubqueryElementAlias: (subqueryDepth?: number) => string;
|
|
|
5016
5067
|
*
|
|
5017
5068
|
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#use_within_json
|
|
5018
5069
|
*/
|
|
5019
|
-
declare const bigIntJsonStringifyReplacer: (_key: string, value: unknown) => unknown;
|
|
5070
|
+
export declare const bigIntJsonStringifyReplacer: (_key: string, value: unknown) => unknown;
|
|
5020
5071
|
/**
|
|
5021
5072
|
* "Reviver" method for JSON.parse's second argument. Converts objects having a single
|
|
5022
5073
|
* `$bigint: string` property to an actual `bigint` value.
|
|
@@ -5025,7 +5076,7 @@ declare const bigIntJsonStringifyReplacer: (_key: string, value: unknown) => unk
|
|
|
5025
5076
|
*
|
|
5026
5077
|
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt#use_within_json
|
|
5027
5078
|
*/
|
|
5028
|
-
declare const bigIntJsonParseReviver: (_key: string, value: unknown) => unknown;
|
|
5079
|
+
export declare const bigIntJsonParseReviver: (_key: string, value: unknown) => unknown;
|
|
5029
5080
|
//#endregion
|
|
5030
5081
|
//#region src/utils/formatQuery/index.d.ts
|
|
5031
5082
|
/**
|
|
@@ -5035,43 +5086,43 @@ declare const bigIntJsonParseReviver: (_key: string, value: unknown) => unknown;
|
|
|
5035
5086
|
*
|
|
5036
5087
|
* @group Export
|
|
5037
5088
|
*/
|
|
5038
|
-
declare const defaultValueProcessor: ValueProcessorLegacy;
|
|
5089
|
+
export declare const defaultValueProcessor: ValueProcessorLegacy;
|
|
5039
5090
|
/**
|
|
5040
5091
|
* @deprecated Prefer {@link defaultRuleProcessorMongoDB}.
|
|
5041
5092
|
*
|
|
5042
5093
|
* @group Export
|
|
5043
5094
|
*/
|
|
5044
|
-
declare const defaultMongoDBValueProcessor: ValueProcessorLegacy;
|
|
5095
|
+
export declare const defaultMongoDBValueProcessor: ValueProcessorLegacy;
|
|
5045
5096
|
/**
|
|
5046
5097
|
* @deprecated Prefer {@link defaultRuleProcessorCEL}.
|
|
5047
5098
|
*
|
|
5048
5099
|
* @group Export
|
|
5049
5100
|
*/
|
|
5050
|
-
declare const defaultCELValueProcessor: ValueProcessorLegacy;
|
|
5101
|
+
export declare const defaultCELValueProcessor: ValueProcessorLegacy;
|
|
5051
5102
|
/**
|
|
5052
5103
|
* @deprecated Prefer {@link defaultRuleProcessorSpEL}.
|
|
5053
5104
|
*
|
|
5054
5105
|
* @group Export
|
|
5055
5106
|
*/
|
|
5056
|
-
declare const defaultSpELValueProcessor: ValueProcessorLegacy;
|
|
5107
|
+
export declare const defaultSpELValueProcessor: ValueProcessorLegacy;
|
|
5057
5108
|
/**
|
|
5058
5109
|
* @deprecated Renamed to {@link defaultRuleProcessorCEL}.
|
|
5059
5110
|
*
|
|
5060
5111
|
* @group Export
|
|
5061
5112
|
*/
|
|
5062
|
-
declare const defaultValueProcessorCELByRule: RuleProcessor;
|
|
5113
|
+
export declare const defaultValueProcessorCELByRule: RuleProcessor;
|
|
5063
5114
|
/**
|
|
5064
5115
|
* @deprecated Renamed to {@link defaultRuleProcessorMongoDB}.
|
|
5065
5116
|
*
|
|
5066
5117
|
* @group Export
|
|
5067
5118
|
*/
|
|
5068
|
-
declare const defaultValueProcessorMongoDBByRule: RuleProcessor;
|
|
5119
|
+
export declare const defaultValueProcessorMongoDBByRule: RuleProcessor;
|
|
5069
5120
|
/**
|
|
5070
5121
|
* @deprecated Renamed to {@link defaultRuleProcessorSpEL}.
|
|
5071
5122
|
*
|
|
5072
5123
|
* @group Export
|
|
5073
5124
|
*/
|
|
5074
|
-
declare const defaultValueProcessorSpELByRule: RuleProcessor;
|
|
5125
|
+
export declare const defaultValueProcessorSpELByRule: RuleProcessor;
|
|
5075
5126
|
//#endregion
|
|
5076
5127
|
//#region src/utils/generateAccessibleDescription.d.ts
|
|
5077
5128
|
/**
|
|
@@ -5080,11 +5131,11 @@ declare const defaultValueProcessorSpELByRule: RuleProcessor;
|
|
|
5080
5131
|
*
|
|
5081
5132
|
* @group Accessibility
|
|
5082
5133
|
*/
|
|
5083
|
-
declare const generateAccessibleDescription: AccessibleDescriptionGenerator;
|
|
5134
|
+
export declare const generateAccessibleDescription: AccessibleDescriptionGenerator;
|
|
5084
5135
|
//#endregion
|
|
5085
5136
|
//#region src/utils/generateID.d.ts
|
|
5086
5137
|
type UUID = `${string}-${string}-${string}-${string}-${string}`;
|
|
5087
|
-
declare const uuidV4regex: RegExp;
|
|
5138
|
+
export declare const uuidV4regex: RegExp;
|
|
5088
5139
|
/**
|
|
5089
5140
|
* Default `id` generator. Generates a valid v4 UUID. Uses `crypto.randomUUID()`
|
|
5090
5141
|
* when available, otherwise uses an alternate method based on `getRandomValues`.
|
|
@@ -5094,7 +5145,7 @@ declare const uuidV4regex: RegExp;
|
|
|
5094
5145
|
* ```
|
|
5095
5146
|
* @returns Valid v4 UUID
|
|
5096
5147
|
*/
|
|
5097
|
-
declare let generateID: () => UUID;
|
|
5148
|
+
export declare let generateID: () => UUID;
|
|
5098
5149
|
//#endregion
|
|
5099
5150
|
//#region src/utils/immerInstances.d.ts
|
|
5100
5151
|
/**
|
|
@@ -5110,7 +5161,7 @@ declare let generateID: () => UUID;
|
|
|
5110
5161
|
*
|
|
5111
5162
|
* @group Query Tools
|
|
5112
5163
|
*/
|
|
5113
|
-
declare const setAutoFreeze: (autoFreeze: boolean) => void;
|
|
5164
|
+
export declare const setAutoFreeze: (autoFreeze: boolean) => void;
|
|
5114
5165
|
//#endregion
|
|
5115
5166
|
//#region src/utils/getMatchModesUtil.d.ts
|
|
5116
5167
|
/**
|
|
@@ -5119,19 +5170,19 @@ declare const setAutoFreeze: (autoFreeze: boolean) => void;
|
|
|
5119
5170
|
* property, the `getMatchModes` prop is used. Returns
|
|
5120
5171
|
* `FullOption<MatchMode>[]` of all match modes by default.
|
|
5121
5172
|
*/
|
|
5122
|
-
declare const getMatchModesUtil: <F extends FullField>(fieldData: F, getMatchModes?: (field: GetOptionIdentifierType<F>, misc: {
|
|
5173
|
+
export declare const getMatchModesUtil: <F extends FullField>(fieldData: F, getMatchModes?: (field: GetOptionIdentifierType<F>, misc: {
|
|
5123
5174
|
fieldData: F;
|
|
5124
5175
|
}) => boolean | MatchMode[] | FlexibleOption<MatchMode>[]) => MatchModeOptions;
|
|
5125
5176
|
//#endregion
|
|
5126
5177
|
//#region src/utils/getParseNumberMethod.d.ts
|
|
5127
|
-
declare const getParseNumberMethod: ({ parseNumbers, inputType }: {
|
|
5178
|
+
export declare const getParseNumberMethod: ({ parseNumbers, inputType }: {
|
|
5128
5179
|
parseNumbers?: ParseNumbersPropConfig;
|
|
5129
5180
|
inputType?: InputType | null;
|
|
5130
5181
|
}) => ParseNumberMethod;
|
|
5131
5182
|
//#endregion
|
|
5132
5183
|
//#region src/utils/getRuleDefaultValue.d.ts
|
|
5133
5184
|
/** Options for {@link getRuleDefaultValue}. */
|
|
5134
|
-
interface GetRuleDefaultValueOptions<F extends FullField = FullField> {
|
|
5185
|
+
export interface GetRuleDefaultValueOptions<F extends FullField = FullField> {
|
|
5135
5186
|
/** Resolved field configuration for `rule.field` (e.g. `fieldMap[rule.field] ?? {}`). */
|
|
5136
5187
|
fieldData: F;
|
|
5137
5188
|
/** Full field list, used to seed a comparator-valid field when `valueSource` is `'field'`. */
|
|
@@ -5172,7 +5223,7 @@ declare const getRuleDefaultValue$1: <F extends FullField = FullField>(rule: Rul
|
|
|
5172
5223
|
* Gets the standard classname for valid or invalid components
|
|
5173
5224
|
* based on the given validation result.
|
|
5174
5225
|
*/
|
|
5175
|
-
declare const getValidationClassNames: (validationResult: boolean | ValidationResult) => "" | (typeof standardClassnames)["valid"] | (typeof standardClassnames)["invalid"];
|
|
5226
|
+
export declare const getValidationClassNames: (validationResult: boolean | ValidationResult) => "" | (typeof standardClassnames)["valid"] | (typeof standardClassnames)["invalid"];
|
|
5176
5227
|
//#endregion
|
|
5177
5228
|
//#region src/utils/getValueSourcesUtil.d.ts
|
|
5178
5229
|
/**
|
|
@@ -5181,7 +5232,7 @@ declare const getValidationClassNames: (validationResult: boolean | ValidationRe
|
|
|
5181
5232
|
* `valueSources` property, the `getValueSources` prop is used.
|
|
5182
5233
|
* Returns `[FullOption<"value">]` by default.
|
|
5183
5234
|
*/
|
|
5184
|
-
declare const getValueSourcesUtil: <F extends FullField, O extends string>(fieldData: F, operator: string, getValueSources?: (field: GetOptionIdentifierType<F>, operator: O, misc: {
|
|
5235
|
+
export declare const getValueSourcesUtil: <F extends FullField, O extends string>(fieldData: F, operator: string, getValueSources?: (field: GetOptionIdentifierType<F>, operator: O, misc: {
|
|
5185
5236
|
fieldData: F;
|
|
5186
5237
|
}) => ValueSources | ValueSourceFlexibleOptions) => ValueSourceFullOptions;
|
|
5187
5238
|
//#endregion
|
|
@@ -5189,64 +5240,64 @@ declare const getValueSourcesUtil: <F extends FullField, O extends string>(field
|
|
|
5189
5240
|
/**
|
|
5190
5241
|
* Determines if an object is a {@link RuleType} (only checks for a `field` property).
|
|
5191
5242
|
*/
|
|
5192
|
-
declare const isRuleType: (s: unknown) => s is RuleType;
|
|
5243
|
+
export declare const isRuleType: (s: unknown) => s is RuleType;
|
|
5193
5244
|
/**
|
|
5194
5245
|
* Determines if an object is a {@link RuleGroupType} or {@link RuleGroupTypeIC}.
|
|
5195
5246
|
*/
|
|
5196
|
-
declare const isRuleGroup: (rg: unknown) => rg is RuleGroupTypeAny;
|
|
5247
|
+
export declare const isRuleGroup: (rg: unknown) => rg is RuleGroupTypeAny;
|
|
5197
5248
|
/**
|
|
5198
5249
|
* Determines if an object is a {@link RuleGroupType}.
|
|
5199
5250
|
*/
|
|
5200
|
-
declare const isRuleGroupType: (rg: unknown) => rg is RuleGroupType;
|
|
5251
|
+
export declare const isRuleGroupType: (rg: unknown) => rg is RuleGroupType;
|
|
5201
5252
|
/**
|
|
5202
5253
|
* Determines if an object is a {@link RuleGroupTypeIC}.
|
|
5203
5254
|
*/
|
|
5204
|
-
declare const isRuleGroupTypeIC: (rg: unknown) => rg is RuleGroupTypeIC;
|
|
5255
|
+
export declare const isRuleGroupTypeIC: (rg: unknown) => rg is RuleGroupTypeIC;
|
|
5205
5256
|
//#endregion
|
|
5206
5257
|
//#region src/utils/isRuleOrGroupValid.d.ts
|
|
5207
5258
|
/**
|
|
5208
5259
|
* Determines if an object is useful as a validation result.
|
|
5209
5260
|
*/
|
|
5210
|
-
declare const isValidationResult: (vr?: ValidationResult) => vr is ValidationResult;
|
|
5261
|
+
export declare const isValidationResult: (vr?: ValidationResult) => vr is ValidationResult;
|
|
5211
5262
|
/**
|
|
5212
5263
|
* Determines if a rule or group is valid based on a validation result (if defined)
|
|
5213
5264
|
* or a validator function. Returns `true` if neither are defined and the `muted`
|
|
5214
5265
|
* property is not `true`.
|
|
5215
5266
|
*/
|
|
5216
|
-
declare const isRuleOrGroupValid: (rg: RuleType | RuleGroupTypeAny, validationResult?: boolean | ValidationResult, validator?: RuleValidator) => boolean;
|
|
5267
|
+
export declare const isRuleOrGroupValid: (rg: RuleType | RuleGroupTypeAny, validationResult?: boolean | ValidationResult, validator?: RuleValidator) => boolean;
|
|
5217
5268
|
//#endregion
|
|
5218
5269
|
//#region src/utils/mergeAnyTranslations.d.ts
|
|
5219
5270
|
/**
|
|
5220
5271
|
* Merges any number of partial translations into a single definition.
|
|
5221
5272
|
*/
|
|
5222
|
-
declare const mergeAnyTranslations: (base: Record<string, Record<string, unknown>>, ...otherTranslations: (Record<string, Record<string, unknown>> | undefined)[]) => Record<string, Record<string, unknown>>;
|
|
5223
|
-
declare const mergeAnyTranslation: (el: string, keyPropContextMap: Record<string, [unknown, unknown]>, defaults?: Record<string, Record<string, unknown>>) => Record<string, Record<string, unknown>> | undefined;
|
|
5273
|
+
export declare const mergeAnyTranslations: (base: Record<string, Record<string, unknown>>, ...otherTranslations: (Record<string, Record<string, unknown>> | undefined)[]) => Record<string, Record<string, unknown>>;
|
|
5274
|
+
export declare const mergeAnyTranslation: (el: string, keyPropContextMap: Record<string, [unknown, unknown]>, defaults?: Record<string, Record<string, unknown>>) => Record<string, Record<string, unknown>> | undefined;
|
|
5224
5275
|
//#endregion
|
|
5225
5276
|
//#region src/utils/mergeClassnames.d.ts
|
|
5226
5277
|
type MergeClassnamesParams = (Partial<Classnames> | undefined)[];
|
|
5227
5278
|
/**
|
|
5228
5279
|
* Merges a list of partial {@link Classnames} definitions into a single definition.
|
|
5229
5280
|
*/
|
|
5230
|
-
declare const mergeClassnames: (...args: MergeClassnamesParams) => Classnames;
|
|
5281
|
+
export declare const mergeClassnames: (...args: MergeClassnamesParams) => Classnames;
|
|
5231
5282
|
//#endregion
|
|
5232
5283
|
//#region src/utils/misc.d.ts
|
|
5233
5284
|
/**
|
|
5234
5285
|
* Converts a value to lowercase if it's a string, otherwise returns the value as is.
|
|
5235
5286
|
*/
|
|
5236
|
-
declare const lc: <T>(v: T) => T;
|
|
5287
|
+
export declare const lc: <T>(v: T) => T;
|
|
5237
5288
|
/**
|
|
5238
5289
|
* Regex matching numeric strings. Passes for positive/negative integers, decimals,
|
|
5239
5290
|
* and E notation, with optional surrounding whitespace.
|
|
5240
5291
|
*/
|
|
5241
|
-
declare const numericRegex: RegExp;
|
|
5292
|
+
export declare const numericRegex: RegExp;
|
|
5242
5293
|
/**
|
|
5243
5294
|
* Determines if a variable is a plain old JavaScript object, aka POJO.
|
|
5244
5295
|
*/
|
|
5245
|
-
declare const isPojo: (obj: unknown) => obj is Record<string, any>;
|
|
5296
|
+
export declare const isPojo: (obj: unknown) => obj is Record<string, any>;
|
|
5246
5297
|
/**
|
|
5247
5298
|
* Simple helper to determine whether a value is null, undefined, or an empty string.
|
|
5248
5299
|
*/
|
|
5249
|
-
declare const nullOrUndefinedOrEmpty: (value: unknown) => value is null | undefined | "";
|
|
5300
|
+
export declare const nullOrUndefinedOrEmpty: (value: unknown) => value is null | undefined | "";
|
|
5250
5301
|
//#endregion
|
|
5251
5302
|
//#region src/utils/objectUtils.d.ts
|
|
5252
5303
|
/**
|
|
@@ -5261,24 +5312,24 @@ type ObjectKeys<T extends object> = Exclude<keyof T, symbol>;
|
|
|
5261
5312
|
*
|
|
5262
5313
|
* [Original source](https://github.com/sindresorhus/ts-extras/blob/44f57392c5f027268330771996c4fdf9260b22d6/source/object-keys.ts)
|
|
5263
5314
|
*/
|
|
5264
|
-
declare const objectKeys: <Type extends object>(value: Type) => Array<ObjectKeys<Type>>;
|
|
5315
|
+
export declare const objectKeys: <Type extends object>(value: Type) => Array<ObjectKeys<Type>>;
|
|
5265
5316
|
/**
|
|
5266
5317
|
* A strongly-typed version of `Object.entries()`.
|
|
5267
5318
|
*
|
|
5268
5319
|
* [Original source](https://github.com/sindresorhus/ts-extras/blob/44f57392c5f027268330771996c4fdf9260b22d6/source/object-entries.ts)
|
|
5269
5320
|
*/
|
|
5270
|
-
declare const objectEntries: <Type extends Record<PropertyKey, unknown>>(value: Type) => Array<[ObjectKeys<Type>, Type[ObjectKeys<Type>]]>;
|
|
5321
|
+
export declare const objectEntries: <Type extends Record<PropertyKey, unknown>>(value: Type) => Array<[ObjectKeys<Type>, Type[ObjectKeys<Type>]]>;
|
|
5271
5322
|
/**
|
|
5272
5323
|
* Returns `true` if the key could cause prototype pollution when used
|
|
5273
5324
|
* as a property name in bracket-notation assignment.
|
|
5274
5325
|
*/
|
|
5275
|
-
declare const isUnsafeKey: (key: unknown) => boolean;
|
|
5326
|
+
export declare const isUnsafeKey: (key: unknown) => boolean;
|
|
5276
5327
|
//#endregion
|
|
5277
5328
|
//#region src/utils/optionResolvers.d.ts
|
|
5278
5329
|
/**
|
|
5279
5330
|
* Options shared by the resolvers below that produce a normalized option list.
|
|
5280
5331
|
*/
|
|
5281
|
-
interface ResolveOptionListOptions {
|
|
5332
|
+
export interface ResolveOptionListOptions {
|
|
5282
5333
|
/**
|
|
5283
5334
|
* Prepended as an empty placeholder option when `autoSelectOption` is `false`. Supplied by the
|
|
5284
5335
|
* `translations` prop in React; omit it where translations don't apply.
|
|
@@ -5296,7 +5347,7 @@ interface ResolveOptionListOptions {
|
|
|
5296
5347
|
*
|
|
5297
5348
|
* @group Option Lists
|
|
5298
5349
|
*/
|
|
5299
|
-
declare const resolveOperatorList: <F extends FullField = FullField, O extends FullOperator = FullOperator>({ field, fieldData, getOperators, operators, placeholder, baseOption, autoSelectOption }: {
|
|
5350
|
+
export declare const resolveOperatorList: <F extends FullField = FullField, O extends FullOperator = FullOperator>({ field, fieldData, getOperators, operators, placeholder, baseOption, autoSelectOption }: {
|
|
5300
5351
|
field: string;
|
|
5301
5352
|
fieldData: F;
|
|
5302
5353
|
getOperators?: (field: string, misc: {
|
|
@@ -5311,7 +5362,7 @@ declare const resolveOperatorList: <F extends FullField = FullField, O extends F
|
|
|
5311
5362
|
*
|
|
5312
5363
|
* @group Option Lists
|
|
5313
5364
|
*/
|
|
5314
|
-
declare const resolveDefaultOperator: <F extends FullField = FullField>({ field, fieldData, getDefaultOperator, getOperators }: {
|
|
5365
|
+
export declare const resolveDefaultOperator: <F extends FullField = FullField>({ field, fieldData, getDefaultOperator, getOperators }: {
|
|
5315
5366
|
field: string;
|
|
5316
5367
|
fieldData: F;
|
|
5317
5368
|
getDefaultOperator?: string | ((field: string, misc: {
|
|
@@ -5329,7 +5380,7 @@ declare const resolveDefaultOperator: <F extends FullField = FullField>({ field,
|
|
|
5329
5380
|
*
|
|
5330
5381
|
* @group Option Lists
|
|
5331
5382
|
*/
|
|
5332
|
-
declare const resolveValueEditorType: <F extends FullField = FullField>({ field, operator, fieldData, getValueEditorType }: {
|
|
5383
|
+
export declare const resolveValueEditorType: <F extends FullField = FullField>({ field, operator, fieldData, getValueEditorType }: {
|
|
5333
5384
|
field: string;
|
|
5334
5385
|
operator: string;
|
|
5335
5386
|
fieldData: F;
|
|
@@ -5344,7 +5395,7 @@ declare const resolveValueEditorType: <F extends FullField = FullField>({ field,
|
|
|
5344
5395
|
*
|
|
5345
5396
|
* @group Option Lists
|
|
5346
5397
|
*/
|
|
5347
|
-
declare const resolveValueList: <F extends FullField = FullField>({ field, operator, fieldData, getValues, placeholder, baseOption, autoSelectOption }: {
|
|
5398
|
+
export declare const resolveValueList: <F extends FullField = FullField>({ field, operator, fieldData, getValues, placeholder, baseOption, autoSelectOption }: {
|
|
5348
5399
|
field: string;
|
|
5349
5400
|
operator: string;
|
|
5350
5401
|
fieldData: F;
|
|
@@ -5360,27 +5411,27 @@ declare const resolveValueList: <F extends FullField = FullField>({ field, opera
|
|
|
5360
5411
|
*
|
|
5361
5412
|
* @group Option Lists
|
|
5362
5413
|
*/
|
|
5363
|
-
declare function toFullOption<Opt extends BaseOption>(opt: Opt | string, baseProperties?: Record<string, unknown>, labelMap?: Record<string, unknown>): ToFullOption<Opt>;
|
|
5414
|
+
export declare function toFullOption<Opt extends BaseOption>(opt: Opt | string, baseProperties?: Record<string, unknown>, labelMap?: Record<string, unknown>): ToFullOption<Opt>;
|
|
5364
5415
|
/**
|
|
5365
5416
|
* Converts an {@link OptionList} or {@link FlexibleOptionList} into a {@link FullOptionList}.
|
|
5366
5417
|
* Lists of full options are left unchanged.
|
|
5367
5418
|
*
|
|
5368
5419
|
* @group Option Lists
|
|
5369
5420
|
*/
|
|
5370
|
-
declare function toFullOptionList<Opt extends BaseOption>(optList: unknown[], baseProperties?: Record<string, unknown>, labelMap?: Record<string, unknown>): FullOptionList<Opt>;
|
|
5421
|
+
export declare function toFullOptionList<Opt extends BaseOption>(optList: unknown[], baseProperties?: Record<string, unknown>, labelMap?: Record<string, unknown>): FullOptionList<Opt>;
|
|
5371
5422
|
/**
|
|
5372
5423
|
* Converts a {@link FlexibleOptionList} into a {@link FullOptionList}.
|
|
5373
5424
|
* Lists of full options are left unchanged.
|
|
5374
5425
|
*
|
|
5375
5426
|
* @group Option Lists
|
|
5376
5427
|
*/
|
|
5377
|
-
declare function toFullOptionMap<OptMap extends BaseOptionMap>(optMap: OptMap, baseProperties?: Record<string, unknown>): OptMap extends BaseOptionMap<infer V, infer K> ? Partial<Record<K, ToFullOption<V>>> : never;
|
|
5428
|
+
export declare function toFullOptionMap<OptMap extends BaseOptionMap>(optMap: OptMap, baseProperties?: Record<string, unknown>): OptMap extends BaseOptionMap<infer V, infer K> ? Partial<Record<K, ToFullOption<V>>> : never;
|
|
5378
5429
|
/**
|
|
5379
5430
|
* @deprecated Renamed to {@link uniqByIdentifier}.
|
|
5380
5431
|
*
|
|
5381
5432
|
* @group Option Lists
|
|
5382
5433
|
*/
|
|
5383
|
-
declare const uniqByName: <T extends {
|
|
5434
|
+
export declare const uniqByName: <T extends {
|
|
5384
5435
|
name: string;
|
|
5385
5436
|
value?: string;
|
|
5386
5437
|
} | {
|
|
@@ -5393,7 +5444,7 @@ declare const uniqByName: <T extends {
|
|
|
5393
5444
|
*
|
|
5394
5445
|
* @group Option Lists
|
|
5395
5446
|
*/
|
|
5396
|
-
declare const uniqByIdentifier: <T extends RequireAtLeastOne$1<{
|
|
5447
|
+
export declare const uniqByIdentifier: <T extends RequireAtLeastOne$1<{
|
|
5397
5448
|
name: string;
|
|
5398
5449
|
value: string;
|
|
5399
5450
|
}, "name" | "value">>(originalArray: T[]) => T[];
|
|
@@ -5402,25 +5453,25 @@ declare const uniqByIdentifier: <T extends RequireAtLeastOne$1<{
|
|
|
5402
5453
|
*
|
|
5403
5454
|
* @group Option Lists
|
|
5404
5455
|
*/
|
|
5405
|
-
declare const isOptionGroupArray: (arr: unknown) => arr is OptionGroup<BaseOption>[];
|
|
5456
|
+
export declare const isOptionGroupArray: (arr: unknown) => arr is OptionGroup<BaseOption>[];
|
|
5406
5457
|
/**
|
|
5407
5458
|
* Determines if an array is a flat array of {@link FlexibleOption}.
|
|
5408
5459
|
*
|
|
5409
5460
|
* @group Option Lists
|
|
5410
5461
|
*/
|
|
5411
|
-
declare const isFlexibleOptionArray: (arr: unknown) => arr is FlexibleOption[];
|
|
5462
|
+
export declare const isFlexibleOptionArray: (arr: unknown) => arr is FlexibleOption[];
|
|
5412
5463
|
/**
|
|
5413
5464
|
* Determines if an array is a flat array of {@link FullOption}.
|
|
5414
5465
|
*
|
|
5415
5466
|
* @group Option Lists
|
|
5416
5467
|
*/
|
|
5417
|
-
declare const isFullOptionArray: (arr: unknown) => arr is FullOption[];
|
|
5468
|
+
export declare const isFullOptionArray: (arr: unknown) => arr is FullOption[];
|
|
5418
5469
|
/**
|
|
5419
5470
|
* Determines if a {@link FlexibleOptionList} is a {@link FlexibleOptionGroup} array.
|
|
5420
5471
|
*
|
|
5421
5472
|
* @group Option Lists
|
|
5422
5473
|
*/
|
|
5423
|
-
declare const isFlexibleOptionGroupArray: (arr: unknown, { allowEmpty }?: {
|
|
5474
|
+
export declare const isFlexibleOptionGroupArray: (arr: unknown, { allowEmpty }?: {
|
|
5424
5475
|
allowEmpty?: boolean;
|
|
5425
5476
|
}) => arr is FlexibleOptionGroup[];
|
|
5426
5477
|
/**
|
|
@@ -5428,7 +5479,7 @@ declare const isFlexibleOptionGroupArray: (arr: unknown, { allowEmpty }?: {
|
|
|
5428
5479
|
*
|
|
5429
5480
|
* @group Option Lists
|
|
5430
5481
|
*/
|
|
5431
|
-
declare const isFullOptionGroupArray: (arr: unknown, { allowEmpty }?: {
|
|
5482
|
+
export declare const isFullOptionGroupArray: (arr: unknown, { allowEmpty }?: {
|
|
5432
5483
|
allowEmpty?: boolean;
|
|
5433
5484
|
}) => arr is OptionGroup<FullOption>[];
|
|
5434
5485
|
/**
|
|
@@ -5437,46 +5488,46 @@ declare const isFullOptionGroupArray: (arr: unknown, { allowEmpty }?: {
|
|
|
5437
5488
|
*
|
|
5438
5489
|
* @group Option Lists
|
|
5439
5490
|
*/
|
|
5440
|
-
declare function getOption<OptType extends FullOption>(arr: FullOptionList<OptType>, name: string): OptType | undefined;
|
|
5441
|
-
declare function getOption<OptType extends ValueOption>(arr: FlexibleOptionList<OptType>, name: string): OptType | undefined;
|
|
5442
|
-
declare function getOption<OptType extends Option>(arr: FlexibleOptionList<OptType>, name: string): OptType | undefined;
|
|
5491
|
+
export declare function getOption<OptType extends FullOption>(arr: FullOptionList<OptType>, name: string): OptType | undefined;
|
|
5492
|
+
export declare function getOption<OptType extends ValueOption>(arr: FlexibleOptionList<OptType>, name: string): OptType | undefined;
|
|
5493
|
+
export declare function getOption<OptType extends Option>(arr: FlexibleOptionList<OptType>, name: string): OptType | undefined;
|
|
5443
5494
|
/**
|
|
5444
5495
|
* Gets the first option from an {@link OptionList}.
|
|
5445
5496
|
*
|
|
5446
5497
|
* @group Option Lists
|
|
5447
5498
|
*/
|
|
5448
|
-
declare function getFirstOption<Opt extends FullOption>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
|
|
5449
|
-
declare function getFirstOption<Opt extends ValueOption>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
|
|
5450
|
-
declare function getFirstOption<Opt extends Option>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
|
|
5499
|
+
export declare function getFirstOption<Opt extends FullOption>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
|
|
5500
|
+
export declare function getFirstOption<Opt extends ValueOption>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
|
|
5501
|
+
export declare function getFirstOption<Opt extends Option>(arr?: OptionGroup<Opt>[] | Opt[]): GetOptionIdentifierType<Opt> | null;
|
|
5451
5502
|
/**
|
|
5452
5503
|
* Flattens {@link FlexibleOptionGroup} arrays into {@link BaseOption} arrays.
|
|
5453
5504
|
* If the array is already flat, it is returned as is.
|
|
5454
5505
|
*
|
|
5455
5506
|
* @group Option Lists
|
|
5456
5507
|
*/
|
|
5457
|
-
declare const toFlatOptionArray: <T extends FullOption>(arr: FullOptionList<T>) => T[];
|
|
5508
|
+
export declare const toFlatOptionArray: <T extends FullOption>(arr: FullOptionList<T>) => T[];
|
|
5458
5509
|
/**
|
|
5459
5510
|
* Generates a new {@link OptionGroup} array with duplicates
|
|
5460
5511
|
* removed based on the identifying property (`value` or `name`).
|
|
5461
5512
|
*
|
|
5462
5513
|
* @group Option Lists
|
|
5463
5514
|
*/
|
|
5464
|
-
declare const uniqOptGroups: <T extends BaseOption>(originalArray: FlexibleOptionGroup<T>[]) => OptionGroup<ToFullOption<T>>[];
|
|
5515
|
+
export declare const uniqOptGroups: <T extends BaseOption>(originalArray: FlexibleOptionGroup<T>[]) => OptionGroup<ToFullOption<T>>[];
|
|
5465
5516
|
/**
|
|
5466
5517
|
* Generates a new {@link Option} or {@link OptionGroup} array with duplicates
|
|
5467
5518
|
* removed based on the identifier property (`value` or `name`).
|
|
5468
5519
|
*
|
|
5469
5520
|
* @group Option Lists
|
|
5470
5521
|
*/
|
|
5471
|
-
declare const uniqOptList: <T extends BaseOption>(originalArray: FlexibleOptionList<T>) => WithUnknownIndex<BaseOption & FullOption>[] | OptionGroup<ToFullOption<T>>[];
|
|
5522
|
+
export declare const uniqOptList: <T extends BaseOption>(originalArray: FlexibleOptionList<T>) => WithUnknownIndex<BaseOption & FullOption>[] | OptionGroup<ToFullOption<T>>[];
|
|
5472
5523
|
/** Result of {@link prepareOptionList}. */
|
|
5473
|
-
interface PreparedOptionList<O extends FullOption> {
|
|
5524
|
+
export interface PreparedOptionList<O extends FullOption> {
|
|
5474
5525
|
defaultOption: FullOption;
|
|
5475
5526
|
optionList: FullOptionList<O>;
|
|
5476
5527
|
optionsMap: Partial<FullOptionRecord<O>>;
|
|
5477
5528
|
}
|
|
5478
5529
|
/** Parameters for {@link prepareOptionList}. */
|
|
5479
|
-
interface PrepareOptionListParams<O extends FullOption> {
|
|
5530
|
+
export interface PrepareOptionListParams<O extends FullOption> {
|
|
5480
5531
|
placeholder?: Placeholder;
|
|
5481
5532
|
optionList?: FlexibleOptionListProp<O> | BaseOptionMap<O>;
|
|
5482
5533
|
baseOption?: Record<string, unknown>;
|
|
@@ -5497,50 +5548,50 @@ interface PrepareOptionListParams<O extends FullOption> {
|
|
|
5497
5548
|
*
|
|
5498
5549
|
* @group Option Lists
|
|
5499
5550
|
*/
|
|
5500
|
-
declare const prepareOptionList: <O extends FullOption>(props: PrepareOptionListParams<O>) => PreparedOptionList<O>;
|
|
5551
|
+
export declare const prepareOptionList: <O extends FullOption>(props: PrepareOptionListParams<O>) => PreparedOptionList<O>;
|
|
5501
5552
|
//#endregion
|
|
5502
5553
|
//#region src/utils/pathUtils.d.ts
|
|
5503
5554
|
/**
|
|
5504
5555
|
* Return type for {@link findPath}.
|
|
5505
5556
|
*/
|
|
5506
|
-
type FindPathReturnType = RuleGroupTypeAny | RuleType | null;
|
|
5557
|
+
export type FindPathReturnType = RuleGroupTypeAny | RuleType | null;
|
|
5507
5558
|
/**
|
|
5508
5559
|
* Returns the {@link RuleType} or {@link RuleGroupType}/{@link RuleGroupTypeIC}
|
|
5509
5560
|
* at the given path within a query.
|
|
5510
5561
|
*/
|
|
5511
|
-
declare const findPath: (path: Path, query: RuleGroupTypeAny) => FindPathReturnType;
|
|
5562
|
+
export declare const findPath: (path: Path, query: RuleGroupTypeAny) => FindPathReturnType;
|
|
5512
5563
|
/**
|
|
5513
5564
|
* Returns the {@link RuleType} or {@link RuleGroupType}/{@link RuleGroupTypeIC}
|
|
5514
5565
|
* with the given `id` within a query.
|
|
5515
5566
|
*/
|
|
5516
|
-
declare const findID: (id: string, query: RuleGroupTypeAny) => FindPathReturnType;
|
|
5567
|
+
export declare const findID: (id: string, query: RuleGroupTypeAny) => FindPathReturnType;
|
|
5517
5568
|
/**
|
|
5518
5569
|
* Returns the {@link Path} of the {@link RuleType} or {@link RuleGroupType}/{@link RuleGroupTypeIC}
|
|
5519
5570
|
* with the given `id` within a query.
|
|
5520
5571
|
*/
|
|
5521
|
-
declare const getPathOfID: (id: string, query: RuleGroupTypeAny) => Path | null;
|
|
5572
|
+
export declare const getPathOfID: (id: string, query: RuleGroupTypeAny) => Path | null;
|
|
5522
5573
|
/**
|
|
5523
5574
|
* Truncates the last element of an array and returns the result as a new array.
|
|
5524
5575
|
*/
|
|
5525
|
-
declare const getParentPath: (path: Path) => Path;
|
|
5576
|
+
export declare const getParentPath: (path: Path) => Path;
|
|
5526
5577
|
/**
|
|
5527
5578
|
* Determines if two paths (each `Path`) are equivalent.
|
|
5528
5579
|
*/
|
|
5529
|
-
declare const pathsAreEqual: (path1: Path, path2: Path) => boolean;
|
|
5580
|
+
export declare const pathsAreEqual: (path1: Path, path2: Path) => boolean;
|
|
5530
5581
|
/**
|
|
5531
5582
|
* Determines if the first path is an ancestor of the second path. The first path must
|
|
5532
5583
|
* be shorter and exactly match the second path up through the length of the first path.
|
|
5533
5584
|
*/
|
|
5534
|
-
declare const isAncestor: (maybeAncestor: Path, path: Path) => boolean;
|
|
5585
|
+
export declare const isAncestor: (maybeAncestor: Path, path: Path) => boolean;
|
|
5535
5586
|
/**
|
|
5536
5587
|
* Finds the deepest/longest path that two paths have in common.
|
|
5537
5588
|
*/
|
|
5538
|
-
declare const getCommonAncestorPath: (path1: Path, path2: Path) => Path;
|
|
5589
|
+
export declare const getCommonAncestorPath: (path1: Path, path2: Path) => Path;
|
|
5539
5590
|
/**
|
|
5540
5591
|
* Determines if the rule or group at the specified path is either disabled itself
|
|
5541
5592
|
* or disabled by an ancestor group.
|
|
5542
5593
|
*/
|
|
5543
|
-
declare const pathIsDisabled: (path: Path, query: RuleGroupTypeAny) => boolean;
|
|
5594
|
+
export declare const pathIsDisabled: (path: Path, query: RuleGroupTypeAny) => boolean;
|
|
5544
5595
|
/**
|
|
5545
5596
|
* Determines if the rule or group at the specified path is disabled by `disabledPaths`—the array
|
|
5546
5597
|
* form of the `QueryBuilder` `disabled` prop, which disables nodes by position rather than by a
|
|
@@ -5549,8 +5600,8 @@ declare const pathIsDisabled: (path: Path, query: RuleGroupTypeAny) => boolean;
|
|
|
5549
5600
|
*
|
|
5550
5601
|
* @group Paths
|
|
5551
5602
|
*/
|
|
5552
|
-
declare const pathIsDisabledByPaths: (path: Path, disabledPaths?: Path[]) => boolean;
|
|
5553
|
-
/** The path of a child rule or group, and whether it is disabled. */ interface PathInfo {
|
|
5603
|
+
export declare const pathIsDisabledByPaths: (path: Path, disabledPaths?: Path[]) => boolean;
|
|
5604
|
+
/** The path of a child rule or group, and whether it is disabled. */ export interface PathInfo {
|
|
5554
5605
|
path: Path;
|
|
5555
5606
|
disabled: boolean;
|
|
5556
5607
|
}
|
|
@@ -5560,7 +5611,7 @@ declare const pathIsDisabledByPaths: (path: Path, disabledPaths?: Path[]) => boo
|
|
|
5560
5611
|
*
|
|
5561
5612
|
* @group Paths
|
|
5562
5613
|
*/
|
|
5563
|
-
declare const derivePathInfo: (path: Path, childCount: number, { disabled, disabledPaths }?: {
|
|
5614
|
+
export declare const derivePathInfo: (path: Path, childCount: number, { disabled, disabledPaths }?: {
|
|
5564
5615
|
disabled?: boolean;
|
|
5565
5616
|
disabledPaths?: Path[];
|
|
5566
5617
|
}) => PathInfo[];
|
|
@@ -5569,7 +5620,7 @@ declare const derivePathInfo: (path: Path, childCount: number, { disabled, disab
|
|
|
5569
5620
|
/**
|
|
5570
5621
|
* Options object for {@link index!transformQuery transformQuery}.
|
|
5571
5622
|
*/
|
|
5572
|
-
interface TransformQueryOptions<RG extends RuleGroupTypeAny = RuleGroupType> {
|
|
5623
|
+
export interface TransformQueryOptions<RG extends RuleGroupTypeAny = RuleGroupType> {
|
|
5573
5624
|
/**
|
|
5574
5625
|
* When a rule is encountered in the hierarchy, it will be replaced
|
|
5575
5626
|
* with the result of this function.
|
|
@@ -5669,14 +5720,14 @@ interface TransformQueryOptions<RG extends RuleGroupTypeAny = RuleGroupType> {
|
|
|
5669
5720
|
*
|
|
5670
5721
|
* [Documentation](https://react-querybuilder.js.org/docs/utils/misc#transformquery)
|
|
5671
5722
|
*/
|
|
5672
|
-
declare function transformQuery(query: RuleGroupType, options?: TransformQueryOptions): any;
|
|
5723
|
+
export declare function transformQuery(query: RuleGroupType, options?: TransformQueryOptions): any;
|
|
5673
5724
|
/**
|
|
5674
5725
|
* Recursively process a query heirarchy with independent combinators using this
|
|
5675
5726
|
* versatile utility function.
|
|
5676
5727
|
*
|
|
5677
5728
|
* [Documentation](https://react-querybuilder.js.org/docs/utils/misc#transformquery)
|
|
5678
5729
|
*/
|
|
5679
|
-
declare function transformQuery(query: RuleGroupTypeIC, options?: TransformQueryOptions<RuleGroupTypeIC>): any;
|
|
5730
|
+
export declare function transformQuery(query: RuleGroupTypeIC, options?: TransformQueryOptions<RuleGroupTypeIC>): any;
|
|
5680
5731
|
//#endregion
|
|
5681
5732
|
//#region src/utils/QueryManager.d.ts
|
|
5682
5733
|
/**
|
|
@@ -5685,7 +5736,7 @@ declare function transformQuery(query: RuleGroupTypeIC, options?: TransformQuery
|
|
|
5685
5736
|
*
|
|
5686
5737
|
* @group Query Tools
|
|
5687
5738
|
*/
|
|
5688
|
-
declare class QueryManagerError extends Error {
|
|
5739
|
+
export declare class QueryManagerError extends Error {
|
|
5689
5740
|
/** Why the operation was aborted. */
|
|
5690
5741
|
readonly code: AbortReason;
|
|
5691
5742
|
/** Full details about the aborted operation. */
|
|
@@ -5698,7 +5749,7 @@ declare class QueryManagerError extends Error {
|
|
|
5698
5749
|
*
|
|
5699
5750
|
* @group Query Tools
|
|
5700
5751
|
*/
|
|
5701
|
-
interface StrictOptions {
|
|
5752
|
+
export interface StrictOptions {
|
|
5702
5753
|
/**
|
|
5703
5754
|
* Throw a {@link QueryManagerError} when an operation is aborted for one of the
|
|
5704
5755
|
* {@link strictAbortReasons}. Overrides the manager's own `strict` option.
|
|
@@ -5720,7 +5771,7 @@ interface StrictOptions {
|
|
|
5720
5771
|
*
|
|
5721
5772
|
* @group Query Tools
|
|
5722
5773
|
*/
|
|
5723
|
-
type DefaultFieldProp<F extends FullField = FullField> = string | ((fieldsData: FullOptionList<F>) => string);
|
|
5774
|
+
export type DefaultFieldProp<F extends FullField = FullField> = string | ((fieldsData: FullOptionList<F>) => string);
|
|
5724
5775
|
/**
|
|
5725
5776
|
* The `getDefaultOperator` option: either an operator name or a function that picks one.
|
|
5726
5777
|
*
|
|
@@ -5729,7 +5780,7 @@ type DefaultFieldProp<F extends FullField = FullField> = string | ((fieldsData:
|
|
|
5729
5780
|
*
|
|
5730
5781
|
* @group Query Tools
|
|
5731
5782
|
*/
|
|
5732
|
-
type DefaultOperatorProp<F extends FullField = FullField> = string | ((field: string, misc: {
|
|
5783
|
+
export type DefaultOperatorProp<F extends FullField = FullField> = string | ((field: string, misc: {
|
|
5733
5784
|
fieldData: F;
|
|
5734
5785
|
}) => string);
|
|
5735
5786
|
/**
|
|
@@ -5739,7 +5790,7 @@ type DefaultOperatorProp<F extends FullField = FullField> = string | ((field: st
|
|
|
5739
5790
|
*
|
|
5740
5791
|
* @group Query Tools
|
|
5741
5792
|
*/
|
|
5742
|
-
interface QueryManagerOptions<F extends FullField = FullField, O extends FullOperator = FullOperator, C extends FullCombinator = FullCombinator> {
|
|
5793
|
+
export interface QueryManagerOptions<F extends FullField = FullField, O extends FullOperator = FullOperator, C extends FullCombinator = FullCombinator> {
|
|
5743
5794
|
/** The fields available for rules. Accepts the same shapes as the `fields` prop. */
|
|
5744
5795
|
fields?: FlexibleOptionListProp<F> | BaseOptionMap<F>;
|
|
5745
5796
|
/** The operators available for rules. Accepts the same shapes as the `operators` prop. */
|
|
@@ -5900,7 +5951,7 @@ interface QueryManagerOptions<F extends FullField = FullField, O extends FullOpe
|
|
|
5900
5951
|
*
|
|
5901
5952
|
* @group Query Tools
|
|
5902
5953
|
*/
|
|
5903
|
-
interface SubscriptionChange {
|
|
5954
|
+
export interface SubscriptionChange {
|
|
5904
5955
|
/** The query was replaced. */
|
|
5905
5956
|
query: boolean;
|
|
5906
5957
|
/** Options were applied, so option lists and any derived configuration may have changed. */
|
|
@@ -5910,7 +5961,7 @@ interface SubscriptionChange {
|
|
|
5910
5961
|
* A single rule or group encountered by {@link QueryManager.walk}, along with where it was found.
|
|
5911
5962
|
*
|
|
5912
5963
|
* @group Query Tools
|
|
5913
|
-
*/ interface QueryNode<RG extends RuleGroupTypeAny = RuleGroupType> {
|
|
5964
|
+
*/ export interface QueryNode<RG extends RuleGroupTypeAny = RuleGroupType> {
|
|
5914
5965
|
/** The rule or group itself. */
|
|
5915
5966
|
node: RG | RuleType;
|
|
5916
5967
|
/** The {@link Path} of `node` within the query. The root group's path is `[]`. */
|
|
@@ -5923,7 +5974,7 @@ interface SubscriptionChange {
|
|
|
5923
5974
|
*
|
|
5924
5975
|
* @group Query Tools
|
|
5925
5976
|
*/
|
|
5926
|
-
interface WalkOptions {
|
|
5977
|
+
export interface WalkOptions {
|
|
5927
5978
|
/**
|
|
5928
5979
|
* Traverse only the subtree rooted at this path or `id` instead of the whole query. The node
|
|
5929
5980
|
* itself is visited first. When the path or `id` can't be resolved, nothing is visited.
|
|
@@ -5963,7 +6014,7 @@ type AsRuleGroup<T> = T extends RuleGroupTypeAny ? T : RuleGroupTypeAny;
|
|
|
5963
6014
|
*
|
|
5964
6015
|
* @group Query Tools
|
|
5965
6016
|
*/
|
|
5966
|
-
declare class QueryManager<RG extends RuleGroupTypeAny = RuleGroupType, F extends FullField = FullField, O extends FullOperator = FullOperator, C extends FullCombinator = FullCombinator> {
|
|
6017
|
+
export declare class QueryManager<RG extends RuleGroupTypeAny = RuleGroupType, F extends FullField = FullField, O extends FullOperator = FullOperator, C extends FullCombinator = FullCombinator> {
|
|
5967
6018
|
/**
|
|
5968
6019
|
* All instance state, rather than `#private` fields. See `kState` for why.
|
|
5969
6020
|
*
|
|
@@ -6096,6 +6147,12 @@ declare class QueryManager<RG extends RuleGroupTypeAny = RuleGroupType, F extend
|
|
|
6096
6147
|
* `targetPathOrID` and `sourcePathOrID`.
|
|
6097
6148
|
*/
|
|
6098
6149
|
group(sourcePathOrID: Path | string, targetPathOrID: Path | string, options?: GroupOptions & StrictOptions): this;
|
|
6150
|
+
/**
|
|
6151
|
+
* Replaces the group at `pathOrID` with its own rules in the parent group. The group's
|
|
6152
|
+
* `combinator`, `not`, `id`, `muted`, and `disabled` properties are discarded; an empty group
|
|
6153
|
+
* is simply removed.
|
|
6154
|
+
*/
|
|
6155
|
+
ungroup(pathOrID: Path | string, options?: UngroupOptions & StrictOptions): this;
|
|
6099
6156
|
/**
|
|
6100
6157
|
* The options currently in effect, as a frozen shallow copy. Reflects everything applied by
|
|
6101
6158
|
* the constructor and any subsequent {@link QueryManager.reconfigure} calls, but not the
|
|
@@ -6468,7 +6525,7 @@ declare class QueryManager<RG extends RuleGroupTypeAny = RuleGroupType, F extend
|
|
|
6468
6525
|
* be proven equivalent, so a caller that rebuilds `getDefaultValue` per render must either
|
|
6469
6526
|
* memoize it or accept the reconfigure.
|
|
6470
6527
|
*/
|
|
6471
|
-
declare const valuesEqual: (a: unknown, b: unknown) => boolean;
|
|
6528
|
+
export declare const valuesEqual: (a: unknown, b: unknown) => boolean;
|
|
6472
6529
|
/**
|
|
6473
6530
|
* Whether two {@link QueryManagerOptions} objects describe the same configuration, per
|
|
6474
6531
|
* {@link valuesEqual}: data by value, functions by identity.
|
|
@@ -6480,13 +6537,13 @@ declare const valuesEqual: (a: unknown, b: unknown) => boolean;
|
|
|
6480
6537
|
* Nested option objects (`history`, `translations`, …) are descended into rather than compared
|
|
6481
6538
|
* by identity, so `{ history: { maxHistory: 10 } }` rebuilt per render compares equal.
|
|
6482
6539
|
*/
|
|
6483
|
-
declare const optionsEqual: <F extends FullField = FullField, O extends FullOperator = FullOperator, C extends FullCombinator = FullCombinator>(a: Partial<QueryManagerOptions<F, O, C>> | undefined, b: Partial<QueryManagerOptions<F, O, C>> | undefined) => boolean;
|
|
6540
|
+
export declare const optionsEqual: <F extends FullField = FullField, O extends FullOperator = FullOperator, C extends FullCombinator = FullCombinator>(a: Partial<QueryManagerOptions<F, O, C>> | undefined, b: Partial<QueryManagerOptions<F, O, C>> | undefined) => boolean;
|
|
6484
6541
|
//#endregion
|
|
6485
6542
|
//#region src/utils/parseNumber.d.ts
|
|
6486
6543
|
/**
|
|
6487
6544
|
* Options object for {@link parseNumber}.
|
|
6488
6545
|
*/
|
|
6489
|
-
interface ParseNumberOptions {
|
|
6546
|
+
export interface ParseNumberOptions {
|
|
6490
6547
|
parseNumbers?: ParseNumberMethod;
|
|
6491
6548
|
/**
|
|
6492
6549
|
* Generates a `bigint` value if the string represents a valid integer
|
|
@@ -6500,45 +6557,45 @@ interface ParseNumberOptions {
|
|
|
6500
6557
|
* If that returns `NaN`, the string is returned unchanged. Numeric values are returned
|
|
6501
6558
|
* as-is regardless of the `parseNumbers` option.
|
|
6502
6559
|
*/
|
|
6503
|
-
declare const parseNumber: (val: unknown, { parseNumbers, bigIntOnOverflow }?: ParseNumberOptions) => any;
|
|
6560
|
+
export declare const parseNumber: (val: unknown, { parseNumbers, bigIntOnOverflow }?: ParseNumberOptions) => any;
|
|
6504
6561
|
//#endregion
|
|
6505
6562
|
//#region src/utils/preferProp.d.ts
|
|
6506
6563
|
/**
|
|
6507
6564
|
* For given default, prop, and context values, return the first provided of prop,
|
|
6508
6565
|
* context, and default, in that order.
|
|
6509
6566
|
*/
|
|
6510
|
-
declare const preferProp: (def: boolean, prop?: boolean, context?: boolean, doNotFinalize?: boolean) => boolean;
|
|
6567
|
+
export declare const preferProp: (def: boolean, prop?: boolean, context?: boolean, doNotFinalize?: boolean) => boolean;
|
|
6511
6568
|
/**
|
|
6512
6569
|
* For given default, prop, and context values, return the first provided of prop,
|
|
6513
6570
|
* context, and default, in that order.
|
|
6514
6571
|
*/
|
|
6515
|
-
declare const preferAnyProp: (def?: any, prop?: any, context?: any) => any;
|
|
6572
|
+
export declare const preferAnyProp: (def?: any, prop?: any, context?: any) => any;
|
|
6516
6573
|
/**
|
|
6517
6574
|
* For a given set of defaults, props, and context values, return the first provided of prop,
|
|
6518
6575
|
* context, and default—in that order—for each property in the defaults object.
|
|
6519
6576
|
*/
|
|
6520
|
-
declare const preferFlagProps: (props?: QueryBuilderFlags, contextVals?: QueryBuilderFlags, finalize?: boolean) => QueryBuilderFlags;
|
|
6577
|
+
export declare const preferFlagProps: (props?: QueryBuilderFlags, contextVals?: QueryBuilderFlags, finalize?: boolean) => QueryBuilderFlags;
|
|
6521
6578
|
//#endregion
|
|
6522
6579
|
//#region src/utils/prepareQueryObjects.d.ts
|
|
6523
6580
|
/**
|
|
6524
6581
|
* Options for {@link prepareRule}/{@link prepareRuleGroup}.
|
|
6525
6582
|
*/
|
|
6526
|
-
interface PreparerOptions {
|
|
6583
|
+
export interface PreparerOptions {
|
|
6527
6584
|
idGenerator?: () => string;
|
|
6528
6585
|
}
|
|
6529
6586
|
/**
|
|
6530
6587
|
* Ensures that a rule is valid by adding an `id` property if it does not already exist.
|
|
6531
6588
|
*/
|
|
6532
|
-
declare const prepareRule: (rule: RuleType, { idGenerator }?: PreparerOptions) => RuleType;
|
|
6589
|
+
export declare const prepareRule: (rule: RuleType, { idGenerator }?: PreparerOptions) => RuleType;
|
|
6533
6590
|
/**
|
|
6534
6591
|
* Ensures that a rule group is valid by recursively adding an `id` property to the group itself
|
|
6535
6592
|
* and all its rules and subgroups where one does not already exist.
|
|
6536
6593
|
*/
|
|
6537
|
-
declare const prepareRuleGroup: <RG extends RuleGroupTypeAny>(queryObject: RG, { idGenerator }?: PreparerOptions) => RG;
|
|
6594
|
+
export declare const prepareRuleGroup: <RG extends RuleGroupTypeAny>(queryObject: RG, { idGenerator }?: PreparerOptions) => RG;
|
|
6538
6595
|
/**
|
|
6539
6596
|
* Ensures that a rule or group is valid. See {@link prepareRule} and {@link prepareRuleGroup}.
|
|
6540
6597
|
*/
|
|
6541
|
-
declare const prepareRuleOrGroup: (rg: RuleGroupTypeAny | RuleType, { idGenerator }?: PreparerOptions) => RuleGroupType | RuleGroupTypeIC | RuleType;
|
|
6598
|
+
export declare const prepareRuleOrGroup: (rg: RuleGroupTypeAny | RuleType, { idGenerator }?: PreparerOptions) => RuleGroupType | RuleGroupTypeIC | RuleType;
|
|
6542
6599
|
/**
|
|
6543
6600
|
* Resolves the query a query builder should render from the available sources, in precedence
|
|
6544
6601
|
* order: the controlled `query`, then whatever is already in the store, then the uncontrolled
|
|
@@ -6550,7 +6607,7 @@ declare const prepareRuleOrGroup: (rg: RuleGroupTypeAny | RuleType, { idGenerato
|
|
|
6550
6607
|
*
|
|
6551
6608
|
* @group Query Tools
|
|
6552
6609
|
*/
|
|
6553
|
-
declare const resolveCandidateQuery: <RG extends RuleGroupTypeAny>(sources: {
|
|
6610
|
+
export declare const resolveCandidateQuery: <RG extends RuleGroupTypeAny>(sources: {
|
|
6554
6611
|
query?: RG;
|
|
6555
6612
|
storeQuery?: RG;
|
|
6556
6613
|
defaultQuery?: RG;
|
|
@@ -6568,11 +6625,13 @@ declare const resolveCandidateQuery: <RG extends RuleGroupTypeAny>(sources: {
|
|
|
6568
6625
|
* _replacement rule/group_ to add instead of the one provided.
|
|
6569
6626
|
* - `onMoveRule`/`onMoveGroup`/`onGroupRule`/`onGroupGroup` may return `true` to proceed, a
|
|
6570
6627
|
* falsy value to cancel, or a _replacement query_ to apply instead of the computed one.
|
|
6628
|
+
* - `onUngroup` may return `true` to proceed, a falsy value to cancel, or a _replacement query_
|
|
6629
|
+
* to apply instead of the computed one.
|
|
6571
6630
|
* - `onRemove` is boolean only.
|
|
6572
6631
|
*
|
|
6573
6632
|
* @group Query Tools
|
|
6574
6633
|
*/
|
|
6575
|
-
interface QueryActionCallbacks {
|
|
6634
|
+
export interface QueryActionCallbacks {
|
|
6576
6635
|
onAddRule?: (rule: RuleType, parentPath: Path, query: any, context?: any) => RuleType | boolean;
|
|
6577
6636
|
onAddGroup?: (ruleGroup: any, parentPath: Path, query: any, context?: any) => RuleGroupTypeAny | boolean;
|
|
6578
6637
|
onRemove?: (ruleOrGroup: any, path: Path, query: any, context?: any) => boolean;
|
|
@@ -6580,13 +6639,14 @@ interface QueryActionCallbacks {
|
|
|
6580
6639
|
onMoveGroup?: (...args: any[]) => RuleGroupTypeAny | boolean;
|
|
6581
6640
|
onGroupRule?: (...args: any[]) => RuleGroupTypeAny | boolean;
|
|
6582
6641
|
onGroupGroup?: (...args: any[]) => RuleGroupTypeAny | boolean;
|
|
6642
|
+
onUngroup?: (...args: any[]) => RuleGroupTypeAny | boolean;
|
|
6583
6643
|
}
|
|
6584
6644
|
/**
|
|
6585
6645
|
* Configuration for {@link createQueryActions}.
|
|
6586
6646
|
*
|
|
6587
6647
|
* @group Query Tools
|
|
6588
6648
|
*/
|
|
6589
|
-
interface QueryActionsConfig extends QueryActionCallbacks {
|
|
6649
|
+
export interface QueryActionsConfig extends QueryActionCallbacks {
|
|
6590
6650
|
/** Identifier included in every log payload. */
|
|
6591
6651
|
qbId?: string;
|
|
6592
6652
|
combinators?: OptionList;
|
|
@@ -6627,22 +6687,23 @@ interface QueryActionsConfig extends QueryActionCallbacks {
|
|
|
6627
6687
|
onLog?: (payload: Record<string, any>) => void;
|
|
6628
6688
|
}
|
|
6629
6689
|
/**
|
|
6630
|
-
* The
|
|
6690
|
+
* The seven mutations a query builder performs. Each takes the current query and returns the next
|
|
6631
6691
|
* one, or `undefined` when the mutation was aborted—because the target is disabled, a
|
|
6632
6692
|
* confirmation callback declined, or a depth limit was reached.
|
|
6633
6693
|
*
|
|
6634
6694
|
* @group Query Tools
|
|
6635
6695
|
*/
|
|
6636
|
-
interface QueryActionHandlers {
|
|
6696
|
+
export interface QueryActionHandlers {
|
|
6637
6697
|
addRule: (query: any, rule: RuleType, parentPath: Path, context?: any) => any;
|
|
6638
6698
|
addGroup: (query: any, ruleGroup: any, parentPath: Path, context?: any) => any;
|
|
6639
6699
|
propChange: (query: any, prop: UpdateableProperties, value: any, path: Path) => any;
|
|
6640
6700
|
removeRuleOrGroup: (query: any, path: Path, context?: any) => any;
|
|
6641
6701
|
moveRule: (query: any, oldPath: Path, newPath: Path | "up" | "down", clone?: boolean, context?: any) => any;
|
|
6642
6702
|
groupRule: (query: any, sourcePath: Path, targetPath: Path, clone?: boolean, context?: any) => any;
|
|
6703
|
+
ungroupRuleGroup: (query: any, path: Path, context?: any) => any;
|
|
6643
6704
|
}
|
|
6644
6705
|
/**
|
|
6645
|
-
* Builds the query builder's
|
|
6706
|
+
* Builds the query builder's seven mutation handlers as pure functions of the current query.
|
|
6646
6707
|
*
|
|
6647
6708
|
* This is the framework-agnostic core of the action handlers in `useQueryBuilderSchema`. It owns
|
|
6648
6709
|
* the policy that surrounds the query tools—disabled gating, the confirmation callback protocol,
|
|
@@ -6651,23 +6712,23 @@ interface QueryActionHandlers {
|
|
|
6651
6712
|
*
|
|
6652
6713
|
* @group Query Tools
|
|
6653
6714
|
*/
|
|
6654
|
-
declare const createQueryActions: (config?: QueryActionsConfig) => QueryActionHandlers;
|
|
6715
|
+
export declare const createQueryActions: (config?: QueryActionsConfig) => QueryActionHandlers;
|
|
6655
6716
|
//#endregion
|
|
6656
6717
|
//#region src/utils/regenerateIDs.d.ts
|
|
6657
6718
|
/**
|
|
6658
6719
|
* Options object for {@link regenerateID}/{@link regenerateIDs}.
|
|
6659
6720
|
*/
|
|
6660
|
-
interface RegenerateIdOptions {
|
|
6721
|
+
export interface RegenerateIdOptions {
|
|
6661
6722
|
idGenerator?: () => string;
|
|
6662
6723
|
}
|
|
6663
6724
|
/**
|
|
6664
6725
|
* Generates a new `id` property for a rule.
|
|
6665
6726
|
*/
|
|
6666
|
-
declare const regenerateID: <R extends RuleType>(rule: R, { idGenerator }?: RegenerateIdOptions) => SetRequired<R, "id">;
|
|
6727
|
+
export declare const regenerateID: <R extends RuleType>(rule: R, { idGenerator }?: RegenerateIdOptions) => SetRequired<R, "id">;
|
|
6667
6728
|
/**
|
|
6668
6729
|
* Recursively generates new `id` properties for a rule group and all its rules and subgroups.
|
|
6669
6730
|
*/
|
|
6670
|
-
declare const regenerateIDs: <RG>(subject: RG, { idGenerator }?: RegenerateIdOptions) => RG & {
|
|
6731
|
+
export declare const regenerateIDs: <RG>(subject: RG, { idGenerator }?: RegenerateIdOptions) => RG & {
|
|
6671
6732
|
id: string;
|
|
6672
6733
|
};
|
|
6673
6734
|
//#endregion
|
|
@@ -6676,7 +6737,7 @@ declare const regenerateIDs: <RG>(subject: RG, { idGenerator }?: RegenerateIdOpt
|
|
|
6676
6737
|
* Everything {@link createRule} needs to produce a new rule. Each member corresponds to the
|
|
6677
6738
|
* `QueryBuilder` prop (or `useQueryBuilderSetup` output) of the same name.
|
|
6678
6739
|
*/
|
|
6679
|
-
interface CreateRuleOptions<F extends FullField = FullField> {
|
|
6740
|
+
export interface CreateRuleOptions<F extends FullField = FullField> {
|
|
6680
6741
|
fields: FullOptionList<F>;
|
|
6681
6742
|
getDefaultField?: string | ((fieldsData: FullOptionList<F>) => string);
|
|
6682
6743
|
/** Produces the default operator for a field, i.e. `resolveDefaultOperator` already bound. */
|
|
@@ -6700,11 +6761,11 @@ interface CreateRuleOptions<F extends FullField = FullField> {
|
|
|
6700
6761
|
*
|
|
6701
6762
|
* @group Query Tools
|
|
6702
6763
|
*/
|
|
6703
|
-
declare const createRule: <F extends FullField = FullField>({ fields, getDefaultField, getRuleDefaultOperator, getValueSources, getMatchModes, getRuleDefaultValue, idGenerator }: CreateRuleOptions<F>) => RuleType;
|
|
6764
|
+
export declare const createRule: <F extends FullField = FullField>({ fields, getDefaultField, getRuleDefaultOperator, getValueSources, getMatchModes, getRuleDefaultValue, idGenerator }: CreateRuleOptions<F>) => RuleType;
|
|
6704
6765
|
/**
|
|
6705
6766
|
* Everything {@link createRuleGroup} needs to produce a new group.
|
|
6706
6767
|
*/
|
|
6707
|
-
interface CreateRuleGroupOptions<C extends FullCombinator = FullCombinator> {
|
|
6768
|
+
export interface CreateRuleGroupOptions<C extends FullCombinator = FullCombinator> {
|
|
6708
6769
|
combinators: FullOptionList<C>;
|
|
6709
6770
|
/** When `true`, the new group contains one new rule. */
|
|
6710
6771
|
addRuleToNewGroups?: boolean;
|
|
@@ -6722,7 +6783,7 @@ interface CreateRuleGroupOptions<C extends FullCombinator = FullCombinator> {
|
|
|
6722
6783
|
*
|
|
6723
6784
|
* @group Query Tools
|
|
6724
6785
|
*/
|
|
6725
|
-
declare const createRuleGroup: <C extends FullCombinator = FullCombinator>({ combinators, addRuleToNewGroups, createRule: createRuleMain, idGenerator }: CreateRuleGroupOptions<C>, independentCombinators?: boolean) => RuleGroupTypeAny;
|
|
6786
|
+
export declare const createRuleGroup: <C extends FullCombinator = FullCombinator>({ combinators, addRuleToNewGroups, createRule: createRuleMain, idGenerator }: CreateRuleGroupOptions<C>, independentCombinators?: boolean) => RuleGroupTypeAny;
|
|
6726
6787
|
//#endregion
|
|
6727
6788
|
//#region src/utils/signature.d.ts
|
|
6728
6789
|
/**
|
|
@@ -6730,12 +6791,12 @@ declare const createRuleGroup: <C extends FullCombinator = FullCombinator>({ com
|
|
|
6730
6791
|
* removed, moved, or reordered—rather than the properties of a single node. Structural changes
|
|
6731
6792
|
* never coalesce with each other, so each one produces its own history entry.
|
|
6732
6793
|
*/
|
|
6733
|
-
declare const structuralSignature = "~structural";
|
|
6794
|
+
export declare const structuralSignature = "~structural";
|
|
6734
6795
|
/**
|
|
6735
6796
|
* Signature returned when two queries differ by reference only, with no observable difference
|
|
6736
6797
|
* in their properties.
|
|
6737
6798
|
*/
|
|
6738
|
-
declare const unchangedSignature = "";
|
|
6799
|
+
export declare const unchangedSignature = "";
|
|
6739
6800
|
/**
|
|
6740
6801
|
* Describes _what changed_ between two versions of a query as a short string, so that
|
|
6741
6802
|
* consecutive edits to the same property of the same rule (e.g. typing in a value editor) can
|
|
@@ -6755,7 +6816,7 @@ declare const unchangedSignature = "";
|
|
|
6755
6816
|
* gets its own history entry—but controlled components that clone the query on every change
|
|
6756
6817
|
* will not benefit from coalescing.
|
|
6757
6818
|
*/
|
|
6758
|
-
declare const signatureOf: (prev: RuleGroupTypeAny, next: RuleGroupTypeAny) => string;
|
|
6819
|
+
export declare const signatureOf: (prev: RuleGroupTypeAny, next: RuleGroupTypeAny) => string;
|
|
6759
6820
|
//#endregion
|
|
6760
|
-
export {
|
|
6821
|
+
export { 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, convertQuery, formatQuery, getRuleDefaultValue$1 as getRuleDefaultValue };
|
|
6761
6822
|
//# sourceMappingURL=react-querybuilder_core.production.d.mts.map
|