spaper 1.3.0 → 2.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 +20 -58
- package/dist/components/Alert.svelte +83 -0
- package/dist/components/Alert.svelte.d.ts +15 -0
- package/dist/components/Article.svelte +63 -0
- package/dist/components/Article.svelte.d.ts +17 -0
- package/dist/components/Avatar/Avatar.svelte +102 -0
- package/dist/components/Avatar/Avatar.svelte.d.ts +16 -0
- package/dist/components/Avatar/AvatarGroup.svelte +21 -0
- package/dist/components/Avatar/AvatarGroup.svelte.d.ts +9 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Avatar/index.js +2 -0
- package/dist/components/Breadcrumb.svelte +33 -0
- package/dist/components/Breadcrumb.svelte.d.ts +12 -0
- package/dist/components/Button.svelte +174 -0
- package/dist/components/Button.svelte.d.ts +33 -0
- package/dist/components/Card.svelte +101 -0
- package/dist/components/Card.svelte.d.ts +22 -0
- package/dist/components/Carousel/Carousel.svelte +204 -0
- package/dist/components/Carousel/Carousel.svelte.d.ts +27 -0
- package/dist/components/Carousel/CarouselItem.svelte +48 -0
- package/dist/components/Carousel/CarouselItem.svelte.d.ts +7 -0
- package/{components → dist/components}/Carousel/index.d.ts +1 -0
- package/dist/components/Carousel/types.d.ts +22 -0
- package/dist/components/CloseButton.svelte +34 -0
- package/dist/components/CloseButton.svelte.d.ts +8 -0
- package/dist/components/Collapsible.svelte +64 -0
- package/dist/components/Collapsible.svelte.d.ts +16 -0
- package/dist/components/CopyButton.svelte +54 -0
- package/dist/components/CopyButton.svelte.d.ts +13 -0
- package/dist/components/Divider.svelte +9 -0
- package/dist/components/Divider.svelte.d.ts +6 -0
- package/dist/components/Form/Checkbox.svelte +54 -0
- package/dist/components/Form/Checkbox.svelte.d.ts +15 -0
- package/dist/components/Form/Input.svelte +105 -0
- package/dist/components/Form/Input.svelte.d.ts +21 -0
- package/dist/components/Form/NumberInput/DecrementButton.svelte +14 -0
- package/dist/components/Form/NumberInput/DecrementButton.svelte.d.ts +9 -0
- package/dist/components/Form/NumberInput/IncrementButton.svelte +14 -0
- package/dist/components/Form/NumberInput/IncrementButton.svelte.d.ts +9 -0
- package/dist/components/Form/NumberInput/NumberInput.svelte +227 -0
- package/dist/components/Form/NumberInput/NumberInput.svelte.d.ts +34 -0
- package/dist/components/Form/NumberInput/index.d.ts +3 -0
- package/dist/components/Form/NumberInput/index.js +3 -0
- package/dist/components/Form/Radio.svelte +42 -0
- package/dist/components/Form/Radio.svelte.d.ts +13 -0
- package/dist/components/Form/Select.svelte +61 -0
- package/dist/components/Form/Select.svelte.d.ts +12 -0
- package/dist/components/Form/Slider.svelte +129 -0
- package/dist/components/Form/Slider.svelte.d.ts +22 -0
- package/dist/components/Form/Switch.svelte +101 -0
- package/dist/components/Form/Switch.svelte.d.ts +22 -0
- package/dist/components/Form/index.d.ts +9 -0
- package/{components → dist/components}/Form/index.js +2 -2
- package/dist/components/Hero.svelte +78 -0
- package/dist/components/Hero.svelte.d.ts +17 -0
- package/dist/components/Icon.svelte +102 -0
- package/dist/components/Icon.svelte.d.ts +27 -0
- package/dist/components/Modal/Modal.svelte +120 -0
- package/dist/components/Modal/Modal.svelte.d.ts +19 -0
- package/dist/components/Modal/index.d.ts +12 -0
- package/dist/components/Modal/index.js +30 -0
- package/dist/components/Navbar.svelte +98 -0
- package/dist/components/Navbar.svelte.d.ts +11 -0
- package/dist/components/Pagination/Arrow.svelte +29 -0
- package/dist/components/Pagination/Arrow.svelte.d.ts +8 -0
- package/dist/components/Pagination/NavigationButton.svelte +33 -0
- package/dist/components/Pagination/NavigationButton.svelte.d.ts +13 -0
- package/dist/components/Pagination/Pagination.svelte +209 -0
- package/dist/components/Pagination/Pagination.svelte.d.ts +32 -0
- package/{components → dist/components}/Pagination/arrow-dimension.js +3 -3
- package/{components → dist/components}/Pagination/index.d.ts +1 -1
- package/dist/components/Popover.svelte +64 -0
- package/dist/components/Popover.svelte.d.ts +17 -0
- package/dist/components/Progress.svelte +87 -0
- package/dist/components/Progress.svelte.d.ts +19 -0
- package/dist/components/ScrollTop.svelte +79 -0
- package/dist/components/ScrollTop.svelte.d.ts +17 -0
- package/dist/components/Skeleton.svelte +104 -0
- package/dist/components/Skeleton.svelte.d.ts +21 -0
- package/dist/components/Spinner.svelte +59 -0
- package/dist/components/Spinner.svelte.d.ts +16 -0
- package/dist/components/Table/Table.svelte +292 -0
- package/dist/components/Table/Table.svelte.d.ts +25 -0
- package/dist/components/Table/TableColumn.svelte +62 -0
- package/dist/components/Table/TableColumn.svelte.d.ts +15 -0
- package/dist/components/Table/context.d.ts +13 -0
- package/dist/components/Table/context.js +1 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/index.js +2 -0
- package/dist/components/Tabs/Tab.svelte +90 -0
- package/dist/components/Tabs/Tab.svelte.d.ts +14 -0
- package/dist/components/Tabs/Tabs.svelte +138 -0
- package/dist/components/Tabs/Tabs.svelte.d.ts +13 -0
- package/{components → dist/components}/Tabs/utils.d.ts +4 -3
- package/dist/components/Tag.svelte +38 -0
- package/dist/components/Tag.svelte.d.ts +10 -0
- package/dist/components/Toast/Toast.svelte +105 -0
- package/dist/components/Toast/Toast.svelte.d.ts +6 -0
- package/dist/components/Toast/ToastContainer.svelte +101 -0
- package/dist/components/Toast/ToastContainer.svelte.d.ts +8 -0
- package/{components → dist/components}/Toast/index.d.ts +19 -5
- package/dist/components/Toast/index.js +100 -0
- package/dist/icons.d.ts +3 -0
- package/dist/icons.js +2 -0
- package/dist/index.d.ts +31 -0
- package/{index.js → dist/index.js} +10 -5
- package/dist/type-icons.d.ts +4 -0
- package/dist/type-icons.js +9 -0
- package/dist/types.d.ts +29 -0
- package/dist/utils.d.ts +16 -0
- package/dist/utils.js +44 -0
- package/package.json +70 -64
- package/components/Alert.svelte +0 -34
- package/components/Alert.svelte.d.ts +0 -21
- package/components/Article.svelte +0 -39
- package/components/Article.svelte.d.ts +0 -26
- package/components/Badge.svelte +0 -16
- package/components/Badge.svelte.d.ts +0 -20
- package/components/Breadcrumb.svelte +0 -17
- package/components/Breadcrumb.svelte.d.ts +0 -21
- package/components/Button.svelte +0 -41
- package/components/Button.svelte.d.ts +0 -30
- package/components/Card.svelte +0 -70
- package/components/Card.svelte.d.ts +0 -32
- package/components/Carousel/Carousel.svelte +0 -128
- package/components/Carousel/Carousel.svelte.d.ts +0 -35
- package/components/Carousel/CarouselItem.svelte +0 -32
- package/components/Carousel/CarouselItem.svelte.d.ts +0 -18
- package/components/Carousel/types.d.ts +0 -14
- package/components/CloseButton.svelte +0 -23
- package/components/CloseButton.svelte.d.ts +0 -19
- package/components/Collapsible.svelte +0 -49
- package/components/Collapsible.svelte.d.ts +0 -21
- package/components/CopyButton.svelte +0 -43
- package/components/CopyButton.svelte.d.ts +0 -24
- package/components/Form/Checkbox.svelte +0 -37
- package/components/Form/Checkbox.svelte.d.ts +0 -26
- package/components/Form/Form.svelte +0 -11
- package/components/Form/Form.svelte.d.ts +0 -26
- package/components/Form/Input.svelte +0 -74
- package/components/Form/Input.svelte.d.ts +0 -28
- package/components/Form/Radio.svelte +0 -26
- package/components/Form/Radio.svelte.d.ts +0 -25
- package/components/Form/Select.svelte +0 -40
- package/components/Form/Select.svelte.d.ts +0 -24
- package/components/Form/Slider.svelte +0 -124
- package/components/Form/Slider.svelte.d.ts +0 -30
- package/components/Form/Switch.svelte +0 -71
- package/components/Form/index.d.ts +0 -9
- package/components/Form/style.scss +0 -4
- package/components/Hero.svelte +0 -78
- package/components/Hero.svelte.d.ts +0 -26
- package/components/Layout/Col.svelte +0 -25
- package/components/Layout/Col.svelte.d.ts +0 -27
- package/components/Layout/Row.svelte +0 -24
- package/components/Layout/Row.svelte.d.ts +0 -26
- package/components/Layout/index.d.ts +0 -2
- package/components/Layout/index.js +0 -2
- package/components/Modal/Modal.svelte +0 -62
- package/components/Modal/Modal.svelte.d.ts +0 -28
- package/components/Modal/index.d.ts +0 -13
- package/components/Modal/index.js +0 -17
- package/components/Navbar.svelte +0 -40
- package/components/Navbar.svelte.d.ts +0 -22
- package/components/Pagination/Arrow.svelte +0 -17
- package/components/Pagination/Arrow.svelte.d.ts +0 -19
- package/components/Pagination/NavigationButton.svelte +0 -23
- package/components/Pagination/NavigationButton.svelte.d.ts +0 -23
- package/components/Pagination/Pagination.svelte +0 -137
- package/components/Pagination/Pagination.svelte.d.ts +0 -36
- package/components/Popover.svelte +0 -57
- package/components/Popover.svelte.d.ts +0 -25
- package/components/Progress.svelte +0 -39
- package/components/Progress.svelte.d.ts +0 -25
- package/components/Skeleton.svelte +0 -55
- package/components/Skeleton.svelte.d.ts +0 -22
- package/components/Table.svelte +0 -73
- package/components/Table.svelte.d.ts +0 -24
- package/components/Tabs/Tab.svelte +0 -52
- package/components/Tabs/Tab.svelte.d.ts +0 -20
- package/components/Tabs/Tabs.svelte +0 -90
- package/components/Tabs/Tabs.svelte.d.ts +0 -25
- package/components/Toast/Toast.svelte +0 -91
- package/components/Toast/Toast.svelte.d.ts +0 -26
- package/components/Toast/ToastContainer.svelte +0 -37
- package/components/Toast/ToastContainer.svelte.d.ts +0 -18
- package/components/Toast/index.js +0 -37
- package/index.d.ts +0 -23
- package/types.d.ts +0 -16
- package/utils.d.ts +0 -16
- package/utils.js +0 -34
- /package/{components → dist/components}/Carousel/index.js +0 -0
- /package/{components → dist/components}/Carousel/types.js +0 -0
- /package/{components → dist/components}/Pagination/arrow-dimension.d.ts +0 -0
- /package/{components → dist/components}/Pagination/index.js +0 -0
- /package/{components → dist/components}/Tabs/index.d.ts +0 -0
- /package/{components → dist/components}/Tabs/index.js +0 -0
- /package/{components → dist/components}/Tabs/utils.js +0 -0
- /package/{components → dist/components}/style.scss +0 -0
- /package/{types.js → dist/types.js} +0 -0
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
as?: keyof HTMLElementTagNameMap;
|
|
6
|
-
right?: boolean;
|
|
7
|
-
center?: boolean;
|
|
8
|
-
edges?: boolean;
|
|
9
|
-
spaces?: boolean;
|
|
10
|
-
top?: boolean;
|
|
11
|
-
middle?: boolean;
|
|
12
|
-
bottom?: boolean;
|
|
13
|
-
};
|
|
14
|
-
events: {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {
|
|
18
|
-
default: {};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export declare type RowProps = typeof __propDef.props;
|
|
22
|
-
export declare type RowEvents = typeof __propDef.events;
|
|
23
|
-
export declare type RowSlots = typeof __propDef.slots;
|
|
24
|
-
export default class Row extends SvelteComponentTyped<RowProps, RowEvents, RowSlots> {
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
<svelte:window on:keydown={handleKeydown} />
|
|
2
|
-
|
|
3
|
-
<div class="modal"
|
|
4
|
-
class:active>
|
|
5
|
-
<div {...$$restProps}
|
|
6
|
-
class="{$$restProps.class ?? ''} modal-body">
|
|
7
|
-
<CloseButton on:click={close} />
|
|
8
|
-
{#if title}
|
|
9
|
-
<h4 class="modal-title">{title}</h4>
|
|
10
|
-
{/if}
|
|
11
|
-
{#if subTitle}
|
|
12
|
-
<h5 class="modal-subtitle">{subTitle}</h5>
|
|
13
|
-
{/if}
|
|
14
|
-
<p class="modal-text">
|
|
15
|
-
{#if content}
|
|
16
|
-
{content}
|
|
17
|
-
{:else if component}
|
|
18
|
-
<svelte:component this={component} />
|
|
19
|
-
{:else}
|
|
20
|
-
<slot />
|
|
21
|
-
{/if}
|
|
22
|
-
</p>
|
|
23
|
-
<footer>
|
|
24
|
-
{#if $$slots.footer}
|
|
25
|
-
<slot name="footer" />
|
|
26
|
-
{/if}
|
|
27
|
-
<Button on:click={close}>
|
|
28
|
-
{closeBtnText}
|
|
29
|
-
</Button>
|
|
30
|
-
</footer>
|
|
31
|
-
</div>
|
|
32
|
-
</div>
|
|
33
|
-
|
|
34
|
-
<script >import { createEventDispatcher, SvelteComponent } from 'svelte';
|
|
35
|
-
import Button from '../Button.svelte';
|
|
36
|
-
import CloseButton from '../CloseButton.svelte';
|
|
37
|
-
export let active = false;
|
|
38
|
-
export let title = '';
|
|
39
|
-
export let subTitle = '';
|
|
40
|
-
export let content = '';
|
|
41
|
-
export let component = null;
|
|
42
|
-
export let closeBtnText = 'Close';
|
|
43
|
-
const dispatch = createEventDispatcher();
|
|
44
|
-
function close() {
|
|
45
|
-
active = false;
|
|
46
|
-
}
|
|
47
|
-
function handleKeydown({ key }) {
|
|
48
|
-
if (key === 'Escape')
|
|
49
|
-
close();
|
|
50
|
-
}
|
|
51
|
-
$: if (!active) {
|
|
52
|
-
dispatch('close');
|
|
53
|
-
}
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
<style >.modal.active {
|
|
57
|
-
opacity: 1;
|
|
58
|
-
visibility: visible;
|
|
59
|
-
}
|
|
60
|
-
.modal.active .modal-body {
|
|
61
|
-
top: 50%;
|
|
62
|
-
}</style>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import { SvelteComponent } from 'svelte';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
active?: boolean;
|
|
7
|
-
title?: string;
|
|
8
|
-
subTitle?: string;
|
|
9
|
-
content?: string;
|
|
10
|
-
component?: typeof SvelteComponent;
|
|
11
|
-
closeBtnText?: string;
|
|
12
|
-
};
|
|
13
|
-
events: {
|
|
14
|
-
close: CustomEvent<any>;
|
|
15
|
-
} & {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
};
|
|
18
|
-
slots: {
|
|
19
|
-
default: {};
|
|
20
|
-
footer: {};
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export declare type ModalProps = typeof __propDef.props;
|
|
24
|
-
export declare type ModalEvents = typeof __propDef.events;
|
|
25
|
-
export declare type ModalSlots = typeof __propDef.slots;
|
|
26
|
-
export default class Modal extends SvelteComponentTyped<ModalProps, ModalEvents, ModalSlots> {
|
|
27
|
-
}
|
|
28
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { SvelteComponent } from 'svelte';
|
|
2
|
-
import type { ComponentProps } from '../../utils';
|
|
3
|
-
import Modal from './Modal.svelte';
|
|
4
|
-
declare type ModalProps = ComponentProps<Modal>;
|
|
5
|
-
declare type ProgrammaticModalProps = Omit<ModalProps, 'active'>;
|
|
6
|
-
interface ProgrammaticModal {
|
|
7
|
-
open?: (props: ProgrammaticModalProps) => ProgrammaticModalInstance;
|
|
8
|
-
close?: () => void;
|
|
9
|
-
}
|
|
10
|
-
declare type ProgrammaticModalComponent = ProgrammaticModal & typeof SvelteComponent;
|
|
11
|
-
declare type ProgrammaticModalInstance = ProgrammaticModal & SvelteComponent;
|
|
12
|
-
declare const _default: ProgrammaticModalComponent;
|
|
13
|
-
export default _default;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import Modal from './Modal.svelte';
|
|
2
|
-
const TRANSITION_TIME = 235;
|
|
3
|
-
function open(props) {
|
|
4
|
-
const modal = new Modal({
|
|
5
|
-
target: document.body,
|
|
6
|
-
props,
|
|
7
|
-
});
|
|
8
|
-
// Preserve transition
|
|
9
|
-
setTimeout(modal.$set.bind(modal, { active: true }), 1);
|
|
10
|
-
modal.close = () => {
|
|
11
|
-
modal.$set({ active: false });
|
|
12
|
-
setTimeout(modal.$destroy, TRANSITION_TIME);
|
|
13
|
-
};
|
|
14
|
-
return modal;
|
|
15
|
-
}
|
|
16
|
-
Modal.open = open;
|
|
17
|
-
export default Modal;
|
package/components/Navbar.svelte
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
<nav {...$$restProps}
|
|
2
|
-
class={`${$$restProps.class ?? ''} paper-navbar`}
|
|
3
|
-
class:border class:fixed
|
|
4
|
-
class:split-nav={split}>
|
|
5
|
-
{#if $$slots.brand}
|
|
6
|
-
<div class="nav-brand">
|
|
7
|
-
<slot name="brand" />
|
|
8
|
-
</div>
|
|
9
|
-
{/if}
|
|
10
|
-
<div class="collapsible">
|
|
11
|
-
<button on:click={collapse}>☰</button>
|
|
12
|
-
<div class="collapsible-body" class:open>
|
|
13
|
-
<slot />
|
|
14
|
-
</div>
|
|
15
|
-
</div>
|
|
16
|
-
</nav>
|
|
17
|
-
|
|
18
|
-
<script >export let border = true;
|
|
19
|
-
export let fixed = false;
|
|
20
|
-
export let split = true;
|
|
21
|
-
let open = false;
|
|
22
|
-
function collapse() {
|
|
23
|
-
open = !open;
|
|
24
|
-
}
|
|
25
|
-
</script>
|
|
26
|
-
|
|
27
|
-
<style >/* Papercss removes border of buttons in .collapsible */
|
|
28
|
-
.collapsible > button {
|
|
29
|
-
border: 2px solid var(--primary);
|
|
30
|
-
}
|
|
31
|
-
.collapsible-body.open {
|
|
32
|
-
margin: 0;
|
|
33
|
-
max-height: 960px;
|
|
34
|
-
opacity: 1;
|
|
35
|
-
padding: 0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
:global(.paper-navbar li a.paper-btn) {
|
|
39
|
-
display: initial;
|
|
40
|
-
}</style>
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
border?: boolean;
|
|
6
|
-
fixed?: boolean;
|
|
7
|
-
split?: boolean;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {
|
|
13
|
-
brand: {};
|
|
14
|
-
default: {};
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
export declare type NavbarProps = typeof __propDef.props;
|
|
18
|
-
export declare type NavbarEvents = typeof __propDef.events;
|
|
19
|
-
export declare type NavbarSlots = typeof __propDef.slots;
|
|
20
|
-
export default class Navbar extends SvelteComponentTyped<NavbarProps, NavbarEvents, NavbarSlots> {
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor"
|
|
2
|
-
width={dimension} height={dimension} viewBox="0 0 24 24">
|
|
3
|
-
{#if type === 'right'}
|
|
4
|
-
<path d="M5 3l3.057-3 11.943 12-11.943 12-3.057-3 9-9z" />
|
|
5
|
-
{:else}
|
|
6
|
-
<path d="M16.67 0l2.83 2.829-9.339 9.175 9.339 9.167-2.83 2.829-12.17-11.996z" />
|
|
7
|
-
{/if}
|
|
8
|
-
</svg>
|
|
9
|
-
|
|
10
|
-
<script >;
|
|
11
|
-
;
|
|
12
|
-
import arrowDimension from './arrow-dimension';
|
|
13
|
-
export let size;
|
|
14
|
-
export let type;
|
|
15
|
-
let dimension;
|
|
16
|
-
$: dimension = arrowDimension[size];
|
|
17
|
-
</script>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { PaperSize } from '../../types';
|
|
3
|
-
import type { Direction } from '.';
|
|
4
|
-
declare const __propDef: {
|
|
5
|
-
props: {
|
|
6
|
-
size: PaperSize;
|
|
7
|
-
type: Direction;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
};
|
|
14
|
-
export declare type ArrowProps = typeof __propDef.props;
|
|
15
|
-
export declare type ArrowEvents = typeof __propDef.events;
|
|
16
|
-
export declare type ArrowSlots = typeof __propDef.slots;
|
|
17
|
-
export default class Arrow extends SvelteComponentTyped<ArrowProps, ArrowEvents, ArrowSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
<Button {size} {type}
|
|
2
|
-
isLink {disabled}
|
|
3
|
-
aria-label={ariaLabel}
|
|
4
|
-
on:click={clickHandler}>
|
|
5
|
-
{#if label}
|
|
6
|
-
{label}
|
|
7
|
-
{:else}
|
|
8
|
-
<Arrow {size}
|
|
9
|
-
type={action === 'next' ? 'right' : 'left'} />
|
|
10
|
-
{/if}
|
|
11
|
-
</Button>
|
|
12
|
-
|
|
13
|
-
<script >import Button from '../Button.svelte';
|
|
14
|
-
import Arrow from './Arrow.svelte';
|
|
15
|
-
;
|
|
16
|
-
export let size;
|
|
17
|
-
export let label;
|
|
18
|
-
export let action;
|
|
19
|
-
export let type;
|
|
20
|
-
export let disabled;
|
|
21
|
-
export let clickHandler;
|
|
22
|
-
export let ariaLabel;
|
|
23
|
-
</script>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { PaperSize, PaperType } from '../../types';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
size: PaperSize;
|
|
6
|
-
label: string;
|
|
7
|
-
action: 'previous' | 'next';
|
|
8
|
-
type: PaperType;
|
|
9
|
-
disabled: boolean;
|
|
10
|
-
clickHandler: (e: MouseEvent) => any;
|
|
11
|
-
ariaLabel: string;
|
|
12
|
-
};
|
|
13
|
-
events: {
|
|
14
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
-
};
|
|
16
|
-
slots: {};
|
|
17
|
-
};
|
|
18
|
-
export declare type NavigationButtonProps = typeof __propDef.props;
|
|
19
|
-
export declare type NavigationButtonEvents = typeof __propDef.events;
|
|
20
|
-
export declare type NavigationButtonSlots = typeof __propDef.slots;
|
|
21
|
-
export default class NavigationButton extends SvelteComponentTyped<NavigationButtonProps, NavigationButtonEvents, NavigationButtonSlots> {
|
|
22
|
-
}
|
|
23
|
-
export {};
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
<section {...$$restProps}>
|
|
2
|
-
{#if showNavigation}
|
|
3
|
-
<NavigationButton
|
|
4
|
-
type={highlightedStyle}
|
|
5
|
-
{size} action="previous"
|
|
6
|
-
label={previousLabel}
|
|
7
|
-
disabled={current <= 1}
|
|
8
|
-
clickHandler={changePage.bind(null, current-1)}
|
|
9
|
-
ariaLabel={ariaPreviousLabel} />
|
|
10
|
-
{/if}
|
|
11
|
-
|
|
12
|
-
{#if simple}
|
|
13
|
-
{current} / {pageCount}
|
|
14
|
-
{:else}
|
|
15
|
-
<ol class="padding-none">
|
|
16
|
-
{#each pages as {idx, show}}
|
|
17
|
-
<li>
|
|
18
|
-
{#if show}
|
|
19
|
-
<Button {size} isLink
|
|
20
|
-
class={bullets ? 'paper-pagination-btn--rounded' : ''}
|
|
21
|
-
on:click={changePage.bind(null, idx)}
|
|
22
|
-
type={idx === current ? highlightedStyle : defaultStyle}
|
|
23
|
-
aria-label={ariaPageLabel?.(idx) ?? `Page ${idx}`}
|
|
24
|
-
aria-current={idx === current}>
|
|
25
|
-
{displayedPageLabel(idx)}
|
|
26
|
-
</Button>
|
|
27
|
-
{:else if shouldDisplayEllipsis(idx)}
|
|
28
|
-
…
|
|
29
|
-
{/if}
|
|
30
|
-
</li>
|
|
31
|
-
{/each}
|
|
32
|
-
</ol>
|
|
33
|
-
{/if}
|
|
34
|
-
|
|
35
|
-
{#if showNavigation}
|
|
36
|
-
<NavigationButton
|
|
37
|
-
type={highlightedStyle}
|
|
38
|
-
{size} action="next"
|
|
39
|
-
label={nextLabel}
|
|
40
|
-
disabled={current >= pageCount}
|
|
41
|
-
clickHandler={changePage.bind(null, current+1)}
|
|
42
|
-
ariaLabel={ariaNextLabel} />
|
|
43
|
-
{/if}
|
|
44
|
-
|
|
45
|
-
{#if jumper}
|
|
46
|
-
<span on:keypress={submitJumper}>
|
|
47
|
-
<Input class="paper-pagination-input"
|
|
48
|
-
bind:value={jumperValue}
|
|
49
|
-
type="number" placeholder="Go to"
|
|
50
|
-
min="1" max={pageCount} step="1" />
|
|
51
|
-
</span>
|
|
52
|
-
{/if}
|
|
53
|
-
</section>
|
|
54
|
-
|
|
55
|
-
<script >import { createEventDispatcher } from 'svelte';
|
|
56
|
-
import Button from '../Button.svelte';
|
|
57
|
-
import Input from '../Form/Input.svelte';
|
|
58
|
-
;
|
|
59
|
-
import NavigationButton from './NavigationButton.svelte';
|
|
60
|
-
export let total;
|
|
61
|
-
export let pageSize = 10;
|
|
62
|
-
export let current = 1;
|
|
63
|
-
export let size = 'small';
|
|
64
|
-
export let navigation = true;
|
|
65
|
-
export let simple = false;
|
|
66
|
-
export let bullets = false;
|
|
67
|
-
export let previousLabel = null;
|
|
68
|
-
export let nextLabel = null;
|
|
69
|
-
export let highlightedStyle = 'secondary';
|
|
70
|
-
export let defaultStyle = null;
|
|
71
|
-
export let rangeBetween = null;
|
|
72
|
-
export let jumper = false;
|
|
73
|
-
export let pageLabel = null;
|
|
74
|
-
export let ariaPreviousLabel = 'previous page';
|
|
75
|
-
export let ariaNextLabel = 'next page';
|
|
76
|
-
export let ariaPageLabel = null;
|
|
77
|
-
const dispatch = createEventDispatcher();
|
|
78
|
-
let jumperValue;
|
|
79
|
-
let pageCount;
|
|
80
|
-
$: pageCount = Math.ceil(total / pageSize);
|
|
81
|
-
let pages;
|
|
82
|
-
$: if (current) {
|
|
83
|
-
pages = Array.from({ length: pageCount }, (_, i) => ({ idx: ++i, show: shouldDisplayButton(i) }));
|
|
84
|
-
}
|
|
85
|
-
let showNavigation;
|
|
86
|
-
$: showNavigation = navigation && !bullets;
|
|
87
|
-
function submitJumper({ code }) {
|
|
88
|
-
const toPage = Number(jumperValue);
|
|
89
|
-
if (code !== 'Enter' || pageInvalid(toPage))
|
|
90
|
-
return;
|
|
91
|
-
changePage(toPage);
|
|
92
|
-
}
|
|
93
|
-
function pageInvalid(idx) {
|
|
94
|
-
return idx < 1 || idx > pageCount || !Number.isInteger(idx);
|
|
95
|
-
}
|
|
96
|
-
function shouldDisplayButton(idx) {
|
|
97
|
-
if (!rangeBetween || [1, pageCount].includes(idx))
|
|
98
|
-
return true;
|
|
99
|
-
return idx >= (current - rangeBetween)
|
|
100
|
-
&& idx <= (current + rangeBetween);
|
|
101
|
-
}
|
|
102
|
-
function shouldDisplayEllipsis(idx) {
|
|
103
|
-
return pages[idx - 2].show;
|
|
104
|
-
}
|
|
105
|
-
function changePage(val) {
|
|
106
|
-
if (pageInvalid(val))
|
|
107
|
-
return;
|
|
108
|
-
current = val;
|
|
109
|
-
dispatch('change', current);
|
|
110
|
-
}
|
|
111
|
-
function displayedPageLabel(idx) {
|
|
112
|
-
var _a;
|
|
113
|
-
if (bullets)
|
|
114
|
-
return '';
|
|
115
|
-
return (_a = pageLabel === null || pageLabel === void 0 ? void 0 : pageLabel(idx)) !== null && _a !== void 0 ? _a : idx;
|
|
116
|
-
}
|
|
117
|
-
</script>
|
|
118
|
-
|
|
119
|
-
<style >ol, li {
|
|
120
|
-
display: inline;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
ol li {
|
|
124
|
-
text-indent: 0;
|
|
125
|
-
}
|
|
126
|
-
ol li::before {
|
|
127
|
-
content: "";
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
:global(.paper-pagination-input) {
|
|
131
|
-
display: inline;
|
|
132
|
-
width: 4rem;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
:global(.paper-pagination-btn--rounded) {
|
|
136
|
-
border-radius: 50%;
|
|
137
|
-
}</style>
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { PaperSize, PaperType } from '../../types';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
total: number;
|
|
7
|
-
pageSize?: number;
|
|
8
|
-
current?: number;
|
|
9
|
-
size?: PaperSize;
|
|
10
|
-
navigation?: boolean;
|
|
11
|
-
simple?: boolean;
|
|
12
|
-
bullets?: boolean;
|
|
13
|
-
previousLabel?: string;
|
|
14
|
-
nextLabel?: string;
|
|
15
|
-
highlightedStyle?: PaperType;
|
|
16
|
-
defaultStyle?: PaperType;
|
|
17
|
-
rangeBetween?: number;
|
|
18
|
-
jumper?: boolean;
|
|
19
|
-
pageLabel?: (idx: number) => string | number;
|
|
20
|
-
ariaPreviousLabel?: string;
|
|
21
|
-
ariaNextLabel?: string;
|
|
22
|
-
ariaPageLabel?: (idx: number) => string;
|
|
23
|
-
};
|
|
24
|
-
events: {
|
|
25
|
-
change: CustomEvent<any>;
|
|
26
|
-
} & {
|
|
27
|
-
[evt: string]: CustomEvent<any>;
|
|
28
|
-
};
|
|
29
|
-
slots: {};
|
|
30
|
-
};
|
|
31
|
-
export declare type PaginationProps = typeof __propDef.props;
|
|
32
|
-
export declare type PaginationEvents = typeof __propDef.events;
|
|
33
|
-
export declare type PaginationSlots = typeof __propDef.slots;
|
|
34
|
-
export default class Pagination extends SvelteComponentTyped<PaginationProps, PaginationEvents, PaginationSlots> {
|
|
35
|
-
}
|
|
36
|
-
export {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<div {...$$restProps}
|
|
2
|
-
{ ...{[`popover-${position}`]: label} }
|
|
3
|
-
class={`${$$restProps.class} ${bgClass(background)}`}
|
|
4
|
-
class:inline
|
|
5
|
-
class:active={always || active}>
|
|
6
|
-
<slot />
|
|
7
|
-
</div>
|
|
8
|
-
|
|
9
|
-
<script >;
|
|
10
|
-
export let label = '';
|
|
11
|
-
export let position = 'top';
|
|
12
|
-
export let inline = true;
|
|
13
|
-
export let background = 'primary';
|
|
14
|
-
export let active = false;
|
|
15
|
-
export let always = false;
|
|
16
|
-
function bgClass(color) {
|
|
17
|
-
return `popover-${color}`;
|
|
18
|
-
}
|
|
19
|
-
</script>
|
|
20
|
-
|
|
21
|
-
<style >.inline {
|
|
22
|
-
display: inline;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
[popover-top].popover-primary::after, [popover-right].popover-primary::after,
|
|
26
|
-
[popover-bottom].popover-primary::after, [popover-left].popover-primary::after {
|
|
27
|
-
background-color: var(--primary);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
[popover-top].popover-secondary::after, [popover-right].popover-secondary::after,
|
|
31
|
-
[popover-bottom].popover-secondary::after, [popover-left].popover-secondary::after {
|
|
32
|
-
background-color: var(--secondary);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
[popover-top].popover-success::after, [popover-right].popover-success::after,
|
|
36
|
-
[popover-bottom].popover-success::after, [popover-left].popover-success::after {
|
|
37
|
-
background-color: var(--success);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
[popover-top].popover-warning::after, [popover-right].popover-warning::after,
|
|
41
|
-
[popover-bottom].popover-warning::after, [popover-left].popover-warning::after {
|
|
42
|
-
background-color: var(--warning);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
[popover-top].popover-danger::after, [popover-right].popover-danger::after,
|
|
46
|
-
[popover-bottom].popover-danger::after, [popover-left].popover-danger::after {
|
|
47
|
-
background-color: var(--danger);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
[popover-top], [popover-right],
|
|
51
|
-
[popover-bottom], [popover-left] {
|
|
52
|
-
margin: 0;
|
|
53
|
-
}
|
|
54
|
-
[popover-top].active::after, [popover-right].active::after,
|
|
55
|
-
[popover-bottom].active::after, [popover-left].active::after {
|
|
56
|
-
opacity: 1;
|
|
57
|
-
}</style>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { PaperType, Position } from "../types";
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
label?: string;
|
|
7
|
-
position?: Position;
|
|
8
|
-
inline?: boolean;
|
|
9
|
-
background?: PaperType;
|
|
10
|
-
active?: boolean;
|
|
11
|
-
always?: boolean;
|
|
12
|
-
};
|
|
13
|
-
events: {
|
|
14
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
-
};
|
|
16
|
-
slots: {
|
|
17
|
-
default: {};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export declare type PopoverProps = typeof __propDef.props;
|
|
21
|
-
export declare type PopoverEvents = typeof __propDef.events;
|
|
22
|
-
export declare type PopoverSlots = typeof __propDef.slots;
|
|
23
|
-
export default class Popover extends SvelteComponentTyped<PopoverProps, PopoverEvents, PopoverSlots> {
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
<div {...$$restProps}
|
|
2
|
-
class={`progress ${$$restProps.class ?? ''}`}
|
|
3
|
-
class:margin-bottom={marginBottom}>
|
|
4
|
-
<div class={`bar ${type} w-${cappedValue}`}
|
|
5
|
-
class:striped class:infinite>
|
|
6
|
-
{#if $$slots.default}
|
|
7
|
-
<slot />
|
|
8
|
-
{:else if showValue}
|
|
9
|
-
{cappedValue}%
|
|
10
|
-
{/if}
|
|
11
|
-
</div>
|
|
12
|
-
</div>
|
|
13
|
-
|
|
14
|
-
<script >;
|
|
15
|
-
export let value = 50;
|
|
16
|
-
export let type = 'primary';
|
|
17
|
-
export let showValue = false;
|
|
18
|
-
export let striped = false;
|
|
19
|
-
export let infinite = false;
|
|
20
|
-
export let marginBottom = true;
|
|
21
|
-
let cappedValue;
|
|
22
|
-
$: cappedValue = Math.max(Math.min(+value, 100), 0);
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<style>
|
|
26
|
-
.bar.infinite {
|
|
27
|
-
position: relative;
|
|
28
|
-
animation: in-progress 3s infinite;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@keyframes in-progress {
|
|
32
|
-
from {
|
|
33
|
-
right: 100%;
|
|
34
|
-
}
|
|
35
|
-
to {
|
|
36
|
-
right: -100%;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
</style>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { PaperType } from "../types";
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
value?: number | string;
|
|
7
|
-
type?: PaperType;
|
|
8
|
-
showValue?: boolean;
|
|
9
|
-
striped?: boolean;
|
|
10
|
-
infinite?: boolean;
|
|
11
|
-
marginBottom?: boolean;
|
|
12
|
-
};
|
|
13
|
-
events: {
|
|
14
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
-
};
|
|
16
|
-
slots: {
|
|
17
|
-
default: {};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export declare type ProgressProps = typeof __propDef.props;
|
|
21
|
-
export declare type ProgressEvents = typeof __propDef.events;
|
|
22
|
-
export declare type ProgressSlots = typeof __propDef.slots;
|
|
23
|
-
export default class Progress extends SvelteComponentTyped<ProgressProps, ProgressEvents, ProgressSlots> {
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
{#if active}
|
|
2
|
-
{#each { length: count } as _}
|
|
3
|
-
{@const borderType = Math.floor(Math.random() * 6 + 1)}
|
|
4
|
-
<div {...$$restProps}
|
|
5
|
-
aria-hidden="true"
|
|
6
|
-
aria-valuetext={ariaValueText}
|
|
7
|
-
tabindex="-1"
|
|
8
|
-
role="progressbar"
|
|
9
|
-
class="{$$restProps.class ?? ''} border border-{borderType} margin-small"
|
|
10
|
-
class:animated
|
|
11
|
-
class:circle
|
|
12
|
-
class:inline>
|
|
13
|
-
</div>
|
|
14
|
-
{/each}
|
|
15
|
-
{/if}
|
|
16
|
-
|
|
17
|
-
<script >export let active = true;
|
|
18
|
-
export let count = 1;
|
|
19
|
-
export let animated = true;
|
|
20
|
-
export let circle = false;
|
|
21
|
-
export let inline = false;
|
|
22
|
-
export let ariaValueText = 'Loading...';
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<style >:global(.dark) div {
|
|
26
|
-
--mid-gradient: var(--primary-dark);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
div {
|
|
30
|
-
cursor: progress;
|
|
31
|
-
border-color: transparent;
|
|
32
|
-
width: var(--width, auto);
|
|
33
|
-
min-height: 1rem;
|
|
34
|
-
height: var(--height, 100%);
|
|
35
|
-
background: var(--muted-light-10);
|
|
36
|
-
background: linear-gradient(95deg, var(--muted-light-10) 5%, var(--mid-gradient, var(--muted-light)) 20%, var(--muted-light-10) 50%);
|
|
37
|
-
background-size: 200% 100%;
|
|
38
|
-
}
|
|
39
|
-
div.circle {
|
|
40
|
-
border-radius: 50%;
|
|
41
|
-
}
|
|
42
|
-
div.inline {
|
|
43
|
-
display: inline-block;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
47
|
-
.animated {
|
|
48
|
-
animation: loading 2s linear infinite alternate;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
@keyframes loading {
|
|
52
|
-
to {
|
|
53
|
-
background-position-x: -200%;
|
|
54
|
-
}
|
|
55
|
-
}</style>
|