@ethlete/cdk 4.34.1 → 4.35.0
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 +10 -0
- package/esm2022/lib/components/overlay/components/overlay/utils/overlay-handler.mjs +11 -9
- package/fesm2022/ethlete-cdk.mjs +9 -8
- package/fesm2022/ethlete-cdk.mjs.map +1 -1
- package/lib/components/overlay/components/overlay/utils/overlay-handler.d.ts +13 -4
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import { TemplateRef } from '@angular/core';
|
|
|
3
3
|
import { OverlayBreakpointConfigEntry, OverlayConfig, OverlayConsumerConfig } from '../types';
|
|
4
4
|
import { OverlayPositionBuilder } from './overlay-position-builder';
|
|
5
5
|
import { OverlayRef } from './overlay-ref';
|
|
6
|
-
export type CreateOverlayHandlerConfig<T, D = unknown
|
|
6
|
+
export type CreateOverlayHandlerConfig<T, D = unknown> = Omit<OverlayConfig<D>, 'positions'> & {
|
|
7
7
|
/** The overlay component. Use either this or the `template` property */
|
|
8
8
|
component?: ComponentType<T>;
|
|
9
9
|
/** The overlay template. Use either this or the `component` property */
|
|
@@ -18,13 +18,18 @@ export type OverlayHandler<T, D = unknown, R = unknown> = {
|
|
|
18
18
|
* Returns the typed overlay ref.
|
|
19
19
|
* @throws Error if the overlay ref gets accessed outside of the overlay component or templateRef
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
injectOverlayRef: () => OverlayRef<T, R>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns the overlay data.
|
|
24
|
+
* @throws Error if the overlay data gets accessed outside of the overlay component or templateRef
|
|
25
|
+
*/
|
|
26
|
+
injectOverlayData: () => D;
|
|
22
27
|
};
|
|
23
28
|
export type CreateOverlayHandlerInnerConfig<R = unknown> = {
|
|
24
29
|
/** A callback function to be executed once the overlay has been closed */
|
|
25
30
|
afterClosed?: (result: R | null) => void;
|
|
26
31
|
};
|
|
27
|
-
export declare const createOverlayHandler: <TComponent, TOverlayData = unknown, TOverlayResult = unknown>(rootConfig: CreateOverlayHandlerConfig<TComponent, TOverlayData
|
|
32
|
+
export declare const createOverlayHandler: <TComponent, TOverlayData = unknown, TOverlayResult = unknown>(rootConfig: CreateOverlayHandlerConfig<TComponent, TOverlayData>) => (innerConfig?: CreateOverlayHandlerInnerConfig<TOverlayResult>) => OverlayHandler<TComponent, TOverlayData, TOverlayResult>;
|
|
28
33
|
export type OverlayHandlerWithQueryParamLifecycle<Q = string> = {
|
|
29
34
|
/** Open the overlay using the provided query param value */
|
|
30
35
|
open: (queryParamValue: Q) => void;
|
|
@@ -39,6 +44,7 @@ export type CreateOverlayHandlerWithQueryParamLifecycleConfig<T> = Omit<OverlayC
|
|
|
39
44
|
/** The query param key to be used for the overlay */
|
|
40
45
|
queryParamKey: string;
|
|
41
46
|
};
|
|
47
|
+
export declare const OVERLAY_QUERY_PARAM_INPUT_NAME = "overlayQueryParam";
|
|
42
48
|
/**
|
|
43
49
|
* This handler will automatically open the overlay when the query param is present.
|
|
44
50
|
* The overlay can contain a required input with the name `overlayQueryParam` to receive the query param value.
|
|
@@ -48,4 +54,7 @@ export type CreateOverlayHandlerWithQueryParamLifecycleConfig<T> = Omit<OverlayC
|
|
|
48
54
|
*
|
|
49
55
|
* To open the overlay either use the `OverlayHandlerLinkDirective` or call the `.open` method of the returned handler.
|
|
50
56
|
*/
|
|
51
|
-
export declare const createOverlayHandlerWithQueryParamLifecycle: <TComponent, TQueryParam extends string = string, TResult = unknown>(config: CreateOverlayHandlerWithQueryParamLifecycleConfig<TComponent>) =>
|
|
57
|
+
export declare const createOverlayHandlerWithQueryParamLifecycle: <TComponent, TQueryParam extends string = string, TResult = unknown>(config: CreateOverlayHandlerWithQueryParamLifecycleConfig<TComponent>) => {
|
|
58
|
+
(innerConfig?: CreateOverlayHandlerInnerConfig<TResult>): OverlayHandlerWithQueryParamLifecycle<TQueryParam>;
|
|
59
|
+
injectOverlayRef(): OverlayRef<TComponent, TResult>;
|
|
60
|
+
};
|