spaper 1.2.0 → 1.3.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/components/Form/Form.svelte +2 -1
- package/components/Form/Form.svelte.d.ts +1 -0
- package/components/Form/Input.svelte +8 -1
- package/components/Form/Input.svelte.d.ts +2 -2
- package/components/Layout/Col.svelte +11 -7
- package/components/Layout/Col.svelte.d.ts +1 -0
- package/components/Layout/Row.svelte +15 -11
- package/components/Layout/Row.svelte.d.ts +1 -0
- package/components/Skeleton.svelte +1 -1
- package/components/Tabs/Tabs.svelte +2 -1
- package/components/Tabs/Tabs.svelte.d.ts +1 -0
- package/package.json +2 -1
- package/types.d.ts +14 -24
- package/types.js +1 -0
|
@@ -35,14 +35,18 @@ import { computeClasses, getDomAttributes } from '../../utils';
|
|
|
35
35
|
;
|
|
36
36
|
;
|
|
37
37
|
export let label = '';
|
|
38
|
-
export let value =
|
|
38
|
+
export let value = null;
|
|
39
39
|
export let block = false;
|
|
40
40
|
export let type = 'text';
|
|
41
41
|
export let valid = null;
|
|
42
42
|
export let noResize = false;
|
|
43
43
|
const dispatch = createEventDispatcher();
|
|
44
|
+
// let value_ = value
|
|
44
45
|
function onInput({ target }) {
|
|
45
46
|
dispatch('input', target.value);
|
|
47
|
+
// console.log(type)
|
|
48
|
+
// const valueToDispatch = type === 'number' ? parseFloat(target.value) : target.value;
|
|
49
|
+
// dispatch('input', valueToDispatch);
|
|
46
50
|
}
|
|
47
51
|
let isValid = true;
|
|
48
52
|
$: if (valid) {
|
|
@@ -58,6 +62,9 @@ $: {
|
|
|
58
62
|
}
|
|
59
63
|
let classes;
|
|
60
64
|
$: classes = `${(_a = $$restProps.class) !== null && _a !== void 0 ? _a : ''} ${computeClasses('input', { block })}`;
|
|
65
|
+
// $: console.log('value in input', value, value === null)
|
|
66
|
+
// FIXME: change value twice... use other var? value_?
|
|
67
|
+
// $: if (type === 'number' && value !== null) value = Number(value)
|
|
61
68
|
</script>
|
|
62
69
|
|
|
63
70
|
<style>
|
|
@@ -4,10 +4,10 @@ declare const __propDef: {
|
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
label?: string;
|
|
7
|
-
value?: string;
|
|
7
|
+
value?: string | number | null;
|
|
8
8
|
block?: boolean;
|
|
9
9
|
type?: InputType;
|
|
10
|
-
valid?: (val: string) => boolean;
|
|
10
|
+
valid?: (val: string | number) => boolean;
|
|
11
11
|
noResize?: boolean;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
<svelte:element
|
|
2
|
+
this={as}
|
|
3
|
+
{...$$restProps}
|
|
4
|
+
class={classes}
|
|
5
|
+
class:col-fill={fill}
|
|
6
|
+
class:align-top={top}
|
|
7
|
+
class:align-middle={middle}
|
|
8
|
+
class:align-bottom={bottom}
|
|
9
|
+
>
|
|
7
10
|
<slot />
|
|
8
|
-
</
|
|
11
|
+
</svelte:element>
|
|
9
12
|
|
|
10
13
|
<script >var _a;
|
|
11
14
|
import { computeClasses } from '../../utils';
|
|
15
|
+
export let as = 'div';
|
|
12
16
|
export let col = null;
|
|
13
17
|
export let sm = null;
|
|
14
18
|
export let md = null;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
<svelte:element
|
|
2
|
+
this={as}
|
|
3
|
+
{...$$restProps}
|
|
4
|
+
class="{$$restProps.class ?? ''} row"
|
|
5
|
+
class:flex-right={right}
|
|
6
|
+
class:flex-center={center}
|
|
7
|
+
class:flex-edges={edges}
|
|
8
|
+
class:flex-spaces={spaces}
|
|
9
|
+
class:flex-top={top}
|
|
10
|
+
class:flex-middle={middle}
|
|
11
|
+
class:flex-bottom={bottom}
|
|
12
|
+
>
|
|
10
13
|
<slot />
|
|
11
|
-
</
|
|
14
|
+
</svelte:element>
|
|
12
15
|
|
|
13
|
-
<script >export let
|
|
16
|
+
<script >export let as = 'div';
|
|
17
|
+
export let right = false;
|
|
14
18
|
export let center = false;
|
|
15
19
|
export let edges = false;
|
|
16
20
|
export let spaces = false;
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"papercss",
|
|
9
9
|
"components"
|
|
10
10
|
],
|
|
11
|
-
"version": "1.
|
|
11
|
+
"version": "1.3.0",
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
14
|
"url": "git+https://github.com/Oli8/spaper.git"
|
|
@@ -70,6 +70,7 @@
|
|
|
70
70
|
"./components/Toast": "./components/Toast/index.js",
|
|
71
71
|
"./components/style.scss": "./components/style.scss",
|
|
72
72
|
".": "./index.js",
|
|
73
|
+
"./types": "./types.js",
|
|
73
74
|
"./utils": "./utils.js"
|
|
74
75
|
},
|
|
75
76
|
"svelte": "./index.js"
|
package/types.d.ts
CHANGED
|
@@ -1,26 +1,16 @@
|
|
|
1
|
-
export type PaperSize = 'small' | 'default' | 'large';
|
|
2
|
-
|
|
3
|
-
export type
|
|
4
|
-
|
|
5
|
-
export type
|
|
6
|
-
|
|
7
|
-
export type
|
|
8
|
-
|
|
9
|
-
export type Attributes = Record<string, string|boolean>;
|
|
10
|
-
|
|
11
|
-
export type PositionY = 'top' | 'bottom';
|
|
12
|
-
export type PositionX = 'left' | 'right';
|
|
13
|
-
export type Position = PositionX | PositionY;
|
|
14
|
-
|
|
1
|
+
export declare type PaperSize = 'small' | 'default' | 'large';
|
|
2
|
+
export declare type PaperType = 'primary' | 'secondary' | 'success' | 'warning' | 'danger';
|
|
3
|
+
export declare type PaperFlexPlacement = 'spaces' | 'edges' | 'right' | 'center' | 'left';
|
|
4
|
+
export declare type PaperAlign = 'left' | 'center' | 'right';
|
|
5
|
+
export declare type Attributes = Record<string, string | boolean>;
|
|
6
|
+
export declare type PositionY = 'top' | 'bottom';
|
|
7
|
+
export declare type PositionX = 'left' | 'right';
|
|
8
|
+
export declare type Position = PositionX | PositionY;
|
|
15
9
|
export interface TableColumnObj {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
field: string;
|
|
11
|
+
label?: string;
|
|
12
|
+
content?: (val?: any) => string;
|
|
13
|
+
html?: boolean;
|
|
20
14
|
}
|
|
21
|
-
|
|
22
|
-
export type
|
|
23
|
-
|
|
24
|
-
export type Transition = 'blur'
|
|
25
|
-
| 'fade' | 'fly' | 'slide'
|
|
26
|
-
| 'scale' | 'draw' | 'crossfade';
|
|
15
|
+
export declare type TableColumn = TableColumnObj | string;
|
|
16
|
+
export declare type Transition = 'blur' | 'fade' | 'fly' | 'slide' | 'scale' | 'draw' | 'crossfade';
|
package/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|