@malloydata/render 0.0.211-dev241111205502 → 0.0.211-dev241112175236
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/.storybook/malloy-stories-indexer.ts +2 -1
- package/dist/component/copy-to-html.d.ts +3 -0
- package/dist/component/render.d.ts +8 -3
- package/dist/component/types.d.ts +7 -0
- package/dist/index.d.ts +1 -0
- package/dist/module/index.mjs +63 -4
- package/dist/module/index.umd.js +198 -184
- package/dist/register/chart-dev-tool-BgukBFxT.mjs +6 -0
- package/dist/register/register.mjs +12752 -12674
- package/dist/register/register.umd.js +209 -209
- package/dist/stories/util.d.ts +0 -1
- package/dist/webcomponent/chart-dev-tool-BgukBFxT.mjs +6 -0
- package/dist/webcomponent/malloy-render.mjs +12752 -12674
- package/dist/webcomponent/malloy-render.umd.js +209 -209
- package/package.json +2 -2
- package/vite.config.base.ts +18 -8
|
@@ -139,7 +139,8 @@ export function viteMalloyStoriesPlugin(): PluginOption {
|
|
|
139
139
|
};`
|
|
140
140
|
: `
|
|
141
141
|
import script from '${id}?raw';
|
|
142
|
-
import {createLoader
|
|
142
|
+
import {createLoader} from './util';
|
|
143
|
+
import {copyMalloyRenderHTML} from '../component/copy-to-html';
|
|
143
144
|
import './themes.css';
|
|
144
145
|
import '../component/render-webcomponent';
|
|
145
146
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ModelDef, QueryResult, Result } from '@malloydata/malloy';
|
|
2
|
+
import { Accessor } from 'solid-js';
|
|
2
3
|
import './render.css';
|
|
3
4
|
import { ComponentOptions, ICustomElement } from 'component-register';
|
|
4
|
-
import { MalloyClickEventPayload, VegaConfigHandler } from './types';
|
|
5
|
+
import { DashboardConfig, MalloyClickEventPayload, TableConfig, VegaConfigHandler } from './types';
|
|
5
6
|
export type MalloyRenderProps = {
|
|
6
7
|
result?: Result;
|
|
7
8
|
queryResult?: QueryResult;
|
|
@@ -9,13 +10,17 @@ export type MalloyRenderProps = {
|
|
|
9
10
|
scrollEl?: HTMLElement;
|
|
10
11
|
onClick?: (payload: MalloyClickEventPayload) => void;
|
|
11
12
|
vegaConfigOverride?: VegaConfigHandler;
|
|
13
|
+
tableConfig?: Partial<TableConfig>;
|
|
14
|
+
dashboardConfig?: Partial<DashboardConfig>;
|
|
12
15
|
};
|
|
13
16
|
export declare const useConfig: () => {
|
|
14
|
-
|
|
15
|
-
|
|
17
|
+
tableConfig: Accessor<TableConfig>;
|
|
18
|
+
dashboardConfig: Accessor<DashboardConfig>;
|
|
16
19
|
element: ICustomElement;
|
|
17
20
|
addCSSToShadowRoot: (css: string) => void;
|
|
18
21
|
addCSSToDocument: (id: string, css: string) => void;
|
|
22
|
+
onClick?: ((payload: MalloyClickEventPayload) => void) | undefined;
|
|
23
|
+
vegaConfigOverride?: VegaConfigHandler | undefined;
|
|
19
24
|
};
|
|
20
25
|
export declare function MalloyRender(props: MalloyRenderProps, { element }: ComponentOptions): import("solid-js").JSX.Element;
|
|
21
26
|
export declare function MalloyRenderInner(props: {
|
|
@@ -86,4 +86,11 @@ export type Channel = {
|
|
|
86
86
|
fields: string[];
|
|
87
87
|
type: ScaleType | null;
|
|
88
88
|
};
|
|
89
|
+
export type TableConfig = {
|
|
90
|
+
disableVirtualization: boolean;
|
|
91
|
+
rowLimit: number;
|
|
92
|
+
};
|
|
93
|
+
export type DashboardConfig = {
|
|
94
|
+
disableVirtualization: boolean;
|
|
95
|
+
};
|
|
89
96
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export { HTMLView, JSONView } from './html/html_view';
|
|
|
2
2
|
export * from './html/data_styles';
|
|
3
3
|
export type { MalloyRenderProps } from './component/render';
|
|
4
4
|
export { getDrillQuery } from './html/drill';
|
|
5
|
+
export { copyMalloyRenderHTML, getMalloyRenderHTML, } from './component/copy-to-html';
|
package/dist/module/index.mjs
CHANGED
|
@@ -145326,7 +145326,7 @@ Fv.renderFactories = [
|
|
|
145326
145326
|
wO.instance
|
|
145327
145327
|
];
|
|
145328
145328
|
let f8 = Fv;
|
|
145329
|
-
class
|
|
145329
|
+
class Wst {
|
|
145330
145330
|
constructor(e) {
|
|
145331
145331
|
this.document = e;
|
|
145332
145332
|
}
|
|
@@ -145360,7 +145360,7 @@ class Qst {
|
|
|
145360
145360
|
}
|
|
145361
145361
|
}
|
|
145362
145362
|
}
|
|
145363
|
-
class
|
|
145363
|
+
class Vst {
|
|
145364
145364
|
constructor(e) {
|
|
145365
145365
|
this.document = e;
|
|
145366
145366
|
}
|
|
@@ -145484,12 +145484,71 @@ function iE(t, e, n, r, i) {
|
|
|
145484
145484
|
);
|
|
145485
145485
|
}), s.childRenderers = o, s;
|
|
145486
145486
|
}
|
|
145487
|
+
async function Yst(t) {
|
|
145488
|
+
const e = await Nit(t);
|
|
145489
|
+
try {
|
|
145490
|
+
await navigator.clipboard.writeText(e);
|
|
145491
|
+
} catch (n) {
|
|
145492
|
+
console.error("Failed to copy text: ", n);
|
|
145493
|
+
}
|
|
145494
|
+
}
|
|
145495
|
+
async function Nit(t) {
|
|
145496
|
+
let e = "";
|
|
145497
|
+
const n = t.tableConfig ?? {}, r = Object.assign(
|
|
145498
|
+
{
|
|
145499
|
+
disableVirtualization: !0
|
|
145500
|
+
},
|
|
145501
|
+
n
|
|
145502
|
+
);
|
|
145503
|
+
t.tableConfig = r;
|
|
145504
|
+
const i = t.dashboardConfig ?? {}, s = Object.assign(
|
|
145505
|
+
{
|
|
145506
|
+
disableVirtualization: !0
|
|
145507
|
+
},
|
|
145508
|
+
i
|
|
145509
|
+
);
|
|
145510
|
+
if (t.dashboardConfig = s, await wit(1e3), t.shadowRoot) {
|
|
145511
|
+
let o = "";
|
|
145512
|
+
for (const u of [...t.shadowRoot.adoptedStyleSheets]) {
|
|
145513
|
+
for (let l = 0; l < u.cssRules.length; l++) {
|
|
145514
|
+
const c = u.cssRules.item(l);
|
|
145515
|
+
c && (o += `
|
|
145516
|
+
` + c.cssText);
|
|
145517
|
+
}
|
|
145518
|
+
o = o.replaceAll(":host", ".malloy_html_host");
|
|
145519
|
+
const a = t.getAttribute("style");
|
|
145520
|
+
e = `
|
|
145521
|
+
<div>
|
|
145522
|
+
<style>
|
|
145523
|
+
${o}
|
|
145524
|
+
|
|
145525
|
+
form.vega-bindings {
|
|
145526
|
+
margin-block: 0em;
|
|
145527
|
+
}
|
|
145528
|
+
</style>
|
|
145529
|
+
<div class="malloy_html_host" style="${a}">
|
|
145530
|
+
${t.shadowRoot.innerHTML}
|
|
145531
|
+
</div>
|
|
145532
|
+
</div>
|
|
145533
|
+
`;
|
|
145534
|
+
}
|
|
145535
|
+
} else
|
|
145536
|
+
e = t.innerHTML;
|
|
145537
|
+
return t.tableConfig = n, t.dashboardConfig = i, e;
|
|
145538
|
+
}
|
|
145539
|
+
function wit(t) {
|
|
145540
|
+
return new Promise((e) => {
|
|
145541
|
+
setTimeout(e, t);
|
|
145542
|
+
});
|
|
145543
|
+
}
|
|
145487
145544
|
export {
|
|
145488
145545
|
I1 as Currency,
|
|
145489
145546
|
vc as DataVolumeUnit,
|
|
145490
145547
|
Vn as DurationUnit,
|
|
145491
|
-
|
|
145492
|
-
|
|
145548
|
+
Wst as HTMLView,
|
|
145549
|
+
Vst as JSONView,
|
|
145550
|
+
Yst as copyMalloyRenderHTML,
|
|
145493
145551
|
BJ as getDrillQuery,
|
|
145552
|
+
Nit as getMalloyRenderHTML,
|
|
145494
145553
|
mit as isDurationUnit
|
|
145495
145554
|
};
|