@react-querybuilder/core 8.23.1 → 8.24.1

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 (86) hide show
  1. package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +516 -455
  2. package/dist/cjs/react-querybuilder_core.cjs.development.js +169 -6
  3. package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
  4. package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +516 -455
  5. package/dist/cjs/react-querybuilder_core.cjs.production.js +74 -1
  6. package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
  7. package/dist/derivations.d.mts +290 -239
  8. package/dist/derivations.d.ts +290 -239
  9. package/dist/derivations.js +137 -4
  10. package/dist/derivations.js.map +1 -1
  11. package/dist/derivations.mjs +136 -5
  12. package/dist/derivations.mjs.map +1 -1
  13. package/dist/formatQuery.d.mts +1 -1
  14. package/dist/formatQuery.d.ts +1 -1
  15. package/dist/formatQuery.js +7 -4
  16. package/dist/formatQuery.js.map +1 -1
  17. package/dist/formatQuery.mjs +7 -4
  18. package/dist/formatQuery.mjs.map +1 -1
  19. package/dist/{import-BfZTwhp2.d.ts → import-BCkipOTY.d.ts} +2 -2
  20. package/dist/{import-BdKPtLzo.d.mts → import-C9el4B_K.d.mts} +2 -2
  21. package/dist/{index-DOIE2pwx.d.ts → index-BExDPYEG.d.mts} +10 -8
  22. package/dist/{index-DOIE2pwx.d.mts → index-BExDPYEG.d.ts} +10 -8
  23. package/dist/{index-XueTy_XQ.d.ts → index-icv8DBhg.d.mts} +5 -3
  24. package/dist/{index-OF2Q1gTp.d.mts → index-yXGVO31H.d.ts} +5 -3
  25. package/dist/parseCEL.d.mts +112 -112
  26. package/dist/parseCEL.d.ts +112 -112
  27. package/dist/parseCEL.js +4 -4
  28. package/dist/parseCEL.js.map +1 -1
  29. package/dist/parseCEL.mjs +4 -4
  30. package/dist/parseCEL.mjs.map +1 -1
  31. package/dist/parseCypher.d.mts +8 -8
  32. package/dist/parseCypher.d.ts +8 -8
  33. package/dist/parseGremlin.d.mts +5 -5
  34. package/dist/parseGremlin.d.ts +5 -5
  35. package/dist/parseJSONata.d.mts +39 -39
  36. package/dist/parseJSONata.d.ts +39 -39
  37. package/dist/parseJSONata.js +2 -2
  38. package/dist/parseJSONata.mjs +2 -2
  39. package/dist/parseJsonLogic.d.mts +10 -10
  40. package/dist/parseJsonLogic.d.ts +10 -10
  41. package/dist/parseJsonLogic.js +3 -3
  42. package/dist/parseJsonLogic.mjs +3 -3
  43. package/dist/parseMongoDB.d.mts +9 -9
  44. package/dist/parseMongoDB.d.ts +9 -9
  45. package/dist/parseMongoDB.js +3 -3
  46. package/dist/parseMongoDB.mjs +3 -3
  47. package/dist/parseSPARQL.d.mts +5 -5
  48. package/dist/parseSPARQL.d.ts +5 -5
  49. package/dist/parseSQL.d.mts +63 -63
  50. package/dist/parseSQL.d.ts +63 -63
  51. package/dist/parseSQL.js +4 -4
  52. package/dist/parseSQL.js.map +1 -1
  53. package/dist/parseSQL.mjs +4 -4
  54. package/dist/parseSQL.mjs.map +1 -1
  55. package/dist/parseSpEL.d.mts +57 -57
  56. package/dist/parseSpEL.d.ts +57 -57
  57. package/dist/parseSpEL.js +3 -3
  58. package/dist/parseSpEL.mjs +3 -3
  59. package/dist/{parserUtils-DbBXyAht.js → parserUtils-2VtG7m8L.js} +3 -3
  60. package/dist/{parserUtils-DbBXyAht.js.map → parserUtils-2VtG7m8L.js.map} +1 -1
  61. package/dist/{parserUtils-BKPstAaO.mjs → parserUtils-BlafvoFb.mjs} +3 -3
  62. package/dist/{parserUtils-BKPstAaO.mjs.map → parserUtils-BlafvoFb.mjs.map} +1 -1
  63. package/dist/{prepareQueryObjects-Dj9cTl9D.js → prepareQueryObjects-DJ_VjOLb.js} +2 -2
  64. package/dist/{prepareQueryObjects-Dj9cTl9D.js.map → prepareQueryObjects-DJ_VjOLb.js.map} +1 -1
  65. package/dist/{prepareQueryObjects-Dmyf3Wi_.mjs → prepareQueryObjects-DawsH4e3.mjs} +2 -2
  66. package/dist/{prepareQueryObjects-Dmyf3Wi_.mjs.map → prepareQueryObjects-DawsH4e3.mjs.map} +1 -1
  67. package/dist/react-querybuilder_core.d.mts +516 -455
  68. package/dist/react-querybuilder_core.legacy-esm.d.ts +516 -455
  69. package/dist/react-querybuilder_core.legacy-esm.js +172 -14
  70. package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
  71. package/dist/react-querybuilder_core.mjs +168 -7
  72. package/dist/react-querybuilder_core.mjs.map +1 -1
  73. package/dist/react-querybuilder_core.production.d.mts +516 -455
  74. package/dist/react-querybuilder_core.production.mjs +74 -1
  75. package/dist/react-querybuilder_core.production.mjs.map +1 -1
  76. package/dist/{transformQuery-B7d9AWUf.d.mts → transformQuery-B6PRLRkS.d.mts} +2 -2
  77. package/dist/{transformQuery-BXDiUBGB.d.ts → transformQuery-DVjJZXnB.d.ts} +2 -2
  78. package/dist/transformQuery.d.mts +1 -1
  79. package/dist/transformQuery.d.ts +1 -1
  80. package/dist/{utils-e-7KHkjV.js → utils-B4E1-ZvU.js} +12 -2
  81. package/dist/utils-B4E1-ZvU.js.map +1 -0
  82. package/dist/{utils-CP5Jqy1P.mjs → utils-DLZCoyAh.mjs} +12 -2
  83. package/dist/utils-DLZCoyAh.mjs.map +1 -0
  84. package/package.json +20 -19
  85. package/dist/utils-CP5Jqy1P.mjs.map +0 -1
  86. package/dist/utils-e-7KHkjV.js.map +0 -1
@@ -1,13 +1,13 @@
1
- import { $t as DefaultRuleGroupType, Jt as DefaultCombinatorName, Pt as DefaultRuleGroupTypeIC, Zt as DefaultOperatorName, jn as Except, on as ExpressionNode } from "./index-DOIE2pwx.mjs";
2
- import { t as ParserCommonOptions } from "./import-BdKPtLzo.mjs";
1
+ import { $t as DefaultRuleGroupType, Jt as DefaultCombinatorName, Pt as DefaultRuleGroupTypeIC, Zt as DefaultOperatorName, jn as Except, on as ExpressionNode } from "./index-BExDPYEG.mjs";
2
+ import { t as ParserCommonOptions } from "./import-C9el4B_K.mjs";
3
3
  //#region src/utils/parseSpEL/types.d.ts
4
- type SpELNodeType = "invalid" | SpELOperationType | SpELPrimitiveType | SpELRelOp | SpELIdentifierType | "assign" | "beanref" | "constructorref" | "elvis" | "function" | "identifier" | "indexer" | "list" | "map" | "method" | "between" | "instanceof" | "matches" | "projection" | "qualifiedidentifier" | "selection" | "ternary" | "typeref";
4
+ export type SpELNodeType = "invalid" | SpELOperationType | SpELPrimitiveType | SpELRelOp | SpELIdentifierType | "assign" | "beanref" | "constructorref" | "elvis" | "function" | "identifier" | "indexer" | "list" | "map" | "method" | "between" | "instanceof" | "matches" | "projection" | "qualifiedidentifier" | "selection" | "ternary" | "typeref";
5
5
  type SpELOperationType = "op-and" | "op-dec" | "op-divide" | "op-eq" | "op-ge" | "op-gt" | "op-inc" | "op-le" | "op-lt" | "op-minus" | "op-modulus" | "op-multiply" | "op-ne" | "op-not" | "op-or" | "op-plus" | "op-power";
