@svar-ui/svelte-toolbar 2.2.1 → 2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svar-ui/svelte-toolbar",
3
- "version": "2.2.1",
3
+ "version": "2.3.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.2.1",
36
+ "@svar-ui/svelte-core": "2.3.1",
36
37
  "@svar-ui/lib-dom": "0.9.2"
37
38
  },
38
39
  "files": [
39
40
  "src",
41
+ "types",
40
42
  "readme.md",
41
43
  "whatsnew.md",
42
44
  "license.txt"
@@ -22,7 +22,7 @@
22
22
  </script>
23
23
 
24
24
  {#if item.comp == "spacer"}
25
- <Spacer {menu} />
25
+ <Spacer />
26
26
  {:else if item.comp == "separator"}
27
27
  <Separator {menu} />
28
28
  {:else}
@@ -9,7 +9,7 @@
9
9
  let {
10
10
  items = $bindable([]),
11
11
  menuCss = "",
12
- css,
12
+ css = "",
13
13
  values = $bindable(null),
14
14
  overflow = "menu",
15
15
  onclick,
@@ -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;
package/whatsnew.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## 2.3.0
2
+
3
+ ### New features
4
+
5
+ - TypeScript definitions
6
+
7
+ ### Fixes
8
+
9
+ - item `menuText` property is not applied
10
+
1
11
  ## 2.2.1
2
12
 
3
13
  ### Fixes