@tylertech/forge 2.12.0 → 2.13.0-next.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.
Files changed (80) hide show
  1. package/custom-elements.json +91 -25
  2. package/dist/esm/app-bar/help-button/index.js +1 -1
  3. package/dist/esm/app-bar/index.js +1 -1
  4. package/dist/esm/app-bar/profile-button/index.js +1 -1
  5. package/dist/esm/autocomplete/index.js +1 -1
  6. package/dist/esm/calendar/calendar-dropdown/index.js +1 -1
  7. package/dist/esm/calendar/index.js +1 -1
  8. package/dist/esm/chunks/{chunk.2VFX652S.js → chunk.2ZSAAJDN.js} +2 -2
  9. package/dist/esm/chunks/{chunk.2VFX652S.js.map → chunk.2ZSAAJDN.js.map} +0 -0
  10. package/dist/esm/chunks/{chunk.KKF2ZZMD.js → chunk.32SMESZX.js} +2 -2
  11. package/dist/esm/chunks/{chunk.KKF2ZZMD.js.map → chunk.32SMESZX.js.map} +0 -0
  12. package/dist/esm/chunks/chunk.3UMBCR4P.js +7 -0
  13. package/dist/esm/chunks/chunk.3UMBCR4P.js.map +7 -0
  14. package/dist/esm/chunks/{chunk.OPTMTRWL.js → chunk.4T5TGQFG.js} +2 -2
  15. package/dist/esm/chunks/{chunk.OPTMTRWL.js.map → chunk.4T5TGQFG.js.map} +0 -0
  16. package/dist/esm/chunks/{chunk.77FVTUTL.js → chunk.5D6UB4DL.js} +2 -2
  17. package/dist/esm/chunks/{chunk.77FVTUTL.js.map → chunk.5D6UB4DL.js.map} +0 -0
  18. package/dist/esm/chunks/{chunk.4HI4HGZ6.js → chunk.CYJBOJMX.js} +2 -2
  19. package/dist/esm/chunks/{chunk.4HI4HGZ6.js.map → chunk.CYJBOJMX.js.map} +0 -0
  20. package/dist/esm/chunks/{chunk.CVJTQY2T.js → chunk.E4ZTNVXI.js} +2 -2
  21. package/dist/esm/chunks/{chunk.CVJTQY2T.js.map → chunk.E4ZTNVXI.js.map} +0 -0
  22. package/dist/esm/chunks/{chunk.4WFU5CVF.js → chunk.F3W3XMGT.js} +2 -2
  23. package/dist/esm/chunks/{chunk.4WFU5CVF.js.map → chunk.F3W3XMGT.js.map} +0 -0
  24. package/dist/esm/chunks/{chunk.7TKJAZTM.js → chunk.G5Q2CUUE.js} +2 -2
  25. package/dist/esm/chunks/{chunk.7TKJAZTM.js.map → chunk.G5Q2CUUE.js.map} +0 -0
  26. package/dist/esm/chunks/{chunk.23VA56ZY.js → chunk.J3NHIF6W.js} +2 -2
  27. package/dist/esm/chunks/{chunk.23VA56ZY.js.map → chunk.J3NHIF6W.js.map} +0 -0
  28. package/dist/esm/chunks/{chunk.ZHXPL2MS.js → chunk.JB2N65SR.js} +2 -2
  29. package/dist/esm/chunks/{chunk.ZHXPL2MS.js.map → chunk.JB2N65SR.js.map} +0 -0
  30. package/dist/esm/chunks/{chunk.YX5SWK3O.js → chunk.K32ME33N.js} +2 -2
  31. package/dist/esm/chunks/{chunk.YX5SWK3O.js.map → chunk.K32ME33N.js.map} +0 -0
  32. package/dist/esm/chunks/{chunk.QBDE7M3E.js → chunk.KGW63HJX.js} +2 -2
  33. package/dist/esm/chunks/{chunk.QBDE7M3E.js.map → chunk.KGW63HJX.js.map} +0 -0
  34. package/dist/esm/chunks/{chunk.UHVCXKB4.js → chunk.NTFA7FCB.js} +2 -2
  35. package/dist/esm/chunks/{chunk.UHVCXKB4.js.map → chunk.NTFA7FCB.js.map} +0 -0
  36. package/dist/esm/chunks/{chunk.7PHGAX6P.js → chunk.PFD2SVJ4.js} +2 -2
  37. package/dist/esm/chunks/{chunk.7PHGAX6P.js.map → chunk.PFD2SVJ4.js.map} +0 -0
  38. package/dist/esm/chunks/{chunk.SVHVGMKS.js → chunk.RKKJB3EE.js} +2 -2
  39. package/dist/esm/chunks/{chunk.SVHVGMKS.js.map → chunk.RKKJB3EE.js.map} +0 -0
  40. package/dist/esm/chunks/{chunk.K6LZM6DS.js → chunk.SZL74RTY.js} +2 -2
  41. package/dist/esm/chunks/{chunk.K6LZM6DS.js.map → chunk.SZL74RTY.js.map} +0 -0
  42. package/dist/esm/chunks/{chunk.ZFUVXYDL.js → chunk.TCCPCDJK.js} +2 -2
  43. package/dist/esm/chunks/{chunk.ZFUVXYDL.js.map → chunk.TCCPCDJK.js.map} +0 -0
  44. package/dist/esm/chunks/{chunk.WALEAV54.js → chunk.VH3PVW2V.js} +2 -2
  45. package/dist/esm/chunks/{chunk.WALEAV54.js.map → chunk.VH3PVW2V.js.map} +0 -0
  46. package/dist/esm/chunks/chunk.VQKRN5IQ.js +7 -0
  47. package/dist/esm/chunks/chunk.VQKRN5IQ.js.map +7 -0
  48. package/dist/esm/chunks/{chunk.SLZFPWOH.js → chunk.WUIIZZQD.js} +2 -2
  49. package/dist/esm/chunks/{chunk.SLZFPWOH.js.map → chunk.WUIIZZQD.js.map} +0 -0
  50. package/dist/esm/chunks/{chunk.7GTCDP5H.js → chunk.YK2PXI6D.js} +2 -2
  51. package/dist/esm/chunks/{chunk.7GTCDP5H.js.map → chunk.YK2PXI6D.js.map} +1 -1
  52. package/dist/esm/date-picker/index.js +1 -1
  53. package/dist/esm/date-range-picker/index.js +1 -1
  54. package/dist/esm/dialog/index.js +1 -1
  55. package/dist/esm/index.js +1 -1
  56. package/dist/esm/list-dropdown/index.js +1 -1
  57. package/dist/esm/menu/index.js +1 -1
  58. package/dist/esm/paginator/index.js +1 -1
  59. package/dist/esm/popup/index.js +1 -1
  60. package/dist/esm/select/core/index.js +1 -1
  61. package/dist/esm/select/index.js +1 -1
  62. package/dist/esm/select/select/index.js +1 -1
  63. package/dist/esm/select/select-dropdown/index.js +1 -1
  64. package/dist/esm/split-view/index.js +1 -1
  65. package/dist/esm/split-view/split-view/index.js +1 -1
  66. package/dist/esm/split-view/split-view-panel/index.js +1 -1
  67. package/dist/esm/time-picker/index.js +1 -1
  68. package/esm/dialog/dialog-adapter.d.ts +5 -5
  69. package/esm/dialog/dialog-adapter.js +30 -31
  70. package/esm/dialog/dialog-foundation.d.ts +4 -2
  71. package/esm/dialog/dialog-foundation.js +55 -38
  72. package/esm/dialog/dialog.d.ts +4 -0
  73. package/esm/dialog/dialog.js +7 -1
  74. package/esm/popup/popup-adapter.js +5 -0
  75. package/esm/split-view/split-view-panel/split-view-panel.js +1 -1
  76. package/package.json +1 -1
  77. package/dist/esm/chunks/chunk.DRFU6POI.js +0 -7
  78. package/dist/esm/chunks/chunk.DRFU6POI.js.map +0 -7
  79. package/dist/esm/chunks/chunk.YSE5EMB3.js +0 -7
  80. package/dist/esm/chunks/chunk.YSE5EMB3.js.map +0 -7
