Skip to content

Commit

Permalink
fix: fix optionsChanged watch and add more types
Browse files Browse the repository at this point in the history
also bump some deps
  • Loading branch information
mikaelkaron committed Oct 19, 2019
1 parent 4758c0f commit 39bd5ba
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 27 deletions.
34 changes: 17 additions & 17 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
"release": "standard-version"
},
"peerDependencies": {
"apexcharts": "^3.8.5"
"apexcharts": "^3.10.0"
},
"devDependencies": {
"@stencil/core": "^1.3.2",
"@stencil/core": "^1.7.3",
"standard-version": "^7.0.0"
},
"license": "MIT",
Expand Down
11 changes: 7 additions & 4 deletions src/components.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable */
/* tslint:disable */
/**
* This is an autogenerated file created by the Stencil compiler.
Expand All @@ -11,7 +12,7 @@ import {
ApexChartType,
ApexChartWidth,
ApexOptionsSeries,
} from './components/apex-chart/apex-charts';
} from './components/apex-chart';
import {
ApexOptions,
} from 'apexcharts';
Expand Down Expand Up @@ -57,7 +58,7 @@ declare global {


interface HTMLApexChartElement extends Components.ApexChart, HTMLStencilElement {}
var HTMLApexChartElement: {
const HTMLApexChartElement: {
prototype: HTMLApexChartElement;
new (): HTMLApexChartElement;
};
Expand All @@ -67,7 +68,7 @@ declare global {
}

declare namespace LocalJSX {
interface ApexChart extends JSXBase.HTMLAttributes<HTMLApexChartElement> {
interface ApexChart {
/**
* (optional) Height
* @see https://apexcharts.com/docs/options/chart/height/
Expand Down Expand Up @@ -105,7 +106,9 @@ export { LocalJSX as JSX };

declare module "@stencil/core" {
export namespace JSX {
interface IntrinsicElements extends LocalJSX.IntrinsicElements {}
interface IntrinsicElements {
'apex-chart': LocalJSX.ApexChart & JSXBase.HTMLAttributes<HTMLApexChartElement>;
}
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/components/apex-chart/apex-chart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
ApexChartHeight,
ApexChartWidth,
ApexOptionsSeries
} from './apex-charts';
} from '.';

const config = (
options: ApexOptions,
Expand Down Expand Up @@ -70,10 +70,10 @@ export class chart {
@Prop({ mutable: true }) options?: ApexOptions;

@Watch('options')
optionsChanged(options) {
optionsChanged(options: ApexOptions) {
if (this.chartObj !== null) {
return this.chartObj.updateOptions(
config(options, this.type, this.width, options, this.series)
config(options, this.type, this.width, this.height, this.series)
);
}
}
Expand All @@ -85,7 +85,7 @@ export class chart {
@Prop({ mutable: true }) series?: ApexOptionsSeries;

@Watch('series')
seriesChanged(series) {
seriesChanged(series: ApexOptionsSeries) {
if (this.chartObj !== null) {
this.chartObj.updateSeries(series, true);
}
Expand Down
File renamed without changes.

0 comments on commit 39bd5ba

Please sign in to comment.