typecomposer 0.0.86 → 0.0.87
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/core/element/action/ChartPane.d.ts +0 -32
- package/dist/cjs/core/element/action/ChartPane.js +0 -161
- package/dist/cjs/core/element/action/ChartPane.js.map +1 -1
- package/dist/cjs/core/element/index.d.ts +1 -2
- package/dist/cjs/core/element/index.js +1 -3
- package/dist/cjs/core/element/index.js.map +1 -1
- package/dist/esm/core/element/action/ChartPane.d.ts +0 -32
- package/dist/esm/core/element/action/ChartPane.js +0 -157
- package/dist/esm/core/element/action/ChartPane.js.map +1 -1
- package/dist/esm/core/element/index.d.ts +1 -2
- package/dist/esm/core/element/index.js +1 -16
- package/dist/esm/core/element/index.js.map +1 -1
- package/package.json +1 -4
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Component, type ComponentProps } from "../..";
|
|
2
|
-
import { Chart, ChartConfiguration } from "chart.js/auto";
|
|
3
|
-
/**
|
|
4
|
-
* ChartElement
|
|
5
|
-
* https://www.chartjs.org/docs/latest/charts
|
|
6
|
-
*/
|
|
7
|
-
export declare class ChartElement extends Component {
|
|
8
|
-
private _canvas;
|
|
9
|
-
private _chart;
|
|
10
|
-
private ctx;
|
|
11
|
-
constructor(props?: ComponentProps & {
|
|
12
|
-
type?: ChartConfiguration["type"];
|
|
13
|
-
data?: ChartConfiguration["data"];
|
|
14
|
-
options?: ChartConfiguration["options"];
|
|
15
|
-
plugins?: ChartConfiguration["plugins"];
|
|
16
|
-
});
|
|
17
|
-
resize(): void;
|
|
18
|
-
onInit(): void;
|
|
19
|
-
update(config?: ChartConfiguration): void;
|
|
20
|
-
set type(type: ChartConfiguration["type"]);
|
|
21
|
-
get type(): ChartConfiguration["type"];
|
|
22
|
-
get configuration(): ChartConfiguration;
|
|
23
|
-
set configuration(config: ChartConfiguration);
|
|
24
|
-
get datasets(): ChartConfiguration["data"]["datasets"];
|
|
25
|
-
get plugins(): ChartConfiguration["plugins"];
|
|
26
|
-
set plugins(plugins: ChartConfiguration["plugins"]);
|
|
27
|
-
set datasets(datasets: ChartConfiguration["data"]["datasets"]);
|
|
28
|
-
get chart(): Chart;
|
|
29
|
-
unmount(): void;
|
|
30
|
-
static ChartOptionsEmpty(data?: ChartConfiguration): ChartConfiguration;
|
|
31
|
-
static generateUniqueColors(qtd: number): string[];
|
|
32
|
-
}
|
|
@@ -1,162 +1 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChartElement = void 0;
|
|
4
|
-
const __1 = require("../..");
|
|
5
|
-
const auto_1 = require("chart.js/auto");
|
|
6
|
-
/**
|
|
7
|
-
* ChartElement
|
|
8
|
-
* https://www.chartjs.org/docs/latest/charts
|
|
9
|
-
*/
|
|
10
|
-
class ChartElement extends __1.Component {
|
|
11
|
-
_canvas = new __1.CanvasElement();
|
|
12
|
-
_chart;
|
|
13
|
-
ctx;
|
|
14
|
-
constructor(props) {
|
|
15
|
-
super(props);
|
|
16
|
-
this.ctx = this._canvas.getContext("2d");
|
|
17
|
-
this._chart = new auto_1.Chart(this.ctx, ChartElement.ChartOptionsEmpty({
|
|
18
|
-
type: props?.type,
|
|
19
|
-
data: props?.data,
|
|
20
|
-
options: props?.options,
|
|
21
|
-
plugins: props?.plugins,
|
|
22
|
-
}));
|
|
23
|
-
this.addEventListener("resize", this.resize.bind(this));
|
|
24
|
-
this.addEventListener("change", this.resize.bind(this));
|
|
25
|
-
this.appendChild(this._canvas);
|
|
26
|
-
}
|
|
27
|
-
resize() {
|
|
28
|
-
this.style.display = "none";
|
|
29
|
-
this.chart?.resize();
|
|
30
|
-
this.chart?.update();
|
|
31
|
-
this._canvas.width = this.clientWidth;
|
|
32
|
-
this._canvas.height = this.clientHeight;
|
|
33
|
-
this.style.display = "block";
|
|
34
|
-
}
|
|
35
|
-
onInit() {
|
|
36
|
-
const data = {
|
|
37
|
-
labels: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio"],
|
|
38
|
-
datasets: [
|
|
39
|
-
{
|
|
40
|
-
label: "Vendas",
|
|
41
|
-
data: [12, 19, 3, 5, 2],
|
|
42
|
-
backgroundColor: ["rgba(255, 99, 132, 0.2)", "rgba(54, 162, 235, 0.2)", "rgba(255, 206, 86, 0.2)", "rgba(75, 192, 192, 0.2)", "rgba(153, 102, 255, 0.2)"],
|
|
43
|
-
borderColor: ["rgba(255, 99, 132, 1)", "rgba(54, 162, 235, 1)", "rgba(255, 206, 86, 1)", "rgba(75, 192, 192, 1)", "rgba(153, 102, 255, 1)"],
|
|
44
|
-
borderWidth: 1,
|
|
45
|
-
},
|
|
46
|
-
],
|
|
47
|
-
};
|
|
48
|
-
this.update({
|
|
49
|
-
type: "line",
|
|
50
|
-
data: data,
|
|
51
|
-
options: {
|
|
52
|
-
maintainAspectRatio: false,
|
|
53
|
-
responsive: true,
|
|
54
|
-
scales: {
|
|
55
|
-
y: {
|
|
56
|
-
beginAtZero: true,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
update(config) {
|
|
63
|
-
if (config != undefined) {
|
|
64
|
-
this._chart.data = config.data || ChartElement.ChartOptionsEmpty().data;
|
|
65
|
-
this._chart.options = config.options || ChartElement.ChartOptionsEmpty().options;
|
|
66
|
-
// ChartElement.ChartOptionsEmpty().options.da
|
|
67
|
-
// if (config.type) (this._chart.options as any).type = config.type;
|
|
68
|
-
}
|
|
69
|
-
if (config.type) {
|
|
70
|
-
// @ts-ignore
|
|
71
|
-
this._chart.config.type = config.type;
|
|
72
|
-
}
|
|
73
|
-
this._chart.update();
|
|
74
|
-
// mudar o type do chart
|
|
75
|
-
}
|
|
76
|
-
set type(type) {
|
|
77
|
-
// @ts-ignore
|
|
78
|
-
this._chart.config.type = type;
|
|
79
|
-
this._chart.update();
|
|
80
|
-
}
|
|
81
|
-
get type() {
|
|
82
|
-
// @ts-ignore
|
|
83
|
-
return this._chart.config.type;
|
|
84
|
-
}
|
|
85
|
-
get configuration() {
|
|
86
|
-
return this._chart.config;
|
|
87
|
-
}
|
|
88
|
-
set configuration(config) {
|
|
89
|
-
this.update(config);
|
|
90
|
-
}
|
|
91
|
-
get datasets() {
|
|
92
|
-
return this._chart.data.datasets;
|
|
93
|
-
}
|
|
94
|
-
get plugins() {
|
|
95
|
-
return this._chart.config.plugins;
|
|
96
|
-
}
|
|
97
|
-
set plugins(plugins) {
|
|
98
|
-
this._chart.config.plugins = plugins;
|
|
99
|
-
this._chart.update();
|
|
100
|
-
}
|
|
101
|
-
set datasets(datasets) {
|
|
102
|
-
this._chart.data.datasets = datasets;
|
|
103
|
-
this._chart.update();
|
|
104
|
-
}
|
|
105
|
-
get chart() {
|
|
106
|
-
return this._chart;
|
|
107
|
-
}
|
|
108
|
-
unmount() {
|
|
109
|
-
window.removeEventListener("resize", this.resize.bind(this));
|
|
110
|
-
}
|
|
111
|
-
static ChartOptionsEmpty(data) {
|
|
112
|
-
const result = {
|
|
113
|
-
type: "line",
|
|
114
|
-
data: {
|
|
115
|
-
labels: [],
|
|
116
|
-
datasets: [
|
|
117
|
-
{
|
|
118
|
-
label: "",
|
|
119
|
-
data: [],
|
|
120
|
-
backgroundColor: ["rgba(255, 99, 132, 0)"],
|
|
121
|
-
borderColor: ["rgba(255, 99, 132, 0)"],
|
|
122
|
-
borderWidth: 1,
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
},
|
|
126
|
-
options: {
|
|
127
|
-
maintainAspectRatio: false,
|
|
128
|
-
responsive: true,
|
|
129
|
-
scales: {
|
|
130
|
-
y: {
|
|
131
|
-
beginAtZero: true,
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
},
|
|
135
|
-
};
|
|
136
|
-
if (data?.data != undefined)
|
|
137
|
-
result.data = data.data;
|
|
138
|
-
if (data?.options != undefined)
|
|
139
|
-
result.options = data.options;
|
|
140
|
-
if (data?.type != undefined)
|
|
141
|
-
result.type = data.type;
|
|
142
|
-
if (data?.plugins != undefined)
|
|
143
|
-
result.plugins = data.plugins;
|
|
144
|
-
return result;
|
|
145
|
-
}
|
|
146
|
-
static generateUniqueColors(qtd) {
|
|
147
|
-
const cores = [];
|
|
148
|
-
const hexadecimais = "0123456789ABCDEF";
|
|
149
|
-
for (let i = 0; i < qtd; i++) {
|
|
150
|
-
let cor = "#";
|
|
151
|
-
for (let j = 0; j < 6; j++) {
|
|
152
|
-
cor += hexadecimais[Math.floor(Math.random() * 16)];
|
|
153
|
-
}
|
|
154
|
-
cores.push(cor);
|
|
155
|
-
}
|
|
156
|
-
return cores;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
exports.ChartElement = ChartElement;
|
|
160
|
-
// @ts-ignore
|
|
161
|
-
customElements.define("chart-element", ChartElement);
|
|
162
1
|
//# sourceMappingURL=ChartPane.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartPane.js","sourceRoot":"","sources":["../../../../../src/core/element/action/ChartPane.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChartPane.js","sourceRoot":"","sources":["../../../../../src/core/element/action/ChartPane.ts"],"names":[],"mappings":""}
|
|
@@ -15,7 +15,6 @@ import { TabItem } from "./action/TabItem";
|
|
|
15
15
|
import { PaneElement } from "./layers/PaneElement";
|
|
16
16
|
import { SlidePane } from "./action/SlidePane";
|
|
17
17
|
import { DropDown } from "./action/DropDown";
|
|
18
|
-
import { ChartElement } from "./action/ChartPane";
|
|
19
18
|
import { CheckBox, CheckBoxGroup } from "./action/CheckBox";
|
|
20
19
|
import { ToggleButton } from "./action/ToggleButton";
|
|
21
20
|
import { ILayout } from "./base/Elements";
|
|
@@ -26,4 +25,4 @@ import { ScrollPane } from "./layers/ScrollPane";
|
|
|
26
25
|
import { TablePane, TablePagination } from "./layers/TablePane";
|
|
27
26
|
import { PopUpButton } from "./action/PopUpButton";
|
|
28
27
|
import { AvatarElement } from "./action/AvatarElement";
|
|
29
|
-
export { ColorPicker, AlertType, ScrollPane, AlertPanel, App, CardElement,
|
|
28
|
+
export { ColorPicker, AlertType, ScrollPane, AlertPanel, App, CardElement, CheckBox, CheckBoxGroup, ToggleButton, TablePane, TablePagination, AvatarElement, DropDown, PopUpButton, SlidePane, TabPane, TabItem, ListElement, IconElement, FlowPane, VBoxElement, HBoxElement, GridElement, PaneElement, BorderPaneElement, StyleLink, ILayout, StackPane, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.StackPane = exports.ILayout = exports.StyleLink = exports.BorderPaneElement = exports.PaneElement = exports.GridElement = exports.HBoxElement = exports.VBoxElement = exports.FlowPane = exports.IconElement = exports.ListElement = exports.TabItem = exports.TabPane = exports.SlidePane = exports.PopUpButton = exports.DropDown = exports.AvatarElement = exports.TablePagination = exports.TablePane = exports.ToggleButton = exports.CheckBoxGroup = exports.CheckBox = exports.
|
|
3
|
+
exports.StackPane = exports.ILayout = exports.StyleLink = exports.BorderPaneElement = exports.PaneElement = exports.GridElement = exports.HBoxElement = exports.VBoxElement = exports.FlowPane = exports.IconElement = exports.ListElement = exports.TabItem = exports.TabPane = exports.SlidePane = exports.PopUpButton = exports.DropDown = exports.AvatarElement = exports.TablePagination = exports.TablePane = exports.ToggleButton = exports.CheckBoxGroup = exports.CheckBox = exports.CardElement = exports.App = exports.AlertPanel = exports.ScrollPane = exports.ColorPicker = void 0;
|
|
4
4
|
__exportStar(require("./base/Elements"), exports);
|
|
5
5
|
__exportStar(require("./text"), exports);
|
|
6
6
|
const CardElement_1 = require("./layers/CardElement");
|
|
@@ -33,8 +33,6 @@ const SlidePane_1 = require("./action/SlidePane");
|
|
|
33
33
|
Object.defineProperty(exports, "SlidePane", { enumerable: true, get: function () { return SlidePane_1.SlidePane; } });
|
|
34
34
|
const DropDown_1 = require("./action/DropDown");
|
|
35
35
|
Object.defineProperty(exports, "DropDown", { enumerable: true, get: function () { return DropDown_1.DropDown; } });
|
|
36
|
-
const ChartPane_1 = require("./action/ChartPane");
|
|
37
|
-
Object.defineProperty(exports, "ChartElement", { enumerable: true, get: function () { return ChartPane_1.ChartElement; } });
|
|
38
36
|
const CheckBox_1 = require("./action/CheckBox");
|
|
39
37
|
Object.defineProperty(exports, "CheckBox", { enumerable: true, get: function () { return CheckBox_1.CheckBox; } });
|
|
40
38
|
Object.defineProperty(exports, "CheckBoxGroup", { enumerable: true, get: function () { return CheckBox_1.CheckBoxGroup; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/element/index.ts"],"names":[],"mappings":";;;AAAA,kDAAgC;AAChC,yCAAuB;AAEvB,sDAAmD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/element/index.ts"],"names":[],"mappings":";;;AAAA,kDAAgC;AAChC,yCAAuB;AAEvB,sDAAmD;AAgCjD,4FAhCO,yBAAW,OAgCP;AA/Bb,uDAAoD;AAmDlD,0FAnDO,qBAAS,OAmDP;AAlDX,sDAAmD;AA6CjD,4FA7CO,yBAAW,OA6CP;AA5Cb,sDAAmD;AA6CjD,4FA7CO,yBAAW,OA6CP;AA5Cb,sDAAmD;AA6CjD,4FA7CO,yBAAW,OA6CP;AA5Cb,kEAA+D;AA8C7D,kGA9CO,qCAAiB,OA8CP;AA7CnB,oCAAiC;AAyB/B,oFAzBO,SAAG,OAyBP;AAxBL,gDAA6C;AAuC3C,yFAvCO,mBAAQ,OAuCP;AAtCV,sDAAmD;AAoCjD,4FApCO,yBAAW,OAoCP;AAnCb,8CAA2C;AAiCzC,wFAjCO,iBAAO,OAiCP;AAhCT,qDAAkD;AAmChD,4FAnCO,yBAAW,OAmCP;AAlCb,8CAA2C;AAgCzC,wFAhCO,iBAAO,OAgCP;AA/BT,sDAAmD;AAsCjD,4FAtCO,yBAAW,OAsCP;AArCb,kDAA+C;AA4B7C,0FA5BO,qBAAS,OA4BP;AA3BX,gDAA6C;AAyB3C,yFAzBO,mBAAQ,OAyBP;AAxBV,gDAA4D;AAkB1D,yFAlBO,mBAAQ,OAkBP;AACR,8FAnBiB,wBAAa,OAmBjB;AAlBf,wDAAqD;AAmBnD,6FAnBO,2BAAY,OAmBP;AAlBd,8CAA0C;AAoCxC,wFApCO,kBAAO,OAoCP;AAnCT,kDAA+C;AAoC7C,0FApCO,qBAAS,OAoCP;AAnCX,kDAAgE;AAW9D,2FAXO,sBAAU,OAWP;AAVZ,sDAAmD;AAOjD,4FAPO,yBAAW,OAOP;AANb,oDAAiD;AAQ/C,2FARO,uBAAU,OAQP;AAPZ,kDAAgE;AAc9D,0FAdO,qBAAS,OAcP;AACT,gGAfkB,2BAAe,OAelB;AAdjB,sDAAmD;AAiBjD,4FAjBO,yBAAW,OAiBP;AAhBb,0DAAuD;AAcrD,8FAdO,6BAAa,OAcP"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { Component, type ComponentProps } from "../..";
|
|
2
|
-
import { Chart, ChartConfiguration } from "chart.js/auto";
|
|
3
|
-
/**
|
|
4
|
-
* ChartElement
|
|
5
|
-
* https://www.chartjs.org/docs/latest/charts
|
|
6
|
-
*/
|
|
7
|
-
export declare class ChartElement extends Component {
|
|
8
|
-
private _canvas;
|
|
9
|
-
private _chart;
|
|
10
|
-
private ctx;
|
|
11
|
-
constructor(props?: ComponentProps & {
|
|
12
|
-
type?: ChartConfiguration["type"];
|
|
13
|
-
data?: ChartConfiguration["data"];
|
|
14
|
-
options?: ChartConfiguration["options"];
|
|
15
|
-
plugins?: ChartConfiguration["plugins"];
|
|
16
|
-
});
|
|
17
|
-
resize(): void;
|
|
18
|
-
onInit(): void;
|
|
19
|
-
update(config?: ChartConfiguration): void;
|
|
20
|
-
set type(type: ChartConfiguration["type"]);
|
|
21
|
-
get type(): ChartConfiguration["type"];
|
|
22
|
-
get configuration(): ChartConfiguration;
|
|
23
|
-
set configuration(config: ChartConfiguration);
|
|
24
|
-
get datasets(): ChartConfiguration["data"]["datasets"];
|
|
25
|
-
get plugins(): ChartConfiguration["plugins"];
|
|
26
|
-
set plugins(plugins: ChartConfiguration["plugins"]);
|
|
27
|
-
set datasets(datasets: ChartConfiguration["data"]["datasets"]);
|
|
28
|
-
get chart(): Chart;
|
|
29
|
-
unmount(): void;
|
|
30
|
-
static ChartOptionsEmpty(data?: ChartConfiguration): ChartConfiguration;
|
|
31
|
-
static generateUniqueColors(qtd: number): string[];
|
|
32
|
-
}
|
|
@@ -1,158 +1 @@
|
|
|
1
|
-
import { Component, CanvasElement } from "../..";
|
|
2
|
-
import { Chart } from "chart.js/auto";
|
|
3
|
-
/**
|
|
4
|
-
* ChartElement
|
|
5
|
-
* https://www.chartjs.org/docs/latest/charts
|
|
6
|
-
*/
|
|
7
|
-
export class ChartElement extends Component {
|
|
8
|
-
_canvas = new CanvasElement();
|
|
9
|
-
_chart;
|
|
10
|
-
ctx;
|
|
11
|
-
constructor(props) {
|
|
12
|
-
super(props);
|
|
13
|
-
this.ctx = this._canvas.getContext("2d");
|
|
14
|
-
this._chart = new Chart(this.ctx, ChartElement.ChartOptionsEmpty({
|
|
15
|
-
type: props?.type,
|
|
16
|
-
data: props?.data,
|
|
17
|
-
options: props?.options,
|
|
18
|
-
plugins: props?.plugins,
|
|
19
|
-
}));
|
|
20
|
-
this.addEventListener("resize", this.resize.bind(this));
|
|
21
|
-
this.addEventListener("change", this.resize.bind(this));
|
|
22
|
-
this.appendChild(this._canvas);
|
|
23
|
-
}
|
|
24
|
-
resize() {
|
|
25
|
-
this.style.display = "none";
|
|
26
|
-
this.chart?.resize();
|
|
27
|
-
this.chart?.update();
|
|
28
|
-
this._canvas.width = this.clientWidth;
|
|
29
|
-
this._canvas.height = this.clientHeight;
|
|
30
|
-
this.style.display = "block";
|
|
31
|
-
}
|
|
32
|
-
onInit() {
|
|
33
|
-
const data = {
|
|
34
|
-
labels: ["Janeiro", "Fevereiro", "Março", "Abril", "Maio"],
|
|
35
|
-
datasets: [
|
|
36
|
-
{
|
|
37
|
-
label: "Vendas",
|
|
38
|
-
data: [12, 19, 3, 5, 2],
|
|
39
|
-
backgroundColor: ["rgba(255, 99, 132, 0.2)", "rgba(54, 162, 235, 0.2)", "rgba(255, 206, 86, 0.2)", "rgba(75, 192, 192, 0.2)", "rgba(153, 102, 255, 0.2)"],
|
|
40
|
-
borderColor: ["rgba(255, 99, 132, 1)", "rgba(54, 162, 235, 1)", "rgba(255, 206, 86, 1)", "rgba(75, 192, 192, 1)", "rgba(153, 102, 255, 1)"],
|
|
41
|
-
borderWidth: 1,
|
|
42
|
-
},
|
|
43
|
-
],
|
|
44
|
-
};
|
|
45
|
-
this.update({
|
|
46
|
-
type: "line",
|
|
47
|
-
data: data,
|
|
48
|
-
options: {
|
|
49
|
-
maintainAspectRatio: false,
|
|
50
|
-
responsive: true,
|
|
51
|
-
scales: {
|
|
52
|
-
y: {
|
|
53
|
-
beginAtZero: true,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
update(config) {
|
|
60
|
-
if (config != undefined) {
|
|
61
|
-
this._chart.data = config.data || ChartElement.ChartOptionsEmpty().data;
|
|
62
|
-
this._chart.options = config.options || ChartElement.ChartOptionsEmpty().options;
|
|
63
|
-
// ChartElement.ChartOptionsEmpty().options.da
|
|
64
|
-
// if (config.type) (this._chart.options as any).type = config.type;
|
|
65
|
-
}
|
|
66
|
-
if (config.type) {
|
|
67
|
-
// @ts-ignore
|
|
68
|
-
this._chart.config.type = config.type;
|
|
69
|
-
}
|
|
70
|
-
this._chart.update();
|
|
71
|
-
// mudar o type do chart
|
|
72
|
-
}
|
|
73
|
-
set type(type) {
|
|
74
|
-
// @ts-ignore
|
|
75
|
-
this._chart.config.type = type;
|
|
76
|
-
this._chart.update();
|
|
77
|
-
}
|
|
78
|
-
get type() {
|
|
79
|
-
// @ts-ignore
|
|
80
|
-
return this._chart.config.type;
|
|
81
|
-
}
|
|
82
|
-
get configuration() {
|
|
83
|
-
return this._chart.config;
|
|
84
|
-
}
|
|
85
|
-
set configuration(config) {
|
|
86
|
-
this.update(config);
|
|
87
|
-
}
|
|
88
|
-
get datasets() {
|
|
89
|
-
return this._chart.data.datasets;
|
|
90
|
-
}
|
|
91
|
-
get plugins() {
|
|
92
|
-
return this._chart.config.plugins;
|
|
93
|
-
}
|
|
94
|
-
set plugins(plugins) {
|
|
95
|
-
this._chart.config.plugins = plugins;
|
|
96
|
-
this._chart.update();
|
|
97
|
-
}
|
|
98
|
-
set datasets(datasets) {
|
|
99
|
-
this._chart.data.datasets = datasets;
|
|
100
|
-
this._chart.update();
|
|
101
|
-
}
|
|
102
|
-
get chart() {
|
|
103
|
-
return this._chart;
|
|
104
|
-
}
|
|
105
|
-
unmount() {
|
|
106
|
-
window.removeEventListener("resize", this.resize.bind(this));
|
|
107
|
-
}
|
|
108
|
-
static ChartOptionsEmpty(data) {
|
|
109
|
-
const result = {
|
|
110
|
-
type: "line",
|
|
111
|
-
data: {
|
|
112
|
-
labels: [],
|
|
113
|
-
datasets: [
|
|
114
|
-
{
|
|
115
|
-
label: "",
|
|
116
|
-
data: [],
|
|
117
|
-
backgroundColor: ["rgba(255, 99, 132, 0)"],
|
|
118
|
-
borderColor: ["rgba(255, 99, 132, 0)"],
|
|
119
|
-
borderWidth: 1,
|
|
120
|
-
},
|
|
121
|
-
],
|
|
122
|
-
},
|
|
123
|
-
options: {
|
|
124
|
-
maintainAspectRatio: false,
|
|
125
|
-
responsive: true,
|
|
126
|
-
scales: {
|
|
127
|
-
y: {
|
|
128
|
-
beginAtZero: true,
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
};
|
|
133
|
-
if (data?.data != undefined)
|
|
134
|
-
result.data = data.data;
|
|
135
|
-
if (data?.options != undefined)
|
|
136
|
-
result.options = data.options;
|
|
137
|
-
if (data?.type != undefined)
|
|
138
|
-
result.type = data.type;
|
|
139
|
-
if (data?.plugins != undefined)
|
|
140
|
-
result.plugins = data.plugins;
|
|
141
|
-
return result;
|
|
142
|
-
}
|
|
143
|
-
static generateUniqueColors(qtd) {
|
|
144
|
-
const cores = [];
|
|
145
|
-
const hexadecimais = "0123456789ABCDEF";
|
|
146
|
-
for (let i = 0; i < qtd; i++) {
|
|
147
|
-
let cor = "#";
|
|
148
|
-
for (let j = 0; j < 6; j++) {
|
|
149
|
-
cor += hexadecimais[Math.floor(Math.random() * 16)];
|
|
150
|
-
}
|
|
151
|
-
cores.push(cor);
|
|
152
|
-
}
|
|
153
|
-
return cores;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
// @ts-ignore
|
|
157
|
-
customElements.define("chart-element", ChartElement);
|
|
158
1
|
//# sourceMappingURL=ChartPane.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartPane.js","sourceRoot":"","sources":["../../../../../src/core/element/action/ChartPane.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ChartPane.js","sourceRoot":"","sources":["../../../../../src/core/element/action/ChartPane.ts"],"names":[],"mappings":""}
|
|
@@ -15,7 +15,6 @@ import { TabItem } from "./action/TabItem";
|
|
|
15
15
|
import { PaneElement } from "./layers/PaneElement";
|
|
16
16
|
import { SlidePane } from "./action/SlidePane";
|
|
17
17
|
import { DropDown } from "./action/DropDown";
|
|
18
|
-
import { ChartElement } from "./action/ChartPane";
|
|
19
18
|
import { CheckBox, CheckBoxGroup } from "./action/CheckBox";
|
|
20
19
|
import { ToggleButton } from "./action/ToggleButton";
|
|
21
20
|
import { ILayout } from "./base/Elements";
|
|
@@ -26,4 +25,4 @@ import { ScrollPane } from "./layers/ScrollPane";
|
|
|
26
25
|
import { TablePane, TablePagination } from "./layers/TablePane";
|
|
27
26
|
import { PopUpButton } from "./action/PopUpButton";
|
|
28
27
|
import { AvatarElement } from "./action/AvatarElement";
|
|
29
|
-
export { ColorPicker, AlertType, ScrollPane, AlertPanel, App, CardElement,
|
|
28
|
+
export { ColorPicker, AlertType, ScrollPane, AlertPanel, App, CardElement, CheckBox, CheckBoxGroup, ToggleButton, TablePane, TablePagination, AvatarElement, DropDown, PopUpButton, SlidePane, TabPane, TabItem, ListElement, IconElement, FlowPane, VBoxElement, HBoxElement, GridElement, PaneElement, BorderPaneElement, StyleLink, ILayout, StackPane, };
|
|
@@ -15,7 +15,6 @@ import { TabItem } from "./action/TabItem";
|
|
|
15
15
|
import { PaneElement } from "./layers/PaneElement";
|
|
16
16
|
import { SlidePane } from "./action/SlidePane";
|
|
17
17
|
import { DropDown } from "./action/DropDown";
|
|
18
|
-
import { ChartElement } from "./action/ChartPane";
|
|
19
18
|
import { CheckBox, CheckBoxGroup } from "./action/CheckBox";
|
|
20
19
|
import { ToggleButton } from "./action/ToggleButton";
|
|
21
20
|
import { ILayout } from "./base/Elements";
|
|
@@ -26,19 +25,5 @@ import { ScrollPane } from "./layers/ScrollPane";
|
|
|
26
25
|
import { TablePane, TablePagination } from "./layers/TablePane";
|
|
27
26
|
import { PopUpButton } from "./action/PopUpButton";
|
|
28
27
|
import { AvatarElement } from "./action/AvatarElement";
|
|
29
|
-
export { ColorPicker, ScrollPane, AlertPanel, App, CardElement,
|
|
30
|
-
// BodyElement,
|
|
31
|
-
// H1Element,
|
|
32
|
-
// H2Element,
|
|
33
|
-
// ButtonElement,
|
|
34
|
-
DropDown, PopUpButton,
|
|
35
|
-
// AnchorPane,
|
|
36
|
-
// Pane,
|
|
37
|
-
// SvgElement,
|
|
38
|
-
SlidePane, TabPane, TabItem, ListElement,
|
|
39
|
-
// ImageElement,
|
|
40
|
-
IconElement,
|
|
41
|
-
// InputElement,
|
|
42
|
-
// LabelElement,
|
|
43
|
-
FlowPane, VBoxElement, HBoxElement, GridElement, PaneElement, BorderPaneElement, StyleLink, ILayout, StackPane, };
|
|
28
|
+
export { ColorPicker, ScrollPane, AlertPanel, App, CardElement, CheckBox, CheckBoxGroup, ToggleButton, TablePane, TablePagination, AvatarElement, DropDown, PopUpButton, SlidePane, TabPane, TabItem, ListElement, IconElement, FlowPane, VBoxElement, HBoxElement, GridElement, PaneElement, BorderPaneElement, StyleLink, ILayout, StackPane, };
|
|
44
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/element/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/element/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,QAAQ,CAAC;AAEvB,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAkB,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EACL,WAAW,EAEX,UAAU,EACV,UAAU,EACV,GAAG,EACH,WAAW,EACX,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,SAAS,EACT,eAAe,EACf,aAAa,EACb,QAAQ,EACR,WAAW,EACX,SAAS,EACT,OAAO,EACP,OAAO,EACP,WAAW,EACX,WAAW,EACX,QAAQ,EACR,WAAW,EACX,WAAW,EACX,WAAW,EACX,WAAW,EACX,iBAAiB,EACjB,SAAS,EACT,OAAO,EACP,SAAS,GACV,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "typecomposer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.87",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/zico15"
|
|
@@ -32,9 +32,6 @@
|
|
|
32
32
|
"preferGlobal": true,
|
|
33
33
|
"author": "Ezequiel",
|
|
34
34
|
"license": "MIT",
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"chart.js": "^4.4.0"
|
|
37
|
-
},
|
|
38
35
|
"devDependencies": {
|
|
39
36
|
"@types/node": "^22.5.5",
|
|
40
37
|
"csstype": "^3.1.3",
|