Skip to content

Commit 9a0d4e7

Browse files
committed
Add docs page about compatibility packages
1 parent 45d09ba commit 9a0d4e7

File tree

3 files changed

+51
-35
lines changed

3 files changed

+51
-35
lines changed

docs/compat.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Compatibility packages
3+
---
4+
5+
The default React Query Builder components, being basic HTML5 form controls, are very flexible with styling (primarily through the [`controlClassnames` prop](./api/querybuilder#controlclassnames)). But some style libraries require different HTML structure to style their form controls correctly.
6+
7+
Official components compatible with several popular style libraries are available under the [`@react-querybuilder` org on npm](https://www.npmjs.com/org/react-querybuilder). Current supported libraries include:
8+
9+
- [Bootstrap](https://getbootstrap.com/) ([@react-querybuilder/bootstrap](https://www.npmjs.com/package/@react-querybuilder/bootstrap))
10+
- [Ant Design](https://ant.design/) ([@react-querybuilder/antd](https://www.npmjs.com/package/@react-querybuilder/antd))
11+
- [Bulma](https://bulma.io/) ([@react-querybuilder/bulma](https://www.npmjs.com/package/@react-querybuilder/bulma))
12+
- [Chakra UI](https://chakra-ui.com/) ([@react-querybuilder/chakra](https://www.npmjs.com/package/@react-querybuilder/chakra))
13+
- [MUI](https://mui.com/) ([@react-querybuilder/material](https://www.npmjs.com/package/@react-querybuilder/material))
14+
15+
You can see each alternate component package in action by selecting different options in the "Style" dropdown list on the [demo page](https://react-querybuilder.js.org/react-querybuilder/).

docs/typescript.mdx

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -53,41 +53,6 @@ type RuleGroupTypeAny = RuleGroupType | RuleGroupTypeIC;
5353
type RuleOrGroupArray =
5454
| (RuleType | RuleGroupType)[]
5555
| (RuleType | RuleGroupTypeIC | string)[];
56-
57-
interface Schema {
58-
fields: Field[];
59-
fieldMap: { [k: string]: Field };
60-
classNames: Classnames;
61-
combinators: NameLabelPair[];
62-
controls: Controls;
63-
createRule(): RuleType;
64-
createRuleGroup(): RuleGroupTypeAny;
65-
getOperators(field: string): NameLabelPair[];
66-
getValueEditorType(field: string, operator: string): ValueEditorType;
67-
getInputType(field: string, operator: string): string | null;
68-
getValues(field: string, operator: string): NameLabelPair[];
69-
isRuleGroup(
70-
ruleOrGroup: RuleType | RuleGroupTypeAny
71-
): ruleOrGroup is RuleGroupTypeAny;
72-
onGroupAdd(group: RuleGroupTypeAny, parentPath: number[]): void;
73-
onGroupRemove(path: number[]): void;
74-
onPropChange(
75-
prop: Exclude<keyof RuleType | keyof RuleGroupType, "id" | "path">,
76-
value: any,
77-
path: number[]
78-
): void;
79-
onRuleAdd(rule: RuleType, parentPath: number[]): void;
80-
onRuleRemove(path: number[]): void;
81-
updateIndependentCombinator(value: string, path: number[]): void;
82-
showCombinatorsBetweenRules: boolean;
83-
showNotToggle: boolean;
84-
showCloneButtons: boolean;
85-
autoSelectField: boolean;
86-
addRuleToNewGroups: boolean;
87-
enableDragAndDrop: boolean;
88-
validationMap: ValidationMap;
89-
independentCombinators: boolean;
90-
}
9156
```
9257

9358
## Export
@@ -162,4 +127,39 @@ interface NameLabelPair {
162127
}
163128

164129
type ValueEditorType = "text" | "select" | "checkbox" | "radio" | null;
130+
131+
interface Schema {
132+
fields: Field[];
133+
fieldMap: { [k: string]: Field };
134+
classNames: Classnames;
135+
combinators: NameLabelPair[];
136+
controls: Controls;
137+
createRule(): RuleType;
138+
createRuleGroup(): RuleGroupTypeAny;
139+
getOperators(field: string): NameLabelPair[];
140+
getValueEditorType(field: string, operator: string): ValueEditorType;
141+
getInputType(field: string, operator: string): string | null;
142+
getValues(field: string, operator: string): NameLabelPair[];
143+
isRuleGroup(
144+
ruleOrGroup: RuleType | RuleGroupTypeAny
145+
): ruleOrGroup is RuleGroupTypeAny;
146+
onGroupAdd(group: RuleGroupTypeAny, parentPath: number[]): void;
147+
onGroupRemove(path: number[]): void;
148+
onPropChange(
149+
prop: Exclude<keyof RuleType | keyof RuleGroupType, "id" | "path">,
150+
value: any,
151+
path: number[]
152+
): void;
153+
onRuleAdd(rule: RuleType, parentPath: number[]): void;
154+
onRuleRemove(path: number[]): void;
155+
updateIndependentCombinator(value: string, path: number[]): void;
156+
showCombinatorsBetweenRules: boolean;
157+
showNotToggle: boolean;
158+
showCloneButtons: boolean;
159+
autoSelectField: boolean;
160+
addRuleToNewGroups: boolean;
161+
enableDragAndDrop: boolean;
162+
validationMap: ValidationMap;
163+
independentCombinators: boolean;
164+
}
165165
```

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ const sidebars = {
3636
"tips/common-mistakes",
3737
],
3838
},
39+
"compat",
3940
"typescript",
4041
],
4142
};

0 commit comments

Comments
 (0)