react-querybuilder
Advanced tools
Comparing version 7.0.2 to 7.1.0
@@ -1,2 +0,2 @@ | ||
import { R as RuleProcessor, V as ValueProcessorByRule, F as FormatQueryOptions, P as ParameterizedSQL, a as ParameterizedNamedSQL, b as RQBJsonLogic, E as ExportFormat, c as ValueProcessorLegacy } from './importExport-I-1mtCVZ.js'; | ||
import { R as RuleProcessor, V as ValueProcessorByRule, F as FormatQueryOptions, P as ParameterizedSQL, a as ParameterizedNamedSQL, b as RQBJsonLogic, E as ExportFormat, c as ValueProcessorLegacy } from './importExport-C0h8KkL7.js'; | ||
import { R as RuleGroupTypeAny } from './basic-CtWU1IF_.js'; | ||
@@ -3,0 +3,0 @@ import 'json-logic-js'; |
@@ -662,3 +662,3 @@ "use strict"; | ||
// src/utils/formatQuery/defaultRuleProcessorParameterized.ts | ||
var defaultRuleProcessorParameterized = (rule, opts) => { | ||
var defaultRuleProcessorParameterized = (rule, opts, meta) => { | ||
const { | ||
@@ -671,5 +671,7 @@ fieldData, | ||
paramsKeepPrefix, | ||
numberedParams, | ||
quoteFieldNamesWith = ["", ""], | ||
valueProcessor = defaultValueProcessorByRule | ||
} = opts ?? {}; | ||
const { processedParams = [] } = meta ?? {}; | ||
const parameterized = format === "parameterized"; | ||
@@ -710,3 +712,5 @@ const params = []; | ||
return finalize( | ||
`${quoteFieldNamesWith[0]}${rule.field}${quoteFieldNamesWith[1]} ${sqlOperator} (${splitValue.map(() => "?").join(", ")})` | ||
`${quoteFieldNamesWith[0]}${rule.field}${quoteFieldNamesWith[1]} ${sqlOperator} (${splitValue.map( | ||
(_v, i) => numberedParams ? `${paramPrefix}${processedParams.length + 1 + splitValue.length - (splitValue.length - i)}` : "?" | ||
).join(", ")})` | ||
); | ||
@@ -733,3 +737,3 @@ } | ||
return finalize( | ||
`${quoteFieldNamesWith[0]}${rule.field}${quoteFieldNamesWith[1]} ${sqlOperator} ? and ?` | ||
`${quoteFieldNamesWith[0]}${rule.field}${quoteFieldNamesWith[1]} ${sqlOperator} ${numberedParams ? `${paramPrefix}${processedParams.length + 1}` : "?"} and ${numberedParams ? `${paramPrefix}${processedParams.length + 2}` : "?"}` | ||
); | ||
@@ -764,3 +768,3 @@ } | ||
return finalize( | ||
`${quoteFieldNamesWith[0]}${rule.field}${quoteFieldNamesWith[1]} ${sqlOperator} ${parameterized ? "?" : `${paramPrefix}${paramName}`}`.trim() | ||
`${quoteFieldNamesWith[0]}${rule.field}${quoteFieldNamesWith[1]} ${sqlOperator} ${parameterized ? numberedParams ? `${paramPrefix}${processedParams.length + 1}` : "?" : `${paramPrefix}${paramName}`}`.trim() | ||
); | ||
@@ -931,2 +935,3 @@ }; | ||
let paramsKeepPrefix = false; | ||
let numberedParams = false; | ||
let parseNumbers = false; | ||
@@ -965,2 +970,3 @@ let placeholderFieldName = defaultPlaceholderFieldName; | ||
paramsKeepPrefix = !!options.paramsKeepPrefix; | ||
numberedParams = !!options.numberedParams; | ||
parseNumbers = !!options.parseNumbers; | ||
@@ -1093,18 +1099,25 @@ placeholderFieldName = options.placeholderFieldName ?? defaultPlaceholderFieldName; | ||
); | ||
const processedRule = (typeof ruleProcessorInternal === "function" ? ruleProcessorInternal : defaultRuleProcessorParameterized)(rule, { | ||
getNextNamedParam, | ||
fieldParamNames, | ||
parseNumbers, | ||
quoteFieldNamesWith, | ||
fieldData, | ||
format, | ||
paramPrefix, | ||
paramsKeepPrefix, | ||
fallbackExpression, | ||
valueProcessor: valueProcessorInternal, | ||
fields, | ||
placeholderFieldName, | ||
placeholderOperatorName, | ||
validator | ||
}); | ||
const processedRule = (typeof ruleProcessorInternal === "function" ? ruleProcessorInternal : defaultRuleProcessorParameterized)( | ||
rule, | ||
{ | ||
getNextNamedParam, | ||
fieldParamNames, | ||
parseNumbers, | ||
quoteFieldNamesWith, | ||
fieldData, | ||
format, | ||
paramPrefix, | ||
paramsKeepPrefix, | ||
numberedParams, | ||
fallbackExpression, | ||
valueProcessor: valueProcessorInternal, | ||
fields, | ||
placeholderFieldName, | ||
placeholderOperatorName, | ||
validator | ||
}, | ||
{ | ||
processedParams: params | ||
} | ||
); | ||
if (!isPojo(processedRule)) { | ||
@@ -1111,0 +1124,0 @@ return ""; |
import { D as DefaultRuleGroupType, a as DefaultRuleGroupTypeIC } from './basic-CtWU1IF_.js'; | ||
import { d as ParseCELOptions } from './importExport-I-1mtCVZ.js'; | ||
import { d as ParseCELOptions } from './importExport-C0h8KkL7.js'; | ||
import 'type-fest'; | ||
@@ -4,0 +4,0 @@ import 'json-logic-js'; |
import { D as DefaultRuleGroupType, a as DefaultRuleGroupTypeIC } from './basic-CtWU1IF_.js'; | ||
import { b as RQBJsonLogic, e as ParseJsonLogicOptions } from './importExport-I-1mtCVZ.js'; | ||
import { b as RQBJsonLogic, e as ParseJsonLogicOptions } from './importExport-C0h8KkL7.js'; | ||
import 'type-fest'; | ||
@@ -4,0 +4,0 @@ import 'json-logic-js'; |
import { D as DefaultRuleGroupType, a as DefaultRuleGroupTypeIC } from './basic-CtWU1IF_.js'; | ||
import { f as ParseMongoDbOptions } from './importExport-I-1mtCVZ.js'; | ||
import { f as ParseMongoDbOptions } from './importExport-C0h8KkL7.js'; | ||
import 'type-fest'; | ||
@@ -4,0 +4,0 @@ import 'json-logic-js'; |
import { D as DefaultRuleGroupType, a as DefaultRuleGroupTypeIC } from './basic-CtWU1IF_.js'; | ||
import { g as ParseSpELOptions } from './importExport-I-1mtCVZ.js'; | ||
import { g as ParseSpELOptions } from './importExport-C0h8KkL7.js'; | ||
import 'type-fest'; | ||
@@ -4,0 +4,0 @@ import 'json-logic-js'; |
import { D as DefaultRuleGroupType, a as DefaultRuleGroupTypeIC } from './basic-CtWU1IF_.js'; | ||
import { h as ParseSQLOptions } from './importExport-I-1mtCVZ.js'; | ||
import { h as ParseSQLOptions } from './importExport-C0h8KkL7.js'; | ||
import 'type-fest'; | ||
@@ -4,0 +4,0 @@ import 'json-logic-js'; |
{ | ||
"name": "react-querybuilder", | ||
"version": "7.0.2", | ||
"version": "7.1.0", | ||
"description": "The React <QueryBuilder /> component for constructing queries", | ||
@@ -86,8 +86,8 @@ "main": "./dist/cjs/index.js", | ||
"devDependencies": { | ||
"@babel/core": "^7.24.0", | ||
"@babel/preset-env": "^7.24.0", | ||
"@babel/preset-react": "^7.23.3", | ||
"@babel/preset-typescript": "^7.23.3", | ||
"@electric-sql/pglite": "^0.0.2", | ||
"@testing-library/react": "^14.2.1", | ||
"@babel/core": "^7.24.3", | ||
"@babel/preset-env": "^7.24.3", | ||
"@babel/preset-react": "^7.24.1", | ||
"@babel/preset-typescript": "^7.24.1", | ||
"@electric-sql/pglite": "^0.1.1", | ||
"@testing-library/react": "^14.2.2", | ||
"@testing-library/user-event": "^14.5.2", | ||
@@ -97,9 +97,8 @@ "@types/hoist-non-react-statics": "^3.3.5", | ||
"@types/json-logic-js": "^2.0.7", | ||
"@types/node": "^20.11.26", | ||
"@types/react": "^18.2.65", | ||
"@types/react-dom": "^18.2.21", | ||
"@types/node": "^20.11.30", | ||
"@types/react": "^18.2.73", | ||
"@types/react-dom": "^18.2.23", | ||
"@vitejs/plugin-react-swc": "^3.6.0", | ||
"babel-plugin-istanbul": "^6.1.1", | ||
"concurrently": "^8.2.2", | ||
"copyfiles": "^2.4.1", | ||
"jscodeshift": "^0.15.2", | ||
@@ -112,10 +111,10 @@ "json-logic-js": "^2.0.2", | ||
"rollup-plugin-visualizer": "^5.12.0", | ||
"sass": "1.71.1", | ||
"sass": "^1.72.0", | ||
"spel2js": "^0.2.8", | ||
"type-fest": "^4.12.0", | ||
"typescript": "^5.4.2", | ||
"vite": "^5.1.6" | ||
"type-fest": "^4.14.0", | ||
"typescript": "^5.4.3", | ||
"vite": "^5.2.7" | ||
}, | ||
"dependencies": { | ||
"@reduxjs/toolkit": "^2.2.1", | ||
"@reduxjs/toolkit": "^2.2.2", | ||
"clsx": "^2.1.0", | ||
@@ -127,3 +126,3 @@ "immer": "^10.0.4", | ||
"peerDependencies": { | ||
"react": ">=16.8.0" | ||
"react": ">=18" | ||
}, | ||
@@ -133,7 +132,8 @@ "browserslist": "> 0.25%, not dead", | ||
"start": "bunx --bun vite", | ||
"build": "tsup && bun run build:css", | ||
"build:css": "copyfiles --flat src/*.scss dist && bun x sass dist/query-builder-layout.scss dist/query-builder-layout.css && bun x sass dist/query-builder.scss dist/query-builder.css", | ||
"build": "bun run build:main && bun run build:css", | ||
"build:main": "tsup", | ||
"build:css": "bun buildCSS.ts", | ||
"typecheck": "tsc --noEmit", | ||
"typecheck:watch": "tsc --noEmit --watch", | ||
"generate:parsers": "concurrently --timings --names sqlParser,celParser bun:generate:sqlparser bun:generate:celparser && bun generate:parsers-codemod", | ||
"generate:parsers": "concurrently --group --timings --names sqlParser,celParser bun:generate:sqlparser bun:generate:celparser && bun generate:parsers-codemod", | ||
"generate:sqlparser": "bun x jison src/utils/parseSQL/sql.jison --outfile src/utils/parseSQL/sqlParser.js --module-type commonjs", | ||
@@ -143,3 +143,3 @@ "generate:celparser": "bun x jison src/utils/parseCEL/cel.jison --outfile src/utils/parseCEL/celParser.js --module-type commonjs", | ||
}, | ||
"gitHead": "9ce2ce38dc792ef1630b8543e290d3ff20011a30" | ||
"gitHead": "853546b1d9c2f81aa35d868956fb9091b8cff11d" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4488329
28
31969
Updated@reduxjs/toolkit@^2.2.2