spaper 0.2.6 → 0.3.6
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 +1 -1
- package/components/Alert.svelte +2 -2
- package/components/Article.svelte +1 -1
- package/components/Badge.svelte +1 -1
- package/components/Breadcrumb.svelte +1 -1
- package/components/Button.svelte +1 -1
- package/components/Card.svelte +1 -1
- package/components/CloseButton.svelte +2 -2
- package/components/Collapsible.svelte +2 -2
- package/components/Form/Checkbox.svelte +2 -2
- package/components/Form/Input.svelte +1 -1
- package/components/Form/Radio.svelte +1 -1
- package/components/Form/Select.svelte +1 -1
- package/components/Form/Slider.svelte +2 -2
- package/components/Form/Switch.svelte +11 -5
- package/components/Modal/Modal.svelte +2 -2
- package/components/Navbar.svelte +2 -2
- package/components/Pagination/Arrow.svelte +1 -1
- package/components/Pagination/NavigationButton.svelte +1 -1
- package/components/Pagination/Pagination.svelte +2 -2
- package/components/Popover.svelte +2 -2
- package/components/Progress.svelte +1 -1
- package/components/Table.svelte +2 -3
- package/components/Tabs/Tab.svelte +1 -1
- package/components/Tabs/Tabs.svelte +2 -2
- package/components/Toast/Toast.svelte +1 -1
- package/components/Toast/ToastContainer.svelte +3 -3
- package/components/Toast/index.js +1 -1
- package/package.json +6 -9
- package/utils.js +4 -1
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ Browse [documentation and demo here](https://oli8.github.io/spaper/).
|
|
|
14
14
|
Add a link to the CDN into your HTML file:
|
|
15
15
|
|
|
16
16
|
```html
|
|
17
|
-
<link rel="stylesheet" href="https://unpkg.com/papercss@1.8.
|
|
17
|
+
<link rel="stylesheet" href="https://unpkg.com/papercss@1.8.3/dist/paper.min.css">
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
Or use NPM:
|
package/components/Alert.svelte
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
{/if}
|
|
9
9
|
</div>
|
|
10
10
|
|
|
11
|
-
<script
|
|
11
|
+
<script >var _a;
|
|
12
12
|
;
|
|
13
13
|
import CloseButton from './CloseButton.svelte';
|
|
14
14
|
import { computeClasses } from '../utils';
|
|
@@ -21,7 +21,7 @@ function close() {
|
|
|
21
21
|
$: classes = `${(_a = $$restProps.class) !== null && _a !== void 0 ? _a : ''} alert ${computeClasses('alert', { type })}`;
|
|
22
22
|
</script>
|
|
23
23
|
|
|
24
|
-
<style
|
|
24
|
+
<style >.alert {
|
|
25
25
|
transition: all 0.25s ease-out;
|
|
26
26
|
}
|
|
27
27
|
.alert.closed {
|
package/components/Badge.svelte
CHANGED
package/components/Button.svelte
CHANGED
package/components/Card.svelte
CHANGED
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
</div>
|
|
15
15
|
</section>
|
|
16
16
|
|
|
17
|
-
<script
|
|
17
|
+
<script context="module">let count = 0;
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
|
-
<script
|
|
20
|
+
<script >var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
21
21
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
22
22
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
23
23
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<span>{label}</span>
|
|
10
10
|
</label>
|
|
11
11
|
|
|
12
|
-
<script
|
|
12
|
+
<script >import { createEventDispatcher } from 'svelte';
|
|
13
13
|
export let label = '';
|
|
14
14
|
export let value = '';
|
|
15
15
|
export let name = '';
|
|
@@ -30,7 +30,7 @@ function onChange({ target }) {
|
|
|
30
30
|
}
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
|
-
<style
|
|
33
|
+
<style >input[disabled] + span::before, input[disabled] ~ span {
|
|
34
34
|
opacity: 0.5;
|
|
35
35
|
cursor: not-allowed;
|
|
36
36
|
}</style>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
{/if}
|
|
25
25
|
</label>
|
|
26
26
|
|
|
27
|
-
<script
|
|
27
|
+
<script >import { onMount } from 'svelte';
|
|
28
28
|
;
|
|
29
29
|
import { computeClasses } from '../../utils';
|
|
30
30
|
export let label = '';
|
|
@@ -52,7 +52,7 @@ $: if (percentage) {
|
|
|
52
52
|
}
|
|
53
53
|
</script>
|
|
54
54
|
|
|
55
|
-
<style
|
|
55
|
+
<style >label.block {
|
|
56
56
|
width: 100%;
|
|
57
57
|
}
|
|
58
58
|
label.disabled {
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
class:disabled>
|
|
4
4
|
<input bind:checked
|
|
5
5
|
type="checkbox"
|
|
6
|
-
{disabled}
|
|
6
|
+
{disabled}
|
|
7
|
+
on:change={onChange} />
|
|
7
8
|
<div class="paper-switch-tile-card border">
|
|
8
9
|
<div class={`paper-switch-tile-card-front border
|
|
9
10
|
${bgClass(tile.off.background)}`}>
|
|
@@ -20,7 +21,8 @@
|
|
|
20
21
|
<input id={domId}
|
|
21
22
|
bind:checked
|
|
22
23
|
type="checkbox"
|
|
23
|
-
{disabled}
|
|
24
|
+
{disabled}
|
|
25
|
+
on:change={onChange} />
|
|
24
26
|
<span class="paper-switch-slider"
|
|
25
27
|
class:round></span>
|
|
26
28
|
</label>
|
|
@@ -32,16 +34,17 @@
|
|
|
32
34
|
{/if}
|
|
33
35
|
{/if}
|
|
34
36
|
|
|
35
|
-
<script
|
|
37
|
+
<script context="module">let count = 0;
|
|
36
38
|
</script>
|
|
37
39
|
|
|
38
|
-
<script
|
|
40
|
+
<script >import { onMount, createEventDispatcher } from "svelte";
|
|
39
41
|
;
|
|
40
42
|
export let checked = false;
|
|
41
43
|
export let disabled = false;
|
|
42
44
|
export let round = false;
|
|
43
45
|
export let inline = false;
|
|
44
46
|
export let tile = null;
|
|
47
|
+
const dispatch = createEventDispatcher();
|
|
45
48
|
let id;
|
|
46
49
|
onMount(() => {
|
|
47
50
|
id = count++;
|
|
@@ -50,6 +53,9 @@ let domId;
|
|
|
50
53
|
$: domId = `paper-switch-input-${id}`;
|
|
51
54
|
let prefix;
|
|
52
55
|
$: prefix = 'paper-switch' + (inline ? '-2' : '');
|
|
56
|
+
function onChange() {
|
|
57
|
+
dispatch('change', checked);
|
|
58
|
+
}
|
|
53
59
|
function bgClass(color) {
|
|
54
60
|
if (!color)
|
|
55
61
|
return;
|
|
@@ -57,7 +63,7 @@ function bgClass(color) {
|
|
|
57
63
|
}
|
|
58
64
|
</script>
|
|
59
65
|
|
|
60
|
-
<style
|
|
66
|
+
<style >input[disabled] + span,
|
|
61
67
|
.paper-switch-tile.disabled {
|
|
62
68
|
opacity: 0.5;
|
|
63
69
|
cursor: not-allowed;
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
</div>
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
|
-
<script
|
|
26
|
+
<script >import Button from '../Button.svelte';
|
|
27
27
|
import CloseButton from '../CloseButton.svelte';
|
|
28
28
|
export let active = false;
|
|
29
29
|
export let title = '';
|
|
@@ -38,7 +38,7 @@ function handleKeydown({ key }) {
|
|
|
38
38
|
}
|
|
39
39
|
</script>
|
|
40
40
|
|
|
41
|
-
<style
|
|
41
|
+
<style >.modal.active {
|
|
42
42
|
opacity: 1;
|
|
43
43
|
visibility: visible;
|
|
44
44
|
}
|
package/components/Navbar.svelte
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
</div>
|
|
15
15
|
</nav>
|
|
16
16
|
|
|
17
|
-
<script
|
|
17
|
+
<script >export let border = true;
|
|
18
18
|
export let fixed = false;
|
|
19
19
|
export let split = true;
|
|
20
20
|
let open = false;
|
|
@@ -23,7 +23,7 @@ function collapse() {
|
|
|
23
23
|
}
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
|
-
<style
|
|
26
|
+
<style >/* Papercss removes border of buttons in .collapsible */
|
|
27
27
|
.collapsible > button {
|
|
28
28
|
border: 2px solid var(--primary);
|
|
29
29
|
}
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
{/if}
|
|
52
52
|
</section>
|
|
53
53
|
|
|
54
|
-
<script
|
|
54
|
+
<script >import { createEventDispatcher } from 'svelte';
|
|
55
55
|
import Button from '../Button.svelte';
|
|
56
56
|
import Input from '../Form/Input.svelte';
|
|
57
57
|
;
|
|
@@ -105,7 +105,7 @@ function changePage(val) {
|
|
|
105
105
|
}
|
|
106
106
|
</script>
|
|
107
107
|
|
|
108
|
-
<style
|
|
108
|
+
<style >ul, li {
|
|
109
109
|
display: inline;
|
|
110
110
|
}
|
|
111
111
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<slot />
|
|
6
6
|
</div>
|
|
7
7
|
|
|
8
|
-
<script
|
|
8
|
+
<script >;
|
|
9
9
|
export let label = '';
|
|
10
10
|
export let position = 'top';
|
|
11
11
|
export let inline = true;
|
|
@@ -17,7 +17,7 @@ function bgClass(color) {
|
|
|
17
17
|
}
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
|
-
<style
|
|
20
|
+
<style >.inline {
|
|
21
21
|
display: inline;
|
|
22
22
|
}
|
|
23
23
|
|
package/components/Table.svelte
CHANGED
|
@@ -41,8 +41,7 @@
|
|
|
41
41
|
</tbody>
|
|
42
42
|
</table>
|
|
43
43
|
|
|
44
|
-
<script
|
|
45
|
-
let tmpCol;
|
|
44
|
+
<script >let tmpCol;
|
|
46
45
|
export let columns = [];
|
|
47
46
|
export let data = [];
|
|
48
47
|
export let striped = false;
|
|
@@ -63,7 +62,7 @@ function isColumnObj(arg) {
|
|
|
63
62
|
return arg.field;
|
|
64
63
|
}
|
|
65
64
|
function getRowFiltered(row) {
|
|
66
|
-
return Object.entries(
|
|
65
|
+
return Object.entries(row).filter(([key, _val]) => displayedFields.includes(key));
|
|
67
66
|
}
|
|
68
67
|
$: if (!columns.length) {
|
|
69
68
|
columns = Object.keys(data[0] || {});
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<slot />
|
|
16
16
|
</div>
|
|
17
17
|
|
|
18
|
-
<script
|
|
18
|
+
<script >import { onMount, setContext, createEventDispatcher } from 'svelte';
|
|
19
19
|
import { writable } from 'svelte/store';
|
|
20
20
|
;
|
|
21
21
|
;
|
|
@@ -52,7 +52,7 @@ function updateTabsVisility() {
|
|
|
52
52
|
$: activeTab && updateTabsVisility();
|
|
53
53
|
</script>
|
|
54
54
|
|
|
55
|
-
<style
|
|
55
|
+
<style >.tabs-label-header {
|
|
56
56
|
cursor: pointer;
|
|
57
57
|
color: var(--primary-light);
|
|
58
58
|
display: inline-block;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<div class="{containerClass} {position}">
|
|
2
2
|
</div>
|
|
3
3
|
|
|
4
|
-
<script
|
|
4
|
+
<script context="module">export const containerClass = 'paper-toast-container';
|
|
5
5
|
</script>
|
|
6
6
|
|
|
7
|
-
<script
|
|
7
|
+
<script >;
|
|
8
8
|
export let position = 'top-right';
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
|
-
<style
|
|
11
|
+
<style >:global(.paper-toast-container:is(.top, .bottom) > div) {
|
|
12
12
|
align-self: center;
|
|
13
13
|
}
|
|
14
14
|
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"papercss",
|
|
9
9
|
"components"
|
|
10
10
|
],
|
|
11
|
-
"version": "0.
|
|
11
|
+
"version": "0.3.6",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "git+https://github.com/Oli8/spaper.git"
|
|
@@ -18,13 +18,9 @@
|
|
|
18
18
|
},
|
|
19
19
|
"homepage": "https://github.com/Oli8/spaper#readme",
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"papercss": "^1.8.
|
|
21
|
+
"papercss": "^1.8.3"
|
|
22
22
|
},
|
|
23
23
|
"type": "module",
|
|
24
|
-
"dependencies": {
|
|
25
|
-
"lodash.omit": "^4.5.0",
|
|
26
|
-
"lodash.pick": "^4.4.0"
|
|
27
|
-
},
|
|
28
24
|
"exports": {
|
|
29
25
|
"./package.json": "./package.json",
|
|
30
26
|
"./components/Alert.svelte": "./components/Alert.svelte",
|
|
@@ -50,7 +46,7 @@
|
|
|
50
46
|
"./components/Pagination/Arrow.svelte": "./components/Pagination/Arrow.svelte",
|
|
51
47
|
"./components/Pagination/NavigationButton.svelte": "./components/Pagination/NavigationButton.svelte",
|
|
52
48
|
"./components/Pagination/Pagination.svelte": "./components/Pagination/Pagination.svelte",
|
|
53
|
-
"./components/Pagination/arrow-dimension
|
|
49
|
+
"./components/Pagination/arrow-dimension": "./components/Pagination/arrow-dimension.js",
|
|
54
50
|
"./components/Pagination": "./components/Pagination/index.js",
|
|
55
51
|
"./components/Popover.svelte": "./components/Popover.svelte",
|
|
56
52
|
"./components/Progress.svelte": "./components/Progress.svelte",
|
|
@@ -63,6 +59,7 @@
|
|
|
63
59
|
"./components/Toast": "./components/Toast/index.js",
|
|
64
60
|
"./components/style.scss": "./components/style.scss",
|
|
65
61
|
".": "./index.js",
|
|
66
|
-
"./utils
|
|
67
|
-
}
|
|
62
|
+
"./utils": "./utils.js"
|
|
63
|
+
},
|
|
64
|
+
"svelte": "./index.js"
|
|
68
65
|
}
|
package/utils.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import omit from 'lodash.omit';
|
|
2
1
|
const propToClass = {
|
|
3
2
|
size: (pf, val) => `${pf}-${val}`,
|
|
4
3
|
block: (pf, _val) => `${pf}-block`,
|
|
5
4
|
type: (pf, val) => `${pf}-${val}`,
|
|
6
5
|
outline: (pf, val) => `${pf}-${val}-outline`,
|
|
7
6
|
};
|
|
7
|
+
function omit(obj, properties) {
|
|
8
|
+
return Object.fromEntries(Object.entries(obj)
|
|
9
|
+
.filter(([key, _val]) => !properties.includes(key)));
|
|
10
|
+
}
|
|
8
11
|
export function computeClasses(elPrefix, props) {
|
|
9
12
|
return Object.entries(props)
|
|
10
13
|
.filter(([_prop, val]) => val)
|