@react-querybuilder/core 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/{basic-BeKPP0_1.d.ts → basic-DbvrfPNz.d.mts} +39 -4
- package/dist/{basic-B4vXboTG.d.mts → basic-o1-sYjK6.d.ts} +39 -4
- package/dist/chunk-BxBTb9qk.js +39 -0
- package/dist/chunk-DrjzjjTJ.mjs +23 -0
- package/dist/chunk-Dv2ph0Ay.js +23 -0
- package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +131 -53
- package/dist/cjs/react-querybuilder_core.cjs.development.js +36 -39
- package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +131 -53
- package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
- package/dist/{convertQuery-CqX3rPvj.mjs → convertQuery-Cj4t-LT4.mjs} +2 -2
- package/dist/{convertQuery-CqX3rPvj.mjs.map → convertQuery-Cj4t-LT4.mjs.map} +1 -1
- package/dist/{convertQuery-DAqoID3O.js → convertQuery-DuY_BJHy.js} +3 -3
- package/dist/{convertQuery-DAqoID3O.js.map → convertQuery-DuY_BJHy.js.map} +1 -1
- package/dist/{export-BjRt-qrK.d.mts → export-CCULKoP4.d.mts} +2 -2
- package/dist/{export-CQB0nuvW.d.ts → export-WDHFbiPz.d.ts} +2 -2
- package/dist/formatQuery.d.mts +15 -3
- package/dist/formatQuery.d.ts +15 -3
- package/dist/formatQuery.js +172 -425
- package/dist/formatQuery.js.map +1 -1
- package/dist/formatQuery.mjs +4 -257
- package/dist/formatQuery.mjs.map +1 -1
- package/dist/{import-Dvayhrgj.d.ts → import-BSWb9Vgd.d.ts} +2 -2
- package/dist/{import-Bc_p8ls9.d.mts → import-CLyHpgk8.d.mts} +2 -2
- package/dist/{isRuleGroup-CYcfPgbg.mjs → isRuleGroup-BcfwGaIN.mjs} +1 -1
- package/dist/{isRuleGroup-CYcfPgbg.mjs.map → isRuleGroup-BcfwGaIN.mjs.map} +1 -1
- package/dist/{isRuleGroup-DqAs2x4E.js → isRuleGroup-Do9KKsmt.js} +2 -40
- package/dist/{isRuleGroup-DqAs2x4E.js.map → isRuleGroup-Do9KKsmt.js.map} +1 -1
- package/dist/parseCEL.d.mts +32 -7
- package/dist/parseCEL.d.ts +32 -7
- package/dist/parseCEL.js +181 -12
- package/dist/parseCEL.js.map +1 -1
- package/dist/parseCEL.mjs +174 -8
- package/dist/parseCEL.mjs.map +1 -1
- package/dist/parseJSONata.d.mts +2 -2
- package/dist/parseJSONata.d.ts +2 -2
- package/dist/parseJSONata.js +6 -5
- package/dist/parseJSONata.js.map +1 -1
- package/dist/parseJSONata.mjs +3 -3
- package/dist/parseJsonLogic.d.mts +3 -3
- package/dist/parseJsonLogic.d.ts +3 -3
- package/dist/parseJsonLogic.js +10 -11
- package/dist/parseJsonLogic.js.map +1 -1
- package/dist/parseJsonLogic.mjs +4 -5
- package/dist/parseJsonLogic.mjs.map +1 -1
- package/dist/parseMongoDB.d.mts +2 -2
- package/dist/parseMongoDB.d.ts +2 -2
- package/dist/parseMongoDB.js +20 -21
- package/dist/parseMongoDB.js.map +1 -1
- package/dist/parseMongoDB.mjs +4 -5
- package/dist/parseMongoDB.mjs.map +1 -1
- package/dist/parseSQL.d.mts +2 -2
- package/dist/parseSQL.d.ts +2 -2
- package/dist/parseSQL.js +10 -13
- package/dist/parseSQL.js.map +1 -1
- package/dist/parseSQL.mjs +3 -5
- package/dist/parseSQL.mjs.map +1 -1
- package/dist/parseSpEL.d.mts +2 -2
- package/dist/parseSpEL.d.ts +2 -2
- package/dist/parseSpEL.js +7 -7
- package/dist/parseSpEL.js.map +1 -1
- package/dist/parseSpEL.mjs +3 -4
- package/dist/parseSpEL.mjs.map +1 -1
- package/dist/{prepareQueryObjects-DPCC-iHp.mjs → prepareQueryObjects-BfnyRV5t.mjs} +4 -3
- package/dist/{prepareQueryObjects-DPCC-iHp.mjs.map → prepareQueryObjects-BfnyRV5t.mjs.map} +1 -1
- package/dist/{prepareQueryObjects-BOUWfel5.js → prepareQueryObjects-DCtJJrF5.js} +14 -13
- package/dist/prepareQueryObjects-DCtJJrF5.js.map +1 -0
- package/dist/react-querybuilder_core.d.mts +131 -53
- package/dist/react-querybuilder_core.legacy-esm.d.ts +131 -53
- package/dist/react-querybuilder_core.legacy-esm.js +43 -21
- package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_core.mjs +36 -14
- package/dist/react-querybuilder_core.mjs.map +1 -1
- package/dist/react-querybuilder_core.production.d.mts +131 -53
- package/dist/react-querybuilder_core.production.mjs +1 -1
- package/dist/react-querybuilder_core.production.mjs.map +1 -1
- package/dist/{transformQuery-DCCpjtyq.mjs → transformQuery-Bq4iyYsE.mjs} +9 -2
- package/dist/{transformQuery-DCCpjtyq.mjs.map → transformQuery-Bq4iyYsE.mjs.map} +1 -1
- package/dist/{transformQuery-CWDPogO5.js → transformQuery-DvJTAvkh.js} +10 -3
- package/dist/{transformQuery-CWDPogO5.js.map → transformQuery-DvJTAvkh.js.map} +1 -1
- package/dist/transformQuery.d.mts +1 -1
- package/dist/transformQuery.d.ts +1 -1
- package/dist/transformQuery.js +2 -2
- package/dist/transformQuery.mjs +2 -2
- package/dist/utils-CoYbYnVo.js +706 -0
- package/dist/utils-CoYbYnVo.js.map +1 -0
- package/dist/utils-DxH23QtE.mjs +514 -0
- package/dist/utils-DxH23QtE.mjs.map +1 -0
- package/package.json +15 -15
- package/dist/arrayUtils-A_OXU9W1.mjs +0 -50
- package/dist/arrayUtils-A_OXU9W1.mjs.map +0 -1
- package/dist/arrayUtils-QxZOZTf6.js +0 -73
- package/dist/arrayUtils-QxZOZTf6.js.map +0 -1
- package/dist/optGroupUtils-B0hTpodo.js +0 -251
- package/dist/optGroupUtils-B0hTpodo.js.map +0 -1
- package/dist/optGroupUtils-VeZ3k7-1.mjs +0 -185
- package/dist/optGroupUtils-VeZ3k7-1.mjs.map +0 -1
- package/dist/parseNumber-CXdMVNFx.mjs +0 -24
- package/dist/parseNumber-CXdMVNFx.mjs.map +0 -1
- package/dist/parseNumber-D4iQDxK-.js +0 -31
- package/dist/parseNumber-D4iQDxK-.js.map +0 -1
- package/dist/prepareQueryObjects-BOUWfel5.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as lc, n as isRuleGroupType, r as isRuleGroupTypeIC, t as isRuleGroup } from "./isRuleGroup-
|
|
1
|
+
import { a as lc, n as isRuleGroupType, r as isRuleGroupTypeIC, t as isRuleGroup } from "./isRuleGroup-BcfwGaIN.mjs";
|
|
2
2
|
import { produce } from "immer";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/convertQuery.ts
|
|
@@ -72,4 +72,4 @@ const convertToIC = (rg) => {
|
|
|
72
72
|
|
|
73
73
|
//#endregion
|
|
74
74
|
export { convertToIC as n, convertFromIC as t };
|
|
75
|
-
//# sourceMappingURL=convertQuery-
|
|
75
|
+
//# sourceMappingURL=convertQuery-Cj4t-LT4.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertQuery-
|
|
1
|
+
{"version":3,"file":"convertQuery-Cj4t-LT4.mjs","names":["rules: (RuleGroupTypeIC | RuleType | string)[]"],"sources":["../src/utils/convertQuery.ts"],"sourcesContent":["import { produce } from 'immer';\nimport type {\n RuleGroupArray,\n RuleGroupType,\n RuleGroupTypeAny,\n RuleGroupTypeIC,\n RuleType,\n} from '../types';\nimport { isRuleGroup, isRuleGroupType, isRuleGroupTypeIC } from './isRuleGroup';\nimport { lc } from './misc';\n\nconst combinatorLevels = ['or', 'xor', 'and'] as const;\n\nconst isSameString = (a: unknown, b: string) => lc(a) === b;\n\nconst generateRuleGroupICWithConsistentCombinators = (\n rg: RuleGroupTypeIC,\n baseCombinatorLevel: number = 0\n): RuleGroupTypeIC => {\n const baseCombinator = combinatorLevels[baseCombinatorLevel];\n\n // oxlint-disable-next-line typescript/no-explicit-any\n if (!rg.rules.includes(baseCombinator as any)) {\n // No instances of this combinator, so group based on the next\n // combinator level if at least two levels remain\n return baseCombinatorLevel < combinatorLevels.length - 2\n ? generateRuleGroupICWithConsistentCombinators(rg, baseCombinatorLevel + 1)\n : rg;\n }\n\n return produce(rg, draft => {\n let cursor = 0;\n\n // Group all chains of combinators in the rule array that are not the base combinator\n while (cursor < draft.rules.length - 2) {\n if (isSameString(draft.rules[cursor + 1], baseCombinator)) {\n cursor += 2;\n continue;\n }\n\n const nextBaseCombinatorIndex = draft.rules.findIndex(\n (r, i) => i > cursor && typeof r === 'string' && lc(r) === baseCombinator\n );\n\n if (nextBaseCombinatorIndex === -1) {\n // No more instances of this combinator, so group all remaining rules and exit the loop\n draft.rules.splice(\n cursor,\n draft.rules.length,\n generateRuleGroupICWithConsistentCombinators(\n // oxlint-disable-next-line typescript/no-explicit-any\n { rules: draft.rules.slice(cursor) as any },\n baseCombinatorLevel + 1\n )\n );\n break;\n } else {\n // Group all rules between the current cursor and the next instance of the base combinator\n draft.rules.splice(\n cursor,\n nextBaseCombinatorIndex - cursor,\n generateRuleGroupICWithConsistentCombinators(\n // oxlint-disable-next-line typescript/no-explicit-any\n { rules: draft.rules.slice(cursor, nextBaseCombinatorIndex) as any },\n baseCombinatorLevel + 1\n )\n );\n }\n }\n });\n};\n\n/**\n * Converts a {@link RuleGroupTypeIC} to {@link RuleGroupType}.\n *\n * This function is idempotent: {@link RuleGroupType} queries will be\n * returned as-is.\n *\n * @group Query Tools\n */\nexport const convertFromIC = <RG extends RuleGroupType = RuleGroupType>(\n rg: RuleGroupTypeAny\n): RG => {\n if (isRuleGroupType(rg)) {\n return rg as RG;\n }\n const processedRG = generateRuleGroupICWithConsistentCombinators(rg);\n const rulesAsMixedList = processedRG.rules.map(r =>\n typeof r === 'string' || !isRuleGroup(r) ? r : convertFromIC(r)\n );\n const combinator = rulesAsMixedList.length < 2 ? 'and' : (rulesAsMixedList[1] as string);\n const rules = rulesAsMixedList.filter(r => typeof r !== 'string') as RuleGroupArray;\n return { ...processedRG, combinator, rules } as RG;\n};\n\n/**\n * Converts a {@link RuleGroupType} to {@link RuleGroupTypeIC}.\n *\n * This function is idempotent: {@link RuleGroupTypeIC} queries will be\n * returned as-is.\n *\n * @group Query Tools\n */\nexport const convertToIC = <RGIC extends RuleGroupTypeIC = RuleGroupTypeIC>(\n rg: RuleGroupTypeAny\n): RGIC => {\n if (isRuleGroupTypeIC(rg)) {\n return rg as RGIC;\n }\n const { combinator, ...queryWithoutCombinator } = rg;\n const rules: (RuleGroupTypeIC | RuleType | string)[] = [];\n const { length } = rg.rules;\n for (const [idx, r] of rg.rules.entries()) {\n if (isRuleGroup(r)) {\n rules.push(convertToIC(r));\n } else {\n rules.push(r);\n }\n if (combinator && idx < length - 1) {\n rules.push(combinator);\n }\n }\n return { ...queryWithoutCombinator, rules } as RGIC;\n};\n\n/**\n * Converts a {@link RuleGroupType} to {@link RuleGroupTypeIC}. For a more explicit\n * operation, use {@link convertToIC}.\n *\n * @group Query Tools\n */\nfunction convertQuery(query: RuleGroupType): RuleGroupTypeIC;\n/**\n * Converts a {@link RuleGroupTypeIC} to {@link RuleGroupType}. For a more explicit\n * operation, use {@link convertFromIC}.\n *\n * @group Query Tools\n */\nfunction convertQuery(query: RuleGroupTypeIC): RuleGroupType;\nfunction convertQuery(query: RuleGroupType | RuleGroupTypeIC): RuleGroupType | RuleGroupTypeIC {\n return isRuleGroupTypeIC(query) ? convertFromIC(query) : convertToIC(query);\n}\n\nexport { convertQuery };\n"],"mappings":";;;;AAWA,MAAM,mBAAmB;CAAC;CAAM;CAAO;CAAM;AAE7C,MAAM,gBAAgB,GAAY,MAAc,GAAG,EAAE,KAAK;AAE1D,MAAM,gDACJ,IACA,sBAA8B,MACV;CACpB,MAAM,iBAAiB,iBAAiB;AAGxC,KAAI,CAAC,GAAG,MAAM,SAAS,eAAsB,CAG3C,QAAO,sBAA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,CAChB,OAAM,KAAK,YAAY,EAAE,CAAC;MAE1B,OAAM,KAAK,EAAE;AAEf,MAAI,cAAc,MAAM,SAAS,EAC/B,OAAM,KAAK,WAAW;;AAG1B,QAAO;EAAE,GAAG;EAAwB;EAAO"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_chunk = require('./chunk-BxBTb9qk.js');
|
|
2
|
+
const require_isRuleGroup = require('./isRuleGroup-Do9KKsmt.js');
|
|
2
3
|
let immer = require("immer");
|
|
3
|
-
immer = require_isRuleGroup.__toESM(immer);
|
|
4
4
|
|
|
5
5
|
//#region src/utils/convertQuery.ts
|
|
6
6
|
const combinatorLevels = [
|
|
@@ -84,4 +84,4 @@ Object.defineProperty(exports, 'convertToIC', {
|
|
|
84
84
|
return convertToIC;
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
|
-
//# sourceMappingURL=convertQuery-
|
|
87
|
+
//# sourceMappingURL=convertQuery-DuY_BJHy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convertQuery-
|
|
1
|
+
{"version":3,"file":"convertQuery-DuY_BJHy.js","names":["lc","isRuleGroupType","isRuleGroup","isRuleGroupTypeIC","rules: (RuleGroupTypeIC | RuleType | string)[]"],"sources":["../src/utils/convertQuery.ts"],"sourcesContent":["import { produce } from 'immer';\nimport type {\n RuleGroupArray,\n RuleGroupType,\n RuleGroupTypeAny,\n RuleGroupTypeIC,\n RuleType,\n} from '../types';\nimport { isRuleGroup, isRuleGroupType, isRuleGroupTypeIC } from './isRuleGroup';\nimport { lc } from './misc';\n\nconst combinatorLevels = ['or', 'xor', 'and'] as const;\n\nconst isSameString = (a: unknown, b: string) => lc(a) === b;\n\nconst generateRuleGroupICWithConsistentCombinators = (\n rg: RuleGroupTypeIC,\n baseCombinatorLevel: number = 0\n): RuleGroupTypeIC => {\n const baseCombinator = combinatorLevels[baseCombinatorLevel];\n\n // oxlint-disable-next-line typescript/no-explicit-any\n if (!rg.rules.includes(baseCombinator as any)) {\n // No instances of this combinator, so group based on the next\n // combinator level if at least two levels remain\n return baseCombinatorLevel < combinatorLevels.length - 2\n ? generateRuleGroupICWithConsistentCombinators(rg, baseCombinatorLevel + 1)\n : rg;\n }\n\n return produce(rg, draft => {\n let cursor = 0;\n\n // Group all chains of combinators in the rule array that are not the base combinator\n while (cursor < draft.rules.length - 2) {\n if (isSameString(draft.rules[cursor + 1], baseCombinator)) {\n cursor += 2;\n continue;\n }\n\n const nextBaseCombinatorIndex = draft.rules.findIndex(\n (r, i) => i > cursor && typeof r === 'string' && lc(r) === baseCombinator\n );\n\n if (nextBaseCombinatorIndex === -1) {\n // No more instances of this combinator, so group all remaining rules and exit the loop\n draft.rules.splice(\n cursor,\n draft.rules.length,\n generateRuleGroupICWithConsistentCombinators(\n // oxlint-disable-next-line typescript/no-explicit-any\n { rules: draft.rules.slice(cursor) as any },\n baseCombinatorLevel + 1\n )\n );\n break;\n } else {\n // Group all rules between the current cursor and the next instance of the base combinator\n draft.rules.splice(\n cursor,\n nextBaseCombinatorIndex - cursor,\n generateRuleGroupICWithConsistentCombinators(\n // oxlint-disable-next-line typescript/no-explicit-any\n { rules: draft.rules.slice(cursor, nextBaseCombinatorIndex) as any },\n baseCombinatorLevel + 1\n )\n );\n }\n }\n });\n};\n\n/**\n * Converts a {@link RuleGroupTypeIC} to {@link RuleGroupType}.\n *\n * This function is idempotent: {@link RuleGroupType} queries will be\n * returned as-is.\n *\n * @group Query Tools\n */\nexport const convertFromIC = <RG extends RuleGroupType = RuleGroupType>(\n rg: RuleGroupTypeAny\n): RG => {\n if (isRuleGroupType(rg)) {\n return rg as RG;\n }\n const processedRG = generateRuleGroupICWithConsistentCombinators(rg);\n const rulesAsMixedList = processedRG.rules.map(r =>\n typeof r === 'string' || !isRuleGroup(r) ? r : convertFromIC(r)\n );\n const combinator = rulesAsMixedList.length < 2 ? 'and' : (rulesAsMixedList[1] as string);\n const rules = rulesAsMixedList.filter(r => typeof r !== 'string') as RuleGroupArray;\n return { ...processedRG, combinator, rules } as RG;\n};\n\n/**\n * Converts a {@link RuleGroupType} to {@link RuleGroupTypeIC}.\n *\n * This function is idempotent: {@link RuleGroupTypeIC} queries will be\n * returned as-is.\n *\n * @group Query Tools\n */\nexport const convertToIC = <RGIC extends RuleGroupTypeIC = RuleGroupTypeIC>(\n rg: RuleGroupTypeAny\n): RGIC => {\n if (isRuleGroupTypeIC(rg)) {\n return rg as RGIC;\n }\n const { combinator, ...queryWithoutCombinator } = rg;\n const rules: (RuleGroupTypeIC | RuleType | string)[] = [];\n const { length } = rg.rules;\n for (const [idx, r] of rg.rules.entries()) {\n if (isRuleGroup(r)) {\n rules.push(convertToIC(r));\n } else {\n rules.push(r);\n }\n if (combinator && idx < length - 1) {\n rules.push(combinator);\n }\n }\n return { ...queryWithoutCombinator, rules } as RGIC;\n};\n\n/**\n * Converts a {@link RuleGroupType} to {@link RuleGroupTypeIC}. For a more explicit\n * operation, use {@link convertToIC}.\n *\n * @group Query Tools\n */\nfunction convertQuery(query: RuleGroupType): RuleGroupTypeIC;\n/**\n * Converts a {@link RuleGroupTypeIC} to {@link RuleGroupType}. For a more explicit\n * operation, use {@link convertFromIC}.\n *\n * @group Query Tools\n */\nfunction convertQuery(query: RuleGroupTypeIC): RuleGroupType;\nfunction convertQuery(query: RuleGroupType | RuleGroupTypeIC): RuleGroupType | RuleGroupTypeIC {\n return isRuleGroupTypeIC(query) ? convertFromIC(query) : convertToIC(query);\n}\n\nexport { convertQuery };\n"],"mappings":";;;;;AAWA,MAAM,mBAAmB;CAAC;CAAM;CAAO;CAAM;AAE7C,MAAM,gBAAgB,GAAY,MAAcA,uBAAG,EAAE,KAAK;AAE1D,MAAM,gDACJ,IACA,sBAA8B,MACV;CACpB,MAAM,iBAAiB,iBAAiB;AAGxC,KAAI,CAAC,GAAG,MAAM,SAAS,eAAsB,CAG3C,QAAO,sBAAsB,iBAAiB,SAAS,IACnD,6CAA6C,IAAI,sBAAsB,EAAE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,KAAK,EAAE;AAEf,MAAI,cAAc,MAAM,SAAS,EAC/B,OAAM,KAAK,WAAW;;AAG1B,QAAO;EAAE,GAAG;EAAwB;EAAO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Except, a as ValueSource, b as FullOptionList, c as RuleValidator, f as RuleGroupTypeAny, h as DefaultOperatorName, i as ParseNumbersPropConfig, l as ValidationMap, n as FullOperator, r as InputType, s as QueryValidator, t as FullField, u as ValidationResult, v as RuleType, y as FlexibleOptionList } from "./basic-
|
|
1
|
+
import { C as Except, a as ValueSource, b as FullOptionList, c as RuleValidator, f as RuleGroupTypeAny, h as DefaultOperatorName, i as ParseNumbersPropConfig, l as ValidationMap, n as FullOperator, r as InputType, s as QueryValidator, t as FullField, u as ValidationResult, v as RuleType, y as FlexibleOptionList } from "./basic-DbvrfPNz.mjs";
|
|
2
2
|
import { RulesLogic } from "json-logic-js";
|
|
3
3
|
|
|
4
4
|
//#region src/types/export.d.ts
|
|
@@ -449,4 +449,4 @@ type NLTranslationKey = "and" | "or" | "true" | "false" | `groupPrefix${ZeroOrMo
|
|
|
449
449
|
type NLTranslations = Partial<Record<NLTranslationKey, string>>;
|
|
450
450
|
//#endregion
|
|
451
451
|
export { ValueProcessorOptions as _, FormatQueryOptions as a, NLTranslations as c, RQBJsonLogic as d, RuleGroupProcessor as f, ValueProcessorLegacy as g, ValueProcessorByRule as h, ExportOperatorMap as i, ParameterizedNamedSQL as l, SQLPreset as m, ExportFormat as n, GroupVariantCondition as o, RuleProcessor as p, ExportObjectFormats as r, NLTranslationKey as s, ConstituentWordOrder as t, ParameterizedSQL as u };
|
|
452
|
-
//# sourceMappingURL=export-
|
|
452
|
+
//# sourceMappingURL=export-CCULKoP4.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as Except, a as ValueSource, b as FullOptionList, c as RuleValidator, f as RuleGroupTypeAny, h as DefaultOperatorName, i as ParseNumbersPropConfig, l as ValidationMap, n as FullOperator, r as InputType, s as QueryValidator, t as FullField, u as ValidationResult, v as RuleType, y as FlexibleOptionList } from "./basic-
|
|
1
|
+
import { C as Except, a as ValueSource, b as FullOptionList, c as RuleValidator, f as RuleGroupTypeAny, h as DefaultOperatorName, i as ParseNumbersPropConfig, l as ValidationMap, n as FullOperator, r as InputType, s as QueryValidator, t as FullField, u as ValidationResult, v as RuleType, y as FlexibleOptionList } from "./basic-o1-sYjK6.js";
|
|
2
2
|
import { RulesLogic } from "json-logic-js";
|
|
3
3
|
|
|
4
4
|
//#region src/types/export.d.ts
|
|
@@ -449,4 +449,4 @@ type NLTranslationKey = "and" | "or" | "true" | "false" | `groupPrefix${ZeroOrMo
|
|
|
449
449
|
type NLTranslations = Partial<Record<NLTranslationKey, string>>;
|
|
450
450
|
//#endregion
|
|
451
451
|
export { ValueProcessorOptions as _, FormatQueryOptions as a, NLTranslations as c, RQBJsonLogic as d, RuleGroupProcessor as f, ValueProcessorLegacy as g, ValueProcessorByRule as h, ExportOperatorMap as i, ParameterizedNamedSQL as l, SQLPreset as m, ExportFormat as n, GroupVariantCondition as o, RuleProcessor as p, ExportObjectFormats as r, NLTranslationKey as s, ConstituentWordOrder as t, ParameterizedSQL as u };
|
|
452
|
-
//# sourceMappingURL=export-
|
|
452
|
+
//# sourceMappingURL=export-WDHFbiPz.d.ts.map
|
package/dist/formatQuery.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SetRequired, f as RuleGroupTypeAny, v as RuleType } from "./basic-
|
|
2
|
-
import { _ as ValueProcessorOptions, a as FormatQueryOptions, c as NLTranslations, d as RQBJsonLogic, f as RuleGroupProcessor, g as ValueProcessorLegacy, h as ValueProcessorByRule, i as ExportOperatorMap, l as ParameterizedNamedSQL, m as SQLPreset, n as ExportFormat, o as GroupVariantCondition, p as RuleProcessor, r as ExportObjectFormats, s as NLTranslationKey, t as ConstituentWordOrder, u as ParameterizedSQL } from "./export-
|
|
1
|
+
import { S as SetRequired, f as RuleGroupTypeAny, v as RuleType } from "./basic-DbvrfPNz.mjs";
|
|
2
|
+
import { _ as ValueProcessorOptions, a as FormatQueryOptions, c as NLTranslations, d as RQBJsonLogic, f as RuleGroupProcessor, g as ValueProcessorLegacy, h as ValueProcessorByRule, i as ExportOperatorMap, l as ParameterizedNamedSQL, m as SQLPreset, n as ExportFormat, o as GroupVariantCondition, p as RuleProcessor, r as ExportObjectFormats, s as NLTranslationKey, t as ConstituentWordOrder, u as ParameterizedSQL } from "./export-CCULKoP4.mjs";
|
|
3
3
|
import { Column, Operators, SQL, Table } from "drizzle-orm";
|
|
4
4
|
import { WhereOptions } from "sequelize";
|
|
5
5
|
|
|
@@ -598,7 +598,19 @@ type ProcessedMatchMode = {
|
|
|
598
598
|
mode: "exactly";
|
|
599
599
|
threshold: number;
|
|
600
600
|
};
|
|
601
|
-
|
|
601
|
+
/**
|
|
602
|
+
* Transforms
|
|
603
|
+
* - `match: { mode: "atLeast", threshold: 1 }` to `match: { mode: "some" }`
|
|
604
|
+
* - `match: { mode: "atMost", threshold: 0 }` to `match: { mode: "none" }`.
|
|
605
|
+
*
|
|
606
|
+
* Returns:
|
|
607
|
+
* - Processed `{ mode, threshold }` object for valid subqueries
|
|
608
|
+
* - `null` if match mode is not applicable for the rule
|
|
609
|
+
* - `false` if match mode is valid, but either
|
|
610
|
+
* 1. `threshold` is required and invalid, or
|
|
611
|
+
* 2. `value` is not a valid rule group.
|
|
612
|
+
*/
|
|
613
|
+
declare const processMatchMode: (rule: RuleType) => null | false | ProcessedMatchMode;
|
|
602
614
|
/**
|
|
603
615
|
* "Replacer" method for JSON.stringify's second argument. Converts `bigint` values to
|
|
604
616
|
* objects with a `$bigint` property having a value of a string representation of
|
package/dist/formatQuery.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SetRequired, f as RuleGroupTypeAny, v as RuleType } from "./basic-
|
|
2
|
-
import { _ as ValueProcessorOptions, a as FormatQueryOptions, c as NLTranslations, d as RQBJsonLogic, f as RuleGroupProcessor, g as ValueProcessorLegacy, h as ValueProcessorByRule, i as ExportOperatorMap, l as ParameterizedNamedSQL, m as SQLPreset, n as ExportFormat, o as GroupVariantCondition, p as RuleProcessor, r as ExportObjectFormats, s as NLTranslationKey, t as ConstituentWordOrder, u as ParameterizedSQL } from "./export-
|
|
1
|
+
import { S as SetRequired, f as RuleGroupTypeAny, v as RuleType } from "./basic-o1-sYjK6.js";
|
|
2
|
+
import { _ as ValueProcessorOptions, a as FormatQueryOptions, c as NLTranslations, d as RQBJsonLogic, f as RuleGroupProcessor, g as ValueProcessorLegacy, h as ValueProcessorByRule, i as ExportOperatorMap, l as ParameterizedNamedSQL, m as SQLPreset, n as ExportFormat, o as GroupVariantCondition, p as RuleProcessor, r as ExportObjectFormats, s as NLTranslationKey, t as ConstituentWordOrder, u as ParameterizedSQL } from "./export-WDHFbiPz.js";
|
|
3
3
|
import { Column, Operators, SQL, Table } from "drizzle-orm";
|
|
4
4
|
import { WhereOptions } from "sequelize";
|
|
5
5
|
|
|
@@ -598,7 +598,19 @@ type ProcessedMatchMode = {
|
|
|
598
598
|
mode: "exactly";
|
|
599
599
|
threshold: number;
|
|
600
600
|
};
|
|
601
|
-
|
|
601
|
+
/**
|
|
602
|
+
* Transforms
|
|
603
|
+
* - `match: { mode: "atLeast", threshold: 1 }` to `match: { mode: "some" }`
|
|
604
|
+
* - `match: { mode: "atMost", threshold: 0 }` to `match: { mode: "none" }`.
|
|
605
|
+
*
|
|
606
|
+
* Returns:
|
|
607
|
+
* - Processed `{ mode, threshold }` object for valid subqueries
|
|
608
|
+
* - `null` if match mode is not applicable for the rule
|
|
609
|
+
* - `false` if match mode is valid, but either
|
|
610
|
+
* 1. `threshold` is required and invalid, or
|
|
611
|
+
* 2. `value` is not a valid rule group.
|
|
612
|
+
*/
|
|
613
|
+
declare const processMatchMode: (rule: RuleType) => null | false | ProcessedMatchMode;
|
|
602
614
|
/**
|
|
603
615
|
* "Replacer" method for JSON.stringify's second argument. Converts `bigint` values to
|
|
604
616
|
* objects with a `$bigint` property having a value of a string representation of
|