wx-svelte-menu 2.3.0 → 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 +3 -3
- package/readme.md +1 -1
- package/src/components/MenuBar.svelte +7 -0
- package/src/components/MenuOption.svelte +10 -0
- package/src/helpers/index.js +3 -2
- package/types/index.d.ts +1 -0
- package/whatsnew.md +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wx-svelte-menu",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Svelte menu component for creating dropdown menus, context menus, or complex menu bars",
|
|
5
5
|
"productTag": "menu",
|
|
6
6
|
"productTrial": false,
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
},
|
|
34
34
|
"homepage": "https://svar.dev/svelte/core/",
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@svar-ui/svelte-core": "2.
|
|
37
|
-
"@svar-ui/lib-dom": "0.
|
|
36
|
+
"@svar-ui/svelte-core": "2.4.0",
|
|
37
|
+
"@svar-ui/lib-dom": "0.11.1"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
40
40
|
"src",
|
package/readme.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@svar-ui/svelte-menu)
|
|
6
6
|
[](https://github.com/svar-widgets/menu/blob/main/license.txt)
|
|
7
|
-
[](https://www.npmjs.com/package/@svar-ui/svelte-
|
|
7
|
+
[](https://www.npmjs.com/package/@svar-ui/svelte-menu)
|
|
8
8
|
|
|
9
9
|
</div>
|
|
10
10
|
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
{#each finalOptions as option (option.id)}
|
|
51
51
|
<button
|
|
52
52
|
class="wx-option {active === option.id ? 'wx-active' : ''}"
|
|
53
|
+
class:wx-disabled={option.disabled}
|
|
53
54
|
onmouseenter={ev => onHover(ev, option)}
|
|
54
55
|
onclick={ev => setMenu(ev, option, true)}>{option.text}</button
|
|
55
56
|
>
|
|
@@ -92,4 +93,10 @@
|
|
|
92
93
|
background-color: var(--wx-background-alt);
|
|
93
94
|
border-radius: var(--wx-button-border-radius);
|
|
94
95
|
}
|
|
96
|
+
.wx-disabled {
|
|
97
|
+
pointer-events: none;
|
|
98
|
+
}
|
|
99
|
+
.wx-disabled {
|
|
100
|
+
color: var(--wx-color-font-disabled);
|
|
101
|
+
}
|
|
95
102
|
</style>
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
<div
|
|
15
15
|
bind:this={element}
|
|
16
16
|
class="wx-option {option.css || ''}"
|
|
17
|
+
class:wx-disabled={option.disabled}
|
|
17
18
|
data-id={option.id}
|
|
18
19
|
onmouseenter={onHover}
|
|
19
20
|
{onclick}
|
|
@@ -80,4 +81,13 @@
|
|
|
80
81
|
margin-left: 20px;
|
|
81
82
|
white-space: nowrap;
|
|
82
83
|
}
|
|
84
|
+
|
|
85
|
+
.wx-disabled {
|
|
86
|
+
pointer-events: none;
|
|
87
|
+
}
|
|
88
|
+
.wx-disabled .wx-value,
|
|
89
|
+
.wx-disabled .wx-icon,
|
|
90
|
+
.wx-disabled .wx-sub-icon {
|
|
91
|
+
color: var(--wx-color-font-disabled);
|
|
92
|
+
}
|
|
83
93
|
</style>
|
package/src/helpers/index.js
CHANGED
|
@@ -31,8 +31,9 @@ let uid = 1;
|
|
|
31
31
|
export function prepareMenuData(data) {
|
|
32
32
|
return mapData(data, a => {
|
|
33
33
|
// [deprecated] option.type to be deprecated in 3.0
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
const opt = { ...a, id: a.id || uid++ };
|
|
35
|
+
if (opt.type) opt.comp = opt.type;
|
|
36
|
+
return opt;
|
|
36
37
|
});
|
|
37
38
|
}
|
|
38
39
|
|
package/types/index.d.ts
CHANGED
package/whatsnew.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
1
|
+
## 2.4.0
|
|
2
|
+
|
|
3
|
+
### Updates
|
|
4
|
+
|
|
5
|
+
- More options to precisely position and align ContextMenu, DropDownMenu, ActionMenu
|
|
6
|
+
|
|
7
|
+
### Fixes
|
|
8
|
+
|
|
9
|
+
- Incorrect position of Menus in a relatively positioned continer
|
|
10
|
+
- Incorrect position of Menus close to the container edges
|
|
11
|
+
|
|
12
|
+
## 2.3.1
|
|
13
|
+
|
|
14
|
+
### Fixes
|
|
15
|
+
|
|
16
|
+
- Backward compatibility for option type
|
|
17
|
+
|
|
1
18
|
## 2.3.0
|
|
2
19
|
|
|
3
20
|
### New features
|