@watermarkinsights/ripple 5.7.0-9 → 5.7.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.
- package/dist/cjs/{global-80ed0881.js → global-eddf4e56.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/priv-option-list.cjs.entry.js +13 -2
- package/dist/cjs/ripple.cjs.js +1 -1
- package/dist/cjs/wm-modal-pss_3.cjs.entry.js +24 -23
- package/dist/collection/components/selects/priv-option-list/priv-option-list.css +10 -0
- package/dist/collection/components/selects/priv-option-list/priv-option-list.js +12 -1
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.css +12 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-footer.js +1 -1
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.css +12 -0
- package/dist/collection/components/wm-modal-pss/wm-modal-pss-header.js +3 -2
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.css +16 -2
- package/dist/collection/components/wm-modal-pss/wm-modal-pss.js +12 -11
- package/dist/collection/dev/pss-modal.js +8 -0
- package/dist/collection/dev/scripts.js +12 -15
- package/dist/esm/{chartFunctions-dfcb1edf.js → chartFunctions-34f19953.js} +1 -1
- package/dist/esm/{functions-b791a892.js → functions-8800c690.js} +1 -1
- package/dist/esm/{global-525745d2.js → global-e7316cfe.js} +1 -1
- package/dist/esm/{intl-f2f7ce8b.js → intl-b110ca8d.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/priv-calendar.entry.js +1 -1
- package/dist/esm/priv-chart-popover.entry.js +1 -1
- package/dist/esm/priv-option-list.entry.js +14 -3
- package/dist/esm/ripple.js +1 -1
- package/dist/esm/wm-action-menu_2.entry.js +1 -1
- package/dist/esm/wm-button.entry.js +1 -1
- package/dist/esm/wm-chart.entry.js +3 -3
- package/dist/esm/wm-date-range.entry.js +1 -1
- package/dist/esm/wm-datepicker.entry.js +1 -1
- package/dist/esm/wm-file.entry.js +1 -1
- package/dist/esm/wm-input.entry.js +2 -2
- package/dist/esm/wm-line-chart.entry.js +3 -3
- package/dist/esm/wm-modal-pss_3.entry.js +22 -21
- package/dist/esm/wm-modal_3.entry.js +2 -2
- package/dist/esm/wm-navigation_3.entry.js +2 -2
- package/dist/esm/wm-navigator.entry.js +1 -1
- package/dist/esm/wm-nested-select.entry.js +2 -2
- package/dist/esm/wm-optgroup.entry.js +1 -1
- package/dist/esm/wm-option_2.entry.js +2 -2
- package/dist/esm/wm-pagination.entry.js +1 -1
- package/dist/esm/wm-progress-indicator_3.entry.js +2 -2
- package/dist/esm/wm-search.entry.js +2 -2
- package/dist/esm/wm-snackbar.entry.js +2 -2
- package/dist/esm/wm-tab-item_3.entry.js +1 -1
- package/dist/esm/wm-tag-input.entry.js +2 -2
- package/dist/esm/wm-tag-option.entry.js +1 -1
- package/dist/esm/wm-textarea.entry.js +2 -2
- package/dist/esm/wm-timepicker.entry.js +1 -1
- package/dist/esm/wm-toggletip.entry.js +1 -1
- package/dist/esm/wm-uploader.entry.js +2 -2
- package/dist/esm-es5/{chartFunctions-dfcb1edf.js → chartFunctions-34f19953.js} +1 -1
- package/dist/esm-es5/{functions-b791a892.js → functions-8800c690.js} +1 -1
- package/dist/esm-es5/global-e7316cfe.js +1 -0
- package/dist/esm-es5/{intl-f2f7ce8b.js → intl-b110ca8d.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/priv-calendar.entry.js +1 -1
- package/dist/esm-es5/priv-chart-popover.entry.js +1 -1
- package/dist/esm-es5/priv-option-list.entry.js +1 -1
- package/dist/esm-es5/ripple.js +1 -1
- package/dist/esm-es5/wm-action-menu_2.entry.js +1 -1
- package/dist/esm-es5/wm-button.entry.js +1 -1
- package/dist/esm-es5/wm-chart.entry.js +1 -1
- package/dist/esm-es5/wm-date-range.entry.js +1 -1
- package/dist/esm-es5/wm-datepicker.entry.js +1 -1
- package/dist/esm-es5/wm-file.entry.js +1 -1
- package/dist/esm-es5/wm-input.entry.js +1 -1
- package/dist/esm-es5/wm-line-chart.entry.js +1 -1
- package/dist/esm-es5/wm-modal-pss_3.entry.js +1 -1
- package/dist/esm-es5/wm-modal_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigation_3.entry.js +1 -1
- package/dist/esm-es5/wm-navigator.entry.js +1 -1
- package/dist/esm-es5/wm-nested-select.entry.js +1 -1
- package/dist/esm-es5/wm-optgroup.entry.js +1 -1
- package/dist/esm-es5/wm-option_2.entry.js +1 -1
- package/dist/esm-es5/wm-pagination.entry.js +1 -1
- package/dist/esm-es5/wm-progress-indicator_3.entry.js +1 -1
- package/dist/esm-es5/wm-search.entry.js +1 -1
- package/dist/esm-es5/wm-snackbar.entry.js +1 -1
- package/dist/esm-es5/wm-tab-item_3.entry.js +1 -1
- package/dist/esm-es5/wm-tag-input.entry.js +1 -1
- package/dist/esm-es5/wm-tag-option.entry.js +1 -1
- package/dist/esm-es5/wm-textarea.entry.js +1 -1
- package/dist/esm-es5/wm-timepicker.entry.js +1 -1
- package/dist/esm-es5/wm-toggletip.entry.js +1 -1
- package/dist/esm-es5/wm-uploader.entry.js +1 -1
- package/dist/ripple/{p-21d372ed.js → p-02dc1562.js} +1 -1
- package/dist/ripple/{p-ca971eac.system.entry.js → p-037bf5c7.system.entry.js} +1 -1
- package/dist/ripple/{p-ff1ed90f.entry.js → p-04d5e7d7.entry.js} +1 -1
- package/dist/ripple/{p-b01f9998.system.entry.js → p-0eea8fd3.system.entry.js} +1 -1
- package/dist/ripple/{p-1d18d9d2.system.entry.js → p-0faf7ef9.system.entry.js} +1 -1
- package/dist/ripple/{p-eefbca0e.system.js → p-10745cf2.system.js} +1 -1
- package/dist/ripple/{p-45f9ad09.entry.js → p-13cc92e7.entry.js} +1 -1
- package/dist/ripple/{p-236af552.entry.js → p-1618709f.entry.js} +1 -1
- package/dist/ripple/{p-bf7d98d8.entry.js → p-1c7201d1.entry.js} +1 -1
- package/dist/ripple/{p-c853e185.system.entry.js → p-2520d947.system.entry.js} +1 -1
- package/dist/ripple/{p-6d129ef8.system.entry.js → p-29f41fea.system.entry.js} +1 -1
- package/dist/ripple/{p-f24572f5.entry.js → p-2c028fe2.entry.js} +1 -1
- package/dist/ripple/{p-3e415c49.system.entry.js → p-2f565d7a.system.entry.js} +1 -1
- package/dist/ripple/{p-02deae76.entry.js → p-31b587a3.entry.js} +1 -1
- package/dist/ripple/{p-41550baa.entry.js → p-3212fd0e.entry.js} +1 -1
- package/dist/ripple/{p-215793a4.entry.js → p-34d80f95.entry.js} +1 -1
- package/dist/ripple/{p-f2101a0d.entry.js → p-37649315.entry.js} +1 -1
- package/dist/ripple/{p-725230dd.system.entry.js → p-38509918.system.entry.js} +1 -1
- package/dist/ripple/{p-aea13873.entry.js → p-3aca84d7.entry.js} +1 -1
- package/dist/ripple/{p-0b1c6965.system.entry.js → p-3bb1f795.system.entry.js} +1 -1
- package/dist/ripple/{p-828adbf1.system.js → p-4378b6b9.system.js} +1 -1
- package/dist/ripple/{p-ed1f6b8d.system.entry.js → p-43b03ad8.system.entry.js} +1 -1
- package/dist/ripple/{p-fa4f1030.system.entry.js → p-4743176d.system.entry.js} +1 -1
- package/dist/ripple/{p-c2e00d4a.system.entry.js → p-4c5606da.system.entry.js} +1 -1
- package/dist/ripple/p-5360487b.js +1 -0
- package/dist/ripple/p-54d7688a.entry.js +1 -0
- package/dist/ripple/{p-eddbcb21.js → p-5943c8b1.js} +1 -1
- package/dist/ripple/{p-2e79fa49.entry.js → p-5ea1c7a6.entry.js} +1 -1
- package/dist/ripple/{p-1389302e.system.entry.js → p-5eb02aa9.system.entry.js} +1 -1
- package/dist/ripple/{p-6cc07645.system.entry.js → p-6025efee.system.entry.js} +1 -1
- package/dist/ripple/p-6692b5a6.entry.js +1 -0
- package/dist/ripple/{p-db9657eb.system.entry.js → p-6a4c59e0.system.entry.js} +1 -1
- package/dist/ripple/{p-5284791c.entry.js → p-6ad695a5.entry.js} +1 -1
- package/dist/ripple/{p-149a22bf.entry.js → p-6d2122b9.entry.js} +1 -1
- package/dist/ripple/{p-30b905eb.system.entry.js → p-6eb50cc3.system.entry.js} +1 -1
- package/dist/ripple/{p-012cab20.entry.js → p-72c22a55.entry.js} +1 -1
- package/dist/ripple/{p-505eca1c.system.entry.js → p-7906a797.system.entry.js} +1 -1
- package/dist/ripple/{p-749597da.system.entry.js → p-7b982ba8.system.entry.js} +1 -1
- package/dist/ripple/{p-83be63f6.entry.js → p-7e4866c3.entry.js} +1 -1
- package/dist/ripple/{p-84ba5b74.entry.js → p-870cf4ef.entry.js} +1 -1
- package/dist/ripple/{p-1e625a5e.entry.js → p-8f217fb1.entry.js} +1 -1
- package/dist/ripple/{p-f4bcee58.system.entry.js → p-90261a03.system.entry.js} +1 -1
- package/dist/ripple/{p-f40e1468.system.entry.js → p-9a2cf94c.system.entry.js} +1 -1
- package/dist/ripple/{p-cff5d7e9.system.entry.js → p-9fccdac8.system.entry.js} +1 -1
- package/dist/ripple/p-a4061c96.system.js +1 -0
- package/dist/ripple/p-ae4c8481.system.entry.js +1 -0
- package/dist/ripple/{p-c1e3c2fb.entry.js → p-b01d022f.entry.js} +1 -1
- package/dist/ripple/{p-b9dbf1f4.entry.js → p-b0e099f8.entry.js} +1 -1
- package/dist/ripple/{p-c47fab48.entry.js → p-b19ea29e.entry.js} +1 -1
- package/dist/ripple/{p-e687176d.entry.js → p-b3114a58.entry.js} +1 -1
- package/dist/ripple/{p-5300b15d.entry.js → p-b976c84b.entry.js} +1 -1
- package/dist/ripple/{p-226fe4e0.entry.js → p-c2657183.entry.js} +1 -1
- package/dist/ripple/{p-a3c01e10.system.entry.js → p-c39a3951.system.entry.js} +1 -1
- package/dist/ripple/{p-3deaf4d9.system.entry.js → p-cbd2473d.system.entry.js} +1 -1
- package/dist/ripple/{p-3d50db36.entry.js → p-cedfcf23.entry.js} +1 -1
- package/dist/ripple/{p-a0ecb6d7.system.entry.js → p-d824406e.system.entry.js} +1 -1
- package/dist/ripple/{p-6fdfe9f4.system.entry.js → p-dd26ae24.system.entry.js} +1 -1
- package/dist/ripple/{p-cad0c5f9.system.entry.js → p-dd76bf0a.system.entry.js} +1 -1
- package/dist/ripple/{p-e081fdc2.system.entry.js → p-e28671cd.system.entry.js} +1 -1
- package/dist/ripple/{p-72165bd2.entry.js → p-e4ff7200.entry.js} +1 -1
- package/dist/ripple/{p-df157138.entry.js → p-e53b6f7c.entry.js} +1 -1
- package/dist/ripple/{p-16f65bf4.js → p-eca78c2b.js} +1 -1
- package/dist/ripple/{p-ae82b3d2.system.js → p-edd87140.system.js} +1 -1
- package/dist/ripple/{p-81c2df85.system.js → p-ee31c799.system.js} +1 -1
- package/dist/ripple/{p-f90e4094.entry.js → p-f05e38b1.entry.js} +1 -1
- package/dist/ripple/p-f367f027.system.entry.js +1 -0
- package/dist/ripple/{p-5a9e3108.system.entry.js → p-f9d26f8b.system.entry.js} +1 -1
- package/dist/ripple/ripple.esm.js +1 -1
- package/dist/ripple/ripple.js +1 -1
- package/dist/types/components/wm-modal-pss/wm-modal-pss-footer.d.ts +1 -1
- package/dist/types/components/wm-modal-pss/wm-modal-pss-header.d.ts +1 -1
- package/dist/types/components/wm-modal-pss/wm-modal-pss.d.ts +33 -0
- package/package.json +1 -1
- package/dist/esm-es5/global-525745d2.js +0 -1
- package/dist/ripple/p-01035c8e.system.js +0 -1
- package/dist/ripple/p-1092e5ce.js +0 -1
- package/dist/ripple/p-249add87.system.entry.js +0 -1
- package/dist/ripple/p-5254f902.entry.js +0 -1
- package/dist/ripple/p-6e725656.system.entry.js +0 -1
- package/dist/ripple/p-f13b034e.entry.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,f as i,h as r,g as o}from"./p-568c595f.js";import{i as a,d as s,u as n,m as l,h,v as d,w as c,s as p,k as g,x as u}from"./p-16f65bf4.js";import{g as m}from"./p-21d372ed.js";const w=class{constructor(r){t(this,r),this.wmTagInputTagAdded=e(this,"wmTagInputTagAdded",7),this.addNewHelpText=a.formatMessage({id:"tagInput.addNewHelpText",defaultMessage:"Press the Enter or Comma key to add a new tag.",description:"Help text appearing in a dropdown. Use imperative"}),this.selectionHelpText=a.formatMessage({id:"tagInput.selectionHelpText",defaultMessage:"Search and select a tag.",description:"Help text appearing in a dropdown. Use imperative"}),this.maxTagsReachedMessage=a.formatMessage({id:"tagInput.maxTagsReached",defaultMessage:"No more tags can be added because the limit has been reached."}),this.tagAreaInstructions=a.formatMessage({id:"tagInput.tagAreaInstructions",defaultMessage:"tag selection. Press Backspace or Delete to remove a tag."}),this.tagsAddedMessage=a.formatMessage({id:"tagInput.tagsAdded",defaultMessage:"Tags added",description:"Full message for context: 'Tags added: x/y"}),this.openUp=!1,this.inModal=!1,this.debouncedUpdate=s((()=>i(this.el)),30),this.label=void 0,this.errorMessage=void 0,this.info=void 0,this.labelPosition="top",this.maxTags=void 0,this.placeholder=void 0,this.requiredField=!1,this.tagInputType="dropdown",this.helpText=void 0,this.addNew=!0,this.characterLimit=50,this.colHeaders=void 0,this.colWidths=void 0,this.colWrap=void 0,this.isKeying=!1,this.isExpanded=!1,this.liveRegionMessage="",this.focusedOption=void 0,this.focusedColumn=0,this.focusedTagIndex=void 0,this.tagsList=[]}toggleKeyingOn(){this.isKeying=!0}toggleKeyingOff(){this.isKeying=!1}get isDropdown(){return"dropdown"===this.tagInputType}get isTable(){return"table"===this.tagInputType}get charCount(){return this.inputEl?this.inputEl.value.length:0}get tooltipVisible(){return document.getElementById("wm-tooltip").classList.contains("show")}get optionEls(){return Array.from(this.el.querySelectorAll("wm-tag-option"))}get filteredOptionEls(){const t=this.inputEl?this.inputEl.value.toLowerCase():"";return Array.from(this.optionEls).filter((e=>{let i="";return this.isDropdown?i=e.textContent.toLowerCase():this.isTable&&(i=[e.col1,e.col2,e.col3,e.col4].join("").toLowerCase()),i.includes(t)}))}get taggedOptions(){return this.optionEls.filter((t=>t.selected||t.locked))}get _tagEls(){return this.tagAreaEl?Array.from(this.tagAreaEl.querySelectorAll(".tag")):[]}get focusedTag(){if(void 0!==this.focusedTagIndex&&this.focusedTagIndex>=0)return this._tagEls[this.focusedTagIndex]}tagOptionFromEl(t){return"add-new-btn"===t.id?void 0:this.el.querySelector("#"+t.id)}tagOptionFromTag(t){const e=t.id.replace("tag-","");return this.el.querySelector("#"+e)}elFromTagOption(t){return this.el.shadowRoot.querySelector("#"+t.id)}get _focusedOption(){return this.focusedOption?this.elFromTagOption(this.focusedOption):this.addNewButton&&this.addNewButton.classList.contains("focused")?this.addNewButton:void 0}get _focusedCell(){if(this._focusedOption)return Array.from(this._focusedOption.querySelectorAll("td"))[this.focusedColumn||0]}get inputActiveDescendantId(){return this._focusedOption?this.isTable?Array.from(this._focusedOption.querySelectorAll("td"))[this.focusedColumn].id:this._focusedOption.id:null}get tagLimitReached(){return!!(this.maxTags&&this.taggedOptions.length>=this.maxTags)}get noResultsMessage(){return a.formatMessage({id:"tagInput.noResults",defaultMessage:"No results match your search.",description:"Message displayed when a user's search returns empty."})}get inputMinimumWidth(){if(this._tagEls){const t=getComputedStyle(this.inputEl),e=getComputedStyle(this._tagEls[this._tagEls.length-1]),i=[t.paddingLeft,t.paddingRight,t.marginLeft,t.marginRight,e.marginRight].reduce(((t,e)=>t+parseInt(e.replace("px",""))),0);return Math.max(150,n(this.inputEl,this.placeholder).width+i)}return 150}getTagName(t){return this.isDropdown?t.textContent:t.col1}isExistingTag(t){return this.optionEls.map((t=>this.getTagName(t).toLowerCase())).includes(t.toLowerCase())}tagAddedMessage(t){return a.formatMessage({id:"tagInput.tagAdded",defaultMessage:"{tagName} added.",description:"A confirmation for adding a tag."},{tagName:t})}tagRemovedMessage(t){return a.formatMessage({id:"tagInput.tagRemoved",defaultMessage:"{tagName} removed.",description:"A confirmation for removing a tag."},{tagName:t})}tagAlreadyAddedMessage(t){return a.formatMessage({id:"tagInput.tagAlreadyAdded",defaultMessage:"{tagName} has already been added.",description:"An alert for adding a tag that is already present."},{tagName:t})}tagLockedMessage(t){return a.formatMessage({id:"tagInput.tagLocked",defaultMessage:"{tagName} is locked and cannot be removed.",description:"An alert for when a user tries to remove a tag that is locked."},{tagName:t})}isElOrChild(t){return t===this.el||this.el.shadowRoot.contains(t)||this.el.contains(t)}componentWillLoad(){this.placeholder||(this.placeholder=this.createPlaceholderDefault(this.addNew,this.optionEls.length>0)),this.label||console.error("wm-tag-input must have a label property"),this.el.focus=()=>{const t=this._tagEls[0];t?(this.tagAreaEl.focus(),this.focusTag(t)):this.inputEl.focus()},new ResizeObserver((()=>this.debouncedUpdate())).observe(this.el),this.el.closest("wm-modal")&&(this.inModal=!0);const t=[],e=[];this.optionEls.forEach((i=>{i.locked?t.push(i):i.selected&&e.push(i)})),this.tagsList=[...t,...e]}componentDidLoad(){new MutationObserver((t=>t.forEach((t=>this.handleChangeAnnouncement(t))))).observe(this.el,{subtree:!0,attributes:!0,attributeFilter:["selected"],childList:!0}),new MutationObserver((t=>t.forEach((t=>this.handleOptionListChange(t))))).observe(this.el,{childList:!0}),this.tagAreaEl&&new MutationObserver((t=>t.forEach((t=>this.handleTagListChange(t))))).observe(this.tagAreaEl,{childList:!0})}handleChangeAnnouncement(t){const e=t.target;if("childList"==t.type&&t.removedNodes.length>0)this.announce(this.tagRemovedMessage(t.removedNodes[0].textContent));else if("attributes"==t.type){const t=this.getTagName(e);if(e.selected){let e=this.tagAddedMessage(t);this.tagLimitReached&&(e+=` ${this.maxTagsReachedMessage}`),this.announce(e)}else this.announce(this.tagRemovedMessage(t))}}handleOptionListChange(t){const e=Array.from(t.addedNodes);e.length>0&&e.forEach((t=>!this.tagsList.includes(t)&&this.tagsList.push(t)));const i=Array.from(t.removedNodes);i.length>0&&(this.tagsList=this.tagsList.filter((t=>!i.includes(t))))}handleTagOptionSelected(t){this.tagsList=this.tagsList.concat(t.target)}handleTagOptionDeselected(t){const e=t.target;this.tagsList=this.tagsList.filter((t=>t!=e))}handleTagListChange(t){const e=Array.from(t.addedNodes);e&&e.forEach((t=>{t.classList.add("highlight")}));const i=t.removedNodes[0];i&&(i.classList.remove("highlight"),this.focusedTag?this.focusTag(this.focusedTag):this._tagEls.length>0?this.focusTag(this._tagEls[this._tagEls.length-1]):this.inputEl.focus())}componentDidRender(){this.positionInput(),this._tagEls.forEach((t=>{const e=t.querySelector(".tag-text"),i=this.el.shadowRoot.querySelector(".tags-and-input-wrapper"),r=e.getBoundingClientRect().left,o=i.getBoundingClientRect().right-10-8-28,a=t.id.replace("tag-",""),s=a&&this.el.querySelector("#"+a);s&&(e.textContent=l(e,this.getTagName(s),o-r,5))}))}createPlaceholderDefault(t,e){const i=a.formatMessage({id:"tagInput.placeholderAddAndSearch",defaultMessage:"Add or search for a tag",description:"Placeholder text. Use imperative"}),r=a.formatMessage({id:"tagInput.placeholderSearch",defaultMessage:"Search and select a tag",description:"Placeholder text. Use imperative"}),o=a.formatMessage({id:"tagInput.placeholderAdd",defaultMessage:"Add a new tag",description:"Placeholder text. Use imperative"});let s="";return t&&e?s=i:!t&&e?s=r:t&&(s=o),s}handleClick(t){this.isDropdown&&!this.el.contains(t.target)&&this.isExpanded&&this.closeDropdown()}announceError(){this.errorMessage&&setTimeout((()=>this.announce(this.errorMessage)),100)}handleOptionClick(t){let e;t.preventDefault(),this.resetInput(),this.isTable?(e=t.target,e=this.tagOptionFromEl(e.closest("tr"))):e=this.tagOptionFromEl(t.target),e.click(),e.locked?this.announce(this.tagLockedMessage(this.getTagName(e))):e.selected?this.isTable&&e.emitDeselectedEvent():e.emitSelectedEvent()}dismissTooltip(){this.tooltipVisible&&h()}handleInputKeyDown(t){switch(/^.$/.test(t.key)&&this.charCount>=this.characterLimit&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),t.key){case"Enter":t.preventDefault(),this.handleInputEnter();break;case"ArrowDown":t.preventDefault(),this.handleInputArrowDown();break;case"ArrowUp":t.preventDefault(),this.handleInputArrowUp();break;case"ArrowLeft":this.isTable&&(t.preventDefault(),this.focusPrevCell());break;case"ArrowRight":this.isTable&&(t.preventDefault(),this.focusNextCell());break;case"Escape":this.isDropdown&&this.isExpanded&&(t.preventDefault(),this.closeDropdown());break;case"ArrowLeft":case"Backspace":this.handleInputBackspace()}}handleInputFocus(){this.isDropdown&&(this.openDropdown(),this.clearOptionFocus())}handleInputChanged(t){this.clearOptionFocus(),this.isDropdown&&(this.charCount>=this.characterLimit-5&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),this.isExpanded||this.openDropdown());const e=t.target.value;e.includes(",")&&this.addNew?this.addTags(e):this.announceExistingOptions()}handleInputEnter(){if(this.focusedOption)this.focusedOption.locked?this.announce(this.tagLockedMessage(this.getTagName(this.focusedOption))):(this.focusedOption.click(),this.focusedOption.selected?this.isTable&&this.focusedOption.emitDeselectedEvent():this.focusedOption.emitSelectedEvent(),this.resetInput());else if(this.isDropdown){const t=this.inputEl.value;t&&(this.isExistingTag(t)?this.announce(this.tagAlreadyAddedMessage(t)):this.addTags(t),this.resetInput())}}handleInputArrowDown(){if(this.isDropdown)if(this.isExpanded){let t=[];this.addNewButton&&"add-new-btn"===this.addNewButton.id&&t.push(this.addNewButton),this.filteredOptionEls.forEach((e=>{t.push(this.elFromTagOption(e))}));const e=d(t,this._focusedOption,!0);this.focusOption(e)}else this.openDropdown();else{const t=this.filteredOptionEls.map((t=>this.elFromTagOption(t))),e=d(t,this._focusedOption,!0);this.focusOption(e)}}handleInputArrowUp(){if(this.isDropdown)if(this.isExpanded){let t=[];this.addNewButton&&t.push(this.addNewButton),this.filteredOptionEls.forEach((e=>{t.push(this.elFromTagOption(e))}));const e=c(t,this._focusedOption,!0);this.focusOption(e)}else this.openDropdown();else{const t=this.filteredOptionEls.map((t=>this.elFromTagOption(t))),e=c(t,this._focusedOption,!0);this.focusOption(e)}}handleInputBackspace(){""===this.inputEl.value&&this._tagEls.length>0&&(this.isKeying=!0,window.requestAnimationFrame((()=>{this.tagAreaEl.focus(),this.focusTag(this._tagEls[this._tagEls.length-1])})))}handleTagAreaKeyDown(t){switch(t.key){case"ArrowLeft":case"ArrowUp":if(t.preventDefault(),this.focusedTag){const t=c(this._tagEls,this.focusedTag,!0);this.focusTag(t)}break;case"ArrowRight":case"ArrowDown":if(t.preventDefault(),this.focusedTag){const t=d(this._tagEls,this.focusedTag,!0);this.focusTag(t)}break;case"Backspace":case"Delete":if(this.focusedTag){const t=this.tagOptionFromTag(this.focusedTag);t.locked?this.announce(this.tagLockedMessage(this.getTagName(t))):t.emitDeselectedEvent()}}}handleBlur(t){this.dismissTooltip(),this.clearOptionFocus(),this.isElOrChild(t.relatedTarget)||(this.fieldWrapperEl.classList.remove("focused"),this.isDropdown&&this.closeDropdown())}handleTagAreaFocus(t){if(this.isDropdown&&this.closeDropdown(),this._tagEls.length>0){const e=t.relatedTarget;this.focusTag(e&&"input"===e.id?this._tagEls[this._tagEls.length-1]:this._tagEls[0])}}focusPrevCell(){this.focusedOption&&this.focusedColumn>0&&(this.focusedColumn-=1)}focusNextCell(){if(this._focusedOption){const t=this._focusedOption.querySelectorAll("td").length-1;this.focusedColumn<t&&(this.focusedColumn+=1)}}focusOption(t){if(t){if(this.focusedOption=this.tagOptionFromEl(t),t===this.addNewButton?this.addNewButton.classList.add("focused"):this.addNewButton&&this.addNewButton.classList.remove("focused"),this.isTable){const t=this._focusedOption.querySelector(".cell-content-wrapper"),e=t.scrollWidth>t.clientWidth;this.dismissTooltip(),e&&p("bottom",this._focusedOption,this._focusedOption.innerText)}t.scrollIntoView({block:"nearest"})}}showTooltipIfTruncated(t){const e=t.querySelector(".tag-text").textContent,i=t.id.replace("tag-","");if(i){const r=this.el.querySelector("#"+i),o=this.getTagName(r);e!==o&&e.includes("...")&&p("bottom",t,o)}}focusTag(t){this.focusedTagIndex=this._tagEls.indexOf(t),t.scrollIntoView({block:"nearest"}),window.requestAnimationFrame((()=>{h(),this.showTooltipIfTruncated(t)}))}clearOptionFocus(){this.focusedOption=void 0,this.focusedColumn=0}openDropdown(){this.openUp=g(this.el,this.dropdownEl.clientHeight,this.el.clientHeight,-2),this.isExpanded=!0}closeDropdown(){this.clearOptionFocus(),this.isExpanded=!1}resetInput(){this.inputEl.value=""}announce(t){this.liveRegionEl.textContent===t&&(t+=" "),this.liveRegionMessage=t}addTags(t){const e=t.split(",").filter((t=>t.match(/\S/)));e.forEach((t=>{this.wmTagInputTagAdded.emit(t)})),this.announce(this.tagAddedMessage(e.join(", "))),this.resetInput()}announceExistingOptions(){window.requestAnimationFrame((()=>{const t=a.formatMessage({id:"tagInput.existingOptions",defaultMessage:"{num, plural, one {1 existing option.} other {# existing options.}}"},{num:this.filteredOptionEls.length});this.announce(t)}))}generateCharacterLimitWarning(t,e){let i=m.getCharactersEntered(t,e);return t>=e&&(i+=` ${m.characterLimitReached}`),i}positionInput(){if(this.tagAreaEl){const t=this._tagEls[this._tagEls.length-1];if(this.inputEl.style.position="static",this.inputEl.style.width="100%",this.inputEl.classList.add("extended"),t){const e=this.tagAreaEl.getBoundingClientRect().right-t.getBoundingClientRect().right;e>=this.inputMinimumWidth&&(this.inputEl.style.position="absolute",this.inputEl.style.top=t.offsetTop.toString()+"px",this.inputEl.style.width=(e-8).toString()+"px",this.inputEl.classList.remove("extended"))}}}handleTagMouseEnter(t){this.showTooltipIfTruncated(t.target)}renderDropdown(){return r("div",{class:`dropdown-wrapper ${this.isExpanded?"open":""} ${this.openUp?"upwards":""}`,ref:t=>this.dropdownEl=t},r("div",{id:"help-text",class:"help-text"},this.renderHelpText()),r("ul",{class:"dropdown",id:"dropdown",role:"listbox","aria-multiselectable":"true","aria-expanded":this.isExpanded?"true":"false","aria-label":this.label,tabindex:-1},this.inputEl&&this.renderAddNewButton(),this.filteredOptionEls.map((t=>this.renderListItem(t)))))}renderHelpText(){if(this.helpText)return this.helpText;let t="";return this.optionEls.length>0&&(t=this.selectionHelpText),this.addNew&&(t+=" "+this.addNewHelpText),t}renderAddNewButton(){const t=this.inputEl.value.trim(),e=this.inputEl.value.match(/\S/),i=this.isExistingTag(this.inputEl.value.trim());return this.addNew&&e&&!i&&r("li",{ref:t=>this.addNewButton=t,id:"add-new-btn",class:"add-new-btn",onClick:()=>this.addTags(t)},"Add "+t)}renderTable(){return r("div",{class:"table-wrapper",onScroll:()=>this.dismissTooltip()},r("table",{id:"table",role:"grid",class:this.colWidths?"fixed-widths":"","aria-label":this.label,"aria-multiselectable":"true"},this.renderTableHeaders(),this.filteredOptionEls.length?this.filteredOptionEls.map((t=>this.renderTableRow(t))):r("div",{class:"no-results"},this.noResultsMessage)))}renderTableHeaders(){return r("tr",{class:"headers",role:"row"},u(this.colHeaders).map(((t,e)=>{let i="wrap";return this.colWrap&&u(this.colWrap)[e]&&(i=u(this.colWrap)[e]),r("th",{class:`header-cell ${i}`,role:"columnheader",width:this.colWidths?u(this.colWidths)[e]:""},t)})))}renderTag(t){const e=this.focusedTag&&this.focusedTag.id==="tag-"+t.id?"focused":"",i=this.getTagName(t);return r("li",{id:"tag-"+t.id,role:"option",class:`tag ${e} ${t.locked?"locked":""}`,"aria-describedby":`tag-${t.id}-description`,onMouseEnter:t=>this.handleTagMouseEnter(t),onMouseLeave:h},r("span",{class:"sr-only"},i),r("div",{class:"description",id:`tag-${t.id}-description`},t.locked?"locked":""),r("span",{class:"tag-text","aria-hidden":"true"},i),t.locked?r("div",{class:"icon lock"}):r("button",{class:"icon remove-btn",tabIndex:-1,onClick:()=>t.emitDeselectedEvent()}))}renderTags(){return this.tagsList.map((t=>this.renderTag(t)))}renderTagCounter(){if(this.maxTags)return r("div",{class:"lower-row"},r("div",{id:"max-tags"},this.renderMaxTags()))}renderMaxTags(){if(this.helpText)return this.helpText;{let t=`${this.tagsAddedMessage}: ${this.taggedOptions.length}/${this.maxTags}`;return this.tagLimitReached&&(t+=`- ${this.maxTagsReachedMessage}`),t}}handleCellMouseEnter(t){const e=t.target,i=e.querySelector(".cell-content-wrapper");i.scrollWidth>i.clientWidth&&p("bottom",e,e.innerText)}renderTableCells(t){return[t.col1,t.col2,t.col3,t.col4].filter((t=>!!t)).map(((e,i)=>{const o=`${t.id}-col${i+1}`;let a="wrap";return this.colWrap&&u(this.colWrap)[i]&&(a=u(this.colWrap)[i]),r("td",{id:o,class:{focused:!!this._focusedCell&&o===this._focusedCell.id},role:"gridcell","aria-describedby":`${o}-description`,"aria-selected":t.selected?"true":"false","aria-readonly":t.locked?"true":null,onMouseEnter:t=>this.handleCellMouseEnter(t),onMouseLeave:()=>h()},r("div",{class:`cell-content-wrapper ${a}`},e),r("div",{class:"description",id:`${o}-description`},t.locked?"locked":""))}))}renderTableRow(t){return r("tr",{id:t.id,class:{selected:t.selected,locked:t.locked,focused:!(!this.focusedOption||t!==this.focusedOption)},onClick:t=>this.handleOptionClick(t)},this.renderTableCells(t))}renderListItem(t){if(this.inputEl)return r("li",{id:t.id,role:"option",class:"option "+(this.focusedOption&&t===this.focusedOption?"focused":""),"aria-selected":t.selected?"true":"false",onClick:t=>this.handleOptionClick(t)},t.textContent)}render(){return r("div",{class:`wrapper label-${this.labelPosition} ${this.errorMessage?"invalid":""}`},r("div",{class:"label-wrapper"},r("label",{class:"label",htmlFor:"input"},this.label,this.requiredField&&r("span",{class:"required","aria-hidden":"true"},"*"))),r("div",{class:`field-wrapper ${this.el.shadowRoot.activeElement===this.inputEl?"focused":""} ${this.errorMessage?"invalid":""}`,ref:t=>this.fieldWrapperEl=t},r("div",{class:"upper-row"},r("div",{class:"tags-and-input-wrapper "+(this.inModal?"in-modal":"")},r("ul",{ref:t=>this.tagAreaEl=t,class:`tag-area ${0===this.taggedOptions.length&&"empty"} ${this.isKeying?"user-is-keying":""}`,role:"listbox","aria-activedescendant":this.focusedTag?this.focusedTag.id:null,"aria-orientation":"horizontal","aria-label":`${this.label} ${this.tagAreaInstructions}`,tabindex:this._tagEls.length>0?0:-1,"aria-describedby":"info max-tags",onFocus:t=>this.handleTagAreaFocus(t),onBlur:t=>{this.focusedTagIndex=void 0,this.handleBlur(t)},onKeyDown:t=>this.handleTagAreaKeyDown(t)},this.renderTags()),r("input",{id:"input",class:"input",role:"combobox",ref:t=>this.inputEl=t,autocomplete:"off","aria-required":this.requiredField?"true":null,"aria-controls":this.tagInputType,"aria-describedby":`help-text${this.errorMessage?" error ":""} max-tags`,"aria-label":`${this.label} ${this.isDropdown?m.getCharacterLimit(this.characterLimit):""}`,"aria-expanded":this.isDropdown?this.isExpanded.toString():null,"aria-activedescendant":this.inputActiveDescendantId,placeholder:this.placeholder,maxLength:this.isDropdown?this.characterLimit:void 0,onInput:t=>this.handleInputChanged(t),onBlur:t=>{this.handleBlur(t)},onFocus:()=>this.handleInputFocus(),onKeyDown:t=>this.handleInputKeyDown(t)})),this.isDropdown&&r("div",{class:"character-count"},this.charCount,"/",this.characterLimit)),this.renderTagCounter(),this.isDropdown&&this.renderDropdown()),this.info&&r("div",{id:"info",class:"info-text"},this.info),r("div",{id:"error"},this.errorMessage),r("div",{class:"sr-only","aria-live":"polite",ref:t=>this.liveRegionEl=t,"aria-atomic":"true"},this.liveRegionMessage),this.isTable&&this.renderTable())}static get delegatesFocus(){return!0}get el(){return o(this)}static get watchers(){return{errorMessage:["announceError"]}}};w.style=':host{--wmcolor-taginput-altrow-background-table:var(--wmcolor-table-altrow-background);--wmcolor-taginput-border:var(--wmcolor-input-border);--wmcolor-taginput-charcount-background:var(--wmcolor-input-charcount-background);--wmcolor-taginput-header-background-table:var(--wmcolor-table-header-background);--wmcolor-taginput-help-text:var(--wmcolor-text);--wmcolor-taginput-icon:var(--wmcolor-icon-accent);--wmcolor-taginput-maxtags-background:var(--wmcolor-background-readonly);--wmcolor-taginput-maxtags-border:var(--wmcolor-input-border);--wmcolor-taginput-maxtags-text:var(--wmcolor-text);--wmcolor-taginput-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-taginput-option-background:var(--wmcolor-option-background);--wmcolor-taginput-option-border:var(--wmcolor-option-border);--wmcolor-taginput-option-text-selected:var(--wmcolor-option-text-disabled);--wmcolor-taginput-option-text:var(--wmcolor-interactive);--wmcolor-taginput-row-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-taginput-row-background-selected:var(--wmcolor-table-row-background-selected);--wmcolor-taginput-row-background-table:var(--wmcolor-table-row-background);--wmcolor-taginput-row-border-selected:var(--wmcolor-table-row-border-selected);--wmcolor-taginput-tag-background-focus:var(--wmcolor-palelilacgray-dark);--wmcolor-taginput-tag-background-highlight:var(--wmcolor-interactive-background-highlight);--wmcolor-taginput-tag-background-locked:var(--wmcolor-interactive-disabled);--wmcolor-taginput-tag-background:var(--wmcolor-palelilacgray);--wmcolor-taginput-tag-text-locked:var(--wmcolor-text-ondark);--wmcolor-taginput-tag-text:var(--wmcolor-text);--wmcolor-taginput-tagbutton-background-hover:var(--wmcolor-button-background-icononly-hover);--wmcolor-taginput-tagbutton-border:var(--wmcolor-button-border-icononly);--wmcolor-taginput-tagbutton-icon-hover:var(--wmcolor-button-icon-icononly-hover);--wmcolor-taginput-tagbutton-icon:var(--wmcolor-button-icon-icononly);font-family:inherit;width:100%;display:block;max-height:80vh}:host *{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{width:100%;height:100%;max-height:inherit;min-height:inherit;position:relative}:host .field-wrapper{position:relative;width:100%;border:1px solid;border-color:var(--wmcolor-taginput-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px}:host .field-wrapper.focused{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .field-wrapper.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper:not(.label-left) .field-wrapper{-ms-flex-negative:0;flex-shrink:0}:host .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:var(--wmcolor-taginput-charcount-background);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .tags-and-input-wrapper{position:relative;width:100%;padding:8px 8px 8px 6px;overflow:auto;max-height:200px}:host .tags-and-input-wrapper.in-modal{max-height:20vh}:host .upper-row{width:100%;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:justify;justify-content:space-between}:host .upper-row:before{-ms-flex-item-align:start;align-self:flex-start;display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f349";color:var(--wmcolor-taginput-icon);padding:0.75rem 0.5rem 0.75rem 0.75rem;line-height:normal;font-size:1.12rem}:host .lower-row{width:100%;min-height:1.875rem}:host #max-tags{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:1.875rem;background-color:var(--wmcolor-taginput-maxtags-background);padding:0.5rem 1rem;color:var(--wmcolor-taginput-maxtags-text);font-size:0.875rem;border-top:1px solid var(--wmcolor-taginput-maxtags-border);border-radius:0 0 3px 3px}:host .tag-area{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0;margin:0;gap:8px}:host .tag-area:focus{outline:none}:host .tag-area li{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;height:1.75rem;list-style:none;color:var(--wmcolor-taginput-tag-text);background-color:var(--wmcolor-taginput-tag-background);padding:0.5rem 0.625rem;-webkit-transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);white-space:pre}:host .tag-area li.highlight{-webkit-animation:fadeIn 1s;animation:fadeIn 1s}@-webkit-keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}@keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}:host .tag-area li.locked{background-color:var(--wmcolor-taginput-tag-background-locked);color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:1.25rem;width:1.25rem;padding:0;margin-left:0.5rem}:host .tag-area li .icon.remove-btn{border:1px solid var(--wmcolor-taginput-tagbutton-border);color:var(--wmcolor-taginput-tagbutton-icon);border-radius:50%;cursor:pointer;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1)}:host .tag-area li .icon.remove-btn:hover{color:var(--wmcolor-taginput-tagbutton-icon-hover);background-color:var(--wmcolor-taginput-tagbutton-background-hover)}:host .tag-area li .icon.remove-btn:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f156"}:host .tag-area li .icon.lock{color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon.lock:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f341"}:host .tag-area.user-is-keying:focus-visible li.focused{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:3px}:host .input{font-family:inherit;border:none;height:1.75rem;padding:0;margin:0;right:8px}:host .input:focus{outline:none}:host .tag-area:not(.empty)+.input.extended{-webkit-margin-before:8px;margin-block-start:8px}:host .dropdown-wrapper{margin:0;padding:0;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:calc(100% + 2px);right:0;z-index:100;width:100%;font-size:0.875rem}:host .dropdown-wrapper .dropdown{-webkit-overflow-scrolling:touch;overflow:auto;max-height:12.5rem;margin:0;padding:0}:host .dropdown-wrapper.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .dropdown-wrapper.upwards{top:unset;bottom:calc(100% + 2px);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}:host .dropdown-wrapper li,:host .dropdown-wrapper div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 1rem;background:var(--wmcolor-taginput-option-background);list-style:none;min-height:2.6875rem;white-space:pre-wrap;overflow-wrap:anywhere}:host .dropdown-wrapper li.option,:host .dropdown-wrapper li.add-new-btn,:host .dropdown-wrapper div.option,:host .dropdown-wrapper div.add-new-btn{cursor:pointer;color:var(--wmcolor-taginput-option-text);font-weight:bold;width:100%;border:none}:host .dropdown-wrapper li.option[aria-selected=true],:host .dropdown-wrapper li.add-new-btn[aria-selected=true],:host .dropdown-wrapper div.option[aria-selected=true],:host .dropdown-wrapper div.add-new-btn[aria-selected=true]{color:var(--wmcolor-taginput-option-text-selected);font-style:italic;font-weight:normal;cursor:unset}:host .dropdown-wrapper li.option:hover:not([aria-selected=true]),:host .dropdown-wrapper li.option.focused,:host .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper li.add-new-btn.focused,:host .dropdown-wrapper div.option:hover:not([aria-selected=true]),:host .dropdown-wrapper div.option.focused,:host .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper div.add-new-btn.focused{outline:none;background:var(--wmcolor-taginput-option-background-hover)}:host .dropdown-wrapper li.help-text,:host .dropdown-wrapper div.help-text{color:var(--wmcolor-taginput-help-text);height:auto;min-height:2.6875rem;padding-top:0.25rem;padding-bottom:0.25rem;white-space:normal}:host .dropdown-wrapper li:not(:last-child),:host .dropdown-wrapper div:not(:last-child){border-bottom:2px solid var(--wmcolor-taginput-option-border)}:host .info-text{font-style:italic;margin-top:0.25rem}:host .table-wrapper{overflow:auto;margin-top:1.5rem}:host .table-wrapper #table{width:100%;border-spacing:0px}:host .table-wrapper #table.fixed-widths{table-layout:fixed}:host .table-wrapper #table .headers{height:2.5rem;background-color:var(--wmcolor-taginput-header-background-table)}:host .table-wrapper #table .headers th{text-align:left;font-size:0.75rem;font-weight:700;text-transform:uppercase;padding:0 1.5rem}:host .table-wrapper tr:nth-child(even){background-color:var(--wmcolor-taginput-altrow-background-table)}:host .table-wrapper tr.selected,:host .table-wrapper tr.locked{background-color:var(--wmcolor-taginput-row-background-selected);-webkit-box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);font-weight:500}:host .table-wrapper tr.focused,:host .table-wrapper tr:hover:not(.locked){background-color:var(--wmcolor-taginput-row-background-hover);-webkit-box-shadow:none;box-shadow:none}:host .table-wrapper tr.locked td{cursor:auto}:host .table-wrapper tr.locked td:first-child .cell-content-wrapper:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f33e";margin-right:0.5rem;color:var(--wmcolor-taginput-tag-text)}:host .table-wrapper td{height:3.75rem;vertical-align:middle;padding:0 1.5rem;cursor:pointer}:host .table-wrapper td.focused{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-3px}:host .table-wrapper td .cell-content-wrapper.trunc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .description{display:none}:host .no-results{padding:1.25rem 1.5rem}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host #error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem}:host #error:not(:empty){margin-top:0.25rem}';export{w as wm_tag_input}
|
|
1
|
+
import{r as t,c as e,f as i,h as r,g as o}from"./p-568c595f.js";import{i as a,d as s,u as n,m as l,h,v as d,w as c,s as p,k as g,x as u}from"./p-eca78c2b.js";import{g as m}from"./p-02dc1562.js";const w=class{constructor(r){t(this,r),this.wmTagInputTagAdded=e(this,"wmTagInputTagAdded",7),this.addNewHelpText=a.formatMessage({id:"tagInput.addNewHelpText",defaultMessage:"Press the Enter or Comma key to add a new tag.",description:"Help text appearing in a dropdown. Use imperative"}),this.selectionHelpText=a.formatMessage({id:"tagInput.selectionHelpText",defaultMessage:"Search and select a tag.",description:"Help text appearing in a dropdown. Use imperative"}),this.maxTagsReachedMessage=a.formatMessage({id:"tagInput.maxTagsReached",defaultMessage:"No more tags can be added because the limit has been reached."}),this.tagAreaInstructions=a.formatMessage({id:"tagInput.tagAreaInstructions",defaultMessage:"tag selection. Press Backspace or Delete to remove a tag."}),this.tagsAddedMessage=a.formatMessage({id:"tagInput.tagsAdded",defaultMessage:"Tags added",description:"Full message for context: 'Tags added: x/y"}),this.openUp=!1,this.inModal=!1,this.debouncedUpdate=s((()=>i(this.el)),30),this.label=void 0,this.errorMessage=void 0,this.info=void 0,this.labelPosition="top",this.maxTags=void 0,this.placeholder=void 0,this.requiredField=!1,this.tagInputType="dropdown",this.helpText=void 0,this.addNew=!0,this.characterLimit=50,this.colHeaders=void 0,this.colWidths=void 0,this.colWrap=void 0,this.isKeying=!1,this.isExpanded=!1,this.liveRegionMessage="",this.focusedOption=void 0,this.focusedColumn=0,this.focusedTagIndex=void 0,this.tagsList=[]}toggleKeyingOn(){this.isKeying=!0}toggleKeyingOff(){this.isKeying=!1}get isDropdown(){return"dropdown"===this.tagInputType}get isTable(){return"table"===this.tagInputType}get charCount(){return this.inputEl?this.inputEl.value.length:0}get tooltipVisible(){return document.getElementById("wm-tooltip").classList.contains("show")}get optionEls(){return Array.from(this.el.querySelectorAll("wm-tag-option"))}get filteredOptionEls(){const t=this.inputEl?this.inputEl.value.toLowerCase():"";return Array.from(this.optionEls).filter((e=>{let i="";return this.isDropdown?i=e.textContent.toLowerCase():this.isTable&&(i=[e.col1,e.col2,e.col3,e.col4].join("").toLowerCase()),i.includes(t)}))}get taggedOptions(){return this.optionEls.filter((t=>t.selected||t.locked))}get _tagEls(){return this.tagAreaEl?Array.from(this.tagAreaEl.querySelectorAll(".tag")):[]}get focusedTag(){if(void 0!==this.focusedTagIndex&&this.focusedTagIndex>=0)return this._tagEls[this.focusedTagIndex]}tagOptionFromEl(t){return"add-new-btn"===t.id?void 0:this.el.querySelector("#"+t.id)}tagOptionFromTag(t){const e=t.id.replace("tag-","");return this.el.querySelector("#"+e)}elFromTagOption(t){return this.el.shadowRoot.querySelector("#"+t.id)}get _focusedOption(){return this.focusedOption?this.elFromTagOption(this.focusedOption):this.addNewButton&&this.addNewButton.classList.contains("focused")?this.addNewButton:void 0}get _focusedCell(){if(this._focusedOption)return Array.from(this._focusedOption.querySelectorAll("td"))[this.focusedColumn||0]}get inputActiveDescendantId(){return this._focusedOption?this.isTable?Array.from(this._focusedOption.querySelectorAll("td"))[this.focusedColumn].id:this._focusedOption.id:null}get tagLimitReached(){return!!(this.maxTags&&this.taggedOptions.length>=this.maxTags)}get noResultsMessage(){return a.formatMessage({id:"tagInput.noResults",defaultMessage:"No results match your search.",description:"Message displayed when a user's search returns empty."})}get inputMinimumWidth(){if(this._tagEls){const t=getComputedStyle(this.inputEl),e=getComputedStyle(this._tagEls[this._tagEls.length-1]),i=[t.paddingLeft,t.paddingRight,t.marginLeft,t.marginRight,e.marginRight].reduce(((t,e)=>t+parseInt(e.replace("px",""))),0);return Math.max(150,n(this.inputEl,this.placeholder).width+i)}return 150}getTagName(t){return this.isDropdown?t.textContent:t.col1}isExistingTag(t){return this.optionEls.map((t=>this.getTagName(t).toLowerCase())).includes(t.toLowerCase())}tagAddedMessage(t){return a.formatMessage({id:"tagInput.tagAdded",defaultMessage:"{tagName} added.",description:"A confirmation for adding a tag."},{tagName:t})}tagRemovedMessage(t){return a.formatMessage({id:"tagInput.tagRemoved",defaultMessage:"{tagName} removed.",description:"A confirmation for removing a tag."},{tagName:t})}tagAlreadyAddedMessage(t){return a.formatMessage({id:"tagInput.tagAlreadyAdded",defaultMessage:"{tagName} has already been added.",description:"An alert for adding a tag that is already present."},{tagName:t})}tagLockedMessage(t){return a.formatMessage({id:"tagInput.tagLocked",defaultMessage:"{tagName} is locked and cannot be removed.",description:"An alert for when a user tries to remove a tag that is locked."},{tagName:t})}isElOrChild(t){return t===this.el||this.el.shadowRoot.contains(t)||this.el.contains(t)}componentWillLoad(){this.placeholder||(this.placeholder=this.createPlaceholderDefault(this.addNew,this.optionEls.length>0)),this.label||console.error("wm-tag-input must have a label property"),this.el.focus=()=>{const t=this._tagEls[0];t?(this.tagAreaEl.focus(),this.focusTag(t)):this.inputEl.focus()},new ResizeObserver((()=>this.debouncedUpdate())).observe(this.el),this.el.closest("wm-modal")&&(this.inModal=!0);const t=[],e=[];this.optionEls.forEach((i=>{i.locked?t.push(i):i.selected&&e.push(i)})),this.tagsList=[...t,...e]}componentDidLoad(){new MutationObserver((t=>t.forEach((t=>this.handleChangeAnnouncement(t))))).observe(this.el,{subtree:!0,attributes:!0,attributeFilter:["selected"],childList:!0}),new MutationObserver((t=>t.forEach((t=>this.handleOptionListChange(t))))).observe(this.el,{childList:!0}),this.tagAreaEl&&new MutationObserver((t=>t.forEach((t=>this.handleTagListChange(t))))).observe(this.tagAreaEl,{childList:!0})}handleChangeAnnouncement(t){const e=t.target;if("childList"==t.type&&t.removedNodes.length>0)this.announce(this.tagRemovedMessage(t.removedNodes[0].textContent));else if("attributes"==t.type){const t=this.getTagName(e);if(e.selected){let e=this.tagAddedMessage(t);this.tagLimitReached&&(e+=` ${this.maxTagsReachedMessage}`),this.announce(e)}else this.announce(this.tagRemovedMessage(t))}}handleOptionListChange(t){const e=Array.from(t.addedNodes);e.length>0&&e.forEach((t=>!this.tagsList.includes(t)&&this.tagsList.push(t)));const i=Array.from(t.removedNodes);i.length>0&&(this.tagsList=this.tagsList.filter((t=>!i.includes(t))))}handleTagOptionSelected(t){this.tagsList=this.tagsList.concat(t.target)}handleTagOptionDeselected(t){const e=t.target;this.tagsList=this.tagsList.filter((t=>t!=e))}handleTagListChange(t){const e=Array.from(t.addedNodes);e&&e.forEach((t=>{t.classList.add("highlight")}));const i=t.removedNodes[0];i&&(i.classList.remove("highlight"),this.focusedTag?this.focusTag(this.focusedTag):this._tagEls.length>0?this.focusTag(this._tagEls[this._tagEls.length-1]):this.inputEl.focus())}componentDidRender(){this.positionInput(),this._tagEls.forEach((t=>{const e=t.querySelector(".tag-text"),i=this.el.shadowRoot.querySelector(".tags-and-input-wrapper"),r=e.getBoundingClientRect().left,o=i.getBoundingClientRect().right-10-8-28,a=t.id.replace("tag-",""),s=a&&this.el.querySelector("#"+a);s&&(e.textContent=l(e,this.getTagName(s),o-r,5))}))}createPlaceholderDefault(t,e){const i=a.formatMessage({id:"tagInput.placeholderAddAndSearch",defaultMessage:"Add or search for a tag",description:"Placeholder text. Use imperative"}),r=a.formatMessage({id:"tagInput.placeholderSearch",defaultMessage:"Search and select a tag",description:"Placeholder text. Use imperative"}),o=a.formatMessage({id:"tagInput.placeholderAdd",defaultMessage:"Add a new tag",description:"Placeholder text. Use imperative"});let s="";return t&&e?s=i:!t&&e?s=r:t&&(s=o),s}handleClick(t){this.isDropdown&&!this.el.contains(t.target)&&this.isExpanded&&this.closeDropdown()}announceError(){this.errorMessage&&setTimeout((()=>this.announce(this.errorMessage)),100)}handleOptionClick(t){let e;t.preventDefault(),this.resetInput(),this.isTable?(e=t.target,e=this.tagOptionFromEl(e.closest("tr"))):e=this.tagOptionFromEl(t.target),e.click(),e.locked?this.announce(this.tagLockedMessage(this.getTagName(e))):e.selected?this.isTable&&e.emitDeselectedEvent():e.emitSelectedEvent()}dismissTooltip(){this.tooltipVisible&&h()}handleInputKeyDown(t){switch(/^.$/.test(t.key)&&this.charCount>=this.characterLimit&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),t.key){case"Enter":t.preventDefault(),this.handleInputEnter();break;case"ArrowDown":t.preventDefault(),this.handleInputArrowDown();break;case"ArrowUp":t.preventDefault(),this.handleInputArrowUp();break;case"ArrowLeft":this.isTable&&(t.preventDefault(),this.focusPrevCell());break;case"ArrowRight":this.isTable&&(t.preventDefault(),this.focusNextCell());break;case"Escape":this.isDropdown&&this.isExpanded&&(t.preventDefault(),this.closeDropdown());break;case"ArrowLeft":case"Backspace":this.handleInputBackspace()}}handleInputFocus(){this.isDropdown&&(this.openDropdown(),this.clearOptionFocus())}handleInputChanged(t){this.clearOptionFocus(),this.isDropdown&&(this.charCount>=this.characterLimit-5&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),this.isExpanded||this.openDropdown());const e=t.target.value;e.includes(",")&&this.addNew?this.addTags(e):this.announceExistingOptions()}handleInputEnter(){if(this.focusedOption)this.focusedOption.locked?this.announce(this.tagLockedMessage(this.getTagName(this.focusedOption))):(this.focusedOption.click(),this.focusedOption.selected?this.isTable&&this.focusedOption.emitDeselectedEvent():this.focusedOption.emitSelectedEvent(),this.resetInput());else if(this.isDropdown){const t=this.inputEl.value;t&&(this.isExistingTag(t)?this.announce(this.tagAlreadyAddedMessage(t)):this.addTags(t),this.resetInput())}}handleInputArrowDown(){if(this.isDropdown)if(this.isExpanded){let t=[];this.addNewButton&&"add-new-btn"===this.addNewButton.id&&t.push(this.addNewButton),this.filteredOptionEls.forEach((e=>{t.push(this.elFromTagOption(e))}));const e=d(t,this._focusedOption,!0);this.focusOption(e)}else this.openDropdown();else{const t=this.filteredOptionEls.map((t=>this.elFromTagOption(t))),e=d(t,this._focusedOption,!0);this.focusOption(e)}}handleInputArrowUp(){if(this.isDropdown)if(this.isExpanded){let t=[];this.addNewButton&&t.push(this.addNewButton),this.filteredOptionEls.forEach((e=>{t.push(this.elFromTagOption(e))}));const e=c(t,this._focusedOption,!0);this.focusOption(e)}else this.openDropdown();else{const t=this.filteredOptionEls.map((t=>this.elFromTagOption(t))),e=c(t,this._focusedOption,!0);this.focusOption(e)}}handleInputBackspace(){""===this.inputEl.value&&this._tagEls.length>0&&(this.isKeying=!0,window.requestAnimationFrame((()=>{this.tagAreaEl.focus(),this.focusTag(this._tagEls[this._tagEls.length-1])})))}handleTagAreaKeyDown(t){switch(t.key){case"ArrowLeft":case"ArrowUp":if(t.preventDefault(),this.focusedTag){const t=c(this._tagEls,this.focusedTag,!0);this.focusTag(t)}break;case"ArrowRight":case"ArrowDown":if(t.preventDefault(),this.focusedTag){const t=d(this._tagEls,this.focusedTag,!0);this.focusTag(t)}break;case"Backspace":case"Delete":if(this.focusedTag){const t=this.tagOptionFromTag(this.focusedTag);t.locked?this.announce(this.tagLockedMessage(this.getTagName(t))):t.emitDeselectedEvent()}}}handleBlur(t){this.dismissTooltip(),this.clearOptionFocus(),this.isElOrChild(t.relatedTarget)||(this.fieldWrapperEl.classList.remove("focused"),this.isDropdown&&this.closeDropdown())}handleTagAreaFocus(t){if(this.isDropdown&&this.closeDropdown(),this._tagEls.length>0){const e=t.relatedTarget;this.focusTag(e&&"input"===e.id?this._tagEls[this._tagEls.length-1]:this._tagEls[0])}}focusPrevCell(){this.focusedOption&&this.focusedColumn>0&&(this.focusedColumn-=1)}focusNextCell(){if(this._focusedOption){const t=this._focusedOption.querySelectorAll("td").length-1;this.focusedColumn<t&&(this.focusedColumn+=1)}}focusOption(t){if(t){if(this.focusedOption=this.tagOptionFromEl(t),t===this.addNewButton?this.addNewButton.classList.add("focused"):this.addNewButton&&this.addNewButton.classList.remove("focused"),this.isTable){const t=this._focusedOption.querySelector(".cell-content-wrapper"),e=t.scrollWidth>t.clientWidth;this.dismissTooltip(),e&&p("bottom",this._focusedOption,this._focusedOption.innerText)}t.scrollIntoView({block:"nearest"})}}showTooltipIfTruncated(t){const e=t.querySelector(".tag-text").textContent,i=t.id.replace("tag-","");if(i){const r=this.el.querySelector("#"+i),o=this.getTagName(r);e!==o&&e.includes("...")&&p("bottom",t,o)}}focusTag(t){this.focusedTagIndex=this._tagEls.indexOf(t),t.scrollIntoView({block:"nearest"}),window.requestAnimationFrame((()=>{h(),this.showTooltipIfTruncated(t)}))}clearOptionFocus(){this.focusedOption=void 0,this.focusedColumn=0}openDropdown(){this.openUp=g(this.el,this.dropdownEl.clientHeight,this.el.clientHeight,-2),this.isExpanded=!0}closeDropdown(){this.clearOptionFocus(),this.isExpanded=!1}resetInput(){this.inputEl.value=""}announce(t){this.liveRegionEl.textContent===t&&(t+=" "),this.liveRegionMessage=t}addTags(t){const e=t.split(",").filter((t=>t.match(/\S/)));e.forEach((t=>{this.wmTagInputTagAdded.emit(t)})),this.announce(this.tagAddedMessage(e.join(", "))),this.resetInput()}announceExistingOptions(){window.requestAnimationFrame((()=>{const t=a.formatMessage({id:"tagInput.existingOptions",defaultMessage:"{num, plural, one {1 existing option.} other {# existing options.}}"},{num:this.filteredOptionEls.length});this.announce(t)}))}generateCharacterLimitWarning(t,e){let i=m.getCharactersEntered(t,e);return t>=e&&(i+=` ${m.characterLimitReached}`),i}positionInput(){if(this.tagAreaEl){const t=this._tagEls[this._tagEls.length-1];if(this.inputEl.style.position="static",this.inputEl.style.width="100%",this.inputEl.classList.add("extended"),t){const e=this.tagAreaEl.getBoundingClientRect().right-t.getBoundingClientRect().right;e>=this.inputMinimumWidth&&(this.inputEl.style.position="absolute",this.inputEl.style.top=t.offsetTop.toString()+"px",this.inputEl.style.width=(e-8).toString()+"px",this.inputEl.classList.remove("extended"))}}}handleTagMouseEnter(t){this.showTooltipIfTruncated(t.target)}renderDropdown(){return r("div",{class:`dropdown-wrapper ${this.isExpanded?"open":""} ${this.openUp?"upwards":""}`,ref:t=>this.dropdownEl=t},r("div",{id:"help-text",class:"help-text"},this.renderHelpText()),r("ul",{class:"dropdown",id:"dropdown",role:"listbox","aria-multiselectable":"true","aria-expanded":this.isExpanded?"true":"false","aria-label":this.label,tabindex:-1},this.inputEl&&this.renderAddNewButton(),this.filteredOptionEls.map((t=>this.renderListItem(t)))))}renderHelpText(){if(this.helpText)return this.helpText;let t="";return this.optionEls.length>0&&(t=this.selectionHelpText),this.addNew&&(t+=" "+this.addNewHelpText),t}renderAddNewButton(){const t=this.inputEl.value.trim(),e=this.inputEl.value.match(/\S/),i=this.isExistingTag(this.inputEl.value.trim());return this.addNew&&e&&!i&&r("li",{ref:t=>this.addNewButton=t,id:"add-new-btn",class:"add-new-btn",onClick:()=>this.addTags(t)},"Add "+t)}renderTable(){return r("div",{class:"table-wrapper",onScroll:()=>this.dismissTooltip()},r("table",{id:"table",role:"grid",class:this.colWidths?"fixed-widths":"","aria-label":this.label,"aria-multiselectable":"true"},this.renderTableHeaders(),this.filteredOptionEls.length?this.filteredOptionEls.map((t=>this.renderTableRow(t))):r("div",{class:"no-results"},this.noResultsMessage)))}renderTableHeaders(){return r("tr",{class:"headers",role:"row"},u(this.colHeaders).map(((t,e)=>{let i="wrap";return this.colWrap&&u(this.colWrap)[e]&&(i=u(this.colWrap)[e]),r("th",{class:`header-cell ${i}`,role:"columnheader",width:this.colWidths?u(this.colWidths)[e]:""},t)})))}renderTag(t){const e=this.focusedTag&&this.focusedTag.id==="tag-"+t.id?"focused":"",i=this.getTagName(t);return r("li",{id:"tag-"+t.id,role:"option",class:`tag ${e} ${t.locked?"locked":""}`,"aria-describedby":`tag-${t.id}-description`,onMouseEnter:t=>this.handleTagMouseEnter(t),onMouseLeave:h},r("span",{class:"sr-only"},i),r("div",{class:"description",id:`tag-${t.id}-description`},t.locked?"locked":""),r("span",{class:"tag-text","aria-hidden":"true"},i),t.locked?r("div",{class:"icon lock"}):r("button",{class:"icon remove-btn",tabIndex:-1,onClick:()=>t.emitDeselectedEvent()}))}renderTags(){return this.tagsList.map((t=>this.renderTag(t)))}renderTagCounter(){if(this.maxTags)return r("div",{class:"lower-row"},r("div",{id:"max-tags"},this.renderMaxTags()))}renderMaxTags(){if(this.helpText)return this.helpText;{let t=`${this.tagsAddedMessage}: ${this.taggedOptions.length}/${this.maxTags}`;return this.tagLimitReached&&(t+=`- ${this.maxTagsReachedMessage}`),t}}handleCellMouseEnter(t){const e=t.target,i=e.querySelector(".cell-content-wrapper");i.scrollWidth>i.clientWidth&&p("bottom",e,e.innerText)}renderTableCells(t){return[t.col1,t.col2,t.col3,t.col4].filter((t=>!!t)).map(((e,i)=>{const o=`${t.id}-col${i+1}`;let a="wrap";return this.colWrap&&u(this.colWrap)[i]&&(a=u(this.colWrap)[i]),r("td",{id:o,class:{focused:!!this._focusedCell&&o===this._focusedCell.id},role:"gridcell","aria-describedby":`${o}-description`,"aria-selected":t.selected?"true":"false","aria-readonly":t.locked?"true":null,onMouseEnter:t=>this.handleCellMouseEnter(t),onMouseLeave:()=>h()},r("div",{class:`cell-content-wrapper ${a}`},e),r("div",{class:"description",id:`${o}-description`},t.locked?"locked":""))}))}renderTableRow(t){return r("tr",{id:t.id,class:{selected:t.selected,locked:t.locked,focused:!(!this.focusedOption||t!==this.focusedOption)},onClick:t=>this.handleOptionClick(t)},this.renderTableCells(t))}renderListItem(t){if(this.inputEl)return r("li",{id:t.id,role:"option",class:"option "+(this.focusedOption&&t===this.focusedOption?"focused":""),"aria-selected":t.selected?"true":"false",onClick:t=>this.handleOptionClick(t)},t.textContent)}render(){return r("div",{class:`wrapper label-${this.labelPosition} ${this.errorMessage?"invalid":""}`},r("div",{class:"label-wrapper"},r("label",{class:"label",htmlFor:"input"},this.label,this.requiredField&&r("span",{class:"required","aria-hidden":"true"},"*"))),r("div",{class:`field-wrapper ${this.el.shadowRoot.activeElement===this.inputEl?"focused":""} ${this.errorMessage?"invalid":""}`,ref:t=>this.fieldWrapperEl=t},r("div",{class:"upper-row"},r("div",{class:"tags-and-input-wrapper "+(this.inModal?"in-modal":"")},r("ul",{ref:t=>this.tagAreaEl=t,class:`tag-area ${0===this.taggedOptions.length&&"empty"} ${this.isKeying?"user-is-keying":""}`,role:"listbox","aria-activedescendant":this.focusedTag?this.focusedTag.id:null,"aria-orientation":"horizontal","aria-label":`${this.label} ${this.tagAreaInstructions}`,tabindex:this._tagEls.length>0?0:-1,"aria-describedby":"info max-tags",onFocus:t=>this.handleTagAreaFocus(t),onBlur:t=>{this.focusedTagIndex=void 0,this.handleBlur(t)},onKeyDown:t=>this.handleTagAreaKeyDown(t)},this.renderTags()),r("input",{id:"input",class:"input",role:"combobox",ref:t=>this.inputEl=t,autocomplete:"off","aria-required":this.requiredField?"true":null,"aria-controls":this.tagInputType,"aria-describedby":`help-text${this.errorMessage?" error ":""} max-tags`,"aria-label":`${this.label} ${this.isDropdown?m.getCharacterLimit(this.characterLimit):""}`,"aria-expanded":this.isDropdown?this.isExpanded.toString():null,"aria-activedescendant":this.inputActiveDescendantId,placeholder:this.placeholder,maxLength:this.isDropdown?this.characterLimit:void 0,onInput:t=>this.handleInputChanged(t),onBlur:t=>{this.handleBlur(t)},onFocus:()=>this.handleInputFocus(),onKeyDown:t=>this.handleInputKeyDown(t)})),this.isDropdown&&r("div",{class:"character-count"},this.charCount,"/",this.characterLimit)),this.renderTagCounter(),this.isDropdown&&this.renderDropdown()),this.info&&r("div",{id:"info",class:"info-text"},this.info),r("div",{id:"error"},this.errorMessage),r("div",{class:"sr-only","aria-live":"polite",ref:t=>this.liveRegionEl=t,"aria-atomic":"true"},this.liveRegionMessage),this.isTable&&this.renderTable())}static get delegatesFocus(){return!0}get el(){return o(this)}static get watchers(){return{errorMessage:["announceError"]}}};w.style=':host{--wmcolor-taginput-altrow-background-table:var(--wmcolor-table-altrow-background);--wmcolor-taginput-border:var(--wmcolor-input-border);--wmcolor-taginput-charcount-background:var(--wmcolor-input-charcount-background);--wmcolor-taginput-header-background-table:var(--wmcolor-table-header-background);--wmcolor-taginput-help-text:var(--wmcolor-text);--wmcolor-taginput-icon:var(--wmcolor-icon-accent);--wmcolor-taginput-maxtags-background:var(--wmcolor-background-readonly);--wmcolor-taginput-maxtags-border:var(--wmcolor-input-border);--wmcolor-taginput-maxtags-text:var(--wmcolor-text);--wmcolor-taginput-option-background-hover:var(--wmcolor-option-background-hover);--wmcolor-taginput-option-background:var(--wmcolor-option-background);--wmcolor-taginput-option-border:var(--wmcolor-option-border);--wmcolor-taginput-option-text-selected:var(--wmcolor-option-text-disabled);--wmcolor-taginput-option-text:var(--wmcolor-interactive);--wmcolor-taginput-row-background-hover:var(--wmcolor-interactive-background-hover);--wmcolor-taginput-row-background-selected:var(--wmcolor-table-row-background-selected);--wmcolor-taginput-row-background-table:var(--wmcolor-table-row-background);--wmcolor-taginput-row-border-selected:var(--wmcolor-table-row-border-selected);--wmcolor-taginput-tag-background-focus:var(--wmcolor-palelilacgray-dark);--wmcolor-taginput-tag-background-highlight:var(--wmcolor-interactive-background-highlight);--wmcolor-taginput-tag-background-locked:var(--wmcolor-interactive-disabled);--wmcolor-taginput-tag-background:var(--wmcolor-palelilacgray);--wmcolor-taginput-tag-text-locked:var(--wmcolor-text-ondark);--wmcolor-taginput-tag-text:var(--wmcolor-text);--wmcolor-taginput-tagbutton-background-hover:var(--wmcolor-button-background-icononly-hover);--wmcolor-taginput-tagbutton-border:var(--wmcolor-button-border-icononly);--wmcolor-taginput-tagbutton-icon-hover:var(--wmcolor-button-icon-icononly-hover);--wmcolor-taginput-tagbutton-icon:var(--wmcolor-button-icon-icononly);font-family:inherit;width:100%;display:block;max-height:80vh}:host *{-webkit-box-sizing:border-box;box-sizing:border-box;font-size:14px}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper{width:100%;height:100%;max-height:inherit;min-height:inherit;position:relative}:host .field-wrapper{position:relative;width:100%;border:1px solid;border-color:var(--wmcolor-taginput-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px}:host .field-wrapper.focused{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .field-wrapper.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper:not(.label-left) .field-wrapper{-ms-flex-negative:0;flex-shrink:0}:host .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:var(--wmcolor-taginput-charcount-background);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .tags-and-input-wrapper{position:relative;width:100%;padding:8px 8px 8px 6px;overflow:auto;max-height:200px}:host .tags-and-input-wrapper.in-modal{max-height:20vh}:host .upper-row{width:100%;display:-ms-flexbox;display:flex;-ms-flex:1;flex:1;-ms-flex-pack:justify;justify-content:space-between}:host .upper-row:before{-ms-flex-item-align:start;align-self:flex-start;display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f349";color:var(--wmcolor-taginput-icon);padding:0.75rem 0.5rem 0.75rem 0.75rem;line-height:normal;font-size:1.12rem}:host .lower-row{width:100%;min-height:1.875rem}:host #max-tags{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:1.875rem;background-color:var(--wmcolor-taginput-maxtags-background);padding:0.5rem 1rem;color:var(--wmcolor-taginput-maxtags-text);font-size:0.875rem;border-top:1px solid var(--wmcolor-taginput-maxtags-border);border-radius:0 0 3px 3px}:host .tag-area{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;padding:0;margin:0;gap:8px}:host .tag-area:focus{outline:none}:host .tag-area li{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-align:center;align-items:center;height:1.75rem;list-style:none;color:var(--wmcolor-taginput-tag-text);background-color:var(--wmcolor-taginput-tag-background);padding:0.5rem 0.625rem;-webkit-transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);white-space:pre}:host .tag-area li.highlight{-webkit-animation:fadeIn 1s;animation:fadeIn 1s}@-webkit-keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}@keyframes fadeIn{0%{background-color:var(--wmcolor-taginput-tag-background)}50%{background-color:var(--wmcolor-taginput-tag-background-highlight)}100%{background-color:var(--wmcolor-taginput-tag-background)}}:host .tag-area li.locked{background-color:var(--wmcolor-taginput-tag-background-locked);color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon{display:-ms-inline-flexbox;display:inline-flex;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;height:1.25rem;width:1.25rem;padding:0;margin-left:0.5rem}:host .tag-area li .icon.remove-btn{border:1px solid var(--wmcolor-taginput-tagbutton-border);color:var(--wmcolor-taginput-tagbutton-icon);border-radius:50%;cursor:pointer;-webkit-transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1);transition:background-color 500ms cubic-bezier(0.4, 0, 0.2, 1), color 500ms cubic-bezier(0.4, 0, 0.2, 1)}:host .tag-area li .icon.remove-btn:hover{color:var(--wmcolor-taginput-tagbutton-icon-hover);background-color:var(--wmcolor-taginput-tagbutton-background-hover)}:host .tag-area li .icon.remove-btn:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f156"}:host .tag-area li .icon.lock{color:var(--wmcolor-taginput-tag-text-locked)}:host .tag-area li .icon.lock:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f341"}:host .tag-area.user-is-keying:focus-visible li.focused{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:3px}:host .input{font-family:inherit;border:none;height:1.75rem;padding:0;margin:0;right:8px}:host .input:focus{outline:none}:host .tag-area:not(.empty)+.input.extended{-webkit-margin-before:8px;margin-block-start:8px}:host .dropdown-wrapper{margin:0;padding:0;-webkit-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-moz-box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 4px 15px 0 rgba(0, 0, 0, 0.2);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;position:absolute;top:calc(100% + 2px);right:0;z-index:100;width:100%;font-size:0.875rem}:host .dropdown-wrapper .dropdown{-webkit-overflow-scrolling:touch;overflow:auto;max-height:12.5rem;margin:0;padding:0}:host .dropdown-wrapper.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1)}:host .dropdown-wrapper.upwards{top:unset;bottom:calc(100% + 2px);-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}:host .dropdown-wrapper li,:host .dropdown-wrapper div{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding:0 1rem;background:var(--wmcolor-taginput-option-background);list-style:none;min-height:2.6875rem;white-space:pre-wrap;overflow-wrap:anywhere}:host .dropdown-wrapper li.option,:host .dropdown-wrapper li.add-new-btn,:host .dropdown-wrapper div.option,:host .dropdown-wrapper div.add-new-btn{cursor:pointer;color:var(--wmcolor-taginput-option-text);font-weight:bold;width:100%;border:none}:host .dropdown-wrapper li.option[aria-selected=true],:host .dropdown-wrapper li.add-new-btn[aria-selected=true],:host .dropdown-wrapper div.option[aria-selected=true],:host .dropdown-wrapper div.add-new-btn[aria-selected=true]{color:var(--wmcolor-taginput-option-text-selected);font-style:italic;font-weight:normal;cursor:unset}:host .dropdown-wrapper li.option:hover:not([aria-selected=true]),:host .dropdown-wrapper li.option.focused,:host .dropdown-wrapper li.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper li.add-new-btn.focused,:host .dropdown-wrapper div.option:hover:not([aria-selected=true]),:host .dropdown-wrapper div.option.focused,:host .dropdown-wrapper div.add-new-btn:hover:not([aria-selected=true]),:host .dropdown-wrapper div.add-new-btn.focused{outline:none;background:var(--wmcolor-taginput-option-background-hover)}:host .dropdown-wrapper li.help-text,:host .dropdown-wrapper div.help-text{color:var(--wmcolor-taginput-help-text);height:auto;min-height:2.6875rem;padding-top:0.25rem;padding-bottom:0.25rem;white-space:normal}:host .dropdown-wrapper li:not(:last-child),:host .dropdown-wrapper div:not(:last-child){border-bottom:2px solid var(--wmcolor-taginput-option-border)}:host .info-text{font-style:italic;margin-top:0.25rem}:host .table-wrapper{overflow:auto;margin-top:1.5rem}:host .table-wrapper #table{width:100%;border-spacing:0px}:host .table-wrapper #table.fixed-widths{table-layout:fixed}:host .table-wrapper #table .headers{height:2.5rem;background-color:var(--wmcolor-taginput-header-background-table)}:host .table-wrapper #table .headers th{text-align:left;font-size:0.75rem;font-weight:700;text-transform:uppercase;padding:0 1.5rem}:host .table-wrapper tr:nth-child(even){background-color:var(--wmcolor-taginput-altrow-background-table)}:host .table-wrapper tr.selected,:host .table-wrapper tr.locked{background-color:var(--wmcolor-taginput-row-background-selected);-webkit-box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);box-shadow:inset 0 0 0 1px var(--wmcolor-taginput-row-border-selected);font-weight:500}:host .table-wrapper tr.focused,:host .table-wrapper tr:hover:not(.locked){background-color:var(--wmcolor-taginput-row-background-hover);-webkit-box-shadow:none;box-shadow:none}:host .table-wrapper tr.locked td{cursor:auto}:host .table-wrapper tr.locked td:first-child .cell-content-wrapper:before{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f33e";margin-right:0.5rem;color:var(--wmcolor-taginput-tag-text)}:host .table-wrapper td{height:3.75rem;vertical-align:middle;padding:0 1.5rem;cursor:pointer}:host .table-wrapper td.focused{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-3px}:host .table-wrapper td .cell-content-wrapper.trunc{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host .description{display:none}:host .no-results{padding:1.25rem 1.5rem}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host #error{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem}:host #error:not(:empty){margin-top:0.25rem}';export{w as wm_tag_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as o,H as e,g as s}from"./p-568c595f.js";import{d as n,q as r,k as a,y as h}from"./p-16f65bf4.js";import{g as m}from"./p-2732bddd.js";const c=class{constructor(o){t(this,o),this.wmActionMenuLoaded=i(this,"wmActionMenuLoaded",7),this.menuLoaded=i(this,"menuLoaded",7),this.openUp=!1,this.keysSoFar="",this.searchIndex=0,this.debouncedClearKeysSoFar=n((()=>{this.keysSoFar=""}),500),this.isExpanded=!1,this.tooltipPosition=void 0,this.actionMenuType="icon",this.buttonText=void 0,this.disabled=!1,this.tooltip=void 0,this.labelForIdenticalButtons=void 0,this.darkMode=void 0}get horizontalPosition(){return this.el&&this.itemsEl&&r(this.el,this.itemsEl.clientWidth)?"right":"left"}get childItems(){return Array.from(this.el.querySelectorAll("wm-menuitem"))}get internalButtonType(){return"icon"===this.actionMenuType||"text"===this.actionMenuType?this.actionMenuType+"only":this.actionMenuType}handleClickedItem(){this.close()}handleKeyUp(t){this.moveUp(t.target)}handleKeyDown(t){this.moveDown(t.detail)}handleHomeKey(){this.focusFirstItem()}handleEndKey(){this.focusLastItem()}handleTabKey(){this.isExpanded&&this.close()}handleEscKey(){this.close(),this.wmButtonEl.focus()}handleKey(t){switch(t.key){case"ArrowDown":this.isExpanded||(t.preventDefault(),this.open(),window.requestAnimationFrame((()=>this.focusFirstItem())));break;case"ArrowUp":this.isExpanded||(t.preventDefault(),this.open(),window.requestAnimationFrame((()=>this.focusLastItem())))}}handleMenuitemBlur(t){if(t.detail.relatedTarget!==this.el&&!this.el.contains(t.detail.relatedTarget)){const i=new CustomEvent("blur");i.relatedTarget=t.detail.relatedTarget,this.el.dispatchEvent(i)}}handleButtonBlur(t){(t.relatedTarget===this.el||this.el.contains(t.relatedTarget))&&t.stopPropagation()}componentDidLoad(){"icon"===this.actionMenuType||this.buttonText||console.error("wm-action-menu should have a valid button-text property when action-menu-type is set to 'text' or 'selector'"),"icon"!==this.actionMenuType||this.tooltip||console.error("wm-action-menu should have a valid tooltip when action-menu-type is set to 'icon'"),this.wmActionMenuLoaded.emit(),this.menuLoaded.emit()}moveUp(t){const i=this.childItems.indexOf(t);0===i?this.focusLastItem():this.childItems[i-1].focus()}moveDown(t){const i=this.childItems.indexOf(t);i===this.childItems.length-1?this.focusFirstItem():this.childItems[i+1].focus()}open(){this.disabled||(this.openUp=a(this.el,this.itemsEl.clientHeight),this.isExpanded=!0,this.itemsEl.classList.remove("hidden"),window.requestAnimationFrame((()=>this.focusFirstItem())))}close(t=!0){this.isExpanded=!1,window.setTimeout((()=>{this.itemsEl.classList.add("hidden")}),150),window.setTimeout((()=>{!t||"BODY"!==document.activeElement.tagName&&"WM-MENUITEM"!==document.activeElement.tagName||this.wmButtonEl.focus()}),250)}focusFirstItem(){this.childItems[0].focus()}focusLastItem(){this.childItems[this.childItems.length-1].focus()}findAndFocusItem(t){if(this.keysSoFar||" "!=t.detail){const i=t.detail.toLowerCase();this.focusFirstItem(),this.keysSoFar||this.childItems.forEach(((t,i)=>{t===document.activeElement&&(this.searchIndex=i)})),this.keysSoFar+=i;let o=this.findMatchInRange(this.childItems,this.searchIndex+1,this.childItems.length);o||(o=this.findMatchInRange(this.childItems,0,this.searchIndex)),o&&o.focus(),this.debouncedClearKeysSoFar()}else t.target.click()}findMatchInRange(t,i,o){for(var e=i;e<o;e++){var s=t[e].textContent;if(s&&0===s.toLowerCase().indexOf(this.keysSoFar))return t[e]}return null}render(){return o(e,{onBlur:()=>this.close(!1)},o("div",{class:h()},o("wm-button",{"button-type":this.internalButtonType,tooltip:this.tooltip,"custom-background":this.darkMode?"dark":void 0,"label-for-identical-buttons":this.labelForIdenticalButtons,icon:"icon"===this.actionMenuType?"f1d9":"",iconSize:"icon"===this.actionMenuType?"24px":void 0,id:"menubtn",onClick:()=>this.isExpanded?this.close():this.open(),onBlur:t=>this.handleButtonBlur(t),disabled:this.disabled,ref:t=>this.wmButtonEl=t,"tooltip-position":this.tooltipPosition||this.horizontalPosition,"aria-haspopup":"true","aria-expanded":this.isExpanded?"true":"false","aria-controls":"menu"},this.buttonText),o("div",{class:`dropdown ${this.openUp?"open-up":""} ${this.horizontalPosition} ${this.isExpanded?"open":""} hidden`,id:"menu",tabindex:-1,role:"menu",ref:t=>this.itemsEl=t},o("slot",null))))}static get delegatesFocus(){return!0}get el(){return s(this)}};c.style=":host{--wmcolor-actionmenu-background:var(--wmcolor-background);--wmcolor-actionmenu-text:var(--wmcolor-interactive);--wmcolor-actionmenu-text-disabled:var(--wmcolor-option-text-disabled);position:relative;display:inline-block;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;color:var(--wmcolor-actionmenu-text);font-family:inherit}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host(:focus){outline:none}wm-action-menu:focus{outline:none}.dropdown{position:absolute;padding:0;margin:0.25rem 0;border-radius:3px 3px 3px 3px;min-width:11.4375rem;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;visibility:hidden;-webkit-box-shadow:0 3px 14px 3px rgba(5, 3, 3, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 3px 14px 3px rgba(5, 3, 3, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);background:var(--wmcolor-actionmenu-background);z-index:10;text-align:left;white-space:nowrap}.dropdown:focus{outline:none}.dropdown.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1);visibility:visible}.dropdown.open-up{bottom:2.5rem;top:auto;-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.dropdown.right{left:0}.dropdown.left{right:0}";const d=class{constructor(o){t(this,o),this.wmMenuitemClicked=i(this,"wmMenuitemClicked",7),this.wmKeyUpPressed=i(this,"wmKeyUpPressed",7),this.wmKeyDownPressed=i(this,"wmKeyDownPressed",7),this.wmEscKeyPressed=i(this,"wmEscKeyPressed",7),this.wmHomeKeyPressed=i(this,"wmHomeKeyPressed",7),this.wmEndKeyPressed=i(this,"wmEndKeyPressed",7),this.wmPageDownItems=i(this,"wmPageDownItems",7),this.wmPageUpItems=i(this,"wmPageUpItems",7),this.wmTabKeyPressed=i(this,"wmTabKeyPressed",7),this.wmLetterPressed=i(this,"wmLetterPressed",7),this.wmMenuitemBlurred=i(this,"wmMenuitemBlurred",7),this.descriptionCharLimit=100,this.disabled=!1,this.icon=void 0,this.description=void 0}handleKeydown(t){const i=t.altKey||t.ctrlKey||t.metaKey,o=/^.$/.test(t.key)&&!i;switch(t.key){case"ArrowUp":t.preventDefault(),this.wmKeyUpPressed.emit(this.el);break;case"ArrowDown":t.preventDefault(),this.wmKeyDownPressed.emit(this.el);break;case"Enter":t.preventDefault(),this.disabled||this.el.click();break;case"Escape":t.preventDefault(),t.stopPropagation(),this.wmEscKeyPressed.emit();break;case"Home":t.preventDefault(),this.wmHomeKeyPressed.emit();break;case"End":t.preventDefault(),this.wmEndKeyPressed.emit();break;case"Tab":this.wmTabKeyPressed.emit();break;default:o&&(t.preventDefault(),this.wmLetterPressed.emit(t.key))}}handleClick(){this.disabled||this.wmMenuitemClicked.emit()}handleBlur(t){this.wmMenuitemBlurred.emit({relatedTarget:t.relatedTarget})}setOnClick(){this.disabled&&this.el.onclick?(this.onClickFunc=this.el.onclick,this.el.onclick=null):!this.disabled&&this.onClickFunc&&(this.el.onclick=this.onClickFunc)}componentWillLoad(){this.icon&&(this.icon=m(this.icon)),this.description&&(this.description.length>this.descriptionCharLimit&&console.error(`wm-menuitem description is above the character limit of ${this.descriptionCharLimit}`),this.icon&&console.error("wm-menuitems with descriptions do not support the use of icons")),this.setOnClick()}componentDidLoad(){this.icon&&(this.iconEl.classList.add("mdi"),this.iconEl.innerHTML=`&#x${this.icon};`)}render(){return o(e,{tabindex:-1,role:"menuitem","aria-disabled":this.disabled?"true":null},o("div",{class:"wrapper","aria-disabled":this.disabled?"true":null},o("span",{ref:t=>this.iconEl=t}),this.el.textContent,this.description?o("div",{class:"description"},this.description):""))}get el(){return s(this)}static get watchers(){return{disabled:["setOnClick"]}}};d.style=':host{--wmcolor-actionmenu-item-background-hover:var(--wmcolor-option-background-hover);--wmcolor-actionmenu-item-background-disabled:var(--wmcolor-option-background-disabled);--wmcolor-actionmenu-item-background:var(--wmcolor-option-background);--wmcolor-actionmenu-item-border:var(--wmcolor-option-border);--wmcolor-actionmenu-item-text-description:var(--wmcolor-option-text);--wmcolor-actionmenu-item-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-actionmenu-item-text:var(--wmcolor-interactive);contain:content;font-family:inherit}:host .wrapper{display:block;min-width:8.75rem;cursor:pointer;padding:1.25rem;border-radius:0px 0px 0px 0px;background:var(--wmcolor-actionmenu-item-background);font-family:inherit;font-weight:500;list-style:none;border-bottom:2px solid var(--wmcolor-actionmenu-item-border);color:var(--wmcolor-actionmenu-item-text);font-weight:700}:host .wrapper:hover{background:var(--wmcolor-actionmenu-item-background-hover);outline:none}:host .wrapper .description{color:var(--wmcolor-actionmenu-item-text-description);font-size:0.875rem;padding-top:0.5rem;white-space:normal;font-weight:400}:host .wrapper:not(:last-child){border-bottom:2px solid var(--wmcolor-actionmenu-item-border)}:host ::slotted{font-family:inherit}:host .mdi{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;margin-right:0.625rem;pointer-events:none;font-size:1.12rem}:host(:focus-visible){outline:none}:host(:focus-visible) .wrapper{outline:none;background:var(--wmcolor-actionmenu-item-background-hover)}:host([aria-disabled=true]){pointer-events:none}:host([aria-disabled=true]) .wrapper{background:var(--wmcolor-actionmenu-item-background-disabled);color:var(--wmcolor-actionmenu-text-disabled)}:host([aria-disabled=true]) .description{color:var(--wmcolor-actionmenu-text-disabled)}';export{c as wm_action_menu,d as wm_menuitem}
|
|
1
|
+
import{r as t,c as i,h as o,H as e,g as s}from"./p-568c595f.js";import{d as n,q as r,k as a,y as h}from"./p-eca78c2b.js";import{g as m}from"./p-2732bddd.js";const c=class{constructor(o){t(this,o),this.wmActionMenuLoaded=i(this,"wmActionMenuLoaded",7),this.menuLoaded=i(this,"menuLoaded",7),this.openUp=!1,this.keysSoFar="",this.searchIndex=0,this.debouncedClearKeysSoFar=n((()=>{this.keysSoFar=""}),500),this.isExpanded=!1,this.tooltipPosition=void 0,this.actionMenuType="icon",this.buttonText=void 0,this.disabled=!1,this.tooltip=void 0,this.labelForIdenticalButtons=void 0,this.darkMode=void 0}get horizontalPosition(){return this.el&&this.itemsEl&&r(this.el,this.itemsEl.clientWidth)?"right":"left"}get childItems(){return Array.from(this.el.querySelectorAll("wm-menuitem"))}get internalButtonType(){return"icon"===this.actionMenuType||"text"===this.actionMenuType?this.actionMenuType+"only":this.actionMenuType}handleClickedItem(){this.close()}handleKeyUp(t){this.moveUp(t.target)}handleKeyDown(t){this.moveDown(t.detail)}handleHomeKey(){this.focusFirstItem()}handleEndKey(){this.focusLastItem()}handleTabKey(){this.isExpanded&&this.close()}handleEscKey(){this.close(),this.wmButtonEl.focus()}handleKey(t){switch(t.key){case"ArrowDown":this.isExpanded||(t.preventDefault(),this.open(),window.requestAnimationFrame((()=>this.focusFirstItem())));break;case"ArrowUp":this.isExpanded||(t.preventDefault(),this.open(),window.requestAnimationFrame((()=>this.focusLastItem())))}}handleMenuitemBlur(t){if(t.detail.relatedTarget!==this.el&&!this.el.contains(t.detail.relatedTarget)){const i=new CustomEvent("blur");i.relatedTarget=t.detail.relatedTarget,this.el.dispatchEvent(i)}}handleButtonBlur(t){(t.relatedTarget===this.el||this.el.contains(t.relatedTarget))&&t.stopPropagation()}componentDidLoad(){"icon"===this.actionMenuType||this.buttonText||console.error("wm-action-menu should have a valid button-text property when action-menu-type is set to 'text' or 'selector'"),"icon"!==this.actionMenuType||this.tooltip||console.error("wm-action-menu should have a valid tooltip when action-menu-type is set to 'icon'"),this.wmActionMenuLoaded.emit(),this.menuLoaded.emit()}moveUp(t){const i=this.childItems.indexOf(t);0===i?this.focusLastItem():this.childItems[i-1].focus()}moveDown(t){const i=this.childItems.indexOf(t);i===this.childItems.length-1?this.focusFirstItem():this.childItems[i+1].focus()}open(){this.disabled||(this.openUp=a(this.el,this.itemsEl.clientHeight),this.isExpanded=!0,this.itemsEl.classList.remove("hidden"),window.requestAnimationFrame((()=>this.focusFirstItem())))}close(t=!0){this.isExpanded=!1,window.setTimeout((()=>{this.itemsEl.classList.add("hidden")}),150),window.setTimeout((()=>{!t||"BODY"!==document.activeElement.tagName&&"WM-MENUITEM"!==document.activeElement.tagName||this.wmButtonEl.focus()}),250)}focusFirstItem(){this.childItems[0].focus()}focusLastItem(){this.childItems[this.childItems.length-1].focus()}findAndFocusItem(t){if(this.keysSoFar||" "!=t.detail){const i=t.detail.toLowerCase();this.focusFirstItem(),this.keysSoFar||this.childItems.forEach(((t,i)=>{t===document.activeElement&&(this.searchIndex=i)})),this.keysSoFar+=i;let o=this.findMatchInRange(this.childItems,this.searchIndex+1,this.childItems.length);o||(o=this.findMatchInRange(this.childItems,0,this.searchIndex)),o&&o.focus(),this.debouncedClearKeysSoFar()}else t.target.click()}findMatchInRange(t,i,o){for(var e=i;e<o;e++){var s=t[e].textContent;if(s&&0===s.toLowerCase().indexOf(this.keysSoFar))return t[e]}return null}render(){return o(e,{onBlur:()=>this.close(!1)},o("div",{class:h()},o("wm-button",{"button-type":this.internalButtonType,tooltip:this.tooltip,"custom-background":this.darkMode?"dark":void 0,"label-for-identical-buttons":this.labelForIdenticalButtons,icon:"icon"===this.actionMenuType?"f1d9":"",iconSize:"icon"===this.actionMenuType?"24px":void 0,id:"menubtn",onClick:()=>this.isExpanded?this.close():this.open(),onBlur:t=>this.handleButtonBlur(t),disabled:this.disabled,ref:t=>this.wmButtonEl=t,"tooltip-position":this.tooltipPosition||this.horizontalPosition,"aria-haspopup":"true","aria-expanded":this.isExpanded?"true":"false","aria-controls":"menu"},this.buttonText),o("div",{class:`dropdown ${this.openUp?"open-up":""} ${this.horizontalPosition} ${this.isExpanded?"open":""} hidden`,id:"menu",tabindex:-1,role:"menu",ref:t=>this.itemsEl=t},o("slot",null))))}static get delegatesFocus(){return!0}get el(){return s(this)}};c.style=":host{--wmcolor-actionmenu-background:var(--wmcolor-background);--wmcolor-actionmenu-text:var(--wmcolor-interactive);--wmcolor-actionmenu-text-disabled:var(--wmcolor-option-text-disabled);position:relative;display:inline-block;width:-moz-fit-content;width:-webkit-fit-content;width:fit-content;color:var(--wmcolor-actionmenu-text);font-family:inherit}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host(:focus){outline:none}wm-action-menu:focus{outline:none}.dropdown{position:absolute;padding:0;margin:0.25rem 0;border-radius:3px 3px 3px 3px;min-width:11.4375rem;-ms-transform:scale(1, 0);-webkit-transform:scale(1, 0);-moz-transform:scale(1, 0);transform:scale(1, 0);-ms-transition:transform 0.25s ease;-webkit-transition:transform 0.25s ease;-moz-transition:transform 0.25s ease;-webkit-transition:-webkit-transform 0.25s ease;transition:-webkit-transform 0.25s ease;transition:transform 0.25s ease;transition:transform 0.25s ease, -webkit-transform 0.25s ease;-ms-transform-origin:center top;-webkit-transform-origin:center top;-moz-transform-origin:center top;transform-origin:center top;visibility:hidden;-webkit-box-shadow:0 3px 14px 3px rgba(5, 3, 3, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);box-shadow:0 3px 14px 3px rgba(5, 3, 3, 0.12), 0 4px 15px 0 rgba(0, 0, 0, 0.2);background:var(--wmcolor-actionmenu-background);z-index:10;text-align:left;white-space:nowrap}.dropdown:focus{outline:none}.dropdown.open{-ms-transform:scale(1, 1);-webkit-transform:scale(1, 1);-moz-transform:scale(1, 1);transform:scale(1, 1);visibility:visible}.dropdown.open-up{bottom:2.5rem;top:auto;-ms-transform-origin:center bottom;-webkit-transform-origin:center bottom;-moz-transform-origin:center bottom;transform-origin:center bottom}.dropdown.right{left:0}.dropdown.left{right:0}";const d=class{constructor(o){t(this,o),this.wmMenuitemClicked=i(this,"wmMenuitemClicked",7),this.wmKeyUpPressed=i(this,"wmKeyUpPressed",7),this.wmKeyDownPressed=i(this,"wmKeyDownPressed",7),this.wmEscKeyPressed=i(this,"wmEscKeyPressed",7),this.wmHomeKeyPressed=i(this,"wmHomeKeyPressed",7),this.wmEndKeyPressed=i(this,"wmEndKeyPressed",7),this.wmPageDownItems=i(this,"wmPageDownItems",7),this.wmPageUpItems=i(this,"wmPageUpItems",7),this.wmTabKeyPressed=i(this,"wmTabKeyPressed",7),this.wmLetterPressed=i(this,"wmLetterPressed",7),this.wmMenuitemBlurred=i(this,"wmMenuitemBlurred",7),this.descriptionCharLimit=100,this.disabled=!1,this.icon=void 0,this.description=void 0}handleKeydown(t){const i=t.altKey||t.ctrlKey||t.metaKey,o=/^.$/.test(t.key)&&!i;switch(t.key){case"ArrowUp":t.preventDefault(),this.wmKeyUpPressed.emit(this.el);break;case"ArrowDown":t.preventDefault(),this.wmKeyDownPressed.emit(this.el);break;case"Enter":t.preventDefault(),this.disabled||this.el.click();break;case"Escape":t.preventDefault(),t.stopPropagation(),this.wmEscKeyPressed.emit();break;case"Home":t.preventDefault(),this.wmHomeKeyPressed.emit();break;case"End":t.preventDefault(),this.wmEndKeyPressed.emit();break;case"Tab":this.wmTabKeyPressed.emit();break;default:o&&(t.preventDefault(),this.wmLetterPressed.emit(t.key))}}handleClick(){this.disabled||this.wmMenuitemClicked.emit()}handleBlur(t){this.wmMenuitemBlurred.emit({relatedTarget:t.relatedTarget})}setOnClick(){this.disabled&&this.el.onclick?(this.onClickFunc=this.el.onclick,this.el.onclick=null):!this.disabled&&this.onClickFunc&&(this.el.onclick=this.onClickFunc)}componentWillLoad(){this.icon&&(this.icon=m(this.icon)),this.description&&(this.description.length>this.descriptionCharLimit&&console.error(`wm-menuitem description is above the character limit of ${this.descriptionCharLimit}`),this.icon&&console.error("wm-menuitems with descriptions do not support the use of icons")),this.setOnClick()}componentDidLoad(){this.icon&&(this.iconEl.classList.add("mdi"),this.iconEl.innerHTML=`&#x${this.icon};`)}render(){return o(e,{tabindex:-1,role:"menuitem","aria-disabled":this.disabled?"true":null},o("div",{class:"wrapper","aria-disabled":this.disabled?"true":null},o("span",{ref:t=>this.iconEl=t}),this.el.textContent,this.description?o("div",{class:"description"},this.description):""))}get el(){return s(this)}static get watchers(){return{disabled:["setOnClick"]}}};d.style=':host{--wmcolor-actionmenu-item-background-hover:var(--wmcolor-option-background-hover);--wmcolor-actionmenu-item-background-disabled:var(--wmcolor-option-background-disabled);--wmcolor-actionmenu-item-background:var(--wmcolor-option-background);--wmcolor-actionmenu-item-border:var(--wmcolor-option-border);--wmcolor-actionmenu-item-text-description:var(--wmcolor-option-text);--wmcolor-actionmenu-item-text-disabled:var(--wmcolor-option-text-disabled);--wmcolor-actionmenu-item-text:var(--wmcolor-interactive);contain:content;font-family:inherit}:host .wrapper{display:block;min-width:8.75rem;cursor:pointer;padding:1.25rem;border-radius:0px 0px 0px 0px;background:var(--wmcolor-actionmenu-item-background);font-family:inherit;font-weight:500;list-style:none;border-bottom:2px solid var(--wmcolor-actionmenu-item-border);color:var(--wmcolor-actionmenu-item-text);font-weight:700}:host .wrapper:hover{background:var(--wmcolor-actionmenu-item-background-hover);outline:none}:host .wrapper .description{color:var(--wmcolor-actionmenu-item-text-description);font-size:0.875rem;padding-top:0.5rem;white-space:normal;font-weight:400}:host .wrapper:not(:last-child){border-bottom:2px solid var(--wmcolor-actionmenu-item-border)}:host ::slotted{font-family:inherit}:host .mdi{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;display:inline-block;margin-right:0.625rem;pointer-events:none;font-size:1.12rem}:host(:focus-visible){outline:none}:host(:focus-visible) .wrapper{outline:none;background:var(--wmcolor-actionmenu-item-background-hover)}:host([aria-disabled=true]){pointer-events:none}:host([aria-disabled=true]) .wrapper{background:var(--wmcolor-actionmenu-item-background-disabled);color:var(--wmcolor-actionmenu-text-disabled)}:host([aria-disabled=true]) .description{color:var(--wmcolor-actionmenu-text-disabled)}';export{c as wm_action_menu,d as wm_menuitem}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-ab8d78cc.system.js","./p-
|
|
1
|
+
System.register(["./p-ab8d78cc.system.js","./p-edd87140.system.js","./p-ee31c799.system.js"],(function(t){"use strict";var e,i,r,n,o,s,a,l;return{setters:[function(t){e=t.r;i=t.c;r=t.h;n=t.g},function(t){o=t.t;s=t.a;a=t.b},function(t){l=t.g}],execute:function(){var p=':host{font-family:inherit;width:100%}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper .inner-wrapper{width:100%}:host .wrapper .text-after-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px}:host .wrapper .text-after{-ms-flex:0 1 fit-content;flex:0 1 fit-content}:host .wrapper .inputfield-wrapper{height:2.5rem;min-width:6.25rem;border:1px solid var(--wmcolor-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;display:-ms-flexbox;display:flex}:host .wrapper .inputfield-wrapper.disabled{background-color:var(--wmcolor-input-background-disabled);color:var(--wmcolor-input-text-disabled)}:host .wrapper .inputfield-wrapper.disabled .symbol{background:none}:host .wrapper .symbol{display:-ms-flexbox;display:flex;background-color:var(--wmcolor-input-unit-background);-ms-flex:0 0 44px;flex:0 0 44px;padding-inline:8px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .wrapper .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:var(--wmcolor-input-charcount-background);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .wrapper input{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;border:none;font-family:inherit;font-size:0.875rem;height:100%;-ms-flex:1;flex:1;padding:0.75rem 1rem;width:100%}:host .wrapper input:focus{outline:none}:host .wrapper input[type=number]{padding-right:0}:host .wrapper .info{font-style:italic;line-height:100%;margin:4px 0}:host .wrapper.invalid .inputfield-wrapper{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper.invalid .error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;line-height:100%}:host .wrapper.invalid .error-message:not(:empty){margin-top:0.25rem}:host .wrapper:focus .inputfield-wrapper,:host .wrapper.focus .inputfield-wrapper{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var h=t("wm_input",function(){function t(t){e(this,t);this.wmInputValueChanged=i(this,"wmInputValueChanged",7);this.previousValue="";this.label=undefined;this.labelPosition="top";this.value="";this.disabled=false;this.info=undefined;this.inputWidth="";this.placeholder="";this.requiredField=false;this.errorMessage=undefined;this.characterLimit=undefined;this.symbolBefore=undefined;this.symbolAfter=undefined;this.textAfter=undefined;this.type="text";this.step=1;this.min=undefined;this.max=undefined;this.isSubmit=false;this.announcement=""}t.prototype.getInputWidth=function(){return this.inputWidth?{width:this.inputWidth}:{flex:"1"}};Object.defineProperty(t.prototype,"charCount",{get:function(){return this.value.length},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"isDisabled",{get:function(){return o(this.disabled)},enumerable:false,configurable:true});t.prototype.componentWillLoad=function(){if(!this.label){console.error("wm-input requires the label property")}s(this.el,this.isDisabled)};t.prototype.componentDidLoad=function(){this.previousValue=this.inputEl.value};t.prototype.handleDisabledChange=function(){s(this.el,this.isDisabled)};t.prototype.announceError=function(){var t=this;if(this.errorMessage){setTimeout((function(){return t.announce(t.errorMessage)}),100)}};t.prototype.handleInput=function(t){this.value=t.target.value;if(this.characterLimit&&this.charCount>=this.characterLimit-5){this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit))}};t.prototype.handleKeyDown=function(t){var e=t.ctrlKey||t.metaKey||t.altKey;var i=/^.$/.test(t.key)&&!e;var r=i&&this.characterLimit&&this.inputEl.value.length>=this.characterLimit;if(r){this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit))}if(t.key==="Enter"){this.isSubmit&&a(this.el.closest("form"))}};t.prototype.handleBlur=function(){if(this.value!==this.previousValue){this.wmInputValueChanged.emit({value:this.value})}this.previousValue=this.value;this.inputWrapperEl.classList.remove("focus")};t.prototype.handleFocus=function(){this.inputWrapperEl.classList.add("focus")};t.prototype.announce=function(t){if(this.liveRegionEl.textContent===t){t+=" "}this.announcement=t};t.prototype.generateCharacterLimitWarning=function(t,e){var i=l.getCharactersEntered(t,e);if(t>=e){i+=" ".concat(l.characterLimitReached)}return i};t.prototype.descriptors=function(){return this.symbolBefore||this.symbolAfter||this.textAfter?"symbol-before inputfield symbol-after text-after info error":"info error"};t.prototype.render=function(){var t=this;return r("div",{class:"wrapper label-".concat(this.labelPosition," ").concat(this.errorMessage?"invalid":""),ref:function(e){return t.inputWrapperEl=e}},r("div",{class:"label-wrapper"},r("label",{htmlFor:"inputfield",class:"label"},this.label,this.characterLimit&&r("span",{class:"sr-only"}," ",l.getCharacterLimit(this.characterLimit)),this.requiredField&&r("span",{class:"required","aria-hidden":"true"},"*"))),r("div",{class:"inner-wrapper"},r("div",{class:"text-after-wrapper"},r("div",{class:"inputfield-wrapper ".concat(this.isDisabled?"disabled":""),style:this.getInputWidth()},this.symbolBefore&&r("span",{class:"symbol",id:"symbol-before"},this.symbolBefore),r("input",{ref:function(e){return t.inputEl=e},id:"inputfield",disabled:this.isDisabled,"aria-describedby":this.descriptors(),onInput:function(e){return t.handleInput(e)},onKeyDown:function(e){return t.handleKeyDown(e)},onBlur:function(){return t.handleBlur()},onFocus:function(){return t.handleFocus()},placeholder:this.placeholder,autocomplete:"off","aria-required":this.requiredField?"true":null,maxLength:this.characterLimit||undefined,type:this.type,step:this.step,max:this.max,min:this.min,value:this.el.value}),this.symbolAfter&&r("span",{class:"symbol",id:"symbol-after"},this.symbolAfter),this.characterLimit&&typeof this.characterLimit==="number"?r("div",{class:"character-count"},this.charCount,"/",this.characterLimit):""),this.textAfter&&r("span",{class:"text-after",id:"text-after"},this.textAfter)),this.info&&r("div",{id:"info",class:"info"},this.info),r("div",{id:"error",class:"error-message"},this.errorMessage),r("div",{class:"sr-only","aria-live":"polite","aria-atomic":"true",ref:function(e){return t.liveRegionEl=e}},this.announcement)))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return n(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{disabled:["handleDisabledChange"],errorMessage:["announceError"]}},enumerable:false,configurable:true});return t}());h.style=p}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as o,h as e,g as i,H as a}from"./p-568c595f.js";import{g as s}from"./p-
|
|
1
|
+
import{r as t,c as o,h as e,g as i,H as a}from"./p-568c595f.js";import{g as s}from"./p-eca78c2b.js";import{g as r}from"./p-02dc1562.js";const m=class{constructor(e){t(this,e),this.focusLastElement=o(this,"focusLastElement",3),this.focusFirstElement=o(this,"focusFirstElement",3),this.wmModalCloseTriggered=o(this,"wmModalCloseTriggered",3),this.wmModalPrimaryTriggered=o(this,"wmModalPrimaryTriggered",7),this.wmModalSecondaryTriggered=o(this,"wmModalSecondaryTriggered",7),this.open=!1,this.elementToFocus="",this.modalType="modal",this.uid=void 0,this.returnFocusEl=void 0}get closeButtonEl(){return this.el.querySelector(`#wm-modal-close-${this.uid}`)}get focusOnOpenEl(){let t=null;return"primary"===this.elementToFocus||"secondary"===this.elementToFocus?t=this.el.querySelector(`#wm-${this.elementToFocus}-${this.uid}`):this.elementToFocus&&(t=this.el.querySelector("#"+this.elementToFocus),!t&&console.warn(`Ripple Component Library: The modal component couldn't find an element matching the id you passed for 'elementToFocus' (${this.elementToFocus}). It will fall back to the default and focus the close button when the modal opens.`)),t}get hasBrowserPopoverSupport(){const t=document.getElementById("wm-tooltip");return!!t&&!!t.showPopover}toggleModal(){this.open?this.showModal():this.hideModal()}handleDialogClose(){this.open&&this.wmModalCloseTriggered.emit(),this.open=!1}showModal(){this.returnFocusEl=document.activeElement,this.setAriaDescribedbyOnModal(),document.body.style.overflow="hidden",this.dialogEl.showModal(),this.focusOnOpenEl&&this.focusOnOpenEl.focus()}hideModal(){document.body.style.overflow="visible",this.dialogEl.close(),setTimeout((()=>{this.returnFocusEl&&document.activeElement===document.body&&("WM-MENUITEM"===this.returnFocusEl.tagName&&(this.returnFocusEl=this.returnFocusEl.parentElement),this.returnFocusEl.focus())}),20)}componentWillLoad(){"primary"!==this.elementToFocus&&"secondary"!==this.elementToFocus||this.el.id||console.error("For accessibility purposes you need to set the modal content wrapper's id to 'content-[id of wm-modal]'."),this.el.focus=()=>{this.focusOnOpenEl?this.focusOnOpenEl.focus():this.closeButtonEl.focus()},this.uid=this.el.id?this.el.id:s()}componentDidLoad(){this.open&&this.showModal(),this.dialogEl.addEventListener("close",(()=>this.handleDialogClose()))}async emitCloseEvent(){this.wmModalCloseTriggered.emit()}async emitPrimaryEvent(){this.wmModalPrimaryTriggered.emit()}async emitSecondaryEvent(){this.wmModalSecondaryTriggered.emit()}handleKeyDown(t){"Escape"==t.key&&t.stopPropagation()}setAriaDescribedbyOnModal(){document.getElementById(`content-${this.uid}`)?this.el.setAttribute("aria-describedby",`wm-modal-heading-text-${this.uid} content-${this.uid}`):console.warn("Ripple Component Library: The element containing the body of the modal must include an id in the format 'content-[id of modal]' for accessibility purposes.")}render(){return e("dialog",{class:"wm-"+this.modalType,ref:t=>this.dialogEl=t,onKeyDown:t=>this.handleKeyDown(t)},e("div",{class:"tabtrap sr-only",tabindex:"0",onFocus:t=>{t.relatedTarget&&t.relatedTarget==this.closeButtonEl?this.focusLastElement.emit():this.focusFirstElement.emit()}}),!this.hasBrowserPopoverSupport&&e("div",{class:"wm-tooltip"}),e("slot",null),e("div",{class:"tabtrap sr-only",tabindex:"0",onFocus:()=>{this.focusFirstElement.emit()}}))}get el(){return i(this)}static get watchers(){return{open:["toggleModal"]}}};m.style="wm-modal{--wmcolor-modal-background:var(--wmcolor-background);--wmcolor-modal-border:var(--wmcolor-border);--wmcolor-modal-heading:var(--wmcolor-text);--wmcolor-modal-overlay:var(--wmcolor-overlay)}wm-modal *{-webkit-box-sizing:border-box;box-sizing:border-box}wm-modal dialog{color:inherit;padding:0;width:80vw;max-width:750px;max-height:80vh;-webkit-border-radius:5px 5px 5px 5px;-moz-border-radius:5px 5px 5px 5px;-ms-border-radius:5px 5px 5px 5px;border-radius:5px 5px 5px 5px;border:none;background:var(--wmcolor-modal-background)}wm-modal dialog>:not(wm-modal-header):not(wm-modal-footer){max-height:calc(80vh - 166px)}wm-modal dialog::-webkit-backdrop{background:rgba(25, 25, 25, 0.4)}wm-modal dialog::-ms-backdrop{background:rgba(25, 25, 25, 0.4)}wm-modal dialog::backdrop{background:rgba(25, 25, 25, 0.4)}wm-modal dialog[open]{-webkit-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);-moz-box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14);box-shadow:0px 11px 15px 0px rgba(0, 0, 0, 0.2), 0px 9px 46px 8px rgba(0, 0, 0, 0.12), 0px 24px 38px 3px rgba(0, 0, 0, 0.14)}wm-modal dialog.wm-modal>wm-modal-header{border-bottom:1px solid var(--wmcolor-modal-border)}wm-modal dialog.wm-modal>wm-modal-footer{border-top:1px solid var(--wmcolor-modal-border)}@media only screen and (max-width: 768px){wm-modal dialog.wm-modal{height:100%;max-height:none;max-width:none;width:100vw}wm-modal dialog.wm-modal>*{max-width:none;width:100vw}wm-modal dialog.wm-modal>*:not(wm-modal-header):not(wm-modal-footer){max-height:none;height:calc(100vh - 166px)}}wm-modal dialog.wm-dialog>:not(wm-modal-header):not(wm-modal-footer):not(.wm-tooltip){padding:0 1.875rem 1.25rem 1.875rem;font-size:0.875rem;border:none}wm-modal wm-modal-header,wm-modal wm-modal-footer{padding:1.25rem 1.875rem;width:100%}wm-modal .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important;top:0;left:0}";const d=class{constructor(o){t(this,o),this.secondaryText="",this.primaryText="",this.infoText="",this.primaryActionDisabled=!1,this.deleteStyle=!1}componentWillLoad(){const t=this.el.closest("wm-modal");this.uid=t.uid,t.addEventListener("focusLastElement",(()=>{this.lastElement.focus()}))}emitParentPrimaryEvent(){const t=this.el.closest("wm-modal");t&&t.emitPrimaryEvent()}emitParentSecondaryEvent(){const t=this.el.closest("wm-modal");t&&t.emitSecondaryEvent()}render(){return e("div",{class:"wm-wrapper "+(this.infoText?" footer-text":"")},e("div",{class:"wm-info","aria-live":"polite"},this.infoText),e("div",{class:"wm-button-collection"},this.secondaryText&&e("wm-button",{onClick:()=>this.emitParentSecondaryEvent(),id:`wm-secondary-${this.uid}`,ref:t=>this.primaryActionDisabled?this.lastElement=t:void 0},this.secondaryText),e("wm-button",{"button-type":this.deleteStyle?"secondary":"primary","permanently-delete":this.deleteStyle,onClick:()=>this.emitParentPrimaryEvent(),disabled:this.primaryActionDisabled,id:`wm-primary-${this.uid}`,ref:t=>this.primaryActionDisabled?void 0:this.lastElement=t},this.primaryText)))}get el(){return i(this)}};d.style="wm-modal-footer{display:block;-webkit-border-radius:0px 0px 5px 5px;-moz-border-radius:0px 0px 5px 5px;-ms-border-radius:0px 0px 5px 5px;border-radius:0px 0px 5px 5px}wm-modal-footer .wm-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}@media only screen and (max-width: 650px){wm-modal-footer .wm-wrapper.footer-text{-ms-flex-direction:column;flex-direction:column;-ms-flex-align:start;align-items:flex-start}}wm-modal-footer .wm-wrapper wm-button+wm-button{margin-left:1rem}wm-modal-footer .wm-wrapper .wm-info{font-size:0.875rem;font-style:italic}@media only screen and (max-width: 650px){wm-modal-footer .wm-wrapper .wm-info{padding-bottom:0.625rem}}wm-modal-footer .wm-wrapper .wm-info:focus{outline:none}";const l=class{constructor(o){t(this,o),this.heading="",this.subheading=""}componentWillLoad(){const t=this.el.closest("wm-modal");this.uid=t.uid,t.addEventListener("focusFirstElement",(()=>{this.closeButtonEl.focus()}))}emitParentCloseEvent(){this.el.closest("wm-modal").emitCloseEvent()}render(){return e(a,null,e("div",{class:"wm-wrapper"},e("div",null,e("h2",{class:"title",id:`wm-modal-heading-text-${this.uid}`},this.heading,e("span",{class:"subtitle"},this.subheading))),e("wm-button",{"button-type":"navigational",icon:"f156",tooltip:r.close,"tooltip-position":"left",id:`wm-modal-close-${this.uid}`,ref:t=>this.closeButtonEl=t,onClick:()=>this.emitParentCloseEvent()})))}get el(){return i(this)}};l.style="wm-modal-header{display:block;-webkit-border-radius:5px 5px 0 0px;-moz-border-radius:5px 5px 0 0px;-ms-border-radius:5px 5px 0 0px;border-radius:5px 5px 0 0px}wm-modal-header .wm-wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-ms-flex-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;-webkit-box-align:center;-webkit-align-items:center;-ms-flex-align:center;align-items:center}wm-modal-header .wm-wrapper .title{margin:0;font-weight:600;font-size:1.125rem;color:var(--wmcolor-modal-heading);line-height:normal}wm-modal-header .wm-wrapper .title .subtitle{display:block;font-size:0.875rem;font-weight:normal}wm-modal-header .wm-wrapper .title:focus{outline:none}";export{m as wm_modal,d as wm_modal_footer,l as wm_modal_header}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-ab8d78cc.system.js","./p-
|
|
1
|
+
System.register(["./p-ab8d78cc.system.js","./p-edd87140.system.js","./p-ee31c799.system.js"],(function(e){"use strict";var r,t,i,o,a,n,s;return{setters:[function(e){r=e.r;t=e.c;i=e.h;o=e.g},function(e){a=e.t;n=e.a},function(e){s=e.g}],execute:function(){var l=':host{--wmcolor-textarea-input-border:var(--wmcolor-input-border);--wmcolor-textarea-charcount-background:var(--wmcolor-input-charcount-background);--wmcolor-textarea-input-background-disabled:var(--wmcolor-input-background-disabled);--wmcolor-textarea-input-text-disabled:var(--wmcolor-input-text-disabled);font-family:inherit;display:block;max-width:100%;width:588px}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper .inner-wrapper{width:100%;min-width:6.25rem}:host .wrapper .inputfield-wrapper{border:1px solid var(--wmcolor-textarea-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .wrapper .inputfield-wrapper:has(textarea:focus){outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .wrapper .inputfield-wrapper.invalid{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:end;justify-content:flex-end;height:1.875rem;background-color:var(--wmcolor-textarea-charcount-background);font-size:0.875rem;font-weight:500;padding:4px 16px}:host .wrapper .character-count.exceeded{color:var(--wmcolor-text-error);font-weight:600}:host .wrapper textarea{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;border:none;font-family:inherit;font-size:0.875rem;min-height:calc(1lh + 1rem);padding:0.5rem 1rem;width:100%;resize:vertical}:host .wrapper textarea:focus{outline:none}:host .wrapper textarea[disabled]{background-color:var(--wmcolor-textarea-input-background-disabled);color:var(--wmcolor-textarea-input-text-disabled)}:host .wrapper .error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;line-height:100%}:host .wrapper .error-message:not(:empty){margin-top:0.25rem}:host .wrapper .info{font-style:italic;line-height:100%;margin-top:0.25rem}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';var p=e("wm_textarea",function(){function e(e){r(this,e);this.wmTextareaValueChanged=t(this,"wmTextareaValueChanged",7);this.previousValue="";this.label=undefined;this.labelPosition="top";this.value="";this.disabled=false;this.info=undefined;this.placeholder="";this.requiredField=false;this.errorMessage=undefined;this.characterLimit=undefined;this.inputWidth="";this.inputHeight="";this.announcement=""}Object.defineProperty(e.prototype,"charCount",{get:function(){return this.value.length},enumerable:false,configurable:true});Object.defineProperty(e.prototype,"isDisabled",{get:function(){return a(this.disabled)},enumerable:false,configurable:true});e.prototype.componentWillLoad=function(){var e=this;this.el.focus=function(){e.el.shadowRoot.querySelector("textarea").focus()};if(!this.label){console.error("wm-textarea requires the label property")}if(this.el.textContent){this.value=this.el.textContent}n(this.el,this.isDisabled);this.previousValue=this.value};e.prototype.handleDisabledChange=function(){n(this.el,this.isDisabled)};e.prototype.announceError=function(){var e=this;if(this.errorMessage){setTimeout((function(){return e.announce(e.errorMessage)}),100)}};e.prototype.handleInput=function(e){this.value=e.target.value;if(this.characterLimit&&this.charCount>=this.characterLimit-5){this.announce(s.getCharactersEntered(this.charCount,this.characterLimit))}};e.prototype.handleBlur=function(){if(this.value!==this.previousValue){this.wmTextareaValueChanged.emit({value:this.value})}this.previousValue=this.value};e.prototype.announce=function(e){if(this.liveRegionEl.textContent===e){e+=" "}this.announcement=e};e.prototype.render=function(){var e=this;return i("div",{class:"wrapper label-".concat(this.labelPosition," ").concat(this.errorMessage?"invalid":"")},i("div",{class:"label-wrapper"},i("label",{htmlFor:"inputfield",class:"label"},this.label,this.characterLimit&&i("span",{class:"sr-only"}," ",s.getCharacterLimit(this.characterLimit)),this.requiredField&&i("span",{class:"required","aria-hidden":"true"},"*"))),i("div",{class:"inner-wrapper"},i("div",{class:"inputfield-wrapper ".concat(this.errorMessage?"invalid":""),style:this.inputWidth?{width:this.inputWidth}:{}},i("textarea",{id:"inputfield",disabled:this.isDisabled,"aria-describedby":"info error",onInput:function(r){return e.handleInput(r)},onBlur:function(){return e.handleBlur()},placeholder:this.placeholder,autocomplete:"off","aria-required":this.requiredField?"true":null,value:this.value,rows:3,style:{height:this.inputHeight}}),this.characterLimit&&typeof this.characterLimit==="number"?i("div",{class:"character-count ".concat(this.value.length>this.characterLimit?"exceeded":"")},this.charCount,"/",this.characterLimit):""),this.info&&i("div",{id:"info",class:"info"},this.info),i("div",{id:"error",class:"error-message"},this.errorMessage),i("div",{id:"live-polite",class:"sr-only","aria-live":"polite","aria-atomic":"true",ref:function(r){return e.liveRegionEl=r}},this.announcement)))};Object.defineProperty(e.prototype,"el",{get:function(){return o(this)},enumerable:false,configurable:true});Object.defineProperty(e,"watchers",{get:function(){return{disabled:["handleDisabledChange"],errorMessage:["announceError"]}},enumerable:false,configurable:true});return e}());p.style=l}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
System.register(["./p-ab8d78cc.system.js","./p-
|
|
1
|
+
System.register(["./p-ab8d78cc.system.js","./p-edd87140.system.js"],(function(t){"use strict";var e,i,n,r,a,s,o,u;return{setters:[function(t){e=t.r;i=t.c;n=t.h;r=t.H;a=t.g;s=t.f},function(t){o=t.d;u=t.g}],execute:function(){var l=":host{display:-ms-flexbox;display:flex;font-family:inherit;-ms-flex-item-align:stretch;align-self:stretch}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host.hide{display:none}.tab-item{display:-ms-flexbox;display:flex;-ms-flex-item-align:stretch;align-self:stretch;list-style-type:none}.tab-item .tab{-webkit-border-radius:0;-moz-border-radius:0;-ms-border-radius:0;border-radius:0;color:var(--wmcolor-tab-text);text-decoration:none;letter-spacing:0.7px;font-size:0.875rem;font-weight:500;opacity:1;position:relative;text-transform:uppercase;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding-inline:1.5rem}.tab-item .tab[aria-selected=true]{font-weight:700;opacity:1;text-decoration:underline;text-decoration-thickness:3px;text-underline-offset:16px}.tab-item .tab[aria-selected=true].dark{color:var(--wmcolor-tab-text-ondark)}.tab-item .tab,.tab-item .tab:hover,.tab-item .tab:active{outline:none}.tab-item .tab:focus{outline:none}.tab-item .tab.dark:not([aria-selected=true]){opacity:0.8;color:var(--wmcolor-tab-text-ondark)}.tab-item .tab:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:-3px}";var c=t("wm_tab_item",function(){function t(t){var n=this;e(this,t);this.wmTabSelected=i(this,"wmTabSelected",7);this.keydownOnTabItem=i(this,"keydownOnTabItem",7);this.tabItemLoaded=i(this,"tabItemLoaded",7);this.tabClicked=function(t){t.preventDefault();n.wmTabSelected.emit({tabId:n.tabId})};this.tabPressed=function(t){var e=t.key;if(e==="Enter"||e===" "){t.preventDefault();n.wmTabSelected.emit({tabId:n.tabId})}else if(e.includes("Arrow")){t.preventDefault();n.keydownOnTabItem.emit({tabItem:n.el,key:t.key})}};this.selected=false;this.show=true;this.tabId=""}Object.defineProperty(t.prototype,"parentTabList",{get:function(){return this.el.parentElement},enumerable:false,configurable:true});t.prototype.componentDidLoad=function(){this.tabItemLoaded.emit()};t.prototype.render=function(){var t=this;var e=this.show?"":"hide ";e+=this.parentTabList&&this.parentTabList.customBackground=="dark"?"dark":"";var i={};var a=this.parentTabList&&this.parentTabList.customPadding;if(a){var s=parseInt(a,10)*2||0;var o=a.split(/([0-9]+)/).pop();i={"padding-left":this.parentTabList.customPadding,"padding-right":this.parentTabList.customPadding,"background-size":"calc(100% - ".concat(s).concat(o,") 3px")}}return n(r,{role:"presentation"},n("li",{class:"tab-item",role:"presentation"},n("a",{class:"tab ".concat(e),style:i,role:"tab",ref:function(e){return t.linkEl=e},onClick:this.tabClicked,id:"tab-link-".concat(this.tabId),onKeyDown:function(e){return t.tabPressed(e)},"aria-selected":this.selected?"true":"false",tabindex:this.selected?0:-1},n("slot",null))))};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());c.style=l;var f=":host{--wmcolor-tab-background:var(--wmcolor-background-transparent);--wmcolor-tab-background-dark:var(--wmcolor-background-dark);--wmcolor-tab-text-ondark:var(--wmcolor-interactive-ondark);--wmcolor-tab-text:var(--wmcolor-interactive);position:relative;white-space:nowrap;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;display:block}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .tabcontainer{background:var(--wmcolor-tab-background);margin:0;width:100%;height:4.0625rem;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;padding:0}:host .tabcontainer.dark{background:var(--wmcolor-tab-background-dark);margin:0}:host wm-select{padding:0.375rem 0}";var b=t("wm_tab_list",function(){function t(t){var n=this;e(this,t);this.wmTabSelected=i(this,"wmTabSelected",7);this.debouncedSetLayout=o((function(){if(!n.listWidth){n.setListWidth()}s(n.el)}),10);this.customBackground=undefined;this.customPadding=undefined;this.selectedTab=undefined}Object.defineProperty(t.prototype,"menuLayout",{get:function(){if(this.listWidth){return this.el.offsetWidth<this.listWidth-24}else{return false}},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"tabItems",{get:function(){return Array.from(this.el.querySelectorAll("wm-tab-item"))},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"selectedTabItem",{get:function(){return this.tabItems.filter((function(t){return t.selected}))[0]},enumerable:false,configurable:true});t.prototype.getLinkEl=function(t){return t.shadowRoot.querySelector("a")};Object.defineProperty(t.prototype,"panels",{get:function(){var t=Array.from(document.querySelectorAll("wm-tab-panel"));var e=this.tabItems.map((function(t){return t.tabId}));return t.filter((function(t){return e.includes(t.tabId)}))},enumerable:false,configurable:true});t.prototype.getPanel=function(t){return this.panels.find((function(e){return e.tabId===t}))};t.prototype.setListWidth=function(){var t=this.tabItems.reduce((function(t,e){return t+e.offsetWidth}),0);this.listWidth=t&&t>0?t:this.listWidth};t.prototype.setSelected=function(t){this.tabItems.map((function(e){return e.selected=e.tabId===t}));var e=this.panels.length===1&&this.tabItems.length>1;if(e){this.setAttributesOnPanel(this.panels[0],this.selectedTabItem);this.panels[0].active=true}else{this.panels.map((function(e){return e.active=e.tabId===t}))}};t.prototype.showItems=function(){this.tabItems.map((function(t){return t.show=true}))};t.prototype.hideItems=function(){this.tabItems.map((function(t){return t.show=false}))};t.prototype.componentWillLoad=function(){var t=this;this.el.focus=function(){t.selectedTabItem&&t.selectedTabItem.focus()};var e=new ResizeObserver((function(){return t.debouncedSetLayout()}));e.observe(this.el)};t.prototype.componentDidLoad=function(){var t=this.selectedTab||this.tabItems[0].tabId;this.setSelected(t)};t.prototype.tabItemLoaded=function(t){this.setAriaOnPanelAndTab(t.target)};t.prototype.setAriaOnPanelAndTab=function(t){var e=this.getPanel(t.tabId);if(!e){if(this.panels.length===1){this.setAttributesOnTab(t,this.panels[0])}}else{this.setAttributesOnPanel(e,t);this.setAttributesOnTab(t,e)}};t.prototype.setAttributesOnTab=function(t,e){var i=this.getLinkEl(t);if(i){i.setAttribute("href","#".concat(e.id))}};t.prototype.removeAttributesOnTab=function(t){var e=this.getLinkEl(t);if(e){e.removeAttribute("href")}};t.prototype.setAttributesOnPanel=function(t,e){var i=this.getLinkEl(e);if(i){t.setAttribute("aria-labelledby",i.id);t.setAttribute("tab-id",e.tabId)}};t.prototype.handleKeydown=function(t){var e=t.detail.key;var i=this.tabItems.indexOf(t.detail.tabItem);if(e==="ArrowLeft"||e==="ArrowRight"){this.handleLeftRightArrow(i,e)}};t.prototype.handleLeftRightArrow=function(t,e){if(e){t=e==="ArrowLeft"?t-1:t+1}if(t<0){t=this.tabItems.length-1}else if(t===this.tabItems.length){t=0}var i=this.tabItems[t];this.getLinkEl(i).focus()};t.prototype.renderMenuOrTabs=function(){if(this.menuLayout){this.hideItems();return n("wm-select",{label:"Choose a tab","label-position":"none"},this.renderOptions())}else{this.showItems();var t={};if(this.customPadding){t={"margin-left":"-"+this.customPadding}}return n("ul",{class:"tabcontainer ".concat(this.customBackground||""),style:t,role:"tablist"},n("slot",null))}};t.prototype.renderOptions=function(){var t=this;return this.tabItems.map((function(e){return n("wm-option",{id:"tab-link-".concat(e.tabId),selected:e.tabId===t.selectedTab,onClick:function(i){i.preventDefault();t.wmTabSelected.emit({tabId:e.tabId})}},e.textContent)}))};t.prototype.render=function(){return n(r,{class:this.menuLayout?"menu":""},this.renderMenuOrTabs())};Object.defineProperty(t,"delegatesFocus",{get:function(){return true},enumerable:false,configurable:true});Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});Object.defineProperty(t,"watchers",{get:function(){return{selectedTab:["setSelected"]}},enumerable:false,configurable:true});return t}());b.style=f;var h="wm-tab-panel{visibility:inherit}wm-tab-panel.tab-hidden{display:none}wm-tab-panel:active{outline:none}wm-tab-panel:focus{outline:none}wm-tab-panel.user-is-tabbing:focus{outline:-webkit-focus-ring-color auto 5px}";var d=t("wm_tab_panel",function(){function t(t){e(this,t);this.tabPanelLoaded=i(this,"tabPanelLoaded",7);this.active=false;this.tabId=""}t.prototype.componentWillLoad=function(){!this.el.id&&this.el.setAttribute("id",u())};t.prototype.componentDidLoad=function(){this.tabPanelLoaded.emit({tabId:this.tabId})};t.prototype.render=function(){return n(r,{role:"tabpanel",class:{"tab-hidden":!this.active}})};Object.defineProperty(t.prototype,"el",{get:function(){return a(this)},enumerable:false,configurable:true});return t}());d.style=h}}}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as r,g as e}from"./p-568c595f.js";import{t as s,a as o,b as a}from"./p-
|
|
1
|
+
import{r as t,c as i,h as r,g as e}from"./p-568c595f.js";import{t as s,a as o,b as a}from"./p-eca78c2b.js";import{g as n}from"./p-02dc1562.js";const l=class{constructor(r){t(this,r),this.wmInputValueChanged=i(this,"wmInputValueChanged",7),this.previousValue="",this.label=void 0,this.labelPosition="top",this.value="",this.disabled=!1,this.info=void 0,this.inputWidth="",this.placeholder="",this.requiredField=!1,this.errorMessage=void 0,this.characterLimit=void 0,this.symbolBefore=void 0,this.symbolAfter=void 0,this.textAfter=void 0,this.type="text",this.step=1,this.min=void 0,this.max=void 0,this.isSubmit=!1,this.announcement=""}getInputWidth(){return this.inputWidth?{width:this.inputWidth}:{flex:"1"}}get charCount(){return this.value.length}get isDisabled(){return s(this.disabled)}componentWillLoad(){this.label||console.error("wm-input requires the label property"),o(this.el,this.isDisabled)}componentDidLoad(){this.previousValue=this.inputEl.value}handleDisabledChange(){o(this.el,this.isDisabled)}announceError(){this.errorMessage&&setTimeout((()=>this.announce(this.errorMessage)),100)}handleInput(t){this.value=t.target.value,this.characterLimit&&this.charCount>=this.characterLimit-5&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit))}handleKeyDown(t){const i=t.ctrlKey||t.metaKey||t.altKey;/^.$/.test(t.key)&&!i&&this.characterLimit&&this.inputEl.value.length>=this.characterLimit&&this.announce(this.generateCharacterLimitWarning(this.charCount,this.characterLimit)),"Enter"===t.key&&this.isSubmit&&a(this.el.closest("form"))}handleBlur(){this.value!==this.previousValue&&this.wmInputValueChanged.emit({value:this.value}),this.previousValue=this.value,this.inputWrapperEl.classList.remove("focus")}handleFocus(){this.inputWrapperEl.classList.add("focus")}announce(t){this.liveRegionEl.textContent===t&&(t+=" "),this.announcement=t}generateCharacterLimitWarning(t,i){let r=n.getCharactersEntered(t,i);return t>=i&&(r+=` ${n.characterLimitReached}`),r}descriptors(){return this.symbolBefore||this.symbolAfter||this.textAfter?"symbol-before inputfield symbol-after text-after info error":"info error"}render(){return r("div",{class:`wrapper label-${this.labelPosition} ${this.errorMessage?"invalid":""}`,ref:t=>this.inputWrapperEl=t},r("div",{class:"label-wrapper"},r("label",{htmlFor:"inputfield",class:"label"},this.label,this.characterLimit&&r("span",{class:"sr-only"}," ",n.getCharacterLimit(this.characterLimit)),this.requiredField&&r("span",{class:"required","aria-hidden":"true"},"*"))),r("div",{class:"inner-wrapper"},r("div",{class:"text-after-wrapper"},r("div",{class:"inputfield-wrapper "+(this.isDisabled?"disabled":""),style:this.getInputWidth()},this.symbolBefore&&r("span",{class:"symbol",id:"symbol-before"},this.symbolBefore),r("input",{ref:t=>this.inputEl=t,id:"inputfield",disabled:this.isDisabled,"aria-describedby":this.descriptors(),onInput:t=>this.handleInput(t),onKeyDown:t=>this.handleKeyDown(t),onBlur:()=>this.handleBlur(),onFocus:()=>this.handleFocus(),placeholder:this.placeholder,autocomplete:"off","aria-required":this.requiredField?"true":null,maxLength:this.characterLimit||void 0,type:this.type,step:this.step,max:this.max,min:this.min,value:this.el.value}),this.symbolAfter&&r("span",{class:"symbol",id:"symbol-after"},this.symbolAfter),this.characterLimit&&"number"==typeof this.characterLimit?r("div",{class:"character-count"},this.charCount,"/",this.characterLimit):""),this.textAfter&&r("span",{class:"text-after",id:"text-after"},this.textAfter)),this.info&&r("div",{id:"info",class:"info"},this.info),r("div",{id:"error",class:"error-message"},this.errorMessage),r("div",{class:"sr-only","aria-live":"polite","aria-atomic":"true",ref:t=>this.liveRegionEl=t},this.announcement)))}static get delegatesFocus(){return!0}get el(){return e(this)}static get watchers(){return{disabled:["handleDisabledChange"],errorMessage:["announceError"]}}};l.style=':host{font-family:inherit;width:100%}:host *{-webkit-box-sizing:border-box;box-sizing:border-box}:host .wrapper{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;font-size:0.875rem}:host .wrapper .label{display:block;line-height:normal;font-weight:600;white-space:nowrap;margin-bottom:0.25rem}:host .wrapper .label .required{color:var(--wmcolor-text-required)}:host .wrapper.label-left{-ms-flex-direction:row;flex-direction:row}:host .wrapper.label-left .label-wrapper{line-height:2.5rem}:host .wrapper.label-left .label-wrapper .label{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;min-height:2.5rem;white-space:normal;margin-bottom:0;margin-right:0.75rem}:host .wrapper.label-none label{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .wrapper.invalid .label{color:var(--wmcolor-text-error)}:host .wrapper.invalid .label:after{display:inline-block;font:normal normal normal 24px/1 "Material Design Icons";font-size:inherit;text-rendering:auto;line-height:inherit;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;content:"\\f026";margin-left:0.3125rem}[dir=RTL] :host .wrapper.invalid .label:after{margin-left:0;margin-right:0.3125rem}:host .wrapper.rtl.label-left .label{margin-right:0;margin-left:0.75rem}:host .wrapper .inner-wrapper{width:100%}:host .wrapper .text-after-wrapper{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;gap:8px}:host .wrapper .text-after{-ms-flex:0 1 fit-content;flex:0 1 fit-content}:host .wrapper .inputfield-wrapper{height:2.5rem;min-width:6.25rem;border:1px solid var(--wmcolor-input-border);-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;display:-ms-flexbox;display:flex}:host .wrapper .inputfield-wrapper.disabled{background-color:var(--wmcolor-input-background-disabled);color:var(--wmcolor-input-text-disabled)}:host .wrapper .inputfield-wrapper.disabled .symbol{background:none}:host .wrapper .symbol{display:-ms-flexbox;display:flex;background-color:var(--wmcolor-input-unit-background);-ms-flex:0 0 44px;flex:0 0 44px;padding-inline:8px;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center}:host .wrapper .character-count{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;min-width:5rem;background-color:var(--wmcolor-input-charcount-background);font-size:0.875rem;font-weight:500;-ms-flex-item-align:stretch;align-self:stretch}:host .wrapper input{-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;border:none;font-family:inherit;font-size:0.875rem;height:100%;-ms-flex:1;flex:1;padding:0.75rem 1rem;width:100%}:host .wrapper input:focus{outline:none}:host .wrapper input[type=number]{padding-right:0}:host .wrapper .info{font-style:italic;line-height:100%;margin:4px 0}:host .wrapper.invalid .inputfield-wrapper{-webkit-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);-moz-box-shadow:0 0 0 1px var(--wmcolor-input-border-error);box-shadow:0 0 0 1px var(--wmcolor-input-border-error);border-color:var(--wmcolor-input-border-error)}:host .wrapper.invalid .error-message{display:block;font-style:italic;color:var(--wmcolor-text-error);font-size:0.875rem;line-height:100%}:host .wrapper.invalid .error-message:not(:empty){margin-top:0.25rem}:host .wrapper:focus .inputfield-wrapper,:host .wrapper.focus .inputfield-wrapper{outline:2px solid var(--wmcolor-input-border-focus);border-color:var(--wmcolor-input-border-focus)}:host .sr-only{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}';export{l as wm_input}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e,f as t,h as r,H as o,g as n,c as a}from"./p-568c595f.js";import{g as p,d as s,i,x as l}from"./p-16f65bf4.js";import{a as h,h as c,g as d,r as m,c as w,d as g,e as b,f as x,l as u,j as f,m as v}from"./p-eddbcb21.js";const k=class{constructor(r){e(this,r),this.uid=p(),this.slicesDetails=[],this.barLabelsWidth=this.el.parentElement.barLabelsWidth,this.debouncedUpdate=s((async()=>{t(this.el)}),10),this.label=void 0,this.subinfo=void 0,this.completionMessage=void 0,this.showLegend=!0,this.printMode=!1,this.printModeFormat="amount",this.isTabbing=!1,this.mode=void 0,this.userIsNavigating=!1,this.focusedSliceId=void 0}get popoverEl(){return this.el.shadowRoot.querySelector("priv-chart-popover")}get sliceEls(){return Array.from(this.el.shadowRoot.querySelectorAll(".segment"))}get chartDetails(){return this.mode?h[this.mode]:void 0}get ariaLabelText(){let e=`${this.label}`;return this.subinfo&&(e+=` ${this.subinfo}`),e}get chartRoleDescription(){return i.formatMessage({id:"chart.roleDescription",defaultMessage:"Interactive chart",description:"For screen readers only, a description clarifying the role of the chart widget"})}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}handleKeydown(e){c.call(this,e)}componentWillLoad(){this.label||console.error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information."),2!==this.el.children.length&&console.warn("wm-progress-indicator component must have 2 wm-progress-slice children."),this.el.parentElement.addEventListener("wmProgressMonitorModeChange",(e=>this.mode=e.detail)),new ResizeObserver((()=>this.debouncedUpdate())).observe(this.el)}async handleSliceUpdate(){await d.call(this,this.mode),t(this.el)}handleModeUpdate(){this.mode&&d.call(this,this.mode)}handlePopoverOpenChanged(e){if(!e.detail){const e=Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex]"));m(e)}}renderBarOrDoughnut(){return this.total>0&&"bar"===this.mode?w.call(this,this.mode):g.call(this,this.mode)}render(){return r(o,{onBlur:()=>f.call(this)},r("div",{ref:e=>this.componentWrapperEl=e,class:`component-wrapper ${this.mode} ${this.isTabbing&&!this.userIsNavigating?"user-is-tabbing":""}`,role:"application","aria-label":this.ariaLabelText,tabindex:"0","aria-roledescription":this.chartRoleDescription,"aria-describedby":"chart-instructions"},r("label",{id:`label-${this.uid}`,class:"label "+(this.barLabelsWidth&&"bar"===this.mode?"custom-width":""),style:{"--custom-label-width":this.barLabelsWidth},htmlFor:`graphic-${this.uid}`},r("span",{class:"label-text"},this.label),this.subinfo?r("span",{class:"subinfo"},this.subinfo):""),this.mode&&this.renderBarOrDoughnut(),"doughnut"===this.mode?x.call(this,this.mode):"",r("priv-chart-popover",{class:this.isTabbing?"user-is-tabbing":"",onIntChartPopoverOpenChanged:e=>this.handlePopoverOpenChanged(e)}),"doughnut"===this.mode?u.call(this):""),b())}static get delegatesFocus(){return!0}get el(){return n(this)}static get watchers(){return{mode:["handleModeUpdate"]}}};k.style=":host{--wmcolor-chart-label-text-negative:var(--wmcolor-text-negative);--wmcolor-chart-label-text-positive:var(--wmcolor-text-positive);--wmcolor-chart-label-text:var(--wmcolor-text);--wmcolor-chart-subinfo-text:var(--wmcolor-text);--wmcolor-chart-value-text:var(--wmcolor-text);display:block}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;font-size:0.875rem;position:relative;outline:none;}:host .component-wrapper:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}:host .component-wrapper .label{display:block;margin:0;padding-bottom:0.25rem;font-weight:600;position:relative}:host .component-wrapper .label .subinfo{display:block;font-weight:normal;font-style:italic;bottom:0.25rem;width:100%;color:var(--wmcolor-chart-subinfo-text)}:host .component-wrapper .label.custom-width{width:var(--custom-label-width)}:host .component-wrapper .label.--none{display:none}:host .component-wrapper .doughnut-svg,:host .component-wrapper .inner-stacked-bar-wrapper{overflow:visible}:host .component-wrapper .bar-wrapper{-ms-flex-positive:1;flex-grow:1;width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper{width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .values{display:-ms-flexbox;display:flex;gap:2px;margin-bottom:8px}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .values.none{margin:0}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper{display:-ms-flexbox;display:flex;gap:2px}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper .stacked-bar-segment{height:30px;cursor:pointer}:host .component-wrapper .segment{print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .component-wrapper .segment.fixed-width{-ms-flex-negative:0;flex-shrink:0}:host .component-wrapper .doughnut-wrapper{-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px}:host .component-wrapper .doughnut-wrapper .doughnut-segment{cursor:pointer}:host .component-wrapper .value-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .component-wrapper .value-wrapper .fixed-width{-ms-flex-negative:0;flex-shrink:0}:host .component-wrapper .value-wrapper .value.hidden{visibility:hidden}:host .component-wrapper .faded{opacity:0.3}:host .component-wrapper path:active,:host .component-wrapper path:hover,:host .component-wrapper path:focus,:host .component-wrapper .stacked-bar-segment:active,:host .component-wrapper .stacked-bar-segment:hover,:host .component-wrapper .stacked-bar-segment:focus{outline:none}:host .component-wrapper .stacked-bar-segment:active.stacked-bar-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:hover.stacked-bar-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:focus.stacked-bar-segment:not(:focus-visible){-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper path:active.doughnut-segment:not(:focus-visible),:host .component-wrapper path:hover.doughnut-segment:not(:focus-visible),:host .component-wrapper path:focus.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:active.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:hover.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:focus.doughnut-segment:not(:focus-visible){-webkit-filter:url(#wmHoverDropShadow);filter:url(#wmHoverDropShadow)}:host .component-wrapper path::-moz-focus-inner,:host .component-wrapper .stacked-bar-segment::-moz-focus-inner{border:0;outline:none}:host .component-wrapper .stacked-bar-segment:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px;-webkit-box-shadow:0 0 0 7px white;box-shadow:0 0 0 7px white;z-index:1}:host .component-wrapper #kfbg1{stroke:white;stroke-width:10px}:host .component-wrapper #kfstroke{stroke:var(--wmcolor-interactive-focus);stroke-width:6px}:host .component-wrapper #kfbg2{stroke:white;stroke-width:2px}:host .component-wrapper.doughnut{width:300px}:host .component-wrapper.doughnut1 label,:host .component-wrapper.doughnut1 .label-text,:host .component-wrapper.doughnut2 label,:host .component-wrapper.doughnut2 .label-text,:host .component-wrapper.doughnut3 label,:host .component-wrapper.doughnut3 .label-text{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper.doughnut{-ms-flex-align:center;align-items:center}:host .component-wrapper.doughnut label{text-align:center;width:100%;padding-bottom:1.5rem}:host .component-wrapper.doughnut label .subinfo{position:absolute}:host .component-wrapper.doughnut .completion-message{padding-top:0.625rem}:host .component-wrapper.bar{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .component-wrapper.bar label .subinfo{position:initial}:host .component-wrapper.bar .chart-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper.bar .chart-wrapper .single-perc{width:4rem;-ms-flex:none;flex:none;display:-ms-flexbox;display:flex;height:30px;-ms-flex-align:center;align-items:center}:host .component-wrapper.bar .chart-wrapper .inner-stacked-bar-wrapper{-ms-flex:1;flex:1}:host .component-wrapper.bar .chart-wrapper .completion-message{width:100%;text-align:right;margin-top:0.25rem}@media screen and (min-width: 768px){:host .component-wrapper.bar{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;min-height:30px;width:12rem;text-align:left;padding-right:1.25rem;padding-bottom:0;-ms-flex:none;flex:none}:host .component-wrapper.bar .bar-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host .component-wrapper.bar .bar-wrapper .single-perc{text-align:center;padding-left:0.5rem;-ms-flex-pack:center;justify-content:center}}:host .component-wrapper.bar2,:host .component-wrapper.bar3,:host .component-wrapper.bar4,:host .component-wrapper.bar5{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar4 .inner-stacked-bar-wrapper,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper{height:30px;margin-bottom:0}:host .component-wrapper.bar4 .inner-stacked-bar-wrapper.show-values,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper.show-values{height:60px;margin-top:0}:host .component-wrapper.bar3 .chart-wrapper{position:relative;height:116px}:host .component-wrapper.bar3 .chart-wrapper .inner-stacked-bar-wrapper{position:absolute;top:35px;left:0;right:0;bottom:0;height:30px}:host .component-wrapper.bar3 .chart-wrapper .axis{position:absolute;top:0;left:0;width:100%;overflow:visible;-webkit-transform:translate(0px, 96px);transform:translate(0px, 96px)}:host .component-wrapper.bar3 .chart-wrapper .axis line{stroke:var(--wmcolor-chart-gridline);stroke-width:1px}:host .component-wrapper.bar3 .hidden-values-warning{margin-top:1.25rem}:host .component-wrapper.bar3 .bar3-axis-label{position:absolute;bottom:-4px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .component-wrapper.bar6,:host .component-wrapper.bar7{--chartPadding:48px;-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar6 .chart-wrapper,:host .component-wrapper.bar7 .chart-wrapper{width:100%}:host .component-wrapper.bar6 .chart,:host .component-wrapper.bar7 .chart{position:relative;padding-right:var(--chartPadding)}:host .component-wrapper.bar6 .gridlines,:host .component-wrapper.bar7 .gridlines{position:absolute;left:var(--labelWidth);right:var(--chartPadding);top:0;bottom:0;background-image:linear-gradient(90deg, var(--wmcolor-chart-gridline) 1px, transparent 1px);background-position:-1px;border-left:1px solid var(--wmcolor-chart-gridline);border-bottom:1px solid var(--wmcolor-chart-gridline);background-size:var(--backgroundSize)}:host .component-wrapper.bar6 .rows,:host .component-wrapper.bar7 .rows{display:grid;grid-template-columns:var(--labelWidth) auto;grid-auto-rows:minmax(30px, 1fr);-ms-flex-align:center;align-items:center;position:relative;z-index:1}:host .component-wrapper.bar6 .rows .label,:host .component-wrapper.bar7 .rows .label{font-weight:400;padding:0 0.75rem 0 0;text-align:right;margin:0.75rem 0}:host .component-wrapper.bar6 .rows .label.hidden,:host .component-wrapper.bar7 .rows .label.hidden{visibility:hidden;white-space:nowrap}:host .component-wrapper.bar6 .bar,:host .component-wrapper.bar7 .bar{height:30px;position:relative}:host .component-wrapper.bar6 .bar .value,:host .component-wrapper.bar7 .bar .value{position:absolute;top:50%;right:-0.5rem;-webkit-transform:translate(100%, -50%);transform:translate(100%, -50%)}:host .component-wrapper.bar6 .x-axis,:host .component-wrapper.bar7 .x-axis{margin-left:var(--labelWidth);margin-right:var(--chartPadding);display:-ms-flexbox;display:flex;postion:relative}:host .component-wrapper.bar6 .tick,:host .component-wrapper.bar7 .tick{-ms-flex:1;flex:1;text-align:right}:host .component-wrapper.bar6 .tick span,:host .component-wrapper.bar7 .tick span{-webkit-transform:translateX(50%);transform:translateX(50%);display:inline-block}:host .component-wrapper.bar6 .zero,:host .component-wrapper.bar7 .zero{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%)}:host .component-wrapper.bar6 .bar:active,:host .component-wrapper.bar6 .bar:hover,:host .component-wrapper.bar6 .bar:focus,:host .component-wrapper.bar7 .bar:active,:host .component-wrapper.bar7 .bar:hover,:host .component-wrapper.bar7 .bar:focus{outline:none}:host .component-wrapper.bar6 .bar:active.bar:not(:focus-visible),:host .component-wrapper.bar6 .bar:hover.bar:not(:focus-visible),:host .component-wrapper.bar6 .bar:focus.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:active.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:hover.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:focus.bar:not(:focus-visible){-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper.bar6 .bar:focus-visible,:host .component-wrapper.bar7 .bar:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px;-webkit-box-shadow:0 0 0 7px white;box-shadow:0 0 0 7px white;z-index:1}:host .component-wrapper.left-label{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.left-label .label{width:12rem;padding-right:1.25rem;-ms-flex:none;flex:none;-ms-flex-item-align:end;align-self:flex-end;min-height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .component-wrapper .hidden-values-warning{font-size:0.75rem;font-style:italic;max-width:100%}:host .component-wrapper .hidden-values-warning.hidden{display:none}@media print{:host .component-wrapper .hidden-values-warning{display:none}}:host #chart-instructions{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .component-wrapper .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .component-wrapper .legend-wrapper .legend.bar6{display:none}:host .component-wrapper .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .component-wrapper .legend-wrapper .legend .legend-item{position:relative}:host .component-wrapper .legend-wrapper .legend .legend-item.faded{opacity:0.3}:host .component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .component-wrapper .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .component-wrapper .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem;print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .component-wrapper .legend-wrapper .legend .print-value{display:none}:host .component-wrapper .legend-wrapper .legend .print-value.force-visible{display:unset}@media print{:host .component-wrapper .legend-wrapper .legend .print-value{display:unset}}:host .component-wrapper .legend-wrapper .legend.bar3{padding-bottom:1.25rem}";const y=class{constructor(r){e(this,r),this.wmProgressMonitorModeChange=a(this,"wmProgressMonitorModeChange",7),this.doughnutWidth=300,this.modeInitialized=!1,this.debouncedUpdate=s((()=>t(this.el)),50),this.breakpoint=void 0,this.groupLegend=void 0,this.barLabelsWidth=void 0}get parsedBreakpoint(){const e=this.parseToNum(this.breakpoint?this.breakpoint:this.el.children.length);return e>=20?e:e*this.doughnutWidth}get mode(){return this.el.clientWidth>this.parsedBreakpoint?"doughnut":"bar"}get isBar(){return!1}get isDoughnut(){return!1}componentWillLoad(){new ResizeObserver((()=>this.debouncedUpdate())).observe(this.el)}componentDidLoad(){this.wmProgressMonitorModeChange.emit(this.mode),this.modeInitialized=!0}componentWillUpdate(){this.prevMode!==this.mode&&this.wmProgressMonitorModeChange.emit(this.mode),this.prevMode=this.mode}parseToNum(e){const t=e.toString().replace("px","");return parseInt(t)}renderLegend(){const e=l(this.groupLegend),t=h.bar.colors;return r("div",{class:"legend-wrapper"},r("div",{class:"legend"},e.map(((e,r)=>v.call(this,{key:e,color:t[r]})))))}render(){return r(o,{class:"doughnut"===this.mode?"row":"column"},this.modeInitialized&&this.groupLegend&&"bar"===this.mode&&this.renderLegend(),this.modeInitialized&&r("slot",null))}static get delegatesFocus(){return!0}get el(){return n(this)}};y.style=":host .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .legend-wrapper .legend.bar6{display:none}:host .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .legend-wrapper .legend .legend-item{position:relative}:host .legend-wrapper .legend .legend-item.faded{opacity:0.3}:host .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem;print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .legend-wrapper .legend .print-value{display:none}:host .legend-wrapper .legend .print-value.force-visible{display:unset}@media print{:host .legend-wrapper .legend .print-value{display:unset}}:host .legend-wrapper .legend.bar3{padding-bottom:1.25rem}:host{display:-ms-flexbox;display:flex}:host .legend-wrapper{-ms-flex-align:start;align-items:flex-start}:host(.row){-ms-flex-direction:row;flex-direction:row}:host(.column){-ms-flex-direction:column;flex-direction:column}:host(.column) .legend-wrapper{margin-bottom:2rem}:host(.column) .legend-wrapper .legend{padding-bottom:0}:host(.column) ::slotted(wm-progress-indicator:not(:last-of-type)){margin-bottom:2.5rem}";const z=class{constructor(t){e(this,t),this.wmProgressSliceUpdated=a(this,"wmProgressSliceUpdated",7),this.legend=void 0,this.amount=void 0,this.popoverTitle=void 0,this.popoverText=void 0,this.popoverButtonText=void 0}componentDidUpdate(){this.wmProgressSliceUpdated.emit()}};export{k as wm_progress_indicator,y as wm_progress_monitor,z as wm_progress_slice}
|
|
1
|
+
import{r as e,f as t,h as r,H as o,g as n,c as a}from"./p-568c595f.js";import{g as p,d as s,i,x as l}from"./p-eca78c2b.js";import{a as h,h as c,g as d,r as m,c as w,d as g,e as b,f as x,l as u,j as f,m as v}from"./p-5943c8b1.js";const k=class{constructor(r){e(this,r),this.uid=p(),this.slicesDetails=[],this.barLabelsWidth=this.el.parentElement.barLabelsWidth,this.debouncedUpdate=s((async()=>{t(this.el)}),10),this.label=void 0,this.subinfo=void 0,this.completionMessage=void 0,this.showLegend=!0,this.printMode=!1,this.printModeFormat="amount",this.isTabbing=!1,this.mode=void 0,this.userIsNavigating=!1,this.focusedSliceId=void 0}get popoverEl(){return this.el.shadowRoot.querySelector("priv-chart-popover")}get sliceEls(){return Array.from(this.el.shadowRoot.querySelectorAll(".segment"))}get chartDetails(){return this.mode?h[this.mode]:void 0}get ariaLabelText(){let e=`${this.label}`;return this.subinfo&&(e+=` ${this.subinfo}`),e}get chartRoleDescription(){return i.formatMessage({id:"chart.roleDescription",defaultMessage:"Interactive chart",description:"For screen readers only, a description clarifying the role of the chart widget"})}toggleTabbingOn(){this.isTabbing=!0}toggleTabbingOff(){this.isTabbing=!1}handleKeydown(e){c.call(this,e)}componentWillLoad(){this.label||console.error("For accessibility purposes, you must provide a label for the chart. See https://components.watermarkinsights.com/chart for more information."),2!==this.el.children.length&&console.warn("wm-progress-indicator component must have 2 wm-progress-slice children."),this.el.parentElement.addEventListener("wmProgressMonitorModeChange",(e=>this.mode=e.detail)),new ResizeObserver((()=>this.debouncedUpdate())).observe(this.el)}async handleSliceUpdate(){await d.call(this,this.mode),t(this.el)}handleModeUpdate(){this.mode&&d.call(this,this.mode)}handlePopoverOpenChanged(e){if(!e.detail){const e=Array.from(this.el.shadowRoot.querySelectorAll("[data-segmentindex]"));m(e)}}renderBarOrDoughnut(){return this.total>0&&"bar"===this.mode?w.call(this,this.mode):g.call(this,this.mode)}render(){return r(o,{onBlur:()=>f.call(this)},r("div",{ref:e=>this.componentWrapperEl=e,class:`component-wrapper ${this.mode} ${this.isTabbing&&!this.userIsNavigating?"user-is-tabbing":""}`,role:"application","aria-label":this.ariaLabelText,tabindex:"0","aria-roledescription":this.chartRoleDescription,"aria-describedby":"chart-instructions"},r("label",{id:`label-${this.uid}`,class:"label "+(this.barLabelsWidth&&"bar"===this.mode?"custom-width":""),style:{"--custom-label-width":this.barLabelsWidth},htmlFor:`graphic-${this.uid}`},r("span",{class:"label-text"},this.label),this.subinfo?r("span",{class:"subinfo"},this.subinfo):""),this.mode&&this.renderBarOrDoughnut(),"doughnut"===this.mode?x.call(this,this.mode):"",r("priv-chart-popover",{class:this.isTabbing?"user-is-tabbing":"",onIntChartPopoverOpenChanged:e=>this.handlePopoverOpenChanged(e)}),"doughnut"===this.mode?u.call(this):""),b())}static get delegatesFocus(){return!0}get el(){return n(this)}static get watchers(){return{mode:["handleModeUpdate"]}}};k.style=":host{--wmcolor-chart-label-text-negative:var(--wmcolor-text-negative);--wmcolor-chart-label-text-positive:var(--wmcolor-text-positive);--wmcolor-chart-label-text:var(--wmcolor-text);--wmcolor-chart-subinfo-text:var(--wmcolor-text);--wmcolor-chart-value-text:var(--wmcolor-text);display:block}:host .component-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;font-size:0.875rem;position:relative;outline:none;}:host .component-wrapper:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px}:host .component-wrapper .label{display:block;margin:0;padding-bottom:0.25rem;font-weight:600;position:relative}:host .component-wrapper .label .subinfo{display:block;font-weight:normal;font-style:italic;bottom:0.25rem;width:100%;color:var(--wmcolor-chart-subinfo-text)}:host .component-wrapper .label.custom-width{width:var(--custom-label-width)}:host .component-wrapper .label.--none{display:none}:host .component-wrapper .doughnut-svg,:host .component-wrapper .inner-stacked-bar-wrapper{overflow:visible}:host .component-wrapper .bar-wrapper{-ms-flex-positive:1;flex-grow:1;width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper{width:100%}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .values{display:-ms-flexbox;display:flex;gap:2px;margin-bottom:8px}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .values.none{margin:0}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper{display:-ms-flexbox;display:flex;gap:2px}:host .component-wrapper .bar-wrapper .inner-stacked-bar-wrapper .stacked-bar-segments-wrapper .stacked-bar-segment{height:30px;cursor:pointer}:host .component-wrapper .segment{print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .component-wrapper .segment.fixed-width{-ms-flex-negative:0;flex-shrink:0}:host .component-wrapper .doughnut-wrapper{-webkit-border-radius:4px;-moz-border-radius:4px;-ms-border-radius:4px;border-radius:4px}:host .component-wrapper .doughnut-wrapper .doughnut-segment{cursor:pointer}:host .component-wrapper .value-wrapper{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center}:host .component-wrapper .value-wrapper .fixed-width{-ms-flex-negative:0;flex-shrink:0}:host .component-wrapper .value-wrapper .value.hidden{visibility:hidden}:host .component-wrapper .faded{opacity:0.3}:host .component-wrapper path:active,:host .component-wrapper path:hover,:host .component-wrapper path:focus,:host .component-wrapper .stacked-bar-segment:active,:host .component-wrapper .stacked-bar-segment:hover,:host .component-wrapper .stacked-bar-segment:focus{outline:none}:host .component-wrapper .stacked-bar-segment:active.stacked-bar-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:hover.stacked-bar-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:focus.stacked-bar-segment:not(:focus-visible){-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper path:active.doughnut-segment:not(:focus-visible),:host .component-wrapper path:hover.doughnut-segment:not(:focus-visible),:host .component-wrapper path:focus.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:active.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:hover.doughnut-segment:not(:focus-visible),:host .component-wrapper .stacked-bar-segment:focus.doughnut-segment:not(:focus-visible){-webkit-filter:url(#wmHoverDropShadow);filter:url(#wmHoverDropShadow)}:host .component-wrapper path::-moz-focus-inner,:host .component-wrapper .stacked-bar-segment::-moz-focus-inner{border:0;outline:none}:host .component-wrapper .stacked-bar-segment:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px;-webkit-box-shadow:0 0 0 7px white;box-shadow:0 0 0 7px white;z-index:1}:host .component-wrapper #kfbg1{stroke:white;stroke-width:10px}:host .component-wrapper #kfstroke{stroke:var(--wmcolor-interactive-focus);stroke-width:6px}:host .component-wrapper #kfbg2{stroke:white;stroke-width:2px}:host .component-wrapper.doughnut{width:300px}:host .component-wrapper.doughnut1 label,:host .component-wrapper.doughnut1 .label-text,:host .component-wrapper.doughnut2 label,:host .component-wrapper.doughnut2 .label-text,:host .component-wrapper.doughnut3 label,:host .component-wrapper.doughnut3 .label-text{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper.doughnut{-ms-flex-align:center;align-items:center}:host .component-wrapper.doughnut label{text-align:center;width:100%;padding-bottom:1.5rem}:host .component-wrapper.doughnut label .subinfo{position:absolute}:host .component-wrapper.doughnut .completion-message{padding-top:0.625rem}:host .component-wrapper.bar{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host .component-wrapper.bar label .subinfo{position:initial}:host .component-wrapper.bar .chart-wrapper{display:-ms-flexbox;display:flex}:host .component-wrapper.bar .chart-wrapper .single-perc{width:4rem;-ms-flex:none;flex:none;display:-ms-flexbox;display:flex;height:30px;-ms-flex-align:center;align-items:center}:host .component-wrapper.bar .chart-wrapper .inner-stacked-bar-wrapper{-ms-flex:1;flex:1}:host .component-wrapper.bar .chart-wrapper .completion-message{width:100%;text-align:right;margin-top:0.25rem}@media screen and (min-width: 768px){:host .component-wrapper.bar{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.bar label{display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;min-height:30px;width:12rem;text-align:left;padding-right:1.25rem;padding-bottom:0;-ms-flex:none;flex:none}:host .component-wrapper.bar .bar-wrapper{-ms-flex-direction:row-reverse;flex-direction:row-reverse}:host .component-wrapper.bar .bar-wrapper .single-perc{text-align:center;padding-left:0.5rem;-ms-flex-pack:center;justify-content:center}}:host .component-wrapper.bar2,:host .component-wrapper.bar3,:host .component-wrapper.bar4,:host .component-wrapper.bar5{-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar4 .inner-stacked-bar-wrapper,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper{height:30px;margin-bottom:0}:host .component-wrapper.bar4 .inner-stacked-bar-wrapper.show-values,:host .component-wrapper.bar5 .inner-stacked-bar-wrapper.show-values{height:60px;margin-top:0}:host .component-wrapper.bar3 .chart-wrapper{position:relative;height:116px}:host .component-wrapper.bar3 .chart-wrapper .inner-stacked-bar-wrapper{position:absolute;top:35px;left:0;right:0;bottom:0;height:30px}:host .component-wrapper.bar3 .chart-wrapper .axis{position:absolute;top:0;left:0;width:100%;overflow:visible;-webkit-transform:translate(0px, 96px);transform:translate(0px, 96px)}:host .component-wrapper.bar3 .chart-wrapper .axis line{stroke:var(--wmcolor-chart-gridline);stroke-width:1px}:host .component-wrapper.bar3 .hidden-values-warning{margin-top:1.25rem}:host .component-wrapper.bar3 .bar3-axis-label{position:absolute;bottom:-4px;width:100%;display:-ms-flexbox;display:flex;-ms-flex-pack:justify;justify-content:space-between}:host .component-wrapper.bar6,:host .component-wrapper.bar7{--chartPadding:48px;-ms-flex-align:start;align-items:flex-start}:host .component-wrapper.bar6 .chart-wrapper,:host .component-wrapper.bar7 .chart-wrapper{width:100%}:host .component-wrapper.bar6 .chart,:host .component-wrapper.bar7 .chart{position:relative;padding-right:var(--chartPadding)}:host .component-wrapper.bar6 .gridlines,:host .component-wrapper.bar7 .gridlines{position:absolute;left:var(--labelWidth);right:var(--chartPadding);top:0;bottom:0;background-image:linear-gradient(90deg, var(--wmcolor-chart-gridline) 1px, transparent 1px);background-position:-1px;border-left:1px solid var(--wmcolor-chart-gridline);border-bottom:1px solid var(--wmcolor-chart-gridline);background-size:var(--backgroundSize)}:host .component-wrapper.bar6 .rows,:host .component-wrapper.bar7 .rows{display:grid;grid-template-columns:var(--labelWidth) auto;grid-auto-rows:minmax(30px, 1fr);-ms-flex-align:center;align-items:center;position:relative;z-index:1}:host .component-wrapper.bar6 .rows .label,:host .component-wrapper.bar7 .rows .label{font-weight:400;padding:0 0.75rem 0 0;text-align:right;margin:0.75rem 0}:host .component-wrapper.bar6 .rows .label.hidden,:host .component-wrapper.bar7 .rows .label.hidden{visibility:hidden;white-space:nowrap}:host .component-wrapper.bar6 .bar,:host .component-wrapper.bar7 .bar{height:30px;position:relative}:host .component-wrapper.bar6 .bar .value,:host .component-wrapper.bar7 .bar .value{position:absolute;top:50%;right:-0.5rem;-webkit-transform:translate(100%, -50%);transform:translate(100%, -50%)}:host .component-wrapper.bar6 .x-axis,:host .component-wrapper.bar7 .x-axis{margin-left:var(--labelWidth);margin-right:var(--chartPadding);display:-ms-flexbox;display:flex;postion:relative}:host .component-wrapper.bar6 .tick,:host .component-wrapper.bar7 .tick{-ms-flex:1;flex:1;text-align:right}:host .component-wrapper.bar6 .tick span,:host .component-wrapper.bar7 .tick span{-webkit-transform:translateX(50%);transform:translateX(50%);display:inline-block}:host .component-wrapper.bar6 .zero,:host .component-wrapper.bar7 .zero{position:absolute;-webkit-transform:translateX(-50%);transform:translateX(-50%)}:host .component-wrapper.bar6 .bar:active,:host .component-wrapper.bar6 .bar:hover,:host .component-wrapper.bar6 .bar:focus,:host .component-wrapper.bar7 .bar:active,:host .component-wrapper.bar7 .bar:hover,:host .component-wrapper.bar7 .bar:focus{outline:none}:host .component-wrapper.bar6 .bar:active.bar:not(:focus-visible),:host .component-wrapper.bar6 .bar:hover.bar:not(:focus-visible),:host .component-wrapper.bar6 .bar:focus.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:active.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:hover.bar:not(:focus-visible),:host .component-wrapper.bar7 .bar:focus.bar:not(:focus-visible){-webkit-box-shadow:0px 0px 6px #333;-moz-box-shadow:0px 0px 6px #333;box-shadow:0px 0px 6px #333}:host .component-wrapper.bar6 .bar:focus-visible,:host .component-wrapper.bar7 .bar:focus-visible{outline:3px solid var(--wmcolor-interactive-focus);outline-offset:2px;-webkit-box-shadow:0 0 0 7px white;box-shadow:0 0 0 7px white;z-index:1}:host .component-wrapper.left-label{-ms-flex-direction:row;flex-direction:row}:host .component-wrapper.left-label .label{width:12rem;padding-right:1.25rem;-ms-flex:none;flex:none;-ms-flex-item-align:end;align-self:flex-end;min-height:30px;display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center}:host .component-wrapper .hidden-values-warning{font-size:0.75rem;font-style:italic;max-width:100%}:host .component-wrapper .hidden-values-warning.hidden{display:none}@media print{:host .component-wrapper .hidden-values-warning{display:none}}:host #chart-instructions{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;border:0 !important;overflow:hidden !important;clip:rect(0, 0, 0, 0) !important;-webkit-clip-path:inset(50%) !important;clip-path:inset(50%) !important;white-space:nowrap !important;margin:-1px !important}:host .component-wrapper .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .component-wrapper .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .component-wrapper .legend-wrapper .legend.bar6{display:none}:host .component-wrapper .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .component-wrapper .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .component-wrapper .legend-wrapper .legend .legend-item{position:relative}:host .component-wrapper .legend-wrapper .legend .legend-item.faded{opacity:0.3}:host .component-wrapper .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .component-wrapper .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .component-wrapper .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem;print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .component-wrapper .legend-wrapper .legend .print-value{display:none}:host .component-wrapper .legend-wrapper .legend .print-value.force-visible{display:unset}@media print{:host .component-wrapper .legend-wrapper .legend .print-value{display:unset}}:host .component-wrapper .legend-wrapper .legend.bar3{padding-bottom:1.25rem}";const y=class{constructor(r){e(this,r),this.wmProgressMonitorModeChange=a(this,"wmProgressMonitorModeChange",7),this.doughnutWidth=300,this.modeInitialized=!1,this.debouncedUpdate=s((()=>t(this.el)),50),this.breakpoint=void 0,this.groupLegend=void 0,this.barLabelsWidth=void 0}get parsedBreakpoint(){const e=this.parseToNum(this.breakpoint?this.breakpoint:this.el.children.length);return e>=20?e:e*this.doughnutWidth}get mode(){return this.el.clientWidth>this.parsedBreakpoint?"doughnut":"bar"}get isBar(){return!1}get isDoughnut(){return!1}componentWillLoad(){new ResizeObserver((()=>this.debouncedUpdate())).observe(this.el)}componentDidLoad(){this.wmProgressMonitorModeChange.emit(this.mode),this.modeInitialized=!0}componentWillUpdate(){this.prevMode!==this.mode&&this.wmProgressMonitorModeChange.emit(this.mode),this.prevMode=this.mode}parseToNum(e){const t=e.toString().replace("px","");return parseInt(t)}renderLegend(){const e=l(this.groupLegend),t=h.bar.colors;return r("div",{class:"legend-wrapper"},r("div",{class:"legend"},e.map(((e,r)=>v.call(this,{key:e,color:t[r]})))))}render(){return r(o,{class:"doughnut"===this.mode?"row":"column"},this.modeInitialized&&this.groupLegend&&"bar"===this.mode&&this.renderLegend(),this.modeInitialized&&r("slot",null))}static get delegatesFocus(){return!0}get el(){return n(this)}};y.style=":host .legend-wrapper{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:center;justify-content:center;-ms-flex-align:center;align-items:center;text-align:center}:host .legend-wrapper .legend{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-wrap:wrap;flex-wrap:wrap;text-align:center;padding-top:0.25rem;padding-bottom:0.75rem;-webkit-box-sizing:border-box;box-sizing:border-box}:host .legend-wrapper .legend.bar6{display:none}:host .legend-wrapper .legend.--top{margin-top:-0.75rem}:host .legend-wrapper .legend.--top .legend-item{padding-top:0.75rem}:host .legend-wrapper .legend.--top .legend-color{top:0.75rem}:host .legend-wrapper .legend.--bottom{margin-bottom:-0.75rem}:host .legend-wrapper .legend.--bottom .legend-item{padding-bottom:0.75rem}:host .legend-wrapper .legend.--bottom .legend-color{top:-0.75rem}:host .legend-wrapper .legend .legend-item{position:relative}:host .legend-wrapper .legend .legend-item.faded{opacity:0.3}:host .legend-wrapper .legend .legend-item:not(:last-of-type){padding-right:1.25rem}:host .legend-wrapper .legend .legend-text{font-size:0.875rem;padding-left:1rem;line-height:1}:host .legend-wrapper .legend .legend-color{position:absolute;left:0;bottom:0;margin:auto;width:0.6875rem;height:0.6875rem;print-color-adjust:exact;-webkit-print-color-adjust:exact}:host .legend-wrapper .legend .print-value{display:none}:host .legend-wrapper .legend .print-value.force-visible{display:unset}@media print{:host .legend-wrapper .legend .print-value{display:unset}}:host .legend-wrapper .legend.bar3{padding-bottom:1.25rem}:host{display:-ms-flexbox;display:flex}:host .legend-wrapper{-ms-flex-align:start;align-items:flex-start}:host(.row){-ms-flex-direction:row;flex-direction:row}:host(.column){-ms-flex-direction:column;flex-direction:column}:host(.column) .legend-wrapper{margin-bottom:2rem}:host(.column) .legend-wrapper .legend{padding-bottom:0}:host(.column) ::slotted(wm-progress-indicator:not(:last-of-type)){margin-bottom:2.5rem}";const z=class{constructor(t){e(this,t),this.wmProgressSliceUpdated=a(this,"wmProgressSliceUpdated",7),this.legend=void 0,this.amount=void 0,this.popoverTitle=void 0,this.popoverText=void 0,this.popoverButtonText=void 0}componentDidUpdate(){this.wmProgressSliceUpdated.emit()}};export{k as wm_progress_indicator,y as wm_progress_monitor,z as wm_progress_slice}
|