Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

- [#682] `parseCEL` processes "like" operators ("contains"/"startsWith"/"endsWith") that are negated without parentheses, like `!f1.contains(f2)`.
- [#692] `formatQuery` updates (these are probably _technically_ breaking changes, but the logic itself is equivalent to the previous version so we're considering them bug fixes):
- For the "jsonlogic" export format, the entire group structure is retained even if only one top-level child object exists.
- For the "jsonlogic", "mongodb", and "cel" formats, rules where the operator is "in" or "notIn" and the value evaluates to an empty array are retained.
- The "jsonata" format now respects the `quoteFieldNamesWith` option.

## [v7.2.0] - 2024-04-15

Expand Down Expand Up @@ -1595,6 +1599,7 @@ Maintenance release focused on converting to a monorepo with Vite driving the bu
[#671]: https://github.com/react-querybuilder/react-querybuilder/pull/671
[#677]: https://github.com/react-querybuilder/react-querybuilder/issues/677
[#682]: https://github.com/react-querybuilder/react-querybuilder/issues/682
[#692]: https://github.com/react-querybuilder/react-querybuilder/pull/692

<!-- Release comparison links -->

Expand Down
4 changes: 2 additions & 2 deletions examples/_template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"private": true,
"type": "module",
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions examples/antd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"@ant-design/icons": ">=4.7.0",
"@react-querybuilder/antd": "^7.2.0",
"antd": ">=5",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"description": "React Query Builder Ant Design Example",
Expand Down
4 changes: 2 additions & 2 deletions examples/basic-ts/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"description": "React Query Builder Basic TypeScript Example",
Expand Down
4 changes: 2 additions & 2 deletions examples/basic/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"description": "React Query Builder Basic Example",
Expand Down
4 changes: 2 additions & 2 deletions examples/bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"@react-querybuilder/bootstrap": "^7.2.0",
"bootstrap": ">=5",
"bootstrap-icons": ">=1.7.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"description": "React Query Builder Bootstrap Example",
Expand Down
4 changes: 2 additions & 2 deletions examples/bulma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"dependencies": {
"@react-querybuilder/bulma": "^7.2.0",
"bulma": "^0.9.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"description": "React Query Builder Bulma Example",
Expand Down
4 changes: 2 additions & 2 deletions examples/chakra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"@emotion/styled": "^11",
"@react-querybuilder/chakra": "^7.2.0",
"framer-motion": "^6.3.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"description": "React Query Builder Chakra UI Example",
Expand Down
4 changes: 2 additions & 2 deletions examples/ci/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"dependencies": {
"@react-querybuilder/dnd": "^7.2.0",
"react": "^18.2.0",
"react": "^18.3.1",
"react-dnd": ">=14.0.0",
"react-dnd-html5-backend": ">=14.0.0",
"react-dom": "^18.2.0",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"description": "React Query Builder CI Base",
Expand Down
4 changes: 2 additions & 2 deletions examples/dnd/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"dependencies": {
"@react-querybuilder/dnd": "^7.2.0",
"react": "^18.2.0",
"react": "^18.3.1",
"react-dnd": ">=14.0.0",
"react-dnd-html5-backend": ">=14.0.0",
"react-dom": "^18.2.0",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"description": "React Query Builder Drag-and-drop Example",
Expand Down
4 changes: 2 additions & 2 deletions examples/fluent/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"dependencies": {
"@fluentui/react-components": "^9",
"@react-querybuilder/fluent": "^7.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"description": "React Query Builder Fluent UI Example",
Expand Down
4 changes: 2 additions & 2 deletions examples/mantine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"@mantine/hooks": ">=7",
"@react-querybuilder/mantine": "^7.2.0",
"dayjs": ">=1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"description": "React Query Builder Mantine Example",
Expand Down
4 changes: 2 additions & 2 deletions examples/material/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"@mui/icons-material": ">=5.0.0",
"@mui/material": ">=5.0.0",
"@react-querybuilder/material": "^7.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"description": "React Query Builder MUI/Material Example",
Expand Down
4 changes: 2 additions & 2 deletions examples/native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"@react-native-picker/picker": "^2.4.8",
"@react-querybuilder/native": "^7.2.0",
"native-base": "^3.4.25",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-native-safe-area-context": "^4.5.0",
"react-native-web": "~0.18.12",
"react-querybuilder": "^7.2.0",
Expand Down
4 changes: 2 additions & 2 deletions examples/next/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"dependencies": {
"next": "14.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions examples/tremor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"@react-querybuilder/tremor": "^7.2.0",
"@tremor/react": "^3",
"dayjs": ">=1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0"
},
"description": "React Query Builder Tremor Example",
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,30 +79,30 @@
"website:clear": "cd website && bun run clear"
},
"devDependencies": {
"@babel/core": "^7.24.3",
"@babel/preset-env": "^7.24.3",
"@babel/core": "^7.24.5",
"@babel/preset-env": "^7.24.5",
"@babel/preset-react": "^7.24.1",
"@babel/preset-typescript": "^7.24.1",
"@react-native-picker/picker": "^2.7.2",
"@testing-library/dom": "^9.3.4",
"@testing-library/jest-dom": "^6.4.2",
"@testing-library/react": "^14.2.2",
"@react-native-picker/picker": "^2.7.5",
"@testing-library/dom": "^10.1.0",
"@testing-library/jest-dom": "^6.4.4",
"@testing-library/react": "^15.0.6",
"@testing-library/user-event": "^14.5.2",
"@types/bun": "^1.0.11",
"@types/bun": "^1.1.1",
"@types/glob": "^8.1.0",
"@types/jest": "^29.5.12",
"@types/node": "^20.11.30",
"@types/react": "^18.2.73",
"@types/react-dom": "^18.2.23",
"@types/web": "^0.0.142",
"@typescript-eslint/eslint-plugin": "^7.4.0",
"@typescript-eslint/parser": "^7.4.0",
"@types/node": "^20.12.8",
"@types/react": "^18.3.1",
"@types/react-dom": "^18.3.0",
"@types/web": "^0.0.143",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"all-contributors-cli": "^6.26.1",
"concurrently": "^8.2.2",
"esbuild-analyzer": "^0.2.0",
"eslint": "^8.57.0",
"eslint-plugin-react": "^7.34.1",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-hooks": "^4.6.2",
"fast-json-stable-stringify": "^2.1.0",
"glob": "^10.3.12",
"jest": "^29.7.0",
Expand All @@ -112,16 +112,16 @@
"native-base": "^3.4.28",
"prettier": "^3.2.5",
"prettier-plugin-organize-imports": "^3.2.4",
"react": "^18.2.0",
"react": "^18.3.1",
"react-dnd": "^16.0.1",
"react-dnd-test-backend": "^16.0.1",
"react-dnd-test-utils": "^16.0.1",
"react-dom": "^18.2.0",
"react-dom": "^18.3.1",
"regenerator-runtime": "^0.14.1",
"swc-loader": "^0.2.6",
"tsup": "^8.0.2",
"typescript": "^5.4.3",
"vite": "^5.2.7"
"typescript": "^5.4.5",
"vite": "^5.2.11"
},
"packageManager": "yarn@4.1.1"
}
18 changes: 9 additions & 9 deletions packages/antd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,18 @@
"typecheck:watch": "tsc --noEmit --watch"
},
"devDependencies": {
"@ant-design/icons": "^5.3.5",
"@testing-library/react": "^14.2.2",
"@types/react": "^18.2.73",
"@ant-design/icons": "^5.3.6",
"@testing-library/react": "^15.0.6",
"@types/react": "^18.3.1",
"@vitejs/plugin-react-swc": "^3.6.0",
"antd": "^5.15.4",
"dayjs": "^1.11.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"antd": "^5.17.0",
"dayjs": "^1.11.11",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0",
"rollup-plugin-visualizer": "^5.12.0",
"typescript": "^5.4.3",
"vite": "^5.2.7"
"typescript": "^5.4.5",
"vite": "^5.2.11"
},
"peerDependencies": {
"@ant-design/icons": ">=4.7.0",
Expand Down
56 changes: 54 additions & 2 deletions packages/antd/src/dayjs.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* This file is adapted from the following sources:
* - https://github.com/react-component/picker/blob/d526bd551778070be3295060f1b5841786cb9500/src/generate/dayjs.ts
* - https://github.com/react-component/picker/blob/d526bd551778070be3295060f1b5841786cb9500/src/generate/index.ts
*/

import type { Dayjs } from 'dayjs';
import dayjs from 'dayjs';
import advancedFormat from 'dayjs/plugin/advancedFormat.js';
Expand All @@ -6,9 +12,55 @@ import localeData from 'dayjs/plugin/localeData.js';
import weekOfYear from 'dayjs/plugin/weekOfYear.js';
import weekYear from 'dayjs/plugin/weekYear.js';
import weekday from 'dayjs/plugin/weekday.js';
import type { GenerateConfig } from 'rc-picker/lib/generate';
import { noteOnce } from 'rc-util/lib/warning';

type GenerateConfig<DateType> = {
// Get
getWeekDay: (value: DateType) => number;
getMillisecond: (value: DateType) => number;
getSecond: (value: DateType) => number;
getMinute: (value: DateType) => number;
getHour: (value: DateType) => number;
getDate: (value: DateType) => number;
getMonth: (value: DateType) => number;
getYear: (value: DateType) => number;
getNow: () => DateType;
getFixedDate: (fixed: string) => DateType;
getEndDate: (value: DateType) => DateType;

// Set
addYear: (value: DateType, diff: number) => DateType;
addMonth: (value: DateType, diff: number) => DateType;
addDate: (value: DateType, diff: number) => DateType;
setYear: (value: DateType, year: number) => DateType;
setMonth: (value: DateType, month: number) => DateType;
setDate: (value: DateType, date: number) => DateType;
setHour: (value: DateType, hour: number) => DateType;
setMinute: (value: DateType, minute: number) => DateType;
setSecond: (value: DateType, second: number) => DateType;
setMillisecond: (value: DateType, millisecond: number) => DateType;

// Compare
isAfter: (date1: DateType, date2: DateType) => boolean;
isValidate: (date: DateType) => boolean;

locale: {
getWeekFirstDay: (locale: string) => number;
getWeekFirstDate: (locale: string, value: DateType) => DateType;
getWeek: (locale: string, value: DateType) => number;

format: (locale: string, date: DateType, format: string) => string;

/** Should only return validate date instance */
parse: (locale: string, text: string, formats: string[]) => DateType | null;

/** A proxy for getting locale with moment or other locale library */
getShortWeekDays?: (locale: string) => string[];
/** A proxy for getting locale with moment or other locale library */
getShortMonths?: (locale: string) => string[];
};
};

dayjs.extend(customParseFormat);
dayjs.extend(advancedFormat);
dayjs.extend(weekday);
Expand Down Expand Up @@ -132,7 +184,7 @@ const generateConfig: GenerateConfig<Dayjs> = {
setHour: (date, hour) => date.hour(hour),
setMinute: (date, minute) => date.minute(minute),
setSecond: (date, second) => date.second(second),
setMillisecond: (date, millisecond) => date.millisecond(millisecond),
setMillisecond: (date, milliseconds) => date.millisecond(milliseconds),

// Compare
isAfter: (date1, date2) => date1.isAfter(date2),
Expand Down
12 changes: 6 additions & 6 deletions packages/bootstrap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@
},
"devDependencies": {
"@popperjs/core": "^2.11.8",
"@testing-library/react": "^14.2.2",
"@types/react": "^18.2.73",
"@testing-library/react": "^15.0.6",
"@types/react": "^18.3.1",
"@vitejs/plugin-react-swc": "^3.6.0",
"bootstrap": "^5.3.3",
"bootstrap-icons": "^1.11.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-querybuilder": "^7.2.0",
"rollup-plugin-visualizer": "^5.12.0",
"typescript": "^5.4.3",
"vite": "^5.2.7"
"typescript": "^5.4.5",
"vite": "^5.2.11"
},
"peerDependencies": {
"bootstrap": ">=5",
Expand Down
Loading