@api-client/ui 0.5.45 → 0.5.46
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/build/src/md/menu/internal/Menu.d.ts +10 -0
- package/build/src/md/menu/internal/Menu.d.ts.map +1 -1
- package/build/src/md/menu/internal/Menu.js +34 -5
- package/build/src/md/menu/internal/Menu.js.map +1 -1
- package/build/src/md/menu/internal/MenuItem.styles.d.ts.map +1 -1
- package/build/src/md/menu/internal/MenuItem.styles.js +0 -1
- package/build/src/md/menu/internal/MenuItem.styles.js.map +1 -1
- package/build/src/md/menu/ui-menu.d.ts +0 -8
- package/build/src/md/menu/ui-menu.d.ts.map +1 -1
- package/build/src/md/menu/ui-menu.js +0 -8
- package/build/src/md/menu/ui-menu.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/md/menu/internal/Menu.ts +16 -3
- package/src/md/menu/internal/MenuItem.styles.ts +0 -1
- package/src/md/menu/ui-menu.ts +0 -8
package/package.json
CHANGED
|
@@ -30,6 +30,17 @@ export default class Menu extends UiList {
|
|
|
30
30
|
*/
|
|
31
31
|
@property({ type: Boolean, reflect: true }) accessor disabled = false
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Whether to select menu items when they are activated.
|
|
35
|
+
* When true, clicking or pressing Enter/Space on a menu item will mark it as selected.
|
|
36
|
+
* When false (default), menu items will not be marked as selected when activated.
|
|
37
|
+
*
|
|
38
|
+
* Note, this is different than `selectActive` as this property controls the class names
|
|
39
|
+
* set on the menu item.
|
|
40
|
+
* @attribute
|
|
41
|
+
*/
|
|
42
|
+
@property({ type: Boolean }) accessor selectOnActivate = false
|
|
43
|
+
|
|
33
44
|
/**
|
|
34
45
|
* Currently active sub-menu
|
|
35
46
|
*/
|
|
@@ -241,9 +252,11 @@ export default class Menu extends UiList {
|
|
|
241
252
|
}
|
|
242
253
|
|
|
243
254
|
override notifySelect(item: UiListItem & { selected?: boolean }, index?: number): boolean {
|
|
244
|
-
//
|
|
245
|
-
this.
|
|
246
|
-
|
|
255
|
+
// Only handle selection if selectOnActivate is enabled
|
|
256
|
+
if (this.selectOnActivate) {
|
|
257
|
+
this.clearSelection()
|
|
258
|
+
item.selected = true
|
|
259
|
+
}
|
|
247
260
|
this.hide()
|
|
248
261
|
return super.notifySelect(item, index)
|
|
249
262
|
}
|
package/src/md/menu/ui-menu.ts
CHANGED
|
@@ -5,14 +5,6 @@ import styles from './internal/Menu.styles.js'
|
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Material Design 3 Menu component with sub-menu support.
|
|
8
|
-
*
|
|
9
|
-
* @element ui-menu
|
|
10
|
-
* @attribute {boolean} open - Whether the menu is currently open
|
|
11
|
-
* @attribute {boolean} anchored - Whether the menu should be positioned relative to an anchor element
|
|
12
|
-
* @attribute {boolean} disabled - Whether the menu is disabled
|
|
13
|
-
* @fires select - Dispatched when a menu item is selected
|
|
14
|
-
* @fires close - Dispatched when the menu is closed
|
|
15
|
-
* @fires open - Dispatched when the menu is opened
|
|
16
8
|
*/
|
|
17
9
|
@customElement('ui-menu')
|
|
18
10
|
export class UiMenuElement extends Element {
|