@react-querybuilder/core 8.11.2 → 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-CLG_Bmom.d.mts → basic-DbvrfPNz.d.mts} +39 -4
- package/dist/{basic-BeKPP0_1.d.ts → 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 +118 -52
- package/dist/cjs/react-querybuilder_core.cjs.development.js +13 -28
- package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
- package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +118 -52
- 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-C7NvB0XA.js → convertQuery-DuY_BJHy.js} +3 -3
- package/dist/{convertQuery-C7NvB0XA.js.map → convertQuery-DuY_BJHy.js.map} +1 -1
- package/dist/{export-B2Yw5gak.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 +2 -2
- package/dist/formatQuery.d.ts +2 -2
- package/dist/formatQuery.js +5 -5
- package/dist/formatQuery.mjs +1 -1
- package/dist/{import-Dvayhrgj.d.ts → import-BSWb9Vgd.d.ts} +2 -2
- package/dist/{import-BtpySRSy.d.mts → import-CLyHpgk8.d.mts} +2 -2
- 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 +2 -2
- package/dist/parseCEL.d.ts +2 -2
- package/dist/parseCEL.js +16 -6
- package/dist/parseCEL.js.map +1 -1
- package/dist/parseCEL.mjs +12 -1
- 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/parseJsonLogic.d.mts +3 -3
- package/dist/parseJsonLogic.d.ts +3 -3
- package/dist/parseJsonLogic.js +4 -4
- package/dist/parseMongoDB.d.mts +2 -2
- package/dist/parseMongoDB.d.ts +2 -2
- package/dist/parseMongoDB.js +4 -4
- package/dist/parseSQL.d.mts +2 -2
- package/dist/parseSQL.d.ts +2 -2
- package/dist/parseSQL.js +4 -5
- package/dist/parseSQL.js.map +1 -1
- package/dist/parseSpEL.d.mts +2 -2
- package/dist/parseSpEL.d.ts +2 -2
- package/dist/parseSpEL.js +6 -5
- package/dist/parseSpEL.js.map +1 -1
- package/dist/{prepareQueryObjects-Cz_28zYz.js → prepareQueryObjects-DCtJJrF5.js} +4 -4
- package/dist/{prepareQueryObjects-Cz_28zYz.js.map → prepareQueryObjects-DCtJJrF5.js.map} +1 -1
- package/dist/react-querybuilder_core.d.mts +118 -52
- package/dist/react-querybuilder_core.legacy-esm.d.ts +118 -52
- package/dist/react-querybuilder_core.legacy-esm.js +20 -10
- package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
- package/dist/react-querybuilder_core.mjs +13 -3
- package/dist/react-querybuilder_core.mjs.map +1 -1
- package/dist/react-querybuilder_core.production.d.mts +118 -52
- package/dist/react-querybuilder_core.production.mjs +1 -1
- package/dist/react-querybuilder_core.production.mjs.map +1 -1
- package/dist/{transformQuery-C85j__7e.mjs → transformQuery-Bq4iyYsE.mjs} +8 -1
- package/dist/{transformQuery-C85j__7e.mjs.map → transformQuery-Bq4iyYsE.mjs.map} +1 -1
- package/dist/{transformQuery-B4SaTTO-.js → transformQuery-DvJTAvkh.js} +10 -3
- package/dist/{transformQuery-B4SaTTO-.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 +1 -1
- package/dist/{utils-Dkz3Xn2D.js → utils-CoYbYnVo.js} +3 -4
- package/dist/utils-CoYbYnVo.js.map +1 -0
- package/dist/utils-DxH23QtE.mjs.map +1 -1
- package/package.json +11 -11
- package/dist/utils-Dkz3Xn2D.js.map +0 -1
|
@@ -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,GACzE;AAGN,2BAAe,KAAI,UAAS;EAC1B,IAAI,SAAS;AAGb,SAAO,SAAS,MAAM,MAAM,SAAS,GAAG;AACtC,OAAI,aAAa,MAAM,MAAM,SAAS,IAAI,eAAe,EAAE;AACzD,cAAU;AACV;;GAGF,MAAM,0BAA0B,MAAM,MAAM,WACzC,GAAG,MAAM,IAAI,UAAU,OAAO,MAAM,YAAYA,uBAAG,EAAE,KAAK,eAC5D;AAED,OAAI,4BAA4B,IAAI;AAElC,UAAM,MAAM,OACV,QACA,MAAM,MAAM,QACZ,6CAEE,EAAE,OAAO,MAAM,MAAM,MAAM,OAAO,EAAS,EAC3C,sBAAsB,EACvB,CACF;AACD;SAGA,OAAM,MAAM,OACV,QACA,0BAA0B,QAC1B,6CAEE,EAAE,OAAO,MAAM,MAAM,MAAM,QAAQ,wBAAwB,EAAS,EACpE,sBAAsB,EACvB,CACF;;GAGL;;;;;;;;;;AAWJ,MAAa,iBACX,OACO;AACP,KAAIC,oCAAgB,GAAG,CACrB,QAAO;CAET,MAAM,cAAc,6CAA6C,GAAG;CACpE,MAAM,mBAAmB,YAAY,MAAM,KAAI,MAC7C,OAAO,MAAM,YAAY,CAACC,gCAAY,EAAE,GAAG,IAAI,cAAc,EAAE,CAChE;CACD,MAAM,aAAa,iBAAiB,SAAS,IAAI,QAAS,iBAAiB;CAC3E,MAAM,QAAQ,iBAAiB,QAAO,MAAK,OAAO,MAAM,SAAS;AACjE,QAAO;EAAE,GAAG;EAAa;EAAY;EAAO;;;;;;;;;;AAW9C,MAAa,eACX,OACS;AACT,KAAIC,sCAAkB,GAAG,CACvB,QAAO;CAET,MAAM,EAAE,WAAY,GAAG,2BAA2B;CAClD,MAAMC,QAAiD,EAAE;CACzD,MAAM,EAAE,WAAW,GAAG;AACtB,MAAK,MAAM,CAAC,KAAK,MAAM,GAAG,MAAM,SAAS,EAAE;AACzC,MAAIF,gCAAY,EAAE,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,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
|
|
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
|
|
package/dist/formatQuery.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
2
|
-
const require_utils = require('./utils-
|
|
3
|
-
const
|
|
4
|
-
const
|
|
1
|
+
const require_chunk = require('./chunk-BxBTb9qk.js');
|
|
2
|
+
const require_utils = require('./utils-CoYbYnVo.js');
|
|
3
|
+
const require_isRuleGroup = require('./isRuleGroup-Do9KKsmt.js');
|
|
4
|
+
const require_transformQuery = require('./transformQuery-DvJTAvkh.js');
|
|
5
|
+
const require_convertQuery = require('./convertQuery-DuY_BJHy.js');
|
|
5
6
|
let immer = require("immer");
|
|
6
|
-
immer = require_isRuleGroup.__toESM(immer);
|
|
7
7
|
|
|
8
8
|
//#region src/utils/isRuleOrGroupValid.ts
|
|
9
9
|
/**
|
package/dist/formatQuery.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { E as parseNumber, M as defaultPlaceholderOperatorName, O as toArray, S as toFlatOptionArray, _ as shouldRenderAsNumber, a as getNLTranslataion, c as isValidValue, d as mapSQLOperator, f as mongoOperators, g as processMatchMode, h as prismaOperators, i as defaultNLTranslations, j as defaultPlaceholderFieldName, k as trimIfString, l as isValueProcessorLegacy, m as numerifyValues, n as bigIntJsonStringifyReplacer, o as getQuoteFieldNamesWithArray, p as normalizeConstituentWordOrder, r as celCombinatorMap, s as getQuotedFieldName, t as bigIntJsonParseReviver, u as jsonLogicAdditionalOperators, v as getParseNumberMethod, w as toFullOptionList, y as getOption } from "./utils-DxH23QtE.mjs";
|
|
2
2
|
import { a as lc, i as isPojo, n as isRuleGroupType, o as nullOrUndefinedOrEmpty, r as isRuleGroupTypeIC, t as isRuleGroup } from "./isRuleGroup-BcfwGaIN.mjs";
|
|
3
|
-
import { t as transformQuery } from "./transformQuery-
|
|
3
|
+
import { t as transformQuery } from "./transformQuery-Bq4iyYsE.mjs";
|
|
4
4
|
import { t as convertFromIC } from "./convertQuery-Cj4t-LT4.mjs";
|
|
5
5
|
import { produce } from "immer";
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as ValueSources, t as FullField, x as OptionList } from "./basic-
|
|
1
|
+
import { o as ValueSources, t as FullField, x as OptionList } from "./basic-o1-sYjK6.js";
|
|
2
2
|
|
|
3
3
|
//#region src/types/import.d.ts
|
|
4
4
|
|
|
@@ -25,4 +25,4 @@ interface ParserCommonOptions {
|
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
27
|
export { ParserCommonOptions as t };
|
|
28
|
-
//# sourceMappingURL=import-
|
|
28
|
+
//# sourceMappingURL=import-BSWb9Vgd.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as ValueSources, t as FullField, x as OptionList } from "./basic-
|
|
1
|
+
import { o as ValueSources, t as FullField, x as OptionList } from "./basic-DbvrfPNz.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/types/import.d.ts
|
|
4
4
|
|
|
@@ -25,4 +25,4 @@ interface ParserCommonOptions {
|
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
27
|
export { ParserCommonOptions as t };
|
|
28
|
-
//# sourceMappingURL=import-
|
|
28
|
+
//# sourceMappingURL=import-CLyHpgk8.d.mts.map
|
|
@@ -1,31 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13
|
-
key = keys[i];
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
-
get: ((k) => from[k]).bind(null, key),
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
-
value: mod,
|
|
23
|
-
enumerable: true
|
|
24
|
-
}) : target, mod));
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
1
|
+
const require_chunk = require('./chunk-BxBTb9qk.js');
|
|
27
2
|
let numeric_quantity = require("numeric-quantity");
|
|
28
|
-
numeric_quantity = __toESM(numeric_quantity);
|
|
29
3
|
|
|
30
4
|
//#region src/utils/misc.ts
|
|
31
5
|
/**
|
|
@@ -63,18 +37,6 @@ const isRuleGroupType = (rg) => isRuleGroup(rg) && typeof rg.combinator === "str
|
|
|
63
37
|
const isRuleGroupTypeIC = (rg) => isRuleGroup(rg) && rg.combinator === void 0;
|
|
64
38
|
|
|
65
39
|
//#endregion
|
|
66
|
-
Object.defineProperty(exports, '__commonJS', {
|
|
67
|
-
enumerable: true,
|
|
68
|
-
get: function () {
|
|
69
|
-
return __commonJS;
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
Object.defineProperty(exports, '__toESM', {
|
|
73
|
-
enumerable: true,
|
|
74
|
-
get: function () {
|
|
75
|
-
return __toESM;
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
40
|
Object.defineProperty(exports, 'isPojo', {
|
|
79
41
|
enumerable: true,
|
|
80
42
|
get: function () {
|
|
@@ -117,4 +79,4 @@ Object.defineProperty(exports, 'numericRegex', {
|
|
|
117
79
|
return numericRegex;
|
|
118
80
|
}
|
|
119
81
|
});
|
|
120
|
-
//# sourceMappingURL=isRuleGroup-
|
|
82
|
+
//# sourceMappingURL=isRuleGroup-Do9KKsmt.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isRuleGroup-
|
|
1
|
+
{"version":3,"file":"isRuleGroup-Do9KKsmt.js","names":["numericRegex: RegExp","numericQuantityRegex"],"sources":["../src/utils/misc.ts","../src/utils/isRuleGroup.ts"],"sourcesContent":["import { numericRegex as numericQuantityRegex } from 'numeric-quantity';\n\n/**\n * Converts a value to lowercase if it's a string, otherwise returns the value as is.\n */\n// istanbul ignore next\nexport const lc = <T>(v: T): T => (typeof v === 'string' ? (v.toLowerCase() as T) : v);\n\n/**\n * Regex matching numeric strings. Passes for positive/negative integers, decimals,\n * and E notation, with optional surrounding whitespace.\n */\nexport const numericRegex: RegExp = new RegExp(\n numericQuantityRegex.source.replace(/^\\^/, String.raw`^\\s*`).replace(/\\$$/, String.raw`\\s*$`)\n);\n\n/**\n * Determines if a variable is a plain old JavaScript object, aka POJO.\n */\n// oxlint-disable-next-line typescript/no-explicit-any\nexport const isPojo = (obj: any): obj is Record<string, any> =>\n obj === null || typeof obj !== 'object' ? false : Object.getPrototypeOf(obj) === Object.prototype;\n\n/**\n * Simple helper to determine whether a value is null, undefined, or an empty string.\n */\nexport const nullOrUndefinedOrEmpty = (value: unknown): value is null | undefined | '' =>\n value === null || value === undefined || value === '';\n","import type { RuleGroupType, RuleGroupTypeAny, RuleGroupTypeIC, RuleType } from '../types';\nimport { isPojo } from './misc';\n\n/**\n * Determines if an object is a {@link RuleType} (only checks for a `field` property).\n */\nexport const isRuleType = (s: unknown): s is RuleType =>\n isPojo(s) && 'field' in s && typeof s.field === 'string';\n\n/**\n * Determines if an object is a {@link RuleGroupType} or {@link RuleGroupTypeIC}.\n */\nexport const isRuleGroup = (rg: unknown): rg is RuleGroupTypeAny =>\n isPojo(rg) && Array.isArray(rg.rules);\n\n/**\n * Determines if an object is a {@link RuleGroupType}.\n */\nexport const isRuleGroupType = (rg: unknown): rg is RuleGroupType =>\n isRuleGroup(rg) && typeof rg.combinator === 'string';\n\n/**\n * Determines if an object is a {@link RuleGroupTypeIC}.\n */\nexport const isRuleGroupTypeIC = (rg: unknown): rg is RuleGroupTypeIC =>\n isRuleGroup(rg) && rg.combinator === undefined;\n"],"mappings":";;;;;;;;AAMA,MAAa,MAAS,MAAa,OAAO,MAAM,WAAY,EAAE,aAAa,GAAS;;;;;AAMpF,MAAaA,eAAuB,IAAI,OACtCC,8BAAqB,OAAO,QAAQ,OAAO,OAAO,GAAG,OAAO,CAAC,QAAQ,OAAO,OAAO,GAAG,OAAO,CAC9F;;;;AAMD,MAAa,UAAU,QACrB,QAAQ,QAAQ,OAAO,QAAQ,WAAW,QAAQ,OAAO,eAAe,IAAI,KAAK,OAAO;;;;AAK1F,MAAa,0BAA0B,UACrC,UAAU,QAAQ,UAAU,UAAa,UAAU;;;;;;;ACfrD,MAAa,eAAe,OAC1B,OAAO,GAAG,IAAI,MAAM,QAAQ,GAAG,MAAM;;;;AAKvC,MAAa,mBAAmB,OAC9B,YAAY,GAAG,IAAI,OAAO,GAAG,eAAe;;;;AAK9C,MAAa,qBAAqB,OAChC,YAAY,GAAG,IAAI,GAAG,eAAe"}
|
package/dist/parseCEL.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Except, _ as RuleGroupType, d as DefaultRuleGroupTypeIC, g as DefaultRuleGroupType, h as DefaultOperatorName, m as DefaultCombinatorName, p as RuleGroupTypeIC, v as RuleType } from "./basic-
|
|
2
|
-
import { t as ParserCommonOptions } from "./import-
|
|
1
|
+
import { C as Except, _ as RuleGroupType, d as DefaultRuleGroupTypeIC, g as DefaultRuleGroupType, h as DefaultOperatorName, m as DefaultCombinatorName, p as RuleGroupTypeIC, v as RuleType } from "./basic-DbvrfPNz.mjs";
|
|
2
|
+
import { t as ParserCommonOptions } from "./import-CLyHpgk8.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/parseCEL/types.d.ts
|
|
5
5
|
type CELExpressionType = "Addition" | "BooleanLiteral" | "BytesLiteral" | "ConditionalAnd" | "ConditionalExpr" | "ConditionalOr" | "Division" | "DynamicPropertyAccessor" | "ExpressionGroup" | "ExpressionList" | "FieldInit" | "FieldInits" | "FieldsObject" | "FloatLiteral" | "FunctionCall" | "Identifier" | "IntegerLiteral" | "List" | "Map" | "MapInit" | "MapInits" | "Member" | "Modulo" | "Multiplication" | "Negation" | "Negative" | "NullLiteral" | "Property" | "Relation" | "StringLiteral" | "Subtraction" | "Unary" | "UnsignedIntegerLiteral" | "LikeExpression" | "SubqueryExpression";
|
package/dist/parseCEL.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { C as Except, _ as RuleGroupType, d as DefaultRuleGroupTypeIC, g as DefaultRuleGroupType, h as DefaultOperatorName, m as DefaultCombinatorName, p as RuleGroupTypeIC, v as RuleType } from "./basic-
|
|
2
|
-
import { t as ParserCommonOptions } from "./import-
|
|
1
|
+
import { C as Except, _ as RuleGroupType, d as DefaultRuleGroupTypeIC, g as DefaultRuleGroupType, h as DefaultOperatorName, m as DefaultCombinatorName, p as RuleGroupTypeIC, v as RuleType } from "./basic-o1-sYjK6.js";
|
|
2
|
+
import { t as ParserCommonOptions } from "./import-BSWb9Vgd.js";
|
|
3
3
|
|
|
4
4
|
//#region src/utils/parseCEL/types.d.ts
|
|
5
5
|
type CELExpressionType = "Addition" | "BooleanLiteral" | "BytesLiteral" | "ConditionalAnd" | "ConditionalExpr" | "ConditionalOr" | "Division" | "DynamicPropertyAccessor" | "ExpressionGroup" | "ExpressionList" | "FieldInit" | "FieldInits" | "FieldsObject" | "FloatLiteral" | "FunctionCall" | "Identifier" | "IntegerLiteral" | "List" | "Map" | "MapInit" | "MapInits" | "Member" | "Modulo" | "Multiplication" | "Negation" | "Negative" | "NullLiteral" | "Property" | "Relation" | "StringLiteral" | "Subtraction" | "Unary" | "UnsignedIntegerLiteral" | "LikeExpression" | "SubqueryExpression";
|
package/dist/parseCEL.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
const
|
|
2
|
-
const require_utils = require('./utils-
|
|
3
|
-
const
|
|
1
|
+
const require_chunk = require('./chunk-BxBTb9qk.js');
|
|
2
|
+
const require_utils = require('./utils-CoYbYnVo.js');
|
|
3
|
+
const require_isRuleGroup = require('./isRuleGroup-Do9KKsmt.js');
|
|
4
|
+
const require_prepareQueryObjects = require('./prepareQueryObjects-DCtJJrF5.js');
|
|
4
5
|
let __ts_jison_parser = require("@ts-jison/parser");
|
|
5
|
-
__ts_jison_parser = require_isRuleGroup.__toESM(__ts_jison_parser);
|
|
6
6
|
let __ts_jison_lexer = require("@ts-jison/lexer");
|
|
7
|
-
__ts_jison_lexer = require_isRuleGroup.__toESM(__ts_jison_lexer);
|
|
8
7
|
|
|
9
8
|
//#region src/utils/parseCEL/celParser.ts
|
|
10
9
|
/**
|
|
@@ -2172,7 +2171,18 @@ const transformAliasInExpressionInternal = (expr, alias, isPrimitive) => {
|
|
|
2172
2171
|
value: ""
|
|
2173
2172
|
};
|
|
2174
2173
|
if (isCELMember(expr) && expr.left && isCELIdentifier(expr.left) && expr.left.value === alias) {
|
|
2175
|
-
if (expr.right && isCELIdentifier(expr.right) && !isPrimitive)
|
|
2174
|
+
if (expr.right && isCELIdentifier(expr.right) && !isPrimitive) {
|
|
2175
|
+
if (expr.list) return {
|
|
2176
|
+
type: "Member",
|
|
2177
|
+
left: {
|
|
2178
|
+
type: "Identifier",
|
|
2179
|
+
value: ""
|
|
2180
|
+
},
|
|
2181
|
+
right: expr.right,
|
|
2182
|
+
list: expr.list
|
|
2183
|
+
};
|
|
2184
|
+
return expr.right;
|
|
2185
|
+
}
|
|
2176
2186
|
}
|
|
2177
2187
|
if (isCELLikeExpression(expr) && isCELIdentifier(expr.left) && expr.left.value === alias) return {
|
|
2178
2188
|
type: "Member",
|