Skip to content

Commit 6091a42

Browse files
committed
Update dependencies and fix links
1 parent a7ea092 commit 6091a42

File tree

9 files changed

+1665
-1729
lines changed

9 files changed

+1665
-1729
lines changed

docs/api/import.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Use the `parseSQL` function to convert SQL `SELECT` statements into a format sui
1313
function parseSQL(sql: string, options?: ParseSQLOptions): RuleGroupTypeAny;
1414
```
1515

16-
`parseSQL` takes a SQL `SELECT` statement (either the full statement or the `WHERE` clause by itself). Try it out in the [demo](https://react-querybuilder.github.io/react-querybuilder/) by clicking the "Load from SQL" button.
16+
`parseSQL` takes a SQL `SELECT` statement (either the full statement or the `WHERE` clause by itself). Try it out in the [demo](https://react-querybuilder.js.org/react-querybuilder/) by clicking the "Load from SQL" button.
1717

1818
The optional second parameter to `parseSQL` is an options object that configures how the function handles named or anonymous bind variables within the SQL string.
1919

docs/api/misc.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function defaultValidator(query: RuleGroupType): {
2020

2121
Pass `validator={defaultValidator}` to automatically validate groups (rules will be ignored). A group will be marked invalid if either 1) it has no child rules or groups (`query.rules.length === 0`), or 2) it has a missing/invalid `combinator` and more than one child rule or group (`rules.length >= 2`).
2222

23-
You can see an example of the default validator in action in the [demo](https://react-querybuilder.github.io/react-querybuilder/) if you check the ["Use validation" option](https://react-querybuilder.github.io/react-querybuilder/#validateQuery=true). Empty groups will have bold text on their "+Rule" button and a description of the situation where the rules normally appear.
23+
You can see an example of the default validator in action in the [demo](https://react-querybuilder.js.org/react-querybuilder/) if you check the ["Use validation" option](https://react-querybuilder.js.org/react-querybuilder/#validateQuery=true). Empty groups will have bold text on their "+Rule" button and a description of the situation where the rules normally appear.
2424

2525
### `findPath`
2626

docs/api/querybuilder.mdx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -661,35 +661,35 @@ The `translations` prop is optional, and each top-level property in the `transla
661661

662662
### `showCombinatorsBetweenRules`
663663

664-
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.github.io/react-querybuilder/#showCombinatorsBetweenRules=true)
664+
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.js.org/react-querybuilder/#showCombinatorsBetweenRules=true)
665665

666666
Pass `true` to show the combinators (and/or) between rules and rule groups instead of at the top of rule groups. This can make some queries easier to understand as it encourages a more natural style of reading.
667667

668668
### `showNotToggle`
669669

670-
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.github.io/react-querybuilder/#showNotToggle=true)
670+
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.js.org/react-querybuilder/#showNotToggle=true)
671671

672672
Pass `true` to show the "Not" (aka inversion) toggle switch for each rule group.
673673

674674
### `showCloneButtons`
675675

676-
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.github.io/react-querybuilder/#showCloneButtons=true)
676+
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.js.org/react-querybuilder/#showCloneButtons=true)
677677

678678
### `showLockButtons`
679679

680-
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.github.io/react-querybuilder/#showLockButtons=true)
680+
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.js.org/react-querybuilder/#showLockButtons=true)
681681

682682
Pass `true` to show the "Lock rule" and "Lock group" buttons. When a rule is locked, all elements within the rule will be disabled (except for the lock button, so the user can unlock it). When a group is locked, all elements within the group header (except the lock button), as well as all child rule/group elements, will be disabled.
683683

684684
### `resetOnFieldChange`
685685

