@react-querybuilder/core 8.15.0 → 8.16.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.
Files changed (84) hide show
  1. package/README.md +114 -53
  2. package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +89 -16
  3. package/dist/cjs/react-querybuilder_core.cjs.development.js +402 -19
  4. package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
  5. package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +89 -16
  6. package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -1
  7. package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
  8. package/dist/formatQuery.d.mts +67 -2
  9. package/dist/formatQuery.d.ts +67 -2
  10. package/dist/formatQuery.js +402 -19
  11. package/dist/formatQuery.js.map +1 -1
  12. package/dist/formatQuery.mjs +396 -20
  13. package/dist/formatQuery.mjs.map +1 -1
  14. package/dist/{import-0wp72lLT.d.mts → import-BHlzBLM_.d.mts} +2 -2
  15. package/dist/{import-yRVJh7E1.d.ts → import-C6imciDf.d.ts} +2 -2
  16. package/dist/{index-D5TXNIzF.d.ts → index-Cjapnb-H.d.ts} +14 -7
  17. package/dist/{index-Lht_Wq3V.d.mts → index-D-Iej37L.d.mts} +14 -7
  18. package/dist/parseCEL.d.mts +2 -2
  19. package/dist/parseCEL.d.ts +2 -2
  20. package/dist/parseCEL.js.map +1 -1
  21. package/dist/parseCEL.mjs.map +1 -1
  22. package/dist/parseCypher.d.mts +49 -0
  23. package/dist/parseCypher.d.ts +49 -0
  24. package/dist/parseCypher.js +578 -0
  25. package/dist/parseCypher.js.map +1 -0
  26. package/dist/parseCypher.mjs +575 -0
  27. package/dist/parseCypher.mjs.map +1 -0
  28. package/dist/parseGremlin.d.mts +35 -0
  29. package/dist/parseGremlin.d.ts +35 -0
  30. package/dist/parseGremlin.js +192 -0
  31. package/dist/parseGremlin.js.map +1 -0
  32. package/dist/parseGremlin.mjs +191 -0
  33. package/dist/parseGremlin.mjs.map +1 -0
  34. package/dist/parseJSONata.d.mts +2 -2
  35. package/dist/parseJSONata.d.ts +2 -2
  36. package/dist/parseJSONata.js.map +1 -1
  37. package/dist/parseJSONata.mjs.map +1 -1
  38. package/dist/parseJsonLogic.d.mts +2 -2
  39. package/dist/parseJsonLogic.d.ts +2 -2
  40. package/dist/parseJsonLogic.js.map +1 -1
  41. package/dist/parseJsonLogic.mjs.map +1 -1
  42. package/dist/parseMongoDB.d.mts +2 -2
  43. package/dist/parseMongoDB.d.ts +2 -2
  44. package/dist/parseMongoDB.js.map +1 -1
  45. package/dist/parseMongoDB.mjs.map +1 -1
  46. package/dist/parseSPARQL.d.mts +34 -0
  47. package/dist/parseSPARQL.d.ts +34 -0
  48. package/dist/parseSPARQL.js +253 -0
  49. package/dist/parseSPARQL.js.map +1 -0
  50. package/dist/parseSPARQL.mjs +251 -0
  51. package/dist/parseSPARQL.mjs.map +1 -0
  52. package/dist/parseSQL.d.mts +2 -2
  53. package/dist/parseSQL.d.ts +2 -2
  54. package/dist/parseSQL.js.map +1 -1
  55. package/dist/parseSQL.mjs.map +1 -1
  56. package/dist/parseSpEL.d.mts +2 -2
  57. package/dist/parseSpEL.d.ts +2 -2
  58. package/dist/parseSpEL.js.map +1 -1
  59. package/dist/parseSpEL.mjs.map +1 -1
  60. package/dist/prepareQueryObjects-BoG5Rt8z.js.map +1 -1
  61. package/dist/prepareQueryObjects-uA10ZpZX.mjs.map +1 -1
  62. package/dist/react-querybuilder_core.d.mts +89 -16
  63. package/dist/react-querybuilder_core.legacy-esm.d.ts +89 -16
  64. package/dist/react-querybuilder_core.legacy-esm.js +408 -27
  65. package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
  66. package/dist/react-querybuilder_core.mjs +396 -20
  67. package/dist/react-querybuilder_core.mjs.map +1 -1
  68. package/dist/react-querybuilder_core.production.d.mts +89 -16
  69. package/dist/react-querybuilder_core.production.mjs +1 -1
  70. package/dist/react-querybuilder_core.production.mjs.map +1 -1
  71. package/dist/transformQuery.d.mts +1 -1
  72. package/dist/transformQuery.d.ts +1 -1
  73. package/formatQuery/package.json +1 -1
  74. package/package.json +47 -3
  75. package/parseCEL/package.json +1 -1
  76. package/parseCypher/package.json +4 -0
  77. package/parseGremlin/package.json +4 -0
  78. package/parseJSONata/package.json +1 -1
  79. package/parseJsonLogic/package.json +1 -1
  80. package/parseMongoDB/package.json +1 -1
  81. package/parseSPARQL/package.json +4 -0
  82. package/parseSQL/package.json +1 -1
  83. package/parseSpEL/package.json +1 -1
  84. package/transformQuery/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { b as ValueSources, k as OptionList, y as FullField } from "./index-Lht_Wq3V.mjs";
