@juspay/svelte-ui-components 1.0.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/README.md +115 -0
- package/dist/Accordion/Accordion.svelte +35 -0
- package/dist/Accordion/Accordion.svelte.d.ts +18 -0
- package/dist/Animations/ModalAnimation.svelte +28 -0
- package/dist/Animations/ModalAnimation.svelte.d.ts +20 -0
- package/dist/Animations/OverlayAnimation.svelte +7 -0
- package/dist/Animations/OverlayAnimation.svelte.d.ts +27 -0
- package/dist/Badge/Badge.svelte +45 -0
- package/dist/Badge/Badge.svelte.d.ts +17 -0
- package/dist/Badge/properties.d.ts +4 -0
- package/dist/Badge/properties.js +1 -0
- package/dist/Banner/Banner.svelte +61 -0
- package/dist/Banner/Banner.svelte.d.ts +20 -0
- package/dist/Banner/properties.d.ts +5 -0
- package/dist/Banner/properties.js +1 -0
- package/dist/BrandLoader/BrandLoader.svelte +125 -0
- package/dist/BrandLoader/BrandLoader.svelte.d.ts +18 -0
- package/dist/BrandLoader/properties.d.ts +8 -0
- package/dist/BrandLoader/properties.js +7 -0
- package/dist/Button/Button.svelte +87 -0
- package/dist/Button/Button.svelte.d.ts +21 -0
- package/dist/Button/properties.d.ts +9 -0
- package/dist/Button/properties.js +7 -0
- package/dist/Carousel/Carousel.svelte +219 -0
- package/dist/Carousel/Carousel.svelte.d.ts +19 -0
- package/dist/Carousel/properties.d.ts +18 -0
- package/dist/Carousel/properties.js +7 -0
- package/dist/CheckListItem/CheckListItem.svelte +40 -0
- package/dist/CheckListItem/CheckListItem.svelte.d.ts +19 -0
- package/dist/Icon/Icon.svelte +32 -0
- package/dist/Icon/Icon.svelte.d.ts +20 -0
- package/dist/Icon/properties.d.ts +5 -0
- package/dist/Icon/properties.js +4 -0
- package/dist/Input/Input.svelte +218 -0
- package/dist/Input/Input.svelte.d.ts +26 -0
- package/dist/Input/properties.d.ts +25 -0
- package/dist/Input/properties.js +23 -0
- package/dist/InputButton/InputButton.svelte +157 -0
- package/dist/InputButton/InputButton.svelte.d.ts +27 -0
- package/dist/InputButton/properties.d.ts +8 -0
- package/dist/InputButton/properties.js +17 -0
- package/dist/ListItem/ListItem.svelte +196 -0
- package/dist/ListItem/ListItem.svelte.d.ts +32 -0
- package/dist/ListItem/properties.d.ts +8 -0
- package/dist/ListItem/properties.js +7 -0
- package/dist/Loader/Loader.svelte +89 -0
- package/dist/Loader/Loader.svelte.d.ts +15 -0
- package/dist/Modal/Modal.svelte +200 -0
- package/dist/Modal/Modal.svelte.d.ts +25 -0
- package/dist/Modal/properties.d.ts +15 -0
- package/dist/Modal/properties.js +12 -0
- package/dist/Select/Select.svelte +271 -0
- package/dist/Select/Select.svelte.d.ts +21 -0
- package/dist/Select/properties.d.ts +9 -0
- package/dist/Select/properties.js +1 -0
- package/dist/Status/Status.svelte +64 -0
- package/dist/Status/Status.svelte.d.ts +20 -0
- package/dist/Status/properties.d.ts +8 -0
- package/dist/Status/properties.js +6 -0
- package/dist/Table/Table.svelte +147 -0
- package/dist/Table/Table.svelte.d.ts +19 -0
- package/dist/Table/properties.d.ts +8 -0
- package/dist/Table/properties.js +1 -0
- package/dist/Toggle/Toggle.svelte +86 -0
- package/dist/Toggle/Toggle.svelte.d.ts +17 -0
- package/dist/Toolbar/Toolbar.svelte +95 -0
- package/dist/Toolbar/Toolbar.svelte.d.ts +25 -0
- package/dist/Toolbar/properties.d.ts +6 -0
- package/dist/Toolbar/properties.js +5 -0
- package/dist/index.d.ts +47 -0
- package/dist/index.js +30 -0
- package/dist/types.d.ts +19 -0
- package/dist/types.js +1 -0
- package/dist/utils.d.ts +11 -0
- package/dist/utils.js +147 -0
- package/package.json +162 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<script>import { createEventDispatcher, onDestroy, onMount } from "svelte";
|
|
2
|
+
import ModalAnimation from "../Animations/ModalAnimation.svelte";
|
|
3
|
+
import OverlayAnimation from "../Animations/OverlayAnimation.svelte";
|
|
4
|
+
import { defaultModalProperties } from "./properties";
|
|
5
|
+
const dispatch = createEventDispatcher();
|
|
6
|
+
let overlayDiv;
|
|
7
|
+
let backPressed = false;
|
|
8
|
+
export let properties = defaultModalProperties;
|
|
9
|
+
function handlePopstate() {
|
|
10
|
+
backPressed = true;
|
|
11
|
+
dispatch("close");
|
|
12
|
+
}
|
|
13
|
+
function handleRightImageClick() {
|
|
14
|
+
dispatch("headerRightImageClick");
|
|
15
|
+
}
|
|
16
|
+
function handleLeftImageClick() {
|
|
17
|
+
dispatch("headerLeftImageClick");
|
|
18
|
+
}
|
|
19
|
+
function handleOverlayClick(event) {
|
|
20
|
+
if (event.target && event.target === overlayDiv) {
|
|
21
|
+
dispatch("overlayClick");
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
function handleKeyDown(event) {
|
|
25
|
+
let key = event?.key;
|
|
26
|
+
if (key === "Escape") {
|
|
27
|
+
dispatch("overlayClick");
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
onMount(() => {
|
|
31
|
+
document.body.style.overflow = "hidden";
|
|
32
|
+
if (properties.supportHardwareBackPress) {
|
|
33
|
+
history.pushState(null, "", window.location.href);
|
|
34
|
+
window.addEventListener("popstate", handlePopstate);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
onDestroy(() => {
|
|
38
|
+
if (typeof window !== "undefined") {
|
|
39
|
+
document.body.style.overflow = "";
|
|
40
|
+
if (properties.supportHardwareBackPress) {
|
|
41
|
+
if (!backPressed) {
|
|
42
|
+
history.back();
|
|
43
|
+
}
|
|
44
|
+
window.removeEventListener("popstate", handlePopstate);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<svelte:window on:keydown={handleKeyDown} />
|
|
51
|
+
|
|
52
|
+
{#if $$slots.content}
|
|
53
|
+
<OverlayAnimation>
|
|
54
|
+
<div
|
|
55
|
+
bind:this={overlayDiv}
|
|
56
|
+
class="modal {properties.align} {properties.showOverlay
|
|
57
|
+
? 'overlay-active'
|
|
58
|
+
: 'overlay-inactive'}"
|
|
59
|
+
on:click={handleOverlayClick}
|
|
60
|
+
on:keydown
|
|
61
|
+
role="button"
|
|
62
|
+
tabindex="0"
|
|
63
|
+
>
|
|
64
|
+
<ModalAnimation enable={properties.enableTransition} align={properties.align}>
|
|
65
|
+
<div class="modal-content {properties.size}">
|
|
66
|
+
{#if properties.header.leftImage !== null || properties.header.text !== null || properties.header.rightImage !== null}
|
|
67
|
+
<div class="header">
|
|
68
|
+
{#if properties.header.leftImage}
|
|
69
|
+
<div on:click={handleLeftImageClick} on:keydown role="button" tabindex="0">
|
|
70
|
+
<img class="header-left-img" src={properties.header.leftImage} alt="" />
|
|
71
|
+
</div>
|
|
72
|
+
{/if}
|
|
73
|
+
{#if properties.header.text}
|
|
74
|
+
<div class="header-text">
|
|
75
|
+
{properties.header.text}
|
|
76
|
+
</div>
|
|
77
|
+
{/if}
|
|
78
|
+
{#if properties.header.rightImage}
|
|
79
|
+
<div role="button" tabindex="0" on:click={handleRightImageClick} on:keydown>
|
|
80
|
+
<img class="header-right-img" src={properties.header.rightImage} alt="" />
|
|
81
|
+
</div>
|
|
82
|
+
{/if}
|
|
83
|
+
</div>
|
|
84
|
+
{/if}
|
|
85
|
+
<div class="slot-content">
|
|
86
|
+
<slot name="content" />
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
</ModalAnimation>
|
|
90
|
+
</div>
|
|
91
|
+
</OverlayAnimation>
|
|
92
|
+
{/if}
|
|
93
|
+
|
|
94
|
+
<style>
|
|
95
|
+
.modal {
|
|
96
|
+
position: fixed;
|
|
97
|
+
top: 0;
|
|
98
|
+
bottom: 0;
|
|
99
|
+
left: 0;
|
|
100
|
+
right: 0;
|
|
101
|
+
width: 100vw;
|
|
102
|
+
height: 100vh;
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
z-index: var(--modal-z-index, 15);
|
|
106
|
+
-webkit-tap-highlight-color: transparent;
|
|
107
|
+
margin-top: var(--margin-top, 0px);
|
|
108
|
+
margin-bottom: var(--margin-bottom, 0px);
|
|
109
|
+
margin-left: var(--margin-left, 0px);
|
|
110
|
+
margin-right: var(--margin-right, 0px);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.overlay-active {
|
|
114
|
+
background-color: var(--background-color, #00000066);
|
|
115
|
+
pointer-events: auto;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.overlay-inactive {
|
|
119
|
+
pointer-events: none;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.modal-content {
|
|
123
|
+
pointer-events: auto;
|
|
124
|
+
background-color: var(--content-background-color, #ffffff);
|
|
125
|
+
cursor: auto;
|
|
126
|
+
display: flex;
|
|
127
|
+
flex-direction: column;
|
|
128
|
+
border-radius: var(--modal-border-radius, 0px);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
.slot-content {
|
|
132
|
+
display: flex;
|
|
133
|
+
overflow-y: scroll;
|
|
134
|
+
scrollbar-width: none;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.slot-content::-webkit-scrollbar {
|
|
138
|
+
display: none;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.center {
|
|
142
|
+
justify-content: center;
|
|
143
|
+
align-items: center;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.bottom {
|
|
147
|
+
justify-content: flex-end;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
.top {
|
|
151
|
+
justify-content: flex-start;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.small {
|
|
155
|
+
height: var(--modal-small-height, 20vh);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.medium {
|
|
159
|
+
height: var(--modal-medium-height, 50vh);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.large {
|
|
163
|
+
height: var(--modal-large-height, 80vh);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.fit-content {
|
|
167
|
+
height: fit-content;
|
|
168
|
+
max-height: var(--modal-fit-content-max-height, 80vh);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.header {
|
|
172
|
+
display: flex;
|
|
173
|
+
background-color: var(--modal-header-background-color, #f6f7f9);
|
|
174
|
+
padding: 18px 20px;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.header-text {
|
|
178
|
+
display: flex;
|
|
179
|
+
align-items: center;
|
|
180
|
+
flex: 1;
|
|
181
|
+
font-size: 16px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.header-left-img,
|
|
185
|
+
.header-right-img {
|
|
186
|
+
padding-top: var(--header-img-top-padding, 5px);
|
|
187
|
+
cursor: pointer;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.header-left-img {
|
|
191
|
+
margin-right: 18px;
|
|
192
|
+
width: var(--header-left-image-width, 25px);
|
|
193
|
+
height: var(--header-left-image-height, 25px);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
.header-right-img {
|
|
197
|
+
width: var(--header-right-image-width, 25px);
|
|
198
|
+
height: var(--header-right-image-height, 25px);
|
|
199
|
+
}
|
|
200
|
+
</style>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { ModalProperties } from './properties';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
properties?: ModalProperties | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
keydown: KeyboardEvent;
|
|
9
|
+
close: CustomEvent<any>;
|
|
10
|
+
headerRightImageClick: CustomEvent<any>;
|
|
11
|
+
headerLeftImageClick: CustomEvent<any>;
|
|
12
|
+
overlayClick: CustomEvent<any>;
|
|
13
|
+
} & {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {
|
|
17
|
+
content: {};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type ModalProps = typeof __propDef.props;
|
|
21
|
+
export type ModalEvents = typeof __propDef.events;
|
|
22
|
+
export type ModalSlots = typeof __propDef.slots;
|
|
23
|
+
export default class Modal extends SvelteComponent<ModalProps, ModalEvents, ModalSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type ModalSize = 'large' | 'medium' | 'small' | 'fit-content';
|
|
2
|
+
export type ModalAlign = 'top' | 'center' | 'bottom';
|
|
3
|
+
export type ModalProperties = {
|
|
4
|
+
size: ModalSize;
|
|
5
|
+
align: ModalAlign;
|
|
6
|
+
showOverlay: boolean;
|
|
7
|
+
supportHardwareBackPress: boolean;
|
|
8
|
+
enableTransition: boolean;
|
|
9
|
+
header: {
|
|
10
|
+
leftImage: string | null;
|
|
11
|
+
rightImage: string | null;
|
|
12
|
+
text: string | null;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare const defaultModalProperties: ModalProperties;
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
<script>import { createEventDispatcher, onDestroy, onMount } from "svelte";
|
|
2
|
+
import Button from "../Button/Button.svelte";
|
|
3
|
+
let selectedElementDiv = null;
|
|
4
|
+
export let properties = {
|
|
5
|
+
placeholder: "",
|
|
6
|
+
label: "",
|
|
7
|
+
allItems: [],
|
|
8
|
+
selectedItem: "",
|
|
9
|
+
selectedItemLabel: null,
|
|
10
|
+
showSelectedItemInDropdown: false,
|
|
11
|
+
selectMultipleItems: false
|
|
12
|
+
};
|
|
13
|
+
const applyButtonProps = {
|
|
14
|
+
text: "Apply",
|
|
15
|
+
enable: true,
|
|
16
|
+
showLoader: false,
|
|
17
|
+
loaderType: null,
|
|
18
|
+
type: "submit"
|
|
19
|
+
};
|
|
20
|
+
const selectAllButtonProps = {
|
|
21
|
+
text: "Select All",
|
|
22
|
+
enable: true,
|
|
23
|
+
showLoader: false,
|
|
24
|
+
loaderType: null,
|
|
25
|
+
type: "submit"
|
|
26
|
+
};
|
|
27
|
+
const clearAllButtonProps = {
|
|
28
|
+
text: "Clear All",
|
|
29
|
+
enable: true,
|
|
30
|
+
showLoader: false,
|
|
31
|
+
loaderType: null,
|
|
32
|
+
type: "submit"
|
|
33
|
+
};
|
|
34
|
+
let isSelectOpen = false;
|
|
35
|
+
const dispatch = createEventDispatcher();
|
|
36
|
+
$:
|
|
37
|
+
nonSelectedItems = properties.allItems.filter(
|
|
38
|
+
(item) => properties.selectMultipleItems ? !properties.selectedItem.includes(item) : item !== properties.selectedItem
|
|
39
|
+
);
|
|
40
|
+
function selectItem(item) {
|
|
41
|
+
if (properties.selectMultipleItems && Array.isArray(properties.selectedItemLabel) && Array.isArray(properties.selectedItem)) {
|
|
42
|
+
if (properties.selectedItem.includes(item)) {
|
|
43
|
+
properties.selectedItem = properties.selectedItem.filter(
|
|
44
|
+
(selectedItem) => selectedItem !== item
|
|
45
|
+
);
|
|
46
|
+
properties.selectedItemLabel = properties.selectedItemLabel.filter(
|
|
47
|
+
(label) => label !== item
|
|
48
|
+
);
|
|
49
|
+
} else {
|
|
50
|
+
properties.selectedItem = [...properties.selectedItem, item];
|
|
51
|
+
properties.selectedItemLabel = [...properties.selectedItemLabel, item];
|
|
52
|
+
}
|
|
53
|
+
} else {
|
|
54
|
+
properties.selectedItem = [item];
|
|
55
|
+
}
|
|
56
|
+
if (!properties.selectMultipleItems) {
|
|
57
|
+
toggleSelect();
|
|
58
|
+
dispatchEvent();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function dispatchEvent() {
|
|
62
|
+
dispatch("message", { selectedItems: properties.selectedItem });
|
|
63
|
+
}
|
|
64
|
+
function toggleSelect() {
|
|
65
|
+
isSelectOpen = !isSelectOpen;
|
|
66
|
+
dispatch("dropdownClick");
|
|
67
|
+
}
|
|
68
|
+
function clearAllItems() {
|
|
69
|
+
properties.selectedItem = [];
|
|
70
|
+
properties.selectedItemLabel = [];
|
|
71
|
+
}
|
|
72
|
+
function selectAllItems() {
|
|
73
|
+
properties.selectedItem = [...properties.allItems];
|
|
74
|
+
properties.selectedItemLabel = [...properties.allItems];
|
|
75
|
+
}
|
|
76
|
+
function closeSelect(event) {
|
|
77
|
+
const clickedElement = event.target;
|
|
78
|
+
if (selectedElementDiv !== null && !selectedElementDiv.contains(clickedElement)) {
|
|
79
|
+
const isItemClicked = clickedElement.classList.contains("item");
|
|
80
|
+
const isApplyButtonClicked = clickedElement.classList.contains("apply-btn");
|
|
81
|
+
const isClearAllButtonClicked = clickedElement.innerText === "Clear All";
|
|
82
|
+
const isSelectAllButtonClicked = clickedElement.innerText === "Select All";
|
|
83
|
+
if (!isItemClicked && !isApplyButtonClicked && !isClearAllButtonClicked && !isSelectAllButtonClicked) {
|
|
84
|
+
isSelectOpen = false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
onMount(() => {
|
|
89
|
+
document.addEventListener("click", closeSelect);
|
|
90
|
+
});
|
|
91
|
+
onDestroy(() => {
|
|
92
|
+
if (typeof window !== "undefined") {
|
|
93
|
+
document.removeEventListener("click", closeSelect);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
</script>
|
|
97
|
+
|
|
98
|
+
{#if properties.label !== null}
|
|
99
|
+
<label class="label-container" for={properties.label}>
|
|
100
|
+
{properties.label}
|
|
101
|
+
</label>
|
|
102
|
+
{/if}
|
|
103
|
+
|
|
104
|
+
{#if properties.allItems.length !== 0}
|
|
105
|
+
<div class="select">
|
|
106
|
+
<div
|
|
107
|
+
class="selected item"
|
|
108
|
+
on:click={toggleSelect}
|
|
109
|
+
bind:this={selectedElementDiv}
|
|
110
|
+
on:keydown
|
|
111
|
+
role="button"
|
|
112
|
+
tabindex="0"
|
|
113
|
+
>
|
|
114
|
+
{#if properties.selectMultipleItems && Array.isArray(properties.selectedItemLabel) && Array.isArray(properties.selectedItem)}
|
|
115
|
+
{#if properties.selectedItem.length === 0}
|
|
116
|
+
{properties.placeholder}
|
|
117
|
+
{:else if properties.selectedItemLabel?.length === 0 || properties.showSelectedItemInDropdown}
|
|
118
|
+
{properties.selectedItem.join(', ')}
|
|
119
|
+
{:else}
|
|
120
|
+
{properties.selectedItemLabel.join(', ')}
|
|
121
|
+
{/if}
|
|
122
|
+
{:else if properties.selectedItem === ''}
|
|
123
|
+
{properties.placeholder}
|
|
124
|
+
{:else if properties.selectedItemLabel === null || properties.selectedItemLabel === ''}
|
|
125
|
+
{properties.selectedItem}
|
|
126
|
+
{:else}
|
|
127
|
+
{properties.selectedItemLabel}
|
|
128
|
+
{/if}
|
|
129
|
+
<div class="filler" />
|
|
130
|
+
<img
|
|
131
|
+
src="https://sdk.breeze.in/gallery/icons/right-arrow.svg"
|
|
132
|
+
alt=""
|
|
133
|
+
class="arrow {isSelectOpen ? 'active' : ''}"
|
|
134
|
+
/>
|
|
135
|
+
</div>
|
|
136
|
+
<div
|
|
137
|
+
class="non-selected-items"
|
|
138
|
+
style="--non-selected-display:{isSelectOpen ? 'inline-block' : 'none'};"
|
|
139
|
+
>
|
|
140
|
+
{#if properties.selectMultipleItems}
|
|
141
|
+
<div class="multipleSelect-btn">
|
|
142
|
+
<Button properties={applyButtonProps} on:click={dispatchEvent} />
|
|
143
|
+
<Button properties={selectAllButtonProps} on:click={selectAllItems} />
|
|
144
|
+
<Button properties={clearAllButtonProps} on:click={clearAllItems} />
|
|
145
|
+
</div>
|
|
146
|
+
{/if}
|
|
147
|
+
<div class="item-list">
|
|
148
|
+
{#each properties.showSelectedItemInDropdown ? properties.allItems : nonSelectedItems as item}
|
|
149
|
+
<div
|
|
150
|
+
on:keydown
|
|
151
|
+
on:click={() => {
|
|
152
|
+
selectItem(item);
|
|
153
|
+
}}
|
|
154
|
+
class="item {properties.selectedItem.includes(item) ? 'selected item-selected' : ''}"
|
|
155
|
+
role="button"
|
|
156
|
+
tabindex="0"
|
|
157
|
+
>
|
|
158
|
+
{item}
|
|
159
|
+
</div>
|
|
160
|
+
{/each}
|
|
161
|
+
</div>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
{/if}
|
|
165
|
+
|
|
166
|
+
<style>
|
|
167
|
+
.select {
|
|
168
|
+
height: var(--select-height, fit-content);
|
|
169
|
+
background-color: var(--select-bgcolor, #ffffff);
|
|
170
|
+
font-size: var(--select-font-size, 14px);
|
|
171
|
+
font-family: var(--select-font-family, Euclid Circular A);
|
|
172
|
+
border-radius: var(--select-radius, 4px);
|
|
173
|
+
font-weight: var(--select-font-weight, 400);
|
|
174
|
+
width: var(--select-width, 100%);
|
|
175
|
+
min-width: var(--select-min-width);
|
|
176
|
+
box-shadow: 0px 1px 8px #2f537733;
|
|
177
|
+
-webkit-appearance: none !important; /* For Safari MWeb */
|
|
178
|
+
outline: none;
|
|
179
|
+
cursor: pointer;
|
|
180
|
+
border: var(--select-border);
|
|
181
|
+
word-break: var(--select-word-break, break-word);
|
|
182
|
+
resize: none;
|
|
183
|
+
position: relative;
|
|
184
|
+
white-space: var(--select-white-space);
|
|
185
|
+
color: var(--select-color);
|
|
186
|
+
--button-margin: 1px;
|
|
187
|
+
--button-border-radius: 2px;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.arrow {
|
|
191
|
+
height: 16px;
|
|
192
|
+
width: 16px;
|
|
193
|
+
transform: rotate(-0.25turn);
|
|
194
|
+
transition: transform 0.1s;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.active {
|
|
198
|
+
transform: rotate(0.25turn);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.item {
|
|
202
|
+
padding: var(--item-padding, 8px);
|
|
203
|
+
border-radius: 4px;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.filler {
|
|
207
|
+
flex: 1;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.item:hover {
|
|
211
|
+
background-color: var(--non-selected-hover-bg, #00000010);
|
|
212
|
+
color: var(--non-selected-hover-color);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.selected {
|
|
216
|
+
margin: 0px;
|
|
217
|
+
display: flex;
|
|
218
|
+
justify-content: flex-start;
|
|
219
|
+
align-items: center;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.selected:hover {
|
|
223
|
+
background-color: var(--selected-hover-bg, transparent);
|
|
224
|
+
color: var(--selected-color, black);
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.non-selected-items {
|
|
228
|
+
display: var(--non-selected-display);
|
|
229
|
+
background-color: var(--non-selected-item-bgcolor, #ffffff);
|
|
230
|
+
box-shadow: 0px 1px 8px #2f537733;
|
|
231
|
+
width: var(--non-selected-width, fit-content);
|
|
232
|
+
min-width: var(--non-selected-min-width, 100%);
|
|
233
|
+
position: absolute;
|
|
234
|
+
border-radius: 4px 4px 4px 4px;
|
|
235
|
+
margin: 4px 0px 0px 0px;
|
|
236
|
+
z-index: 10;
|
|
237
|
+
word-wrap: var(--non-selected-word-break, break-word);
|
|
238
|
+
white-space: var(--non-selected-white-space);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
::-webkit-scrollbar {
|
|
242
|
+
width: 0;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
.item-list {
|
|
246
|
+
max-height: var(--non-selected-max-height, 135px);
|
|
247
|
+
overflow-y: auto;
|
|
248
|
+
position: relative;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.item-selected::after {
|
|
252
|
+
content: '✔';
|
|
253
|
+
position: absolute;
|
|
254
|
+
right: 7px;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.label-container {
|
|
258
|
+
font-weight: var(--label-text-weight, 400);
|
|
259
|
+
font-size: var(--label-text-size, 12px);
|
|
260
|
+
color: var(--label-text-color, #000000);
|
|
261
|
+
margin-bottom: 4px;
|
|
262
|
+
display: inline-block;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.multipleSelect-btn {
|
|
266
|
+
display: flex;
|
|
267
|
+
width: var(--multipleSelect-btn-width, 100%);
|
|
268
|
+
white-space: var(--multipleSelect-btn-white-space, nowrap);
|
|
269
|
+
padding: var(--multipleSelect-btn-padding, 2px);
|
|
270
|
+
}
|
|
271
|
+
</style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
import type { SelectProperties } from './properties';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
properties?: SelectProperties | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
keydown: KeyboardEvent;
|
|
9
|
+
message: CustomEvent<any>;
|
|
10
|
+
dropdownClick: CustomEvent<any>;
|
|
11
|
+
} & {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export type SelectProps = typeof __propDef.props;
|
|
17
|
+
export type SelectEvents = typeof __propDef.events;
|
|
18
|
+
export type SelectSlots = typeof __propDef.slots;
|
|
19
|
+
export default class Select extends SvelteComponent<SelectProps, SelectEvents, SelectSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<script context="module">export const prerender = true;
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<script>import { defaultStatusProperties } from "./properties";
|
|
5
|
+
import Button from "../Button/Button.svelte";
|
|
6
|
+
import { createEventDispatcher } from "svelte";
|
|
7
|
+
const dispatch = createEventDispatcher();
|
|
8
|
+
export let properties = defaultStatusProperties;
|
|
9
|
+
function handleButtonClick() {
|
|
10
|
+
dispatch("buttonClick");
|
|
11
|
+
}
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<div class="background">
|
|
15
|
+
<div class="order-status">
|
|
16
|
+
<div class="status-image"><img src={properties.statusIcon} alt="status" /></div>
|
|
17
|
+
<div class="status-text">{properties.statusText}</div>
|
|
18
|
+
<div class="status-description">
|
|
19
|
+
<!-- eslint-disable-next-line -->
|
|
20
|
+
{@html properties.statusDescription}
|
|
21
|
+
</div>
|
|
22
|
+
{#if properties.buttonProperties !== null}
|
|
23
|
+
<Button properties={properties.buttonProperties} on:click={handleButtonClick} />
|
|
24
|
+
{/if}
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
|
|
28
|
+
<style>
|
|
29
|
+
.status-text {
|
|
30
|
+
font-weight: var(--status-font-weight, 600);
|
|
31
|
+
color: var(--status-description-font-color, #2f3841);
|
|
32
|
+
margin-bottom: 8px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.status-description {
|
|
36
|
+
font-weight: var(--status-font-weight, 400);
|
|
37
|
+
color: var(--status-description-font-color, #436484cc);
|
|
38
|
+
padding: 0px 42px;
|
|
39
|
+
margin-bottom: 25px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.status-image {
|
|
43
|
+
display: flex;
|
|
44
|
+
margin-bottom: 25px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.order-status {
|
|
48
|
+
flex-direction: column;
|
|
49
|
+
display: flex;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
align-items: center;
|
|
52
|
+
min-height: 100vh;
|
|
53
|
+
font-family: var(--order-font, 'Euclid Circular A');
|
|
54
|
+
font-size: var(--order-font-size, 14px);
|
|
55
|
+
text-align: center;
|
|
56
|
+
}
|
|
57
|
+
@supports ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
|
|
58
|
+
.order-status {
|
|
59
|
+
background-color: rgba(255, 255, 255, 0.6);
|
|
60
|
+
-webkit-backdrop-filter: blur(60px);
|
|
61
|
+
backdrop-filter: blur(60px);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponent } from "svelte";
|
|
2
|
+
export declare const prerender = true;
|
|
3
|
+
import type { StatusProperties } from './properties';
|
|
4
|
+
declare const __propDef: {
|
|
5
|
+
props: {
|
|
6
|
+
properties?: StatusProperties | undefined;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
buttonClick: CustomEvent<any>;
|
|
10
|
+
} & {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
};
|
|
15
|
+
export type StatusProps = typeof __propDef.props;
|
|
16
|
+
export type StatusEvents = typeof __propDef.events;
|
|
17
|
+
export type StatusSlots = typeof __propDef.slots;
|
|
18
|
+
export default class Status extends SvelteComponent<StatusProps, StatusEvents, StatusSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ButtonProperties } from '../Button/properties';
|
|
2
|
+
export type StatusProperties = {
|
|
3
|
+
statusIcon: string;
|
|
4
|
+
statusText: string;
|
|
5
|
+
statusDescription: string;
|
|
6
|
+
buttonProperties: ButtonProperties | null;
|
|
7
|
+
};
|
|
8
|
+
export declare const defaultStatusProperties: StatusProperties;
|