@sankhyalabs/ezui 5.21.2 → 5.22.0-dev.1
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/dist/cjs/ICustomRender-6fafffce.js +13 -0
- package/dist/cjs/ez-actions-button.cjs.entry.js +1 -0
- package/dist/cjs/ez-chart.cjs.entry.js +433 -0
- package/dist/cjs/ez-collapsible-box.cjs.entry.js +1 -0
- package/dist/cjs/ez-combo-box.cjs.entry.js +1 -0
- package/dist/cjs/{ez-text-edit.cjs.entry.js → ez-custom-form-input_2.cjs.entry.js} +99 -0
- package/dist/cjs/ez-form-view.cjs.entry.js +34 -3
- package/dist/cjs/ez-form.cjs.entry.js +77 -2
- package/dist/cjs/ez-grid.cjs.entry.js +313 -39
- package/dist/cjs/ez-list.cjs.entry.js +10 -2
- package/dist/cjs/ez-number-input.cjs.entry.js +37 -31
- package/dist/cjs/ez-scroller_2.cjs.entry.js +222 -0
- package/dist/cjs/ez-search.cjs.entry.js +39 -32
- package/dist/cjs/ez-sidebar-navigator.cjs.entry.js +92 -0
- package/dist/cjs/ez-split-item.cjs.entry.js +1 -0
- package/dist/cjs/{ez-scroller_3.cjs.entry.js → ez-tree.cjs.entry.js} +0 -215
- package/dist/cjs/ezui.cjs.js +1 -1
- package/dist/cjs/index-a7b0c73d.js +16 -4
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/ez-chart/components/BarChart.js +27 -0
- package/dist/collection/components/ez-chart/components/ColumnChart.js +27 -0
- package/dist/collection/components/ez-chart/components/DonutChart.js +42 -0
- package/dist/collection/components/ez-chart/components/LineChart.js +27 -0
- package/dist/collection/components/ez-chart/components/PieChart.js +45 -0
- package/dist/collection/components/ez-chart/components/index.js +5 -0
- package/dist/collection/components/ez-chart/ez-chart.css +5 -0
- package/dist/collection/components/ez-chart/ez-chart.js +284 -0
- package/dist/collection/components/ez-chart/interfaces/ChartAxis.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartContext.js +14 -0
- package/dist/collection/components/ez-chart/interfaces/ChartOptions.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartSerie.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartStrategies.js +1 -0
- package/dist/collection/components/ez-chart/interfaces/ChartType.js +8 -0
- package/dist/collection/components/ez-chart/interfaces/index.js +5 -0
- package/dist/collection/components/ez-chart/test/mock-chart.js +137 -0
- package/dist/collection/components/ez-chart/types/BaseHighChartsRender.js +146 -0
- package/dist/collection/components/ez-form/ez-form.js +130 -4
- package/dist/collection/components/ez-form-view/custom-input/ez-custom-form-input.js +278 -0
- package/dist/collection/components/ez-form-view/ez-form-view.js +110 -1
- package/dist/collection/components/ez-form-view/fieldbuilder/templates/NumberInput.tpl.js +3 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/AgGridController.js +51 -22
- package/dist/collection/components/ez-grid/controller/ag-grid/DataSource.js +6 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/GridEditionManager.js +35 -1
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.js +59 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.js +11 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellEditor.js +10 -3
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/EzCellRender.js +40 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/IUICellRender.js +1 -0
- package/dist/collection/components/ez-grid/controller/ag-grid/editor/templates/NumberInput.tpl.js +3 -2
- package/dist/collection/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.js +40 -0
- package/dist/collection/components/ez-grid/ez-grid.js +237 -12
- package/dist/collection/components/ez-grid/interfaces/ICustomFormatter.js +1 -0
- package/dist/collection/components/ez-grid/interfaces/index.js +1 -0
- package/dist/collection/components/ez-grid/test/resources/gridDataUnit.js +19 -0
- package/dist/collection/components/ez-list/ez-list.js +28 -2
- package/dist/collection/components/ez-number-input/ez-number-input.js +46 -31
- package/dist/collection/components/ez-search/ez-search.js +38 -32
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.css +6 -2
- package/dist/collection/components/ez-sidebar-button/ez-sidebar-button.js +1 -1
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.css +180 -0
- package/dist/collection/components/ez-sidebar-navigator/ez-sidebar-navigator.js +293 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.js +5 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.js +6 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.js +6 -0
- package/dist/collection/components/ez-sidebar-navigator/interfaces/index.js +3 -0
- package/dist/collection/components/ez-sidebar-navigator/messages/constants.js +5 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditor.js +5 -0
- package/dist/collection/utils/customEditor/interfaces/ICustomEditorInfo.js +1 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRender.js +5 -0
- package/dist/collection/utils/customRender/interfaces/ICustomRenderInfo.js +1 -0
- package/dist/collection/utils/form/DataBinder.js +26 -0
- package/dist/collection/utils/form/test/DataBinder.test.js +41 -4
- package/dist/collection/utils/form/test/resources/metadataTest.js +15 -0
- package/dist/collection/utils/index.js +2 -0
- package/dist/custom-elements/index.d.ts +18 -0
- package/dist/custom-elements/index.js +1145 -117
- package/dist/esm/ICustomRender-875b5a40.js +13 -0
- package/dist/esm/ez-actions-button.entry.js +1 -0
- package/dist/esm/ez-chart.entry.js +429 -0
- package/dist/esm/ez-collapsible-box.entry.js +1 -0
- package/dist/esm/ez-combo-box.entry.js +1 -0
- package/dist/esm/{ez-text-edit.entry.js → ez-custom-form-input_2.entry.js} +101 -3
- package/dist/esm/ez-form-view.entry.js +34 -3
- package/dist/esm/ez-form.entry.js +78 -3
- package/dist/esm/ez-grid.entry.js +313 -39
- package/dist/esm/ez-list.entry.js +10 -2
- package/dist/esm/ez-number-input.entry.js +38 -32
- package/dist/esm/ez-scroller_2.entry.js +217 -0
- package/dist/esm/ez-search.entry.js +39 -32
- package/dist/esm/ez-sidebar-navigator.entry.js +88 -0
- package/dist/esm/ez-split-item.entry.js +1 -0
- package/dist/esm/{ez-scroller_3.entry.js → ez-tree.entry.js} +3 -216
- package/dist/esm/ezui.js +1 -1
- package/dist/esm/index-baa5e267.js +16 -4
- package/dist/esm/loader.js +1 -1
- package/dist/ezui/ezui.esm.js +1 -1
- package/dist/ezui/p-12ae1104.entry.js +1 -0
- package/dist/ezui/p-2097d0cf.entry.js +1 -0
- package/dist/ezui/p-3b4eeeb6.entry.js +1 -0
- package/dist/ezui/p-4607fb89.js +1 -0
- package/dist/ezui/p-4d5235f1.entry.js +1 -0
- package/dist/ezui/p-5056284a.entry.js +1 -0
- package/dist/ezui/p-7922142b.entry.js +1 -0
- package/dist/ezui/{p-fbee26ec.entry.js → p-816cece6.entry.js} +2 -2
- package/dist/ezui/p-84e439b9.entry.js +1 -0
- package/dist/ezui/p-8888d9ed.entry.js +1 -0
- package/dist/ezui/p-922ac38b.entry.js +1 -0
- package/dist/ezui/p-9ab22a07.entry.js +1 -0
- package/dist/ezui/p-a31b9c90.entry.js +1 -0
- package/dist/ezui/p-bcb53f27.entry.js +1 -0
- package/dist/ezui/p-ecc2c1ec.entry.js +1 -0
- package/dist/ezui/p-ffef392d.entry.js +1 -0
- package/dist/types/components/ez-chart/components/BarChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/ColumnChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/DonutChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/LineChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/PieChart.d.ts +9 -0
- package/dist/types/components/ez-chart/components/index.d.ts +5 -0
- package/dist/types/components/ez-chart/ez-chart.d.ts +58 -0
- package/dist/types/components/ez-chart/interfaces/ChartAxis.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/ChartContext.d.ts +11 -0
- package/dist/types/components/ez-chart/interfaces/ChartOptions.d.ts +10 -0
- package/dist/types/components/ez-chart/interfaces/ChartSerie.d.ts +20 -0
- package/dist/types/components/ez-chart/interfaces/ChartStrategies.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/ChartType.d.ts +7 -0
- package/dist/types/components/ez-chart/interfaces/index.d.ts +5 -0
- package/dist/types/components/ez-chart/types/BaseHighChartsRender.d.ts +15 -0
- package/dist/types/components/ez-form/ez-form.d.ts +20 -1
- package/dist/types/components/ez-form-view/custom-input/ez-custom-form-input.d.ts +48 -0
- package/dist/types/components/ez-form-view/ez-form-view.d.ts +16 -1
- package/dist/types/components/ez-grid/controller/EzGridController.d.ts +37 -0
- package/dist/types/components/ez-grid/controller/ag-grid/AgGridController.d.ts +13 -4
- package/dist/types/components/ez-grid/controller/ag-grid/DataSource.d.ts +1 -0
- package/dist/types/components/ez-grid/controller/ag-grid/GridEditionManager.d.ts +7 -1
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellEditor.d.ts +19 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/EzGridCustomCellRender.d.ts +14 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellEditorConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/components/test/constants/EzGridCustomCellRenderConstants.d.ts +11 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellEditor.d.ts +6 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/EzCellRender.d.ts +15 -0
- package/dist/types/components/ez-grid/controller/ag-grid/editor/IUICellRender.d.ts +10 -0
- package/dist/types/components/ez-grid/controller/ag-grid/test/constants/GridEditionMock.d.ts +6 -0
- package/dist/types/components/ez-grid/ez-grid.d.ts +35 -1
- package/dist/types/components/ez-grid/interfaces/ICustomFormatter.d.ts +5 -0
- package/dist/types/components/ez-grid/interfaces/index.d.ts +1 -0
- package/dist/types/components/ez-grid/test/resources/gridDataUnit.d.ts +2 -0
- package/dist/types/components/ez-list/ez-list.d.ts +5 -0
- package/dist/types/components/ez-number-input/ez-number-input.d.ts +3 -0
- package/dist/types/components/ez-search/ez-search.d.ts +4 -2
- package/dist/types/components/ez-sidebar-navigator/ez-sidebar-navigator.d.ts +57 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/ModeMenuEnum.d.ts +4 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/SizeMenuEnum.d.ts +5 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/TypeMenuEnum.d.ts +5 -0
- package/dist/types/components/ez-sidebar-navigator/interfaces/index.d.ts +3 -0
- package/dist/types/components/ez-sidebar-navigator/messages/constants.d.ts +5 -0
- package/dist/types/components.d.ts +334 -5
- package/dist/types/utils/customEditor/interfaces/ICustomEditor.d.ts +31 -0
- package/dist/types/utils/customEditor/interfaces/ICustomEditorInfo.d.ts +5 -0
- package/dist/types/utils/customRender/interfaces/ICustomRender.d.ts +29 -0
- package/dist/types/utils/customRender/interfaces/ICustomRenderInfo.d.ts +5 -0
- package/dist/types/utils/form/DataBinder.d.ts +3 -0
- package/dist/types/utils/form/test/resources/metadataTest.d.ts +2 -0
- package/dist/types/utils/index.d.ts +2 -0
- package/package.json +2 -1
- package/react/components.d.ts +3 -0
- package/react/components.js +3 -0
- package/react/components.js.map +1 -1
- package/dist/ezui/p-0447d17c.entry.js +0 -1
- package/dist/ezui/p-20ec22c0.entry.js +0 -1
- package/dist/ezui/p-2a1a0e04.entry.js +0 -1
- package/dist/ezui/p-637f69f2.entry.js +0 -1
- package/dist/ezui/p-786559c5.entry.js +0 -1
- package/dist/ezui/p-7c770f14.entry.js +0 -1
- package/dist/ezui/p-91f626d3.entry.js +0 -1
- package/dist/ezui/p-99ead599.entry.js +0 -1
- package/dist/ezui/p-b567fa8c.entry.js +0 -1
- package/dist/ezui/p-bae3d0aa.entry.js +0 -1
- package/dist/ezui/p-db77a984.entry.js +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as Highcharts from 'highcharts';
|
|
2
|
+
import { BaseHighChartsRender } from "../types/BaseHighChartsRender";
|
|
3
|
+
export class LineChartStrategy extends BaseHighChartsRender {
|
|
4
|
+
buildOptions(series, xAxis, yAxis, options) {
|
|
5
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ chart: Object.assign(Object.assign({}, (options.width && { width: options.width })), (options.height && { height: options.height })), title: this.parseTitle(options.title) }, (options.subTitle && { subtitle: this.parseSubTitle(options.subTitle) })), (yAxis && { yAxis: this.parseAxis(yAxis) })), (xAxis && { xAxis: this.parseAxis(xAxis) })), { series: this.parseSerie(series) }), this.buildResposiveConfig()), this.buildDefaultChartOptions()), { tooltip: this.buildFormatterTooltip(series), legend: {
|
|
6
|
+
enabled: options.legendEnabled,
|
|
7
|
+
} }), (options.onClickSerie && {
|
|
8
|
+
plotOptions: {
|
|
9
|
+
series: {
|
|
10
|
+
cursor: 'pointer',
|
|
11
|
+
point: {
|
|
12
|
+
events: {
|
|
13
|
+
click: this.buildOnClickCallBack(options.onClickSerie),
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
render(container, series, xAxis, yAxis, options) {
|
|
21
|
+
this.chart = Highcharts.chart(container, this.buildOptions(series, xAxis, yAxis, options));
|
|
22
|
+
}
|
|
23
|
+
destroy() {
|
|
24
|
+
var _a;
|
|
25
|
+
(_a = this.chart) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as Highcharts from 'highcharts';
|
|
2
|
+
import { BaseHighChartsRender } from "../types/BaseHighChartsRender";
|
|
3
|
+
export class PieChartStrategy extends BaseHighChartsRender {
|
|
4
|
+
buildOptions(series, options) {
|
|
5
|
+
const dataLabels = [
|
|
6
|
+
{
|
|
7
|
+
enabled: true,
|
|
8
|
+
distance: 10
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
enabled: true,
|
|
12
|
+
distance: -40,
|
|
13
|
+
format: '{point.percentage:.1f}%',
|
|
14
|
+
style: {
|
|
15
|
+
fontSize: '1.2em',
|
|
16
|
+
textOutline: 'none',
|
|
17
|
+
opacity: 0.7
|
|
18
|
+
},
|
|
19
|
+
filter: {
|
|
20
|
+
property: 'percentage',
|
|
21
|
+
operator: '>',
|
|
22
|
+
value: 4
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
];
|
|
26
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({ chart: Object.assign(Object.assign({ type: 'pie' }, (options.width && { width: options.width })), (options.height && { height: options.height })), title: this.parseTitle(options.title) }, (options.subTitle && { subtitle: this.parseSubTitle(options.subTitle) })), { series: this.parseSerie(series), tooltip: this.buildFormatterTooltip(series), legend: {
|
|
27
|
+
enabled: options.legendEnabled,
|
|
28
|
+
}, plotOptions: {
|
|
29
|
+
series: Object.assign({ dataLabels, cursor: 'pointer' }, (options.onClickSerie && {
|
|
30
|
+
point: {
|
|
31
|
+
events: {
|
|
32
|
+
click: this.buildOnClickCallBack(options.onClickSerie),
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}))
|
|
36
|
+
} }), this.buildResposiveConfig()), this.buildDefaultChartOptions());
|
|
37
|
+
}
|
|
38
|
+
render(container, series, _xAxis, _yAxis, options) {
|
|
39
|
+
this.chart = Highcharts.chart(container, this.buildOptions(series, options));
|
|
40
|
+
}
|
|
41
|
+
destroy() {
|
|
42
|
+
var _a;
|
|
43
|
+
(_a = this.chart) === null || _a === void 0 ? void 0 : _a.destroy();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import { ChartContext, ChartType } from './interfaces';
|
|
3
|
+
import { ColumnChartStrategy, BarChartStrategy, LineChartStrategy, PieChartStrategy, DonutChartStrategy } from './components';
|
|
4
|
+
export class EzChart {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.STRATEGY_BY_CHART_TYPE = new Map();
|
|
7
|
+
this.type = ChartType.LINE;
|
|
8
|
+
this.xAxis = undefined;
|
|
9
|
+
this.yAxis = undefined;
|
|
10
|
+
this.chartTitle = "";
|
|
11
|
+
this.chartSubTitle = "";
|
|
12
|
+
this.legendEnabled = true;
|
|
13
|
+
this.series = undefined;
|
|
14
|
+
this.width = undefined;
|
|
15
|
+
this.height = undefined;
|
|
16
|
+
this.initializeStrategies();
|
|
17
|
+
}
|
|
18
|
+
initializeStrategies() {
|
|
19
|
+
this.STRATEGY_BY_CHART_TYPE.set(ChartType.COLUMN, new ColumnChartStrategy());
|
|
20
|
+
this.STRATEGY_BY_CHART_TYPE.set(ChartType.BAR, new BarChartStrategy());
|
|
21
|
+
this.STRATEGY_BY_CHART_TYPE.set(ChartType.LINE, new LineChartStrategy());
|
|
22
|
+
this.STRATEGY_BY_CHART_TYPE.set(ChartType.PIE, new PieChartStrategy());
|
|
23
|
+
this.STRATEGY_BY_CHART_TYPE.set(ChartType.DONUT, new DonutChartStrategy());
|
|
24
|
+
}
|
|
25
|
+
renderChart() {
|
|
26
|
+
this.chartContext.render(this._container, this.series, this.xAxis, this.yAxis, {
|
|
27
|
+
title: this.chartTitle,
|
|
28
|
+
subTitle: this.chartSubTitle,
|
|
29
|
+
legendEnabled: this.legendEnabled,
|
|
30
|
+
onClickSerie: this.ezSerieClick,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
componentWillLoad() {
|
|
34
|
+
this.setChartStrategy();
|
|
35
|
+
}
|
|
36
|
+
componentWillUpdate() {
|
|
37
|
+
this.renderChart();
|
|
38
|
+
}
|
|
39
|
+
componentDidLoad() {
|
|
40
|
+
this.renderChart();
|
|
41
|
+
}
|
|
42
|
+
disconnectedCallback() {
|
|
43
|
+
this.chartContext.destroy();
|
|
44
|
+
}
|
|
45
|
+
handleTypeChange() {
|
|
46
|
+
this.setChartStrategy();
|
|
47
|
+
}
|
|
48
|
+
setChartStrategy() {
|
|
49
|
+
const strategy = this.STRATEGY_BY_CHART_TYPE.get(this.type);
|
|
50
|
+
if (strategy) {
|
|
51
|
+
this.chartContext = new ChartContext(strategy);
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
this.chartContext = new ChartContext(new LineChartStrategy());
|
|
55
|
+
}
|
|
56
|
+
render() {
|
|
57
|
+
return (h("div", { ref: (el) => this._container = el }));
|
|
58
|
+
}
|
|
59
|
+
static get is() { return "ez-chart"; }
|
|
60
|
+
static get encapsulation() { return "shadow"; }
|
|
61
|
+
static get originalStyleUrls() {
|
|
62
|
+
return {
|
|
63
|
+
"$": ["ez-chart.css"]
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
static get styleUrls() {
|
|
67
|
+
return {
|
|
68
|
+
"$": ["ez-chart.css"]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
static get properties() {
|
|
72
|
+
return {
|
|
73
|
+
"type": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"mutable": false,
|
|
76
|
+
"complexType": {
|
|
77
|
+
"original": "ChartType",
|
|
78
|
+
"resolved": "ChartType.BAR | ChartType.COLUMN | ChartType.DONUT | ChartType.LINE | ChartType.PIE",
|
|
79
|
+
"references": {
|
|
80
|
+
"ChartType": {
|
|
81
|
+
"location": "import",
|
|
82
|
+
"path": "./interfaces"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"required": false,
|
|
87
|
+
"optional": false,
|
|
88
|
+
"docs": {
|
|
89
|
+
"tags": [],
|
|
90
|
+
"text": "Define o tipo de gr\u00E1fico apresentado pelo componente"
|
|
91
|
+
},
|
|
92
|
+
"attribute": "type",
|
|
93
|
+
"reflect": false,
|
|
94
|
+
"defaultValue": "ChartType.LINE"
|
|
95
|
+
},
|
|
96
|
+
"xAxis": {
|
|
97
|
+
"type": "unknown",
|
|
98
|
+
"mutable": false,
|
|
99
|
+
"complexType": {
|
|
100
|
+
"original": "ChartAxis | Array<ChartAxis>",
|
|
101
|
+
"resolved": "ChartAxis[] | ({ color?: string; categories?: string[]; formatter?: (value: string | number) => string; text?: string; invertedPosition?: boolean; })",
|
|
102
|
+
"references": {
|
|
103
|
+
"ChartAxis": {
|
|
104
|
+
"location": "import",
|
|
105
|
+
"path": "./interfaces"
|
|
106
|
+
},
|
|
107
|
+
"Array": {
|
|
108
|
+
"location": "global"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
"required": false,
|
|
113
|
+
"optional": false,
|
|
114
|
+
"docs": {
|
|
115
|
+
"tags": [],
|
|
116
|
+
"text": "Defini\u00E7\u00F5es do eixo X do gr\u00E1fico"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"yAxis": {
|
|
120
|
+
"type": "unknown",
|
|
121
|
+
"mutable": false,
|
|
122
|
+
"complexType": {
|
|
123
|
+
"original": "ChartAxis | Array<ChartAxis>",
|
|
124
|
+
"resolved": "ChartAxis[] | ({ color?: string; categories?: string[]; formatter?: (value: string | number) => string; text?: string; invertedPosition?: boolean; })",
|
|
125
|
+
"references": {
|
|
126
|
+
"ChartAxis": {
|
|
127
|
+
"location": "import",
|
|
128
|
+
"path": "./interfaces"
|
|
129
|
+
},
|
|
130
|
+
"Array": {
|
|
131
|
+
"location": "global"
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"required": false,
|
|
136
|
+
"optional": false,
|
|
137
|
+
"docs": {
|
|
138
|
+
"tags": [],
|
|
139
|
+
"text": "Defini\u00E7\u00F5es do eixo Y do gr\u00E1fico"
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
"chartTitle": {
|
|
143
|
+
"type": "string",
|
|
144
|
+
"mutable": false,
|
|
145
|
+
"complexType": {
|
|
146
|
+
"original": "string",
|
|
147
|
+
"resolved": "string",
|
|
148
|
+
"references": {}
|
|
149
|
+
},
|
|
150
|
+
"required": false,
|
|
151
|
+
"optional": false,
|
|
152
|
+
"docs": {
|
|
153
|
+
"tags": [],
|
|
154
|
+
"text": "Define o titulo a ser apresentado no gr\u00E1fico"
|
|
155
|
+
},
|
|
156
|
+
"attribute": "chart-title",
|
|
157
|
+
"reflect": false,
|
|
158
|
+
"defaultValue": "\"\""
|
|
159
|
+
},
|
|
160
|
+
"chartSubTitle": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"mutable": false,
|
|
163
|
+
"complexType": {
|
|
164
|
+
"original": "string",
|
|
165
|
+
"resolved": "string",
|
|
166
|
+
"references": {}
|
|
167
|
+
},
|
|
168
|
+
"required": false,
|
|
169
|
+
"optional": false,
|
|
170
|
+
"docs": {
|
|
171
|
+
"tags": [],
|
|
172
|
+
"text": "Define o sub titulo a ser apresentado no gr\u00E1fico"
|
|
173
|
+
},
|
|
174
|
+
"attribute": "chart-sub-title",
|
|
175
|
+
"reflect": false,
|
|
176
|
+
"defaultValue": "\"\""
|
|
177
|
+
},
|
|
178
|
+
"legendEnabled": {
|
|
179
|
+
"type": "boolean",
|
|
180
|
+
"mutable": false,
|
|
181
|
+
"complexType": {
|
|
182
|
+
"original": "boolean",
|
|
183
|
+
"resolved": "boolean",
|
|
184
|
+
"references": {}
|
|
185
|
+
},
|
|
186
|
+
"required": false,
|
|
187
|
+
"optional": false,
|
|
188
|
+
"docs": {
|
|
189
|
+
"tags": [],
|
|
190
|
+
"text": "Define se a legenda do gr\u00E1fico deve ser apresentada ou n\u00E3o."
|
|
191
|
+
},
|
|
192
|
+
"attribute": "legend-enabled",
|
|
193
|
+
"reflect": false,
|
|
194
|
+
"defaultValue": "true"
|
|
195
|
+
},
|
|
196
|
+
"series": {
|
|
197
|
+
"type": "unknown",
|
|
198
|
+
"mutable": false,
|
|
199
|
+
"complexType": {
|
|
200
|
+
"original": "ChartSerie | Array<ChartSerie>",
|
|
201
|
+
"resolved": "ChartSerie[] | ({ data: (number | ChartSerieData)[]; name?: string; color?: string; type?: \"line\" | \"column\" | \"bar\"; yAxis?: number; toolTipFormatter?: (serieName: string, xAxis: string | number, yAxis: number, dataName: string, percentage: number) => string; showDataLabel?: boolean; })",
|
|
202
|
+
"references": {
|
|
203
|
+
"ChartSerie": {
|
|
204
|
+
"location": "import",
|
|
205
|
+
"path": "./interfaces/ChartSerie"
|
|
206
|
+
},
|
|
207
|
+
"Array": {
|
|
208
|
+
"location": "global"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
"required": false,
|
|
213
|
+
"optional": false,
|
|
214
|
+
"docs": {
|
|
215
|
+
"tags": [],
|
|
216
|
+
"text": "Define as series a serem apresentadas no gr\u00E1fico"
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
"width": {
|
|
220
|
+
"type": "number",
|
|
221
|
+
"mutable": false,
|
|
222
|
+
"complexType": {
|
|
223
|
+
"original": "number",
|
|
224
|
+
"resolved": "number",
|
|
225
|
+
"references": {}
|
|
226
|
+
},
|
|
227
|
+
"required": false,
|
|
228
|
+
"optional": false,
|
|
229
|
+
"docs": {
|
|
230
|
+
"tags": [],
|
|
231
|
+
"text": "Define uma largura do gr\u00E1fico"
|
|
232
|
+
},
|
|
233
|
+
"attribute": "width",
|
|
234
|
+
"reflect": false
|
|
235
|
+
},
|
|
236
|
+
"height": {
|
|
237
|
+
"type": "number",
|
|
238
|
+
"mutable": false,
|
|
239
|
+
"complexType": {
|
|
240
|
+
"original": "number",
|
|
241
|
+
"resolved": "number",
|
|
242
|
+
"references": {}
|
|
243
|
+
},
|
|
244
|
+
"required": false,
|
|
245
|
+
"optional": false,
|
|
246
|
+
"docs": {
|
|
247
|
+
"tags": [],
|
|
248
|
+
"text": "Define a altura do gr\u00E1fico"
|
|
249
|
+
},
|
|
250
|
+
"attribute": "height",
|
|
251
|
+
"reflect": false
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
static get events() {
|
|
256
|
+
return [{
|
|
257
|
+
"method": "ezSerieClick",
|
|
258
|
+
"name": "ezSerieClick",
|
|
259
|
+
"bubbles": true,
|
|
260
|
+
"cancelable": true,
|
|
261
|
+
"composed": true,
|
|
262
|
+
"docs": {
|
|
263
|
+
"tags": [],
|
|
264
|
+
"text": "Evento emitido quando ocorre um click em uma serie do gr\u00E1fico"
|
|
265
|
+
},
|
|
266
|
+
"complexType": {
|
|
267
|
+
"original": "SerieClickEvent",
|
|
268
|
+
"resolved": "{ name: string; data: number[]; type: string; yAxis: number; }",
|
|
269
|
+
"references": {
|
|
270
|
+
"SerieClickEvent": {
|
|
271
|
+
"location": "import",
|
|
272
|
+
"path": "./interfaces/ChartSerie"
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
}];
|
|
277
|
+
}
|
|
278
|
+
static get watchers() {
|
|
279
|
+
return [{
|
|
280
|
+
"propName": "type",
|
|
281
|
+
"methodName": "handleTypeChange"
|
|
282
|
+
}];
|
|
283
|
+
}
|
|
284
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export class ChartContext {
|
|
2
|
+
constructor(strategy) {
|
|
3
|
+
this.strategy = strategy;
|
|
4
|
+
}
|
|
5
|
+
setStrategy(strategy) {
|
|
6
|
+
this.strategy = strategy;
|
|
7
|
+
}
|
|
8
|
+
render(container, series, xAxis, yAxis, options) {
|
|
9
|
+
return this.strategy.render(container, series, xAxis, yAxis, options);
|
|
10
|
+
}
|
|
11
|
+
destroy() {
|
|
12
|
+
return this.strategy.destroy();
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
export const mockChartProp = {
|
|
2
|
+
chartTitle: "Titulo do gráfico",
|
|
3
|
+
chartSubTitle: "Sub-titulo do gráfico",
|
|
4
|
+
series: [{
|
|
5
|
+
name: 'Qtd. Vendas',
|
|
6
|
+
data: [23, 20, 22, 26, 24, 28],
|
|
7
|
+
yAxis: 1,
|
|
8
|
+
showDataLabel: true,
|
|
9
|
+
}, {
|
|
10
|
+
name: 'Vlr. Vendas',
|
|
11
|
+
data: [25600, 21600, 24500, 26890, 20560, 22508],
|
|
12
|
+
yAxis: 0,
|
|
13
|
+
toolTipFormatter: jest.fn(),
|
|
14
|
+
}],
|
|
15
|
+
yAxis: [{
|
|
16
|
+
text: 'Valor das vendas no semestre',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
text: 'Quantidade de itens vendidos',
|
|
20
|
+
invertedPosition: true,
|
|
21
|
+
}],
|
|
22
|
+
xAxis: {
|
|
23
|
+
text: 'Defina uma descrição para o eixo',
|
|
24
|
+
formatter: jest.fn(),
|
|
25
|
+
color: '#008561',
|
|
26
|
+
categories: ['Jan', 'Feb', 'Mar', 'Abr', 'Mai', 'Jun']
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const expectChart = {
|
|
31
|
+
title: { text: "Titulo do gráfico" },
|
|
32
|
+
subtitle: { text: "Sub-titulo do gráfico" },
|
|
33
|
+
tooltip: { formatter: function () { return jest.fn(); } },
|
|
34
|
+
yAxis: [
|
|
35
|
+
{
|
|
36
|
+
title: { text: "Valor das vendas no semestre" }
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
title: { text: "Quantidade de itens vendidos" },
|
|
40
|
+
opposite: true,
|
|
41
|
+
},
|
|
42
|
+
],
|
|
43
|
+
xAxis: {
|
|
44
|
+
categories: ["Jan", "Feb", "Mar", "Abr", "Mai", "Jun"],
|
|
45
|
+
title: {
|
|
46
|
+
text: "Defina uma descrição para o eixo",
|
|
47
|
+
style: { color: "#008561" }
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
series: [{
|
|
51
|
+
name: "Qtd. Vendas",
|
|
52
|
+
data: [23, 20, 22, 26, 24, 28],
|
|
53
|
+
dataLabels: { enabled: true },
|
|
54
|
+
yAxis: 1,
|
|
55
|
+
}, {
|
|
56
|
+
name: "Vlr. Vendas",
|
|
57
|
+
data: [25600, 21600, 24500, 26890, 20560, 22508],
|
|
58
|
+
yAxis: 0,
|
|
59
|
+
}],
|
|
60
|
+
rules: [
|
|
61
|
+
{
|
|
62
|
+
condition: { maxWidth: 500 },
|
|
63
|
+
chartOptions: {
|
|
64
|
+
legend: { enabled: false },
|
|
65
|
+
xAxis: {
|
|
66
|
+
labels: { enabled: false },
|
|
67
|
+
gridLineWidth: 0,
|
|
68
|
+
},
|
|
69
|
+
yAxis: {
|
|
70
|
+
labels: { enabled: false },
|
|
71
|
+
gridLineWidth: 0,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
condition: { maxWidth: 600 },
|
|
77
|
+
chartOptions: {
|
|
78
|
+
xAxis: {
|
|
79
|
+
labels: {
|
|
80
|
+
style: { fontSize: "10px" },
|
|
81
|
+
},
|
|
82
|
+
},
|
|
83
|
+
yAxis: {
|
|
84
|
+
labels: {
|
|
85
|
+
style: { fontSize: "10px" },
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
title: {
|
|
89
|
+
style: { fontSize: "14px" },
|
|
90
|
+
},
|
|
91
|
+
subtitle: {
|
|
92
|
+
style: { fontSize: "12px" },
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
condition: { maxWidth: 400 },
|
|
98
|
+
chartOptions: {
|
|
99
|
+
chart: { margin: [10, 10, 15, 10] },
|
|
100
|
+
subtitle: { text: null },
|
|
101
|
+
title: { text: null },
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
],
|
|
105
|
+
credits: { enabled: false },
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
export const mockChartPieProp = {
|
|
110
|
+
chartTitle: "Titulo do gráfico",
|
|
111
|
+
chartSubTitle: "Sub-titulo do gráfico",
|
|
112
|
+
series: {
|
|
113
|
+
name: 'venda',
|
|
114
|
+
data: [
|
|
115
|
+
{ name: 'Chrome', y: 74.03 },
|
|
116
|
+
{ name: 'Edge', y: 12.66 },
|
|
117
|
+
{ name: 'Firefox', y: 4 },
|
|
118
|
+
{ name: 'Internet Explorer', y: 2 },
|
|
119
|
+
{ name: 'Other', y: 3 }
|
|
120
|
+
],
|
|
121
|
+
showDataLabel: true,
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export const expectPieChart = {
|
|
126
|
+
series: [{
|
|
127
|
+
name: "venda",
|
|
128
|
+
data: [
|
|
129
|
+
{ name: 'Chrome', y: 74.03 },
|
|
130
|
+
{ name: 'Edge', y: 12.66 },
|
|
131
|
+
{ name: 'Firefox', y: 4 },
|
|
132
|
+
{ name: 'Internet Explorer', y: 2 },
|
|
133
|
+
{ name: 'Other', y: 3 }
|
|
134
|
+
],
|
|
135
|
+
dataLabels: { enabled: true },
|
|
136
|
+
}],
|
|
137
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
export class BaseHighChartsRender {
|
|
2
|
+
parseSerie(series) {
|
|
3
|
+
if (Array.isArray(series)) {
|
|
4
|
+
const seriesOptions = series.map(serie => this.chartSerieToSeriesOptions(serie));
|
|
5
|
+
return seriesOptions;
|
|
6
|
+
}
|
|
7
|
+
const seriesOptions = this.chartSerieToSeriesOptions(series);
|
|
8
|
+
return [seriesOptions];
|
|
9
|
+
}
|
|
10
|
+
parseAxis(axis) {
|
|
11
|
+
if (Array.isArray(axis)) {
|
|
12
|
+
const axisOptions = axis.map(value => this.chartAxisToAxisOptions(value));
|
|
13
|
+
return axisOptions;
|
|
14
|
+
}
|
|
15
|
+
const axisOptions = this.chartAxisToAxisOptions(axis);
|
|
16
|
+
return axisOptions;
|
|
17
|
+
}
|
|
18
|
+
parseTitle(title) {
|
|
19
|
+
return {
|
|
20
|
+
text: title,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
parseSubTitle(subTtile) {
|
|
24
|
+
return {
|
|
25
|
+
text: subTtile,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
buildFormatterTooltip(series) {
|
|
29
|
+
const seriesArray = Array.isArray(series) ? series : [series];
|
|
30
|
+
return {
|
|
31
|
+
formatter: function (tooltip) {
|
|
32
|
+
const indexSerie = seriesArray.findIndex(serie => serie.name === this.series.name && serie.toolTipFormatter);
|
|
33
|
+
if (indexSerie !== -1) {
|
|
34
|
+
return seriesArray[indexSerie].toolTipFormatter(this.series.name, this.x, this.y, this.point.name, this.point.percentage);
|
|
35
|
+
}
|
|
36
|
+
return tooltip.defaultFormatter.call(this, tooltip);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
buildOnClickCallBack(evt) {
|
|
41
|
+
return function (_e) {
|
|
42
|
+
evt.emit({
|
|
43
|
+
name: this.series.name,
|
|
44
|
+
data: this.series.data,
|
|
45
|
+
type: this.series.type,
|
|
46
|
+
yAxis: this.x,
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
buildResposiveConfig() {
|
|
51
|
+
return {
|
|
52
|
+
rules: [
|
|
53
|
+
{
|
|
54
|
+
condition: {
|
|
55
|
+
maxWidth: 500
|
|
56
|
+
},
|
|
57
|
+
chartOptions: {
|
|
58
|
+
legend: {
|
|
59
|
+
enabled: false
|
|
60
|
+
},
|
|
61
|
+
xAxis: {
|
|
62
|
+
labels: {
|
|
63
|
+
enabled: false
|
|
64
|
+
},
|
|
65
|
+
gridLineWidth: 0
|
|
66
|
+
},
|
|
67
|
+
yAxis: {
|
|
68
|
+
labels: {
|
|
69
|
+
enabled: false
|
|
70
|
+
},
|
|
71
|
+
gridLineWidth: 0
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
condition: {
|
|
77
|
+
maxWidth: 600
|
|
78
|
+
},
|
|
79
|
+
chartOptions: {
|
|
80
|
+
xAxis: {
|
|
81
|
+
labels: {
|
|
82
|
+
style: {
|
|
83
|
+
fontSize: '10px'
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
yAxis: {
|
|
88
|
+
labels: {
|
|
89
|
+
style: {
|
|
90
|
+
fontSize: '10px'
|
|
91
|
+
},
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
title: {
|
|
95
|
+
style: {
|
|
96
|
+
fontSize: '14px'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
subtitle: {
|
|
100
|
+
style: {
|
|
101
|
+
fontSize: '12px'
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
condition: {
|
|
108
|
+
maxWidth: 400
|
|
109
|
+
},
|
|
110
|
+
chartOptions: {
|
|
111
|
+
chart: {
|
|
112
|
+
margin: [10, 10, 15, 10],
|
|
113
|
+
},
|
|
114
|
+
subtitle: {
|
|
115
|
+
text: null
|
|
116
|
+
},
|
|
117
|
+
title: {
|
|
118
|
+
text: null
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
]
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
buildDefaultChartOptions() {
|
|
126
|
+
return {
|
|
127
|
+
credits: {
|
|
128
|
+
enabled: false
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
chartSerieToSeriesOptions(serie) {
|
|
133
|
+
const { name, data, color, showDataLabel, type, yAxis } = serie;
|
|
134
|
+
return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (name && { name })), (type && { type })), (data && { data })), (color && { color })), (showDataLabel && { dataLabels: { enabled: showDataLabel } })), (yAxis !== undefined && { yAxis }));
|
|
135
|
+
}
|
|
136
|
+
chartAxisToAxisOptions(axis) {
|
|
137
|
+
const { categories, color, text, invertedPosition, formatter } = axis;
|
|
138
|
+
return Object.assign(Object.assign(Object.assign(Object.assign({}, (categories && { categories })), (text && {
|
|
139
|
+
title: Object.assign({ text }, (color && { style: { color } }))
|
|
140
|
+
})), (formatter && {
|
|
141
|
+
labels: {
|
|
142
|
+
formatter: function () { return formatter(this.value); },
|
|
143
|
+
}
|
|
144
|
+
})), (invertedPosition && { opposite: invertedPosition }));
|
|
145
|
+
}
|
|
146
|
+
}
|