@ethlete/cdk 4.35.0 → 4.37.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 +18 -0
- package/esm2022/lib/components/overlay/components/overlay/utils/overlay-handler.mjs +40 -22
- package/esm2022/lib/components/picture/components/picture/picture.component.mjs +3 -3
- package/esm2022/lib/components/picture/types/picture.types.mjs +1 -1
- package/esm2022/lib/components/picture/utils/picture.utils.mjs +6 -3
- package/fesm2022/ethlete-cdk.mjs +45 -24
- package/fesm2022/ethlete-cdk.mjs.map +1 -1
- package/lib/components/overlay/components/overlay/utils/overlay-handler.d.ts +3 -2
- package/lib/components/picture/types/picture.types.d.ts +29 -2
- package/package.json +1 -1
|
@@ -36,7 +36,7 @@ export type OverlayHandlerWithQueryParamLifecycle<Q = string> = {
|
|
|
36
36
|
/** Close the overlay and remove the query param */
|
|
37
37
|
close: () => void;
|
|
38
38
|
};
|
|
39
|
-
export type CreateOverlayHandlerWithQueryParamLifecycleConfig<T> = Omit<OverlayConfig<unknown>, 'positions' | 'data'> & {
|
|
39
|
+
export type CreateOverlayHandlerWithQueryParamLifecycleConfig<T> = Omit<OverlayConfig<unknown>, 'positions' | 'data' | 'closeOnNavigation'> & {
|
|
40
40
|
/** The overlay component */
|
|
41
41
|
component: ComponentType<T>;
|
|
42
42
|
/** The overlay positions using the position builder provided via argument */
|
|
@@ -47,7 +47,7 @@ export type CreateOverlayHandlerWithQueryParamLifecycleConfig<T> = Omit<OverlayC
|
|
|
47
47
|
export declare const OVERLAY_QUERY_PARAM_INPUT_NAME = "overlayQueryParam";
|
|
48
48
|
/**
|
|
49
49
|
* This handler will automatically open the overlay when the query param is present.
|
|
50
|
-
* The overlay can contain a
|
|
50
|
+
* The overlay can contain a input or model with the name `overlayQueryParam` to receive the query param value.
|
|
51
51
|
*
|
|
52
52
|
* If you need to transfer more information (eg. a second query param), you need to combine them into a single query param string.
|
|
53
53
|
* You can then split the string inside the overlay component using computed signals.
|
|
@@ -57,4 +57,5 @@ export declare const OVERLAY_QUERY_PARAM_INPUT_NAME = "overlayQueryParam";
|
|
|
57
57
|
export declare const createOverlayHandlerWithQueryParamLifecycle: <TComponent, TQueryParam extends string = string, TResult = unknown>(config: CreateOverlayHandlerWithQueryParamLifecycleConfig<TComponent>) => {
|
|
58
58
|
(innerConfig?: CreateOverlayHandlerInnerConfig<TResult>): OverlayHandlerWithQueryParamLifecycle<TQueryParam>;
|
|
59
59
|
injectOverlayRef(): OverlayRef<TComponent, TResult>;
|
|
60
|
+
updateQueryParam(value: TQueryParam): void;
|
|
60
61
|
};
|
|
@@ -1,15 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A source to be used in a picture element.
|
|
3
|
+
* @see https://www.mediaevent.de/html/picture.html
|
|
4
|
+
* @see https://web.dev/learn/design/responsive-images
|
|
5
|
+
*/
|
|
1
6
|
export interface PictureSource {
|
|
2
7
|
/**
|
|
3
8
|
* The mime type of the image.
|
|
9
|
+
* If not provided, it will be inferred from the URL.
|
|
10
|
+
* If it cannot be inferred, it will be `null` and a error will be logged to the console without throwing.
|
|
4
11
|
* @example `image/jpeg`
|
|
5
12
|
*/
|
|
6
|
-
type
|
|
13
|
+
type?: string | null;
|
|
7
14
|
/**
|
|
8
15
|
* The source set of the image. Can be either a single URL or a comma-separated list of URLs.
|
|
16
|
+
* If a width descriptor is provided (eg. 200w), you must also set the `sizes` property.
|
|
17
|
+
* If a density descriptor is provided (eg. 2x), the browser will automatically select the correct image based on the device's pixel density.
|
|
18
|
+
*
|
|
19
|
+
* **Note**: You can provide either a width descriptor or a density descriptor, but not both.
|
|
9
20
|
* @example `https://example.com/image.jpg`
|
|
10
|
-
* @example `https://example.com/image.jpg, https://example.com/image@2x.jpg`
|
|
21
|
+
* @example `https://example.com/image.jpg 1x, https://example.com/image@2x.jpg 2x`
|
|
22
|
+
* @example `https://example.com/image.jpg 300w, https://example.com/image600.jpg 600w`
|
|
11
23
|
*/
|
|
12
24
|
srcset: string;
|
|
25
|
+
/**
|
|
26
|
+
* The sizes attribute of the image.
|
|
27
|
+
*
|
|
28
|
+
* **Note**: Only required if the `srcset` property contains width descriptors.
|
|
29
|
+
* @example `100vw` // The image will take up the full width of the viewport
|
|
30
|
+
* @example `(min-width: 800px) 50vw, 100vw` // The image will take up 50% of the viewport width if the viewport is at least 800px wide, otherwise it will take up the full width
|
|
31
|
+
*/
|
|
32
|
+
sizes?: string | null;
|
|
33
|
+
/**
|
|
34
|
+
* The media query to which the source applies.
|
|
35
|
+
* If the media query applies, the source will be used.
|
|
36
|
+
* @example `(min-width: 800px)` // Only applies if the viewport is at least 800px wide
|
|
37
|
+
* @example `(min-width: 800px) and (orientation: landscape) and (prefers-color-scheme: dark)` // Only applies if the viewport is at least 800px wide, is in landscape orientation and prefers dark colors
|
|
38
|
+
*/
|
|
39
|
+
media?: string | null;
|
|
13
40
|
}
|
|
14
41
|
export interface PictureConfig {
|
|
15
42
|
baseUrl?: string;
|