6
- type SpELPrimitiveType = "number" | "string" | "boolean" | "null";
7
- type SpELRelOp = "==" | ">=" | ">" | "<=" | "<" | "!=" | "in";
8
- type SpELRelOpType = "op-eq" | "op-ge" | "op-gt" | "op-le" | "op-lt" | "op-ne";
9
- type SpELIdentifierType = "property" | "compound" | "variable";
10
- interface SpELBaseNode<T extends SpELNodeType> {
6
+ export type SpELPrimitiveType = "number" | "string" | "boolean" | "null";
7
+ export type SpELRelOp = "==" | ">=" | ">" | "<=" | "<" | "!=" | "in";
8
+ export type SpELRelOpType = "op-eq" | "op-ge" | "op-gt" | "op-le" | "op-lt" | "op-ne";
9
+ export type SpELIdentifierType = "property" | "compound" | "variable";
10
+ export interface SpELBaseNode<T extends SpELNodeType> {
11
11
  _type: T;
12
12
  getType: () => T;
13
13
  getChildren: () => SpELBaseNode<T>[];
@@ -16,34 +16,34 @@ interface SpELBaseNode<T extends SpELNodeType> {
16
16
  getValue: () => boolean | number | string | null;
17
17
  toString: () => string;
18
18
  }
19
- interface SpELPropertyNode extends SpELBaseNode<SpELIdentifierType> {
19
+ export interface SpELPropertyNode extends SpELBaseNode<SpELIdentifierType> {
20
20
  getRaw: () => string;
21
21
  getName: () => string;
22
22
  }
23
- interface SpELListNode extends SpELBaseNode<"list"> {
23
+ export interface SpELListNode extends SpELBaseNode<"list"> {
24
24
  getRaw: () => SpELPropertyNode[];
25
25
  }
26
- interface SpELCompoundNode extends SpELBaseNode<SpELIdentifierType> {
26
+ export interface SpELCompoundNode extends SpELBaseNode<SpELIdentifierType> {
27
27
  getChildren: () => SpELPropertyNode[];
28
28
  }
29
29
  /**
30
30
  * A SpEL method/function invocation node. Note that arguments are _not_ children — they are
31
31
  * exposed as raw (unprocessed) nodes through `getRaw()`.
32
32
  */
33
- interface SpELMethodNode extends SpELBaseNode<"method"> {
33
+ export interface SpELMethodNode extends SpELBaseNode<"method"> {
34
34
  getRaw: () => {
35
35
  methodName: string;
36
36
  args: SpELExpressionNode[];
37
37
  };
38
38
  }
39
39
  /** The dotted segments of a `T(...)` type reference, e.g. `["java", "lang", "Math"]`. */
40
- interface SpELQualifiedIdentifierNode extends SpELBaseNode<"qualifiedidentifier"> {
40
+ export interface SpELQualifiedIdentifierNode extends SpELBaseNode<"qualifiedidentifier"> {
41
41
  getRaw: () => string[];
42
42
  }
43
- interface SpELExpressionNode extends SpELBaseNode<SpELNodeType> {
43
+ export interface SpELExpressionNode extends SpELBaseNode<SpELNodeType> {
44
44
  getChildren: () => SpELExpressionNode[];
45
45
  }
46
- interface SpELProcessedExpression {
46
+ export interface SpELProcessedExpression {
47
47
  type: SpELNodeType;
48
48
  children: SpELProcessedExpression[];
49
49
  value: number | string | boolean | null;
@@ -65,57 +65,57 @@ interface SpELProcessedExpression {
65
65
  * stored as {@link SpELProcessedExpression.target}, and static-call types as
66
66
  * {@link SpELProcessedExpression.typeRef}.
67
67
  */
68
- interface SpELMethodCall extends SpELProcessedExpression {
68
+ export interface SpELMethodCall extends SpELProcessedExpression {
69
69
  type: "method";
70
70
  methodName: string;
71
71
  }
72
- interface SpELOpAnd extends SpELProcessedExpression {
72
+ export interface SpELOpAnd extends SpELProcessedExpression {
73
73
  type: "op-and";
74
74
  }
75
- interface SpELOpOr extends SpELProcessedExpression {
75
+ export interface SpELOpOr extends SpELProcessedExpression {
76
76
  type: "op-or";
77
77
  }
78
- interface SpELOpMatches extends SpELProcessedExpression {
78
+ export interface SpELOpMatches extends SpELProcessedExpression {
79
79
  type: "matches";
80
80
  children: [SpELIdentifier, SpELStringLiteral] | [SpELStringLiteral, SpELIdentifier] | [SpELIdentifier, SpELIdentifier];
81
81
  }
82
- interface SpELIdentifier extends SpELProcessedExpression {
82
+ export interface SpELIdentifier extends SpELProcessedExpression {
83
83
  type: "compound" | "property" | "variable";
84
84
  identifier: string;
85
85
  }
86
- interface SpELRelation extends SpELProcessedExpression {
86
+ export interface SpELRelation extends SpELProcessedExpression {
87
87
  type: SpELRelOpType;
88
88
  }
89
- interface SpELBetweenValues extends SpELProcessedExpression {
89
+ export interface SpELBetweenValues extends SpELProcessedExpression {
90
90
  type: "between";
91
91
  children: [SpELIdentifier, SpELListOfValues];
92
92
  }
93
- interface SpELBetweenFields extends SpELProcessedExpression {
93
+ export interface SpELBetweenFields extends SpELProcessedExpression {
94
94
  type: "between";
95
95
  children: [SpELIdentifier, SpELListOfFields];
96
96
  }
97
- interface SpELListOfValues extends SpELProcessedExpression {
97
+ export interface SpELListOfValues extends SpELProcessedExpression {
98
98
  type: "list";
99
99
  children: [SpELPrimitive, SpELPrimitive, ...SpELPrimitive[]];
100
100
  }
101
- interface SpELListOfFields extends SpELProcessedExpression {
101
+ export interface SpELListOfFields extends SpELProcessedExpression {
102
102
  type: "list";
103
103
  children: [SpELIdentifier, SpELIdentifier, ...SpELIdentifier[]];
104
104
  }
105
- type SpELPrimitive = SpELBooleanLiteral | SpELNumericLiteral | SpELStringLiteral | SpELNullLiteral;
106
- interface SpELStringLiteral extends SpELProcessedExpression {
105
+ export type SpELPrimitive = SpELBooleanLiteral | SpELNumericLiteral | SpELStringLiteral | SpELNullLiteral;
106
+ export interface SpELStringLiteral extends SpELProcessedExpression {
107
107
  type: "string";
108
108
  value: string;
109
109
  }
110
- interface SpELNumericLiteral extends SpELProcessedExpression {
110
+ export interface SpELNumericLiteral extends SpELProcessedExpression {
111
111
  type: "number";
112
112
  value: number;
113
113
  }
114
- interface SpELBooleanLiteral extends SpELProcessedExpression {
114
+ export interface SpELBooleanLiteral extends SpELProcessedExpression {
115
115
  type: "boolean";
116
116
  value: boolean;
117
117
  }
118
- interface SpELNullLiteral extends SpELProcessedExpression {
118
+ export interface SpELNullLiteral extends SpELProcessedExpression {
119
119
  type: "null";
120
120
  value: null;
121
121
  }
@@ -125,9 +125,9 @@ interface SpELNullLiteral extends SpELProcessedExpression {
125
125
  * method/function invocation ({@link SpELMethodCall}), which covers `T(java.lang.Math).abs/min/max(...)`,
126
126
  * `.toUpperCase()`/`.toLowerCase()`, and custom calls like `myFunc(a, b)`.
127
127
  */
128
- type SpELExpressionOperand = SpELProcessedExpression;
128
+ export type SpELExpressionOperand = SpELProcessedExpression;
129
129
  /** Context passed to {@link parseSpEL!ParseSpELOptions.getExpression}. */
130
- interface ParseSpELExpressionContext {
130
+ export interface ParseSpELExpressionContext {
131
131
  /** Returns `true` if the field is configured (or if no `fields` were supplied). */
132
132
  fieldExists: (fieldName: string) => boolean;
133
133
  }
@@ -136,7 +136,7 @@ interface ParseSpELExpressionContext {
136
136
  /**
137
137
  * Options object for {@link parseSpEL!parseSpEL}.
138
138
  */
139
- interface ParseSpELOptions extends ParserCommonOptions {
139
+ export interface ParseSpELOptions extends ParserCommonOptions {
140
140
  /**
141
141
  * Handler that converts a SpEL expression operand subtree into an {@link ExpressionNode}.
142
142
  * Return `null` to reject (the rule is dropped). Supplied by `@react-querybuilder/expr`
@@ -172,36 +172,36 @@ declare function parseSpEL(spel: string, options: Except<ParseSpELOptions, "inde
172
172
  }): DefaultRuleGroupTypeIC;
173
173
  //#endregion
174
174
  //#region src/utils/parseSpEL/utils.d.ts
175
- declare const isSpELPropertyNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELPropertyNode;
176
- declare const isSpELCompoundNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELCompoundNode;
177
- declare const isSpELListNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELListNode;
178
- declare const isSpELOpAnd: (expr: SpELProcessedExpression) => expr is SpELOpAnd;
179
- declare const isSpELOpOr: (expr: SpELProcessedExpression) => expr is SpELOpOr;
180
- declare const isSpELOpMatches: (expr: SpELProcessedExpression) => expr is SpELOpMatches;
181
- declare const isSpELIdentifier: (expr: SpELProcessedExpression) => expr is SpELIdentifier;
182
- declare const isSpELStringLiteral: (expr: SpELProcessedExpression) => expr is SpELStringLiteral;
183
- declare const isSpELNumericLiteral: (expr: SpELProcessedExpression) => expr is SpELNumericLiteral;
184
- declare const isSpELBooleanLiteral: (expr: SpELProcessedExpression) => expr is SpELBooleanLiteral;
185
- declare const isSpELNullLiteral: (expr: SpELProcessedExpression) => expr is SpELNullLiteral;
186
- declare const isSpELRelationOp: (expr: SpELProcessedExpression) => expr is SpELRelation;
187
- declare const isSpELPrimitive: (expr: SpELProcessedExpression) => expr is SpELPrimitive;
188
- declare const isSpELBetweenValues: (expr: SpELProcessedExpression) => expr is SpELBetweenValues;
189
- declare const isSpELBetweenFields: (expr: SpELProcessedExpression) => expr is SpELBetweenFields;
175
+ export declare const isSpELPropertyNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELPropertyNode;
176
+ export declare const isSpELCompoundNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELCompoundNode;
177
+ export declare const isSpELListNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELListNode;
178
+ export declare const isSpELOpAnd: (expr: SpELProcessedExpression) => expr is SpELOpAnd;
179
+ export declare const isSpELOpOr: (expr: SpELProcessedExpression) => expr is SpELOpOr;
180
+ export declare const isSpELOpMatches: (expr: SpELProcessedExpression) => expr is SpELOpMatches;
181
+ export declare const isSpELIdentifier: (expr: SpELProcessedExpression) => expr is SpELIdentifier;
182
+ export declare const isSpELStringLiteral: (expr: SpELProcessedExpression) => expr is SpELStringLiteral;
183
+ export declare const isSpELNumericLiteral: (expr: SpELProcessedExpression) => expr is SpELNumericLiteral;
184
+ export declare const isSpELBooleanLiteral: (expr: SpELProcessedExpression) => expr is SpELBooleanLiteral;
185
+ export declare const isSpELNullLiteral: (expr: SpELProcessedExpression) => expr is SpELNullLiteral;
186
+ export declare const isSpELRelationOp: (expr: SpELProcessedExpression) => expr is SpELRelation;
187
+ export declare const isSpELPrimitive: (expr: SpELProcessedExpression) => expr is SpELPrimitive;
188
+ export declare const isSpELBetweenValues: (expr: SpELProcessedExpression) => expr is SpELBetweenValues;
189
+ export declare const isSpELBetweenFields: (expr: SpELProcessedExpression) => expr is SpELBetweenFields;
190
190
  /** A SpEL arithmetic infix node (`op-plus`/`op-minus`/`op-multiply`/`op-divide`/`op-modulus`). */
191
- declare const isSpELMathOperation: (expr: SpELProcessedExpression) => boolean;
191
+ export declare const isSpELMathOperation: (expr: SpELProcessedExpression) => boolean;
192
192
  /** A method/function invocation node (`.toUpperCase()`, `T(java.lang.Math).abs(x)`, `myFunc(a)`). */
193
- declare const isSpELMethodCall: (expr: SpELProcessedExpression) => expr is SpELMethodCall;
193
+ export declare const isSpELMethodCall: (expr: SpELProcessedExpression) => expr is SpELMethodCall;
194
194
  /**
195
195
  * Whether a relation operand should be routed to `getExpression`: an arithmetic infix node or a
196
196
  * method/function invocation. Bare identifiers, chains, and literals are not expression operands
197
197
  * (they retain their normal handling).
198
198
  */
199
- declare const isSpELExpressionOperand: (expr: SpELProcessedExpression) => boolean;
200
- declare const isSpELMethodNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELMethodNode;
201
- declare const processCompiledExpression: (ce: SpELPropertyNode | SpELExpressionNode) => SpELProcessedExpression;
202
- declare const normalizeOperator: (opType: SpELRelOpType, flip?: boolean) => DefaultOperatorName;
203
- declare const generateFlatAndOrList: (expr: SpELProcessedExpression) => (DefaultCombinatorName | SpELProcessedExpression)[];
204
- declare const generateMixedAndOrList: (expr: SpELOpAnd | SpELOpOr) => (DefaultCombinatorName | SpELProcessedExpression | ("and" | SpELProcessedExpression)[])[];
199
+ export declare const isSpELExpressionOperand: (expr: SpELProcessedExpression) => boolean;
200
+ export declare const isSpELMethodNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELMethodNode;
201
+ export declare const processCompiledExpression: (ce: SpELPropertyNode | SpELExpressionNode) => SpELProcessedExpression;
202
+ export declare const normalizeOperator: (opType: SpELRelOpType, flip?: boolean) => DefaultOperatorName;
203
+ export declare const generateFlatAndOrList: (expr: SpELProcessedExpression) => (DefaultCombinatorName | SpELProcessedExpression)[];
204
+ export declare const generateMixedAndOrList: (expr: SpELOpAnd | SpELOpOr) => (DefaultCombinatorName | SpELProcessedExpression | ("and" | SpELProcessedExpression)[])[];
205
205
  //#endregion
206
- export { ParseSpELExpressionContext, ParseSpELOptions, SpELBaseNode, SpELBetweenFields, SpELBetweenValues, SpELBooleanLiteral, SpELCompoundNode, SpELExpressionNode, SpELExpressionOperand, SpELIdentifier, SpELIdentifierType, SpELListNode, SpELListOfFields, SpELListOfValues, SpELMethodCall, SpELMethodNode, SpELNodeType, SpELNullLiteral, SpELNumericLiteral, SpELOpAnd, SpELOpMatches, SpELOpOr, SpELPrimitive, SpELPrimitiveType, SpELProcessedExpression, SpELPropertyNode, SpELQualifiedIdentifierNode, SpELRelOp, SpELRelOpType, SpELRelation, SpELStringLiteral, generateFlatAndOrList, generateMixedAndOrList, isSpELBetweenFields, isSpELBetweenValues, isSpELBooleanLiteral, isSpELCompoundNode, isSpELExpressionOperand, isSpELIdentifier, isSpELListNode, isSpELMathOperation, isSpELMethodCall, isSpELMethodNode, isSpELNullLiteral, isSpELNumericLiteral, isSpELOpAnd, isSpELOpMatches, isSpELOpOr, isSpELPrimitive, isSpELPropertyNode, isSpELRelationOp, isSpELStringLiteral, normalizeOperator, parseSpEL, processCompiledExpression };
206
+ export { parseSpEL };
207
207
  //# sourceMappingURL=parseSpEL.d.mts.map
@@ -1,13 +1,13 @@
1
- import { $t as DefaultRuleGroupType, Jt as DefaultCombinatorName, Pt as DefaultRuleGroupTypeIC, Zt as DefaultOperatorName, jn as Except, on as ExpressionNode } from "./index-DOIE2pwx.js";
2
- import { t as ParserCommonOptions } from "./import-BfZTwhp2.js";
1
+ import { $t as DefaultRuleGroupType, Jt as DefaultCombinatorName, Pt as DefaultRuleGroupTypeIC, Zt as DefaultOperatorName, jn as Except, on as ExpressionNode } from "./index-BExDPYEG.js";
2
+ import { t as ParserCommonOptions } from "./import-BCkipOTY.js";
3
3
  //#region src/utils/parseSpEL/types.d.ts
4
- type SpELNodeType = "invalid" | SpELOperationType | SpELPrimitiveType | SpELRelOp | SpELIdentifierType | "assign" | "beanref" | "constructorref" | "elvis" | "function" | "identifier" | "indexer" | "list" | "map" | "method" | "between" | "instanceof" | "matches" | "projection" | "qualifiedidentifier" | "selection" | "ternary" | "typeref";
4
+ export type SpELNodeType = "invalid" | SpELOperationType | SpELPrimitiveType | SpELRelOp | SpELIdentifierType | "assign" | "beanref" | "constructorref" | "elvis" | "function" | "identifier" | "indexer" | "list" | "map" | "method" | "between" | "instanceof" | "matches" | "projection" | "qualifiedidentifier" | "selection" | "ternary" | "typeref";
5
5
  type SpELOperationType = "op-and" | "op-dec" | "op-divide" | "op-eq" | "op-ge" | "op-gt" | "op-inc" | "op-le" | "op-lt" | "op-minus" | "op-modulus" | "op-multiply" | "op-ne" | "op-not" | "op-or" | "op-plus" | "op-power";
6
- type SpELPrimitiveType = "number" | "string" | "boolean" | "null";
7
- type SpELRelOp = "==" | ">=" | ">" | "<=" | "<" | "!=" | "in";
8
- type SpELRelOpType = "op-eq" | "op-ge" | "op-gt" | "op-le" | "op-lt" | "op-ne";
9
- type SpELIdentifierType = "property" | "compound" | "variable";
10
- interface SpELBaseNode<T extends SpELNodeType> {
6
+ export type SpELPrimitiveType = "number" | "string" | "boolean" | "null";
7
+ export type SpELRelOp = "==" | ">=" | ">" | "<=" | "<" | "!=" | "in";
8
+ export type SpELRelOpType = "op-eq" | "op-ge" | "op-gt" | "op-le" | "op-lt" | "op-ne";
9
+ export type SpELIdentifierType = "property" | "compound" | "variable";
10
+ export interface SpELBaseNode<T extends SpELNodeType> {
11
11
  _type: T;
12
12
  getType: () => T;
13
13
  getChildren: () => SpELBaseNode<T>[];
@@ -16,34 +16,34 @@ interface SpELBaseNode<T extends SpELNodeType> {
16
16
  getValue: () => boolean | number | string | null;
17
17
  toString: () => string;
18
18
  }
19
- interface SpELPropertyNode extends SpELBaseNode<SpELIdentifierType> {
19
+ export interface SpELPropertyNode extends SpELBaseNode<SpELIdentifierType> {
20
20
  getRaw: () => string;
21
21
  getName: () => string;
22
22
  }
23
- interface SpELListNode extends SpELBaseNode<"list"> {
23
+ export interface SpELListNode extends SpELBaseNode<"list"> {
24
24
  getRaw: () => SpELPropertyNode[];
25
25
  }
26
- interface SpELCompoundNode extends SpELBaseNode<SpELIdentifierType> {
26
+ export interface SpELCompoundNode extends SpELBaseNode<SpELIdentifierType> {
27
27
  getChildren: () => SpELPropertyNode[];
28
28
  }
29
29
  /**
30
30
  * A SpEL method/function invocation node. Note that arguments are _not_ children — they are
31
31
  * exposed as raw (unprocessed) nodes through `getRaw()`.
32
32
  */
33
- interface SpELMethodNode extends SpELBaseNode<"method"> {
33
+ export interface SpELMethodNode extends SpELBaseNode<"method"> {
34
34
  getRaw: () => {
35
35
  methodName: string;
36
36
  args: SpELExpressionNode[];
37
37
  };
38
38
  }
39
39
  /** The dotted segments of a `T(...)` type reference, e.g. `["java", "lang", "Math"]`. */
40
- interface SpELQualifiedIdentifierNode extends SpELBaseNode<"qualifiedidentifier"> {
40
+ export interface SpELQualifiedIdentifierNode extends SpELBaseNode<"qualifiedidentifier"> {
41
41
  getRaw: () => string[];
42
42
  }
43
- interface SpELExpressionNode extends SpELBaseNode<SpELNodeType> {
43
+ export interface SpELExpressionNode extends SpELBaseNode<SpELNodeType> {
44
44
  getChildren: () => SpELExpressionNode[];
45
45
  }
46
- interface SpELProcessedExpression {
46
+ export interface SpELProcessedExpression {
47
47
  type: SpELNodeType;
48
48
  children: SpELProcessedExpression[];
49
49
  value: number | string | boolean | null;
@@ -65,57 +65,57 @@ interface SpELProcessedExpression {
65
65
  * stored as {@link SpELProcessedExpression.target}, and static-call types as
66
66
  * {@link SpELProcessedExpression.typeRef}.
67
67
  */
68
- interface SpELMethodCall extends SpELProcessedExpression {
68
+ export interface SpELMethodCall extends SpELProcessedExpression {
69
69
  type: "method";
70
70
  methodName: string;
71
71
  }
72
- interface SpELOpAnd extends SpELProcessedExpression {
72
+ export interface SpELOpAnd extends SpELProcessedExpression {
73
73
  type: "op-and";
74
74
  }
75
- interface SpELOpOr extends SpELProcessedExpression {
75
+ export interface SpELOpOr extends SpELProcessedExpression {
76
76
  type: "op-or";
77
77
  }
78
- interface SpELOpMatches extends SpELProcessedExpression {
78
+ export interface SpELOpMatches extends SpELProcessedExpression {
79
79
  type: "matches";
80
80
  children: [SpELIdentifier, SpELStringLiteral] | [SpELStringLiteral, SpELIdentifier] | [SpELIdentifier, SpELIdentifier];
81
81
  }
82
- interface SpELIdentifier extends SpELProcessedExpression {
82
+ export interface SpELIdentifier extends SpELProcessedExpression {
83
83
  type: "compound" | "property" | "variable";
84
84
  identifier: string;
85
85
  }
86
- interface SpELRelation extends SpELProcessedExpression {
86
+ export interface SpELRelation extends SpELProcessedExpression {
87
87
  type: SpELRelOpType;
88
88
  }
89
- interface SpELBetweenValues extends SpELProcessedExpression {
89
+ export interface SpELBetweenValues extends SpELProcessedExpression {
90
90
  type: "between";
91
91
  children: [SpELIdentifier, SpELListOfValues];
92
92
  }
93
- interface SpELBetweenFields extends SpELProcessedExpression {
93
+ export interface SpELBetweenFields extends SpELProcessedExpression {
94
94
  type: "between";
95
95
  children: [SpELIdentifier, SpELListOfFields];
96
96
  }
97
- interface SpELListOfValues extends SpELProcessedExpression {
97
+ export interface SpELListOfValues extends SpELProcessedExpression {
98
98
  type: "list";
99
99
  children: [SpELPrimitive, SpELPrimitive, ...SpELPrimitive[]];
100
100
  }
101
- interface SpELListOfFields extends SpELProcessedExpression {
101
+ export interface SpELListOfFields extends SpELProcessedExpression {
102
102
  type: "list";
103
103
  children: [SpELIdentifier, SpELIdentifier, ...SpELIdentifier[]];
104
104
  }
105
- type SpELPrimitive = SpELBooleanLiteral | SpELNumericLiteral | SpELStringLiteral | SpELNullLiteral;
106
- interface SpELStringLiteral extends SpELProcessedExpression {
105
+ export type SpELPrimitive = SpELBooleanLiteral | SpELNumericLiteral | SpELStringLiteral | SpELNullLiteral;
106
+ export interface SpELStringLiteral extends SpELProcessedExpression {
107
107
  type: "string";
108
108
  value: string;
109
109
  }
110
- interface SpELNumericLiteral extends SpELProcessedExpression {
110
+ export interface SpELNumericLiteral extends SpELProcessedExpression {
111
111
  type: "number";
112
112
  value: number;
113
113
  }
114
- interface SpELBooleanLiteral extends SpELProcessedExpression {
114
+ export interface SpELBooleanLiteral extends SpELProcessedExpression {
115
115
  type: "boolean";
116
116
  value: boolean;
117
117
  }
118
- interface SpELNullLiteral extends SpELProcessedExpression {
118
+ export interface SpELNullLiteral extends SpELProcessedExpression {
119
119
  type: "null";
120
120
  value: null;
121
121
  }
@@ -125,9 +125,9 @@ interface SpELNullLiteral extends SpELProcessedExpression {
125
125
  * method/function invocation ({@link SpELMethodCall}), which covers `T(java.lang.Math).abs/min/max(...)`,
126
126
  * `.toUpperCase()`/`.toLowerCase()`, and custom calls like `myFunc(a, b)`.
127
127
  */
128
- type SpELExpressionOperand = SpELProcessedExpression;
128
+ export type SpELExpressionOperand = SpELProcessedExpression;
129
129
  /** Context passed to {@link parseSpEL!ParseSpELOptions.getExpression}. */
130
- interface ParseSpELExpressionContext {
130
+ export interface ParseSpELExpressionContext {
131
131
  /** Returns `true` if the field is configured (or if no `fields` were supplied). */
132
132
  fieldExists: (fieldName: string) => boolean;
133
133
  }
@@ -136,7 +136,7 @@ interface ParseSpELExpressionContext {
136
136
  /**
137
137
  * Options object for {@link parseSpEL!parseSpEL}.
138
138
  */
139
- interface ParseSpELOptions extends ParserCommonOptions {
139
+ export interface ParseSpELOptions extends ParserCommonOptions {
140
140
  /**
141
141
  * Handler that converts a SpEL expression operand subtree into an {@link ExpressionNode}.
142
142
  * Return `null` to reject (the rule is dropped). Supplied by `@react-querybuilder/expr`
@@ -172,36 +172,36 @@ declare function parseSpEL(spel: string, options: Except<ParseSpELOptions, "inde
172
172
  }): DefaultRuleGroupTypeIC;
173
173
  //#endregion
174
174
  //#region src/utils/parseSpEL/utils.d.ts
175
- declare const isSpELPropertyNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELPropertyNode;
176
- declare const isSpELCompoundNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELCompoundNode;
177
- declare const isSpELListNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELListNode;
178
- declare const isSpELOpAnd: (expr: SpELProcessedExpression) => expr is SpELOpAnd;
179
- declare const isSpELOpOr: (expr: SpELProcessedExpression) => expr is SpELOpOr;
180
- declare const isSpELOpMatches: (expr: SpELProcessedExpression) => expr is SpELOpMatches;
181
- declare const isSpELIdentifier: (expr: SpELProcessedExpression) => expr is SpELIdentifier;
182
- declare const isSpELStringLiteral: (expr: SpELProcessedExpression) => expr is SpELStringLiteral;
183
- declare const isSpELNumericLiteral: (expr: SpELProcessedExpression) => expr is SpELNumericLiteral;
184
- declare const isSpELBooleanLiteral: (expr: SpELProcessedExpression) => expr is SpELBooleanLiteral;
185
- declare const isSpELNullLiteral: (expr: SpELProcessedExpression) => expr is SpELNullLiteral;
186
- declare const isSpELRelationOp: (expr: SpELProcessedExpression) => expr is SpELRelation;
187
- declare const isSpELPrimitive: (expr: SpELProcessedExpression) => expr is SpELPrimitive;
188
- declare const isSpELBetweenValues: (expr: SpELProcessedExpression) => expr is SpELBetweenValues;
189
- declare const isSpELBetweenFields: (expr: SpELProcessedExpression) => expr is SpELBetweenFields;
175
+ export declare const isSpELPropertyNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELPropertyNode;
176
+ export declare const isSpELCompoundNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELCompoundNode;
177
+ export declare const isSpELListNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELListNode;
178
+ export declare const isSpELOpAnd: (expr: SpELProcessedExpression) => expr is SpELOpAnd;
179
+ export declare const isSpELOpOr: (expr: SpELProcessedExpression) => expr is SpELOpOr;
180
+ export declare const isSpELOpMatches: (expr: SpELProcessedExpression) => expr is SpELOpMatches;
181
+ export declare const isSpELIdentifier: (expr: SpELProcessedExpression) => expr is SpELIdentifier;
182
+ export declare const isSpELStringLiteral: (expr: SpELProcessedExpression) => expr is SpELStringLiteral;
183
+ export declare const isSpELNumericLiteral: (expr: SpELProcessedExpression) => expr is SpELNumericLiteral;
184
+ export declare const isSpELBooleanLiteral: (expr: SpELProcessedExpression) => expr is SpELBooleanLiteral;
185
+ export declare const isSpELNullLiteral: (expr: SpELProcessedExpression) => expr is SpELNullLiteral;
186
+ export declare const isSpELRelationOp: (expr: SpELProcessedExpression) => expr is SpELRelation;
187
+ export declare const isSpELPrimitive: (expr: SpELProcessedExpression) => expr is SpELPrimitive;
188
+ export declare const isSpELBetweenValues: (expr: SpELProcessedExpression) => expr is SpELBetweenValues;
189
+ export declare const isSpELBetweenFields: (expr: SpELProcessedExpression) => expr is SpELBetweenFields;
190
190
  /** A SpEL arithmetic infix node (`op-plus`/`op-minus`/`op-multiply`/`op-divide`/`op-modulus`). */
191
- declare const isSpELMathOperation: (expr: SpELProcessedExpression) => boolean;
191
+ export declare const isSpELMathOperation: (expr: SpELProcessedExpression) => boolean;
192
192
  /** A method/function invocation node (`.toUpperCase()`, `T(java.lang.Math).abs(x)`, `myFunc(a)`). */
193
- declare const isSpELMethodCall: (expr: SpELProcessedExpression) => expr is SpELMethodCall;
193
+ export declare const isSpELMethodCall: (expr: SpELProcessedExpression) => expr is SpELMethodCall;
194
194
  /**
195
195
  * Whether a relation operand should be routed to `getExpression`: an arithmetic infix node or a
196
196
  * method/function invocation. Bare identifiers, chains, and literals are not expression operands
197
197
  * (they retain their normal handling).
198
198
  */
199
- declare const isSpELExpressionOperand: (expr: SpELProcessedExpression) => boolean;
200
- declare const isSpELMethodNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELMethodNode;
201
- declare const processCompiledExpression: (ce: SpELPropertyNode | SpELExpressionNode) => SpELProcessedExpression;
202
- declare const normalizeOperator: (opType: SpELRelOpType, flip?: boolean) => DefaultOperatorName;
203
- declare const generateFlatAndOrList: (expr: SpELProcessedExpression) => (DefaultCombinatorName | SpELProcessedExpression)[];
204
- declare const generateMixedAndOrList: (expr: SpELOpAnd | SpELOpOr) => (DefaultCombinatorName | SpELProcessedExpression | ("and" | SpELProcessedExpression)[])[];
199
+ export declare const isSpELExpressionOperand: (expr: SpELProcessedExpression) => boolean;
200
+ export declare const isSpELMethodNode: (expr: SpELBaseNode<SpELNodeType>) => expr is SpELMethodNode;
201
+ export declare const processCompiledExpression: (ce: SpELPropertyNode | SpELExpressionNode) => SpELProcessedExpression;
202
+ export declare const normalizeOperator: (opType: SpELRelOpType, flip?: boolean) => DefaultOperatorName;
203
+ export declare const generateFlatAndOrList: (expr: SpELProcessedExpression) => (DefaultCombinatorName | SpELProcessedExpression)[];
204
+ export declare const generateMixedAndOrList: (expr: SpELOpAnd | SpELOpOr) => (DefaultCombinatorName | SpELProcessedExpression | ("and" | SpELProcessedExpression)[])[];
205
205
  //#endregion
206
- export { ParseSpELExpressionContext, ParseSpELOptions, SpELBaseNode, SpELBetweenFields, SpELBetweenValues, SpELBooleanLiteral, SpELCompoundNode, SpELExpressionNode, SpELExpressionOperand, SpELIdentifier, SpELIdentifierType, SpELListNode, SpELListOfFields, SpELListOfValues, SpELMethodCall, SpELMethodNode, SpELNodeType, SpELNullLiteral, SpELNumericLiteral, SpELOpAnd, SpELOpMatches, SpELOpOr, SpELPrimitive, SpELPrimitiveType, SpELProcessedExpression, SpELPropertyNode, SpELQualifiedIdentifierNode, SpELRelOp, SpELRelOpType, SpELRelation, SpELStringLiteral, generateFlatAndOrList, generateMixedAndOrList, isSpELBetweenFields, isSpELBetweenValues, isSpELBooleanLiteral, isSpELCompoundNode, isSpELExpressionOperand, isSpELIdentifier, isSpELListNode, isSpELMathOperation, isSpELMethodCall, isSpELMethodNode, isSpELNullLiteral, isSpELNumericLiteral, isSpELOpAnd, isSpELOpMatches, isSpELOpOr, isSpELPrimitive, isSpELPropertyNode, isSpELRelationOp, isSpELStringLiteral, normalizeOperator, parseSpEL, processCompiledExpression };
206
+ export { parseSpEL };
207
207
  //# sourceMappingURL=parseSpEL.d.ts.map
package/dist/parseSpEL.js CHANGED
@@ -1,8 +1,8 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_utils = require("./utils-e-7KHkjV.js");
2
+ const require_utils = require("./utils-B4E1-ZvU.js");
3
3
  const require_objectUtils = require("./objectUtils-DfnEmDSV.js");
4
- const require_prepareQueryObjects = require("./prepareQueryObjects-Dj9cTl9D.js");
5
- const require_parserUtils = require("./parserUtils-DbBXyAht.js");
4
+ const require_prepareQueryObjects = require("./prepareQueryObjects-DJ_VjOLb.js");
5
+ const require_parserUtils = require("./parserUtils-2VtG7m8L.js");
6
6
  let spel2js = require("spel2js");
7
7
  //#region src/utils/parseSpEL/utils.ts
8
8
  const isSpELPropertyNode = (expr) => {
@@ -1,7 +1,7 @@
1
- import { U as joinWith } from "./utils-CP5Jqy1P.mjs";
1
+ import { U as joinWith } from "./utils-DLZCoyAh.mjs";
2
2
  import { i as isRuleGroup } from "./objectUtils-DDZ-KhV5.mjs";
3
- import { n as prepareRuleGroup } from "./prepareQueryObjects-Dmyf3Wi_.mjs";
4
- import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-BKPstAaO.mjs";
3
+ import { n as prepareRuleGroup } from "./prepareQueryObjects-DawsH4e3.mjs";
4
+ import { n as getFieldsArray, t as fieldIsValidUtil } from "./parserUtils-BlafvoFb.mjs";
5
5
  import { SpelExpressionEvaluator } from "spel2js";
6
6
  //#region src/utils/parseSpEL/utils.ts
7
7
  const isSpELPropertyNode = (expr) => {
@@ -1,5 +1,5 @@
1
- const require_utils = require("./utils-e-7KHkjV.js");
2
- const require_prepareQueryObjects = require("./prepareQueryObjects-Dj9cTl9D.js");
1
+ const require_utils = require("./utils-B4E1-ZvU.js");
2
+ const require_prepareQueryObjects = require("./prepareQueryObjects-DJ_VjOLb.js");
3
3
  //#region src/utils/parserUtils.ts
4
4
  const getFieldsArray = (fields) => {
5
5
  const fieldsArray = fields ? Array.isArray(fields) ? fields : Object.keys(fields).map((fld) => Object.assign({}, fields[fld], { name: fld })).sort((a, b) => a.label.localeCompare(b.label)) : [];
@@ -38,4 +38,4 @@ Object.defineProperty(exports, "getFieldsArray", {
38
38
  }
39
39
  });
40
40
 
41
- //# sourceMappingURL=parserUtils-DbBXyAht.js.map
41
+ //# sourceMappingURL=parserUtils-2VtG7m8L.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"parserUtils-DbBXyAht.js","names":["toFlatOptionArray","getValueSourcesUtil","isFlexibleOptionArray","toFullOption","filterFieldsByComparator"],"sources":["../src/utils/parserUtils.ts"],"sourcesContent":["import type {\n DefaultOperatorName,\n FullField,\n FullOption,\n OptionList,\n ValueSource,\n ValueSourceFlexibleOptions,\n ValueSources,\n} from '../types';\nimport { filterFieldsByComparator } from './filterFieldsByComparator';\nimport { getValueSourcesUtil } from './getValueSourcesUtil';\nimport { isFlexibleOptionArray, toFlatOptionArray, toFullOption } from './optGroupUtils';\n\nexport const getFieldsArray = (\n fields?: OptionList<FullField> | Record<string, FullField>\n): FullOption[] => {\n const fieldsArray = fields\n ? Array.isArray(fields)\n ? fields\n : Object.keys(fields)\n .map(fld => Object.assign({}, fields[fld], { name: fld }))\n // oxlint-disable-next-line no-array-sort\n .sort((a, b) => a.label.localeCompare(b.label))\n : [];\n return toFlatOptionArray(fieldsArray);\n};\n\nexport function fieldIsValidUtil(params: {\n fieldsFlat: FullField[];\n getValueSources?: (field: string, operator: string) => ValueSources | ValueSourceFlexibleOptions;\n fieldName: string;\n operator: DefaultOperatorName;\n subordinateFieldName?: string;\n}): boolean {\n const { fieldsFlat, fieldName, operator, subordinateFieldName, getValueSources } = params;\n\n const vsIncludes = (vs: ValueSource) => {\n const vss = getValueSourcesUtil(primaryField, operator, getValueSources);\n return isFlexibleOptionArray(vss) && vss.some(vso => vso.value === vs || vso.name === vs);\n };\n\n // If fields option was an empty array or undefined, then all identifiers\n // are considered valid.\n if (fieldsFlat.length === 0) return true;\n\n let valid = false;\n\n const primaryField = toFullOption(fieldsFlat.find(ff => ff.name === fieldName)!);\n if (primaryField) {\n valid = !(\n !subordinateFieldName &&\n operator !== 'notNull' &&\n operator !== 'null' &&\n !vsIncludes('value')\n );\n\n if (valid && !!subordinateFieldName) {\n if (vsIncludes('field') && fieldName !== subordinateFieldName) {\n const validSubordinateFields = filterFieldsByComparator(\n primaryField,\n fieldsFlat,\n operator\n ) as FullField[];\n if (!validSubordinateFields.some(vsf => vsf.name === subordinateFieldName)) {\n valid = false;\n }\n } else {\n valid = false;\n }\n }\n }\n\n return valid;\n}\n"],"mappings":";;;AAaA,MAAa,kBACX,WACiB;CACjB,MAAM,cAAc,SAChB,MAAM,QAAQ,MAAM,IAClB,SACA,OAAO,KAAK,MAAM,CAAC,CAChB,KAAI,QAAO,OAAO,OAAO,CAAC,GAAG,OAAO,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAEzD,MAAM,GAAG,MAAM,EAAE,MAAM,cAAc,EAAE,KAAK,CAAC,IAClD,CAAC;CACL,OAAOA,cAAAA,kBAAkB,WAAW;AACtC;AAEA,SAAgB,iBAAiB,QAMrB;CACV,MAAM,EAAE,YAAY,WAAW,UAAU,sBAAsB,oBAAoB;CAEnF,MAAM,cAAc,OAAoB;EACtC,MAAM,MAAMC,4BAAAA,oBAAoB,cAAc,UAAU,eAAe;EACvE,OAAOC,cAAAA,sBAAsB,GAAG,KAAK,IAAI,MAAK,QAAO,IAAI,UAAU,MAAM,IAAI,SAAS,EAAE;CAC1F;CAIA,IAAI,WAAW,WAAW,GAAG,OAAO;CAEpC,IAAI,QAAQ;CAEZ,MAAM,eAAeC,cAAAA,aAAa,WAAW,MAAK,OAAM,GAAG,SAAS,SAAS,CAAE;CAC/E,IAAI,cAAc;EAChB,QAAQ,EACN,CAAC,wBACD,aAAa,aACb,aAAa,UACb,CAAC,WAAW,OAAO;EAGrB,IAAI,SAAS,CAAC,CAAC,sBAAsB;GACnC,IAAI,WAAW,OAAO,KAAK,cAAc,sBAMnC;QAAA,CAL2BC,4BAAAA,yBAC7B,cACA,YACA,QAEwB,CAAC,CAAC,MAAK,QAAO,IAAI,SAAS,oBAAoB,GACvE,QAAQ;GAAA,OAGV,QAAQ;EAEZ;CACF;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"parserUtils-2VtG7m8L.js","names":["toFlatOptionArray","getValueSourcesUtil","isFlexibleOptionArray","toFullOption","filterFieldsByComparator"],"sources":["../src/utils/parserUtils.ts"],"sourcesContent":["import type {\n DefaultOperatorName,\n FullField,\n FullOption,\n OptionList,\n ValueSource,\n ValueSourceFlexibleOptions,\n ValueSources,\n} from '../types';\nimport { filterFieldsByComparator } from './filterFieldsByComparator';\nimport { getValueSourcesUtil } from './getValueSourcesUtil';\nimport { isFlexibleOptionArray, toFlatOptionArray, toFullOption } from './optGroupUtils';\n\nexport const getFieldsArray = (\n fields?: OptionList<FullField> | Record<string, FullField>\n): FullOption[] => {\n const fieldsArray = fields\n ? Array.isArray(fields)\n ? fields\n : Object.keys(fields)\n .map(fld => Object.assign({}, fields[fld], { name: fld }))\n // oxlint-disable-next-line no-array-sort\n .sort((a, b) => a.label.localeCompare(b.label))\n : [];\n return toFlatOptionArray(fieldsArray);\n};\n\nexport function fieldIsValidUtil(params: {\n fieldsFlat: FullField[];\n getValueSources?: (field: string, operator: string) => ValueSources | ValueSourceFlexibleOptions;\n fieldName: string;\n operator: DefaultOperatorName;\n subordinateFieldName?: string;\n}): boolean {\n const { fieldsFlat, fieldName, operator, subordinateFieldName, getValueSources } = params;\n\n const vsIncludes = (vs: ValueSource) => {\n const vss = getValueSourcesUtil(primaryField, operator, getValueSources);\n return isFlexibleOptionArray(vss) && vss.some(vso => vso.value === vs || vso.name === vs);\n };\n\n // If fields option was an empty array or undefined, then all identifiers\n // are considered valid.\n if (fieldsFlat.length === 0) return true;\n\n let valid = false;\n\n const primaryField = toFullOption(fieldsFlat.find(ff => ff.name === fieldName)!);\n if (primaryField) {\n valid = !(\n !subordinateFieldName &&\n operator !== 'notNull' &&\n operator !== 'null' &&\n !vsIncludes('value')\n );\n\n if (valid && !!subordinateFieldName) {\n if (vsIncludes('field') && fieldName !== subordinateFieldName) {\n const validSubordinateFields = filterFieldsByComparator(\n primaryField,\n fieldsFlat,\n operator\n ) as FullField[];\n if (!validSubordinateFields.some(vsf => vsf.name === subordinateFieldName)) {\n valid = false;\n }\n } else {\n valid = false;\n }\n }\n }\n\n return valid;\n}\n"],"mappings":";;;AAaA,MAAa,kBACX,WACiB;CACjB,MAAM,cAAc,SAChB,MAAM,QAAQ,MAAM,IAClB,SACA,OAAO,KAAK,MAAM,CAAC,CAChB,KAAI,QAAO,OAAO,OAAO,CAAC,GAAG,OAAO,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAEzD,MAAM,GAAG,MAAM,EAAE,MAAM,cAAc,EAAE,KAAK,CAAC,IAClD,CAAC;CACL,OAAOA,cAAAA,kBAAkB,WAAW;AACtC;AAEA,SAAgB,iBAAiB,QAMrB;CACV,MAAM,EAAE,YAAY,WAAW,UAAU,sBAAsB,oBAAoB;CAEnF,MAAM,cAAc,OAAoB;EACtC,MAAM,MAAMC,4BAAAA,oBAAoB,cAAc,UAAU,eAAe;EACvE,OAAOC,cAAAA,sBAAsB,GAAG,KAAK,IAAI,MAAK,QAAO,IAAI,UAAU,MAAM,IAAI,SAAS,EAAE;CAC1F;CAIA,IAAI,WAAW,WAAW,GAAG,OAAO;CAEpC,IAAI,QAAQ;CAEZ,MAAM,eAAeC,cAAAA,aAAa,WAAW,MAAK,OAAM,GAAG,SAAS,SAAS,CAAE;CAC/E,IAAI,cAAc;EAChB,QAAQ,EACN,CAAC,wBACD,aAAa,aACb,aAAa,UACb,CAAC,WAAW,OAAO;EAGrB,IAAI,SAAS,CAAC,CAAC,sBAAsB;GACnC,IAAI,WAAW,OAAO,KAAK,cAAc,sBAMnC;QAAA,CAL2BC,4BAAAA,yBAC7B,cACA,YACA,QAEwB,CAAC,CAAC,MAAK,QAAO,IAAI,SAAS,oBAAoB,GACvE,QAAQ;GAAA,OAGV,QAAQ;EAEZ;CACF;CAEA,OAAO;AACT"}
@@ -1,5 +1,5 @@
1
- import { F as toFlatOptionArray, I as toFullOption, k as isFlexibleOptionArray } from "./utils-CP5Jqy1P.mjs";
2
- import { a as getValueSourcesUtil, c as filterFieldsByComparator } from "./prepareQueryObjects-Dmyf3Wi_.mjs";
1
+ import { F as toFlatOptionArray, I as toFullOption, k as isFlexibleOptionArray } from "./utils-DLZCoyAh.mjs";
2
+ import { a as getValueSourcesUtil, c as filterFieldsByComparator } from "./prepareQueryObjects-DawsH4e3.mjs";
3
3
  //#region src/utils/parserUtils.ts
4
4
  const getFieldsArray = (fields) => {
5
5
  const fieldsArray = fields ? Array.isArray(fields) ? fields : Object.keys(fields).map((fld) => Object.assign({}, fields[fld], { name: fld })).sort((a, b) => a.label.localeCompare(b.label)) : [];
@@ -27,4 +27,4 @@ function fieldIsValidUtil(params) {
27
27
  //#endregion
28
28
  export { getFieldsArray as n, fieldIsValidUtil as t };
29
29
 
30
- //# sourceMappingURL=parserUtils-BKPstAaO.mjs.map
30
+ //# sourceMappingURL=parserUtils-BlafvoFb.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"parserUtils-BKPstAaO.mjs","names":[],"sources":["../src/utils/parserUtils.ts"],"sourcesContent":["import type {\n DefaultOperatorName,\n FullField,\n FullOption,\n OptionList,\n ValueSource,\n ValueSourceFlexibleOptions,\n ValueSources,\n} from '../types';\nimport { filterFieldsByComparator } from './filterFieldsByComparator';\nimport { getValueSourcesUtil } from './getValueSourcesUtil';\nimport { isFlexibleOptionArray, toFlatOptionArray, toFullOption } from './optGroupUtils';\n\nexport const getFieldsArray = (\n fields?: OptionList<FullField> | Record<string, FullField>\n): FullOption[] => {\n const fieldsArray = fields\n ? Array.isArray(fields)\n ? fields\n : Object.keys(fields)\n .map(fld => Object.assign({}, fields[fld], { name: fld }))\n // oxlint-disable-next-line no-array-sort\n .sort((a, b) => a.label.localeCompare(b.label))\n : [];\n return toFlatOptionArray(fieldsArray);\n};\n\nexport function fieldIsValidUtil(params: {\n fieldsFlat: FullField[];\n getValueSources?: (field: string, operator: string) => ValueSources | ValueSourceFlexibleOptions;\n fieldName: string;\n operator: DefaultOperatorName;\n subordinateFieldName?: string;\n}): boolean {\n const { fieldsFlat, fieldName, operator, subordinateFieldName, getValueSources } = params;\n\n const vsIncludes = (vs: ValueSource) => {\n const vss = getValueSourcesUtil(primaryField, operator, getValueSources);\n return isFlexibleOptionArray(vss) && vss.some(vso => vso.value === vs || vso.name === vs);\n };\n\n // If fields option was an empty array or undefined, then all identifiers\n // are considered valid.\n if (fieldsFlat.length === 0) return true;\n\n let valid = false;\n\n const primaryField = toFullOption(fieldsFlat.find(ff => ff.name === fieldName)!);\n if (primaryField) {\n valid = !(\n !subordinateFieldName &&\n operator !== 'notNull' &&\n operator !== 'null' &&\n !vsIncludes('value')\n );\n\n if (valid && !!subordinateFieldName) {\n if (vsIncludes('field') && fieldName !== subordinateFieldName) {\n const validSubordinateFields = filterFieldsByComparator(\n primaryField,\n fieldsFlat,\n operator\n ) as FullField[];\n if (!validSubordinateFields.some(vsf => vsf.name === subordinateFieldName)) {\n valid = false;\n }\n } else {\n valid = false;\n }\n }\n }\n\n return valid;\n}\n"],"mappings":";;;AAaA,MAAa,kBACX,WACiB;CACjB,MAAM,cAAc,SAChB,MAAM,QAAQ,MAAM,IAClB,SACA,OAAO,KAAK,MAAM,CAAC,CAChB,KAAI,QAAO,OAAO,OAAO,CAAC,GAAG,OAAO,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAEzD,MAAM,GAAG,MAAM,EAAE,MAAM,cAAc,EAAE,KAAK,CAAC,IAClD,CAAC;CACL,OAAO,kBAAkB,WAAW;AACtC;AAEA,SAAgB,iBAAiB,QAMrB;CACV,MAAM,EAAE,YAAY,WAAW,UAAU,sBAAsB,oBAAoB;CAEnF,MAAM,cAAc,OAAoB;EACtC,MAAM,MAAM,oBAAoB,cAAc,UAAU,eAAe;EACvE,OAAO,sBAAsB,GAAG,KAAK,IAAI,MAAK,QAAO,IAAI,UAAU,MAAM,IAAI,SAAS,EAAE;CAC1F;CAIA,IAAI,WAAW,WAAW,GAAG,OAAO;CAEpC,IAAI,QAAQ;CAEZ,MAAM,eAAe,aAAa,WAAW,MAAK,OAAM,GAAG,SAAS,SAAS,CAAE;CAC/E,IAAI,cAAc;EAChB,QAAQ,EACN,CAAC,wBACD,aAAa,aACb,aAAa,UACb,CAAC,WAAW,OAAO;EAGrB,IAAI,SAAS,CAAC,CAAC,sBAAsB;GACnC,IAAI,WAAW,OAAO,KAAK,cAAc,sBAMnC;QAAA,CAL2B,yBAC7B,cACA,YACA,QAEwB,CAAC,CAAC,MAAK,QAAO,IAAI,SAAS,oBAAoB,GACvE,QAAQ;GAAA,OAGV,QAAQ;EAEZ;CACF;CAEA,OAAO;AACT"}
1
+ {"version":3,"file":"parserUtils-BlafvoFb.mjs","names":[],"sources":["../src/utils/parserUtils.ts"],"sourcesContent":["import type {\n DefaultOperatorName,\n FullField,\n FullOption,\n OptionList,\n ValueSource,\n ValueSourceFlexibleOptions,\n ValueSources,\n} from '../types';\nimport { filterFieldsByComparator } from './filterFieldsByComparator';\nimport { getValueSourcesUtil } from './getValueSourcesUtil';\nimport { isFlexibleOptionArray, toFlatOptionArray, toFullOption } from './optGroupUtils';\n\nexport const getFieldsArray = (\n fields?: OptionList<FullField> | Record<string, FullField>\n): FullOption[] => {\n const fieldsArray = fields\n ? Array.isArray(fields)\n ? fields\n : Object.keys(fields)\n .map(fld => Object.assign({}, fields[fld], { name: fld }))\n // oxlint-disable-next-line no-array-sort\n .sort((a, b) => a.label.localeCompare(b.label))\n : [];\n return toFlatOptionArray(fieldsArray);\n};\n\nexport function fieldIsValidUtil(params: {\n fieldsFlat: FullField[];\n getValueSources?: (field: string, operator: string) => ValueSources | ValueSourceFlexibleOptions;\n fieldName: string;\n operator: DefaultOperatorName;\n subordinateFieldName?: string;\n}): boolean {\n const { fieldsFlat, fieldName, operator, subordinateFieldName, getValueSources } = params;\n\n const vsIncludes = (vs: ValueSource) => {\n const vss = getValueSourcesUtil(primaryField, operator, getValueSources);\n return isFlexibleOptionArray(vss) && vss.some(vso => vso.value === vs || vso.name === vs);\n };\n\n // If fields option was an empty array or undefined, then all identifiers\n // are considered valid.\n if (fieldsFlat.length === 0) return true;\n\n let valid = false;\n\n const primaryField = toFullOption(fieldsFlat.find(ff => ff.name === fieldName)!);\n if (primaryField) {\n valid = !(\n !subordinateFieldName &&\n operator !== 'notNull' &&\n operator !== 'null' &&\n !vsIncludes('value')\n );\n\n if (valid && !!subordinateFieldName) {\n if (vsIncludes('field') && fieldName !== subordinateFieldName) {\n const validSubordinateFields = filterFieldsByComparator(\n primaryField,\n fieldsFlat,\n operator\n ) as FullField[];\n if (!validSubordinateFields.some(vsf => vsf.name === subordinateFieldName)) {\n valid = false;\n }\n } else {\n valid = false;\n }\n }\n }\n\n return valid;\n}\n"],"mappings":";;;AAaA,MAAa,kBACX,WACiB;CACjB,MAAM,cAAc,SAChB,MAAM,QAAQ,MAAM,IAClB,SACA,OAAO,KAAK,MAAM,CAAC,CAChB,KAAI,QAAO,OAAO,OAAO,CAAC,GAAG,OAAO,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAC,CAEzD,MAAM,GAAG,MAAM,EAAE,MAAM,cAAc,EAAE,KAAK,CAAC,IAClD,CAAC;CACL,OAAO,kBAAkB,WAAW;AACtC;AAEA,SAAgB,iBAAiB,QAMrB;CACV,MAAM,EAAE,YAAY,WAAW,UAAU,sBAAsB,oBAAoB;CAEnF,MAAM,cAAc,OAAoB;EACtC,MAAM,MAAM,oBAAoB,cAAc,UAAU,eAAe;EACvE,OAAO,sBAAsB,GAAG,KAAK,IAAI,MAAK,QAAO,IAAI,UAAU,MAAM,IAAI,SAAS,EAAE;CAC1F;CAIA,IAAI,WAAW,WAAW,GAAG,OAAO;CAEpC,IAAI,QAAQ;CAEZ,MAAM,eAAe,aAAa,WAAW,MAAK,OAAM,GAAG,SAAS,SAAS,CAAE;CAC/E,IAAI,cAAc;EAChB,QAAQ,EACN,CAAC,wBACD,aAAa,aACb,aAAa,UACb,CAAC,WAAW,OAAO;EAGrB,IAAI,SAAS,CAAC,CAAC,sBAAsB;GACnC,IAAI,WAAW,OAAO,KAAK,cAAc,sBAMnC;QAAA,CAL2B,yBAC7B,cACA,YACA,QAEwB,CAAC,CAAC,MAAK,QAAO,IAAI,SAAS,oBAAoB,GACvE,QAAQ;GAAA,OAGV,QAAQ;EAEZ;CACF;CAEA,OAAO;AACT"}
@@ -1,4 +1,4 @@
1
- const require_utils = require("./utils-e-7KHkjV.js");
1
+ const require_utils = require("./utils-B4E1-ZvU.js");
2
2
  const require_objectUtils = require("./objectUtils-DfnEmDSV.js");
3
3
  //#region src/utils/filterFieldsByComparator.ts
4
4
  const filterByComparator = (field, operator, fieldToCompare) => {
@@ -212,4 +212,4 @@ Object.defineProperty(exports, "uuidV4regex", {
212
212
  }
213
213
  });
214
214
 
215
- //# sourceMappingURL=prepareQueryObjects-Dj9cTl9D.js.map
215
+ //# sourceMappingURL=prepareQueryObjects-DJ_VjOLb.js.map