blue-web 1.17.0 → 1.17.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.
@@ -1 +1 @@
1
- (()=>{"use strict";class t extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML='<slot style="border-radius: inherit"></slot>',this.activeIndex=-1,this.items=[],this.inputElement=null}connectedCallback(){this.setAttribute("role","listbox"),this.tabIndex=-1,this.updateItems();const t=this.getAttribute("for");this.inputElement=t?document.getElementById(t):null,this.inputElement&&(this.inputElement.setAttribute("role","combobox"),this.inputElement.setAttribute("aria-controls",this.id),this.inputElement.setAttribute("aria-autocomplete","list"),this.inputElement.setAttribute("aria-expanded","true"),this.inputElement.addEventListener("keydown",this.onKeyDown.bind(this))),this.addEventListener("keydown",this.onKeyDown.bind(this)),this.addEventListener("click",(t=>{const e=t.target instanceof Element?t.target.closest("[data-blue-select-list-index]"):null;if(e&&e.hasAttribute("data-blue-select-list-index")){const t=Number(e.getAttribute("data-blue-select-list-index"));this.select(t)}}))}updateItems(){this.items=Array.from(this.children),this.items.forEach(((t,e)=>{t.hasAttribute("id")||t.setAttribute("id",`${this.id}-option-${e}`),t.setAttribute("data-blue-select-list-index",e.toString()),t.setAttribute("aria-selected","false"),t.setAttribute("role","option"),t.tabIndex=-1}))}onKeyDown(t){if(this.items.length)if("ArrowDown"===t.key)t.preventDefault(),this.activeIndex=(this.activeIndex+1)%this.items.length,this.updateActiveItem();else if("ArrowUp"===t.key)t.preventDefault(),this.activeIndex=(this.activeIndex-1+this.items.length)%this.items.length,this.updateActiveItem();else if("Enter"===t.key&&this.activeIndex>=0){const t=this.items[this.activeIndex];t?.click()}}updateActiveItem(){this.items.forEach(((t,e)=>{const i=e===this.activeIndex;t.classList.toggle("active",i),t.setAttribute("aria-selected",i.toString())}));const t=this.items[this.activeIndex];t&&this.inputElement&&(this.inputElement.setAttribute("aria-activedescendant",t.id),t.scrollIntoView({block:"nearest"}))}select(t){this.activeIndex=t,this.updateActiveItem();const e=this.items[t];e&&(this.dispatchEvent(new CustomEvent("bl-select",{detail:{index:t,item:e},bubbles:!0,composed:!0})),e.click())}}customElements.define("bl-select-list",t)})();
1
+ (()=>{"use strict";class t extends HTMLElement{constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML='<slot style="border-radius: inherit"></slot>',this.activeIndex=-1,this.items=[],this.inputElement=null}connectedCallback(){this.setAttribute("role","listbox"),this.tabIndex=-1,this.updateItems();const t=this.getAttribute("for");this.inputElement=t?document.getElementById(t):null,this.inputElement&&(this.inputElement.setAttribute("role","combobox"),this.inputElement.setAttribute("aria-controls",this.id),this.inputElement.setAttribute("aria-expanded","true"),this.inputElement.addEventListener("keydown",this.onKeyDown.bind(this))),this.addEventListener("keydown",this.onKeyDown.bind(this)),this.addEventListener("click",(t=>{const e=t.target instanceof Element?t.target.closest("[data-blue-select-list-index]"):null;if(e&&e.hasAttribute("data-blue-select-list-index")){const t=Number(e.getAttribute("data-blue-select-list-index"));this.select(t)}}))}updateItems(){this.items=Array.from(this.children),this.items.forEach(((t,e)=>{t.hasAttribute("id")||t.setAttribute("id",`${this.id}-option-${e}`),t.setAttribute("data-blue-select-list-index",e.toString()),t.setAttribute("aria-selected","false"),t.setAttribute("role","option"),t.tabIndex=-1}))}onKeyDown(t){if(console.log("select-list onKeyDown"),this.items.length)if("ArrowDown"===t.key)t.preventDefault(),this.activeIndex=(this.activeIndex+1)%this.items.length,this.updateActiveItem();else if("ArrowUp"===t.key)t.preventDefault(),this.activeIndex=(this.activeIndex-1+this.items.length)%this.items.length,this.updateActiveItem();else if("Enter"===t.key&&this.activeIndex>=0){const t=this.items[this.activeIndex];t?.click()}}updateActiveItem(){this.items.forEach(((t,e)=>{const i=e===this.activeIndex;t.classList.toggle("active",i),t.setAttribute("aria-selected",i.toString())}));const t=this.items[this.activeIndex];t&&this.inputElement&&(this.inputElement.setAttribute("aria-activedescendant",t.id),t.scrollIntoView({block:"nearest"}))}select(t){this.activeIndex=t,this.updateActiveItem();const e=this.items[t];e&&(this.dispatchEvent(new CustomEvent("bl-select",{detail:{index:t,item:e},bubbles:!0,composed:!0})),e.click())}}customElements.define("bl-select-list",t)})();
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * A Web Component that provides a keyboard-accessible selectable list, typically used for dropdowns or autocomplete lists.
3
+ * Together with `popover` and CSS Anchoring, it's also useful to create a dropdown list.
3
4
  * Supports keyboard navigation and selection, and integrates with an input element for combobox behavior.
