@voidable/ui 0.5.5 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{decorate-DKuCkHK4.js → decorate-CaYbmmmm.js} +1 -1
- package/dist/chunks/scale-_ccSuoYg.js +33 -0
- package/dist/chunks/shape-FJvZa8FW.js +52 -0
- package/dist/components/accordion.js +1 -1
- package/dist/components/action-input.js +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/avatar.js +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/banner.js +1 -1
- package/dist/components/bar-chart.d.ts +47 -0
- package/dist/components/bar-chart.d.ts.map +1 -0
- package/dist/components/bar-chart.js +151 -0
- package/dist/components/breadcrumbs.js +1 -1
- package/dist/components/button.js +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/carousel.js +1 -1
- package/dist/components/charts/scale.d.ts +22 -0
- package/dist/components/charts/scale.d.ts.map +1 -0
- package/dist/components/charts/shape.d.ts +13 -0
- package/dist/components/charts/shape.d.ts.map +1 -0
- package/dist/components/checkbox-group.js +1 -1
- package/dist/components/checkbox.js +1 -1
- package/dist/components/collapsible.js +1 -1
- package/dist/components/color-picker.js +1 -1
- package/dist/components/combobox.js +1 -1
- package/dist/components/compose-input.js +1 -1
- package/dist/components/dialog.js +1 -1
- package/dist/components/divider.js +1 -1
- package/dist/components/donut-chart.d.ts +57 -0
- package/dist/components/donut-chart.d.ts.map +1 -0
- package/dist/components/donut-chart.js +187 -0
- package/dist/components/drawer.js +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/editable.js +1 -1
- package/dist/components/error-fallback.js +1 -1
- package/dist/components/field.js +1 -1
- package/dist/components/file-upload.js +1 -1
- package/dist/components/gauge.d.ts +102 -0
- package/dist/components/gauge.d.ts.map +1 -0
- package/dist/components/gauge.js +398 -0
- package/dist/components/hamburger.js +1 -1
- package/dist/components/hover-card.js +1 -1
- package/dist/components/indicator.js +1 -1
- package/dist/components/input.js +1 -1
- package/dist/components/line-chart.d.ts +47 -0
- package/dist/components/line-chart.d.ts.map +1 -0
- package/dist/components/line-chart.js +216 -0
- package/dist/components/list.js +1 -1
- package/dist/components/menu.js +1 -1
- package/dist/components/multiselect.js +1 -1
- package/dist/components/nav-bar.js +1 -1
- package/dist/components/nav-menu.js +1 -1
- package/dist/components/number-input.d.ts +2 -0
- package/dist/components/number-input.d.ts.map +1 -1
- package/dist/components/number-input.js +15 -13
- package/dist/components/pagination.js +1 -1
- package/dist/components/panel.js +1 -1
- package/dist/components/pin-input.js +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/progress.js +1 -1
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio.js +1 -1
- package/dist/components/scroll-area.js +1 -1
- package/dist/components/segmented-control.js +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/sidebar.js +1 -1
- package/dist/components/skeleton.js +1 -1
- package/dist/components/slider.js +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/stat.js +1 -1
- package/dist/components/status-dot.js +1 -1
- package/dist/components/stepper.js +1 -1
- package/dist/components/switch.js +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.js +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/tags-input.js +1 -1
- package/dist/components/textarea.js +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toggle-group.js +1 -1
- package/dist/components/toggle.js +1 -1
- package/dist/components/tooltip.js +1 -1
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/package.json +1 -5
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { t as e } from "../chunks/decorate-CaYbmmmm.js";
|
|
2
|
+
import { t } from "../chunks/shape-FJvZa8FW.js";
|
|
3
|
+
import { LitElement as n, html as r, nothing as i, svg as a } from "lit";
|
|
4
|
+
import { property as o, state as s } from "lit/decorators.js";
|
|
5
|
+
//#region src/components/donut-chart.ts
|
|
6
|
+
function c(e) {
|
|
7
|
+
return 1 - (1 - e) ** 3;
|
|
8
|
+
}
|
|
9
|
+
function l(e) {
|
|
10
|
+
return Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(e >= 1e4 ? 0 : 1)}k` : Math.round(e).toString();
|
|
11
|
+
}
|
|
12
|
+
function u(e) {
|
|
13
|
+
return Math.abs(e) >= 1e3 ? `${(e / 1e3).toFixed(e >= 1e4 ? 0 : 1)}k` : Math.round(e).toString();
|
|
14
|
+
}
|
|
15
|
+
var d = class extends n {
|
|
16
|
+
constructor(...e) {
|
|
17
|
+
super(...e), this.size = 220, this.inner = .6, this.gaps = !1, this.variant = "filled", this.showValues = !1, this.showTotal = !1, this.ariaLabel = "", this._data = { segments: [] }, this._phase = "pre", this._hoverSegment = null, this._hoverX = 0, this._hoverY = 0, this._progress = 0, this._progressFrom = 0, this._displayValues = /* @__PURE__ */ new Map(), this._targetValues = /* @__PURE__ */ new Map(), this._animFrom = /* @__PURE__ */ new Map(), this._displayTotal = 0, this._displayTotalFrom = 0, this._targetTotal = 0, this._animStart = 0, this._animDuration = 0, this._rafHandle = 0, this._onMouseMove = (e) => {
|
|
18
|
+
let t = this.querySelector("svg");
|
|
19
|
+
if (!t) return;
|
|
20
|
+
let n = this._data.segments;
|
|
21
|
+
if (n.length === 0 || this._displayTotal <= 0) return;
|
|
22
|
+
let r = t.getBoundingClientRect();
|
|
23
|
+
if (r.width === 0) return;
|
|
24
|
+
let i = (e.clientX - r.left) / r.width * this.size, a = (e.clientY - r.top) / r.height * this.size, o = this.size / 2, s = this.size / 2, c = i - o, l = a - s, u = Math.sqrt(c * c + l * l), d = this.size / 2 - 4;
|
|
25
|
+
if (u < d * this.inner || u > d) {
|
|
26
|
+
this._hoverSegment !== null && (this._hoverSegment = null);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
let f = Math.atan2(l, c) - -Math.PI / 2;
|
|
30
|
+
f < 0 && (f += 2 * Math.PI);
|
|
31
|
+
let p = 2 * Math.PI, m = 0;
|
|
32
|
+
for (let e = 0; e < n.length; e++) {
|
|
33
|
+
let t = n[e].value / this._targetTotal * p;
|
|
34
|
+
if (f >= m && f < m + t) {
|
|
35
|
+
this._hoverSegment !== e && (this._hoverSegment = e), this._hoverX = i, this._hoverY = a;
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
m += t;
|
|
39
|
+
}
|
|
40
|
+
this._hoverSegment !== null && (this._hoverSegment = null);
|
|
41
|
+
}, this._onMouseLeave = () => {
|
|
42
|
+
this._hoverSegment = null;
|
|
43
|
+
}, this._tick = (e) => {
|
|
44
|
+
let t = e - this._animStart, n = Math.min(t / this._animDuration, 1), r = c(n);
|
|
45
|
+
this._progress = this._progressFrom + (1 - this._progressFrom) * r;
|
|
46
|
+
for (let [e, t] of this._targetValues) {
|
|
47
|
+
let n = this._animFrom.get(e) ?? 0;
|
|
48
|
+
this._displayValues.set(e, n + (t - n) * r);
|
|
49
|
+
}
|
|
50
|
+
this._displayTotal = this._displayTotalFrom + (this._targetTotal - this._displayTotalFrom) * r, this.requestUpdate(), n < 1 ? this._rafHandle = requestAnimationFrame(this._tick) : this._phase = "idle";
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
createRenderRoot() {
|
|
54
|
+
return this;
|
|
55
|
+
}
|
|
56
|
+
get data() {
|
|
57
|
+
return this._data;
|
|
58
|
+
}
|
|
59
|
+
set data(e) {
|
|
60
|
+
let t = this._data.segments, n = this._progress, r = new Map(this._displayValues), i = this._displayTotal;
|
|
61
|
+
this._data = e, this._refreshTargets(), this.requestUpdate(), this.updateComplete.then(() => {
|
|
62
|
+
let a = /* @__PURE__ */ new Map();
|
|
63
|
+
for (let e = 0; e < t.length; e++) a.set(e, r.get(e) ?? 0);
|
|
64
|
+
for (let t = 0; t < e.segments.length; t++) a.has(t) || a.set(t, 0);
|
|
65
|
+
this._startAnimation(a, i, n >= 1 ? 1 : n, !1);
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
_refreshTargets() {
|
|
69
|
+
this._targetValues.clear();
|
|
70
|
+
let e = this._data.segments;
|
|
71
|
+
for (let t = 0; t < e.length; t++) this._targetValues.set(t, e[t].value);
|
|
72
|
+
this._targetTotal = e.reduce((e, t) => e + t.value, 0);
|
|
73
|
+
}
|
|
74
|
+
connectedCallback() {
|
|
75
|
+
super.connectedCallback(), this.setAttribute("role", "img"), this._refreshTargets(), requestAnimationFrame(() => {
|
|
76
|
+
this._startAnimation(/* @__PURE__ */ new Map(), 0, 0, !0);
|
|
77
|
+
}), this.addEventListener("mousemove", this._onMouseMove), this.addEventListener("mouseleave", this._onMouseLeave);
|
|
78
|
+
}
|
|
79
|
+
disconnectedCallback() {
|
|
80
|
+
super.disconnectedCallback(), cancelAnimationFrame(this._rafHandle), this.removeEventListener("mousemove", this._onMouseMove), this.removeEventListener("mouseleave", this._onMouseLeave);
|
|
81
|
+
}
|
|
82
|
+
_startAnimation(e, t, n, r) {
|
|
83
|
+
cancelAnimationFrame(this._rafHandle);
|
|
84
|
+
let i = getComputedStyle(this), a = i.getPropertyValue("--void-anim-scale").trim(), o = a === "" ? 1 : parseFloat(a), s = parseFloat(i.getPropertyValue("--void-duration-chart-enter")) || 700;
|
|
85
|
+
if (this._animDuration = s * o, this._animFrom = e, this._displayTotalFrom = t, this._progressFrom = r ? 0 : n, this._progress = this._progressFrom, this._animStart = performance.now(), this._animDuration <= 0) {
|
|
86
|
+
this._progress = 1, this._displayValues = new Map(this._targetValues), this._displayTotal = this._targetTotal, this._phase = "idle", this.requestUpdate();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this._phase = "animating", this._rafHandle = requestAnimationFrame(this._tick);
|
|
90
|
+
}
|
|
91
|
+
render() {
|
|
92
|
+
let { segments: e } = this._data, n = e.reduce((e, t) => e + t.value, 0);
|
|
93
|
+
if (e.length === 0 || n === 0) return r`<svg viewBox="0 0 ${this.size} ${this.size}" role="img" aria-label=${this.ariaLabel || "Donut chart"}></svg>`;
|
|
94
|
+
let o = this.size / 2, s = this.size / 2, c = this.size / 2 - 4, d = c * this.inner, f = Math.max(this._displayTotal, .001), p = 2 * Math.PI, m = -Math.PI / 2 + this._progress * p, h = (this.gaps === !0 ? 1 : this.gaps === !1 ? 0 : this.gaps) / 100 * p, g = (e.length > 0 ? h / e.length : 0) / 2, _ = [], v = -Math.PI / 2;
|
|
95
|
+
for (let n = 0; n < e.length; n++) {
|
|
96
|
+
let r = e[n], i = this._displayValues.get(n) ?? 0, l = v, u = l + i / f * p, h = Math.min(u, m);
|
|
97
|
+
if (h > l + .001) {
|
|
98
|
+
let e = r.color ?? `var(--void-chart-series-${n % 6 + 1})`, i = l + g, u = Math.max(i + .001, h - g);
|
|
99
|
+
_.push(a`
|
|
100
|
+
<path
|
|
101
|
+
class="void-donut-chart-segment"
|
|
102
|
+
d=${t(o, s, c, i, u, d)}
|
|
103
|
+
style="--segment-color: ${e}"
|
|
104
|
+
data-segment-index=${n}
|
|
105
|
+
></path>
|
|
106
|
+
`);
|
|
107
|
+
}
|
|
108
|
+
v = u;
|
|
109
|
+
}
|
|
110
|
+
return r`
|
|
111
|
+
<svg
|
|
112
|
+
viewBox="0 0 ${this.size} ${this.size}"
|
|
113
|
+
role="img"
|
|
114
|
+
aria-label=${this.ariaLabel || "Donut chart"}
|
|
115
|
+
data-phase=${this._phase}
|
|
116
|
+
>
|
|
117
|
+
${_}
|
|
118
|
+
${this.showTotal ? a`
|
|
119
|
+
<g class="void-donut-chart-total">
|
|
120
|
+
<text x=${o} y=${s} text-anchor="middle" dy="0.32em">${l(this._displayTotal)}</text>
|
|
121
|
+
</g>
|
|
122
|
+
` : i}
|
|
123
|
+
${this.showValues ? a`
|
|
124
|
+
<g class="void-donut-chart-labels">
|
|
125
|
+
${e.map((e, t) => {
|
|
126
|
+
let n = this._displayValues.get(t) ?? 0;
|
|
127
|
+
if (n < .001) return i;
|
|
128
|
+
let r = -Math.PI / 2;
|
|
129
|
+
for (let e = 0; e < t; e++) r += (this._displayValues.get(e) ?? 0) / f * p;
|
|
130
|
+
let l = r + n / f * p / 2, m = (c + d) / 2;
|
|
131
|
+
return a`<text x=${o + m * Math.cos(l)} y=${s + m * Math.sin(l)} text-anchor="middle" dy="0.32em">${u(n)}</text>`;
|
|
132
|
+
})}
|
|
133
|
+
</g>
|
|
134
|
+
` : i}
|
|
135
|
+
|
|
136
|
+
${this._hoverSegment !== null && this._hoverSegment < e.length ? this._renderHoverTooltip(e, this._hoverSegment) : i}
|
|
137
|
+
</svg>
|
|
138
|
+
`;
|
|
139
|
+
}
|
|
140
|
+
_renderHoverTooltip(e, t) {
|
|
141
|
+
let n = e[t], r = this._displayValues.get(t) ?? n.value, i = [...this._displayValues.values()].reduce((e, t) => e + t, 0) || this._targetTotal || 1, o = Math.round(r / i * 100), s = this.size / 2, c = this._hoverX < s ? this.size - 140 - 8 : 8, l = this._hoverY - 44 / 2;
|
|
142
|
+
return l < 8 && (l = 8), l + 44 > this.size - 8 && (l = this.size - 44 - 8), a`
|
|
143
|
+
<g class="void-donut-chart-hover" pointer-events="none">
|
|
144
|
+
<rect
|
|
145
|
+
class="void-donut-chart-tooltip-bg"
|
|
146
|
+
x=${c} y=${l}
|
|
147
|
+
width=${140} height=${44}
|
|
148
|
+
rx="6" ry="6"
|
|
149
|
+
></rect>
|
|
150
|
+
<text
|
|
151
|
+
class="void-donut-chart-tooltip-name"
|
|
152
|
+
x=${c + 8}
|
|
153
|
+
y=${l + 8 + 10}
|
|
154
|
+
>${n.name}</text>
|
|
155
|
+
<text
|
|
156
|
+
class="void-donut-chart-tooltip-value"
|
|
157
|
+
x=${c + 8}
|
|
158
|
+
y=${l + 8 + 14 + 10}
|
|
159
|
+
>${u(r)} <tspan class="void-donut-chart-tooltip-pct">(${o}%)</tspan></text>
|
|
160
|
+
</g>
|
|
161
|
+
`;
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
e([o({
|
|
165
|
+
type: Number,
|
|
166
|
+
reflect: !0
|
|
167
|
+
})], d.prototype, "size", void 0), e([o({ type: Number })], d.prototype, "inner", void 0), e([o({ converter: {
|
|
168
|
+
fromAttribute(e) {
|
|
169
|
+
if (e === null || e === "" || e === "true") return !0;
|
|
170
|
+
if (e === "false") return !1;
|
|
171
|
+
let t = Number(e);
|
|
172
|
+
return isNaN(t) ? !0 : t;
|
|
173
|
+
},
|
|
174
|
+
toAttribute(e) {
|
|
175
|
+
return e === !0 ? "" : e === !1 ? "false" : String(e);
|
|
176
|
+
}
|
|
177
|
+
} })], d.prototype, "gaps", void 0), e([o({ reflect: !0 })], d.prototype, "variant", void 0), e([o({
|
|
178
|
+
type: Boolean,
|
|
179
|
+
attribute: "show-values",
|
|
180
|
+
reflect: !0
|
|
181
|
+
})], d.prototype, "showValues", void 0), e([o({
|
|
182
|
+
type: Boolean,
|
|
183
|
+
attribute: "show-total",
|
|
184
|
+
reflect: !0
|
|
185
|
+
})], d.prototype, "showTotal", void 0), e([o({ attribute: "aria-label" })], d.prototype, "ariaLabel", void 0), e([s()], d.prototype, "_phase", void 0), e([s()], d.prototype, "_hoverSegment", void 0), e([s()], d.prototype, "_hoverX", void 0), e([s()], d.prototype, "_hoverY", void 0), customElements.get("void-donut-chart") || customElements.define("void-donut-chart", d);
|
|
186
|
+
//#endregion
|
|
187
|
+
export { d as VoidDonutChart };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VoidElement as e } from "../base.js";
|
|
2
|
-
import { t } from "../chunks/decorate-
|
|
2
|
+
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { html as n, nothing as r } from "lit";
|
|
4
4
|
import { property as i } from "lit/decorators.js";
|
|
5
5
|
//#region src/components/drawer.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VoidElement as e } from "../base.js";
|
|
2
|
-
import { t } from "../chunks/decorate-
|
|
2
|
+
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { property as n } from "lit/decorators.js";
|
|
4
4
|
//#region src/components/dropdown-menu.ts
|
|
5
5
|
var r = class extends e {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VoidElement as e } from "../base.js";
|
|
2
|
-
import { t } from "../chunks/decorate-
|
|
2
|
+
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { html as n, nothing as r } from "lit";
|
|
4
4
|
import { property as i } from "lit/decorators.js";
|
|
5
5
|
//#region src/components/editable.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VoidElement as e } from "../base.js";
|
|
2
|
-
import { t } from "../chunks/decorate-
|
|
2
|
+
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { html as n, nothing as r } from "lit";
|
|
4
4
|
import { property as i } from "lit/decorators.js";
|
|
5
5
|
//#region src/components/error-fallback.ts
|
package/dist/components/field.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VoidElement as e } from "../base.js";
|
|
2
|
-
import { t } from "../chunks/decorate-
|
|
2
|
+
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { html as n, nothing as r } from "lit";
|
|
4
4
|
import { property as i } from "lit/decorators.js";
|
|
5
5
|
//#region src/components/field.ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { VoidElement as e } from "../base.js";
|
|
2
|
-
import { t } from "../chunks/decorate-
|
|
2
|
+
import { t } from "../chunks/decorate-CaYbmmmm.js";
|
|
3
3
|
import { html as n, nothing as r } from "lit";
|
|
4
4
|
import { property as i } from "lit/decorators.js";
|
|
5
5
|
//#region src/components/file-upload.ts
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
export interface GaugeZone {
|
|
3
|
+
from: number;
|
|
4
|
+
to: number;
|
|
5
|
+
color: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GaugeSegment {
|
|
8
|
+
name: string;
|
|
9
|
+
value: number;
|
|
10
|
+
color?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface GaugeData {
|
|
13
|
+
value?: number;
|
|
14
|
+
segments?: GaugeSegment[];
|
|
15
|
+
}
|
|
16
|
+
export declare class VoidGauge extends LitElement {
|
|
17
|
+
createRenderRoot(): this;
|
|
18
|
+
unit: string;
|
|
19
|
+
value: number;
|
|
20
|
+
min: number;
|
|
21
|
+
max: number;
|
|
22
|
+
size: number;
|
|
23
|
+
thickness: number;
|
|
24
|
+
circular: 'full' | 'semi' | 'triple';
|
|
25
|
+
variant: 'filled' | 'outline' | 'wireframe';
|
|
26
|
+
showValue: boolean;
|
|
27
|
+
/** When true, render the unit right next to the value (e.g. "75%").
|
|
28
|
+
When false (default), render it on the line below. Short units like
|
|
29
|
+
% or ° look better inline; longer multi-char units often look
|
|
30
|
+
better stacked. */
|
|
31
|
+
unitInline: boolean;
|
|
32
|
+
/** Major tick interval in value units. 0 disables major ticks. Ticks are
|
|
33
|
+
placed at every multiple of this value within (min, max], drawn as
|
|
34
|
+
thicker, longer outward marks. Speedometer-style layout: pair with
|
|
35
|
+
`tick-minor` for a major-grade-with-subdivisions look. */
|
|
36
|
+
tickMajor: number;
|
|
37
|
+
/** Minor tick interval in value units. 0 disables minor ticks. Positions
|
|
38
|
+
that are also major-tick positions are rendered as majors, not minors.
|
|
39
|
+
For example, max=100 / tick-major=25 / tick-minor=5 yields 4 major
|
|
40
|
+
ticks (25, 50, 75, 100) and 16 minor ticks (everything else divisible
|
|
41
|
+
by 5 within the range). */
|
|
42
|
+
tickMinor: number;
|
|
43
|
+
/** When true (default), force a major tick at `min` (the gauge start
|
|
44
|
+
position). Independent of `tick-major` — useful when min isn't a
|
|
45
|
+
multiple of the major interval but you still want an endpoint
|
|
46
|
+
marker. Set `tick-min="false"` to disable. */
|
|
47
|
+
tickMin: boolean;
|
|
48
|
+
/** When true (default), force a major tick at `max` (the gauge end
|
|
49
|
+
position). Useful when max doesn't naturally fall on a major-interval
|
|
50
|
+
boundary (e.g. max=100 with tick-major=30) but you still want the
|
|
51
|
+
endpoint marked. If max naturally falls on a step, this upgrades the
|
|
52
|
+
classification to major. Set `tick-max="false"` to disable. */
|
|
53
|
+
tickMax: boolean;
|
|
54
|
+
segmentsSort: 'value' | 'manual';
|
|
55
|
+
/** Visible gap between segments. `false`/`0` = seamless. `true` = 1% of the
|
|
56
|
+
filled arc consumed by gaps. Number = explicit percent. Higher % = clearer
|
|
57
|
+
segmentation but more arc sacrificed; the precision-vs-clarity tradeoff. */
|
|
58
|
+
gaps: boolean | number;
|
|
59
|
+
ariaLabel: string;
|
|
60
|
+
zones: GaugeZone[];
|
|
61
|
+
private _data;
|
|
62
|
+
get data(): GaugeData;
|
|
63
|
+
set data(next: GaugeData);
|
|
64
|
+
private _phase;
|
|
65
|
+
private _hoverSegment;
|
|
66
|
+
private _hoverX;
|
|
67
|
+
private _hoverY;
|
|
68
|
+
private _displayValue;
|
|
69
|
+
private _displayValueFrom;
|
|
70
|
+
private _targetValue;
|
|
71
|
+
private _displaySegments;
|
|
72
|
+
private _segmentsFrom;
|
|
73
|
+
private _targetSegments;
|
|
74
|
+
private _animStart;
|
|
75
|
+
private _animDuration;
|
|
76
|
+
private _rafHandle;
|
|
77
|
+
private _refreshTargets;
|
|
78
|
+
private _resolveTotal;
|
|
79
|
+
connectedCallback(): void;
|
|
80
|
+
disconnectedCallback(): void;
|
|
81
|
+
private _onMouseMove;
|
|
82
|
+
private _onMouseLeave;
|
|
83
|
+
private _startAnimation;
|
|
84
|
+
private _tick;
|
|
85
|
+
private _viewBoxHeight;
|
|
86
|
+
private _angleAt;
|
|
87
|
+
private _resolveFillColor;
|
|
88
|
+
private _hasSegments;
|
|
89
|
+
private _renderZones;
|
|
90
|
+
private _renderSegments;
|
|
91
|
+
private _renderCenter;
|
|
92
|
+
private _hasTicks;
|
|
93
|
+
private _renderTicks;
|
|
94
|
+
render(): import('lit').TemplateResult<1>;
|
|
95
|
+
private _renderHoverTooltip;
|
|
96
|
+
}
|
|
97
|
+
declare global {
|
|
98
|
+
interface HTMLElementTagNameMap {
|
|
99
|
+
'void-gauge': VoidGauge;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
//# sourceMappingURL=gauge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gauge.d.ts","sourceRoot":"","sources":["../../src/components/gauge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAGrD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;CAC3B;AAoLD,qBAAa,SAAU,SAAQ,UAAU;IACvC,gBAAgB,IAAI,IAAI;IAEZ,IAAI,SAAM;IACM,KAAK,SAAK;IACV,GAAG,SAAK;IACR,GAAG,SAAO;IACK,IAAI,SAAO;IAC1B,SAAS,SAAM;IACd,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,QAAQ,CAAY;IAChD,OAAO,EAAE,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAY;IACf,SAAS,UAAQ;IACtF;;;0BAGsB;IACgD,UAAU,UAAS;IACzF;;;iEAG6D;IACR,SAAS,EAAE,MAAM,CAAK;IAC3E;;;;kCAI8B;IACuB,SAAS,EAAE,MAAM,CAAK;IAC3E;;;qDAGiD;IACkB,OAAO,UAAQ;IAClF;;;;sEAIkE;IACC,OAAO,UAAQ;IACxC,YAAY,EAAE,OAAO,GAAG,QAAQ,CAAW;IACrF;;mFAE+E;IAa5E,IAAI,EAAE,OAAO,GAAG,MAAM,CAAS;IACK,SAAS,SAAM;IAEtD,KAAK,EAAE,SAAS,EAAE,CAAM;IAExB,OAAO,CAAC,KAAK,CAAiB;IAE9B,IAAI,IAAI,IAAI,SAAS,CAAuB;IAC5C,IAAI,IAAI,CAAC,IAAI,EAAE,SAAS,EAmBvB;IAEQ,OAAO,CAAC,MAAM,CAAuC;IACrD,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,OAAO,CAAa;IAC5B,OAAO,CAAC,OAAO,CAAa;IACrC,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,gBAAgB,CAA6B;IACrD,OAAO,CAAC,aAAa,CAA6B;IAClD,OAAO,CAAC,eAAe,CAA6B;IACpD,OAAO,CAAC,UAAU,CAAK;IACvB,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,UAAU,CAAK;IAEvB,OAAO,CAAC,eAAe;IASvB,OAAO,CAAC,aAAa;IAOrB,iBAAiB;IAcjB,oBAAoB;IAOpB,OAAO,CAAC,YAAY,CA8DlB;IAEF,OAAO,CAAC,aAAa,CAEnB;IAEF,OAAO,CAAC,eAAe;IA4BvB,OAAO,CAAC,KAAK,CAmBX;IAEF,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,QAAQ;IAOhB,OAAO,CAAC,iBAAiB;IAUzB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,YAAY;IAwGpB,OAAO,CAAC,eAAe;IAiGvB,OAAO,CAAC,aAAa;IAwCrB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,YAAY;IAgDpB,MAAM;IAsEN,OAAO,CAAC,mBAAmB;CAwC5B;AAMD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|