spaper 1.4.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 -59
- 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/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 +1 -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 -68
- 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 -22
- package/components/Form/Form.svelte.d.ts +0 -26
- package/components/Form/Input.svelte +0 -67
- package/components/Form/Input.svelte.d.ts +0 -28
- package/components/Form/NumberInput/DecrementButton.svelte +0 -9
- package/components/Form/NumberInput/DecrementButton.svelte.d.ts +0 -19
- package/components/Form/NumberInput/IncrementButton.svelte +0 -9
- package/components/Form/NumberInput/IncrementButton.svelte.d.ts +0 -19
- package/components/Form/NumberInput/NumberInput.svelte +0 -129
- package/components/Form/NumberInput/NumberInput.svelte.d.ts +0 -36
- 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 -10
- 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 -62
- 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}/Form/NumberInput/index.d.ts +0 -0
- /package/{components → dist/components}/Form/NumberInput/index.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
|
-
};
|
|
6
|
-
events: {
|
|
7
|
-
submit: Event;
|
|
8
|
-
click: MouseEvent;
|
|
9
|
-
keydown: KeyboardEvent;
|
|
10
|
-
mouseover: MouseEvent;
|
|
11
|
-
mouseenter: MouseEvent;
|
|
12
|
-
mouseleave: MouseEvent;
|
|
13
|
-
focus: FocusEvent;
|
|
14
|
-
} & {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {
|
|
18
|
-
default: {};
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export declare type FormProps = typeof __propDef.props & svelte.JSX.HTMLAttributes<HTMLElementTagNameMap["form"]>;
|
|
22
|
-
export declare type FormEvents = typeof __propDef.events;
|
|
23
|
-
export declare type FormSlots = typeof __propDef.slots;
|
|
24
|
-
export default class Form extends SvelteComponentTyped<FormProps, FormEvents, FormSlots> {
|
|
25
|
-
}
|
|
26
|
-
export {};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
{#if type === 'textarea'}
|
|
2
|
-
<textarea {...attr}
|
|
3
|
-
bind:value
|
|
4
|
-
class:no-resize={noResize}
|
|
5
|
-
on:input={onInput}
|
|
6
|
-
on:focus
|
|
7
|
-
on:blur
|
|
8
|
-
on:change></textarea>
|
|
9
|
-
{:else if label}
|
|
10
|
-
<label>
|
|
11
|
-
{label}
|
|
12
|
-
<input {...attr}
|
|
13
|
-
bind:value
|
|
14
|
-
class:border-danger={!isValid && value}
|
|
15
|
-
class:border-success={isValid && value && valid}
|
|
16
|
-
on:input={onInput}
|
|
17
|
-
on:focus
|
|
18
|
-
on:blur
|
|
19
|
-
on:change />
|
|
20
|
-
</label>
|
|
21
|
-
{:else}
|
|
22
|
-
<input {...attr}
|
|
23
|
-
bind:value
|
|
24
|
-
class:border-danger={!isValid && value}
|
|
25
|
-
class:border-success={isValid && value && valid}
|
|
26
|
-
on:input={onInput}
|
|
27
|
-
on:focus
|
|
28
|
-
on:blur
|
|
29
|
-
on:change />
|
|
30
|
-
{/if}
|
|
31
|
-
|
|
32
|
-
<script >var _a;
|
|
33
|
-
import { createEventDispatcher } from 'svelte';
|
|
34
|
-
import { computeClasses, getDomAttributes } from '../../utils';
|
|
35
|
-
;
|
|
36
|
-
;
|
|
37
|
-
export let label = '';
|
|
38
|
-
export let value = '';
|
|
39
|
-
export let block = false;
|
|
40
|
-
export let type = 'text';
|
|
41
|
-
export let valid = null;
|
|
42
|
-
export let noResize = false;
|
|
43
|
-
const dispatch = createEventDispatcher();
|
|
44
|
-
function onInput({ target }) {
|
|
45
|
-
dispatch('input', target.value);
|
|
46
|
-
}
|
|
47
|
-
let isValid = true;
|
|
48
|
-
$: if (valid) {
|
|
49
|
-
isValid = valid(value);
|
|
50
|
-
}
|
|
51
|
-
let attr;
|
|
52
|
-
$: {
|
|
53
|
-
attr = getDomAttributes({
|
|
54
|
-
props: $$props,
|
|
55
|
-
classes,
|
|
56
|
-
toOmit: ['block', 'value', 'valid', 'noResize']
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
let classes;
|
|
60
|
-
$: classes = `${(_a = $$restProps.class) !== null && _a !== void 0 ? _a : ''} ${computeClasses('input', { block })}`;
|
|
61
|
-
</script>
|
|
62
|
-
|
|
63
|
-
<style>
|
|
64
|
-
label {
|
|
65
|
-
width: 100%;
|
|
66
|
-
}
|
|
67
|
-
</style>
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { InputType } from './';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
label?: string;
|
|
7
|
-
value?: string;
|
|
8
|
-
block?: boolean;
|
|
9
|
-
type?: InputType;
|
|
10
|
-
valid?: (val: string) => boolean;
|
|
11
|
-
noResize?: boolean;
|
|
12
|
-
};
|
|
13
|
-
events: {
|
|
14
|
-
focus: FocusEvent;
|
|
15
|
-
blur: FocusEvent;
|
|
16
|
-
change: Event;
|
|
17
|
-
input: CustomEvent<any>;
|
|
18
|
-
} & {
|
|
19
|
-
[evt: string]: CustomEvent<any>;
|
|
20
|
-
};
|
|
21
|
-
slots: {};
|
|
22
|
-
};
|
|
23
|
-
export declare type InputProps = typeof __propDef.props;
|
|
24
|
-
export declare type InputEvents = typeof __propDef.events;
|
|
25
|
-
export declare type InputSlots = typeof __propDef.slots;
|
|
26
|
-
export default class Input extends SvelteComponentTyped<InputProps, InputEvents, InputSlots> {
|
|
27
|
-
}
|
|
28
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { PaperType } from '../../../types';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
clickHandler: (e: MouseEvent) => any;
|
|
7
|
-
type: PaperType;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
};
|
|
14
|
-
export declare type DecrementButtonProps = typeof __propDef.props;
|
|
15
|
-
export declare type DecrementButtonEvents = typeof __propDef.events;
|
|
16
|
-
export declare type DecrementButtonSlots = typeof __propDef.slots;
|
|
17
|
-
export default class DecrementButton extends SvelteComponentTyped<DecrementButtonProps, DecrementButtonEvents, DecrementButtonSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { PaperType } from '../../../types';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
clickHandler: (e: MouseEvent) => any;
|
|
7
|
-
type: PaperType;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
};
|
|
14
|
-
export declare type IncrementButtonProps = typeof __propDef.props;
|
|
15
|
-
export declare type IncrementButtonEvents = typeof __propDef.events;
|
|
16
|
-
export declare type IncrementButtonSlots = typeof __propDef.slots;
|
|
17
|
-
export default class IncrementButton extends SvelteComponentTyped<IncrementButtonProps, IncrementButtonEvents, IncrementButtonSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
{#if label}
|
|
2
|
-
<div class="number-input-wrapper">
|
|
3
|
-
{#if controls}
|
|
4
|
-
<DecrementButton
|
|
5
|
-
clickHandler={() => value -= step}
|
|
6
|
-
type={controlsType}
|
|
7
|
-
disabled={!canDecrement}
|
|
8
|
-
/>
|
|
9
|
-
{/if}
|
|
10
|
-
<label>
|
|
11
|
-
{label}
|
|
12
|
-
<input {...attr}
|
|
13
|
-
inputmode="numeric"
|
|
14
|
-
bind:value={formattedValue}
|
|
15
|
-
class:border-danger={!isValid && value}
|
|
16
|
-
class:border-success={isValid && value && valid}
|
|
17
|
-
aria-valuemin={min}
|
|
18
|
-
aria-valuemax={max}
|
|
19
|
-
aria-valuenow={value}
|
|
20
|
-
on:input={onInput}
|
|
21
|
-
on:focus
|
|
22
|
-
on:blur
|
|
23
|
-
on:change />
|
|
24
|
-
</label>
|
|
25
|
-
{#if controls}
|
|
26
|
-
<IncrementButton
|
|
27
|
-
clickHandler={() => value += step}
|
|
28
|
-
type={controlsType}
|
|
29
|
-
disabled={!canIncrement}
|
|
30
|
-
/>
|
|
31
|
-
{/if}
|
|
32
|
-
</div>
|
|
33
|
-
{:else}
|
|
34
|
-
<div class="number-input-wrapper">
|
|
35
|
-
{#if controls}
|
|
36
|
-
<DecrementButton
|
|
37
|
-
clickHandler={() => value -= step}
|
|
38
|
-
type={controlsType}
|
|
39
|
-
disabled={!canDecrement}
|
|
40
|
-
/>
|
|
41
|
-
{/if}
|
|
42
|
-
<input {...attr}
|
|
43
|
-
inputmode="numeric"
|
|
44
|
-
bind:value={formattedValue}
|
|
45
|
-
class:border-danger={!isValid && value}
|
|
46
|
-
class:border-success={isValid && value && valid}
|
|
47
|
-
aria-valuemin={min}
|
|
48
|
-
aria-valuemax={max}
|
|
49
|
-
aria-valuenow={value}
|
|
50
|
-
on:input={onInput}
|
|
51
|
-
on:focus
|
|
52
|
-
on:blur
|
|
53
|
-
on:change />
|
|
54
|
-
{#if controls}
|
|
55
|
-
<IncrementButton
|
|
56
|
-
clickHandler={() => value += step}
|
|
57
|
-
type={controlsType}
|
|
58
|
-
disabled={!canIncrement}
|
|
59
|
-
/>
|
|
60
|
-
{/if}
|
|
61
|
-
</div>
|
|
62
|
-
{/if}
|
|
63
|
-
|
|
64
|
-
<script >var _a;
|
|
65
|
-
import { createEventDispatcher } from 'svelte';
|
|
66
|
-
import { DecrementButton, IncrementButton } from './';
|
|
67
|
-
import { computeClasses, getDomAttributes } from '../../../utils';
|
|
68
|
-
;
|
|
69
|
-
export let label = '';
|
|
70
|
-
export let value = null;
|
|
71
|
-
export let step = 1;
|
|
72
|
-
export let min = null;
|
|
73
|
-
export let max = null;
|
|
74
|
-
export let disabled = false;
|
|
75
|
-
export let controls = true;
|
|
76
|
-
export let controlsType = 'secondary';
|
|
77
|
-
export let block = false;
|
|
78
|
-
export let valid = null;
|
|
79
|
-
export let prefix = '';
|
|
80
|
-
export let suffix = '';
|
|
81
|
-
export let format = null;
|
|
82
|
-
export let formatOptions = undefined;
|
|
83
|
-
const dispatch = createEventDispatcher();
|
|
84
|
-
function onInput({ target }) {
|
|
85
|
-
dispatch('input', target.value);
|
|
86
|
-
}
|
|
87
|
-
let isValid = true;
|
|
88
|
-
$: if (valid) {
|
|
89
|
-
isValid = valid(value);
|
|
90
|
-
}
|
|
91
|
-
let attr;
|
|
92
|
-
$: {
|
|
93
|
-
attr = getDomAttributes({
|
|
94
|
-
props: $$props,
|
|
95
|
-
classes,
|
|
96
|
-
toOmit: ['block', 'value', 'valid', 'noResize', 'min', 'max']
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
let classes;
|
|
100
|
-
$: classes = `${(_a = $$restProps.class) !== null && _a !== void 0 ? _a : ''} ${computeClasses('input', { block })}`;
|
|
101
|
-
$: canDecrement = !disabled && (min !== null ? value - step >= min : true);
|
|
102
|
-
$: canIncrement = !disabled && (max !== null ? value + step <= max : true);
|
|
103
|
-
let formattedValue = '';
|
|
104
|
-
$: if (value !== null) {
|
|
105
|
-
formattedValue = String(value);
|
|
106
|
-
if (format) {
|
|
107
|
-
if (typeof format === 'string') {
|
|
108
|
-
formattedValue = new Intl.NumberFormat(format === 'locale' ? undefined : format, formatOptions).format(value);
|
|
109
|
-
}
|
|
110
|
-
else {
|
|
111
|
-
formattedValue = format(value);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
formattedValue = [
|
|
115
|
-
prefix,
|
|
116
|
-
formattedValue,
|
|
117
|
-
suffix,
|
|
118
|
-
].join(' ').trim();
|
|
119
|
-
}
|
|
120
|
-
</script>
|
|
121
|
-
|
|
122
|
-
<style >:global(.number-input-wrapper) {
|
|
123
|
-
display: flex;
|
|
124
|
-
gap: 0.25rem;
|
|
125
|
-
}
|
|
126
|
-
:global(.number-input-wrapper) :global(.paper-btn) {
|
|
127
|
-
align-self: flex-end;
|
|
128
|
-
padding: 0.5rem;
|
|
129
|
-
}</style>
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { PaperType } from '../../../types';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
label?: string;
|
|
7
|
-
value?: number | null;
|
|
8
|
-
step?: number;
|
|
9
|
-
min?: number | null;
|
|
10
|
-
max?: number | null;
|
|
11
|
-
disabled?: boolean;
|
|
12
|
-
controls?: boolean;
|
|
13
|
-
controlsType?: PaperType;
|
|
14
|
-
block?: boolean;
|
|
15
|
-
valid?: (val: number | null) => boolean;
|
|
16
|
-
prefix?: string;
|
|
17
|
-
suffix?: string;
|
|
18
|
-
format?: string | ((val: number | null) => string);
|
|
19
|
-
formatOptions?: Intl.NumberFormatOptions | undefined;
|
|
20
|
-
};
|
|
21
|
-
events: {
|
|
22
|
-
focus: FocusEvent;
|
|
23
|
-
blur: FocusEvent;
|
|
24
|
-
change: Event;
|
|
25
|
-
input: CustomEvent<any>;
|
|
26
|
-
} & {
|
|
27
|
-
[evt: string]: CustomEvent<any>;
|
|
28
|
-
};
|
|
29
|
-
slots: {};
|
|
30
|
-
};
|
|
31
|
-
export declare type NumberInputProps = typeof __propDef.props;
|
|
32
|
-
export declare type NumberInputEvents = typeof __propDef.events;
|
|
33
|
-
export declare type NumberInputSlots = typeof __propDef.slots;
|
|
34
|
-
export default class NumberInput extends SvelteComponentTyped<NumberInputProps, NumberInputEvents, NumberInputSlots> {
|
|
35
|
-
}
|
|
36
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<label class="paper-radio">
|
|
2
|
-
<input type="radio"
|
|
3
|
-
{value}
|
|
4
|
-
{...$$restProps}
|
|
5
|
-
bind:group
|
|
6
|
-
on:focus
|
|
7
|
-
on:blur
|
|
8
|
-
on:change />
|
|
9
|
-
<span>
|
|
10
|
-
{#if $$slots.default}
|
|
11
|
-
<slot />
|
|
12
|
-
{:else}
|
|
13
|
-
{label}
|
|
14
|
-
{/if}
|
|
15
|
-
</span>
|
|
16
|
-
</label>
|
|
17
|
-
|
|
18
|
-
<script >export let label = '';
|
|
19
|
-
export let value = '';
|
|
20
|
-
export let group = '';
|
|
21
|
-
</script>
|
|
22
|
-
|
|
23
|
-
<style >input[disabled] + span::before, input[disabled] ~ span {
|
|
24
|
-
opacity: 0.5;
|
|
25
|
-
cursor: not-allowed;
|
|
26
|
-
}</style>
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
label?: string;
|
|
6
|
-
value?: string;
|
|
7
|
-
group?: string;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
focus: FocusEvent;
|
|
11
|
-
blur: FocusEvent;
|
|
12
|
-
change: Event;
|
|
13
|
-
} & {
|
|
14
|
-
[evt: string]: CustomEvent<any>;
|
|
15
|
-
};
|
|
16
|
-
slots: {
|
|
17
|
-
default: {};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export declare type RadioProps = typeof __propDef.props;
|
|
21
|
-
export declare type RadioEvents = typeof __propDef.events;
|
|
22
|
-
export declare type RadioSlots = typeof __propDef.slots;
|
|
23
|
-
export default class Radio extends SvelteComponentTyped<RadioProps, RadioEvents, RadioSlots> {
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
{#if label}
|
|
2
|
-
<label>
|
|
3
|
-
{label}
|
|
4
|
-
<select bind:this={selectElement}
|
|
5
|
-
bind:value
|
|
6
|
-
{...$$restProps}
|
|
7
|
-
on:change={onChange}
|
|
8
|
-
on:blur
|
|
9
|
-
on:focus>
|
|
10
|
-
<slot />
|
|
11
|
-
</select>
|
|
12
|
-
</label>
|
|
13
|
-
{:else}
|
|
14
|
-
<select bind:this={selectElement}
|
|
15
|
-
bind:value
|
|
16
|
-
{...$$restProps}
|
|
17
|
-
on:change={onChange}
|
|
18
|
-
on:blur
|
|
19
|
-
on:focus>
|
|
20
|
-
<slot />
|
|
21
|
-
</select>
|
|
22
|
-
{/if}
|
|
23
|
-
|
|
24
|
-
<script >import { createEventDispatcher } from 'svelte';
|
|
25
|
-
export let label = '';
|
|
26
|
-
export let value = '';
|
|
27
|
-
let selectElement;
|
|
28
|
-
const dispatch = createEventDispatcher();
|
|
29
|
-
function onChange({ target }) {
|
|
30
|
-
dispatch('change', target.value);
|
|
31
|
-
}
|
|
32
|
-
$: if (selectElement && value !== undefined) {
|
|
33
|
-
const options = selectElement.querySelectorAll('option');
|
|
34
|
-
const opt = Array.from(options).find((opt) => {
|
|
35
|
-
return opt.value == value;
|
|
36
|
-
});
|
|
37
|
-
if (opt)
|
|
38
|
-
opt.selected = true;
|
|
39
|
-
}
|
|
40
|
-
</script>
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
declare const __propDef: {
|
|
3
|
-
props: {
|
|
4
|
-
[x: string]: any;
|
|
5
|
-
label?: string;
|
|
6
|
-
value?: string;
|
|
7
|
-
};
|
|
8
|
-
events: {
|
|
9
|
-
blur: FocusEvent;
|
|
10
|
-
focus: FocusEvent;
|
|
11
|
-
change: CustomEvent<any>;
|
|
12
|
-
} & {
|
|
13
|
-
[evt: string]: CustomEvent<any>;
|
|
14
|
-
};
|
|
15
|
-
slots: {
|
|
16
|
-
default: {};
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
export declare type SelectProps = typeof __propDef.props;
|
|
20
|
-
export declare type SelectEvents = typeof __propDef.events;
|
|
21
|
-
export declare type SelectSlots = typeof __propDef.slots;
|
|
22
|
-
export default class Select extends SvelteComponentTyped<SelectProps, SelectEvents, SelectSlots> {
|
|
23
|
-
}
|
|
24
|
-
export {};
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
<label class:block
|
|
2
|
-
class:disabled
|
|
3
|
-
{...$$restProps}>
|
|
4
|
-
{#if $$slots.default}
|
|
5
|
-
<slot />
|
|
6
|
-
{:else}
|
|
7
|
-
{label}
|
|
8
|
-
{/if}
|
|
9
|
-
<input type="range"
|
|
10
|
-
bind:this={rangeEl}
|
|
11
|
-
bind:value
|
|
12
|
-
class={classes}
|
|
13
|
-
{min} {max} {step} />
|
|
14
|
-
{#if !hideValue}
|
|
15
|
-
<output>
|
|
16
|
-
{#if $$slots.output}
|
|
17
|
-
<slot name="output" />
|
|
18
|
-
{:else}
|
|
19
|
-
{outputValue}
|
|
20
|
-
{#if percentage}%{/if}
|
|
21
|
-
{/if}
|
|
22
|
-
</output>
|
|
23
|
-
{/if}
|
|
24
|
-
</label>
|
|
25
|
-
|
|
26
|
-
<script >import { onMount } from 'svelte';
|
|
27
|
-
;
|
|
28
|
-
import { computeClasses } from '../../utils';
|
|
29
|
-
export let label = '';
|
|
30
|
-
export let min = 0;
|
|
31
|
-
export let max = 100;
|
|
32
|
-
export let step = 1;
|
|
33
|
-
export let block = false;
|
|
34
|
-
export let hideValue = false;
|
|
35
|
-
export let value = null;
|
|
36
|
-
export let background = 'secondary';
|
|
37
|
-
export let percentage = false;
|
|
38
|
-
export let disabled = false;
|
|
39
|
-
let rangeEl;
|
|
40
|
-
let outputValue;
|
|
41
|
-
onMount(() => {
|
|
42
|
-
outputValue = rangeEl.value;
|
|
43
|
-
});
|
|
44
|
-
let classes;
|
|
45
|
-
$: classes = `range-${background} ${computeClasses('input', { block })}`;
|
|
46
|
-
// need to react to programmatic change to `value` as well as slider variations
|
|
47
|
-
$: if (value !== null) {
|
|
48
|
-
outputValue = String(value);
|
|
49
|
-
}
|
|
50
|
-
$: if (percentage) {
|
|
51
|
-
outputValue = String(Math.round(Number(outputValue) / Number(max) * 100));
|
|
52
|
-
}
|
|
53
|
-
</script>
|
|
54
|
-
|
|
55
|
-
<style >label.block {
|
|
56
|
-
width: 100%;
|
|
57
|
-
}
|
|
58
|
-
label.disabled {
|
|
59
|
-
pointer-events: none;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
input {
|
|
63
|
-
margin-bottom: 0.35rem;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
input[type=range].range-primary::-webkit-slider-runnable-track {
|
|
67
|
-
background: var(--primary);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
input[type=range].range-primary::-moz-range-track {
|
|
71
|
-
background: var(--primary);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
input[type=range].range-primary::-ms-track {
|
|
75
|
-
background: var(--primary);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
input[type=range].range-secondary::-webkit-slider-runnable-track {
|
|
79
|
-
background: var(--secondary);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
input[type=range].range-secondary::-moz-range-track {
|
|
83
|
-
background: var(--secondary);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
input[type=range].range-secondary::-ms-track {
|
|
87
|
-
background: var(--secondary);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
input[type=range].range-success::-webkit-slider-runnable-track {
|
|
91
|
-
background: var(--success);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
input[type=range].range-success::-moz-range-track {
|
|
95
|
-
background: var(--success);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
input[type=range].range-success::-ms-track {
|
|
99
|
-
background: var(--success);
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
input[type=range].range-warning::-webkit-slider-runnable-track {
|
|
103
|
-
background: var(--warning);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
input[type=range].range-warning::-moz-range-track {
|
|
107
|
-
background: var(--warning);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
input[type=range].range-warning::-ms-track {
|
|
111
|
-
background: var(--warning);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
input[type=range].range-danger::-webkit-slider-runnable-track {
|
|
115
|
-
background: var(--danger);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
input[type=range].range-danger::-moz-range-track {
|
|
119
|
-
background: var(--danger);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
input[type=range].range-danger::-ms-track {
|
|
123
|
-
background: var(--danger);
|
|
124
|
-
}</style>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { PaperType } from '../../types';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
label?: string;
|
|
7
|
-
min?: number | string;
|
|
8
|
-
max?: number | string;
|
|
9
|
-
step?: number | string;
|
|
10
|
-
block?: boolean;
|
|
11
|
-
hideValue?: boolean;
|
|
12
|
-
value?: number | string;
|
|
13
|
-
background?: PaperType;
|
|
14
|
-
percentage?: boolean;
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
};
|
|
17
|
-
events: {
|
|
18
|
-
[evt: string]: CustomEvent<any>;
|
|
19
|
-
};
|
|
20
|
-
slots: {
|
|
21
|
-
default: {};
|
|
22
|
-
output: {};
|
|
23
|
-
};
|
|
24
|
-
};
|
|
25
|
-
export declare type SliderProps = typeof __propDef.props;
|
|
26
|
-
export declare type SliderEvents = typeof __propDef.events;
|
|
27
|
-
export declare type SliderSlots = typeof __propDef.slots;
|
|
28
|
-
export default class Slider extends SvelteComponentTyped<SliderProps, SliderEvents, SliderSlots> {
|
|
29
|
-
}
|
|
30
|
-
export {};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
{#if tile}
|
|
2
|
-
<label {...$$restProps}
|
|
3
|
-
class="{$$restProps.class ?? ''} paper-switch-tile"
|
|
4
|
-
class:disabled>
|
|
5
|
-
<input bind:checked
|
|
6
|
-
type="checkbox"
|
|
7
|
-
{disabled}
|
|
8
|
-
on:change={onChange} />
|
|
9
|
-
<div class="paper-switch-tile-card border">
|
|
10
|
-
<div class={`paper-switch-tile-card-front border
|
|
11
|
-
${bgClass(tile.off.background)}`}>
|
|
12
|
-
{tile.off.label}
|
|
13
|
-
</div>
|
|
14
|
-
<div class={`paper-switch-tile-card-back border
|
|
15
|
-
${bgClass(tile.on.background)}`}>
|
|
16
|
-
{tile.on.label}
|
|
17
|
-
</div>
|
|
18
|
-
</div>
|
|
19
|
-
</label>
|
|
20
|
-
{:else}
|
|
21
|
-
<label class={prefix}>
|
|
22
|
-
<input id={domId}
|
|
23
|
-
bind:checked
|
|
24
|
-
type="checkbox"
|
|
25
|
-
{disabled}
|
|
26
|
-
on:change={onChange} />
|
|
27
|
-
<span class="paper-switch-slider"
|
|
28
|
-
class:round></span>
|
|
29
|
-
</label>
|
|
30
|
-
{#if $$slots.default}
|
|
31
|
-
<label class={`${prefix}-label`}
|
|
32
|
-
for={domId}>
|
|
33
|
-
<slot />
|
|
34
|
-
</label>
|
|
35
|
-
{/if}
|
|
36
|
-
{/if}
|
|
37
|
-
|
|
38
|
-
<script context="module">let count = 0;
|
|
39
|
-
</script>
|
|
40
|
-
|
|
41
|
-
<script >import { onMount, createEventDispatcher } from "svelte";
|
|
42
|
-
;
|
|
43
|
-
export let checked = false;
|
|
44
|
-
export let disabled = false;
|
|
45
|
-
export let round = false;
|
|
46
|
-
export let inline = false;
|
|
47
|
-
export let tile = null;
|
|
48
|
-
const dispatch = createEventDispatcher();
|
|
49
|
-
let id;
|
|
50
|
-
onMount(() => {
|
|
51
|
-
id = count++;
|
|
52
|
-
});
|
|
53
|
-
let domId;
|
|
54
|
-
$: domId = `paper-switch-input-${id}`;
|
|
55
|
-
let prefix;
|
|
56
|
-
$: prefix = 'paper-switch' + (inline ? '-2' : '');
|
|
57
|
-
function onChange() {
|
|
58
|
-
dispatch('change', checked);
|
|
59
|
-
}
|
|
60
|
-
function bgClass(color) {
|
|
61
|
-
if (!color)
|
|
62
|
-
return;
|
|
63
|
-
return `background-${color}`;
|
|
64
|
-
}
|
|
65
|
-
</script>
|
|
66
|
-
|
|
67
|
-
<style >input[disabled] + span,
|
|
68
|
-
.paper-switch-tile.disabled {
|
|
69
|
-
opacity: 0.5;
|
|
70
|
-
cursor: not-allowed;
|
|
71
|
-
}</style>
|