@@ -3,5 +3,5 @@
3
3
  * Copyright 2022 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{a as k}from"./chunk.4WFU5CVF.js";import{e as B,h as H,j as F}from"./chunk.QBDE7M3E.js";import{c as x}from"./chunk.D3DLVPPE.js";import{a as v,b as N}from"./chunk.7JTKKFL4.js";import{d as U}from"./chunk.K753A3KI.js";import{b as P}from"./chunk.XYBFFTXS.js";import{e as V}from"./chunk.DRFU6POI.js";import{d as w}from"./chunk.LZMYHIO2.js";import{d as A}from"./chunk.YAJT3P6V.js";import{a as T}from"./chunk.A23NSEWA.js";import{a}from"./chunk.B3IJU6XJ.js";import{a as D,b as m,d as y}from"./chunk.BSZ2LBJX.js";import{a as C,e as S}from"./chunk.HN4PXH3D.js";import{l as L}from"./chunk.R4NDFXVA.js";import{a as O,b as M,i as I,k as _}from"./chunk.G76HB2FK.js";import{a as c,b as g,f as r}from"./chunk.MCIQXNKY.js";var l=`${m}menu`,K={POPUP:"forge-menu__popup",MENU:"mdc-menu"},R={TOGGLE:`.${m}menu__toggle, [${l}-toggle], button, [type=button]`,MENU_LIST:"forge-list"},G={OPEN:"open",PLACEMENT:"placement",SELECTED_INDEX:"selected-index",SELECTED_VALUE:"selected-value",DENSE:"dense",ICON_CLASS:"icon-class",PERSIST_SELECTION:"persist-selection",MODE:"mode",SYNC_POPUP_WIDTH:"sync-popup-width",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold"},$={SELECT:`${l}-select`,OPEN:`${l}-open`,CLOSE:`${l}-close`,ACTIVE_CHANGE:`${l}-active-change`},z={CHILD_MOUSE_LEAVE_TIMEOUT:300,POPUP_MOUSE_LEAVE_TIMEOUT:500},i={elementName:l,classes:K,selectors:R,attributes:G,events:$,numbers:z};var u=class extends T{constructor(e){super(e);this._childMenus=new Map}getDropdownElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}hasTargetElement(){return!!this._targetElement}initializeTarget(){this._targetElement=this._component.querySelector(i.selectors.TOGGLE),this._targetElement||(this._targetElement=this._component.firstElementChild)}initializeAccessibility(e){!this._targetElement||(this._targetElement.setAttribute("aria-atomic","true"),this._targetElement.setAttribute("aria-live","assertive"),this._targetElement.setAttribute("aria-haspopup","true"),this._targetElement.setAttribute("aria-expanded","false"),this._targetElement.hasAttribute("aria-label")||this._targetElement.setAttribute("aria-label",this._targetElement.textContent||""))}addTargetListener(e,t,n=!1){this._targetElement&&this._targetElement.addEventListener(e,t,n)}removeTargetListener(e,t){this._targetElement&&this._targetElement.removeEventListener(e,t)}attachMenu(e){this._listDropdown||!this._targetElement||(this._listDropdown=new H(this._targetElement,e),this._listDropdown.open(),this._targetElement.setAttribute("aria-expanded","true"),this._targetElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`))}setOptions(e){this._listDropdown&&this._listDropdown.setOptions(e)}detachMenu(){this._targetElement&&(this._targetElement.removeAttribute("aria-activedescendant"),this._targetElement.removeAttribute("aria-expanded"),this._targetElement.removeAttribute("aria-controls")),this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0)}setActiveOption(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:-1}focusTarget(){this._targetElement&&this._targetElement.focus()}isTargetFocused(){return document.activeElement===this._targetElement}updateActiveDescendant(e){!this._targetElement||(e?this._targetElement.setAttribute("aria-activedescendant",e):this._targetElement.removeAttribute("aria-activedescendant"))}addDropdownListener(e,t){!this._listDropdown||!this._listDropdown.dropdownElement||this._listDropdown.dropdownElement.addEventListener(e,t)}isOwnElement(e){return!this._targetElement||!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._targetElement.contains(e)||!!this._listDropdown.dropdownElement.contains(e)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}proxyKeyboardEventToChild(e,t){if(!this.getDropdownElement())return;let n=this._getOpenChildMenu(t);n&&n.propagateKeyEvent(e)}toggleChildMenu(e,t){let p=this._getListItems()[e].parentElement;p&&p.tagName.toLowerCase()===i.elementName&&(t===void 0?p.open=!p.open:p.open=t)}createChildMenu(e,t,n,o,p){let d=document.createElement("forge-menu");return d.style.display="block",d.addEventListener(i.events.OPEN,()=>{this._childMenus.set(e,d),n(e)}),d.addEventListener(i.events.CLOSE,()=>{this._childMenus.delete(e),o(e)}),d.addEventListener(i.events.SELECT,b=>{b.stopPropagation(),p(g(c({},b.detail),{parentValue:t}))}),d}closeOtherChildMenus(e){let t=[];this._childMenus.forEach((n,o)=>{o!==e&&(n.open=!1,t.push(o))}),t.forEach(n=>this._childMenus.delete(n))}setSelectedValues(e){var t;(t=this._listDropdown)==null||t.setSelectedValues(e)}_getOpenChildMenu(e){if(!this.getDropdownElement())return null;let t=this._getOwnList(e);return t?t.querySelector(`${i.elementName}[${i.attributes.OPEN}]`):null}_getOwnList(e){let t=this.getDropdownElement();return t?t.querySelector(`${v.elementName}[id="list-dropdown-list-${e}"]`):null}_getListItems(){let e=this.getDropdownElement();if(!e)return[];let t=e.querySelector(v.elementName);return t?Array.from(t.querySelectorAll(N.elementName)):[]}};var h=class extends F{constructor(e){super({popupTimeout:i.numbers.POPUP_MOUSE_LEAVE_TIMEOUT,targetTimeout:i.numbers.CHILD_MOUSE_LEAVE_TIMEOUT});this._adapter=e;this._placement="bottom-start";this._dense=!1;this._iconClass=y;this._persistSelection=!1;this._mode="click";this._identifier=O(),this._clickListener=t=>this._onTargetClick(t),this._blurListener=t=>this._onTargetBlur(t),this._selectListener=t=>this._handleSelectEvent(t),this._keydownListener=t=>this.onKeydown(t),this._activeChangeListener=t=>this._onActiveOptionChanged(t)}initialize(){this._adapter.initializeTarget(),this._adapter.initializeAccessibility(this._identifier),this._initializeInteractionListeners()}disconnect(){this._open&&this._closeDropdown(),this._destroyInteractionListeners()}_applyMode(){!this._adapter.hasTargetElement()||(this._mode!=="cascade"?this._adapter.addTargetListener("click",this._clickListener):this._attachCascadingListeners())}_initializeInteractionListeners(){!this._adapter.hasTargetElement()||(this._applyMode(),this._adapter.addTargetListener("keydown",this._keydownListener,!0),this._adapter.addTargetListener("blur",this._blurListener))}_destroyInteractionListeners(){!this._adapter.hasTargetElement()||(this._adapter.removeTargetListener("keydown",this._clickListener),this._adapter.removeTargetListener("blur",this._blurListener),this._adapter.removeTargetListener("click",this._clickListener),this._detachCascadingListeners())}_attachCascadingListeners(){this._adapter.addTargetListener("mouseenter",this._targetMouseEnterListener),this._adapter.addTargetListener("mouseleave",this._targetMouseLeaveListener),this._adapter.addDocumentListener("mousemove",this._documentMouseMoveListener)}_detachCascadingListeners(){this._adapter.removeTargetListener("mouseenter",this._targetMouseEnterListener),this._adapter.removeTargetListener("mouseleave",this._targetMouseLeaveListener),this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener)}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}get _flatOptions(){return B(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onTargetClick(e){if(this._open){this._closeDropdown();return}this.open=!this._open,this._open&&this._adapter.focusTarget()}_onTargetBlur(e){this._open&&this._closeDropdown()}_onActiveOptionChanged(e){let t={id:e},n=this._adapter.emitHostEvent(i.events.ACTIVE_CHANGE,t,!0,!0);this._mode!=="cascade"&&n&&this._adapter.updateActiveDescendant(e)}onKeydown(e){if(this._childOpen){if(e.code==="Escape"){e.preventDefault(),this._adapter.closeOtherChildMenus(),this._closeDropdown();return}this._adapter.proxyKeyboardEventToChild(e,this._identifier);return}switch(e.code){case"Tab":this._open&&this._selectActiveOption();break;case"Escape":this._open&&(e.preventDefault(),this._closeDropdown());break;case"Space":e.preventDefault(),this._open?this._closeDropdown():this._openDropdown();break;case"Home":case"End":this._open&&(e.preventDefault(),this._adapter.propagateKey(e.code));break;case"Enter":if(!this._open)return;e.stopImmediatePropagation(),e.preventDefault(),this._adapter.propagateKey(e.code);let t=this._adapter.getActiveOptionIndex(),n=this._nonDividerOptions[t];n&&n.options&&n.options.length&&this._adapter.toggleChildMenu(t);break;case"ArrowUp":case"ArrowDown":if(this._open&&e.stopImmediatePropagation(),e.preventDefault(),!this._open&&e.code==="ArrowDown"){this._openDropdown(),this._adapter.activateFirstOption();return}this._adapter.propagateKey(e.code);break;case"ArrowLeft":this._open&&e.stopImmediatePropagation(),this._mode==="cascade"&&this._open&&this._closeDropdown();break;case"ArrowRight":if(this._open&&e.stopImmediatePropagation(),!this._open)return;let o=this._adapter.getActiveOptionIndex(),p=this._nonDividerOptions[o];if(p&&p.options){this._adapter.toggleChildMenu(o,e.code==="ArrowRight");return}break}}async _openMenu(){this._open=!0;let e=[];if(typeof this._optionsFactory=="function")this._loadOptionsAsync(),this._options=[];else{if(!this._options||!this._options.length)return;e=this._options}this._persistSelection||e.forEach(o=>o.selected=!1),this._mapIconToLeadingIcon();let t=this._persistSelection?this._getSelectedValues():[],n={id:this._identifier,type:"menu",options:this._options,selectedValues:t,iconClass:this._iconClass,dense:this._dense,multiple:!1,popupStatic:!0,allowBusy:!0,asyncStyle:"spinner",optionBuilder:this._optionBuilder,optionLimit:this._optionLimit,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,popupPlacement:this._placement,activeStartIndex:this._mode==="cascade"?0:void 0,popupClasses:[i.classes.POPUP,i.classes.MENU,...this._popupClasses],syncWidth:this._syncPopupWidth,activeChangeCallback:this._activeChangeListener,selectCallback:this._selectListener,popupOffset:this._popupOffset,cascadingElementFactory:o=>this._createCascadingElement(o)};this._adapter.setHostAttribute(i.attributes.OPEN,""),this._adapter.attachMenu(n),this._mode==="cascade"&&(this._adapter.addDropdownListener("mouseenter",this._childPopupMouseEnterListener),this._adapter.addDropdownListener("mouseleave",this._childPopupMouseLeaveListener)),this._adapter.addDropdownListener(i.events.ACTIVE_CHANGE,o=>{this._onActiveOptionChanged(o.detail.id)}),this._adapter.emitHostEvent(i.events.OPEN)}_closeMenu(){this._open=!1,this._childOpen=!1,this._adapter.detachMenu(),this._activeMouseLeaveTimeout!==void 0&&window.clearTimeout(this._activeMouseLeaveTimeout),this._adapter.removeHostAttribute(i.attributes.OPEN),this._adapter.emitHostEvent(i.events.CLOSE)}_loadOptionsAsync(){return this._optionsFactory?Promise.resolve(this._optionsFactory()).then(e=>{if(this._persistSelection||e.forEach(t=>t.selected=!1),this._open)if(e&&I(e)&&e.length){this._options=e,this._adapter.setOptions(e);let t=this._getSelectedValues();t.length&&this._adapter.setSelectedValues(t)}else this._open&&this._closeDropdown()}).catch(e=>{console.error("An unexpected error ocurred while opening the menu:",e),this._open&&this._closeDropdown()}):(this._open&&this._closeMenu(),Promise.resolve())}_handleSelectEvent(e){let t=this._nonDividerOptions.findIndex(n=>n.value===e);t<0||this._selectOptionByIndex(t)}_selectActiveOption(){let e=this._adapter.getActiveOptionIndex();e>=0&&this._nonDividerOptions[e]&&this._selectOptionByIndex(e)}_selectOptionByIndex(e){let{options:t,value:n}=this._nonDividerOptions[e];if(t){this._adapter.setActiveOption(e);return}this._closeDropdown();let o={index:e,value:n};!this._adapter.emitHostEvent(i.events.SELECT,o,!0,!0)||(this._selectedValue=this._persistSelection?n:void 0)}_getSelectedValues(){let e=this._flatOptions.filter(t=>t.selected).map(t=>t.value);return this._selectedValue!==void 0&&e.push(this._selectedValue),e}_onCascadingOptionSelected(e){this._persistSelection&&(this._selectedValue=e.value),this._adapter.emitHostEvent(i.events.SELECT,e),this._closeDropdown()}_onCascadingChildOpen(e){super._clearMouseLeaveTimeout(),this._adapter.closeOtherChildMenus(e),this._childOpen=!0,this._adapter.setActiveOption(e)}_onCascadingChildClose(){this._childOpen=!1}_closeDropdown(){this._closeMenu()}_openDropdown(){this._openMenu()}_isOwnElement(e){return this._adapter.isOwnElement(e)}_createCascadingElement({index:e,options:t,parentValue:n}){let o=this._adapter.createChildMenu(e,n,this._onCascadingChildOpen.bind(this),this._onCascadingChildClose.bind(this),this._onCascadingOptionSelected.bind(this));return o.mode="cascade",o.popupOffset={x:0,y:-8},o.dense=this._dense,o.placement="right-start",o.persistSelection=this._persistSelection,this._persistSelection&&(o.selectedValue=this._selectedValue),o.options=t,o.optionBuilder=this._optionBuilder,o.iconClass=this._iconClass,o}_mapIconToLeadingIcon(){this._flatOptions.filter(e=>e.icon).forEach(e=>e.leadingIcon=e.icon)}get open(){return this._open}set open(e){e=Boolean(e),this._open!==e&&(this._open=e,e?this._openDropdown():this._closeDropdown())}set options(e){if(typeof e=="function")this.optionsFactory=e;else if(this.optionsFactory=void 0,this._options=e.map(t=>c({},t)),this._open&&(this._mapIconToLeadingIcon(),this._adapter.setOptions(this._options),this._persistSelection)){let t=this._getSelectedValues();t.length&&this._adapter.setSelectedValues(t)}}get options(){return this._options?this._flatOptions.map(e=>c({},e)):[]}set optionsFactory(e){this._optionsFactory=e}set selectedIndex(e){let t=this._nonDividerOptions[e];t&&t.value!==this._selectedValue&&(this.selectedValue=t.value)}get selectedIndex(){return this._selectedValue!==void 0?this._nonDividerOptions.findIndex(e=>e.value===this._selectedValue):-1}set selectedValue(e){this._selectedValue!==e&&(this._selectedValue=e,this._adapter.setSelectedValues(this._selectedValue))}get selectedValue(){return this._selectedValue}get placement(){return this._placement}set placement(e){this._placement!==e&&(this._placement=e||"bottom-start",this._adapter.setHostAttribute(i.attributes.PLACEMENT,this._placement))}get dense(){return this._dense}set dense(e){this._dense=e}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass=e}get persistSelection(){return this._persistSelection}set persistSelection(e){this._persistSelection!==e&&(this._persistSelection=e,this._adapter.toggleHostAttribute(i.attributes.PERSIST_SELECTION,this._persistSelection),this._persistSelection||(this._flatOptions.forEach(t=>t.selected=!1),this._selectedValue=void 0))}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._destroyInteractionListeners(),this._applyMode(),this._adapter.setHostAttribute(i.attributes.MODE,this._mode))}get popupOffset(){return this._popupOffset}set popupOffset(e){this._popupOffset=e}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get popupElement(){return this._adapter.getDropdownElement()}};var q="<template><slot></slot></template>",W=":host{display:inline-block}:host([hidden]){display:none}",s=class extends k{constructor(){super();A.define(w),this._foundation=new h(new u(this)),S(this,q,W)}static get observedAttributes(){return[i.attributes.OPEN,i.attributes.PLACEMENT,i.attributes.SELECTED_INDEX,i.attributes.SELECTED_VALUE,i.attributes.DENSE,i.attributes.ICON_CLASS,i.attributes.PERSIST_SELECTION,i.attributes.MODE,i.attributes.SYNC_POPUP_WIDTH,i.attributes.POPUP_CLASSES,i.attributes.OPTION_LIMIT,i.attributes.OBSERVE_SCROLL,i.attributes.OBSERVE_SCROLL_THRESHOLD]}connectedCallback(){this.children.length?this._foundation.initialize():L(this).then(()=>this._foundation.initialize())}attributeChangedCallback(e,t,n){switch(super.attributeChangedCallback(e,t,n),e){case i.attributes.OPEN:this._foundation.open=M(n);break;case i.attributes.PLACEMENT:this._foundation.placement=n;break;case i.attributes.SELECTED_INDEX:this._foundation.selectedIndex=Number(n);break;case i.attributes.SELECTED_VALUE:this._foundation.selectedValue=n;break;case i.attributes.DENSE:this._foundation.dense=_(n);break;case i.attributes.ICON_CLASS:this._foundation.iconClass=n;break;case i.attributes.PERSIST_SELECTION:this.persistSelection=_(n);break;case i.attributes.MODE:this.mode=n;break}}disconnectedCallback(){this._foundation.disconnect()}propagateKeyEvent(e){this._foundation.onKeydown(e)}};r([a()],s.prototype,"open",2),r([a()],s.prototype,"options",2),r([a()],s.prototype,"selectedIndex",2),r([a()],s.prototype,"selectedValue",2),r([a()],s.prototype,"placement",2),r([a()],s.prototype,"dense",2),r([a()],s.prototype,"iconClass",2),r([a()],s.prototype,"persistSelection",2),r([a()],s.prototype,"mode",2),r([a()],s.prototype,"popupOffset",2),r([a()],s.prototype,"optionBuilder",2),r([a({set:!1})],s.prototype,"popupElement",2),s=r([D({name:i.elementName,dependencies:[V,x,U,P]})],s);function Ye(){C(s)}export{i as a,u as b,h as c,s as d,Ye as e};
7
- //# sourceMappingURL=chunk.K6LZM6DS.js.map
6
+ import{a as k}from"./chunk.F3W3XMGT.js";import{e as B,h as H,j as F}from"./chunk.KGW63HJX.js";import{c as x}from"./chunk.D3DLVPPE.js";import{a as v,b as N}from"./chunk.7JTKKFL4.js";import{d as U}from"./chunk.K753A3KI.js";import{b as P}from"./chunk.XYBFFTXS.js";import{e as V}from"./chunk.3UMBCR4P.js";import{d as w}from"./chunk.LZMYHIO2.js";import{d as A}from"./chunk.YAJT3P6V.js";import{a as T}from"./chunk.A23NSEWA.js";import{a}from"./chunk.B3IJU6XJ.js";import{a as D,b as m,d as y}from"./chunk.BSZ2LBJX.js";import{a as C,e as S}from"./chunk.HN4PXH3D.js";import{l as L}from"./chunk.R4NDFXVA.js";import{a as O,b as M,i as I,k as _}from"./chunk.G76HB2FK.js";import{a as c,b as g,f as r}from"./chunk.MCIQXNKY.js";var l=`${m}menu`,K={POPUP:"forge-menu__popup",MENU:"mdc-menu"},R={TOGGLE:`.${m}menu__toggle, [${l}-toggle], button, [type=button]`,MENU_LIST:"forge-list"},G={OPEN:"open",PLACEMENT:"placement",SELECTED_INDEX:"selected-index",SELECTED_VALUE:"selected-value",DENSE:"dense",ICON_CLASS:"icon-class",PERSIST_SELECTION:"persist-selection",MODE:"mode",SYNC_POPUP_WIDTH:"sync-popup-width",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold"},$={SELECT:`${l}-select`,OPEN:`${l}-open`,CLOSE:`${l}-close`,ACTIVE_CHANGE:`${l}-active-change`},z={CHILD_MOUSE_LEAVE_TIMEOUT:300,POPUP_MOUSE_LEAVE_TIMEOUT:500},i={elementName:l,classes:K,selectors:R,attributes:G,events:$,numbers:z};var u=class extends T{constructor(e){super(e);this._childMenus=new Map}getDropdownElement(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.dropdownElement)!=null?t:null}hasTargetElement(){return!!this._targetElement}initializeTarget(){this._targetElement=this._component.querySelector(i.selectors.TOGGLE),this._targetElement||(this._targetElement=this._component.firstElementChild)}initializeAccessibility(e){!this._targetElement||(this._targetElement.setAttribute("aria-atomic","true"),this._targetElement.setAttribute("aria-live","assertive"),this._targetElement.setAttribute("aria-haspopup","true"),this._targetElement.setAttribute("aria-expanded","false"),this._targetElement.hasAttribute("aria-label")||this._targetElement.setAttribute("aria-label",this._targetElement.textContent||""))}addTargetListener(e,t,n=!1){this._targetElement&&this._targetElement.addEventListener(e,t,n)}removeTargetListener(e,t){this._targetElement&&this._targetElement.removeEventListener(e,t)}attachMenu(e){this._listDropdown||!this._targetElement||(this._listDropdown=new H(this._targetElement,e),this._listDropdown.open(),this._targetElement.setAttribute("aria-expanded","true"),this._targetElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`))}setOptions(e){this._listDropdown&&this._listDropdown.setOptions(e)}detachMenu(){this._targetElement&&(this._targetElement.removeAttribute("aria-activedescendant"),this._targetElement.removeAttribute("aria-expanded"),this._targetElement.removeAttribute("aria-controls")),this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0)}setActiveOption(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:-1}focusTarget(){this._targetElement&&this._targetElement.focus()}isTargetFocused(){return document.activeElement===this._targetElement}updateActiveDescendant(e){!this._targetElement||(e?this._targetElement.setAttribute("aria-activedescendant",e):this._targetElement.removeAttribute("aria-activedescendant"))}addDropdownListener(e,t){!this._listDropdown||!this._listDropdown.dropdownElement||this._listDropdown.dropdownElement.addEventListener(e,t)}isOwnElement(e){return!this._targetElement||!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._targetElement.contains(e)||!!this._listDropdown.dropdownElement.contains(e)}propagateKey(e){var t;(t=this._listDropdown)==null||t.handleKey(e)}proxyKeyboardEventToChild(e,t){if(!this.getDropdownElement())return;let n=this._getOpenChildMenu(t);n&&n.propagateKeyEvent(e)}toggleChildMenu(e,t){let p=this._getListItems()[e].parentElement;p&&p.tagName.toLowerCase()===i.elementName&&(t===void 0?p.open=!p.open:p.open=t)}createChildMenu(e,t,n,o,p){let d=document.createElement("forge-menu");return d.style.display="block",d.addEventListener(i.events.OPEN,()=>{this._childMenus.set(e,d),n(e)}),d.addEventListener(i.events.CLOSE,()=>{this._childMenus.delete(e),o(e)}),d.addEventListener(i.events.SELECT,b=>{b.stopPropagation(),p(g(c({},b.detail),{parentValue:t}))}),d}closeOtherChildMenus(e){let t=[];this._childMenus.forEach((n,o)=>{o!==e&&(n.open=!1,t.push(o))}),t.forEach(n=>this._childMenus.delete(n))}setSelectedValues(e){var t;(t=this._listDropdown)==null||t.setSelectedValues(e)}_getOpenChildMenu(e){if(!this.getDropdownElement())return null;let t=this._getOwnList(e);return t?t.querySelector(`${i.elementName}[${i.attributes.OPEN}]`):null}_getOwnList(e){let t=this.getDropdownElement();return t?t.querySelector(`${v.elementName}[id="list-dropdown-list-${e}"]`):null}_getListItems(){let e=this.getDropdownElement();if(!e)return[];let t=e.querySelector(v.elementName);return t?Array.from(t.querySelectorAll(N.elementName)):[]}};var h=class extends F{constructor(e){super({popupTimeout:i.numbers.POPUP_MOUSE_LEAVE_TIMEOUT,targetTimeout:i.numbers.CHILD_MOUSE_LEAVE_TIMEOUT});this._adapter=e;this._placement="bottom-start";this._dense=!1;this._iconClass=y;this._persistSelection=!1;this._mode="click";this._identifier=O(),this._clickListener=t=>this._onTargetClick(t),this._blurListener=t=>this._onTargetBlur(t),this._selectListener=t=>this._handleSelectEvent(t),this._keydownListener=t=>this.onKeydown(t),this._activeChangeListener=t=>this._onActiveOptionChanged(t)}initialize(){this._adapter.initializeTarget(),this._adapter.initializeAccessibility(this._identifier),this._initializeInteractionListeners()}disconnect(){this._open&&this._closeDropdown(),this._destroyInteractionListeners()}_applyMode(){!this._adapter.hasTargetElement()||(this._mode!=="cascade"?this._adapter.addTargetListener("click",this._clickListener):this._attachCascadingListeners())}_initializeInteractionListeners(){!this._adapter.hasTargetElement()||(this._applyMode(),this._adapter.addTargetListener("keydown",this._keydownListener,!0),this._adapter.addTargetListener("blur",this._blurListener))}_destroyInteractionListeners(){!this._adapter.hasTargetElement()||(this._adapter.removeTargetListener("keydown",this._clickListener),this._adapter.removeTargetListener("blur",this._blurListener),this._adapter.removeTargetListener("click",this._clickListener),this._detachCascadingListeners())}_attachCascadingListeners(){this._adapter.addTargetListener("mouseenter",this._targetMouseEnterListener),this._adapter.addTargetListener("mouseleave",this._targetMouseLeaveListener),this._adapter.addDocumentListener("mousemove",this._documentMouseMoveListener)}_detachCascadingListeners(){this._adapter.removeTargetListener("mouseenter",this._targetMouseEnterListener),this._adapter.removeTargetListener("mouseleave",this._targetMouseLeaveListener),this._adapter.removeDocumentListener("mousemove",this._documentMouseMoveListener)}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}get _flatOptions(){return B(this._options,1)?this._options.reduce((e,t)=>e.concat(t.options),[]):this._options}_onTargetClick(e){if(this._open){this._closeDropdown();return}this.open=!this._open,this._open&&this._adapter.focusTarget()}_onTargetBlur(e){this._open&&this._closeDropdown()}_onActiveOptionChanged(e){let t={id:e},n=this._adapter.emitHostEvent(i.events.ACTIVE_CHANGE,t,!0,!0);this._mode!=="cascade"&&n&&this._adapter.updateActiveDescendant(e)}onKeydown(e){if(this._childOpen){if(e.code==="Escape"){e.preventDefault(),this._adapter.closeOtherChildMenus(),this._closeDropdown();return}this._adapter.proxyKeyboardEventToChild(e,this._identifier);return}switch(e.code){case"Tab":this._open&&this._selectActiveOption();break;case"Escape":this._open&&(e.preventDefault(),this._closeDropdown());break;case"Space":e.preventDefault(),this._open?this._closeDropdown():this._openDropdown();break;case"Home":case"End":this._open&&(e.preventDefault(),this._adapter.propagateKey(e.code));break;case"Enter":if(!this._open)return;e.stopImmediatePropagation(),e.preventDefault(),this._adapter.propagateKey(e.code);let t=this._adapter.getActiveOptionIndex(),n=this._nonDividerOptions[t];n&&n.options&&n.options.length&&this._adapter.toggleChildMenu(t);break;case"ArrowUp":case"ArrowDown":if(this._open&&e.stopImmediatePropagation(),e.preventDefault(),!this._open&&e.code==="ArrowDown"){this._openDropdown(),this._adapter.activateFirstOption();return}this._adapter.propagateKey(e.code);break;case"ArrowLeft":this._open&&e.stopImmediatePropagation(),this._mode==="cascade"&&this._open&&this._closeDropdown();break;case"ArrowRight":if(this._open&&e.stopImmediatePropagation(),!this._open)return;let o=this._adapter.getActiveOptionIndex(),p=this._nonDividerOptions[o];if(p&&p.options){this._adapter.toggleChildMenu(o,e.code==="ArrowRight");return}break}}async _openMenu(){this._open=!0;let e=[];if(typeof this._optionsFactory=="function")this._loadOptionsAsync(),this._options=[];else{if(!this._options||!this._options.length)return;e=this._options}this._persistSelection||e.forEach(o=>o.selected=!1),this._mapIconToLeadingIcon();let t=this._persistSelection?this._getSelectedValues():[],n={id:this._identifier,type:"menu",options:this._options,selectedValues:t,iconClass:this._iconClass,dense:this._dense,multiple:!1,popupStatic:!0,allowBusy:!0,asyncStyle:"spinner",optionBuilder:this._optionBuilder,optionLimit:this._optionLimit,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,popupPlacement:this._placement,activeStartIndex:this._mode==="cascade"?0:void 0,popupClasses:[i.classes.POPUP,i.classes.MENU,...this._popupClasses],syncWidth:this._syncPopupWidth,activeChangeCallback:this._activeChangeListener,selectCallback:this._selectListener,popupOffset:this._popupOffset,cascadingElementFactory:o=>this._createCascadingElement(o)};this._adapter.setHostAttribute(i.attributes.OPEN,""),this._adapter.attachMenu(n),this._mode==="cascade"&&(this._adapter.addDropdownListener("mouseenter",this._childPopupMouseEnterListener),this._adapter.addDropdownListener("mouseleave",this._childPopupMouseLeaveListener)),this._adapter.addDropdownListener(i.events.ACTIVE_CHANGE,o=>{this._onActiveOptionChanged(o.detail.id)}),this._adapter.emitHostEvent(i.events.OPEN)}_closeMenu(){this._open=!1,this._childOpen=!1,this._adapter.detachMenu(),this._activeMouseLeaveTimeout!==void 0&&window.clearTimeout(this._activeMouseLeaveTimeout),this._adapter.removeHostAttribute(i.attributes.OPEN),this._adapter.emitHostEvent(i.events.CLOSE)}_loadOptionsAsync(){return this._optionsFactory?Promise.resolve(this._optionsFactory()).then(e=>{if(this._persistSelection||e.forEach(t=>t.selected=!1),this._open)if(e&&I(e)&&e.length){this._options=e,this._adapter.setOptions(e);let t=this._getSelectedValues();t.length&&this._adapter.setSelectedValues(t)}else this._open&&this._closeDropdown()}).catch(e=>{console.error("An unexpected error ocurred while opening the menu:",e),this._open&&this._closeDropdown()}):(this._open&&this._closeMenu(),Promise.resolve())}_handleSelectEvent(e){let t=this._nonDividerOptions.findIndex(n=>n.value===e);t<0||this._selectOptionByIndex(t)}_selectActiveOption(){let e=this._adapter.getActiveOptionIndex();e>=0&&this._nonDividerOptions[e]&&this._selectOptionByIndex(e)}_selectOptionByIndex(e){let{options:t,value:n}=this._nonDividerOptions[e];if(t){this._adapter.setActiveOption(e);return}this._closeDropdown();let o={index:e,value:n};!this._adapter.emitHostEvent(i.events.SELECT,o,!0,!0)||(this._selectedValue=this._persistSelection?n:void 0)}_getSelectedValues(){let e=this._flatOptions.filter(t=>t.selected).map(t=>t.value);return this._selectedValue!==void 0&&e.push(this._selectedValue),e}_onCascadingOptionSelected(e){this._persistSelection&&(this._selectedValue=e.value),this._adapter.emitHostEvent(i.events.SELECT,e),this._closeDropdown()}_onCascadingChildOpen(e){super._clearMouseLeaveTimeout(),this._adapter.closeOtherChildMenus(e),this._childOpen=!0,this._adapter.setActiveOption(e)}_onCascadingChildClose(){this._childOpen=!1}_closeDropdown(){this._closeMenu()}_openDropdown(){this._openMenu()}_isOwnElement(e){return this._adapter.isOwnElement(e)}_createCascadingElement({index:e,options:t,parentValue:n}){let o=this._adapter.createChildMenu(e,n,this._onCascadingChildOpen.bind(this),this._onCascadingChildClose.bind(this),this._onCascadingOptionSelected.bind(this));return o.mode="cascade",o.popupOffset={x:0,y:-8},o.dense=this._dense,o.placement="right-start",o.persistSelection=this._persistSelection,this._persistSelection&&(o.selectedValue=this._selectedValue),o.options=t,o.optionBuilder=this._optionBuilder,o.iconClass=this._iconClass,o}_mapIconToLeadingIcon(){this._flatOptions.filter(e=>e.icon).forEach(e=>e.leadingIcon=e.icon)}get open(){return this._open}set open(e){e=Boolean(e),this._open!==e&&(this._open=e,e?this._openDropdown():this._closeDropdown())}set options(e){if(typeof e=="function")this.optionsFactory=e;else if(this.optionsFactory=void 0,this._options=e.map(t=>c({},t)),this._open&&(this._mapIconToLeadingIcon(),this._adapter.setOptions(this._options),this._persistSelection)){let t=this._getSelectedValues();t.length&&this._adapter.setSelectedValues(t)}}get options(){return this._options?this._flatOptions.map(e=>c({},e)):[]}set optionsFactory(e){this._optionsFactory=e}set selectedIndex(e){let t=this._nonDividerOptions[e];t&&t.value!==this._selectedValue&&(this.selectedValue=t.value)}get selectedIndex(){return this._selectedValue!==void 0?this._nonDividerOptions.findIndex(e=>e.value===this._selectedValue):-1}set selectedValue(e){this._selectedValue!==e&&(this._selectedValue=e,this._adapter.setSelectedValues(this._selectedValue))}get selectedValue(){return this._selectedValue}get placement(){return this._placement}set placement(e){this._placement!==e&&(this._placement=e||"bottom-start",this._adapter.setHostAttribute(i.attributes.PLACEMENT,this._placement))}get dense(){return this._dense}set dense(e){this._dense=e}get iconClass(){return this._iconClass}set iconClass(e){this._iconClass=e}get persistSelection(){return this._persistSelection}set persistSelection(e){this._persistSelection!==e&&(this._persistSelection=e,this._adapter.toggleHostAttribute(i.attributes.PERSIST_SELECTION,this._persistSelection),this._persistSelection||(this._flatOptions.forEach(t=>t.selected=!1),this._selectedValue=void 0))}get mode(){return this._mode}set mode(e){this._mode!==e&&(this._mode=e,this._destroyInteractionListeners(),this._applyMode(),this._adapter.setHostAttribute(i.attributes.MODE,this._mode))}get popupOffset(){return this._popupOffset}set popupOffset(e){this._popupOffset=e}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get popupElement(){return this._adapter.getDropdownElement()}};var q="<template><slot></slot></template>",W=":host{display:inline-block}:host([hidden]){display:none}",s=class extends k{constructor(){super();A.define(w),this._foundation=new h(new u(this)),S(this,q,W)}static get observedAttributes(){return[i.attributes.OPEN,i.attributes.PLACEMENT,i.attributes.SELECTED_INDEX,i.attributes.SELECTED_VALUE,i.attributes.DENSE,i.attributes.ICON_CLASS,i.attributes.PERSIST_SELECTION,i.attributes.MODE,i.attributes.SYNC_POPUP_WIDTH,i.attributes.POPUP_CLASSES,i.attributes.OPTION_LIMIT,i.attributes.OBSERVE_SCROLL,i.attributes.OBSERVE_SCROLL_THRESHOLD]}connectedCallback(){this.children.length?this._foundation.initialize():L(this).then(()=>this._foundation.initialize())}attributeChangedCallback(e,t,n){switch(super.attributeChangedCallback(e,t,n),e){case i.attributes.OPEN:this._foundation.open=M(n);break;case i.attributes.PLACEMENT:this._foundation.placement=n;break;case i.attributes.SELECTED_INDEX:this._foundation.selectedIndex=Number(n);break;case i.attributes.SELECTED_VALUE:this._foundation.selectedValue=n;break;case i.attributes.DENSE:this._foundation.dense=_(n);break;case i.attributes.ICON_CLASS:this._foundation.iconClass=n;break;case i.attributes.PERSIST_SELECTION:this.persistSelection=_(n);break;case i.attributes.MODE:this.mode=n;break}}disconnectedCallback(){this._foundation.disconnect()}propagateKeyEvent(e){this._foundation.onKeydown(e)}};r([a()],s.prototype,"open",2),r([a()],s.prototype,"options",2),r([a()],s.prototype,"selectedIndex",2),r([a()],s.prototype,"selectedValue",2),r([a()],s.prototype,"placement",2),r([a()],s.prototype,"dense",2),r([a()],s.prototype,"iconClass",2),r([a()],s.prototype,"persistSelection",2),r([a()],s.prototype,"mode",2),r([a()],s.prototype,"popupOffset",2),r([a()],s.prototype,"optionBuilder",2),r([a({set:!1})],s.prototype,"popupElement",2),s=r([D({name:i.elementName,dependencies:[V,x,U,P]})],s);function Ye(){C(s)}export{i as a,u as b,h as c,s as d,Ye as e};
7
+ //# sourceMappingURL=chunk.SZL74RTY.js.map
@@ -3,5 +3,5 @@
3
3
  * Copyright 2022 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{a as D}from"./chunk.B5ABD4CZ.js";import{b as o}from"./chunk.IGMTMR3D.js";import{a as G}from"./chunk.4WFU5CVF.js";import{h as k,i as P}from"./chunk.QBDE7M3E.js";import{a as V}from"./chunk.DRFU6POI.js";import{x as C}from"./chunk.KYCC3C3M.js";import{a as B}from"./chunk.A23NSEWA.js";import{a}from"./chunk.B3IJU6XJ.js";import{i as L}from"./chunk.R4NDFXVA.js";import{a as T,b as c,j as S,k as y,n as x}from"./chunk.G76HB2FK.js";import{a as O,f as d}from"./chunk.MCIQXNKY.js";var M={VALUE:"value",MULTIPLE:"multiple",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",SYNC_POPUP_WIDTH:"sync-popup-width"},U=O({},M),W={CHANGE:"change"},m={attributes:U,events:W};var N=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(N||{});function w(l,b){let e=l.some(i=>E(i)),t=l.some(i=>R(i));return e&&b===1||t&&b===0}function E(l){return c(l)&&S(l)&&l.hasOwnProperty("options")&&l.hasOwnProperty("text")}function R(l){return c(l)&&S(l)&&l.hasOwnProperty("label")&&l.hasOwnProperty("value")}var H=class extends P{constructor(e){super();this._adapter=e;this._options=[];this._value=[];this._multiple=!1;this._open=!1;this._selectedValues=[];this._selectedLabels=[];this._selectedIndexes=[];this._filterString="";this._focusListener=t=>this._onFocus(t),this._blurListener=t=>this._onBlur(t),this._clickListener=t=>this._onClick(t),this._keydownListener=t=>this._onKeydown(t),this._optionsChangedListener=t=>this._onOptionsChanged(t),this._activeChangeListener=t=>this._onActiveOptionChanged(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dismissListener=()=>this._onDismiss(),this._identifier=T()}_onFocus(e){}initialize(){this._optionListenerDestructor=this._adapter.setOptionsListener(this._optionsChangedListener),this._initializeValue()}initializeTarget(){this._adapter.initializeAccessibility(),this._adapter.setMultiple(this._multiple),this._adapter.addClickListener(this._clickListener),this._adapter.addTargetListener("blur",this._blurListener),this._adapter.addTargetListener("focus",this._focusListener),this._adapter.addTargetListener("keydown",this._keydownListener)}disconnect(){this._adapter.removeClickListener(this._clickListener),this._adapter.removeTargetListener("blur",this._blurListener),this._adapter.removeTargetListener("focus",this._focusListener),this._adapter.removeTargetListener("keydown",this._keydownListener),this._open&&this._closeDropdown(),this._optionListenerDestructor&&this._optionListenerDestructor()}appendOptions(e){this._adapter.setOptions(e,!1),this._open&&this._adapter.appendDropdownOptions(e)}selectAll(){this._multiple&&(this.value=this._flatOptions.map(e=>e.value))}deselectAll(){this._multiple&&(this.value=[])}get _flatOptions(){return w(this._options,1)?[].concat.apply([],this._options.map(e=>e.options)):this._options}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}_initializeValue(){let e=this._options.length&&this._options||this._adapter.getOptions();c(this._value)&&e.length&&this._applyValue(this._value)}_onClick(e){e.button===0&&(this._open?this._closeDropdown():this._openDropdown())}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._open&&this._closeDropdown()}_openDropdown(){if(this._options=this._adapter.getOptions(),!this._flatOptions.length)return;this._open=!0;let e={options:this._options,multiple:this._multiple,selectedValues:[...this._selectedValues],id:this._identifier,optionBuilder:this._optionBuilder,syncWidth:this._syncPopupWidth,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,popupClasses:this._popupClasses,optionLimit:this._optionLimit,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,closeCallback:()=>this._closeDropdown(),selectCallback:t=>{let i=this._flatOptions,s=i.find(r=>r.value===t);if(s){let r=i.indexOf(s);this._onSelect(s,r,!0)}}};this._adapter.open(e),this._adapter.setDismissListener(this._dismissListener)}_closeDropdown(){this._open=!1,this._adapter.close()}async _onSelect(e,t,i=!0){return new Promise(async s=>{if(this._valueChanging)return Promise.resolve(!1);let r=e?e.value:"",u=e?e.label:"",v=[...this._selectedValues],f=[...this._selectedLabels],g=[...this._selectedIndexes];if(this._multiple)if(this._selectedValues.includes(r)){let _=this._selectedValues.indexOf(r);this._selectedValues.splice(_,1),this._selectedLabels.splice(_,1),this._selectedIndexes.splice(_,1)}else this._selectedValues.push(r),this._selectedLabels.push(u),this._selectedIndexes.push(t);else c(r)?(this._selectedValues[0]=r,this._selectedLabels[0]=u,this._selectedIndexes[0]=t):(this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]);let I=()=>{this._selectedValues=[...v],this._selectedLabels=[...f],this._selectedIndexes=[...g]},n=()=>{if(this._value=[...this._selectedValues],this._multiple){let _=this._selectedIndexes.includes(t);this._adapter.toggleOptionMultiple(t,_)}this._applySelection()},h=this.multiple?[...this._selectedValues]:this._selectedValues[0];if(this._open&&i&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"){this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,h));let _=await this._valueChanging;if(this._valueChanging=void 0,!_)return I(),this._tryUpdateDropdownPosition(),s(!1)}let A=!this._adapter.emitHostEvent(m.events.CHANGE,h,!0,!0);A?I():n(),this._tryUpdateDropdownPosition(),s(!A)})}_selectActiveOption(){let e=this._adapter.getActiveOptionIndex();e>=0&&this._nonDividerOptions[e]&&this._onSelect(this._nonDividerOptions[e],e)}_tryUpdateDropdownPosition(){this._open&&this._adapter.queueDropdownPositionUpdate()}_reset(){this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]}_applyValue(e){this._selectedValues=[],this._selectedLabels=[],this._options=this._adapter.getOptions(),Array.isArray(e)||(e=[e]),this._value=[];for(let t of e){this._value.includes(t)||this._value.push(t);let i=this._flatOptions.find(s=>x(s.value,t));i&&(this._selectedValues.push(i.value),this._selectedLabels.push(i.label))}this._selectedIndexes=this._selectedValues.map(t=>this._flatOptions.findIndex(i=>i.value===t)),this._adapter.patchSelectedValues(this._selectedValues)}_onDismiss(){this._closeDropdown()}_getSelectedText(){if(typeof this._selectedTextBuilder=="function"){let e=this._flatOptions.filter(t=>this._selectedValues.includes(t.value));return this._selectedTextBuilder(e)}return this._multiple?this._selectedLabels.length?`${this._selectedLabels.length} ${this._selectedLabels.length===1?"option":"options"} selected`:"":this._selectedLabels.filter(e=>e&&e.length).join(" ").trim()}_onKeydown(e){let t=e.key==="Escape"||e.keyCode===27,i=e.key==="Enter"||e.keyCode===13,s=e.key==="Space"||e.keyCode===32,r=e.key==="ArrowDown"||e.keyCode===40,u=e.key==="ArrowUp"||e.keyCode===38,v=e.keyCode>=48&&e.keyCode<=90,f=e.key==="Home"||e.keyCode===36,g=e.key==="End"||e.keyCode===35;if(e.key==="Tab"&&this._open&&!this._multiple){this._selectActiveOption();return}if(!v&&this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterString="",this._filterTimeout=void 0),t&&(e.preventDefault(),this._open)){this._closeDropdown();return}if(s)e.preventDefault(),this._open?this._closeDropdown():this._openDropdown();else if(i)this._open&&(e.stopPropagation(),e.preventDefault(),this._options=this._adapter.getOptions(),this._selectActiveOption());else if(u||r){if(e.preventDefault(),this._multiple&&!this._open){this._openDropdown(),this._adapter.activateFirstOption();return}if(this._flatOptions.length===0)return;let n=0;this._open?(n=this._adapter.getActiveOptionIndex(),n===-1&&(n=this._getFirstSelectedOptionIndex())):n=this._getFirstSelectedOptionIndex(),u?n=this._getPreviousHighlightableOptionIndex(n,this._nonDividerOptions):n=this._getNextHighlightableOptionIndex(n,this._nonDividerOptions),this._open?this._adapter.highlightActiveOption(n):this._onSelect(this._nonDividerOptions[n],n)}else if(f)this._open&&(e.preventDefault(),this._adapter.highlightActiveOption(this._nonDividerOptions.findIndex(n=>!n.disabled)));else if(g){if(this._open){e.preventDefault();let n=this._nonDividerOptions;for(let h=n.length-1;h>=0;h--)if(!n[h].disabled){this._adapter.highlightActiveOption(h);break}}}else v&&this._filter(e.key)}_getFirstSelectedOptionIndex(){return this._nonDividerOptions.findIndex(e=>this._selectedValues.includes(e.value))}_getPreviousHighlightableOptionIndex(e,t){let i=e;return i<=0?i=t.length-1:i--,t[i].disabled?this._getPreviousHighlightableOptionIndex(i,t):i}_getNextHighlightableOptionIndex(e,t){let i=e;return i===t.length-1?i=0:i++,t[i].disabled?this._getNextHighlightableOptionIndex(i,t):i}_filter(e){this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterTimeout=void 0),this._filterString+=e,this._filterTimeout=window.setTimeout(()=>{this._filterString="",this._filterTimeout=void 0},300),this._options=this._adapter.getOptions();let t=this._flatOptions.find(i=>!i.disabled&&i.label.toLowerCase().startsWith(this._filterString));if(t){let i=this._flatOptions.indexOf(t);this._open?this._adapter.highlightActiveOption(i):this._multiple||this._onSelect(t,i,!1)}}_onOptionsChanged(e){this._options=e,this._applyValue(this._value)}_onActiveOptionChanged(e){this._adapter.updateActiveDescendant(e)}get value(){return this._multiple?[...this._selectedValues]:this._selectedValues[0]}set value(e){let t;Array.isArray(e)?t=[...e]:t=e,this._applyValue(t)}get selectedIndex(){return this._multiple?[...this._selectedIndexes]:this._selectedIndexes[0]}set selectedIndex(e){this._options=this._adapter.getOptions();let t;if(Array.isArray(e)?t=[...e]:t=[e],t.sort(),this.multiple)this.value=t.map(i=>this._flatOptions[i]).filter(i=>i).map(i=>i.value);else{let i=this._flatOptions[t[t.length-1]];if(!i)return;this.value=i.value}}get options(){return this._adapter.getOptions()}set options(e){let t;w(e,1)?t=e.map(i=>O({},i)):t=e.map(i=>O({},i)),this._options=t,this._adapter.setOptions(t),this._initializeValue(),this._open&&this._adapter.setDropdownOptions(t)}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._reset(),this._open&&this._closeDropdown(),this._adapter.setMultiple(this._multiple))}get open(){return this._open}set open(e){this._open!==e&&(e?this._openDropdown():this._closeDropdown())}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth=e}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit=e}get popupClasses(){return this._popupClasses}set popupClasses(e){this._popupClasses=e}get popupHeaderBuilder(){return this._popupHeaderBuilder}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}get popupFooterBuilder(){return this._popupFooterBuilder}set popupFooterBuilder(e){this._popupFooterBuilder=e}get popupElement(){return this._adapter.popupElement}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){this._beforeValueChange=e}};var p=class extends G{constructor(){super()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case m.attributes.MULTIPLE:this.multiple=y(i);break;case m.attributes.VALUE:this.value=i;break}}appendOptions(e){this._foundation.appendOptions(e)}selectAll(){this._foundation.selectAll()}deselectAll(){this._foundation.deselectAll()}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.disconnect()}};d([a()],p.prototype,"value",2),d([a()],p.prototype,"selectedIndex",2),d([a()],p.prototype,"options",2),d([a()],p.prototype,"multiple",2),d([a()],p.prototype,"open",2),d([a()],p.prototype,"optionBuilder",2),d([a()],p.prototype,"selectedTextBuilder",2),d([a()],p.prototype,"beforeValueChange",2),d([a({set:!1})],p.prototype,"popupElement",2);var F=class extends B{constructor(e){super(e)}get popupElement(){var e;return(e=this._listDropdown)==null?void 0:e.dropdownElement}getOptions(){let e=Array.from(this._component.querySelectorAll(D.elementName));if(e.length)return e.map(t=>{let i=Array.from(t.querySelectorAll(o.elementName)),s=this._createOptionsFromElements(i);return{text:t.label,options:s}});{let t=Array.from(this._component.querySelectorAll(o.elementName));return this._createOptionsFromElements(t)}}_createOptionsFromElements(e){return e.map(t=>{let i=t.hasAttribute(o.attributes.OPTION_CLASS)?t.getAttribute(o.attributes.OPTION_CLASS):t.optionClass;return typeof i=="string"&&(i=i.split(" ")),{label:t.hasAttribute(o.attributes.LABEL)?t.getAttribute(o.attributes.LABEL):c(t.label)?t.label:t.innerText,value:t.hasAttribute(o.attributes.VALUE)?t.getAttribute(o.attributes.VALUE):t.value,disabled:t.hasAttribute(o.attributes.DISABLED),divider:t.hasAttribute(o.attributes.DIVIDER),optionClass:i,leadingIcon:t.hasAttribute(o.attributes.LEADING_ICON)?t.getAttribute(o.attributes.LEADING_ICON):t.leadingIcon,leadingIconClass:t.hasAttribute(o.attributes.LEADING_ICON_CLASS)?t.getAttribute(o.attributes.LEADING_ICON_CLASS):t.leadingIconClass,leadingIconType:t.hasAttribute(o.attributes.LEADING_ICON_TYPE)?t.getAttribute(o.attributes.LEADING_ICON_TYPE):t.leadingIconType,trailingIcon:t.hasAttribute(o.attributes.TRAILING_ICON)?t.getAttribute(o.attributes.TRAILING_ICON):t.trailingIcon,trailingIconClass:t.hasAttribute(o.attributes.TRAILING_ICON_CLASS)?t.getAttribute(o.attributes.TRAILING_ICON_CLASS):t.trailingIconClass,trailingIconType:t.hasAttribute(o.attributes.TRAILING_ICON_TYPE)?t.getAttribute(o.attributes.TRAILING_ICON_TYPE):t.trailingIconType,leadingBuilder:t.leadingBuilder,trailingBuilder:t.trailingBuilder}})}open(e){this._listDropdown=new k(this._targetElement,e),this._listDropdown.open()}close(){this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(V.events.BLUR,e)}toggleOptionMultiple(e,t){var i;(i=this._listDropdown)==null||i.toggleOptionMultiple(e,t)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:-1}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}highlightActiveOption(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}patchSelectedValues(e){var t;(t=this._listDropdown)==null||t.setSelectedValues(e)}setOptionsListener(e){let t=new MutationObserver(()=>e(this.getOptions()));return t.observe(this._component,{childList:!0,subtree:!0}),()=>t.disconnect()}setOptions(e,t=!0){t&&this._clearOptions();for(let i of e)if(E(i)){let s=this._createOptionGroupElement(i);for(let r of i.options){let u=this._createOptionElement(r);s.appendChild(u)}this._component.appendChild(s)}else{let s=this._createOptionElement(i);this._component.appendChild(s)}}appendDropdownOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setDropdownOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}scrollSelectedOptionIntoView(){var e;(e=this._listDropdown)==null||e.scrollSelectedOptionIntoView()}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}queueDropdownPositionUpdate(){!this.popupElement||window.requestAnimationFrame(()=>{let e=this.popupElement;e==null||e.position()})}_clearOptions(){Array.from(this._component.querySelectorAll(D.elementName)).forEach(i=>L(i)),Array.from(this._component.querySelectorAll(o.elementName)).forEach(i=>L(i))}_createOptionGroupElement(e){var i;let t=document.createElement("forge-option-group");return C(e,t),t.label=(i=e.text)!=null?i:"",t}_createOptionElement(e){let t=document.createElement("forge-option");return C(e,t),t.textContent=e.label,t}};export{m as a,N as b,w as c,E as d,R as e,H as f,p as g,F as h};
