@cngx/common 0.1.0-rc.8 → 0.1.0-rc.9
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/command/README.md +29 -0
- package/data/README.md +5 -2
- package/fesm2022/cngx-common-a11y.mjs +403 -84
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +16 -13
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +4 -3
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +55 -36
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +60 -6
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +185 -37
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +86 -48
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +27 -23
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +324 -122
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +129 -26
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +947 -33
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +300 -166
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +251 -80
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +16 -10
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/layout/README.md +16 -0
- package/package.json +20 -7
- package/popover/README.md +40 -0
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +91 -0
- package/schematics/package.json +3 -0
- package/stepper/README.md +5 -4
- package/theming/components/cngx-popover-sheet.css +402 -0
- package/theming/components/cngx-popover.css +10 -6
- package/types/cngx-common-a11y.d.ts +167 -14
- package/types/cngx-common-chart.d.ts +8 -7
- package/types/cngx-common-command.d.ts +19 -2
- package/types/cngx-common-data.d.ts +164 -26
- package/types/cngx-common-dialog.d.ts +3 -7
- package/types/cngx-common-interactive.d.ts +52 -17
- package/types/cngx-common-layout.d.ts +37 -5
- package/types/cngx-common-popover.d.ts +353 -13
- package/types/cngx-common-stepper.d.ts +168 -129
- package/types/cngx-common-tabs.d.ts +149 -30
- package/types/cngx-common-timeline.d.ts +27 -7
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { CngxRuntimeError, clamp, cngxDevWarn, arrayEqual } from '@cngx/utils';
|
|
1
2
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject, DestroyRef, signal, computed, InjectionToken, input, ViewEncapsulation, ChangeDetectionStrategy, Component, TemplateRef, Directive, linkedSignal, untracked, effect, ElementRef, contentChildren, contentChild,
|
|
3
|
+
import { inject, DestroyRef, signal, computed, InjectionToken, input, ViewEncapsulation, ChangeDetectionStrategy, Component, TemplateRef, Directive, linkedSignal, untracked, effect, ElementRef, contentChildren, contentChild, afterNextRender } from '@angular/core';
|
|
3
4
|
import { NgTemplateOutlet } from '@angular/common';
|
|
4
5
|
import * as i1 from '@cngx/common/layout';
|
|
5
6
|
import { CngxResizeObserver } from '@cngx/common/layout';
|
|
6
7
|
import { resolveAsyncView } from '@cngx/common/data';
|
|
7
8
|
import { numberFormatterFor, createOverrideMerge, nextUid, injectLocale, createMediaQuerySignal, createTransitionTracker, dateTimeFormatterFor } from '@cngx/core/utils';
|
|
8
9
|
import { formatMessage, createLanguageSection, createSectionBundle } from '@cngx/core/i18n';
|
|
9
|
-
import { clamp, arrayEqual } from '@cngx/utils';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Pure-TS linear scale. Maps a numeric domain `[d0, d1]` to a numeric
|
|
@@ -95,7 +95,8 @@ function createBandScale(domain, range, padding = 0) {
|
|
|
95
95
|
* @param domain Ordered list of categorical values. Values are matched
|
|
96
96
|
* by reference equality on lookup.
|
|
97
97
|
* @param colors Palette to cycle through. Must have at least one entry;
|
|
98
|
-
* an empty palette throws
|
|
98
|
+
* an empty palette throws a `CngxRuntimeError` (`CNGX1049`)
|
|
99
|
+
* synchronously at construction time.
|
|
99
100
|
* @returns Callable `(v: T) => string` returning the palette entry for
|
|
100
101
|
* `v`. Lookup of an unknown value returns the palette's first entry.
|
|
101
102
|
*
|
|
@@ -103,7 +104,9 @@ function createBandScale(domain, range, padding = 0) {
|
|
|
103
104
|
*/
|
|
104
105
|
function createOrdinalScale(domain, colors) {
|
|
105
106
|
if (colors.length === 0) {
|
|
106
|
-
throw new
|
|
107
|
+
throw new CngxRuntimeError('CNGX1049', typeof ngDevMode !== 'undefined' &&
|
|
108
|
+
ngDevMode &&
|
|
109
|
+
'createOrdinalScale(): colors palette must not be empty');
|
|
107
110
|
}
|
|
108
111
|
const lookup = new Map();
|
|
109
112
|
for (let i = 0; i < domain.length; i++) {
|
|
@@ -293,13 +296,16 @@ function slotContextEqual(a, b) {
|
|
|
293
296
|
* is allocated once; no growth, no per-push allocation.
|
|
294
297
|
*
|
|
295
298
|
* @param capacity positive integer maximum element count.
|
|
296
|
-
* @throws when `capacity` is not a positive
|
|
299
|
+
* @throws `CngxRuntimeError` (`CNGX1050`) when `capacity` is not a positive
|
|
300
|
+
* integer.
|
|
297
301
|
*
|
|
298
302
|
* @category common/chart/buffer
|
|
299
303
|
*/
|
|
300
304
|
function createRingBuffer(capacity) {
|
|
301
305
|
if (!Number.isInteger(capacity) || capacity <= 0) {
|
|
302
|
-
throw new
|
|
306
|
+
throw new CngxRuntimeError('CNGX1050', typeof ngDevMode !== 'undefined' &&
|
|
307
|
+
ngDevMode &&
|
|
308
|
+
`createRingBuffer(): capacity must be a positive integer, got ${capacity}`);
|
|
303
309
|
}
|
|
304
310
|
const store = new Array(capacity);
|
|
305
311
|
let head = 0; // next write slot
|
|
@@ -457,11 +463,11 @@ const CNGX_CHART_AXIS = new InjectionToken('CNGX_CHART_AXIS');
|
|
|
457
463
|
*/
|
|
458
464
|
const CNGX_CHART_CONTEXT = new InjectionToken('CngxChartContext');
|
|
459
465
|
/**
|
|
460
|
-
* Inject the parent chart's reactive context. Throws a
|
|
461
|
-
*
|
|
462
|
-
* `<cngx-chart
|
|
463
|
-
*
|
|
464
|
-
*
|
|
466
|
+
* Inject the parent chart's reactive context. Throws a `CngxRuntimeError`
|
|
467
|
+
* with code `CNGX1048` when the consumer is not mounted as a content child
|
|
468
|
+
* of `<cngx-chart>`, in development and production alike. The `selector`
|
|
469
|
+
* argument is the consumer's public selector without brackets (`'cngxLine'`)
|
|
470
|
+
* and names it in the development message.
|
|
465
471
|
*
|
|
466
472
|
* Use it from custom layer directives mounted on `<svg:g>` hosts to
|
|
467
473
|
* read `plot`, the scales and `renderSvg` the same way the built-in
|
|
@@ -471,10 +477,12 @@ const CNGX_CHART_CONTEXT = new InjectionToken('CngxChartContext');
|
|
|
471
477
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/chart/chart/chart-context.ts
|
|
472
478
|
* @since 0.1.0
|
|
473
479
|
*/
|
|
474
|
-
function injectChartContext(
|
|
480
|
+
function injectChartContext(selector) {
|
|
475
481
|
const ctx = inject(CNGX_CHART_CONTEXT, { optional: true });
|
|
476
482
|
if (!ctx) {
|
|
477
|
-
throw new
|
|
483
|
+
throw new CngxRuntimeError('CNGX1048', typeof ngDevMode !== 'undefined' &&
|
|
484
|
+
ngDevMode &&
|
|
485
|
+
`[${selector}] must be placed inside <cngx-chart>.`);
|
|
478
486
|
}
|
|
479
487
|
return ctx;
|
|
480
488
|
}
|
|
@@ -522,7 +530,7 @@ class CngxThreshold {
|
|
|
522
530
|
label = input(null, ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
523
531
|
dashed = input(false, ...(ngDevMode ? [{ debugName: "dashed" }] : /* istanbul ignore next */ []));
|
|
524
532
|
color = input(null, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
525
|
-
ctx = injectChartContext('
|
|
533
|
+
ctx = injectChartContext('cngxThreshold');
|
|
526
534
|
bounds = computed(() => {
|
|
527
535
|
// Spans the plot, not the box - a threshold line running under
|
|
528
536
|
// the left axis's tick labels reads as a stray rule through the
|
|
@@ -2241,8 +2249,9 @@ class CngxChart {
|
|
|
2241
2249
|
overlaySlot = contentChild(CngxChartOverlay, ...(ngDevMode ? [{ debugName: "overlaySlot" }] : /* istanbul ignore next */ []));
|
|
2242
2250
|
// Only the first overlay renders (contentChild above). This parallel
|
|
2243
2251
|
// query exists solely to warn in dev when a consumer projects more
|
|
2244
|
-
// than one, since the extra templates drop silently otherwise.
|
|
2245
|
-
|
|
2252
|
+
// than one, since the extra templates drop silently otherwise. Descendants,
|
|
2253
|
+
// like the contentChild above, so a nested second overlay is counted too.
|
|
2254
|
+
overlaySlots = contentChildren(CngxChartOverlay, { ...(ngDevMode ? { debugName: "overlaySlots" } : /* istanbul ignore next */ {}), descendants: true });
|
|
2246
2255
|
/** Resolved consumer-projected loading template (null when no slot bound). */
|
|
2247
2256
|
loadingTpl = computed(() => this.loadingSlot()?.templateRef ?? null, ...(ngDevMode ? [{ debugName: "loadingTpl" }] : /* istanbul ignore next */ []));
|
|
2248
2257
|
/** Resolved consumer-projected empty template (null when no slot bound). */
|
|
@@ -2376,7 +2385,7 @@ class CngxChart {
|
|
|
2376
2385
|
factory: this.rendererFactory,
|
|
2377
2386
|
destroyRef: this.destroyRef,
|
|
2378
2387
|
});
|
|
2379
|
-
if (
|
|
2388
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
2380
2389
|
afterNextRender(() => {
|
|
2381
2390
|
if (this.summaryAccessor() !== DEFAULT_SUMMARY_ACCESSOR) {
|
|
2382
2391
|
return;
|
|
@@ -2389,13 +2398,14 @@ class CngxChart {
|
|
|
2389
2398
|
if (Number.isFinite(projected)) {
|
|
2390
2399
|
return;
|
|
2391
2400
|
}
|
|
2392
|
-
|
|
2401
|
+
cngxDevWarn('CNGX1007', '[cngx-chart] data is non-numeric and no [summaryAccessor] is bound. ' +
|
|
2393
2402
|
'Auto-Summary and the SR data-table will silently fall back to NaN. ' +
|
|
2394
|
-
'Bind [summaryAccessor]=
|
|
2403
|
+
'Bind [summaryAccessor] to a stable component field (summaryAccessor = (d: Row) => d.value) ' +
|
|
2404
|
+
'or pass a numeric data array.');
|
|
2395
2405
|
});
|
|
2396
2406
|
afterNextRender(() => {
|
|
2397
2407
|
if (this.overlaySlots().length > 1) {
|
|
2398
|
-
|
|
2408
|
+
cngxDevWarn('CNGX1008', '[cngx-chart] more than one *cngxChartOverlay projected; only the first renders. ' +
|
|
2399
2409
|
'Compose multiple overlays inside a single overlay template.');
|
|
2400
2410
|
}
|
|
2401
2411
|
});
|
|
@@ -2404,7 +2414,7 @@ class CngxChart {
|
|
|
2404
2414
|
const horizontal = axes.filter((a) => isHorizontalPosition(a.position()));
|
|
2405
2415
|
const vertical = axes.filter((a) => isVerticalPosition(a.position()));
|
|
2406
2416
|
if (horizontal.length > 1 || vertical.length > 1) {
|
|
2407
|
-
|
|
2417
|
+
cngxDevWarn('CNGX1009', '[cngx-chart] multiple axes share one orientation; only the first drives ' +
|
|
2408
2418
|
'the scale, the rest render their line and ticks but their [domain] ' +
|
|
2409
2419
|
'is silently ignored. Mount one X and one Y axis per chart.');
|
|
2410
2420
|
}
|
|
@@ -2735,7 +2745,7 @@ class CngxChart {
|
|
|
2735
2745
|
return this.dataInput().length > 1;
|
|
2736
2746
|
}, ...(ngDevMode ? [{ debugName: "tableActive" }] : /* istanbul ignore next */ []));
|
|
2737
2747
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxChart, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2738
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxChart, isStandalone: true, selector: "cngx-chart", inputs: { dataInput: { classPropertyName: "dataInput", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, preserveAspectRatio: { classPropertyName: "preserveAspectRatio", publicName: "preserveAspectRatio", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, summaryAccessor: { classPropertyName: "summaryAccessor", publicName: "summaryAccessor", isSignal: true, isRequired: false, transformFunction: null }, accessibleTable: { classPropertyName: "accessibleTable", publicName: "accessibleTable", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, connectionState: { classPropertyName: "connectionState", publicName: "connectionState", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "img" }, properties: { "attr.aria-label": "ariaLabelText()", "attr.aria-describedby": "dataTableId", "attr.aria-busy": "busy() ? \"true\" : null", "class.cngx-chart--responsive": "isResponsive()", "class.cngx-chart--content-hidden": "contentHidden()", "style.width.px": "width() ?? null", "style.aspect-ratio": "explicitAspectRatio()", "style.--cngx-chart-plot-block-start": "plotVars().blockStart", "style.--cngx-chart-plot-block-end": "plotVars().blockEnd", "style.--cngx-chart-plot-inline-start": "plotVars().inlineStart", "style.--cngx-chart-plot-inline-end": "plotVars().inlineEnd", "style.--_cngx-chart-hatch-diagonal": "hatchFill.diagonal", "style.--_cngx-chart-hatch-horizontal": "hatchFill.horizontal" } }, providers: [{ provide: CNGX_CHART_CONTEXT, useExisting: CngxChart }], queries: [{ propertyName: "axes", predicate: CNGX_CHART_AXIS, descendants: true, isSignal: true }, { propertyName: "thresholds", predicate: CngxThreshold, descendants: true, isSignal: true }, { propertyName: "layers", predicate: CNGX_CHART_LAYER, descendants: true, isSignal: true }, { propertyName: "loadingSlot", first: true, predicate: CngxChartLoading, descendants: true, isSignal: true }, { propertyName: "emptySlot", first: true, predicate: CngxChartEmpty, descendants: true, isSignal: true }, { propertyName: "errorSlot", first: true, predicate: CngxChartError, descendants: true, isSignal: true }, { propertyName: "connectionErrorSlot", first: true, predicate: CngxChartConnectionError, descendants: true, isSignal: true }, { propertyName: "reconnectingSlot", first: true, predicate: CngxChartReconnecting, descendants: true, isSignal: true }, { propertyName: "overlaySlot", first: true, predicate: CngxChartOverlay, descendants: true, isSignal: true }, { propertyName: "overlaySlots", predicate: CngxChartOverlay, isSignal: true }], exportAs: ["cngxChart"], hostDirectives: [{ directive: i1.CngxResizeObserver }], ngImport: i0, template: `
|
|
2748
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxChart, isStandalone: true, selector: "cngx-chart", inputs: { dataInput: { classPropertyName: "dataInput", publicName: "data", isSignal: true, isRequired: true, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, preserveAspectRatio: { classPropertyName: "preserveAspectRatio", publicName: "preserveAspectRatio", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "aria-label", isSignal: true, isRequired: false, transformFunction: null }, summaryAccessor: { classPropertyName: "summaryAccessor", publicName: "summaryAccessor", isSignal: true, isRequired: false, transformFunction: null }, accessibleTable: { classPropertyName: "accessibleTable", publicName: "accessibleTable", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, connectionState: { classPropertyName: "connectionState", publicName: "connectionState", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "img" }, properties: { "attr.aria-label": "ariaLabelText()", "attr.aria-describedby": "dataTableId", "attr.aria-busy": "busy() ? \"true\" : null", "class.cngx-chart--responsive": "isResponsive()", "class.cngx-chart--content-hidden": "contentHidden()", "style.width.px": "width() ?? null", "style.aspect-ratio": "explicitAspectRatio()", "style.--cngx-chart-plot-block-start": "plotVars().blockStart", "style.--cngx-chart-plot-block-end": "plotVars().blockEnd", "style.--cngx-chart-plot-inline-start": "plotVars().inlineStart", "style.--cngx-chart-plot-inline-end": "plotVars().inlineEnd", "style.--_cngx-chart-hatch-diagonal": "hatchFill.diagonal", "style.--_cngx-chart-hatch-horizontal": "hatchFill.horizontal" } }, providers: [{ provide: CNGX_CHART_CONTEXT, useExisting: CngxChart }], queries: [{ propertyName: "axes", predicate: CNGX_CHART_AXIS, descendants: true, isSignal: true }, { propertyName: "thresholds", predicate: CngxThreshold, descendants: true, isSignal: true }, { propertyName: "layers", predicate: CNGX_CHART_LAYER, descendants: true, isSignal: true }, { propertyName: "loadingSlot", first: true, predicate: CngxChartLoading, descendants: true, isSignal: true }, { propertyName: "emptySlot", first: true, predicate: CngxChartEmpty, descendants: true, isSignal: true }, { propertyName: "errorSlot", first: true, predicate: CngxChartError, descendants: true, isSignal: true }, { propertyName: "connectionErrorSlot", first: true, predicate: CngxChartConnectionError, descendants: true, isSignal: true }, { propertyName: "reconnectingSlot", first: true, predicate: CngxChartReconnecting, descendants: true, isSignal: true }, { propertyName: "overlaySlot", first: true, predicate: CngxChartOverlay, descendants: true, isSignal: true }, { propertyName: "overlaySlots", predicate: CngxChartOverlay, descendants: true, isSignal: true }], exportAs: ["cngxChart"], hostDirectives: [{ directive: i1.CngxResizeObserver }], ngImport: i0, template: `
|
|
2739
2749
|
@switch (activeView()) {
|
|
2740
2750
|
@case ('skeleton') {
|
|
2741
2751
|
@if (loadingTpl(); as tpl) {
|
|
@@ -2964,7 +2974,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2964
2974
|
[hidden]="!tableActive() || activeView() !== 'content'"
|
|
2965
2975
|
/>
|
|
2966
2976
|
`, styles: ["@layer cngx.tokens{@property --cngx-chart-primary{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-chart-secondary{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .02 250);}@property --cngx-chart-danger{syntax: \"<color>\"; inherits: true; initial-value: oklch(.55 .18 25);}@property --cngx-chart-success{syntax: \"<color>\"; inherits: true; initial-value: oklch(.55 .15 145);}@property --cngx-chart-grid-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .005 250);}@property --cngx-chart-axis-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .015 250);}@property --cngx-chart-text-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.25 .015 250);}@property --cngx-chart-aspect-ratio{syntax: \"*\"; inherits: true; initial-value: 5 / 2;}}:root{--cngx-chart-primary: var(--accent, var(--cngx-color-primary, oklch(.66 .19 50)));--cngx-chart-secondary: var( --accent-secondary, var(--cngx-color-text-muted, oklch(.65 .02 250)) );--cngx-chart-danger: var(--danger, var(--cngx-color-danger, oklch(.55 .18 25)));--cngx-chart-success: var(--success, var(--cngx-color-success, oklch(.55 .15 145)));--cngx-chart-grid-color: color-mix(in oklch, currentColor 14%, transparent);--cngx-chart-axis-color: var( --text-secondary, var(--cngx-color-text-muted, oklch(.5 .015 250)) );--cngx-chart-text-color: var(--text-primary, var(--cngx-color-text, oklch(.25 .015 250)));--cngx-skeleton-bg: color-mix(in oklch, currentColor 14%, transparent);--cngx-chart-numeric-bidi: isolate}@media(forced-colors:active){cngx-mini-bar.cngx-mini-bar .cngx-mini-bar__track,cngx-bullet.cngx-bullet .cngx-bullet__track,cngx-deviation-bar.cngx-deviation-bar .cngx-deviation-bar__track,cngx-stacked-bar.cngx-stacked-bar .cngx-stacked-bar__track{background:Canvas}cngx-mini-bar.cngx-mini-bar .cngx-mini-bar__track:after,cngx-bullet.cngx-bullet .cngx-bullet__track:after,cngx-deviation-bar.cngx-deviation-bar .cngx-deviation-bar__track:after,cngx-stacked-bar.cngx-stacked-bar .cngx-stacked-bar__track:after{content:\"\";position:absolute;inset:0;border-radius:inherit;pointer-events:none;forced-color-adjust:none;box-shadow:inset 0 0 0 1px CanvasText}cngx-mini-bar.cngx-mini-bar .cngx-mini-bar__fill,cngx-bullet.cngx-bullet .cngx-bullet__actual,cngx-bullet.cngx-bullet .cngx-bullet__target,cngx-deviation-bar.cngx-deviation-bar .cngx-deviation-bar__fill,cngx-deviation-bar.cngx-deviation-bar .cngx-deviation-bar__baseline{background:CanvasText;opacity:1}cngx-bullet.cngx-bullet .cngx-bullet__range{forced-color-adjust:none;background:Canvas!important;box-shadow:inset -1px 0 0 GrayText;opacity:1}cngx-stacked-bar.cngx-stacked-bar .cngx-stacked-bar__segment{forced-color-adjust:none;background:CanvasText!important;box-shadow:inset -2px 0 0 Canvas}cngx-stacked-bar.cngx-stacked-bar .cngx-stacked-bar__segment:nth-child(4n+2){background:repeating-linear-gradient(45deg,CanvasText 0 2px,Canvas 2px 4px)!important}cngx-stacked-bar.cngx-stacked-bar .cngx-stacked-bar__segment:nth-child(4n+3){background:Canvas!important;box-shadow:inset -2px 0 0 Canvas,inset -3px 0 0 CanvasText,inset 0 0 0 1px CanvasText}cngx-stacked-bar.cngx-stacked-bar .cngx-stacked-bar__segment:nth-child(4n+4){background:repeating-linear-gradient(0deg,CanvasText 0 2px,Canvas 2px 4px)!important}cngx-donut.cngx-donut .cngx-donut__fill{stroke:CanvasText}cngx-donut.cngx-donut .cngx-donut__track{stroke:CanvasText;stroke-opacity:.6;stroke-dasharray:2 3}}\n", "cngx-chart .cngx-chart__hatch-ink{fill:CanvasText}cngx-chart .cngx-chart__hatch-gap{fill:Canvas}cngx-chart{display:inline-block;position:relative;max-width:100%}cngx-chart.cngx-chart--responsive{display:block;width:100%;aspect-ratio:var(--cngx-chart-aspect-ratio, 5 / 2)}cngx-chart>.cngx-chart__canvas{position:absolute;inset:0;width:100%;height:100%;z-index:var(--cngx-chart-canvas-z, 0)}cngx-chart.cngx-chart--content-hidden>.cngx-chart__canvas{display:none}cngx-chart>svg{display:block;width:100%;height:100%}cngx-chart>.cngx-chart__fallback-frame{display:flex;align-items:center;justify-content:center;width:100%;height:100%}cngx-chart>.cngx-chart__overlay-frame{position:absolute;inset-block-start:var(--cngx-chart-plot-block-start, 0px);inset-block-end:var(--cngx-chart-plot-block-end, 0px);inset-inline-start:var(--cngx-chart-plot-inline-start, 0px);inset-inline-end:var(--cngx-chart-plot-inline-end, 0px);z-index:var(--cngx-chart-overlay-z, 1);pointer-events:none}cngx-chart>.cngx-chart__loading{display:flex;align-items:center;justify-content:center;width:100%;height:100%}cngx-chart .cngx-chart__spinner{width:var(--cngx-chart-spinner-size, 32px);height:var(--cngx-chart-spinner-size, 32px);border:var(--cngx-chart-spinner-thickness, 3px) solid var(--cngx-chart-spinner-track, rgb(0 0 0 / .08));border-top-color:var(--cngx-chart-spinner-color, var(--cngx-chart-primary, currentColor));border-radius:50%;animation:cngx-chart-spin .8s linear infinite}cngx-chart>.cngx-chart__fallback{display:flex;align-items:center;justify-content:center;width:100%;height:100%;min-height:var(--cngx-chart-fallback-min-height, 48px);font-size:var(--cngx-chart-fallback-font-size, .875rem);color:var(--cngx-chart-text-color, currentColor);opacity:var(--cngx-chart-fallback-opacity, .7);padding:var(--cngx-chart-fallback-padding, 1rem);text-align:center;box-sizing:border-box}cngx-chart>.cngx-chart__fallback--error{color:var(--cngx-chart-danger, currentColor);opacity:1}cngx-chart>.cngx-chart__connection-overlay{position:absolute;top:calc(var(--cngx-chart-plot-block-start, 0px) + var(--cngx-chart-connection-inset, .5rem));inset-inline-end:calc(var(--cngx-chart-plot-inline-end, 0px) + var(--cngx-chart-connection-inset, .5rem));max-inline-size:calc(100% - var(--cngx-chart-plot-inline-start, 0px) - var(--cngx-chart-plot-inline-end, 0px) - 2 * var(--cngx-chart-connection-inset, .5rem));display:flex;align-items:center;gap:var(--cngx-chart-connection-gap, .375rem);padding:var(--cngx-chart-connection-padding, .25rem .625rem);border-radius:var(--cngx-chart-connection-radius, 999px);font-size:var(--cngx-chart-connection-font-size, .75rem);line-height:1.4;pointer-events:none;box-shadow:var(--cngx-chart-connection-shadow, 0 1px 3px rgb(0 0 0 / .12))}cngx-chart>.cngx-chart__connection-overlay--error{background:var(--cngx-chart-connection-error-bg, var(--cngx-chart-danger, #d32f2f));color:var(--cngx-chart-connection-error-color, #fff)}cngx-chart>.cngx-chart__connection-overlay--reconnecting{background:var(--cngx-chart-connection-reconnecting-bg, rgb(0 0 0 / .72));color:var(--cngx-chart-connection-reconnecting-color, #fff)}cngx-chart>.cngx-chart__sr-status{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@keyframes cngx-chart-spin{to{transform:rotate(360deg)}}@media(prefers-reduced-motion:reduce){cngx-chart .cngx-chart__spinner{animation:none}}\n"] }]
|
|
2967
|
-
}], ctorParameters: () => [], propDecorators: { dataInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], preserveAspectRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "preserveAspectRatio", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], summaryAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "summaryAccessor", required: false }] }], accessibleTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibleTable", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], connectionState: [{ type: i0.Input, args: [{ isSignal: true, alias: "connectionState", required: false }] }], axes: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CNGX_CHART_AXIS), { ...{ descendants: true }, isSignal: true }] }], thresholds: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CngxThreshold), { ...{ descendants: true }, isSignal: true }] }], layers: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CNGX_CHART_LAYER), { ...{ descendants: true }, isSignal: true }] }], loadingSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxChartLoading), { isSignal: true }] }], emptySlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxChartEmpty), { isSignal: true }] }], errorSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxChartError), { isSignal: true }] }], connectionErrorSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxChartConnectionError), { isSignal: true }] }], reconnectingSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxChartReconnecting), { isSignal: true }] }], overlaySlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxChartOverlay), { isSignal: true }] }], overlaySlots: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CngxChartOverlay), { isSignal: true }] }] } });
|
|
2977
|
+
}], ctorParameters: () => [], propDecorators: { dataInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "data", required: true }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], preserveAspectRatio: [{ type: i0.Input, args: [{ isSignal: true, alias: "preserveAspectRatio", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], summaryAccessor: [{ type: i0.Input, args: [{ isSignal: true, alias: "summaryAccessor", required: false }] }], accessibleTable: [{ type: i0.Input, args: [{ isSignal: true, alias: "accessibleTable", required: false }] }], state: [{ type: i0.Input, args: [{ isSignal: true, alias: "state", required: false }] }], connectionState: [{ type: i0.Input, args: [{ isSignal: true, alias: "connectionState", required: false }] }], axes: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CNGX_CHART_AXIS), { ...{ descendants: true }, isSignal: true }] }], thresholds: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CngxThreshold), { ...{ descendants: true }, isSignal: true }] }], layers: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CNGX_CHART_LAYER), { ...{ descendants: true }, isSignal: true }] }], loadingSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxChartLoading), { isSignal: true }] }], emptySlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxChartEmpty), { isSignal: true }] }], errorSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxChartError), { isSignal: true }] }], connectionErrorSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxChartConnectionError), { isSignal: true }] }], reconnectingSlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxChartReconnecting), { isSignal: true }] }], overlaySlot: [{ type: i0.ContentChild, args: [i0.forwardRef(() => CngxChartOverlay), { isSignal: true }] }], overlaySlots: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CngxChartOverlay), { ...{ descendants: true }, isSignal: true }] }] } });
|
|
2968
2978
|
/** @internal */
|
|
2969
2979
|
function isHorizontalPosition(p) {
|
|
2970
2980
|
return p === 'top' || p === 'bottom';
|
|
@@ -3249,7 +3259,7 @@ class CngxAxis {
|
|
|
3249
3259
|
* `[label]` for terseness.
|
|
3250
3260
|
*/
|
|
3251
3261
|
axisLabel = input(null, { ...(ngDevMode ? { debugName: "axisLabel" } : /* istanbul ignore next */ {}), alias: 'label' });
|
|
3252
|
-
ctx =
|
|
3262
|
+
ctx = injectChartContext('cngxAxis');
|
|
3253
3263
|
locale = injectLocale();
|
|
3254
3264
|
/**
|
|
3255
3265
|
* The bound `[format]`, or the default tick formatter bound to the app
|
|
@@ -4283,7 +4293,7 @@ class CngxLine {
|
|
|
4283
4293
|
* `'always'` marks every datum; `'never'` suppresses markers.
|
|
4284
4294
|
*/
|
|
4285
4295
|
points = input('auto', ...(ngDevMode ? [{ debugName: "points" }] : /* istanbul ignore next */ []));
|
|
4286
|
-
ctx = injectChartContext('
|
|
4296
|
+
ctx = injectChartContext('cngxLine');
|
|
4287
4297
|
builder = computed(() => createPathBuilder({
|
|
4288
4298
|
y: this.accessor(),
|
|
4289
4299
|
x: this.xAccessor(),
|
|
@@ -4397,7 +4407,7 @@ class CngxArea {
|
|
|
4397
4407
|
* `'always'` marks every datum; `'never'` suppresses markers.
|
|
4398
4408
|
*/
|
|
4399
4409
|
points = input('auto', ...(ngDevMode ? [{ debugName: "points" }] : /* istanbul ignore next */ []));
|
|
4400
|
-
ctx = injectChartContext('
|
|
4410
|
+
ctx = injectChartContext('cngxArea');
|
|
4401
4411
|
builder = computed(() => createPathBuilder({
|
|
4402
4412
|
y: this.accessor(),
|
|
4403
4413
|
x: this.xAccessor(),
|
|
@@ -4513,7 +4523,7 @@ class CngxBar {
|
|
|
4513
4523
|
baseline = input(FALLBACK_BASELINE, ...(ngDevMode ? [{ debugName: "baseline" }] : /* istanbul ignore next */ []));
|
|
4514
4524
|
data = input(undefined, ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
4515
4525
|
color = input(null, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
4516
|
-
ctx = injectChartContext('
|
|
4526
|
+
ctx = injectChartContext('cngxBar');
|
|
4517
4527
|
resolvedData = computed(() => {
|
|
4518
4528
|
const local = this.data();
|
|
4519
4529
|
if (local !== undefined) {
|
|
@@ -4677,7 +4687,7 @@ class CngxScatter {
|
|
|
4677
4687
|
radius = input(3, ...(ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []));
|
|
4678
4688
|
data = input(undefined, ...(ngDevMode ? [{ debugName: "data" }] : /* istanbul ignore next */ []));
|
|
4679
4689
|
color = input(null, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
4680
|
-
ctx = injectChartContext('
|
|
4690
|
+
ctx = injectChartContext('cngxScatter');
|
|
4681
4691
|
resolvedData = computed(() => {
|
|
4682
4692
|
const local = this.data();
|
|
4683
4693
|
if (local !== undefined) {
|
|
@@ -4805,7 +4815,7 @@ class CngxBand {
|
|
|
4805
4815
|
label = input(null, ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
4806
4816
|
opacity = input(null, ...(ngDevMode ? [{ debugName: "opacity" }] : /* istanbul ignore next */ []));
|
|
4807
4817
|
color = input(null, ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
4808
|
-
ctx = injectChartContext('
|
|
4818
|
+
ctx = injectChartContext('cngxBand');
|
|
4809
4819
|
rect = computed(() => {
|
|
4810
4820
|
// The plot, not the box: the band spans the area the marks live
|
|
4811
4821
|
// in, so it stops at the axis gutter instead of painting over
|
|
@@ -4955,12 +4965,13 @@ function injectPresetState(state) {
|
|
|
4955
4965
|
* with no accessible name - an unnamed meter reads to AT as a bare
|
|
4956
4966
|
* number with no subject. Same shape as the `cngx-status` warning.
|
|
4957
4967
|
* Call from the preset's constructor (needs the injection context for
|
|
4958
|
-
* `ElementRef` and `afterNextRender`)
|
|
4968
|
+
* `ElementRef` and `afterNextRender`) inside a dev-mode guard, so the
|
|
4969
|
+
* call and its hint strings strip from production builds.
|
|
4959
4970
|
*
|
|
4960
4971
|
* @internal
|
|
4961
4972
|
*/
|
|
4962
4973
|
function warnIfUnnamedPreset(selector, hint, hasName) {
|
|
4963
|
-
if (!
|
|
4974
|
+
if (!(typeof ngDevMode !== 'undefined' && ngDevMode)) {
|
|
4964
4975
|
return;
|
|
4965
4976
|
}
|
|
4966
4977
|
const el = inject(ElementRef).nativeElement;
|
|
@@ -4973,7 +4984,7 @@ function warnIfUnnamedPreset(selector, hint, hasName) {
|
|
|
4973
4984
|
if (el.getAttribute('aria-label') || el.getAttribute('aria-labelledby')) {
|
|
4974
4985
|
return;
|
|
4975
4986
|
}
|
|
4976
|
-
|
|
4987
|
+
cngxDevWarn('CNGX1010', `[${selector}] role="${el.getAttribute('role') ?? 'meter'}" has no accessible name - ` +
|
|
4977
4988
|
`AT announces the value with no subject. ${hint}`);
|
|
4978
4989
|
});
|
|
4979
4990
|
}
|
|
@@ -5137,7 +5148,9 @@ class CngxMiniBar {
|
|
|
5137
5148
|
*/
|
|
5138
5149
|
showsMeterValue = computed(() => this.activeView() === 'content', ...(ngDevMode ? [{ debugName: "showsMeterValue" }] : /* istanbul ignore next */ []));
|
|
5139
5150
|
constructor() {
|
|
5140
|
-
|
|
5151
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
5152
|
+
warnIfUnnamedPreset('cngx-mini-bar', 'Bind [label] or [aria-label].', () => !!(this.ariaLabel() ?? this.label()));
|
|
5153
|
+
}
|
|
5141
5154
|
}
|
|
5142
5155
|
percent = computed(() => clampedRatio(this.value(), this.min(), this.max()) * 100, ...(ngDevMode ? [{ debugName: "percent" }] : /* istanbul ignore next */ []));
|
|
5143
5156
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxMiniBar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -5235,7 +5248,9 @@ class CngxDeviationBar {
|
|
|
5235
5248
|
*/
|
|
5236
5249
|
showsMeterValue = computed(() => this.activeView() === 'content', ...(ngDevMode ? [{ debugName: "showsMeterValue" }] : /* istanbul ignore next */ []));
|
|
5237
5250
|
constructor() {
|
|
5238
|
-
|
|
5251
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
5252
|
+
warnIfUnnamedPreset('cngx-deviation-bar', 'Bind [aria-label].', () => !!this.ariaLabel());
|
|
5253
|
+
}
|
|
5239
5254
|
}
|
|
5240
5255
|
/**
|
|
5241
5256
|
* The meter's valid range is centred on the baseline, not on zero:
|
|
@@ -5481,7 +5496,9 @@ class CngxDonut {
|
|
|
5481
5496
|
*/
|
|
5482
5497
|
showsMeterValue = computed(() => this.activeView() === 'content', ...(ngDevMode ? [{ debugName: "showsMeterValue" }] : /* istanbul ignore next */ []));
|
|
5483
5498
|
constructor() {
|
|
5484
|
-
|
|
5499
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
5500
|
+
warnIfUnnamedPreset('cngx-donut', 'Bind [label] or [aria-label].', () => !!(this.ariaLabel() ?? this.label()));
|
|
5501
|
+
}
|
|
5485
5502
|
}
|
|
5486
5503
|
center = computed(() => this.size() / 2, ...(ngDevMode ? [{ debugName: "center" }] : /* istanbul ignore next */ []));
|
|
5487
5504
|
radius = computed(() => (this.size() - this.thickness()) / 2, ...(ngDevMode ? [{ debugName: "radius" }] : /* istanbul ignore next */ []));
|
|
@@ -5645,7 +5662,9 @@ class CngxBullet {
|
|
|
5645
5662
|
*/
|
|
5646
5663
|
showsMeterValue = computed(() => this.activeView() === 'content', ...(ngDevMode ? [{ debugName: "showsMeterValue" }] : /* istanbul ignore next */ []));
|
|
5647
5664
|
constructor() {
|
|
5648
|
-
|
|
5665
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
5666
|
+
warnIfUnnamedPreset('cngx-bullet', 'Bind [aria-label].', () => !!this.ariaLabel());
|
|
5667
|
+
}
|
|
5649
5668
|
}
|
|
5650
5669
|
maxValue = computed(() => {
|
|
5651
5670
|
const explicit = this.max();
|