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