@hyvor/design 0.0.67 → 0.0.68
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/components/ActionList/ActionList.svelte +2 -7
- package/dist/components/ActionList/ActionListGroup.svelte +24 -29
- package/dist/components/ActionList/ActionListItem.svelte +86 -88
- package/dist/components/ActionList/Selected.svelte +17 -20
- package/dist/components/Avatar/Avatar.svelte +7 -11
- package/dist/components/Avatar/AvatarStack.svelte +16 -20
- package/dist/components/Base/Base.svelte +3 -3
- package/dist/components/Box/Box.svelte +8 -8
- package/dist/components/Button/Button.svelte +33 -42
- package/dist/components/Button/ButtonGroup.svelte +6 -6
- package/dist/components/Callout/Callout.svelte +88 -86
- package/dist/components/Callout/Callout.svelte.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.svelte +113 -121
- package/dist/components/CodeBlock/CodeBlock.svelte +26 -23
- package/dist/components/CodeBlock/getCode.js +6 -6
- package/dist/components/CodeBlock/hljs.scss +189 -191
- package/dist/components/CodeBlock/prism.scss +370 -7
- package/dist/components/ColorPicker/ColorPicker.svelte +42 -42
- package/dist/components/Dark/DarkProvider.svelte +9 -9
- package/dist/components/Dark/DarkToggle.svelte +7 -10
- package/dist/components/Divider/Divider.svelte +6 -7
- package/dist/components/Dropdown/Dropdown.svelte +33 -108
- package/dist/components/Dropdown/DropdownContent.svelte +120 -0
- package/dist/components/Dropdown/DropdownContent.svelte.d.ts +24 -0
- package/dist/components/FormControl/Caption.svelte +9 -9
- package/dist/components/FormControl/FormControl.svelte +18 -18
- package/dist/components/FormControl/InputGroup.svelte +7 -8
- package/dist/components/FormControl/Label.svelte +5 -5
- package/dist/components/FormControl/Validation.svelte +18 -16
- package/dist/components/FormControl/Validation.svelte.d.ts +1 -1
- package/dist/components/HyvorBar/BarProducts.svelte +52 -0
- package/dist/components/HyvorBar/BarProducts.svelte.d.ts +39 -0
- package/dist/components/HyvorBar/BarSupport.svelte +119 -0
- package/dist/components/HyvorBar/BarSupport.svelte.d.ts +19 -0
- package/dist/components/HyvorBar/BarUpdates.svelte +58 -0
- package/dist/components/HyvorBar/BarUpdates.svelte.d.ts +18 -0
- package/dist/components/HyvorBar/BarUpdatesList.svelte +134 -0
- package/dist/components/HyvorBar/BarUpdatesList.svelte.d.ts +18 -0
- package/dist/components/HyvorBar/BarUser.svelte +60 -0
- package/dist/components/HyvorBar/BarUser.svelte.d.ts +16 -0
- package/dist/components/HyvorBar/BarUserPreview.svelte +42 -0
- package/dist/components/HyvorBar/BarUserPreview.svelte.d.ts +14 -0
- package/dist/components/HyvorBar/HyvorBar.svelte +150 -0
- package/dist/components/HyvorBar/HyvorBar.svelte.d.ts +19 -0
- package/dist/components/HyvorBar/bar.d.ts +33 -0
- package/dist/components/HyvorBar/bar.js +74 -0
- package/dist/components/HyvorBar/img/G2.svelte +9 -0
- package/dist/components/HyvorBar/img/G2.svelte.d.ts +23 -0
- package/dist/components/HyvorBar/img/Trustpilot.svelte +11 -0
- package/dist/components/HyvorBar/img/Trustpilot.svelte.d.ts +23 -0
- package/dist/components/IconButton/IconButton.svelte +19 -23
- package/dist/components/IconMessage/IconMessage.svelte +89 -38
- package/dist/components/IconMessage/IconMessage.svelte.d.ts +9 -1
- package/dist/components/Internationalization/InternationalizationProvider.svelte +2 -2
- package/dist/components/Internationalization/InternationalizationProvider.svelte.d.ts +1 -1
- package/dist/components/Internationalization/LanguageToggle.svelte +33 -36
- package/dist/components/Internationalization/LanguageToggle.svelte.d.ts +2 -2
- package/dist/components/Internationalization/T.svelte.d.ts +3 -3
- package/dist/components/Internationalization/i18n.d.ts +4 -4
- package/dist/components/Internationalization/i18n.js +13 -11
- package/dist/components/Internationalization/t.d.ts +3 -3
- package/dist/components/Internationalization/t.js +4 -4
- package/dist/components/Internationalization/types.d.ts +1 -1
- package/dist/components/Link/Link.svelte +53 -58
- package/dist/components/Loader/LoadButton.svelte +15 -29
- package/dist/components/Loader/Loader.svelte +56 -69
- package/dist/components/Modal/ConfirmModalProvider.svelte +18 -36
- package/dist/components/Modal/Modal.svelte +134 -164
- package/dist/components/Modal/ModalFooter.svelte +23 -26
- package/dist/components/Modal/confirm.d.ts +1 -1
- package/dist/components/Modal/confirm.js +4 -4
- package/dist/components/Modal/modal-types.d.ts +2 -2
- package/dist/components/NavLink/NavLink.svelte +78 -86
- package/dist/components/Radio/Radio.svelte +23 -31
- package/dist/components/Slider/Slider.svelte +71 -79
- package/dist/components/SplitControl/SplitControl.svelte +28 -42
- package/dist/components/Switch/Switch.svelte +60 -65
- package/dist/components/TabNav/TabNav.svelte +6 -10
- package/dist/components/TabNav/TabNavItem.svelte +36 -43
- package/dist/components/Table/Table.svelte +7 -4
- package/dist/components/Table/TableRow.svelte +23 -23
- package/dist/components/Tag/Tag.svelte +28 -36
- package/dist/components/Text/Text.svelte +15 -22
- package/dist/components/TextInput/TextInput.svelte +26 -26
- package/dist/components/Textarea/Textarea.svelte +38 -38
- package/dist/components/Toast/ToastIcon.svelte +29 -31
- package/dist/components/Toast/ToastMessage.svelte +33 -39
- package/dist/components/Toast/ToastProvider.svelte +16 -16
- package/dist/components/Toast/cleaner.js +5 -5
- package/dist/components/Toast/toast.d.ts +2 -2
- package/dist/components/Toast/toast.js +10 -10
- package/dist/components/Tooltip/Tooltip.svelte +82 -83
- package/dist/components/directives/clickOutside.js +4 -4
- package/dist/components/directives/debounce.d.ts +1 -0
- package/dist/components/directives/debounce.js +8 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/index.css +31 -33
- package/dist/marketing/Container/Container.svelte +8 -8
- package/dist/marketing/Docs/Content/Content.svelte +8 -7
- package/dist/marketing/Docs/Content/DocsImage.svelte +52 -62
- package/dist/marketing/Docs/Docs.svelte +21 -24
- package/dist/marketing/Docs/Nav/Nav.svelte +21 -22
- package/dist/marketing/Docs/Nav/NavCategory.svelte +28 -28
- package/dist/marketing/Docs/Nav/NavItem.svelte +21 -24
- package/dist/marketing/Docs/Sidebar/Sidebar.svelte +22 -25
- package/dist/marketing/Docs/Toc.svelte +17 -19
- package/dist/marketing/Document/Document.svelte +5 -5
- package/dist/marketing/Document/DocumentTitle.svelte +49 -49
- package/dist/marketing/Footer/Footer.svelte +111 -119
- package/dist/marketing/Footer/FooterLinkList.svelte +24 -26
- package/dist/marketing/Header/Header.svelte +7 -15
- package/dist/marketing/Logo/LogoBlogs.svelte +41 -0
- package/dist/marketing/Logo/LogoBlogs.svelte.d.ts +16 -0
- package/dist/marketing/Logo/LogoCore.svelte +41 -0
- package/dist/marketing/Logo/LogoCore.svelte.d.ts +16 -0
- package/dist/marketing/Logo/LogoFortguard.svelte +49 -0
- package/dist/marketing/Logo/LogoFortguard.svelte.d.ts +16 -0
- package/dist/marketing/Logo/LogoTalk.svelte +27 -0
- package/dist/marketing/Logo/LogoTalk.svelte.d.ts +16 -0
- package/dist/stores/dark.js +8 -8
- package/dist/variables.scss +41 -48
- package/package.json +59 -58
|
@@ -10,35 +10,21 @@ export let buttonProps = {};
|
|
|
10
10
|
</script>
|
|
11
11
|
|
|
12
12
|
{#if show}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{:else}
|
|
23
|
-
|
|
24
|
-
<Button
|
|
25
|
-
size="small"
|
|
26
|
-
on:click
|
|
27
|
-
{...buttonProps}
|
|
28
|
-
>
|
|
29
|
-
{text}
|
|
30
|
-
</Button>
|
|
31
|
-
|
|
32
|
-
{/if}
|
|
33
|
-
|
|
34
|
-
</div>
|
|
35
|
-
|
|
13
|
+
<div class="load-button" style:height="{height}px" {...divProps}>
|
|
14
|
+
{#if loading}
|
|
15
|
+
<Loader {...loaderProps} />
|
|
16
|
+
{:else}
|
|
17
|
+
<Button size="small" on:click {...buttonProps}>
|
|
18
|
+
{text}
|
|
19
|
+
</Button>
|
|
20
|
+
{/if}
|
|
21
|
+
</div>
|
|
36
22
|
{/if}
|
|
37
23
|
|
|
38
24
|
<style>
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
</style>
|
|
25
|
+
.load-button {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
IconCheckCircleFill,
|
|
3
|
-
IconXCircleFill
|
|
4
|
-
} from "@hyvor/icons";
|
|
1
|
+
<script>import { IconCheckCircleFill, IconXCircleFill } from "@hyvor/icons";
|
|
5
2
|
export let block = false;
|
|
6
3
|
export let full = false;
|
|
7
4
|
export let padding = "medium";
|
|
@@ -42,72 +39,61 @@ const paddings = {
|
|
|
42
39
|
padding = typeof padding === "number" ? padding : paddings[padding];
|
|
43
40
|
</script>
|
|
44
41
|
|
|
45
|
-
<div
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
style:padding={block ? padding + "px" : undefined}
|
|
55
|
-
{...$$restProps}
|
|
42
|
+
<div
|
|
43
|
+
class="loader"
|
|
44
|
+
class:block
|
|
45
|
+
class:full
|
|
46
|
+
class:success={state === 'success'}
|
|
47
|
+
class:error={state === 'error'}
|
|
48
|
+
style:--local-size={size + 'px'}
|
|
49
|
+
style:padding={block ? padding + 'px' : undefined}
|
|
50
|
+
{...$$restProps}
|
|
56
51
|
>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
{#if $$slots.default}
|
|
102
|
-
<div class="message">
|
|
103
|
-
<slot></slot>
|
|
104
|
-
</div>
|
|
105
|
-
{/if}
|
|
106
|
-
|
|
52
|
+
{#if state !== 'none'}
|
|
53
|
+
<span class="loader-wrap">
|
|
54
|
+
{#if state === 'loading'}
|
|
55
|
+
<svg>
|
|
56
|
+
<circle
|
|
57
|
+
class="track"
|
|
58
|
+
cx="50%"
|
|
59
|
+
cy="50%"
|
|
60
|
+
r={r + 'px'}
|
|
61
|
+
fill="none"
|
|
62
|
+
stroke-width={strokeWidth}
|
|
63
|
+
stroke={colorTrack}
|
|
64
|
+
></circle>
|
|
65
|
+
<circle
|
|
66
|
+
class="progress"
|
|
67
|
+
cx="50%"
|
|
68
|
+
cy="50%"
|
|
69
|
+
r={r + 'px'}
|
|
70
|
+
fill="none"
|
|
71
|
+
stroke-width={strokeWidth}
|
|
72
|
+
stroke={color}
|
|
73
|
+
stroke-linecap="round"
|
|
74
|
+
stroke-dasharray={strokeDashArray}
|
|
75
|
+
stroke-dashoffset={strokeDashOffset}
|
|
76
|
+
></circle>
|
|
77
|
+
</svg>
|
|
78
|
+
{:else if state === 'success'}
|
|
79
|
+
<span class="success-icon">
|
|
80
|
+
<IconCheckCircleFill color="var(--green)" width={size} height={size} />
|
|
81
|
+
</span>
|
|
82
|
+
{:else if state === 'error'}
|
|
83
|
+
<span class="error-icon">
|
|
84
|
+
<IconXCircleFill color="var(--red)" width={size} height={size} />
|
|
85
|
+
</span>
|
|
86
|
+
{/if}
|
|
87
|
+
</span>
|
|
88
|
+
{/if}
|
|
89
|
+
|
|
90
|
+
{#if $$slots.default}
|
|
91
|
+
<div class="message">
|
|
92
|
+
<slot></slot>
|
|
93
|
+
</div>
|
|
94
|
+
{/if}
|
|
107
95
|
</div>
|
|
108
96
|
|
|
109
|
-
|
|
110
|
-
|
|
111
97
|
<style>.loader {
|
|
112
98
|
display: inline-flex;
|
|
113
99
|
align-items: center;
|
|
@@ -147,7 +133,8 @@ padding = typeof padding === "number" ? padding : paddings[padding];
|
|
|
147
133
|
position: relative;
|
|
148
134
|
}
|
|
149
135
|
|
|
150
|
-
.success-icon,
|
|
136
|
+
.success-icon,
|
|
137
|
+
.error-icon {
|
|
151
138
|
animation: scale 0.2s ease-in-out;
|
|
152
139
|
}
|
|
153
140
|
|
|
@@ -184,4 +171,4 @@ circle.progress {
|
|
|
184
171
|
transform: scale(1);
|
|
185
172
|
opacity: 1;
|
|
186
173
|
}
|
|
187
|
-
}</style>
|
|
174
|
+
}</style>
|
|
@@ -18,40 +18,22 @@ $: {
|
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
20
|
{#if $confirmStore}
|
|
21
|
+
<Modal title={$confirmStore.title} bind:show size="small" loading={$confirmStore.loading}>
|
|
22
|
+
{#if typeof $confirmStore.content === 'string'}
|
|
23
|
+
{$confirmStore.content}
|
|
24
|
+
{:else}
|
|
25
|
+
<svelte:component this={$confirmStore.content} {...$confirmStore.contentProps || {}} />
|
|
26
|
+
{/if}
|
|
21
27
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
{...$confirmStore.contentProps || {}}
|
|
35
|
-
/>
|
|
36
|
-
{/if}
|
|
37
|
-
|
|
38
|
-
<svelte:fragment slot="footer">
|
|
39
|
-
<ButtonGroup>
|
|
40
|
-
<Button
|
|
41
|
-
variant="invisible"
|
|
42
|
-
on:click={handleCancel}
|
|
43
|
-
>
|
|
44
|
-
{$confirmStore.cancelText || "Cancel"}
|
|
45
|
-
</Button>
|
|
46
|
-
<Button
|
|
47
|
-
color={$confirmStore.danger ? "red" : "accent"}
|
|
48
|
-
on:click={handleConfirm}
|
|
49
|
-
>
|
|
50
|
-
{$confirmStore.confirmText || "Confirm"}
|
|
51
|
-
</Button>
|
|
52
|
-
</ButtonGroup>
|
|
53
|
-
</svelte:fragment>
|
|
54
|
-
|
|
55
|
-
</Modal>
|
|
56
|
-
|
|
57
|
-
{/if}
|
|
28
|
+
<svelte:fragment slot="footer">
|
|
29
|
+
<ButtonGroup>
|
|
30
|
+
<Button variant="invisible" on:click={handleCancel}>
|
|
31
|
+
{$confirmStore.cancelText || 'Cancel'}
|
|
32
|
+
</Button>
|
|
33
|
+
<Button color={$confirmStore.danger ? 'red' : 'accent'} on:click={handleConfirm}>
|
|
34
|
+
{$confirmStore.confirmText || 'Confirm'}
|
|
35
|
+
</Button>
|
|
36
|
+
</ButtonGroup>
|
|
37
|
+
</svelte:fragment>
|
|
38
|
+
</Modal>
|
|
39
|
+
{/if}
|
|
@@ -39,172 +39,142 @@ $:
|
|
|
39
39
|
show, setFlex();
|
|
40
40
|
</script>
|
|
41
41
|
|
|
42
|
-
<svelte:window
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
|
|
42
|
+
<svelte:window
|
|
43
|
+
on:keyup={(e) => {
|
|
44
|
+
if (e.key === 'Escape' && closeOnEscape && !loading) {
|
|
45
|
+
show = false;
|
|
46
|
+
}
|
|
47
|
+
}}
|
|
48
|
+
/>
|
|
48
49
|
|
|
49
50
|
{#if show}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
{#if $$slots.footer}
|
|
107
|
-
<slot name="footer" />
|
|
108
|
-
{:else if footer}
|
|
109
|
-
<ModalFooter
|
|
110
|
-
{footer}
|
|
111
|
-
bind:show={show}
|
|
112
|
-
on:cancel
|
|
113
|
-
on:confirm
|
|
114
|
-
/>
|
|
115
|
-
{/if}
|
|
116
|
-
</div>
|
|
117
|
-
{/if}
|
|
118
|
-
|
|
119
|
-
{#if loading}
|
|
120
|
-
<div
|
|
121
|
-
class="loading"
|
|
122
|
-
in:fade={{duration: 100}}
|
|
123
|
-
>
|
|
124
|
-
<Loader full>
|
|
125
|
-
{#if typeof loading === "string"}
|
|
126
|
-
{loading}
|
|
127
|
-
{/if}
|
|
128
|
-
</Loader>
|
|
129
|
-
</div>
|
|
130
|
-
{/if}
|
|
131
|
-
|
|
132
|
-
</div>
|
|
133
|
-
|
|
134
|
-
</div>
|
|
51
|
+
<div class="wrap" bind:this={wrapEl} in:fade={{ duration: 100 }} out:fade={{ duration: 100 }}>
|
|
52
|
+
<div
|
|
53
|
+
class="inner {size}"
|
|
54
|
+
use:clickOutside={{
|
|
55
|
+
enabled: closeOnOutsideClick,
|
|
56
|
+
callback: () => (!loading ? (show = false) : null)
|
|
57
|
+
}}
|
|
58
|
+
in:scale={{ duration: 100, start: 0.9, opacity: 0.9 }}
|
|
59
|
+
out:scale={{ duration: 100, start: 0.9, opacity: 0.9 }}
|
|
60
|
+
bind:this={innerEl}
|
|
61
|
+
{role}
|
|
62
|
+
aria-modal="true"
|
|
63
|
+
aria-labelledby={titleId}
|
|
64
|
+
aria-describedby={descId}
|
|
65
|
+
>
|
|
66
|
+
<div class="header">
|
|
67
|
+
<div class="title" id={titleId}>
|
|
68
|
+
{#if $$slots.title}
|
|
69
|
+
<slot name="title" />
|
|
70
|
+
{:else}
|
|
71
|
+
<span>{title}</span>
|
|
72
|
+
{/if}
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div class="close-wrap">
|
|
76
|
+
<IconButton variant="invisible" on:click={handleCancel}>
|
|
77
|
+
<IconX size={25} />
|
|
78
|
+
</IconButton>
|
|
79
|
+
</div>
|
|
80
|
+
</div>
|
|
81
|
+
|
|
82
|
+
<div class="content" id={descId}>
|
|
83
|
+
<slot />
|
|
84
|
+
</div>
|
|
85
|
+
|
|
86
|
+
{#if $$slots.footer || footer}
|
|
87
|
+
<div class="footer">
|
|
88
|
+
{#if $$slots.footer}
|
|
89
|
+
<slot name="footer" />
|
|
90
|
+
{:else if footer}
|
|
91
|
+
<ModalFooter {footer} bind:show on:cancel on:confirm />
|
|
92
|
+
{/if}
|
|
93
|
+
</div>
|
|
94
|
+
{/if}
|
|
95
|
+
|
|
96
|
+
{#if loading}
|
|
97
|
+
<div class="loading" in:fade={{ duration: 100 }}>
|
|
98
|
+
<Loader full>
|
|
99
|
+
{#if typeof loading === 'string'}
|
|
100
|
+
{loading}
|
|
101
|
+
{/if}
|
|
102
|
+
</Loader>
|
|
103
|
+
</div>
|
|
104
|
+
{/if}
|
|
105
|
+
</div>
|
|
106
|
+
</div>
|
|
135
107
|
{/if}
|
|
136
108
|
|
|
137
109
|
<style>
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
</style>
|
|
110
|
+
.loading {
|
|
111
|
+
position: absolute;
|
|
112
|
+
top: 0;
|
|
113
|
+
left: 0;
|
|
114
|
+
z-index: 1;
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
background-color: var(--box-background);
|
|
118
|
+
border-radius: var(--box-radius);
|
|
119
|
+
box-shadow: var(--box-shadow);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.wrap {
|
|
123
|
+
position: fixed;
|
|
124
|
+
top: 0;
|
|
125
|
+
left: 0;
|
|
126
|
+
z-index: 10000000;
|
|
127
|
+
width: 100%;
|
|
128
|
+
height: 100%;
|
|
129
|
+
background: rgba(0, 0, 0, 0.5);
|
|
130
|
+
display: flex;
|
|
131
|
+
align-items: center;
|
|
132
|
+
justify-content: center;
|
|
133
|
+
padding: 30px;
|
|
134
|
+
overflow: auto;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.inner {
|
|
138
|
+
background: var(--box-background);
|
|
139
|
+
border-radius: var(--box-radius);
|
|
140
|
+
box-shadow: var(--box-shadow);
|
|
141
|
+
width: 650px;
|
|
142
|
+
max-width: 100%;
|
|
143
|
+
position: relative;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.inner.small {
|
|
147
|
+
width: 425px;
|
|
148
|
+
}
|
|
149
|
+
.inner.large {
|
|
150
|
+
width: 800px;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.header {
|
|
154
|
+
padding: 20px 25px;
|
|
155
|
+
display: flex;
|
|
156
|
+
align-items: center;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.title {
|
|
160
|
+
flex: 1;
|
|
161
|
+
}
|
|
162
|
+
.title span {
|
|
163
|
+
font-size: 1.2em;
|
|
164
|
+
font-weight: 600;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
.content {
|
|
168
|
+
padding: 20px 25px;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
.footer {
|
|
172
|
+
padding: 20px 25px;
|
|
173
|
+
display: flex;
|
|
174
|
+
align-items: center;
|
|
175
|
+
justify-content: flex-end;
|
|
176
|
+
}
|
|
177
|
+
.footer :global(button:not(:last-child)) {
|
|
178
|
+
margin-right: 2px;
|
|
179
|
+
}
|
|
180
|
+
</style>
|
|
@@ -6,31 +6,28 @@ export let footer;
|
|
|
6
6
|
const dispatch = createEventDispatcher();
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
|
-
|
|
10
9
|
<ButtonGroup>
|
|
10
|
+
{#if footer.cancel !== false}
|
|
11
|
+
<Button
|
|
12
|
+
variant="invisible"
|
|
13
|
+
on:click={() => {
|
|
14
|
+
show = false;
|
|
15
|
+
dispatch('cancel');
|
|
16
|
+
}}
|
|
17
|
+
{...footer.cancel?.props}
|
|
18
|
+
>
|
|
19
|
+
{footer.cancel?.text || 'Cancel'}
|
|
20
|
+
</Button>
|
|
21
|
+
{/if}
|
|
11
22
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{/if}
|
|
24
|
-
|
|
25
|
-
{#if footer.confirm !== false}
|
|
26
|
-
<Button
|
|
27
|
-
variant="fill"
|
|
28
|
-
color={footer.confirm?.danger ? "red" : "accent"}
|
|
29
|
-
on:click={() => dispatch("confirm")}
|
|
30
|
-
{...footer.confirm?.props}
|
|
31
|
-
>
|
|
32
|
-
{footer.confirm?.text || "Confirm"}
|
|
33
|
-
</Button>
|
|
34
|
-
{/if}
|
|
35
|
-
|
|
36
|
-
</ButtonGroup>
|
|
23
|
+
{#if footer.confirm !== false}
|
|
24
|
+
<Button
|
|
25
|
+
variant="fill"
|
|
26
|
+
color={footer.confirm?.danger ? 'red' : 'accent'}
|
|
27
|
+
on:click={() => dispatch('confirm')}
|
|
28
|
+
{...footer.confirm?.props}
|
|
29
|
+
>
|
|
30
|
+
{footer.confirm?.text || 'Confirm'}
|
|
31
|
+
</Button>
|
|
32
|
+
{/if}
|
|
33
|
+
</ButtonGroup>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {} from
|
|
2
|
-
import { writable } from
|
|
1
|
+
import {} from 'svelte';
|
|
2
|
+
import { writable } from 'svelte/store';
|
|
3
3
|
export const confirmStore = writable(null);
|
|
4
4
|
export function confirm(config) {
|
|
5
5
|
function getOptions() {
|
|
@@ -12,7 +12,7 @@ export function confirm(config) {
|
|
|
12
12
|
return store;
|
|
13
13
|
});
|
|
14
14
|
},
|
|
15
|
-
close: () => confirmStore.set(null)
|
|
15
|
+
close: () => confirmStore.set(null)
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
18
|
return new Promise((resolve, reject) => {
|
|
@@ -27,7 +27,7 @@ export function confirm(config) {
|
|
|
27
27
|
onCancel: () => {
|
|
28
28
|
resolve(false);
|
|
29
29
|
confirmStore.set(null);
|
|
30
|
-
}
|
|
30
|
+
}
|
|
31
31
|
});
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentProps } from
|
|
2
|
-
import type Button from
|
|
1
|
+
import type { ComponentProps } from 'svelte';
|
|
2
|
+
import type Button from '../Button/Button.svelte';
|
|
3
3
|
export interface Footer {
|
|
4
4
|
/**
|
|
5
5
|
* undefined: default cancel button
|