@flanksource/clicky-ui 0.3.19 → 0.3.21

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 (450) hide show
  1. package/dist/components/ErrorWrapper.cjs +1 -1
  2. package/dist/components/ErrorWrapper.cjs.map +1 -1
  3. package/dist/components/ErrorWrapper.js +1 -1
  4. package/dist/components/ErrorWrapper.js.map +1 -1
  5. package/dist/components/UnitStepControls.cjs +55 -0
  6. package/dist/components/UnitStepControls.cjs.map +1 -0
  7. package/dist/components/UnitStepControls.d.ts +10 -0
  8. package/dist/components/UnitStepControls.d.ts.map +1 -0
  9. package/dist/components/UnitStepControls.js +55 -0
  10. package/dist/components/UnitStepControls.js.map +1 -0
  11. package/dist/components/json-schema-form-accordion-array.cjs +5 -73
  12. package/dist/components/json-schema-form-accordion-array.cjs.map +1 -1
  13. package/dist/components/json-schema-form-accordion-array.d.ts.map +1 -1
  14. package/dist/components/json-schema-form-accordion-array.js +3 -71
  15. package/dist/components/json-schema-form-accordion-array.js.map +1 -1
  16. package/dist/components/json-schema-form-array.cjs +6 -1
  17. package/dist/components/json-schema-form-array.cjs.map +1 -1
  18. package/dist/components/json-schema-form-array.d.ts.map +1 -1
  19. package/dist/components/json-schema-form-array.js +6 -1
  20. package/dist/components/json-schema-form-array.js.map +1 -1
  21. package/dist/components/json-schema-form-cards-array.cjs +96 -0
  22. package/dist/components/json-schema-form-cards-array.cjs.map +1 -0
  23. package/dist/components/json-schema-form-cards-array.d.ts +7 -0
  24. package/dist/components/json-schema-form-cards-array.d.ts.map +1 -0
  25. package/dist/components/json-schema-form-cards-array.js +96 -0
  26. package/dist/components/json-schema-form-cards-array.js.map +1 -0
  27. package/dist/components/json-schema-form-item-row.cjs +81 -0
  28. package/dist/components/json-schema-form-item-row.cjs.map +1 -0
  29. package/dist/components/json-schema-form-item-row.d.ts +19 -0
  30. package/dist/components/json-schema-form-item-row.d.ts.map +1 -0
  31. package/dist/components/json-schema-form-item-row.js +81 -0
  32. package/dist/components/json-schema-form-item-row.js.map +1 -0
  33. package/dist/components/json-schema-form-render.cjs +2 -2
  34. package/dist/components/json-schema-form-render.cjs.map +1 -1
  35. package/dist/components/json-schema-form-render.d.ts.map +1 -1
  36. package/dist/components/json-schema-form-render.js +2 -2
  37. package/dist/components/json-schema-form-render.js.map +1 -1
  38. package/dist/components/json-schema-form-resolve.cjs +1 -1
  39. package/dist/components/json-schema-form-resolve.cjs.map +1 -1
  40. package/dist/components/json-schema-form-resolve.js +1 -1
  41. package/dist/components/json-schema-form-resolve.js.map +1 -1
  42. package/dist/components/json-schema-form-tone.cjs +12 -0
  43. package/dist/components/json-schema-form-tone.cjs.map +1 -1
  44. package/dist/components/json-schema-form-tone.js +12 -0
  45. package/dist/components/json-schema-form-tone.js.map +1 -1
  46. package/dist/components/json-schema-form-types.d.ts +1 -1
  47. package/dist/components/json-schema-form-types.d.ts.map +1 -1
  48. package/dist/components/unit-form-extension.cjs +126 -0
  49. package/dist/components/unit-form-extension.cjs.map +1 -0
  50. package/dist/components/unit-form-extension.d.ts +8 -0
  51. package/dist/components/unit-form-extension.d.ts.map +1 -0
  52. package/dist/components/unit-form-extension.js +126 -0
  53. package/dist/components/unit-form-extension.js.map +1 -0
  54. package/dist/components.cjs +4 -0
  55. package/dist/components.cjs.map +1 -1
  56. package/dist/components.d.ts +1 -0
  57. package/dist/components.d.ts.map +1 -1
  58. package/dist/components.js +4 -0
  59. package/dist/components.js.map +1 -1
  60. package/dist/data/diagnostics/ErrorDetails.cjs +61 -8
  61. package/dist/data/diagnostics/ErrorDetails.cjs.map +1 -1
  62. package/dist/data/diagnostics/ErrorDetails.d.ts.map +1 -1
  63. package/dist/data/diagnostics/ErrorDetails.js +61 -8
  64. package/dist/data/diagnostics/ErrorDetails.js.map +1 -1
  65. package/dist/data/diagnostics/error-diagnostics.cjs +10 -4
  66. package/dist/data/diagnostics/error-diagnostics.cjs.map +1 -1
  67. package/dist/data/diagnostics/error-diagnostics.d.ts.map +1 -1
  68. package/dist/data/diagnostics/error-diagnostics.js +10 -4
  69. package/dist/data/diagnostics/error-diagnostics.js.map +1 -1
  70. package/dist/data/query-browser/QueryBrowser.cjs +12 -6
  71. package/dist/data/query-browser/QueryBrowser.cjs.map +1 -1
  72. package/dist/data/query-browser/QueryBrowser.d.ts.map +1 -1
  73. package/dist/data/query-browser/QueryBrowser.js +12 -6
  74. package/dist/data/query-browser/QueryBrowser.js.map +1 -1
  75. package/dist/data/query-browser/QueryBrowser.types.cjs +2 -1
  76. package/dist/data/query-browser/QueryBrowser.types.cjs.map +1 -1
  77. package/dist/data/query-browser/QueryBrowser.types.d.ts +16 -14
  78. package/dist/data/query-browser/QueryBrowser.types.d.ts.map +1 -1
  79. package/dist/data/query-browser/QueryBrowser.types.js +2 -1
  80. package/dist/data/query-browser/QueryBrowser.types.js.map +1 -1
  81. package/dist/data/version-info.cjs +3 -3
  82. package/dist/data/version-info.js +3 -3
  83. package/dist/index.cjs +4 -0
  84. package/dist/index.cjs.map +1 -1
  85. package/dist/index.js +4 -0
  86. package/dist/index.js.map +1 -1
  87. package/dist/lib/string.cjs +8 -0
  88. package/dist/lib/string.cjs.map +1 -1
  89. package/dist/lib/string.d.ts +1 -0
  90. package/dist/lib/string.d.ts.map +1 -1
  91. package/dist/lib/string.js +8 -0
  92. package/dist/lib/string.js.map +1 -1
  93. package/dist/profiles/catalogTree.cjs +133 -0
  94. package/dist/profiles/catalogTree.cjs.map +1 -0
  95. package/dist/profiles/catalogTree.d.ts +11 -0
  96. package/dist/profiles/catalogTree.d.ts.map +1 -0
  97. package/dist/profiles/catalogTree.js +133 -0
  98. package/dist/profiles/catalogTree.js.map +1 -0
  99. package/dist/profiles/connectionBrowserModel.cjs +185 -0
  100. package/dist/profiles/connectionBrowserModel.cjs.map +1 -0
  101. package/dist/profiles/connectionBrowserModel.d.ts +169 -0
  102. package/dist/profiles/connectionBrowserModel.d.ts.map +1 -0
  103. package/dist/profiles/connectionBrowserModel.js +185 -0
  104. package/dist/profiles/connectionBrowserModel.js.map +1 -0
  105. package/dist/profiles/connectionQueryWorkspace.cjs +185 -0
  106. package/dist/profiles/connectionQueryWorkspace.cjs.map +1 -0
  107. package/dist/profiles/connectionQueryWorkspace.d.ts +63 -0
  108. package/dist/profiles/connectionQueryWorkspace.d.ts.map +1 -0
  109. package/dist/profiles/connectionQueryWorkspace.js +185 -0
  110. package/dist/profiles/connectionQueryWorkspace.js.map +1 -0
  111. package/dist/profiles/connectionQueryWorkspaceModel.cjs +28 -0
  112. package/dist/profiles/connectionQueryWorkspaceModel.cjs.map +1 -0
  113. package/dist/profiles/connectionQueryWorkspaceModel.d.ts +38 -0
  114. package/dist/profiles/connectionQueryWorkspaceModel.d.ts.map +1 -0
  115. package/dist/profiles/connectionQueryWorkspaceModel.js +28 -0
  116. package/dist/profiles/connectionQueryWorkspaceModel.js.map +1 -0
  117. package/dist/profiles/esFieldValues.cjs +64 -0
  118. package/dist/profiles/esFieldValues.cjs.map +1 -0
  119. package/dist/profiles/esFieldValues.d.ts +48 -0
  120. package/dist/profiles/esFieldValues.d.ts.map +1 -0
  121. package/dist/profiles/esFieldValues.js +64 -0
  122. package/dist/profiles/esFieldValues.js.map +1 -0
  123. package/dist/profiles/esParamMappingModel.cjs +301 -0
  124. package/dist/profiles/esParamMappingModel.cjs.map +1 -0
  125. package/dist/profiles/esParamMappingModel.d.ts +37 -0
  126. package/dist/profiles/esParamMappingModel.d.ts.map +1 -0
  127. package/dist/profiles/esParamMappingModel.js +301 -0
  128. package/dist/profiles/esParamMappingModel.js.map +1 -0
  129. package/dist/profiles/esParamMappingPill.cjs +24 -0
  130. package/dist/profiles/esParamMappingPill.cjs.map +1 -0
  131. package/dist/profiles/esParamMappingPill.d.ts +13 -0
  132. package/dist/profiles/esParamMappingPill.d.ts.map +1 -0
  133. package/dist/profiles/esParamMappingPill.js +24 -0
  134. package/dist/profiles/esParamMappingPill.js.map +1 -0
  135. package/dist/profiles/esParamOperandExtension.cjs +75 -0
  136. package/dist/profiles/esParamOperandExtension.cjs.map +1 -0
  137. package/dist/profiles/esParamOperandExtension.d.ts +11 -0
  138. package/dist/profiles/esParamOperandExtension.d.ts.map +1 -0
  139. package/dist/profiles/esParamOperandExtension.js +75 -0
  140. package/dist/profiles/esParamOperandExtension.js.map +1 -0
  141. package/dist/profiles/esQueryBuilder.cjs +205 -0
  142. package/dist/profiles/esQueryBuilder.cjs.map +1 -0
  143. package/dist/profiles/esQueryBuilder.d.ts +35 -0
  144. package/dist/profiles/esQueryBuilder.d.ts.map +1 -0
  145. package/dist/profiles/esQueryBuilder.js +205 -0
  146. package/dist/profiles/esQueryBuilder.js.map +1 -0
  147. package/dist/profiles/esQueryBuilderExtension.cjs +23 -0
  148. package/dist/profiles/esQueryBuilderExtension.cjs.map +1 -0
  149. package/dist/profiles/esQueryBuilderExtension.d.ts +5 -0
  150. package/dist/profiles/esQueryBuilderExtension.d.ts.map +1 -0
  151. package/dist/profiles/esQueryBuilderExtension.js +23 -0
  152. package/dist/profiles/esQueryBuilderExtension.js.map +1 -0
  153. package/dist/profiles/esQueryBuilderForm.cjs +26 -0
  154. package/dist/profiles/esQueryBuilderForm.cjs.map +1 -0
  155. package/dist/profiles/esQueryBuilderForm.d.ts +18 -0
  156. package/dist/profiles/esQueryBuilderForm.d.ts.map +1 -0
  157. package/dist/profiles/esQueryBuilderForm.js +26 -0
  158. package/dist/profiles/esQueryBuilderForm.js.map +1 -0
  159. package/dist/profiles/esQueryBuilderModel.cjs +131 -0
  160. package/dist/profiles/esQueryBuilderModel.cjs.map +1 -0
  161. package/dist/profiles/esQueryBuilderModel.d.ts +108 -0
  162. package/dist/profiles/esQueryBuilderModel.d.ts.map +1 -0
  163. package/dist/profiles/esQueryBuilderModel.js +131 -0
  164. package/dist/profiles/esQueryBuilderModel.js.map +1 -0
  165. package/dist/profiles/esQueryClauseGroup.cjs +144 -0
  166. package/dist/profiles/esQueryClauseGroup.cjs.map +1 -0
  167. package/dist/profiles/esQueryClauseGroup.d.ts +10 -0
  168. package/dist/profiles/esQueryClauseGroup.d.ts.map +1 -0
  169. package/dist/profiles/esQueryClauseGroup.js +144 -0
  170. package/dist/profiles/esQueryClauseGroup.js.map +1 -0
  171. package/dist/profiles/esQueryCompile.cjs +47 -0
  172. package/dist/profiles/esQueryCompile.cjs.map +1 -0
  173. package/dist/profiles/esQueryCompile.d.ts +39 -0
  174. package/dist/profiles/esQueryCompile.d.ts.map +1 -0
  175. package/dist/profiles/esQueryCompile.js +47 -0
  176. package/dist/profiles/esQueryCompile.js.map +1 -0
  177. package/dist/profiles/esQueryConditionRow.cjs +168 -0
  178. package/dist/profiles/esQueryConditionRow.cjs.map +1 -0
  179. package/dist/profiles/esQueryConditionRow.d.ts +37 -0
  180. package/dist/profiles/esQueryConditionRow.d.ts.map +1 -0
  181. package/dist/profiles/esQueryConditionRow.js +168 -0
  182. package/dist/profiles/esQueryConditionRow.js.map +1 -0
  183. package/dist/profiles/esQueryGroupModel.cjs +12 -0
  184. package/dist/profiles/esQueryGroupModel.cjs.map +1 -0
  185. package/dist/profiles/esQueryGroupModel.d.ts +9 -0
  186. package/dist/profiles/esQueryGroupModel.d.ts.map +1 -0
  187. package/dist/profiles/esQueryGroupModel.js +12 -0
  188. package/dist/profiles/esQueryGroupModel.js.map +1 -0
  189. package/dist/profiles/esQueryOccur.cjs +16 -0
  190. package/dist/profiles/esQueryOccur.cjs.map +1 -0
  191. package/dist/profiles/esQueryOccur.d.ts +11 -0
  192. package/dist/profiles/esQueryOccur.d.ts.map +1 -0
  193. package/dist/profiles/esQueryOccur.js +16 -0
  194. package/dist/profiles/esQueryOccur.js.map +1 -0
  195. package/dist/profiles/esQueryOperandEditors.cjs +279 -0
  196. package/dist/profiles/esQueryOperandEditors.cjs.map +1 -0
  197. package/dist/profiles/esQueryOperandEditors.d.ts +24 -0
  198. package/dist/profiles/esQueryOperandEditors.d.ts.map +1 -0
  199. package/dist/profiles/esQueryOperandEditors.js +279 -0
  200. package/dist/profiles/esQueryOperandEditors.js.map +1 -0
  201. package/dist/profiles/esQueryOperandModel.cjs +28 -0
  202. package/dist/profiles/esQueryOperandModel.cjs.map +1 -0
  203. package/dist/profiles/esQueryOperandModel.d.ts +17 -0
  204. package/dist/profiles/esQueryOperandModel.d.ts.map +1 -0
  205. package/dist/profiles/esQueryOperandModel.js +28 -0
  206. package/dist/profiles/esQueryOperandModel.js.map +1 -0
  207. package/dist/profiles/esQueryOperators.cjs +165 -0
  208. package/dist/profiles/esQueryOperators.cjs.map +1 -0
  209. package/dist/profiles/esQueryOperators.d.ts +83 -0
  210. package/dist/profiles/esQueryOperators.d.ts.map +1 -0
  211. package/dist/profiles/esQueryOperators.js +165 -0
  212. package/dist/profiles/esQueryOperators.js.map +1 -0
  213. package/dist/profiles/esQueryOutputEditor.cjs +138 -0
  214. package/dist/profiles/esQueryOutputEditor.cjs.map +1 -0
  215. package/dist/profiles/esQueryOutputEditor.d.ts +7 -0
  216. package/dist/profiles/esQueryOutputEditor.d.ts.map +1 -0
  217. package/dist/profiles/esQueryOutputEditor.js +138 -0
  218. package/dist/profiles/esQueryOutputEditor.js.map +1 -0
  219. package/dist/profiles/esQueryOutputModel.cjs +16 -0
  220. package/dist/profiles/esQueryOutputModel.cjs.map +1 -0
  221. package/dist/profiles/esQueryOutputModel.d.ts +14 -0
  222. package/dist/profiles/esQueryOutputModel.d.ts.map +1 -0
  223. package/dist/profiles/esQueryOutputModel.js +16 -0
  224. package/dist/profiles/esQueryOutputModel.js.map +1 -0
  225. package/dist/profiles/esQueryPreview.cjs +30 -0
  226. package/dist/profiles/esQueryPreview.cjs.map +1 -0
  227. package/dist/profiles/esQueryPreview.d.ts +6 -0
  228. package/dist/profiles/esQueryPreview.d.ts.map +1 -0
  229. package/dist/profiles/esQueryPreview.js +30 -0
  230. package/dist/profiles/esQueryPreview.js.map +1 -0
  231. package/dist/profiles/esQuerySortEditor.cjs +143 -0
  232. package/dist/profiles/esQuerySortEditor.cjs.map +1 -0
  233. package/dist/profiles/esQuerySortEditor.d.ts +9 -0
  234. package/dist/profiles/esQuerySortEditor.d.ts.map +1 -0
  235. package/dist/profiles/esQuerySortEditor.js +143 -0
  236. package/dist/profiles/esQuerySortEditor.js.map +1 -0
  237. package/dist/profiles/esQuerySortModel.cjs +13 -0
  238. package/dist/profiles/esQuerySortModel.cjs.map +1 -0
  239. package/dist/profiles/esQuerySortModel.d.ts +4 -0
  240. package/dist/profiles/esQuerySortModel.d.ts.map +1 -0
  241. package/dist/profiles/esQuerySortModel.js +13 -0
  242. package/dist/profiles/esQuerySortModel.js.map +1 -0
  243. package/dist/profiles/esValueCombobox.cjs +86 -0
  244. package/dist/profiles/esValueCombobox.cjs.map +1 -0
  245. package/dist/profiles/esValueCombobox.d.ts +15 -0
  246. package/dist/profiles/esValueCombobox.d.ts.map +1 -0
  247. package/dist/profiles/esValueCombobox.js +86 -0
  248. package/dist/profiles/esValueCombobox.js.map +1 -0
  249. package/dist/profiles/jsonPathSample.cjs +75 -0
  250. package/dist/profiles/jsonPathSample.cjs.map +1 -0
  251. package/dist/profiles/jsonPathSample.d.ts +27 -0
  252. package/dist/profiles/jsonPathSample.d.ts.map +1 -0
  253. package/dist/profiles/jsonPathSample.js +75 -0
  254. package/dist/profiles/jsonPathSample.js.map +1 -0
  255. package/dist/profiles/jsonPathSampleRow.cjs +14 -0
  256. package/dist/profiles/jsonPathSampleRow.cjs.map +1 -0
  257. package/dist/profiles/jsonPathSampleRow.d.ts +6 -0
  258. package/dist/profiles/jsonPathSampleRow.d.ts.map +1 -0
  259. package/dist/profiles/jsonPathSampleRow.js +14 -0
  260. package/dist/profiles/jsonPathSampleRow.js.map +1 -0
  261. package/dist/profiles/profileApi.cjs +37 -0
  262. package/dist/profiles/profileApi.cjs.map +1 -0
  263. package/dist/profiles/profileApi.d.ts +32 -0
  264. package/dist/profiles/profileApi.d.ts.map +1 -0
  265. package/dist/profiles/profileApi.js +37 -0
  266. package/dist/profiles/profileApi.js.map +1 -0
  267. package/dist/profiles/profileBuilder.cjs +65 -0
  268. package/dist/profiles/profileBuilder.cjs.map +1 -0
  269. package/dist/profiles/profileBuilder.d.ts +11 -0
  270. package/dist/profiles/profileBuilder.d.ts.map +1 -0
  271. package/dist/profiles/profileBuilder.js +65 -0
  272. package/dist/profiles/profileBuilder.js.map +1 -0
  273. package/dist/profiles/profileBuilderExtension.cjs +25 -0
  274. package/dist/profiles/profileBuilderExtension.cjs.map +1 -0
  275. package/dist/profiles/profileBuilderExtension.d.ts +5 -0
  276. package/dist/profiles/profileBuilderExtension.d.ts.map +1 -0
  277. package/dist/profiles/profileBuilderExtension.js +25 -0
  278. package/dist/profiles/profileBuilderExtension.js.map +1 -0
  279. package/dist/profiles/profileBuilderWorkspace.cjs +368 -0
  280. package/dist/profiles/profileBuilderWorkspace.cjs.map +1 -0
  281. package/dist/profiles/profileBuilderWorkspace.d.ts +21 -0
  282. package/dist/profiles/profileBuilderWorkspace.d.ts.map +1 -0
  283. package/dist/profiles/profileBuilderWorkspace.js +368 -0
  284. package/dist/profiles/profileBuilderWorkspace.js.map +1 -0
  285. package/dist/profiles/profileColumnModel.cjs +23 -0
  286. package/dist/profiles/profileColumnModel.cjs.map +1 -0
  287. package/dist/profiles/profileColumnModel.d.ts +8 -0
  288. package/dist/profiles/profileColumnModel.d.ts.map +1 -0
  289. package/dist/profiles/profileColumnModel.js +23 -0
  290. package/dist/profiles/profileColumnModel.js.map +1 -0
  291. package/dist/profiles/profileColumnPicker.cjs +68 -0
  292. package/dist/profiles/profileColumnPicker.cjs.map +1 -0
  293. package/dist/profiles/profileColumnPicker.d.ts +11 -0
  294. package/dist/profiles/profileColumnPicker.d.ts.map +1 -0
  295. package/dist/profiles/profileColumnPicker.js +68 -0
  296. package/dist/profiles/profileColumnPicker.js.map +1 -0
  297. package/dist/profiles/profileEditor.cjs +386 -0
  298. package/dist/profiles/profileEditor.cjs.map +1 -0
  299. package/dist/profiles/profileEditor.d.ts +19 -0
  300. package/dist/profiles/profileEditor.d.ts.map +1 -0
  301. package/dist/profiles/profileEditor.js +386 -0
  302. package/dist/profiles/profileEditor.js.map +1 -0
  303. package/dist/profiles/profileEditorModel.cjs +181 -0
  304. package/dist/profiles/profileEditorModel.cjs.map +1 -0
  305. package/dist/profiles/profileEditorModel.d.ts +74 -0
  306. package/dist/profiles/profileEditorModel.d.ts.map +1 -0
  307. package/dist/profiles/profileEditorModel.js +181 -0
  308. package/dist/profiles/profileEditorModel.js.map +1 -0
  309. package/dist/profiles/profileEditorPreview.cjs +38 -0
  310. package/dist/profiles/profileEditorPreview.cjs.map +1 -0
  311. package/dist/profiles/profileEditorPreview.d.ts +12 -0
  312. package/dist/profiles/profileEditorPreview.d.ts.map +1 -0
  313. package/dist/profiles/profileEditorPreview.js +38 -0
  314. package/dist/profiles/profileEditorPreview.js.map +1 -0
  315. package/dist/profiles/profileEditorRail.cjs +46 -0
  316. package/dist/profiles/profileEditorRail.cjs.map +1 -0
  317. package/dist/profiles/profileEditorRail.d.ts +8 -0
  318. package/dist/profiles/profileEditorRail.d.ts.map +1 -0
  319. package/dist/profiles/profileEditorRail.js +46 -0
  320. package/dist/profiles/profileEditorRail.js.map +1 -0
  321. package/dist/profiles/profileEditorRaw.cjs +118 -0
  322. package/dist/profiles/profileEditorRaw.cjs.map +1 -0
  323. package/dist/profiles/profileEditorRaw.d.ts +7 -0
  324. package/dist/profiles/profileEditorRaw.d.ts.map +1 -0
  325. package/dist/profiles/profileEditorRaw.js +118 -0
  326. package/dist/profiles/profileEditorRaw.js.map +1 -0
  327. package/dist/profiles/profileEditorRoutes.cjs +7 -0
  328. package/dist/profiles/profileEditorRoutes.cjs.map +1 -0
  329. package/dist/profiles/profileEditorRoutes.d.ts +2 -0
  330. package/dist/profiles/profileEditorRoutes.d.ts.map +1 -0
  331. package/dist/profiles/profileEditorRoutes.js +7 -0
  332. package/dist/profiles/profileEditorRoutes.js.map +1 -0
  333. package/dist/profiles/profileEditorSections.cjs +213 -0
  334. package/dist/profiles/profileEditorSections.cjs.map +1 -0
  335. package/dist/profiles/profileEditorSections.d.ts +23 -0
  336. package/dist/profiles/profileEditorSections.d.ts.map +1 -0
  337. package/dist/profiles/profileEditorSections.js +213 -0
  338. package/dist/profiles/profileEditorSections.js.map +1 -0
  339. package/dist/profiles/profileFieldEditor.cjs +200 -0
  340. package/dist/profiles/profileFieldEditor.cjs.map +1 -0
  341. package/dist/profiles/profileFieldEditor.d.ts +34 -0
  342. package/dist/profiles/profileFieldEditor.d.ts.map +1 -0
  343. package/dist/profiles/profileFieldEditor.js +200 -0
  344. package/dist/profiles/profileFieldEditor.js.map +1 -0
  345. package/dist/profiles/profileFieldGrid.cjs +250 -0
  346. package/dist/profiles/profileFieldGrid.cjs.map +1 -0
  347. package/dist/profiles/profileFieldGrid.d.ts +20 -0
  348. package/dist/profiles/profileFieldGrid.d.ts.map +1 -0
  349. package/dist/profiles/profileFieldGrid.js +250 -0
  350. package/dist/profiles/profileFieldGrid.js.map +1 -0
  351. package/dist/profiles/profileFieldManager.cjs +103 -0
  352. package/dist/profiles/profileFieldManager.cjs.map +1 -0
  353. package/dist/profiles/profileFieldManager.d.ts +9 -0
  354. package/dist/profiles/profileFieldManager.d.ts.map +1 -0
  355. package/dist/profiles/profileFieldManager.js +103 -0
  356. package/dist/profiles/profileFieldManager.js.map +1 -0
  357. package/dist/profiles/profileFieldState.cjs +136 -0
  358. package/dist/profiles/profileFieldState.cjs.map +1 -0
  359. package/dist/profiles/profileFieldState.d.ts +41 -0
  360. package/dist/profiles/profileFieldState.d.ts.map +1 -0
  361. package/dist/profiles/profileFieldState.js +136 -0
  362. package/dist/profiles/profileFieldState.js.map +1 -0
  363. package/dist/profiles/profileFieldTypes.cjs +17 -0
  364. package/dist/profiles/profileFieldTypes.cjs.map +1 -0
  365. package/dist/profiles/profileFieldTypes.d.ts +8 -0
  366. package/dist/profiles/profileFieldTypes.d.ts.map +1 -0
  367. package/dist/profiles/profileFieldTypes.js +17 -0
  368. package/dist/profiles/profileFieldTypes.js.map +1 -0
  369. package/dist/profiles/profileParamModel.cjs +78 -0
  370. package/dist/profiles/profileParamModel.cjs.map +1 -0
  371. package/dist/profiles/profileParamModel.d.ts +3 -0
  372. package/dist/profiles/profileParamModel.d.ts.map +1 -0
  373. package/dist/profiles/profileParamModel.js +78 -0
  374. package/dist/profiles/profileParamModel.js.map +1 -0
  375. package/dist/profiles/profileSamplePayload.cjs +15 -0
  376. package/dist/profiles/profileSamplePayload.cjs.map +1 -0
  377. package/dist/profiles/profileSamplePayload.d.ts +13 -0
  378. package/dist/profiles/profileSamplePayload.d.ts.map +1 -0
  379. package/dist/profiles/profileSamplePayload.js +15 -0
  380. package/dist/profiles/profileSamplePayload.js.map +1 -0
  381. package/dist/profiles/profileWizard.cjs +257 -0
  382. package/dist/profiles/profileWizard.cjs.map +1 -0
  383. package/dist/profiles/profileWizard.d.ts +12 -0
  384. package/dist/profiles/profileWizard.d.ts.map +1 -0
  385. package/dist/profiles/profileWizard.js +257 -0
  386. package/dist/profiles/profileWizard.js.map +1 -0
  387. package/dist/profiles/profileWizardHelp.cjs +10 -0
  388. package/dist/profiles/profileWizardHelp.cjs.map +1 -0
  389. package/dist/profiles/profileWizardHelp.d.ts +13 -0
  390. package/dist/profiles/profileWizardHelp.d.ts.map +1 -0
  391. package/dist/profiles/profileWizardHelp.js +10 -0
  392. package/dist/profiles/profileWizardHelp.js.map +1 -0
  393. package/dist/profiles/profileWizardModel.cjs +198 -0
  394. package/dist/profiles/profileWizardModel.cjs.map +1 -0
  395. package/dist/profiles/profileWizardModel.d.ts +255 -0
  396. package/dist/profiles/profileWizardModel.d.ts.map +1 -0
  397. package/dist/profiles/profileWizardModel.js +198 -0
  398. package/dist/profiles/profileWizardModel.js.map +1 -0
  399. package/dist/profiles/profileWizardQueryStep.cjs +215 -0
  400. package/dist/profiles/profileWizardQueryStep.cjs.map +1 -0
  401. package/dist/profiles/profileWizardQueryStep.d.ts +18 -0
  402. package/dist/profiles/profileWizardQueryStep.d.ts.map +1 -0
  403. package/dist/profiles/profileWizardQueryStep.js +215 -0
  404. package/dist/profiles/profileWizardQueryStep.js.map +1 -0
  405. package/dist/profiles/profileWizardSteps.cjs +214 -0
  406. package/dist/profiles/profileWizardSteps.cjs.map +1 -0
  407. package/dist/profiles/profileWizardSteps.d.ts +35 -0
  408. package/dist/profiles/profileWizardSteps.d.ts.map +1 -0
  409. package/dist/profiles/profileWizardSteps.js +214 -0
  410. package/dist/profiles/profileWizardSteps.js.map +1 -0
  411. package/dist/profiles/profileYaml.cjs +19 -0
  412. package/dist/profiles/profileYaml.cjs.map +1 -0
  413. package/dist/profiles/profileYaml.d.ts +4 -0
  414. package/dist/profiles/profileYaml.d.ts.map +1 -0
  415. package/dist/profiles/profileYaml.js +19 -0
  416. package/dist/profiles/profileYaml.js.map +1 -0
  417. package/dist/profiles/prometheusResults.cjs +60 -0
  418. package/dist/profiles/prometheusResults.cjs.map +1 -0
  419. package/dist/profiles/prometheusResults.d.ts +7 -0
  420. package/dist/profiles/prometheusResults.d.ts.map +1 -0
  421. package/dist/profiles/prometheusResults.js +60 -0
  422. package/dist/profiles/prometheusResults.js.map +1 -0
  423. package/dist/profiles/queryRowLimits.cjs +82 -0
  424. package/dist/profiles/queryRowLimits.cjs.map +1 -0
  425. package/dist/profiles/queryRowLimits.d.ts +9 -0
  426. package/dist/profiles/queryRowLimits.d.ts.map +1 -0
  427. package/dist/profiles/queryRowLimits.js +82 -0
  428. package/dist/profiles/queryRowLimits.js.map +1 -0
  429. package/dist/profiles/queryRowLimitsModel.cjs +10 -0
  430. package/dist/profiles/queryRowLimitsModel.cjs.map +1 -0
  431. package/dist/profiles/queryRowLimitsModel.d.ts +9 -0
  432. package/dist/profiles/queryRowLimitsModel.d.ts.map +1 -0
  433. package/dist/profiles/queryRowLimitsModel.js +10 -0
  434. package/dist/profiles/queryRowLimitsModel.js.map +1 -0
  435. package/dist/profiles/queryTargetPicker.cjs +42 -0
  436. package/dist/profiles/queryTargetPicker.cjs.map +1 -0
  437. package/dist/profiles/queryTargetPicker.d.ts +8 -0
  438. package/dist/profiles/queryTargetPicker.d.ts.map +1 -0
  439. package/dist/profiles/queryTargetPicker.js +42 -0
  440. package/dist/profiles/queryTargetPicker.js.map +1 -0
  441. package/dist/profiles/testSchema.d.ts +3 -0
  442. package/dist/profiles/testSchema.d.ts.map +1 -0
  443. package/dist/profiles.cjs +223 -0
  444. package/dist/profiles.cjs.map +1 -0
  445. package/dist/profiles.d.ts +68 -0
  446. package/dist/profiles.d.ts.map +1 -0
  447. package/dist/profiles.js +223 -0
  448. package/dist/profiles.js.map +1 -0
  449. package/dist/styles.css +1 -1
  450. package/package.json +6 -1
