@akcelik/strct 4.4.0 → 4.4.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.
|
@@ -1756,7 +1756,7 @@ class StrctProgress {
|
|
|
1756
1756
|
>
|
|
1757
1757
|
<div class="strct-progress__fill" [style.width.%]="clamped()"></div>
|
|
1758
1758
|
</div>
|
|
1759
|
-
`, isInline: true, styles: [".strct-progress{display:block}.strct-progress__track{height:6px;border-radius:var(--radius-sm);background:var(--
|
|
1759
|
+
`, isInline: true, styles: [".strct-progress{display:block}.strct-progress__track{height:6px;border-radius:var(--radius-sm);background:var(--strct-progress-track, color-mix(in srgb, var(--t1) 12%, transparent));box-shadow:inset 0 0 0 1px var(--b2);overflow:hidden}.strct-progress__fill{height:100%;border-radius:var(--radius-sm);background:var(--acc);transition:width .3s ease}.strct-progress--success .strct-progress__fill{background:var(--success)}.strct-progress--warning .strct-progress__fill{background:var(--warning)}.strct-progress--critical .strct-progress__fill{background:var(--critical)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1760
1760
|
}
|
|
1761
1761
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: StrctProgress, decorators: [{
|
|
1762
1762
|
type: Component,
|
|
@@ -1776,7 +1776,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.4", ngImpor
|
|
|
1776
1776
|
'[class.strct-progress--success]': "resolvedStatus() === 'success'",
|
|
1777
1777
|
'[class.strct-progress--warning]': "resolvedStatus() === 'warning'",
|
|
1778
1778
|
'[class.strct-progress--critical]': "resolvedStatus() === 'critical'",
|
|
1779
|
-
}, styles: [".strct-progress{display:block}.strct-progress__track{height:6px;border-radius:var(--radius-sm);background:var(--
|
|
1779
|
+
}, styles: [".strct-progress{display:block}.strct-progress__track{height:6px;border-radius:var(--radius-sm);background:var(--strct-progress-track, color-mix(in srgb, var(--t1) 12%, transparent));box-shadow:inset 0 0 0 1px var(--b2);overflow:hidden}.strct-progress__fill{height:100%;border-radius:var(--radius-sm);background:var(--acc);transition:width .3s ease}.strct-progress--success .strct-progress__fill{background:var(--success)}.strct-progress--warning .strct-progress__fill{background:var(--warning)}.strct-progress--critical .strct-progress__fill{background:var(--critical)}\n"] }]
|
|
1780
1780
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], thresholds: [{ type: i0.Input, args: [{ isSignal: true, alias: "thresholds", required: false }] }] } });
|
|
1781
1781
|
|
|
1782
1782
|
/** Indeterminate loading ring. `<strct-spinner size="sm" />`. */
|
|
@@ -22044,27 +22044,47 @@ class StrctHeatmap {
|
|
|
22044
22044
|
const maxV = this.maxVal();
|
|
22045
22045
|
const t = this.thresholds();
|
|
22046
22046
|
if (t) {
|
|
22047
|
-
const { color, from, to } = this.bandFor(value, t, maxV);
|
|
22047
|
+
const { color, from, to, floor, ceilingPct } = this.bandFor(value, t, maxV);
|
|
22048
22048
|
const span = to - from;
|
|
22049
22049
|
const pos = span > 0 ? Math.min(Math.max((value - from) / span, 0), 1) : 1;
|
|
22050
|
-
const pct =
|
|
22050
|
+
const pct = floor + Math.round(pos * (ceilingPct - floor));
|
|
22051
22051
|
return `color-mix(in srgb, ${color} ${pct}%, var(--bg-1))`;
|
|
22052
22052
|
}
|
|
22053
22053
|
const ratio = maxV > 0 ? Math.min(value / maxV, 1) : 0;
|
|
22054
22054
|
const pct = 8 + Math.round(ratio * 92);
|
|
22055
22055
|
return `color-mix(in srgb, ${this.color()} ${pct}%, var(--bg-1))`;
|
|
22056
22056
|
}
|
|
22057
|
-
/**
|
|
22057
|
+
/**
|
|
22058
|
+
* The band a value falls in: its hue, the value range intensity scales over,
|
|
22059
|
+
* and the intensity range itself.
|
|
22060
|
+
*
|
|
22061
|
+
* FR-44-02: the bands' intensity ranges ASCEND and do not overlap, so
|
|
22062
|
+
* intensity never falls as the value rises. Restarting every band at one
|
|
22063
|
+
* floor (4.3.0) made a cell just past a threshold paler than the cell just
|
|
22064
|
+
* below it — an 86% warning cell read quieter than an 84% accent one, which
|
|
22065
|
+
* is backwards for the hours that matter most. The accent band still starts
|
|
22066
|
+
* near-empty; warning and critical start where accent ends, so neither can
|
|
22067
|
+
* be mistaken for no-data either.
|
|
22068
|
+
*/
|
|
22058
22069
|
bandFor(value, t, maxV) {
|
|
22059
22070
|
const ceiling = Math.max(maxV, value);
|
|
22060
22071
|
if (t.critical != null && value >= t.critical) {
|
|
22061
|
-
return { color: COLOR.critical, from: t.critical, to: ceiling };
|
|
22072
|
+
return { color: COLOR.critical, from: t.critical, to: ceiling, floor: 92, ceilingPct: 100 };
|
|
22062
22073
|
}
|
|
22063
22074
|
if (t.warning != null && value >= t.warning) {
|
|
22064
|
-
|
|
22075
|
+
const to = t.critical ?? ceiling;
|
|
22076
|
+
// With a critical bound above it the warning band stops short of it;
|
|
22077
|
+
// without one it owns the top of the ramp.
|
|
22078
|
+
return {
|
|
22079
|
+
color: COLOR.warning,
|
|
22080
|
+
from: t.warning,
|
|
22081
|
+
to,
|
|
22082
|
+
floor: 80,
|
|
22083
|
+
ceilingPct: t.critical != null ? 92 : 100,
|
|
22084
|
+
};
|
|
22065
22085
|
}
|
|
22066
22086
|
const upper = t.warning ?? t.critical ?? ceiling;
|
|
22067
|
-
return { color: this.color(), from: 0, to: upper };
|
|
22087
|
+
return { color: this.color(), from: 0, to: upper, floor: 8, ceilingPct: 80 };
|
|
22068
22088
|
}
|
|
22069
22089
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.4", ngImport: i0, type: StrctHeatmap, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
22070
22090
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.4", type: StrctHeatmap, isStandalone: true, selector: "strct-heatmap", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, rows: { classPropertyName: "rows", publicName: "rows", isSignal: true, isRequired: false, transformFunction: null }, cols: { classPropertyName: "cols", publicName: "cols", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, colLabelEvery: { classPropertyName: "colLabelEvery", publicName: "colLabelEvery", isSignal: true, isRequired: false, transformFunction: null }, colLabel: { classPropertyName: "colLabel", publicName: "colLabel", isSignal: true, isRequired: false, transformFunction: null }, valueFormat: { classPropertyName: "valueFormat", publicName: "valueFormat", isSignal: true, isRequired: false, transformFunction: null }, thresholds: { classPropertyName: "thresholds", publicName: "thresholds", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, emptyText: { classPropertyName: "emptyText", publicName: "emptyText", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, summaryFormat: { classPropertyName: "summaryFormat", publicName: "summaryFormat", isSignal: true, isRequired: false, transformFunction: null }, cellHeight: { classPropertyName: "cellHeight", publicName: "cellHeight", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, rowLabelWidth: { classPropertyName: "rowLabelWidth", publicName: "rowLabelWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { classAttribute: "strct-heatmap" }, ngImport: i0, template: `
|