1
+ import { b as ValueSources, k as OptionList, y as FullField } from "./index-D-Iej37L.mjs";
2
2
 
3
3
  //#region src/types/import.d.ts
4
4
  /**
@@ -24,4 +24,4 @@ interface ParserCommonOptions {
24
24
  }
25
25
  //#endregion
26
26
  export { ParserCommonOptions as t };
27
- //# sourceMappingURL=import-0wp72lLT.d.mts.map
27
+ //# sourceMappingURL=import-BHlzBLM_.d.mts.map
@@ -1,4 +1,4 @@
1
- import { b as ValueSources, k as OptionList, y as FullField } from "./index-D5TXNIzF.js";
1
+ import { b as ValueSources, k as OptionList, y as FullField } from "./index-Cjapnb-H.js";
2
2
 
3
3
  //#region src/types/import.d.ts
4
4
  /**
@@ -24,4 +24,4 @@ interface ParserCommonOptions {
24
24
  }
25
25
  //#endregion
26
26
  export { ParserCommonOptions as t };
27
- //# sourceMappingURL=import-yRVJh7E1.d.ts.map
27
+ //# sourceMappingURL=import-C6imciDf.d.ts.map
@@ -2,7 +2,7 @@ import { RulesLogic } from "json-logic-js";
2
2
 
3
3
  //#region ../../node_modules/type-fest/source/union-to-intersection.d.ts
4
4
  /**
5
- Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
5
+ Convert a union type to an intersection type.
6
6
 
7
7
  Inspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153).
8
8
 
@@ -899,7 +899,7 @@ type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Requ
899
899
  //#endregion
900
900
  //#region ../../node_modules/type-fest/source/set-required.d.ts
901
901
  /**
902
- Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type.
902
+ Create a type that makes the given keys required, while keeping the remaining keys as is.
903
903
 
904
904
  Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required.
905
905
 
@@ -925,8 +925,8 @@ type ArrayExample = SetRequired<[number?, number?, number?], 0 | 1>;
925
925
  */
926
926
  type SetRequired<BaseType, Keys extends keyof BaseType> = (BaseType extends ((...arguments_: never) => any) ? (...arguments_: Parameters<BaseType>) => ReturnType<BaseType> : unknown) & _SetRequired<BaseType, Keys>;
927
927
  type _SetRequired<BaseType, Keys extends keyof BaseType> = BaseType extends UnknownArray ? SetArrayRequired<BaseType, Keys> extends infer ResultantArray ? If<IsArrayReadonly<BaseType>, Readonly<ResultantArray>, ResultantArray> : never : Simplify< // Pick just the keys that are optional from the base type.
