@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.
Files changed (52) hide show
  1. package/command/README.md +29 -0
  2. package/data/README.md +5 -2
  3. package/fesm2022/cngx-common-a11y.mjs +403 -84
  4. package/fesm2022/cngx-common-a11y.mjs.map +1 -1
  5. package/fesm2022/cngx-common-audio.mjs +16 -13
  6. package/fesm2022/cngx-common-audio.mjs.map +1 -1
  7. package/fesm2022/cngx-common-card.mjs +4 -3
  8. package/fesm2022/cngx-common-card.mjs.map +1 -1
  9. package/fesm2022/cngx-common-chart.mjs +55 -36
  10. package/fesm2022/cngx-common-chart.mjs.map +1 -1
  11. package/fesm2022/cngx-common-command.mjs +60 -6
  12. package/fesm2022/cngx-common-command.mjs.map +1 -1
  13. package/fesm2022/cngx-common-data.mjs +185 -37
  14. package/fesm2022/cngx-common-data.mjs.map +1 -1
  15. package/fesm2022/cngx-common-dialog.mjs +86 -48
  16. package/fesm2022/cngx-common-dialog.mjs.map +1 -1
  17. package/fesm2022/cngx-common-display.mjs +27 -23
  18. package/fesm2022/cngx-common-display.mjs.map +1 -1
  19. package/fesm2022/cngx-common-interactive.mjs +324 -122
  20. package/fesm2022/cngx-common-interactive.mjs.map +1 -1
  21. package/fesm2022/cngx-common-layout.mjs +129 -26
  22. package/fesm2022/cngx-common-layout.mjs.map +1 -1
  23. package/fesm2022/cngx-common-popover.mjs +947 -33
  24. package/fesm2022/cngx-common-popover.mjs.map +1 -1
  25. package/fesm2022/cngx-common-stepper.mjs +300 -166
  26. package/fesm2022/cngx-common-stepper.mjs.map +1 -1
  27. package/fesm2022/cngx-common-tabs.mjs +251 -80
  28. package/fesm2022/cngx-common-tabs.mjs.map +1 -1
  29. package/fesm2022/cngx-common-timeline.mjs +16 -10
  30. package/fesm2022/cngx-common-timeline.mjs.map +1 -1
  31. package/fesm2022/cngx-common.mjs +1 -1
  32. package/layout/README.md +16 -0
  33. package/package.json +20 -7
  34. package/popover/README.md +40 -0
  35. package/schematics/collection.json +9 -0
  36. package/schematics/ng-add/index.js +9 -0
  37. package/schematics/ng-add/schema.json +91 -0
  38. package/schematics/package.json +3 -0
  39. package/stepper/README.md +5 -4
  40. package/theming/components/cngx-popover-sheet.css +402 -0
  41. package/theming/components/cngx-popover.css +10 -6
  42. package/types/cngx-common-a11y.d.ts +167 -14
  43. package/types/cngx-common-chart.d.ts +8 -7
  44. package/types/cngx-common-command.d.ts +19 -2
  45. package/types/cngx-common-data.d.ts +164 -26
  46. package/types/cngx-common-dialog.d.ts +3 -7
  47. package/types/cngx-common-interactive.d.ts +52 -17
  48. package/types/cngx-common-layout.d.ts +37 -5
  49. package/types/cngx-common-popover.d.ts +353 -13
  50. package/types/cngx-common-stepper.d.ts +168 -129
  51. package/types/cngx-common-tabs.d.ts +149 -30
  52. 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, isDevMode, afterNextRender, TemplateRef, contentChild, makeEnvironmentProviders, untracked } from '@angular/core';
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 (isDevMode()) {
961
+ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
961
962
  afterNextRender(() => {
962
963
  const el = this.elRef.nativeElement;
963
- if (!this.label() && !el.getAttribute('aria-label') && !el.getAttribute('aria-labelledby')) {
964
- console.warn('cngx-status: no `label` and no external `aria-label`/`aria-labelledby`; ' +
965
- 'the status has no accessible name and reads only as a coloured dot. ' +
966
- 'Set [label] or an aria-label on the host.');
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
- console.warn('cngx-status: [glyph]="false" with no visible `label`; a bare coloured ' +
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 (isDevMode()) {
1413
+ if (typeof ngDevMode !== 'undefined' && ngDevMode) {
1413
1414
  effect(() => {
1414
1415
  if (!this.isValidDate()) {
1415
- console.warn('[CngxTime] [date] resolved to an Invalid Date - rendering empty. ' +
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 bare `<div>` - AT reads the label but won't
2565
- // announce "list, N items". One-shot, tree-shaken in prod.
2566
- afterNextRender(() => {
2567
- const { label, semanticList } = untracked(() => ({
2568
- label: this.label(),
2569
- semanticList: this.semanticList(),
2570
- }));
2571
- if (isDevMode() && label && !semanticList) {
2572
- console.warn('[cngx-tag-group] [label] is bound without [semanticList]="true"; ' +
2573
- 'the aria-label lands on a generic <div>. Add ' +
2574
- '[semanticList]="true" to expose role="list" + aria-label, ' +
2575
- 'or remove [label].');
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: `