q2-tecton-elements 1.23.0-alpha.0 → 1.24.0
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/action-sheet-4b366e9a.js +84 -0
- package/dist/cjs/charting-d02cba1f.js +3127 -0
- package/dist/cjs/{index-3518c78c.js → index-e00b4210.js} +33 -7
- package/dist/cjs/{installCanvasRenderer-b4d10c92.js → installCanvasRenderer-6c4fbcc9.js} +230 -1130
- package/dist/cjs/installLabelLayout-d6b548fe.js +1048 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/q2-action-sheet.cjs.entry.js +218 -0
- package/dist/cjs/q2-badge_2.cjs.entry.js +1 -1
- package/dist/cjs/q2-btn_2.cjs.entry.js +2 -2
- package/dist/cjs/q2-calendar.cjs.entry.js +1 -1
- package/dist/cjs/q2-card.cjs.entry.js +2 -2
- package/dist/cjs/q2-carousel-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-carousel.cjs.entry.js +1 -1
- package/dist/cjs/q2-chart-area.cjs.entry.js +4569 -0
- package/dist/cjs/q2-chart-bar.cjs.entry.js +25 -3133
- package/dist/cjs/q2-chart-donut.cjs.entry.js +9 -8
- package/dist/cjs/q2-checkbox-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-checkbox.cjs.entry.js +2 -2
- package/dist/cjs/q2-dropdown-item.cjs.entry.js +1 -1
- package/dist/cjs/q2-dropdown.cjs.entry.js +1 -1
- package/dist/cjs/q2-editable-field.cjs.entry.js +1 -1
- package/dist/cjs/q2-icon.cjs.entry.js +1 -1
- package/dist/cjs/q2-loading-element.cjs.entry.js +1 -1
- package/dist/cjs/q2-loc.cjs.entry.js +1 -1
- package/dist/cjs/q2-message.cjs.entry.js +1 -1
- package/dist/cjs/q2-month-picker.cjs.entry.js +1 -1
- package/dist/cjs/q2-optgroup_2.cjs.entry.js +93 -0
- package/dist/cjs/q2-option-list_2.cjs.entry.js +230 -88
- package/dist/cjs/q2-pagination.cjs.entry.js +1 -1
- package/dist/cjs/q2-pill.cjs.entry.js +57 -18
- package/dist/cjs/q2-radio-group.cjs.entry.js +1 -1
- package/dist/cjs/q2-radio.cjs.entry.js +1 -1
- package/dist/cjs/q2-section.cjs.entry.js +1 -1
- package/dist/cjs/q2-select.cjs.entry.js +149 -409
- package/dist/cjs/q2-stepper-pane.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper-vertical.cjs.entry.js +1 -1
- package/dist/cjs/q2-stepper.cjs.entry.js +1 -1
- package/dist/cjs/q2-tab-container.cjs.entry.js +1 -1
- package/dist/cjs/q2-tag.cjs.entry.js +21 -6
- package/dist/cjs/q2-tecton-elements.cjs.js +1 -1
- package/dist/cjs/q2-textarea.cjs.entry.js +1 -1
- package/dist/collection/collection-manifest.json +2 -0
- package/dist/collection/components/q2-action-sheet/index.js +345 -0
- package/dist/collection/components/q2-action-sheet/styles.css +215 -0
- package/dist/collection/components/q2-card/index.js +1 -1
- package/dist/collection/components/q2-chart-area/index.js +622 -0
- package/dist/collection/components/q2-chart-area/styles.css +82 -0
- package/dist/collection/components/q2-chart-bar/index.js +4 -4
- package/dist/collection/components/q2-chart-bar/styles.css +3 -6
- package/dist/collection/components/q2-chart-donut/index.js +1 -1
- package/dist/collection/components/q2-checkbox/index.js +2 -2
- package/dist/collection/components/q2-checkbox/styles.css +1 -0
- package/dist/collection/components/q2-dropdown/index.js +1 -1
- package/dist/collection/components/q2-loading/index.js +1 -1
- package/dist/collection/components/q2-loading/skeleton/q2-loading-element/styles.css +4 -0
- package/dist/collection/components/q2-loading/styles.css +4 -0
- package/dist/collection/components/q2-optgroup/styles.css +2 -2
- package/dist/collection/components/q2-option/index.js +1 -56
- package/dist/collection/components/q2-option/styles.css +7 -0
- package/dist/collection/components/q2-option-list/index.js +290 -102
- package/dist/collection/components/q2-pill/index.js +79 -18
- package/dist/collection/components/q2-pill/styles.css +1 -2
- package/dist/collection/components/q2-popover/index.js +21 -5
- package/dist/collection/components/q2-popover/styles.css +10 -67
- package/dist/collection/components/q2-radio/index.js +2 -2
- package/dist/collection/components/q2-select/index.js +197 -427
- package/dist/collection/components/q2-select/styles.css +5 -11
- package/dist/collection/components/q2-tag/index.js +38 -5
- package/dist/collection/utils/action-sheet.js +79 -0
- package/dist/collection/utils/index.js +31 -7
- package/dist/components/action-sheet.js +81 -0
- package/dist/components/charting.js +3113 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +2 -0
- package/dist/components/index10.js +1 -1
- package/dist/components/index11.js +42 -353
- package/dist/components/index12.js +44 -97
- package/dist/components/index13.js +495 -580
- package/dist/components/index14.js +137 -0
- package/dist/components/index15.js +626 -0
- package/dist/components/index5.js +1 -1
- package/dist/components/index6.js +1 -1
- package/dist/components/index7.js +1 -1
- package/dist/components/index8.js +1 -1
- package/dist/components/index9.js +3 -3
- package/dist/components/installCanvasRenderer.js +188 -1123
- package/dist/components/installLabelLayout.js +1042 -0
- package/dist/components/q2-action-sheet.d.ts +11 -0
- package/dist/components/q2-action-sheet.js +282 -0
- package/dist/components/q2-calendar.js +1 -1
- package/dist/components/q2-card.js +2 -2
- package/dist/components/q2-carousel-pane.js +1 -1
- package/dist/components/q2-carousel.js +1 -1
- package/dist/components/q2-chart-area.d.ts +11 -0
- package/dist/components/q2-chart-area.js +4604 -0
- package/dist/components/q2-chart-bar.js +11 -3119
- package/dist/components/q2-chart-donut.js +4 -3
- package/dist/components/q2-checkbox-group.js +1 -1
- package/dist/components/q2-checkbox.js +2 -2
- package/dist/components/q2-dropdown.js +2 -2
- package/dist/components/q2-editable-field.js +1 -1
- package/dist/components/q2-loading-element.js +1 -1
- package/dist/components/q2-loc.js +1 -1
- package/dist/components/q2-month-picker.js +1 -1
- package/dist/components/q2-optgroup.js +1 -70
- package/dist/components/q2-option-list.js +1 -1
- package/dist/components/q2-option.js +1 -76
- package/dist/components/q2-pagination.js +1 -1
- package/dist/components/q2-pill.js +62 -21
- package/dist/components/q2-popover.js +1 -1
- package/dist/components/q2-radio-group.js +1 -1
- package/dist/components/q2-radio.js +3 -3
- package/dist/components/q2-section.js +1 -1
- package/dist/components/q2-select.js +181 -427
- package/dist/components/q2-stepper-pane.js +1 -1
- package/dist/components/q2-stepper-vertical.js +1 -1
- package/dist/components/q2-stepper.js +1 -1
- package/dist/components/q2-tab-container.js +1 -1
- package/dist/components/q2-tag.js +24 -8
- package/dist/components/q2-textarea.js +1 -1
- package/dist/esm/action-sheet-a9597b32.js +81 -0
- package/dist/esm/charting-2a73ba8e.js +3113 -0
- package/dist/esm/{index-9c591682.js → index-ca21e539.js} +32 -8
- package/dist/esm/{installCanvasRenderer-0143b52d.js → installCanvasRenderer-4a470516.js} +188 -1123
- package/dist/esm/installLabelLayout-d660eaad.js +1042 -0
- package/dist/esm/loader.js +1 -1
- package/dist/esm/q2-action-sheet.entry.js +214 -0
- package/dist/esm/q2-badge_2.entry.js +1 -1
- package/dist/esm/q2-btn_2.entry.js +2 -2
- package/dist/esm/q2-calendar.entry.js +1 -1
- package/dist/esm/q2-card.entry.js +2 -2
- package/dist/esm/q2-carousel-pane.entry.js +1 -1
- package/dist/esm/q2-carousel.entry.js +1 -1
- package/dist/esm/q2-chart-area.entry.js +4565 -0
- package/dist/esm/q2-chart-bar.entry.js +11 -3119
- package/dist/esm/q2-chart-donut.entry.js +4 -3
- package/dist/esm/q2-checkbox-group.entry.js +1 -1
- package/dist/esm/q2-checkbox.entry.js +2 -2
- package/dist/esm/q2-dropdown-item.entry.js +1 -1
- package/dist/esm/q2-dropdown.entry.js +1 -1
- package/dist/esm/q2-editable-field.entry.js +1 -1
- package/dist/esm/q2-icon.entry.js +1 -1
- package/dist/esm/q2-loading-element.entry.js +1 -1
- package/dist/esm/q2-loc.entry.js +1 -1
- package/dist/esm/q2-message.entry.js +1 -1
- package/dist/esm/q2-month-picker.entry.js +1 -1
- package/dist/esm/q2-optgroup_2.entry.js +88 -0
- package/dist/esm/q2-option-list_2.entry.js +230 -88
- package/dist/esm/q2-pagination.entry.js +1 -1
- package/dist/esm/q2-pill.entry.js +57 -18
- package/dist/esm/q2-radio-group.entry.js +1 -1
- package/dist/esm/q2-radio.entry.js +1 -1
- package/dist/esm/q2-section.entry.js +1 -1
- package/dist/esm/q2-select.entry.js +149 -409
- package/dist/esm/q2-stepper-pane.entry.js +1 -1
- package/dist/esm/q2-stepper-vertical.entry.js +1 -1
- package/dist/esm/q2-stepper.entry.js +1 -1
- package/dist/esm/q2-tab-container.entry.js +1 -1
- package/dist/esm/q2-tag.entry.js +21 -6
- package/dist/esm/q2-tecton-elements.js +1 -1
- package/dist/esm/q2-textarea.entry.js +1 -1
- package/dist/q2-tecton-elements/{p-db873db2.entry.js → p-0473f4f7.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-520c40f6.entry.js → p-13a1390b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9ebb283a.entry.js → p-13deb3ed.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-0ba564b1.entry.js → p-1d854203.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-1f71774f.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-18cc4758.entry.js → p-256d3fe6.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-9281adaa.entry.js → p-282f0f8c.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-2d2c5af2.entry.js → p-30969629.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-30cd888b.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-fc134a5d.entry.js → p-37cf9c97.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-fb37e67e.entry.js → p-388349b5.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-458b1987.js +1 -0
- package/dist/q2-tecton-elements/p-52063431.js +39 -0
- package/dist/q2-tecton-elements/p-5589ae0f.entry.js +1 -0
- package/dist/q2-tecton-elements/p-619aed74.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-4625184b.entry.js → p-63b67260.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-e4dc9ac0.entry.js → p-63e363ad.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-cbd1289a.entry.js → p-6736df05.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-72fe10cc.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-c4640b55.entry.js → p-75b817c6.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-c3f27fe2.entry.js → p-7a116095.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-7c94119b.entry.js +1 -0
- package/dist/q2-tecton-elements/p-833398d1.js +1 -0
- package/dist/q2-tecton-elements/{p-ce015552.entry.js → p-90572e43.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-91153c61.entry.js +1 -0
- package/dist/q2-tecton-elements/p-9792de8a.entry.js +1 -0
- package/dist/q2-tecton-elements/p-9acfa94e.js +1 -0
- package/dist/q2-tecton-elements/p-a1926e65.js +1 -0
- package/dist/q2-tecton-elements/{p-ffb48ccc.entry.js → p-b3a8cdc5.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-ce3f203c.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-041b3a82.entry.js → p-ce91cd9b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-b8b00394.entry.js → p-cefc9d0b.entry.js} +1 -1
- package/dist/q2-tecton-elements/p-d05beeb7.entry.js +1 -0
- package/dist/q2-tecton-elements/p-dc7c8371.entry.js +1 -0
- package/dist/q2-tecton-elements/{p-16c11d74.entry.js → p-e58581fc.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-f800fd1e.entry.js → p-e886c55b.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-6e6b5b80.entry.js → p-f0ec4d2c.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-97aa8423.entry.js → p-f94e7043.entry.js} +1 -1
- package/dist/q2-tecton-elements/{p-c444a60b.entry.js → p-fcb7d191.entry.js} +1 -1
- package/dist/q2-tecton-elements/q2-tecton-elements.esm.js +1 -1
- package/dist/test/helpers.js +3 -2
- package/dist/types/components/q2-action-sheet/index.d.ts +52 -0
- package/dist/types/components/q2-card/index.d.ts +1 -1
- package/dist/types/components/q2-chart-area/index.d.ts +40 -0
- package/dist/types/components/q2-chart-bar/index.d.ts +2 -2
- package/dist/types/components/q2-chart-donut/index.d.ts +1 -1
- package/dist/types/components/q2-checkbox/index.d.ts +4 -1
- package/dist/types/components/q2-option/index.d.ts +0 -3
- package/dist/types/components/q2-option-list/index.d.ts +16 -8
- package/dist/types/components/q2-pill/index.d.ts +10 -1
- package/dist/types/components/q2-popover/index.d.ts +2 -0
- package/dist/types/components/q2-select/index.d.ts +46 -47
- package/dist/types/components/q2-tag/index.d.ts +3 -2
- package/dist/types/components.d.ts +100 -13
- package/dist/types/global.d.ts +10 -1
- package/dist/types/utils/action-sheet.d.ts +12 -0
- package/dist/types/utils/index.d.ts +3 -1
- package/dist/types/workspace/workspace/{_production_release_1.22.x-alpha → Tecton_tecton-production_master}/packages/q2-tecton-elements/.stencil/test/helpers.d.ts +1 -1
- package/package.json +3 -2
- package/dist/cjs/q2-optgroup.cjs.entry.js +0 -56
- package/dist/cjs/q2-option.cjs.entry.js +0 -46
- package/dist/esm/q2-optgroup.entry.js +0 -52
- package/dist/esm/q2-option.entry.js +0 -42
- package/dist/q2-tecton-elements/p-0d8dd75a.entry.js +0 -1
- package/dist/q2-tecton-elements/p-0fad9c5a.entry.js +0 -1
- package/dist/q2-tecton-elements/p-1f85cced.js +0 -39
- package/dist/q2-tecton-elements/p-2c9b1308.entry.js +0 -1
- package/dist/q2-tecton-elements/p-5e374fbd.js +0 -1
- package/dist/q2-tecton-elements/p-6b52a262.entry.js +0 -1
- package/dist/q2-tecton-elements/p-aaf42539.entry.js +0 -1
- package/dist/q2-tecton-elements/p-cf41970f.entry.js +0 -1
- package/dist/q2-tecton-elements/p-de164483.entry.js +0 -1
- package/dist/q2-tecton-elements/p-e6d26f39.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f1d06917.entry.js +0 -1
- package/dist/q2-tecton-elements/p-f35bf6a3.entry.js +0 -1
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
import { h } from '@stencil/core';
|
|
2
|
+
import * as echarts from 'echarts/core';
|
|
3
|
+
import { TitleComponent, AriaComponent, GridComponent, } from 'echarts/components';
|
|
4
|
+
import { LineChart } from 'echarts/charts';
|
|
5
|
+
import { UniversalTransition } from 'echarts/features';
|
|
6
|
+
import { CanvasRenderer } from 'echarts/renderers';
|
|
7
|
+
import { loc, overrideFocus } from 'src/utils';
|
|
8
|
+
import { getCSSProperty, isValidColor, formatValue } from 'src/utils/charting';
|
|
9
|
+
echarts.use([AriaComponent, LineChart, CanvasRenderer, UniversalTransition, GridComponent, TitleComponent]);
|
|
10
|
+
export class Q2ChartArea {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.data = [];
|
|
13
|
+
this.alignChartName = undefined;
|
|
14
|
+
this.chartName = undefined;
|
|
15
|
+
this.lineColor = undefined;
|
|
16
|
+
this.pointerLineColor = undefined;
|
|
17
|
+
this.pointerLineStyle = undefined;
|
|
18
|
+
this.areaColor = undefined;
|
|
19
|
+
this.dataNamesOverflow = undefined;
|
|
20
|
+
this.dataNamesWidth = undefined;
|
|
21
|
+
this.format = undefined;
|
|
22
|
+
this.formatModifier = undefined;
|
|
23
|
+
this.hideNameAxisLabels = false;
|
|
24
|
+
this.hideValueAxisLabels = false;
|
|
25
|
+
this.offsetDataNames = false;
|
|
26
|
+
this.offsetDataValues = false;
|
|
27
|
+
this.showChartName = false;
|
|
28
|
+
this.showDatapointLabels = false;
|
|
29
|
+
this.showGradient = false;
|
|
30
|
+
this.gridLines = undefined;
|
|
31
|
+
}
|
|
32
|
+
componentDidLoad() {
|
|
33
|
+
const chart = echarts.init(this.chartContainer);
|
|
34
|
+
this.chart = chart;
|
|
35
|
+
this.resizeEventListener = () => this.resizeChart();
|
|
36
|
+
window.addEventListener('resize', this.resizeEventListener);
|
|
37
|
+
this.cacheComputedStyles();
|
|
38
|
+
this.updateChart(chart);
|
|
39
|
+
overrideFocus(this.hostElement);
|
|
40
|
+
}
|
|
41
|
+
disconnectedCallback() {
|
|
42
|
+
window.removeEventListener('resize', this.resizeEventListener);
|
|
43
|
+
}
|
|
44
|
+
cacheComputedStyles() {
|
|
45
|
+
this.chartContainerStyles = getComputedStyle(this.chartContainer);
|
|
46
|
+
this.hostElementStyles = getComputedStyle(this.hostElement);
|
|
47
|
+
}
|
|
48
|
+
getAreaFill() {
|
|
49
|
+
if (this.showGradient) {
|
|
50
|
+
return {
|
|
51
|
+
type: 'linear',
|
|
52
|
+
x: 0,
|
|
53
|
+
y: 0,
|
|
54
|
+
x2: 0,
|
|
55
|
+
y2: 1,
|
|
56
|
+
colorStops: [
|
|
57
|
+
{
|
|
58
|
+
offset: 0,
|
|
59
|
+
color: this.getColor(this.areaColor),
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
offset: 1,
|
|
63
|
+
color: 'white',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
global: false,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
return this.getColor(this.areaColor);
|
|
70
|
+
}
|
|
71
|
+
getColor(color) {
|
|
72
|
+
const primaryColor = getCSSProperty('var(--t-primary)', this.chartContainerStyles, this.hostElementStyles);
|
|
73
|
+
const cssColorProp = getCSSProperty(color, this.chartContainerStyles, this.hostElementStyles);
|
|
74
|
+
if (cssColorProp)
|
|
75
|
+
return cssColorProp;
|
|
76
|
+
if (isValidColor(color))
|
|
77
|
+
return color;
|
|
78
|
+
return primaryColor;
|
|
79
|
+
}
|
|
80
|
+
updateChart(chart) {
|
|
81
|
+
var _a;
|
|
82
|
+
const decimals = ((_a = this.formatModifier) === null || _a === void 0 ? void 0 : _a.includes('dec')) ? this.formatModifier.replace('dec', '') : 0;
|
|
83
|
+
const valueAxis = {
|
|
84
|
+
type: 'value',
|
|
85
|
+
axisLabel: {
|
|
86
|
+
formatter: (value) => formatValue(value, {
|
|
87
|
+
type: this.format,
|
|
88
|
+
decimals,
|
|
89
|
+
}),
|
|
90
|
+
rotate: this.offsetDataValues ? 45 : 0,
|
|
91
|
+
margin: this.offsetDataValues ? 15 : 8,
|
|
92
|
+
show: !this.hideValueAxisLabels,
|
|
93
|
+
},
|
|
94
|
+
splitLine: {
|
|
95
|
+
show: this.gridLines === 'horizontal' || !this.gridLines,
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
const categoryAxis = {
|
|
99
|
+
type: 'category',
|
|
100
|
+
boundaryGap: false,
|
|
101
|
+
data: this.data.map(datum => loc(datum.name) || ''),
|
|
102
|
+
axisLabel: {
|
|
103
|
+
rotate: this.offsetDataNames ? 45 : 0,
|
|
104
|
+
margin: this.offsetDataNames ? 15 : 8,
|
|
105
|
+
width: this.dataNamesWidth || 50,
|
|
106
|
+
overflow: this.dataNamesOverflow || 'none',
|
|
107
|
+
truncate: 'ellipsis',
|
|
108
|
+
show: !this.hideNameAxisLabels,
|
|
109
|
+
},
|
|
110
|
+
axisLine: {
|
|
111
|
+
show: !this.hideNameAxisLabels,
|
|
112
|
+
},
|
|
113
|
+
axisTick: {
|
|
114
|
+
show: !this.hideNameAxisLabels,
|
|
115
|
+
},
|
|
116
|
+
axisPointer: {
|
|
117
|
+
show: true,
|
|
118
|
+
type: 'line',
|
|
119
|
+
label: {
|
|
120
|
+
show: false,
|
|
121
|
+
formatter: (params) => {
|
|
122
|
+
const dataIndex = params.seriesData[0].dataIndex;
|
|
123
|
+
this.change.emit({
|
|
124
|
+
index: dataIndex,
|
|
125
|
+
data: this.data[dataIndex],
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
lineStyle: {
|
|
130
|
+
color: this.getColor(this.pointerLineColor || 'var(--t-gray-10)'),
|
|
131
|
+
type: this.pointerLineStyle || 'solid',
|
|
132
|
+
width: 1.5,
|
|
133
|
+
},
|
|
134
|
+
z: 1,
|
|
135
|
+
},
|
|
136
|
+
splitLine: {
|
|
137
|
+
show: this.gridLines === 'vertical',
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
return chart.setOption({
|
|
141
|
+
aria: {
|
|
142
|
+
enabled: true,
|
|
143
|
+
},
|
|
144
|
+
title: {
|
|
145
|
+
text: this.chartName,
|
|
146
|
+
show: this.showChartName,
|
|
147
|
+
left: this.alignChartName,
|
|
148
|
+
},
|
|
149
|
+
grid: {
|
|
150
|
+
containLabel: true,
|
|
151
|
+
},
|
|
152
|
+
xAxis: categoryAxis,
|
|
153
|
+
yAxis: valueAxis,
|
|
154
|
+
series: [
|
|
155
|
+
{
|
|
156
|
+
data: this.data.map(datum => datum.value || 0),
|
|
157
|
+
id: 'area',
|
|
158
|
+
type: 'line',
|
|
159
|
+
lineStyle: {
|
|
160
|
+
color: this.getColor(this.lineColor),
|
|
161
|
+
},
|
|
162
|
+
itemStyle: {
|
|
163
|
+
color: this.getColor(this.lineColor),
|
|
164
|
+
},
|
|
165
|
+
areaStyle: {
|
|
166
|
+
color: this.getAreaFill(),
|
|
167
|
+
},
|
|
168
|
+
symbolSize: 10,
|
|
169
|
+
showSymbol: false,
|
|
170
|
+
label: {
|
|
171
|
+
show: this.showDatapointLabels,
|
|
172
|
+
position: 'right',
|
|
173
|
+
formatter: (params) => {
|
|
174
|
+
return formatValue(params.value, {
|
|
175
|
+
type: this.format,
|
|
176
|
+
decimals,
|
|
177
|
+
});
|
|
178
|
+
},
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
],
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
resizeChart() {
|
|
185
|
+
this.chart.resize();
|
|
186
|
+
}
|
|
187
|
+
propsUpdates() {
|
|
188
|
+
this.updateChart(this.chart);
|
|
189
|
+
}
|
|
190
|
+
render() {
|
|
191
|
+
return (h("div", { class: "container" }, h("div", { ref: el => (this.chartContainer = el), class: "chart-container", "test-id": "areaChartContainer" })));
|
|
192
|
+
}
|
|
193
|
+
static get is() { return "q2-chart-area"; }
|
|
194
|
+
static get encapsulation() { return "shadow"; }
|
|
195
|
+
static get originalStyleUrls() {
|
|
196
|
+
return {
|
|
197
|
+
"$": ["styles.scss"]
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
static get styleUrls() {
|
|
201
|
+
return {
|
|
202
|
+
"$": ["styles.css"]
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
static get properties() {
|
|
206
|
+
return {
|
|
207
|
+
"data": {
|
|
208
|
+
"type": "unknown",
|
|
209
|
+
"mutable": false,
|
|
210
|
+
"complexType": {
|
|
211
|
+
"original": "IChartData[]",
|
|
212
|
+
"resolved": "IChartData[]",
|
|
213
|
+
"references": {
|
|
214
|
+
"IChartData": {
|
|
215
|
+
"location": "import",
|
|
216
|
+
"path": "src/utils/charting"
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
"required": false,
|
|
221
|
+
"optional": false,
|
|
222
|
+
"docs": {
|
|
223
|
+
"tags": [],
|
|
224
|
+
"text": ""
|
|
225
|
+
},
|
|
226
|
+
"defaultValue": "[]"
|
|
227
|
+
},
|
|
228
|
+
"alignChartName": {
|
|
229
|
+
"type": "string",
|
|
230
|
+
"mutable": false,
|
|
231
|
+
"complexType": {
|
|
232
|
+
"original": "'left' | 'right' | 'center'",
|
|
233
|
+
"resolved": "\"center\" | \"left\" | \"right\"",
|
|
234
|
+
"references": {}
|
|
235
|
+
},
|
|
236
|
+
"required": false,
|
|
237
|
+
"optional": false,
|
|
238
|
+
"docs": {
|
|
239
|
+
"tags": [],
|
|
240
|
+
"text": ""
|
|
241
|
+
},
|
|
242
|
+
"attribute": "align-chart-name",
|
|
243
|
+
"reflect": true
|
|
244
|
+
},
|
|
245
|
+
"chartName": {
|
|
246
|
+
"type": "string",
|
|
247
|
+
"mutable": false,
|
|
248
|
+
"complexType": {
|
|
249
|
+
"original": "string",
|
|
250
|
+
"resolved": "string",
|
|
251
|
+
"references": {}
|
|
252
|
+
},
|
|
253
|
+
"required": false,
|
|
254
|
+
"optional": false,
|
|
255
|
+
"docs": {
|
|
256
|
+
"tags": [],
|
|
257
|
+
"text": ""
|
|
258
|
+
},
|
|
259
|
+
"attribute": "chart-name",
|
|
260
|
+
"reflect": true
|
|
261
|
+
},
|
|
262
|
+
"lineColor": {
|
|
263
|
+
"type": "string",
|
|
264
|
+
"mutable": false,
|
|
265
|
+
"complexType": {
|
|
266
|
+
"original": "string",
|
|
267
|
+
"resolved": "string",
|
|
268
|
+
"references": {}
|
|
269
|
+
},
|
|
270
|
+
"required": false,
|
|
271
|
+
"optional": false,
|
|
272
|
+
"docs": {
|
|
273
|
+
"tags": [],
|
|
274
|
+
"text": ""
|
|
275
|
+
},
|
|
276
|
+
"attribute": "line-color",
|
|
277
|
+
"reflect": true
|
|
278
|
+
},
|
|
279
|
+
"pointerLineColor": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"mutable": false,
|
|
282
|
+
"complexType": {
|
|
283
|
+
"original": "string",
|
|
284
|
+
"resolved": "string",
|
|
285
|
+
"references": {}
|
|
286
|
+
},
|
|
287
|
+
"required": false,
|
|
288
|
+
"optional": false,
|
|
289
|
+
"docs": {
|
|
290
|
+
"tags": [],
|
|
291
|
+
"text": ""
|
|
292
|
+
},
|
|
293
|
+
"attribute": "pointer-line-color",
|
|
294
|
+
"reflect": true
|
|
295
|
+
},
|
|
296
|
+
"pointerLineStyle": {
|
|
297
|
+
"type": "string",
|
|
298
|
+
"mutable": false,
|
|
299
|
+
"complexType": {
|
|
300
|
+
"original": "'solid' | 'dashed'",
|
|
301
|
+
"resolved": "\"dashed\" | \"solid\"",
|
|
302
|
+
"references": {}
|
|
303
|
+
},
|
|
304
|
+
"required": false,
|
|
305
|
+
"optional": false,
|
|
306
|
+
"docs": {
|
|
307
|
+
"tags": [],
|
|
308
|
+
"text": ""
|
|
309
|
+
},
|
|
310
|
+
"attribute": "pointer-line-style",
|
|
311
|
+
"reflect": true
|
|
312
|
+
},
|
|
313
|
+
"areaColor": {
|
|
314
|
+
"type": "string",
|
|
315
|
+
"mutable": false,
|
|
316
|
+
"complexType": {
|
|
317
|
+
"original": "string",
|
|
318
|
+
"resolved": "string",
|
|
319
|
+
"references": {}
|
|
320
|
+
},
|
|
321
|
+
"required": false,
|
|
322
|
+
"optional": false,
|
|
323
|
+
"docs": {
|
|
324
|
+
"tags": [],
|
|
325
|
+
"text": ""
|
|
326
|
+
},
|
|
327
|
+
"attribute": "area-color",
|
|
328
|
+
"reflect": true
|
|
329
|
+
},
|
|
330
|
+
"dataNamesOverflow": {
|
|
331
|
+
"type": "string",
|
|
332
|
+
"mutable": false,
|
|
333
|
+
"complexType": {
|
|
334
|
+
"original": "'break' | 'truncate'",
|
|
335
|
+
"resolved": "\"break\" | \"truncate\"",
|
|
336
|
+
"references": {}
|
|
337
|
+
},
|
|
338
|
+
"required": false,
|
|
339
|
+
"optional": false,
|
|
340
|
+
"docs": {
|
|
341
|
+
"tags": [],
|
|
342
|
+
"text": ""
|
|
343
|
+
},
|
|
344
|
+
"attribute": "data-names-overflow",
|
|
345
|
+
"reflect": true
|
|
346
|
+
},
|
|
347
|
+
"dataNamesWidth": {
|
|
348
|
+
"type": "number",
|
|
349
|
+
"mutable": false,
|
|
350
|
+
"complexType": {
|
|
351
|
+
"original": "number",
|
|
352
|
+
"resolved": "number",
|
|
353
|
+
"references": {}
|
|
354
|
+
},
|
|
355
|
+
"required": false,
|
|
356
|
+
"optional": false,
|
|
357
|
+
"docs": {
|
|
358
|
+
"tags": [],
|
|
359
|
+
"text": ""
|
|
360
|
+
},
|
|
361
|
+
"attribute": "data-names-width",
|
|
362
|
+
"reflect": true
|
|
363
|
+
},
|
|
364
|
+
"format": {
|
|
365
|
+
"type": "string",
|
|
366
|
+
"mutable": false,
|
|
367
|
+
"complexType": {
|
|
368
|
+
"original": "'currency' | 'default'",
|
|
369
|
+
"resolved": "\"currency\" | \"default\"",
|
|
370
|
+
"references": {}
|
|
371
|
+
},
|
|
372
|
+
"required": false,
|
|
373
|
+
"optional": false,
|
|
374
|
+
"docs": {
|
|
375
|
+
"tags": [],
|
|
376
|
+
"text": ""
|
|
377
|
+
},
|
|
378
|
+
"attribute": "format",
|
|
379
|
+
"reflect": true
|
|
380
|
+
},
|
|
381
|
+
"formatModifier": {
|
|
382
|
+
"type": "string",
|
|
383
|
+
"mutable": false,
|
|
384
|
+
"complexType": {
|
|
385
|
+
"original": "string",
|
|
386
|
+
"resolved": "string",
|
|
387
|
+
"references": {}
|
|
388
|
+
},
|
|
389
|
+
"required": false,
|
|
390
|
+
"optional": false,
|
|
391
|
+
"docs": {
|
|
392
|
+
"tags": [],
|
|
393
|
+
"text": ""
|
|
394
|
+
},
|
|
395
|
+
"attribute": "format-modifier",
|
|
396
|
+
"reflect": true
|
|
397
|
+
},
|
|
398
|
+
"hideNameAxisLabels": {
|
|
399
|
+
"type": "boolean",
|
|
400
|
+
"mutable": false,
|
|
401
|
+
"complexType": {
|
|
402
|
+
"original": "boolean",
|
|
403
|
+
"resolved": "boolean",
|
|
404
|
+
"references": {}
|
|
405
|
+
},
|
|
406
|
+
"required": false,
|
|
407
|
+
"optional": false,
|
|
408
|
+
"docs": {
|
|
409
|
+
"tags": [],
|
|
410
|
+
"text": ""
|
|
411
|
+
},
|
|
412
|
+
"attribute": "hide-name-axis-labels",
|
|
413
|
+
"reflect": true,
|
|
414
|
+
"defaultValue": "false"
|
|
415
|
+
},
|
|
416
|
+
"hideValueAxisLabels": {
|
|
417
|
+
"type": "boolean",
|
|
418
|
+
"mutable": false,
|
|
419
|
+
"complexType": {
|
|
420
|
+
"original": "boolean",
|
|
421
|
+
"resolved": "boolean",
|
|
422
|
+
"references": {}
|
|
423
|
+
},
|
|
424
|
+
"required": false,
|
|
425
|
+
"optional": false,
|
|
426
|
+
"docs": {
|
|
427
|
+
"tags": [],
|
|
428
|
+
"text": ""
|
|
429
|
+
},
|
|
430
|
+
"attribute": "hide-value-axis-labels",
|
|
431
|
+
"reflect": true,
|
|
432
|
+
"defaultValue": "false"
|
|
433
|
+
},
|
|
434
|
+
"offsetDataNames": {
|
|
435
|
+
"type": "boolean",
|
|
436
|
+
"mutable": false,
|
|
437
|
+
"complexType": {
|
|
438
|
+
"original": "boolean",
|
|
439
|
+
"resolved": "boolean",
|
|
440
|
+
"references": {}
|
|
441
|
+
},
|
|
442
|
+
"required": false,
|
|
443
|
+
"optional": false,
|
|
444
|
+
"docs": {
|
|
445
|
+
"tags": [],
|
|
446
|
+
"text": ""
|
|
447
|
+
},
|
|
448
|
+
"attribute": "offset-data-names",
|
|
449
|
+
"reflect": true,
|
|
450
|
+
"defaultValue": "false"
|
|
451
|
+
},
|
|
452
|
+
"offsetDataValues": {
|
|
453
|
+
"type": "boolean",
|
|
454
|
+
"mutable": false,
|
|
455
|
+
"complexType": {
|
|
456
|
+
"original": "boolean",
|
|
457
|
+
"resolved": "boolean",
|
|
458
|
+
"references": {}
|
|
459
|
+
},
|
|
460
|
+
"required": false,
|
|
461
|
+
"optional": false,
|
|
462
|
+
"docs": {
|
|
463
|
+
"tags": [],
|
|
464
|
+
"text": ""
|
|
465
|
+
},
|
|
466
|
+
"attribute": "offset-data-values",
|
|
467
|
+
"reflect": true,
|
|
468
|
+
"defaultValue": "false"
|
|
469
|
+
},
|
|
470
|
+
"showChartName": {
|
|
471
|
+
"type": "boolean",
|
|
472
|
+
"mutable": false,
|
|
473
|
+
"complexType": {
|
|
474
|
+
"original": "boolean",
|
|
475
|
+
"resolved": "boolean",
|
|
476
|
+
"references": {}
|
|
477
|
+
},
|
|
478
|
+
"required": false,
|
|
479
|
+
"optional": false,
|
|
480
|
+
"docs": {
|
|
481
|
+
"tags": [],
|
|
482
|
+
"text": ""
|
|
483
|
+
},
|
|
484
|
+
"attribute": "show-chart-name",
|
|
485
|
+
"reflect": true,
|
|
486
|
+
"defaultValue": "false"
|
|
487
|
+
},
|
|
488
|
+
"showDatapointLabels": {
|
|
489
|
+
"type": "boolean",
|
|
490
|
+
"mutable": false,
|
|
491
|
+
"complexType": {
|
|
492
|
+
"original": "boolean",
|
|
493
|
+
"resolved": "boolean",
|
|
494
|
+
"references": {}
|
|
495
|
+
},
|
|
496
|
+
"required": false,
|
|
497
|
+
"optional": false,
|
|
498
|
+
"docs": {
|
|
499
|
+
"tags": [],
|
|
500
|
+
"text": ""
|
|
501
|
+
},
|
|
502
|
+
"attribute": "show-datapoint-labels",
|
|
503
|
+
"reflect": true,
|
|
504
|
+
"defaultValue": "false"
|
|
505
|
+
},
|
|
506
|
+
"showGradient": {
|
|
507
|
+
"type": "boolean",
|
|
508
|
+
"mutable": false,
|
|
509
|
+
"complexType": {
|
|
510
|
+
"original": "boolean",
|
|
511
|
+
"resolved": "boolean",
|
|
512
|
+
"references": {}
|
|
513
|
+
},
|
|
514
|
+
"required": false,
|
|
515
|
+
"optional": false,
|
|
516
|
+
"docs": {
|
|
517
|
+
"tags": [],
|
|
518
|
+
"text": ""
|
|
519
|
+
},
|
|
520
|
+
"attribute": "show-gradient",
|
|
521
|
+
"reflect": true,
|
|
522
|
+
"defaultValue": "false"
|
|
523
|
+
},
|
|
524
|
+
"gridLines": {
|
|
525
|
+
"type": "string",
|
|
526
|
+
"mutable": false,
|
|
527
|
+
"complexType": {
|
|
528
|
+
"original": "'horizontal' | 'vertical' | 'off'",
|
|
529
|
+
"resolved": "\"horizontal\" | \"off\" | \"vertical\"",
|
|
530
|
+
"references": {}
|
|
531
|
+
},
|
|
532
|
+
"required": false,
|
|
533
|
+
"optional": false,
|
|
534
|
+
"docs": {
|
|
535
|
+
"tags": [],
|
|
536
|
+
"text": ""
|
|
537
|
+
},
|
|
538
|
+
"attribute": "grid-lines",
|
|
539
|
+
"reflect": true
|
|
540
|
+
}
|
|
541
|
+
};
|
|
542
|
+
}
|
|
543
|
+
static get events() {
|
|
544
|
+
return [{
|
|
545
|
+
"method": "change",
|
|
546
|
+
"name": "change",
|
|
547
|
+
"bubbles": true,
|
|
548
|
+
"cancelable": true,
|
|
549
|
+
"composed": true,
|
|
550
|
+
"docs": {
|
|
551
|
+
"tags": [],
|
|
552
|
+
"text": ""
|
|
553
|
+
},
|
|
554
|
+
"complexType": {
|
|
555
|
+
"original": "any",
|
|
556
|
+
"resolved": "any",
|
|
557
|
+
"references": {}
|
|
558
|
+
}
|
|
559
|
+
}];
|
|
560
|
+
}
|
|
561
|
+
static get elementRef() { return "hostElement"; }
|
|
562
|
+
static get watchers() {
|
|
563
|
+
return [{
|
|
564
|
+
"propName": "data",
|
|
565
|
+
"methodName": "propsUpdates"
|
|
566
|
+
}, {
|
|
567
|
+
"propName": "alignChartName",
|
|
568
|
+
"methodName": "propsUpdates"
|
|
569
|
+
}, {
|
|
570
|
+
"propName": "chartName",
|
|
571
|
+
"methodName": "propsUpdates"
|
|
572
|
+
}, {
|
|
573
|
+
"propName": "lineColor",
|
|
574
|
+
"methodName": "propsUpdates"
|
|
575
|
+
}, {
|
|
576
|
+
"propName": "pointerLineColor",
|
|
577
|
+
"methodName": "propsUpdates"
|
|
578
|
+
}, {
|
|
579
|
+
"propName": "pointerLineStyle",
|
|
580
|
+
"methodName": "propsUpdates"
|
|
581
|
+
}, {
|
|
582
|
+
"propName": "areaColor",
|
|
583
|
+
"methodName": "propsUpdates"
|
|
584
|
+
}, {
|
|
585
|
+
"propName": "dataNamesOverflow",
|
|
586
|
+
"methodName": "propsUpdates"
|
|
587
|
+
}, {
|
|
588
|
+
"propName": "dataNamesWidth",
|
|
589
|
+
"methodName": "propsUpdates"
|
|
590
|
+
}, {
|
|
591
|
+
"propName": "format",
|
|
592
|
+
"methodName": "propsUpdates"
|
|
593
|
+
}, {
|
|
594
|
+
"propName": "formatModifier",
|
|
595
|
+
"methodName": "propsUpdates"
|
|
596
|
+
}, {
|
|
597
|
+
"propName": "hideNameAxisLabels",
|
|
598
|
+
"methodName": "propsUpdates"
|
|
599
|
+
}, {
|
|
600
|
+
"propName": "hideValueAxisLabels",
|
|
601
|
+
"methodName": "propsUpdates"
|
|
602
|
+
}, {
|
|
603
|
+
"propName": "offsetDataNames",
|
|
604
|
+
"methodName": "propsUpdates"
|
|
605
|
+
}, {
|
|
606
|
+
"propName": "offsetDataValues",
|
|
607
|
+
"methodName": "propsUpdates"
|
|
608
|
+
}, {
|
|
609
|
+
"propName": "showChartName",
|
|
610
|
+
"methodName": "propsUpdates"
|
|
611
|
+
}, {
|
|
612
|
+
"propName": "showDatapointLabels",
|
|
613
|
+
"methodName": "propsUpdates"
|
|
614
|
+
}, {
|
|
615
|
+
"propName": "showGradient",
|
|
616
|
+
"methodName": "propsUpdates"
|
|
617
|
+
}, {
|
|
618
|
+
"propName": "gridLines",
|
|
619
|
+
"methodName": "propsUpdates"
|
|
620
|
+
}];
|
|
621
|
+
}
|
|
622
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
*:active {
|
|
6
|
+
outline: none;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
*:focus {
|
|
10
|
+
outline: none;
|
|
11
|
+
box-shadow: var(--const-double-focus-ring, 0 0 0 2px #ffffff, 0 0 0 4px #33b4ff #06C);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host {
|
|
15
|
+
box-shadow: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
::-moz-focus-inner {
|
|
19
|
+
border: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
input,
|
|
23
|
+
textarea,
|
|
24
|
+
button {
|
|
25
|
+
font-family: inherit;
|
|
26
|
+
font-size: inherit;
|
|
27
|
+
font-stretch: inherit;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
:host(.sr),
|
|
31
|
+
:host(.sr) button {
|
|
32
|
+
border: 0;
|
|
33
|
+
clip: rect(0 0 0 0);
|
|
34
|
+
height: 1px;
|
|
35
|
+
margin: -1px;
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
padding: 0;
|
|
38
|
+
position: absolute;
|
|
39
|
+
width: 1px;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.sr,
|
|
44
|
+
.sr button {
|
|
45
|
+
border: 0;
|
|
46
|
+
clip: rect(0 0 0 0);
|
|
47
|
+
height: 1px;
|
|
48
|
+
margin: -1px;
|
|
49
|
+
overflow: hidden;
|
|
50
|
+
padding: 0;
|
|
51
|
+
position: absolute;
|
|
52
|
+
width: 1px;
|
|
53
|
+
white-space: nowrap;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.hidden {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
:host([hidden]) {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.invisible {
|
|
65
|
+
visibility: hidden;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
:host {
|
|
69
|
+
width: var(--tct-area-chart-width, 100%);
|
|
70
|
+
height: var(--tct-area-chart-height, 100%);
|
|
71
|
+
display: block;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.container {
|
|
75
|
+
width: 100%;
|
|
76
|
+
height: 100%;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.chart-container {
|
|
80
|
+
width: 100%;
|
|
81
|
+
height: 100%;
|
|
82
|
+
}
|