7
- //# sourceMappingURL=chunk.ZFUVXYDL.js.map
6
+ import{a as D}from"./chunk.B5ABD4CZ.js";import{b as o}from"./chunk.IGMTMR3D.js";import{a as G}from"./chunk.F3W3XMGT.js";import{h as k,i as P}from"./chunk.KGW63HJX.js";import{a as V}from"./chunk.3UMBCR4P.js";import{x as C}from"./chunk.KYCC3C3M.js";import{a as B}from"./chunk.A23NSEWA.js";import{a}from"./chunk.B3IJU6XJ.js";import{i as L}from"./chunk.R4NDFXVA.js";import{a as T,b as c,j as S,k as y,n as x}from"./chunk.G76HB2FK.js";import{a as O,f as d}from"./chunk.MCIQXNKY.js";var M={VALUE:"value",MULTIPLE:"multiple",OBSERVE_SCROLL:"observe-scroll",OBSERVE_SCROLL_THRESHOLD:"observe-scroll-threshold",POPUP_CLASSES:"popup-classes",OPTION_LIMIT:"option-limit",SYNC_POPUP_WIDTH:"sync-popup-width"},U=O({},M),W={CHANGE:"change"},m={attributes:U,events:W};var N=(e=>(e[e.Option=0]="Option",e[e.Group=1]="Group",e))(N||{});function w(l,b){let e=l.some(i=>E(i)),t=l.some(i=>R(i));return e&&b===1||t&&b===0}function E(l){return c(l)&&S(l)&&l.hasOwnProperty("options")&&l.hasOwnProperty("text")}function R(l){return c(l)&&S(l)&&l.hasOwnProperty("label")&&l.hasOwnProperty("value")}var H=class extends P{constructor(e){super();this._adapter=e;this._options=[];this._value=[];this._multiple=!1;this._open=!1;this._selectedValues=[];this._selectedLabels=[];this._selectedIndexes=[];this._filterString="";this._focusListener=t=>this._onFocus(t),this._blurListener=t=>this._onBlur(t),this._clickListener=t=>this._onClick(t),this._keydownListener=t=>this._onKeydown(t),this._optionsChangedListener=t=>this._onOptionsChanged(t),this._activeChangeListener=t=>this._onActiveOptionChanged(t),this._dropdownScrollEndListener=()=>this._onDropdownScrollEnd(),this._dismissListener=()=>this._onDismiss(),this._identifier=T()}_onFocus(e){}initialize(){this._optionListenerDestructor=this._adapter.setOptionsListener(this._optionsChangedListener),this._initializeValue()}initializeTarget(){this._adapter.initializeAccessibility(),this._adapter.setMultiple(this._multiple),this._adapter.addClickListener(this._clickListener),this._adapter.addTargetListener("blur",this._blurListener),this._adapter.addTargetListener("focus",this._focusListener),this._adapter.addTargetListener("keydown",this._keydownListener)}disconnect(){this._adapter.removeClickListener(this._clickListener),this._adapter.removeTargetListener("blur",this._blurListener),this._adapter.removeTargetListener("focus",this._focusListener),this._adapter.removeTargetListener("keydown",this._keydownListener),this._open&&this._closeDropdown(),this._optionListenerDestructor&&this._optionListenerDestructor()}appendOptions(e){this._adapter.setOptions(e,!1),this._open&&this._adapter.appendDropdownOptions(e)}selectAll(){this._multiple&&(this.value=this._flatOptions.map(e=>e.value))}deselectAll(){this._multiple&&(this.value=[])}get _flatOptions(){return w(this._options,1)?[].concat.apply([],this._options.map(e=>e.options)):this._options}get _nonDividerOptions(){return this._flatOptions.filter(e=>!e.divider)}_initializeValue(){let e=this._options.length&&this._options||this._adapter.getOptions();c(this._value)&&e.length&&this._applyValue(this._value)}_onClick(e){e.button===0&&(this._open?this._closeDropdown():this._openDropdown())}_onBlur(e){this._adapter.isFocusWithinPopup(e.relatedTarget)||this._open&&this._closeDropdown()}_openDropdown(){if(this._options=this._adapter.getOptions(),!this._flatOptions.length)return;this._open=!0;let e={options:this._options,multiple:this._multiple,selectedValues:[...this._selectedValues],id:this._identifier,optionBuilder:this._optionBuilder,syncWidth:this._syncPopupWidth,observeScroll:this._observeScroll,observeScrollThreshold:this._observeScrollThreshold,scrollEndListener:this._dropdownScrollEndListener,activeChangeCallback:this._activeChangeListener,targetWidthCallback:this._targetWidthCallback,popupClasses:this._popupClasses,optionLimit:this._optionLimit,headerBuilder:this._popupHeaderBuilder,footerBuilder:this._popupFooterBuilder,closeCallback:()=>this._closeDropdown(),selectCallback:t=>{let i=this._flatOptions,s=i.find(r=>r.value===t);if(s){let r=i.indexOf(s);this._onSelect(s,r,!0)}}};this._adapter.open(e),this._adapter.setDismissListener(this._dismissListener)}_closeDropdown(){this._open=!1,this._adapter.close()}async _onSelect(e,t,i=!0){return new Promise(async s=>{if(this._valueChanging)return Promise.resolve(!1);let r=e?e.value:"",u=e?e.label:"",v=[...this._selectedValues],f=[...this._selectedLabels],g=[...this._selectedIndexes];if(this._multiple)if(this._selectedValues.includes(r)){let _=this._selectedValues.indexOf(r);this._selectedValues.splice(_,1),this._selectedLabels.splice(_,1),this._selectedIndexes.splice(_,1)}else this._selectedValues.push(r),this._selectedLabels.push(u),this._selectedIndexes.push(t);else c(r)?(this._selectedValues[0]=r,this._selectedLabels[0]=u,this._selectedIndexes[0]=t):(this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]);let I=()=>{this._selectedValues=[...v],this._selectedLabels=[...f],this._selectedIndexes=[...g]},n=()=>{if(this._value=[...this._selectedValues],this._multiple){let _=this._selectedIndexes.includes(t);this._adapter.toggleOptionMultiple(t,_)}this._applySelection()},h=this.multiple?[...this._selectedValues]:this._selectedValues[0];if(this._open&&i&&!this._multiple&&this._closeDropdown(),typeof this._beforeValueChange=="function"){this._valueChanging=Promise.resolve(this._beforeValueChange.call(null,h));let _=await this._valueChanging;if(this._valueChanging=void 0,!_)return I(),this._tryUpdateDropdownPosition(),s(!1)}let A=!this._adapter.emitHostEvent(m.events.CHANGE,h,!0,!0);A?I():n(),this._tryUpdateDropdownPosition(),s(!A)})}_selectActiveOption(){let e=this._adapter.getActiveOptionIndex();e>=0&&this._nonDividerOptions[e]&&this._onSelect(this._nonDividerOptions[e],e)}_tryUpdateDropdownPosition(){this._open&&this._adapter.queueDropdownPositionUpdate()}_reset(){this._selectedValues=[],this._selectedLabels=[],this._selectedIndexes=[]}_applyValue(e){this._selectedValues=[],this._selectedLabels=[],this._options=this._adapter.getOptions(),Array.isArray(e)||(e=[e]),this._value=[];for(let t of e){this._value.includes(t)||this._value.push(t);let i=this._flatOptions.find(s=>x(s.value,t));i&&(this._selectedValues.push(i.value),this._selectedLabels.push(i.label))}this._selectedIndexes=this._selectedValues.map(t=>this._flatOptions.findIndex(i=>i.value===t)),this._adapter.patchSelectedValues(this._selectedValues)}_onDismiss(){this._closeDropdown()}_getSelectedText(){if(typeof this._selectedTextBuilder=="function"){let e=this._flatOptions.filter(t=>this._selectedValues.includes(t.value));return this._selectedTextBuilder(e)}return this._multiple?this._selectedLabels.length?`${this._selectedLabels.length} ${this._selectedLabels.length===1?"option":"options"} selected`:"":this._selectedLabels.filter(e=>e&&e.length).join(" ").trim()}_onKeydown(e){let t=e.key==="Escape"||e.keyCode===27,i=e.key==="Enter"||e.keyCode===13,s=e.key==="Space"||e.keyCode===32,r=e.key==="ArrowDown"||e.keyCode===40,u=e.key==="ArrowUp"||e.keyCode===38,v=e.keyCode>=48&&e.keyCode<=90,f=e.key==="Home"||e.keyCode===36,g=e.key==="End"||e.keyCode===35;if(e.key==="Tab"&&this._open&&!this._multiple){this._selectActiveOption();return}if(!v&&this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterString="",this._filterTimeout=void 0),t&&(e.preventDefault(),this._open)){this._closeDropdown();return}if(s)e.preventDefault(),this._open?this._closeDropdown():this._openDropdown();else if(i)this._open&&(e.stopPropagation(),e.preventDefault(),this._options=this._adapter.getOptions(),this._selectActiveOption());else if(u||r){if(e.preventDefault(),this._multiple&&!this._open){this._openDropdown(),this._adapter.activateFirstOption();return}if(this._flatOptions.length===0)return;let n=0;this._open?(n=this._adapter.getActiveOptionIndex(),n===-1&&(n=this._getFirstSelectedOptionIndex())):n=this._getFirstSelectedOptionIndex(),u?n=this._getPreviousHighlightableOptionIndex(n,this._nonDividerOptions):n=this._getNextHighlightableOptionIndex(n,this._nonDividerOptions),this._open?this._adapter.highlightActiveOption(n):this._onSelect(this._nonDividerOptions[n],n)}else if(f)this._open&&(e.preventDefault(),this._adapter.highlightActiveOption(this._nonDividerOptions.findIndex(n=>!n.disabled)));else if(g){if(this._open){e.preventDefault();let n=this._nonDividerOptions;for(let h=n.length-1;h>=0;h--)if(!n[h].disabled){this._adapter.highlightActiveOption(h);break}}}else v&&this._filter(e.key)}_getFirstSelectedOptionIndex(){return this._nonDividerOptions.findIndex(e=>this._selectedValues.includes(e.value))}_getPreviousHighlightableOptionIndex(e,t){let i=e;return i<=0?i=t.length-1:i--,t[i].disabled?this._getPreviousHighlightableOptionIndex(i,t):i}_getNextHighlightableOptionIndex(e,t){let i=e;return i===t.length-1?i=0:i++,t[i].disabled?this._getNextHighlightableOptionIndex(i,t):i}_filter(e){this._filterTimeout&&(window.clearTimeout(this._filterTimeout),this._filterTimeout=void 0),this._filterString+=e,this._filterTimeout=window.setTimeout(()=>{this._filterString="",this._filterTimeout=void 0},300),this._options=this._adapter.getOptions();let t=this._flatOptions.find(i=>!i.disabled&&i.label.toLowerCase().startsWith(this._filterString));if(t){let i=this._flatOptions.indexOf(t);this._open?this._adapter.highlightActiveOption(i):this._multiple||this._onSelect(t,i,!1)}}_onOptionsChanged(e){this._options=e,this._applyValue(this._value)}_onActiveOptionChanged(e){this._adapter.updateActiveDescendant(e)}get value(){return this._multiple?[...this._selectedValues]:this._selectedValues[0]}set value(e){let t;Array.isArray(e)?t=[...e]:t=e,this._applyValue(t)}get selectedIndex(){return this._multiple?[...this._selectedIndexes]:this._selectedIndexes[0]}set selectedIndex(e){this._options=this._adapter.getOptions();let t;if(Array.isArray(e)?t=[...e]:t=[e],t.sort(),this.multiple)this.value=t.map(i=>this._flatOptions[i]).filter(i=>i).map(i=>i.value);else{let i=this._flatOptions[t[t.length-1]];if(!i)return;this.value=i.value}}get options(){return this._adapter.getOptions()}set options(e){let t;w(e,1)?t=e.map(i=>O({},i)):t=e.map(i=>O({},i)),this._options=t,this._adapter.setOptions(t),this._initializeValue(),this._open&&this._adapter.setDropdownOptions(t)}get multiple(){return this._multiple}set multiple(e){this._multiple!==e&&(this._multiple=e,this._reset(),this._open&&this._closeDropdown(),this._adapter.setMultiple(this._multiple))}get open(){return this._open}set open(e){this._open!==e&&(e?this._openDropdown():this._closeDropdown())}get optionBuilder(){return this._optionBuilder}set optionBuilder(e){this._optionBuilder=e}get selectedTextBuilder(){return this._selectedTextBuilder}set selectedTextBuilder(e){this._selectedTextBuilder=e}get observeScroll(){return this._observeScroll}set observeScroll(e){this._observeScroll=e}get observeScrollThreshold(){return this._observeScrollThreshold}set observeScrollThreshold(e){this._observeScrollThreshold=e}get syncPopupWidth(){return this._syncPopupWidth}set syncPopupWidth(e){this._syncPopupWidth=e}get optionLimit(){return this._optionLimit}set optionLimit(e){this._optionLimit=e}get popupClasses(){return this._popupClasses}set popupClasses(e){this._popupClasses=e}get popupHeaderBuilder(){return this._popupHeaderBuilder}set popupHeaderBuilder(e){this._popupHeaderBuilder=e}get popupFooterBuilder(){return this._popupFooterBuilder}set popupFooterBuilder(e){this._popupFooterBuilder=e}get popupElement(){return this._adapter.popupElement}get beforeValueChange(){return this._beforeValueChange}set beforeValueChange(e){this._beforeValueChange=e}};var p=class extends G{constructor(){super()}attributeChangedCallback(e,t,i){switch(super.attributeChangedCallback(e,t,i),e){case m.attributes.MULTIPLE:this.multiple=y(i);break;case m.attributes.VALUE:this.value=i;break}}appendOptions(e){this._foundation.appendOptions(e)}selectAll(){this._foundation.selectAll()}deselectAll(){this._foundation.deselectAll()}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.disconnect()}};d([a()],p.prototype,"value",2),d([a()],p.prototype,"selectedIndex",2),d([a()],p.prototype,"options",2),d([a()],p.prototype,"multiple",2),d([a()],p.prototype,"open",2),d([a()],p.prototype,"optionBuilder",2),d([a()],p.prototype,"selectedTextBuilder",2),d([a()],p.prototype,"beforeValueChange",2),d([a({set:!1})],p.prototype,"popupElement",2);var F=class extends B{constructor(e){super(e)}get popupElement(){var e;return(e=this._listDropdown)==null?void 0:e.dropdownElement}getOptions(){let e=Array.from(this._component.querySelectorAll(D.elementName));if(e.length)return e.map(t=>{let i=Array.from(t.querySelectorAll(o.elementName)),s=this._createOptionsFromElements(i);return{text:t.label,options:s}});{let t=Array.from(this._component.querySelectorAll(o.elementName));return this._createOptionsFromElements(t)}}_createOptionsFromElements(e){return e.map(t=>{let i=t.hasAttribute(o.attributes.OPTION_CLASS)?t.getAttribute(o.attributes.OPTION_CLASS):t.optionClass;return typeof i=="string"&&(i=i.split(" ")),{label:t.hasAttribute(o.attributes.LABEL)?t.getAttribute(o.attributes.LABEL):c(t.label)?t.label:t.innerText,value:t.hasAttribute(o.attributes.VALUE)?t.getAttribute(o.attributes.VALUE):t.value,disabled:t.hasAttribute(o.attributes.DISABLED),divider:t.hasAttribute(o.attributes.DIVIDER),optionClass:i,leadingIcon:t.hasAttribute(o.attributes.LEADING_ICON)?t.getAttribute(o.attributes.LEADING_ICON):t.leadingIcon,leadingIconClass:t.hasAttribute(o.attributes.LEADING_ICON_CLASS)?t.getAttribute(o.attributes.LEADING_ICON_CLASS):t.leadingIconClass,leadingIconType:t.hasAttribute(o.attributes.LEADING_ICON_TYPE)?t.getAttribute(o.attributes.LEADING_ICON_TYPE):t.leadingIconType,trailingIcon:t.hasAttribute(o.attributes.TRAILING_ICON)?t.getAttribute(o.attributes.TRAILING_ICON):t.trailingIcon,trailingIconClass:t.hasAttribute(o.attributes.TRAILING_ICON_CLASS)?t.getAttribute(o.attributes.TRAILING_ICON_CLASS):t.trailingIconClass,trailingIconType:t.hasAttribute(o.attributes.TRAILING_ICON_TYPE)?t.getAttribute(o.attributes.TRAILING_ICON_TYPE):t.trailingIconType,leadingBuilder:t.leadingBuilder,trailingBuilder:t.trailingBuilder}})}open(e){this._listDropdown=new k(this._targetElement,e),this._listDropdown.open()}close(){this._listDropdown&&(this._listDropdown.close(),this._listDropdown.destroy(),this._listDropdown=void 0)}setDismissListener(e){if(!this._listDropdown||!this._listDropdown.dropdownElement)return;let t=this._listDropdown.dropdownElement;t.targetElement&&t.targetElement.addEventListener(V.events.BLUR,e)}toggleOptionMultiple(e,t){var i;(i=this._listDropdown)==null||i.toggleOptionMultiple(e,t)}getActiveOptionIndex(){var e,t;return(t=(e=this._listDropdown)==null?void 0:e.getActiveOptionIndex())!=null?t:-1}activateSelectedOption(){var e;(e=this._listDropdown)==null||e.activateSelectedOption()}activateFirstOption(){var e;(e=this._listDropdown)==null||e.activateFirstOption()}highlightActiveOption(e){var t;(t=this._listDropdown)==null||t.activateOption(e)}patchSelectedValues(e){var t;(t=this._listDropdown)==null||t.setSelectedValues(e)}setOptionsListener(e){let t=new MutationObserver(()=>e(this.getOptions()));return t.observe(this._component,{childList:!0,subtree:!0}),()=>t.disconnect()}setOptions(e,t=!0){t&&this._clearOptions();for(let i of e)if(E(i)){let s=this._createOptionGroupElement(i);for(let r of i.options){let u=this._createOptionElement(r);s.appendChild(u)}this._component.appendChild(s)}else{let s=this._createOptionElement(i);this._component.appendChild(s)}}appendDropdownOptions(e){var t;(t=this._listDropdown)==null||t.appendOptions(e)}setDropdownOptions(e){var t;(t=this._listDropdown)==null||t.setOptions(e)}scrollSelectedOptionIntoView(){var e;(e=this._listDropdown)==null||e.scrollSelectedOptionIntoView()}isFocusWithinPopup(e){return!this._listDropdown||!this._listDropdown.dropdownElement?!1:this._listDropdown.dropdownElement.contains(e)}queueDropdownPositionUpdate(){!this.popupElement||window.requestAnimationFrame(()=>{let e=this.popupElement;e==null||e.position()})}_clearOptions(){Array.from(this._component.querySelectorAll(D.elementName)).forEach(i=>L(i)),Array.from(this._component.querySelectorAll(o.elementName)).forEach(i=>L(i))}_createOptionGroupElement(e){var i;let t=document.createElement("forge-option-group");return C(e,t),t.label=(i=e.text)!=null?i:"",t}_createOptionElement(e){let t=document.createElement("forge-option");return C(e,t),t.textContent=e.label,t}};export{m as a,N as b,w as c,E as d,R as e,H as f,p as g,F as h};
7
+ //# sourceMappingURL=chunk.TCCPCDJK.js.map
@@ -3,5 +3,5 @@
3
3
  * Copyright 2022 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{a as o}from"./chunk.4HI4HGZ6.js";import{a as n}from"./chunk.24D46RLZ.js";var l=class extends n{constructor(e){super(e)}_build(){return document.createElement(o.elementName)}_configure(){var e;typeof((e=this._config.options)==null?void 0:e.helperText)=="string"&&this.setHelperText(this._config.options.helperText)}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._element.disabled}set disabled(e){this._element.disabled=e}get invalid(){return this._element.invalid||!1}set invalid(e){this._element.invalid=e}onChange(e){this._element.addEventListener("change",t=>e(t.detail))}onFocus(e){this._element.addEventListener("focus",t=>e(t))}onBlur(e){this._element.addEventListener("blur",t=>e(t))}setHelperText(e){e?(this._helperTextElement||(this._helperTextElement=document.createElement("span"),this._helperTextElement.slot="helper-text",this._element.appendChild(this._helperTextElement)),this._helperTextElement.textContent=e):this._helperTextElement&&this._helperTextElement.isConnected&&(this._element.removeChild(this._helperTextElement),this._helperTextElement=void 0)}};export{l as a};
