@juspay/svelte-ui-components 1.34.1 → 1.34.2
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/Accordion/Accordion.svelte +17 -30
- package/dist/Accordion/Accordion.svelte.d.ts +6 -20
- package/dist/Animations/ModalAnimation.svelte +44 -30
- package/dist/Animations/ModalAnimation.svelte.d.ts +9 -21
- package/dist/Animations/OverlayAnimation.svelte +9 -2
- package/dist/Animations/OverlayAnimation.svelte.d.ts +6 -28
- package/dist/Badge/Badge.svelte +9 -8
- package/dist/Badge/Badge.svelte.d.ts +3 -18
- package/dist/Banner/Banner.svelte +20 -19
- package/dist/Banner/Banner.svelte.d.ts +3 -23
- package/dist/Banner/properties.d.ts +6 -2
- package/dist/BrandLoader/BrandLoader.svelte +11 -12
- package/dist/BrandLoader/BrandLoader.svelte.d.ts +3 -19
- package/dist/BrandLoader/properties.d.ts +1 -4
- package/dist/BrandLoader/properties.js +1 -7
- package/dist/Button/Button.svelte +38 -27
- package/dist/Button/Button.svelte.d.ts +4 -23
- package/dist/Button/properties.d.ts +9 -5
- package/dist/Button/properties.js +1 -7
- package/dist/Carousel/Carousel.svelte +132 -108
- package/dist/Carousel/Carousel.svelte.d.ts +3 -20
- package/dist/Carousel/properties.d.ts +6 -12
- package/dist/Carousel/properties.js +1 -7
- package/dist/CheckListItem/CheckListItem.svelte +18 -12
- package/dist/CheckListItem/CheckListItem.svelte.d.ts +4 -23
- package/dist/CheckListItem/properties.d.ts +7 -0
- package/dist/CheckListItem/properties.js +1 -0
- package/dist/GridItem/GridItem.svelte +17 -11
- package/dist/GridItem/GridItem.svelte.d.ts +4 -24
- package/dist/GridItem/properties.d.ts +8 -0
- package/dist/GridItem/properties.js +1 -0
- package/dist/Icon/Icon.svelte +8 -6
- package/dist/Icon/Icon.svelte.d.ts +3 -21
- package/dist/Icon/properties.d.ts +3 -2
- package/dist/Icon/properties.js +1 -4
- package/dist/IconStack/IconStack.svelte +5 -3
- package/dist/IconStack/IconStack.svelte.d.ts +4 -19
- package/dist/IconStack/properties.d.ts +4 -1
- package/dist/Img/Img.svelte +13 -9
- package/dist/Img/Img.svelte.d.ts +4 -20
- package/dist/Img/properties.d.ts +2 -2
- package/dist/Input/Input.svelte +172 -139
- package/dist/Input/Input.svelte.d.ts +6 -32
- package/dist/Input/properties.d.ts +23 -22
- package/dist/Input/properties.js +1 -23
- package/dist/InputButton/InputButton.svelte +76 -78
- package/dist/InputButton/InputButton.svelte.d.ts +6 -35
- package/dist/InputButton/properties.d.ts +6 -4
- package/dist/InputButton/properties.js +1 -18
- package/dist/ListItem/ListItem.svelte +87 -64
- package/dist/ListItem/ListItem.svelte.d.ts +4 -35
- package/dist/ListItem/properties.d.ts +21 -7
- package/dist/ListItem/properties.js +1 -8
- package/dist/Loader/Loader.svelte +1 -4
- package/dist/Loader/Loader.svelte.d.ts +24 -15
- package/dist/Modal/Modal.svelte +117 -95
- package/dist/Modal/Modal.svelte.d.ts +3 -29
- package/dist/Modal/properties.d.ts +21 -13
- package/dist/Modal/properties.js +1 -14
- package/dist/Select/Select.svelte +170 -142
- package/dist/Select/Select.svelte.d.ts +3 -26
- package/dist/Select/properties.d.ts +19 -10
- package/dist/Status/Status.svelte +15 -15
- package/dist/Status/Status.svelte.d.ts +3 -21
- package/dist/Status/properties.d.ts +2 -2
- package/dist/Status/properties.js +1 -6
- package/dist/Stepper/Step.svelte +13 -13
- package/dist/Stepper/Step.svelte.d.ts +4 -23
- package/dist/Stepper/Stepper.svelte +10 -7
- package/dist/Stepper/Stepper.svelte.d.ts +3 -20
- package/dist/Stepper/properties.d.ts +12 -0
- package/dist/Table/Table.svelte +73 -47
- package/dist/Table/Table.svelte.d.ts +3 -20
- package/dist/Table/properties.d.ts +5 -5
- package/dist/Toast/Toast.svelte +144 -76
- package/dist/Toast/Toast.svelte.d.ts +24 -23
- package/dist/Toast/properties.d.ts +10 -11
- package/dist/Toast/properties.js +1 -4
- package/dist/Toggle/Toggle.svelte +12 -11
- package/dist/Toggle/Toggle.svelte.d.ts +4 -21
- package/dist/Toggle/properties.d.ts +5 -0
- package/dist/Toggle/properties.js +1 -0
- package/dist/Toolbar/Toolbar.svelte +27 -20
- package/dist/Toolbar/Toolbar.svelte.d.ts +3 -26
- package/dist/Toolbar/properties.d.ts +10 -4
- package/dist/Toolbar/properties.js +1 -5
- package/dist/index.d.ts +0 -11
- package/dist/index.js +0 -11
- package/package.json +29 -29
|
@@ -1,116 +1,114 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
export function focus() {
|
|
48
|
-
|
|
49
|
-
}
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Button from '../Button/Button.svelte';
|
|
3
|
+
import Input from '../Input/Input.svelte';
|
|
4
|
+
import type { InputButtonProperties } from './properties';
|
|
5
|
+
import type { ValidationState } from '../types';
|
|
6
|
+
import type { SvelteComponent } from 'svelte';
|
|
7
|
+
|
|
8
|
+
let {
|
|
9
|
+
value = $bindable(''),
|
|
10
|
+
inputProperties,
|
|
11
|
+
rightButtonProperties,
|
|
12
|
+
leftButtonProperties,
|
|
13
|
+
bottomButtonProperties,
|
|
14
|
+
leftIcon
|
|
15
|
+
}: InputButtonProperties = $props();
|
|
16
|
+
|
|
17
|
+
let validationState = $state<ValidationState>('InProgress');
|
|
18
|
+
|
|
19
|
+
let inputRef: SvelteComponent | null = $state(null);
|
|
20
|
+
|
|
21
|
+
// Derive enable state for right button
|
|
22
|
+
let isRightButtonEnabled = $derived(validationState === 'Valid');
|
|
23
|
+
|
|
24
|
+
function rightButtonClick(event: MouseEvent): void {
|
|
25
|
+
if (validationState === 'Valid') {
|
|
26
|
+
rightButtonProperties?.onclick?.(event);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function bottomButtonClick(event: MouseEvent): void {
|
|
31
|
+
if (validationState === 'Valid') {
|
|
32
|
+
bottomButtonProperties?.onclick?.(event);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function triggerRightClickIfValid(event: KeyboardEvent): void {
|
|
37
|
+
if (event?.key === 'Enter' && validationState === 'Valid') {
|
|
38
|
+
rightButtonProperties?.onkeyup?.(event);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function handleStateChange(state: ValidationState): void {
|
|
43
|
+
validationState = state;
|
|
44
|
+
inputProperties.onStateChange?.(state);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function focus() {
|
|
48
|
+
inputRef?.focus();
|
|
49
|
+
}
|
|
50
50
|
</script>
|
|
51
51
|
|
|
52
|
-
{#if
|
|
53
|
-
<label class="label" for={
|
|
54
|
-
{
|
|
52
|
+
{#if inputProperties.label && inputProperties.label !== ''}
|
|
53
|
+
<label class="label" for={inputProperties.name}>
|
|
54
|
+
{inputProperties.label}
|
|
55
55
|
</label>
|
|
56
56
|
{/if}
|
|
57
57
|
|
|
58
58
|
<div class="input-button-container">
|
|
59
|
-
<div class="input-button {
|
|
60
|
-
{#if
|
|
59
|
+
<div class="input-button {validationState === 'Invalid' ? 'invalid' : 'valid'}">
|
|
60
|
+
{#if leftButtonProperties != null}
|
|
61
61
|
<div class="left-button">
|
|
62
|
-
<Button
|
|
63
|
-
<slot name="left-icon" slot="icon" />
|
|
64
|
-
</Button>
|
|
62
|
+
<Button {...leftButtonProperties} icon={leftIcon} />
|
|
65
63
|
</div>
|
|
66
64
|
{/if}
|
|
67
|
-
|
|
65
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
66
|
+
<div class="input" onkeyup={triggerRightClickIfValid}>
|
|
68
67
|
<Input
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
on:stateChange={handleState}
|
|
72
|
-
on:input={(event) => dispatch('input', event)}
|
|
73
|
-
on:focusout={onFocusOut}
|
|
74
|
-
on:valueChange
|
|
75
|
-
on:focus
|
|
76
|
-
on:click={onInputClick}
|
|
77
|
-
--input-width="auto"
|
|
68
|
+
{...inputProperties}
|
|
69
|
+
bind:value
|
|
78
70
|
bind:this={inputRef}
|
|
71
|
+
onStateChange={handleStateChange}
|
|
72
|
+
--input-width="auto"
|
|
79
73
|
/>
|
|
80
74
|
</div>
|
|
81
|
-
{#if
|
|
75
|
+
{#if rightButtonProperties != null}
|
|
82
76
|
<div class="right-button">
|
|
83
|
-
<Button
|
|
77
|
+
<Button
|
|
78
|
+
{...rightButtonProperties}
|
|
79
|
+
enable={isRightButtonEnabled}
|
|
80
|
+
onclick={rightButtonClick}
|
|
81
|
+
/>
|
|
84
82
|
</div>
|
|
85
83
|
{/if}
|
|
86
84
|
</div>
|
|
87
|
-
{#if
|
|
85
|
+
{#if bottomButtonProperties != null}
|
|
88
86
|
<div class="bottom-button">
|
|
89
|
-
<Button
|
|
87
|
+
<Button {...bottomButtonProperties} onclick={bottomButtonClick} />
|
|
90
88
|
</div>
|
|
91
89
|
{/if}
|
|
92
90
|
</div>
|
|
93
|
-
{#if
|
|
91
|
+
{#if inputProperties.onErrorMessage !== '' && validationState === 'Invalid'}
|
|
94
92
|
<div class="error-message">
|
|
95
|
-
{
|
|
93
|
+
{inputProperties.onErrorMessage}
|
|
96
94
|
</div>
|
|
97
95
|
{/if}
|
|
98
|
-
{#if typeof
|
|
96
|
+
{#if typeof inputProperties.infoMessage === 'string' && inputProperties.infoMessage !== ''}
|
|
99
97
|
<div class="info-message">
|
|
100
|
-
{
|
|
98
|
+
{inputProperties.infoMessage}
|
|
101
99
|
</div>
|
|
102
100
|
{/if}
|
|
103
101
|
|
|
104
102
|
<style>
|
|
105
103
|
.input-button-container {
|
|
104
|
+
--button-width: 100%;
|
|
105
|
+
--input-border: none;
|
|
106
|
+
--input-focus-border: none;
|
|
106
107
|
height: var(--input-height, fit-content);
|
|
107
108
|
font-size: var(--input-font-size, 16px) !important;
|
|
108
109
|
font-weight: 500;
|
|
109
110
|
margin: var(--input-button-margin);
|
|
110
111
|
border-radius: var(--input-button-radius, 4px);
|
|
111
|
-
--button-width: 100%;
|
|
112
|
-
--input-border: none;
|
|
113
|
-
--input-focus-border: none;
|
|
114
112
|
border: var(--input-button-container-border);
|
|
115
113
|
background: var(--input-button-container-background);
|
|
116
114
|
padding: var(--input-button-container-padding);
|
|
@@ -1,35 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
valueChange: CustomEvent<any>;
|
|
10
|
-
focus: FocusEvent;
|
|
11
|
-
input: CustomEvent<any>;
|
|
12
|
-
rightButtonClick: CustomEvent<any>;
|
|
13
|
-
leftButtonClick: CustomEvent<any>;
|
|
14
|
-
bottomButtonClick: CustomEvent<any>;
|
|
15
|
-
stateChange: CustomEvent<any>;
|
|
16
|
-
focusout: CustomEvent<any>;
|
|
17
|
-
inputClick: CustomEvent<any>;
|
|
18
|
-
} & {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {
|
|
22
|
-
'left-icon': {
|
|
23
|
-
slot: string;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
exports?: {} | undefined;
|
|
27
|
-
bindings?: string | undefined;
|
|
28
|
-
};
|
|
29
|
-
export type InputButtonProps = typeof __propDef.props;
|
|
30
|
-
export type InputButtonEvents = typeof __propDef.events;
|
|
31
|
-
export type InputButtonSlots = typeof __propDef.slots;
|
|
32
|
-
export default class InputButton extends SvelteComponent<InputButtonProps, InputButtonEvents, InputButtonSlots> {
|
|
33
|
-
get focus(): () => void;
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
1
|
+
import type { InputButtonProperties } from './properties';
|
|
2
|
+
declare const InputButton: import("svelte").Component<InputButtonProperties, {
|
|
3
|
+
focus: () => void;
|
|
4
|
+
}, "value">;
|
|
5
|
+
type InputButton = ReturnType<typeof InputButton>;
|
|
6
|
+
export default InputButton;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ButtonProperties } from '../Button/properties';
|
|
2
2
|
import type { InputProperties } from '../Input/properties';
|
|
3
|
+
import type { Snippet } from 'svelte';
|
|
3
4
|
export type InputButtonProperties = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
value: string;
|
|
6
|
+
inputProperties: Omit<InputProperties, 'value'>;
|
|
7
|
+
rightButtonProperties?: ButtonProperties | null;
|
|
8
|
+
leftButtonProperties?: ButtonProperties | null;
|
|
7
9
|
bottomButtonProperties?: ButtonProperties | null;
|
|
10
|
+
leftIcon?: Snippet;
|
|
8
11
|
};
|
|
9
|
-
export declare const defaultInputButtonProperties: InputButtonProperties;
|
|
@@ -1,18 +1 @@
|
|
|
1
|
-
|
|
2
|
-
const inputProperties = {
|
|
3
|
-
...defaultInputProperties,
|
|
4
|
-
actionInput: true
|
|
5
|
-
};
|
|
6
|
-
const rightButtonProperties = {
|
|
7
|
-
text: 'click',
|
|
8
|
-
enable: false,
|
|
9
|
-
showLoader: false,
|
|
10
|
-
loaderType: null,
|
|
11
|
-
type: 'submit'
|
|
12
|
-
};
|
|
13
|
-
export const defaultInputButtonProperties = {
|
|
14
|
-
inputProperties,
|
|
15
|
-
rightButtonProperties,
|
|
16
|
-
leftButtonProperties: null,
|
|
17
|
-
bottomButtonProperties: null
|
|
18
|
-
};
|
|
1
|
+
export {};
|
|
@@ -1,108 +1,131 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
<script lang="ts">
|
|
2
|
+
import Accordion from '../Accordion/Accordion.svelte';
|
|
3
|
+
import Loader from '../Loader/Loader.svelte';
|
|
4
|
+
import Img from '../Img/Img.svelte';
|
|
5
|
+
import type { ListItemProperties } from './properties';
|
|
6
|
+
|
|
7
|
+
let {
|
|
8
|
+
leftImageUrl,
|
|
9
|
+
leftImageFallbackUrl,
|
|
10
|
+
rightImageUrl,
|
|
11
|
+
label,
|
|
12
|
+
useAccordion = false,
|
|
13
|
+
rightContentText,
|
|
14
|
+
testId,
|
|
15
|
+
topSectionTestId,
|
|
16
|
+
rightImageTestId,
|
|
17
|
+
leftImageTestId,
|
|
18
|
+
centerTextTestId,
|
|
19
|
+
showLoader = false,
|
|
20
|
+
showRightContentLoader = false,
|
|
21
|
+
expand = $bindable(false),
|
|
22
|
+
preventFocus = false,
|
|
23
|
+
leftContent,
|
|
24
|
+
centerContent,
|
|
25
|
+
rightContent,
|
|
26
|
+
bottomContent,
|
|
27
|
+
onleftImageClick,
|
|
28
|
+
onrightImageClick,
|
|
29
|
+
oncenterTextClick,
|
|
30
|
+
onitemClick,
|
|
31
|
+
ontopSectionClick,
|
|
32
|
+
onkeydown
|
|
33
|
+
}: ListItemProperties = $props();
|
|
34
|
+
|
|
35
|
+
function handleLeftImageClick(event: MouseEvent): void {
|
|
36
|
+
onleftImageClick?.(event);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function handleRightImageClick(event: MouseEvent): void {
|
|
40
|
+
onrightImageClick?.(event);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function handleCenterTextClick(event: MouseEvent): void {
|
|
44
|
+
oncenterTextClick?.(event);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function handleItemClick(event: MouseEvent): void {
|
|
48
|
+
onitemClick?.(event);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function handleTopSectionClick(event: MouseEvent): void {
|
|
52
|
+
ontopSectionClick?.(event);
|
|
53
|
+
}
|
|
27
54
|
</script>
|
|
28
55
|
|
|
29
|
-
{#if
|
|
56
|
+
{#if leftImageUrl || rightImageUrl || label || leftContent || centerContent || rightContent || bottomContent}
|
|
30
57
|
<div class="item-container">
|
|
31
58
|
{#if showLoader}
|
|
32
|
-
<div class="item-loader"
|
|
59
|
+
<div class="item-loader"></div>
|
|
33
60
|
{/if}
|
|
34
61
|
<div
|
|
35
62
|
class="item"
|
|
36
63
|
class:prevent-focus={preventFocus}
|
|
37
|
-
|
|
38
|
-
|
|
64
|
+
onclick={handleItemClick}
|
|
65
|
+
{onkeydown}
|
|
39
66
|
role="button"
|
|
40
67
|
tabindex="0"
|
|
41
|
-
data-pw={
|
|
68
|
+
data-pw={testId}
|
|
42
69
|
>
|
|
43
70
|
<div
|
|
44
71
|
class="top-section"
|
|
45
72
|
class:prevent-focus={preventFocus}
|
|
46
|
-
|
|
47
|
-
|
|
73
|
+
onclick={handleTopSectionClick}
|
|
74
|
+
{onkeydown}
|
|
48
75
|
role="button"
|
|
49
76
|
tabindex="0"
|
|
50
|
-
data-pw={
|
|
77
|
+
data-pw={topSectionTestId}
|
|
51
78
|
>
|
|
52
79
|
<div class="left-content">
|
|
53
|
-
{#if
|
|
80
|
+
{#if leftImageUrl}
|
|
54
81
|
<div
|
|
55
82
|
class:prevent-focus={preventFocus}
|
|
56
|
-
|
|
57
|
-
|
|
83
|
+
onclick={handleLeftImageClick}
|
|
84
|
+
{onkeydown}
|
|
58
85
|
role="button"
|
|
59
86
|
tabindex="0"
|
|
60
|
-
data-pw={
|
|
87
|
+
data-pw={leftImageTestId}
|
|
61
88
|
>
|
|
62
|
-
<Img
|
|
63
|
-
src={properties.leftImageUrl}
|
|
64
|
-
alt=""
|
|
65
|
-
fallback={properties.leftImageFallbackUrl}
|
|
66
|
-
/>
|
|
89
|
+
<Img src={leftImageUrl} alt="" fallback={leftImageFallbackUrl} />
|
|
67
90
|
</div>
|
|
68
91
|
{/if}
|
|
69
|
-
{#if
|
|
70
|
-
|
|
92
|
+
{#if leftContent}
|
|
93
|
+
{@render leftContent?.()}
|
|
71
94
|
{/if}
|
|
72
95
|
</div>
|
|
73
96
|
<div class="center-content">
|
|
74
|
-
{#if
|
|
97
|
+
{#if label}
|
|
75
98
|
<div
|
|
76
99
|
class="center-text"
|
|
77
100
|
class:prevent-focus={preventFocus}
|
|
78
|
-
|
|
79
|
-
|
|
101
|
+
onclick={handleCenterTextClick}
|
|
102
|
+
{onkeydown}
|
|
80
103
|
role="button"
|
|
81
104
|
tabindex="0"
|
|
82
|
-
data-pw={
|
|
105
|
+
data-pw={centerTextTestId}
|
|
83
106
|
>
|
|
84
107
|
<!-- eslint-disable-next-line -->
|
|
85
|
-
{@html
|
|
108
|
+
{@html label}
|
|
86
109
|
</div>
|
|
87
110
|
{/if}
|
|
88
|
-
{#if
|
|
89
|
-
|
|
111
|
+
{#if centerContent}
|
|
112
|
+
{@render centerContent?.()}
|
|
90
113
|
{/if}
|
|
91
114
|
</div>
|
|
92
115
|
<div class="right-content">
|
|
93
|
-
{#if
|
|
94
|
-
|
|
116
|
+
{#if rightContent}
|
|
117
|
+
{@render rightContent?.()}
|
|
95
118
|
{/if}
|
|
96
|
-
{#if
|
|
119
|
+
{#if rightImageUrl}
|
|
97
120
|
<div
|
|
98
121
|
class:prevent-focus={preventFocus}
|
|
99
|
-
|
|
100
|
-
|
|
122
|
+
onclick={handleRightImageClick}
|
|
123
|
+
{onkeydown}
|
|
101
124
|
role="button"
|
|
102
125
|
tabindex="0"
|
|
103
|
-
data-pw={
|
|
126
|
+
data-pw={rightImageTestId}
|
|
104
127
|
>
|
|
105
|
-
<img class="right-img" src={
|
|
128
|
+
<img class="right-img" src={rightImageUrl} alt="" />
|
|
106
129
|
</div>
|
|
107
130
|
{/if}
|
|
108
131
|
{#if showRightContentLoader}
|
|
@@ -110,15 +133,15 @@ function handleTopSectionClick() {
|
|
|
110
133
|
<Loader />
|
|
111
134
|
</div>
|
|
112
135
|
{/if}
|
|
113
|
-
{#if
|
|
114
|
-
<span class="right-content-text">{
|
|
136
|
+
{#if rightContentText && rightContentText !== ''}
|
|
137
|
+
<span class="right-content-text">{rightContentText}</span>
|
|
115
138
|
{/if}
|
|
116
139
|
</div>
|
|
117
140
|
</div>
|
|
118
141
|
<div class="bottom-section">
|
|
119
|
-
{#if
|
|
120
|
-
<Accordion
|
|
121
|
-
|
|
142
|
+
{#if bottomContent && useAccordion}
|
|
143
|
+
<Accordion {expand}>
|
|
144
|
+
{@render bottomContent?.()}
|
|
122
145
|
</Accordion>
|
|
123
146
|
{/if}
|
|
124
147
|
</div>
|
|
@@ -1,35 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
properties?: ListItemProperties;
|
|
6
|
-
showLoader?: boolean;
|
|
7
|
-
showRightContentLoader?: boolean;
|
|
8
|
-
expand?: boolean;
|
|
9
|
-
preventFocus?: boolean;
|
|
10
|
-
};
|
|
11
|
-
events: {
|
|
12
|
-
keydown: KeyboardEvent;
|
|
13
|
-
leftImageClick: CustomEvent<any>;
|
|
14
|
-
rightImageClick: CustomEvent<any>;
|
|
15
|
-
centerTextClick: CustomEvent<any>;
|
|
16
|
-
itemClick: CustomEvent<any>;
|
|
17
|
-
topSectionClick: CustomEvent<any>;
|
|
18
|
-
} & {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {
|
|
22
|
-
leftContent: {};
|
|
23
|
-
centerContent: {};
|
|
24
|
-
rightContent: {};
|
|
25
|
-
bottomContent: {};
|
|
26
|
-
};
|
|
27
|
-
exports?: {} | undefined;
|
|
28
|
-
bindings?: string | undefined;
|
|
29
|
-
};
|
|
30
|
-
export type ListItemProps = typeof __propDef.props;
|
|
31
|
-
export type ListItemEvents = typeof __propDef.events;
|
|
32
|
-
export type ListItemSlots = typeof __propDef.slots;
|
|
33
|
-
export default class ListItem extends SvelteComponent<ListItemProps, ListItemEvents, ListItemSlots> {
|
|
34
|
-
}
|
|
35
|
-
export {};
|
|
1
|
+
import type { ListItemProperties } from './properties';
|
|
2
|
+
declare const ListItem: import("svelte").Component<ListItemProperties, {}, "expand">;
|
|
3
|
+
type ListItem = ReturnType<typeof ListItem>;
|
|
4
|
+
export default ListItem;
|
|
@@ -1,14 +1,28 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
1
2
|
export type ListItemProperties = {
|
|
2
|
-
leftImageUrl
|
|
3
|
-
leftImageFallbackUrl
|
|
4
|
-
rightImageUrl
|
|
5
|
-
label
|
|
6
|
-
useAccordion
|
|
7
|
-
rightContentText
|
|
3
|
+
leftImageUrl?: string | null;
|
|
4
|
+
leftImageFallbackUrl?: string | null;
|
|
5
|
+
rightImageUrl?: string | null;
|
|
6
|
+
label?: string | null;
|
|
7
|
+
useAccordion?: boolean;
|
|
8
|
+
rightContentText?: string | null;
|
|
8
9
|
testId?: string;
|
|
9
10
|
topSectionTestId?: string;
|
|
10
11
|
rightImageTestId?: string;
|
|
11
12
|
leftImageTestId?: string;
|
|
12
13
|
centerTextTestId?: string;
|
|
14
|
+
showLoader?: boolean;
|
|
15
|
+
showRightContentLoader?: boolean;
|
|
16
|
+
expand?: boolean;
|
|
17
|
+
preventFocus?: boolean;
|
|
18
|
+
leftContent?: Snippet;
|
|
19
|
+
centerContent?: Snippet;
|
|
20
|
+
rightContent?: Snippet;
|
|
21
|
+
bottomContent?: Snippet;
|
|
22
|
+
onleftImageClick?: (event: MouseEvent) => void;
|
|
23
|
+
onrightImageClick?: (event: MouseEvent) => void;
|
|
24
|
+
oncenterTextClick?: (event: MouseEvent) => void;
|
|
25
|
+
onitemClick?: (event: MouseEvent) => void;
|
|
26
|
+
ontopSectionClick?: (event: MouseEvent) => void;
|
|
27
|
+
onkeydown?: (event: KeyboardEvent) => void;
|
|
13
28
|
};
|
|
14
|
-
export declare const defaultListItemProperties: ListItemProperties;
|
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
slots: {};
|
|
9
|
-
exports?: {} | undefined;
|
|
10
|
-
bindings?: string | undefined;
|
|
1
|
+
export default Loader;
|
|
2
|
+
type Loader = SvelteComponent<{
|
|
3
|
+
[x: string]: never;
|
|
4
|
+
}, {
|
|
5
|
+
[evt: string]: CustomEvent<any>;
|
|
6
|
+
}, {}> & {
|
|
7
|
+
$$bindings?: string | undefined;
|
|
11
8
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
declare const Loader: $$__sveltets_2_IsomorphicComponent<{
|
|
10
|
+
[x: string]: never;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}, {}, string>;
|
|
14
|
+
interface $$__sveltets_2_IsomorphicComponent<Props extends Record<string, any> = any, Events extends Record<string, any> = any, Slots extends Record<string, any> = any, Exports = {}, Bindings = string> {
|
|
15
|
+
new (options: import("svelte").ComponentConstructorOptions<Props>): import("svelte").SvelteComponent<Props, Events, Slots> & {
|
|
16
|
+
$$bindings?: Bindings;
|
|
17
|
+
} & Exports;
|
|
18
|
+
(internal: unknown, props: {
|
|
19
|
+
$$events?: Events;
|
|
20
|
+
$$slots?: Slots;
|
|
21
|
+
}): Exports & {
|
|
22
|
+
$set?: any;
|
|
23
|
+
$on?: any;
|
|
24
|
+
};
|
|
25
|
+
z_$$bindings?: Bindings;
|
|
16
26
|
}
|
|
17
|
-
export {};
|