@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,7 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, ViewEncapsulation, ChangeDetectionStrategy, Component, InjectionToken, inject, computed, Directive, linkedSignal, ElementRef, contentChildren, afterRenderEffect, Renderer2, effect, DestroyRef, output, booleanAttribute,
|
|
2
|
+
import { input, ViewEncapsulation, ChangeDetectionStrategy, Component, InjectionToken, inject, computed, Directive, linkedSignal, ElementRef, contentChildren, afterRenderEffect, Renderer2, effect, DestroyRef, output, booleanAttribute, afterNextRender, TemplateRef, contentChild, makeEnvironmentProviders, untracked } from '@angular/core';
|
|
3
3
|
import { formatMessage, createNestedLanguageSection, createSectionBundle } from '@cngx/core/i18n';
|
|
4
4
|
import { createOverrideMerge, injectLocale, numberFormatterFor, nextUid, memoize, dateTimeFormatterFor } from '@cngx/core/utils';
|
|
5
|
+
import { cngxDevWarn } from '@cngx/utils';
|
|
5
6
|
import { NgTemplateOutlet } from '@angular/common';
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -957,16 +958,16 @@ class CngxStatus {
|
|
|
957
958
|
/** @internal Tone glyph char bound into the decorative dot. */
|
|
958
959
|
glyphChar = computed(() => TONE_GLYPH[this.tone()], ...(ngDevMode ? [{ debugName: "glyphChar" }] : /* istanbul ignore next */ []));
|
|
959
960
|
constructor() {
|
|
960
|
-
if (
|
|
961
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
961
962
|
afterNextRender(() => {
|
|
962
963
|
const el = this.elRef.nativeElement;
|
|
963
|
-
if (!this.label() &&
|
|
964
|
-
|
|
965
|
-
'
|
|
966
|
-
'
|
|
964
|
+
if (!this.label() && el.getAttribute('aria-hidden') !== 'true') {
|
|
965
|
+
cngxDevWarn('CNGX1016', '[cngx-status] no `label`; the status has no accessible name and reads only as a ' +
|
|
966
|
+
'coloured dot. Set [label]: the host has no role, so an aria-label or ' +
|
|
967
|
+
'aria-labelledby on it is not a valid name.');
|
|
967
968
|
}
|
|
968
969
|
if (!this.glyph() && !this.label()) {
|
|
969
|
-
|
|
970
|
+
cngxDevWarn('CNGX1017', '[cngx-status] [glyph]="false" with no visible `label`; a bare coloured ' +
|
|
970
971
|
'dot is colour-only for a sighted colour-blind reader even with an ' +
|
|
971
972
|
'aria-label. Set [label] or show the glyph.');
|
|
972
973
|
}
|
|
@@ -1409,10 +1410,10 @@ class CngxTime {
|
|
|
1409
1410
|
return dateTimeFormatterFor(locale, format).format(instant);
|
|
1410
1411
|
}, ...(ngDevMode ? [{ debugName: "formatted" }] : /* istanbul ignore next */ []));
|
|
1411
1412
|
constructor() {
|
|
1412
|
-
if (
|
|
1413
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
1413
1414
|
effect(() => {
|
|
1414
1415
|
if (!this.isValidDate()) {
|
|
1415
|
-
|
|
1416
|
+
cngxDevWarn('CNGX1006', '[cngx-time] [date] resolved to an Invalid Date - rendering empty. ' +
|
|
1416
1417
|
'Check the bound value (bad ISO string?).');
|
|
1417
1418
|
}
|
|
1418
1419
|
});
|
|
@@ -2561,20 +2562,23 @@ class CngxTagGroup {
|
|
|
2561
2562
|
a.count === b.count });
|
|
2562
2563
|
constructor() {
|
|
2563
2564
|
// Dev-mode advisory: `[label]` without `[semanticList]="true"` lands
|
|
2564
|
-
// `aria-label` on a
|
|
2565
|
-
//
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
semanticList
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
'[
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2565
|
+
// `aria-label` on a role-less host, where ARIA prohibits naming, so most
|
|
2566
|
+
// AT drops the label and no "list, N items" is announced. One-shot,
|
|
2567
|
+
// tree-shaken in prod.
|
|
2568
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
2569
|
+
afterNextRender(() => {
|
|
2570
|
+
const { label, semanticList } = untracked(() => ({
|
|
2571
|
+
label: this.label(),
|
|
2572
|
+
semanticList: this.semanticList(),
|
|
2573
|
+
}));
|
|
2574
|
+
if (label && !semanticList) {
|
|
2575
|
+
cngxDevWarn('CNGX1018', '[cngx-tag-group] [label] is bound without [semanticList]="true"; ' +
|
|
2576
|
+
'the aria-label lands on a generic <div>. Add ' +
|
|
2577
|
+
'[semanticList]="true" to expose role="list" + aria-label, ' +
|
|
2578
|
+
'or remove [label].');
|
|
2579
|
+
}
|
|
2580
|
+
});
|
|
2581
|
+
}
|
|
2578
2582
|
}
|
|
2579
2583
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTagGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2580
2584
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxTagGroup, isStandalone: true, selector: "cngx-tag-group", inputs: { gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, semanticListInput: { classPropertyName: "semanticListInput", publicName: "semanticList", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cngx-tag-group--gap-xs": "gap() === 'xs'", "class.cngx-tag-group--gap-md": "gap() === 'md'", "class.cngx-tag-group--align-start": "align() === 'start'", "class.cngx-tag-group--align-center": "align() === 'center'", "class.cngx-tag-group--align-end": "align() === 'end'", "class.cngx-tag-group--align-between": "align() === 'between'", "attr.role": "semanticList() ? 'list' : null", "attr.aria-label": "label() ?? null" }, classAttribute: "cngx-tag-group" }, providers: [{ provide: CNGX_TAG_GROUP, useExisting: CngxTagGroup }], queries: [{ propertyName: "headerSlot", first: true, predicate: CngxTagGroupHeader, descendants: true, isSignal: true }, { propertyName: "accessorySlot", first: true, predicate: CngxTagGroupAccessory, descendants: true, isSignal: true }, { propertyName: "projectedTags", predicate: CngxTag, isSignal: true }], exportAs: ["cngxTagGroup"], ngImport: i0, template: `
|