You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
8 lines
3.3 KiB
8 lines
3.3 KiB
// All material copyright Esri, All Rights Reserved, unless otherwise specified. |
|
// See https://js.arcgis.com/4.30/esri/copyright.txt for details. |
|
//>>built |
|
define(["exports","./componentsUtils","./observers","./resources3"],function(c,b,g,d){function e(){"undefined"!==typeof customElements&&["calcite-dropdown-group"].forEach(a=>{switch(a){case "calcite-dropdown-group":customElements.get(a)||customElements.define(a,f)}})}const f=b.proxyCustomElement(class extends b.H{constructor(){super();this.__registerHost();this.__attachShadow();this.calciteInternalDropdownItemChange=b.createEvent(this,"calciteInternalDropdownItemChange",6);this.updateItems=()=>{Array.from(this.el.querySelectorAll("calcite-dropdown-item")).forEach(a=> |
|
a.selectionMode=this.selectionMode)};this.mutationObserver=g.createObserver("mutation",()=>this.updateItems());this.groupTitle=void 0;this.scale="m";this.selectionMode="single"}handlePropsChange(){this.updateItems()}connectedCallback(){this.updateItems();this.mutationObserver?.observe(this.el,{childList:!0})}componentWillLoad(){this.groupPosition=this.getGroupPosition()}disconnectedCallback(){this.mutationObserver?.disconnect()}render(){const a=this.groupTitle?b.h("span",{"aria-hidden":"true",class:"dropdown-title"}, |
|
this.groupTitle):null,h=0<this.groupPosition?b.h("div",{class:"dropdown-separator",role:"separator"}):null;return b.h(b.Host,{key:"c1b662afcbb612d775cea66edb949d71f5f63167","aria-label":this.groupTitle,role:"group"},b.h("div",{key:"cdfdb0919b1b6006f69f7fbcda0c16c2beefec5e",class:{[d.CSS.container]:!0,[`${d.CSS.container}--${this.scale}`]:!0}},h,a,b.h("slot",{key:"166c8236f3315d2f038f61b0619270d2bd9b344a"})))}updateActiveItemOnChange(a){this.requestedDropdownGroup=a.detail.requestedDropdownGroup;this.requestedDropdownItem= |
|
a.detail.requestedDropdownItem;this.calciteInternalDropdownItemChange.emit({requestedDropdownGroup:this.requestedDropdownGroup,requestedDropdownItem:this.requestedDropdownItem})}getGroupPosition(){return Array.prototype.indexOf.call(this.el.parentElement.querySelectorAll("calcite-dropdown-group"),this.el)}static get delegatesFocus(){return!0}get el(){return this}static get watchers(){return{selectionMode:["handlePropsChange"]}}static get style(){return":host{position:relative;display:block}.container{text-align:start}.container--s{font-size:var(--calcite-font-size--2);line-height:1rem}.container--s .dropdown-title{padding:0.5rem}.container--m{font-size:var(--calcite-font-size--1);line-height:1rem}.container--m .dropdown-title{padding:0.75rem}.container--l{font-size:var(--calcite-font-size-0);line-height:1.25rem}.container--l .dropdown-title{padding:1rem}.dropdown-title{margin-block-end:-1px;display:block;cursor:default;overflow-wrap:break-word;border-width:0px;border-block-end-width:1px;border-style:solid;border-color:var(--calcite-color-border-3);font-weight:var(--calcite-font-weight-bold);color:var(--calcite-color-text-2)}.dropdown-separator{display:block;block-size:1px;background-color:var(--calcite-color-border-3)}:host([hidden]){display:none}[hidden]{display:none}"}}, |
|
[17,"calcite-dropdown-group",{groupTitle:[513,"group-title"],scale:[1],selectionMode:[513,"selection-mode"]},[[0,"calciteInternalDropdownItemSelect","updateActiveItemOnChange"]],{selectionMode:["handlePropsChange"]}]);e();c.CalciteDropdownGroup=f;c.defineCustomElement=e;Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})}); |