7
- //# sourceMappingURL=chunk.WALEAV54.js.map
6
+ import{a as o}from"./chunk.CYJBOJMX.js";import{a as n}from"./chunk.24D46RLZ.js";var l=class extends n{constructor(e){super(e)}_build(){return document.createElement(o.elementName)}_configure(){var e;typeof((e=this._config.options)==null?void 0:e.helperText)=="string"&&this.setHelperText(this._config.options.helperText)}get value(){return this._element.value}set value(e){this._element.value=e}get disabled(){return this._element.disabled}set disabled(e){this._element.disabled=e}get invalid(){return this._element.invalid||!1}set invalid(e){this._element.invalid=e}onChange(e){this._element.addEventListener("change",t=>e(t.detail))}onFocus(e){this._element.addEventListener("focus",t=>e(t))}onBlur(e){this._element.addEventListener("blur",t=>e(t))}setHelperText(e){e?(this._helperTextElement||(this._helperTextElement=document.createElement("span"),this._helperTextElement.slot="helper-text",this._element.appendChild(this._helperTextElement)),this._helperTextElement.textContent=e):this._helperTextElement&&this._helperTextElement.isConnected&&(this._element.removeChild(this._helperTextElement),this._helperTextElement=void 0)}};export{l as a};
7
+ //# sourceMappingURL=chunk.VH3PVW2V.js.map
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Tyler Technologies, Inc.
4
+ * License: Apache-2.0
5
+ */
6
+ import{a as H}from"./chunk.DGOV5RDW.js";import{a as I}from"./chunk.NGIBMR3Q.js";import{c as L}from"./chunk.7NXPOEXV.js";import{a as c,d as w}from"./chunk.QJPH24V4.js";import{a as P}from"./chunk.BOENNFXE.js";import{a as O}from"./chunk.A23NSEWA.js";import{a as s}from"./chunk.B3IJU6XJ.js";import{a as x,b as S}from"./chunk.BSZ2LBJX.js";import{a as A}from"./chunk.3E5QKMHL.js";import{a as M,e as D,g as v}from"./chunk.HN4PXH3D.js";import{i as T,r as y,s as k,t as p}from"./chunk.R4NDFXVA.js";import{b as g,c as E,d as C,k as m}from"./chunk.G76HB2FK.js";import{a as f,f as n}from"./chunk.MCIQXNKY.js";var l=`${S}dialog`,B={ANIMATING:"forge-dialog--animating",OPEN:"forge-dialog--open",ACTION_BUTTON:"forge-dialog__action__button",BUTTON_TEXT:"forge-button__text",SCROLLABLE:"forge-dialog--scrollable",FULLSCREEN:"forge-dialog--fullscreen",MOVEABLE:"forge-dialog--moveable"},h={BACKDROP_CLOSE:"backdrop-close",ESCAPE_CLOSE:"escape-close",FULLSCREEN:"fullscreen",POSITION_TYPE:"position-type",POSITION_X:"position-x",POSITION_Y:"position-y",MOVEABLE:"moveable",MOVE_TARGET:"move-target",OPEN:"forge-dialog-open",INITIAL_FOCUS:"forge-dialog-focus",DFEAULT_MOVE_TARGET:"forge-dialog-move-target"},R={CONTAINER:".forge-dialog",SURFACE:".forge-dialog__surface",BACKDROP:c.elementName,INITIAL_FOCUS:`[${h.INITIAL_FOCUS}]`,DFEAULT_MOVE_TARGET:`[${h.DFEAULT_MOVE_TARGET}]`,CONTENT:".forge-dialog__body"},z={BEFORE_CLOSE:`${l}-before-close`,OPEN:`${l}-open`,CLOSE:`${l}-close`,READY:`${l}-ready`,MOVE_START:`${l}-move-start`,MOVED:`${l}-move`,MOVE_END:`${l}-move-end`},F={ANIMATION_DURATION:150,BACKDROP_MAX_OPACITY:.3},i={elementName:l,classes:B,selectors:R,attributes:h,events:z,numbers:F};var u=class{constructor(t){this._adapter=t;this._open=!1;this._backdropClose=!0;this._escapeClose=!0;this._fullscreen=!1;this._positionType="absolute";this._positionX=null;this._positionY=null;this._moveable=!1;this._moveTarget=i.selectors.DFEAULT_MOVE_TARGET;this._isAnimating=!1;this._isMoving=!1;this._transitionEndHandler=e=>this._onTransitionEnd(),this._documentKeydownHandler=e=>this._onDocumentKeydown(e),this._backdropClickHandler=e=>this._onBackdropClick(e),this._moveTargetMouseDownHandler=e=>this._onMoveTargetMouseDown(e),this._moveTargetMouseMoveHandler=e=>this._onMoveTargetMouseMove(e),this._moveTargetMouseUpHandler=e=>this._onMoveTargetMouseUp(e)}initialize(){this._adapter.initializeAccessibility(),this._open&&this._moveable&&(this._adapter.setMoveable(this._moveable),this._initMoveTarget())}destroy(){this._open&&(this._removeDragHandlers(),this._adapter.deregisterTransitionEndHandler(this._transitionEndHandler),this._adapter.removeDocumentListener("keydown",this._documentKeydownHandler),this._adapter.deregisterBackdropClickHandler(this._backdropClickHandler))}async _applyOpen(t){if(t){if(typeof this._openCallback=="function"&&!await this._executeOpenCallback())return;this._open=t,this._openDialog()}else{if(typeof this._closeCallback=="function"&&!await this._executeCloseCallback())return;this._open=t,this._closeDialog()}this._adapter.toggleHostAttribute(i.attributes.OPEN,this._open)}async _executeOpenCallback(){try{return await Promise.resolve(this._openCallback())!==!1}catch(t){return!1}}async _executeCloseCallback(){try{return await Promise.resolve(this._closeCallback())!==!1}catch(t){return!1}}initializeMoveTarget(){this._moveTarget||(this._moveTarget=i.selectors.DFEAULT_MOVE_TARGET),this._initMoveTarget()}resetPosition(){this._adapter.setSurfacePosition(this._positionX,this._positionY,this._positionType)}async show(t){this._open||(this._open=!0,this._adapter.isConnected||this._adapter.attach(t),await this._openDialog())}async hide(t){!this._open||(this._open=!1,await this._closeDialog(),t&&this._adapter.detach())}_normalizePositionValue(t){return C(t)?`${t}px`:E(t)?t:null}_openDialog(){return this._fullscreen||(this._moveable&&this._adapter.setMoveable(this._moveable),(this._positionX!==null||this._positionY!==null)&&this._adapter.setSurfacePosition(this._positionX,this._positionY,this._positionType)),this._adapter.setBodyAttribute(i.attributes.OPEN,"true"),this._adapter.registerTransitionEndHandler(this._transitionEndHandler),this._setDocumentKeydownListener(this._escapeClose),this._adapter.setAnimating(!0),this._isAnimating=!0,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{this._adapter.setVisibility(!0),this._setBackdropClickListener(this._backdropClose),this._adapter.emitHostEvent(i.events.OPEN),this._adapter.trySetInitialFocus(),this._adapter.isScrollable()&&this._adapter.addRootClass(i.classes.SCROLLABLE)})}),new Promise(t=>{window.setTimeout(()=>{window.requestAnimationFrame(()=>{this._open&&this._isAnimating&&(this._onTransitionEnd(),t())})},i.numbers.ANIMATION_DURATION)})}_closeDialog(){return this._moveTarget&&this._removeDragHandlers(),this._adapter.deregisterTransitionEndHandler(this._transitionEndHandler),this._escapeClose&&this._adapter.removeDocumentListener("keydown",this._documentKeydownHandler),this._backdropClose&&this._adapter.deregisterBackdropClickHandler(this._backdropClickHandler),this._isAnimating=!1,this._moveContext=void 0,this._lastPosition=void 0,this._adapter.setAnimating(!0),this._adapter.setVisibility(!1),this._adapter.setSurfacePosition(null,null,null),new Promise(t=>{setTimeout(()=>{this._adapter.emitHostEvent(i.events.CLOSE),this._adapter.getOpenDialogs(`${i.elementName}[${i.attributes.OPEN}]`).length||this._adapter.removeBodyAttribute(i.attributes.OPEN),this._adapter.setAnimating(!1),t()},i.numbers.ANIMATION_DURATION)})}_onTransitionEnd(){!this._isAnimating||(this._adapter.deregisterTransitionEndHandler(this._transitionEndHandler),this._adapter.setAnimating(!1),this._adapter.emitHostEvent(i.events.READY),this._adapter.tryLayoutChildren(),this._moveable&&this._initMoveTarget(),this._isAnimating=!1)}_initMoveTarget(){!this._fullscreen&&this._moveable&&this._moveTarget&&this._adapter.setMoveTarget(this._moveTarget)&&this._adapter.setMoveTargetHandler("mousedown",this._moveTargetMouseDownHandler)}_removeDragHandlers(){this._adapter.removeDragTargetHandler("mousedown",this._moveTargetMouseDownHandler),this._adapter.removeDocumentListener("mousemove",this._moveTargetMouseMoveHandler),this._adapter.removeDocumentListener("mouseup",this._moveTargetMouseUpHandler)}_onMoveTargetMouseDown(t){t.preventDefault(),this._adapter.captureActiveElement();let e=this._adapter.getSurfaceBounds();this._moveContext={top:t.clientY-e.top,left:t.clientX-e.left,height:e.height,width:e.width},this._adapter.setDocumentListener("mousemove",this._moveTargetMouseMoveHandler),this._adapter.setDocumentListener("mouseup",this._moveTargetMouseUpHandler)}_onMoveTargetMouseMove(t){t.preventDefault();let e=this._calculateOffsetPosition(t.pageX,t.pageY,this._moveContext);if(!this._isMoving&&(this._isMoving=!0,!this._adapter.emitHostEvent(i.events.MOVE_START,e,!0,!0)))return;let o=this._clampPosition(e,this._moveContext);if((!this._lastPosition||o.x!==this._lastPosition.x||o.y!==this._lastPosition.y)&&this._adapter.emitHostEvent(i.events.MOVED,o,!0,!0)){this._lastPosition=f({},o);let d=this._normalizePositionValue(o.x),N=this._normalizePositionValue(o.y);this._adapter.setSurfacePosition(d,N,"absolute")}}_onMoveTargetMouseUp(t){this._isMoving&&this._adapter.emitHostEvent(i.events.MOVE_END),this._moveComplete()}_moveComplete(){this._adapter.tryRestoreActiveElement(),this._adapter.removeDocumentListener("mousemove",this._moveTargetMouseMoveHandler),this._adapter.removeDocumentListener("mouseup",this._moveTargetMouseUpHandler),this._lastPosition=void 0,this._moveContext=void 0,this._isMoving=!1}_onDocumentKeydown(t){t.stopPropagation(),t.key&&(t.key==="Escape"||t.key==="Esc")&&this._tryClose()}_onBackdropClick(t){t.stopPropagation(),this._tryClose()}async _tryClose(){if(!!this._adapter.emitHostEvent(i.events.BEFORE_CLOSE,void 0,void 0,!0)){if(!this._beforeCloseCallback){this.open=!1;return}try{if(await Promise.resolve(this._beforeCloseCallback())!==!1){this.open=!1;return}}catch(e){return}}}_setBackdropClickListener(t){!this._open||(t&&this._backdropClose?this._adapter.registerBackdropClickHandler(this._backdropClickHandler):t||this._adapter.deregisterBackdropClickHandler(this._backdropClickHandler))}_setDocumentKeydownListener(t){!this._open||(t&&this._escapeClose?this._adapter.setDocumentListener("keydown",this._documentKeydownHandler):t||this._adapter.removeDocumentListener("keydown",this._documentKeydownHandler))}_calculateOffsetPosition(t,e,o){return{x:t-((o==null?void 0:o.left)||0),y:e-((o==null?void 0:o.top)||0)}}_clampPosition({x:t,y:e},o){let a=0,d=0;return o&&(a=o.width,d=o.height),t<=0?t=0:t+a>=window.innerWidth&&(t=window.innerWidth-a),e<=0?e=0:e+d>=window.innerHeight&&(e=window.innerHeight-d),{x:t,y:e}}set backdropClose(t){t=Boolean(t),this._backdropClose!==t&&(this._backdropClose=t,this._setBackdropClickListener(this._backdropClose),g(this._backdropClose)?this._adapter.setHostAttribute(i.attributes.BACKDROP_CLOSE,this._backdropClose.toString()):this._adapter.removeHostAttribute(i.attributes.BACKDROP_CLOSE))}get backdropClose(){return this._backdropClose}set escapeClose(t){t=Boolean(t),this._escapeClose!==t&&(this._escapeClose=t,this._setDocumentKeydownListener(this._escapeClose),g(this._escapeClose)?this._adapter.setHostAttribute(i.attributes.ESCAPE_CLOSE,this._escapeClose.toString()):this._adapter.removeHostAttribute(i.attributes.ESCAPE_CLOSE))}get escapeClose(){return this._escapeClose}get open(){return this._open}set open(t){this._open!==t&&(t=Boolean(t),t!==this._open&&this._applyOpen(t))}get fullscreen(){return this._fullscreen}set fullscreen(t){this._fullscreen!==t&&(this._fullscreen=t,this._adapter.setFullscreen(this._fullscreen))}get openCallback(){return this._openCallback}set openCallback(t){this._openCallback=t}get closeCallback(){return this._closeCallback}set closeCallback(t){this._closeCallback=t}get beforeCloseCallback(){return this._beforeCloseCallback}set beforeCloseCallback(t){this._beforeCloseCallback=t}get positionType(){return this._positionType}set positionType(t){this._positionType!==t&&(this._positionType=t,this._open&&this._adapter.setSurfacePosition(this._positionX,this._positionY,this._positionType))}get positionX(){return this._positionX}set positionX(t){this._positionX!==t&&(this._positionX=this._normalizePositionValue(t),this._open&&this._adapter.setSurfacePosition(this._positionX,this._positionY,this._positionType))}get positionY(){return this._positionY}set positionY(t){this._positionY!==t&&(this._positionY=this._normalizePositionValue(t),this._open&&this._adapter.setSurfacePosition(this._positionX,this._positionY,this._positionType))}get moveable(){return this._moveable}set moveable(t){this._moveable!==t&&(this._moveable=t,this._open&&(this._adapter.setMoveable(this._moveable),this._moveable?this._initMoveTarget():(this._removeDragHandlers(),this._isMoving=!1)))}get moveTarget(){return this._moveTarget}set moveTarget(t){this._moveTarget=t}};var b=class extends O{constructor(e){super(e);this._containerElement=v(e,i.selectors.CONTAINER),this._surfaceElement=v(e,i.selectors.SURFACE)}initializeAccessibility(){this._component.hasAttribute("role")||this._component.setAttribute("role","dialog"),this._component.setAttribute("aria-modal","true")}setAnimating(e){p(this._containerElement,e,i.classes.ANIMATING)}setVisibility(e){p(this._containerElement,e,i.classes.OPEN),this._backdropElement||(this._backdropElement=document.createElement("forge-backdrop"),this._backdropElement.setAttribute("part","scrim"),this._containerElement.appendChild(this._backdropElement)),e?this._backdropElement.fadeIn():this._backdropElement.fadeOut()}attach(e=document.body){e.appendChild(this._component)}detach(){this._activeElement&&(this._activeElement=void 0),T(this._component)}registerTransitionEndHandler(e){this._surfaceElement.addEventListener("transitionend",e)}deregisterTransitionEndHandler(e){this._surfaceElement.removeEventListener("transitionend",e)}setDocumentListener(e,o){document.addEventListener(e,o)}removeDocumentListener(e,o){document.removeEventListener(e,o)}registerBackdropClickHandler(e){var o;(o=this._backdropElement)==null||o.addEventListener(c.events.BACKDROP_CLICK,e)}deregisterBackdropClickHandler(e){var o;(o=this._backdropElement)==null||o.removeEventListener(c.events.BACKDROP_CLICK,e)}getOpenDialogs(e){return document.querySelectorAll(e)}setBodyAttribute(e,o){document.body.setAttribute(e,o)}removeBodyAttribute(e){document.body.removeAttribute(e)}trySetInitialFocus(){let e=y(this._component,i.selectors.INITIAL_FOCUS);e&&e.length&&e[e.length-1].focus()}isScrollable(){let e=this._component.querySelector(i.selectors.CONTENT);return e?e.scrollHeight>e.offsetHeight:!1}addRootClass(e){this._component.classList.add(e)}setFullscreen(e){p(this._containerElement,e,i.classes.FULLSCREEN)}setMoveable(e){p(this._containerElement,e,i.classes.MOVEABLE)}tryLayoutChildren(){let e=[P.elementName,H.elementName,L.elementName,I.elementName];Array.from(this._component.querySelectorAll(e.join(","))).filter(a=>typeof a.layout=="function").forEach(a=>a.layout())}setMoveTarget(e){return e?(this._moveTargetElement=this._component.querySelector(e),!!this._moveTargetElement):!1}setMoveTargetHandler(e,o){var a;(a=this._moveTargetElement)==null||a.addEventListener(e,o)}removeDragTargetHandler(e,o){var a;(a=this._moveTargetElement)==null||a.removeEventListener(e,o)}getSurfaceBounds(){return this._surfaceElement.getBoundingClientRect()}setSurfacePosition(e,o,a){a?this._surfaceElement.style.position=a==="absolute"?a:"relative":this._surfaceElement.style.removeProperty("position"),o!==null?this._surfaceElement.style.top=o:this._surfaceElement.style.removeProperty("top"),e!==null?this._surfaceElement.style.left=e:this._surfaceElement.style.removeProperty("left")}captureActiveElement(){var e;this._activeElement=k(),(e=this._activeElement)==null||e.blur()}tryRestoreActiveElement(){this._activeElement&&(this._activeElement.isConnected&&this._activeElement.focus(),this._activeElement=void 0)}};var U='<template><div class="forge-dialog" part="root"><div class="forge-dialog__surface" part="surface"><slot></slot></div></div></template>',K='.forge-dialog{position:fixed;top:0;bottom:0;left:0;right:0;z-index:8;z-index:var(--forge-z-index-dialog,8);-webkit-box-align:center;align-items:center;-webkit-box-align:var(--forge-dialog-align-items,center);align-items:var(--forge-dialog-align-items,center);top:0;top:var(--forge-dialog-top,0);padding:24px;padding:var(--forge-dialog-padding,24px);display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;visibility:hidden}@media (max-width:599px){.forge-dialog{padding:0}}.forge-dialog--moveable:not(.forge-dialog--fullscreen) ::slotted([forge-dialog-move-target]){cursor:move}.forge-dialog--animating{visibility:visible}.forge-dialog--animating .forge-dialog--open .forge-dialog__surface{-webkit-transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1)}.forge-dialog--animating .forge-dialog__surface{-webkit-transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1)}.forge-dialog--scrollable .forge-dialog__footer,.forge-dialog--scrollable .forge-dialog__title{border-color:rgba(0,0,0,.12)}.forge-dialog--open{visibility:visible!important}.forge-dialog--open .forge-dialog__surface{-webkit-transform:scale(1);transform:scale(1);opacity:1}.forge-dialog__surface{-webkit-box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);background-color:#fff;background-color:var(--mdc-theme-surface,#fff);width:auto;width:var(--forge-dialog-width,auto);height:auto;height:var(--forge-dialog-height,auto);min-width:280px;min-width:var(--forge-dialog-min-width,280px);max-width:100%;max-width:var(--forge-dialog-max-width,100%);max-height:100%;max-height:var(--forge-dialog-max-height,100%);border-radius:4px;border-radius:var(--forge-dialog-border-radius,var(--mdc-shape-medium,4px));display:-webkit-inline-box;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transform:scale(.8);transform:scale(.8);opacity:0;overflow:hidden;z-index:inherit}.forge-dialog__header{margin:0;padding:0 24px 9px;border-bottom:1px solid transparent}.forge-dialog__title{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:1.25rem;font-size:var(--forge-typography-title-font-size, 1.25rem);line-height:2rem;line-height:var(--forge-typography-title-line-height, 2rem);font-weight:400;font-weight:var(--forge-typography-title-font-weight,400);letter-spacing:.0125em;letter-spacing:var(--forge-typography-title-letter-spacing, .0125em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-title-text-decoration,inherit);text-decoration:var(--forge-typography-title-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-title-text-transform,inherit);-webkit-box-sizing:border-box;box-sizing:border-box;margin:0}.forge-dialog__title::before{display:inline-block;width:0;height:40px;content:"";vertical-align:0}.forge-dialog__body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-body1-font-size, 1rem);line-height:1.5rem;line-height:var(--mdc-typography-body1-line-height, 1.5rem);font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);padding-top:20px;padding:0 24px 24px;overflow:auto}.forge-dialog__body--scrollable{max-height:195px;border-top:1px solid rgba(0,0,0,.1);border-bottom:1px solid rgba(0,0,0,.1);overflow-x:auto;overflow-y:scroll;-webkit-overflow-scrolling:touch}.forge-dialog__footer{display:-webkit-box;display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;-webkit-box-align:center;align-items:center;-webkit-box-pack:end;justify-content:flex-end;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:52px;margin:0;padding:8px;border-top:1px solid transparent}.forge-dialog--fullscreen{padding:0}.forge-dialog--fullscreen .forge-dialog__surface{height:100%;width:100%;min-width:auto;max-width:100%;border-radius:0}:host{display:block}:host([hidden]){display:none}',r=class extends A{constructor(){super();D(this,U,K),this._foundation=new u(new b(this))}static get observedAttributes(){return[i.attributes.BACKDROP_CLOSE,i.attributes.ESCAPE_CLOSE,i.attributes.OPEN,i.attributes.FULLSCREEN,i.attributes.POSITION_TYPE,i.attributes.POSITION_X,i.attributes.POSITION_Y,i.attributes.MOVEABLE,i.attributes.MOVE_TARGET]}connectedCallback(){this._foundation.initialize()}disconnectedCallback(){this._foundation.destroy()}attributeChangedCallback(e,o,a){switch(e){case i.attributes.BACKDROP_CLOSE:this.backdropClose=a==="true";break;case i.attributes.ESCAPE_CLOSE:this.escapeClose=a==="true";break;case i.attributes.OPEN:this.open=m(a);break;case i.attributes.FULLSCREEN:this.fullscreen=m(a);break;case i.attributes.POSITION_TYPE:this.positionType=a;break;case i.attributes.POSITION_X:this.positionX=a;break;case i.attributes.POSITION_Y:this.positionY=a;break;case i.attributes.MOVEABLE:this.moveable=m(a);break;case i.attributes.MOVE_TARGET:this.moveTarget=a;break}}initializeMoveTarget(){this._foundation.initializeMoveTarget()}resetPosition(){this._foundation.resetPosition()}show(e){return this._foundation.show(e)}hide(e){return this._foundation.hide(e)}};n([s()],r.prototype,"backdropClose",2),n([s()],r.prototype,"escapeClose",2),n([s()],r.prototype,"open",2),n([s()],r.prototype,"fullscreen",2),n([s()],r.prototype,"openCallback",2),n([s()],r.prototype,"closeCallback",2),n([s()],r.prototype,"beforeCloseCallback",2),n([s()],r.prototype,"positionType",2),n([s()],r.prototype,"positionX",2),n([s()],r.prototype,"positionY",2),n([s()],r.prototype,"moveable",2),n([s()],r.prototype,"moveTarget",2),r=n([x({name:i.elementName,dependencies:[w]})],r);function De(){M(r)}export{i as a,u as b,b as c,r as d,De as e};
7
+ //# sourceMappingURL=chunk.VQKRN5IQ.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dialog/dialog-constants.ts", "../../src/dialog/dialog-foundation.ts", "../../src/dialog/dialog-adapter.ts", "../../src/dialog/dialog.ts", "../../src/dialog/index.ts"],
4
+ "sourcesContent": ["import { COMPONENT_NAME_PREFIX } from '../constants';\nimport { BACKDROP_CONSTANTS } from '../backdrop';\n\nconst elementName: keyof HTMLElementTagNameMap = `${COMPONENT_NAME_PREFIX}dialog`;\n\nconst classes = {\n ANIMATING: 'forge-dialog--animating',\n OPEN: 'forge-dialog--open',\n ACTION_BUTTON: 'forge-dialog__action__button',\n BUTTON_TEXT: 'forge-button__text',\n SCROLLABLE: 'forge-dialog--scrollable',\n FULLSCREEN: 'forge-dialog--fullscreen',\n MOVEABLE: 'forge-dialog--moveable'\n};\n\nconst attributes = {\n BACKDROP_CLOSE: 'backdrop-close',\n ESCAPE_CLOSE: 'escape-close',\n FULLSCREEN: 'fullscreen',\n POSITION_TYPE: 'position-type',\n POSITION_X: 'position-x',\n POSITION_Y: 'position-y',\n MOVEABLE: 'moveable',\n MOVE_TARGET: 'move-target',\n OPEN: 'forge-dialog-open',\n INITIAL_FOCUS: 'forge-dialog-focus',\n DFEAULT_MOVE_TARGET: 'forge-dialog-move-target'\n};\n\nconst selectors = {\n CONTAINER: '.forge-dialog',\n SURFACE: '.forge-dialog__surface',\n BACKDROP: BACKDROP_CONSTANTS.elementName,\n INITIAL_FOCUS: `[${attributes.INITIAL_FOCUS}]`,\n DFEAULT_MOVE_TARGET: `[${attributes.DFEAULT_MOVE_TARGET}]`,\n CONTENT: '.forge-dialog__body'\n};\n\nconst events = {\n BEFORE_CLOSE: `${elementName}-before-close`,\n OPEN: `${elementName}-open`,\n CLOSE: `${elementName}-close`,\n READY: `${elementName}-ready`,\n MOVE_START: `${elementName}-move-start`,\n MOVED: `${elementName}-move`,\n MOVE_END: `${elementName}-move-end`\n};\n\nconst numbers = {\n ANIMATION_DURATION: 150,\n BACKDROP_MAX_OPACITY: 0.3\n};\n\nexport const DIALOG_CONSTANTS = {\n elementName,\n classes,\n selectors,\n attributes,\n events,\n numbers\n};\n\nexport interface IDialogMoveEventData {\n x: number;\n y: number;\n}\n\nexport interface IDialogMoveContext {\n top: number;\n left: number;\n height: number;\n width: number;\n}\n\nexport interface IDialogMoveStartEventData extends IDialogMoveEventData {}\n\nexport type DialogPositionType = 'absolute' | 'relative';\nexport type DialogStateCallback = () => boolean | void | Promise<boolean | void>;\n", "import { ICustomElementFoundation, isDefined, isNumber, isString } from '@tylertech/forge-core';\nimport { IDialogAdapter } from './dialog-adapter';\nimport { DialogPositionType, DialogStateCallback, DIALOG_CONSTANTS, IDialogMoveContext, IDialogMoveStartEventData } from './dialog-constants';\n\nexport interface IDialogFoundation extends ICustomElementFoundation {\n backdropClose: boolean;\n escapeClose: boolean;\n open: boolean;\n fullscreen: boolean;\n openCallback: DialogStateCallback;\n closeCallback: DialogStateCallback;\n beforeCloseCallback: DialogStateCallback;\n positionType: DialogPositionType;\n positionX: number | string | null | undefined;\n positionY: number | string | null | undefined;\n moveable: boolean;\n moveTarget: string;\n initializeMoveTarget(): void;\n resetPosition(): void;\n show(parent?: HTMLElement): Promise<void>;\n hide(remove?: boolean): Promise<void>;\n}\n\nexport class DialogFoundation implements IDialogFoundation {\n // Private vars\n private _open = false;\n private _backdropClose = true;\n private _escapeClose = true;\n private _fullscreen = false;\n private _openCallback: DialogStateCallback;\n private _closeCallback: DialogStateCallback;\n private _beforeCloseCallback: DialogStateCallback;\n private _positionType: DialogPositionType = 'absolute';\n private _positionX: string | null = null;\n private _positionY: string | null = null;\n private _moveable = false;\n private _moveTarget = DIALOG_CONSTANTS.selectors.DFEAULT_MOVE_TARGET;\n private _isAnimating = false;\n private _isMoving = false;\n private _moveContext: IDialogMoveContext | undefined;\n private _lastPosition: { x: number; y: number } | undefined;\n\n // Event handlers\n private _transitionEndHandler: (evt: TransitionEvent) => void;\n private _documentKeydownHandler: (evt: KeyboardEvent) => void;\n private _backdropClickHandler: (evt: CustomEvent) => void;\n private _moveTargetMouseDownHandler: (evt: MouseEvent) => void;\n private _moveTargetMouseMoveHandler: (evt: MouseEvent) => void;\n private _moveTargetMouseUpHandler: (evt: MouseEvent) => void;\n\n constructor(public _adapter: IDialogAdapter) {\n this._transitionEndHandler = (evt: TransitionEvent) => this._onTransitionEnd();\n this._documentKeydownHandler = (evt: KeyboardEvent) => this._onDocumentKeydown(evt);\n this._backdropClickHandler = (evt: CustomEvent) => this._onBackdropClick(evt);\n this._moveTargetMouseDownHandler = (evt: MouseEvent) => this._onMoveTargetMouseDown(evt);\n this._moveTargetMouseMoveHandler = (evt: MouseEvent) => this._onMoveTargetMouseMove(evt);\n this._moveTargetMouseUpHandler = (evt: MouseEvent) => this._onMoveTargetMouseUp(evt);\n }\n\n public initialize(): void {\n this._adapter.initializeAccessibility();\n if (this._open) {\n if (this._moveable) {\n this._adapter.setMoveable(this._moveable);\n this._initMoveTarget();\n }\n }\n }\n\n public destroy(): void {\n if (this._open) {\n this._removeDragHandlers();\n this._adapter.deregisterTransitionEndHandler(this._transitionEndHandler);\n this._adapter.removeDocumentListener('keydown', this._documentKeydownHandler);\n this._adapter.deregisterBackdropClickHandler(this._backdropClickHandler);\n }\n }\n\n private async _applyOpen(value: boolean): Promise<void> {\n if (value) {\n if (typeof this._openCallback === 'function' && !await this._executeOpenCallback()) {\n return;\n }\n this._open = value;\n this._openDialog();\n } else {\n if (typeof this._closeCallback === 'function' && !await this._executeCloseCallback()) {\n return;\n }\n this._open = value;\n this._closeDialog();\n }\n\n this._adapter.toggleHostAttribute(DIALOG_CONSTANTS.attributes.OPEN, this._open);\n }\n\n private async _executeOpenCallback(): Promise<boolean> {\n try {\n return await Promise.resolve(this._openCallback()) !== false;\n } catch (e) {\n return false;\n }\n }\n\n private async _executeCloseCallback(): Promise<boolean> {\n try {\n return await Promise.resolve(this._closeCallback()) !== false;\n } catch (e) {\n return false;\n }\n }\n\n public initializeMoveTarget(): void {\n if (!this._moveTarget) {\n this._moveTarget = DIALOG_CONSTANTS.selectors.DFEAULT_MOVE_TARGET;\n }\n this._initMoveTarget();\n }\n\n public resetPosition(): void {\n this._adapter.setSurfacePosition(this._positionX, this._positionY, this._positionType);\n }\n\n public async show(parent?: HTMLElement): Promise<void> {\n if (this._open) {\n return;\n }\n \n this._open = true;\n if (!this._adapter.isConnected) {\n this._adapter.attach(parent);\n }\n await this._openDialog();\n }\n\n public async hide(remove?: boolean): Promise<void> {\n if (!this._open) {\n return;\n }\n\n this._open = false;\n await this._closeDialog();\n if (remove) {\n this._adapter.detach();\n }\n }\n\n private _normalizePositionValue(value: number | string | null | undefined): string | null {\n if (isNumber(value)) {\n return `${value}px`;\n } else if (isString(value)) {\n return value;\n }\n return null;\n }\n\n private _openDialog(): Promise<void> {\n if (!this._fullscreen) {\n if (this._moveable) {\n this._adapter.setMoveable(this._moveable);\n }\n if (this._positionX !== null || this._positionY !== null) {\n this._adapter.setSurfacePosition(this._positionX, this._positionY, this._positionType);\n }\n }\n\n this._adapter.setBodyAttribute(DIALOG_CONSTANTS.attributes.OPEN, 'true');\n this._adapter.registerTransitionEndHandler(this._transitionEndHandler);\n this._setDocumentKeydownListener(this._escapeClose);\n this._adapter.setAnimating(true);\n this._isAnimating = true;\n\n // Ensure transitions are triggered properly\n window.requestAnimationFrame(() => {\n window.requestAnimationFrame(() => {\n this._adapter.setVisibility(true);\n this._setBackdropClickListener(this._backdropClose); // Must come after setting visibility because the backdrop may not yet exist\n this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.OPEN);\n this._adapter.trySetInitialFocus();\n if (this._adapter.isScrollable()) {\n this._adapter.addRootClass(DIALOG_CONSTANTS.classes.SCROLLABLE);\n }\n });\n });\n\n return new Promise<void>(resolve => {\n // Wait for the dialog to finish animating open, then emit the ready event and attach any listeners\n window.setTimeout(() => {\n window.requestAnimationFrame(() => {\n if (this._open && this._isAnimating) {\n this._onTransitionEnd();\n resolve();\n }\n });\n }, DIALOG_CONSTANTS.numbers.ANIMATION_DURATION);\n });\n }\n\n private _closeDialog(): Promise<void> {\n if (this._moveTarget) {\n this._removeDragHandlers();\n }\n\n this._adapter.deregisterTransitionEndHandler(this._transitionEndHandler);\n\n if (this._escapeClose) {\n this._adapter.removeDocumentListener('keydown', this._documentKeydownHandler);\n }\n if (this._backdropClose) {\n this._adapter.deregisterBackdropClickHandler(this._backdropClickHandler);\n }\n\n this._isAnimating = false;\n this._moveContext = undefined;\n this._lastPosition = undefined;\n this._adapter.setAnimating(true);\n this._adapter.setVisibility(false);\n this._adapter.setSurfacePosition(null, null, null);\n\n return new Promise<void>(resolve => {\n setTimeout(() => {\n this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.CLOSE);\n const openDialogs = this._adapter.getOpenDialogs(`${DIALOG_CONSTANTS.elementName}[${DIALOG_CONSTANTS.attributes.OPEN}]`);\n if (!openDialogs.length) {\n this._adapter.removeBodyAttribute(DIALOG_CONSTANTS.attributes.OPEN);\n }\n this._adapter.setAnimating(false);\n resolve();\n }, DIALOG_CONSTANTS.numbers.ANIMATION_DURATION);\n });\n }\n\n private _onTransitionEnd(): void {\n if (!this._isAnimating) {\n return;\n }\n this._adapter.deregisterTransitionEndHandler(this._transitionEndHandler);\n this._adapter.setAnimating(false);\n this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.READY);\n this._adapter.tryLayoutChildren();\n if (this._moveable) {\n this._initMoveTarget();\n }\n this._isAnimating = false;\n }\n\n private _initMoveTarget(): void {\n if (!this._fullscreen && this._moveable && this._moveTarget && this._adapter.setMoveTarget(this._moveTarget)) {\n this._adapter.setMoveTargetHandler('mousedown', this._moveTargetMouseDownHandler);\n }\n }\n\n private _removeDragHandlers(): void {\n this._adapter.removeDragTargetHandler('mousedown', this._moveTargetMouseDownHandler);\n this._adapter.removeDocumentListener('mousemove', this._moveTargetMouseMoveHandler);\n this._adapter.removeDocumentListener('mouseup', this._moveTargetMouseUpHandler);\n }\n\n private _onMoveTargetMouseDown(evt: MouseEvent): void {\n evt.preventDefault();\n this._adapter.captureActiveElement();\n const bounds = this._adapter.getSurfaceBounds();\n this._moveContext = {\n top: evt.clientY - bounds.top,\n left: evt.clientX - bounds.left,\n height: bounds.height,\n width: bounds.width\n };\n this._adapter.setDocumentListener('mousemove', this._moveTargetMouseMoveHandler);\n this._adapter.setDocumentListener('mouseup', this._moveTargetMouseUpHandler);\n }\n\n private _onMoveTargetMouseMove(evt: MouseEvent): void {\n evt.preventDefault();\n const position = this._calculateOffsetPosition(evt.pageX, evt.pageY, this._moveContext);\n\n // If this is the beginning of the move sequence, we emit the start event (to allow for preventing default) and\n // then update the surface position if not prevented\n if (!this._isMoving) {\n this._isMoving = true;\n const canDrag = this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.MOVE_START, position as IDialogMoveStartEventData, true, true);\n if (!canDrag) {\n return;\n }\n }\n\n // Ensure that the surface position stays within the bounds of the screen\n const newPosition = this._clampPosition(position, this._moveContext);\n\n // Only update the position if it actually changed\n if (!this._lastPosition || newPosition.x !== this._lastPosition.x || newPosition.y !== this._lastPosition.y) {\n const canMove = this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.MOVED, newPosition as IDialogMoveStartEventData, true, true);\n if (canMove) {\n this._lastPosition = { ...newPosition };\n const newX = this._normalizePositionValue(newPosition.x);\n const newY = this._normalizePositionValue(newPosition.y);\n this._adapter.setSurfacePosition(newX, newY, 'absolute');\n }\n }\n }\n\n private _onMoveTargetMouseUp(evt: MouseEvent): void {\n if (this._isMoving) {\n this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.MOVE_END);\n }\n this._moveComplete();\n }\n\n private _moveComplete(): void {\n this._adapter.tryRestoreActiveElement();\n this._adapter.removeDocumentListener('mousemove', this._moveTargetMouseMoveHandler);\n this._adapter.removeDocumentListener('mouseup', this._moveTargetMouseUpHandler);\n this._lastPosition = undefined;\n this._moveContext = undefined;\n this._isMoving = false;\n }\n\n private _onDocumentKeydown(evt: KeyboardEvent): void {\n evt.stopPropagation();\n if (evt.key && (evt.key === 'Escape' || evt.key === 'Esc')) {\n this._tryClose();\n }\n }\n\n private _onBackdropClick(evt: CustomEvent): void {\n evt.stopPropagation();\n this._tryClose();\n }\n\n private async _tryClose(): Promise<void> {\n const isCancelled = !this._adapter.emitHostEvent(DIALOG_CONSTANTS.events.BEFORE_CLOSE, undefined, undefined, true);\n if (isCancelled) {\n return;\n }\n\n if (!this._beforeCloseCallback) {\n this.open = false;\n return;\n }\n\n try {\n const shouldClose = await Promise.resolve(this._beforeCloseCallback()) !== false;\n if (shouldClose) {\n this.open = false;\n return;\n }\n } catch (err) {\n return;\n }\n }\n\n private _setBackdropClickListener(attach: boolean): void {\n if (!this._open) {\n return;\n }\n\n if (attach && this._backdropClose) {\n this._adapter.registerBackdropClickHandler(this._backdropClickHandler);\n } else if (!attach) {\n this._adapter.deregisterBackdropClickHandler(this._backdropClickHandler);\n }\n }\n\n private _setDocumentKeydownListener(attach: boolean): void {\n if (!this._open) {\n return;\n }\n\n if (attach && this._escapeClose) {\n this._adapter.setDocumentListener('keydown', this._documentKeydownHandler);\n } else if (!attach) {\n this._adapter.removeDocumentListener('keydown', this._documentKeydownHandler);\n }\n }\n\n private _calculateOffsetPosition(pageX: number, pageY: number, context?: IDialogMoveContext): { x: number; y: number } {\n return {\n x: pageX - (context?.left || 0),\n y: pageY - (context?.top || 0)\n };\n }\n\n private _clampPosition({ x, y }: { x: number; y: number }, context?: IDialogMoveContext): { x: number; y: number } {\n let width = 0;\n let height = 0;\n\n if (context) {\n width = context.width;\n height = context.height;\n }\n\n if (x <= 0) {\n x = 0;\n } else if (x + width >= window.innerWidth) {\n x = window.innerWidth - width;\n }\n\n if (y <= 0) {\n y = 0;\n } else if (y + height >= window.innerHeight) {\n y = window.innerHeight - height;\n }\n\n return { x, y };\n }\n\n /** Controls whether clicking the backdrop closes the dialog or not. */\n public set backdropClose(value: boolean) {\n value = Boolean(value);\n if (this._backdropClose !== value) {\n this._backdropClose = value;\n\n this._setBackdropClickListener(this._backdropClose);\n\n if (isDefined(this._backdropClose)) {\n this._adapter.setHostAttribute(DIALOG_CONSTANTS.attributes.BACKDROP_CLOSE, this._backdropClose.toString());\n } else {\n this._adapter.removeHostAttribute(DIALOG_CONSTANTS.attributes.BACKDROP_CLOSE);\n }\n }\n }\n public get backdropClose(): boolean {\n return this._backdropClose;\n }\n\n /** Controls whether pressing the escape key closes the dialog or not. */\n public set escapeClose(value: boolean) {\n value = Boolean(value);\n if (this._escapeClose !== value) {\n this._escapeClose = value;\n this._setDocumentKeydownListener(this._escapeClose);\n if (isDefined(this._escapeClose)) {\n this._adapter.setHostAttribute(DIALOG_CONSTANTS.attributes.ESCAPE_CLOSE, this._escapeClose.toString());\n } else {\n this._adapter.removeHostAttribute(DIALOG_CONSTANTS.attributes.ESCAPE_CLOSE);\n }\n }\n }\n public get escapeClose(): boolean {\n return this._escapeClose;\n }\n\n public get open(): boolean {\n return this._open;\n }\n public set open(value: boolean) {\n if (this._open !== value) {\n value = Boolean(value);\n if (value !== this._open) {\n this._applyOpen(value);\n }\n }\n }\n\n public get fullscreen(): boolean {\n return this._fullscreen;\n }\n public set fullscreen(value: boolean) {\n if (this._fullscreen !== value) {\n this._fullscreen = value;\n this._adapter.setFullscreen(this._fullscreen);\n }\n }\n\n public get openCallback(): DialogStateCallback {\n return this._openCallback;\n }\n public set openCallback(callback: DialogStateCallback) {\n this._openCallback = callback;\n }\n\n public get closeCallback(): DialogStateCallback {\n return this._closeCallback;\n }\n public set closeCallback(callback: DialogStateCallback) {\n this._closeCallback = callback;\n }\n\n public get beforeCloseCallback(): DialogStateCallback {\n return this._beforeCloseCallback;\n }\n public set beforeCloseCallback(callback: DialogStateCallback) {\n this._beforeCloseCallback = callback;\n }\n\n public get positionType(): DialogPositionType {\n return this._positionType;\n }\n public set positionType(value: DialogPositionType) {\n if (this._positionType !== value) {\n this._positionType = value;\n if (this._open) {\n this._adapter.setSurfacePosition(this._positionX, this._positionY, this._positionType);\n }\n }\n }\n\n public get positionX(): number | string | null | undefined {\n return this._positionX;\n }\n public set positionX(value: number | string | null | undefined) {\n if (this._positionX !== value) {\n this._positionX = this._normalizePositionValue(value);\n if (this._open) {\n this._adapter.setSurfacePosition(this._positionX, this._positionY, this._positionType);\n }\n }\n }\n\n public get positionY(): number | string | null | undefined {\n return this._positionY;\n }\n public set positionY(value: number | string | null | undefined) {\n if (this._positionY !== value) {\n this._positionY = this._normalizePositionValue(value);\n if (this._open) {\n this._adapter.setSurfacePosition(this._positionX, this._positionY, this._positionType);\n }\n }\n }\n\n public get moveable(): boolean {\n return this._moveable;\n }\n public set moveable(value: boolean) {\n if (this._moveable !== value) {\n this._moveable = value;\n if (this._open) {\n this._adapter.setMoveable(this._moveable);\n if (this._moveable) {\n this._initMoveTarget();\n } else {\n this._removeDragHandlers();\n this._isMoving = false;\n }\n }\n }\n }\n\n public get moveTarget(): string {\n return this._moveTarget;\n }\n public set moveTarget(value: string) {\n this._moveTarget = value;\n }\n}\n", "import { getShadowElement, removeElement, deepQuerySelectorAll, getActiveElement, toggleClass } from '@tylertech/forge-core';\nimport { BACKDROP_CONSTANTS, IBackdropComponent } from '../backdrop';\nimport { CHECKBOX_CONSTANTS } from '../checkbox';\nimport { BaseAdapter, IBaseAdapter } from '../core/base/base-adapter';\nimport { ICON_BUTTON_CONSTANTS } from '../icon-button';\nimport { RADIO_CONSTANTS } from '../radio';\nimport { SWITCH_CONSTANTS } from '../switch';\nimport { IDialogComponent } from './dialog';\nimport { DialogPositionType, DIALOG_CONSTANTS } from './dialog-constants';\n\nexport interface IDialogAdapter extends IBaseAdapter {\n initializeAccessibility(): void;\n setAnimating(animating: boolean): void;\n setVisibility(visible: boolean): void;\n attach(parent?: HTMLElement): void;\n detach(): void;\n setDocumentListener(type: string, listener: (evt: Event) => void): void;\n removeDocumentListener(type: string, listener: (evt: Event) => void): void;\n registerTransitionEndHandler: (handler: (evt: TransitionEvent) => void) => void;\n deregisterTransitionEndHandler: (handler: (evt: TransitionEvent) => void) => void;\n registerBackdropClickHandler: (handler: (evt: CustomEvent) => void) => void;\n deregisterBackdropClickHandler: (handler: (evt: CustomEvent) => void) => void;\n getOpenDialogs: (selector: string) => NodeListOf<HTMLElement>;\n setBodyAttribute: (name: string, value: string) => void;\n removeBodyAttribute: (name: string) => void;\n trySetInitialFocus: () => void;\n isScrollable(): boolean;\n addRootClass(name: string): void;\n setFullscreen(value: boolean): void;\n setMoveable(value: boolean): void;\n tryLayoutChildren(): void;\n setMoveTarget(selector: string): boolean;\n setMoveTargetHandler(type: string, listener: (evt: MouseEvent) => void): void;\n removeDragTargetHandler(type: string, listener: (evt: MouseEvent) => void): void;\n getSurfaceBounds(): DOMRect;\n setSurfacePosition(x: string | null, y: string | null, positionType: DialogPositionType | null): void;\n captureActiveElement(): void;\n tryRestoreActiveElement(): void;\n}\n\n/**\n * Provides facilities for interacting with the internal DOM of `DialogComponent`.\n */\nexport class DialogAdapter extends BaseAdapter<IDialogComponent> implements IDialogAdapter {\n private _backdropElement?: IBackdropComponent;\n private _containerElement: HTMLElement;\n private _surfaceElement: HTMLElement;\n private _moveTargetElement: HTMLElement | null;\n private _activeElement: HTMLElement | undefined;\n\n constructor(component: IDialogComponent) {\n super(component);\n this._containerElement = getShadowElement(component, DIALOG_CONSTANTS.selectors.CONTAINER);\n this._surfaceElement = getShadowElement(component, DIALOG_CONSTANTS.selectors.SURFACE);\n }\n\n public initializeAccessibility(): void {\n if (!this._component.hasAttribute('role')) {\n this._component.setAttribute('role', 'dialog');\n }\n this._component.setAttribute('aria-modal', 'true');\n }\n\n public setAnimating(animating: boolean): void {\n toggleClass(this._containerElement, animating, DIALOG_CONSTANTS.classes.ANIMATING);\n }\n\n public setVisibility(visible: boolean): void {\n toggleClass(this._containerElement, visible, DIALOG_CONSTANTS.classes.OPEN);\n\n if (!this._backdropElement) {\n this._backdropElement = document.createElement('forge-backdrop');\n this._backdropElement.setAttribute('part', 'scrim');\n this._containerElement.appendChild(this._backdropElement);\n }\n \n if (visible) {\n this._backdropElement.fadeIn();\n } else {\n this._backdropElement.fadeOut();\n }\n }\n\n public attach(parent: HTMLElement = document.body): void {\n parent.appendChild(this._component);\n }\n\n public detach(): void {\n if (this._activeElement) {\n this._activeElement = undefined;\n }\n removeElement(this._component);\n }\n\n public registerTransitionEndHandler(handler: (evt: TransitionEvent) => void): void {\n this._surfaceElement.addEventListener('transitionend', handler);\n }\n\n public deregisterTransitionEndHandler(handler: (evt: TransitionEvent) => void): void {\n this._surfaceElement.removeEventListener('transitionend', handler);\n }\n\n public setDocumentListener(type: string, listener: (evt: Event) => void): void {\n document.addEventListener(type, listener);\n }\n\n public removeDocumentListener(type: string, listener: (evt: Event) => void): void {\n document.removeEventListener(type, listener);\n }\n\n public registerBackdropClickHandler(handler: (evt: CustomEvent) => void): void {\n this._backdropElement?.addEventListener(BACKDROP_CONSTANTS.events.BACKDROP_CLICK, handler);\n }\n\n public deregisterBackdropClickHandler(handler: (evt: CustomEvent) => void): void {\n this._backdropElement?.removeEventListener(BACKDROP_CONSTANTS.events.BACKDROP_CLICK, handler);\n }\n\n public getOpenDialogs(selector: string): NodeListOf<HTMLElement> {\n return document.querySelectorAll(selector);\n }\n\n public setBodyAttribute(name: string, value: string): void {\n document.body.setAttribute(name, value);\n }\n\n public removeBodyAttribute(name: string): void {\n document.body.removeAttribute(name);\n }\n\n public trySetInitialFocus(): void {\n const elements = deepQuerySelectorAll(this._component, DIALOG_CONSTANTS.selectors.INITIAL_FOCUS);\n if (elements && elements.length) {\n const initialElement = elements[elements.length - 1] as HTMLElement;\n initialElement.focus();\n }\n }\n\n public isScrollable(): boolean {\n const contentElement = this._component.querySelector(DIALOG_CONSTANTS.selectors.CONTENT) as HTMLElement;\n if (contentElement) {\n return contentElement.scrollHeight > contentElement.offsetHeight;\n }\n return false;\n }\n\n public addRootClass(name: string): void {\n this._component.classList.add(name);\n }\n\n public setFullscreen(value: boolean): void {\n toggleClass(this._containerElement, value, DIALOG_CONSTANTS.classes.FULLSCREEN);\n }\n\n public setMoveable(value: boolean): void {\n toggleClass(this._containerElement, value, DIALOG_CONSTANTS.classes.MOVEABLE);\n }\n\n public tryLayoutChildren(): void {\n const layoutChildren = [ICON_BUTTON_CONSTANTS.elementName, SWITCH_CONSTANTS.elementName, CHECKBOX_CONSTANTS.elementName, RADIO_CONSTANTS.elementName];\n const commonLayoutElements = Array.from(this._component.querySelectorAll(layoutChildren.join(','))) as any[];\n commonLayoutElements.filter(el => typeof el.layout === 'function').forEach(el => el.layout());\n }\n\n public setMoveTarget(selector: string): boolean {\n if (!selector) {\n return false;\n }\n this._moveTargetElement = this._component.querySelector(selector);\n return !!this._moveTargetElement;\n }\n\n public setMoveTargetHandler(type: string, listener: (evt: MouseEvent) => void): void {\n this._moveTargetElement?.addEventListener(type, listener);\n }\n\n public removeDragTargetHandler(type: string, listener: (evt: MouseEvent) => void): void {\n this._moveTargetElement?.removeEventListener(type, listener);\n }\n\n public getSurfaceBounds(): DOMRect {\n return this._surfaceElement.getBoundingClientRect() as DOMRect;\n }\n\n public setSurfacePosition(x: string | null, y: string | null, positionType: DialogPositionType | null): void {\n if (positionType) {\n this._surfaceElement.style.position = positionType === 'absolute' ? positionType : 'relative';\n } else {\n this._surfaceElement.style.removeProperty('position');\n }\n\n if (y !== null) {\n this._surfaceElement.style.top = y;\n } else {\n this._surfaceElement.style.removeProperty('top');\n }\n\n if (x !== null) {\n this._surfaceElement.style.left = x;\n } else {\n this._surfaceElement.style.removeProperty('left');\n }\n }\n\n public captureActiveElement(): void {\n this._activeElement = getActiveElement() as HTMLElement;\n this._activeElement?.blur();\n }\n\n public tryRestoreActiveElement(): void {\n if (this._activeElement) {\n if (this._activeElement.isConnected) {\n this._activeElement.focus();\n }\n this._activeElement = undefined;\n }\n }\n}\n", "import { CustomElement, attachShadowTemplate, coerceBoolean, FoundationProperty } from '@tylertech/forge-core';\n\nimport { DialogFoundation } from './dialog-foundation';\nimport { DialogAdapter } from './dialog-adapter';\nimport { DIALOG_CONSTANTS, DialogPositionType, IDialogMoveStartEventData, IDialogMoveEventData, DialogStateCallback } from './dialog-constants';\nimport { BackdropComponent } from '../backdrop';\nimport { BaseComponent, IBaseComponent } from '../core/base/base-component';\n\nconst template = '<template><div class=\\\"forge-dialog\\\" part=\\\"root\\\"><div class=\\\"forge-dialog__surface\\\" part=\\\"surface\\\"><slot></slot></div></div></template>';\nconst styles = '.forge-dialog{position:fixed;top:0;bottom:0;left:0;right:0;z-index:8;z-index:var(--forge-z-index-dialog,8);-webkit-box-align:center;align-items:center;-webkit-box-align:var(--forge-dialog-align-items,center);align-items:var(--forge-dialog-align-items,center);top:0;top:var(--forge-dialog-top,0);padding:24px;padding:var(--forge-dialog-padding,24px);display:-webkit-box;display:flex;-webkit-box-pack:center;justify-content:center;visibility:hidden}@media (max-width:599px){.forge-dialog{padding:0}}.forge-dialog--moveable:not(.forge-dialog--fullscreen) ::slotted([forge-dialog-move-target]){cursor:move}.forge-dialog--animating{visibility:visible}.forge-dialog--animating .forge-dialog--open .forge-dialog__surface{-webkit-transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1)}.forge-dialog--animating .forge-dialog__surface{-webkit-transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1);transition:transform 150ms 0s cubic-bezier(0, 0, .2, 1),-webkit-transform 150ms 0s cubic-bezier(0, 0, .2, 1)}.forge-dialog--scrollable .forge-dialog__footer,.forge-dialog--scrollable .forge-dialog__title{border-color:rgba(0,0,0,.12)}.forge-dialog--open{visibility:visible!important}.forge-dialog--open .forge-dialog__surface{-webkit-transform:scale(1);transform:scale(1);opacity:1}.forge-dialog__surface{-webkit-box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);box-shadow:0 11px 15px -7px rgba(0,0,0,.2),0 24px 38px 3px rgba(0,0,0,.14),0 9px 46px 8px rgba(0,0,0,.12);background-color:#fff;background-color:var(--mdc-theme-surface,#fff);width:auto;width:var(--forge-dialog-width,auto);height:auto;height:var(--forge-dialog-height,auto);min-width:280px;min-width:var(--forge-dialog-min-width,280px);max-width:100%;max-width:var(--forge-dialog-max-width,100%);max-height:100%;max-height:var(--forge-dialog-max-height,100%);border-radius:4px;border-radius:var(--forge-dialog-border-radius,var(--mdc-shape-medium,4px));display:-webkit-inline-box;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-transform:scale(.8);transform:scale(.8);opacity:0;overflow:hidden;z-index:inherit}.forge-dialog__header{margin:0;padding:0 24px 9px;border-bottom:1px solid transparent}.forge-dialog__title{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-size:1.25rem;font-size:var(--forge-typography-title-font-size, 1.25rem);line-height:2rem;line-height:var(--forge-typography-title-line-height, 2rem);font-weight:400;font-weight:var(--forge-typography-title-font-weight,400);letter-spacing:.0125em;letter-spacing:var(--forge-typography-title-letter-spacing, .0125em);text-decoration:inherit;-webkit-text-decoration:var(--forge-typography-title-text-decoration,inherit);text-decoration:var(--forge-typography-title-text-decoration,inherit);text-transform:inherit;text-transform:var(--forge-typography-title-text-transform,inherit);-webkit-box-sizing:border-box;box-sizing:border-box;margin:0}.forge-dialog__title::before{display:inline-block;width:0;height:40px;content:\\\"\\\";vertical-align:0}.forge-dialog__body{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body1-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:1rem;font-size:var(--mdc-typography-body1-font-size, 1rem);line-height:1.5rem;line-height:var(--mdc-typography-body1-line-height, 1.5rem);font-weight:400;font-weight:var(--mdc-typography-body1-font-weight,400);letter-spacing:.03125em;letter-spacing:var(--mdc-typography-body1-letter-spacing, .03125em);text-decoration:inherit;-webkit-text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-decoration:var(--mdc-typography-body1-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body1-text-transform,inherit);padding-top:20px;padding:0 24px 24px;overflow:auto}.forge-dialog__body--scrollable{max-height:195px;border-top:1px solid rgba(0,0,0,.1);border-bottom:1px solid rgba(0,0,0,.1);overflow-x:auto;overflow-y:scroll;-webkit-overflow-scrolling:touch}.forge-dialog__footer{display:-webkit-box;display:flex;position:relative;flex-shrink:0;flex-wrap:wrap;-webkit-box-align:center;align-items:center;-webkit-box-pack:end;justify-content:flex-end;-webkit-box-sizing:border-box;box-sizing:border-box;min-height:52px;margin:0;padding:8px;border-top:1px solid transparent}.forge-dialog--fullscreen{padding:0}.forge-dialog--fullscreen .forge-dialog__surface{height:100%;width:100%;min-width:auto;max-width:100%;border-radius:0}:host{display:block}:host([hidden]){display:none}';\n\nexport interface IDialogComponent extends IBaseComponent {\n backdropClose: boolean;\n escapeClose: boolean;\n open: boolean;\n fullscreen: boolean;\n openCallback: DialogStateCallback;\n closeCallback: DialogStateCallback;\n beforeCloseCallback: () => boolean | Promise<boolean>;\n positionType: DialogPositionType;\n positionX: number | string | null | undefined;\n positionY: number | string | null | undefined;\n moveable: boolean;\n moveTarget: string;\n initializeMoveTarget(): void;\n resetPosition(): void;\n show(parent?: HTMLElement): Promise<void>;\n hide(remove?: boolean): Promise<void>;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'forge-dialog': IDialogComponent;\n }\n\n interface HTMLElementEventMap {\n 'forge-dialog-before-close': CustomEvent<void>;\n 'forge-dialog-open': CustomEvent<void>;\n 'forge-dialog-close': CustomEvent<void>;\n 'forge-dialog-ready': CustomEvent<void>;\n 'forge-dialog-move-start': CustomEvent<IDialogMoveStartEventData>;\n 'forge-dialog-move': CustomEvent<IDialogMoveEventData>;\n 'forge-dialog-move-end': CustomEvent<void>;\n }\n}\n\n/**\n * The web component class behind the `<forge-dialog>` custom element.\n * \n * @tag forge-dialog\n */\n@CustomElement({\n name: DIALOG_CONSTANTS.elementName,\n dependencies: [BackdropComponent]\n})\nexport class DialogComponent extends BaseComponent implements IDialogComponent {\n public static get observedAttributes(): string[] {\n return [\n DIALOG_CONSTANTS.attributes.BACKDROP_CLOSE,\n DIALOG_CONSTANTS.attributes.ESCAPE_CLOSE,\n DIALOG_CONSTANTS.attributes.OPEN,\n DIALOG_CONSTANTS.attributes.FULLSCREEN,\n DIALOG_CONSTANTS.attributes.POSITION_TYPE,\n DIALOG_CONSTANTS.attributes.POSITION_X,\n DIALOG_CONSTANTS.attributes.POSITION_Y,\n DIALOG_CONSTANTS.attributes.MOVEABLE,\n DIALOG_CONSTANTS.attributes.MOVE_TARGET\n ];\n }\n\n private _foundation: DialogFoundation;\n\n constructor() {\n super();\n attachShadowTemplate(this, template, styles);\n this._foundation = new DialogFoundation(new DialogAdapter(this));\n }\n\n public connectedCallback(): void {\n this._foundation.initialize();\n }\n\n public disconnectedCallback(): void {\n this._foundation.destroy();\n }\n\n public attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n switch (name) {\n case DIALOG_CONSTANTS.attributes.BACKDROP_CLOSE:\n this.backdropClose = newValue === 'true';\n break;\n case DIALOG_CONSTANTS.attributes.ESCAPE_CLOSE:\n this.escapeClose = newValue === 'true';\n break;\n case DIALOG_CONSTANTS.attributes.OPEN:\n this.open = coerceBoolean(newValue);\n break;\n case DIALOG_CONSTANTS.attributes.FULLSCREEN:\n this.fullscreen = coerceBoolean(newValue);\n break;\n case DIALOG_CONSTANTS.attributes.POSITION_TYPE:\n this.positionType = newValue as DialogPositionType;\n break;\n case DIALOG_CONSTANTS.attributes.POSITION_X:\n this.positionX = newValue;\n break;\n case DIALOG_CONSTANTS.attributes.POSITION_Y:\n this.positionY = newValue;\n break;\n case DIALOG_CONSTANTS.attributes.MOVEABLE:\n this.moveable = coerceBoolean(newValue);\n break;\n case DIALOG_CONSTANTS.attributes.MOVE_TARGET:\n this.moveTarget = newValue;\n break;\n }\n }\n\n /** Controls whether clicking the backdrop closes the dialog or not. Default is true. */\n @FoundationProperty()\n public backdropClose: boolean;\n\n /** Controls whether pressing the escape key closes the dialog or not. Default is true. */\n @FoundationProperty()\n public escapeClose: boolean;\n\n /** Controls whether the dialog is open or not. Default is false. */\n @FoundationProperty()\n public open: boolean;\n\n /** Controls whether the dialog is full screen or not. Default is false. */\n @FoundationProperty()\n public fullscreen: boolean;\n\n /** The function to call when the dialog wants to open. */\n @FoundationProperty()\n public openCallback: DialogStateCallback;\n\n /** the function to call when the dialog wants to close. */\n @FoundationProperty()\n public closeCallback: DialogStateCallback;\n\n /** the function to call when the dialog wants to close. */\n @FoundationProperty()\n public beforeCloseCallback: () => boolean | Promise<boolean>;\n\n /** Gets/sets the position type when using custom positioning values. Default is 'absolute'. */\n @FoundationProperty()\n public positionType: DialogPositionType;\n\n /** Controls the horizontal position of the dialog surface. */\n @FoundationProperty()\n public positionX: number | string | null | undefined;\n\n /** Controls the vertical position of the dialog surface. */\n @FoundationProperty()\n public positionY: number | string | null | undefined;\n\n /** Gets/sets whether the dialog surface can be moved or not. */\n @FoundationProperty()\n public moveable: boolean;\n\n /** Gets/sets the selector used to target the element that is used as the drag target. */\n @FoundationProperty()\n public moveTarget: string;\n\n public initializeMoveTarget(): void {\n this._foundation.initializeMoveTarget();\n }\n\n public resetPosition(): void {\n this._foundation.resetPosition();\n }\n\n public show(parent?: HTMLElement): Promise<void> {\n return this._foundation.show(parent);\n }\n public hide(remove?: boolean): Promise<void> {\n return this._foundation.hide(remove);\n }\n}\n", "import { defineCustomElement } from '@tylertech/forge-core';\n\nimport { DialogComponent } from './dialog';\n\nexport * from './dialog-adapter';\nexport * from './dialog-constants';\nexport * from './dialog-foundation';\nexport * from './dialog';\n\nexport function defineDialogComponent(): void {\n defineCustomElement(DialogComponent);\n}\n"],
5
+ "mappings": "qlBAGA,GAAM,GAA2C,GAAG,UAE9C,EAAU,CACd,UAAW,0BACX,KAAM,qBACN,cAAe,+BACf,YAAa,qBACb,WAAY,2BACZ,WAAY,2BACZ,SAAU,wBACZ,EAEM,EAAa,CACjB,eAAgB,iBAChB,aAAc,eACd,WAAY,aACZ,cAAe,gBACf,WAAY,aACZ,WAAY,aACZ,SAAU,WACV,YAAa,cACb,KAAM,oBACN,cAAe,qBACf,oBAAqB,0BACvB,EAEM,EAAY,CAChB,UAAW,gBACX,QAAS,yBACT,SAAU,EAAmB,YAC7B,cAAe,IAAI,EAAW,iBAC9B,oBAAqB,IAAI,EAAW,uBACpC,QAAS,qBACX,EAEM,EAAS,CACb,aAAc,GAAG,iBACjB,KAAM,GAAG,SACT,MAAO,GAAG,UACV,MAAO,GAAG,UACV,WAAY,GAAG,eACf,MAAO,GAAG,SACV,SAAU,GAAG,YACf,EAEM,EAAU,CACd,mBAAoB,IACpB,qBAAsB,EACxB,EAEa,EAAmB,CAC9B,cACA,UACA,YACA,aACA,SACA,SACF,ECrCO,GAAM,GAAN,KAAoD,CA2BzD,YAAmB,EAA0B,CAA1B,gBAzBnB,KAAQ,MAAQ,GAChB,KAAQ,eAAiB,GACzB,KAAQ,aAAe,GACvB,KAAQ,YAAc,GAItB,KAAQ,cAAoC,WAC5C,KAAQ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AAC,EAAmB,GACb,AAzFI,EAyFJ,mCAIA,GADP,AAAC,EAAmB,GACb,AA7FI,EA6FJ,4BAIA,GADP,AAAC,EAAmB,GACb,AAjGI,EAiGJ,yBAIA,GADP,AAAC,EAAmB,GACb,AArGI,EAqGJ,yBAIA,GADP,AAAC,EAAmB,GACb,AAzGI,EAyGJ,wBAIA,GADP,AAAC,EAAmB,GACb,AA7GI,EA6GJ,0BA7GI,EAAN,GAJP,AAAC,EAAc,CACb,KAAM,EAAiB,YACvB,aAAc,CAAC,CAAiB,CAClC,CAAC,GACY,GC9CN,aAAuC,CAC5C,EAAoB,CAAe,CACrC",
6
+ "names": []
7
+ }
@@ -3,5 +3,5 @@
3
3
  * Copyright 2022 Tyler Technologies, Inc.
