@juspay/svelte-ui-components 2.25.0 → 2.27.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/dist/Img/Img.svelte
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import type { ImgProperties } from './properties';
|
|
3
3
|
|
|
4
|
-
let { src, alt, fallback, onerror, classes, inlineSvg, transformSvg }: ImgProperties =
|
|
4
|
+
let { src, alt, fallback, onerror, classes, inlineSvg, transformSvg, testId }: ImgProperties =
|
|
5
|
+
$props();
|
|
5
6
|
|
|
6
7
|
let currentSrc = $derived(src);
|
|
7
8
|
// Per-source failure marker: when inlining a given URL fails we fall back to
|
|
@@ -114,9 +115,10 @@
|
|
|
114
115
|
role={alt.length > 0 ? 'img' : null}
|
|
115
116
|
aria-label={alt.length > 0 ? alt : null}
|
|
116
117
|
aria-hidden={alt.length === 0 ? 'true' : null}
|
|
118
|
+
data-pw={testId}
|
|
117
119
|
></svg>
|
|
118
120
|
{:else}
|
|
119
|
-
<img class={classes ?? ''} src={currentSrc} {alt} onerror={handleFallback} />
|
|
121
|
+
<img class={classes ?? ''} src={currentSrc} {alt} onerror={handleFallback} data-pw={testId} />
|
|
120
122
|
{/if}
|
|
121
123
|
|
|
122
124
|
<style>
|
package/dist/Img/properties.d.ts
CHANGED
|
@@ -11,11 +11,13 @@
|
|
|
11
11
|
additionalContent,
|
|
12
12
|
classes,
|
|
13
13
|
onbackClick,
|
|
14
|
-
onkeydown
|
|
14
|
+
onkeydown,
|
|
15
|
+
testId,
|
|
16
|
+
headingTestId
|
|
15
17
|
}: ToolbarProperties = $props();
|
|
16
18
|
</script>
|
|
17
19
|
|
|
18
|
-
<div class="toolbar {classes ?? ''}">
|
|
20
|
+
<div class="toolbar {classes ?? ''}" data-pw={testId}>
|
|
19
21
|
<div class="content">
|
|
20
22
|
{#if typeof leftContent === 'function'}
|
|
21
23
|
{@render leftContent()}
|
|
@@ -29,7 +31,7 @@
|
|
|
29
31
|
{@render centerContent()}
|
|
30
32
|
</div>
|
|
31
33
|
{:else if typeof text === 'string' && text.length > 0}
|
|
32
|
-
<div class="text">
|
|
34
|
+
<div class="text" data-pw={headingTestId}>
|
|
33
35
|
{text}
|
|
34
36
|
</div>
|
|
35
37
|
{/if}
|