@malloydata/malloy-explorer 0.0.285-dev250529214052 → 0.0.285-dev250529220510
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@flowtypes/components/MalloyExplorerProvider.flow.js +5 -0
- package/dist/cjs/index.cjs +15 -4
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/esm/index.js +15 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/types/components/MalloyExplorerProvider.d.ts +5 -1
- package/dist/types/contexts/QueryEditorContext.d.ts +4 -0
- package/package.json +1 -1
|
@@ -9,6 +9,11 @@ declare export interface MalloyExplorerProviderProps {
|
|
|
9
9
|
onFocusedNestViewPathChange: (path: string[]) => void;
|
|
10
10
|
children: ReactNode | ReactNode[];
|
|
11
11
|
topValues?: SearchValueMapResult[];
|
|
12
|
+
onDrill?: ($$param0$: {
|
|
13
|
+
stableQuery: Malloy.Query | void,
|
|
14
|
+
stableDrillClauses: Malloy.DrillOperation[] | void,
|
|
15
|
+
...
|
|
16
|
+
}) => void;
|
|
12
17
|
}
|
|
13
18
|
declare export function MalloyExplorerProvider(
|
|
14
19
|
$$param0$: MalloyExplorerProviderProps,
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -3424,7 +3424,8 @@ function MalloyExplorerProvider({
|
|
|
3424
3424
|
focusedNestViewPath,
|
|
3425
3425
|
onFocusedNestViewPathChange,
|
|
3426
3426
|
children,
|
|
3427
|
-
topValues
|
|
3427
|
+
topValues,
|
|
3428
|
+
onDrill
|
|
3428
3429
|
}) {
|
|
3429
3430
|
const rootQuery = useQueryBuilder(source, query);
|
|
3430
3431
|
return /* @__PURE__ */ jsxRuntime.jsx(TooltipProvider, {
|
|
@@ -3437,7 +3438,8 @@ function MalloyExplorerProvider({
|
|
|
3437
3438
|
source,
|
|
3438
3439
|
rootQuery,
|
|
3439
3440
|
setQuery: onQueryChange,
|
|
3440
|
-
topValues
|
|
3441
|
+
topValues,
|
|
3442
|
+
onDrill
|
|
3441
3443
|
},
|
|
3442
3444
|
children
|
|
3443
3445
|
})
|
|
@@ -35678,14 +35680,23 @@ function RenderedResult({
|
|
|
35678
35680
|
}) {
|
|
35679
35681
|
const [renderer, setRenderer] = React.useState();
|
|
35680
35682
|
const {
|
|
35683
|
+
onDrill,
|
|
35681
35684
|
setQuery
|
|
35682
35685
|
} = React.useContext(QueryEditorContext);
|
|
35683
35686
|
React.useEffect(() => {
|
|
35684
35687
|
const renderer2 = document.createElement("malloy-render");
|
|
35685
35688
|
renderer2.malloyResult = result;
|
|
35686
35689
|
renderer2.onDrill = ({
|
|
35687
|
-
stableQuery
|
|
35690
|
+
stableQuery,
|
|
35691
|
+
stableDrillClauses
|
|
35688
35692
|
}) => {
|
|
35693
|
+
if (onDrill) {
|
|
35694
|
+
onDrill({
|
|
35695
|
+
stableQuery,
|
|
35696
|
+
stableDrillClauses
|
|
35697
|
+
});
|
|
35698
|
+
return;
|
|
35699
|
+
}
|
|
35689
35700
|
const rootQuery = new QB.ASTQuery({
|
|
35690
35701
|
query: stableQuery,
|
|
35691
35702
|
source
|
|
@@ -35696,7 +35707,7 @@ function RenderedResult({
|
|
|
35696
35707
|
enableDrill: true
|
|
35697
35708
|
};
|
|
35698
35709
|
setRenderer(renderer2);
|
|
35699
|
-
}, [result, source, setQuery]);
|
|
35710
|
+
}, [onDrill, result, source, setQuery]);
|
|
35700
35711
|
if (renderer) {
|
|
35701
35712
|
return /* @__PURE__ */ jsxRuntime.jsx(DOMElement, {
|
|
35702
35713
|
element: renderer,
|