@@ -0,0 +1,205 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { Combobox } from "../components/Combobox.js";
3
+ import { savedConnectionID, browserBaseUrl, useInspection } from "./connectionBrowserModel.js";
4
+ import { emptyGroup, removeAt, insertAt, conditionAt, updateAt } from "./esQueryBuilderModel.js";
5
+ import { makeFieldValueLookup, valueLookupField } from "./esFieldValues.js";
6
+ import { EsQueryClauseGroup } from "./esQueryClauseGroup.js";
7
+ import { fieldFamily, esBuilderVocabulary } from "./esQueryOperators.js";
8
+ import { EsQueryOutputEditor } from "./esQueryOutputEditor.js";
9
+ import { EsQueryPreview } from "./esQueryPreview.js";
10
+ import { EsQuerySortEditor } from "./esQuerySortEditor.js";
11
+ import { removeParamMapping, bindParamOperand, reconcileSearchParamMappings } from "./esParamMappingModel.js";
12
+ import { paramRoles, defaultParamValues, esQueryFields } from "./esQueryBuilderForm.js";
13
+ import { useCompiledSearch } from "./esQueryCompile.js";
14
+ function EsQueryBuilder({
15
+ search,
16
+ onChange,
17
+ fields,
18
+ vocabulary,
19
+ params = [],
20
+ onMappingChange,
21
+ values,
22
+ compilation,
23
+ className
24
+ }) {
25
+ const root = search.query ?? emptyGroup();
26
+ const mappingFieldsChanged = (edit) => edit.params.some((param, index) => {
27
+ var _a;
28
+ return param.field !== ((_a = params[index]) == null ? void 0 : _a.field);
29
+ });
30
+ const commitMappingEdit = (edit) => {
31
+ if (onMappingChange) {
32
+ onMappingChange(edit);
33
+ return;
34
+ }
35
+ if (mappingFieldsChanged(edit)) {
36
+ throw new Error(
37
+ "list parameter mappings require an atomic mapping change handler"
38
+ );
39
+ }
40
+ onChange(edit.search);
41
+ };
42
+ const commitSearchEdit = (nextSearch) => {
43
+ const edit = reconcileSearchParamMappings({
44
+ previousSearch: search,
45
+ nextSearch,
46
+ params
47
+ });
48
+ if (mappingFieldsChanged(edit)) {
49
+ commitMappingEdit(edit);
50
+ return;
51
+ }
52
+ onChange(nextSearch);
53
+ };
54
+ const context = {
55
+ fields,
56
+ vocabulary,
57
+ params,
58
+ // The builder owns the tree, so it — not the host — decides what a lookup is
59
+ // scoped by: the query without the row being edited. Leaving that row in
60
+ // would filter the suggestions by the half-typed value they are meant to
61
+ // complete.
62
+ ...values ? {
63
+ values: ({ path, field }) => {
64
+ const target = valueLookupField(fields, field);
65
+ if (!target) return void 0;
66
+ return values({ field: target, search: { ...search, query: removeAt(root, path) } });
67
+ }
68
+ } : {}
69
+ };
70
+ const actions = {
71
+ update: (path, update) => commitSearchEdit({ ...search, query: updateAt(root, path, update) }),
72
+ insert: (groupPath, condition) => {
73
+ var _a, _b;
74
+ return commitSearchEdit({
75
+ ...search,
76
+ query: insertAt(
77
+ root,
78
+ groupPath,
79
+ ((_b = (_a = conditionAt(root, groupPath)) == null ? void 0 : _a.conditions) == null ? void 0 : _b.length) ?? 0,
80
+ condition
81
+ )
82
+ });
83
+ },
84
+ remove: (path) => commitSearchEdit({ ...search, query: removeAt(root, path) }),
85
+ mapParam: (path, operand, name) => {
86
+ const edit = bindParamOperand({ search, params, path, operand, name });
87
+ commitMappingEdit(edit);
88
+ },
89
+ unmapParam: (path, name) => {
90
+ const edit = removeParamMapping({ search, params, name, path });
91
+ commitMappingEdit(edit);
92
+ }
93
+ };
94
+ return /* @__PURE__ */ jsxs("div", { className: className ?? "flex min-w-0 flex-col gap-3", children: [
95
+ /* @__PURE__ */ jsx(
96
+ EsQueryClauseGroup,
97
+ {
98
+ condition: root,
99
+ path: [],
100
+ context,
101
+ actions,
102
+ root: true
103
+ }
104
+ ),
105
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
106
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "Time field" }),
107
+ /* @__PURE__ */ jsx(
108
+ Combobox,
109
+ {
110
+ ariaLabel: "Time field",
111
+ className: "min-w-48",
112
+ value: search.timeField ?? "",
113
+ onChange: (next) => onChange({ ...search, timeField: next || void 0 }),
114
+ options: fields.filter((field) => fieldFamily(field) === "date").map((field) => ({ value: field.name, label: field.name })),
115
+ placeholder: "Date field…",
116
+ allowCustomValue: true
117
+ }
118
+ ),
119
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: "Where time-from and time-to parameters apply" })
120
+ ] }),
121
+ /* @__PURE__ */ jsx(
122
+ EsQuerySortEditor,
123
+ {
124
+ sort: search.sort ?? [],
125
+ fields,
126
+ orders: vocabulary.sortOrders,
127
+ onChange: (sort) => onChange({ ...search, sort: sort.length ? sort : void 0 })
128
+ }
129
+ ),
130
+ /* @__PURE__ */ jsx(
131
+ EsQueryOutputEditor,
132
+ {
133
+ search,
134
+ onChange: (patch) => onChange({ ...search, ...patch })
135
+ }
136
+ ),
137
+ compilation ? /* @__PURE__ */ jsx(EsQueryPreview, { compilation }) : null
138
+ ] });
139
+ }
140
+ function EsQueryBuilderField({
141
+ search,
142
+ onChange,
143
+ schema,
144
+ rootValue,
145
+ onRootChange
146
+ }) {
147
+ var _a, _b, _c;
148
+ const connectionID = savedConnectionID((_a = rootValue.provider) == null ? void 0 : _a.connection);
149
+ const baseUrl = connectionID ? browserBaseUrl(connectionID) : "";
150
+ const target = String(((_c = (_b = rootValue.provider) == null ? void 0 : _b.options) == null ? void 0 : _c.index) ?? "");
151
+ const inspection = useInspection({
152
+ cacheKey: "es-query-builder",
153
+ id: connectionID ?? "",
154
+ baseUrl,
155
+ enabled: baseUrl !== "",
156
+ database: "",
157
+ target
158
+ });
159
+ const roles = paramRoles(rootValue.params);
160
+ const params = defaultParamValues(rootValue.params);
161
+ const compilation = useCompiledSearch({
162
+ baseUrl,
163
+ search,
164
+ params,
165
+ roles,
166
+ enabled: baseUrl !== ""
167
+ });
168
+ const values = makeFieldValueLookup({ baseUrl, index: target, params, roles });
169
+ return /* @__PURE__ */ jsx(
170
+ EsQueryBuilder,
171
+ {
172
+ search,
173
+ onChange: (next) => onChange(next),
174
+ fields: esQueryFields(inspection.completion),
175
+ vocabulary: esBuilderVocabulary({ properties: { search: schema } }),
176
+ params: rootValue.params ?? [],
177
+ onMappingChange: (edit) => {
178
+ var _a2;
179
+ if (!onRootChange) {
180
+ throw new Error(
181
+ "query parameter mappings require an atomic root form update"
182
+ );
183
+ }
184
+ onRootChange({
185
+ ...rootValue,
186
+ params: edit.params,
187
+ provider: {
188
+ ...rootValue.provider,
189
+ options: {
190
+ ...(_a2 = rootValue.provider) == null ? void 0 : _a2.options,
191
+ search: edit.search
192
+ }
193
+ }
194
+ });
195
+ },
196
+ ...values ? { values } : {},
197
+ compilation
198
+ }
199
+ );
200
+ }
201
+ export {
202
+ EsQueryBuilder,
203
+ EsQueryBuilderField
204
+ };
205
+ //# sourceMappingURL=esQueryBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esQueryBuilder.js","sources":["../../src/profiles/esQueryBuilder.tsx"],"sourcesContent":["/**\n * The query builder panel and the form extension that mounts it. The panel is\n * pure: it takes a specification and the vocabulary the schema described, and\n * reports edits. Everything that needs a connection — field mappings and the\n * compiled preview — is wired by the host that has one.\n */\n\nimport { Combobox } from \"../components/Combobox\";\nimport type { JsonSchemaProperty } from \"../components/json-schema-form-types\";\nimport {\n browserBaseUrl,\n savedConnectionID,\n useInspection\n} from \"./connectionBrowserModel\";\nimport {\n conditionAt,\n emptyGroup,\n insertAt,\n removeAt,\n updateAt,\n type EsSearch\n} from \"./esQueryBuilderModel\";\nimport {\n makeFieldValueLookup,\n valueLookupField,\n type FieldValuesSource\n} from \"./esFieldValues\";\nimport { EsQueryClauseGroup } from \"./esQueryClauseGroup\";\nimport type {\n EsQueryContext,\n EsQueryTreeActions\n} from \"./esQueryConditionRow\";\nimport {\n esBuilderVocabulary,\n fieldFamily,\n type EsBuilderVocabulary,\n type EsFieldMapping\n} from \"./esQueryOperators\";\nimport { EsQueryOutputEditor } from \"./esQueryOutputEditor\";\nimport {\n EsQueryPreview\n } from \"./esQueryPreview\";\nimport { EsQuerySortEditor } from \"./esQuerySortEditor\";\nimport type { ProfileDraft } from \"./profileBuilderWorkspace\";\nimport type { ParamDraft } from \"./profileWizardModel\";\nimport {\n bindParamOperand,\n reconcileSearchParamMappings,\n removeParamMapping,\n type ParamMappingEdit\n} from \"./esParamMappingModel\";\nimport { defaultParamValues, esQueryFields, paramRoles } from \"./esQueryBuilderForm\";\nimport { useCompiledSearch, type EsCompilation } from \"./esQueryCompile\";\n\nexport type EsQueryBuilderProps = {\n search: EsSearch;\n onChange: (search: EsSearch) => void;\n fields: EsFieldMapping[];\n vocabulary: EsBuilderVocabulary;\n /** Declared profile parameters an operand can bind to. */\n params?: ParamDraft[];\n onMappingChange?: (edit: ParamMappingEdit) => void;\n /** Where a field's own values come from; absent without a connection. */\n values?: FieldValuesSource;\n compilation?: EsCompilation;\n className?: string;\n};\n\nexport function EsQueryBuilder({\n search,\n onChange,\n fields,\n vocabulary,\n params = [],\n onMappingChange,\n values,\n compilation,\n className\n}: EsQueryBuilderProps) {\n const root = search.query ?? emptyGroup();\n const mappingFieldsChanged = (edit: ParamMappingEdit) =>\n edit.params.some((param, index) => param.field !== params[index]?.field);\n const commitMappingEdit = (edit: ParamMappingEdit) => {\n if (onMappingChange) {\n onMappingChange(edit);\n return;\n }\n if (mappingFieldsChanged(edit)) {\n throw new Error(\n \"list parameter mappings require an atomic mapping change handler\",\n );\n }\n onChange(edit.search);\n };\n const commitSearchEdit = (nextSearch: EsSearch) => {\n const edit = reconcileSearchParamMappings({\n previousSearch: search,\n nextSearch,\n params\n });\n if (mappingFieldsChanged(edit)) {\n commitMappingEdit(edit);\n return;\n }\n onChange(nextSearch);\n };\n const context: EsQueryContext = {\n fields,\n vocabulary,\n params,\n // The builder owns the tree, so it — not the host — decides what a lookup is\n // scoped by: the query without the row being edited. Leaving that row in\n // would filter the suggestions by the half-typed value they are meant to\n // complete.\n ...(values\n ? {\n values: ({ path, field }) => {\n const target = valueLookupField(fields, field);\n if (!target) return undefined;\n return values({ field: target, search: { ...search, query: removeAt(root, path) } });\n }\n }\n : {})\n };\n const actions: EsQueryTreeActions = {\n update: (path, update) =>\n commitSearchEdit({ ...search, query: updateAt(root, path, update) }),\n insert: (groupPath, condition) =>\n commitSearchEdit({\n ...search,\n query: insertAt(\n root,\n groupPath,\n conditionAt(root, groupPath)?.conditions?.length ?? 0,\n condition,\n )\n }),\n remove: (path) =>\n commitSearchEdit({ ...search, query: removeAt(root, path) }),\n mapParam: (path, operand, name) => {\n const edit = bindParamOperand({ search, params, path, operand, name });\n commitMappingEdit(edit);\n },\n unmapParam: (path, name) => {\n const edit = removeParamMapping({ search, params, name, path });\n commitMappingEdit(edit);\n }\n };\n\n return (\n <div className={className ?? \"flex min-w-0 flex-col gap-3\"}>\n <EsQueryClauseGroup\n condition={root}\n path={[]}\n context={context}\n actions={actions}\n root\n />\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-xs text-muted-foreground\">Time field</span>\n <Combobox\n ariaLabel=\"Time field\"\n className=\"min-w-48\"\n value={search.timeField ?? \"\"}\n onChange={(next) => onChange({ ...search, timeField: next || undefined })}\n options={fields\n .filter((field) => fieldFamily(field) === \"date\")\n .map((field) => ({ value: field.name, label: field.name }))}\n placeholder=\"Date field…\"\n allowCustomValue\n />\n <span className=\"text-xs text-muted-foreground\">\n Where time-from and time-to parameters apply\n </span>\n </div>\n <EsQuerySortEditor\n sort={search.sort ?? []}\n fields={fields}\n orders={vocabulary.sortOrders}\n onChange={(sort) => onChange({ ...search, sort: sort.length ? sort : undefined })}\n />\n <EsQueryOutputEditor\n search={search}\n onChange={(patch) => onChange({ ...search, ...patch })}\n />\n {compilation ? <EsQueryPreview compilation={compilation} /> : null}\n </div>\n );\n}\n\n/**\n * The builder as the profile form mounts it. The form knows the connection and\n * the index, so the field mappings and the compiled preview come from the same\n * browser endpoints the connection browser uses.\n */\nexport function EsQueryBuilderField({\n search,\n onChange,\n schema,\n rootValue,\n onRootChange\n}: {\n search: EsSearch;\n onChange: (next: unknown) => void;\n schema: JsonSchemaProperty;\n rootValue: ProfileDraft;\n onRootChange?: ((next: Record<string, unknown>) => void) | undefined;\n}) {\n const connectionID = savedConnectionID(rootValue.provider?.connection);\n const baseUrl = connectionID ? browserBaseUrl(connectionID) : \"\";\n const target = String(rootValue.provider?.options?.index ?? \"\");\n const inspection = useInspection({\n cacheKey: \"es-query-builder\",\n id: connectionID ?? \"\",\n baseUrl,\n enabled: baseUrl !== \"\",\n database: \"\",\n target\n });\n const roles = paramRoles(rootValue.params);\n const params = defaultParamValues(rootValue.params);\n const compilation = useCompiledSearch({\n baseUrl,\n search,\n params,\n roles,\n enabled: baseUrl !== \"\"\n });\n const values = makeFieldValueLookup({ baseUrl, index: target, params, roles });\n\n return (\n <EsQueryBuilder\n search={search}\n onChange={(next) => onChange(next)}\n fields={esQueryFields(inspection.completion)}\n vocabulary={esBuilderVocabulary({ properties: { search: schema } })}\n params={rootValue.params ?? []}\n onMappingChange={(edit) => {\n if (!onRootChange) {\n throw new Error(\n \"query parameter mappings require an atomic root form update\",\n );\n }\n onRootChange({\n ...rootValue,\n params: edit.params,\n provider: {\n ...rootValue.provider,\n options: {\n ...rootValue.provider?.options,\n search: edit.search\n }\n }\n });\n }}\n {...(values ? { values } : {})}\n compilation={compilation}\n />\n );\n}\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;AAoEO,SAAS,eAAe;AAAA,EAC7B;AAAA,EACA;AAAA,E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AS,SAAS,IAAI;AAAA,MACjC,QAAQ,cAAc,WAAW,UAAU;AAAA,MAC3C,YAAY,oBAAoB,EAAE,YAAY,EAAE,QAAQ,OAAA,GAAU;AAAA,MAClE,QAAQ,UAAU,UAAU,CAAA;AAAA,MAC5B,iBAAiB,CAAC,SAAS;;AACzB,YAAI,CAAC,cAAc;AACjB,gBAAM,IAAI;AAAA,YACR;AAAA,UAAA;AAAA,QAEJ;AACA,qBAAa;AAAA,UACX,GAAG;AAAA,UACH,QAAQ,KAAK;AAAA,UACb,UAAU;AAAA,YACR,GAAG,UAAU;AAAA,YACb,SAAS;AAAA,cACP,IAAGA,MAAA,UAAU,aAAV,gBAAAA,IAAoB;AAAA,cACvB,QAAQ,KAAK;AAAA,YAAA;AAAA,UACf;AAAA,QACF,CACD;AAAA,MACH;AAAA,MACC,GAAI,SAAS,EAAE,OAAA,IAAW,CAAA;AAAA,MAC3B;AAAA,IAAA;AAAA,EAAA;AAGN;"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const esQueryBuilder = require("./esQueryBuilder.cjs");
5
+ const esQueryBuilderPost = (field, nodes, ctx) => {
6
+ if (field.schema["x-clicky-component"] !== "es-query-builder") return nodes;
7
+ return {
8
+ label: nodes.label,
9
+ value: /* @__PURE__ */ jsxRuntime.jsx(
10
+ esQueryBuilder.EsQueryBuilderField,
11
+ {
12
+ search: field.value ?? {},
13
+ onChange: field.onChange,
14
+ schema: field.schema,
15
+ rootValue: (ctx == null ? void 0 : ctx.rootValue) ?? {},
16
+ onRootChange: ctx == null ? void 0 : ctx.onRootChange
17
+ }
18
+ )
19
+ };
20
+ };
21
+ const esQueryBuilderFormExtensions = { post: [esQueryBuilderPost] };
22
+ exports.esQueryBuilderFormExtensions = esQueryBuilderFormExtensions;
23
+ //# sourceMappingURL=esQueryBuilderExtension.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esQueryBuilderExtension.cjs","sources":["../../src/profiles/esQueryBuilderExtension.tsx"],"sourcesContent":["/**\n * The JSON-schema form extension that swaps in the OpenSearch query builder.\n *\n * It lives apart from esQueryBuilder.tsx because it is not a component, and a\n * module that exports components must export nothing else for Fast Refresh to\n * work (react/only-export-components).\n */\n\nimport type { PostExtension } from \"../components/json-schema-form-types\";\nimport { EsQueryBuilderField } from \"./esQueryBuilder\";\nimport type { EsSearch } from \"./esQueryBuilderModel\";\nimport type { ProfileDraft } from \"./profileBuilderWorkspace\";\n\nconst esQueryBuilderPost: PostExtension = (field, nodes, ctx) => {\n if (field.schema[\"x-clicky-component\"] !== \"es-query-builder\") return nodes;\n return {\n label: nodes.label,\n value: (\n <EsQueryBuilderField\n search={(field.value ?? {}) as EsSearch}\n onChange={field.onChange}\n schema={field.schema}\n rootValue={(ctx?.rootValue ?? {}) as ProfileDraft}\n onRootChange={ctx?.onRootChange}\n />\n ),\n };\n};\n\nexport const esQueryBuilderFormExtensions = { post: [esQueryBuilderPost] };\n"],"names":["jsx","EsQueryBuilderField"],"mappings":";;;;AAaA,MAAM,qBAAoC,CAAC,OAAO,OAAO,QAAQ;AAC/D,MAAI,MAAM,OAAO,oBAAoB,MAAM,mBAAoB,QAAO;AACtE,SAAO;AAAA,IACL,OAAO,MAAM;AAAA,IACb,OACEA,2BAAAA;AAAAA,MAACC,eAAAA;AAAAA,MAAA;AAAA,QACC,QAAS,MAAM,SAAS,CAAA;AAAA,QACxB,UAAU,MAAM;AAAA,QAChB,QAAQ,MAAM;AAAA,QACd,YAAY,2BAAK,cAAa,CAAA;AAAA,QAC9B,cAAc,2BAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EACrB;AAGN;AAEO,MAAM,+BAA+B,EAAE,MAAM,CAAC,kBAAkB,EAAA;;"}
@@ -0,0 +1,5 @@
1
+ import { PostExtension } from '../components/json-schema-form-types';
2
+ export declare const esQueryBuilderFormExtensions: {
3
+ post: PostExtension[];
4
+ };
5
+ //# sourceMappingURL=esQueryBuilderExtension.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esQueryBuilderExtension.d.ts","sourceRoot":"","sources":["../../src/profiles/esQueryBuilderExtension.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAqB1E,eAAO,MAAM,4BAA4B;;CAAiC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { EsQueryBuilderField } from "./esQueryBuilder.js";
3
+ const esQueryBuilderPost = (field, nodes, ctx) => {
4
+ if (field.schema["x-clicky-component"] !== "es-query-builder") return nodes;
5
+ return {
6
+ label: nodes.label,
7
+ value: /* @__PURE__ */ jsx(
8
+ EsQueryBuilderField,
9
+ {
10
+ search: field.value ?? {},
11
+ onChange: field.onChange,
12
+ schema: field.schema,
13
+ rootValue: (ctx == null ? void 0 : ctx.rootValue) ?? {},
14
+ onRootChange: ctx == null ? void 0 : ctx.onRootChange
15
+ }
16
+ )
17
+ };
18
+ };
19
+ const esQueryBuilderFormExtensions = { post: [esQueryBuilderPost] };
20
+ export {
21
+ esQueryBuilderFormExtensions
22
+ };
23
+ //# sourceMappingURL=esQueryBuilderExtension.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esQueryBuilderExtension.js","sources":["../../src/profiles/esQueryBuilderExtension.tsx"],"sourcesContent":["/**\n * The JSON-schema form extension that swaps in the OpenSearch query builder.\n *\n * It lives apart from esQueryBuilder.tsx because it is not a component, and a\n * module that exports components must export nothing else for Fast Refresh to\n * work (react/only-export-components).\n */\n\nimport type { PostExtension } from \"../components/json-schema-form-types\";\nimport { EsQueryBuilderField } from \"./esQueryBuilder\";\nimport type { EsSearch } from \"./esQueryBuilderModel\";\nimport type { ProfileDraft } from \"./profileBuilderWorkspace\";\n\nconst esQueryBuilderPost: PostExtension = (field, nodes, ctx) => {\n if (field.schema[\"x-clicky-component\"] !== \"es-query-builder\") return nodes;\n return {\n label: nodes.label,\n value: (\n <EsQueryBuilderField\n search={(field.value ?? {}) as EsSearch}\n onChange={field.onChange}\n schema={field.schema}\n rootValue={(ctx?.rootValue ?? {}) as ProfileDraft}\n onRootChange={ctx?.onRootChange}\n />\n ),\n };\n};\n\nexport const esQueryBuilderFormExtensions = { post: [esQueryBuilderPost] };\n"],"names":[],"mappings":";;AAaA,MAAM,qBAAoC,CAAC,OAAO,OAAO,QAAQ;AAC/D,MAAI,MAAM,OAAO,oBAAoB,MAAM,mBAAoB,QAAO;AACtE,SAAO;AAAA,IACL,OAAO,MAAM;AAAA,IACb,OACE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,QAAS,MAAM,SAAS,CAAA;AAAA,QACxB,UAAU,MAAM;AAAA,QAChB,QAAQ,MAAM;AAAA,QACd,YAAY,2BAAK,cAAa,CAAA;AAAA,QAC9B,cAAc,2BAAK;AAAA,MAAA;AAAA,IAAA;AAAA,EACrB;AAGN;AAEO,MAAM,+BAA+B,EAAE,MAAM,CAAC,kBAAkB,EAAA;"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ function paramNames(params) {
4
+ return (params ?? []).map((param) => param.name ?? "").filter((name) => name !== "");
5
+ }
6
+ function paramRoles(params) {
7
+ const roles = {};
8
+ for (const param of params ?? []) {
9
+ if (param.name && param.role) roles[param.name] = param.role;
10
+ }
11
+ return roles;
12
+ }
13
+ function defaultParamValues(params) {
14
+ return Object.fromEntries(
15
+ (params ?? []).filter((param) => param.name && param.default !== void 0).map((param) => [param.name, param.default])
16
+ );
17
+ }
18
+ function esQueryFields(completion) {
19
+ const typed = completion;
20
+ return (typed == null ? void 0 : typed.kind) === "json-fields" ? typed.fields ?? [] : [];
21
+ }
22
+ exports.defaultParamValues = defaultParamValues;
23
+ exports.esQueryFields = esQueryFields;
24
+ exports.paramNames = paramNames;
25
+ exports.paramRoles = paramRoles;
26
+ //# sourceMappingURL=esQueryBuilderForm.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esQueryBuilderForm.cjs","sources":["../../src/profiles/esQueryBuilderForm.ts"],"sourcesContent":["/**\n * The pure helpers behind the query builder: which parameters exist, what they\n * default to, and the field mappings a schema describes.\n *\n * Kept apart from esQueryBuilder.tsx so that module exports only components\n * (react/only-export-components).\n */\n\nimport type { EsFieldMapping } from \"./esQueryOperators\";\nimport type { ParamDraft } from \"./profileWizardModel\";\n\n/** paramNames lists the parameters an operand may bind, in declared order. */\nexport function paramNames(params: ParamDraft[] | undefined): string[] {\n return (params ?? [])\n .map((param) => param.name ?? \"\")\n .filter((name) => name !== \"\");\n}\n\n/** paramRoles is the name-to-role table the compiler folds roles from. */\nexport function paramRoles(\n params: ParamDraft[] | undefined,\n): Record<string, string> {\n const roles: Record<string, string> = {};\n for (const param of params ?? []) {\n if (param.name && param.role) roles[param.name] = param.role;\n }\n return roles;\n}\n\n/**\n * defaultParamValues is what the declared parameters resolve to before anyone\n * filters. The compiler needs them to bind a {param:…} operand and to\n * interpolate a {{.params.…}} one, so the preview shows the DSL a run produces.\n */\nexport function defaultParamValues(\n params: ParamDraft[] | undefined,\n): Record<string, unknown> {\n return Object.fromEntries(\n (params ?? [])\n .filter((param) => param.name && param.default !== undefined)\n .map((param) => [param.name as string, param.default]),\n );\n}\n\n/**\n * esQueryFields reads the field mappings off a browser inspection. Only an\n * OpenSearch target carries them, so anything else builds against free text.\n */\nexport function esQueryFields(completion: unknown): EsFieldMapping[] {\n const typed = completion as { kind?: string; fields?: EsFieldMapping[] };\n return typed?.kind === \"json-fields\" ? (typed.fields ?? []) : [];\n}\n"],"names":[],"mappings":";;AAYO,SAAS,WAAW,QAA4C;AACrE,UAAQ,UAAU,CAAA,GACf,IAAI,CAAC,UAAU,MAAM,QAAQ,EAAE,EAC/B,OAAO,CAAC,SAAS,SAAS,EAAE;AACjC;AAGO,SAAS,WACd,QACwB;AACxB,QAAM,QAAgC,CAAA;AACtC,aAAW,SAAS,UAAU,IAAI;AAChC,QAAI,MAAM,QAAQ,MAAM,YAAY,MAAM,IAAI,IAAI,MAAM;AAAA,EAC1D;AACA,SAAO;AACT;AAOO,SAAS,mBACd,QACyB;AACzB,SAAO,OAAO;AAAA,KACX,UAAU,CAAA,GACR,OAAO,CAAC,UAAU,MAAM,QAAQ,MAAM,YAAY,MAAS,EAC3D,IAAI,CAAC,UAAU,CAAC,MAAM,MAAgB,MAAM,OAAO,CAAC;AAAA,EAAA;AAE3D;AAMO,SAAS,cAAc,YAAuC;AACnE,QAAM,QAAQ;AACd,UAAO,+BAAO,UAAS,gBAAiB,MAAM,UAAU,CAAA,IAAM,CAAA;AAChE;;;;;"}
@@ -0,0 +1,18 @@
1
+ import { EsFieldMapping } from './esQueryOperators';
2
+ import { ParamDraft } from './profileWizardModel';
3
+ /** paramNames lists the parameters an operand may bind, in declared order. */
4
+ export declare function paramNames(params: ParamDraft[] | undefined): string[];
5
+ /** paramRoles is the name-to-role table the compiler folds roles from. */
6
+ export declare function paramRoles(params: ParamDraft[] | undefined): Record<string, string>;
7
+ /**
8
+ * defaultParamValues is what the declared parameters resolve to before anyone
9
+ * filters. The compiler needs them to bind a {param:…} operand and to
10
+ * interpolate a {{.params.…}} one, so the preview shows the DSL a run produces.
11
+ */
12
+ export declare function defaultParamValues(params: ParamDraft[] | undefined): Record<string, unknown>;
13
+ /**
14
+ * esQueryFields reads the field mappings off a browser inspection. Only an
15
+ * OpenSearch target carries them, so anything else builds against free text.
16
+ */
17
+ export declare function esQueryFields(completion: unknown): EsFieldMapping[];
18
+ //# sourceMappingURL=esQueryBuilderForm.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esQueryBuilderForm.d.ts","sourceRoot":"","sources":["../../src/profiles/esQueryBuilderForm.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,8EAA8E;AAC9E,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,GAAG,SAAS,GAAG,MAAM,EAAE,CAIrE;AAED,0EAA0E;AAC1E,wBAAgB,UAAU,CACxB,MAAM,EAAE,UAAU,EAAE,GAAG,SAAS,GAC/B,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAMxB;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,UAAU,EAAE,GAAG,SAAS,GAC/B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAMzB;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,OAAO,GAAG,cAAc,EAAE,CAGnE"}
@@ -0,0 +1,26 @@
1
+ function paramNames(params) {
2
+ return (params ?? []).map((param) => param.name ?? "").filter((name) => name !== "");
3
+ }
4
+ function paramRoles(params) {
5
+ const roles = {};
6
+ for (const param of params ?? []) {
7
+ if (param.name && param.role) roles[param.name] = param.role;
8
+ }
9
+ return roles;
10
+ }
11
+ function defaultParamValues(params) {
12
+ return Object.fromEntries(
13
+ (params ?? []).filter((param) => param.name && param.default !== void 0).map((param) => [param.name, param.default])
14
+ );
15
+ }
16
+ function esQueryFields(completion) {
17
+ const typed = completion;
18
+ return (typed == null ? void 0 : typed.kind) === "json-fields" ? typed.fields ?? [] : [];
19
+ }
20
+ export {
21
+ defaultParamValues,
22
+ esQueryFields,
23
+ paramNames,
24
+ paramRoles
25
+ };
26
+ //# sourceMappingURL=esQueryBuilderForm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esQueryBuilderForm.js","sources":["../../src/profiles/esQueryBuilderForm.ts"],"sourcesContent":["/**\n * The pure helpers behind the query builder: which parameters exist, what they\n * default to, and the field mappings a schema describes.\n *\n * Kept apart from esQueryBuilder.tsx so that module exports only components\n * (react/only-export-components).\n */\n\nimport type { EsFieldMapping } from \"./esQueryOperators\";\nimport type { ParamDraft } from \"./profileWizardModel\";\n\n/** paramNames lists the parameters an operand may bind, in declared order. */\nexport function paramNames(params: ParamDraft[] | undefined): string[] {\n return (params ?? [])\n .map((param) => param.name ?? \"\")\n .filter((name) => name !== \"\");\n}\n\n/** paramRoles is the name-to-role table the compiler folds roles from. */\nexport function paramRoles(\n params: ParamDraft[] | undefined,\n): Record<string, string> {\n const roles: Record<string, string> = {};\n for (const param of params ?? []) {\n if (param.name && param.role) roles[param.name] = param.role;\n }\n return roles;\n}\n\n/**\n * defaultParamValues is what the declared parameters resolve to before anyone\n * filters. The compiler needs them to bind a {param:…} operand and to\n * interpolate a {{.params.…}} one, so the preview shows the DSL a run produces.\n */\nexport function defaultParamValues(\n params: ParamDraft[] | undefined,\n): Record<string, unknown> {\n return Object.fromEntries(\n (params ?? [])\n .filter((param) => param.name && param.default !== undefined)\n .map((param) => [param.name as string, param.default]),\n );\n}\n\n/**\n * esQueryFields reads the field mappings off a browser inspection. Only an\n * OpenSearch target carries them, so anything else builds against free text.\n */\nexport function esQueryFields(completion: unknown): EsFieldMapping[] {\n const typed = completion as { kind?: string; fields?: EsFieldMapping[] };\n return typed?.kind === \"json-fields\" ? (typed.fields ?? []) : [];\n}\n"],"names":[],"mappings":"AAYO,SAAS,WAAW,QAA4C;AACrE,UAAQ,UAAU,CAAA,GACf,IAAI,CAAC,UAAU,MAAM,QAAQ,EAAE,EAC/B,OAAO,CAAC,SAAS,SAAS,EAAE;AACjC;AAGO,SAAS,WACd,QACwB;AACxB,QAAM,QAAgC,CAAA;AACtC,aAAW,SAAS,UAAU,IAAI;AAChC,QAAI,MAAM,QAAQ,MAAM,YAAY,MAAM,IAAI,IAAI,MAAM;AAAA,EAC1D;AACA,SAAO;AACT;AAOO,SAAS,mBACd,QACyB;AACzB,SAAO,OAAO;AAAA,KACX,UAAU,CAAA,GACR,OAAO,CAAC,UAAU,MAAM,QAAQ,MAAM,YAAY,MAAS,EAC3D,IAAI,CAAC,UAAU,CAAC,MAAM,MAAgB,MAAM,OAAO,CAAC;AAAA,EAAA;AAE3D;AAMO,SAAS,cAAc,YAAuC;AACnE,QAAM,QAAQ;AACd,UAAO,+BAAO,UAAS,gBAAiB,MAAM,UAAU,CAAA,IAAM,CAAA;AAChE;"}
@@ -0,0 +1,131 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const defaultOperators = {
4
+ keyword: "term",
5
+ text: "match",
6
+ date: "range",
7
+ number: "range",
8
+ boolean: "term",
9
+ ip: "term",
10
+ nested: "nested"
11
+ };
12
+ function normalizeOccur(occur) {
13
+ return occur || "filter";
14
+ }
15
+ function defaultOperatorForFamily(family) {
16
+ return defaultOperators[family] ?? "term";
17
+ }
18
+ function emptyCondition(family = "keyword") {
19
+ const op = defaultOperatorForFamily(family);
20
+ return op === "nested" ? { op, conditions: [] } : { op };
21
+ }
22
+ function emptyGroup() {
23
+ return { op: "bool", conditions: [] };
24
+ }
25
+ function conditionAt(root, path) {
26
+ var _a;
27
+ let node = root;
28
+ for (const index of path) {
29
+ node = (_a = node == null ? void 0 : node.conditions) == null ? void 0 : _a[index];
30
+ if (!node) return void 0;
31
+ }
32
+ return node;
33
+ }
34
+ function updateAt(root, path, update) {
35
+ if (path.length === 0) return update(root);
36
+ const [index, ...rest] = path;
37
+ return {
38
+ ...root,
39
+ conditions: (root.conditions ?? []).map(
40
+ (child, position) => position === index ? updateAt(child, rest, update) : child
41
+ )
42
+ };
43
+ }
44
+ function insertAt(root, groupPath, position, condition) {
45
+ return updateAt(root, groupPath, (group) => {
46
+ const children = [...group.conditions ?? []];
47
+ children.splice(Math.min(Math.max(position, 0), children.length), 0, condition);
48
+ return { ...group, conditions: children };
49
+ });
50
+ }
51
+ function removeAt(root, path) {
52
+ if (path.length === 0) return emptyGroup();
53
+ const index = path[path.length - 1];
54
+ return updateAt(root, path.slice(0, -1), (group) => ({
55
+ ...group,
56
+ conditions: (group.conditions ?? []).filter(
57
+ (_child, position) => position !== index
58
+ )
59
+ }));
60
+ }
61
+ function isParamValue(value) {
62
+ if (!value || typeof value !== "object" || Array.isArray(value)) return false;
63
+ const keys = Object.keys(value);
64
+ return keys.length === 1 && keys[0] === "param" && typeof value.param === "string";
65
+ }
66
+ function paramName(value) {
67
+ return isParamValue(value) ? value.param : void 0;
68
+ }
69
+ function fieldForParam(search, name) {
70
+ const walk = (condition) => {
71
+ if (!condition) return void 0;
72
+ const operands = [
73
+ condition.value,
74
+ ...condition.values ?? [],
75
+ condition.gt,
76
+ condition.gte,
77
+ condition.lt,
78
+ condition.lte
79
+ ];
80
+ if (condition.field && operands.some((value) => paramName(value) === name)) {
81
+ return condition.field;
82
+ }
83
+ for (const child of condition.conditions ?? []) {
84
+ const found = walk(child);
85
+ if (found) return found;
86
+ }
87
+ return void 0;
88
+ };
89
+ return name ? walk(search == null ? void 0 : search.query) : void 0;
90
+ }
91
+ function isEmptySpec(search) {
92
+ if (!search) return true;
93
+ const { query, ...rest } = search;
94
+ for (const value of Object.values(rest)) {
95
+ if (Array.isArray(value) ? value.length > 0 : value !== void 0 && value !== null) {
96
+ if (typeof value === "object" && !Array.isArray(value)) {
97
+ if (Object.keys(value).length > 0) return false;
98
+ continue;
99
+ }
100
+ return false;
101
+ }
102
+ }
103
+ return isEmptyCondition(query);
104
+ }
105
+ function isEmptyCondition(condition) {
106
+ if (!condition) return true;
107
+ if (condition.op === "match_all") return true;
108
+ if (condition.op !== "bool") return false;
109
+ return (condition.conditions ?? []).every(isEmptyCondition);
110
+ }
111
+ function toRawMode(_search, compiled, currentQuery = "") {
112
+ return { search: void 0, query: compiled.trim() || currentQuery };
113
+ }
114
+ function toBuilderMode(search) {
115
+ return { search: search ?? { query: emptyGroup() }, query: "" };
116
+ }
117
+ exports.conditionAt = conditionAt;
118
+ exports.defaultOperatorForFamily = defaultOperatorForFamily;
119
+ exports.emptyCondition = emptyCondition;
120
+ exports.emptyGroup = emptyGroup;
121
+ exports.fieldForParam = fieldForParam;
122
+ exports.insertAt = insertAt;
123
+ exports.isEmptySpec = isEmptySpec;
124
+ exports.isParamValue = isParamValue;
125
+ exports.normalizeOccur = normalizeOccur;
126
+ exports.paramName = paramName;
127
+ exports.removeAt = removeAt;
128
+ exports.toBuilderMode = toBuilderMode;
129
+ exports.toRawMode = toRawMode;
130
+ exports.updateAt = updateAt;
131
+ //# sourceMappingURL=esQueryBuilderModel.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"esQueryBuilderModel.cjs","sources":["../../src/profiles/esQueryBuilderModel.ts"],"sourcesContent":["/**\n * Mirror of the Go `query/esdsl` specification. The builder edits this shape and\n * the server compiles it; nothing here renders DSL, so the two never drift.\n */\n\nexport type EsOccur = \"filter\" | \"must\" | \"should\" | \"must_not\";\n\n/** A literal operand, or `{param}` binding one to a profile parameter. */\nexport type EsValue = unknown;\n\nexport type EsCondition = {\n op: string;\n occur?: EsOccur | \"\" | undefined;\n field?: string | undefined;\n fields?: string[] | undefined;\n value?: EsValue | undefined;\n values?: EsValue[] | undefined;\n gt?: EsValue | undefined;\n gte?: EsValue | undefined;\n lt?: EsValue | undefined;\n lte?: EsValue | undefined;\n format?: string | undefined;\n timeZone?: string | undefined;\n analyzer?: string | undefined;\n matchOperator?: string | undefined;\n multiMatchType?: string | undefined;\n fuzziness?: string | undefined;\n slop?: number | undefined;\n boost?: number | undefined;\n caseInsensitive?: boolean | undefined;\n escape?: boolean | undefined;\n path?: string | undefined;\n scoreMode?: string | undefined;\n minimumShouldMatch?: string | undefined;\n conditions?: EsCondition[] | undefined;\n optional?: boolean | undefined;\n when?: string | undefined;\n};\n\nexport type EsSortBy = {\n field: string;\n order?: string | undefined;\n mode?: string | undefined;\n missing?: string | undefined;\n unmappedType?: string | undefined;\n};\n\nexport type EsSearch = {\n query?: EsCondition | undefined;\n sort?: EsSortBy[] | undefined;\n size?: number | undefined;\n from?: number | undefined;\n source?:\n | {\n enabled?: boolean | undefined;\n includes?: string[] | undefined;\n excludes?: string[] | undefined;\n }\n | undefined;\n trackTotalHits?:\n | { enabled?: boolean | undefined; threshold?: number | undefined }\n | undefined;\n storedFields?: string[] | undefined;\n fields?: string[] | undefined;\n aggregations?: Record<string, unknown> | undefined;\n timeField?: string | undefined;\n};\n\n/** A path of child indexes from the root condition. `[]` is the root itself. */\nexport type ConditionPath = number[];\n\nconst defaultOperators: Record<string, string> = {\n keyword: \"term\",\n text: \"match\",\n date: \"range\",\n number: \"range\",\n boolean: \"term\",\n ip: \"term\",\n nested: \"nested\",\n};\n\nexport function normalizeOccur(occur: string | undefined): EsOccur {\n return (occur || \"filter\") as EsOccur;\n}\n\n/**\n * defaultOperatorForFamily is the operator a family reads best as. It seeds a\n * new condition and leads the operator list, so both agree by construction.\n */\nexport function defaultOperatorForFamily(family: string): string {\n return defaultOperators[family] ?? \"term\";\n}\n\nexport function emptyCondition(family = \"keyword\"): EsCondition {\n const op = defaultOperatorForFamily(family);\n return op === \"nested\" ? { op, conditions: [] } : { op };\n}\n\nexport function emptyGroup(): EsCondition {\n return { op: \"bool\", conditions: [] };\n}\n\nexport function conditionAt(\n root: EsCondition,\n path: ConditionPath,\n): EsCondition | undefined {\n let node: EsCondition | undefined = root;\n for (const index of path) {\n node = node?.conditions?.[index];\n if (!node) return undefined;\n }\n return node;\n}\n\n/**\n * updateAt rebuilds only the branch it edits, so untouched subtrees keep their\n * identity and React re-renders just the changed rows.\n */\nexport function updateAt(\n root: EsCondition,\n path: ConditionPath,\n update: (condition: EsCondition) => EsCondition,\n): EsCondition {\n if (path.length === 0) return update(root);\n const [index, ...rest] = path;\n return {\n ...root,\n conditions: (root.conditions ?? []).map((child, position) =>\n position === index ? updateAt(child, rest, update) : child,\n ),\n };\n}\n\nexport function insertAt(\n root: EsCondition,\n groupPath: ConditionPath,\n position: number,\n condition: EsCondition,\n): EsCondition {\n return updateAt(root, groupPath, (group) => {\n const children = [...(group.conditions ?? [])];\n children.splice(Math.min(Math.max(position, 0), children.length), 0, condition);\n return { ...group, conditions: children };\n });\n}\n\nexport function removeAt(root: EsCondition, path: ConditionPath): EsCondition {\n if (path.length === 0) return emptyGroup();\n const index = path[path.length - 1];\n return updateAt(root, path.slice(0, -1), (group) => ({\n ...group,\n conditions: (group.conditions ?? []).filter(\n (_child, position) => position !== index,\n ),\n }));\n}\n\n/** isParamValue reports whether an operand binds a profile parameter. */\nexport function isParamValue(value: EsValue): value is { param: string } {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) return false;\n const keys = Object.keys(value as Record<string, unknown>);\n return (\n keys.length === 1 &&\n keys[0] === \"param\" &&\n typeof (value as { param: unknown }).param === \"string\"\n );\n}\n\nexport function paramName(value: EsValue): string | undefined {\n return isParamValue(value) ? value.param : undefined;\n}\n\n/**\n * fieldForParam is the field a parameter filters on: the field of the first\n * condition whose operand binds it. A parameter the specification never\n * references has no field, and so nothing to offer values from.\n */\nexport function fieldForParam(\n search: EsSearch | undefined,\n name: string,\n): string | undefined {\n const walk = (condition: EsCondition | undefined): string | undefined => {\n if (!condition) return undefined;\n const operands: EsValue[] = [\n condition.value,\n ...(condition.values ?? []),\n condition.gt,\n condition.gte,\n condition.lt,\n condition.lte,\n ];\n if (condition.field && operands.some((value) => paramName(value) === name)) {\n return condition.field;\n }\n for (const child of condition.conditions ?? []) {\n const found = walk(child);\n if (found) return found;\n }\n return undefined;\n };\n return name ? walk(search?.query) : undefined;\n}\n\n/**\n * isEmptySpec reports whether a specification says nothing the raw query would\n * not. It is what decides whether a profile is still in raw mode.\n */\nexport function isEmptySpec(search: EsSearch | undefined): boolean {\n if (!search) return true;\n const { query, ...rest } = search;\n for (const value of Object.values(rest)) {\n if (Array.isArray(value) ? value.length > 0 : value !== undefined && value !== null) {\n if (typeof value === \"object\" && !Array.isArray(value)) {\n if (Object.keys(value as object).length > 0) return false;\n continue;\n }\n return false;\n }\n }\n return isEmptyCondition(query);\n}\n\nfunction isEmptyCondition(condition: EsCondition | undefined): boolean {\n if (!condition) return true;\n if (condition.op === \"match_all\") return true;\n if (condition.op !== \"bool\") return false;\n return (condition.conditions ?? []).every(isEmptyCondition);\n}\n\nexport type QueryModeTransition = {\n search: EsSearch | undefined;\n query: string;\n};\n\n/**\n * toRawMode leaves the builder for the raw editor, seeding it with the DSL the\n * specification last compiled to. The specification is dropped, never kept\n * alongside the query: the server treats holding both as an authoring error.\n */\nexport function toRawMode(\n _search: EsSearch | undefined,\n compiled: string,\n currentQuery = \"\",\n): QueryModeTransition {\n return { search: undefined, query: compiled.trim() || currentQuery };\n}\n\n/** toBuilderMode is the inverse: the raw query is dropped, not parsed. */\nexport function toBuilderMode(search?: EsSearch): QueryModeTransition {\n return { search: search ?? { query: emptyGroup() }, query: \"\" };\n}\n"],"names":[],"mappings":";;AAuEA,MAAM,mBAA2C;AAAA,EAC/C,SAAS;AAAA,EACT,MAAM;AAAA,EACN,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,IAAI;AAAA,EACJ,QAAQ;AACV;AAEO,SAAS,eAAe,OAAoC;AACjE,SAAQ,SAAS;AACnB;AAMO,SAAS,yBAAyB,QAAwB;AAC/D,SAAO,iBAAiB,MAAM,KAAK;AACrC;AAEO,SAAS,eAAe,SAAS,WAAwB;AAC9D,QAAM,KAAK,yBAAyB,MAAM;AAC1C,SAAO,OAAO,WAAW,EAAE,IAAI,YAAY,CAAA,EAAC,IAAM,EAAE,GAAA;AACtD;AAEO,SAAS,aAA0B;AACxC,SAAO,EAAE,IAAI,QAAQ,YAAY,CAAA,EAAC;AACpC;AAEO,SAAS,YACd,MACA,MACyB;;AACzB,MAAI,OAAgC;AACpC,aAAW,SAAS,MAAM;AACxB,YAAO,kCAAM,eAAN,mBAAmB;AAC1B,QAAI,CAAC,KAAM,QAAO;AAAA,EACpB;AACA,SAAO;AACT;AAMO,SAAS,SACd,MACA,MACA,QACa;AACb,MAAI,KAAK,WAAW,EAAG,QAAO,OAAO,IAAI;AACzC,QAAM,CAAC,OAAO,GAAG,IAAI,IAAI;AACzB,SAAO;AAAA,IACL,GAA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