928
- Except<BaseType, Keys> & // Pick the keys that should be required from the base type and make them required.
929
- Required<HomomorphicPick<BaseType, Keys>>>;
928
+ Except<BaseType, Keys> // Pick the keys that should be required from the base type and make them required.
929
+ & Required<HomomorphicPick<BaseType, Keys>>>;
930
930
  /**
931
931
  Remove the optional modifier from the specified keys in an array.
932
932
  */
@@ -1072,7 +1072,7 @@ interface CommonRuleAndGroupProperties {
1072
1072
  * The main rule type. The `field`, `operator`, and `value` properties
1073
1073
  * can be narrowed with generics.
1074
1074
  */
1075
- interface RuleType<F extends string = string, O extends string = string, V = any, C extends string = string> extends CommonRuleAndGroupProperties {
1075
+ interface RuleType<F extends string = string, O extends string = string, V = any, C extends string = string, M = Record<string, any>> extends CommonRuleAndGroupProperties {
1076
1076
  field: F;
1077
1077
  operator: O;
1078
1078
  value: V;
@@ -1082,6 +1082,13 @@ interface RuleType<F extends string = string, O extends string = string, V = any
1082
1082
  * Only used when adding a rule to a query that uses independent combinators.
1083
1083
  */
1084
1084
  combinatorPreceding?: C;
1085
+ /**
1086
+ * Opaque metadata for use by extension packages. The core library
1087
+ * preserves this property but does not read or interpret it.
1088
+ * Extensions like `@react-querybuilder/graph` use `meta` to store
1089
+ * domain-specific context (e.g., graph pattern information).
1090
+ */
1091
+ meta?: M;
1085
1092
  }
1086
1093
  /**
1087
1094
  * The main rule group type. This type is used for query definitions as well as
@@ -1304,7 +1311,7 @@ type ParseNumbersPropConfig = boolean | `${ParseNumberMethodName}${ParseNumbersM
1304
1311
  *
1305
1312
  * @group Export
1306
1313
  */
1307
- type ExportFormat = "json" | "sql" | "json_without_ids" | "parameterized" | "parameterized_named" | "mongodb" | "mongodb_query" | "cel" | "jsonlogic" | "spel" | "elasticsearch" | "jsonata" | "natural_language" | "ldap" | "drizzle" | "prisma" | "sequelize" | "diagnostics";
1314
+ type ExportFormat = "json" | "sql" | "json_without_ids" | "parameterized" | "parameterized_named" | "mongodb" | "mongodb_query" | "cel" | "jsonlogic" | "spel" | "elasticsearch" | "jsonata" | "natural_language" | "ldap" | "drizzle" | "prisma" | "sequelize" | "cypher" | "gql" | "sparql" | "gremlin" | "diagnostics";
1308
1315
  /**
1309
1316
  * Export formats for {@link formatQuery} that produce objects instead of strings.
1310
1317
  *
@@ -1889,4 +1896,4 @@ type NLTranslationKey = "and" | "or" | "true" | "false" | `groupPrefix${ZeroOrMo
1889
1896
  type NLTranslations = Partial<Record<NLTranslationKey, string>>;
1890
1897
  //#endregion
1891
1898
  export { SetRequired as A, RuleGroupTypeIC as C, RuleGroupType as D, DefaultRuleGroupType as E, RuleType as O, RuleGroupTypeAny as S, DefaultOperatorName as T, ValueProcessorLegacy as _, ExportOperatorMap as a, ValueSources as b, NLTranslationKey as c, ParameterizedSQL as d, RQBJsonLogic as f, ValueProcessorByRule as g, SQLPreset as h, ExportObjectFormats as i, Except as j, OptionList as k, NLTranslations as l, RuleProcessor as m, DiagnosticsResult as n, FormatQueryOptions as o, RuleGroupProcessor as p, ExportFormat as r, GroupVariantCondition as s, ConstituentWordOrder as t, ParameterizedNamedSQL as u, ValueProcessorOptions as v, DefaultCombinatorName as w, DefaultRuleGroupTypeIC as x, FullField as y };
1892
- //# sourceMappingURL=index-D5TXNIzF.d.ts.map
1899
+ //# sourceMappingURL=index-Cjapnb-H.d.ts.map
@@ -2,7 +2,7 @@ import { RulesLogic } from "json-logic-js";
2
2
 
3
3
  //#region ../../node_modules/type-fest/source/union-to-intersection.d.ts
4
4
  /**
5
- Convert a union type to an intersection type using [distributive conditional types](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#distributive-conditional-types).
5
+ Convert a union type to an intersection type.
6
6
 
7
7
  Inspired by [this Stack Overflow answer](https://stackoverflow.com/a/50375286/2172153).
8
8
 
@@ -899,7 +899,7 @@ type _Except<ObjectType, KeysType extends keyof ObjectType, Options extends Requ
899
899
  //#endregion
900
900
  //#region ../../node_modules/type-fest/source/set-required.d.ts
901
901
  /**
902
- Create a type that makes the given keys required. The remaining keys are kept as is. The sister of the `SetOptional` type.
902
+ Create a type that makes the given keys required, while keeping the remaining keys as is.
903
903
 
904
904
  Use-case: You want to define a single model where the only thing that changes is whether or not some of the keys are required.
905
905
 
@@ -925,8 +925,8 @@ type ArrayExample = SetRequired<[number?, number?, number?], 0 | 1>;
925
925
  */
926
926
  type SetRequired<BaseType, Keys extends keyof BaseType> = (BaseType extends ((...arguments_: never) => any) ? (...arguments_: Parameters<BaseType>) => ReturnType<BaseType> : unknown) & _SetRequired<BaseType, Keys>;
927
927
  type _SetRequired<BaseType, Keys extends keyof BaseType> = BaseType extends UnknownArray ? SetArrayRequired<BaseType, Keys> extends infer ResultantArray ? If<IsArrayReadonly<BaseType>, Readonly<ResultantArray>, ResultantArray> : never : Simplify< // Pick just the keys that are optional from the base type.
928
- Except<BaseType, Keys> & // Pick the keys that should be required from the base type and make them required.
929
- Required<HomomorphicPick<BaseType, Keys>>>;
928
+ Except<BaseType, Keys> // Pick the keys that should be required from the base type and make them required.
929
+ & Required<HomomorphicPick<BaseType, Keys>>>;
930
930
  /**
931
931
  Remove the optional modifier from the specified keys in an array.
932
932
  */
@@ -1072,7 +1072,7 @@ interface CommonRuleAndGroupProperties {
1072
1072
  * The main rule type. The `field`, `operator`, and `value` properties
1073
1073
  * can be narrowed with generics.
1074
1074
  */
1075
- interface RuleType<F extends string = string, O extends string = string, V = any, C extends string = string> extends CommonRuleAndGroupProperties {
1075
+ interface RuleType<F extends string = string, O extends string = string, V = any, C extends string = string, M = Record<string, any>> extends CommonRuleAndGroupProperties {
1076
1076
  field: F;
1077
1077
  operator: O;
1078
1078
  value: V;
@@ -1082,6 +1082,13 @@ interface RuleType<F extends string = string, O extends string = string, V = any
1082
1082
  * Only used when adding a rule to a query that uses independent combinators.
1083
1083
  */
1084
1084
  combinatorPreceding?: C;
1085
+ /**
1086
+ * Opaque metadata for use by extension packages. The core library
1087
+ * preserves this property but does not read or interpret it.
1088
+ * Extensions like `@react-querybuilder/graph` use `meta` to store
1089
+ * domain-specific context (e.g., graph pattern information).
1090
+ */
1091
+ meta?: M;
1085
1092
  }
1086
1093
  /**
1087
1094
  * The main rule group type. This type is used for query definitions as well as
@@ -1304,7 +1311,7 @@ type ParseNumbersPropConfig = boolean | `${ParseNumberMethodName}${ParseNumbersM
1304
1311
  *
1305
1312
  * @group Export
1306
1313
  */
1307
- type ExportFormat = "json" | "sql" | "json_without_ids" | "parameterized" | "parameterized_named" | "mongodb" | "mongodb_query" | "cel" | "jsonlogic" | "spel" | "elasticsearch" | "jsonata" | "natural_language" | "ldap" | "drizzle" | "prisma" | "sequelize" | "diagnostics";
1314
+ type ExportFormat = "json" | "sql" | "json_without_ids" | "parameterized" | "parameterized_named" | "mongodb" | "mongodb_query" | "cel" | "jsonlogic" | "spel" | "elasticsearch" | "jsonata" | "natural_language" | "ldap" | "drizzle" | "prisma" | "sequelize" | "cypher" | "gql" | "sparql" | "gremlin" | "diagnostics";
1308
1315
  /**
1309
1316
  * Export formats for {@link formatQuery} that produce objects instead of strings.
1310
1317
  *
@@ -1889,4 +1896,4 @@ type NLTranslationKey = "and" | "or" | "true" | "false" | `groupPrefix${ZeroOrMo
1889
1896
  type NLTranslations = Partial<Record<NLTranslationKey, string>>;
1890
1897
  //#endregion
1891
1898
  export { SetRequired as A, RuleGroupTypeIC as C, RuleGroupType as D, DefaultRuleGroupType as E, RuleType as O, RuleGroupTypeAny as S, DefaultOperatorName as T, ValueProcessorLegacy as _, ExportOperatorMap as a, ValueSources as b, NLTranslationKey as c, ParameterizedSQL as d, RQBJsonLogic as f, ValueProcessorByRule as g, SQLPreset as h, ExportObjectFormats as i, Except as j, OptionList as k, NLTranslations as l, RuleProcessor as m, DiagnosticsResult as n, FormatQueryOptions as o, RuleGroupProcessor as p, ExportFormat as r, GroupVariantCondition as s, ConstituentWordOrder as t, ParameterizedNamedSQL as u, ValueProcessorOptions as v, DefaultCombinatorName as w, DefaultRuleGroupTypeIC as x, FullField as y };
1892
- //# sourceMappingURL=index-Lht_Wq3V.d.mts.map
1899
+ //# sourceMappingURL=index-D-Iej37L.d.mts.map
@@ -1,5 +1,5 @@
1
- import { C as RuleGroupTypeIC, D as RuleGroupType, E as DefaultRuleGroupType, O as RuleType, T as DefaultOperatorName, j as Except, w as DefaultCombinatorName, x as DefaultRuleGroupTypeIC } from "./index-Lht_Wq3V.mjs";
2
- import { t as ParserCommonOptions } from "./import-0wp72lLT.mjs";
1
+ import { C as RuleGroupTypeIC, D as RuleGroupType, E as DefaultRuleGroupType, O as RuleType, T as DefaultOperatorName, j as Except, w as DefaultCombinatorName, x as DefaultRuleGroupTypeIC } from "./index-D-Iej37L.mjs";
2
+ import { t as ParserCommonOptions } from "./import-BHlzBLM_.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";
@@ -1,5 +1,5 @@
1
- import { C as RuleGroupTypeIC, D as RuleGroupType, E as DefaultRuleGroupType, O as RuleType, T as DefaultOperatorName, j as Except, w as DefaultCombinatorName, x as DefaultRuleGroupTypeIC } from "./index-D5TXNIzF.js";
2
- import { t as ParserCommonOptions } from "./import-yRVJh7E1.js";
1
+ import { C as RuleGroupTypeIC, D as RuleGroupType, E as DefaultRuleGroupType, O as RuleType, T as DefaultOperatorName, j as Except, w as DefaultCombinatorName, x as DefaultRuleGroupTypeIC } from "./index-Cjapnb-H.js";
2
+ import { t as ParserCommonOptions } from "./import-C6imciDf.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";