686-
`boolean` (default `true`) [_Click for demo with this feature disabled_](https://react-querybuilder.github.io/react-querybuilder/#resetOnFieldChange=false)
686+
`boolean` (default `true`) [_Click for demo with this feature disabled_](https://react-querybuilder.js.org/react-querybuilder/#resetOnFieldChange=false)
687687

688688
Pass `false` to avoid resetting the operator and value when the field changes.
689689

690690
### `resetOnOperatorChange`
691691

692-
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.github.io/react-querybuilder/#resetOnOperatorChange=true)
692+
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.js.org/react-querybuilder/#resetOnOperatorChange=true)
693693

694694
Pass `true` to reset the value when the operator changes.
695695

@@ -701,25 +701,25 @@ Pass `false` to disable the `onQueryChange` call on mount of the component which
701701

702702
### `autoSelectField`
703703

704-
`boolean` (default `true`) [_Click for demo with this feature disabled_](https://react-querybuilder.github.io/react-querybuilder/#autoSelectField=false)
704+
`boolean` (default `true`) [_Click for demo with this feature disabled_](https://react-querybuilder.js.org/react-querybuilder/#autoSelectField=false)
705705

706706
Pass `false` to add an empty option (`"------"`) to the `fields` array as the first element (which will be selected by default for new rules). When the empty field option is selected, the operator and value components will not display for that rule.
707707

708708
### `addRuleToNewGroups`
709709

710-
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.github.io/react-querybuilder/#addRuleToNewGroups=true)
710+
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.js.org/react-querybuilder/#addRuleToNewGroups=true)
711711

712712
Pass `true` to automatically add a rule to new groups. If a `query` prop is not passed in, a rule will be added to the root group when the component is mounted. If a `query` prop is passed in with an empty `rules` array, no rule will be added automatically.
713713

714714
### `independentCombinators`
715715

716-
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.github.io/react-querybuilder/#independentCombinators=true)
716+
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.js.org/react-querybuilder/#independentCombinators=true)
717717

718718
Pass `true` to insert an independent combinator selector between each rule/group in a rule group. The combinator selector at the group level will not be available. Visually, this is similar to the [`showCombinatorsBetweenRules`](#showcombinatorsbetweenrules) option, except that each combinator selector is independently controlled. You may find that users take to this configuration more easily, as it can allow them to express queries more like they would in natural language.
719719

720720
### `enableDragAndDrop`
721721

722-
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.github.io/react-querybuilder/#enableDragAndDrop=true)
722+
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.js.org/react-querybuilder/#enableDragAndDrop=true)
723723

724724
Pass `true` to display a drag handle to the left of each group header and rule. Clicking and dragging the handle element allows visual reordering of rules and groups.
725725

@@ -731,18 +731,18 @@ Pass `true` to display a drag handle to the left of each group header and rule.
731731

732732
### `disabled`
733733

734-
`boolean | number[][]` (default `false`) [_Click for demo_](https://react-querybuilder.github.io/react-querybuilder/#disabled=true)
734+
`boolean | number[][]` (default `false`) [_Click for demo_](https://react-querybuilder.js.org/react-querybuilder/#disabled=true)
735735

736736
Pass `true` to disable all subcomponents and prevent changes to the query. Pass an array of paths to disable specific rules and/or groups, e.g. `disabled={[[0]]}` will disable the first rule and its subcomponents but nothing else.
737737

738738
### `debugMode`
739739

740-
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.github.io/react-querybuilder/#debugMode=true)
740+
`boolean` (default `false`) [_Click for demo_](https://react-querybuilder.js.org/react-querybuilder/#debugMode=true)
741741

742742
Pass `true` to log debugging information to the console.
743743

744744
### `validator`
745745

746-
`QueryValidator` [_Click for demo_](https://react-querybuilder.github.io/react-querybuilder/#validateQuery=true)
746+
`QueryValidator` [_Click for demo_](https://react-querybuilder.js.org/react-querybuilder/#validateQuery=true)
747747

748748
This is a callback function that is executed each time `QueryBuilder` renders. The return value should be a boolean (`true` for valid queries, `false` for invalid) or an object whose keys are the `id`s of each rule and group in the query tree. If such an object is returned, the values associated to each key should be a boolean (`true` for valid rules/groups, `false` for invalid) or an object with a `valid` boolean property and an optional `reasons` array. The full object will be passed to each rule and group component, and all sub-components of each rule/group will receive the value associated with the rule's or group's `id`. See the [Validation](./validation) documentation for more information.

docs/api/validation.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ If you provide a query- or field-level validator function then the wrapper `<div
110110

111111
:::tip See it in action
112112

113-
In the [demo](https://react-querybuilder.github.io/react-querybuilder/), check the "Use validation" option and create an empty group or a text input without a value. Empty groups will show a message where the rules usually appear (using the `:after` pseudo-selector), and text fields without values will have a [purple](https://meyerweb.com/eric/thoughts/2014/06/19/rebeccapurple/) outline.
113+
In the [demo](https://react-querybuilder.js.org/react-querybuilder/), check the "Use validation" option and create an empty group or a text input without a value. Empty groups will show a message where the rules usually appear (using the `:after` pseudo-selector), and text fields without values will have a [purple](https://meyerweb.com/eric/thoughts/2014/06/19/rebeccapurple/) outline.
114114

115115
:::
116116

@@ -120,4 +120,4 @@ See the [validation section on the Export page](./export#validation) for more in
120120

121121
## Default validator
122122

123-
You can pass the provided [`defaultValidator`](./misc#defaultvalidator) to the `validator` prop to check for invalid combinators, empty groups, or (if `independentCombinators` is true) out-of-sequence `rules` arrays. The [demo](https://react-querybuilder.github.io/react-querybuilder/) uses the default validator.
123+
You can pass the provided [`defaultValidator`](./misc#defaultvalidator) to the `validator` prop to check for invalid combinators, empty groups, or (if `independentCombinators` is true) out-of-sequence `rules` arrays. The [demo](https://react-querybuilder.js.org/react-querybuilder/) uses the default validator.

docs/api/valueeditor.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This query builder has been specially configured in two ways:
1616

1717
:::tip
1818

19-
The [compatibility packages](../compat) also implement these options using appropriate components from the associated style library ([see the demo](https://react-querybuilder.github.io/react-querybuilder/)).
19+
The [compatibility packages](../compat) also implement these options using appropriate components from the associated style library ([see the demo](https://react-querybuilder.js.org/react-querybuilder/)).
2020

2121
:::
2222

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,25 @@
1616
"pretty-print": "prettier --write docs/* docs/**/* src/**/*"
1717
},
1818
"dependencies": {
19-
"@codesandbox/sandpack-react": "^0.10.6",
20-
"@docusaurus/core": "^2.0.0-beta.14",
21-
"@docusaurus/preset-classic": "^2.0.0-beta.14",
22-
"@docusaurus/theme-search-algolia": "^2.0.0-beta.14",
19+
"@codesandbox/sandpack-react": "^0.19.6",
20+
"@docusaurus/core": "2.0.0-beta.20",
21+
"@docusaurus/preset-classic": "2.0.0-beta.20",
22+
"@docusaurus/theme-search-algolia": "2.0.0-beta.20",
2323
"@mdx-js/react": "^1.6.21",
2424
"@svgr/webpack": "^6.1.2",
2525
"clsx": "^1.1.1",
2626
"docusaurus-plugin-sass": "^0.2.1",
2727
"file-loader": "^6.2.0",
2828
"prism-react-renderer": "^1.2.1",
29-
"react": "^17.0.1",
30-
"react-dom": "^17.0.1",
29+
"react": "^18.1.0",
30+
"react-dom": "^18.1.0",
3131
"react-querybuilder": "^4.0.0",
3232
"remark-typescript-tools": "^1.0.10",
3333
"sass": "^1.43.4",
3434
"url-loader": "^4.1.1"
3535
},
3636
"devDependencies": {
37-
"@docusaurus/module-type-aliases": "^2.0.0-beta.14",
37+
"@docusaurus/module-type-aliases": "2.0.0-beta.20",
3838
"@tsconfig/docusaurus": "^1.0.4",
3939
"typescript": "^4.4.4"
4040
},

src/components/SandpackRQB.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@ import { useColorMode } from '@docusaurus/theme-common';
33
import * as React from 'react';
44
import './SandpackRQB.scss';
55

6-
export const SandpackRQB: React.FC<SandpackProps> = ({ children, customSetup, options }) => {
6+
interface SandpackRQBProps extends SandpackProps {
7+
children: React.ReactNode;
8+
}
9+
10+
export const SandpackRQB = ({ children, customSetup, options }: SandpackRQBProps) => {
711
const { isDarkTheme } = useColorMode();
812
const codeSnippets = React.Children.toArray(children) as React.ReactElement[];
913
const bkgdColor = isDarkTheme ? '#343a46' : '#ffffff';
@@ -64,7 +68,7 @@ export const SandpackRQB: React.FC<SandpackProps> = ({ children, customSetup, op
6468
)
6569
? ''
6670
: `@import 'react-querybuilder/dist/query-builder.css';`;
67-
const sandboxStyle = `body { background-color: ${bkgdColor}; }`;
71+
const sandboxStyle = `body { background-color: ${bkgdColor}; } pre { padding: 1rem; background-color: white; border: 1px solid lightgray; border-radius: 4px; white-space: pre-wrap; }`;
6872

6973
files['/styles.css'] = {
7074
code: [rqbCSSimport, sandboxStyle, files['/styles.css']?.code ?? ''].join('\n\n'),

src/pages/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function HomepageHeader() {
1919
</Link>
2020
<Link
2121
className="button button--secondary button--lg"
22-
href="https://react-querybuilder.github.io/react-querybuilder">
22+
href="https://react-querybuilder.js.org/react-querybuilder">
2323
Try it out
2424
</Link>
2525
</div>

0 commit comments

Comments
 (0)