4
5
  *
5
6
  * The Web Component will automatically set attributes for accessibility.
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * A Web Component that provides a keyboard-accessible selectable list, typically used for dropdowns or autocomplete lists.
3
+ * Together with `popover` and CSS Anchoring, it's also useful to create a dropdown list.
3
4
  * Supports keyboard navigation and selection, and integrates with an input element for combobox behavior.
4
5
  *
5
6
  * The Web Component will automatically set attributes for accessibility.
@@ -36,7 +37,6 @@ export class SelectList extends HTMLElement {
36
37
  if (this.inputElement) {
37
38
  this.inputElement.setAttribute("role", "combobox");
38
39
  this.inputElement.setAttribute("aria-controls", this.id);
39
- this.inputElement.setAttribute("aria-autocomplete", "list");
40
40
  this.inputElement.setAttribute("aria-expanded", "true");
41
41
  this.inputElement.addEventListener("keydown", this.onKeyDown.bind(this));
42
42
  }
@@ -62,6 +62,7 @@ export class SelectList extends HTMLElement {
62
62
  });
63
63
  }
64
64
  onKeyDown(e) {
65
+ console.log("select-list onKeyDown");
65
66
  if (!this.items.length) return;
66
67
  if (e.key === "ArrowDown") {
67
68
  e.preventDefault();
package/dist/merged.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Blue Web v1.17.0 (https://bruegmann.github.io/blue-web)
2
+ * Blue Web v1.17.1 (https://bruegmann.github.io/blue-web)
3
3
  * Licensed under GNU General Public License v3.0 (https://github.com/bruegmann/blue-web/blob/master/LICENSE).
4
4
  */
5
5
 
@@ -12366,6 +12366,7 @@ dialog.blue-modal:has(.offcanvas-start) {
12366
12366
  --dxbl-toolbar-btn-border-radius: var(--bs-border-radius) !important;
12367
12367
  --dxbl-dropdown-border-radius: var(--bs-border-radius) !important;
12368
12368
  --dxbl-btn-border-radius: var(--bs-border-radius) !important;
12369
+ --dxbl-context-menu-border-radius: var(--bs-border-radius) !important;
12369
12370
  --dxbl-btn-padding-x: 0.75rem !important;
12370
12371
  --dxbl-btn-padding-y: 0.375rem !important;
12371
12372
  }
@@ -12392,6 +12393,21 @@ body.modal-open .dxbl-popup-cell[style="z-index: 1050;"] {
12392
12393
  z-index: 1056 !important;
12393
12394
  }
12394
12395
 
12396
+ @if ($enable-button-pointers: false) {
12397
+ .dxbl-context-menu.dxbl-context-menu-dropdown
12398
+ > .dxbl-dropdown-body
12399
+ ul
12400
+ li:not(.dxbl-context-menu-separator)
12401
+ > .dxbl-context-menu-item,
12402
+ .dxbl-context-menu-submenu.dxbl-context-menu-dropdown
12403
+ > .dxbl-dropdown-body
12404
+ ul
12405
+ li:not(.dxbl-context-menu-separator)
12406
+ > .dxbl-context-menu-item {
12407
+ cursor: default;
12408
+ }
12409
+ }
12410
+
12395
12411
  :root {
12396
12412
  --bs-font-sans-serif: Inter, #{$font-family-sans-serif};
12397
12413
  font-feature-settings: