@react-querybuilder/core 8.9.1 → 8.10.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 (106) hide show
  1. package/dist/arrayUtils-C9sO4qLO.mjs +50 -0
  2. package/dist/arrayUtils-C9sO4qLO.mjs.map +1 -0
  3. package/dist/arrayUtils-QxZOZTf6.js +73 -0
  4. package/dist/arrayUtils-QxZOZTf6.js.map +1 -0
  5. package/dist/basic-BmpEwexQ.d.mts +363 -0
  6. package/dist/basic-CDDA-KZa.d.ts +363 -0
  7. package/dist/cjs/react-querybuilder_core.cjs.development.d.ts +569 -1252
  8. package/dist/cjs/react-querybuilder_core.cjs.development.js +430 -140
  9. package/dist/cjs/react-querybuilder_core.cjs.development.js.map +1 -1
  10. package/dist/cjs/react-querybuilder_core.cjs.production.d.ts +569 -1252
  11. package/dist/cjs/react-querybuilder_core.cjs.production.js +1 -1
  12. package/dist/cjs/react-querybuilder_core.cjs.production.js.map +1 -1
  13. package/dist/convertQuery-BUgyz1GA.mjs +75 -0
  14. package/dist/convertQuery-BUgyz1GA.mjs.map +1 -0
  15. package/dist/export-Ccjfea21.d.mts +453 -0
  16. package/dist/{export-DyrnTh6K.d.ts → export-GUuxJ7zR.d.ts} +3 -2
  17. package/dist/formatQuery.d.mts +668 -0
  18. package/dist/formatQuery.d.ts +3 -2
  19. package/dist/formatQuery.js +217 -87
  20. package/dist/formatQuery.js.map +1 -1
  21. package/dist/formatQuery.mjs +2496 -0
  22. package/dist/formatQuery.mjs.map +1 -0
  23. package/dist/{import-Cksobmln.d.ts → import-D-hm1phN.d.ts} +2 -2
  24. package/dist/import-Dxevzw_-.d.mts +28 -0
  25. package/dist/isRuleGroup-CGe_rb2w.mjs +40 -0
  26. package/dist/isRuleGroup-CGe_rb2w.mjs.map +1 -0
  27. package/dist/isRuleGroup-DqAs2x4E.js.map +1 -1
  28. package/dist/{optGroupUtils-CXLgyg2i.js → optGroupUtils-B0hTpodo.js} +114 -1
  29. package/dist/optGroupUtils-B0hTpodo.js.map +1 -0
  30. package/dist/optGroupUtils-DrubUpx0.mjs +185 -0
  31. package/dist/optGroupUtils-DrubUpx0.mjs.map +1 -0
  32. package/dist/parseCEL.d.mts +315 -0
  33. package/dist/parseCEL.d.ts +292 -11
  34. package/dist/parseCEL.js +114 -30
  35. package/dist/parseCEL.js.map +1 -1
  36. package/dist/parseCEL.mjs +2631 -0
  37. package/dist/parseCEL.mjs.map +1 -0
  38. package/dist/parseJSONata.d.mts +37 -0
  39. package/dist/parseJSONata.d.ts +3 -2
  40. package/dist/parseJSONata.js +49 -77
  41. package/dist/parseJSONata.js.map +1 -1
  42. package/dist/parseJSONata.mjs +267 -0
  43. package/dist/parseJSONata.mjs.map +1 -0
  44. package/dist/parseJsonLogic.d.mts +37 -0
  45. package/dist/parseJsonLogic.d.ts +4 -3
  46. package/dist/parseJsonLogic.js +5 -6
  47. package/dist/parseJsonLogic.js.map +1 -1
  48. package/dist/parseJsonLogic.mjs +190 -0
  49. package/dist/parseJsonLogic.mjs.map +1 -0
  50. package/dist/parseMongoDB.d.mts +80 -0
  51. package/dist/parseMongoDB.d.ts +3 -2
  52. package/dist/parseMongoDB.js +15 -16
  53. package/dist/parseMongoDB.js.map +1 -1
  54. package/dist/parseMongoDB.mjs +266 -0
  55. package/dist/parseMongoDB.mjs.map +1 -0
  56. package/dist/parseNumber-B_-sR6d5.mjs +24 -0
  57. package/dist/parseNumber-B_-sR6d5.mjs.map +1 -0
  58. package/dist/{parseNumber-Bcys1kOH.js → parseNumber-D4iQDxK-.js} +1 -1
  59. package/dist/{parseNumber-Bcys1kOH.js.map → parseNumber-D4iQDxK-.js.map} +1 -1
  60. package/dist/parseSQL.d.mts +38 -0
  61. package/dist/parseSQL.d.ts +3 -2
  62. package/dist/parseSQL.js +11 -15
  63. package/dist/parseSQL.js.map +1 -1
  64. package/dist/parseSQL.mjs +6622 -0
  65. package/dist/parseSQL.mjs.map +1 -0
  66. package/dist/parseSpEL.d.mts +35 -0
  67. package/dist/parseSpEL.d.ts +3 -2
  68. package/dist/parseSpEL.js +7 -9
  69. package/dist/parseSpEL.js.map +1 -1
  70. package/dist/parseSpEL.mjs +272 -0
  71. package/dist/parseSpEL.mjs.map +1 -0
  72. package/dist/{prepareQueryObjects-BqFEs4eV.js → prepareQueryObjects-BOUWfel5.js} +4 -5
  73. package/dist/prepareQueryObjects-BOUWfel5.js.map +1 -0
  74. package/dist/prepareQueryObjects-CJNpnGcJ.mjs +153 -0
  75. package/dist/prepareQueryObjects-CJNpnGcJ.mjs.map +1 -0
  76. package/dist/query-builder-layout.css +1 -1
  77. package/dist/query-builder-layout.css.map +1 -1
  78. package/dist/query-builder.css +1 -1
  79. package/dist/query-builder.css.map +1 -1
  80. package/dist/react-querybuilder_core.d.mts +569 -1252
  81. package/dist/react-querybuilder_core.legacy-esm.d.ts +569 -1252
  82. package/dist/react-querybuilder_core.legacy-esm.js +430 -136
  83. package/dist/react-querybuilder_core.legacy-esm.js.map +1 -1
  84. package/dist/react-querybuilder_core.mjs +426 -141
  85. package/dist/react-querybuilder_core.mjs.map +1 -1
  86. package/dist/react-querybuilder_core.production.d.mts +569 -1252
  87. package/dist/react-querybuilder_core.production.mjs +1 -1
  88. package/dist/react-querybuilder_core.production.mjs.map +1 -1
  89. package/dist/styles/_layout.scss +61 -17
  90. package/dist/styles/_main.scss +17 -4
  91. package/dist/{transformQuery-FL_nlpp5.js → transformQuery-CWDPogO5.js} +1 -1
  92. package/dist/{transformQuery-FL_nlpp5.js.map → transformQuery-CWDPogO5.js.map} +1 -1
  93. package/dist/transformQuery-DHvtgDgZ.mjs +41 -0
  94. package/dist/transformQuery-DHvtgDgZ.mjs.map +1 -0
  95. package/dist/transformQuery.d.mts +118 -0
  96. package/dist/transformQuery.d.ts +1 -1
  97. package/dist/transformQuery.js +1 -1
  98. package/dist/transformQuery.mjs +4 -0
  99. package/package.json +78 -28
  100. package/dist/arrayUtils-D5EoIsKP.js +0 -164
  101. package/dist/arrayUtils-D5EoIsKP.js.map +0 -1
  102. package/dist/basic-C8xXKHIA.d.ts +0 -1235
  103. package/dist/objectUtils-BBZSfZJz.js +0 -17
  104. package/dist/objectUtils-BBZSfZJz.js.map +0 -1
  105. package/dist/optGroupUtils-CXLgyg2i.js.map +0 -1
  106. package/dist/prepareQueryObjects-BqFEs4eV.js.map +0 -1
@@ -84,9 +84,13 @@
84
84
  /* #endregion */
85
85
 
86
86
  /* #region Branches */
87
- .queryBuilder-branches {
87
+ @mixin branch-layout-styles($direction) {
88
+ $ltr-after: if($direction == rtl, before, after);
89
+ $ltr-before: if($direction == rtl, after, before);
90
+ $margin-side: if($direction == rtl, right, left);
91
+
88
92
  .ruleGroup-body {
89
- margin-left: calc(2 * var(--#{$rqb-var-prefix}branch-indent));
93
+ margin-#{$margin-side}: calc(2 * var(--#{$rqb-var-prefix}branch-indent));
90
94
  }
91
95
 
92
96
  .rule,
@@ -97,26 +101,40 @@
97
101
  &::after {
98
102
  content: '';
99
103
  width: var(--#{$rqb-var-prefix}branch-indent);
100
- left: calc(
104
+ #{$margin-side}: calc(
101
105
  -1 * (var(--#{$rqb-var-prefix}branch-indent) + var(--#{$rqb-var-prefix}branch-width))
102
106
  );
103
107
  border-radius: 0;
104
108
  position: absolute;
105
109
  }
106
110
 
107
- &::before {
111
+ &::#{$ltr-before} {
108
112
  top: calc(-1 * var(--#{$rqb-var-prefix}spacing));
109
113
  height: calc(50% + var(--#{$rqb-var-prefix}spacing));
110
- border-width: 0 0 var(--#{$rqb-var-prefix}branch-width) var(--#{$rqb-var-prefix}branch-width);
114
+ @if $direction == rtl {
115
+ border-width: 0
116
+ var(--#{$rqb-var-prefix}branch-width)
117
+ var(--#{$rqb-var-prefix}branch-width)
118
+ 0;
119
+ } @else {
120
+ border-width: 0
121
+ 0
122
+ var(--#{$rqb-var-prefix}branch-width)
123
+ var(--#{$rqb-var-prefix}branch-width);
124
+ }
111
125
  }
112
126
 
113
- &::after {
127
+ &::#{$ltr-after} {
114
128
  top: 50%;
115
129
  height: 50%;
116
- border-width: 0 0 0 var(--#{$rqb-var-prefix}branch-width);
130
+ @if $direction == rtl {
131
+ border-width: 0 var(--#{$rqb-var-prefix}branch-width) 0 0;
132
+ } @else {
133
+ border-width: 0 0 0 var(--#{$rqb-var-prefix}branch-width);
134
+ }
117
135
  }
118
136
 
119
- &:last-child::after {
137
+ &:last-child::#{$ltr-after} {
120
138
  display: none;
121
139
  }
122
140
  }
@@ -125,7 +143,7 @@
125
143
  .ruleGroup .ruleGroup {
126
144
  &::before,
127
145
  &::after {
128
- left: calc(
146
+ #{$margin-side}: calc(
129
147
  -1 *
130
148
  (
131
149
  var(--#{$rqb-var-prefix}branch-indent) + var(--#{$rqb-var-prefix}branch-width) +
@@ -134,12 +152,12 @@
134
152
  );
135
153
  }
136
154
 
137
- &::before {
155
+ &::#{$ltr-before} {
138
156
  top: calc(-1 * (var(--#{$rqb-var-prefix}spacing) + var(--#{$rqb-var-prefix}border-width)));
139
157
  height: calc(50% + var(--#{$rqb-var-prefix}spacing) + var(--#{$rqb-var-prefix}border-width));
140
158
  }
141
159
 
142
- &::after {
160
+ &::#{$ltr-after} {
143
161
  height: calc(50% + var(--#{$rqb-var-prefix}border-width));
144
162
  }
145
163
  }
@@ -147,24 +165,40 @@
147
165
  .betweenRules {
148
166
  position: relative;
149
167
 
150
- &::before {
168
+ &::#{$ltr-before} {
151
169
  content: '';
152
170
  width: var(--#{$rqb-var-prefix}branch-indent);
153
- left: calc(
171
+ #{$margin-side}: calc(
154
172
  -1 * (var(--#{$rqb-var-prefix}branch-indent) + var(--#{$rqb-var-prefix}branch-width))
155
173
  );
156
174
  border-radius: 0;
157
175
  position: absolute;
158
176
  top: calc(-1 * var(--#{$rqb-var-prefix}spacing));
159
177
  height: calc(100% + var(--#{$rqb-var-prefix}spacing));
160
- border-width: 0 0 0 var(--#{$rqb-var-prefix}branch-width);
178
+ @if $direction == rtl {
179
+ border-width: 0 var(--#{$rqb-var-prefix}branch-width) 0 0;
180
+ } @else {
181
+ border-width: 0 0 0 var(--#{$rqb-var-prefix}branch-width);
182
+ }
161
183
  }
162
184
  }
163
185
  }
186
+
187
+ /* LTR */
188
+ .queryBuilder-branches:dir(ltr) {
189
+ @include branch-layout-styles(ltr);
190
+ }
191
+
192
+ /* RTL */
193
+ .queryBuilder-branches:dir(rtl) {
194
+ @include branch-layout-styles(rtl);
195
+ }
164
196
  /* #endregion */
165
197
 
166
198
  /* #region Justified */
167
- .queryBuilder-justified {
199
+ @mixin justified-auto-margin($direction) {
200
+ $margin-side: if($direction == rtl, right, left);
201
+
168
202
  .ruleGroup-combinators,
169
203
  .ruleGroup-notToggle,
170
204
  .shiftActions,
@@ -187,15 +221,25 @@
187
221
  & + .rule-cloneRule,
188
222
  & + .rule-lock,
189
223
  & + .rule-remove {
190
- margin-left: auto !important;
224
+ margin-#{$margin-side}: auto !important;
191
225
  }
192
226
  }
193
227
 
194
228
  .ruleGroup-addRule,
195
229
  .ruleGroup-addGroup {
196
230
  &:first-child {
197
- margin-left: auto !important;
231
+ margin-#{$margin-side}: auto !important;
198
232
  }
199
233
  }
200
234
  }
235
+
236
+ /* LTR */
237
+ .queryBuilder-justified:dir(ltr) {
238
+ @include justified-auto-margin(ltr);
239
+ }
240
+
241
+ /* RTL */
242
+ .queryBuilder-justified:dir(rtl) {
243
+ @include justified-auto-margin(rtl);
244
+ }
201
245
  /* #endregion */
@@ -88,7 +88,10 @@
88
88
  /* #endregion */
89
89
 
90
90
  /* #region Branch styles */
91
- .queryBuilder-branches {
91
+ @mixin branch-styles($direction) {
92
+ $before-after: if($direction == rtl, after, before);
93
+ $border-side: if($direction == rtl, right, left);
94
+
92
95
  .rule,
93
96
  .ruleGroup .ruleGroup {
94
97
  &::before,
@@ -97,18 +100,28 @@
97
100
  border-style: var(--#{$rqb-var-prefix}branch-style);
98
101
  }
99
102
 
100
- &:last-child::before {
101
- border-bottom-left-radius: var(--#{$rqb-var-prefix}branch-radius);
103
+ &:last-child::#{$before-after} {
104
+ border-bottom-#{$border-side}-radius: var(--#{$rqb-var-prefix}branch-radius);
102
105
  }
103
106
  }
104
107
 
105
108
  .betweenRules {
106
109
  position: relative;
107
110
 
108
- &::before {
111
+ &::#{$before-after} {
109
112
  border-color: var(--#{$rqb-var-prefix}branch-color);
110
113
  border-style: var(--#{$rqb-var-prefix}branch-style);
111
114
  }
112
115
  }
113
116
  }
117
+
118
+ /* LTR */
119
+ .queryBuilder-branches:dir(ltr) {
120
+ @include branch-styles(ltr);
121
+ }
122
+
123
+ /* RTL */
124
+ .queryBuilder-branches:dir(rtl) {
125
+ @include branch-styles(rtl);
126
+ }
114
127
  /* #endregion */
@@ -44,4 +44,4 @@ Object.defineProperty(exports, 'transformQuery', {
44
44
  return transformQuery;
45
45
  }
46
46
  });
47
- //# sourceMappingURL=transformQuery-FL_nlpp5.js.map
47
+ //# sourceMappingURL=transformQuery-CWDPogO5.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transformQuery-FL_nlpp5.js","names":["isRuleGroupType","isRuleGroup"],"sources":["../src/utils/transformQuery.ts"],"sourcesContent":["/**\n * Recursively steps through a query object ({@link index!RuleGroupType RuleGroupType} or {@link index!RuleGroupTypeIC RuleGroupTypeIC}),\n * passing each {@link index!RuleType RuleType} object to a provided `ruleProcessor` function and returning a\n * new query object if there were any referential changes.\n *\n * @module transformQuery\n */\n\nimport { produce } from 'immer';\nimport type { RuleGroupType, RuleGroupTypeAny, RuleGroupTypeIC, RuleType } from '../types';\nimport { isRuleGroup, isRuleGroupType } from './isRuleGroup';\n\nconst remapProperties = (\n // oxlint-disable-next-line typescript/no-explicit-any\n obj: Record<string, any>,\n propertyMap: Record<string, string | false>,\n deleteRemappedProperties: boolean\n) =>\n produce(obj, draft => {\n for (const [k, v] of Object.entries(propertyMap)) {\n if (v === false) {\n delete draft[k];\n } else if (!!v && k !== v && k in draft) {\n draft[v] = draft[k];\n if (deleteRemappedProperties) {\n delete draft[k];\n }\n }\n }\n });\n\n/**\n * Options object for {@link index!transformQuery transformQuery}.\n */\nexport interface TransformQueryOptions<RG extends RuleGroupTypeAny = RuleGroupType> {\n /**\n * When a rule is encountered in the hierarchy, it will be replaced\n * with the result of this function.\n *\n * @defaultValue `r => r`\n */\n // oxlint-disable-next-line typescript/no-explicit-any\n ruleProcessor?: (rule: RuleType) => any;\n /**\n * When a group is encountered in the hierarchy (including the root group, the\n * query itself), it will be replaced with the result of this function.\n *\n * @defaultValue `rg => rg`\n */\n // oxlint-disable-next-line typescript/no-explicit-any\n ruleGroupProcessor?: (ruleGroup: RG) => Record<string, any>;\n /**\n * For each rule and group in the query, any properties matching a key\n * in this object will be renamed to the corresponding value. To retain both\n * the new _and_ the original properties, set `deleteRemappedProperties`\n * to `false`.\n *\n * If a key has a value of `false`, the corresponding property will be removed\n * without being copied to a new property name. (Warning: `{ rules: false }`\n * will prevent recursion and only return the processed root group.)\n *\n * @defaultValue `{}`\n *\n * @example\n * ```\n * transformQuery(\n * { combinator: 'and', not: true, rules: [] },\n * { propertyMap: { combinator: 'AndOr', not: false } }\n * )\n * // Returns: { AndOr: 'and', rules: [] }\n * ```\n */\n propertyMap?: Record<string, string | false>;\n /**\n * Any combinator values (including independent combinators) will be translated\n * from the key in this object to the value.\n *\n * @defaultValue `{}`\n *\n * @example\n * ```\n * transformQuery(\n * { combinator: 'and', rules: [] },\n * { combinatorMap: { and: '&&', or: '||' } }\n * )\n * // Returns: { combinator: '&&', rules: [] }\n * ```\n */\n combinatorMap?: Record<string, string>;\n /**\n * Any operator values will be translated from the key in this object to the value.\n *\n * @defaultValue `{}`\n *\n * @example\n * ```\n * transformQuery(\n * { combinator: 'and', rules: [{ field: 'name', operator: '=', value: 'Steve Vai' }] },\n * { operatorMap: { '=': 'is' } }\n * )\n * // Returns:\n * // {\n * // combinator: 'and',\n * // rules: [{ field: 'name', operator: 'is', value: 'Steve Vai' }]\n * // }\n * ```\n */\n operatorMap?: Record<string, string>;\n /**\n * Prevents the `path` property (see {@link index!Path Path}) from being added to each\n * rule and group in the hierarchy.\n *\n * @defaultValue `false`\n */\n omitPath?: boolean;\n /**\n * Original properties remapped according to the `propertyMap` option will be removed.\n *\n * @defaultValue `true`\n *\n * @example\n * ```\n * transformQuery(\n * { combinator: 'and', rules: [] },\n * { propertyMap: { combinator: 'AndOr' }, deleteRemappedProperties: false }\n * )\n * // Returns: { combinator: 'and', AndOr: 'and', rules: [] }\n * ```\n */\n deleteRemappedProperties?: boolean;\n}\n\n/**\n * Recursively process a query heirarchy using this versatile utility function.\n *\n * [Documentation](https://react-querybuilder.js.org/docs/utils/misc#transformquery)\n */\nexport function transformQuery(\n query: RuleGroupType,\n options?: TransformQueryOptions\n // oxlint-disable-next-line typescript/no-explicit-any\n): any;\n/**\n * Recursively process a query heirarchy with independent combinators using this\n * versatile utility function.\n *\n * [Documentation](https://react-querybuilder.js.org/docs/utils/misc#transformquery)\n */\nexport function transformQuery(\n query: RuleGroupTypeIC,\n options?: TransformQueryOptions<RuleGroupTypeIC>\n // oxlint-disable-next-line typescript/no-explicit-any\n): any;\nexport function transformQuery<RG extends RuleGroupTypeAny>(\n query: RG,\n options: TransformQueryOptions<RG> = {}\n) {\n const {\n ruleProcessor = r => r,\n ruleGroupProcessor = rg => rg,\n propertyMap = {},\n combinatorMap = {},\n operatorMap = {},\n omitPath = false,\n deleteRemappedProperties = true,\n } = options;\n\n // oxlint-disable-next-line typescript/no-explicit-any\n const processGroup = (rg: RuleGroupTypeAny): any => ({\n ...ruleGroupProcessor(\n remapProperties(\n {\n ...rg,\n ...(isRuleGroupType(rg)\n ? { combinator: combinatorMap[rg.combinator] ?? rg.combinator }\n : {}),\n },\n propertyMap,\n deleteRemappedProperties\n ) as RG\n ),\n ...(propertyMap['rules'] === false\n ? null\n : {\n // oxlint-disable-next-line typescript/no-explicit-any\n [propertyMap['rules'] ?? 'rules']: rg.rules.map((r: any, idx) => {\n const pathObject = omitPath ? null : { path: [...rg.path!, idx] };\n if (typeof r === 'string') {\n // independent combinators\n return combinatorMap[r] ?? r;\n } else if (isRuleGroup(r)) {\n // sub-groups\n return processGroup({ ...r, ...pathObject });\n }\n // rules\n return ruleProcessor(\n remapProperties(\n {\n ...r,\n ...pathObject,\n ...('operator' in r ? { operator: operatorMap[r.operator] ?? r.operator } : {}),\n },\n propertyMap,\n deleteRemappedProperties\n ) as RuleType\n );\n }),\n }),\n });\n\n return processGroup({ ...query, ...(omitPath ? null : { path: [] }) });\n}\n"],"mappings":";;;;;AAYA,MAAM,mBAEJ,KACA,aACA,gDAEQ,MAAK,UAAS;AACpB,MAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,YAAY,CAC9C,KAAI,MAAM,MACR,QAAO,MAAM;UACJ,CAAC,CAAC,KAAK,MAAM,KAAK,KAAK,OAAO;AACvC,QAAM,KAAK,MAAM;AACjB,MAAI,yBACF,QAAO,MAAM;;EAInB;AA4HJ,SAAgB,eACd,OACA,UAAqC,EAAE,EACvC;CACA,MAAM,EACJ,iBAAgB,MAAK,GACrB,sBAAqB,OAAM,IAC3B,cAAc,EAAE,EAChB,gBAAgB,EAAE,EAClB,cAAc,EAAE,EAChB,WAAW,OACX,2BAA2B,SACzB;CAGJ,MAAM,gBAAgB,QAA+B;EACnD,GAAG,mBACD,gBACE;GACE,GAAG;GACH,GAAIA,oCAAgB,GAAG,GACnB,EAAE,YAAY,cAAc,GAAG,eAAe,GAAG,YAAY,GAC7D,EAAE;GACP,EACD,aACA,yBACD,CACF;EACD,GAAI,YAAY,aAAa,QACzB,OACA,GAEG,YAAY,YAAY,UAAU,GAAG,MAAM,KAAK,GAAQ,QAAQ;GAC/D,MAAM,aAAa,WAAW,OAAO,EAAE,MAAM,CAAC,GAAG,GAAG,MAAO,IAAI,EAAE;AACjE,OAAI,OAAO,MAAM,SAEf,QAAO,cAAc,MAAM;YAClBC,gCAAY,EAAE,CAEvB,QAAO,aAAa;IAAE,GAAG;IAAG,GAAG;IAAY,CAAC;AAG9C,UAAO,cACL,gBACE;IACE,GAAG;IACH,GAAG;IACH,GAAI,cAAc,IAAI,EAAE,UAAU,YAAY,EAAE,aAAa,EAAE,UAAU,GAAG,EAAE;IAC/E,EACD,aACA,yBACD,CACF;IACD,EACH;EACN;AAED,QAAO,aAAa;EAAE,GAAG;EAAO,GAAI,WAAW,OAAO,EAAE,MAAM,EAAE,EAAE;EAAG,CAAC"}
1
+ {"version":3,"file":"transformQuery-CWDPogO5.js","names":["isRuleGroupType","isRuleGroup"],"sources":["../src/utils/transformQuery.ts"],"sourcesContent":["/**\n * Recursively steps through a query object ({@link index!RuleGroupType RuleGroupType} or {@link index!RuleGroupTypeIC RuleGroupTypeIC}),\n * passing each {@link index!RuleType RuleType} object to a provided `ruleProcessor` function and returning a\n * new query object if there were any referential changes.\n *\n * @module transformQuery\n */\n\nimport { produce } from 'immer';\nimport type { RuleGroupType, RuleGroupTypeAny, RuleGroupTypeIC, RuleType } from '../types';\nimport { isRuleGroup, isRuleGroupType } from './isRuleGroup';\n\nconst remapProperties = (\n // oxlint-disable-next-line typescript/no-explicit-any\n obj: Record<string, any>,\n propertyMap: Record<string, string | false>,\n deleteRemappedProperties: boolean\n) =>\n produce(obj, draft => {\n for (const [k, v] of Object.entries(propertyMap)) {\n if (v === false) {\n delete draft[k];\n } else if (!!v && k !== v && k in draft) {\n draft[v] = draft[k];\n if (deleteRemappedProperties) {\n delete draft[k];\n }\n }\n }\n });\n\n/**\n * Options object for {@link index!transformQuery transformQuery}.\n */\nexport interface TransformQueryOptions<RG extends RuleGroupTypeAny = RuleGroupType> {\n /**\n * When a rule is encountered in the hierarchy, it will be replaced\n * with the result of this function.\n *\n * @defaultValue `r => r`\n */\n // oxlint-disable-next-line typescript/no-explicit-any\n ruleProcessor?: (rule: RuleType) => any;\n /**\n * When a group is encountered in the hierarchy (including the root group, the\n * query itself), it will be replaced with the result of this function.\n *\n * @defaultValue `rg => rg`\n */\n // oxlint-disable-next-line typescript/no-explicit-any\n ruleGroupProcessor?: (ruleGroup: RG) => Record<string, any>;\n /**\n * For each rule and group in the query, any properties matching a key\n * in this object will be renamed to the corresponding value. To retain both\n * the new _and_ the original properties, set `deleteRemappedProperties`\n * to `false`.\n *\n * If a key has a value of `false`, the corresponding property will be removed\n * without being copied to a new property name. (Warning: `{ rules: false }`\n * will prevent recursion and only return the processed root group.)\n *\n * @defaultValue `{}`\n *\n * @example\n * ```\n * transformQuery(\n * { combinator: 'and', not: true, rules: [] },\n * { propertyMap: { combinator: 'AndOr', not: false } }\n * )\n * // Returns: { AndOr: 'and', rules: [] }\n * ```\n */\n propertyMap?: Record<string, string | false>;\n /**\n * Any combinator values (including independent combinators) will be translated\n * from the key in this object to the value.\n *\n * @defaultValue `{}`\n *\n * @example\n * ```\n * transformQuery(\n * { combinator: 'and', rules: [] },\n * { combinatorMap: { and: '&&', or: '||' } }\n * )\n * // Returns: { combinator: '&&', rules: [] }\n * ```\n */\n combinatorMap?: Record<string, string>;\n /**\n * Any operator values will be translated from the key in this object to the value.\n *\n * @defaultValue `{}`\n *\n * @example\n * ```\n * transformQuery(\n * { combinator: 'and', rules: [{ field: 'name', operator: '=', value: 'Steve Vai' }] },\n * { operatorMap: { '=': 'is' } }\n * )\n * // Returns:\n * // {\n * // combinator: 'and',\n * // rules: [{ field: 'name', operator: 'is', value: 'Steve Vai' }]\n * // }\n * ```\n */\n operatorMap?: Record<string, string>;\n /**\n * Prevents the `path` property (see {@link index!Path Path}) from being added to each\n * rule and group in the hierarchy.\n *\n * @defaultValue `false`\n */\n omitPath?: boolean;\n /**\n * Original properties remapped according to the `propertyMap` option will be removed.\n *\n * @defaultValue `true`\n *\n * @example\n * ```\n * transformQuery(\n * { combinator: 'and', rules: [] },\n * { propertyMap: { combinator: 'AndOr' }, deleteRemappedProperties: false }\n * )\n * // Returns: { combinator: 'and', AndOr: 'and', rules: [] }\n * ```\n */\n deleteRemappedProperties?: boolean;\n}\n\n/**\n * Recursively process a query heirarchy using this versatile utility function.\n *\n * [Documentation](https://react-querybuilder.js.org/docs/utils/misc#transformquery)\n */\nexport function transformQuery(\n query: RuleGroupType,\n options?: TransformQueryOptions\n // oxlint-disable-next-line typescript/no-explicit-any\n): any;\n/**\n * Recursively process a query heirarchy with independent combinators using this\n * versatile utility function.\n *\n * [Documentation](https://react-querybuilder.js.org/docs/utils/misc#transformquery)\n */\nexport function transformQuery(\n query: RuleGroupTypeIC,\n options?: TransformQueryOptions<RuleGroupTypeIC>\n // oxlint-disable-next-line typescript/no-explicit-any\n): any;\nexport function transformQuery<RG extends RuleGroupTypeAny>(\n query: RG,\n options: TransformQueryOptions<RG> = {}\n) {\n const {\n ruleProcessor = r => r,\n ruleGroupProcessor = rg => rg,\n propertyMap = {},\n combinatorMap = {},\n operatorMap = {},\n omitPath = false,\n deleteRemappedProperties = true,\n } = options;\n\n // oxlint-disable-next-line typescript/no-explicit-any\n const processGroup = (rg: RuleGroupTypeAny): any => ({\n ...ruleGroupProcessor(\n remapProperties(\n {\n ...rg,\n ...(isRuleGroupType(rg)\n ? { combinator: combinatorMap[rg.combinator] ?? rg.combinator }\n : {}),\n },\n propertyMap,\n deleteRemappedProperties\n ) as RG\n ),\n ...(propertyMap['rules'] === false\n ? null\n : {\n // oxlint-disable-next-line typescript/no-explicit-any\n [propertyMap['rules'] ?? 'rules']: rg.rules.map((r: any, idx) => {\n const pathObject = omitPath ? null : { path: [...rg.path!, idx] };\n if (typeof r === 'string') {\n // independent combinators\n return combinatorMap[r] ?? r;\n } else if (isRuleGroup(r)) {\n // sub-groups\n return processGroup({ ...r, ...pathObject });\n }\n // rules\n return ruleProcessor(\n remapProperties(\n {\n ...r,\n ...pathObject,\n ...('operator' in r ? { operator: operatorMap[r.operator] ?? r.operator } : {}),\n },\n propertyMap,\n deleteRemappedProperties\n ) as RuleType\n );\n }),\n }),\n });\n\n return processGroup({ ...query, ...(omitPath ? null : { path: [] }) });\n}\n"],"mappings":";;;;;AAYA,MAAM,mBAEJ,KACA,aACA,gDAEQ,MAAK,UAAS;AACpB,MAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,YAAY,CAC9C,KAAI,MAAM,MACR,QAAO,MAAM;UACJ,CAAC,CAAC,KAAK,MAAM,KAAK,KAAK,OAAO;AACvC,QAAM,KAAK,MAAM;AACjB,MAAI,yBACF,QAAO,MAAM;;EAInB;AA4HJ,SAAgB,eACd,OACA,UAAqC,EAAE,EACvC;CACA,MAAM,EACJ,iBAAgB,MAAK,GACrB,sBAAqB,OAAM,IAC3B,cAAc,EAAE,EAChB,gBAAgB,EAAE,EAClB,cAAc,EAAE,EAChB,WAAW,OACX,2BAA2B,SACzB;CAGJ,MAAM,gBAAgB,QAA+B;EACnD,GAAG,mBACD,gBACE;GACE,GAAG;GACH,GAAIA,oCAAgB,GAAG,GACnB,EAAE,YAAY,cAAc,GAAG,eAAe,GAAG,YAAY,GAC7D,EAAE;GACP,EACD,aACA,yBACD,CACF;EACD,GAAI,YAAY,aAAa,QACzB,OACA,GAEG,YAAY,YAAY,UAAU,GAAG,MAAM,KAAK,GAAQ,QAAQ;GAC/D,MAAM,aAAa,WAAW,OAAO,EAAE,MAAM,CAAC,GAAG,GAAG,MAAO,IAAI,EAAE;AACjE,OAAI,OAAO,MAAM,SAEf,QAAO,cAAc,MAAM;YAClBC,gCAAY,EAAE,CAEvB,QAAO,aAAa;IAAE,GAAG;IAAG,GAAG;IAAY,CAAC;AAG9C,UAAO,cACL,gBACE;IACE,GAAG;IACH,GAAG;IACH,GAAI,cAAc,IAAI,EAAE,UAAU,YAAY,EAAE,aAAa,EAAE,UAAU,GAAG,EAAE;IAC/E,EACD,aACA,yBACD,CACF;IACD,EACH;EACN;AAED,QAAO,aAAa;EAAE,GAAG;EAAO,GAAI,WAAW,OAAO,EAAE,MAAM,EAAE,EAAE;EAAG,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { isRuleGroup, isRuleGroupType } from "./isRuleGroup-CGe_rb2w.mjs";
2
+ import { produce } from "immer";
3
+
4
+ //#region src/utils/transformQuery.ts
5
+ const remapProperties = (obj, propertyMap, deleteRemappedProperties) => produce(obj, (draft) => {
6
+ for (const [k, v] of Object.entries(propertyMap)) if (v === false) delete draft[k];
7
+ else if (!!v && k !== v && k in draft) {
8
+ draft[v] = draft[k];
9
+ if (deleteRemappedProperties) delete draft[k];
10
+ }
11
+ });
12
+ function transformQuery(query, options = {}) {
13
+ const { ruleProcessor = (r) => r, ruleGroupProcessor = (rg) => rg, propertyMap = {}, combinatorMap = {}, operatorMap = {}, omitPath = false, deleteRemappedProperties = true } = options;
14
+ const processGroup = (rg) => ({
15
+ ...ruleGroupProcessor(remapProperties({
16
+ ...rg,
17
+ ...isRuleGroupType(rg) ? { combinator: combinatorMap[rg.combinator] ?? rg.combinator } : {}
18
+ }, propertyMap, deleteRemappedProperties)),
19
+ ...propertyMap["rules"] === false ? null : { [propertyMap["rules"] ?? "rules"]: rg.rules.map((r, idx) => {
20
+ const pathObject = omitPath ? null : { path: [...rg.path, idx] };
21
+ if (typeof r === "string") return combinatorMap[r] ?? r;
22
+ else if (isRuleGroup(r)) return processGroup({
23
+ ...r,
24
+ ...pathObject
25
+ });
26
+ return ruleProcessor(remapProperties({
27
+ ...r,
28
+ ...pathObject,
29
+ ..."operator" in r ? { operator: operatorMap[r.operator] ?? r.operator } : {}
30
+ }, propertyMap, deleteRemappedProperties));
31
+ }) }
32
+ });
33
+ return processGroup({
34
+ ...query,
35
+ ...omitPath ? null : { path: [] }
36
+ });
37
+ }
38
+
39
+ //#endregion
40
+ export { transformQuery };
41
+ //# sourceMappingURL=transformQuery-DHvtgDgZ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transformQuery-DHvtgDgZ.mjs","names":[],"sources":["../src/utils/transformQuery.ts"],"sourcesContent":["/**\n * Recursively steps through a query object ({@link index!RuleGroupType RuleGroupType} or {@link index!RuleGroupTypeIC RuleGroupTypeIC}),\n * passing each {@link index!RuleType RuleType} object to a provided `ruleProcessor` function and returning a\n * new query object if there were any referential changes.\n *\n * @module transformQuery\n */\n\nimport { produce } from 'immer';\nimport type { RuleGroupType, RuleGroupTypeAny, RuleGroupTypeIC, RuleType } from '../types';\nimport { isRuleGroup, isRuleGroupType } from './isRuleGroup';\n\nconst remapProperties = (\n // oxlint-disable-next-line typescript/no-explicit-any\n obj: Record<string, any>,\n propertyMap: Record<string, string | false>,\n deleteRemappedProperties: boolean\n) =>\n produce(obj, draft => {\n for (const [k, v] of Object.entries(propertyMap)) {\n if (v === false) {\n delete draft[k];\n } else if (!!v && k !== v && k in draft) {\n draft[v] = draft[k];\n if (deleteRemappedProperties) {\n delete draft[k];\n }\n }\n }\n });\n\n/**\n * Options object for {@link index!transformQuery transformQuery}.\n */\nexport interface TransformQueryOptions<RG extends RuleGroupTypeAny = RuleGroupType> {\n /**\n * When a rule is encountered in the hierarchy, it will be replaced\n * with the result of this function.\n *\n * @defaultValue `r => r`\n */\n // oxlint-disable-next-line typescript/no-explicit-any\n ruleProcessor?: (rule: RuleType) => any;\n /**\n * When a group is encountered in the hierarchy (including the root group, the\n * query itself), it will be replaced with the result of this function.\n *\n * @defaultValue `rg => rg`\n */\n // oxlint-disable-next-line typescript/no-explicit-any\n ruleGroupProcessor?: (ruleGroup: RG) => Record<string, any>;\n /**\n * For each rule and group in the query, any properties matching a key\n * in this object will be renamed to the corresponding value. To retain both\n * the new _and_ the original properties, set `deleteRemappedProperties`\n * to `false`.\n *\n * If a key has a value of `false`, the corresponding property will be removed\n * without being copied to a new property name. (Warning: `{ rules: false }`\n * will prevent recursion and only return the processed root group.)\n *\n * @defaultValue `{}`\n *\n * @example\n * ```\n * transformQuery(\n * { combinator: 'and', not: true, rules: [] },\n * { propertyMap: { combinator: 'AndOr', not: false } }\n * )\n * // Returns: { AndOr: 'and', rules: [] }\n * ```\n */\n propertyMap?: Record<string, string | false>;\n /**\n * Any combinator values (including independent combinators) will be translated\n * from the key in this object to the value.\n *\n * @defaultValue `{}`\n *\n * @example\n * ```\n * transformQuery(\n * { combinator: 'and', rules: [] },\n * { combinatorMap: { and: '&&', or: '||' } }\n * )\n * // Returns: { combinator: '&&', rules: [] }\n * ```\n */\n combinatorMap?: Record<string, string>;\n /**\n * Any operator values will be translated from the key in this object to the value.\n *\n * @defaultValue `{}`\n *\n * @example\n * ```\n * transformQuery(\n * { combinator: 'and', rules: [{ field: 'name', operator: '=', value: 'Steve Vai' }] },\n * { operatorMap: { '=': 'is' } }\n * )\n * // Returns:\n * // {\n * // combinator: 'and',\n * // rules: [{ field: 'name', operator: 'is', value: 'Steve Vai' }]\n * // }\n * ```\n */\n operatorMap?: Record<string, string>;\n /**\n * Prevents the `path` property (see {@link index!Path Path}) from being added to each\n * rule and group in the hierarchy.\n *\n * @defaultValue `false`\n */\n omitPath?: boolean;\n /**\n * Original properties remapped according to the `propertyMap` option will be removed.\n *\n * @defaultValue `true`\n *\n * @example\n * ```\n * transformQuery(\n * { combinator: 'and', rules: [] },\n * { propertyMap: { combinator: 'AndOr' }, deleteRemappedProperties: false }\n * )\n * // Returns: { combinator: 'and', AndOr: 'and', rules: [] }\n * ```\n */\n deleteRemappedProperties?: boolean;\n}\n\n/**\n * Recursively process a query heirarchy using this versatile utility function.\n *\n * [Documentation](https://react-querybuilder.js.org/docs/utils/misc#transformquery)\n */\nexport function transformQuery(\n query: RuleGroupType,\n options?: TransformQueryOptions\n // oxlint-disable-next-line typescript/no-explicit-any\n): any;\n/**\n * Recursively process a query heirarchy with independent combinators using this\n * versatile utility function.\n *\n * [Documentation](https://react-querybuilder.js.org/docs/utils/misc#transformquery)\n */\nexport function transformQuery(\n query: RuleGroupTypeIC,\n options?: TransformQueryOptions<RuleGroupTypeIC>\n // oxlint-disable-next-line typescript/no-explicit-any\n): any;\nexport function transformQuery<RG extends RuleGroupTypeAny>(\n query: RG,\n options: TransformQueryOptions<RG> = {}\n) {\n const {\n ruleProcessor = r => r,\n ruleGroupProcessor = rg => rg,\n propertyMap = {},\n combinatorMap = {},\n operatorMap = {},\n omitPath = false,\n deleteRemappedProperties = true,\n } = options;\n\n // oxlint-disable-next-line typescript/no-explicit-any\n const processGroup = (rg: RuleGroupTypeAny): any => ({\n ...ruleGroupProcessor(\n remapProperties(\n {\n ...rg,\n ...(isRuleGroupType(rg)\n ? { combinator: combinatorMap[rg.combinator] ?? rg.combinator }\n : {}),\n },\n propertyMap,\n deleteRemappedProperties\n ) as RG\n ),\n ...(propertyMap['rules'] === false\n ? null\n : {\n // oxlint-disable-next-line typescript/no-explicit-any\n [propertyMap['rules'] ?? 'rules']: rg.rules.map((r: any, idx) => {\n const pathObject = omitPath ? null : { path: [...rg.path!, idx] };\n if (typeof r === 'string') {\n // independent combinators\n return combinatorMap[r] ?? r;\n } else if (isRuleGroup(r)) {\n // sub-groups\n return processGroup({ ...r, ...pathObject });\n }\n // rules\n return ruleProcessor(\n remapProperties(\n {\n ...r,\n ...pathObject,\n ...('operator' in r ? { operator: operatorMap[r.operator] ?? r.operator } : {}),\n },\n propertyMap,\n deleteRemappedProperties\n ) as RuleType\n );\n }),\n }),\n });\n\n return processGroup({ ...query, ...(omitPath ? null : { path: [] }) });\n}\n"],"mappings":";;;;AAYA,MAAM,mBAEJ,KACA,aACA,6BAEA,QAAQ,MAAK,UAAS;AACpB,MAAK,MAAM,CAAC,GAAG,MAAM,OAAO,QAAQ,YAAY,CAC9C,KAAI,MAAM,MACR,QAAO,MAAM;UACJ,CAAC,CAAC,KAAK,MAAM,KAAK,KAAK,OAAO;AACvC,QAAM,KAAK,MAAM;AACjB,MAAI,yBACF,QAAO,MAAM;;EAInB;AA4HJ,SAAgB,eACd,OACA,UAAqC,EAAE,EACvC;CACA,MAAM,EACJ,iBAAgB,MAAK,GACrB,sBAAqB,OAAM,IAC3B,cAAc,EAAE,EAChB,gBAAgB,EAAE,EAClB,cAAc,EAAE,EAChB,WAAW,OACX,2BAA2B,SACzB;CAGJ,MAAM,gBAAgB,QAA+B;EACnD,GAAG,mBACD,gBACE;GACE,GAAG;GACH,GAAI,gBAAgB,GAAG,GACnB,EAAE,YAAY,cAAc,GAAG,eAAe,GAAG,YAAY,GAC7D,EAAE;GACP,EACD,aACA,yBACD,CACF;EACD,GAAI,YAAY,aAAa,QACzB,OACA,GAEG,YAAY,YAAY,UAAU,GAAG,MAAM,KAAK,GAAQ,QAAQ;GAC/D,MAAM,aAAa,WAAW,OAAO,EAAE,MAAM,CAAC,GAAG,GAAG,MAAO,IAAI,EAAE;AACjE,OAAI,OAAO,MAAM,SAEf,QAAO,cAAc,MAAM;YAClB,YAAY,EAAE,CAEvB,QAAO,aAAa;IAAE,GAAG;IAAG,GAAG;IAAY,CAAC;AAG9C,UAAO,cACL,gBACE;IACE,GAAG;IACH,GAAG;IACH,GAAI,cAAc,IAAI,EAAE,UAAU,YAAY,EAAE,aAAa,EAAE,UAAU,GAAG,EAAE;IAC/E,EACD,aACA,yBACD,CACF;IACD,EACH;EACN;AAED,QAAO,aAAa;EAAE,GAAG;EAAO,GAAI,WAAW,OAAO,EAAE,MAAM,EAAE,EAAE;EAAG,CAAC"}
@@ -0,0 +1,118 @@
1
+ import { RuleGroupType, RuleGroupTypeAny, RuleGroupTypeIC, RuleType } from "./basic-BmpEwexQ.mjs";
2
+
3
+ //#region src/utils/transformQuery.d.ts
4
+
5
+ /**
6
+ * Options object for {@link index!transformQuery transformQuery}.
7
+ */
8
+ interface TransformQueryOptions<RG extends RuleGroupTypeAny = RuleGroupType> {
9
+ /**
10
+ * When a rule is encountered in the hierarchy, it will be replaced
11
+ * with the result of this function.
12
+ *
13
+ * @defaultValue `r => r`
14
+ */
15
+ ruleProcessor?: (rule: RuleType) => any;
16
+ /**
17
+ * When a group is encountered in the hierarchy (including the root group, the
18
+ * query itself), it will be replaced with the result of this function.
19
+ *
20
+ * @defaultValue `rg => rg`
21
+ */
22
+ ruleGroupProcessor?: (ruleGroup: RG) => Record<string, any>;
23
+ /**
24
+ * For each rule and group in the query, any properties matching a key
25
+ * in this object will be renamed to the corresponding value. To retain both
26
+ * the new _and_ the original properties, set `deleteRemappedProperties`
27
+ * to `false`.
28
+ *
29
+ * If a key has a value of `false`, the corresponding property will be removed
30
+ * without being copied to a new property name. (Warning: `{ rules: false }`
31
+ * will prevent recursion and only return the processed root group.)
32
+ *
33
+ * @defaultValue `{}`
34
+ *
35
+ * @example
36
+ * ```
37
+ * transformQuery(
38
+ * { combinator: 'and', not: true, rules: [] },
39
+ * { propertyMap: { combinator: 'AndOr', not: false } }
40
+ * )
41
+ * // Returns: { AndOr: 'and', rules: [] }
42
+ * ```
43
+ */
44
+ propertyMap?: Record<string, string | false>;
45
+ /**
46
+ * Any combinator values (including independent combinators) will be translated
47
+ * from the key in this object to the value.
48
+ *
49
+ * @defaultValue `{}`
50
+ *
51
+ * @example
52
+ * ```
53
+ * transformQuery(
54
+ * { combinator: 'and', rules: [] },
55
+ * { combinatorMap: { and: '&&', or: '||' } }
56
+ * )
57
+ * // Returns: { combinator: '&&', rules: [] }
58
+ * ```
59
+ */
60
+ combinatorMap?: Record<string, string>;
61
+ /**
62
+ * Any operator values will be translated from the key in this object to the value.
63
+ *
64
+ * @defaultValue `{}`
65
+ *
66
+ * @example
67
+ * ```
68
+ * transformQuery(
69
+ * { combinator: 'and', rules: [{ field: 'name', operator: '=', value: 'Steve Vai' }] },
70
+ * { operatorMap: { '=': 'is' } }
71
+ * )
72
+ * // Returns:
73
+ * // {
74
+ * // combinator: 'and',
75
+ * // rules: [{ field: 'name', operator: 'is', value: 'Steve Vai' }]
76
+ * // }
77
+ * ```
78
+ */
79
+ operatorMap?: Record<string, string>;
80
+ /**
81
+ * Prevents the `path` property (see {@link index!Path Path}) from being added to each
82
+ * rule and group in the hierarchy.
83
+ *
84
+ * @defaultValue `false`
85
+ */
86
+ omitPath?: boolean;
87
+ /**
88
+ * Original properties remapped according to the `propertyMap` option will be removed.
89
+ *
90
+ * @defaultValue `true`
91
+ *
92
+ * @example
93
+ * ```
94
+ * transformQuery(
95
+ * { combinator: 'and', rules: [] },
96
+ * { propertyMap: { combinator: 'AndOr' }, deleteRemappedProperties: false }
97
+ * )
98
+ * // Returns: { combinator: 'and', AndOr: 'and', rules: [] }
99
+ * ```
100
+ */
101
+ deleteRemappedProperties?: boolean;
102
+ }
103
+ /**
104
+ * Recursively process a query heirarchy using this versatile utility function.
105
+ *
106
+ * [Documentation](https://react-querybuilder.js.org/docs/utils/misc#transformquery)
107
+ */
108
+ declare function transformQuery(query: RuleGroupType, options?: TransformQueryOptions): any;
109
+ /**
110
+ * Recursively process a query heirarchy with independent combinators using this
111
+ * versatile utility function.
112
+ *
113
+ * [Documentation](https://react-querybuilder.js.org/docs/utils/misc#transformquery)
114
+ */
115
+ declare function transformQuery(query: RuleGroupTypeIC, options?: TransformQueryOptions<RuleGroupTypeIC>): any;
116
+ //#endregion
117
+ export { TransformQueryOptions, transformQuery };
118
+ //# sourceMappingURL=transformQuery.d.mts.map
@@ -1,4 +1,4 @@
1
- import { RuleGroupType, RuleGroupTypeAny, RuleGroupTypeIC, RuleType } from "./basic-C8xXKHIA.js";
1
+ import { RuleGroupType, RuleGroupTypeAny, RuleGroupTypeIC, RuleType } from "./basic-CDDA-KZa.js";
2
2
 
3
3
  //#region src/utils/transformQuery.d.ts
4
4
 
@@ -1,4 +1,4 @@
1
1
  require('./isRuleGroup-DqAs2x4E.js');
2
- const require_transformQuery = require('./transformQuery-FL_nlpp5.js');
2
+ const require_transformQuery = require('./transformQuery-CWDPogO5.js');
3
3
 
4
4
  exports.transformQuery = require_transformQuery.transformQuery;
@@ -0,0 +1,4 @@
1
+ import "./isRuleGroup-CGe_rb2w.mjs";
2
+ import { transformQuery } from "./transformQuery-DHvtgDgZ.mjs";
3
+
4
+ export { transformQuery };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-querybuilder/core",
3
- "version": "8.9.1",
3
+ "version": "8.10.0",
4
4
  "description": "React Query Builder component for constructing queries and filters, with utilities for executing them in various database and evaluation contexts",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -21,36 +21,84 @@
21
21
  },
22
22
  "./dist/*": "./dist/*",
23
23
  "./formatQuery": {
24
- "types": "./dist/formatQuery.d.ts",
25
- "default": "./dist/formatQuery.js"
24
+ "import": {
25
+ "types": "./dist/formatQuery.d.mts",
26
+ "import": "./dist/formatQuery.mjs"
27
+ },
28
+ "require": {
29
+ "types": "./dist/formatQuery.d.ts",
30
+ "default": "./dist/formatQuery.js"
31
+ }
26
32
  },
27
33
  "./parseCEL": {
28
- "types": "./dist/parseCEL.d.ts",
29
- "default": "./dist/parseCEL.js"
34
+ "import": {
35
+ "types": "./dist/parseCEL.d.mts",
36
+ "import": "./dist/parseCEL.mjs"
37
+ },
38
+ "require": {
39
+ "types": "./dist/parseCEL.d.ts",
40
+ "default": "./dist/parseCEL.js"
41
+ }
30
42
  },
31
43
  "./parseJSONata": {
32
- "types": "./dist/parseJSONata.d.ts",
33
- "default": "./dist/parseJSONata.js"
44
+ "import": {
45
+ "types": "./dist/parseJSONata.d.mts",
46
+ "import": "./dist/parseJSONata.mjs"
47
+ },
48
+ "require": {
49
+ "types": "./dist/parseJSONata.d.ts",
50
+ "default": "./dist/parseJSONata.js"
51
+ }
34
52
  },
35
53
  "./parseJsonLogic": {
36
- "types": "./dist/parseJsonLogic.d.ts",
37
- "default": "./dist/parseJsonLogic.js"
54
+ "import": {
55
+ "types": "./dist/parseJsonLogic.d.mts",
56
+ "import": "./dist/parseJsonLogic.mjs"
57
+ },
58
+ "require": {
59
+ "types": "./dist/parseJsonLogic.d.ts",
60
+ "default": "./dist/parseJsonLogic.js"
61
+ }
38
62
  },
39
63
  "./parseMongoDB": {
40
- "types": "./dist/parseMongoDB.d.ts",
41
- "default": "./dist/parseMongoDB.js"
64
+ "import": {
65
+ "types": "./dist/parseMongoDB.d.mts",
66
+ "import": "./dist/parseMongoDB.mjs"
67
+ },
68
+ "require": {
69
+ "types": "./dist/parseMongoDB.d.ts",
70
+ "default": "./dist/parseMongoDB.js"
71
+ }
42
72
  },
43
73
  "./parseSpEL": {
44
- "types": "./dist/parseSpEL.d.ts",
45
- "default": "./dist/parseSpEL.js"
74
+ "import": {
75
+ "types": "./dist/parseSpEL.d.mts",
76
+ "import": "./dist/parseSpEL.mjs"
77
+ },
78
+ "require": {
79
+ "types": "./dist/parseSpEL.d.ts",
80
+ "default": "./dist/parseSpEL.js"
81
+ }
46
82
  },
47
83
  "./parseSQL": {
48
- "types": "./dist/parseSQL.d.ts",
49
- "default": "./dist/parseSQL.js"
84
+ "import": {
85
+ "types": "./dist/parseSQL.d.mts",
86
+ "import": "./dist/parseSQL.mjs"
87
+ },
88
+ "require": {
89
+ "types": "./dist/parseSQL.d.ts",
90
+ "default": "./dist/parseSQL.js"
91
+ }
50
92
  },
51
93
  "./transformQuery": {
52
- "types": "./dist/transformQuery.d.ts",
53
- "default": "./dist/transformQuery.js"
94
+ "import": {
95
+ "types": "./dist/transformQuery.d.mts",
96
+ "import": "./dist/transformQuery.mjs"
97
+ },
98
+ "require": {
99
+ "types": "./dist/transformQuery.d.ts",
100
+ "default": "./dist/transformQuery.js"
101
+ }
54
102
  }
55
103
  },
56
104
  "react-native": "dist/react-querybuilder_core.mjs",
@@ -96,24 +144,26 @@
96
144
  "@babel/core": "^7.28.4",
97
145
  "@babel/preset-env": "^7.28.3",
98
146
  "@babel/preset-typescript": "^7.27.1",
99
- "@electric-sql/pglite": "^0.3.8",
147
+ "@electric-sql/pglite": "^0.3.10",
100
148
  "@types/json-logic-js": "^2.0.8",
101
- "@types/node": "^24.5.2",
149
+ "@types/node": "^24.7.1",
102
150
  "babel-plugin-istanbul": "^7.0.1",
103
- "drizzle-orm": "^0.44.5",
151
+ "drizzle-orm": "^0.44.6",
104
152
  "json-logic-js": "^2.0.5",
105
153
  "jsonata": "^2.1.0",
106
- "mongodb-memory-server-core": "^10.2.1",
107
- "mongoose": "^8.18.1",
154
+ "mongodb-memory-server-core": "^10.2.3",
155
+ "mongoose": "^8.19.1",
108
156
  "pglite-prisma-adapter": "^0.6.1",
109
- "prisma": "~6.14.0",
157
+ "prisma": "~6.17.0",
110
158
  "query-string": "^9.3.1",
111
159
  "regenerator-runtime": "^0.14.1",
112
- "rollup-plugin-visualizer": "^6.0.3",
113
- "sass": "^1.92.1",
160
+ "rollup-plugin-visualizer": "^6.0.4",
161
+ "sass": "^1.93.2",
114
162
  "sequelize": "^6.37.7",
115
- "spel2js": "^0.2.8",
116
- "typescript": "^5.9.2"
163
+ "spel2js": "^0.2.9",
164
+ "type-fest": "^4.41.0",
165
+ "typescript": "^5.9.3",
166
+ "vite": "^7.1.9"
117
167
  },
118
168
  "dependencies": {
119
169
  "immer": "^10.1.3",
@@ -143,5 +193,5 @@
143
193
  "typecheck": "tsc --noEmit",
144
194
  "typecheck:watch": "tsc --noEmit --watch"
145
195
  },
146
- "gitHead": "d4d46ff2a6afb1623f3cb8f666c8b2e02ee7cd2f"
196
+ "gitHead": "fc383fac6b7deefae34f004c6fe60b924ddd3b20"
147
197
  }