overview-components 1.0.83 → 1.0.89
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/assets/generated/locales/de.js +72 -70
- package/dist/assets/generated/locales/en.js +72 -70
- package/dist/assets/generated/locales/fr.js +72 -70
- package/dist/assets/generated/locales/hr.js +72 -70
- package/dist/assets/generated/locales/it.js +72 -70
- package/dist/assets/generated/locales/pl.js +72 -70
- package/dist/assets/generated/locales/ro.js +72 -70
- package/dist/assets/generated/locales/sk.js +72 -70
- package/dist/assets/generated/locales/sr.js +72 -70
- package/dist/components/lit-attachments-tab.js +267 -432
- package/dist/components/lit-badge.js +37 -40
- package/dist/components/lit-case-variables-tab.js +378 -497
- package/dist/components/lit-chart.js +375 -406
- package/dist/components/lit-data-grid-tanstack.js +1145 -1663
- package/dist/components/lit-filter-modal.js +194 -230
- package/dist/components/lit-multiselect-item.js +297 -477
- package/dist/components/lit-section-tab.js +69 -85
- package/dist/components/lit-tabs-overview.js +187 -232
- package/dist/components/react-wrappers/attachments-tab.js +13 -8
- package/dist/components/react-wrappers/badge.js +13 -8
- package/dist/components/react-wrappers/button.js +13 -8
- package/dist/components/react-wrappers/case-variables-tab.js +13 -8
- package/dist/components/react-wrappers/chart.js +13 -8
- package/dist/components/react-wrappers/data-grid-tanstack.js +13 -8
- package/dist/components/react-wrappers/filter-modal.js +13 -8
- package/dist/components/react-wrappers/progress-bar.js +13 -8
- package/dist/components/react-wrappers/section-tab.js +13 -8
- package/dist/components/react-wrappers/tabs-overview.js +13 -8
- package/dist/index.d.ts +1 -64
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -4819
- package/dist/node_modules/@lit/reactive-element/css-tag.js +42 -0
- package/dist/node_modules/@lit/reactive-element/decorators/base.js +9 -0
- package/dist/node_modules/@lit/reactive-element/decorators/custom-element.js +13 -0
- package/dist/node_modules/@lit/reactive-element/decorators/property.js +37 -0
- package/dist/node_modules/@lit/reactive-element/decorators/query.js +20 -0
- package/dist/node_modules/@lit/reactive-element/decorators/state.js +12 -0
- package/dist/node_modules/@lit/reactive-element/reactive-element.js +249 -0
- package/dist/node_modules/lit-html/async-directive.js +69 -0
- package/dist/node_modules/lit-html/directive-helpers.js +45 -0
- package/dist/node_modules/lit-html/directive.js +27 -0
- package/dist/node_modules/lit-html/directives/ref.js +42 -0
- package/dist/node_modules/lit-html/directives/repeat.js +61 -0
- package/dist/node_modules/lit-html/directives/style-map.js +36 -0
- package/dist/node_modules/lit-html/directives/unsafe-html.js +27 -0
- package/dist/node_modules/lit-html/lit-html.js +242 -0
- package/dist/shared/lit-button.js +63 -80
- package/dist/shared/lit-icon-button.d.ts +1 -1
- package/dist/shared/lit-icon-button.d.ts.map +1 -1
- package/dist/shared/lit-loader.d.ts +1 -1
- package/dist/shared/lit-loader.d.ts.map +1 -1
- package/dist/shared/lit-loading-bar.d.ts +1 -1
- package/dist/shared/lit-loading-bar.d.ts.map +1 -1
- package/dist/shared/lit-menu-item.d.ts +1 -1
- package/dist/shared/lit-menu-item.d.ts.map +1 -1
- package/dist/shared/lit-progress-bar.js +32 -33
- package/dist/shared/lit-text-field.d.ts +1 -1
- package/dist/shared/lit-text-field.d.ts.map +1 -1
- package/dist/shared/simple-tooltip.js +122 -198
- package/dist/shared/styles/button-shared-styles.js +5 -4
- package/dist/utils/currency.js +12 -15
- package/dist/utils/custom-filters.js +45 -80
- package/dist/utils/date.js +13 -21
- package/dist/utils/getOperatorByType.js +50 -65
- package/dist/utils/localization.js +29 -431
- package/package.json +74 -87
- package/dist/assets/generated/locales/de.js.map +0 -1
- package/dist/assets/generated/locales/en.js.map +0 -1
- package/dist/assets/generated/locales/fr.js.map +0 -1
- package/dist/assets/generated/locales/hr.js.map +0 -1
- package/dist/assets/generated/locales/it.js.map +0 -1
- package/dist/assets/generated/locales/pl.js.map +0 -1
- package/dist/assets/generated/locales/ro.js.map +0 -1
- package/dist/assets/generated/locales/sk.js.map +0 -1
- package/dist/assets/generated/locales/sr.js.map +0 -1
- package/dist/assets/icons/iconGlyphs.js +0 -679
- package/dist/assets/icons/iconGlyphs.js.map +0 -1
- package/dist/assets/illustration/delete-illustration.js +0 -96
- package/dist/assets/illustration/delete-illustration.js.map +0 -1
- package/dist/assets/illustration/no-content.js +0 -167
- package/dist/assets/illustration/no-content.js.map +0 -1
- package/dist/assets/illustration/no-preview.js +0 -133
- package/dist/assets/illustration/no-preview.js.map +0 -1
- package/dist/assets/illustration/not-found.js +0 -106
- package/dist/assets/illustration/not-found.js.map +0 -1
- package/dist/assets/illustration/settings-illustration.js +0 -176
- package/dist/assets/illustration/settings-illustration.js.map +0 -1
- package/dist/components/components-settings/attachments-tab-settings.js +0 -226
- package/dist/components/components-settings/attachments-tab-settings.js.map +0 -1
- package/dist/components/components-settings/data-grid-settings.js +0 -318
- package/dist/components/components-settings/data-grid-settings.js.map +0 -1
- package/dist/components/components-settings/section-tab-settings.js +0 -269
- package/dist/components/components-settings/section-tab-settings.js.map +0 -1
- package/dist/components/components-settings/tabs-overview-settings.js +0 -439
- package/dist/components/components-settings/tabs-overview-settings.js.map +0 -1
- package/dist/components/lit-attachments-tab.js.map +0 -1
- package/dist/components/lit-badge.js.map +0 -1
- package/dist/components/lit-case-variables-tab.js.map +0 -1
- package/dist/components/lit-chart.js.map +0 -1
- package/dist/components/lit-data-grid-tanstack.js.map +0 -1
- package/dist/components/lit-filter-modal.js.map +0 -1
- package/dist/components/lit-multiselect-item.js.map +0 -1
- package/dist/components/lit-section-tab.js.map +0 -1
- package/dist/components/lit-tabs-overview.js.map +0 -1
- package/dist/components/modals/lit-confirm-modal.js +0 -120
- package/dist/components/modals/lit-confirm-modal.js.map +0 -1
- package/dist/components/modals/lit-delete-modal.js +0 -128
- package/dist/components/modals/lit-delete-modal.js.map +0 -1
- package/dist/components/react-wrappers/attachments-tab.js.map +0 -1
- package/dist/components/react-wrappers/badge.js.map +0 -1
- package/dist/components/react-wrappers/button.js.map +0 -1
- package/dist/components/react-wrappers/case-variables-tab.js.map +0 -1
- package/dist/components/react-wrappers/chart.js.map +0 -1
- package/dist/components/react-wrappers/data-grid-tanstack.js.map +0 -1
- package/dist/components/react-wrappers/filter-modal.js.map +0 -1
- package/dist/components/react-wrappers/progress-bar.js.map +0 -1
- package/dist/components/react-wrappers/section-tab.js.map +0 -1
- package/dist/components/react-wrappers/tabs-overview.js.map +0 -1
- package/dist/data/translations.js +0 -2763
- package/dist/data/translations.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/schemas/index.js +0 -17
- package/dist/schemas/index.js.map +0 -1
- package/dist/schemas/lit-attachments-tab-document.schema.js +0 -20
- package/dist/schemas/lit-attachments-tab-document.schema.js.map +0 -1
- package/dist/schemas/lit-attachments-tab-settings-value.schema.js +0 -15
- package/dist/schemas/lit-attachments-tab-settings-value.schema.js.map +0 -1
- package/dist/schemas/lit-attachments-tab.schema.js +0 -32
- package/dist/schemas/lit-attachments-tab.schema.js.map +0 -1
- package/dist/schemas/lit-case-variables-tab-cell.schema.js +0 -43
- package/dist/schemas/lit-case-variables-tab-cell.schema.js.map +0 -1
- package/dist/schemas/lit-case-variables-tab-rows.schema.js +0 -6
- package/dist/schemas/lit-case-variables-tab-rows.schema.js.map +0 -1
- package/dist/schemas/lit-case-variables-tab.schema.js +0 -24
- package/dist/schemas/lit-case-variables-tab.schema.js.map +0 -1
- package/dist/schemas/lit-data-grid-tanstack-column-array.schema.js +0 -6
- package/dist/schemas/lit-data-grid-tanstack-column-array.schema.js.map +0 -1
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter-array.schema.js +0 -6
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter-array.schema.js.map +0 -1
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter.schema.js +0 -11
- package/dist/schemas/lit-data-grid-tanstack-column-custom-filter.schema.js.map +0 -1
- package/dist/schemas/lit-data-grid-tanstack-column.schema.js +0 -55
- package/dist/schemas/lit-data-grid-tanstack-column.schema.js.map +0 -1
- package/dist/schemas/lit-data-grid-tanstack.schema.js +0 -99
- package/dist/schemas/lit-data-grid-tanstack.schema.js.map +0 -1
- package/dist/schemas/lit-section-tab-schema.js +0 -24
- package/dist/schemas/lit-section-tab-schema.js.map +0 -1
- package/dist/schemas/lit-tabs-overview-tab-array.schema.js +0 -6
- package/dist/schemas/lit-tabs-overview-tab-array.schema.js.map +0 -1
- package/dist/schemas/lit-tabs-overview-tab.schema.js +0 -32
- package/dist/schemas/lit-tabs-overview-tab.schema.js.map +0 -1
- package/dist/schemas/lit-tabs-overview.schema.js +0 -29
- package/dist/schemas/lit-tabs-overview.schema.js.map +0 -1
- package/dist/scripts/translate-locales.js +0 -69
- package/dist/scripts/translate-locales.js.map +0 -1
- package/dist/shared/filter-inputs.js +0 -427
- package/dist/shared/filter-inputs.js.map +0 -1
- package/dist/shared/lit-button.js.map +0 -1
- package/dist/shared/lit-case-variables-tab-cell.js +0 -226
- package/dist/shared/lit-case-variables-tab-cell.js.map +0 -1
- package/dist/shared/lit-checkbox.js +0 -171
- package/dist/shared/lit-checkbox.js.map +0 -1
- package/dist/shared/lit-custom-popper.js +0 -117
- package/dist/shared/lit-custom-popper.js.map +0 -1
- package/dist/shared/lit-data-grid-action-buttons-popover.js +0 -295
- package/dist/shared/lit-data-grid-action-buttons-popover.js.map +0 -1
- package/dist/shared/lit-data-grid-density-popover.js +0 -84
- package/dist/shared/lit-data-grid-density-popover.js.map +0 -1
- package/dist/shared/lit-data-grid-export-popover.js +0 -68
- package/dist/shared/lit-data-grid-export-popover.js.map +0 -1
- package/dist/shared/lit-data-grid-operators-popover.js +0 -114
- package/dist/shared/lit-data-grid-operators-popover.js.map +0 -1
- package/dist/shared/lit-data-grid-row-actions.js +0 -76
- package/dist/shared/lit-data-grid-row-actions.js.map +0 -1
- package/dist/shared/lit-date-picker.js +0 -606
- package/dist/shared/lit-date-picker.js.map +0 -1
- package/dist/shared/lit-icon-button.js +0 -105
- package/dist/shared/lit-icon-button.js.map +0 -1
- package/dist/shared/lit-icon.js +0 -284
- package/dist/shared/lit-icon.js.map +0 -1
- package/dist/shared/lit-input.js +0 -239
- package/dist/shared/lit-input.js.map +0 -1
- package/dist/shared/lit-label.js +0 -104
- package/dist/shared/lit-label.js.map +0 -1
- package/dist/shared/lit-loader.js +0 -69
- package/dist/shared/lit-loader.js.map +0 -1
- package/dist/shared/lit-loading-bar.js +0 -127
- package/dist/shared/lit-loading-bar.js.map +0 -1
- package/dist/shared/lit-menu-item.js +0 -99
- package/dist/shared/lit-menu-item.js.map +0 -1
- package/dist/shared/lit-menu.js +0 -42
- package/dist/shared/lit-menu.js.map +0 -1
- package/dist/shared/lit-modal-body.js +0 -22
- package/dist/shared/lit-modal-body.js.map +0 -1
- package/dist/shared/lit-modal-footer.js +0 -29
- package/dist/shared/lit-modal-footer.js.map +0 -1
- package/dist/shared/lit-modal-header.js +0 -36
- package/dist/shared/lit-modal-header.js.map +0 -1
- package/dist/shared/lit-modal.js +0 -169
- package/dist/shared/lit-modal.js.map +0 -1
- package/dist/shared/lit-overflow-tooltip.js +0 -103
- package/dist/shared/lit-overflow-tooltip.js.map +0 -1
- package/dist/shared/lit-pill.js +0 -88
- package/dist/shared/lit-pill.js.map +0 -1
- package/dist/shared/lit-progress-bar.js.map +0 -1
- package/dist/shared/lit-responsive-button.js +0 -94
- package/dist/shared/lit-responsive-button.js.map +0 -1
- package/dist/shared/lit-select-field.js +0 -459
- package/dist/shared/lit-select-field.js.map +0 -1
- package/dist/shared/lit-select.js +0 -413
- package/dist/shared/lit-select.js.map +0 -1
- package/dist/shared/lit-settings.js +0 -77
- package/dist/shared/lit-settings.js.map +0 -1
- package/dist/shared/lit-text-field.js +0 -222
- package/dist/shared/lit-text-field.js.map +0 -1
- package/dist/shared/lit-toggle.js +0 -222
- package/dist/shared/lit-toggle.js.map +0 -1
- package/dist/shared/lit-tooltip.js +0 -166
- package/dist/shared/lit-tooltip.js.map +0 -1
- package/dist/shared/simple-popper.js +0 -266
- package/dist/shared/simple-popper.js.map +0 -1
- package/dist/shared/simple-tooltip.js.map +0 -1
- package/dist/shared/styles/button-shared-styles.js.map +0 -1
- package/dist/style.css +0 -1
- package/dist/styles.js +0 -169
- package/dist/styles.js.map +0 -1
- package/dist/utils/currency.js.map +0 -1
- package/dist/utils/custom-filters.js.map +0 -1
- package/dist/utils/date.js.map +0 -1
- package/dist/utils/getOperatorByType.js.map +0 -1
- package/dist/utils/getOverviewValue.js +0 -177
- package/dist/utils/getOverviewValue.js.map +0 -1
- package/dist/utils/localization.js.map +0 -1
- package/dist/utils/utils.js +0 -13
- package/dist/utils/utils.js.map +0 -1
- package/dist/utils/validate-json-schema.js +0 -8
- package/dist/utils/validate-json-schema.js.map +0 -1
- package/dist/validators/validator.js +0 -7
- package/dist/validators/validator.js.map +0 -1
|
@@ -1,423 +1,392 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { customElement as w } from "../node_modules/@lit/reactive-element/decorators/custom-element.js";
|
|
2
|
+
import { property as b } from "../node_modules/@lit/reactive-element/decorators/property.js";
|
|
3
|
+
import { LitElement as v, html as y, css as x } from "lit";
|
|
4
|
+
import { Chart as p, registerables as D } from "chart.js";
|
|
5
|
+
var k = Object.defineProperty, S = Object.getOwnPropertyDescriptor, u = (a, r, n, e) => {
|
|
6
|
+
for (var t = e > 1 ? void 0 : e ? S(r, n) : r, s = a.length - 1, o; s >= 0; s--)
|
|
7
|
+
(o = a[s]) && (t = (e ? o(r, n, t) : o(t)) || t);
|
|
8
|
+
return e && t && k(r, n, t), t;
|
|
6
9
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
10
|
+
p.register(...D);
|
|
11
|
+
let c = class extends v {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.type = "bar", this.data = { labels: [], datasets: [], title: "" }, this.isLoading = !1, this.chart = null;
|
|
14
|
+
}
|
|
15
|
+
updated(a) {
|
|
16
|
+
(a.has("type") || a.has("data")) && this.renderChart();
|
|
17
|
+
}
|
|
18
|
+
generateColors(a) {
|
|
19
|
+
return Array.from(
|
|
20
|
+
{ length: a },
|
|
21
|
+
() => `rgba(${Math.floor(Math.random() * 255)}, ${Math.floor(Math.random() * 255)}, ${Math.floor(Math.random() * 255)}, 0.6)`
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
renderChart() {
|
|
25
|
+
var r;
|
|
26
|
+
const a = (r = this.shadowRoot) == null ? void 0 : r.querySelector("canvas");
|
|
27
|
+
a && (this.type === "bar" || this.type === "line" ? this.renderBarAndLineChart(a) : this.type === "bubble" ? this.renderBubbleChart(a) : this.type === "pie" || this.type === "doughnut" ? this.renderPieAndDoughnutChart(a) : this.type === "gantt" && this.renderGanttChart(a));
|
|
28
|
+
}
|
|
29
|
+
renderGanttChart(a) {
|
|
30
|
+
var f;
|
|
31
|
+
this.chart && this.chart.destroy();
|
|
32
|
+
const r = this.generateColors(((f = this.data.datasets[0]) == null ? void 0 : f.data.length) || 0), n = this.data.datasets.map((l, i) => ({
|
|
33
|
+
label: l.label || `Dataset ${i + 1}`,
|
|
34
|
+
data: l.data.map((d) => {
|
|
35
|
+
const h = new Date(d.x[0]), m = new Date(d.x[1]);
|
|
36
|
+
return {
|
|
37
|
+
x: [
|
|
38
|
+
isNaN(h.getTime()) ? Date.now() : h.getTime(),
|
|
39
|
+
isNaN(m.getTime()) ? Date.now() : m.getTime()
|
|
40
|
+
],
|
|
41
|
+
y: d.y
|
|
42
|
+
};
|
|
43
|
+
}),
|
|
44
|
+
backgroundColor: r,
|
|
45
|
+
borderColor: r,
|
|
46
|
+
borderWidth: 1,
|
|
47
|
+
barThickness: 16,
|
|
48
|
+
borderRadius: 4,
|
|
49
|
+
borderSkipped: !1
|
|
50
|
+
})), e = this.data.datasets.flatMap(
|
|
51
|
+
(l) => l.data.flatMap((i) => {
|
|
52
|
+
var d, h;
|
|
53
|
+
return [
|
|
54
|
+
new Date((d = i == null ? void 0 : i.x) == null ? void 0 : d[0]).getTime(),
|
|
55
|
+
new Date((h = i == null ? void 0 : i.x) == null ? void 0 : h[1]).getTime()
|
|
56
|
+
];
|
|
57
|
+
})
|
|
58
|
+
), t = Math.min(...e), s = Math.max(...e), C = (s - t) / 20;
|
|
59
|
+
this.chart = new p(a, {
|
|
60
|
+
type: "bar",
|
|
61
|
+
data: {
|
|
62
|
+
datasets: n
|
|
63
|
+
},
|
|
64
|
+
options: {
|
|
65
|
+
indexAxis: "y",
|
|
66
|
+
responsive: !0,
|
|
67
|
+
maintainAspectRatio: !1,
|
|
68
|
+
scales: {
|
|
69
|
+
x: {
|
|
70
|
+
type: "linear",
|
|
71
|
+
ticks: {
|
|
72
|
+
stepSize: C,
|
|
73
|
+
// 30 dní v milisekundách
|
|
74
|
+
autoSkip: !1,
|
|
75
|
+
callback: (l) => new Date(l).toLocaleDateString("sk-SK", {
|
|
76
|
+
day: "2-digit",
|
|
77
|
+
month: "2-digit",
|
|
78
|
+
year: "numeric"
|
|
79
|
+
})
|
|
80
|
+
},
|
|
81
|
+
min: t,
|
|
82
|
+
max: s
|
|
83
|
+
},
|
|
84
|
+
y: {
|
|
85
|
+
type: "category"
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
plugins: {
|
|
89
|
+
tooltip: {
|
|
90
|
+
callbacks: {
|
|
91
|
+
label: function(l) {
|
|
92
|
+
const i = new Date(l.raw.x[0]).toLocaleDateString(
|
|
93
|
+
"sk-SK",
|
|
94
|
+
{
|
|
95
|
+
day: "2-digit",
|
|
96
|
+
month: "2-digit",
|
|
97
|
+
year: "numeric"
|
|
98
|
+
}
|
|
99
|
+
), d = new Date(l.raw.x[1]).toLocaleDateString("sk-SK", {
|
|
100
|
+
day: "2-digit",
|
|
101
|
+
month: "2-digit",
|
|
102
|
+
year: "numeric"
|
|
103
|
+
});
|
|
104
|
+
return ` Začiatok: ${i}, Koniec: ${d}`;
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
bodyFont: {
|
|
108
|
+
size: 13,
|
|
109
|
+
weight: 400
|
|
110
|
+
},
|
|
111
|
+
displayColors: !0,
|
|
112
|
+
usePointStyle: !0,
|
|
113
|
+
backgroundColor: "black",
|
|
114
|
+
cornerRadius: 8
|
|
115
|
+
},
|
|
116
|
+
legend: {
|
|
117
|
+
display: !1
|
|
118
|
+
},
|
|
119
|
+
title: {
|
|
120
|
+
display: !0,
|
|
121
|
+
text: this.data.title,
|
|
122
|
+
// Text, ktorý sa zobrazí nad grafom
|
|
123
|
+
font: {
|
|
124
|
+
size: 17,
|
|
125
|
+
weight: 500
|
|
126
|
+
},
|
|
127
|
+
color: "var(--text-primary, #111827)",
|
|
128
|
+
padding: {
|
|
129
|
+
top: 10,
|
|
130
|
+
bottom: 20
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
onHover: (l, i) => {
|
|
135
|
+
var h;
|
|
136
|
+
const d = (h = l.native) == null ? void 0 : h.target;
|
|
137
|
+
d.style.cursor = i.length ? "pointer" : "default";
|
|
43
138
|
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
datasets: datasetsWithColors,
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
renderPieAndDoughnutChart(a) {
|
|
143
|
+
var e;
|
|
144
|
+
this.chart && this.chart.destroy();
|
|
145
|
+
const r = this.generateColors(((e = this.data.datasets[0]) == null ? void 0 : e.data.length) || 0), n = this.data.datasets.map((t) => ({
|
|
146
|
+
...t,
|
|
147
|
+
backgroundColor: r,
|
|
148
|
+
borderColor: r,
|
|
149
|
+
borderWidth: 2,
|
|
150
|
+
pointBorderWidth: 2
|
|
151
|
+
}));
|
|
152
|
+
this.chart = new p(a, {
|
|
153
|
+
type: this.type,
|
|
154
|
+
data: {
|
|
155
|
+
labels: this.data.labels,
|
|
156
|
+
datasets: n
|
|
157
|
+
},
|
|
158
|
+
options: {
|
|
159
|
+
responsive: !0,
|
|
160
|
+
maintainAspectRatio: !1,
|
|
161
|
+
plugins: {
|
|
162
|
+
legend: {
|
|
163
|
+
position: "top",
|
|
164
|
+
labels: {
|
|
165
|
+
usePointStyle: !0,
|
|
166
|
+
pointStyle: "circle",
|
|
167
|
+
font: {
|
|
168
|
+
size: 13,
|
|
169
|
+
weight: 500
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
tooltip: {
|
|
174
|
+
callbacks: {
|
|
175
|
+
title: () => "",
|
|
176
|
+
label: (t) => (t.raw, ` ${t.label}: ${t.raw}`)
|
|
83
177
|
},
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
maintainAspectRatio: false,
|
|
88
|
-
scales: {
|
|
89
|
-
x: {
|
|
90
|
-
type: 'linear',
|
|
91
|
-
ticks: {
|
|
92
|
-
stepSize: stepSize, // 30 dní v milisekundách
|
|
93
|
-
autoSkip: false,
|
|
94
|
-
callback: (value) => {
|
|
95
|
-
return new Date(value).toLocaleDateString('sk-SK', {
|
|
96
|
-
day: '2-digit',
|
|
97
|
-
month: '2-digit',
|
|
98
|
-
year: 'numeric',
|
|
99
|
-
});
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
min: minDate,
|
|
103
|
-
max: maxDate,
|
|
104
|
-
},
|
|
105
|
-
y: {
|
|
106
|
-
type: 'category',
|
|
107
|
-
},
|
|
108
|
-
},
|
|
109
|
-
plugins: {
|
|
110
|
-
tooltip: {
|
|
111
|
-
callbacks: {
|
|
112
|
-
label: function (context) {
|
|
113
|
-
const start = new Date(context.raw.x[0]).toLocaleDateString('sk-SK', {
|
|
114
|
-
day: '2-digit',
|
|
115
|
-
month: '2-digit',
|
|
116
|
-
year: 'numeric',
|
|
117
|
-
});
|
|
118
|
-
const end = new Date(context.raw.x[1]).toLocaleDateString('sk-SK', {
|
|
119
|
-
day: '2-digit',
|
|
120
|
-
month: '2-digit',
|
|
121
|
-
year: 'numeric',
|
|
122
|
-
});
|
|
123
|
-
return `\u00A0\u00A0Začiatok: ${start}, Koniec: ${end}`;
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
bodyFont: {
|
|
127
|
-
size: 13,
|
|
128
|
-
weight: 400,
|
|
129
|
-
},
|
|
130
|
-
displayColors: true,
|
|
131
|
-
usePointStyle: true,
|
|
132
|
-
backgroundColor: 'black',
|
|
133
|
-
cornerRadius: 8,
|
|
134
|
-
},
|
|
135
|
-
legend: {
|
|
136
|
-
display: false,
|
|
137
|
-
},
|
|
138
|
-
title: {
|
|
139
|
-
display: true,
|
|
140
|
-
text: this.data.title, // Text, ktorý sa zobrazí nad grafom
|
|
141
|
-
font: {
|
|
142
|
-
size: 17,
|
|
143
|
-
weight: 500,
|
|
144
|
-
},
|
|
145
|
-
color: 'var(--text-primary, #111827)',
|
|
146
|
-
padding: {
|
|
147
|
-
top: 10,
|
|
148
|
-
bottom: 20,
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
onHover: (event, chartElement) => {
|
|
153
|
-
const target = event.native?.target;
|
|
154
|
-
target.style.cursor = chartElement.length ? 'pointer' : 'default';
|
|
155
|
-
},
|
|
178
|
+
bodyFont: {
|
|
179
|
+
size: 13,
|
|
180
|
+
weight: 400
|
|
156
181
|
},
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
labels: this.data.labels,
|
|
174
|
-
datasets: datasetsWithColors,
|
|
182
|
+
displayColors: !0,
|
|
183
|
+
usePointStyle: !0,
|
|
184
|
+
// Použitie kruhového symbolu
|
|
185
|
+
xAlign: "center",
|
|
186
|
+
yAlign: "bottom",
|
|
187
|
+
padding: 16,
|
|
188
|
+
backgroundColor: "black",
|
|
189
|
+
cornerRadius: 8
|
|
190
|
+
},
|
|
191
|
+
title: {
|
|
192
|
+
display: !0,
|
|
193
|
+
text: this.data.title,
|
|
194
|
+
// Text, ktorý sa zobrazí nad grafom
|
|
195
|
+
font: {
|
|
196
|
+
size: 17,
|
|
197
|
+
weight: 500
|
|
175
198
|
},
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
}
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
else {
|
|
234
|
-
target.style.cursor = 'default';
|
|
235
|
-
}
|
|
236
|
-
},
|
|
199
|
+
color: "var(--text-primary, #111827)",
|
|
200
|
+
padding: {
|
|
201
|
+
top: 10,
|
|
202
|
+
bottom: 20
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
...this.type === "doughnut" && {
|
|
207
|
+
cutout: "70%"
|
|
208
|
+
},
|
|
209
|
+
onHover: (t, s) => {
|
|
210
|
+
var g;
|
|
211
|
+
const o = (g = t.native) == null ? void 0 : g.target;
|
|
212
|
+
s.length ? o.style.cursor = "pointer" : o.style.cursor = "default";
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
renderBubbleChart(a) {
|
|
218
|
+
this.chart && this.chart.destroy();
|
|
219
|
+
const r = this.generateColors(this.data.datasets.length), n = this.data.datasets.map((e, t) => ({
|
|
220
|
+
...e,
|
|
221
|
+
backgroundColor: r[t],
|
|
222
|
+
borderColor: r[t],
|
|
223
|
+
borderWidth: 1,
|
|
224
|
+
hoverRadius: 10,
|
|
225
|
+
pointBorderWidth: 2
|
|
226
|
+
}));
|
|
227
|
+
this.chart = new p(a, {
|
|
228
|
+
type: "bubble",
|
|
229
|
+
data: { datasets: n },
|
|
230
|
+
options: {
|
|
231
|
+
responsive: !0,
|
|
232
|
+
scales: {
|
|
233
|
+
x: { beginAtZero: !0 },
|
|
234
|
+
y: { beginAtZero: !0 }
|
|
235
|
+
},
|
|
236
|
+
plugins: {
|
|
237
|
+
legend: {
|
|
238
|
+
position: "top",
|
|
239
|
+
labels: {
|
|
240
|
+
usePointStyle: !0,
|
|
241
|
+
// Použitie kruhového symbolu
|
|
242
|
+
pointStyle: "circle"
|
|
243
|
+
// Špecifický tvar pre symbol v legende
|
|
244
|
+
}
|
|
245
|
+
},
|
|
246
|
+
tooltip: {
|
|
247
|
+
callbacks: {
|
|
248
|
+
label: (e) => {
|
|
249
|
+
const t = e.raw;
|
|
250
|
+
return ` x: ${t.x}, y: ${t.y}, r: ${t.r}`;
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
bodyFont: {
|
|
254
|
+
size: 13,
|
|
255
|
+
weight: 400
|
|
237
256
|
},
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
target.style.cursor = 'default';
|
|
309
|
-
}
|
|
310
|
-
},
|
|
257
|
+
displayColors: !0,
|
|
258
|
+
usePointStyle: !0,
|
|
259
|
+
// Použitie kruhového symbolu
|
|
260
|
+
xAlign: "center",
|
|
261
|
+
yAlign: "bottom",
|
|
262
|
+
padding: 16,
|
|
263
|
+
backgroundColor: "black",
|
|
264
|
+
cornerRadius: 8
|
|
265
|
+
},
|
|
266
|
+
title: {
|
|
267
|
+
display: !0,
|
|
268
|
+
text: this.data.title,
|
|
269
|
+
// Text, ktorý sa zobrazí nad grafom
|
|
270
|
+
font: {
|
|
271
|
+
size: 17,
|
|
272
|
+
weight: 500
|
|
273
|
+
},
|
|
274
|
+
color: "var(--text-primary, #111827)",
|
|
275
|
+
padding: {
|
|
276
|
+
top: 10,
|
|
277
|
+
bottom: 20
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
},
|
|
281
|
+
onHover: (e, t) => {
|
|
282
|
+
var o;
|
|
283
|
+
const s = (o = e.native) == null ? void 0 : o.target;
|
|
284
|
+
t.length ? s.style.cursor = "pointer" : s.style.cursor = "default";
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
renderBarAndLineChart(a) {
|
|
290
|
+
this.chart && this.chart.destroy();
|
|
291
|
+
const r = this.generateColors(this.data.datasets.length), n = this.data.datasets.map((e, t) => ({
|
|
292
|
+
...e,
|
|
293
|
+
backgroundColor: r[t],
|
|
294
|
+
borderColor: r[t],
|
|
295
|
+
borderWidth: 2,
|
|
296
|
+
...this.type === "bar" ? { borderRadius: 4 } : {},
|
|
297
|
+
...this.type === "line" ? {
|
|
298
|
+
pointStyle: "circle",
|
|
299
|
+
pointRadius: 3,
|
|
300
|
+
pointBorderWidth: 2,
|
|
301
|
+
pointBorderColor: r[t]
|
|
302
|
+
} : {}
|
|
303
|
+
}));
|
|
304
|
+
this.chart = new p(a, {
|
|
305
|
+
type: this.type,
|
|
306
|
+
data: {
|
|
307
|
+
labels: this.data.labels,
|
|
308
|
+
datasets: n
|
|
309
|
+
},
|
|
310
|
+
options: {
|
|
311
|
+
responsive: !0,
|
|
312
|
+
maintainAspectRatio: !1,
|
|
313
|
+
plugins: {
|
|
314
|
+
legend: {
|
|
315
|
+
position: "top",
|
|
316
|
+
labels: {
|
|
317
|
+
usePointStyle: !0,
|
|
318
|
+
// Použitie kruhového symbolu
|
|
319
|
+
pointStyle: "circle"
|
|
320
|
+
// Špecifický tvar pre symbol v legende
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
tooltip: {
|
|
324
|
+
callbacks: {
|
|
325
|
+
title: () => "",
|
|
326
|
+
label: (e) => (e.raw, ` ${e.label}: ${e.raw}`)
|
|
311
327
|
},
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
if (this.chart)
|
|
316
|
-
this.chart.destroy();
|
|
317
|
-
const colors = this.generateColors(this.data.datasets.length);
|
|
318
|
-
const datasetsWithColors = this.data.datasets.map((dataset, index) => ({
|
|
319
|
-
...dataset,
|
|
320
|
-
backgroundColor: colors[index],
|
|
321
|
-
borderColor: colors[index],
|
|
322
|
-
borderWidth: 2,
|
|
323
|
-
...(this.type === 'bar' ? { borderRadius: 4 } : {}),
|
|
324
|
-
...(this.type === 'line'
|
|
325
|
-
? {
|
|
326
|
-
pointStyle: 'circle',
|
|
327
|
-
pointRadius: 3,
|
|
328
|
-
pointBorderWidth: 2,
|
|
329
|
-
pointBorderColor: colors[index],
|
|
330
|
-
}
|
|
331
|
-
: {}),
|
|
332
|
-
}));
|
|
333
|
-
this.chart = new Chart(canvas, {
|
|
334
|
-
type: this.type,
|
|
335
|
-
data: {
|
|
336
|
-
labels: this.data.labels,
|
|
337
|
-
datasets: datasetsWithColors,
|
|
328
|
+
bodyFont: {
|
|
329
|
+
size: 13,
|
|
330
|
+
weight: 400
|
|
338
331
|
},
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
return `\u00A0\u00A0${tooltipItem.label}: ${tooltipItem.raw}`;
|
|
356
|
-
},
|
|
357
|
-
},
|
|
358
|
-
bodyFont: {
|
|
359
|
-
size: 13,
|
|
360
|
-
weight: 400,
|
|
361
|
-
},
|
|
362
|
-
displayColors: true,
|
|
363
|
-
usePointStyle: true, // Použitie kruhového symbolu
|
|
364
|
-
xAlign: 'center',
|
|
365
|
-
yAlign: 'bottom',
|
|
366
|
-
padding: 16,
|
|
367
|
-
backgroundColor: 'black',
|
|
368
|
-
cornerRadius: 8,
|
|
369
|
-
},
|
|
370
|
-
title: {
|
|
371
|
-
display: true,
|
|
372
|
-
text: this.data.title, // Text, ktorý sa zobrazí nad grafom
|
|
373
|
-
font: {
|
|
374
|
-
size: 17,
|
|
375
|
-
weight: 500,
|
|
376
|
-
},
|
|
377
|
-
color: 'var(--text-primary, #111827)',
|
|
378
|
-
padding: {
|
|
379
|
-
top: 10,
|
|
380
|
-
bottom: 20,
|
|
381
|
-
},
|
|
382
|
-
},
|
|
383
|
-
},
|
|
384
|
-
onHover: (event, chartElement) => {
|
|
385
|
-
const target = event.native?.target;
|
|
386
|
-
if (chartElement.length) {
|
|
387
|
-
target.style.cursor = 'pointer'; // Zmena kurzora na ruku
|
|
388
|
-
}
|
|
389
|
-
else {
|
|
390
|
-
target.style.cursor = 'default';
|
|
391
|
-
}
|
|
392
|
-
},
|
|
332
|
+
displayColors: !0,
|
|
333
|
+
usePointStyle: !0,
|
|
334
|
+
// Použitie kruhového symbolu
|
|
335
|
+
xAlign: "center",
|
|
336
|
+
yAlign: "bottom",
|
|
337
|
+
padding: 16,
|
|
338
|
+
backgroundColor: "black",
|
|
339
|
+
cornerRadius: 8
|
|
340
|
+
},
|
|
341
|
+
title: {
|
|
342
|
+
display: !0,
|
|
343
|
+
text: this.data.title,
|
|
344
|
+
// Text, ktorý sa zobrazí nad grafom
|
|
345
|
+
font: {
|
|
346
|
+
size: 17,
|
|
347
|
+
weight: 500
|
|
393
348
|
},
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
349
|
+
color: "var(--text-primary, #111827)",
|
|
350
|
+
padding: {
|
|
351
|
+
top: 10,
|
|
352
|
+
bottom: 20
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
},
|
|
356
|
+
onHover: (e, t) => {
|
|
357
|
+
var o;
|
|
358
|
+
const s = (o = e.native) == null ? void 0 : o.target;
|
|
359
|
+
t.length ? s.style.cursor = "pointer" : s.style.cursor = "default";
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
render() {
|
|
365
|
+
return y`${this.isLoading ? y`<lit-loader></lit-loader>` : y`<canvas></canvas>`}`;
|
|
366
|
+
}
|
|
399
367
|
};
|
|
400
|
-
|
|
401
|
-
|
|
368
|
+
c.styles = [
|
|
369
|
+
x`
|
|
402
370
|
canvas {
|
|
403
371
|
width: 100%;
|
|
404
372
|
height: 100%;
|
|
405
373
|
font-family: 'Inter', sans-serif;
|
|
406
374
|
margin: 0 auto;
|
|
407
375
|
}
|
|
408
|
-
|
|
376
|
+
`
|
|
409
377
|
];
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
],
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
],
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
],
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
],
|
|
422
|
-
export {
|
|
423
|
-
|
|
378
|
+
u([
|
|
379
|
+
b({ type: String })
|
|
380
|
+
], c.prototype, "type", 2);
|
|
381
|
+
u([
|
|
382
|
+
b({ type: Array })
|
|
383
|
+
], c.prototype, "data", 2);
|
|
384
|
+
u([
|
|
385
|
+
b({ type: Boolean })
|
|
386
|
+
], c.prototype, "isLoading", 2);
|
|
387
|
+
c = u([
|
|
388
|
+
w("lit-chart")
|
|
389
|
+
], c);
|
|
390
|
+
export {
|
|
391
|
+
c as LitChart
|
|
392
|
+
};
|