@db-ux/wc-core-components 4.12.0 → 4.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/bundle/db-custom-select-list-item.js +1 -1
- package/bundle/db-custom-select.js +1 -1
- package/bundle/db-drawer.js +1 -1
- package/bundle/db-header.js +1 -1
- package/bundle/db-navigation-item.js +1 -1
- package/bundle/db-popover.js +1 -1
- package/bundle/db-tag.js +1 -1
- package/bundle/db-tooltip.js +1 -1
- package/bundle/index.js +1 -1
- package/bundle/p-BFeR7jXy.js +1 -0
- package/bundle/p-C0q9XJSc.js +1 -0
- package/bundle/{p-BuBrj57D.js → p-C_qYW0Kh.js} +1 -1
- package/bundle/{p-BvgvWjGH.js → p-CuC4YsIB.js} +1 -1
- package/bundle/{p-DFypNnh0.js → p-gIJnyld5.js} +1 -1
- package/bundle/p-k8bCF_aj.js +1 -0
- package/dist/cjs/db-custom-select-dropdown_5.cjs.entry.js +1 -1
- package/dist/cjs/db-custom-select.cjs.entry.js +15 -7
- package/dist/cjs/db-drawer.cjs.entry.js +28 -7
- package/dist/cjs/db-header.cjs.entry.js +2 -2
- package/dist/cjs/db-navigation-item.cjs.entry.js +2 -2
- package/dist/cjs/db-popover.cjs.entry.js +1 -1
- package/dist/cjs/db-tooltip.cjs.entry.js +1 -1
- package/dist/cjs/db-ux.cjs.js +1 -1
- package/dist/cjs/{floating-components-DlstoCKH.js → floating-components-SpHkZuLA.js} +53 -8
- package/dist/cjs/index.cjs.js +2 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{navigation-Bah882nU.js → navigation-DUTSDY4q.js} +1 -1
- package/dist/collection/components/custom-select/custom-select.js +14 -6
- package/dist/collection/components/custom-select-list-item/custom-select-list-item.js +1 -1
- package/dist/collection/components/drawer/drawer.js +29 -7
- package/dist/collection/utils/floating-components.js +53 -8
- package/dist/custom-elements.json +119 -20
- package/dist/db-ux/db-ux.esm.js +1 -1
- package/dist/db-ux/index.esm.js +1 -1
- package/dist/db-ux/{p-88dcff6a.entry.js → p-183c78b7.entry.js} +1 -1
- package/dist/db-ux/p-4751361d.entry.js +1 -0
- package/dist/db-ux/{p-bb5149a9.entry.js → p-5623ff36.entry.js} +1 -1
- package/dist/db-ux/{p-ef63c591.entry.js → p-87281518.entry.js} +1 -1
- package/dist/db-ux/p-C0q9XJSc.js +1 -0
- package/dist/db-ux/{p-BuBrj57D.js → p-C_qYW0Kh.js} +1 -1
- package/dist/db-ux/p-a6f33f3b.entry.js +1 -0
- package/dist/db-ux/p-f271332c.entry.js +1 -0
- package/dist/db-ux/{p-6fd70ba4.entry.js → p-f5f73623.entry.js} +1 -1
- package/dist/esm/db-custom-select-dropdown_5.entry.js +1 -1
- package/dist/esm/db-custom-select.entry.js +15 -7
- package/dist/esm/db-drawer.entry.js +28 -7
- package/dist/esm/db-header.entry.js +2 -2
- package/dist/esm/db-navigation-item.entry.js +2 -2
- package/dist/esm/db-popover.entry.js +1 -1
- package/dist/esm/db-tooltip.entry.js +1 -1
- package/dist/esm/db-ux.js +1 -1
- package/dist/esm/{floating-components-DOPXnIzL.js → floating-components-C0q9XJSc.js} +53 -8
- package/dist/esm/index.js +2 -2
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{navigation-Jh6m0eMk.js → navigation-Cd7KZ6E2.js} +1 -1
- package/dist/types/components/drawer/drawer.d.ts +4 -1
- package/dist/types/components/drawer/model.d.ts +3 -0
- package/dist/vscode.html-custom-data.json +6 -0
- package/dist/web-types.json +13 -1
- package/package.json +3 -3
- package/bundle/p-DOPXnIzL.js +0 -1
- package/bundle/p-DW47OZNu.js +0 -1
- package/bundle/p-n2qePi9e.js +0 -1
- package/dist/db-ux/p-4a94fbc9.entry.js +0 -1
- package/dist/db-ux/p-96978a7f.entry.js +0 -1
- package/dist/db-ux/p-DOPXnIzL.js +0 -1
- package/dist/db-ux/p-a4fb4782.entry.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @db-ux/wc-core-components
|
|
2
2
|
|
|
3
|
+
## 4.12.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- fix(custom-select): dropdown with `dropdownWidth="auto"` now correctly sizes to content width and respects the trigger minimum width. Long option labels no longer get truncated: `auto` keeps them on a single line (dropdown grows to the longest option), while `fixed` and `full` wrap long labels onto new lines. - [see commit 68dedc3](https://github.com/db-ux-design-system/core-web/commit/68dedc33c324b48339d5bb73a85fdff3045ed059)
|
|
8
|
+
|
|
9
|
+
- fix(drawer): prevent backdrop drag-close when selection starts inside content - [see commit b53ff8a](https://github.com/db-ux-design-system/core-web/commit/b53ff8a4f0a5350c5be41fad072e14797676bba7)
|
|
10
|
+
|
|
3
11
|
## 4.12.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as o,d as s}from"./p-
|
|
1
|
+
import{D as o,d as s}from"./p-k8bCF_aj.js";const a=o,p=s;export{a as DbCustomSelectListItem,p as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{u as t,y as i,H as s,A as e,h,f as l,p as a,q as o,z as d,F as n,j as c,k as r,o as u,d as v,t as w}from"./p-CYYSsu3p.js";import{l as m,a as b,m as f,f as p,g as y,h as g,e as k,d as x,i as _,o as A,k as I,c as L,s as F}from"./p-BdL-nI5y.js";import{D as C}from"./p-DJTpgiBy.js";import{a as D}from"./p-DOPXnIzL.js";import{b as O}from"./p-D6L0n3gO.js";import{d as T}from"./p-DVuZmW_J.js";import{d as S}from"./p-G57oLrr4.js";import{d as E}from"./p-to845Mg2.js";import{d as R}from"./p-DW47OZNu.js";import{d as j}from"./p-BpO8Ok-r.js";import{d as B}from"./p-DcgghWWs.js";import{d as M}from"./p-BvgvWjGH.js";import{d as V}from"./p-DFypNnh0.js";class q{static runCallbacks(t){for(const i of Object.values(q.callbacks))"function"==typeof i&&i(t)}constructor(){if(q._instance)return q._instance;q._instance=this,self.document&&self.document.addEventListener("click",(t=>q.runCallbacks(t)))}addCallback(i){const s=t();return q.callbacks[s]=i,s}removeCallback(t){delete q.callbacks[t]}}q.callbacks={},q._instance=null;const N=i(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.amountChange=e(this,"amountChange"),this.dropdownToggle=e(this,"dropdownToggle"),this.optionSelected=e(this,"optionSelected"),this.search=e(this,"search"),this.showClearSelection=!0,this.clearSelectionText="Clear selection",this._id=void 0,this._messageId=void 0,this._validMessageId=void 0,this._invalidMessageId=void 0,this._invalidMessage=void 0,this._selectId=void 0,this._labelId=void 0,this._summaryId=void 0,this._placeholderId=void 0,this._infoTextId=void 0,this._validity="no-validation",this._userInteraction=!1,this.abortController=void 0,this._descByIds=void 0,this._selectedLabels="",this._selectedLabelsId=void 0,this._voiceOverFallback="",this._selectedOptions=[],this.selectAllEnabled=!1,this.searchEnabled=!1,this.amountOptions=0,this._values=[],this._options=[],this._hasNoOptions=!1,this._documentClickListenerCallbackId=void 0,this._internalChangeTimestamp=0,this._documentScrollListenerCallbackId=void 0,this._observer=void 0,this._searchValue=void 0,this.selectAllChecked=!1,this.selectAllIndeterminate=!1,this.observer=void 0,this.satisfyReact=function(t){t.stopPropagation()}}handleDocumentScroll(t){var i,s;(null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.contains)&&(null===(s=null==t?void 0:t.target)||void 0===s?void 0:s.contains(this.detailsRef))&&this.handleAutoPlacement()}hasValidState(){var t;return!!(null!==(t=this.validMessage)&&void 0!==t?t:"valid"===this.validation)}handleValidation(){var t,i,s,e,o,d,n,c;this.selectRef&&(this.selectRef.value=this.getNativeSelectValue()),(null===(t=this.selectRef)||void 0===t?void 0:t.validity.valid)&&"invalid"!==this.validation?this.hasValidState()&&(null===(e=this.selectRef)||void 0===e?void 0:e.validity.valid)&&this.required?(this.setDescById(this._validMessageId),h()&&(this._voiceOverFallback=null!==(o=this.validMessage)&&void 0!==o?o:I,l((()=>this._voiceOverFallback=""),1e3)),this._validity=null!==(d=this.validation)&&void 0!==d?d:"valid"):a(this.message,this.showMessage)?(this.setDescById(this._messageId),this._validity=null!==(n=this.validation)&&void 0!==n?n:"no-validation"):(this.setDescById(this._placeholderId),this._validity=null!==(c=this.validation)&&void 0!==c?c:"no-validation"):(this.setDescById(this._invalidMessageId),this._invalidMessage=this.invalidMessage||(null===(i=this.selectRef)||void 0===i?void 0:i.validationMessage)||m,h()&&(this._voiceOverFallback=this._invalidMessage,l((()=>this._voiceOverFallback=""),1e3)),this._userInteraction&&(this._validity=null!==(s=this.validation)&&void 0!==s?s:"invalid"))}handleDropdownToggle(t){var i,s;this.dropdownToggle&&(t.stopPropagation(),this.dropdownToggle.emit(t)),t.target instanceof HTMLDetailsElement&&t.target.open?(this._documentClickListenerCallbackId=(new q).addCallback((t=>this.handleDocumentClose(t))),this._documentScrollListenerCallbackId=(new C).addCallback((t=>this.handleDocumentScroll(t))),this.handleAutoPlacement(),null===(i=this._observer)||void 0===i||i.observe(this.detailsRef),t.target.dataset.test||this.handleOpenByKeyboardFocus()):(this._documentClickListenerCallbackId&&(new q).removeCallback(this._documentClickListenerCallbackId),this._documentScrollListenerCallbackId&&(new C).removeCallback(this._documentScrollListenerCallbackId),null===(s=this._observer)||void 0===s||s.unobserve(this.detailsRef))}getNativeSelectValue(){var t,i;return(null===(t=this._values)||void 0===t?void 0:t.length)&&null!==(i=this._values.at(0))&&void 0!==i?i:""}setDescById(t){var i;const s=[];t&&s.push(t),this._selectedLabelsId&&(null===(i=this._selectedLabels)||void 0===i?void 0:i.length)&&s.push(this._selectedLabelsId),this._descByIds=s.join(" ")}getSelectAllLabel(){var t;return null!==(t=this.selectAllLabel)&&void 0!==t?t:b}getOptionLabel(t){var i,s,e;return null!==(e=null!==(i=t.label)&&void 0!==i?i:null===(s=t.value)||void 0===s?void 0:""+s)&&void 0!==e?e:""}getOptionChecked(t){var i,s;return!(!t||!(null===(i=this._values)||void 0===i?void 0:i.includes))&&(null===(s=this._values)||void 0===s?void 0:s.includes(t))}getTagRemoveLabel(t){const i=this.removeTagsTexts,s=this.options;if(i&&s){const e=s.findIndex((i=>i.value===t.value));if(e>=0&&e<i.length)return i[e]}return`${f} ${this.getOptionLabel(t)}`}handleTagRemove(t,i){i&&i.stopPropagation(),this.handleSelect(t.value),this.handleSummaryFocus()}handleAutoPlacement(){if(this.detailsRef){const t=this.detailsRef.querySelector("article");t&&l((()=>{var i;D(t,this.detailsRef,null!==(i=this.placement)&&void 0!==i?i:"bottom")}),1)}}handleArrowDownUp(t){var i,s,e;if(null===(i=this.detailsRef)||void 0===i?void 0:i.open){if(self.document){const i=self.document.activeElement;if(i)if("checkbox"===i.getAttribute("type")||"radio"===i.getAttribute("type")){const h=null==i?void 0:i.closest("li");if("ArrowDown"===t.key||"ArrowRight"===t.key){let t=null==h?void 0:h.nextElementSibling;for(;t;){const i=t.querySelector("input");if(i){i.focus();break}t=t.nextElementSibling}t||this.handleFocusFirstDropdownCheckbox(i)}else{let t=null==h?void 0:h.previousElementSibling;for(;t;){const i=t.querySelector("input");if(i){i.focus();break}t=t.previousElementSibling}if(!t){const t=this.detailsRef.querySelector('input[type="checkbox"]');if(t&&t!==i)this.handleFocusFirstDropdownCheckbox(i);else{const t=o(this.detailsRef);if(t)l((()=>{t.focus()}),100);else{const t=Array.from(null===(s=this.detailsRef)||void 0===s?void 0:s.querySelectorAll('input[type="checkbox"],input[type="radio"]'));t.length&&(null===(e=t.at(-1))||void 0===e||e.focus())}}}}}else"search"!==i.getAttribute("type")||"ArrowUp"!==t.key&&"ArrowLeft"!==t.key?this.handleFocusFirstDropdownCheckbox(i):(this.handleClose(void 0,!0),this.handleSummaryFocus())}}else"ArrowDown"!==t.key&&"ArrowRight"!==t.key||(this.handleAutoPlacement(),this.detailsRef&&(this.detailsRef.open=!0),this.handleOpenByKeyboardFocus());t.stopPropagation(),t.preventDefault()}handleKeyboardPress(t){var i,s,e;if(t.stopPropagation(),"Escape"===t.key&&(null===(i=this.detailsRef)||void 0===i?void 0:i.open))this.handleClose(void 0,!0),this.handleSummaryFocus();else if("Enter"===t.key&&(null===(s=this.detailsRef)||void 0===s?void 0:s.open)){if(self.document){const i=self.document.activeElement;if(["checkbox","radio"].includes(i.getAttribute("type")||""))i.click(),t.preventDefault();else if("search"===i.getAttribute("type")){const i=null===(e=this._options)||void 0===e?void 0:e.find((t=>!t.isGroupTitle&&!t.disabled));(null==i?void 0:i.value)&&(this.handleSelect(i.value),t.preventDefault())}}}else"ArrowDown"!==t.key&&"ArrowUp"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||this.handleArrowDownUp(t)}handleClose(t,i){if(this.detailsRef)if(i)this.detailsRef.open=!1,this.handleSummaryFocus();else if(this.detailsRef.open&&t&&t.relatedTarget){const i=t.relatedTarget;this.detailsRef.contains(i)||"dialog"===i.localName||l((()=>this.detailsRef.open=!1),1)}}handleDocumentClose(t){var i,s;if(t){const e="number"==typeof t.detail?t.target:null===(i=t.detail)||void 0===i?void 0:i.target;(null===(s=this.detailsRef)||void 0===s?void 0:s.open)&&!this.detailsRef.contains(e)&&(this.detailsRef.open=!1)}}handleOptionSelected(t){(new Date).getTime()-this._internalChangeTimestamp<200||(this._values=t,this._userInteraction=!0,this.optionSelected&&this.optionSelected.emit(null!=t?t:[]),this._internalChangeTimestamp=(new Date).getTime())}handleSelect(t){var i;t&&(this.multiple?(null===(i=this._values)||void 0===i?void 0:i.includes(t))?this.handleOptionSelected(this._values.filter((i=>i!==t))):this.handleOptionSelected([...this._values||[],t]):(this.handleOptionSelected([t]),this.handleClose(void 0,!0)))}handleSelectAll(t){var i;if(t.stopPropagation(),(null===(i=this._values)||void 0===i?void 0:i.length)===this.amountOptions)this.handleOptionSelected([]);else{const t=this.searchEnabled&&this.searchInputRef?this.searchInputRef.value:void 0;this.handleOptionSelected(this.options?this.options.filter((i=>{var s;return!i.isGroupTitle&&(!t||(null===(s=i.value)||void 0===s?void 0:s.toLowerCase().includes(t.toLowerCase())))})).map((t=>{var i;return null!==(i=t.value)&&void 0!==i?i:""})):[])}}handleFocusFirstDropdownCheckbox(t){if(this.detailsRef){const i=Array.from(this.detailsRef.querySelectorAll('input[type="checkbox"],input[type="radio"]'));if(i.length){const s=i.at(0),e=s===t&&i.length>1?i.at(1):s;e&&l((()=>{e.focus()}),1)}}}handleOpenByKeyboardFocus(){if(this.detailsRef){const t=o(this.detailsRef);t?l((()=>{t.focus()}),1):this.handleFocusFirstDropdownCheckbox()}}handleSearch(t){if(void 0===t)return;let i;if("string"==typeof t)i=t;else{const s=t;s.stopPropagation(),this.search&&this.search.emit(s),i=s.target.value,this._searchValue=i}this._options=this.options&&i&&0!==i.length?this.options.filter(this.searchFilter?t=>this.searchFilter(t,i):t=>!t.isGroupTitle&&this.getOptionLabel(t).toLowerCase().includes(i.toLowerCase())):this.options}handleClearAll(t){t.stopPropagation(),this.handleOptionSelected([]),this.handleSummaryFocus()}handleSummaryFocus(){var t;this.detailsRef&&(null===(t=this.detailsRef.querySelector("summary"))||void 0===t||t.focus())}resetIds(){var i,s,e;const h=null!==(e=null!==(i=this.id)&&void 0!==i?i:null===(s=this.propOverrides)||void 0===s?void 0:s.id)&&void 0!==e?e:"custom-select-"+t();this._id=h,this._messageId=h+p,this._validMessageId=h+y,this._invalidMessageId=h+g,this._selectId=h+k,this._labelId=h+x,this._summaryId=h+"-summary",this._placeholderId=h+_,this._selectedLabelsId=h+"-selected-labels",this._infoTextId=h+"-info"}setupObserver(t){if(!t)return;const i=t.closest("db-custom-select");i&&!this.observer&&(this.observer=new MutationObserver((i=>{i.some((t=>{var i;const s=t.target.attributes.getNamedItem(null!==(i=t.attributeName)&&void 0!==i?i:"");return(null==s?void 0:s.value)!==t.oldValue}))&&this.enableAttributePassing(t,"db-custom-select")})),this.observer.observe(i,{attributes:!0,attributeOldValue:!0}))}enableAttributePassing(t,i){const s=null==t?void 0:t.closest(i);if(t&&s){const i=s.attributes;for(let e=0;e<i.length;e++){const h=i.item(e);if(h&&"data-density"!==h.name&&(h.name.startsWith("data-")||h.name.startsWith("aria-")))h.value?t.setAttribute(h.name,h.value):t.removeAttribute(h.name),s.removeAttribute(h.name);else if(h&&["style"].includes(h.name))t.setAttribute(h.name,h.value),s.removeAttribute(h.name);else if(h&&"class"===h.name){const i=h.value.includes("hydrated"),e=h.value.replace("hydrated","").trim(),l=t.getAttribute("class");t.setAttribute(h.name,`${l||""}${e?" "+e:""}`),i?s.setAttribute("class","hydrated"):s.removeAttribute(h.name)}}}}watch0Fn(){var t,i;(null!==(t=this.id)&&void 0!==t?t:null===(i=this.propOverrides)||void 0===i?void 0:i.id)&&this.resetIds()}watch0(){this.watch0Fn()}watch1Fn(){this.detailsRef&&this.detailsRef.addEventListener("focusout",(t=>this.handleClose(t)))}watch1(){this.watch1Fn()}watch2Fn(){if(this._id){const t=this._id+p;this._labelId=this._id+x,this._selectId=this._id+k,this._validMessageId=this._id+y,this._invalidMessageId=this._id+g,this._placeholderId=this._id+_,a(this.message,this.showMessage)?this.setDescById(t):this.setDescById()}}watch2(){this.watch2Fn()}watch3Fn(){var t;if(this.detailsRef){const i=this.detailsRef.querySelector("summary");i&&i.setAttribute("aria-describedby",null!==(t=this.ariaDescribedBy)&&void 0!==t?t:this._descByIds||"")}}watch3(){this.watch3Fn()}watch4Fn(){void 0!==this.showNoResults?this._hasNoOptions=this.showNoResults:this._options&&(this._hasNoOptions=0===this._options.length)}watch4(){this.watch4Fn()}watch5Fn(){var t;this.selectAllEnabled=!(!this.multiple||!(null!==(t=this.showSelectAll)&&void 0!==t?t:this.amountOptions>5))}watch5(){this.watch5Fn()}watch6Fn(){var t;this.searchEnabled=null!==(t=this.showSearch)&&void 0!==t?t:this.amountOptions>9}watch6(){this.watch6Fn()}watch7Fn(){var t;const i=this.values;Array.isArray(i)?this._values!==i&&(this._values=i):null==i&&0!==(null===(t=this._values)||void 0===t?void 0:t.length)&&(this._values=[])}watch7(){this.watch7Fn()}watch8Fn(){this.selectRef&&this.handleValidation()}watch8(){this.watch8Fn()}watch9Fn(){if(this.selectRef){let t=this.abortController;t||(t=new AbortController,this.abortController=t);const i=this.values;O(this.selectRef,(()=>{this.handleOptionSelected(i||(this.selectRef.value?[this.selectRef.value]:[])),this.handleValidation()}),t.signal)}}watch9(){this.watch9Fn()}watch10Fn(){this._validity=this.validation}watch10(){this.watch10Fn()}watch11Fn(){var t,i;0===(null===(t=this._values)||void 0===t?void 0:t.length)?(this.selectAllChecked=!1,this.selectAllIndeterminate=!1):(null===(i=this._values)||void 0===i?void 0:i.length)===this.amountOptions?(this.selectAllIndeterminate=!1,this.selectAllChecked=!0):this._values&&(this.selectAllIndeterminate=!0)}watch11(){this.watch11Fn()}watch12Fn(){var t,i;this._options=this.options,this.amountOptions=null!==(i=null===(t=this.options)||void 0===t?void 0:t.filter((t=>!t.isGroupTitle)).length)&&void 0!==i?i:0}watch12(){this.watch12Fn()}watch13Fn(){this._searchValue=this.searchValue,this.searchValue&&this.handleSearch(this.searchValue)}watch13(){this.watch13Fn()}watch14Fn(){var t,i;(null===(t=this.options)||void 0===t?void 0:t.length)&&(this._selectedOptions=null===(i=this.options)||void 0===i?void 0:i.filter((t=>{var i,s;return!(!t.value||!(null===(i=this._values)||void 0===i?void 0:i.includes))&&!t.isGroupTitle&&(null===(s=this._values)||void 0===s?void 0:s.includes(t.value))})))}watch14(){this.watch14Fn()}watch15Fn(){var t,i,s;if(this.selectedLabels)this._selectedLabels=this.selectedLabels;else if(null===(t=this._selectedOptions)||void 0===t?void 0:t.length){if(this.transformSelectedLabels)return void(this._selectedLabels=(0,this.transformSelectedLabels)(this._selectedOptions));this._selectedLabels="amount"===this.selectedType?this.amountText?this.amountText:`${null===(i=this._selectedOptions)||void 0===i?void 0:i.length} ${A}`:null===(s=this._selectedOptions)||void 0===s?void 0:s.map((t=>this.getOptionLabel(t))).join(", ")}else this._selectedLabels=""}watch15(){this.watch15Fn()}watch16Fn(){var t,i;this.amountChange&&this.amountChange.emit(null!==(i=null===(t=this._selectedOptions)||void 0===t?void 0:t.length)&&void 0!==i?i:0)}watch16(){this.watch16Fn()}watch17Fn(){this.selectAllRef&&(this.selectAllRef.indeterminate=!!this.selectAllIndeterminate)}watch17(){this.watch17Fn()}watch18Fn(){var t;this._invalidMessage=this.invalidMessage||(null===(t=this.selectRef)||void 0===t?void 0:t.validationMessage)||m}watch18(){this.watch18Fn()}componentDidLoad(){if("undefined"!=typeof document&&this.rootElement&&this.rootElement.dataset.connect){const t=document.querySelector(`[data-connect-id="${this.rootElement.dataset.connect}"]`);t&&t.remove()}this.enableAttributePassing(this._ref,"db-custom-select"),(()=>{this.resetIds(),this._invalidMessage=this.invalidMessage||m,"undefined"!=typeof window&&"IntersectionObserver"in window&&(this._observer=new IntersectionObserver((t=>{if(this.detailsRef){const i=t.find((({target:t})=>t===this.detailsRef));i&&!i.isIntersecting&&this.detailsRef.open&&(this.detailsRef.open=!1)}})))})(),(()=>{this.setupObserver(this._ref)})(),this.watch0Fn(),this.watch1Fn(),this.watch2Fn(),this.watch3Fn(),this.watch4Fn(),this.watch5Fn(),this.watch6Fn(),this.watch7Fn(),this.watch8Fn(),this.watch9Fn(),this.watch10Fn(),this.watch11Fn(),this.watch12Fn(),this.watch13Fn(),this.watch14Fn(),this.watch15Fn(),this.watch16Fn(),this.watch17Fn(),this.watch18Fn()}disconnectedCallback(){var t,i;null===(t=this.abortController)||void 0===t||t.abort(),null===(i=this.observer)||void 0===i||i.disconnect()}render(){var t,i,s,e,h,l,o,w,m,f,p,y,g,k,x;return d("div",{key:"83046fc855d23b9e678b3439a05a837849dffff1",class:v("db-custom-select",this.className),id:this._id,ref:t=>{this._ref=t},"aria-invalid":"invalid"===this._validity,"data-custom-validity":this._validity,"data-width":this.formFieldWidth,"data-variant":"floating"===this.variant&&"tag"===this.selectedType&&this.multiple?"above":this.variant,"data-required":c(this.required,"required"),"data-hide-asterisk":u(this.showRequiredAsterisk),"data-placement":this.placement,"data-selected-type":this.multiple?this.selectedType:"text","data-hide-label":u(this.showLabel),"data-icon":this.icon,"data-show-icon":c(this.showIcon,"showIcon")},d("label",{key:"015ece24c6eafe5d148749641fa045cc40e3352c",id:this._labelId},null!==(t=this.label)&&void 0!==t?t:b,d("select",{key:"1472fec486eaa5abf3103037c1ab3beb94001f4f",role:"none",hidden:!0,id:this._selectId,tabIndex:-1,ref:t=>{this.selectRef=t},form:this.form,name:this.name,"data-custom-validity":this._validity,multiple:r(this.multiple,"multiple"),disabled:r(this.disabled,"disabled"),required:r(this.required,"required"),onChange:t=>this.satisfyReact(t)},(null===(i=this.options)||void 0===i?void 0:i.length)?null===(s=this.options)||void 0===s?void 0:s.map((t=>d("option",{disabled:t.disabled,value:t.value,key:void 0},this.getOptionLabel(t)))):null)),d("details",{key:"da28a110e387920a7ca6b7bb20e367d6aab2e7e5",ref:t=>{this.detailsRef=t},open:this.open,onToggle:t=>this.handleDropdownToggle(t),onKeyDown:t=>this.handleKeyboardPress(t)},d("slot",{key:"a9708a4d0dc7e24e3a2a0a5790b7bdf1f6d9c711"}),this.options?d(n,null,d("summary",{class:"db-custom-select-form-field",id:this._summaryId,"aria-disabled":c(this.disabled,"disabled"),tabIndex:this.disabled?-1:void 0,"aria-labelledby":this._labelId},(null===(e=this._selectedLabels)||void 0===e?void 0:e.length)?d("span",{"data-visually-hidden":c("tag"===this.selectedType,"selectedType"),id:this._selectedLabelsId},this.selectedPrefix?d("span",{"data-visually-hidden":"true"},this.selectedPrefix):null,this._selectedLabels):null,"tag"===this.selectedType?d("div",null,null===(h=this._selectedOptions)||void 0===h?void 0:h.map((t=>d("db-tag",{emphasis:"strong",behavior:"removable",removeButton:this.getTagRemoveLabel(t),onRemove:i=>this.handleTagRemove(t,i),key:void 0},this.getOptionLabel(t))))):null),d("db-custom-select-dropdown",{width:this.dropdownWidth},this.searchEnabled?d("div",null,d("db-input",{type:"search",ref:t=>{this.searchInputRef=t},name:this._id,form:this._id,showLabel:!1,value:this._searchValue,label:null!==(l=this.searchLabel)&&void 0!==l?l:b,placeholder:null!==(o=this.searchPlaceholder)&&void 0!==o?o:this.searchLabel,ariaDescribedBy:this._hasNoOptions||this.showLoading?this._infoTextId:void 0,onInput:t=>this.handleSearch(t)})):null,this._hasNoOptions||this.showLoading?d("db-infotext",{id:this._infoTextId,icon:this.showLoading?"circular_arrows":void 0,semantic:this.showLoading?"informational":"warning"},null!==(w=this.showLoading?this.loadingText:this.noResultsText)&&void 0!==w?w:L):d(n,null,this.selectAllEnabled?d("div",null,d("div",{class:"db-checkbox db-custom-select-list-item"},d("label",null,d("input",{type:"checkbox",value:"select-all",ref:t=>{this.selectAllRef=t},form:this._id,checked:this.selectAllChecked,onChange:t=>this.handleSelectAll(t)}),this.getSelectAllLabel()))):null,d("db-custom-select-list",{multiple:r(this.multiple,"multiple"),label:null!==(f=null!==(m=this.listLabel)&&void 0!==m?m:this.label)&&void 0!==f?f:b},null===(p=this._options)||void 0===p?void 0:p.map((t=>d("db-custom-select-list-item",{type:this.multiple?"checkbox":"radio",showDivider:t.showDivider,icon:t.icon,isGroupTitle:t.isGroupTitle,groupTitle:this.getOptionLabel(t),name:this._id,checked:this.getOptionChecked(t.value),disabled:t.disabled,value:t.value,onChange:()=>this.handleSelect(t.value),key:void 0},t.isGroupTitle?null:this.getOptionLabel(t)))))),d("div",null,d("db-button",{variant:"ghost",width:"full",icon:"cross",size:"small",name:this._id,form:this._id,onClick:()=>this.handleClose(void 0,!0)},null!==(y=this.mobileCloseButtonText)&&void 0!==y?y:F)))):null),(null===(g=this.showClearSelection)||void 0===g||g)&&(null===(k=this._values)||void 0===k?void 0:k.length)?d("db-button",{icon:"cross",variant:"ghost",size:"small",noText:!0,name:this._id,form:this._id,disabled:r(this.disabled,"disabled"),onClick:t=>this.handleClearAll(t)},this.clearSelectionText,d("db-tooltip",{placement:"top"},this.clearSelectionText)):null,d("span",{key:"2239de0c36c6289a623146c363987b1874e468cc",class:"db-custom-select-placeholder","aria-hidden":"true",id:this._placeholderId},null!==(x=this.placeholder)&&void 0!==x?x:this.label),a(this.message,this.showMessage)?d("db-infotext",{size:"small",icon:this.messageIcon,id:this._messageId},this.message):null,this.hasValidState()?d("db-infotext",{size:"small",semantic:"successful",id:this._validMessageId},this.validMessage||I):null,d("db-infotext",{key:"55fe7e28b2124a471bc814601925cdf86abd8178",size:"small",semantic:"critical",id:this._invalidMessageId},this._invalidMessage),d("span",{key:"294d2fad5268e30791745abee8589d5266524807","data-visually-hidden":"true",role:"status"},this._voiceOverFallback))}get rootElement(){return this}static get watchers(){return{id:[{watch0:0}],"propOverrides?.id":[{watch0:0}],detailsRef:[{watch1:0},{watch3:0}],_id:[{watch2:0}],_descByIds:[{watch3:0}],showNoResults:[{watch4:0}],showLoading:[{watch4:0}],_options:[{watch4:0}],showSelectAll:[{watch5:0}],amountOptions:[{watch5:0},{watch6:0},{watch11:0}],multiple:[{watch5:0}],showSearch:[{watch6:0}],values:[{watch7:0}],_values:[{watch8:0},{watch11:0},{watch14:0}],selectRef:[{watch8:0},{watch9:0},{watch18:0}],validation:[{watch10:0}],options:[{watch12:0},{watch14:0}],searchValue:[{watch13:0}],_selectedOptions:[{watch15:0},{watch16:0}],selectedType:[{watch15:0}],amountText:[{watch15:0}],selectedLabels:[{watch15:0}],transformSelectedLabels:[{watch15:0}],selectAllIndeterminate:[{watch17:0}],selectAllRef:[{watch17:0}],invalidMessage:[{watch18:0}]}}},[260,"db-custom-select",{invalidMessage:[1,"invalid-message"],id:[1],propOverrides:[16],message:[1],showMessage:[8,"show-message"],ariaDescribedBy:[1,"aria-described-by"],showNoResults:[4,"show-no-results"],showLoading:[4,"show-loading"],multiple:[8],showSelectAll:[4,"show-select-all"],showSearch:[4,"show-search"],values:[16],validation:[1],options:[16],searchValue:[1,"search-value"],selectedLabels:[1,"selected-labels"],transformSelectedLabels:[16],selectedType:[1,"selected-type"],amountText:[1,"amount-text"],validMessage:[1,"valid-message"],required:[8],selectAllLabel:[1,"select-all-label"],removeTagsTexts:[16],placement:[1],searchFilter:[16],className:[1,"classname"],formFieldWidth:[1,"form-field-width"],variant:[1],showRequiredAsterisk:[8,"show-required-asterisk"],showLabel:[8,"show-label"],icon:[1],showIcon:[8,"show-icon"],label:[1],form:[1],name:[1],disabled:[8],open:[4],selectedPrefix:[1,"selected-prefix"],dropdownWidth:[1,"dropdown-width"],searchLabel:[1,"search-label"],searchPlaceholder:[1,"search-placeholder"],listLabel:[1,"list-label"],loadingText:[1,"loading-text"],noResultsText:[1,"no-results-text"],mobileCloseButtonText:[1,"mobile-close-button-text"],showClearSelection:[4,"show-clear-selection"],clearSelectionText:[1,"clear-selection-text"],placeholder:[1],messageIcon:[1,"message-icon"],_id:[32],_messageId:[32],_validMessageId:[32],_invalidMessageId:[32],_invalidMessage:[32],_selectId:[32],_labelId:[32],_summaryId:[32],_placeholderId:[32],_infoTextId:[32],_validity:[32],_userInteraction:[32],abortController:[32],_descByIds:[32],_selectedLabels:[32],_selectedLabelsId:[32],_voiceOverFallback:[32],_selectedOptions:[32],selectAllEnabled:[32],searchEnabled:[32],amountOptions:[32],_values:[32],_options:[32],_hasNoOptions:[32],_documentClickListenerCallbackId:[32],_internalChangeTimestamp:[32],_documentScrollListenerCallbackId:[32],_observer:[32],_searchValue:[32],selectAllChecked:[32],selectAllIndeterminate:[32],observer:[32]},void 0,{id:[{watch0:0}],"propOverrides?.id":[{watch0:0}],detailsRef:[{watch1:0},{watch3:0}],_id:[{watch2:0}],_descByIds:[{watch3:0}],showNoResults:[{watch4:0}],showLoading:[{watch4:0}],_options:[{watch4:0}],showSelectAll:[{watch5:0}],amountOptions:[{watch5:0},{watch6:0},{watch11:0}],multiple:[{watch5:0}],showSearch:[{watch6:0}],values:[{watch7:0}],_values:[{watch8:0},{watch11:0},{watch14:0}],selectRef:[{watch8:0},{watch9:0},{watch18:0}],validation:[{watch10:0}],options:[{watch12:0},{watch14:0}],searchValue:[{watch13:0}],_selectedOptions:[{watch15:0},{watch16:0}],selectedType:[{watch15:0}],amountText:[{watch15:0}],selectedLabels:[{watch15:0}],transformSelectedLabels:[{watch15:0}],selectAllIndeterminate:[{watch17:0}],selectAllRef:[{watch17:0}],invalidMessage:[{watch18:0}]}]),z=N,W=function(){"undefined"!=typeof customElements&&["db-custom-select","db-button","db-custom-select-dropdown","db-custom-select-list","db-custom-select-list-item","db-infotext","db-input","db-tag","db-tooltip"].forEach((t=>{switch(t){case"db-custom-select":customElements.get(w(t))||customElements.define(w(t),N);break;case"db-button":customElements.get(w(t))||T();break;case"db-custom-select-dropdown":customElements.get(w(t))||S();break;case"db-custom-select-list":customElements.get(w(t))||E();break;case"db-custom-select-list-item":customElements.get(w(t))||R();break;case"db-infotext":customElements.get(w(t))||j();break;case"db-input":customElements.get(w(t))||B();break;case"db-tag":customElements.get(w(t))||M();break;case"db-tooltip":customElements.get(w(t))||V()}}))};export{q as D,z as DbCustomSelect,W as defineCustomElement}
|
|
1
|
+
import{u as t,y as i,H as s,A as e,h,f as l,p as a,q as o,z as d,F as n,j as c,k as r,o as u,d as v,t as w}from"./p-CYYSsu3p.js";import{l as m,a as b,m as f,f as p,g as y,h as g,e as k,d as _,i as x,o as A,k as I,c as C,s as F}from"./p-BdL-nI5y.js";import{D as L}from"./p-DJTpgiBy.js";import{a as T}from"./p-C0q9XJSc.js";import{b as O}from"./p-D6L0n3gO.js";import{d as S}from"./p-DVuZmW_J.js";import{d as D}from"./p-G57oLrr4.js";import{d as E}from"./p-to845Mg2.js";import{d as R}from"./p-k8bCF_aj.js";import{d as j}from"./p-BpO8Ok-r.js";import{d as B}from"./p-DcgghWWs.js";import{d as M}from"./p-CuC4YsIB.js";import{d as q}from"./p-gIJnyld5.js";class V{static runCallbacks(t){for(const i of Object.values(V.callbacks))"function"==typeof i&&i(t)}constructor(){if(V._instance)return V._instance;V._instance=this,self.document&&self.document.addEventListener("click",(t=>V.runCallbacks(t)))}addCallback(i){const s=t();return V.callbacks[s]=i,s}removeCallback(t){delete V.callbacks[t]}}V.callbacks={},V._instance=null;const $=i(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.amountChange=e(this,"amountChange"),this.dropdownToggle=e(this,"dropdownToggle"),this.optionSelected=e(this,"optionSelected"),this.search=e(this,"search"),this.showClearSelection=!0,this.clearSelectionText="Clear selection",this._id=void 0,this._messageId=void 0,this._validMessageId=void 0,this._invalidMessageId=void 0,this._invalidMessage=void 0,this._selectId=void 0,this._labelId=void 0,this._summaryId=void 0,this._placeholderId=void 0,this._infoTextId=void 0,this._validity="no-validation",this._userInteraction=!1,this.abortController=void 0,this._descByIds=void 0,this._selectedLabels="",this._selectedLabelsId=void 0,this._voiceOverFallback="",this._selectedOptions=[],this.selectAllEnabled=!1,this.searchEnabled=!1,this.amountOptions=0,this._values=[],this._options=[],this._hasNoOptions=!1,this._documentClickListenerCallbackId=void 0,this._internalChangeTimestamp=0,this._documentScrollListenerCallbackId=void 0,this._observer=void 0,this._searchValue=void 0,this.selectAllChecked=!1,this.selectAllIndeterminate=!1,this.observer=void 0,this.satisfyReact=function(t){t.stopPropagation()}}handleDocumentScroll(t){var i,s;(null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.contains)&&(null===(s=null==t?void 0:t.target)||void 0===s?void 0:s.contains(this.detailsRef))&&this.handleAutoPlacement()}hasValidState(){var t;return!!(null!==(t=this.validMessage)&&void 0!==t?t:"valid"===this.validation)}handleValidation(){var t,i,s,e,o,d,n,c;this.selectRef&&(this.selectRef.value=this.getNativeSelectValue()),(null===(t=this.selectRef)||void 0===t?void 0:t.validity.valid)&&"invalid"!==this.validation?this.hasValidState()&&(null===(e=this.selectRef)||void 0===e?void 0:e.validity.valid)&&this.required?(this.setDescById(this._validMessageId),h()&&(this._voiceOverFallback=null!==(o=this.validMessage)&&void 0!==o?o:I,l((()=>this._voiceOverFallback=""),1e3)),this._validity=null!==(d=this.validation)&&void 0!==d?d:"valid"):a(this.message,this.showMessage)?(this.setDescById(this._messageId),this._validity=null!==(n=this.validation)&&void 0!==n?n:"no-validation"):(this.setDescById(this._placeholderId),this._validity=null!==(c=this.validation)&&void 0!==c?c:"no-validation"):(this.setDescById(this._invalidMessageId),this._invalidMessage=this.invalidMessage||(null===(i=this.selectRef)||void 0===i?void 0:i.validationMessage)||m,h()&&(this._voiceOverFallback=this._invalidMessage,l((()=>this._voiceOverFallback=""),1e3)),this._userInteraction&&(this._validity=null!==(s=this.validation)&&void 0!==s?s:"invalid"))}handleDropdownToggle(t){var i,s;this.dropdownToggle&&(t.stopPropagation(),this.dropdownToggle.emit(t)),t.target instanceof HTMLDetailsElement&&t.target.open?(this._documentClickListenerCallbackId=(new V).addCallback((t=>this.handleDocumentClose(t))),this._documentScrollListenerCallbackId=(new L).addCallback((t=>this.handleDocumentScroll(t))),this.handleAutoPlacement(),null===(i=this._observer)||void 0===i||i.observe(this.detailsRef),t.target.dataset.test||this.handleOpenByKeyboardFocus()):(this._documentClickListenerCallbackId&&(new V).removeCallback(this._documentClickListenerCallbackId),this._documentScrollListenerCallbackId&&(new L).removeCallback(this._documentScrollListenerCallbackId),null===(s=this._observer)||void 0===s||s.unobserve(this.detailsRef))}getNativeSelectValue(){var t,i;return(null===(t=this._values)||void 0===t?void 0:t.length)&&null!==(i=this._values.at(0))&&void 0!==i?i:""}setDescById(t){var i;const s=[];t&&s.push(t),this._selectedLabelsId&&(null===(i=this._selectedLabels)||void 0===i?void 0:i.length)&&s.push(this._selectedLabelsId),this._descByIds=s.join(" ")}getSelectAllLabel(){var t;return null!==(t=this.selectAllLabel)&&void 0!==t?t:b}getOptionLabel(t){var i,s,e;return null!==(e=null!==(i=t.label)&&void 0!==i?i:null===(s=t.value)||void 0===s?void 0:""+s)&&void 0!==e?e:""}getOptionChecked(t){var i,s;return!(!t||!(null===(i=this._values)||void 0===i?void 0:i.includes))&&(null===(s=this._values)||void 0===s?void 0:s.includes(t))}getTagRemoveLabel(t){const i=this.removeTagsTexts,s=this.options;if(i&&s){const e=s.findIndex((i=>i.value===t.value));if(e>=0&&e<i.length)return i[e]}return`${f} ${this.getOptionLabel(t)}`}handleTagRemove(t,i){i&&i.stopPropagation(),this.handleSelect(t.value),this.handleSummaryFocus()}handleAutoPlacement(){if(this.detailsRef){const t=this.detailsRef.querySelector("article");t&&l((()=>{var i;T(t,this.detailsRef,null!==(i=this.placement)&&void 0!==i?i:"bottom")}),1)}}handleArrowDownUp(t){var i,s,e;if(null===(i=this.detailsRef)||void 0===i?void 0:i.open){if(self.document){const i=self.document.activeElement;if(i)if("checkbox"===i.getAttribute("type")||"radio"===i.getAttribute("type")){const h=null==i?void 0:i.closest("li");if("ArrowDown"===t.key||"ArrowRight"===t.key){let t=null==h?void 0:h.nextElementSibling;for(;t;){const i=t.querySelector("input");if(i){i.focus();break}t=t.nextElementSibling}t||this.handleFocusFirstDropdownCheckbox(i)}else{let t=null==h?void 0:h.previousElementSibling;for(;t;){const i=t.querySelector("input");if(i){i.focus();break}t=t.previousElementSibling}if(!t){const t=this.detailsRef.querySelector('input[type="checkbox"]');if(t&&t!==i)this.handleFocusFirstDropdownCheckbox(i);else{const t=o(this.detailsRef);if(t)l((()=>{t.focus()}),100);else{const t=Array.from(null===(s=this.detailsRef)||void 0===s?void 0:s.querySelectorAll('input[type="checkbox"],input[type="radio"]'));t.length&&(null===(e=t.at(-1))||void 0===e||e.focus())}}}}}else"search"!==i.getAttribute("type")||"ArrowUp"!==t.key&&"ArrowLeft"!==t.key?this.handleFocusFirstDropdownCheckbox(i):(this.handleClose(void 0,!0),this.handleSummaryFocus())}}else"ArrowDown"!==t.key&&"ArrowRight"!==t.key||(this.handleAutoPlacement(),this.detailsRef&&(this.detailsRef.open=!0),this.handleOpenByKeyboardFocus());t.stopPropagation(),t.preventDefault()}handleKeyboardPress(t){var i,s,e;if(t.stopPropagation(),"Escape"===t.key&&(null===(i=this.detailsRef)||void 0===i?void 0:i.open))this.handleClose(void 0,!0),this.handleSummaryFocus();else if("Enter"===t.key&&(null===(s=this.detailsRef)||void 0===s?void 0:s.open)){if(self.document){const i=self.document.activeElement;if(["checkbox","radio"].includes(i.getAttribute("type")||""))i.click(),t.preventDefault();else if("search"===i.getAttribute("type")){const i=null===(e=this._options)||void 0===e?void 0:e.find((t=>!t.isGroupTitle&&!t.disabled));(null==i?void 0:i.value)&&(this.handleSelect(i.value),t.preventDefault())}}}else"ArrowDown"!==t.key&&"ArrowUp"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key||this.handleArrowDownUp(t)}handleClose(t,i){if(this.detailsRef)if(i)this.detailsRef.open=!1,this.handleSummaryFocus();else if(this.detailsRef.open&&t&&t.relatedTarget){const i=t.relatedTarget;this.detailsRef.contains(i)||"dialog"===i.localName||l((()=>this.detailsRef.open=!1),1)}}handleDocumentClose(t){var i,s;if(t){const e="number"==typeof t.detail?t.target:null===(i=t.detail)||void 0===i?void 0:i.target;(null===(s=this.detailsRef)||void 0===s?void 0:s.open)&&!this.detailsRef.contains(e)&&(this.detailsRef.open=!1)}}handleOptionSelected(t){(new Date).getTime()-this._internalChangeTimestamp<200||(this._values=t,this._userInteraction=!0,this.optionSelected&&this.optionSelected.emit(null!=t?t:[]),this._internalChangeTimestamp=(new Date).getTime())}handleSelect(t){var i;t&&(this.multiple?(null===(i=this._values)||void 0===i?void 0:i.includes(t))?this.handleOptionSelected(this._values.filter((i=>i!==t))):this.handleOptionSelected([...this._values||[],t]):(this.handleOptionSelected([t]),this.handleClose(void 0,!0)))}handleSelectAll(t){var i;if(t.stopPropagation(),(null===(i=this._values)||void 0===i?void 0:i.length)===this.amountOptions)this.handleOptionSelected([]);else{const t=this.searchEnabled&&this.searchInputRef?this.searchInputRef.value:void 0;this.handleOptionSelected(this.options?this.options.filter((i=>{var s;return!i.isGroupTitle&&(!t||(null===(s=i.value)||void 0===s?void 0:s.toLowerCase().includes(t.toLowerCase())))})).map((t=>{var i;return null!==(i=t.value)&&void 0!==i?i:""})):[])}}handleFocusFirstDropdownCheckbox(t){if(this.detailsRef){const i=Array.from(this.detailsRef.querySelectorAll('input[type="checkbox"],input[type="radio"]'));if(i.length){const s=i.at(0),e=s===t&&i.length>1?i.at(1):s;e&&l((()=>{e.focus()}),1)}}}handleOpenByKeyboardFocus(){if(this.detailsRef){const t=o(this.detailsRef);t?l((()=>{t.focus()}),1):this.handleFocusFirstDropdownCheckbox()}}handleSearch(t){var i;if(void 0===t)return;let s;if("string"==typeof t)s=t;else{const i=t;i.stopPropagation(),this.search&&this.search.emit(i),s=i.target.value,this._searchValue=s}this._options=this.options&&s&&0!==s.length?this.options.filter(this.searchFilter?t=>this.searchFilter(t,s):t=>!t.isGroupTitle&&this.getOptionLabel(t).toLowerCase().includes(s.toLowerCase())):this.options,(null===(i=this.detailsRef)||void 0===i?void 0:i.open)&&this.handleAutoPlacement()}handleClearAll(t){t.stopPropagation(),this.handleOptionSelected([]),this.handleSummaryFocus()}handleSummaryFocus(){var t;this.detailsRef&&(null===(t=this.detailsRef.querySelector("summary"))||void 0===t||t.focus())}resetIds(){var i,s,e;const h=null!==(e=null!==(i=this.id)&&void 0!==i?i:null===(s=this.propOverrides)||void 0===s?void 0:s.id)&&void 0!==e?e:"custom-select-"+t();this._id=h,this._messageId=h+p,this._validMessageId=h+y,this._invalidMessageId=h+g,this._selectId=h+k,this._labelId=h+_,this._summaryId=h+"-summary",this._placeholderId=h+x,this._selectedLabelsId=h+"-selected-labels",this._infoTextId=h+"-info"}setupObserver(t){if(!t)return;const i=t.closest("db-custom-select");i&&!this.observer&&(this.observer=new MutationObserver((i=>{i.some((t=>{var i;const s=t.target.attributes.getNamedItem(null!==(i=t.attributeName)&&void 0!==i?i:"");return(null==s?void 0:s.value)!==t.oldValue}))&&this.enableAttributePassing(t,"db-custom-select")})),this.observer.observe(i,{attributes:!0,attributeOldValue:!0}))}enableAttributePassing(t,i){const s=null==t?void 0:t.closest(i);if(t&&s){const i=s.attributes;for(let e=0;e<i.length;e++){const h=i.item(e);if(h&&"data-density"!==h.name&&(h.name.startsWith("data-")||h.name.startsWith("aria-")))h.value?t.setAttribute(h.name,h.value):t.removeAttribute(h.name),s.removeAttribute(h.name);else if(h&&["style"].includes(h.name))t.setAttribute(h.name,h.value),s.removeAttribute(h.name);else if(h&&"class"===h.name){const i=h.value.includes("hydrated"),e=h.value.replace("hydrated","").trim(),l=t.getAttribute("class");t.setAttribute(h.name,`${l||""}${e?" "+e:""}`),i?s.setAttribute("class","hydrated"):s.removeAttribute(h.name)}}}}watch0Fn(){var t,i;(null!==(t=this.id)&&void 0!==t?t:null===(i=this.propOverrides)||void 0===i?void 0:i.id)&&this.resetIds()}watch0(){this.watch0Fn()}watch1Fn(){this.detailsRef&&this.detailsRef.addEventListener("focusout",(t=>this.handleClose(t)))}watch1(){this.watch1Fn()}watch2Fn(){if(this._id){const t=this._id+p;this._labelId=this._id+_,this._selectId=this._id+k,this._validMessageId=this._id+y,this._invalidMessageId=this._id+g,this._placeholderId=this._id+x,a(this.message,this.showMessage)?this.setDescById(t):this.setDescById()}}watch2(){this.watch2Fn()}watch3Fn(){var t;if(this.detailsRef){const i=this.detailsRef.querySelector("summary");i&&i.setAttribute("aria-describedby",null!==(t=this.ariaDescribedBy)&&void 0!==t?t:this._descByIds||"")}}watch3(){this.watch3Fn()}watch4Fn(){void 0!==this.showNoResults?this._hasNoOptions=this.showNoResults:this._options&&(this._hasNoOptions=0===this._options.length)}watch4(){this.watch4Fn()}watch5Fn(){var t;this.selectAllEnabled=!(!this.multiple||!(null!==(t=this.showSelectAll)&&void 0!==t?t:this.amountOptions>5))}watch5(){this.watch5Fn()}watch6Fn(){var t;this.searchEnabled=null!==(t=this.showSearch)&&void 0!==t?t:this.amountOptions>9}watch6(){this.watch6Fn()}watch7Fn(){var t;const i=this.values;Array.isArray(i)?this._values!==i&&(this._values=i):null==i&&0!==(null===(t=this._values)||void 0===t?void 0:t.length)&&(this._values=[])}watch7(){this.watch7Fn()}watch8Fn(){this.selectRef&&this.handleValidation()}watch8(){this.watch8Fn()}watch9Fn(){if(this.selectRef){let t=this.abortController;t||(t=new AbortController,this.abortController=t);const i=this.values;O(this.selectRef,(()=>{this.handleOptionSelected(i||(this.selectRef.value?[this.selectRef.value]:[])),this.handleValidation()}),t.signal)}}watch9(){this.watch9Fn()}watch10Fn(){this._validity=this.validation}watch10(){this.watch10Fn()}watch11Fn(){var t,i;0===(null===(t=this._values)||void 0===t?void 0:t.length)?(this.selectAllChecked=!1,this.selectAllIndeterminate=!1):(null===(i=this._values)||void 0===i?void 0:i.length)===this.amountOptions?(this.selectAllIndeterminate=!1,this.selectAllChecked=!0):this._values&&(this.selectAllIndeterminate=!0)}watch11(){this.watch11Fn()}watch12Fn(){var t,i,s;this._options=this.options,this.amountOptions=null!==(i=null===(t=this.options)||void 0===t?void 0:t.filter((t=>!t.isGroupTitle)).length)&&void 0!==i?i:0,(null===(s=this.detailsRef)||void 0===s?void 0:s.open)&&this.handleAutoPlacement()}watch12(){this.watch12Fn()}watch13Fn(){this._searchValue=this.searchValue,this.searchValue&&this.handleSearch(this.searchValue)}watch13(){this.watch13Fn()}watch14Fn(){var t,i;(null===(t=this.options)||void 0===t?void 0:t.length)&&(this._selectedOptions=null===(i=this.options)||void 0===i?void 0:i.filter((t=>{var i,s;return!(!t.value||!(null===(i=this._values)||void 0===i?void 0:i.includes))&&!t.isGroupTitle&&(null===(s=this._values)||void 0===s?void 0:s.includes(t.value))})))}watch14(){this.watch14Fn()}watch15Fn(){var t,i,s;if(this.selectedLabels)this._selectedLabels=this.selectedLabels;else if(null===(t=this._selectedOptions)||void 0===t?void 0:t.length){if(this.transformSelectedLabels)return void(this._selectedLabels=(0,this.transformSelectedLabels)(this._selectedOptions));this._selectedLabels="amount"===this.selectedType?this.amountText?this.amountText:`${null===(i=this._selectedOptions)||void 0===i?void 0:i.length} ${A}`:null===(s=this._selectedOptions)||void 0===s?void 0:s.map((t=>this.getOptionLabel(t))).join(", ")}else this._selectedLabels=""}watch15(){this.watch15Fn()}watch16Fn(){var t,i;this.amountChange&&this.amountChange.emit(null!==(i=null===(t=this._selectedOptions)||void 0===t?void 0:t.length)&&void 0!==i?i:0)}watch16(){this.watch16Fn()}watch17Fn(){this.selectAllRef&&(this.selectAllRef.indeterminate=!!this.selectAllIndeterminate)}watch17(){this.watch17Fn()}watch18Fn(){var t;this._invalidMessage=this.invalidMessage||(null===(t=this.selectRef)||void 0===t?void 0:t.validationMessage)||m}watch18(){this.watch18Fn()}componentDidLoad(){if("undefined"!=typeof document&&this.rootElement&&this.rootElement.dataset.connect){const t=document.querySelector(`[data-connect-id="${this.rootElement.dataset.connect}"]`);t&&t.remove()}this.enableAttributePassing(this._ref,"db-custom-select"),(()=>{this.resetIds(),this._invalidMessage=this.invalidMessage||m,"undefined"!=typeof window&&"IntersectionObserver"in window&&(this._observer=new IntersectionObserver((t=>{if(this.detailsRef){const i=t.find((({target:t})=>t===this.detailsRef));i&&!i.isIntersecting&&this.detailsRef.open&&(this.detailsRef.open=!1)}})))})(),(()=>{this.setupObserver(this._ref)})(),this.watch0Fn(),this.watch1Fn(),this.watch2Fn(),this.watch3Fn(),this.watch4Fn(),this.watch5Fn(),this.watch6Fn(),this.watch7Fn(),this.watch8Fn(),this.watch9Fn(),this.watch10Fn(),this.watch11Fn(),this.watch12Fn(),this.watch13Fn(),this.watch14Fn(),this.watch15Fn(),this.watch16Fn(),this.watch17Fn(),this.watch18Fn()}disconnectedCallback(){var t,i;null===(t=this.abortController)||void 0===t||t.abort(),null===(i=this.observer)||void 0===i||i.disconnect()}render(){var t,i,s,e,h,l,o,w,m,f,p,y,g,k,_;return d("div",{key:"9f804bd057ef9cde5cc83263e5b1e3a477ad5d2e",class:v("db-custom-select",this.className),id:this._id,ref:t=>{this._ref=t},"aria-invalid":"invalid"===this._validity,"data-custom-validity":this._validity,"data-width":this.formFieldWidth,"data-variant":"floating"===this.variant&&"tag"===this.selectedType&&this.multiple?"above":this.variant,"data-required":c(this.required,"required"),"data-hide-asterisk":u(this.showRequiredAsterisk),"data-placement":this.placement,"data-selected-type":this.multiple?this.selectedType:"text","data-hide-label":u(this.showLabel),"data-icon":this.icon,"data-show-icon":c(this.showIcon,"showIcon")},d("label",{key:"1ce826237b63c3abfad8b55068c25fdc4acc2d7a",id:this._labelId},null!==(t=this.label)&&void 0!==t?t:b,d("select",{key:"9f16da6b3d9e633e4ce70e8654925df86a901074",role:"none",hidden:!0,id:this._selectId,tabIndex:-1,ref:t=>{this.selectRef=t},form:this.form,name:this.name,"data-custom-validity":this._validity,multiple:r(this.multiple,"multiple"),disabled:r(this.disabled,"disabled"),required:r(this.required,"required"),onChange:t=>this.satisfyReact(t)},(null===(i=this.options)||void 0===i?void 0:i.length)?null===(s=this.options)||void 0===s?void 0:s.map((t=>d("option",{disabled:t.disabled,value:t.value,key:void 0},this.getOptionLabel(t)))):null)),d("details",{key:"6a88c236898236ee539bced6fa3b3918be8f693d",ref:t=>{this.detailsRef=t},open:this.open,onToggle:t=>this.handleDropdownToggle(t),onKeyDown:t=>this.handleKeyboardPress(t)},d("slot",{key:"c9dd3e30dd094da51de1b2064749a211fef6eb36"}),this.options?d(n,null,d("summary",{class:"db-custom-select-form-field",id:this._summaryId,"aria-disabled":c(this.disabled,"disabled"),tabIndex:this.disabled?-1:void 0,"aria-labelledby":this._labelId},(null===(e=this._selectedLabels)||void 0===e?void 0:e.length)?d("span",{"data-visually-hidden":c("tag"===this.selectedType,"selectedType"),id:this._selectedLabelsId},this.selectedPrefix?d("span",{"data-visually-hidden":"true"},this.selectedPrefix):null,this._selectedLabels):null,"tag"===this.selectedType?d("div",null,null===(h=this._selectedOptions)||void 0===h?void 0:h.map((t=>d("db-tag",{emphasis:"strong",behavior:"removable",removeButton:this.getTagRemoveLabel(t),onRemove:i=>this.handleTagRemove(t,i),key:void 0},this.getOptionLabel(t))))):null),d("db-custom-select-dropdown",{width:this.dropdownWidth},this.searchEnabled?d("div",null,d("db-input",{type:"search",ref:t=>{this.searchInputRef=t},name:this._id,form:this._id,showLabel:!1,value:this._searchValue,label:null!==(l=this.searchLabel)&&void 0!==l?l:b,placeholder:null!==(o=this.searchPlaceholder)&&void 0!==o?o:this.searchLabel,ariaDescribedBy:this._hasNoOptions||this.showLoading?this._infoTextId:void 0,onInput:t=>this.handleSearch(t)})):null,this._hasNoOptions||this.showLoading?d("db-infotext",{id:this._infoTextId,icon:this.showLoading?"circular_arrows":void 0,semantic:this.showLoading?"informational":"warning"},null!==(w=this.showLoading?this.loadingText:this.noResultsText)&&void 0!==w?w:C):d(n,null,this.selectAllEnabled?d("div",null,d("div",{class:"db-checkbox db-custom-select-list-item"},d("label",null,d("input",{type:"checkbox",value:"select-all",ref:t=>{this.selectAllRef=t},form:this._id,checked:this.selectAllChecked,onChange:t=>this.handleSelectAll(t)}),this.getSelectAllLabel()))):null,d("db-custom-select-list",{multiple:r(this.multiple,"multiple"),label:null!==(f=null!==(m=this.listLabel)&&void 0!==m?m:this.label)&&void 0!==f?f:b},null===(p=this._options)||void 0===p?void 0:p.map((t=>d("db-custom-select-list-item",{type:this.multiple?"checkbox":"radio",showDivider:t.showDivider,icon:t.icon,isGroupTitle:t.isGroupTitle,groupTitle:this.getOptionLabel(t),name:this._id,checked:this.getOptionChecked(t.value),disabled:t.disabled,value:t.value,onChange:()=>this.handleSelect(t.value),key:void 0},t.isGroupTitle?null:this.getOptionLabel(t)))))),d("div",null,d("db-button",{variant:"ghost",width:"full",icon:"cross",size:"small",name:this._id,form:this._id,onClick:()=>this.handleClose(void 0,!0)},null!==(y=this.mobileCloseButtonText)&&void 0!==y?y:F)))):null),(null===(g=this.showClearSelection)||void 0===g||g)&&(null===(k=this._values)||void 0===k?void 0:k.length)?d("db-button",{icon:"cross",variant:"ghost",size:"small",noText:!0,name:this._id,form:this._id,disabled:r(this.disabled,"disabled"),onClick:t=>this.handleClearAll(t)},this.clearSelectionText,d("db-tooltip",{placement:"top"},this.clearSelectionText)):null,d("span",{key:"3210abcd9df6f8232346aa78def9e3bd078f35db",class:"db-custom-select-placeholder","aria-hidden":"true",id:this._placeholderId},null!==(_=this.placeholder)&&void 0!==_?_:this.label),a(this.message,this.showMessage)?d("db-infotext",{size:"small",icon:this.messageIcon,id:this._messageId},this.message):null,this.hasValidState()?d("db-infotext",{size:"small",semantic:"successful",id:this._validMessageId},this.validMessage||I):null,d("db-infotext",{key:"a552df2b93f899230e80623e2014691e411c3b40",size:"small",semantic:"critical",id:this._invalidMessageId},this._invalidMessage),d("span",{key:"b29045acf1f702b90b434dc4aa9d589c0c6c57f5","data-visually-hidden":"true",role:"status"},this._voiceOverFallback))}get rootElement(){return this}static get watchers(){return{id:[{watch0:0}],"propOverrides?.id":[{watch0:0}],detailsRef:[{watch1:0},{watch3:0}],_id:[{watch2:0}],_descByIds:[{watch3:0}],showNoResults:[{watch4:0}],showLoading:[{watch4:0}],_options:[{watch4:0}],showSelectAll:[{watch5:0}],amountOptions:[{watch5:0},{watch6:0},{watch11:0}],multiple:[{watch5:0}],showSearch:[{watch6:0}],values:[{watch7:0}],_values:[{watch8:0},{watch11:0},{watch14:0}],selectRef:[{watch8:0},{watch9:0},{watch18:0}],validation:[{watch10:0}],options:[{watch12:0},{watch14:0}],searchValue:[{watch13:0}],_selectedOptions:[{watch15:0},{watch16:0}],selectedType:[{watch15:0}],amountText:[{watch15:0}],selectedLabels:[{watch15:0}],transformSelectedLabels:[{watch15:0}],selectAllIndeterminate:[{watch17:0}],selectAllRef:[{watch17:0}],invalidMessage:[{watch18:0}]}}},[260,"db-custom-select",{invalidMessage:[1,"invalid-message"],id:[1],propOverrides:[16],message:[1],showMessage:[8,"show-message"],ariaDescribedBy:[1,"aria-described-by"],showNoResults:[4,"show-no-results"],showLoading:[4,"show-loading"],multiple:[8],showSelectAll:[4,"show-select-all"],showSearch:[4,"show-search"],values:[16],validation:[1],options:[16],searchValue:[1,"search-value"],selectedLabels:[1,"selected-labels"],transformSelectedLabels:[16],selectedType:[1,"selected-type"],amountText:[1,"amount-text"],validMessage:[1,"valid-message"],required:[8],selectAllLabel:[1,"select-all-label"],removeTagsTexts:[16],placement:[1],searchFilter:[16],className:[1,"classname"],formFieldWidth:[1,"form-field-width"],variant:[1],showRequiredAsterisk:[8,"show-required-asterisk"],showLabel:[8,"show-label"],icon:[1],showIcon:[8,"show-icon"],label:[1],form:[1],name:[1],disabled:[8],open:[4],selectedPrefix:[1,"selected-prefix"],dropdownWidth:[1,"dropdown-width"],searchLabel:[1,"search-label"],searchPlaceholder:[1,"search-placeholder"],listLabel:[1,"list-label"],loadingText:[1,"loading-text"],noResultsText:[1,"no-results-text"],mobileCloseButtonText:[1,"mobile-close-button-text"],showClearSelection:[4,"show-clear-selection"],clearSelectionText:[1,"clear-selection-text"],placeholder:[1],messageIcon:[1,"message-icon"],_id:[32],_messageId:[32],_validMessageId:[32],_invalidMessageId:[32],_invalidMessage:[32],_selectId:[32],_labelId:[32],_summaryId:[32],_placeholderId:[32],_infoTextId:[32],_validity:[32],_userInteraction:[32],abortController:[32],_descByIds:[32],_selectedLabels:[32],_selectedLabelsId:[32],_voiceOverFallback:[32],_selectedOptions:[32],selectAllEnabled:[32],searchEnabled:[32],amountOptions:[32],_values:[32],_options:[32],_hasNoOptions:[32],_documentClickListenerCallbackId:[32],_internalChangeTimestamp:[32],_documentScrollListenerCallbackId:[32],_observer:[32],_searchValue:[32],selectAllChecked:[32],selectAllIndeterminate:[32],observer:[32]},void 0,{id:[{watch0:0}],"propOverrides?.id":[{watch0:0}],detailsRef:[{watch1:0},{watch3:0}],_id:[{watch2:0}],_descByIds:[{watch3:0}],showNoResults:[{watch4:0}],showLoading:[{watch4:0}],_options:[{watch4:0}],showSelectAll:[{watch5:0}],amountOptions:[{watch5:0},{watch6:0},{watch11:0}],multiple:[{watch5:0}],showSearch:[{watch6:0}],values:[{watch7:0}],_values:[{watch8:0},{watch11:0},{watch14:0}],selectRef:[{watch8:0},{watch9:0},{watch18:0}],validation:[{watch10:0}],options:[{watch12:0},{watch14:0}],searchValue:[{watch13:0}],_selectedOptions:[{watch15:0},{watch16:0}],selectedType:[{watch15:0}],amountText:[{watch15:0}],selectedLabels:[{watch15:0}],transformSelectedLabels:[{watch15:0}],selectAllIndeterminate:[{watch17:0}],selectAllRef:[{watch17:0}],invalidMessage:[{watch18:0}]}]),z=$,N=function(){"undefined"!=typeof customElements&&["db-custom-select","db-button","db-custom-select-dropdown","db-custom-select-list","db-custom-select-list-item","db-infotext","db-input","db-tag","db-tooltip"].forEach((t=>{switch(t){case"db-custom-select":customElements.get(w(t))||customElements.define(w(t),$);break;case"db-button":customElements.get(w(t))||S();break;case"db-custom-select-dropdown":customElements.get(w(t))||D();break;case"db-custom-select-list":customElements.get(w(t))||E();break;case"db-custom-select-list-item":customElements.get(w(t))||R();break;case"db-infotext":customElements.get(w(t))||j();break;case"db-input":customElements.get(w(t))||B();break;case"db-tag":customElements.get(w(t))||M();break;case"db-tooltip":customElements.get(w(t))||q()}}))};export{V as D,z as DbCustomSelect,N as defineCustomElement}
|
package/bundle/db-drawer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as o,d as s}from"./p-
|
|
1
|
+
import{D as o,d as s}from"./p-BFeR7jXy.js";const p=o,r=s;export{p as DbDrawer,r as defineCustomElement}
|
package/bundle/db-header.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as e,H as a,A as t,k as d,c as s,z as i,d as c,t as n}from"./p-CYYSsu3p.js";import{p as o}from"./p-BdL-nI5y.js";import{i as r}from"./p-
|
|
1
|
+
import{y as e,H as a,A as t,k as d,c as s,z as i,d as c,t as n}from"./p-CYYSsu3p.js";import{p as o}from"./p-BdL-nI5y.js";import{i as r}from"./p-C_qYW0Kh.js";import{d as b}from"./p-DVuZmW_J.js";import{d as l}from"./p-BFeR7jXy.js";const h=e(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.toggle=t(this,"toggle"),this.initialized=!1,this.forcedToMobile=!1,this.observer=void 0}handleToggle(e){e&&e.stopPropagation&&e.stopPropagation();const a=!d(this.drawerOpen,"drawerOpen");this.toggle&&this.toggle.emit(a)}handleNavigationItemClick(e){r(e)&&this.handleToggle()}setupObserver(e){if(!e)return;const a=e.closest("db-header");a&&!this.observer&&(this.observer=new MutationObserver((a=>{a.some((e=>{var a;const t=e.target.attributes.getNamedItem(null!==(a=e.attributeName)&&void 0!==a?a:"");return(null==t?void 0:t.value)!==e.oldValue}))&&this.enableAttributePassing(e,"db-header")})),this.observer.observe(a,{attributes:!0,attributeOldValue:!0}))}enableAttributePassing(e,a){const t=null==e?void 0:e.closest(a);if(e&&t){const a=t.attributes;for(let d=0;d<a.length;d++){const s=a.item(d);if(s&&"data-density"!==s.name&&(s.name.startsWith("data-")||s.name.startsWith("aria-")))s.value?e.setAttribute(s.name,s.value):e.removeAttribute(s.name),t.removeAttribute(s.name);else if(s&&["style"].includes(s.name))e.setAttribute(s.name,s.value),t.removeAttribute(s.name);else if(s&&"class"===s.name){const a=s.value.includes("hydrated"),d=s.value.replace("hydrated","").trim(),i=e.getAttribute("class");e.setAttribute(s.name,`${i||""}${d?" "+d:""}`),a?t.setAttribute("class","hydrated"):t.removeAttribute(s.name)}}}}watch0Fn(){this.initialized&&this._ref&&this.forceMobile&&(s(this._ref,{key:"data-force-mobile",value:"true"}),this.forcedToMobile=!0)}watch0(){this.watch0Fn()}componentDidLoad(){if("undefined"!=typeof document&&this.rootElement&&this.rootElement.dataset.connect){const e=document.querySelector(`[data-connect-id="${this.rootElement.dataset.connect}"]`);e&&e.remove()}this.enableAttributePassing(this._ref,"db-header"),(()=>{this.initialized=!0})(),(()=>{this.setupObserver(this._ref)})(),this.watch0Fn()}disconnectedCallback(){var e;null===(e=this.observer)||void 0===e||e.disconnect()}render(){var e,a,t;return i("header",{key:"aeeac33c4b9db2b9749b24ccca840aa03bac81df",class:c("db-header",this.className),ref:e=>{this._ref=e},id:null!==(e=this.id)&&void 0!==e?e:null===(a=this.propOverrides)||void 0===a?void 0:a.id,"data-width":this.width,"data-on-forcing-mobile":this.forceMobile&&!this.forcedToMobile},i("div",{key:"1078f960dbc6ed24664b5ff5c23c3524d725b822",class:"db-header-meta-navigation"},i("slot",{key:"c55739d8ae17254c2aa457795a31017a07ab5a88",name:"metaNavigation"})),i("div",{key:"6e82ab28439854dec6bcc6dcf9ed3fa36c6f5e69",class:"db-header-navigation-bar"},i("div",{key:"7e991f8cdee7c1767ea3aefdd9a01c662fb5d178",class:"db-header-brand-container"},i("slot",{key:"a1e2aea32b28520095612367e97a8b955f93bd96",name:"brand"})),i("div",{key:"273f17e3b8594dad83d8fbad021008405d865176",class:"db-header-navigation-container"},i("div",{key:"8bd9a08a0f3cf8083d238963c2cc3715edf1d5a4",class:"db-header-navigation"},i("slot",{key:"abfd95ef152c34e53806c114f243ff26b63a9bbe"})),i("div",{key:"4a61c6d86a0362913b45a432095a621ca22d1268",class:"db-header-primary-action"},i("slot",{key:"3b79bfc6d85a0a39fcb3ca2550be0a2a36b6a682",name:"primaryAction"}))),i("div",{key:"1c506669010a04ae260b692811ed17d76a3ecc03",class:"db-header-action-container"},i("div",{key:"aa522f5b0010a1747a1bc7f550c3700a0bad4e8a",class:"db-header-burger-menu-container"},i("db-button",{key:"2223a3865ed4ea94e3a3849e73e4113e1db0fb66",icon:"menu",variant:"ghost",noText:!0,onClick:()=>this.handleToggle()},null!==(t=this.burgerMenuLabel)&&void 0!==t?t:o)),i("div",{key:"86f41a6b354de871ac3f4d9cf8b7205c699ba189",class:"db-header-secondary-action"},i("slot",{key:"43e443323eb93871bb19cbea2222da6eb8ebd0e8",name:"secondaryAction"})))),i("db-drawer",{key:"8a8474e8a7f54d827f5844f76dea9ce44ef565e0",class:"db-header-drawer",spacing:"small",rounded:!0,closeButtonId:this.closeButtonId,closeButtonText:this.closeButtonText,open:d(this.drawerOpen),onClose:()=>this.handleToggle()},i("div",{key:"21f360dc09f2d53aea13fde8b13c1ffb3781f558",class:"db-header-drawer-navigation"},i("div",{key:"0c567049a2c1788decb48b10b0115348d2f3b406",class:"db-header-navigation",onClick:e=>this.handleNavigationItemClick(e)},i("slot",{key:"1403d518f5f63eca522ccecaf5a4b5f153649a33"})),i("div",{key:"c624cf3f4ea7e89a87e430ef96b34fa4ce6d4236",class:"db-header-meta-navigation"},i("slot",{key:"4fde72b2d7d8c098a8a09160e8f36ca2ddbd0702",name:"metaNavigation"}))),i("div",{key:"91d6fc1b39b3cfc39b8563956971f56a168da218",class:"db-header-secondary-action"},i("slot",{key:"a9745f3cf4c91db6a3cd0bc4e4bf904b8bc7a2aa",name:"secondaryAction"}))))}get rootElement(){return this}static get watchers(){return{initialized:[{watch0:0}],_ref:[{watch0:0}]}}},[260,"db-header",{forceMobile:[8,"force-mobile"],drawerOpen:[8,"drawer-open"],className:[1,"classname"],id:[1],propOverrides:[16],width:[1],burgerMenuLabel:[1,"burger-menu-label"],closeButtonId:[1,"close-button-id"],closeButtonText:[1,"close-button-text"],initialized:[32],forcedToMobile:[32],observer:[32]},void 0,{initialized:[{watch0:0}],_ref:[{watch0:0}]}]),f=h,u=function(){"undefined"!=typeof customElements&&["db-header","db-button","db-drawer"].forEach((e=>{switch(e){case"db-header":customElements.get(n(e))||customElements.define(n(e),h);break;case"db-button":customElements.get(n(e))||b();break;case"db-drawer":customElements.get(n(e))||l()}}))};export{f as DbHeader,u as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as i,H as t,A as s,f as a,k as n,z as e,F as o,j as d,d as h,u as l,t as c}from"./p-CYYSsu3p.js";import{n as r}from"./p-BdL-nI5y.js";import{N as u}from"./p-
|
|
1
|
+
import{y as i,H as t,A as s,f as a,k as n,z as e,F as o,j as d,d as h,u as l,t as c}from"./p-CYYSsu3p.js";import{n as r}from"./p-BdL-nI5y.js";import{N as u}from"./p-C_qYW0Kh.js";import{d as v}from"./p-DVuZmW_J.js";const b=i(class extends t{constructor(i){super(),!1!==i&&this.__registerHost(),this.click=s(this,"click"),this.initialized=!1,this.hasAreaPopup=!1,this.hasSubNavigation=!0,this.isSubNavigationExpanded=!1,this.autoClose=!1,this.navigationItemSafeTriangle=void 0,this.subNavigationId=void 0,this.subNavigationToggleId=void 0,this.observer=void 0}handleNavigationItemClick(i){var t;"A"===(null===(t=null==i?void 0:i.target)||void 0===t?void 0:t.nodeName)&&(this.autoClose=!0,a((()=>{this.autoClose=!1}),1e3))}handleClick(i){this.click&&(i.stopPropagation(),this.click.emit(i)),this.hasAreaPopup&&(this.isSubNavigationExpanded=!0)}handleBackClick(i){i.stopPropagation(),this.isSubNavigationExpanded=!1}setupObserver(i){if(!i)return;const t=i.closest("db-navigation-item");t&&!this.observer&&(this.observer=new MutationObserver((t=>{t.some((i=>{var t;const s=i.target.attributes.getNamedItem(null!==(t=i.attributeName)&&void 0!==t?t:"");return(null==s?void 0:s.value)!==i.oldValue}))&&this.enableAttributePassing(i,"db-navigation-item")})),this.observer.observe(t,{attributes:!0,attributeOldValue:!0}))}enableAttributePassing(i,t){const s=null==i?void 0:i.closest(t);if(i&&s){const t=s.attributes;for(let a=0;a<t.length;a++){const n=t.item(a);if(n&&"data-density"!==n.name&&(n.name.startsWith("data-")||n.name.startsWith("aria-")))n.value?i.setAttribute(n.name,n.value):i.removeAttribute(n.name),s.removeAttribute(n.name);else if(n&&["style"].includes(n.name))i.setAttribute(n.name,n.value),s.removeAttribute(n.name);else if(n&&"class"===n.name){const t=n.value.includes("hydrated"),a=n.value.replace("hydrated","").trim(),e=i.getAttribute("class");i.setAttribute(n.name,`${e||""}${a?" "+a:""}`),t?s.setAttribute("class","hydrated"):s.removeAttribute(n.name)}}}}watch0Fn(){void 0!==this.subNavigationExpanded&&(this.isSubNavigationExpanded=!!n(this.subNavigationExpanded,"subNavigationExpanded"))}watch0(){this.watch0Fn()}watch1Fn(){var i;if(this.initialized&&this._ref){const t=this._ref.querySelector("menu");t&&((null===(i=t.children)||void 0===i?void 0:i.length)>0?(this.hasAreaPopup=!0,this.navigationItemSafeTriangle||(this.navigationItemSafeTriangle=new u(this._ref,t))):this.hasSubNavigation=!1)}}watch1(){this.watch1Fn()}componentDidLoad(){if("undefined"!=typeof document&&this.rootElement&&this.rootElement.dataset.connect){const i=document.querySelector(`[data-connect-id="${this.rootElement.dataset.connect}"]`);i&&i.remove()}this.enableAttributePassing(this._ref,"db-navigation-item"),(()=>{var i;this.initialized=!0;const t="sub-nav-"+(null!==(i=this.id)&&void 0!==i?i:l());this.subNavigationId=t,this.subNavigationToggleId=t+"-toggle"})(),(()=>{this.setupObserver(this._ref)})(),this.watch0Fn(),this.watch1Fn()}disconnectedCallback(){var i;null===(i=this.observer)||void 0===i||i.disconnect()}render(){var i,t,s;return e("li",{key:"c7821549626fe4b55c4bc6907832c972723bc174",class:h("db-navigation-item",this.className),ref:i=>{this._ref=i},id:null!==(i=this.id)&&void 0!==i?i:null===(t=this.propOverrides)||void 0===t?void 0:t.id,onMouseOver:()=>{var i;return null===(i=this.navigationItemSafeTriangle)||void 0===i?void 0:i.enableFollow()},onMouseLeave:()=>{var i;return null===(i=this.navigationItemSafeTriangle)||void 0===i?void 0:i.disableFollow()},onMouseMove:i=>{var t;return null===(t=this.navigationItemSafeTriangle)||void 0===t?void 0:t.followByMouseEvent(i)},"data-width":this.width,"data-icon":this.icon,"data-show-icon":d(this.showIcon,"showIcon"),"data-active":this.active,"data-wrap":d(this.wrap,"wrap"),"aria-disabled":d(this.disabled,"disabled")},!n(this.hideSubNavigation,"hideSubNavigation")&&this.hasSubNavigation?e(o,null,e("button",{class:"db-navigation-item-expand-button",id:this.subNavigationToggleId,"aria-haspopup":this.hasAreaPopup?"true":void 0,"aria-expanded":this.isSubNavigationExpanded,"aria-controls":this.subNavigationId,disabled:n(this.disabled,"disabled"),onClick:i=>this.handleClick(i)},this.text?this.text:e("slot",{name:"expandButton"})),e("menu",{class:"db-sub-navigation",id:this.subNavigationId,"aria-labelledby":this.subNavigationToggleId,"data-force-close":this.autoClose,onClick:i=>this.handleNavigationItemClick(i)},this.hasAreaPopup?e("div",{class:"db-mobile-navigation-back"},e("db-button",{icon:"arrow_left",variant:"ghost",id:this.backButtonId,onClick:i=>this.handleBackClick(i)},null!==(s=this.backButtonText)&&void 0!==s?s:r)):null,e("slot",{name:"subNavigation"}))):this.text?this.text:e("slot",null))}get rootElement(){return this}static get watchers(){return{subNavigationExpanded:[{watch0:0}],initialized:[{watch1:0}],_ref:[{watch1:0}]}}},[260,"db-navigation-item",{id:[1],subNavigationExpanded:[8,"sub-navigation-expanded"],propOverrides:[16],className:[1,"classname"],width:[1],icon:[1],showIcon:[8,"show-icon"],active:[4],wrap:[8],disabled:[8],hideSubNavigation:[8,"hide-sub-navigation"],text:[1],backButtonId:[1,"back-button-id"],backButtonText:[1,"back-button-text"],initialized:[32],hasAreaPopup:[32],hasSubNavigation:[32],isSubNavigationExpanded:[32],autoClose:[32],navigationItemSafeTriangle:[32],subNavigationId:[32],subNavigationToggleId:[32],observer:[32]},void 0,{subNavigationExpanded:[{watch0:0}],initialized:[{watch1:0}],_ref:[{watch1:0}]}]),m=b,g=function(){"undefined"!=typeof customElements&&["db-navigation-item","db-button"].forEach((i=>{switch(i){case"db-navigation-item":customElements.get(c(i))||customElements.define(c(i),b);break;case"db-button":customElements.get(c(i))||v()}}))};export{m as DbNavigationItem,g as defineCustomElement}
|
package/bundle/db-popover.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as t,H as i,f as s,z as e,j as a,d as n,t as o}from"./p-CYYSsu3p.js";import{D as d}from"./p-DJTpgiBy.js";import{b as h}from"./p-
|
|
1
|
+
import{y as t,H as i,f as s,z as e,j as a,d as n,t as o}from"./p-CYYSsu3p.js";import{D as d}from"./p-DJTpgiBy.js";import{b as h}from"./p-C0q9XJSc.js";const r=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this.initialized=!1,this.isExpanded=!1,this._documentScrollListenerCallbackId=void 0,this._observer=void 0,this.observer=void 0}handleEscape(t){if(!t||"Escape"===t.key)for(const t of Array.from(this._ref.children))t.blur()}handleAutoPlacement(){if(!this._ref)return;const t=this._ref.querySelector("article");t&&s((()=>{var i;h(t,this._ref,null!==(i=this.placement)&&void 0!==i?i:"bottom")}),1)}handleDocumentScroll(t){var i,s;(null===(i=null==t?void 0:t.target)||void 0===i?void 0:i.contains)&&(null===(s=null==t?void 0:t.target)||void 0===s?void 0:s.contains(this._ref))&&this.handleAutoPlacement()}handleEnter(){var t;this.isExpanded=!0,this._documentScrollListenerCallbackId=(new d).addCallback((t=>this.handleDocumentScroll(t))),this.handleAutoPlacement();const i=this.getTrigger();i&&(null===(t=this._observer)||void 0===t||t.observe(i))}handleLeave(t){var i;const s=null==t?void 0:t.target;if(!(null==s?void 0:s.parentNode)||s.parentNode.querySelector(":focus")!==s&&s.parentNode.querySelector(":focus-within")!==s&&s.parentNode.querySelector(":hover")!==s){this.isExpanded=!1,this._documentScrollListenerCallbackId&&(new d).removeCallback(this._documentScrollListenerCallbackId);const t=this.getTrigger();t&&(null===(i=this._observer)||void 0===i||i.unobserve(t))}}getTrigger(){var t;if(this._ref){const i=Array.from(this._ref.children);if(i.length>=2){const s=i[0];return s.tagName.includes("-")?(null===(t=s.children)||void 0===t?void 0:t.length)>0?s.children[0]:null:s}}return null}setupObserver(t){if(!t)return;const i=t.closest("db-popover");i&&!this.observer&&(this.observer=new MutationObserver((i=>{i.some((t=>{var i;const s=t.target.attributes.getNamedItem(null!==(i=t.attributeName)&&void 0!==i?i:"");return(null==s?void 0:s.value)!==t.oldValue}))&&this.enableAttributePassing(t,"db-popover")})),this.observer.observe(i,{attributes:!0,attributeOldValue:!0}))}enableAttributePassing(t,i){const s=null==t?void 0:t.closest(i);if(t&&s){const i=s.attributes;for(let e=0;e<i.length;e++){const a=i.item(e);if(a&&"data-density"!==a.name&&(a.name.startsWith("data-")||a.name.startsWith("aria-")))a.value?t.setAttribute(a.name,a.value):t.removeAttribute(a.name),s.removeAttribute(a.name);else if(a&&["style"].includes(a.name))t.setAttribute(a.name,a.value),s.removeAttribute(a.name);else if(a&&"class"===a.name){const i=a.value.includes("hydrated"),e=a.value.replace("hydrated","").trim(),n=t.getAttribute("class");t.setAttribute(a.name,`${n||""}${e?" "+e:""}`),i?s.setAttribute("class","hydrated"):s.removeAttribute(a.name)}}}}watch0Fn(){if(this._ref&&this.initialized){this.initialized=!1;const t=this.getTrigger();t&&(t.ariaHasPopup="true"),this.handleAutoPlacement(),this._ref.addEventListener("keydown",(t=>this.handleEscape(t))),["mouseenter","focusin"].forEach((t=>{this._ref.addEventListener(t,(()=>this.handleEnter()))})),["mouseleave","focusout"].forEach((t=>{this._ref.addEventListener(t,(()=>this.handleLeave()))})),"undefined"!=typeof window&&"IntersectionObserver"in window&&(this._observer=new IntersectionObserver((t=>{const i=t.find((({target:t})=>t===this.getTrigger()));i&&!i.isIntersecting&&this.handleEscape(!1)})))}}watch0(){this.watch0Fn()}watch1Fn(){if(this._ref){const t=this.getTrigger();t&&(t.ariaExpanded=""+!!this.isExpanded)}}watch1(){this.watch1Fn()}componentDidLoad(){if("undefined"!=typeof document&&this.rootElement&&this.rootElement.dataset.connect){const t=document.querySelector(`[data-connect-id="${this.rootElement.dataset.connect}"]`);t&&t.remove()}this.enableAttributePassing(this._ref,"db-popover"),(()=>{this.initialized=!0})(),(()=>{this.setupObserver(this._ref)})(),this.watch0Fn(),this.watch1Fn()}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect()}render(){var t,i,s;return e("div",{key:"6c495cb9c8f329dd2cf07bfc55b56eb9aa524fb9",class:n("db-popover",this.className),ref:t=>{this._ref=t},id:null!==(t=this.id)&&void 0!==t?t:null===(i=this.propOverrides)||void 0===i?void 0:i.id},e("slot",{key:"f74be440cae4d35f76ff2899bae864fc9e3e5c8a",name:"trigger"}),e("article",{key:"efec32b56bf7267aed0f0723306398f9e5f66c75",class:"db-popover-content","data-spacing":this.spacing,"data-gap":a(this.gap,"gap"),"data-animation":a(null===(s=this.animation)||void 0===s||s,"animation"),"data-open":a(this.open,"open"),"data-delay":this.delay,"data-width":this.width,"data-placement":this.placement},e("slot",{key:"2a1957f512ad0c9eca6e9e5f50721dda1ce56cf3"})))}get rootElement(){return this}static get watchers(){return{_ref:[{watch0:0},{watch1:0}],initialized:[{watch0:0}],isExpanded:[{watch1:0}]}}},[260,"db-popover",{placement:[1],id:[1],propOverrides:[16],className:[1,"classname"],spacing:[1],gap:[8],animation:[8],open:[8],delay:[1],width:[1],initialized:[32],isExpanded:[32],_documentScrollListenerCallbackId:[32],_observer:[32],observer:[32]},void 0,{_ref:[{watch0:0},{watch1:0}],initialized:[{watch0:0}],isExpanded:[{watch1:0}]}]),c=r,l=function(){"undefined"!=typeof customElements&&["db-popover"].forEach((t=>{"db-popover"===t&&(customElements.get(o(t))||customElements.define(o(t),r))}))};export{c as DbPopover,l as defineCustomElement}
|
package/bundle/db-tag.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as
|
|
1
|
+
import{D as s,d as o}from"./p-CuC4YsIB.js";const p=s,r=o;export{p as DbTag,r as defineCustomElement}
|
package/bundle/db-tooltip.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as o,d as
|
|
1
|
+
import{D as o,d as s}from"./p-gIJnyld5.js";const p=o,r=s;export{p as DbTooltip,r as defineCustomElement}
|
package/bundle/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as _}from"./p-CYYSsu3p.js";export{c as addAttributeToChildren,d as cls,f as delay,g as getAssetPath,k as getBoolean,j as getBooleanAsString,o as getHideProp,n as getInputValue,x as getNotificationRole,l as getNumber,v as getOptionKey,q as getSearchInput,m as getStep,h as hasVoiceOver,i as isArrayOfStrings,e as isIOSSafari,w as isKeyboardEvent,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions,p as stringPropVisible,u as uuid}from"./p-CYYSsu3p.js";import{DbAccordion as L}from"./db-accordion.js";import{DbAccordionItem as I}from"./db-accordion-item.js";import{DbBadge as O}from"./db-badge.js";import{DbBrand as U}from"./db-brand.js";import{DbButton as R}from"./db-button.js";import{DbCard as P}from"./db-card.js";import{DbCheckbox as M}from"./db-checkbox.js";import{DbCustomButton as V}from"./db-custom-button.js";import{DbCustomSelect as X}from"./db-custom-select.js";export{D as DocumentClickListener}from"./db-custom-select.js";import{DbCustomSelectDropdown as Y}from"./db-custom-select-dropdown.js";import{DbCustomSelectFormField as K}from"./db-custom-select-form-field.js";import{DbCustomSelectList as W}from"./db-custom-select-list.js";import{DbCustomSelectListItem as H}from"./db-custom-select-list-item.js";import{DbDivider as J}from"./db-divider.js";import{DbDrawer as Q}from"./db-drawer.js";import{DbHeader as Z}from"./db-header.js";import{DbIcon as $}from"./db-icon.js";import{DbInfotext as ee}from"./db-infotext.js";import{DbInput as te}from"./db-input.js";import{DbLink as oe}from"./db-link.js";import{DbNavigation as ae}from"./db-navigation.js";import{DbNavigationItem as re}from"./db-navigation-item.js";import{DbNotification as se}from"./db-notification.js";import{DbPage as ie}from"./db-page.js";import{DbPopover as ne}from"./db-popover.js";import{DbRadio as me}from"./db-radio.js";import{DbSection as le}from"./db-section.js";import{DbSelect as de}from"./db-select.js";import{DbStack as ce}from"./db-stack.js";import{DbSwitch as pe}from"./db-switch.js";import{DbTabItem as fe}from"./db-tab-item.js";import{DbTabList as be}from"./db-tab-list.js";import{DbTabPanel as ue}from"./db-tab-panel.js";import{DbTable as ge}from"./db-table.js";import{DbTableBody as Ee}from"./db-table-body.js";import{DbTableCaption as _e}from"./db-table-caption.js";import{DbTableDataCell as je}from"./db-table-data-cell.js";import{DbTableFooter as
|
|
1
|
+
import{t as _}from"./p-CYYSsu3p.js";export{c as addAttributeToChildren,d as cls,f as delay,g as getAssetPath,k as getBoolean,j as getBooleanAsString,o as getHideProp,n as getInputValue,x as getNotificationRole,l as getNumber,v as getOptionKey,q as getSearchInput,m as getStep,h as hasVoiceOver,i as isArrayOfStrings,e as isIOSSafari,w as isKeyboardEvent,r as render,s as setAssetPath,a as setNonce,b as setPlatformOptions,p as stringPropVisible,u as uuid}from"./p-CYYSsu3p.js";import{DbAccordion as L}from"./db-accordion.js";import{DbAccordionItem as I}from"./db-accordion-item.js";import{DbBadge as O}from"./db-badge.js";import{DbBrand as U}from"./db-brand.js";import{DbButton as R}from"./db-button.js";import{DbCard as P}from"./db-card.js";import{DbCheckbox as M}from"./db-checkbox.js";import{DbCustomButton as V}from"./db-custom-button.js";import{DbCustomSelect as X}from"./db-custom-select.js";export{D as DocumentClickListener}from"./db-custom-select.js";import{DbCustomSelectDropdown as Y}from"./db-custom-select-dropdown.js";import{DbCustomSelectFormField as K}from"./db-custom-select-form-field.js";import{DbCustomSelectList as W}from"./db-custom-select-list.js";import{DbCustomSelectListItem as H}from"./db-custom-select-list-item.js";import{DbDivider as J}from"./db-divider.js";import{DbDrawer as Q}from"./db-drawer.js";import{DbHeader as Z}from"./db-header.js";import{DbIcon as $}from"./db-icon.js";import{DbInfotext as ee}from"./db-infotext.js";import{DbInput as te}from"./db-input.js";import{DbLink as oe}from"./db-link.js";import{DbNavigation as ae}from"./db-navigation.js";import{DbNavigationItem as re}from"./db-navigation-item.js";import{DbNotification as se}from"./db-notification.js";import{DbPage as ie}from"./db-page.js";import{DbPopover as ne}from"./db-popover.js";import{DbRadio as me}from"./db-radio.js";import{DbSection as le}from"./db-section.js";import{DbSelect as de}from"./db-select.js";import{DbStack as ce}from"./db-stack.js";import{DbSwitch as pe}from"./db-switch.js";import{DbTabItem as fe}from"./db-tab-item.js";import{DbTabList as be}from"./db-tab-list.js";import{DbTabPanel as ue}from"./db-tab-panel.js";import{DbTable as ge}from"./db-table.js";import{DbTableBody as Ee}from"./db-table-body.js";import{DbTableCaption as _e}from"./db-table-caption.js";import{DbTableDataCell as je}from"./db-table-data-cell.js";import{DbTableFooter as Se}from"./db-table-footer.js";import{DbTableHead as De}from"./db-table-head.js";import{DbTableHeaderCell as Ae}from"./db-table-header-cell.js";import{DbTableRow as Le}from"./db-table-row.js";import{DbTabs as he}from"./db-tabs.js";import{DbTag as Te}from"./db-tag.js";import{DbTextarea as Ie}from"./db-textarea.js";import{DbTooltip as Fe}from"./db-tooltip.js";export{x as COLOR,y as COLORS,z as COLORS_SIMPLE,C as COLOR_CONST,w as COLOR_SIMPLE,F as DB_UX_LOCAL_STORAGE_FRAMEWORK,G as DB_UX_LOCAL_STORAGE_MODE,n as DEFAULT_BACK,p as DEFAULT_BURGER_MENU,s as DEFAULT_CLOSE_BUTTON,j as DEFAULT_DATALIST_ID_SUFFIX,q as DEFAULT_ICON,D as DEFAULT_ID,l as DEFAULT_INVALID_MESSAGE,h as DEFAULT_INVALID_MESSAGE_ID_SUFFIX,a as DEFAULT_LABEL,d as DEFAULT_LABEL_ID_SUFFIX,c as DEFAULT_MESSAGE,f as DEFAULT_MESSAGE_ID_SUFFIX,b as DEFAULT_PLACEHOLDER,i as DEFAULT_PLACEHOLDER_ID_SUFFIX,m as DEFAULT_REMOVE,r as DEFAULT_ROWS,o as DEFAULT_SELECTED,e as DEFAULT_SELECT_ID_SUFFIX,k as DEFAULT_VALID_MESSAGE,g as DEFAULT_VALID_MESSAGE_ID_SUFFIX,B as DEFAULT_VIEWPORT,v as DENSITIES,u as DENSITY,t as DENSITY_CONST,E as DESKTOP_VIEWPORT,S as SEMANTIC,A as SEMANTICS,T as TESTING_VIEWPORTS}from"./p-BdL-nI5y.js";export{D as DocumentScrollListener}from"./p-DJTpgiBy.js";export{g as getFloatingProps,h as handleDataOutside,a as handleFixedDropdown,b as handleFixedPopover}from"./p-C0q9XJSc.js";export{N as NavigationItemSafeTriangle,i as isEventTargetNavigationItem}from"./p-C_qYW0Kh.js";const xe=["divider","card"],ve=["multiple","single"],Oe=["inline","corner-top-left","corner-top-right","corner-center-left","corner-center-right","corner-bottom-left","corner-bottom-right"],Ue=["outlined","brand","filled","ghost"],we=["button","reset","submit"],ye=["static","interactive"],Ce=["1","2","3"],Ne=["fixed","auto","full"],Re=["checkbox","radio"],ke=["amount","text","tag"],Pe=["none","_"],Me=["horizontal","vertical"],Be=["none","strong","weak","invisible"],Ge=["left","right","up","down"],Ve=["modal","inside"],Xe=["fixed","absolute"],ze=["16","20","24","32","48","64"],Ye=["color","date","datetime-local","email","file","hidden","month","number","password","range","search","tel","text","time","url","week"],Ke=["adaptive","brand","inline"],We=["medium","small"],qe=["external","internal"],He=["docked","standalone","overlay"],Je=["block","inline"],Qe=["assertive","polite","off"],Ze=["auto","fixed"],$e=["hidden","auto"],et=["simple","divider"],tt=["row","column"],ot=["stretch","start","end","center"],at=["space-between","start","end","center"],rt=["row","col","rowgroup","colgroup"],st=["none","weak","strong"],it=["x-small","small","medium","large"],nt=["flat","zebra","spaced"],mt=["none","both","horizontal","vertical"],lt=["table","list"],dt=["none","both","horizontal","vertical"],ct=["auto","1fr","min-content","max-content"],pt=["scrollbar","arrows"],ft=["auto","manually"],bt=["static","removable"],ut=["none","both","horizontal","vertical"],gt=["hard","soft","off"],Et=["description","label"],_t=["adaptive","neutral","critical","informational","warning","successful"],jt=["medium","small","large","none"],St=["medium","small","large","none"],Dt=["left","right","left-start","left-end","right-start","right-end"],At=["top","bottom","top-start","top-end","bottom-start","bottom-end"],Lt=[...Dt,...At],ht=["none","3x-large","2x-large","x-large","large","medium","small","x-small","2x-small","3x-small"],Tt=["horizontal","vertical"],It=["full","auto"],Ft=["full","medium","large","small"],xt=["none","slow","fast"],vt=["auto","fixed"],Ot=["small","medium"],Ut=["weak","strong"],wt=["invalid","valid","no-validation"],yt=["fixed","content"],Ct=["above","floating"],Nt=["leading","trailing"],Rt=["off","on","name","honorific-prefix","given-name","additional-name","family-name","honorific-suffix","nickname","email","username","new-password","current-password","one-time-code","organization-title","organization","street-address","shipping","billing","address-line1","address-line2","address-line3","address-level4","address-level3","address-level2","address-level1","country","country-name","postal-code","cc-name","cc-given-name","cc-additional-name","cc-family-name","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc","cc-type","transaction-currency","transaction-amount","language","bday","bday-day","bday-month","bday-year","sex","tel","tel-country-code","tel-national","tel-area-code","tel-local","tel-extension","impp","url","photo","webauthn"],kt=["_self","_blank","_parent","_top"],Pt=["no-referrer","no-referrer-when-downgrade","origin","origin-when-cross-origin","same-origin","strict-origin","strict-origin-when-cross-origin","unsafe-url"],Mt=["start","center","end"],Bt=e=>{"undefined"!=typeof customElements&&[L,I,O,U,R,P,M,V,X,Y,K,W,H,J,Q,Z,$,ee,te,oe,ae,re,se,ie,ne,me,le,de,ce,pe,fe,be,ue,ge,Ee,_e,je,Se,De,Ae,Le,he,Te,Ie,Fe].forEach((t=>{customElements.get(_(t.is))||customElements.define(_(t.is),t,e)}))};export{ve as AccordionBehaviorList,xe as AccordionVariantList,Mt as AlignmentList,Rt as AutoCompleteList,Oe as BadgePlacementList,we as ButtonTypeList,Ue as ButtonVariantList,ye as CardBehaviorList,Ce as CardElevationLevelList,Ne as CustomSelectDropdownWidthList,Re as CustomSelectListItemTypeList,ct as DBTableColumnsSizeList,mt as DBTableDividerList,rt as DBTableHeaderCellScopeList,lt as DBTableMobileVariantList,it as DBTableRowSizeList,st as DBTableRowSubHeaderEmphasisList,dt as DBTableStickyHeaderList,nt as DBTableVariantList,Pe as DividerMarginList,Me as DividerVariantList,Be as DrawerBackdropList,Ge as DrawerDirectionList,Xe as DrawerPositionList,Ve as DrawerVariantList,Ut as EmphasisList,yt as FieldSizingList,ht as GapSpacingList,ze as IconWeightList,Ye as InputTypeList,Nt as LabelVariantHorizontalList,Ct as LabelVariantList,qe as LinkContentList,Pt as LinkReferrerPolicyList,We as LinkSizeList,kt as LinkTargetList,Ke as LinkVariantList,St as MarginList,Ft as MaxWidthList,Qe as NotificationAriaLiveList,Je as NotificationLinkVariantList,He as NotificationVariantList,Tt as OrientationList,$e as PageDocumentOverflowList,Ze as PageVariantList,Dt as PlacementHorizontalList,Lt as PlacementList,At as PlacementVerticalList,xt as PopoverDelayList,vt as PopoverWidthList,ke as SelectedTypeList,_t as SemanticList,Ot as SizeList,jt as SpacingList,ot as StackAlignmentList,tt as StackDirectionList,at as StackJustifyContentList,et as StackVariantList,pt as TabsBehaviorList,ft as TabsInitialSelectedModeList,bt as TagBehaviorList,ut as TextareaResizeList,gt as TextareaWrapList,Et as TooltipVariantList,wt as ValidationList,It as WidthList,Bt as defineCustomElements}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y as t,H as s,A as i,w as e,k as a,f as d,z as o,j as n,d as r,t as h}from"./p-CYYSsu3p.js";import{s as c}from"./p-BdL-nI5y.js";import{d as l}from"./p-DVuZmW_J.js";const b=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.close=i(this,"close"),this.initialized=!1,this.backdropPointerDown=!1,this.observer=void 0}isNotModal(){return"absolute"===this.position||"none"===this.backdrop||"inside"===this.variant}handleBackdropPointerDown(t){var s;this.backdropPointerDown="DIALOG"===(null===(s=null==t?void 0:t.target)||void 0===s?void 0:s.nodeName)}handleClose(t,s){var i;t&&(e(t)?"Escape"===t.key&&(t.preventDefault(),this.close&&this.close.emit(t)):(s&&(t.stopPropagation(),this.close&&this.close.emit(t)),"DIALOG"===(null===(i=t.target)||void 0===i?void 0:i.nodeName)&&"click"===t.type&&"none"!==this.backdrop&&this.backdropPointerDown&&this.close&&this.close.emit(t),this.backdropPointerDown=!1))}handleDialogOpen(){if(this._ref){const t=a(this.open,"open");t&&!this._ref.open&&(this.dialogContainerRef&&this.dialogContainerRef.removeAttribute("data-transition"),this.isNotModal()?this._ref.show():(this._ref.setAttribute("closedby","any"),this._ref.showModal()),d((()=>{this.dialogContainerRef&&(this.dialogContainerRef.dataset.transition="open")}),1)),!t&&this._ref.open&&(this.dialogContainerRef&&(this.dialogContainerRef.dataset.transition="close"),d((()=>{var t;null===(t=this._ref)||void 0===t||t.close()}),401))}}setupObserver(t){if(!t)return;const s=t.closest("db-drawer");s&&!this.observer&&(this.observer=new MutationObserver((s=>{s.some((t=>{var s;const i=t.target.attributes.getNamedItem(null!==(s=t.attributeName)&&void 0!==s?s:"");return(null==i?void 0:i.value)!==t.oldValue}))&&this.enableAttributePassing(t,"db-drawer")})),this.observer.observe(s,{attributes:!0,attributeOldValue:!0}))}enableAttributePassing(t,s){const i=null==t?void 0:t.closest(s);if(t&&i){const s=i.attributes;for(let e=0;e<s.length;e++){const a=s.item(e);if(a&&"data-density"!==a.name&&(a.name.startsWith("data-")||a.name.startsWith("aria-")))a.value?t.setAttribute(a.name,a.value):t.removeAttribute(a.name),i.removeAttribute(a.name);else if(a&&["style"].includes(a.name))t.setAttribute(a.name,a.value),i.removeAttribute(a.name);else if(a&&"class"===a.name){const s=a.value.includes("hydrated"),e=a.value.replace("hydrated","").trim(),d=t.getAttribute("class");t.setAttribute(a.name,`${d||""}${e?` ${e}`:""}`),s?i.setAttribute("class","hydrated"):i.removeAttribute(a.name)}}}}watch0Fn(){this.handleDialogOpen()}watch0(){this.watch0Fn()}watch1Fn(){if(this._ref&&this.initialized&&"absolute"===this.position){const t=this._ref.parentElement;t&&(t.style.position="relative")}}watch1(){this.watch1Fn()}componentDidLoad(){if("undefined"!=typeof document&&this.rootElement&&this.rootElement.dataset.connect){const t=document.querySelector(`[data-connect-id="${this.rootElement.dataset.connect}"]`);t&&t.remove()}this.enableAttributePassing(this._ref,"db-drawer"),(()=>{this.handleDialogOpen(),this.initialized=!0})(),(()=>{this.setupObserver(this._ref)})(),this.watch0Fn(),this.watch1Fn()}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect()}render(){var t,s,i;return o("dialog",{key:"c03126193778f601b7ff3aeeeff508c8920e67a7",class:"db-drawer",id:null!==(t=this.id)&&void 0!==t?t:null===(s=this.propOverrides)||void 0===s?void 0:s.id,ref:t=>{this._ref=t},onClick:t=>this.handleClose(t),onMouseDown:t=>this.handleBackdropPointerDown(t),onKeyDown:t=>this.handleClose(t),"data-position":this.position,"data-backdrop":this.backdrop,"data-direction":this.direction,"data-variant":this.variant},o("article",{key:"64661349d858bf5be872d664b44bc6fa829014e6",class:r("db-drawer-container",this.className),ref:t=>{this.dialogContainerRef=t},"data-spacing":this.spacing,"data-width":this.width,"data-direction":this.direction,"data-rounded":n(this.rounded,"rounded")},o("header",{key:"b758a538b1337573090305aadcf3bc3befef1bf3",class:"db-drawer-header"},o("div",{key:"235f2be7afc9c968b9270178c2720a5a50436123",class:"db-drawer-header-text"},o("slot",{key:"26787a5e103d2d34785ce1eccd0ff73b6733fce8",name:"drawerHeader"})),o("db-button",{key:"1d22b406c4e235e91bc9bfc3265a0aaa9c7f8e8c",class:"button-close-drawer",icon:"cross",variant:"ghost",id:this.closeButtonId,noText:!0,onClick:t=>this.handleClose(t,!0)},null!==(i=this.closeButtonText)&&void 0!==i?i:c)),o("div",{key:"0e338b2e11c8582ba59595f34d8fc4911db7025e",class:"db-drawer-content"},o("slot",{key:"c761758ada4d1602878a58de6003e01cf5b5d075"}))))}get rootElement(){return this}static get watchers(){return{open:[{watch0:0}],_ref:[{watch1:0}],initialized:[{watch1:0}],position:[{watch1:0}]}}},[260,"db-drawer",{open:[8],position:[1],backdrop:[1],variant:[1],id:[1],propOverrides:[16],direction:[1],className:[1,"classname"],spacing:[1],width:[1],rounded:[8],closeButtonId:[1,"close-button-id"],closeButtonText:[1,"close-button-text"],initialized:[32],backdropPointerDown:[32],observer:[32]},void 0,{open:[{watch0:0}],_ref:[{watch1:0}],initialized:[{watch1:0}],position:[{watch1:0}]}]);function u(){"undefined"!=typeof customElements&&["db-drawer","db-button"].forEach((t=>{switch(t){case"db-drawer":customElements.get(h(t))||customElements.define(h(t),b);break;case"db-button":customElements.get(h(t))||l()}}))}export{b as D,u as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=t=>{const{outTop:o,outBottom:e,outLeft:i,outRight:l}=(t=>{var o;const{top:e,bottom:i,left:l,right:n}=t.getBoundingClientRect(),{innerHeight:r,innerWidth:d}=window;let p=e<0,h=i>r,a=l<0,c=n>d;const s=t.dataset.outsideVy,f=t.dataset.outsideVx,b=null===(o=null==t?void 0:t.parentElement)||void 0===o?void 0:o.getBoundingClientRect();return b&&(s&&("top"===t.dataset.outsideVy?p=b.top-(i-b.bottom)<0:h=b.bottom+(b.top-e)>r),f&&("left"===t.dataset.outsideVx?a=b.left-(n-b.right)<0:c=b.right+(b.left-l)>d)),{outTop:p,outBottom:h,outLeft:a,outRight:c}})(t);let n={};return o||e?(n={vy:o?"top":"bottom"},t.dataset.outsideVy=n.vy):delete t.dataset.outsideVy,i||l?(n=Object.assign(Object.assign({},n),{vx:l?"right":"left"}),t.dataset.outsideVx=n.vx):delete t.dataset.outsideVx,n},o=(t,o,i)=>{if(!t||!o)return;const l="full"===t.dataset.width,n="auto"===t.dataset.width;if(t.style.inlineSize="",t.style.minInlineSize="","9999"===getComputedStyle(t).zIndex)return;const{top:r,bottom:d,childHeight:p,childWidth:h,width:a,right:c,left:s,correctedPlacement:f,innerWidth:b}=e(t,o,i);let u=a;if(n){const o=parseFloat(getComputedStyle(t).maxInlineSize);!isNaN(o)&&o>0&&(u=Math.min(a,o))}l?t.style.inlineSize=`${a}px`:n&&(t.style.minInlineSize=`${u}px`);let g=h;n?g=Math.max(h,u):l&&(g=a);let m=f;n&&("top"===m||"bottom"===m||"top-start"===m||"bottom-start"===m)&&s+g>b&&(m=m.startsWith("top")?"top-end":"bottom-end"),"top"===m||"bottom"===m||"top-start"===m||"bottom-start"===m?t.style.insetInlineStart=`${s}px`:"top-end"!==m&&"bottom-end"!==m||(t.style.insetInlineStart=`${Math.max(c-g,0)}px`),(null==m?void 0:m.startsWith("top"))?t.style.insetBlockStart=r-p+"px":(null==m?void 0:m.startsWith("bottom"))&&(t.style.insetBlockStart=`${d}px`),t.style.position="fixed"},e=(t,o,e)=>{if(!t||!o)return{top:0,bottom:0,right:0,height:0,width:0,left:0,childHeight:0,childWidth:0,correctedPlacement:e,innerWidth:window.innerWidth,innerHeight:window.innerHeight};const i=t.getBoundingClientRect(),{top:l,height:n,bottom:r,right:d,left:p,width:h}=o.getBoundingClientRect(),{innerHeight:a,innerWidth:c}=window;let s=i.height,f=i.width;"bottom"!==e&&"top"!==e||(f/=2),"left"!==e&&"right"!==e||(s/=2);const b=r+s>a,u=l-s<0,g=p-f<0,m=d+f>c;let $=e;return e.startsWith("bottom")?b?($=null==e?void 0:e.replace("bottom","top"),g&&m?$="top":g?$="top-start":m&&($="top-end")):g&&m?$="bottom":g?$="bottom-start":m&&($="bottom-end"):e.startsWith("top")?u?($=null==e?void 0:e.replace("top","bottom"),g&&m?$="bottom":g?$="bottom-start":m&&($="bottom-end")):g&&m?$="top":g?$="top-start":m&&($="top-end"):e.startsWith("left")?g?($=null==e?void 0:e.replace("left","right"),b&&u?$="right":b?$="right-end":u&&($="right-start")):b&&u?$="left":b?$="left-end":u&&($="left-start"):$.startsWith("right")&&(m?($=null==e?void 0:e.replace("right","left"),b&&u?$="left":b?$="left-end":u&&($="left-start")):b&&u?$="right":b?$="right-end":u&&($="right-start")),{top:l,bottom:r,right:d,height:n,width:h,left:p,childHeight:i.height,childWidth:i.width,correctedPlacement:$,innerWidth:c,innerHeight:a}},i=new WeakMap,l=(t,o,l)=>{var n,r;if(!t||!o)return;const d=getComputedStyle(o),p=["absolute","fixed"].includes(d.position),h=(t=>{if(i.has(t))return i.get(t);let o=t.parentElement,e=0;for(;o&&e<10;){if(o.dataset.correctedPlacement)return i.set(t,o),o;o=o.parentElement,e+=1}return i.set(t,null),null})(t),a=!h&&!p,c=null!==(r=null===(n=getComputedStyle(t))||void 0===n?void 0:n.getPropertyValue("--db-popover-distance"))&&void 0!==r?r:"0px";let{top:s,height:f,width:b,childHeight:u,childWidth:g,right:m,left:$,bottom:x,correctedPlacement:v,innerWidth:w,innerHeight:W}=e(t,o,l);if(h){const t=h.getBoundingClientRect();$=Math.abs($-t.left),m=1.5*(b+Math.abs(m-t.right)),s=Math.abs(s-t.top),x=1.5*(f+Math.abs(x-t.bottom))}if(p&&($=0,m=b,s=0,x=f,["auto","inherit","0"].includes(d.zIndex)&&(o.style.zIndex="1")),g>b&&(v.startsWith("bottom")||v.startsWith("top"))){const o=b/2/g*100;v.endsWith("start")?t.style.setProperty("--db-tooltip-arrow-inline-start",`${o}%`):v.endsWith("end")?t.style.setProperty("--db-tooltip-arrow-inline-start",100-o+"%"):t.style.setProperty("--db-tooltip-arrow-inline-start","50%")}if(u>f&&(v.startsWith("left")||v.startsWith("bottom"))){const o=f/2/u*100;v.endsWith("start")?t.style.setProperty("--db-tooltip-arrow-block-start",`${o}%`):v.endsWith("end")?t.style.setProperty("--db-tooltip-arrow-block-start",100-o+"%"):t.style.setProperty("--db-tooltip-arrow-block-start","50%")}if("right"===v||"left"===v)t.style.insetBlockStart=`${s+f/2}px`;else if("right-start"===v||"left-start"===v){const o=s+u;t.style.insetBlockStart=`${s}px`,t.style.insetBlockEnd=`${!p&&o>W?W:o}px`}else if("right-end"===v||"left-end"===v){const o=x-u;t.style.insetBlockStart=`${!p&&o<0?0:o}px`,t.style.insetBlockEnd=`${x}px`}else if("top"===v||"bottom"===v)t.style.insetInlineStart=`${$+b/2}px`;else if("top-start"===v||"bottom-start"===v){const o=$+g;t.style.insetInlineStart=`${$}px`,t.style.insetInlineEnd=`${!p&&o>w?w:o}px`}else if("top-end"===v||"bottom-end"===v){const o=m-g;t.style.insetInlineStart=`${!p&&o<0?0:o}px`,t.style.insetInlineEnd=`${m}px`}if(null==v?void 0:v.startsWith("right")){const o=m+g;t.style.insetInlineStart=`calc(${m}px + ${c})`,t.style.insetInlineEnd=`calc(${a&&o>w?w:o}px + ${c})`}else if(null==v?void 0:v.startsWith("left")){const o=$-g;t.style.insetInlineStart=`calc(${a&&o<0?0:o}px - ${c})`,t.style.insetInlineEnd=`calc(${m}px - ${c})`}else if(null==v?void 0:v.startsWith("top")){const o=s-u;t.style.insetBlockStart=`calc(${a&&o<0?0:o}px - ${c})`,t.style.insetBlockEnd=`calc(${p?o:x}px - ${c})`}else if(null==v?void 0:v.startsWith("bottom")){const o=x+u;t.style.insetBlockStart=`calc(${p?o:x}px + ${c})`,t.style.insetBlockEnd=`calc(${a&&o>W?W:o}px + ${c})`}t.style.position="fixed",t.dataset.correctedPlacement=v};export{o as a,l as b,e as g,t as h}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as i}from"./p-
|
|
1
|
+
import{h as i}from"./p-C0q9XJSc.js";const t=i=>{var t,s;const{target:h}=i;return Boolean(!(null===(t=null==h?void 0:h.classList)||void 0===t?void 0:t.contains("db-navigation-item-expand-button"))&&(null===(s=null==h?void 0:h.parentElement)||void 0===s?void 0:s.classList.contains("db-navigation-item")))};class s{constructor(i,t){var s;this.parentSubNavigation=null,this.initialized=!1,this.mouseX=0,this.mouseY=0,this.element=i,this.subNavigation=t,this.element&&this.subNavigation&&(this.parentSubNavigation=null===(s=this.element)||void 0===s?void 0:s.closest(".db-sub-navigation"),this.parentSubNavigation&&!this.element.closest(".db-drawer")&&this.init())}init(){var i,t,s;const h=null!==(t=null===(i=this.parentSubNavigation)||void 0===i?void 0:i.getBoundingClientRect().width)&&void 0!==t?t:0;null===(s=this.element)||void 0===s||s.style.setProperty("--db-navigation-item-inline-size",`${h}px`),this.initialized=!0}enableFollow(){var t,s;if(!this.initialized||this.triangleData||!this.element||!this.subNavigation)return;const h=i(this.subNavigation),n=this.element.getBoundingClientRect(),o=null!==(s=null===(t=this.parentSubNavigation)||void 0===t?void 0:t.getBoundingClientRect().width)&&void 0!==s?s:0;this.triangleData={itemRect:n,parentElementWidth:o,subNavigationHeight:this.subNavigation.getBoundingClientRect().height,padding:(o-n.width)/2,outsideVX:h.vx,outsideVY:h.vy}}disableFollow(){this.triangleData=void 0}getTriangleTipX(){return this.triangleData?"right"===this.triangleData.outsideVX?this.triangleData.itemRect.width-this.mouseX:Math.min(this.mouseX,.75*this.triangleData.itemRect.width):0}getTriangleTipY(){if(!this.triangleData)return 0;const i=Math.max(Math.min(this.mouseY,this.triangleData.itemRect.height),0)+this.triangleData.padding;return"bottom"===this.triangleData.outsideVY?i+(this.triangleData.subNavigationHeight-2*this.triangleData.padding-this.triangleData.itemRect.height):i}hasMouseEnteredSubNavigation(){if(!this.triangleData)return!1;const i="right"===this.triangleData.outsideVX;return!!(i&&this.mouseX<-1*this.triangleData.padding)||!i&&this.mouseX>this.triangleData.parentElementWidth-this.triangleData.padding}getTriangleCoordinates(i){if(!this.triangleData)return;if("fill-gap"===i){const i=`${this.triangleData.itemRect.height+2*this.triangleData.padding}px`,t=this.triangleData.parentElementWidth-this.triangleData.padding+"px";return{lb:`${t} ${i}`,lt:`${t} 0`,rt:"100% 0",rb:`100% ${i}`}}const t=this.getTriangleTipX(),s=this.getTriangleTipY();return{lb:`${t}px ${s}px`,lt:`${t}px ${s}px`,rt:"100% 0",rb:"100% 100%"}}followByMouseEvent(i){if(!(this.initialized&&this.triangleData&&this.element&&this.subNavigation))return;this.mouseX=i.clientX-this.triangleData.itemRect.left,this.mouseY=i.clientY-this.triangleData.itemRect.top;const t=this.hasMouseEnteredSubNavigation(),s=this.getTriangleCoordinates(t?"fill-gap":"safe-triangle");s&&(this.element.style.setProperty("--db-navigation-item-clip-path",`polygon(${s.lb}, ${s.lt}, ${s.rt}, ${s.rb})`),t&&(this.triangleData=void 0))}}export{s as N,t as i}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as t,H as s,A as e,z as o,j as a,d as i,t as n}from"./p-CYYSsu3p.js";import{m as d}from"./p-BdL-nI5y.js";import{d as c}from"./p-
|
|
1
|
+
import{y as t,H as s,A as e,z as o,j as a,d as i,t as n}from"./p-CYYSsu3p.js";import{m as d}from"./p-BdL-nI5y.js";import{d as c}from"./p-gIJnyld5.js";const h=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.remove=e(this,"remove"),this.observer=void 0}handleRemove(t){t&&(t.stopPropagation(),this.remove&&this.remove.emit(t))}getRemoveButtonText(){return this.removeButton?this.removeButton:d}setupObserver(t){if(!t)return;const s=t.closest("db-tag");s&&!this.observer&&(this.observer=new MutationObserver((s=>{s.some((t=>{var s;const e=t.target.attributes.getNamedItem(null!==(s=t.attributeName)&&void 0!==s?s:"");return(null==e?void 0:e.value)!==t.oldValue}))&&this.enableAttributePassing(t,"db-tag")})),this.observer.observe(s,{attributes:!0,attributeOldValue:!0}))}enableAttributePassing(t,s){const e=null==t?void 0:t.closest(s);if(t&&e){const s=e.attributes;for(let o=0;o<s.length;o++){const a=s.item(o);if(a&&"data-density"!==a.name&&(a.name.startsWith("data-")||a.name.startsWith("aria-")))a.value?t.setAttribute(a.name,a.value):t.removeAttribute(a.name),e.removeAttribute(a.name);else if(a&&["style"].includes(a.name))t.setAttribute(a.name,a.value),e.removeAttribute(a.name);else if(a&&"class"===a.name){const s=a.value.includes("hydrated"),o=a.value.replace("hydrated","").trim(),i=t.getAttribute("class");t.setAttribute(a.name,`${i||""}${o?` ${o}`:""}`),s?e.setAttribute("class","hydrated"):e.removeAttribute(a.name)}}}}componentDidLoad(){if("undefined"!=typeof document&&this.rootElement&&this.rootElement.dataset.connect){const t=document.querySelector(`[data-connect-id="${this.rootElement.dataset.connect}"]`);t&&t.remove()}this.enableAttributePassing(this._ref,"db-tag"),this.setupObserver(this._ref)}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect()}render(){var t,s,e;return o("div",{key:"bf503e6e826fcb53cfc057b1f2610d062967311e",class:i("db-tag",this.className),ref:t=>{this._ref=t},id:null!==(t=this.id)&&void 0!==t?t:null===(s=this.propOverrides)||void 0===s?void 0:s.id,"data-semantic":this.semantic,"data-emphasis":this.emphasis,"data-icon":this.icon,"data-show-check-state":a(null===(e=this.showCheckState)||void 0===e||e,"showCheckState"),"data-show-icon":a(this.showIcon,"showIcon"),"data-no-text":a(this.noText,"noText"),"data-overflow":a(this.overflow,"overflow")},o("slot",{key:"d047f3f96e38b36f4d8f43cfb316d1571ebdd9ba",name:"content"}),this.text?this.text:null,o("slot",{key:"b2356b4e384b61ac2844bdb4a8c2f9c4e5b9f153"}),"removable"===this.behavior?o("button",{class:"db-button db-tab-remove-button","data-icon":"cross","data-size":"small","data-no-text":"true","data-variant":"ghost",type:"button",onClick:t=>this.handleRemove(t)},o("db-tooltip",{variant:"label"},this.getRemoveButtonText())):null)}get rootElement(){return this}},[260,"db-tag",{removeButton:[1,"remove-button"],id:[1],propOverrides:[16],className:[1,"classname"],semantic:[1],emphasis:[1],icon:[1],showCheckState:[8,"show-check-state"],showIcon:[8,"show-icon"],noText:[8,"no-text"],overflow:[8],text:[1],behavior:[1],observer:[32]}]);function r(){"undefined"!=typeof customElements&&["db-tag","db-tooltip"].forEach((t=>{switch(t){case"db-tag":customElements.get(n(t))||customElements.define(n(t),h);break;case"db-tooltip":customElements.get(n(t))||c()}}))}export{h as D,r as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{y as t,H as i,f as s,u as e,z as a,j as o,d as h,t as d}from"./p-CYYSsu3p.js";import{D as n}from"./p-BdL-nI5y.js";import{D as l}from"./p-DJTpgiBy.js";import{b as r}from"./p-
|
|
1
|
+
import{y as t,H as i,f as s,u as e,z as a,j as o,d as h,t as d}from"./p-CYYSsu3p.js";import{D as n}from"./p-BdL-nI5y.js";import{D as l}from"./p-DJTpgiBy.js";import{b as r}from"./p-C0q9XJSc.js";const c=t(class extends i{constructor(t){super(),!1!==t&&this.__registerHost(),this._id=n,this.initialized=!1,this._documentScrollListenerCallbackId=void 0,this._observer=void 0,this._attachedParent=void 0,this._attachedId=void 0,this._activeTriggerCount=0,this._boundListeners=[],this.observer=void 0}handleClick(t){t.stopPropagation()}handleEscape(t){t&&"Escape"!==t.key||!this._ref||"visible"!==getComputedStyle(this._ref).visibility||this.getParent().blur()}getParent(){let t=this._ref.parentElement;return t&&t.localName.includes("tooltip")&&(t=t.parentElement),t}handleAutoPlacement(t){t&&this._ref&&s((()=>{var i;this._ref&&r(this._ref,t,null!==(i=this.placement)&&void 0!==i?i:"bottom")}),1)}handleDocumentScroll(t,i){var s,e;(null===(s=null==t?void 0:t.target)||void 0===s?void 0:s.contains)&&(null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.contains(this._ref))&&this.handleAutoPlacement(i)}handleLeave(){var t,i,s;this._activeTriggerCount=Math.max((null!==(t=this._activeTriggerCount)&&void 0!==t?t:0)-1,0),(null!==(i=this._activeTriggerCount)&&void 0!==i?i:0)>0||(this._documentScrollListenerCallbackId&&((new l).removeCallback(this._documentScrollListenerCallbackId),this._documentScrollListenerCallbackId=void 0),null===(s=this._observer)||void 0===s||s.unobserve(this.getParent()))}handleEnter(t){var i,s;this._activeTriggerCount=(null!==(i=this._activeTriggerCount)&&void 0!==i?i:0)+1,1===this._activeTriggerCount&&(this._documentScrollListenerCallbackId=(new l).addCallback((i=>this.handleDocumentScroll(i,t))),null===(s=this._observer)||void 0===s||s.observe(this.getParent())),this.handleAutoPlacement(t)}resetIds(){var t,i,s;this._id=null!==(s=null!==(t=this.id)&&void 0!==t?t:null===(i=this.propOverrides)||void 0===i?void 0:i.id)&&void 0!==s?s:"tooltip-"+e()}_detachListeners(){var t,i,s;const e=this._documentScrollListenerCallbackId;e&&((new l).removeCallback(e),this._documentScrollListenerCallbackId=void 0),null===(t=this._observer)||void 0===t||t.disconnect(),this._observer=void 0,this._activeTriggerCount=0,(null!==(i=this._boundListeners)&&void 0!==i?i:[]).forEach((t=>{t.parent.removeEventListener(t.type,t.fn)})),this._boundListeners=[];const a=this._attachedParent;if(a){const t=null!==(s=this._attachedId)&&void 0!==s?s:this._id,i=a.querySelectorAll(".db-tooltip"),e=Array.from(i).some((t=>t!==this._ref));"true"!==a.dataset.hasTooltip||e||delete a.dataset.hasTooltip,a.getAttribute("aria-labelledby")===t&&a.removeAttribute("aria-labelledby"),a.getAttribute("aria-describedby")===t&&a.removeAttribute("aria-describedby"),this._attachedParent=void 0,this._attachedId=void 0}}setupObserver(t){if(!t)return;const i=t.closest("db-tooltip");i&&!this.observer&&(this.observer=new MutationObserver((i=>{i.some((t=>{var i;const s=t.target.attributes.getNamedItem(null!==(i=t.attributeName)&&void 0!==i?i:"");return(null==s?void 0:s.value)!==t.oldValue}))&&this.enableAttributePassing(t,"db-tooltip")})),this.observer.observe(i,{attributes:!0,attributeOldValue:!0}))}enableAttributePassing(t,i){const s=null==t?void 0:t.closest(i);if(t&&s){const i=s.attributes;for(let e=0;e<i.length;e++){const a=i.item(e);if(a&&"data-density"!==a.name&&(a.name.startsWith("data-")||a.name.startsWith("aria-")))a.value?t.setAttribute(a.name,a.value):t.removeAttribute(a.name),s.removeAttribute(a.name);else if(a&&["style"].includes(a.name))t.setAttribute(a.name,a.value),s.removeAttribute(a.name);else if(a&&"class"===a.name){const i=a.value.includes("hydrated"),e=a.value.replace("hydrated","").trim(),o=t.getAttribute("class");t.setAttribute(a.name,`${o||""}${e?` ${e}`:""}`),i?s.setAttribute("class","hydrated"):s.removeAttribute(a.name)}}}}watch0Fn(){var t,i;(null!==(t=this.id)&&void 0!==t?t:null===(i=this.propOverrides)||void 0===i?void 0:i.id)&&this.resetIds()}watch0(){this.watch0Fn()}watch1Fn(){var t;if(this._ref&&this.initialized&&this._id){const i=this.getParent();if(i){this.handleAutoPlacement(i);const s=()=>this.handleEnter(i),e=()=>this.handleLeave(),a=t=>this.handleEscape(t);i.addEventListener("mouseenter",s),i.addEventListener("focusin",s),i.addEventListener("keydown",a),i.addEventListener("mouseleave",e),i.addEventListener("focusout",e),this._boundListeners=[...null!==(t=this._boundListeners)&&void 0!==t?t:[],{parent:i,type:"mouseenter",fn:s},{parent:i,type:"focusin",fn:s},{parent:i,type:"keydown",fn:a},{parent:i,type:"mouseleave",fn:e},{parent:i,type:"focusout",fn:e}],i.dataset.hasTooltip="true",i.setAttribute("label"===this.variant?"aria-labelledby":"aria-describedby",this._id),this._attachedParent=i,this._attachedId=this._id}"undefined"!=typeof window&&"IntersectionObserver"in window&&(this._observer=new IntersectionObserver((t=>{const i=t.find((({target:t})=>t===this.getParent()));i&&!i.isIntersecting&&this.handleEscape(!1)}))),this.initialized=!1}}watch1(){this.watch1Fn()}componentDidLoad(){if("undefined"!=typeof document&&this.rootElement&&this.rootElement.dataset.connect){const t=document.querySelector(`[data-connect-id="${this.rootElement.dataset.connect}"]`);t&&t.remove()}this.enableAttributePassing(this._ref,"db-tooltip"),(()=>{this.resetIds(),this.initialized=!0})(),(()=>{this.setupObserver(this._ref)})(),this.watch0Fn(),this.watch1Fn()}disconnectedCallback(){var t;this._detachListeners(),null===(t=this.observer)||void 0===t||t.disconnect()}render(){var t,i;return a("i",{key:"a35fc9349a599145e2ea2287aa6467500854fadd",class:h("db-tooltip",this.className),role:"tooltip","aria-hidden":"true","data-gap":"true",ref:t=>{this._ref=t},id:this._id,"data-emphasis":this.emphasis,"data-wrap":o(this.wrap,"wrap"),"data-animation":o(null===(t=this.animation)||void 0===t||t,"animation"),"data-delay":this.delay,"data-width":this.width,"data-show-arrow":o(null===(i=this.showArrow)||void 0===i||i,"showArrow"),"data-placement":this.placement,onClick:t=>this.handleClick(t)},this.text?this.text:null,a("slot",{key:"63d102dc8c4c4022c2dc3bad582f0167635adcb2"}))}get rootElement(){return this}static get watchers(){return{id:[{watch0:0}],"propOverrides?.id":[{watch0:0}],_ref:[{watch1:0}],initialized:[{watch1:0}],_id:[{watch1:0}]}}},[260,"db-tooltip",{id:[1],propOverrides:[16],variant:[1],placement:[1],className:[1,"classname"],emphasis:[1],wrap:[8],animation:[8],delay:[1],width:[1],showArrow:[8,"show-arrow"],text:[1],_id:[32],initialized:[32],_documentScrollListenerCallbackId:[32],_observer:[32],_attachedParent:[32],_attachedId:[32],_activeTriggerCount:[32],_boundListeners:[32],observer:[32]},void 0,{id:[{watch0:0}],"propOverrides?.id":[{watch0:0}],_ref:[{watch1:0}],initialized:[{watch1:0}],_id:[{watch1:0}]}]);function u(){"undefined"!=typeof customElements&&["db-tooltip"].forEach((t=>{"db-tooltip"===t&&(customElements.get(d(t))||customElements.define(d(t),c))}))}export{c as D,u as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y as t,H as s,A as i,k as e,z as c,j as h,d as a,t as o}from"./p-CYYSsu3p.js";const l=t(class extends s{constructor(t){super(),!1!==t&&this.__registerHost(),this.change=i(this,"change"),this.hasDivider=!1,this.observer=void 0}handleChange(t){t.stopPropagation(),this.change&&this.change.emit(t)}getIconTrailing(){if(!this.isGroupTitle&&"checkbox"!==this.type)return e(this.checked,"checked")?"check":"x_placeholder"}setupObserver(t){if(!t)return;const s=t.closest("db-custom-select-list-item");s&&!this.observer&&(this.observer=new MutationObserver((s=>{s.some((t=>{var s;const i=t.target.attributes.getNamedItem(null!==(s=t.attributeName)&&void 0!==s?s:"");return(null==i?void 0:i.value)!==t.oldValue}))&&this.enableAttributePassing(t,"db-custom-select-list-item")})),this.observer.observe(s,{attributes:!0,attributeOldValue:!0}))}enableAttributePassing(t,s){const i=null==t?void 0:t.closest(s);if(t&&i){const s=i.attributes;for(let e=0;e<s.length;e++){const c=s.item(e);if(c&&"data-density"!==c.name&&(c.name.startsWith("data-")||c.name.startsWith("aria-")))c.value?t.setAttribute(c.name,c.value):t.removeAttribute(c.name),i.removeAttribute(c.name);else if(c&&["style"].includes(c.name))t.setAttribute(c.name,c.value),i.removeAttribute(c.name);else if(c&&"class"===c.name){const s=c.value.includes("hydrated"),e=c.value.replace("hydrated","").trim(),h=t.getAttribute("class");t.setAttribute(c.name,`${h||""}${e?` ${e}`:""}`),s?i.setAttribute("class","hydrated"):i.removeAttribute(c.name)}}}}watch0Fn(){this.hasDivider=Boolean(this.isGroupTitle||this.showDivider)}watch0(){this.watch0Fn()}componentDidLoad(){if("undefined"!=typeof document&&this.rootElement&&this.rootElement.dataset.connect){const t=document.querySelector(`[data-connect-id="${this.rootElement.dataset.connect}"]`);t&&t.remove()}this.enableAttributePassing(this._ref,"db-custom-select-list-item"),this.setupObserver(this._ref),this.watch0Fn()}disconnectedCallback(){var t;null===(t=this.observer)||void 0===t||t.disconnect()}render(){var t,s;return c("li",{key:"95e2aeea15f86890868013ddb33a6b365d814fc4",class:a("db-custom-select-list-item",this.className,{"db-checkbox":"checkbox"===this.type&&!this.isGroupTitle,"db-radio":"checkbox"!==this.type&&!this.isGroupTitle}),ref:t=>{this._ref=t},id:null!==(t=this.id)&&void 0!==t?t:null===(s=this.propOverrides)||void 0===s?void 0:s.id,"data-divider":h(this.hasDivider,"hasDivider")},this.isGroupTitle?c("span",null,this.groupTitle):c("label",{"data-icon":"checkbox"!==this.type&&this.icon?this.icon:void 0,"data-show-icon":h(this.showIcon,"showIcon"),"data-icon-trailing":this.getIconTrailing()},c("input",{class:"db-custom-select-list-item-checkbox","data-disable-focus":"true",type:this.type,name:this.name,form:this.name,checked:e(this.checked,"checked"),disabled:e(this.disabled,"disabled"),value:this.value,onChange:t=>this.handleChange(t)}),c("span",{class:"db-custom-select-list-item-label"},this.label?this.label:null,c("slot",null))))}get rootElement(){return this}static get watchers(){return{isGroupTitle:[{watch0:0}],showDivider:[{watch0:0}]}}},[260,"db-custom-select-list-item",{isGroupTitle:[4,"is-group-title"],showDivider:[4,"show-divider"],type:[1],checked:[8],id:[1],propOverrides:[16],className:[1,"classname"],groupTitle:[1,"group-title"],icon:[1],showIcon:[8,"show-icon"],name:[1],disabled:[8],value:[8],label:[1],hasDivider:[32],observer:[32]},void 0,{isGroupTitle:[{watch0:0}],showDivider:[{watch0:0}]}]);function d(){"undefined"!=typeof customElements&&["db-custom-select-list-item"].forEach((t=>{"db-custom-select-list-item"===t&&(customElements.get(o(t))||customElements.define(o(t),l))}))}export{l as D,d}
|
|
@@ -292,7 +292,7 @@ const DBCustomSelectListItem = class {
|
|
|
292
292
|
"db-radio": this.type !== "checkbox" && !this.isGroupTitle,
|
|
293
293
|
}), ref: (el) => {
|
|
294
294
|
this._ref = el;
|
|
295
|
-
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-divider": index$1.getBooleanAsString(this.hasDivider, "hasDivider") }, !this.isGroupTitle ? (index.h("label", { "data-icon": this.type !== "checkbox" && this.icon ? this.icon : undefined, "data-show-icon": index$1.getBooleanAsString(this.showIcon, "showIcon"), "data-icon-trailing": this.getIconTrailing() }, index.h("input", { class: "db-custom-select-list-item-checkbox", "data-disable-focus": "true", type: this.type, name: this.name, form: this.name, checked: index$1.getBoolean(this.checked, "checked"), disabled: index$1.getBoolean(this.disabled, "disabled"), value: this.value, onChange: (event) => this.handleChange(event) }), this.label ? this.label : null, index.h("slot", null))) : (index.h("span", null, this.groupTitle))));
|
|
295
|
+
}, id: (_a = this.id) !== null && _a !== void 0 ? _a : (_b = this.propOverrides) === null || _b === void 0 ? void 0 : _b.id, "data-divider": index$1.getBooleanAsString(this.hasDivider, "hasDivider") }, !this.isGroupTitle ? (index.h("label", { "data-icon": this.type !== "checkbox" && this.icon ? this.icon : undefined, "data-show-icon": index$1.getBooleanAsString(this.showIcon, "showIcon"), "data-icon-trailing": this.getIconTrailing() }, index.h("input", { class: "db-custom-select-list-item-checkbox", "data-disable-focus": "true", type: this.type, name: this.name, form: this.name, checked: index$1.getBoolean(this.checked, "checked"), disabled: index$1.getBoolean(this.disabled, "disabled"), value: this.value, onChange: (event) => this.handleChange(event) }), index.h("span", { class: "db-custom-select-list-item-label" }, this.label ? this.label : null, index.h("slot", null)))) : (index.h("span", null, this.groupTitle))));
|
|
296
296
|
}
|
|
297
297
|
get rootElement() { return index.getElement(this); }
|
|
298
298
|
static get watchers() { return {
|
|
@@ -5,7 +5,7 @@ var constants = require('./constants-bMY2_d8A.js');
|
|
|
5
5
|
var index$1 = require('./index-spuu3sXz.js');
|
|
6
6
|
var documentClickListener = require('./document-click-listener-DdNXbErU.js');
|
|
7
7
|
var documentScrollListener = require('./document-scroll-listener-CvAZ6uPr.js');
|
|
8
|
-
var floatingComponents = require('./floating-components-
|
|
8
|
+
var floatingComponents = require('./floating-components-SpHkZuLA.js');
|
|
9
9
|
var formComponents = require('./form-components-CmQlkARp.js');
|
|
10
10
|
|
|
11
11
|
const DBCustomSelect = class {
|
|
@@ -433,6 +433,7 @@ const DBCustomSelect = class {
|
|
|
433
433
|
}
|
|
434
434
|
}
|
|
435
435
|
handleSearch(valueOrEvent) {
|
|
436
|
+
var _a;
|
|
436
437
|
if (valueOrEvent === undefined) {
|
|
437
438
|
return;
|
|
438
439
|
}
|
|
@@ -461,6 +462,9 @@ const DBCustomSelect = class {
|
|
|
461
462
|
.toLowerCase()
|
|
462
463
|
.includes(filterText.toLowerCase()));
|
|
463
464
|
}
|
|
465
|
+
if ((_a = this.detailsRef) === null || _a === void 0 ? void 0 : _a.open) {
|
|
466
|
+
this.handleAutoPlacement();
|
|
467
|
+
}
|
|
464
468
|
}
|
|
465
469
|
handleClearAll(event) {
|
|
466
470
|
event.stopPropagation();
|
|
@@ -690,10 +694,14 @@ const DBCustomSelect = class {
|
|
|
690
694
|
this.watch11Fn();
|
|
691
695
|
}
|
|
692
696
|
watch12Fn() {
|
|
693
|
-
var _a, _b;
|
|
697
|
+
var _a, _b, _c;
|
|
694
698
|
this._options = this.options;
|
|
695
699
|
this.amountOptions =
|
|
696
700
|
(_b = (_a = this.options) === null || _a === void 0 ? void 0 : _a.filter((option) => !option.isGroupTitle).length) !== null && _b !== void 0 ? _b : 0;
|
|
701
|
+
// Reposition open auto-width dropdowns: replacing options can change their content width.
|
|
702
|
+
if ((_c = this.detailsRef) === null || _c === void 0 ? void 0 : _c.open) {
|
|
703
|
+
this.handleAutoPlacement();
|
|
704
|
+
}
|
|
697
705
|
}
|
|
698
706
|
watch12() {
|
|
699
707
|
this.watch12Fn();
|
|
@@ -834,19 +842,19 @@ const DBCustomSelect = class {
|
|
|
834
842
|
}
|
|
835
843
|
render() {
|
|
836
844
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
837
|
-
return (index.h("div", { key: '
|
|
845
|
+
return (index.h("div", { key: '9f804bd057ef9cde5cc83263e5b1e3a477ad5d2e', class: index$1.cls("db-custom-select", this.className), id: this._id, ref: (el) => {
|
|
838
846
|
this._ref = el;
|
|
839
847
|
}, "aria-invalid": this._validity === "invalid", "data-custom-validity": this._validity, "data-width": this.formFieldWidth, "data-variant": this.variant === "floating" &&
|
|
840
848
|
this.selectedType === "tag" &&
|
|
841
849
|
this.multiple
|
|
842
850
|
? "above"
|
|
843
|
-
: this.variant, "data-required": index$1.getBooleanAsString(this.required, "required"), "data-hide-asterisk": index$1.getHideProp(this.showRequiredAsterisk), "data-placement": this.placement, "data-selected-type": this.multiple ? this.selectedType : "text", "data-hide-label": index$1.getHideProp(this.showLabel), "data-icon": this.icon, "data-show-icon": index$1.getBooleanAsString(this.showIcon, "showIcon") }, index.h("label", { key: '
|
|
851
|
+
: this.variant, "data-required": index$1.getBooleanAsString(this.required, "required"), "data-hide-asterisk": index$1.getHideProp(this.showRequiredAsterisk), "data-placement": this.placement, "data-selected-type": this.multiple ? this.selectedType : "text", "data-hide-label": index$1.getHideProp(this.showLabel), "data-icon": this.icon, "data-show-icon": index$1.getBooleanAsString(this.showIcon, "showIcon") }, index.h("label", { key: '1ce826237b63c3abfad8b55068c25fdc4acc2d7a', id: this._labelId }, (_a = this.label) !== null && _a !== void 0 ? _a : constants.DEFAULT_LABEL, index.h("select", { key: '9f16da6b3d9e633e4ce70e8654925df86a901074', role: "none", hidden: true, id: this._selectId, tabIndex: -1, ref: (el) => {
|
|
844
852
|
this.selectRef = el;
|
|
845
853
|
}, form: this.form, name: this.name, "data-custom-validity": this._validity, multiple: index$1.getBoolean(this.multiple, "multiple"), disabled: index$1.getBoolean(this.disabled, "disabled"), required: index$1.getBoolean(this.required, "required"), onChange: (event) => this.satisfyReact(event) }, ((_b = this.options) === null || _b === void 0 ? void 0 : _b.length)
|
|
846
854
|
? (_c = this.options) === null || _c === void 0 ? void 0 : _c.map((option) => (index.h("option", { disabled: option.disabled, value: option.value, key: undefined }, this.getOptionLabel(option))))
|
|
847
|
-
: null)), index.h("details", { key: '
|
|
855
|
+
: null)), index.h("details", { key: '6a88c236898236ee539bced6fa3b3918be8f693d', ref: (el) => {
|
|
848
856
|
this.detailsRef = el;
|
|
849
|
-
}, open: this.open, onToggle: (event) => this.handleDropdownToggle(event), onKeyDown: (event) => this.handleKeyboardPress(event) }, index.h("slot", { key: '
|
|
857
|
+
}, open: this.open, onToggle: (event) => this.handleDropdownToggle(event), onKeyDown: (event) => this.handleKeyboardPress(event) }, index.h("slot", { key: 'c9dd3e30dd094da51de1b2064749a211fef6eb36' }), this.options ? (index.h(index.Fragment, null, index.h("summary", { class: "db-custom-select-form-field", id: this._summaryId, "aria-disabled": index$1.getBooleanAsString(this.disabled, "disabled"), tabIndex: this.disabled ? -1 : undefined, "aria-labelledby": this._labelId }, ((_d = this._selectedLabels) === null || _d === void 0 ? void 0 : _d.length) ? (index.h("span", { "data-visually-hidden": index$1.getBooleanAsString(this.selectedType === "tag", "selectedType"), id: this._selectedLabelsId }, this.selectedPrefix ? (index.h("span", { "data-visually-hidden": "true" }, this.selectedPrefix)) : null, this._selectedLabels)) : null, this.selectedType === "tag" ? (index.h("div", null, (_e = this._selectedOptions) === null || _e === void 0 ? void 0 : _e.map((option) => (index.h("db-tag", { emphasis: "strong", behavior: "removable", removeButton: this.getTagRemoveLabel(option), onRemove: (event) => this.handleTagRemove(option, event), key: undefined }, this.getOptionLabel(option)))))) : null), index.h("db-custom-select-dropdown", { width: this.dropdownWidth }, this.searchEnabled ? (index.h("div", null, index.h("db-input", { type: "search", ref: (el) => {
|
|
850
858
|
this.searchInputRef = el;
|
|
851
859
|
}, name: this._id, form: this._id, showLabel: false, value: this._searchValue, label: (_f = this.searchLabel) !== null && _f !== void 0 ? _f : constants.DEFAULT_LABEL, placeholder: (_g = this.searchPlaceholder) !== null && _g !== void 0 ? _g : this.searchLabel, ariaDescribedBy: this._hasNoOptions || this.showLoading
|
|
852
860
|
? this._infoTextId
|
|
@@ -856,7 +864,7 @@ const DBCustomSelect = class {
|
|
|
856
864
|
this.selectAllRef = el;
|
|
857
865
|
}, form: this._id, checked: this.selectAllChecked, onChange: (event) => this.handleSelectAll(event) }), this.getSelectAllLabel())))) : null, index.h("db-custom-select-list", { multiple: index$1.getBoolean(this.multiple, "multiple"), label: (_k = (_j = this.listLabel) !== null && _j !== void 0 ? _j : this.label) !== null && _k !== void 0 ? _k : constants.DEFAULT_LABEL }, (_l = this._options) === null || _l === void 0 ? void 0 : _l.map((option) => (index.h("db-custom-select-list-item", { type: this.multiple ? "checkbox" : "radio", showDivider: option.showDivider, icon: option.icon, isGroupTitle: option.isGroupTitle, groupTitle: this.getOptionLabel(option), name: this._id, checked: this.getOptionChecked(option.value), disabled: option.disabled, value: option.value, onChange: () => this.handleSelect(option.value), key: undefined }, !option.isGroupTitle
|
|
858
866
|
? this.getOptionLabel(option)
|
|
859
|
-
: null)))))), index.h("div", null, index.h("db-button", { variant: "ghost", width: "full", icon: "cross", size: "small", name: this._id, form: this._id, onClick: () => this.handleClose(undefined, true) }, (_m = this.mobileCloseButtonText) !== null && _m !== void 0 ? _m : constants.DEFAULT_CLOSE_BUTTON))))) : null), ((_o = this.showClearSelection) !== null && _o !== void 0 ? _o : true) && ((_p = this._values) === null || _p === void 0 ? void 0 : _p.length) ? (index.h("db-button", { icon: "cross", variant: "ghost", size: "small", noText: true, name: this._id, form: this._id, disabled: index$1.getBoolean(this.disabled, "disabled"), onClick: (event) => this.handleClearAll(event) }, this.clearSelectionText, index.h("db-tooltip", { placement: "top" }, this.clearSelectionText))) : null, index.h("span", { key: '
|
|
867
|
+
: null)))))), index.h("div", null, index.h("db-button", { variant: "ghost", width: "full", icon: "cross", size: "small", name: this._id, form: this._id, onClick: () => this.handleClose(undefined, true) }, (_m = this.mobileCloseButtonText) !== null && _m !== void 0 ? _m : constants.DEFAULT_CLOSE_BUTTON))))) : null), ((_o = this.showClearSelection) !== null && _o !== void 0 ? _o : true) && ((_p = this._values) === null || _p === void 0 ? void 0 : _p.length) ? (index.h("db-button", { icon: "cross", variant: "ghost", size: "small", noText: true, name: this._id, form: this._id, disabled: index$1.getBoolean(this.disabled, "disabled"), onClick: (event) => this.handleClearAll(event) }, this.clearSelectionText, index.h("db-tooltip", { placement: "top" }, this.clearSelectionText))) : null, index.h("span", { key: '3210abcd9df6f8232346aa78def9e3bd078f35db', class: "db-custom-select-placeholder", "aria-hidden": "true", id: this._placeholderId }, (_q = this.placeholder) !== null && _q !== void 0 ? _q : this.label), index$1.stringPropVisible(this.message, this.showMessage) ? (index.h("db-infotext", { size: "small", icon: this.messageIcon, id: this._messageId }, this.message)) : null, this.hasValidState() ? (index.h("db-infotext", { size: "small", semantic: "successful", id: this._validMessageId }, this.validMessage || constants.DEFAULT_VALID_MESSAGE)) : null, index.h("db-infotext", { key: 'a552df2b93f899230e80623e2014691e411c3b40', size: "small", semantic: "critical", id: this._invalidMessageId }, this._invalidMessage), index.h("span", { key: 'b29045acf1f702b90b434dc4aa9d589c0c6c57f5', "data-visually-hidden": "true", role: "status" }, this._voiceOverFallback)));
|
|
860
868
|
}
|
|
861
869
|
get rootElement() { return index.getElement(this); }
|
|
862
870
|
static get watchers() { return {
|