@ethlete/core 5.0.0-next.72 → 5.0.0-next.73
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/CHANGELOG.md +13 -0
- package/design/theme-css.js +6 -0
- package/design/theme-css.ts +14 -0
- package/fesm2022/ethlete-core.mjs +4520 -4520
- package/fesm2022/ethlete-core.mjs.map +1 -1
- package/generators/generators.json +3 -0
- package/generators/tailwind-4-surface-theme/generator.js +10 -0
- package/migrations.json +18 -0
- package/package.json +1 -1
- package/types/ethlete-core.d.ts +330 -330
package/types/ethlete-core.d.ts
CHANGED
|
@@ -891,193 +891,6 @@ export type ElementScrollState = {
|
|
|
891
891
|
};
|
|
892
892
|
export declare const signalElementScrollState: (el: SignalElementBindingType, options?: SignalElementScrollStateOptions) => Signal<ElementScrollState>;
|
|
893
893
|
export declare const signalHostElementScrollState: () => Signal<ElementScrollState>;
|
|
894
|
-
export declare const injectAngularRootElement: import("@ethlete/core").InjectFn<import("@angular/core").WritableSignal<HTMLElement | null>>;
|
|
895
|
-
export declare const provideBoundaryElement: () => import("@angular/core").StaticProvider[];
|
|
896
|
-
export declare const injectBoundaryElement: import("@ethlete/core").InjectFn<{
|
|
897
|
-
value: import("@angular/core").Signal<HTMLElement>;
|
|
898
|
-
override: import("@angular/core").WritableSignal<HTMLElement | null>;
|
|
899
|
-
}>;
|
|
900
|
-
export declare const BOUNDARY_ELEMENT_TOKEN: import("@angular/core").InjectionToken<{
|
|
901
|
-
value: import("@angular/core").Signal<HTMLElement>;
|
|
902
|
-
override: import("@angular/core").WritableSignal<HTMLElement | null>;
|
|
903
|
-
}>;
|
|
904
|
-
export type FileDownloadOptions = {
|
|
905
|
-
/**
|
|
906
|
-
* The file's body - a string, a `Blob`, or the parts to build one from. A `Blob` is re-wrapped, so
|
|
907
|
-
* {@link FileDownloadOptions.type} still decides the MIME type.
|
|
908
|
-
*/
|
|
909
|
-
content: BlobPart | BlobPart[];
|
|
910
|
-
/** The name the browser saves the file under, extension included. */
|
|
911
|
-
filename: string;
|
|
912
|
-
/** MIME type of the generated blob, e.g. `application/json`. */
|
|
913
|
-
type?: string;
|
|
914
|
-
};
|
|
915
|
-
/**
|
|
916
|
-
* Hands the user a file the browser downloads. Call it once from an injection context - a field
|
|
917
|
-
* initializer - and the function it hands back can then be called from anywhere, including a click
|
|
918
|
-
* handler.
|
|
919
|
-
*
|
|
920
|
-
* A no-op where there is no browser (server-side rendering), so a toolbar button needs no platform
|
|
921
|
-
* check of its own. Use {@link createObjectUrlHandle} instead when the URL has to outlive the call.
|
|
922
|
-
*
|
|
923
|
-
* @example
|
|
924
|
-
* private download = injectFileDownload();
|
|
925
|
-
*
|
|
926
|
-
* protected save() {
|
|
927
|
-
* this.download({ content: json, filename: 'session.json', type: 'application/json' });
|
|
928
|
-
* }
|
|
929
|
-
*/
|
|
930
|
-
export declare const injectFileDownload: () => (options: FileDownloadOptions) => void;
|
|
931
|
-
export declare const provideFocusVisibleTracker: () => import("@angular/core").StaticProvider[];
|
|
932
|
-
export declare const injectFocusVisibleTracker: import("@ethlete/core").InjectFn<{
|
|
933
|
-
isFocusVisible: import("@angular/core").Signal<boolean>;
|
|
934
|
-
}>;
|
|
935
|
-
export declare const FOCUS_VISIBLE_TRACKER_TOKEN: import("@angular/core").InjectionToken<{
|
|
936
|
-
isFocusVisible: import("@angular/core").Signal<boolean>;
|
|
937
|
-
}>;
|
|
938
|
-
/**
|
|
939
|
-
* A label set, or a function building one for a locale. The function form is called again whenever
|
|
940
|
-
* {@link injectLocale}'s `currentLocale` changes, so a locale switch re-renders the wording without
|
|
941
|
-
* reloading - that is the seam an app's i18n library plugs into.
|
|
942
|
-
*/
|
|
943
|
-
export type LabelsSource<T> = Partial<T> | ((locale: string) => Partial<T>);
|
|
944
|
-
/** What {@link defineLabels} returns. */
|
|
945
|
-
export type LabelsDefinition<T> = {
|
|
946
|
-
readonly provide: (labels: LabelsSource<T>) => Provider;
|
|
947
|
-
readonly inject: () => Signal<T>;
|
|
948
|
-
readonly token: InjectionToken<LabelsSource<T>>;
|
|
949
|
-
};
|
|
950
|
-
/**
|
|
951
|
-
* The one mechanism for the strings a component renders or announces itself. Every domain in the UI
|
|
952
|
-
* library that has such strings exposes exactly this pair - `provide<Domain>Labels` to localize a
|
|
953
|
-
* subtree, `inject<Domain>Labels()` to read the result - so localizing an app is the same move
|
|
954
|
-
* repeated per domain rather than a different one each time.
|
|
955
|
-
*
|
|
956
|
-
* `defaults` may itself be locale-derived, for a domain that ships more than one language (the
|
|
957
|
-
* `@ethlete/query` error tables, say). Overrides are partial and layer on top of whatever the locale
|
|
958
|
-
* resolved to, so translating into a third language while keeping a shipped one as the base is the
|
|
959
|
-
* same call.
|
|
960
|
-
*
|
|
961
|
-
* The injector returns a **signal**, because both halves can change at runtime - read it in a
|
|
962
|
-
* template or computed, never destructure it once.
|
|
963
|
-
*
|
|
964
|
-
* @example
|
|
965
|
-
* export type BreadcrumbLabels = { navigation: string; overflow: string };
|
|
966
|
-
*
|
|
967
|
-
* export const DEFAULT_BREADCRUMB_LABELS: BreadcrumbLabels = {
|
|
968
|
-
* navigation: 'Breadcrumb',
|
|
969
|
-
* overflow: 'Show hidden levels',
|
|
970
|
-
* };
|
|
971
|
-
*
|
|
972
|
-
* const BREADCRUMB_LABELS_DEF = defineLabels<BreadcrumbLabels>('BREADCRUMB_LABELS', DEFAULT_BREADCRUMB_LABELS);
|
|
973
|
-
*
|
|
974
|
-
* export const provideBreadcrumbLabels = toProvideFn(BREADCRUMB_LABELS_DEF);
|
|
975
|
-
* export const injectBreadcrumbLabels = toInjectFn(BREADCRUMB_LABELS_DEF);
|
|
976
|
-
* export const BREADCRUMB_LABELS = toToken(BREADCRUMB_LABELS_DEF);
|
|
977
|
-
*
|
|
978
|
-
* @example
|
|
979
|
-
* // consumer, fixed wording
|
|
980
|
-
* provideBreadcrumbLabels({ navigation: 'Brotkrumen' });
|
|
981
|
-
*
|
|
982
|
-
* // consumer, driven by the app's i18n and re-resolved on a locale change
|
|
983
|
-
* provideBreadcrumbLabels((locale) => ({ navigation: translate('breadcrumb.nav', locale) }));
|
|
984
|
-
*/
|
|
985
|
-
export declare const defineLabels: <T extends object>(name: string, defaults: T | ((locale: string) => T)) => LabelsDefinition<T>;
|
|
986
|
-
type Locale = {
|
|
987
|
-
currentLocale: WritableSignal<string>;
|
|
988
|
-
};
|
|
989
|
-
/** Provides the app locale, starting at `locale` (default `'en'`). Change it later with `injectLocale().currentLocale.set(...)`. */
|
|
990
|
-
export declare const provideLocale: (locale?: string) => StaticProvider[];
|
|
991
|
-
export declare const injectLocale: () => Locale;
|
|
992
|
-
export declare const provideRenderer: () => import("@angular/core").StaticProvider[];
|
|
993
|
-
export declare const injectRenderer: import("@ethlete/core").InjectFn<{
|
|
994
|
-
addClass: (element: HTMLElement, ...classes: string[]) => void;
|
|
995
|
-
removeClass: (element: HTMLElement, ...classes: string[]) => void;
|
|
996
|
-
toggleClass: (element: HTMLElement, className: string, force?: boolean) => boolean;
|
|
997
|
-
setStyle: (element: HTMLElement, style: Partial<Record<keyof CSSStyleDeclaration, string | null>>, flags?: RendererStyleFlags2) => void;
|
|
998
|
-
removeStyle: (element: HTMLElement, style: keyof CSSStyleDeclaration | string, flags?: RendererStyleFlags2) => void;
|
|
999
|
-
removeStyles: (element: HTMLElement, ...styles: (keyof CSSStyleDeclaration | string)[]) => void;
|
|
1000
|
-
setAttribute: (element: Element, name: string, value: string | null, namespace?: string | null) => void;
|
|
1001
|
-
removeAttribute: (element: Element, ...names: string[]) => void;
|
|
1002
|
-
setProperty: (element: HTMLElement, name: string, value: unknown) => void;
|
|
1003
|
-
setProperties: (element: HTMLElement, properties: Record<string, unknown>) => void;
|
|
1004
|
-
createElement: <K extends keyof HTMLElementTagNameMap>(tagName: K, namespace?: string | null) => HTMLElementTagNameMap[K];
|
|
1005
|
-
createText: (value: string) => Text;
|
|
1006
|
-
createComment: (value: string) => Comment;
|
|
1007
|
-
appendChild: (parent: HTMLElement, newChild: Node) => void;
|
|
1008
|
-
insertBefore: (parent: Node, newChild: Node, refChild: Node | null) => void;
|
|
1009
|
-
removeChild: (parent: Node, oldChild: Node, isHostElement?: boolean) => void;
|
|
1010
|
-
selectRootElement: (selectorOrNode: string | HTMLElement, preserveContent?: boolean) => HTMLElement;
|
|
1011
|
-
parentNode: (node: Node) => Node | null;
|
|
1012
|
-
nextSibling: (node: Node) => Node | null;
|
|
1013
|
-
setValue: (node: Node, value: string) => void;
|
|
1014
|
-
listen: (target: HTMLElement | Window | Document | "window" | "document" | "body", eventName: string, callback: (event: Event) => boolean | void) => (() => void);
|
|
1015
|
-
destroyNode: (node: Node) => void;
|
|
1016
|
-
replaceChild: (parent: Node, newChild: Node, oldChild: Node) => void;
|
|
1017
|
-
empty: (element: HTMLElement) => void;
|
|
1018
|
-
setTextContent: (element: HTMLElement, text: string) => void;
|
|
1019
|
-
setAttributes: (element: HTMLElement, attributes: Record<string, string | null>, namespace?: string | null) => void;
|
|
1020
|
-
setDataAttributes: (element: HTMLElement, data: Record<string, string | null>) => void;
|
|
1021
|
-
setCssProperty: (element: HTMLElement, name: string, value: string | null) => void;
|
|
1022
|
-
setCssProperties: (element: HTMLElement, properties: Record<string, string | null>) => void;
|
|
1023
|
-
moveBefore: (config: {
|
|
1024
|
-
newParent: HTMLElement;
|
|
1025
|
-
child: HTMLElement;
|
|
1026
|
-
before?: Node | null;
|
|
1027
|
-
}) => void;
|
|
1028
|
-
renderer: import("@angular/core").Renderer2;
|
|
1029
|
-
}>;
|
|
1030
|
-
export type AngularRenderer = NonNullable<ReturnType<typeof injectRenderer>>;
|
|
1031
|
-
export type StyleManager = {
|
|
1032
|
-
mount: <TComponent>(component: Type<TComponent>) => ComponentRef<TComponent>;
|
|
1033
|
-
};
|
|
1034
|
-
export declare const provideStyleManager: () => import("@angular/core").StaticProvider[];
|
|
1035
|
-
export declare const injectStyleManager: import("@ethlete/core").InjectFn<StyleManager>;
|
|
1036
|
-
export type ConsentHandler = {
|
|
1037
|
-
/** Signal that is `true` when consent has been granted. */
|
|
1038
|
-
isGranted: Signal<boolean>;
|
|
1039
|
-
/** Grants consent and writes the decision back to the source. */
|
|
1040
|
-
grant: () => void;
|
|
1041
|
-
/** Revokes consent and writes the decision back to the source. */
|
|
1042
|
-
revoke?: () => void;
|
|
1043
|
-
};
|
|
1044
|
-
export type CreateUserConsentProviderOptions = {
|
|
1045
|
-
/** The `InjectionToken` this consent provider should be associated with. */
|
|
1046
|
-
for: InjectionToken<ConsentHandler | null>;
|
|
1047
|
-
/**
|
|
1048
|
-
* Factory executed inside the injection context that returns a `Signal<boolean>`.
|
|
1049
|
-
*
|
|
1050
|
-
* @example
|
|
1051
|
-
* isGranted: () => inject(CookieService).hasMediaConsent
|
|
1052
|
-
*/
|
|
1053
|
-
isGranted: () => Signal<boolean>;
|
|
1054
|
-
/**
|
|
1055
|
-
* Factory executed inside the injection context that returns the grant function.
|
|
1056
|
-
*
|
|
1057
|
-
* @example
|
|
1058
|
-
* grant: () => () => inject(CookieService).acceptAll()
|
|
1059
|
-
*/
|
|
1060
|
-
grant: () => () => void;
|
|
1061
|
-
/**
|
|
1062
|
-
* Factory executed inside the injection context that returns the revoke function.
|
|
1063
|
-
*
|
|
1064
|
-
* @example
|
|
1065
|
-
* revoke : () => () => inject(CookieService).revokeAll()
|
|
1066
|
-
*/
|
|
1067
|
-
revoke?: () => () => void;
|
|
1068
|
-
};
|
|
1069
|
-
export declare const createUserConsentProvider: (options: CreateUserConsentProviderOptions) => Provider;
|
|
1070
|
-
/**
|
|
1071
|
-
* Declares the `et-visually-hidden` class as a styles-only component: content that stays in the
|
|
1072
|
-
* accessibility tree but is clipped out of the layout. Mount it from any component whose template
|
|
1073
|
-
* uses the class.
|
|
1074
|
-
*/
|
|
1075
|
-
export declare class VisuallyHiddenStylesComponent {
|
|
1076
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<VisuallyHiddenStylesComponent, never>;
|
|
1077
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<VisuallyHiddenStylesComponent, "et-visually-hidden-styles", never, {}, {}, never, never, true, never>;
|
|
1078
|
-
}
|
|
1079
|
-
/** Mounts {@link VisuallyHiddenStylesComponent}. Call from an injection context. */
|
|
1080
|
-
export declare const mountVisuallyHidden: () => import("@angular/core").ComponentRef<VisuallyHiddenStylesComponent>;
|
|
1081
894
|
/** Inject a signal containing a boolean value indicating if the viewport is xs */
|
|
1082
895
|
export declare const injectIsXs: () => import("@angular/core").Signal<boolean>;
|
|
1083
896
|
/** Inject a signal containing a boolean value indicating if the viewport is sm */
|
|
@@ -1980,53 +1793,240 @@ type OverlayRuntimeRef<TComponent extends object = object, TResult = unknown> =
|
|
|
1980
1793
|
/** Adds or removes the backdrop of an open overlay. A closing overlay keeps the backdrop it has. */
|
|
1981
1794
|
updateBackdrop(hasBackdrop: boolean): void;
|
|
1982
1795
|
};
|
|
1983
|
-
export declare const FOCUSABLE_SELECTOR: string;
|
|
1984
|
-
export declare const isHTMLElement: (value: unknown) => value is HTMLElement;
|
|
1985
|
-
export declare const isElement: (value: unknown) => value is Element;
|
|
1986
|
-
export declare const isHTMLOrSVGElement: (value: unknown) => value is HTMLElement | SVGElement;
|
|
1987
|
-
/**
|
|
1988
|
-
* Whether the overlay rooted at `hostElement` is still the owner of DOM focus - focus is inside it, or
|
|
1989
|
-
* nothing is focused. False once the user has moved focus somewhere else.
|
|
1990
|
-
*/
|
|
1991
|
-
export declare const ownsActiveElement: (hostElement: HTMLElement, document: Document) => boolean;
|
|
1992
|
-
export declare const isFocusable: (element: HTMLElement, document: Document) => boolean;
|
|
1993
|
-
/** The elements Tab stops on inside `container`, with each named radio group collapsed to its checked (else first) radio. */
|
|
1994
|
-
export declare const getFocusableElements: (container: HTMLElement, document: Document) => HTMLElement[];
|
|
1995
|
-
export declare const getHeadingElement: (container: HTMLElement) => HTMLElement | null;
|
|
1996
|
-
export declare const focusElement: (element: HTMLElement | null) => void;
|
|
1997
|
-
export declare const applyInitialFocus: (paneElement: HTMLElement, autoFocus: OverlayRuntimeAutoFocusTarget | string | false, document: Document) => void;
|
|
1998
|
-
export declare const setupFocusTrap: (paneElement: HTMLElement, overlayRef: OverlayRuntimeRef<object, unknown>, enabled: boolean, isTopMost: (ref: OverlayRuntimeRef<object, unknown>) => boolean, document: Document) => () => void;
|
|
1999
|
-
/**
|
|
2000
|
-
* Attribute an element uses to declare the stacking level it paints at. Its value is the z-index of
|
|
2001
|
-
* the runtime root an overlay opened from inside it mounts into, and the level every outside-pointer
|
|
2002
|
-
* close compares a press against.
|
|
2003
|
-
*/
|
|
2004
|
-
export declare const OVERLAY_LAYER_ATTRIBUTE = "data-et-overlay-layer";
|
|
2005
|
-
/**
|
|
2006
|
-
* The stacking level overlays mount at when nothing above their origin declares another one. Near
|
|
2007
|
-
* int32 max, so an overlay outranks an arbitrary host application's own stacking.
|
|
2008
|
-
*/
|
|
2009
|
-
export declare const DEFAULT_OVERLAY_LAYER = 2147483003;
|
|
2010
|
-
/**
|
|
2011
|
-
* The stacking level for an overlay opened from `element`: the one declared by the nearest ancestor
|
|
2012
|
-
* carrying `data-et-overlay-layer`, or {@link DEFAULT_OVERLAY_LAYER}.
|
|
2013
|
-
*
|
|
2014
|
-
* Put the attribute on anything that paints above the default overlay layer - a devtools panel, an
|
|
2015
|
-
* always-on-top widget - so a menu, tooltip or dialog opened inside it is not rendered behind the
|
|
2016
|
-
* thing that opened it, and so working in it does not close an overlay below it. Overlays sharing a
|
|
2017
|
-
* level share a runtime root and stack in open order.
|
|
2018
|
-
*/
|
|
2019
|
-
export declare const resolveOverlayLayer: (element: Element | null | undefined) => number;
|
|
1796
|
+
export declare const FOCUSABLE_SELECTOR: string;
|
|
1797
|
+
export declare const isHTMLElement: (value: unknown) => value is HTMLElement;
|
|
1798
|
+
export declare const isElement: (value: unknown) => value is Element;
|
|
1799
|
+
export declare const isHTMLOrSVGElement: (value: unknown) => value is HTMLElement | SVGElement;
|
|
1800
|
+
/**
|
|
1801
|
+
* Whether the overlay rooted at `hostElement` is still the owner of DOM focus - focus is inside it, or
|
|
1802
|
+
* nothing is focused. False once the user has moved focus somewhere else.
|
|
1803
|
+
*/
|
|
1804
|
+
export declare const ownsActiveElement: (hostElement: HTMLElement, document: Document) => boolean;
|
|
1805
|
+
export declare const isFocusable: (element: HTMLElement, document: Document) => boolean;
|
|
1806
|
+
/** The elements Tab stops on inside `container`, with each named radio group collapsed to its checked (else first) radio. */
|
|
1807
|
+
export declare const getFocusableElements: (container: HTMLElement, document: Document) => HTMLElement[];
|
|
1808
|
+
export declare const getHeadingElement: (container: HTMLElement) => HTMLElement | null;
|
|
1809
|
+
export declare const focusElement: (element: HTMLElement | null) => void;
|
|
1810
|
+
export declare const applyInitialFocus: (paneElement: HTMLElement, autoFocus: OverlayRuntimeAutoFocusTarget | string | false, document: Document) => void;
|
|
1811
|
+
export declare const setupFocusTrap: (paneElement: HTMLElement, overlayRef: OverlayRuntimeRef<object, unknown>, enabled: boolean, isTopMost: (ref: OverlayRuntimeRef<object, unknown>) => boolean, document: Document) => () => void;
|
|
1812
|
+
/**
|
|
1813
|
+
* Attribute an element uses to declare the stacking level it paints at. Its value is the z-index of
|
|
1814
|
+
* the runtime root an overlay opened from inside it mounts into, and the level every outside-pointer
|
|
1815
|
+
* close compares a press against.
|
|
1816
|
+
*/
|
|
1817
|
+
export declare const OVERLAY_LAYER_ATTRIBUTE = "data-et-overlay-layer";
|
|
1818
|
+
/**
|
|
1819
|
+
* The stacking level overlays mount at when nothing above their origin declares another one. Near
|
|
1820
|
+
* int32 max, so an overlay outranks an arbitrary host application's own stacking.
|
|
1821
|
+
*/
|
|
1822
|
+
export declare const DEFAULT_OVERLAY_LAYER = 2147483003;
|
|
1823
|
+
/**
|
|
1824
|
+
* The stacking level for an overlay opened from `element`: the one declared by the nearest ancestor
|
|
1825
|
+
* carrying `data-et-overlay-layer`, or {@link DEFAULT_OVERLAY_LAYER}.
|
|
1826
|
+
*
|
|
1827
|
+
* Put the attribute on anything that paints above the default overlay layer - a devtools panel, an
|
|
1828
|
+
* always-on-top widget - so a menu, tooltip or dialog opened inside it is not rendered behind the
|
|
1829
|
+
* thing that opened it, and so working in it does not close an overlay below it. Overlays sharing a
|
|
1830
|
+
* level share a runtime root and stack in open order.
|
|
1831
|
+
*/
|
|
1832
|
+
export declare const resolveOverlayLayer: (element: Element | null | undefined) => number;
|
|
1833
|
+
/**
|
|
1834
|
+
* Whether `target` sits on a stacking level above `layer` - a press inside the query devtools panel
|
|
1835
|
+
* while an application overlay is open, for example.
|
|
1836
|
+
*
|
|
1837
|
+
* Every outside-pointer close asks this first: a press on a surface that paints over an overlay is
|
|
1838
|
+
* aimed at that surface, not at the content the overlay covers, so it must not close the overlay.
|
|
1839
|
+
* The level of a press inside another overlay resolves through that overlay's runtime root, so a
|
|
1840
|
+
* menu opened from the devtools panel counts as part of the panel's level too.
|
|
1841
|
+
*/
|
|
1842
|
+
export declare const isOnHigherOverlayLayer: (target: EventTarget | null | undefined, layer: number) => boolean;
|
|
1843
|
+
export declare const injectAngularRootElement: import("@ethlete/core").InjectFn<import("@angular/core").WritableSignal<HTMLElement | null>>;
|
|
1844
|
+
export declare const provideBoundaryElement: () => import("@angular/core").StaticProvider[];
|
|
1845
|
+
export declare const injectBoundaryElement: import("@ethlete/core").InjectFn<{
|
|
1846
|
+
value: import("@angular/core").Signal<HTMLElement>;
|
|
1847
|
+
override: import("@angular/core").WritableSignal<HTMLElement | null>;
|
|
1848
|
+
}>;
|
|
1849
|
+
export declare const BOUNDARY_ELEMENT_TOKEN: import("@angular/core").InjectionToken<{
|
|
1850
|
+
value: import("@angular/core").Signal<HTMLElement>;
|
|
1851
|
+
override: import("@angular/core").WritableSignal<HTMLElement | null>;
|
|
1852
|
+
}>;
|
|
1853
|
+
export type FileDownloadOptions = {
|
|
1854
|
+
/**
|
|
1855
|
+
* The file's body - a string, a `Blob`, or the parts to build one from. A `Blob` is re-wrapped, so
|
|
1856
|
+
* {@link FileDownloadOptions.type} still decides the MIME type.
|
|
1857
|
+
*/
|
|
1858
|
+
content: BlobPart | BlobPart[];
|
|
1859
|
+
/** The name the browser saves the file under, extension included. */
|
|
1860
|
+
filename: string;
|
|
1861
|
+
/** MIME type of the generated blob, e.g. `application/json`. */
|
|
1862
|
+
type?: string;
|
|
1863
|
+
};
|
|
1864
|
+
/**
|
|
1865
|
+
* Hands the user a file the browser downloads. Call it once from an injection context - a field
|
|
1866
|
+
* initializer - and the function it hands back can then be called from anywhere, including a click
|
|
1867
|
+
* handler.
|
|
1868
|
+
*
|
|
1869
|
+
* A no-op where there is no browser (server-side rendering), so a toolbar button needs no platform
|
|
1870
|
+
* check of its own. Use {@link createObjectUrlHandle} instead when the URL has to outlive the call.
|
|
1871
|
+
*
|
|
1872
|
+
* @example
|
|
1873
|
+
* private download = injectFileDownload();
|
|
1874
|
+
*
|
|
1875
|
+
* protected save() {
|
|
1876
|
+
* this.download({ content: json, filename: 'session.json', type: 'application/json' });
|
|
1877
|
+
* }
|
|
1878
|
+
*/
|
|
1879
|
+
export declare const injectFileDownload: () => (options: FileDownloadOptions) => void;
|
|
1880
|
+
export declare const provideFocusVisibleTracker: () => import("@angular/core").StaticProvider[];
|
|
1881
|
+
export declare const injectFocusVisibleTracker: import("@ethlete/core").InjectFn<{
|
|
1882
|
+
isFocusVisible: import("@angular/core").Signal<boolean>;
|
|
1883
|
+
}>;
|
|
1884
|
+
export declare const FOCUS_VISIBLE_TRACKER_TOKEN: import("@angular/core").InjectionToken<{
|
|
1885
|
+
isFocusVisible: import("@angular/core").Signal<boolean>;
|
|
1886
|
+
}>;
|
|
1887
|
+
/**
|
|
1888
|
+
* A label set, or a function building one for a locale. The function form is called again whenever
|
|
1889
|
+
* {@link injectLocale}'s `currentLocale` changes, so a locale switch re-renders the wording without
|
|
1890
|
+
* reloading - that is the seam an app's i18n library plugs into.
|
|
1891
|
+
*/
|
|
1892
|
+
export type LabelsSource<T> = Partial<T> | ((locale: string) => Partial<T>);
|
|
1893
|
+
/** What {@link defineLabels} returns. */
|
|
1894
|
+
export type LabelsDefinition<T> = {
|
|
1895
|
+
readonly provide: (labels: LabelsSource<T>) => Provider;
|
|
1896
|
+
readonly inject: () => Signal<T>;
|
|
1897
|
+
readonly token: InjectionToken<LabelsSource<T>>;
|
|
1898
|
+
};
|
|
1899
|
+
/**
|
|
1900
|
+
* The one mechanism for the strings a component renders or announces itself. Every domain in the UI
|
|
1901
|
+
* library that has such strings exposes exactly this pair - `provide<Domain>Labels` to localize a
|
|
1902
|
+
* subtree, `inject<Domain>Labels()` to read the result - so localizing an app is the same move
|
|
1903
|
+
* repeated per domain rather than a different one each time.
|
|
1904
|
+
*
|
|
1905
|
+
* `defaults` may itself be locale-derived, for a domain that ships more than one language (the
|
|
1906
|
+
* `@ethlete/query` error tables, say). Overrides are partial and layer on top of whatever the locale
|
|
1907
|
+
* resolved to, so translating into a third language while keeping a shipped one as the base is the
|
|
1908
|
+
* same call.
|
|
1909
|
+
*
|
|
1910
|
+
* The injector returns a **signal**, because both halves can change at runtime - read it in a
|
|
1911
|
+
* template or computed, never destructure it once.
|
|
1912
|
+
*
|
|
1913
|
+
* @example
|
|
1914
|
+
* export type BreadcrumbLabels = { navigation: string; overflow: string };
|
|
1915
|
+
*
|
|
1916
|
+
* export const DEFAULT_BREADCRUMB_LABELS: BreadcrumbLabels = {
|
|
1917
|
+
* navigation: 'Breadcrumb',
|
|
1918
|
+
* overflow: 'Show hidden levels',
|
|
1919
|
+
* };
|
|
1920
|
+
*
|
|
1921
|
+
* const BREADCRUMB_LABELS_DEF = defineLabels<BreadcrumbLabels>('BREADCRUMB_LABELS', DEFAULT_BREADCRUMB_LABELS);
|
|
1922
|
+
*
|
|
1923
|
+
* export const provideBreadcrumbLabels = toProvideFn(BREADCRUMB_LABELS_DEF);
|
|
1924
|
+
* export const injectBreadcrumbLabels = toInjectFn(BREADCRUMB_LABELS_DEF);
|
|
1925
|
+
* export const BREADCRUMB_LABELS = toToken(BREADCRUMB_LABELS_DEF);
|
|
1926
|
+
*
|
|
1927
|
+
* @example
|
|
1928
|
+
* // consumer, fixed wording
|
|
1929
|
+
* provideBreadcrumbLabels({ navigation: 'Brotkrumen' });
|
|
1930
|
+
*
|
|
1931
|
+
* // consumer, driven by the app's i18n and re-resolved on a locale change
|
|
1932
|
+
* provideBreadcrumbLabels((locale) => ({ navigation: translate('breadcrumb.nav', locale) }));
|
|
1933
|
+
*/
|
|
1934
|
+
export declare const defineLabels: <T extends object>(name: string, defaults: T | ((locale: string) => T)) => LabelsDefinition<T>;
|
|
1935
|
+
type Locale = {
|
|
1936
|
+
currentLocale: WritableSignal<string>;
|
|
1937
|
+
};
|
|
1938
|
+
/** Provides the app locale, starting at `locale` (default `'en'`). Change it later with `injectLocale().currentLocale.set(...)`. */
|
|
1939
|
+
export declare const provideLocale: (locale?: string) => StaticProvider[];
|
|
1940
|
+
export declare const injectLocale: () => Locale;
|
|
1941
|
+
export declare const provideRenderer: () => import("@angular/core").StaticProvider[];
|
|
1942
|
+
export declare const injectRenderer: import("@ethlete/core").InjectFn<{
|
|
1943
|
+
addClass: (element: HTMLElement, ...classes: string[]) => void;
|
|
1944
|
+
removeClass: (element: HTMLElement, ...classes: string[]) => void;
|
|
1945
|
+
toggleClass: (element: HTMLElement, className: string, force?: boolean) => boolean;
|
|
1946
|
+
setStyle: (element: HTMLElement, style: Partial<Record<keyof CSSStyleDeclaration, string | null>>, flags?: RendererStyleFlags2) => void;
|
|
1947
|
+
removeStyle: (element: HTMLElement, style: keyof CSSStyleDeclaration | string, flags?: RendererStyleFlags2) => void;
|
|
1948
|
+
removeStyles: (element: HTMLElement, ...styles: (keyof CSSStyleDeclaration | string)[]) => void;
|
|
1949
|
+
setAttribute: (element: Element, name: string, value: string | null, namespace?: string | null) => void;
|
|
1950
|
+
removeAttribute: (element: Element, ...names: string[]) => void;
|
|
1951
|
+
setProperty: (element: HTMLElement, name: string, value: unknown) => void;
|
|
1952
|
+
setProperties: (element: HTMLElement, properties: Record<string, unknown>) => void;
|
|
1953
|
+
createElement: <K extends keyof HTMLElementTagNameMap>(tagName: K, namespace?: string | null) => HTMLElementTagNameMap[K];
|
|
1954
|
+
createText: (value: string) => Text;
|
|
1955
|
+
createComment: (value: string) => Comment;
|
|
1956
|
+
appendChild: (parent: HTMLElement, newChild: Node) => void;
|
|
1957
|
+
insertBefore: (parent: Node, newChild: Node, refChild: Node | null) => void;
|
|
1958
|
+
removeChild: (parent: Node, oldChild: Node, isHostElement?: boolean) => void;
|
|
1959
|
+
selectRootElement: (selectorOrNode: string | HTMLElement, preserveContent?: boolean) => HTMLElement;
|
|
1960
|
+
parentNode: (node: Node) => Node | null;
|
|
1961
|
+
nextSibling: (node: Node) => Node | null;
|
|
1962
|
+
setValue: (node: Node, value: string) => void;
|
|
1963
|
+
listen: (target: HTMLElement | Window | Document | "window" | "document" | "body", eventName: string, callback: (event: Event) => boolean | void) => (() => void);
|
|
1964
|
+
destroyNode: (node: Node) => void;
|
|
1965
|
+
replaceChild: (parent: Node, newChild: Node, oldChild: Node) => void;
|
|
1966
|
+
empty: (element: HTMLElement) => void;
|
|
1967
|
+
setTextContent: (element: HTMLElement, text: string) => void;
|
|
1968
|
+
setAttributes: (element: HTMLElement, attributes: Record<string, string | null>, namespace?: string | null) => void;
|
|
1969
|
+
setDataAttributes: (element: HTMLElement, data: Record<string, string | null>) => void;
|
|
1970
|
+
setCssProperty: (element: HTMLElement, name: string, value: string | null) => void;
|
|
1971
|
+
setCssProperties: (element: HTMLElement, properties: Record<string, string | null>) => void;
|
|
1972
|
+
moveBefore: (config: {
|
|
1973
|
+
newParent: HTMLElement;
|
|
1974
|
+
child: HTMLElement;
|
|
1975
|
+
before?: Node | null;
|
|
1976
|
+
}) => void;
|
|
1977
|
+
renderer: import("@angular/core").Renderer2;
|
|
1978
|
+
}>;
|
|
1979
|
+
export type AngularRenderer = NonNullable<ReturnType<typeof injectRenderer>>;
|
|
1980
|
+
export type StyleManager = {
|
|
1981
|
+
mount: <TComponent>(component: Type<TComponent>) => ComponentRef<TComponent>;
|
|
1982
|
+
};
|
|
1983
|
+
export declare const provideStyleManager: () => import("@angular/core").StaticProvider[];
|
|
1984
|
+
export declare const injectStyleManager: import("@ethlete/core").InjectFn<StyleManager>;
|
|
1985
|
+
export type ConsentHandler = {
|
|
1986
|
+
/** Signal that is `true` when consent has been granted. */
|
|
1987
|
+
isGranted: Signal<boolean>;
|
|
1988
|
+
/** Grants consent and writes the decision back to the source. */
|
|
1989
|
+
grant: () => void;
|
|
1990
|
+
/** Revokes consent and writes the decision back to the source. */
|
|
1991
|
+
revoke?: () => void;
|
|
1992
|
+
};
|
|
1993
|
+
export type CreateUserConsentProviderOptions = {
|
|
1994
|
+
/** The `InjectionToken` this consent provider should be associated with. */
|
|
1995
|
+
for: InjectionToken<ConsentHandler | null>;
|
|
1996
|
+
/**
|
|
1997
|
+
* Factory executed inside the injection context that returns a `Signal<boolean>`.
|
|
1998
|
+
*
|
|
1999
|
+
* @example
|
|
2000
|
+
* isGranted: () => inject(CookieService).hasMediaConsent
|
|
2001
|
+
*/
|
|
2002
|
+
isGranted: () => Signal<boolean>;
|
|
2003
|
+
/**
|
|
2004
|
+
* Factory executed inside the injection context that returns the grant function.
|
|
2005
|
+
*
|
|
2006
|
+
* @example
|
|
2007
|
+
* grant: () => () => inject(CookieService).acceptAll()
|
|
2008
|
+
*/
|
|
2009
|
+
grant: () => () => void;
|
|
2010
|
+
/**
|
|
2011
|
+
* Factory executed inside the injection context that returns the revoke function.
|
|
2012
|
+
*
|
|
2013
|
+
* @example
|
|
2014
|
+
* revoke : () => () => inject(CookieService).revokeAll()
|
|
2015
|
+
*/
|
|
2016
|
+
revoke?: () => () => void;
|
|
2017
|
+
};
|
|
2018
|
+
export declare const createUserConsentProvider: (options: CreateUserConsentProviderOptions) => Provider;
|
|
2020
2019
|
/**
|
|
2021
|
-
*
|
|
2022
|
-
*
|
|
2023
|
-
*
|
|
2024
|
-
* Every outside-pointer close asks this first: a press on a surface that paints over an overlay is
|
|
2025
|
-
* aimed at that surface, not at the content the overlay covers, so it must not close the overlay.
|
|
2026
|
-
* The level of a press inside another overlay resolves through that overlay's runtime root, so a
|
|
2027
|
-
* menu opened from the devtools panel counts as part of the panel's level too.
|
|
2020
|
+
* Declares the `et-visually-hidden` class as a styles-only component: content that stays in the
|
|
2021
|
+
* accessibility tree but is clipped out of the layout. Mount it from any component whose template
|
|
2022
|
+
* uses the class.
|
|
2028
2023
|
*/
|
|
2029
|
-
export declare
|
|
2024
|
+
export declare class VisuallyHiddenStylesComponent {
|
|
2025
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<VisuallyHiddenStylesComponent, never>;
|
|
2026
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<VisuallyHiddenStylesComponent, "et-visually-hidden-styles", never, {}, {}, never, never, true, never>;
|
|
2027
|
+
}
|
|
2028
|
+
/** Mounts {@link VisuallyHiddenStylesComponent}. Call from an injection context. */
|
|
2029
|
+
export declare const mountVisuallyHidden: () => import("@angular/core").ComponentRef<VisuallyHiddenStylesComponent>;
|
|
2030
2030
|
export declare const applyCenteredPosition: (hostElement: HTMLElement, paneElement: HTMLElement, renderer: AngularRenderer, _config: OverlayRuntimeCenteredPosition) => void;
|
|
2031
2031
|
export declare const applyGlobalPosition: (hostElement: HTMLElement, paneElement: HTMLElement, renderer: AngularRenderer, config: OverlayRuntimeGlobalPosition) => void;
|
|
2032
2032
|
export declare const setupPositioning: (config: OverlayRuntimeMountConfig<object>, hostElement: HTMLElement, paneElement: HTMLElement, overlayRef: OverlayRuntimeRef<object, unknown>, renderer: AngularRenderer) => () => void;
|
|
@@ -2434,14 +2434,6 @@ export declare class NormalizeMatchScorePipe implements PipeTransform {
|
|
|
2434
2434
|
static ɵfac: i0.ɵɵFactoryDeclaration<NormalizeMatchScorePipe, never>;
|
|
2435
2435
|
static ɵpipe: i0.ɵɵPipeDeclaration<NormalizeMatchScorePipe, "etNormalizeMatchScore", true>;
|
|
2436
2436
|
}
|
|
2437
|
-
export declare const MatchStateType: {
|
|
2438
|
-
readonly PREPARING_ROUND: "preparingRound";
|
|
2439
|
-
readonly PRE_MATCH: "preMatch";
|
|
2440
|
-
readonly LIVE: "live";
|
|
2441
|
-
readonly POST_MATCH: "postMatch";
|
|
2442
|
-
readonly AUTO_WIN: "autoWin";
|
|
2443
|
-
};
|
|
2444
|
-
export type MatchStateType = (typeof MatchStateType)[keyof typeof MatchStateType];
|
|
2445
2437
|
export type NormalizedMatchScore = {
|
|
2446
2438
|
home: {
|
|
2447
2439
|
score: string | number | null;
|
|
@@ -2479,6 +2471,14 @@ export declare const getGroupMatchPoints: (match: MatchListView | null | undefin
|
|
|
2479
2471
|
isWinner: boolean;
|
|
2480
2472
|
};
|
|
2481
2473
|
} | null;
|
|
2474
|
+
export declare const MatchStateType: {
|
|
2475
|
+
readonly PREPARING_ROUND: "preparingRound";
|
|
2476
|
+
readonly PRE_MATCH: "preMatch";
|
|
2477
|
+
readonly LIVE: "live";
|
|
2478
|
+
readonly POST_MATCH: "postMatch";
|
|
2479
|
+
readonly AUTO_WIN: "autoWin";
|
|
2480
|
+
};
|
|
2481
|
+
export type MatchStateType = (typeof MatchStateType)[keyof typeof MatchStateType];
|
|
2482
2482
|
export declare class NormalizeMatchStatePipe implements PipeTransform {
|
|
2483
2483
|
transform: (match: MatchListView | null | undefined) => "preparingRound" | "preMatch" | "live" | "postMatch" | "autoWin" | null;
|
|
2484
2484
|
static ɵfac: i0.ɵɵFactoryDeclaration<NormalizeMatchStatePipe, never>;
|
|
@@ -3302,27 +3302,6 @@ export declare const injectColorThemes: import("@ethlete/core").InjectFn<ColorTh
|
|
|
3302
3302
|
export declare const ɵProvideColorThemesPrefix: (valueOverride?: string | undefined) => import("@angular/core").StaticProvider[];
|
|
3303
3303
|
export declare const injectColorThemesPrefix: import("@ethlete/core").InjectFn<string>;
|
|
3304
3304
|
export declare const provideColorThemesWithTailwind4: (themes: ColorTheme[], prefix?: string) => import("@angular/core").StaticProvider[][];
|
|
3305
|
-
/**
|
|
3306
|
-
* The color theme name that draws `chosenName` on `surface`: the surface's `colorThemeVariants` entry for it,
|
|
3307
|
-
* else `chosenName` itself. Always pass the chosen accent, never an already swapped one.
|
|
3308
|
-
*/
|
|
3309
|
-
export declare const resolveColorThemeVariant: (surface: SurfaceTheme | null | undefined, chosenName: string, themes: ColorTheme[] | null | undefined) => string;
|
|
3310
|
-
/**
|
|
3311
|
-
* A signal of the color theme for `type` on the surface this element renders on: the first registered theme
|
|
3312
|
-
* of that `type`, swapped for the nearest surface's `colorThemeVariants` entry. Reading it throws when the app
|
|
3313
|
-
* registered no theme of that `type`, so read it only for a state that renders.
|
|
3314
|
-
*
|
|
3315
|
-
* @example
|
|
3316
|
-
* protected successTheme = injectSemanticColorTheme('success');
|
|
3317
|
-
* // <span [etProvideColor]="successTheme()">+12%</span>
|
|
3318
|
-
*/
|
|
3319
|
-
export declare const injectSemanticColorTheme: (type: ColorThemeType) => Signal<ColorTheme>;
|
|
3320
|
-
/** @deprecated Use `injectSemanticColorTheme('error')`, which follows the surface the element renders on. */
|
|
3321
|
-
export declare const injectErrorTheme: () => ColorTheme;
|
|
3322
|
-
/** @deprecated Use `injectSemanticColorTheme('warning')`, which follows the surface the element renders on. */
|
|
3323
|
-
export declare const injectWarningTheme: () => ColorTheme;
|
|
3324
|
-
/** @deprecated Use `injectSemanticColorTheme('success')`, which follows the surface the element renders on. */
|
|
3325
|
-
export declare const injectSuccessTheme: () => ColorTheme;
|
|
3326
3305
|
export declare const injectDefaultColorTheme: () => ColorTheme;
|
|
3327
3306
|
export declare const SURFACE_TYPE: {
|
|
3328
3307
|
readonly LIGHT: "light";
|
|
@@ -3418,6 +3397,50 @@ export declare const provideSurfaceThemesWithTailwind4: (themes: SurfaceTheme[],
|
|
|
3418
3397
|
* For the theme the root paints right now, use `injectRootSurfaceTheme()`.
|
|
3419
3398
|
*/
|
|
3420
3399
|
export declare const injectDefaultSurfaceTheme: (type?: SurfaceType) => SurfaceTheme | null;
|
|
3400
|
+
export declare const COLOR_PROVIDER: InjectionToken<ProvideColorDirective>;
|
|
3401
|
+
/**
|
|
3402
|
+
* The color provider attached to a bootstrapped root component (e.g. `ProvideColorDirective` in
|
|
3403
|
+
* the app component's `hostDirectives`), if any. Detached DOM such as overlay panes can't reach
|
|
3404
|
+
* it through element DI, so overlay containers fall back to this when resolving the provider to
|
|
3405
|
+
* `syncWithProvider()` - resolve at sync time, not at injection time, since root components only
|
|
3406
|
+
* register with `ApplicationRef` once bootstrap completes.
|
|
3407
|
+
*/
|
|
3408
|
+
export declare const resolveAppRootColorProvider: (appRef: ApplicationRef) => ProvideColorDirective | null;
|
|
3409
|
+
export declare class ProvideColorDirective {
|
|
3410
|
+
private themes;
|
|
3411
|
+
private prefix;
|
|
3412
|
+
private injector;
|
|
3413
|
+
private rootSurfaceTheme;
|
|
3414
|
+
private parentProvider;
|
|
3415
|
+
private appRef;
|
|
3416
|
+
private currentProviderSync;
|
|
3417
|
+
private forcedColor;
|
|
3418
|
+
color: InputSignal<ColorThemeInput | undefined>;
|
|
3419
|
+
effectiveColor: Signal<ColorThemeInput | undefined>;
|
|
3420
|
+
/**
|
|
3421
|
+
* The color that actually applies at this provider's location: its own effective color, or -
|
|
3422
|
+
* when this provider is passive (no input, nothing forced) - the nearest ancestor provider's.
|
|
3423
|
+
* Mirrors the CSS cascade, which falls through a provider's `-color--inherited` scope class;
|
|
3424
|
+
* consumers that re-apply context across detached DOM (overlay panes) must use this instead
|
|
3425
|
+
* of `effectiveColor` or a passive in-between provider (e.g. a form field's) erases the theme.
|
|
3426
|
+
*/
|
|
3427
|
+
resolvedColor: Signal<ColorThemeInput | undefined>;
|
|
3428
|
+
colorName: Signal<string | undefined>;
|
|
3429
|
+
private paintedColorName;
|
|
3430
|
+
protected themeClass: Signal<string>;
|
|
3431
|
+
syncWithProvider(provider: ProvideColorDirective): void;
|
|
3432
|
+
stopSyncWithProvider(): void;
|
|
3433
|
+
forceColor(color: ColorThemeInput): void;
|
|
3434
|
+
clearForcedColor(): void;
|
|
3435
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ProvideColorDirective, never>;
|
|
3436
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ProvideColorDirective, "[etProvideColor]", never, {
|
|
3437
|
+
"color": {
|
|
3438
|
+
"alias": "etProvideColor";
|
|
3439
|
+
"required": false;
|
|
3440
|
+
"isSignal": true;
|
|
3441
|
+
};
|
|
3442
|
+
}, {}, never, never, true, never>;
|
|
3443
|
+
}
|
|
3421
3444
|
export declare const SURFACE_PROVIDER: InjectionToken<ProvideSurfaceDirective>;
|
|
3422
3445
|
export declare class ProvideSurfaceDirective {
|
|
3423
3446
|
private themes;
|
|
@@ -3596,6 +3619,11 @@ export declare const provideColorScheme: (config?: ColorSchemeConfig) => Environ
|
|
|
3596
3619
|
* `provideColorScheme()`.
|
|
3597
3620
|
*/
|
|
3598
3621
|
export declare const injectRootSurfaceTheme: () => Signal<SurfaceTheme | null>;
|
|
3622
|
+
/**
|
|
3623
|
+
* The color theme name that draws `chosenName` on `surface`: the surface's `colorThemeVariants` entry for it,
|
|
3624
|
+
* else `chosenName` itself. Always pass the chosen accent, never an already swapped one.
|
|
3625
|
+
*/
|
|
3626
|
+
export declare const resolveColorThemeVariant: (surface: SurfaceTheme | null | undefined, chosenName: string, themes: ColorTheme[] | null | undefined) => string;
|
|
3599
3627
|
/**
|
|
3600
3628
|
* @deprecated Migrate to Tailwind v4. Intent to remove in v6.
|
|
3601
3629
|
*/
|
|
@@ -3631,50 +3659,22 @@ export declare const createTailwindColorThemes: (themes: ColorTheme[], prefix?:
|
|
|
3631
3659
|
* @deprecated Use provideColorThemesWithTailwind4 instead after migrating to Tailwind CSS v4. Intent to remove in v6.
|
|
3632
3660
|
*/
|
|
3633
3661
|
export declare const provideColorThemes: (themes: ColorTheme[]) => import("@angular/core").StaticProvider[][];
|
|
3634
|
-
export declare const COLOR_PROVIDER: InjectionToken<ProvideColorDirective>;
|
|
3635
3662
|
/**
|
|
3636
|
-
*
|
|
3637
|
-
* the
|
|
3638
|
-
*
|
|
3639
|
-
*
|
|
3640
|
-
*
|
|
3663
|
+
* A signal of the color theme for `type` on the surface this element renders on: the first registered theme
|
|
3664
|
+
* of that `type`, swapped for the nearest surface's `colorThemeVariants` entry. Reading it throws when the app
|
|
3665
|
+
* registered no theme of that `type`, so read it only for a state that renders.
|
|
3666
|
+
*
|
|
3667
|
+
* @example
|
|
3668
|
+
* protected successTheme = injectSemanticColorTheme('success');
|
|
3669
|
+
* // <span [etProvideColor]="successTheme()">+12%</span>
|
|
3641
3670
|
*/
|
|
3642
|
-
export declare const
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
private appRef;
|
|
3650
|
-
private currentProviderSync;
|
|
3651
|
-
private forcedColor;
|
|
3652
|
-
color: InputSignal<ColorThemeInput | undefined>;
|
|
3653
|
-
effectiveColor: import("@angular/core").Signal<ColorThemeInput | undefined>;
|
|
3654
|
-
/**
|
|
3655
|
-
* The color that actually applies at this provider's location: its own effective color, or -
|
|
3656
|
-
* when this provider is passive (no input, nothing forced) - the nearest ancestor provider's.
|
|
3657
|
-
* Mirrors the CSS cascade, which falls through a provider's `-color--inherited` scope class;
|
|
3658
|
-
* consumers that re-apply context across detached DOM (overlay panes) must use this instead
|
|
3659
|
-
* of `effectiveColor` or a passive in-between provider (e.g. a form field's) erases the theme.
|
|
3660
|
-
*/
|
|
3661
|
-
resolvedColor: import("@angular/core").Signal<ColorThemeInput | undefined>;
|
|
3662
|
-
colorName: import("@angular/core").Signal<string | undefined>;
|
|
3663
|
-
private paintedColorName;
|
|
3664
|
-
protected themeClass: import("@angular/core").Signal<string>;
|
|
3665
|
-
syncWithProvider(provider: ProvideColorDirective): void;
|
|
3666
|
-
stopSyncWithProvider(): void;
|
|
3667
|
-
forceColor(color: ColorThemeInput): void;
|
|
3668
|
-
clearForcedColor(): void;
|
|
3669
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<ProvideColorDirective, never>;
|
|
3670
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ProvideColorDirective, "[etProvideColor]", never, {
|
|
3671
|
-
"color": {
|
|
3672
|
-
"alias": "etProvideColor";
|
|
3673
|
-
"required": false;
|
|
3674
|
-
"isSignal": true;
|
|
3675
|
-
};
|
|
3676
|
-
}, {}, never, never, true, never>;
|
|
3677
|
-
}
|
|
3671
|
+
export declare const injectSemanticColorTheme: (type: ColorThemeType) => Signal<ColorTheme>;
|
|
3672
|
+
/** @deprecated Use `injectSemanticColorTheme('error')`, which follows the surface the element renders on. */
|
|
3673
|
+
export declare const injectErrorTheme: () => ColorTheme;
|
|
3674
|
+
/** @deprecated Use `injectSemanticColorTheme('warning')`, which follows the surface the element renders on. */
|
|
3675
|
+
export declare const injectWarningTheme: () => ColorTheme;
|
|
3676
|
+
/** @deprecated Use `injectSemanticColorTheme('success')`, which follows the surface the element renders on. */
|
|
3677
|
+
export declare const injectSuccessTheme: () => ColorTheme;
|
|
3678
3678
|
export type SurfaceContextEntry = {
|
|
3679
3679
|
id: string;
|
|
3680
3680
|
type: SurfaceType;
|
|
@@ -3775,6 +3775,32 @@ export declare const injectUnsavedChangesCoordinator: import("@ethlete/core").In
|
|
|
3775
3775
|
runCheck: (runner: (context: UnsavedChangesConfirmContext) => Promise<boolean>) => Promise<boolean>;
|
|
3776
3776
|
register: (registration: UnsavedChangesRegistration) => () => void;
|
|
3777
3777
|
}>;
|
|
3778
|
+
/**
|
|
3779
|
+
* Decides whether a value with unsaved changes may be discarded. Called with the current value when
|
|
3780
|
+
* (and only when) changes exist. Return a truthy value / resolved Promise / emitted Observable value
|
|
3781
|
+
* to allow the discard, falsy to keep the changes. Typically opens a confirm dialog.
|
|
3782
|
+
*
|
|
3783
|
+
* The second argument carries an {@link UnsavedChangesConfirmContext.signal} that aborts when the
|
|
3784
|
+
* session ends underneath the confirm (a logout) - close your dialog when it fires.
|
|
3785
|
+
*/
|
|
3786
|
+
export type UnsavedChangesConfirmFn<T> = (value: T, context: UnsavedChangesConfirmContext) => boolean | Promise<boolean> | Observable<boolean> | unknown;
|
|
3787
|
+
/** The confirm an unsaved-changes tracker or guard runs when its own config has none. */
|
|
3788
|
+
export declare const UNSAVED_CHANGES_CONFIRM: InjectionToken<UnsavedChangesConfirmFn<unknown>>;
|
|
3789
|
+
/**
|
|
3790
|
+
* Sets the confirm every unsaved-changes tracker and guard below this injector runs when its config has no
|
|
3791
|
+
* `confirm`. `factory` runs once, in an injection context, and returns the confirm.
|
|
3792
|
+
*
|
|
3793
|
+
* @example
|
|
3794
|
+
* provideUnsavedChangesConfirm(() => {
|
|
3795
|
+
* const dialogs = inject(MyDialogs);
|
|
3796
|
+
* return () => dialogs.confirmDiscard();
|
|
3797
|
+
* });
|
|
3798
|
+
*/
|
|
3799
|
+
export declare const provideUnsavedChangesConfirm: (factory: () => UnsavedChangesConfirmFn<unknown>) => Provider;
|
|
3800
|
+
export declare const UNSAVED_CHANGES_ERROR_CODES: {
|
|
3801
|
+
/** An unsaved-changes tracker or guard has no `confirm`, and no `provideUnsavedChangesConfirm()` is in scope. */
|
|
3802
|
+
readonly MISSING_CONFIRM: 9100;
|
|
3803
|
+
};
|
|
3778
3804
|
/**
|
|
3779
3805
|
* The value source an unsaved-changes tracker watches. In order of preference:
|
|
3780
3806
|
*
|
|
@@ -3886,15 +3912,6 @@ export type UnsavedChangesTabLockRef = {
|
|
|
3886
3912
|
* ```
|
|
3887
3913
|
*/
|
|
3888
3914
|
export declare const createUnsavedChangesTabLock: (config: CreateUnsavedChangesTabLockConfig) => UnsavedChangesTabLockRef;
|
|
3889
|
-
/**
|
|
3890
|
-
* Decides whether a value with unsaved changes may be discarded. Called with the current value when
|
|
3891
|
-
* (and only when) changes exist. Return a truthy value / resolved Promise / emitted Observable value
|
|
3892
|
-
* to allow the discard, falsy to keep the changes. Typically opens a confirm dialog.
|
|
3893
|
-
*
|
|
3894
|
-
* The second argument carries an {@link UnsavedChangesConfirmContext.signal} that aborts when the
|
|
3895
|
-
* session ends underneath the confirm (a logout) - close your dialog when it fires.
|
|
3896
|
-
*/
|
|
3897
|
-
export type UnsavedChangesConfirmFn<T> = (value: T, context: UnsavedChangesConfirmContext) => boolean | Promise<boolean> | Observable<boolean> | unknown;
|
|
3898
3915
|
export type CreateUnsavedChangesTrackerConfig<T> = {
|
|
3899
3916
|
/** The form / value to watch. See {@link UnsavedChangesSource}. */
|
|
3900
3917
|
source: UnsavedChangesSource<T>;
|
|
@@ -3975,23 +3992,6 @@ export type UnsavedChangesTrackerRef<T> = {
|
|
|
3975
3992
|
* on this - use them when you want the guard wired to a close/navigation event automatically.
|
|
3976
3993
|
*/
|
|
3977
3994
|
export declare const createUnsavedChangesTracker: <T>(config: CreateUnsavedChangesTrackerConfig<T>) => UnsavedChangesTrackerRef<T>;
|
|
3978
|
-
/** The confirm an unsaved-changes tracker or guard runs when its own config has none. */
|
|
3979
|
-
export declare const UNSAVED_CHANGES_CONFIRM: InjectionToken<UnsavedChangesConfirmFn<unknown>>;
|
|
3980
|
-
/**
|
|
3981
|
-
* Sets the confirm every unsaved-changes tracker and guard below this injector runs when its config has no
|
|
3982
|
-
* `confirm`. `factory` runs once, in an injection context, and returns the confirm.
|
|
3983
|
-
*
|
|
3984
|
-
* @example
|
|
3985
|
-
* provideUnsavedChangesConfirm(() => {
|
|
3986
|
-
* const dialogs = inject(MyDialogs);
|
|
3987
|
-
* return () => dialogs.confirmDiscard();
|
|
3988
|
-
* });
|
|
3989
|
-
*/
|
|
3990
|
-
export declare const provideUnsavedChangesConfirm: (factory: () => UnsavedChangesConfirmFn<unknown>) => Provider;
|
|
3991
|
-
export declare const UNSAVED_CHANGES_ERROR_CODES: {
|
|
3992
|
-
/** An unsaved-changes tracker or guard has no `confirm`, and no `provideUnsavedChangesConfirm()` is in scope. */
|
|
3993
|
-
readonly MISSING_CONFIRM: 9100;
|
|
3994
|
-
};
|
|
3995
3995
|
export type CreateUnsavedChangesGuardConfig<T> = CreateUnsavedChangesTrackerConfig<T>;
|
|
3996
3996
|
export type UnsavedChangesGuardRef<T> = UnsavedChangesTrackerRef<T> & {
|
|
3997
3997
|
/**
|
|
@@ -4012,5 +4012,5 @@ export type UnsavedChangesGuardRef<T> = UnsavedChangesTrackerRef<T> & {
|
|
|
4012
4012
|
*/
|
|
4013
4013
|
export declare const createUnsavedChangesGuard: <T>(config: CreateUnsavedChangesGuardConfig<T>) => UnsavedChangesGuardRef<T>;
|
|
4014
4014
|
/** The version of `@ethlete/core` this build was cut from. */
|
|
4015
|
-
export declare const CORE_VERSION = "5.0.0-next.
|
|
4015
|
+
export declare const CORE_VERSION = "5.0.0-next.73";
|
|
4016
4016
|
export { json_ld_d_exports as JsonLD, type OverlayRuntimeRef, type OverlayRuntimeState };
|