@svar-ui/svelte-toolbar 2.2.1 → 2.4.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/package.json +6 -4
- package/readme.md +3 -3
- package/src/components/BarComponent.svelte +1 -1
- package/src/components/Toolbar.svelte +1 -1
- package/types/index.d.ts +32 -0
- package/whatsnew.md +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@svar-ui/svelte-toolbar",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Svelte toolbar component. Lightweight, customizable, easy-to-use.",
|
|
5
5
|
"productTag": "toolbar",
|
|
6
6
|
"productTrial": false,
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"svelte": "src/index.js",
|
|
19
19
|
"exports": {
|
|
20
20
|
".": {
|
|
21
|
-
"svelte": "./src/index.js"
|
|
21
|
+
"svelte": "./src/index.js",
|
|
22
|
+
"types": "./types/index.d.ts"
|
|
22
23
|
},
|
|
23
24
|
"./package.json": "./package.json"
|
|
24
25
|
},
|
|
@@ -32,11 +33,12 @@
|
|
|
32
33
|
},
|
|
33
34
|
"homepage": "https://svar.dev/svelte/core/",
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@svar-ui/svelte-core": "2.
|
|
36
|
-
"@svar-ui/lib-dom": "0.
|
|
36
|
+
"@svar-ui/svelte-core": "2.4.0",
|
|
37
|
+
"@svar-ui/lib-dom": "0.11.1"
|
|
37
38
|
},
|
|
38
39
|
"files": [
|
|
39
40
|
"src",
|
|
41
|
+
"types",
|
|
40
42
|
"readme.md",
|
|
41
43
|
"whatsnew.md",
|
|
42
44
|
"license.txt"
|
package/readme.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
# SVAR Svelte Toolbar
|
|
4
4
|
|
|
5
|
-
[](https://www.npmjs.com/package/@svar-ui/svelte-toolbar)
|
|
6
6
|
[](https://github.com/svar-widgets/toolbar/blob/main/license.txt)
|
|
7
|
-
[](https://www.npmjs.com/package/@svar-ui/svelte-toolbar)
|
|
8
8
|
|
|
9
9
|
</div>
|
|
10
10
|
|
|
@@ -22,7 +22,7 @@ To use the widget, simply import the package and include the component in your S
|
|
|
22
22
|
|
|
23
23
|
```svelte
|
|
24
24
|
<script>
|
|
25
|
-
import { Toolbar } from "
|
|
25
|
+
import { Toolbar } from "@svar-ui/svelte-toolbar";
|
|
26
26
|
|
|
27
27
|
function onClick(item) {
|
|
28
28
|
message = "Button '" + item.id + "' clicked";
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Component } from "svelte";
|
|
2
|
+
|
|
3
|
+
export interface IToolbarItem {
|
|
4
|
+
id?: string | number;
|
|
5
|
+
comp?: string | Component<any>;
|
|
6
|
+
icon?: string;
|
|
7
|
+
css?: string;
|
|
8
|
+
text?: string;
|
|
9
|
+
menuText?: string;
|
|
10
|
+
key?: string;
|
|
11
|
+
spacer?: boolean;
|
|
12
|
+
collapsed?: boolean;
|
|
13
|
+
handler?: (item: IToolbarItem, value?: any) => void;
|
|
14
|
+
layout?: "column";
|
|
15
|
+
items?: IToolbarItem[];
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export declare const Toolbar: Component<{
|
|
20
|
+
items?: IToolbarItem[];
|
|
21
|
+
menuCss?: string;
|
|
22
|
+
css?: string;
|
|
23
|
+
values?: { [key: string]: any };
|
|
24
|
+
overflow?: "collapse" | "wrap" | "menu";
|
|
25
|
+
onclick?: (ev: { item: IToolbarItem }) => void;
|
|
26
|
+
onchange?: (ev: { value: any; item: IToolbarItem }) => void;
|
|
27
|
+
}>;
|
|
28
|
+
|
|
29
|
+
export declare function registerToolbarItem(
|
|
30
|
+
type: string,
|
|
31
|
+
handler: Component<any>
|
|
32
|
+
): void;
|