4
4
  * License: Apache-2.0
5
5
  */
6
- import{b as N}from"./chunk.BCUBTR5O.js";import{a as s,f as D,g as L,h as y}from"./chunk.ZFUVXYDL.js";import{b as A}from"./chunk.B5ABD4CZ.js";import{d as C}from"./chunk.IGMTMR3D.js";import{c as b}from"./chunk.D3DLVPPE.js";import{e as E}from"./chunk.7JTKKFL4.js";import{d as f}from"./chunk.K753A3KI.js";import{b as x}from"./chunk.JNOCXQVB.js";import{e as v}from"./chunk.DRFU6POI.js";import{b as S}from"./chunk.BOENNFXE.js";import{a as c}from"./chunk.B3IJU6XJ.js";import{a as _,b as h}from"./chunk.BSZ2LBJX.js";import{a as u,e as T}from"./chunk.HN4PXH3D.js";import{k as g}from"./chunk.G76HB2FK.js";import{a as m,f as a}from"./chunk.MCIQXNKY.js";var O=`${h}select-dropdown`,w={TARGET:"target",SELECTED_TEXT_TARGET:"selected-text-target",SYNC_SELECTED_TEXT:"sync-selected-text"},B=m({},w),M={SCROLLED_BOTTOM:`${O}-scrolled-bottom`},o={elementName:O,attributes:B,events:M};var l=class extends D{constructor(t){super(t);this._syncSelectedText=!1;this._originalTargetText="";this._targetDisconnectedListener=()=>this._onTargetDisconnected()}initialize(){this._tryAttach(),super.initialize()}disconnect(){super.disconnect(),this._adapter.isAttached()&&this._detach()}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}_applyValue(t){super._applyValue(t),this._applySelection()}_applySelection(){if(super._applySelection(),this._syncSelectedText||typeof this._selectedTextBuilder=="function"){let t=this._getSelectedText();t||(t=this._originalTargetText),this._adapter.setTargetText(t||"",this._selectedTextTarget)}}_tryAttach(){this._adapter.attach(this._target),this._adapter.isAttached()&&(this._targetDisconnectedDestructor=this._adapter.setTargetDisconnectedListener(this._targetDisconnectedListener),this._originalTargetText=this._adapter.getTargetText(this._selectedTextTarget),this.initializeTarget())}_detach(){this._adapter.detach(),this._targetDisconnectedDestructor&&(this._targetDisconnectedDestructor(),this._targetDisconnectedDestructor=void 0)}_onTargetDisconnected(){this._adapter.detach()}get target(){return this._target}set target(t){this._target!==t&&(this._target=t,this._adapter.isAttached()&&this._detach(),this._tryAttach())}get selectedTextTarget(){return this._selectedTextTarget}set selectedTextTarget(t){this._selectedTextTarget!==t&&(this._selectedTextTarget=t)}get syncSelectedText(){return this._syncSelectedText}set syncSelectedText(t){this._syncSelectedText!==t&&(this._syncSelectedText=t)}};var d=class extends y{constructor(e){super(e)}initializeAccessibility(){this._targetElement.setAttribute("role","listbox"),this._targetElement.setAttribute("aria-live","polite"),this._targetElement.setAttribute("aria-haspopup","true"),this._targetElement.setAttribute("aria-expanded","false")}addClickListener(e){this._targetElement.addEventListener("click",e)}removeClickListener(e){this._targetElement&&this._targetElement.removeEventListener("click",e)}addTargetListener(e,t){let i,r;e==="keydown"&&(i=!1,r=!0),this._targetElement.addEventListener(e,t,{passive:i,capture:r})}removeTargetListener(e,t){this._targetElement&&this._targetElement.removeEventListener(e,t)}updateActiveDescendant(e){e?this._targetElement.setAttribute("aria-activedescendant",e):this._targetElement.removeAttribute("aria-activedescendant")}open(e){super.open(e),this._targetElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._targetElement.setAttribute("aria-expanded","true")}close(){this._targetElement.setAttribute("aria-expanded","false"),this._targetElement.removeAttribute("aria-activedescendant"),this._targetElement.removeAttribute("aria-controls"),super.close()}attach(e){let r=(this._component.getRootNode()||HTMLDocument||this._component.ownerDocument||document).querySelector(e);r&&(this._targetElement=r)}detach(){this._targetElement=void 0}setMultiple(e){!this._targetElement||(e?this._targetElement.setAttribute("aria-multiselectable","true"):this._targetElement.removeAttribute("aria-multiselectable"))}setTargetDisconnectedListener(e){if(!this._targetElement||!this._targetElement.parentElement)return()=>{};let t=new MutationObserver(i=>{i.some(I=>Array.from(I.removedNodes).some(R=>R===this._targetElement))&&(t.disconnect(),e())});return t.observe(this._targetElement.parentElement,{childList:!0}),()=>t.disconnect()}isAttached(){return!!this._targetElement}setTargetText(e,t){let i=this._targetElement;if(t){let r=this._getElementBySelector(t);r&&(i=r)}i&&(i.textContent=e)}getTargetText(e){let t=e?this._getElementBySelector(e):this._targetElement;return t?t.innerText:""}_getElementBySelector(e){return this._targetElement.querySelector(e)||this._getRootNode().querySelector(e)}_getRootNode(){return this._component.getRootNode()||this._component.ownerDocument||document}};var P="<template></template>",H=":host{display:none}",n=class extends L{constructor(){super();T(this,P,H),this._foundation=new l(new d(this))}static get observedAttributes(){return[o.attributes.TARGET,o.attributes.SELECTED_TEXT_TARGET,o.attributes.SYNC_SELECTED_TEXT,s.attributes.VALUE,s.attributes.MULTIPLE,s.attributes.OBSERVE_SCROLL,s.attributes.OBSERVE_SCROLL_THRESHOLD,s.attributes.POPUP_CLASSES,s.attributes.OPTION_LIMIT,s.attributes.SYNC_POPUP_WIDTH]}attributeChangedCallback(t,i,r){switch(t){case o.attributes.TARGET:this.target=r;return;case o.attributes.SELECTED_TEXT_TARGET:this.selectedTextTarget=r;return;case o.attributes.SYNC_SELECTED_TEXT:this.syncSelectedText=g(r);return}super.attributeChangedCallback(t,i,r)}};a([c()],n.prototype,"target",2),a([c()],n.prototype,"selectedTextTarget",2),a([c()],n.prototype,"syncSelectedText",2),n=a([_({name:o.elementName,dependencies:[C,A,v,b,E,f,N,x,S]})],n);function pt(){u(n)}export{o as a,l as b,d as c,n as d,pt as e};
7
- //# sourceMappingURL=chunk.SLZFPWOH.js.map
6
+ import{b as N}from"./chunk.BCUBTR5O.js";import{a as s,f as D,g as L,h as y}from"./chunk.TCCPCDJK.js";import{b as A}from"./chunk.B5ABD4CZ.js";import{d as C}from"./chunk.IGMTMR3D.js";import{c as b}from"./chunk.D3DLVPPE.js";import{e as E}from"./chunk.7JTKKFL4.js";import{d as f}from"./chunk.K753A3KI.js";import{b as x}from"./chunk.JNOCXQVB.js";import{e as v}from"./chunk.3UMBCR4P.js";import{b as S}from"./chunk.BOENNFXE.js";import{a as c}from"./chunk.B3IJU6XJ.js";import{a as _,b as h}from"./chunk.BSZ2LBJX.js";import{a as u,e as T}from"./chunk.HN4PXH3D.js";import{k as g}from"./chunk.G76HB2FK.js";import{a as m,f as a}from"./chunk.MCIQXNKY.js";var O=`${h}select-dropdown`,w={TARGET:"target",SELECTED_TEXT_TARGET:"selected-text-target",SYNC_SELECTED_TEXT:"sync-selected-text"},B=m({},w),M={SCROLLED_BOTTOM:`${O}-scrolled-bottom`},o={elementName:O,attributes:B,events:M};var l=class extends D{constructor(t){super(t);this._syncSelectedText=!1;this._originalTargetText="";this._targetDisconnectedListener=()=>this._onTargetDisconnected()}initialize(){this._tryAttach(),super.initialize()}disconnect(){super.disconnect(),this._adapter.isAttached()&&this._detach()}_onDropdownScrollEnd(){this._adapter.emitHostEvent(o.events.SCROLLED_BOTTOM)}_applyValue(t){super._applyValue(t),this._applySelection()}_applySelection(){if(super._applySelection(),this._syncSelectedText||typeof this._selectedTextBuilder=="function"){let t=this._getSelectedText();t||(t=this._originalTargetText),this._adapter.setTargetText(t||"",this._selectedTextTarget)}}_tryAttach(){this._adapter.attach(this._target),this._adapter.isAttached()&&(this._targetDisconnectedDestructor=this._adapter.setTargetDisconnectedListener(this._targetDisconnectedListener),this._originalTargetText=this._adapter.getTargetText(this._selectedTextTarget),this.initializeTarget())}_detach(){this._adapter.detach(),this._targetDisconnectedDestructor&&(this._targetDisconnectedDestructor(),this._targetDisconnectedDestructor=void 0)}_onTargetDisconnected(){this._adapter.detach()}get target(){return this._target}set target(t){this._target!==t&&(this._target=t,this._adapter.isAttached()&&this._detach(),this._tryAttach())}get selectedTextTarget(){return this._selectedTextTarget}set selectedTextTarget(t){this._selectedTextTarget!==t&&(this._selectedTextTarget=t)}get syncSelectedText(){return this._syncSelectedText}set syncSelectedText(t){this._syncSelectedText!==t&&(this._syncSelectedText=t)}};var d=class extends y{constructor(e){super(e)}initializeAccessibility(){this._targetElement.setAttribute("role","listbox"),this._targetElement.setAttribute("aria-live","polite"),this._targetElement.setAttribute("aria-haspopup","true"),this._targetElement.setAttribute("aria-expanded","false")}addClickListener(e){this._targetElement.addEventListener("click",e)}removeClickListener(e){this._targetElement&&this._targetElement.removeEventListener("click",e)}addTargetListener(e,t){let i,r;e==="keydown"&&(i=!1,r=!0),this._targetElement.addEventListener(e,t,{passive:i,capture:r})}removeTargetListener(e,t){this._targetElement&&this._targetElement.removeEventListener(e,t)}updateActiveDescendant(e){e?this._targetElement.setAttribute("aria-activedescendant",e):this._targetElement.removeAttribute("aria-activedescendant")}open(e){super.open(e),this._targetElement.setAttribute("aria-controls",`list-dropdown-popup-${e.id}`),this._targetElement.setAttribute("aria-expanded","true")}close(){this._targetElement.setAttribute("aria-expanded","false"),this._targetElement.removeAttribute("aria-activedescendant"),this._targetElement.removeAttribute("aria-controls"),super.close()}attach(e){let r=(this._component.getRootNode()||HTMLDocument||this._component.ownerDocument||document).querySelector(e);r&&(this._targetElement=r)}detach(){this._targetElement=void 0}setMultiple(e){!this._targetElement||(e?this._targetElement.setAttribute("aria-multiselectable","true"):this._targetElement.removeAttribute("aria-multiselectable"))}setTargetDisconnectedListener(e){if(!this._targetElement||!this._targetElement.parentElement)return()=>{};let t=new MutationObserver(i=>{i.some(I=>Array.from(I.removedNodes).some(R=>R===this._targetElement))&&(t.disconnect(),e())});return t.observe(this._targetElement.parentElement,{childList:!0}),()=>t.disconnect()}isAttached(){return!!this._targetElement}setTargetText(e,t){let i=this._targetElement;if(t){let r=this._getElementBySelector(t);r&&(i=r)}i&&(i.textContent=e)}getTargetText(e){let t=e?this._getElementBySelector(e):this._targetElement;return t?t.innerText:""}_getElementBySelector(e){return this._targetElement.querySelector(e)||this._getRootNode().querySelector(e)}_getRootNode(){return this._component.getRootNode()||this._component.ownerDocument||document}};var P="<template></template>",H=":host{display:none}",n=class extends L{constructor(){super();T(this,P,H),this._foundation=new l(new d(this))}static get observedAttributes(){return[o.attributes.TARGET,o.attributes.SELECTED_TEXT_TARGET,o.attributes.SYNC_SELECTED_TEXT,s.attributes.VALUE,s.attributes.MULTIPLE,s.attributes.OBSERVE_SCROLL,s.attributes.OBSERVE_SCROLL_THRESHOLD,s.attributes.POPUP_CLASSES,s.attributes.OPTION_LIMIT,s.attributes.SYNC_POPUP_WIDTH]}attributeChangedCallback(t,i,r){switch(t){case o.attributes.TARGET:this.target=r;return;case o.attributes.SELECTED_TEXT_TARGET:this.selectedTextTarget=r;return;case o.attributes.SYNC_SELECTED_TEXT:this.syncSelectedText=g(r);return}super.attributeChangedCallback(t,i,r)}};a([c()],n.prototype,"target",2),a([c()],n.prototype,"selectedTextTarget",2),a([c()],n.prototype,"syncSelectedText",2),n=a([_({name:o.elementName,dependencies:[C,A,v,b,E,f,N,x,S]})],n);function pt(){u(n)}export{o as a,l as b,d as c,n as d,pt as e};
7
+ //# sourceMappingURL=chunk.WUIIZZQD.js.map