@aquera/nile-elements 0.1.33-beta-1.0 → 0.1.33-beta-1.1

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
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent nile-elements following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "nile-elements",
6
- "version": "0.1.33-beta-1.0",
6
+ "version": "0.1.33-beta-1.1",
7
7
  "main": "dist/src/index.js",
8
8
  "type": "module",
9
9
  "module": "dist/src/index.js",
@@ -31,6 +31,8 @@ export class NileMenu extends NileElement {
31
31
 
32
32
  @property({ type: Boolean }) showNoResults: boolean = false;
33
33
 
34
+ @property({ type: Boolean }) allowSpaceKey: boolean = false;
35
+
34
36
  @property({ type: String }) noResultsMessage: string = 'No results found';
35
37
 
36
38
  @query('slot:not([name])') defaultSlot!: HTMLSlotElement;
@@ -67,12 +69,6 @@ export class NileMenu extends NileElement {
67
69
  }
68
70
 
69
71
  private handleKeyDown(event: KeyboardEvent) {
70
- const target = event.target as HTMLElement;
71
-
72
- // Only handle keyboard shortcuts if NOT inside input, textarea, or contenteditable
73
- if (target.closest('nile-input') || target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {
74
- return; // Ignore handling space, arrows, etc.
75
- }
76
72
 
77
73
  // Make a selection when pressing enter
78
74
  if (event.key === 'Enter') {
@@ -82,7 +78,7 @@ export class NileMenu extends NileElement {
82
78
  }
83
79
 
84
80
  // Prevent scrolling when space is pressed (ONLY if not typing)
85
- if (event.key === ' ') {
81
+ if (!this.allowSpaceKey && event.key === ' ') {
86
82
  event.preventDefault();
87
83
  }
88
84
 
@@ -107,7 +103,7 @@ export class NileMenu extends NileElement {
107
103
  items[index].focus();
108
104
  }
109
105
  }
110
- }
106
+ }
111
107
 
112
108
 
113
109
  private handleMouseDown(event: MouseEvent) {
@@ -2215,7 +2215,7 @@
2215
2215
  },
2216
2216
  {
2217
2217
  "name": "nile-menu",
2218
- "description": "An nile-menu element.\n\nEvents:\n\n * `nile-select` {} - Emitted when a menu item is selected.\n\n * `count-changed` {} - Indicates when the count changes\n\nSlots:\n\n * ` ` {} - The menu's content, including menu items, menu labels, and dividers.\n\nAttributes:\n\n * `searchEnabled` {`boolean`} - \n\n * `customSearch` {`boolean`} - \n\n * `showNoResults` {`boolean`} - \n\n * `noResultsMessage` {`string`} - \n\nProperties:\n\n * `styles` - \n\n * `searchValue` {`string`} - \n\n * `searchWidth` {`number`} - \n\n * `searchEnabled` {`boolean`} - \n\n * `customSearch` {`boolean`} - \n\n * `showNoResults` {`boolean`} - \n\n * `noResultsMessage` {`string`} - \n\n * `defaultSlot` {`HTMLSlotElement`} - \n\n * `hasSlotController` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
2218
+ "description": "An nile-menu element.\n\nEvents:\n\n * `nile-select` {} - Emitted when a menu item is selected.\n\n * `count-changed` {} - Indicates when the count changes\n\nSlots:\n\n * ` ` {} - The menu's content, including menu items, menu labels, and dividers.\n\nAttributes:\n\n * `searchEnabled` {`boolean`} - \n\n * `customSearch` {`boolean`} - \n\n * `showNoResults` {`boolean`} - \n\n * `allowSpaceKey` {`boolean`} - \n\n * `noResultsMessage` {`string`} - \n\nProperties:\n\n * `styles` - \n\n * `searchValue` {`string`} - \n\n * `searchWidth` {`number`} - \n\n * `searchEnabled` {`boolean`} - \n\n * `customSearch` {`boolean`} - \n\n * `showNoResults` {`boolean`} - \n\n * `allowSpaceKey` {`boolean`} - \n\n * `noResultsMessage` {`string`} - \n\n * `defaultSlot` {`HTMLSlotElement`} - \n\n * `hasSlotController` - \n\n * `BUBBLES` {`boolean`} - \n\n * `COMPOSED` {`boolean`} - \n\n * `CANCELABLE` {`boolean`} - ",
2219
2219
  "attributes": [
2220
2220
  {
2221
2221
  "name": "searchEnabled",
@@ -2232,6 +2232,11 @@
2232
2232
  "description": "`showNoResults` {`boolean`} - \n\nProperty: showNoResults\n\nDefault: false",
2233
2233
  "valueSet": "v"
2234
2234
  },
2235
+ {
2236
+ "name": "allowSpaceKey",
2237
+ "description": "`allowSpaceKey` {`boolean`} - \n\nProperty: allowSpaceKey\n\nDefault: false",
2238
+ "valueSet": "v"
2239
+ },
2235
2240
  {
2236
2241
  "name": "noResultsMessage",
2237
2242
  "description": "`noResultsMessage` {`string`} - \n\nProperty: noResultsMessage\n\nDefault: No results found"