@cngx/common 0.1.0-rc.7 → 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/card/README.md +2 -1
- package/command/README.md +29 -0
- package/data/README.md +15 -3
- package/dialog/README.md +23 -1
- package/fesm2022/cngx-common-a11y.mjs +517 -184
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +62 -17
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +301 -46
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +1221 -479
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +97 -16
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +1496 -499
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +236 -61
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +364 -93
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +2040 -1046
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +955 -125
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +1293 -89
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +997 -453
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +1794 -1265
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +151 -61
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/interactive/README.md +15 -4
- package/layout/README.md +37 -1
- package/package.json +20 -7
- package/popover/README.md +58 -2
- 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 +11 -8
- package/theming/components/cngx-accordion.css +1 -1
- package/theming/components/cngx-backdrop.css +12 -0
- package/theming/components/cngx-button-toggle.css +29 -3
- package/theming/components/cngx-data-grid.css +168 -1
- package/theming/components/cngx-dialog.css +13 -0
- package/theming/components/cngx-listbox.css +21 -12
- package/theming/components/cngx-menu.css +56 -16
- package/theming/components/cngx-popover-sheet.css +402 -0
- package/theming/components/cngx-popover.css +28 -0
- package/theming/components/cngx-recycler-placeholder.css +196 -0
- package/theming/components/cngx-ripple.css +1 -1
- package/theming/components/cngx-slider.css +32 -1
- package/theming/components/cngx-tooltip.css +12 -0
- package/timeline/README.md +155 -0
- package/types/cngx-common-a11y.d.ts +205 -28
- package/types/cngx-common-card.d.ts +201 -17
- package/types/cngx-common-chart.d.ts +345 -48
- package/types/cngx-common-command.d.ts +50 -10
- package/types/cngx-common-data.d.ts +743 -92
- package/types/cngx-common-dialog.d.ts +161 -10
- package/types/cngx-common-display.d.ts +356 -142
- package/types/cngx-common-interactive.d.ts +910 -226
- package/types/cngx-common-layout.d.ts +603 -32
- package/types/cngx-common-popover.d.ts +612 -49
- package/types/cngx-common-stepper.d.ts +526 -237
- package/types/cngx-common-tabs.d.ts +358 -75
- package/types/cngx-common-timeline.d.ts +108 -22
|
@@ -183,6 +183,8 @@ declare class CngxDialog<T = unknown> implements DialogRef<T>, CngxDialogAriaReg
|
|
|
183
183
|
private readonly renderer;
|
|
184
184
|
private readonly destroyRef;
|
|
185
185
|
private readonly dialogStack;
|
|
186
|
+
private readonly labels;
|
|
187
|
+
private pendingClose;
|
|
186
188
|
private readonly titleDirective;
|
|
187
189
|
private readonly descriptionDirective;
|
|
188
190
|
private readonly registeredTitle;
|
|
@@ -325,6 +327,8 @@ declare class CngxDialog<T = unknown> implements DialogRef<T>, CngxDialogAriaReg
|
|
|
325
327
|
protected readonly ariaDescribedBy: Signal<string | null>;
|
|
326
328
|
protected readonly backdropOpacity: Signal<"0" | "1">;
|
|
327
329
|
private liveRegion;
|
|
330
|
+
/** The title text the open announcement reads; `''` when there is none. */
|
|
331
|
+
private currentTitleText;
|
|
328
332
|
/**
|
|
329
333
|
* The modal mode latched at `open()`. Everything that depends on how the
|
|
330
334
|
* dialog actually opened derives from this - scroll-lock release, stack
|
|
@@ -419,13 +423,6 @@ declare class CngxDialog<T = unknown> implements DialogRef<T>, CngxDialogAriaReg
|
|
|
419
423
|
private scrollLockRelease;
|
|
420
424
|
private acquireScrollLock;
|
|
421
425
|
private releaseScrollLock;
|
|
422
|
-
/**
|
|
423
|
-
* The registry is single-slot per kind, so a second live registration
|
|
424
|
-
* silently wins - surface the authoring error instead of letting the
|
|
425
|
-
* two open paths resolve different labelling.
|
|
426
|
-
*/
|
|
427
|
-
private warnDoubleRegistration;
|
|
428
|
-
private warnNonModalA11y;
|
|
429
426
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxDialog<any>, never>;
|
|
430
427
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxDialog<any>, "dialog[cngxDialog]", ["cngxDialog"], { "modal": { "alias": "modal"; "required": false; "isSignal": true; }; "closeOnBackdropClick": { "alias": "closeOnBackdropClick"; "required": false; "isSignal": true; }; "closeOnEscape": { "alias": "closeOnEscape"; "required": false; "isSignal": true; }; "autoFocus": { "alias": "autoFocus"; "required": false; "isSignal": true; }; "focusFallback": { "alias": "focusFallback"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "submitAction": { "alias": "submitAction"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; }, {}, ["titleDirective", "descriptionDirective"], never, true, never>;
|
|
431
428
|
}
|
|
@@ -575,10 +572,14 @@ declare class CngxDialogDescription {
|
|
|
575
572
|
declare class CngxDialogClose {
|
|
576
573
|
private readonly dialogRef;
|
|
577
574
|
private readonly elRef;
|
|
575
|
+
private readonly labels;
|
|
578
576
|
/** Value to pass to `close()`. When `undefined`, calls `dismiss()` instead. */
|
|
579
577
|
readonly value: _angular_core.InputSignal<unknown>;
|
|
580
578
|
/**
|
|
581
|
-
* Explicit `aria-label` override.
|
|
579
|
+
* Explicit `aria-label` override. Bind a dynamic accessible name here,
|
|
580
|
+
* not through `[attr.aria-label]`: the directive owns the host's
|
|
581
|
+
* `aria-label` binding, so a second binding on the same attribute races it.
|
|
582
|
+
* A static `aria-label="..."` attribute on the host is kept as is.
|
|
582
583
|
*
|
|
583
584
|
* When not set, the directive auto-detects whether the host element
|
|
584
585
|
* has descriptive text content. If it does (e.g. "Cancel", "Confirm"),
|
|
@@ -586,11 +587,13 @@ declare class CngxDialogClose {
|
|
|
586
587
|
* empty, or visually an icon, `aria-label` defaults to `"Close dialog"`.
|
|
587
588
|
*/
|
|
588
589
|
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
590
|
+
private readonly consumerAriaLabel;
|
|
589
591
|
/** Set type="button" on <button> hosts to prevent form submit. */
|
|
590
592
|
protected readonly hostType: string | null;
|
|
591
593
|
/**
|
|
592
594
|
* Computed `aria-label`. Returns:
|
|
593
595
|
* - explicit `label()` input if set
|
|
596
|
+
* - the consumer's static `aria-label` attribute, kept as is
|
|
594
597
|
* - `null` if host text is descriptive (> 1 char, not whitespace-only)
|
|
595
598
|
* - `'Close dialog'` for icon-only / single-char content
|
|
596
599
|
*/
|
|
@@ -703,6 +706,150 @@ interface CngxDialogConfig<D = unknown, T = unknown> {
|
|
|
703
706
|
focusFallback?: HTMLElement;
|
|
704
707
|
}
|
|
705
708
|
|
|
709
|
+
/**
|
|
710
|
+
* The dialog section of a {@link CngxLanguagePack}: the interaction strings
|
|
711
|
+
* the dialog family renders on its own behalf. {@link CngxDialogLabels} is
|
|
712
|
+
* this shape; it feeds the `labels` of `CNGX_DIALOG_DEFAULTS`.
|
|
713
|
+
*
|
|
714
|
+
* @category common/dialog/i18n
|
|
715
|
+
* @since 0.1.0
|
|
716
|
+
* @relatedTo CNGX_DIALOG_DEFAULTS
|
|
717
|
+
*/
|
|
718
|
+
interface CngxDialogLanguageSection {
|
|
719
|
+
/** Implicit accessible name of `CngxDialogClose` when the trigger carries no text. */
|
|
720
|
+
readonly close: string;
|
|
721
|
+
/** Live-region text when a dialog error carries no message of its own. */
|
|
722
|
+
readonly errorFallback: string;
|
|
723
|
+
/** `aria-label` set on a promoted drag handle. */
|
|
724
|
+
readonly dragHandle: string;
|
|
725
|
+
/** `aria-roledescription` set on a promoted drag handle. */
|
|
726
|
+
readonly dragHandleRoleDescription: string;
|
|
727
|
+
/** Visually hidden keyboard-drag instruction the handle is described by. */
|
|
728
|
+
readonly dragInstructions: string;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* The English dialog section: the single source of the dialog family's
|
|
732
|
+
* English copy. The `CNGX_DIALOG_DEFAULTS` labels default to it.
|
|
733
|
+
*
|
|
734
|
+
* @category common/dialog/i18n
|
|
735
|
+
* @since 0.1.0
|
|
736
|
+
* @relatedTo CNGX_DIALOG_DEFAULTS
|
|
737
|
+
*/
|
|
738
|
+
declare const CNGX_DIALOG_LANGUAGE_EN: CngxDialogLanguageSection;
|
|
739
|
+
declare module '@cngx/core/i18n' {
|
|
740
|
+
interface CngxLanguagePack {
|
|
741
|
+
readonly dialog: CngxDialogLanguageSection;
|
|
742
|
+
}
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
/**
|
|
746
|
+
* The five interaction strings the dialog family renders on its own behalf.
|
|
747
|
+
* Every one is a fallback the consumer cannot reach declaratively: the close
|
|
748
|
+
* affordance only names itself when the trigger has no text of its own, the
|
|
749
|
+
* error fallback only fires when the thrown value is not a string, and the
|
|
750
|
+
* drag handle is labelled imperatively because the directive may promote any
|
|
751
|
+
* element to a handle. The same shape as the dialog section of a language
|
|
752
|
+
* pack, declared once as {@link CngxDialogLanguageSection}.
|
|
753
|
+
*
|
|
754
|
+
* @category common/dialog/config
|
|
755
|
+
*/
|
|
756
|
+
type CngxDialogLabels = CngxDialogLanguageSection;
|
|
757
|
+
/**
|
|
758
|
+
* App-wide dialog defaults, populated via {@link provideDialogConfig} in the
|
|
759
|
+
* root providers (or {@link provideDialogConfigAt} in a component's
|
|
760
|
+
* `viewProviders` for a sub-tree scope).
|
|
761
|
+
*
|
|
762
|
+
* Distinct from `CngxDialogConfig`, which is the per-open option bag passed to
|
|
763
|
+
* `CngxDialogOpener.open()`. This one carries defaults for every dialog in the
|
|
764
|
+
* scope; that one configures a single dialog instance.
|
|
765
|
+
*
|
|
766
|
+
* `labels` is a plain bundle or a `Signal` of one; once
|
|
767
|
+
* {@link provideDialogConfig} ran it holds a `Signal`, so the strings follow
|
|
768
|
+
* a runtime language switch. Read it through `coerceSignal` from
|
|
769
|
+
* `@cngx/core/utils`.
|
|
770
|
+
*
|
|
771
|
+
* Only `labels` today. Size / backdrop / close-on-escape / focus-fallback
|
|
772
|
+
* defaults are deliberately absent - no consumer has asked for them, and a key
|
|
773
|
+
* with no caller is configuration for its own sake.
|
|
774
|
+
*
|
|
775
|
+
* @category common/dialog/config
|
|
776
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/config/dialog-config.ts
|
|
777
|
+
* @since 0.1.0
|
|
778
|
+
*/
|
|
779
|
+
interface CngxDialogDefaults {
|
|
780
|
+
readonly labels: CngxDialogLabels | Signal<CngxDialogLabels>;
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* DI token carrying the merged {@link CngxDialogDefaults}. `providedIn: 'root'`:
|
|
784
|
+
* `labels` is the dialog section of the active language pack over the English
|
|
785
|
+
* defaults, so a consumer who provides nothing keeps today's behaviour
|
|
786
|
+
* exactly.
|
|
787
|
+
*
|
|
788
|
+
* @category common/dialog/config
|
|
789
|
+
* @wcag AA
|
|
790
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/config/dialog-config.ts
|
|
791
|
+
* @since 0.1.0
|
|
792
|
+
* @relatedTo CngxDialog, CngxDialogClose, CngxDialogDraggable
|
|
793
|
+
*/
|
|
794
|
+
declare const CNGX_DIALOG_DEFAULTS: InjectionToken<CngxDialogDefaults>;
|
|
795
|
+
/**
|
|
796
|
+
* Feature returned by a `with*` function - merged by
|
|
797
|
+
* {@link provideDialogConfig}.
|
|
798
|
+
*
|
|
799
|
+
* @category common/dialog/config
|
|
800
|
+
*/
|
|
801
|
+
interface CngxDialogConfigFeature {
|
|
802
|
+
/** @internal */
|
|
803
|
+
readonly labels?: Partial<CngxDialogLabels> | Signal<Partial<CngxDialogLabels>>;
|
|
804
|
+
}
|
|
805
|
+
/**
|
|
806
|
+
* Override dialog interaction strings. Unset keys keep the language pack's
|
|
807
|
+
* text, or the English default, and two calls merge rather than replace.
|
|
808
|
+
* Pass a `Signal` to switch the language at runtime.
|
|
809
|
+
*
|
|
810
|
+
* ```ts
|
|
811
|
+
* bootstrapApplication(AppComponent, {
|
|
812
|
+
* providers: [
|
|
813
|
+
* provideDialogConfig(
|
|
814
|
+
* withDialogLabels({ close: 'Dialog schließen', dragHandle: 'Dialog verschieben' }),
|
|
815
|
+
* ),
|
|
816
|
+
* ],
|
|
817
|
+
* });
|
|
818
|
+
* ```
|
|
819
|
+
*
|
|
820
|
+
* @category common/dialog/config
|
|
821
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/config/dialog-config.ts
|
|
822
|
+
* @since 0.1.0
|
|
823
|
+
*/
|
|
824
|
+
declare function withDialogLabels(overrides: Partial<CngxDialogLabels> | Signal<Partial<CngxDialogLabels>>): CngxDialogConfigFeature;
|
|
825
|
+
/**
|
|
826
|
+
* Register app-wide dialog defaults composed from `with*` features, applied
|
|
827
|
+
* on top of the active language pack.
|
|
828
|
+
*
|
|
829
|
+
* @category common/dialog/config
|
|
830
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/config/dialog-config.ts
|
|
831
|
+
* @since 0.1.0
|
|
832
|
+
*/
|
|
833
|
+
declare function provideDialogConfig(...features: CngxDialogConfigFeature[]): Provider[];
|
|
834
|
+
/**
|
|
835
|
+
* Sub-tree variant - use in `viewProviders` so the defaults only apply to
|
|
836
|
+
* dialogs opened from descendants of this component.
|
|
837
|
+
*
|
|
838
|
+
* @category common/dialog/config
|
|
839
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/config/dialog-config.ts
|
|
840
|
+
* @since 0.1.0
|
|
841
|
+
*/
|
|
842
|
+
declare function provideDialogConfigAt(...features: CngxDialogConfigFeature[]): Provider[];
|
|
843
|
+
/**
|
|
844
|
+
* Inject the currently-resolved dialog defaults. Safe in any injection
|
|
845
|
+
* context; falls back to the English bundle when nothing is provided.
|
|
846
|
+
*
|
|
847
|
+
* @category common/dialog/config
|
|
848
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/dialog/config/dialog-config.ts
|
|
849
|
+
* @since 0.1.0
|
|
850
|
+
*/
|
|
851
|
+
declare function injectDialogConfig(): CngxDialogDefaults;
|
|
852
|
+
|
|
706
853
|
/**
|
|
707
854
|
* Internal container component for programmatically opened dialogs.
|
|
708
855
|
*
|
|
@@ -893,6 +1040,7 @@ declare class CngxDialogOpener {
|
|
|
893
1040
|
*/
|
|
894
1041
|
closeAll(): void;
|
|
895
1042
|
private cleanup;
|
|
1043
|
+
private discardOutlet;
|
|
896
1044
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxDialogOpener, never>;
|
|
897
1045
|
static ɵprov: _angular_core.ɵɵInjectableDeclaration<CngxDialogOpener>;
|
|
898
1046
|
}
|
|
@@ -1015,6 +1163,7 @@ declare class CngxBottomSheet {
|
|
|
1015
1163
|
declare class CngxDialogDraggable {
|
|
1016
1164
|
private readonly elRef;
|
|
1017
1165
|
private readonly doc;
|
|
1166
|
+
private readonly labels;
|
|
1018
1167
|
private readonly destroyRef;
|
|
1019
1168
|
private readonly ariaRegistry;
|
|
1020
1169
|
/** Handle element for initiating drag. If not set, entire dialog is the handle. */
|
|
@@ -1071,6 +1220,8 @@ declare class CngxDialogDraggable {
|
|
|
1071
1220
|
private handleKeyDown;
|
|
1072
1221
|
/** Snap `x`/`y` to the nearest `gridSize` increment. Pass-through when grid is disabled. */
|
|
1073
1222
|
private snap;
|
|
1223
|
+
/** Re-apply the handle labels and the instruction text this directive owns. */
|
|
1224
|
+
private applyLabels;
|
|
1074
1225
|
private instructionNode;
|
|
1075
1226
|
private releaseInstruction;
|
|
1076
1227
|
private handleAddedDescribedBy;
|
|
@@ -1097,5 +1248,5 @@ declare class CngxDialogDraggable {
|
|
|
1097
1248
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxDialogDraggable, "[cngxDialogDraggable]", ["cngxDialogDraggable"], { "handle": { "alias": "handle"; "required": false; "isSignal": true; }; "constrainToViewport": { "alias": "constrainToViewport"; "required": false; "isSignal": true; }; "gridSize": { "alias": "gridSize"; "required": false; "isSignal": true; }; "snapMode": { "alias": "snapMode"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1098
1249
|
}
|
|
1099
1250
|
|
|
1100
|
-
export { CNGX_DIALOG_DATA, CngxBottomSheet, CngxDialog, CngxDialogClose, CngxDialogDescription, CngxDialogDraggable, CngxDialogOpener, CngxDialogRef, CngxDialogStack, CngxDialogTitle, DIALOG_REF, provideDialog, provideDialogStack };
|
|
1101
|
-
export type { CngxDialogConfig, DialogRef, DialogState };
|
|
1251
|
+
export { CNGX_DIALOG_DATA, CNGX_DIALOG_DEFAULTS, CNGX_DIALOG_LANGUAGE_EN, CngxBottomSheet, CngxDialog, CngxDialogClose, CngxDialogDescription, CngxDialogDraggable, CngxDialogOpener, CngxDialogRef, CngxDialogStack, CngxDialogTitle, DIALOG_REF, injectDialogConfig, provideDialog, provideDialogConfig, provideDialogConfigAt, provideDialogStack, withDialogLabels };
|
|
1252
|
+
export type { CngxDialogConfig, CngxDialogConfigFeature, CngxDialogDefaults, CngxDialogLabels, CngxDialogLanguageSection, DialogRef, DialogState };
|