@react-querybuilder/bootstrap 8.11.1 → 8.12.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/chunk-DrjzjjTJ.mjs +23 -0
- package/dist/chunk-Dv2ph0Ay.js +23 -0
- package/dist/cjs/react-querybuilder_bootstrap.cjs.development.d.ts +59 -20
- package/dist/cjs/react-querybuilder_bootstrap.cjs.development.js +0 -1
- package/dist/cjs/react-querybuilder_bootstrap.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_bootstrap.cjs.production.d.ts +59 -20
- package/dist/cjs/react-querybuilder_bootstrap.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_bootstrap.cjs.production.js.map +1 -1
- package/dist/react-querybuilder_bootstrap.d.mts +59 -20
- package/dist/react-querybuilder_bootstrap.legacy-esm.d.ts +59 -20
- package/dist/react-querybuilder_bootstrap.legacy-esm.js +5 -5
- package/dist/react-querybuilder_bootstrap.production.d.mts +59 -20
- package/package.json +6 -6
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
@@ -345,6 +345,41 @@ type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
|
345
345
|
//=> 'not equal'
|
|
346
346
|
```
|
|
347
347
|
|
|
348
|
+
Note: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:
|
|
349
|
+
|
|
350
|
+
@example
|
|
351
|
+
```
|
|
352
|
+
import type {If, IsEqual, StringRepeat} from 'type-fest';
|
|
353
|
+
|
|
354
|
+
type HundredZeroes = StringRepeat<'0', 100>;
|
|
355
|
+
|
|
356
|
+
// The following implementation is not tail recursive
|
|
357
|
+
type Includes<S extends string, Char extends string> =
|
|
358
|
+
S extends `${infer First}${infer Rest}`
|
|
359
|
+
? If<IsEqual<First, Char>,
|
|
360
|
+
'found',
|
|
361
|
+
Includes<Rest, Char>>
|
|
362
|
+
: 'not found';
|
|
363
|
+
|
|
364
|
+
// Hence, instantiations with long strings will fail
|
|
365
|
+
// @ts-expect-error
|
|
366
|
+
type Fails = Includes<HundredZeroes, '1'>;
|
|
367
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
368
|
+
// Error: Type instantiation is excessively deep and possibly infinite.
|
|
369
|
+
|
|
370
|
+
// However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
|
|
371
|
+
type IncludesWithoutIf<S extends string, Char extends string> =
|
|
372
|
+
S extends `${infer First}${infer Rest}`
|
|
373
|
+
? IsEqual<First, Char> extends true
|
|
374
|
+
? 'found'
|
|
375
|
+
: IncludesWithoutIf<Rest, Char>
|
|
376
|
+
: 'not found';
|
|
377
|
+
|
|
378
|
+
// Now, instantiations with long strings will work
|
|
379
|
+
type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
380
|
+
//=> 'not found'
|
|
381
|
+
```
|
|
382
|
+
|
|
348
383
|
@category Type Guard
|
|
349
384
|
@category Utilities
|
|
350
385
|
*/
|
|
@@ -439,7 +474,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
439
474
|
```
|
|
440
475
|
|
|
441
476
|
@link https://github.com/microsoft/TypeScript/issues/15300
|
|
442
|
-
@see SimplifyDeep
|
|
477
|
+
@see {@link SimplifyDeep}
|
|
443
478
|
@category Object
|
|
444
479
|
*/
|
|
445
480
|
type Simplify<T$1> = { [KeyType in keyof T$1]: T$1[KeyType] } & {};
|
|
@@ -563,7 +598,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
563
598
|
// => { foo: 'bar'; qux?: 'baz' | undefined; }
|
|
564
599
|
```
|
|
565
600
|
|
|
566
|
-
@see PickIndexSignature
|
|
601
|
+
@see {@link PickIndexSignature}
|
|
567
602
|
@category Object
|
|
568
603
|
*/
|
|
569
604
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
@@ -611,7 +646,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
611
646
|
// }
|
|
612
647
|
```
|
|
613
648
|
|
|
614
|
-
@see OmitIndexSignature
|
|
649
|
+
@see {@link OmitIndexSignature}
|
|
615
650
|
@category Object
|
|
616
651
|
*/
|
|
617
652
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
@@ -1117,7 +1152,7 @@ interface RuleGroupType<R$1 extends RuleType = RuleType, C extends string = stri
|
|
|
1117
1152
|
/**
|
|
1118
1153
|
* The type of the `rules` array in a {@link RuleGroupType}.
|
|
1119
1154
|
*/
|
|
1120
|
-
type RuleGroupArray<RG
|
|
1155
|
+
type RuleGroupArray<RG extends RuleGroupType = RuleGroupType, R$1 extends RuleType = RuleType> = (R$1 | RG)[];
|
|
1121
1156
|
//#endregion
|
|
1122
1157
|
//#region ../core/src/types/ruleGroupsIC.utils.d.ts
|
|
1123
1158
|
type MAXIMUM_ALLOWED_BOUNDARY = 80;
|
|
@@ -1143,7 +1178,7 @@ type RuleGroupTypeAny<R$1 extends RuleType = RuleType, C extends string = string
|
|
|
1143
1178
|
/**
|
|
1144
1179
|
* The type of the `rules` array in a {@link RuleGroupTypeIC}.
|
|
1145
1180
|
*/
|
|
1146
|
-
type RuleGroupICArray<RG
|
|
1181
|
+
type RuleGroupICArray<RG extends RuleGroupTypeIC = RuleGroupTypeIC, R$1 extends RuleType = RuleType, C extends string = string> = [R$1 | RG] | [R$1 | RG, ...MappedTuple<[C, R$1 | RG]>] | ((R$1 | RG)[] & {
|
|
1147
1182
|
length: 0;
|
|
1148
1183
|
});
|
|
1149
1184
|
/**
|
|
@@ -1153,7 +1188,7 @@ type RuleOrGroupArray = RuleGroupArray | RuleGroupICArray;
|
|
|
1153
1188
|
/**
|
|
1154
1189
|
* Converts a narrowed rule group type to its most generic form.
|
|
1155
1190
|
*/
|
|
1156
|
-
type GenericizeRuleGroupType<RG
|
|
1191
|
+
type GenericizeRuleGroupType<RG> = RG extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
|
|
1157
1192
|
//#endregion
|
|
1158
1193
|
//#region ../core/src/types/validation.d.ts
|
|
1159
1194
|
/**
|
|
@@ -1491,9 +1526,13 @@ interface Classnames {
|
|
|
1491
1526
|
*/
|
|
1492
1527
|
branches: Classname;
|
|
1493
1528
|
/**
|
|
1494
|
-
* Classname(s) rules that render a subquery.
|
|
1529
|
+
* Classname(s) applied to rules that render a subquery.
|
|
1495
1530
|
*/
|
|
1496
1531
|
hasSubQuery: Classname;
|
|
1532
|
+
/**
|
|
1533
|
+
* Classname(s) applied to async components in their "loading" state.
|
|
1534
|
+
*/
|
|
1535
|
+
loading: Classname;
|
|
1497
1536
|
}
|
|
1498
1537
|
/**
|
|
1499
1538
|
* Placeholder strings for option lists.
|
|
@@ -2403,15 +2442,15 @@ type QueryBuilderContextProvider<ExtraProps extends object = Record<string, any>
|
|
|
2403
2442
|
*
|
|
2404
2443
|
* @group Props
|
|
2405
2444
|
*/
|
|
2406
|
-
type QueryBuilderProps<RG
|
|
2445
|
+
type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O extends FullOperator, C extends FullCombinator> = RG extends RuleGroupType<infer R> | RuleGroupTypeIC<infer R> ? QueryBuilderContextProps<F, GetOptionIdentifierType<O>> & {
|
|
2407
2446
|
/**
|
|
2408
2447
|
* Initial query object for uncontrolled components.
|
|
2409
2448
|
*/
|
|
2410
|
-
defaultQuery?: RG
|
|
2449
|
+
defaultQuery?: RG;
|
|
2411
2450
|
/**
|
|
2412
2451
|
* Query object for controlled components.
|
|
2413
2452
|
*/
|
|
2414
|
-
query?: RG
|
|
2453
|
+
query?: RG;
|
|
2415
2454
|
/**
|
|
2416
2455
|
* List of valid {@link FullField}s.
|
|
2417
2456
|
*
|
|
@@ -2563,7 +2602,7 @@ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O ext
|
|
|
2563
2602
|
*/
|
|
2564
2603
|
getSubQueryBuilderProps?(field: GetOptionIdentifierType<F>, misc: {
|
|
2565
2604
|
fieldData: F;
|
|
2566
|
-
}): QueryBuilderProps<GenericizeRuleGroupType<RG
|
|
2605
|
+
}): QueryBuilderProps<GenericizeRuleGroupType<RG>, FullOption, FullOption, FullOption>;
|
|
2567
2606
|
/**
|
|
2568
2607
|
* The return value of this function will be used to apply classnames to the
|
|
2569
2608
|
* outer `<div>` of the given {@link Rule}.
|
|
@@ -2575,56 +2614,56 @@ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O ext
|
|
|
2575
2614
|
* The return value of this function will be used to apply classnames to the
|
|
2576
2615
|
* outer `<div>` of the given {@link RuleGroup}.
|
|
2577
2616
|
*/
|
|
2578
|
-
getRuleGroupClassname?(ruleGroup: RG
|
|
2617
|
+
getRuleGroupClassname?(ruleGroup: RG): Classname;
|
|
2579
2618
|
/**
|
|
2580
2619
|
* This callback is invoked before a new rule is added. The function should either manipulate
|
|
2581
2620
|
* the rule and return the new object, return `true` to allow the addition to proceed as normal,
|
|
2582
2621
|
* or return `false` to cancel the addition of the rule.
|
|
2583
2622
|
*/
|
|
2584
|
-
onAddRule?(rule: R, parentPath: Path, query: RG
|
|
2623
|
+
onAddRule?(rule: R, parentPath: Path, query: RG, context?: any): RuleType | boolean;
|
|
2585
2624
|
/**
|
|
2586
2625
|
* This callback is invoked before a new group is added. The function should either manipulate
|
|
2587
2626
|
* the group and return the new object, return `true` to allow the addition to proceed as normal,
|
|
2588
2627
|
* or return `false` to cancel the addition of the group.
|
|
2589
2628
|
*/
|
|
2590
|
-
onAddGroup?(ruleGroup: RG
|
|
2629
|
+
onAddGroup?(ruleGroup: RG, parentPath: Path, query: RG, context?: any): RG | boolean;
|
|
2591
2630
|
/**
|
|
2592
2631
|
* This callback is invoked before a rule is moved or shifted. The function should return
|
|
2593
2632
|
* `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
|
|
2594
2633
|
* a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2595
2634
|
* query state.
|
|
2596
2635
|
*/
|
|
2597
|
-
onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG
|
|
2636
|
+
onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
|
|
2598
2637
|
/**
|
|
2599
2638
|
* This callback is invoked before a group is moved or shifted. The function should return
|
|
2600
2639
|
* `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
|
|
2601
2640
|
* a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2602
2641
|
* query state.
|
|
2603
2642
|
*/
|
|
2604
|
-
onMoveGroup?(ruleGroup: RG
|
|
2643
|
+
onMoveGroup?(ruleGroup: RG, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
|
|
2605
2644
|
/**
|
|
2606
2645
|
* This callback is invoked before a rule is grouped with another object. The function should
|
|
2607
2646
|
* return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
|
|
2608
2647
|
* or a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2609
2648
|
* query state.
|
|
2610
2649
|
*/
|
|
2611
|
-
onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG
|
|
2650
|
+
onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
|
|
2612
2651
|
/**
|
|
2613
2652
|
* This callback is invoked before a group is grouped with another object. The function should
|
|
2614
2653
|
* return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
|
|
2615
2654
|
* or a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2616
2655
|
* query state.
|
|
2617
2656
|
*/
|
|
2618
|
-
onGroupGroup?(ruleGroup: RG
|
|
2657
|
+
onGroupGroup?(ruleGroup: RG, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
|
|
2619
2658
|
/**
|
|
2620
2659
|
* This callback is invoked before a rule or group is removed. The function should return
|
|
2621
2660
|
* `true` if the rule or group should be removed or `false` if it should not be removed.
|
|
2622
2661
|
*/
|
|
2623
|
-
onRemove?(ruleOrGroup: R | RG
|
|
2662
|
+
onRemove?(ruleOrGroup: R | RG, path: Path, query: RG, context?: any): boolean;
|
|
2624
2663
|
/**
|
|
2625
2664
|
* This callback is invoked anytime the query state is updated.
|
|
2626
2665
|
*/
|
|
2627
|
-
onQueryChange?(query: RG
|
|
2666
|
+
onQueryChange?(query: RG): void;
|
|
2628
2667
|
/**
|
|
2629
2668
|
* Each log object will be passed to this function when `debugMode` is `true`.
|
|
2630
2669
|
*
|
|
@@ -24,7 +24,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
24
24
|
let react = require("react");
|
|
25
25
|
react = __toESM(react);
|
|
26
26
|
let react_querybuilder = require("react-querybuilder");
|
|
27
|
-
react_querybuilder = __toESM(react_querybuilder);
|
|
28
27
|
|
|
29
28
|
//#region src/BootstrapNotToggle.tsx
|
|
30
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_bootstrap.cjs.development.js","names":["React","ValueEditor","standardClassnames","bootstrapControlElements: ControlElementsProp<FullField, string>","bootstrapControlClassnames: Partial<Classnames>","bootstrapTranslations: Partial<Translations>","QueryBuilderBootstrap: QueryBuilderContextProvider"],"sources":["../../src/BootstrapNotToggle.tsx","../../src/BootstrapValueEditor.tsx","../../src/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useId } from 'react';\nimport type { NotToggleProps } from 'react-querybuilder';\n\n/**\n * @group Components\n */\nexport const BootstrapNotToggle = ({\n className,\n handleOnChange,\n title,\n label,\n checked,\n disabled,\n}: NotToggleProps): React.JSX.Element => {\n const id = useId();\n\n return (\n <div className={`form-check-inline form-switch ${className}`}>\n <input\n id={id}\n className=\"form-check-input\"\n type=\"checkbox\"\n onChange={e => handleOnChange(e.target.checked)}\n checked={!!checked}\n disabled={disabled}\n />\n <label title={title} htmlFor={id} className=\"form-check-label\">\n {label}\n </label>\n </div>\n );\n};\n","import * as React from 'react';\nimport type { ValueEditorProps } from 'react-querybuilder';\nimport { standardClassnames, useValueEditor, ValueEditor } from 'react-querybuilder';\n\n// Extracted from callback so we can use `useId`\nconst RadioButton = (props: {\n name: string;\n disabled?: boolean;\n checked: boolean;\n handleOnChange: (v: string) => void;\n label: string;\n}) => {\n const id = React.useId();\n return (\n <div className=\"form-check form-check-inline\">\n <input\n className=\"form-check-input\"\n type=\"radio\"\n id={id}\n value={props.name}\n checked={props.checked}\n disabled={props.disabled}\n onChange={e => props.handleOnChange(e.target.value)}\n />\n <label className=\"form-check-label\" htmlFor={id}>\n {props.label}\n </label>\n </div>\n );\n};\n\n/**\n * @group Components\n */\nexport const BootstrapValueEditor = (props: ValueEditorProps): React.JSX.Element | null => {\n const { valueListItemClassName } = useValueEditor(props);\n\n if (props.operator === 'null' || props.operator === 'notNull') {\n return null;\n }\n\n if (\n (props.operator === 'between' || props.operator === 'notBetween') &&\n (props.type === 'select' || props.type === 'text')\n ) {\n const listItemClasses =\n props.type === 'text' ? 'form-control form-control-sm' : 'form-select form-select-sm';\n return (\n <ValueEditor\n {...props}\n skipHook\n schema={{\n ...props.schema,\n classNames: {\n ...props.schema.classNames,\n valueListItem: `${valueListItemClassName} ${listItemClasses}`,\n },\n }}\n />\n );\n }\n\n switch (props.type) {\n case 'select':\n case 'multiselect':\n return (\n <ValueEditor\n {...props}\n skipHook\n className={`${props.className} form-select form-select-sm`}\n />\n );\n\n case 'switch':\n return (\n <span className={`${props.className} custom-control custom-switch`}>\n <input\n type=\"checkbox\"\n className=\"form-check-input custom-control-input\"\n title={props.title}\n disabled={props.disabled}\n onChange={e => props.handleOnChange(e.target.checked)}\n checked={!!props.value}\n />\n </span>\n );\n\n case 'checkbox':\n return <ValueEditor {...props} skipHook className={`${props.className} form-check-input`} />;\n\n case 'radio':\n return (\n <span title={props.title} className={standardClassnames.value}>\n {props.values?.map(v => (\n <RadioButton\n key={v.name}\n name={v.name}\n disabled={props.disabled}\n checked={props.value === v.name}\n handleOnChange={props.handleOnChange}\n label={v.label}\n />\n ))}\n </span>\n );\n }\n\n return (\n <ValueEditor\n {...props}\n skipHook\n className={`${props.className} form-control form-control-sm`}\n />\n );\n};\n","import * as React from 'react';\nimport type {\n Classnames,\n ControlElementsProp,\n FullField,\n QueryBuilderContextProvider,\n Translations,\n} from 'react-querybuilder';\nimport { getCompatContextProvider } from 'react-querybuilder';\nimport { BootstrapNotToggle } from './BootstrapNotToggle';\nimport { BootstrapValueEditor } from './BootstrapValueEditor';\n\nexport * from './BootstrapNotToggle';\nexport * from './BootstrapValueEditor';\n\n/**\n * @group Props\n */\nexport const bootstrapControlElements: ControlElementsProp<FullField, string> = {\n notToggle: BootstrapNotToggle,\n valueEditor: BootstrapValueEditor,\n};\n\n/**\n * @group Props\n */\nexport const bootstrapControlClassnames: Partial<Classnames> = {\n actionElement: 'btn btn-sm',\n addGroup: 'btn-secondary',\n addRule: 'btn-primary',\n cloneGroup: 'btn-secondary',\n cloneRule: 'btn-secondary',\n lockGroup: 'btn-secondary',\n lockRule: 'btn-secondary',\n removeGroup: 'btn-danger',\n removeRule: 'btn-danger',\n // BootstrapValueEditor adds its own classnames\n // value: '',\n valueSelector: 'form-select form-select-sm',\n};\n\n/**\n * @group Props\n */\nexport const bootstrapTranslations: Partial<Translations> = {\n removeGroup: { label: <i className=\"bi bi-x\" /> },\n removeRule: { label: <i className=\"bi bi-x\" /> },\n cloneRule: { label: <i className=\"bi bi-copy\" /> },\n cloneRuleGroup: { label: <i className=\"bi bi-copy\" /> },\n dragHandle: { label: <i className=\"bi bi-grip-vertical\" /> },\n lockGroup: { label: <i className=\"bi bi-unlock\" /> },\n lockRule: { label: <i className=\"bi bi-unlock\" /> },\n lockGroupDisabled: { label: <i className=\"bi bi-lock\" /> },\n lockRuleDisabled: { label: <i className=\"bi bi-lock\" /> },\n shiftActionUp: { label: <i className=\"bi bi-chevron-compact-up\" /> },\n shiftActionDown: { label: <i className=\"bi bi-chevron-compact-down\" /> },\n};\n\n/**\n * @group Components\n */\nexport const QueryBuilderBootstrap: QueryBuilderContextProvider = getCompatContextProvider({\n controlClassnames: bootstrapControlClassnames,\n controlElements: bootstrapControlElements,\n translations: bootstrapTranslations,\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"react-querybuilder_bootstrap.cjs.development.js","names":["React","ValueEditor","standardClassnames","bootstrapControlElements: ControlElementsProp<FullField, string>","bootstrapControlClassnames: Partial<Classnames>","bootstrapTranslations: Partial<Translations>","QueryBuilderBootstrap: QueryBuilderContextProvider"],"sources":["../../src/BootstrapNotToggle.tsx","../../src/BootstrapValueEditor.tsx","../../src/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useId } from 'react';\nimport type { NotToggleProps } from 'react-querybuilder';\n\n/**\n * @group Components\n */\nexport const BootstrapNotToggle = ({\n className,\n handleOnChange,\n title,\n label,\n checked,\n disabled,\n}: NotToggleProps): React.JSX.Element => {\n const id = useId();\n\n return (\n <div className={`form-check-inline form-switch ${className}`}>\n <input\n id={id}\n className=\"form-check-input\"\n type=\"checkbox\"\n onChange={e => handleOnChange(e.target.checked)}\n checked={!!checked}\n disabled={disabled}\n />\n <label title={title} htmlFor={id} className=\"form-check-label\">\n {label}\n </label>\n </div>\n );\n};\n","import * as React from 'react';\nimport type { ValueEditorProps } from 'react-querybuilder';\nimport { standardClassnames, useValueEditor, ValueEditor } from 'react-querybuilder';\n\n// Extracted from callback so we can use `useId`\nconst RadioButton = (props: {\n name: string;\n disabled?: boolean;\n checked: boolean;\n handleOnChange: (v: string) => void;\n label: string;\n}) => {\n const id = React.useId();\n return (\n <div className=\"form-check form-check-inline\">\n <input\n className=\"form-check-input\"\n type=\"radio\"\n id={id}\n value={props.name}\n checked={props.checked}\n disabled={props.disabled}\n onChange={e => props.handleOnChange(e.target.value)}\n />\n <label className=\"form-check-label\" htmlFor={id}>\n {props.label}\n </label>\n </div>\n );\n};\n\n/**\n * @group Components\n */\nexport const BootstrapValueEditor = (props: ValueEditorProps): React.JSX.Element | null => {\n const { valueListItemClassName } = useValueEditor(props);\n\n if (props.operator === 'null' || props.operator === 'notNull') {\n return null;\n }\n\n if (\n (props.operator === 'between' || props.operator === 'notBetween') &&\n (props.type === 'select' || props.type === 'text')\n ) {\n const listItemClasses =\n props.type === 'text' ? 'form-control form-control-sm' : 'form-select form-select-sm';\n return (\n <ValueEditor\n {...props}\n skipHook\n schema={{\n ...props.schema,\n classNames: {\n ...props.schema.classNames,\n valueListItem: `${valueListItemClassName} ${listItemClasses}`,\n },\n }}\n />\n );\n }\n\n switch (props.type) {\n case 'select':\n case 'multiselect':\n return (\n <ValueEditor\n {...props}\n skipHook\n className={`${props.className} form-select form-select-sm`}\n />\n );\n\n case 'switch':\n return (\n <span className={`${props.className} custom-control custom-switch`}>\n <input\n type=\"checkbox\"\n className=\"form-check-input custom-control-input\"\n title={props.title}\n disabled={props.disabled}\n onChange={e => props.handleOnChange(e.target.checked)}\n checked={!!props.value}\n />\n </span>\n );\n\n case 'checkbox':\n return <ValueEditor {...props} skipHook className={`${props.className} form-check-input`} />;\n\n case 'radio':\n return (\n <span title={props.title} className={standardClassnames.value}>\n {props.values?.map(v => (\n <RadioButton\n key={v.name}\n name={v.name}\n disabled={props.disabled}\n checked={props.value === v.name}\n handleOnChange={props.handleOnChange}\n label={v.label}\n />\n ))}\n </span>\n );\n }\n\n return (\n <ValueEditor\n {...props}\n skipHook\n className={`${props.className} form-control form-control-sm`}\n />\n );\n};\n","import * as React from 'react';\nimport type {\n Classnames,\n ControlElementsProp,\n FullField,\n QueryBuilderContextProvider,\n Translations,\n} from 'react-querybuilder';\nimport { getCompatContextProvider } from 'react-querybuilder';\nimport { BootstrapNotToggle } from './BootstrapNotToggle';\nimport { BootstrapValueEditor } from './BootstrapValueEditor';\n\nexport * from './BootstrapNotToggle';\nexport * from './BootstrapValueEditor';\n\n/**\n * @group Props\n */\nexport const bootstrapControlElements: ControlElementsProp<FullField, string> = {\n notToggle: BootstrapNotToggle,\n valueEditor: BootstrapValueEditor,\n};\n\n/**\n * @group Props\n */\nexport const bootstrapControlClassnames: Partial<Classnames> = {\n actionElement: 'btn btn-sm',\n addGroup: 'btn-secondary',\n addRule: 'btn-primary',\n cloneGroup: 'btn-secondary',\n cloneRule: 'btn-secondary',\n lockGroup: 'btn-secondary',\n lockRule: 'btn-secondary',\n removeGroup: 'btn-danger',\n removeRule: 'btn-danger',\n // BootstrapValueEditor adds its own classnames\n // value: '',\n valueSelector: 'form-select form-select-sm',\n};\n\n/**\n * @group Props\n */\nexport const bootstrapTranslations: Partial<Translations> = {\n removeGroup: { label: <i className=\"bi bi-x\" /> },\n removeRule: { label: <i className=\"bi bi-x\" /> },\n cloneRule: { label: <i className=\"bi bi-copy\" /> },\n cloneRuleGroup: { label: <i className=\"bi bi-copy\" /> },\n dragHandle: { label: <i className=\"bi bi-grip-vertical\" /> },\n lockGroup: { label: <i className=\"bi bi-unlock\" /> },\n lockRule: { label: <i className=\"bi bi-unlock\" /> },\n lockGroupDisabled: { label: <i className=\"bi bi-lock\" /> },\n lockRuleDisabled: { label: <i className=\"bi bi-lock\" /> },\n shiftActionUp: { label: <i className=\"bi bi-chevron-compact-up\" /> },\n shiftActionDown: { label: <i className=\"bi bi-chevron-compact-down\" /> },\n};\n\n/**\n * @group Components\n */\nexport const QueryBuilderBootstrap: QueryBuilderContextProvider = getCompatContextProvider({\n controlClassnames: bootstrapControlClassnames,\n controlElements: bootstrapControlElements,\n translations: bootstrapTranslations,\n});\n"],"mappings":"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"}
|
|
@@ -345,6 +345,41 @@ type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
|
345
345
|
//=> 'not equal'
|
|
346
346
|
```
|
|
347
347
|
|
|
348
|
+
Note: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:
|
|
349
|
+
|
|
350
|
+
@example
|
|
351
|
+
```
|
|
352
|
+
import type {If, IsEqual, StringRepeat} from 'type-fest';
|
|
353
|
+
|
|
354
|
+
type HundredZeroes = StringRepeat<'0', 100>;
|
|
355
|
+
|
|
356
|
+
// The following implementation is not tail recursive
|
|
357
|
+
type Includes<S extends string, Char extends string> =
|
|
358
|
+
S extends `${infer First}${infer Rest}`
|
|
359
|
+
? If<IsEqual<First, Char>,
|
|
360
|
+
'found',
|
|
361
|
+
Includes<Rest, Char>>
|
|
362
|
+
: 'not found';
|
|
363
|
+
|
|
364
|
+
// Hence, instantiations with long strings will fail
|
|
365
|
+
// @ts-expect-error
|
|
366
|
+
type Fails = Includes<HundredZeroes, '1'>;
|
|
367
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
368
|
+
// Error: Type instantiation is excessively deep and possibly infinite.
|
|
369
|
+
|
|
370
|
+
// However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
|
|
371
|
+
type IncludesWithoutIf<S extends string, Char extends string> =
|
|
372
|
+
S extends `${infer First}${infer Rest}`
|
|
373
|
+
? IsEqual<First, Char> extends true
|
|
374
|
+
? 'found'
|
|
375
|
+
: IncludesWithoutIf<Rest, Char>
|
|
376
|
+
: 'not found';
|
|
377
|
+
|
|
378
|
+
// Now, instantiations with long strings will work
|
|
379
|
+
type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
380
|
+
//=> 'not found'
|
|
381
|
+
```
|
|
382
|
+
|
|
348
383
|
@category Type Guard
|
|
349
384
|
@category Utilities
|
|
350
385
|
*/
|
|
@@ -439,7 +474,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
439
474
|
```
|
|
440
475
|
|
|
441
476
|
@link https://github.com/microsoft/TypeScript/issues/15300
|
|
442
|
-
@see SimplifyDeep
|
|
477
|
+
@see {@link SimplifyDeep}
|
|
443
478
|
@category Object
|
|
444
479
|
*/
|
|
445
480
|
type Simplify<T$1> = { [KeyType in keyof T$1]: T$1[KeyType] } & {};
|
|
@@ -563,7 +598,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
563
598
|
// => { foo: 'bar'; qux?: 'baz' | undefined; }
|
|
564
599
|
```
|
|
565
600
|
|
|
566
|
-
@see PickIndexSignature
|
|
601
|
+
@see {@link PickIndexSignature}
|
|
567
602
|
@category Object
|
|
568
603
|
*/
|
|
569
604
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
@@ -611,7 +646,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
611
646
|
// }
|
|
612
647
|
```
|
|
613
648
|
|
|
614
|
-
@see OmitIndexSignature
|
|
649
|
+
@see {@link OmitIndexSignature}
|
|
615
650
|
@category Object
|
|
616
651
|
*/
|
|
617
652
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
@@ -1117,7 +1152,7 @@ interface RuleGroupType<R$1 extends RuleType = RuleType, C extends string = stri
|
|
|
1117
1152
|
/**
|
|
1118
1153
|
* The type of the `rules` array in a {@link RuleGroupType}.
|
|
1119
1154
|
*/
|
|
1120
|
-
type RuleGroupArray<RG
|
|
1155
|
+
type RuleGroupArray<RG extends RuleGroupType = RuleGroupType, R$1 extends RuleType = RuleType> = (R$1 | RG)[];
|
|
1121
1156
|
//#endregion
|
|
1122
1157
|
//#region ../core/src/types/ruleGroupsIC.utils.d.ts
|
|
1123
1158
|
type MAXIMUM_ALLOWED_BOUNDARY = 80;
|
|
@@ -1143,7 +1178,7 @@ type RuleGroupTypeAny<R$1 extends RuleType = RuleType, C extends string = string
|
|
|
1143
1178
|
/**
|
|
1144
1179
|
* The type of the `rules` array in a {@link RuleGroupTypeIC}.
|
|
1145
1180
|
*/
|
|
1146
|
-
type RuleGroupICArray<RG
|
|
1181
|
+
type RuleGroupICArray<RG extends RuleGroupTypeIC = RuleGroupTypeIC, R$1 extends RuleType = RuleType, C extends string = string> = [R$1 | RG] | [R$1 | RG, ...MappedTuple<[C, R$1 | RG]>] | ((R$1 | RG)[] & {
|
|
1147
1182
|
length: 0;
|
|
1148
1183
|
});
|
|
1149
1184
|
/**
|
|
@@ -1153,7 +1188,7 @@ type RuleOrGroupArray = RuleGroupArray | RuleGroupICArray;
|
|
|
1153
1188
|
/**
|
|
1154
1189
|
* Converts a narrowed rule group type to its most generic form.
|
|
1155
1190
|
*/
|
|
1156
|
-
type GenericizeRuleGroupType<RG
|
|
1191
|
+
type GenericizeRuleGroupType<RG> = RG extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
|
|
1157
1192
|
//#endregion
|
|
1158
1193
|
//#region ../core/src/types/validation.d.ts
|
|
1159
1194
|
/**
|
|
@@ -1491,9 +1526,13 @@ interface Classnames {
|
|
|
1491
1526
|
*/
|
|
1492
1527
|
branches: Classname;
|
|
1493
1528
|
/**
|
|
1494
|
-
* Classname(s) rules that render a subquery.
|
|
1529
|
+
* Classname(s) applied to rules that render a subquery.
|
|
1495
1530
|
*/
|
|
1496
1531
|
hasSubQuery: Classname;
|
|
1532
|
+
/**
|
|
1533
|
+
* Classname(s) applied to async components in their "loading" state.
|
|
1534
|
+
*/
|
|
1535
|
+
loading: Classname;
|
|
1497
1536
|
}
|
|
1498
1537
|
/**
|
|
1499
1538
|
* Placeholder strings for option lists.
|
|
@@ -2403,15 +2442,15 @@ type QueryBuilderContextProvider<ExtraProps extends object = Record<string, any>
|
|
|
2403
2442
|
*
|
|
2404
2443
|
* @group Props
|
|
2405
2444
|
*/
|
|
2406
|
-
type QueryBuilderProps<RG
|
|
2445
|
+
type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O extends FullOperator, C extends FullCombinator> = RG extends RuleGroupType<infer R> | RuleGroupTypeIC<infer R> ? QueryBuilderContextProps<F, GetOptionIdentifierType<O>> & {
|
|
2407
2446
|
/**
|
|
2408
2447
|
* Initial query object for uncontrolled components.
|
|
2409
2448
|
*/
|
|
2410
|
-
defaultQuery?: RG
|
|
2449
|
+
defaultQuery?: RG;
|
|
2411
2450
|
/**
|
|
2412
2451
|
* Query object for controlled components.
|
|
2413
2452
|
*/
|
|
2414
|
-
query?: RG
|
|
2453
|
+
query?: RG;
|
|
2415
2454
|
/**
|
|
2416
2455
|
* List of valid {@link FullField}s.
|
|
2417
2456
|
*
|
|
@@ -2563,7 +2602,7 @@ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O ext
|
|
|
2563
2602
|
*/
|
|
2564
2603
|
getSubQueryBuilderProps?(field: GetOptionIdentifierType<F>, misc: {
|
|
2565
2604
|
fieldData: F;
|
|
2566
|
-
}): QueryBuilderProps<GenericizeRuleGroupType<RG
|
|
2605
|
+
}): QueryBuilderProps<GenericizeRuleGroupType<RG>, FullOption, FullOption, FullOption>;
|
|
2567
2606
|
/**
|
|
2568
2607
|
* The return value of this function will be used to apply classnames to the
|
|
2569
2608
|
* outer `<div>` of the given {@link Rule}.
|
|
@@ -2575,56 +2614,56 @@ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O ext
|
|
|
2575
2614
|
* The return value of this function will be used to apply classnames to the
|
|
2576
2615
|
* outer `<div>` of the given {@link RuleGroup}.
|
|
2577
2616
|
*/
|
|
2578
|
-
getRuleGroupClassname?(ruleGroup: RG
|
|
2617
|
+
getRuleGroupClassname?(ruleGroup: RG): Classname;
|
|
2579
2618
|
/**
|
|
2580
2619
|
* This callback is invoked before a new rule is added. The function should either manipulate
|
|
2581
2620
|
* the rule and return the new object, return `true` to allow the addition to proceed as normal,
|
|
2582
2621
|
* or return `false` to cancel the addition of the rule.
|
|
2583
2622
|
*/
|
|
2584
|
-
onAddRule?(rule: R, parentPath: Path, query: RG
|
|
2623
|
+
onAddRule?(rule: R, parentPath: Path, query: RG, context?: any): RuleType | boolean;
|
|
2585
2624
|
/**
|
|
2586
2625
|
* This callback is invoked before a new group is added. The function should either manipulate
|
|
2587
2626
|
* the group and return the new object, return `true` to allow the addition to proceed as normal,
|
|
2588
2627
|
* or return `false` to cancel the addition of the group.
|
|
2589
2628
|
*/
|
|
2590
|
-
onAddGroup?(ruleGroup: RG
|
|
2629
|
+
onAddGroup?(ruleGroup: RG, parentPath: Path, query: RG, context?: any): RG | boolean;
|
|
2591
2630
|
/**
|
|
2592
2631
|
* This callback is invoked before a rule is moved or shifted. The function should return
|
|
2593
2632
|
* `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
|
|
2594
2633
|
* a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2595
2634
|
* query state.
|
|
2596
2635
|
*/
|
|
2597
|
-
onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG
|
|
2636
|
+
onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
|
|
2598
2637
|
/**
|
|
2599
2638
|
* This callback is invoked before a group is moved or shifted. The function should return
|
|
2600
2639
|
* `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
|
|
2601
2640
|
* a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2602
2641
|
* query state.
|
|
2603
2642
|
*/
|
|
2604
|
-
onMoveGroup?(ruleGroup: RG
|
|
2643
|
+
onMoveGroup?(ruleGroup: RG, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
|
|
2605
2644
|
/**
|
|
2606
2645
|
* This callback is invoked before a rule is grouped with another object. The function should
|
|
2607
2646
|
* return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
|
|
2608
2647
|
* or a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2609
2648
|
* query state.
|
|
2610
2649
|
*/
|
|
2611
|
-
onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG
|
|
2650
|
+
onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
|
|
2612
2651
|
/**
|
|
2613
2652
|
* This callback is invoked before a group is grouped with another object. The function should
|
|
2614
2653
|
* return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
|
|
2615
2654
|
* or a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2616
2655
|
* query state.
|
|
2617
2656
|
*/
|
|
2618
|
-
onGroupGroup?(ruleGroup: RG
|
|
2657
|
+
onGroupGroup?(ruleGroup: RG, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
|
|
2619
2658
|
/**
|
|
2620
2659
|
* This callback is invoked before a rule or group is removed. The function should return
|
|
2621
2660
|
* `true` if the rule or group should be removed or `false` if it should not be removed.
|
|
2622
2661
|
*/
|
|
2623
|
-
onRemove?(ruleOrGroup: R | RG
|
|
2662
|
+
onRemove?(ruleOrGroup: R | RG, path: Path, query: RG, context?: any): boolean;
|
|
2624
2663
|
/**
|
|
2625
2664
|
* This callback is invoked anytime the query state is updated.
|
|
2626
2665
|
*/
|
|
2627
|
-
onQueryChange?(query: RG
|
|
2666
|
+
onQueryChange?(query: RG): void;
|
|
2628
2667
|
/**
|
|
2629
2668
|
* Each log object will be passed to this function when `debugMode` is `true`.
|
|
2630
2669
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`react`);c=s(c);let l=require(`react-querybuilder`);
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`react`);c=s(c);let l=require(`react-querybuilder`);const u=({className:e,handleOnChange:t,title:n,label:r,checked:i,disabled:a})=>{let o=(0,c.useId)();return c.createElement(`div`,{className:`form-check-inline form-switch ${e}`},c.createElement(`input`,{id:o,className:`form-check-input`,type:`checkbox`,onChange:e=>t(e.target.checked),checked:!!i,disabled:a}),c.createElement(`label`,{title:n,htmlFor:o,className:`form-check-label`},r))},d=e=>{let t=c.useId();return c.createElement(`div`,{className:`form-check form-check-inline`},c.createElement(`input`,{className:`form-check-input`,type:`radio`,id:t,value:e.name,checked:e.checked,disabled:e.disabled,onChange:t=>e.handleOnChange(t.target.value)}),c.createElement(`label`,{className:`form-check-label`,htmlFor:t},e.label))},f=e=>{let{valueListItemClassName:t}=(0,l.useValueEditor)(e);if(e.operator===`null`||e.operator===`notNull`)return null;if((e.operator===`between`||e.operator===`notBetween`)&&(e.type===`select`||e.type===`text`)){let n=e.type===`text`?`form-control form-control-sm`:`form-select form-select-sm`;return c.createElement(l.ValueEditor,{...e,skipHook:!0,schema:{...e.schema,classNames:{...e.schema.classNames,valueListItem:`${t} ${n}`}}})}switch(e.type){case`select`:case`multiselect`:return c.createElement(l.ValueEditor,{...e,skipHook:!0,className:`${e.className} form-select form-select-sm`});case`switch`:return c.createElement(`span`,{className:`${e.className} custom-control custom-switch`},c.createElement(`input`,{type:`checkbox`,className:`form-check-input custom-control-input`,title:e.title,disabled:e.disabled,onChange:t=>e.handleOnChange(t.target.checked),checked:!!e.value}));case`checkbox`:return c.createElement(l.ValueEditor,{...e,skipHook:!0,className:`${e.className} form-check-input`});case`radio`:return c.createElement(`span`,{title:e.title,className:l.standardClassnames.value},e.values?.map(t=>c.createElement(d,{key:t.name,name:t.name,disabled:e.disabled,checked:e.value===t.name,handleOnChange:e.handleOnChange,label:t.label})))}return c.createElement(l.ValueEditor,{...e,skipHook:!0,className:`${e.className} form-control form-control-sm`})},p={notToggle:u,valueEditor:f},m={actionElement:`btn btn-sm`,addGroup:`btn-secondary`,addRule:`btn-primary`,cloneGroup:`btn-secondary`,cloneRule:`btn-secondary`,lockGroup:`btn-secondary`,lockRule:`btn-secondary`,removeGroup:`btn-danger`,removeRule:`btn-danger`,valueSelector:`form-select form-select-sm`},h={removeGroup:{label:c.createElement(`i`,{className:`bi bi-x`})},removeRule:{label:c.createElement(`i`,{className:`bi bi-x`})},cloneRule:{label:c.createElement(`i`,{className:`bi bi-copy`})},cloneRuleGroup:{label:c.createElement(`i`,{className:`bi bi-copy`})},dragHandle:{label:c.createElement(`i`,{className:`bi bi-grip-vertical`})},lockGroup:{label:c.createElement(`i`,{className:`bi bi-unlock`})},lockRule:{label:c.createElement(`i`,{className:`bi bi-unlock`})},lockGroupDisabled:{label:c.createElement(`i`,{className:`bi bi-lock`})},lockRuleDisabled:{label:c.createElement(`i`,{className:`bi bi-lock`})},shiftActionUp:{label:c.createElement(`i`,{className:`bi bi-chevron-compact-up`})},shiftActionDown:{label:c.createElement(`i`,{className:`bi bi-chevron-compact-down`})}},g=(0,l.getCompatContextProvider)({controlClassnames:m,controlElements:p,translations:h});exports.BootstrapNotToggle=u,exports.BootstrapValueEditor=f,exports.QueryBuilderBootstrap=g,exports.bootstrapControlClassnames=m,exports.bootstrapControlElements=p,exports.bootstrapTranslations=h;
|
|
2
2
|
//# sourceMappingURL=react-querybuilder_bootstrap.cjs.production.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react-querybuilder_bootstrap.cjs.production.js","names":["React","ValueEditor","standardClassnames","bootstrapControlElements: ControlElementsProp<FullField, string>","bootstrapControlClassnames: Partial<Classnames>","bootstrapTranslations: Partial<Translations>","QueryBuilderBootstrap: QueryBuilderContextProvider"],"sources":["../../src/BootstrapNotToggle.tsx","../../src/BootstrapValueEditor.tsx","../../src/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useId } from 'react';\nimport type { NotToggleProps } from 'react-querybuilder';\n\n/**\n * @group Components\n */\nexport const BootstrapNotToggle = ({\n className,\n handleOnChange,\n title,\n label,\n checked,\n disabled,\n}: NotToggleProps): React.JSX.Element => {\n const id = useId();\n\n return (\n <div className={`form-check-inline form-switch ${className}`}>\n <input\n id={id}\n className=\"form-check-input\"\n type=\"checkbox\"\n onChange={e => handleOnChange(e.target.checked)}\n checked={!!checked}\n disabled={disabled}\n />\n <label title={title} htmlFor={id} className=\"form-check-label\">\n {label}\n </label>\n </div>\n );\n};\n","import * as React from 'react';\nimport type { ValueEditorProps } from 'react-querybuilder';\nimport { standardClassnames, useValueEditor, ValueEditor } from 'react-querybuilder';\n\n// Extracted from callback so we can use `useId`\nconst RadioButton = (props: {\n name: string;\n disabled?: boolean;\n checked: boolean;\n handleOnChange: (v: string) => void;\n label: string;\n}) => {\n const id = React.useId();\n return (\n <div className=\"form-check form-check-inline\">\n <input\n className=\"form-check-input\"\n type=\"radio\"\n id={id}\n value={props.name}\n checked={props.checked}\n disabled={props.disabled}\n onChange={e => props.handleOnChange(e.target.value)}\n />\n <label className=\"form-check-label\" htmlFor={id}>\n {props.label}\n </label>\n </div>\n );\n};\n\n/**\n * @group Components\n */\nexport const BootstrapValueEditor = (props: ValueEditorProps): React.JSX.Element | null => {\n const { valueListItemClassName } = useValueEditor(props);\n\n if (props.operator === 'null' || props.operator === 'notNull') {\n return null;\n }\n\n if (\n (props.operator === 'between' || props.operator === 'notBetween') &&\n (props.type === 'select' || props.type === 'text')\n ) {\n const listItemClasses =\n props.type === 'text' ? 'form-control form-control-sm' : 'form-select form-select-sm';\n return (\n <ValueEditor\n {...props}\n skipHook\n schema={{\n ...props.schema,\n classNames: {\n ...props.schema.classNames,\n valueListItem: `${valueListItemClassName} ${listItemClasses}`,\n },\n }}\n />\n );\n }\n\n switch (props.type) {\n case 'select':\n case 'multiselect':\n return (\n <ValueEditor\n {...props}\n skipHook\n className={`${props.className} form-select form-select-sm`}\n />\n );\n\n case 'switch':\n return (\n <span className={`${props.className} custom-control custom-switch`}>\n <input\n type=\"checkbox\"\n className=\"form-check-input custom-control-input\"\n title={props.title}\n disabled={props.disabled}\n onChange={e => props.handleOnChange(e.target.checked)}\n checked={!!props.value}\n />\n </span>\n );\n\n case 'checkbox':\n return <ValueEditor {...props} skipHook className={`${props.className} form-check-input`} />;\n\n case 'radio':\n return (\n <span title={props.title} className={standardClassnames.value}>\n {props.values?.map(v => (\n <RadioButton\n key={v.name}\n name={v.name}\n disabled={props.disabled}\n checked={props.value === v.name}\n handleOnChange={props.handleOnChange}\n label={v.label}\n />\n ))}\n </span>\n );\n }\n\n return (\n <ValueEditor\n {...props}\n skipHook\n className={`${props.className} form-control form-control-sm`}\n />\n );\n};\n","import * as React from 'react';\nimport type {\n Classnames,\n ControlElementsProp,\n FullField,\n QueryBuilderContextProvider,\n Translations,\n} from 'react-querybuilder';\nimport { getCompatContextProvider } from 'react-querybuilder';\nimport { BootstrapNotToggle } from './BootstrapNotToggle';\nimport { BootstrapValueEditor } from './BootstrapValueEditor';\n\nexport * from './BootstrapNotToggle';\nexport * from './BootstrapValueEditor';\n\n/**\n * @group Props\n */\nexport const bootstrapControlElements: ControlElementsProp<FullField, string> = {\n notToggle: BootstrapNotToggle,\n valueEditor: BootstrapValueEditor,\n};\n\n/**\n * @group Props\n */\nexport const bootstrapControlClassnames: Partial<Classnames> = {\n actionElement: 'btn btn-sm',\n addGroup: 'btn-secondary',\n addRule: 'btn-primary',\n cloneGroup: 'btn-secondary',\n cloneRule: 'btn-secondary',\n lockGroup: 'btn-secondary',\n lockRule: 'btn-secondary',\n removeGroup: 'btn-danger',\n removeRule: 'btn-danger',\n // BootstrapValueEditor adds its own classnames\n // value: '',\n valueSelector: 'form-select form-select-sm',\n};\n\n/**\n * @group Props\n */\nexport const bootstrapTranslations: Partial<Translations> = {\n removeGroup: { label: <i className=\"bi bi-x\" /> },\n removeRule: { label: <i className=\"bi bi-x\" /> },\n cloneRule: { label: <i className=\"bi bi-copy\" /> },\n cloneRuleGroup: { label: <i className=\"bi bi-copy\" /> },\n dragHandle: { label: <i className=\"bi bi-grip-vertical\" /> },\n lockGroup: { label: <i className=\"bi bi-unlock\" /> },\n lockRule: { label: <i className=\"bi bi-unlock\" /> },\n lockGroupDisabled: { label: <i className=\"bi bi-lock\" /> },\n lockRuleDisabled: { label: <i className=\"bi bi-lock\" /> },\n shiftActionUp: { label: <i className=\"bi bi-chevron-compact-up\" /> },\n shiftActionDown: { label: <i className=\"bi bi-chevron-compact-down\" /> },\n};\n\n/**\n * @group Components\n */\nexport const QueryBuilderBootstrap: QueryBuilderContextProvider = getCompatContextProvider({\n controlClassnames: bootstrapControlClassnames,\n controlElements: bootstrapControlElements,\n translations: bootstrapTranslations,\n});\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"react-querybuilder_bootstrap.cjs.production.js","names":["React","ValueEditor","standardClassnames","bootstrapControlElements: ControlElementsProp<FullField, string>","bootstrapControlClassnames: Partial<Classnames>","bootstrapTranslations: Partial<Translations>","QueryBuilderBootstrap: QueryBuilderContextProvider"],"sources":["../../src/BootstrapNotToggle.tsx","../../src/BootstrapValueEditor.tsx","../../src/index.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useId } from 'react';\nimport type { NotToggleProps } from 'react-querybuilder';\n\n/**\n * @group Components\n */\nexport const BootstrapNotToggle = ({\n className,\n handleOnChange,\n title,\n label,\n checked,\n disabled,\n}: NotToggleProps): React.JSX.Element => {\n const id = useId();\n\n return (\n <div className={`form-check-inline form-switch ${className}`}>\n <input\n id={id}\n className=\"form-check-input\"\n type=\"checkbox\"\n onChange={e => handleOnChange(e.target.checked)}\n checked={!!checked}\n disabled={disabled}\n />\n <label title={title} htmlFor={id} className=\"form-check-label\">\n {label}\n </label>\n </div>\n );\n};\n","import * as React from 'react';\nimport type { ValueEditorProps } from 'react-querybuilder';\nimport { standardClassnames, useValueEditor, ValueEditor } from 'react-querybuilder';\n\n// Extracted from callback so we can use `useId`\nconst RadioButton = (props: {\n name: string;\n disabled?: boolean;\n checked: boolean;\n handleOnChange: (v: string) => void;\n label: string;\n}) => {\n const id = React.useId();\n return (\n <div className=\"form-check form-check-inline\">\n <input\n className=\"form-check-input\"\n type=\"radio\"\n id={id}\n value={props.name}\n checked={props.checked}\n disabled={props.disabled}\n onChange={e => props.handleOnChange(e.target.value)}\n />\n <label className=\"form-check-label\" htmlFor={id}>\n {props.label}\n </label>\n </div>\n );\n};\n\n/**\n * @group Components\n */\nexport const BootstrapValueEditor = (props: ValueEditorProps): React.JSX.Element | null => {\n const { valueListItemClassName } = useValueEditor(props);\n\n if (props.operator === 'null' || props.operator === 'notNull') {\n return null;\n }\n\n if (\n (props.operator === 'between' || props.operator === 'notBetween') &&\n (props.type === 'select' || props.type === 'text')\n ) {\n const listItemClasses =\n props.type === 'text' ? 'form-control form-control-sm' : 'form-select form-select-sm';\n return (\n <ValueEditor\n {...props}\n skipHook\n schema={{\n ...props.schema,\n classNames: {\n ...props.schema.classNames,\n valueListItem: `${valueListItemClassName} ${listItemClasses}`,\n },\n }}\n />\n );\n }\n\n switch (props.type) {\n case 'select':\n case 'multiselect':\n return (\n <ValueEditor\n {...props}\n skipHook\n className={`${props.className} form-select form-select-sm`}\n />\n );\n\n case 'switch':\n return (\n <span className={`${props.className} custom-control custom-switch`}>\n <input\n type=\"checkbox\"\n className=\"form-check-input custom-control-input\"\n title={props.title}\n disabled={props.disabled}\n onChange={e => props.handleOnChange(e.target.checked)}\n checked={!!props.value}\n />\n </span>\n );\n\n case 'checkbox':\n return <ValueEditor {...props} skipHook className={`${props.className} form-check-input`} />;\n\n case 'radio':\n return (\n <span title={props.title} className={standardClassnames.value}>\n {props.values?.map(v => (\n <RadioButton\n key={v.name}\n name={v.name}\n disabled={props.disabled}\n checked={props.value === v.name}\n handleOnChange={props.handleOnChange}\n label={v.label}\n />\n ))}\n </span>\n );\n }\n\n return (\n <ValueEditor\n {...props}\n skipHook\n className={`${props.className} form-control form-control-sm`}\n />\n );\n};\n","import * as React from 'react';\nimport type {\n Classnames,\n ControlElementsProp,\n FullField,\n QueryBuilderContextProvider,\n Translations,\n} from 'react-querybuilder';\nimport { getCompatContextProvider } from 'react-querybuilder';\nimport { BootstrapNotToggle } from './BootstrapNotToggle';\nimport { BootstrapValueEditor } from './BootstrapValueEditor';\n\nexport * from './BootstrapNotToggle';\nexport * from './BootstrapValueEditor';\n\n/**\n * @group Props\n */\nexport const bootstrapControlElements: ControlElementsProp<FullField, string> = {\n notToggle: BootstrapNotToggle,\n valueEditor: BootstrapValueEditor,\n};\n\n/**\n * @group Props\n */\nexport const bootstrapControlClassnames: Partial<Classnames> = {\n actionElement: 'btn btn-sm',\n addGroup: 'btn-secondary',\n addRule: 'btn-primary',\n cloneGroup: 'btn-secondary',\n cloneRule: 'btn-secondary',\n lockGroup: 'btn-secondary',\n lockRule: 'btn-secondary',\n removeGroup: 'btn-danger',\n removeRule: 'btn-danger',\n // BootstrapValueEditor adds its own classnames\n // value: '',\n valueSelector: 'form-select form-select-sm',\n};\n\n/**\n * @group Props\n */\nexport const bootstrapTranslations: Partial<Translations> = {\n removeGroup: { label: <i className=\"bi bi-x\" /> },\n removeRule: { label: <i className=\"bi bi-x\" /> },\n cloneRule: { label: <i className=\"bi bi-copy\" /> },\n cloneRuleGroup: { label: <i className=\"bi bi-copy\" /> },\n dragHandle: { label: <i className=\"bi bi-grip-vertical\" /> },\n lockGroup: { label: <i className=\"bi bi-unlock\" /> },\n lockRule: { label: <i className=\"bi bi-unlock\" /> },\n lockGroupDisabled: { label: <i className=\"bi bi-lock\" /> },\n lockRuleDisabled: { label: <i className=\"bi bi-lock\" /> },\n shiftActionUp: { label: <i className=\"bi bi-chevron-compact-up\" /> },\n shiftActionDown: { label: <i className=\"bi bi-chevron-compact-down\" /> },\n};\n\n/**\n * @group Components\n */\nexport const QueryBuilderBootstrap: QueryBuilderContextProvider = getCompatContextProvider({\n controlClassnames: bootstrapControlClassnames,\n controlElements: bootstrapControlElements,\n translations: bootstrapTranslations,\n});\n"],"mappings":"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"}
|
|
@@ -345,6 +345,41 @@ type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
|
345
345
|
//=> 'not equal'
|
|
346
346
|
```
|
|
347
347
|
|
|
348
|
+
Note: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:
|
|
349
|
+
|
|
350
|
+
@example
|
|
351
|
+
```
|
|
352
|
+
import type {If, IsEqual, StringRepeat} from 'type-fest';
|
|
353
|
+
|
|
354
|
+
type HundredZeroes = StringRepeat<'0', 100>;
|
|
355
|
+
|
|
356
|
+
// The following implementation is not tail recursive
|
|
357
|
+
type Includes<S extends string, Char extends string> =
|
|
358
|
+
S extends `${infer First}${infer Rest}`
|
|
359
|
+
? If<IsEqual<First, Char>,
|
|
360
|
+
'found',
|
|
361
|
+
Includes<Rest, Char>>
|
|
362
|
+
: 'not found';
|
|
363
|
+
|
|
364
|
+
// Hence, instantiations with long strings will fail
|
|
365
|
+
// @ts-expect-error
|
|
366
|
+
type Fails = Includes<HundredZeroes, '1'>;
|
|
367
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
368
|
+
// Error: Type instantiation is excessively deep and possibly infinite.
|
|
369
|
+
|
|
370
|
+
// However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
|
|
371
|
+
type IncludesWithoutIf<S extends string, Char extends string> =
|
|
372
|
+
S extends `${infer First}${infer Rest}`
|
|
373
|
+
? IsEqual<First, Char> extends true
|
|
374
|
+
? 'found'
|
|
375
|
+
: IncludesWithoutIf<Rest, Char>
|
|
376
|
+
: 'not found';
|
|
377
|
+
|
|
378
|
+
// Now, instantiations with long strings will work
|
|
379
|
+
type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
380
|
+
//=> 'not found'
|
|
381
|
+
```
|
|
382
|
+
|
|
348
383
|
@category Type Guard
|
|
349
384
|
@category Utilities
|
|
350
385
|
*/
|
|
@@ -439,7 +474,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
439
474
|
```
|
|
440
475
|
|
|
441
476
|
@link https://github.com/microsoft/TypeScript/issues/15300
|
|
442
|
-
@see SimplifyDeep
|
|
477
|
+
@see {@link SimplifyDeep}
|
|
443
478
|
@category Object
|
|
444
479
|
*/
|
|
445
480
|
type Simplify<T$1> = { [KeyType in keyof T$1]: T$1[KeyType] } & {};
|
|
@@ -563,7 +598,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
563
598
|
// => { foo: 'bar'; qux?: 'baz' | undefined; }
|
|
564
599
|
```
|
|
565
600
|
|
|
566
|
-
@see PickIndexSignature
|
|
601
|
+
@see {@link PickIndexSignature}
|
|
567
602
|
@category Object
|
|
568
603
|
*/
|
|
569
604
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
@@ -611,7 +646,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
611
646
|
// }
|
|
612
647
|
```
|
|
613
648
|
|
|
614
|
-
@see OmitIndexSignature
|
|
649
|
+
@see {@link OmitIndexSignature}
|
|
615
650
|
@category Object
|
|
616
651
|
*/
|
|
617
652
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
@@ -1117,7 +1152,7 @@ interface RuleGroupType<R$1 extends RuleType = RuleType, C extends string = stri
|
|
|
1117
1152
|
/**
|
|
1118
1153
|
* The type of the `rules` array in a {@link RuleGroupType}.
|
|
1119
1154
|
*/
|
|
1120
|
-
type RuleGroupArray<RG
|
|
1155
|
+
type RuleGroupArray<RG extends RuleGroupType = RuleGroupType, R$1 extends RuleType = RuleType> = (R$1 | RG)[];
|
|
1121
1156
|
//#endregion
|
|
1122
1157
|
//#region ../core/src/types/ruleGroupsIC.utils.d.ts
|
|
1123
1158
|
type MAXIMUM_ALLOWED_BOUNDARY = 80;
|
|
@@ -1143,7 +1178,7 @@ type RuleGroupTypeAny<R$1 extends RuleType = RuleType, C extends string = string
|
|
|
1143
1178
|
/**
|
|
1144
1179
|
* The type of the `rules` array in a {@link RuleGroupTypeIC}.
|
|
1145
1180
|
*/
|
|
1146
|
-
type RuleGroupICArray<RG
|
|
1181
|
+
type RuleGroupICArray<RG extends RuleGroupTypeIC = RuleGroupTypeIC, R$1 extends RuleType = RuleType, C extends string = string> = [R$1 | RG] | [R$1 | RG, ...MappedTuple<[C, R$1 | RG]>] | ((R$1 | RG)[] & {
|
|
1147
1182
|
length: 0;
|
|
1148
1183
|
});
|
|
1149
1184
|
/**
|
|
@@ -1153,7 +1188,7 @@ type RuleOrGroupArray = RuleGroupArray | RuleGroupICArray;
|
|
|
1153
1188
|
/**
|
|
1154
1189
|
* Converts a narrowed rule group type to its most generic form.
|
|
1155
1190
|
*/
|
|
1156
|
-
type GenericizeRuleGroupType<RG
|
|
1191
|
+
type GenericizeRuleGroupType<RG> = RG extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
|
|
1157
1192
|
//#endregion
|
|
1158
1193
|
//#region ../core/src/types/validation.d.ts
|
|
1159
1194
|
/**
|
|
@@ -1491,9 +1526,13 @@ interface Classnames {
|
|
|
1491
1526
|
*/
|
|
1492
1527
|
branches: Classname;
|
|
1493
1528
|
/**
|
|
1494
|
-
* Classname(s) rules that render a subquery.
|
|
1529
|
+
* Classname(s) applied to rules that render a subquery.
|
|
1495
1530
|
*/
|
|
1496
1531
|
hasSubQuery: Classname;
|
|
1532
|
+
/**
|
|
1533
|
+
* Classname(s) applied to async components in their "loading" state.
|
|
1534
|
+
*/
|
|
1535
|
+
loading: Classname;
|
|
1497
1536
|
}
|
|
1498
1537
|
/**
|
|
1499
1538
|
* Placeholder strings for option lists.
|
|
@@ -2403,15 +2442,15 @@ type QueryBuilderContextProvider<ExtraProps extends object = Record<string, any>
|
|
|
2403
2442
|
*
|
|
2404
2443
|
* @group Props
|
|
2405
2444
|
*/
|
|
2406
|
-
type QueryBuilderProps<RG
|
|
2445
|
+
type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O extends FullOperator, C extends FullCombinator> = RG extends RuleGroupType<infer R> | RuleGroupTypeIC<infer R> ? QueryBuilderContextProps<F, GetOptionIdentifierType<O>> & {
|
|
2407
2446
|
/**
|
|
2408
2447
|
* Initial query object for uncontrolled components.
|
|
2409
2448
|
*/
|
|
2410
|
-
defaultQuery?: RG
|
|
2449
|
+
defaultQuery?: RG;
|
|
2411
2450
|
/**
|
|
2412
2451
|
* Query object for controlled components.
|
|
2413
2452
|
*/
|
|
2414
|
-
query?: RG
|
|
2453
|
+
query?: RG;
|
|
2415
2454
|
/**
|
|
2416
2455
|
* List of valid {@link FullField}s.
|
|
2417
2456
|
*
|
|
@@ -2563,7 +2602,7 @@ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O ext
|
|
|
2563
2602
|
*/
|
|
2564
2603
|
getSubQueryBuilderProps?(field: GetOptionIdentifierType<F>, misc: {
|
|
2565
2604
|
fieldData: F;
|
|
2566
|
-
}): QueryBuilderProps<GenericizeRuleGroupType<RG
|
|
2605
|
+
}): QueryBuilderProps<GenericizeRuleGroupType<RG>, FullOption, FullOption, FullOption>;
|
|
2567
2606
|
/**
|
|
2568
2607
|
* The return value of this function will be used to apply classnames to the
|
|
2569
2608
|
* outer `<div>` of the given {@link Rule}.
|
|
@@ -2575,56 +2614,56 @@ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O ext
|
|
|
2575
2614
|
* The return value of this function will be used to apply classnames to the
|
|
2576
2615
|
* outer `<div>` of the given {@link RuleGroup}.
|
|
2577
2616
|
*/
|
|
2578
|
-
getRuleGroupClassname?(ruleGroup: RG
|
|
2617
|
+
getRuleGroupClassname?(ruleGroup: RG): Classname;
|
|
2579
2618
|
/**
|
|
2580
2619
|
* This callback is invoked before a new rule is added. The function should either manipulate
|
|
2581
2620
|
* the rule and return the new object, return `true` to allow the addition to proceed as normal,
|
|
2582
2621
|
* or return `false` to cancel the addition of the rule.
|
|
2583
2622
|
*/
|
|
2584
|
-
onAddRule?(rule: R, parentPath: Path, query: RG
|
|
2623
|
+
onAddRule?(rule: R, parentPath: Path, query: RG, context?: any): RuleType | boolean;
|
|
2585
2624
|
/**
|
|
2586
2625
|
* This callback is invoked before a new group is added. The function should either manipulate
|
|
2587
2626
|
* the group and return the new object, return `true` to allow the addition to proceed as normal,
|
|
2588
2627
|
* or return `false` to cancel the addition of the group.
|
|
2589
2628
|
*/
|
|
2590
|
-
onAddGroup?(ruleGroup: RG
|
|
2629
|
+
onAddGroup?(ruleGroup: RG, parentPath: Path, query: RG, context?: any): RG | boolean;
|
|
2591
2630
|
/**
|
|
2592
2631
|
* This callback is invoked before a rule is moved or shifted. The function should return
|
|
2593
2632
|
* `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
|
|
2594
2633
|
* a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2595
2634
|
* query state.
|
|
2596
2635
|
*/
|
|
2597
|
-
onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG
|
|
2636
|
+
onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
|
|
2598
2637
|
/**
|
|
2599
2638
|
* This callback is invoked before a group is moved or shifted. The function should return
|
|
2600
2639
|
* `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
|
|
2601
2640
|
* a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2602
2641
|
* query state.
|
|
2603
2642
|
*/
|
|
2604
|
-
onMoveGroup?(ruleGroup: RG
|
|
2643
|
+
onMoveGroup?(ruleGroup: RG, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
|
|
2605
2644
|
/**
|
|
2606
2645
|
* This callback is invoked before a rule is grouped with another object. The function should
|
|
2607
2646
|
* return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
|
|
2608
2647
|
* or a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2609
2648
|
* query state.
|
|
2610
2649
|
*/
|
|
2611
|
-
onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG
|
|
2650
|
+
onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
|
|
2612
2651
|
/**
|
|
2613
2652
|
* This callback is invoked before a group is grouped with another object. The function should
|
|
2614
2653
|
* return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
|
|
2615
2654
|
* or a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2616
2655
|
* query state.
|
|
2617
2656
|
*/
|
|
2618
|
-
onGroupGroup?(ruleGroup: RG
|
|
2657
|
+
onGroupGroup?(ruleGroup: RG, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
|
|
2619
2658
|
/**
|
|
2620
2659
|
* This callback is invoked before a rule or group is removed. The function should return
|
|
2621
2660
|
* `true` if the rule or group should be removed or `false` if it should not be removed.
|
|
2622
2661
|
*/
|
|
2623
|
-
onRemove?(ruleOrGroup: R | RG
|
|
2662
|
+
onRemove?(ruleOrGroup: R | RG, path: Path, query: RG, context?: any): boolean;
|
|
2624
2663
|
/**
|
|
2625
2664
|
* This callback is invoked anytime the query state is updated.
|
|
2626
2665
|
*/
|
|
2627
|
-
onQueryChange?(query: RG
|
|
2666
|
+
onQueryChange?(query: RG): void;
|
|
2628
2667
|
/**
|
|
2629
2668
|
* Each log object will be passed to this function when `debugMode` is `true`.
|
|
2630
2669
|
*
|
|
@@ -345,6 +345,41 @@ type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
|
345
345
|
//=> 'not equal'
|
|
346
346
|
```
|
|
347
347
|
|
|
348
|
+
Note: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:
|
|
349
|
+
|
|
350
|
+
@example
|
|
351
|
+
```
|
|
352
|
+
import type {If, IsEqual, StringRepeat} from 'type-fest';
|
|
353
|
+
|
|
354
|
+
type HundredZeroes = StringRepeat<'0', 100>;
|
|
355
|
+
|
|
356
|
+
// The following implementation is not tail recursive
|
|
357
|
+
type Includes<S extends string, Char extends string> =
|
|
358
|
+
S extends `${infer First}${infer Rest}`
|
|
359
|
+
? If<IsEqual<First, Char>,
|
|
360
|
+
'found',
|
|
361
|
+
Includes<Rest, Char>>
|
|
362
|
+
: 'not found';
|
|
363
|
+
|
|
364
|
+
// Hence, instantiations with long strings will fail
|
|
365
|
+
// @ts-expect-error
|
|
366
|
+
type Fails = Includes<HundredZeroes, '1'>;
|
|
367
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
368
|
+
// Error: Type instantiation is excessively deep and possibly infinite.
|
|
369
|
+
|
|
370
|
+
// However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
|
|
371
|
+
type IncludesWithoutIf<S extends string, Char extends string> =
|
|
372
|
+
S extends `${infer First}${infer Rest}`
|
|
373
|
+
? IsEqual<First, Char> extends true
|
|
374
|
+
? 'found'
|
|
375
|
+
: IncludesWithoutIf<Rest, Char>
|
|
376
|
+
: 'not found';
|
|
377
|
+
|
|
378
|
+
// Now, instantiations with long strings will work
|
|
379
|
+
type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
380
|
+
//=> 'not found'
|
|
381
|
+
```
|
|
382
|
+
|
|
348
383
|
@category Type Guard
|
|
349
384
|
@category Utilities
|
|
350
385
|
*/
|
|
@@ -439,7 +474,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
439
474
|
```
|
|
440
475
|
|
|
441
476
|
@link https://github.com/microsoft/TypeScript/issues/15300
|
|
442
|
-
@see SimplifyDeep
|
|
477
|
+
@see {@link SimplifyDeep}
|
|
443
478
|
@category Object
|
|
444
479
|
*/
|
|
445
480
|
type Simplify<T$1> = { [KeyType in keyof T$1]: T$1[KeyType] } & {};
|
|
@@ -563,7 +598,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
563
598
|
// => { foo: 'bar'; qux?: 'baz' | undefined; }
|
|
564
599
|
```
|
|
565
600
|
|
|
566
|
-
@see PickIndexSignature
|
|
601
|
+
@see {@link PickIndexSignature}
|
|
567
602
|
@category Object
|
|
568
603
|
*/
|
|
569
604
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
@@ -611,7 +646,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
611
646
|
// }
|
|
612
647
|
```
|
|
613
648
|
|
|
614
|
-
@see OmitIndexSignature
|
|
649
|
+
@see {@link OmitIndexSignature}
|
|
615
650
|
@category Object
|
|
616
651
|
*/
|
|
617
652
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
@@ -1117,7 +1152,7 @@ interface RuleGroupType<R$1 extends RuleType = RuleType, C extends string = stri
|
|
|
1117
1152
|
/**
|
|
1118
1153
|
* The type of the `rules` array in a {@link RuleGroupType}.
|
|
1119
1154
|
*/
|
|
1120
|
-
type RuleGroupArray<RG
|
|
1155
|
+
type RuleGroupArray<RG extends RuleGroupType = RuleGroupType, R$1 extends RuleType = RuleType> = (R$1 | RG)[];
|
|
1121
1156
|
//#endregion
|
|
1122
1157
|
//#region ../core/src/types/ruleGroupsIC.utils.d.ts
|
|
1123
1158
|
type MAXIMUM_ALLOWED_BOUNDARY = 80;
|
|
@@ -1143,7 +1178,7 @@ type RuleGroupTypeAny<R$1 extends RuleType = RuleType, C extends string = string
|
|
|
1143
1178
|
/**
|
|
1144
1179
|
* The type of the `rules` array in a {@link RuleGroupTypeIC}.
|
|
1145
1180
|
*/
|
|
1146
|
-
type RuleGroupICArray<RG
|
|
1181
|
+
type RuleGroupICArray<RG extends RuleGroupTypeIC = RuleGroupTypeIC, R$1 extends RuleType = RuleType, C extends string = string> = [R$1 | RG] | [R$1 | RG, ...MappedTuple<[C, R$1 | RG]>] | ((R$1 | RG)[] & {
|
|
1147
1182
|
length: 0;
|
|
1148
1183
|
});
|
|
1149
1184
|
/**
|
|
@@ -1153,7 +1188,7 @@ type RuleOrGroupArray = RuleGroupArray | RuleGroupICArray;
|
|
|
1153
1188
|
/**
|
|
1154
1189
|
* Converts a narrowed rule group type to its most generic form.
|
|
1155
1190
|
*/
|
|
1156
|
-
type GenericizeRuleGroupType<RG
|
|
1191
|
+
type GenericizeRuleGroupType<RG> = RG extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
|
|
1157
1192
|
//#endregion
|
|
1158
1193
|
//#region ../core/src/types/validation.d.ts
|
|
1159
1194
|
/**
|
|
@@ -1491,9 +1526,13 @@ interface Classnames {
|
|
|
1491
1526
|
*/
|
|
1492
1527
|
branches: Classname;
|
|
1493
1528
|
/**
|
|
1494
|
-
* Classname(s) rules that render a subquery.
|
|
1529
|
+
* Classname(s) applied to rules that render a subquery.
|
|
1495
1530
|
*/
|
|
1496
1531
|
hasSubQuery: Classname;
|
|
1532
|
+
/**
|
|
1533
|
+
* Classname(s) applied to async components in their "loading" state.
|
|
1534
|
+
*/
|
|
1535
|
+
loading: Classname;
|
|
1497
1536
|
}
|
|
1498
1537
|
/**
|
|
1499
1538
|
* Placeholder strings for option lists.
|
|
@@ -2403,15 +2442,15 @@ type QueryBuilderContextProvider<ExtraProps extends object = Record<string, any>
|
|
|
2403
2442
|
*
|
|
2404
2443
|
* @group Props
|
|
2405
2444
|
*/
|
|
2406
|
-
type QueryBuilderProps<RG
|
|
2445
|
+
type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O extends FullOperator, C extends FullCombinator> = RG extends RuleGroupType<infer R> | RuleGroupTypeIC<infer R> ? QueryBuilderContextProps<F, GetOptionIdentifierType<O>> & {
|
|
2407
2446
|
/**
|
|
2408
2447
|
* Initial query object for uncontrolled components.
|
|
2409
2448
|
*/
|
|
2410
|
-
defaultQuery?: RG
|
|
2449
|
+
defaultQuery?: RG;
|
|
2411
2450
|
/**
|
|
2412
2451
|
* Query object for controlled components.
|
|
2413
2452
|
*/
|
|
2414
|
-
query?: RG
|
|
2453
|
+
query?: RG;
|
|
2415
2454
|
/**
|
|
2416
2455
|
* List of valid {@link FullField}s.
|
|
2417
2456
|
*
|
|
@@ -2563,7 +2602,7 @@ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O ext
|
|
|
2563
2602
|
*/
|
|
2564
2603
|
getSubQueryBuilderProps?(field: GetOptionIdentifierType<F>, misc: {
|
|
2565
2604
|
fieldData: F;
|
|
2566
|
-
}): QueryBuilderProps<GenericizeRuleGroupType<RG
|
|
2605
|
+
}): QueryBuilderProps<GenericizeRuleGroupType<RG>, FullOption, FullOption, FullOption>;
|
|
2567
2606
|
/**
|
|
2568
2607
|
* The return value of this function will be used to apply classnames to the
|
|
2569
2608
|
* outer `<div>` of the given {@link Rule}.
|
|
@@ -2575,56 +2614,56 @@ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O ext
|
|
|
2575
2614
|
* The return value of this function will be used to apply classnames to the
|
|
2576
2615
|
* outer `<div>` of the given {@link RuleGroup}.
|
|
2577
2616
|
*/
|
|
2578
|
-
getRuleGroupClassname?(ruleGroup: RG
|
|
2617
|
+
getRuleGroupClassname?(ruleGroup: RG): Classname;
|
|
2579
2618
|
/**
|
|
2580
2619
|
* This callback is invoked before a new rule is added. The function should either manipulate
|
|
2581
2620
|
* the rule and return the new object, return `true` to allow the addition to proceed as normal,
|
|
2582
2621
|
* or return `false` to cancel the addition of the rule.
|
|
2583
2622
|
*/
|
|
2584
|
-
onAddRule?(rule: R, parentPath: Path, query: RG
|
|
2623
|
+
onAddRule?(rule: R, parentPath: Path, query: RG, context?: any): RuleType | boolean;
|
|
2585
2624
|
/**
|
|
2586
2625
|
* This callback is invoked before a new group is added. The function should either manipulate
|
|
2587
2626
|
* the group and return the new object, return `true` to allow the addition to proceed as normal,
|
|
2588
2627
|
* or return `false` to cancel the addition of the group.
|
|
2589
2628
|
*/
|
|
2590
|
-
onAddGroup?(ruleGroup: RG
|
|
2629
|
+
onAddGroup?(ruleGroup: RG, parentPath: Path, query: RG, context?: any): RG | boolean;
|
|
2591
2630
|
/**
|
|
2592
2631
|
* This callback is invoked before a rule is moved or shifted. The function should return
|
|
2593
2632
|
* `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
|
|
2594
2633
|
* a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2595
2634
|
* query state.
|
|
2596
2635
|
*/
|
|
2597
|
-
onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG
|
|
2636
|
+
onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
|
|
2598
2637
|
/**
|
|
2599
2638
|
* This callback is invoked before a group is moved or shifted. The function should return
|
|
2600
2639
|
* `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
|
|
2601
2640
|
* a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2602
2641
|
* query state.
|
|
2603
2642
|
*/
|
|
2604
|
-
onMoveGroup?(ruleGroup: RG
|
|
2643
|
+
onMoveGroup?(ruleGroup: RG, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
|
|
2605
2644
|
/**
|
|
2606
2645
|
* This callback is invoked before a rule is grouped with another object. The function should
|
|
2607
2646
|
* return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
|
|
2608
2647
|
* or a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2609
2648
|
* query state.
|
|
2610
2649
|
*/
|
|
2611
|
-
onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG
|
|
2650
|
+
onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
|
|
2612
2651
|
/**
|
|
2613
2652
|
* This callback is invoked before a group is grouped with another object. The function should
|
|
2614
2653
|
* return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
|
|
2615
2654
|
* or a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2616
2655
|
* query state.
|
|
2617
2656
|
*/
|
|
2618
|
-
onGroupGroup?(ruleGroup: RG
|
|
2657
|
+
onGroupGroup?(ruleGroup: RG, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
|
|
2619
2658
|
/**
|
|
2620
2659
|
* This callback is invoked before a rule or group is removed. The function should return
|
|
2621
2660
|
* `true` if the rule or group should be removed or `false` if it should not be removed.
|
|
2622
2661
|
*/
|
|
2623
|
-
onRemove?(ruleOrGroup: R | RG
|
|
2662
|
+
onRemove?(ruleOrGroup: R | RG, path: Path, query: RG, context?: any): boolean;
|
|
2624
2663
|
/**
|
|
2625
2664
|
* This callback is invoked anytime the query state is updated.
|
|
2626
2665
|
*/
|
|
2627
|
-
onQueryChange?(query: RG
|
|
2666
|
+
onQueryChange?(query: RG): void;
|
|
2628
2667
|
/**
|
|
2629
2668
|
* Each log object will be passed to this function when `debugMode` is `true`.
|
|
2630
2669
|
*
|
|
@@ -23,7 +23,7 @@ const BootstrapNotToggle = ({ className, handleOnChange, title, label, checked,
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
//#endregion
|
|
26
|
-
//#region \0@oxc-project+runtime@0.
|
|
26
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/typeof.js
|
|
27
27
|
function _typeof(o) {
|
|
28
28
|
"@babel/helpers - typeof";
|
|
29
29
|
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o$1) {
|
|
@@ -34,7 +34,7 @@ function _typeof(o) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
//#endregion
|
|
37
|
-
//#region \0@oxc-project+runtime@0.
|
|
37
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/toPrimitive.js
|
|
38
38
|
function toPrimitive(t, r) {
|
|
39
39
|
if ("object" != _typeof(t) || !t) return t;
|
|
40
40
|
var e = t[Symbol.toPrimitive];
|
|
@@ -47,14 +47,14 @@ function toPrimitive(t, r) {
|
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
//#endregion
|
|
50
|
-
//#region \0@oxc-project+runtime@0.
|
|
50
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/toPropertyKey.js
|
|
51
51
|
function toPropertyKey(t) {
|
|
52
52
|
var i = toPrimitive(t, "string");
|
|
53
53
|
return "symbol" == _typeof(i) ? i : i + "";
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
//#endregion
|
|
57
|
-
//#region \0@oxc-project+runtime@0.
|
|
57
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/defineProperty.js
|
|
58
58
|
function _defineProperty(e, r, t) {
|
|
59
59
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
60
60
|
value: t,
|
|
@@ -65,7 +65,7 @@ function _defineProperty(e, r, t) {
|
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
//#endregion
|
|
68
|
-
//#region \0@oxc-project+runtime@0.
|
|
68
|
+
//#region \0@oxc-project+runtime@0.96.0/helpers/objectSpread2.js
|
|
69
69
|
function ownKeys(e, r) {
|
|
70
70
|
var t = Object.keys(e);
|
|
71
71
|
if (Object.getOwnPropertySymbols) {
|
|
@@ -345,6 +345,41 @@ type B = IfEqual<string, number, 'equal', 'not equal'>;
|
|
|
345
345
|
//=> 'not equal'
|
|
346
346
|
```
|
|
347
347
|
|
|
348
|
+
Note: Sometimes using the `If` type can make an implementation non–tail-recursive, which can impact performance. In such cases, it’s better to use a conditional directly. Refer to the following example:
|
|
349
|
+
|
|
350
|
+
@example
|
|
351
|
+
```
|
|
352
|
+
import type {If, IsEqual, StringRepeat} from 'type-fest';
|
|
353
|
+
|
|
354
|
+
type HundredZeroes = StringRepeat<'0', 100>;
|
|
355
|
+
|
|
356
|
+
// The following implementation is not tail recursive
|
|
357
|
+
type Includes<S extends string, Char extends string> =
|
|
358
|
+
S extends `${infer First}${infer Rest}`
|
|
359
|
+
? If<IsEqual<First, Char>,
|
|
360
|
+
'found',
|
|
361
|
+
Includes<Rest, Char>>
|
|
362
|
+
: 'not found';
|
|
363
|
+
|
|
364
|
+
// Hence, instantiations with long strings will fail
|
|
365
|
+
// @ts-expect-error
|
|
366
|
+
type Fails = Includes<HundredZeroes, '1'>;
|
|
367
|
+
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
368
|
+
// Error: Type instantiation is excessively deep and possibly infinite.
|
|
369
|
+
|
|
370
|
+
// However, if we use a simple conditional instead of `If`, the implementation becomes tail-recursive
|
|
371
|
+
type IncludesWithoutIf<S extends string, Char extends string> =
|
|
372
|
+
S extends `${infer First}${infer Rest}`
|
|
373
|
+
? IsEqual<First, Char> extends true
|
|
374
|
+
? 'found'
|
|
375
|
+
: IncludesWithoutIf<Rest, Char>
|
|
376
|
+
: 'not found';
|
|
377
|
+
|
|
378
|
+
// Now, instantiations with long strings will work
|
|
379
|
+
type Works = IncludesWithoutIf<HundredZeroes, '1'>;
|
|
380
|
+
//=> 'not found'
|
|
381
|
+
```
|
|
382
|
+
|
|
348
383
|
@category Type Guard
|
|
349
384
|
@category Utilities
|
|
350
385
|
*/
|
|
@@ -439,7 +474,7 @@ fn(someInterface as Simplify<SomeInterface>); // Good: transform an `interface`
|
|
|
439
474
|
```
|
|
440
475
|
|
|
441
476
|
@link https://github.com/microsoft/TypeScript/issues/15300
|
|
442
|
-
@see SimplifyDeep
|
|
477
|
+
@see {@link SimplifyDeep}
|
|
443
478
|
@category Object
|
|
444
479
|
*/
|
|
445
480
|
type Simplify<T$1> = { [KeyType in keyof T$1]: T$1[KeyType] } & {};
|
|
@@ -563,7 +598,7 @@ type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>;
|
|
|
563
598
|
// => { foo: 'bar'; qux?: 'baz' | undefined; }
|
|
564
599
|
```
|
|
565
600
|
|
|
566
|
-
@see PickIndexSignature
|
|
601
|
+
@see {@link PickIndexSignature}
|
|
567
602
|
@category Object
|
|
568
603
|
*/
|
|
569
604
|
type OmitIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? never : KeyType]: ObjectType[KeyType] };
|
|
@@ -611,7 +646,7 @@ type ExampleIndexSignature = PickIndexSignature<Example>;
|
|
|
611
646
|
// }
|
|
612
647
|
```
|
|
613
648
|
|
|
614
|
-
@see OmitIndexSignature
|
|
649
|
+
@see {@link OmitIndexSignature}
|
|
615
650
|
@category Object
|
|
616
651
|
*/
|
|
617
652
|
type PickIndexSignature<ObjectType> = { [KeyType in keyof ObjectType as {} extends Record<KeyType, unknown> ? KeyType : never]: ObjectType[KeyType] };
|
|
@@ -1117,7 +1152,7 @@ interface RuleGroupType<R$1 extends RuleType = RuleType, C extends string = stri
|
|
|
1117
1152
|
/**
|
|
1118
1153
|
* The type of the `rules` array in a {@link RuleGroupType}.
|
|
1119
1154
|
*/
|
|
1120
|
-
type RuleGroupArray<RG
|
|
1155
|
+
type RuleGroupArray<RG extends RuleGroupType = RuleGroupType, R$1 extends RuleType = RuleType> = (R$1 | RG)[];
|
|
1121
1156
|
//#endregion
|
|
1122
1157
|
//#region ../core/src/types/ruleGroupsIC.utils.d.ts
|
|
1123
1158
|
type MAXIMUM_ALLOWED_BOUNDARY = 80;
|
|
@@ -1143,7 +1178,7 @@ type RuleGroupTypeAny<R$1 extends RuleType = RuleType, C extends string = string
|
|
|
1143
1178
|
/**
|
|
1144
1179
|
* The type of the `rules` array in a {@link RuleGroupTypeIC}.
|
|
1145
1180
|
*/
|
|
1146
|
-
type RuleGroupICArray<RG
|
|
1181
|
+
type RuleGroupICArray<RG extends RuleGroupTypeIC = RuleGroupTypeIC, R$1 extends RuleType = RuleType, C extends string = string> = [R$1 | RG] | [R$1 | RG, ...MappedTuple<[C, R$1 | RG]>] | ((R$1 | RG)[] & {
|
|
1147
1182
|
length: 0;
|
|
1148
1183
|
});
|
|
1149
1184
|
/**
|
|
@@ -1153,7 +1188,7 @@ type RuleOrGroupArray = RuleGroupArray | RuleGroupICArray;
|
|
|
1153
1188
|
/**
|
|
1154
1189
|
* Converts a narrowed rule group type to its most generic form.
|
|
1155
1190
|
*/
|
|
1156
|
-
type GenericizeRuleGroupType<RG
|
|
1191
|
+
type GenericizeRuleGroupType<RG> = RG extends RuleGroupType ? RuleGroupType : RuleGroupTypeIC;
|
|
1157
1192
|
//#endregion
|
|
1158
1193
|
//#region ../core/src/types/validation.d.ts
|
|
1159
1194
|
/**
|
|
@@ -1491,9 +1526,13 @@ interface Classnames {
|
|
|
1491
1526
|
*/
|
|
1492
1527
|
branches: Classname;
|
|
1493
1528
|
/**
|
|
1494
|
-
* Classname(s) rules that render a subquery.
|
|
1529
|
+
* Classname(s) applied to rules that render a subquery.
|
|
1495
1530
|
*/
|
|
1496
1531
|
hasSubQuery: Classname;
|
|
1532
|
+
/**
|
|
1533
|
+
* Classname(s) applied to async components in their "loading" state.
|
|
1534
|
+
*/
|
|
1535
|
+
loading: Classname;
|
|
1497
1536
|
}
|
|
1498
1537
|
/**
|
|
1499
1538
|
* Placeholder strings for option lists.
|
|
@@ -2403,15 +2442,15 @@ type QueryBuilderContextProvider<ExtraProps extends object = Record<string, any>
|
|
|
2403
2442
|
*
|
|
2404
2443
|
* @group Props
|
|
2405
2444
|
*/
|
|
2406
|
-
type QueryBuilderProps<RG
|
|
2445
|
+
type QueryBuilderProps<RG extends RuleGroupTypeAny, F extends FullField, O extends FullOperator, C extends FullCombinator> = RG extends RuleGroupType<infer R> | RuleGroupTypeIC<infer R> ? QueryBuilderContextProps<F, GetOptionIdentifierType<O>> & {
|
|
2407
2446
|
/**
|
|
2408
2447
|
* Initial query object for uncontrolled components.
|
|
2409
2448
|
*/
|
|
2410
|
-
defaultQuery?: RG
|
|
2449
|
+
defaultQuery?: RG;
|
|
2411
2450
|
/**
|
|
2412
2451
|
* Query object for controlled components.
|
|
2413
2452
|
*/
|
|
2414
|
-
query?: RG
|
|
2453
|
+
query?: RG;
|
|
2415
2454
|
/**
|
|
2416
2455
|
* List of valid {@link FullField}s.
|
|
2417
2456
|
*
|
|
@@ -2563,7 +2602,7 @@ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O ext
|
|
|
2563
2602
|
*/
|
|
2564
2603
|
getSubQueryBuilderProps?(field: GetOptionIdentifierType<F>, misc: {
|
|
2565
2604
|
fieldData: F;
|
|
2566
|
-
}): QueryBuilderProps<GenericizeRuleGroupType<RG
|
|
2605
|
+
}): QueryBuilderProps<GenericizeRuleGroupType<RG>, FullOption, FullOption, FullOption>;
|
|
2567
2606
|
/**
|
|
2568
2607
|
* The return value of this function will be used to apply classnames to the
|
|
2569
2608
|
* outer `<div>` of the given {@link Rule}.
|
|
@@ -2575,56 +2614,56 @@ type QueryBuilderProps<RG$1 extends RuleGroupTypeAny, F extends FullField, O ext
|
|
|
2575
2614
|
* The return value of this function will be used to apply classnames to the
|
|
2576
2615
|
* outer `<div>` of the given {@link RuleGroup}.
|
|
2577
2616
|
*/
|
|
2578
|
-
getRuleGroupClassname?(ruleGroup: RG
|
|
2617
|
+
getRuleGroupClassname?(ruleGroup: RG): Classname;
|
|
2579
2618
|
/**
|
|
2580
2619
|
* This callback is invoked before a new rule is added. The function should either manipulate
|
|
2581
2620
|
* the rule and return the new object, return `true` to allow the addition to proceed as normal,
|
|
2582
2621
|
* or return `false` to cancel the addition of the rule.
|
|
2583
2622
|
*/
|
|
2584
|
-
onAddRule?(rule: R, parentPath: Path, query: RG
|
|
2623
|
+
onAddRule?(rule: R, parentPath: Path, query: RG, context?: any): RuleType | boolean;
|
|
2585
2624
|
/**
|
|
2586
2625
|
* This callback is invoked before a new group is added. The function should either manipulate
|
|
2587
2626
|
* the group and return the new object, return `true` to allow the addition to proceed as normal,
|
|
2588
2627
|
* or return `false` to cancel the addition of the group.
|
|
2589
2628
|
*/
|
|
2590
|
-
onAddGroup?(ruleGroup: RG
|
|
2629
|
+
onAddGroup?(ruleGroup: RG, parentPath: Path, query: RG, context?: any): RG | boolean;
|
|
2591
2630
|
/**
|
|
2592
2631
|
* This callback is invoked before a rule is moved or shifted. The function should return
|
|
2593
2632
|
* `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
|
|
2594
2633
|
* a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2595
2634
|
* query state.
|
|
2596
2635
|
*/
|
|
2597
|
-
onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG
|
|
2636
|
+
onMoveRule?(rule: R, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
|
|
2598
2637
|
/**
|
|
2599
2638
|
* This callback is invoked before a group is moved or shifted. The function should return
|
|
2600
2639
|
* `true` to allow the move/shift to proceed as normal, `false` to cancel the move/shift, or
|
|
2601
2640
|
* a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2602
2641
|
* query state.
|
|
2603
2642
|
*/
|
|
2604
|
-
onMoveGroup?(ruleGroup: RG
|
|
2643
|
+
onMoveGroup?(ruleGroup: RG, fromPath: Path, toPath: Path | "up" | "down", query: RG, nextQuery: RG, options: MoveOptions, context?: any): RG | boolean;
|
|
2605
2644
|
/**
|
|
2606
2645
|
* This callback is invoked before a rule is grouped with another object. The function should
|
|
2607
2646
|
* return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
|
|
2608
2647
|
* or a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2609
2648
|
* query state.
|
|
2610
2649
|
*/
|
|
2611
|
-
onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG
|
|
2650
|
+
onGroupRule?(rule: R, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
|
|
2612
2651
|
/**
|
|
2613
2652
|
* This callback is invoked before a group is grouped with another object. The function should
|
|
2614
2653
|
* return `true` to allow the grouping to proceed as normal, `false` to cancel the grouping,
|
|
2615
2654
|
* or a new query object (presumably based on `query` or `nextQuery`) which will become the new
|
|
2616
2655
|
* query state.
|
|
2617
2656
|
*/
|
|
2618
|
-
onGroupGroup?(ruleGroup: RG
|
|
2657
|
+
onGroupGroup?(ruleGroup: RG, fromPath: Path, toPath: Path, query: RG, nextQuery: RG, options: GroupOptions, context?: any): RG | boolean;
|
|
2619
2658
|
/**
|
|
2620
2659
|
* This callback is invoked before a rule or group is removed. The function should return
|
|
2621
2660
|
* `true` if the rule or group should be removed or `false` if it should not be removed.
|
|
2622
2661
|
*/
|
|
2623
|
-
onRemove?(ruleOrGroup: R | RG
|
|
2662
|
+
onRemove?(ruleOrGroup: R | RG, path: Path, query: RG, context?: any): boolean;
|
|
2624
2663
|
/**
|
|
2625
2664
|
* This callback is invoked anytime the query state is updated.
|
|
2626
2665
|
*/
|
|
2627
|
-
onQueryChange?(query: RG
|
|
2666
|
+
onQueryChange?(query: RG): void;
|
|
2628
2667
|
/**
|
|
2629
2668
|
* Each log object will be passed to this function when `debugMode` is `true`.
|
|
2630
2669
|
*
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-querybuilder/bootstrap",
|
|
3
3
|
"description": "Custom Bootstrap components for react-querybuilder",
|
|
4
|
-
"version": "8.
|
|
4
|
+
"version": "8.12.0",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -55,21 +55,21 @@
|
|
|
55
55
|
"@testing-library/dom": "^10.4.1",
|
|
56
56
|
"@testing-library/react": "^16.3.0",
|
|
57
57
|
"@types/react": "^19.2.2",
|
|
58
|
-
"@vitejs/plugin-react": "^5.0
|
|
58
|
+
"@vitejs/plugin-react": "^5.1.0",
|
|
59
59
|
"bootstrap": "^5.3.8",
|
|
60
60
|
"bootstrap-icons": "^1.13.1",
|
|
61
61
|
"react": "^19.2.0",
|
|
62
62
|
"react-dom": "^19.2.0",
|
|
63
|
-
"react-querybuilder": "8.
|
|
63
|
+
"react-querybuilder": "8.12.0",
|
|
64
64
|
"rollup-plugin-visualizer": "^6.0.5",
|
|
65
65
|
"typescript": "^5.9.3",
|
|
66
|
-
"vite": "^7.1
|
|
66
|
+
"vite": "^7.2.1"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"bootstrap": ">=5",
|
|
70
70
|
"bootstrap-icons": ">=1.7.0",
|
|
71
71
|
"react": ">=18",
|
|
72
|
-
"react-querybuilder": "8.
|
|
72
|
+
"react-querybuilder": "8.12.0"
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "8166380d6819d94bb852126be60dff0852e481a3"
|
|
75
75
|
}
|