Skip to content

Commit

Permalink
Add support for using the PivotTable/Table outputs within Shadow DOM (#…
Browse files Browse the repository at this point in the history
…104)

* Send query-viewer elemento to renderJSPivot

* Update jsPivotTable version

* Upgrade jspivottable version

* Pickup jsPivotTable from github

* use jsPivotTable version 1.4.3

* Update package-lock.json
  • Loading branch information
c-milocanovich authored Sep 3, 2024
1 parent e53dc58 commit f2d6413
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 18 deletions.
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"date-fns": "^2.30.0",
"highcharts": "^11.1.0",
"jquery": "^3.7.1",
"jspivottable": "1.3.7",
"jspivottable": "1.4.3",
"material-icons": "^1.13.1",
"rollup-plugin-dotenv": "^0.5.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import {
processDataAndMetadata
} from "./processDataAndMetadata";

import { Options } from "highcharts";
import { Options, PaneOptions } from "highcharts";
import { ChartTypes } from "./chart-types";
import {
AVERAGE_DAYS_PER_MONTH,
Expand Down Expand Up @@ -402,7 +402,7 @@ export class QueryViewerChart {
chartOptions={{ type: "line", height: 80 }}
seriesOptions={fillHeaderAndFooter(this.chartType, charts)}
tooltipOptions={{ enabled: false }}
paneOptions={pane}
paneOptions={pane as PaneOptions}
legendOptions={{ enabled: false }}
plotOptions={{
line: {
Expand All @@ -429,7 +429,7 @@ export class QueryViewerChart {
})

/*
{ {this.renderGroupByCombo({
showYears: true,
showSemesters: true,
Expand Down Expand Up @@ -485,7 +485,7 @@ export class QueryViewerChart {
chartOptions={chart}
seriesOptions={series}
tooltipOptions={tooltip}
paneOptions={pane}
paneOptions={pane as PaneOptions}
legendOptions={legend}
plotOptions={plotOptions}
yaxisOptions={yAxis}
Expand Down
17 changes: 14 additions & 3 deletions src/components/query-viewer-pivot-table/query-viewer-pivot.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
/* eslint-disable @typescript-eslint/no-var-requires */
import { Component, h, Method, Prop, Watch, Listen } from "@stencil/core";
import {
Component,
Element,
h,
Method,
Prop,
Watch,
Listen
} from "@stencil/core";
import {
renderJSPivot,
OAT,
Expand Down Expand Up @@ -41,6 +49,9 @@ export class QueryViewerPivot {
private shouldReRenderPivot = false;
private pageSizeChangeWasCommittedByTheUser = false;

@Element()
element: HTMLGxQueryViewerPivotElement;

/**
* Response Attribute Values
*/
Expand Down Expand Up @@ -94,7 +105,6 @@ export class QueryViewerPivot {
);
}


/**
* Response Page Data
*/
Expand Down Expand Up @@ -392,7 +402,8 @@ export class QueryViewerPivot {
this.queryViewerConfiguration.pivotParams,
this.pivotCollection.collection,
this.QueryViewerTranslations,
this.queryViewerConfiguration
this.queryViewerConfiguration,
this.element
);
}
}
Expand Down
9 changes: 6 additions & 3 deletions src/components/query-viewer/query-viewer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {
Component,
EventEmitter,
Element,
Event,
Host,
Listen,
Expand Down Expand Up @@ -102,6 +103,7 @@ export class QueryViewer {
[QueryViewerOutputType.Default]: response =>
this.notImplementedRender(response)
};
@Element() element: HTMLGxQueryViewerElement;

// refs
private controller: HTMLGxQueryViewerControllerElement;
Expand Down Expand Up @@ -866,9 +868,10 @@ export class QueryViewer {
}

private setControllerRef() {
this.controller = document.querySelector(
`[id=${this.temporalId}] > gx-query-viewer-controller`
);
// this.controller = document.querySelector(
// `[id=${this.temporalId}] > gx-query-viewer-controller`
// );
this.controller = this.element.querySelector(`gx-query-viewer-controller`);
}

componentWillLoad() {
Expand Down

0 comments on commit f2d6413

Please sign in to comment.