@trendyol/baklava 3.4.0-beta.1 → 3.4.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/baklava.js +1 -1
- package/dist/{chunk-2IJL7HNY.js → chunk-4XJNC424.js} +25 -13
- package/dist/chunk-4XJNC424.js.map +7 -0
- package/dist/{chunk-GFBXJPT6.js → chunk-RQOF4US5.js} +7 -6
- package/dist/{chunk-GFBXJPT6.js.map → chunk-RQOF4US5.js.map} +2 -2
- package/dist/components/datepicker/bl-datepicker.d.ts.map +1 -1
- package/dist/components/datepicker/bl-datepicker.js +1 -1
- package/dist/components/pagination/bl-pagination.js +1 -1
- package/dist/components/select/bl-select.d.ts +1 -0
- package/dist/components/select/bl-select.d.ts.map +1 -1
- package/dist/components/select/bl-select.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-2IJL7HNY.js.map +0 -7
package/dist/baklava.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as q}from"./chunk-EZJ3WW6Y.js";import{b as N}from"./chunk-GISZRI4I.js";import{b as z}from"./chunk-JC4VETUE.js";import{b as j}from"./chunk-5EAI6722.js";import{b as O}from"./chunk-Y2Q465TD.js";import{b as y}from"./chunk-J5YZ4HBV.js";import{b as v}from"./chunk-P5TOP3NH.js";import{a as F}from"./chunk-G4DOH6BQ.js";import{a as D}from"./chunk-STZJ3LBU.js";import{a as t}from"./chunk-APLBTZ36.js";import{a as T}from"./chunk-QDYWH7BU.js";import{c as b,f as P}from"./chunk-IKYI4JCF.js";import{b as R}from"./chunk-4BLKAURK.js";import{a as C}from"./chunk-5TPDRTCU.js";import{a as g}from"./chunk-WPESQSKX.js";import{a as w}from"./chunk-QF4LGACD.js";import{a as s}from"./chunk-MWG4TBH7.js";import{b as G,d as k,f as A}from"./chunk-NXVLNG4L.js";import{b as S}from"./chunk-HYBPEELZ.js";import{b as H}from"./chunk-SBCJY5IU.js";import{a as c}from"./chunk-H4WETBHJ.js";import{a as i}from"./chunk-
|
|
1
|
+
import{b as q}from"./chunk-EZJ3WW6Y.js";import{b as N}from"./chunk-GISZRI4I.js";import{b as z}from"./chunk-JC4VETUE.js";import{b as j}from"./chunk-5EAI6722.js";import{b as O}from"./chunk-Y2Q465TD.js";import{b as y}from"./chunk-J5YZ4HBV.js";import{b as v}from"./chunk-P5TOP3NH.js";import{a as F}from"./chunk-G4DOH6BQ.js";import{a as D}from"./chunk-STZJ3LBU.js";import{a as t}from"./chunk-APLBTZ36.js";import{a as T}from"./chunk-QDYWH7BU.js";import{c as b,f as P}from"./chunk-IKYI4JCF.js";import{b as R}from"./chunk-4BLKAURK.js";import{a as C}from"./chunk-5TPDRTCU.js";import{a as g}from"./chunk-WPESQSKX.js";import{a as w}from"./chunk-QF4LGACD.js";import{a as s}from"./chunk-MWG4TBH7.js";import{b as G,d as k,f as A}from"./chunk-NXVLNG4L.js";import{b as S}from"./chunk-HYBPEELZ.js";import{b as H}from"./chunk-SBCJY5IU.js";import{a as c}from"./chunk-H4WETBHJ.js";import{a as i}from"./chunk-4XJNC424.js";import{a as n}from"./chunk-RER7OLAQ.js";import{b as u,e as x}from"./chunk-MWFGDECP.js";import{a as J}from"./chunk-RQOF4US5.js";import{a as h}from"./chunk-DE3A37FL.js";import{b as I}from"./chunk-UOGCEUXK.js";import"./chunk-EZSEQHRH.js";import{a as m}from"./chunk-WC5CTIZH.js";import"./chunk-23PSWIUF.js";import{b as E}from"./chunk-OTAAXK2L.js";import"./chunk-IPYZIIRV.js";import"./chunk-WEEGH2F4.js";import"./chunk-EG7U7PM3.js";import"./chunk-XDUIVR6I.js";import"./chunk-HZ6A5QFC.js";import"./chunk-AYJMIZZ3.js";import{a as B}from"./chunk-QKII4FCI.js";import{b as d}from"./chunk-4UO3W4WP.js";import{b as p}from"./chunk-ZE7GYACV.js";import"./chunk-6LT7O7T2.js";import"./chunk-HBPBDC7T.js";import{a as o}from"./chunk-ZLJF4SVG.js";import{a as l}from"./chunk-ERL6CBPO.js";import"./chunk-ECPWEUBG.js";import"./chunk-DINNT5P2.js";import{a as f}from"./chunk-T5MEA7JO.js";import{a as e,b as a,c as r}from"./chunk-BH64QNLE.js";import"./chunk-GRL4DWKG.js";import"./chunk-3USCFSFQ.js";import"./chunk-7GK5LKBV.js";import"./chunk-5MOOXA2X.js";import"./chunk-4OT5AMS5.js";import"./chunk-IZ2LK5GK.js";export{t as BlAccordion,o as BlAccordionGroup,l as BlAlert,f as BlBadge,d as BlButton,E as BlCalendar,u as BlCheckbox,x as BlCheckboxGroup,J as BlDatePicker,B as BlDialog,s as BlDrawer,A as BlDropdown,S as BlDropdownGroup,k as BlDropdownItem,r as BlIcon,m as BlInput,H as BlNotification,N as BlNotificationCard,c as BlPagination,I as BlPopover,T as BlProgressIndicator,b as BlRadio,P as BlRadioGroup,i as BlSelect,n as BlSelectOption,p as BlSpinner,G as BlSplitButton,R as BlSwitch,g as BlTab,C as BlTabGroup,w as BlTabPanel,v as BlTable,O as BlTableBody,z as BlTableCell,y as BlTableHeader,q as BlTableHeaderCell,j as BlTableRow,F as BlTag,D as BlTextarea,h as BlTooltip,a as getIconPath,e as setIconPath};
|
|
2
2
|
//# sourceMappingURL=baklava.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as $}from"./chunk-EG7U7PM3.js";import{a as k}from"./chunk-XDUIVR6I.js";import{a as f}from"./chunk-6LT7O7T2.js";import{a as z,c as b}from"./chunk-HBPBDC7T.js";import{a as y}from"./chunk-ECPWEUBG.js";import{a as x}from"./chunk-DINNT5P2.js";import{a as m}from"./chunk-GRL4DWKG.js";import{a as T,b as a,c as h,e as v,f as S}from"./chunk-5MOOXA2X.js";import{a as w,b as d,f as g}from"./chunk-4OT5AMS5.js";import{d as o}from"./chunk-IZ2LK5GK.js";var R=w`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-neutral-full);--border-color:var(--bl-color-neutral-lighter);--border-focus-color:var(--bl-color-primary-highlight);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--label-color:var(--bl-color-neutral-dark);--placeholder-color:var(--bl-color-neutral-light);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-neutral-lightest);--menu-height:250px;--popover-position:var(--bl-popover-position, fixed)}:host([multiple][view-select-all]) .select-wrapper{--menu-height:290px}:host([size=large]) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size=small]) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-neutral-light)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-highlight);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);-webkit-user-select:none;user-select:none;margin:0;width:auto;min-width:100%}.label,.placeholder{color:var(--placeholder-color);padding-inline-start:var(--label-padding);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.select-wrapper.selected .placeholder,:host(:not([placeholder])) .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}:host(:not([label])) .label,:host([label-fixed]) .label{display:none}.remove-all{display:none}.selected .remove-all{display:block}:host([disabled]) .remove-all,:host([disabled]) .remove-all::after{display:none}.dropdown-icon{font-size:var(--bl-font-size-m)}.dropdown-icon.open{display:none}.select-open .dropdown-icon.open{display:inline-block}.select-open .dropdown-icon.closed{display:none}.selected .dropdown-icon{--icon-color:var(--bl-color-neutral-darker)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-neutral-light)}.select-input:focus-visible,.select-open .select-input{border:solid 1px var(--border-focus-color);outline:0}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;padding-inline-start:var(--label-padding);margin:0;list-style:none;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([disabled]) .select-input .selected-options{color:var(--bl-color-neutral-light)}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}.selected-options li:not(:last-child)::after{content:", "}.select-input:not(.has-overflowed-options) .additional-selection-count{display:none}:host([disabled]) .additional-selection-count{color:var(--bl-color-neutral-light)}:host([disabled]) .selected-options li{color:var(--bl-color-neutral-light)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-4xs);margin-inline-start:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:var(--popover-position);border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--bl-index-popover);width:100%;top:var(--top);left:var(--left)}:host(:empty) .popover{display:none}.popover-no-result{display:flex;flex-direction:column;gap:var(--bl-size-2xs);align-items:center;justify-content:center;height:80px}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}label,legend{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;display:block;top:var(--padding-vertical);left:var(--padding-horizontal);inset-inline-end:calc(var(--bl-size-2xs) + var(--bl-size-m) + var(--bl-size-2xs));transition:.1s ease-in;pointer-events:none;opacity:0;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color)}legend{height:0;visibility:hidden;display:none}legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:host(:not([placeholder])) .selected .label,:host([placeholder]) :where(.select-open,.selected) .label{display:none}:where(.select-open,.selected) label{top:0;transform:translateY(-50%);font:var(--bl-font-caption);color:var(--label-color);pointer-events:initial;right:var(--padding-horizontal);opacity:1}:host([label]) :where(.select-open,.selected) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host([label-fixed]) label{position:static;padding:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--label-color);opacity:1}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.error-icon,.invalid-text{display:none}.dirty.invalid label,.error-icon,.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}.dirty.invalid .hint,:host([help-text]) .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.select-all{position:sticky;top:0;padding:var(--bl-size-xs) 0;background:var(--background-color);z-index:1;font:var(--bl-font-title-3-regular);box-shadow:10px 0 0 var(--background-color),-10px 0 0 var(--background-color)}.select-all::after{position:absolute;content:"";width:100%;bottom:0;border-bottom:1px solid var(--bl-color-neutral-lighter)}.search-bar-input{font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--text-color);border:none;outline:0;background-color:transparent;width:100%;height:100%;padding:0;margin:0;box-sizing:border-box}.search-bar-input::placeholder{color:var(--placeholder-color)}.search-bar-input:focus-visible{outline:0}.search-spinner{padding-inline-end:var(--bl-font-size-2xs)}.action-divider{display:none}.select-wrapper .action-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}.actions bl-icon{padding:4px}`,P=R;var A,i=class extends k(g){constructor(){super(...arguments);this.size="medium";this.required=!1;this.disabled=!1;this.clearable=!1;this.multiple=!1;this.autofocus=!1;this.labelFixed=!1;this.viewSelectAll=!1;this.searchBar=!1;this.searchBarLoadingState=!1;this._isPopoverOpen=!1;this._additionalSelectedOptionCount=0;this._searchText="";this.userLang=((A=document.querySelector("html"))==null?void 0:A.getAttribute("lang"))||navigator.language;this._connectedOptions=[];this._cleanUpPopover=null;this._selectedOptions=[];this.dirty=!1;this._interactOutsideHandler=e=>{var l;let t=e.composedPath();(l=t==null?void 0:t.find(s=>s.tagName==="BL-SELECT"))!=null&&l.contains(this)||this.close()};this.focusedOptionIndex=-1;this.lastKeyPressedTime=0;this.typedCharacters="";this.keyPressThreshold=500}static get styles(){return[P]}get value(){return this._value}set value(e){if(this._value=e,Array.isArray(e)){let t=new FormData;e.forEach(l=>t.append(this.name,`${l}`)),this.setValue(t)}else this.setValue(e);this.setOptionsSelected()}shouldFormValueUpdate(){return this.value!==null&&this.value!==""}setOptionsSelected(){this._connectedOptions.forEach(e=>e.selected=this.value===e.value||Array.isArray(this.value)&&this.value.includes(e.value)),this._selectedOptions=[...this.options.filter(e=>e.selected)]}get options(){return this._connectedOptions}get opened(){return this._isPopoverOpen}get noResultFound(){return this._searchText!==""&&this._connectedOptions.every(e=>e.hidden)}get selectedOptions(){return this._selectedOptions}get additionalSelectedOptionCount(){return this._additionalSelectedOptionCount}validityCallback(){if(this.customInvalidText)return this.customInvalidText;let e=document.createElement("select");return e.required=this.required,e.validationMessage}reportValidity(){return this.dirty=!0,this.checkValidity()}resetFormControl(){this.value=this._initialValue}open(){this.searchBar&&setTimeout(()=>{var e,t,l;(l=(t=(e=document.activeElement)==null?void 0:e.shadowRoot)==null?void 0:t.querySelector("input"))==null||l.focus()},100),this._isPopoverOpen=!0,this._setupPopover(),document.addEventListener("click",this._interactOutsideHandler,!0),document.addEventListener("focus",this._interactOutsideHandler,!0)}close(){this._handleSearchOptions({target:{value:""}}),this._isPopoverOpen=!1,this.focusedOptionIndex=-1,this._cleanUpPopover&&this._cleanUpPopover(),document.removeEventListener("click",this._interactOutsideHandler,!0),document.removeEventListener("focus",this._interactOutsideHandler,!0)}_setupPopover(){this._cleanUpPopover=V(this._selectInput,this._popover,()=>{L(this._selectInput,this._popover,{placement:"bottom",strategy:"fixed",middleware:[C(),E(8),I({apply(e){Object.assign(e.elements.floating.style,{width:`${e.elements.reference.getBoundingClientRect().width}px`})}})]}).then(({x:e,y:t})=>{this._popover.style.setProperty("--left",`${e}px`),this._popover.style.setProperty("--top",`${t}px`)})})}connectedCallback(){var e;super.connectedCallback(),(e=this.form)==null||e.addEventListener("submit",t=>{this.reportValidity()||t.preventDefault()})}disconnectedCallback(){super.disconnectedCallback(),this._cleanUpPopover&&this._cleanUpPopover()}inputTemplate(){var O;let e=d`<ul class="selected-options">
|
|
1
|
+
import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as $}from"./chunk-EG7U7PM3.js";import{a as k}from"./chunk-XDUIVR6I.js";import{a as f}from"./chunk-6LT7O7T2.js";import{a as z,c as h}from"./chunk-HBPBDC7T.js";import{a as y}from"./chunk-ECPWEUBG.js";import{a as x}from"./chunk-DINNT5P2.js";import{a as m}from"./chunk-GRL4DWKG.js";import{a as T,b as a,c as u,e as b,f as S}from"./chunk-5MOOXA2X.js";import{a as w,b as d,f as g}from"./chunk-4OT5AMS5.js";import{d as o}from"./chunk-IZ2LK5GK.js";var R=w`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-neutral-full);--border-color:var(--bl-color-neutral-lighter);--border-focus-color:var(--bl-color-primary-highlight);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--label-color:var(--bl-color-neutral-dark);--placeholder-color:var(--bl-color-neutral-light);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-neutral-lightest);--menu-height:250px;--popover-position:var(--bl-popover-position, fixed)}:host([multiple][view-select-all]) .select-wrapper{--menu-height:290px}:host([size=large]) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size=small]) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-neutral-light)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-highlight);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);-webkit-user-select:none;user-select:none;margin:0;width:auto;min-width:100%}.label,.placeholder{color:var(--placeholder-color);padding-inline-start:var(--label-padding);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.select-wrapper.selected .placeholder,:host(:not([placeholder])) .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}:host(:not([label])) .label,:host([label-fixed]) .label{display:none}.remove-all{display:none}.selected .remove-all{display:block}:host([disabled]) .remove-all,:host([disabled]) .remove-all::after{display:none}.dropdown-icon{font-size:var(--bl-font-size-m)}.dropdown-icon.open{display:none}.select-open .dropdown-icon.open{display:inline-block}.select-open .dropdown-icon.closed{display:none}.selected .dropdown-icon{--icon-color:var(--bl-color-neutral-darker)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-neutral-light)}.select-input:focus-visible,.select-open .select-input{border:solid 1px var(--border-focus-color);outline:0}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;padding-inline-start:var(--label-padding);margin:0;list-style:none;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([disabled]) .select-input .selected-options{color:var(--bl-color-neutral-light)}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}.selected-options li:not(:last-child)::after{content:", "}.select-input:not(.has-overflowed-options) .additional-selection-count{display:none}:host([disabled]) .additional-selection-count{color:var(--bl-color-neutral-light)}:host([disabled]) .selected-options li{color:var(--bl-color-neutral-light)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-4xs);margin-inline-start:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:var(--popover-position);border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--bl-index-popover);width:100%;top:var(--top);left:var(--left)}:host(:empty) .popover{display:none}.popover-no-result{display:flex;flex-direction:column;gap:var(--bl-size-2xs);align-items:center;justify-content:center;height:80px}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}label,legend{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;display:block;top:var(--padding-vertical);left:var(--padding-horizontal);inset-inline-end:calc(var(--bl-size-2xs) + var(--bl-size-m) + var(--bl-size-2xs));transition:.1s ease-in;pointer-events:none;opacity:0;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color)}legend{height:0;visibility:hidden;display:none}legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:host(:not([placeholder])) .selected .label,:host([placeholder]) :where(.select-open,.selected) .label{display:none}:where(.select-open,.selected) label{top:0;transform:translateY(-50%);font:var(--bl-font-caption);color:var(--label-color);pointer-events:initial;right:var(--padding-horizontal);opacity:1}:host([label]) :where(.select-open,.selected) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host([label-fixed]) label{position:static;padding:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--label-color);opacity:1}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.error-icon,.invalid-text{display:none}.dirty.invalid label,.error-icon,.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}.dirty.invalid .hint,:host([help-text]) .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.select-all{position:sticky;top:0;padding:var(--bl-size-xs) 0;background:var(--background-color);z-index:1;font:var(--bl-font-title-3-regular);box-shadow:10px 0 0 var(--background-color),-10px 0 0 var(--background-color)}.select-all::after{position:absolute;content:"";width:100%;bottom:0;border-bottom:1px solid var(--bl-color-neutral-lighter)}.search-bar-input{font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--text-color);border:none;outline:0;background-color:transparent;width:100%;height:100%;padding:0;margin:0;box-sizing:border-box}.search-bar-input::placeholder{color:var(--placeholder-color)}.search-bar-input:focus-visible{outline:0}.search-spinner{padding-inline-end:var(--bl-font-size-2xs)}.action-divider{display:none}.select-wrapper .action-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}.actions bl-icon{padding:4px}`,P=R;var A,i=class extends k(g){constructor(){super(...arguments);this.size="medium";this.required=!1;this.disabled=!1;this.clearable=!1;this.multiple=!1;this.autofocus=!1;this.labelFixed=!1;this.viewSelectAll=!1;this.searchBar=!1;this.searchBarLoadingState=!1;this._isPopoverOpen=!1;this._additionalSelectedOptionCount=0;this._searchText="";this.userLang=((A=document.querySelector("html"))==null?void 0:A.getAttribute("lang"))||navigator.language;this._connectedOptions=[];this._cleanUpPopover=null;this._selectedOptions=[];this.dirty=!1;this._interactOutsideHandler=e=>{var l;let t=e.composedPath();(l=t==null?void 0:t.find(s=>s.tagName==="BL-SELECT"))!=null&&l.contains(this)||this.close()};this.focusedOptionIndex=-1;this.lastKeyPressedTime=0;this.typedCharacters="";this.keyPressThreshold=500}static get styles(){return[P]}get value(){return this._value}set value(e){if(this._value=e,Array.isArray(e)){let t=new FormData;e.forEach(l=>t.append(this.name,`${l}`)),this.setValue(t)}else this.setValue(e);this.setOptionsSelected()}shouldFormValueUpdate(){return this.value!==null&&this.value!==""}setOptionsSelected(){this._connectedOptions.forEach(e=>e.selected=this.value===e.value||Array.isArray(this.value)&&this.value.includes(e.value)),this._selectedOptions=[...this.options.filter(e=>e.selected)]}get options(){return this._connectedOptions}get opened(){return this._isPopoverOpen}get noResultFound(){return this._searchText!==""&&this._connectedOptions.every(e=>e.hidden)}get selectedOptions(){return this._selectedOptions}get additionalSelectedOptionCount(){return this._additionalSelectedOptionCount}validityCallback(){if(this.customInvalidText)return this.customInvalidText;let e=document.createElement("select");return e.required=this.required,e.validationMessage}reportValidity(){return this.dirty=!0,this.checkValidity()}resetFormControl(){this.value=this._initialValue}open(){this.searchBar&&setTimeout(()=>{var e,t,l;(l=(t=(e=document.activeElement)==null?void 0:e.shadowRoot)==null?void 0:t.querySelector("input"))==null||l.focus()},100),this._isPopoverOpen=!0,this._setupPopover(),document.addEventListener("click",this._interactOutsideHandler,!0),document.addEventListener("focus",this._interactOutsideHandler,!0)}close(){this._handleSearchOptions({target:{value:""}}),this._isPopoverOpen=!1,this.focusedOptionIndex=-1,this._cleanUpPopover&&this._cleanUpPopover(),document.removeEventListener("click",this._interactOutsideHandler,!0),document.removeEventListener("focus",this._interactOutsideHandler,!0)}_setupPopover(){this._cleanUpPopover=V(this._selectInput,this._popover,()=>{L(this._selectInput,this._popover,{placement:"bottom",strategy:"fixed",middleware:[C(),E(8),I({apply(e){Object.assign(e.elements.floating.style,{width:`${e.elements.reference.getBoundingClientRect().width}px`})}})]}).then(({x:e,y:t})=>{this._popover.style.setProperty("--left",`${e}px`),this._popover.style.setProperty("--top",`${t}px`)})})}_handleToggleButtonClick(e){e.stopPropagation(),this._togglePopover()}connectedCallback(){var e;super.connectedCallback(),(e=this.form)==null||e.addEventListener("submit",t=>{this.reportValidity()||t.preventDefault()})}disconnectedCallback(){super.disconnectedCallback(),this._cleanUpPopover&&this._cleanUpPopover()}inputTemplate(){var O;let e=d`<ul class="selected-options">
|
|
2
2
|
${this._selectedOptions.map(p=>d`<li>${p.getAttribute("label")||p.textContent}</li>`)}
|
|
3
3
|
</ul>`,l=!(this._selectedOptions.length>0&&this._selectedOptions.every(p=>p.disabled))&&(this.clearable||this.multiple),s=l?d`<bl-button
|
|
4
4
|
class="remove-all"
|
|
@@ -7,7 +7,7 @@ import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as
|
|
|
7
7
|
kind="neutral"
|
|
8
8
|
icon="close"
|
|
9
9
|
@click=${this._onClickRemove}
|
|
10
|
-
></bl-button>`:"",n=this.searchBar&&this.opened,c=this._selectedOptions.length>0,r=n||c&&l,
|
|
10
|
+
></bl-button>`:"",n=this.searchBar&&this.opened,c=this._selectedOptions.length>0,r=n||c&&l,v=(O=this.searchBarPlaceholder)!=null?O:h("Search",{desc:"bl-select: search placeholder text"}),M=d`<bl-icon
|
|
11
11
|
class="search-mag-icon"
|
|
12
12
|
name="search"
|
|
13
13
|
style="color: var(--bl-color-primary);font-size: var(--bl-font-size-s)"
|
|
@@ -26,7 +26,7 @@ import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as
|
|
|
26
26
|
${this._selectedOptions.length>0&&!this.opened?e:d`
|
|
27
27
|
<input
|
|
28
28
|
class="search-bar-input"
|
|
29
|
-
placeholder=${this.opened||this.labelFixed?
|
|
29
|
+
placeholder=${this.opened||this.labelFixed?v:this.label||v}
|
|
30
30
|
@input=${this._handleSearchOptions}
|
|
31
31
|
@keydown=${p=>{p.code==="Space"&&p.stopPropagation()}}
|
|
32
32
|
.value=${this._searchText}
|
|
@@ -39,12 +39,24 @@ import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as
|
|
|
39
39
|
<div class="actions">
|
|
40
40
|
${this.opened?this.searchBarLoadingState?D:M:""}
|
|
41
41
|
${this.opened?"":s} ${_}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
<bl-button
|
|
43
|
+
class="dropdown-icon open"
|
|
44
|
+
variant="tertiary"
|
|
45
|
+
kind="neutral"
|
|
46
|
+
size="small"
|
|
47
|
+
icon="arrow_up"
|
|
48
|
+
@click=${this._handleToggleButtonClick}
|
|
49
|
+
aria-label="${h("Close dropdown",{desc:"bl-select: close dropdown button"})}"
|
|
50
|
+
></bl-button>
|
|
51
|
+
<bl-button
|
|
52
|
+
class="closed dropdown-icon"
|
|
53
|
+
variant="tertiary"
|
|
54
|
+
kind="neutral"
|
|
55
|
+
size="small"
|
|
56
|
+
icon="arrow_down"
|
|
57
|
+
@click=${this._handleToggleButtonClick}
|
|
58
|
+
aria-label="${h("Open dropdown",{desc:"bl-select: open dropdown button"})}"
|
|
59
|
+
></bl-button>
|
|
48
60
|
</div>
|
|
49
61
|
</fieldset>`;return this.searchBar?F:d`<fieldset
|
|
50
62
|
class=${f({"select-input":!0,"has-overflowed-options":this._additionalSelectedOptionCount>0})}
|
|
@@ -67,7 +79,7 @@ import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as
|
|
|
67
79
|
|
|
68
80
|
<bl-icon class="dropdown-icon closed" name="arrow_down"></bl-icon>
|
|
69
81
|
</div>
|
|
70
|
-
</fieldset>`}selectAllTemplate(){var s;if(!this.multiple||!this.viewSelectAll||this.noResultFound)return null;let e=this._connectedOptions.filter(n=>!n.hidden).every(n=>n.selected),t=this._selectedOptions.filter(n=>!n.hidden).length>0,l=(s=this.selectAllText)!=null?s:
|
|
82
|
+
</fieldset>`}selectAllTemplate(){var s;if(!this.multiple||!this.viewSelectAll||this.noResultFound)return null;let e=this._connectedOptions.filter(n=>!n.hidden).every(n=>n.selected),t=this._selectedOptions.filter(n=>!n.hidden).length>0,l=(s=this.selectAllText)!=null?s:h("Select All",{desc:"bl-select: select all text"});return d`<bl-checkbox
|
|
71
83
|
class="select-all"
|
|
72
84
|
.checked="${e}"
|
|
73
85
|
.indeterminate="${t&&!e}"
|
|
@@ -78,7 +90,7 @@ import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as
|
|
|
78
90
|
${l}
|
|
79
91
|
</bl-checkbox>`}render(){var c,r;let e=this.checkValidity()?"":d`<p id="errorMessage" aria-live="polite" class="invalid-text">
|
|
80
92
|
${this.validationMessage}
|
|
81
|
-
</p>`,t=this.helpText?d`<p class="help-text">${this.helpText}</p>`:"",l=this.label?d`<label id="label">${this.label}</label>`:"",s=(c=this.searchNotFoundText)!=null?c:
|
|
93
|
+
</p>`,t=this.helpText?d`<p class="help-text">${this.helpText}</p>`:"",l=this.label?d`<label id="label">${this.label}</label>`:"",s=(c=this.searchNotFoundText)!=null?c:h("No Data Found",{desc:"bl-select: search no data text"}),n=(r=this.popoverClearSearchText)!=null?r:h("Clear Search",{desc:"bl-select: clear search button text"});return d`<div
|
|
82
94
|
class=${f({"select-wrapper":!0,"select-open":this.opened,selected:this._selectedOptions.length>0,invalid:!this.validity.valid,dirty:this.dirty})}
|
|
83
95
|
@keydown=${this.handleKeydown}
|
|
84
96
|
>
|
|
@@ -103,5 +115,5 @@ import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as
|
|
|
103
115
|
</div>`:""}
|
|
104
116
|
</div>
|
|
105
117
|
<div class="hint">${e} ${t}</div>
|
|
106
|
-
</div> `}handleFocusOptionByKey(e){let t=Date.now();t-this.lastKeyPressedTime>this.keyPressThreshold&&(this.typedCharacters=""),this.lastKeyPressedTime=t,this.typedCharacters+=e.toLowerCase();let s=this.options.findIndex(n=>n.disabled?!1:n.innerText.trim().toLowerCase().startsWith(this.typedCharacters));s!==-1&&(this.focusedOptionIndex=s,this.options[s].focus())}handleKeydown(e){if(this.focusedOptionIndex===-1&&["Enter","Space"].includes(e.code))this._togglePopover(),e.preventDefault();else if(this._isPopoverOpen===!1&&["ArrowDown","ArrowUp"].includes(e.code))this.open(),e.preventDefault();else if(e.code==="Escape")this.close(),e.preventDefault();else if(this._isPopoverOpen&&["ArrowDown","ArrowUp"].includes(e.code)){let t=this.options.filter(l=>!l.disabled);e.code==="ArrowDown"&&this.focusedOptionIndex++,e.code==="ArrowUp"&&this.focusedOptionIndex--,this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,t.length-1)),t[this.focusedOptionIndex].focus(),e.preventDefault()}else this._isPopoverOpen&&!this.searchBar&&this.handleFocusOptionByKey(e.key)}_togglePopover(){this._isPopoverOpen?this.close():this.open()}_handleSelectEvent(){let e=this._selectedOptions.map(t=>({value:t.value,selected:t.selected,text:t.textContent}));this.multiple?this._onBlSelect(e):this._onBlSelect(e[0])}_handleSearchEvent(){this._onBlSearch(this._searchText)}_handleSearchOptions(e){this.searchBar&&(this._searchText=e.target.value,this._handleSearchEvent(),this._connectedOptions.forEach(t=>{let l=this._searchText.toLowerCase(),s="";if(t.textContent)try{s=t.textContent.toLocaleLowerCase(this.userLang)}catch{s=t.textContent.toLowerCase()}let n=s.includes(l);t.hidden=!n}),this._selectedOptions=this.options.filter(t=>t.selected),this._handleLastVisibleSearchedOption(),this.requestUpdate())}_handleLastVisibleSearchedOption(){var t,l;let e=[...this.options].reverse().find(s=>!s.hidden);e&&((l=(t=e==null?void 0:e.shadowRoot)==null?void 0:t.querySelector("div"))==null||l.classList.add("no-border-bottom")),this.options.map(s=>{var n,c;!s.hidden&&s!==e&&((c=(n=s.shadowRoot)==null?void 0:n.querySelector("div"))==null||c.classList.remove("no-border-bottom"))})}_handleSingleSelect(e){this.value=e.value,this._searchText="",this._handleSelectEvent(),this.close()}_handleMultipleSelect(){this.value=this._connectedOptions.filter(e=>e.selected).map(e=>e.value),this._handleSelectEvent()}_handleSelectOptionEvent(e){let t=e.target;this.dirty=!0,this.multiple?this._handleMultipleSelect():this._handleSingleSelect(t)}_handleSelectAll(e){var c;let t=(c=this.shadowRoot)==null?void 0:c.querySelector(".select-all"),l=e.detail,n=this._connectedOptions.filter(r=>!r.selected&&!r.hidden).every(r=>r.disabled);if(l&&n){setTimeout(()=>{var
|
|
107
|
-
//# sourceMappingURL=chunk-
|
|
118
|
+
</div> `}handleFocusOptionByKey(e){let t=Date.now();t-this.lastKeyPressedTime>this.keyPressThreshold&&(this.typedCharacters=""),this.lastKeyPressedTime=t,this.typedCharacters+=e.toLowerCase();let s=this.options.findIndex(n=>n.disabled?!1:n.innerText.trim().toLowerCase().startsWith(this.typedCharacters));s!==-1&&(this.focusedOptionIndex=s,this.options[s].focus())}handleKeydown(e){if(this.focusedOptionIndex===-1&&["Enter","Space"].includes(e.code))this._togglePopover(),e.preventDefault();else if(this._isPopoverOpen===!1&&["ArrowDown","ArrowUp"].includes(e.code))this.open(),e.preventDefault();else if(e.code==="Escape")this.close(),e.preventDefault();else if(this._isPopoverOpen&&["ArrowDown","ArrowUp"].includes(e.code)){let t=this.options.filter(l=>!l.disabled);e.code==="ArrowDown"&&this.focusedOptionIndex++,e.code==="ArrowUp"&&this.focusedOptionIndex--,this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,t.length-1)),t[this.focusedOptionIndex].focus(),e.preventDefault()}else this._isPopoverOpen&&!this.searchBar&&this.handleFocusOptionByKey(e.key)}_togglePopover(){this._isPopoverOpen?this.close():this.open()}_handleSelectEvent(){let e=this._selectedOptions.map(t=>({value:t.value,selected:t.selected,text:t.textContent}));this.multiple?this._onBlSelect(e):this._onBlSelect(e[0])}_handleSearchEvent(){this._onBlSearch(this._searchText)}_handleSearchOptions(e){this.searchBar&&(this._searchText=e.target.value,this._handleSearchEvent(),this._connectedOptions.forEach(t=>{let l=this._searchText.toLowerCase(),s="";if(t.textContent)try{s=t.textContent.toLocaleLowerCase(this.userLang)}catch{s=t.textContent.toLowerCase()}let n=s.includes(l);t.hidden=!n}),this._selectedOptions=this.options.filter(t=>t.selected),this._handleLastVisibleSearchedOption(),this.requestUpdate())}_handleLastVisibleSearchedOption(){var t,l;let e=[...this.options].reverse().find(s=>!s.hidden);e&&((l=(t=e==null?void 0:e.shadowRoot)==null?void 0:t.querySelector("div"))==null||l.classList.add("no-border-bottom")),this.options.map(s=>{var n,c;!s.hidden&&s!==e&&((c=(n=s.shadowRoot)==null?void 0:n.querySelector("div"))==null||c.classList.remove("no-border-bottom"))})}_handleSingleSelect(e){this.value=e.value,this._searchText="",this._handleSelectEvent(),this.close()}_handleMultipleSelect(){this.value=this._connectedOptions.filter(e=>e.selected).map(e=>e.value),this._handleSelectEvent()}_handleSelectOptionEvent(e){let t=e.target;this.dirty=!0,this.multiple?this._handleMultipleSelect():this._handleSingleSelect(t)}_handleSelectAll(e){var c;let t=(c=this.shadowRoot)==null?void 0:c.querySelector(".select-all"),l=e.detail,n=this._connectedOptions.filter(r=>!r.selected&&!r.hidden).every(r=>r.disabled);if(l&&n){setTimeout(()=>{var v;let r=(v=t==null?void 0:t.shadowRoot)==null?void 0:v.querySelector("input");r==null||r.click()},0);return}this._connectedOptions.forEach(r=>{r.disabled||r.hidden||(r.selected=l)}),this._handleMultipleSelect()}_onClickRemove(e){e.stopPropagation(),this._searchText="";let t=this._selectedOptions.filter(l=>l.disabled);this._connectedOptions.filter(l=>!l.disabled&&l.selected).forEach(l=>{l.selected=!1}),this.value=t.length?t.map(l=>l.value):null,this._handleSelectEvent()}_checkAdditionalItemCount(){if(!this.multiple||!this.selectedOptionsItems||this.selectedOptionsItems.length<2){this._additionalSelectedOptionCount=0;return}let e=[...this.selectedOptionsItems].findIndex(t=>t.offsetLeft>this.selectedOptionsContainer.offsetWidth);e>-1?this._additionalSelectedOptionCount=this.selectedOptionsItems.length-e:this._additionalSelectedOptionCount=0}firstUpdated(){this.value===void 0&&(this.multiple?this.value=[]:this.value=null),this._initialValue=this._value}updated(e){e.has("multiple")&&typeof e.get("multiple")=="boolean"&&(this.value=null),e.has("_selectedOptions")&&this._checkAdditionalItemCount()}registerOption(e){this._connectedOptions.push(e),e.selected&&(this.multiple?(Array.isArray(this.value)||(this.value=[]),this.value=[...this.value,e.value]):this.value=e.value),this.setOptionsSelected(),this.requestUpdate()}unregisterOption(e){this._connectedOptions.splice(this._connectedOptions.indexOf(e),1)}};i.shadowRootOptions={...g.shadowRootOptions,delegatesFocus:!0},i.formControlValidators=[$],o([a()],i.prototype,"name",2),o([a()],i.prototype,"value",1),o([a({reflect:!0})],i.prototype,"label",2),o([a({reflect:!0})],i.prototype,"placeholder",2),o([a({type:String,reflect:!0})],i.prototype,"size",2),o([a({type:Boolean,reflect:!0})],i.prototype,"required",2),o([a({type:Boolean,reflect:!0})],i.prototype,"disabled",2),o([a({type:Boolean,reflect:!0})],i.prototype,"clearable",2),o([a({type:Boolean,reflect:!0})],i.prototype,"multiple",2),o([a({type:Boolean,reflect:!0})],i.prototype,"autofocus",2),o([a({type:Boolean,attribute:"label-fixed",reflect:!0})],i.prototype,"labelFixed",2),o([a({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),o([a({type:String,attribute:"invalid-text",reflect:!0})],i.prototype,"customInvalidText",2),o([a({type:Boolean,attribute:"view-select-all",converter:y()})],i.prototype,"viewSelectAll",2),o([a({type:String,attribute:"select-all-text"})],i.prototype,"selectAllText",2),o([a({type:Boolean,attribute:"search-bar",reflect:!0})],i.prototype,"searchBar",2),o([a({type:String,attribute:"search-bar-placeholder",reflect:!0})],i.prototype,"searchBarPlaceholder",2),o([a({type:Boolean,attribute:"search-bar-loading-state",converter:y()})],i.prototype,"searchBarLoadingState",2),o([a({type:String,attribute:"search-not-found-text",reflect:!0})],i.prototype,"searchNotFoundText",2),o([a({type:String,attribute:"popover-clear-search-text",reflect:!0})],i.prototype,"popoverClearSearchText",2),o([u()],i.prototype,"_isPopoverOpen",2),o([u()],i.prototype,"_additionalSelectedOptionCount",2),o([u()],i.prototype,"_searchText",2),o([b(".selected-options")],i.prototype,"selectedOptionsContainer",2),o([S(".selected-options li")],i.prototype,"selectedOptionsItems",2),o([b(".popover")],i.prototype,"_popover",2),o([b(".select-input")],i.prototype,"_selectInput",2),o([m("bl-select")],i.prototype,"_onBlSelect",2),o([m("bl-search")],i.prototype,"_onBlSearch",2),o([u()],i.prototype,"_selectedOptions",2),o([u()],i.prototype,"dirty",2),o([b(".select-input")],i.prototype,"validationTarget",2),i=o([T("bl-select"),z()],i);export{i as a};
|
|
119
|
+
//# sourceMappingURL=chunk-4XJNC424.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/select/bl-select.css", "../src/components/select/bl-select.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-neutral-full);--border-color:var(--bl-color-neutral-lighter);--border-focus-color:var(--bl-color-primary-highlight);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--label-color:var(--bl-color-neutral-dark);--placeholder-color:var(--bl-color-neutral-light);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-neutral-lightest);--menu-height:250px;--popover-position:var(--bl-popover-position, fixed)}:host([multiple][view-select-all]) .select-wrapper{--menu-height:290px}:host([size=large]) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size=small]) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-neutral-light)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-highlight);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);-webkit-user-select:none;user-select:none;margin:0;width:auto;min-width:100%}.label,.placeholder{color:var(--placeholder-color);padding-inline-start:var(--label-padding);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.select-wrapper.selected .placeholder,:host(:not([placeholder])) .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}:host(:not([label])) .label,:host([label-fixed]) .label{display:none}.remove-all{display:none}.selected .remove-all{display:block}:host([disabled]) .remove-all,:host([disabled]) .remove-all::after{display:none}.dropdown-icon{font-size:var(--bl-font-size-m)}.dropdown-icon.open{display:none}.select-open .dropdown-icon.open{display:inline-block}.select-open .dropdown-icon.closed{display:none}.selected .dropdown-icon{--icon-color:var(--bl-color-neutral-darker)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-neutral-light)}.select-input:focus-visible,.select-open .select-input{border:solid 1px var(--border-focus-color);outline:0}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;padding-inline-start:var(--label-padding);margin:0;list-style:none;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([disabled]) .select-input .selected-options{color:var(--bl-color-neutral-light)}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}.selected-options li:not(:last-child)::after{content:\", \"}.select-input:not(.has-overflowed-options) .additional-selection-count{display:none}:host([disabled]) .additional-selection-count{color:var(--bl-color-neutral-light)}:host([disabled]) .selected-options li{color:var(--bl-color-neutral-light)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-4xs);margin-inline-start:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:var(--popover-position);border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--bl-index-popover);width:100%;top:var(--top);left:var(--left)}:host(:empty) .popover{display:none}.popover-no-result{display:flex;flex-direction:column;gap:var(--bl-size-2xs);align-items:center;justify-content:center;height:80px}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}label,legend{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;display:block;top:var(--padding-vertical);left:var(--padding-horizontal);inset-inline-end:calc(var(--bl-size-2xs) + var(--bl-size-m) + var(--bl-size-2xs));transition:.1s ease-in;pointer-events:none;opacity:0;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color)}legend{height:0;visibility:hidden;display:none}legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:host(:not([placeholder])) .selected .label,:host([placeholder]) :where(.select-open,.selected) .label{display:none}:where(.select-open,.selected) label{top:0;transform:translateY(-50%);font:var(--bl-font-caption);color:var(--label-color);pointer-events:initial;right:var(--padding-horizontal);opacity:1}:host([label]) :where(.select-open,.selected) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host([label-fixed]) label{position:static;padding:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--label-color);opacity:1}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.error-icon,.invalid-text{display:none}.dirty.invalid label,.error-icon,.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}.dirty.invalid .hint,:host([help-text]) .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.select-all{position:sticky;top:0;padding:var(--bl-size-xs) 0;background:var(--background-color);z-index:1;font:var(--bl-font-title-3-regular);box-shadow:10px 0 0 var(--background-color),-10px 0 0 var(--background-color)}.select-all::after{position:absolute;content:\"\";width:100%;bottom:0;border-bottom:1px solid var(--bl-color-neutral-lighter)}.search-bar-input{font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--text-color);border:none;outline:0;background-color:transparent;width:100%;height:100%;padding:0;margin:0;box-sizing:border-box}.search-bar-input::placeholder{color:var(--placeholder-color)}.search-bar-input:focus-visible{outline:0}.search-spinner{padding-inline-end:var(--bl-font-size-2xs)}.action-divider{display:none}.select-wrapper .action-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}.actions bl-icon{padding:4px}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, query, queryAll, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { autoUpdate, computePosition, flip, MiddlewareState, offset, size } from \"@floating-ui/dom\";\nimport { localized, msg } from \"@lit/localize\";\nimport { FormControlMixin, requiredValidator } from \"@open-wc/form-control\";\nimport { FormValue } from \"@open-wc/form-helpers\";\nimport \"element-internals-polyfill\";\nimport { LangKey } from \"../../localization\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { stringBooleanConverter } from \"../../utilities/string-boolean.converter\";\nimport \"../button/bl-button\";\nimport \"../checkbox-group/checkbox/bl-checkbox\";\nimport BlCheckbox from \"../checkbox-group/checkbox/bl-checkbox\";\nimport \"../icon/bl-icon\";\nimport style from \"../select/bl-select.css\";\nimport \"../select/option/bl-select-option\";\nimport type BlSelectOption from \"./option/bl-select-option\";\n\nexport interface ISelectOption<T = string> {\n value: T;\n text: string;\n selected: boolean;\n}\n\nexport type SelectSize = \"medium\" | \"large\" | \"small\";\n\nexport type CleanUpFunction = () => void;\n\n/**\n * @tag bl-select\n * @summary Baklava Select component\n *\n * @cssproperty [--bl-popover-position=fixed] Sets the positioning strategy of select popover. You can set it as `absolute` if you need to show popover relative to its trigger element.\n */\n@customElement(\"bl-select\")\n@localized()\nexport default class BlSelect<ValueType extends FormValue = string> extends FormControlMixin(\n LitElement\n) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static formControlValidators = [requiredValidator];\n\n /**\n * Sets name of the select field\n */\n @property()\n name: string;\n\n private _value: ValueType | ValueType[] | null;\n\n private _initialValue: ValueType | ValueType[] | null;\n\n /**\n * Sets the value of the select\n */\n @property()\n get value(): ValueType | ValueType[] | null {\n return this._value;\n }\n\n set value(val: ValueType | ValueType[] | null) {\n this._value = val;\n\n if (Array.isArray(val)) {\n const formData = new FormData();\n\n val.forEach(option => formData.append(this.name, `${option}`));\n this.setValue(formData);\n } else {\n this.setValue(val);\n }\n\n this.setOptionsSelected();\n }\n\n shouldFormValueUpdate(): boolean {\n return this.value !== null && this.value !== \"\";\n }\n\n /* Declare reactive properties */\n /**\n * Sets the label value\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Sets the placeholder value. If left blank, the label value (if specified) is set as placeholder.\n */\n @property({ reflect: true })\n placeholder?: string;\n\n /**\n * Sets the size value. Select component's height value will be changed accordingly\n */\n @property({ type: String, reflect: true })\n size: SelectSize = \"medium\";\n\n /**\n * When option is not selected, shows component in error state\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Shows the component in disabled state.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets whether the selected option is clearable\n */\n @property({ type: Boolean, reflect: true })\n clearable = false;\n\n /**\n * Allows multiple options to be selected\n */\n @property({ type: Boolean, reflect: true })\n multiple = false;\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText?: string;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: \"invalid-text\", reflect: true })\n customInvalidText?: string;\n\n /**\n * Views select all option in multiple select\n */\n @property({ type: Boolean, attribute: \"view-select-all\", converter: stringBooleanConverter() })\n viewSelectAll = false;\n\n /**\n * Sets select all text in multiple select\n */\n @property({ type: String, attribute: \"select-all-text\" })\n selectAllText?: string;\n\n /**\n * Enable search functionality for the options within the list\n */\n @property({ type: Boolean, attribute: \"search-bar\", reflect: true })\n searchBar = false;\n\n /**\n * Search for text variations such as \"search,\" \"searching,\" \"search by country,\" and so on\n */\n @property({ type: String, attribute: \"search-bar-placeholder\", reflect: true })\n searchBarPlaceholder?: string;\n\n /**\n * Display a loading icon in place of the search icon.\n */\n @property({\n type: Boolean,\n attribute: \"search-bar-loading-state\",\n converter: stringBooleanConverter(),\n })\n searchBarLoadingState = false;\n\n /**\n * Text to display when no search results are found.\n */\n @property({ type: String, attribute: \"search-not-found-text\", reflect: true })\n searchNotFoundText?: string;\n\n /**\n * Text to display on the clear search button.\n */\n @property({ type: String, attribute: \"popover-clear-search-text\", reflect: true })\n popoverClearSearchText?: string;\n\n /* Declare internal reactive properties */\n @state()\n private _isPopoverOpen = false;\n\n @state()\n private _additionalSelectedOptionCount = 0;\n\n @state()\n private _searchText = \"\";\n\n @query(\".selected-options\")\n private selectedOptionsContainer!: HTMLElement;\n\n @queryAll(\".selected-options li\")\n private selectedOptionsItems!: NodeListOf<HTMLElement>;\n\n @query(\".popover\")\n private _popover: HTMLElement;\n\n @query(\".select-input\")\n private _selectInput: HTMLElement;\n\n /**\n * Fires when selection changes\n */\n @event(\"bl-select\") private _onBlSelect: EventDispatcher<\n ISelectOption<ValueType>[] | ISelectOption<ValueType>\n >;\n\n /**\n * Fires when search text changes\n */\n @event(\"bl-search\") private _onBlSearch: EventDispatcher<string>;\n\n private userLang =\n (document.querySelector(\"html\")?.getAttribute(\"lang\") as LangKey | null) || navigator.language;\n\n private _connectedOptions: BlSelectOption<ValueType>[] = [];\n\n private _cleanUpPopover: CleanUpFunction | null = null;\n\n private setOptionsSelected() {\n this._connectedOptions.forEach(\n option =>\n (option.selected =\n this.value === option.value ||\n (Array.isArray(this.value) && this.value.includes(option.value)))\n );\n\n this._selectedOptions = [...this.options.filter(option => option.selected)];\n }\n\n get options() {\n return this._connectedOptions;\n }\n\n get opened() {\n return this._isPopoverOpen;\n }\n\n get noResultFound() {\n return this._searchText !== \"\" && this._connectedOptions.every(option => option.hidden);\n }\n\n @state()\n private _selectedOptions: BlSelectOption<ValueType>[] = [];\n\n @state()\n private dirty = false;\n\n get selectedOptions(): BlSelectOption<ValueType>[] {\n return this._selectedOptions;\n }\n\n get additionalSelectedOptionCount() {\n return this._additionalSelectedOptionCount;\n }\n\n validityCallback(): string | void {\n if (this.customInvalidText) {\n return this.customInvalidText;\n }\n const select = document.createElement(\"select\");\n\n select.required = this.required;\n\n return select.validationMessage;\n }\n\n reportValidity() {\n this.dirty = true;\n return this.checkValidity();\n }\n\n resetFormControl(): void {\n this.value = this._initialValue;\n }\n\n @query(\".select-input\")\n validationTarget: HTMLElement;\n\n open() {\n if (this.searchBar) {\n setTimeout(() => {\n document.activeElement?.shadowRoot?.querySelector(\"input\")?.focus();\n }, 100);\n }\n\n this._isPopoverOpen = true;\n this._setupPopover();\n document.addEventListener(\"click\", this._interactOutsideHandler, true);\n document.addEventListener(\"focus\", this._interactOutsideHandler, true);\n }\n\n close() {\n this._handleSearchOptions({ target: { value: \"\" } } as InputEvent & {\n target: HTMLInputElement;\n });\n\n this._isPopoverOpen = false;\n this.focusedOptionIndex = -1;\n this._cleanUpPopover && this._cleanUpPopover();\n document.removeEventListener(\"click\", this._interactOutsideHandler, true);\n document.removeEventListener(\"focus\", this._interactOutsideHandler, true);\n }\n\n private _interactOutsideHandler = (event: MouseEvent | FocusEvent) => {\n const eventPath = event.composedPath() as HTMLElement[];\n\n if (!eventPath?.find(el => el.tagName === \"BL-SELECT\")?.contains(this)) {\n this.close();\n }\n };\n\n private _setupPopover() {\n this._cleanUpPopover = autoUpdate(this._selectInput, this._popover, () => {\n computePosition(this._selectInput, this._popover, {\n placement: \"bottom\",\n strategy: \"fixed\",\n middleware: [\n flip(),\n offset(8),\n size({\n apply(args: MiddlewareState) {\n Object.assign(args.elements.floating.style, {\n width: `${args.elements.reference.getBoundingClientRect().width}px`,\n });\n },\n }),\n ],\n }).then(({ x, y }) => {\n this._popover.style.setProperty(\"--left\", `${x}px`);\n this._popover.style.setProperty(\"--top\", `${y}px`);\n });\n });\n }\n\n private _handleToggleButtonClick(e: MouseEvent) {\n e.stopPropagation();\n this._togglePopover();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.form?.addEventListener(\"submit\", (e: SubmitEvent) => {\n if (!this.reportValidity()) {\n e.preventDefault();\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this._cleanUpPopover && this._cleanUpPopover();\n }\n\n private inputTemplate() {\n const inputSelectedOptions = html`<ul class=\"selected-options\">\n ${this._selectedOptions.map(\n item => html`<li>${item.getAttribute(\"label\") || item.textContent}</li>`\n )}\n </ul>`;\n\n const isAllSelectedDisabled =\n this._selectedOptions.length > 0 && this._selectedOptions.every(option => option.disabled);\n const isRemoveButtonShown = !isAllSelectedDisabled && (this.clearable || this.multiple);\n const removeButton = isRemoveButtonShown\n ? html`<bl-button\n class=\"remove-all\"\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this._onClickRemove}\n ></bl-button>`\n : \"\";\n\n const isSearchBarVisible = this.searchBar && this.opened;\n const hasSelectedOptions = this._selectedOptions.length > 0;\n\n const isDividerShown = isSearchBarVisible || (hasSelectedOptions && isRemoveButtonShown);\n\n const searchbarPlaceholderText =\n this.searchBarPlaceholder ?? msg(\"Search\", { desc: \"bl-select: search placeholder text\" });\n\n const searchMagIcon = html`<bl-icon\n class=\"search-mag-icon\"\n name=\"search\"\n style=\"color: var(--bl-color-primary);font-size: var(--bl-font-size-s)\"\n ></bl-icon>`;\n\n const searchSpinner = html`<bl-spinner class=\"search-spinner\"></bl-spinner>`;\n\n const actionDivider = isDividerShown ? html`<div class=\"action-divider\"></div>` : \"\";\n\n const search = html`<fieldset\n class=${classMap({\n \"select-input\": true,\n \"has-overflowed-options\": this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${this.disabled ? \"-1\" : 0}\"\n .autofocus=${this.autofocus}\n role=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${this.opened}\"\n aria-labelledby=\"label\"\n @click=${this.open}\n >\n <legend><span>${this.label}</span></legend>\n\n ${this._selectedOptions.length > 0 && !this.opened\n ? inputSelectedOptions\n : html`\n <input\n class=\"search-bar-input\"\n placeholder=${this.opened || this.labelFixed\n ? searchbarPlaceholderText\n : this.label || searchbarPlaceholderText}\n @input=${this._handleSearchOptions}\n @keydown=${(e: KeyboardEvent) => {\n if (e.code === \"Space\") {\n e.stopPropagation();\n }\n }}\n .value=${this._searchText}\n />\n `}\n ${!this.opened\n ? html`<span class=\"additional-selection-count\"\n >+${this._additionalSelectedOptionCount}</span\n >`\n : \"\"}\n\n <div class=\"actions\">\n ${this.opened ? (this.searchBarLoadingState ? searchSpinner : searchMagIcon) : \"\"}\n ${!this.opened ? removeButton : \"\"} ${actionDivider}\n <bl-button\n class=\"dropdown-icon open\"\n variant=\"tertiary\"\n kind=\"neutral\"\n size=\"small\"\n icon=\"arrow_up\"\n @click=${this._handleToggleButtonClick}\n aria-label=\"${msg(\"Close dropdown\", { desc: \"bl-select: close dropdown button\" })}\"\n ></bl-button>\n <bl-button\n class=\"closed dropdown-icon\"\n variant=\"tertiary\"\n kind=\"neutral\"\n size=\"small\"\n icon=\"arrow_down\"\n @click=${this._handleToggleButtonClick}\n aria-label=\"${msg(\"Open dropdown\", { desc: \"bl-select: open dropdown button\" })}\"\n ></bl-button>\n </div>\n </fieldset>`;\n\n return this.searchBar\n ? search\n : html`<fieldset\n class=${classMap({\n \"select-input\": true,\n \"has-overflowed-options\": this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${ifDefined(this.disabled ? undefined : 0)}\"\n ?autofocus=${this.autofocus}\n @click=${this._togglePopover}\n role=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${this.opened}\"\n aria-labelledby=\"label\"\n >\n <legend><span>${this.label}</span></legend>\n <span class=\"placeholder\">${this.placeholder}</span>\n <span class=\"label\">${this.label}</span>\n ${inputSelectedOptions}\n <span class=\"additional-selection-count\">+${this._additionalSelectedOptionCount}</span>\n <div class=\"actions\">\n ${removeButton} ${actionDivider}\n <bl-icon class=\"dropdown-icon open\" name=\"arrow_up\"></bl-icon>\n\n <bl-icon class=\"dropdown-icon closed\" name=\"arrow_down\"></bl-icon>\n </div>\n </fieldset>`;\n }\n\n selectAllTemplate() {\n if (!this.multiple || !this.viewSelectAll || this.noResultFound) {\n return null;\n }\n\n const isAllRenderedOptionsSelected = this._connectedOptions\n .filter(option => !option.hidden)\n .every(option => option.selected);\n\n const isAnySelected = this._selectedOptions.filter(option => !option.hidden).length > 0;\n const selectAllText =\n this.selectAllText ?? msg(\"Select All\", { desc: \"bl-select: select all text\" });\n\n return html`<bl-checkbox\n class=\"select-all\"\n .checked=\"${isAllRenderedOptionsSelected}\"\n .indeterminate=\"${isAnySelected && !isAllRenderedOptionsSelected}\"\n role=\"option\"\n aria-selected=\"${isAllRenderedOptionsSelected}\"\n @bl-checkbox-change=\"${this._handleSelectAll}\"\n >\n ${selectAllText}\n </bl-checkbox>`;\n }\n\n render(): TemplateResult {\n const invalidMessage = !this.checkValidity()\n ? html`<p id=\"errorMessage\" aria-live=\"polite\" class=\"invalid-text\">\n ${this.validationMessage}\n </p>`\n : \"\";\n\n const helpMessage = this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : \"\";\n\n const label = this.label ? html`<label id=\"label\">${this.label}</label>` : \"\";\n\n const noDataText =\n this.searchNotFoundText ?? msg(\"No Data Found\", { desc: \"bl-select: search no data text\" });\n\n const clearSearchText =\n this.popoverClearSearchText ??\n msg(\"Clear Search\", { desc: \"bl-select: clear search button text\" });\n\n return html`<div\n class=${classMap({\n \"select-wrapper\": true,\n \"select-open\": this.opened,\n \"selected\": this._selectedOptions.length > 0,\n \"invalid\": !this.validity.valid,\n \"dirty\": this.dirty,\n })}\n @keydown=${this.handleKeydown}\n >\n ${label} ${this.inputTemplate()}\n <div\n class=\"popover\"\n tabindex=\"${ifDefined(this._isPopoverOpen ? undefined : \"-1\")}\"\n @bl-select-option=${this._handleSelectOptionEvent}\n role=\"listbox\"\n aria-multiselectable=\"${this.multiple}\"\n aria-labelledby=\"label\"\n >\n ${this.selectAllTemplate()}\n <slot></slot>\n ${this.searchBar && this.noResultFound\n ? html`<div name=\"popover-clear-search-text\" class=\"popover-no-result\">\n <span>${noDataText}</span>\n <bl-button\n variant=\"tertiary\"\n @click=${() => {\n this._handleSearchOptions({ target: { value: \"\" } } as InputEvent & {\n target: HTMLInputElement;\n });\n }}\n >${clearSearchText}</bl-button\n >\n </div>`\n : \"\"}\n </div>\n <div class=\"hint\">${invalidMessage} ${helpMessage}</div>\n </div> `;\n }\n\n private focusedOptionIndex = -1;\n private lastKeyPressedTime = 0;\n private typedCharacters = \"\";\n private keyPressThreshold = 500;\n\n private handleFocusOptionByKey(key: string) {\n const currentTime = Date.now();\n const elapsedTimeSinceLastKeyPress = currentTime - this.lastKeyPressedTime;\n\n if (elapsedTimeSinceLastKeyPress > this.keyPressThreshold) {\n this.typedCharacters = \"\";\n }\n\n this.lastKeyPressedTime = currentTime;\n this.typedCharacters += key.toLowerCase();\n\n const matchingOptionIndex = this.options.findIndex(option => {\n if (option.disabled) {\n return false;\n }\n const optionText = option.innerText.trim().toLowerCase();\n\n return optionText.startsWith(this.typedCharacters);\n });\n\n if (matchingOptionIndex !== -1) {\n this.focusedOptionIndex = matchingOptionIndex;\n this.options[matchingOptionIndex].focus();\n }\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (this.focusedOptionIndex === -1 && [\"Enter\", \"Space\"].includes(event.code)) {\n this._togglePopover();\n event.preventDefault();\n } else if (this._isPopoverOpen === false && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n this.open();\n event.preventDefault();\n } else if (event.code === \"Escape\") {\n this.close();\n event.preventDefault();\n } else if (this._isPopoverOpen && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n const activeOptions = this.options.filter(option => !option.disabled);\n\n event.code === \"ArrowDown\" && this.focusedOptionIndex++;\n event.code === \"ArrowUp\" && this.focusedOptionIndex--;\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, activeOptions.length - 1)\n );\n\n activeOptions[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n } else if (this._isPopoverOpen && !this.searchBar) {\n this.handleFocusOptionByKey(event.key);\n }\n }\n\n private _togglePopover() {\n this._isPopoverOpen ? this.close() : this.open();\n }\n\n private _handleSelectEvent() {\n const options = this._selectedOptions.map(\n option =>\n ({\n value: option.value,\n selected: option.selected,\n text: option.textContent,\n } as ISelectOption<ValueType>)\n );\n\n if (!this.multiple) this._onBlSelect(options[0]);\n else this._onBlSelect(options);\n }\n\n private _handleSearchEvent() {\n this._onBlSearch(this._searchText);\n }\n\n private _handleSearchOptions(e: InputEvent): void {\n if (!this.searchBar) return;\n\n this._searchText = (e.target as HTMLInputElement).value;\n\n this._handleSearchEvent();\n\n this._connectedOptions.forEach(option => {\n const searchText = this._searchText.toLowerCase();\n let optionText = \"\";\n\n if (option.textContent) {\n try {\n // Try locale-specific comparison first\n optionText = option.textContent.toLocaleLowerCase(this.userLang);\n } catch {\n // Fallback to basic toLowerCase if locale is not supported\n optionText = option.textContent.toLowerCase();\n }\n }\n\n const isVisible = optionText.includes(searchText);\n\n option.hidden = !isVisible;\n });\n\n this._selectedOptions = this.options.filter(option => option.selected);\n this._handleLastVisibleSearchedOption();\n this.requestUpdate();\n }\n\n private _handleLastVisibleSearchedOption() {\n const lastVisibleOption = [...this.options].reverse().find(option => !option.hidden);\n\n if (lastVisibleOption) {\n lastVisibleOption?.shadowRoot?.querySelector(\"div\")?.classList.add(\"no-border-bottom\");\n }\n\n this.options.map(option => {\n if (!option.hidden && option !== lastVisibleOption) {\n option.shadowRoot?.querySelector(\"div\")?.classList.remove(\"no-border-bottom\");\n }\n });\n }\n\n private _handleSingleSelect(optionItem: BlSelectOption<ValueType>) {\n this.value = optionItem.value;\n\n this._searchText = \"\";\n this._handleSelectEvent();\n this.close();\n }\n\n private _handleMultipleSelect() {\n this.value = this._connectedOptions\n .filter(option => option.selected)\n .map(option => option.value);\n\n this._handleSelectEvent();\n }\n\n private _handleSelectOptionEvent(e: CustomEvent) {\n const optionItem = e.target as BlSelectOption<ValueType>;\n\n this.dirty = true;\n\n if (this.multiple) {\n this._handleMultipleSelect();\n } else {\n this._handleSingleSelect(optionItem);\n }\n }\n\n private _handleSelectAll(e: CustomEvent) {\n const selectAllEl = this.shadowRoot?.querySelector(\".select-all\") as BlCheckbox;\n\n const checked = e.detail;\n const unselectedOptions = this._connectedOptions.filter(\n option => !option.selected && !option.hidden\n );\n const isAllUnselectedDisabled = unselectedOptions.every(option => option.disabled);\n\n // If all available options are selected, instead of checking, uncheck all options\n if (checked && isAllUnselectedDisabled) {\n setTimeout(() => {\n const checkbox = selectAllEl?.shadowRoot?.querySelector(\"input\");\n\n checkbox?.click();\n }, 0);\n return;\n }\n\n this._connectedOptions.forEach(option => {\n if (option.disabled || option.hidden) {\n return;\n }\n\n option.selected = checked;\n });\n\n this._handleMultipleSelect();\n }\n\n private _onClickRemove(e: MouseEvent) {\n e.stopPropagation();\n\n this._searchText = \"\";\n\n const selectedDisabledOptions = this._selectedOptions.filter(option => option.disabled);\n\n this._connectedOptions\n .filter(option => !option.disabled && option.selected)\n .forEach(option => {\n option.selected = false;\n });\n\n this.value = selectedDisabledOptions.length\n ? selectedDisabledOptions.map(option => option.value)\n : null;\n this._handleSelectEvent();\n }\n\n private _checkAdditionalItemCount() {\n if (!this.multiple || !this.selectedOptionsItems || this.selectedOptionsItems.length < 2) {\n this._additionalSelectedOptionCount = 0;\n return;\n }\n\n const firstNonVisibleItemIndex = [...this.selectedOptionsItems].findIndex(\n item => item.offsetLeft > this.selectedOptionsContainer.offsetWidth\n );\n\n if (firstNonVisibleItemIndex > -1) {\n this._additionalSelectedOptionCount =\n this.selectedOptionsItems.length - firstNonVisibleItemIndex;\n } else {\n this._additionalSelectedOptionCount = 0;\n }\n }\n\n protected firstUpdated(): void {\n if (this.value === undefined) {\n if (this.multiple) {\n this.value = [];\n } else {\n this.value = null;\n }\n }\n\n this._initialValue = this._value;\n }\n\n protected updated(_changedProperties: PropertyValues) {\n if (\n _changedProperties.has(\"multiple\") &&\n typeof _changedProperties.get(\"multiple\") === \"boolean\"\n ) {\n this.value = null;\n }\n\n if (_changedProperties.has(\"_selectedOptions\")) {\n this._checkAdditionalItemCount();\n }\n }\n\n /**\n * This method is used by `bl-select-option` component to register itself to bl-select.\n * @param option BlSelectOption reference to be registered\n */\n registerOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.push(option);\n\n if (option.selected) {\n if (this.multiple) {\n if (!Array.isArray(this.value)) {\n this.value = [];\n }\n this.value = [...this.value, option.value];\n } else {\n this.value = option.value;\n }\n }\n\n this.setOptionsSelected();\n this.requestUpdate();\n }\n\n /**\n * This method is used by `bl-select-option` component to unregister itself from bl-select.\n * @param option BlSelectOption reference to be unregistered\n */\n unregisterOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.splice(this._connectedOptions.indexOf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EA2KX,wCAGA+D,EAAA,CADP1C,EAAS,sBAAsB,GA7KbrB,EA8KX,oCAGA+D,EAAA,CADPG,EAAM,UAAU,GAhLElE,EAiLX,wBAGA+D,EAAA,CADPG,EAAM,eAAe,GAnLHlE,EAoLX,4BAKoB+D,EAAA,CAA3B5D,EAAM,WAAW,GAzLCH,EAyLS,2BAOA+D,EAAA,CAA3B5D,EAAM,WAAW,GAhMCH,EAgMS,2BAiCpB+D,EAAA,CADPE,EAAM,GAhOYjE,EAiOX,gCAGA+D,EAAA,CADPE,EAAM,GAnOYjE,EAoOX,qBA+BR+D,EAAA,CADCG,EAAM,eAAe,GAlQHlE,EAmQnB,gCAnQmBA,EAArB+D,EAAA,CAFC1C,EAAc,WAAW,EACzB8C,EAAU,GACUnE",
|
|
6
|
+
"names": ["styles", "i", "bl_select_default", "_a", "BlSelect", "FormControlMixin", "s", "event", "eventPath", "el", "bl_select_default", "val", "formData", "option", "select", "_b", "_c", "autoUpdate", "computePosition", "flip", "offset", "size", "args", "x", "y", "e", "inputSelectedOptions", "item", "isRemoveButtonShown", "removeButton", "isSearchBarVisible", "hasSelectedOptions", "isDividerShown", "searchbarPlaceholderText", "msg", "searchMagIcon", "searchSpinner", "actionDivider", "search", "o", "l", "isAllRenderedOptionsSelected", "isAnySelected", "selectAllText", "invalidMessage", "helpMessage", "label", "noDataText", "clearSearchText", "key", "currentTime", "matchingOptionIndex", "activeOptions", "options", "searchText", "optionText", "isVisible", "lastVisibleOption", "optionItem", "selectAllEl", "checked", "isAllUnselectedDisabled", "checkbox", "selectedDisabledOptions", "firstNonVisibleItemIndex", "_changedProperties", "requiredValidator", "__decorateClass", "stringBooleanConverter", "t", "i", "localized"]
|
|
7
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as g}from"./chunk-OTAAXK2L.js";import{a as f}from"./chunk-GRL4DWKG.js";import{a as b,b as r,c,e as _}from"./chunk-5MOOXA2X.js";import{a as m,b as p}from"./chunk-4OT5AMS5.js";import{d as o}from"./chunk-IZ2LK5GK.js";var D=m`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}.datepicker-input{width:var(--bl-datepicker-input-width,auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`,E=D;var i=class extends g{constructor(){super(...arguments);this.size="medium";this.labelFixed=!1;this.valueFormatter=null;this._inputValue="";this._floatingDateCount=0;this._fittingDateCount=0}static get styles(){return[E]}defaultInputValueFormatter(){var t,e,n,
|
|
1
|
+
import{a as g}from"./chunk-OTAAXK2L.js";import{a as f}from"./chunk-GRL4DWKG.js";import{a as b,b as r,c,e as _}from"./chunk-5MOOXA2X.js";import{a as m,b as p}from"./chunk-4OT5AMS5.js";import{d as o}from"./chunk-IZ2LK5GK.js";var D=m`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}.datepicker-input{width:var(--bl-datepicker-input-width,auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`,E=D;var i=class extends g{constructor(){super(...arguments);this.size="medium";this.labelFixed=!1;this.valueFormatter=null;this._inputValue="";this._floatingDateCount=0;this._fittingDateCount=0}static get styles(){return[E]}defaultInputValueFormatter(){var t,e,l,n,a,s,d,h;if(this.type==="single")this._inputValue=this.formatDate((t=this._calendarEl)==null?void 0:t._dates[0]),this.closePopoverWithTimeout();else if(this.type==="multiple"){this.setFloatingDates();let u=(e=this._calendarEl)==null?void 0:e._dates.slice(0,this._fittingDateCount).map(v=>this.formatDate(v));this._inputValue=u.join(",")+(this._floatingDateCount>0?" ,...":"")}else this.type==="range"&&((l=this._calendarEl)!=null&&l._dates[0]&&(this._inputValue=this.formatDate((n=this._calendarEl)==null?void 0:n._dates[0])),(a=this._calendarEl)!=null&&a._dates[1]&&(this._inputValue=`${this._inputValue}-${this.formatDate((s=this._calendarEl)==null?void 0:s._dates[1])}`),(d=this._calendarEl)!=null&&d._dates[0]&&((h=this._calendarEl)!=null&&h._dates[1])&&this.closePopoverWithTimeout())}closePopoverWithTimeout(){setTimeout(()=>{this.closePopover(),this._inputEl.blur()},200)}setFloatingDates(){var n,a,s;let t=(n=this.shadowRoot)==null?void 0:n.getElementById("datepicker-input"),e=(a=this.shadowRoot)==null?void 0:a.getElementById("icon-container"),l=t.offsetWidth-e.offsetWidth;this._fittingDateCount=Math.floor(l/90),this._floatingDateCount=((s=this._calendarEl)==null?void 0:s._dates.length)-this._fittingDateCount}setDatePickerInput(){var t,e;(t=this._calendarEl)!=null&&t._dates.length?this.valueFormatter?this._inputValue=this.valueFormatter((e=this._calendarEl)==null?void 0:e._dates):this.defaultInputValueFormatter():this._inputValue=""}formatDate(t){return`${String(t==null?void 0:t.getDate()).padStart(2,"0")}/${String((t==null?void 0:t.getMonth())+1).padStart(2,"0")}/${t==null?void 0:t.getFullYear()}`}clearDatepicker(){this._calendarEl.handleClearSelectedDates(),this._inputValue="",this._floatingDateCount=0}openPopover(){this._popoverEl.target=this._inputEl,this._popoverEl.show()}closePopover(){this._popoverEl.hide()}_togglePopover(){this._popoverEl.visible?this.closePopover():this.openPopover()}formatAdditionalDates(t){let e=t.split(",");return e==null?void 0:e.reduce((l,n,a)=>(a>0&&a%3===0&&l.push(p`<br />`),l.push(p`<span>${n.trim()}${a<e.length-1?", ":""}</span>`),l),[])}async firstUpdated(){var t,e,l;this._onCalendarMouseDown=n=>{var a;n.preventDefault(),(a=this._inputEl)==null||a.focus()},this._onInputMouseDown=n=>{var a;n.preventDefault(),(a=this._inputEl)==null||a.focus()},(t=this._calendarEl)==null||t.addEventListener("mousedown",this._onCalendarMouseDown),(e=this._inputEl)==null||e.addEventListener("mousedown",this._onInputMouseDown),(l=this._calendarEl)!=null&&l._dates&&this.setDatePickerInput()}onCalendarChange(){var t;this.setDatePickerInput(),this._onBlDatepickerChange((t=this._calendarEl)==null?void 0:t._dates)}disconnectedCallback(){var t,e;super.disconnectedCallback(),(t=this._calendarEl)==null||t.removeEventListener("mousedown",this._onCalendarMouseDown),(e=this._inputEl)==null||e.removeEventListener("mousedown",this._onInputMouseDown)}render(){var s,d,h,u;let t=p`
|
|
2
2
|
<bl-popover target="datepicker-content" placement="bottom-start">
|
|
3
3
|
<bl-calendar
|
|
4
4
|
type=${this.type}
|
|
@@ -11,15 +11,16 @@ import{a as g}from"./chunk-OTAAXK2L.js";import{a as f}from"./chunk-GRL4DWKG.js";
|
|
|
11
11
|
@bl-calendar-change="${this.onCalendarChange}"
|
|
12
12
|
></bl-calendar>
|
|
13
13
|
</bl-popover>
|
|
14
|
-
`,e=(
|
|
14
|
+
`,e=(h=(d=(s=this._calendarEl)==null?void 0:s._dates)==null?void 0:d.slice(this._fittingDateCount).map(v=>this.formatDate(v)).join(","))!=null?h:"",l=this.formatAdditionalDates(e),n=this._floatingDateCount>0?p` <bl-tooltip>
|
|
15
15
|
<span slot="tooltip-trigger">+${this._floatingDateCount}</span>
|
|
16
|
-
<div>${
|
|
17
|
-
</bl-tooltip>`:"",a=((
|
|
16
|
+
<div>${l}</div>
|
|
17
|
+
</bl-tooltip>`:"",a=((u=this._calendarEl)==null?void 0:u._dates.length)>0?p` <bl-button
|
|
18
18
|
size="small"
|
|
19
19
|
variant="tertiary"
|
|
20
20
|
kind="neutral"
|
|
21
21
|
icon="close"
|
|
22
22
|
@click=${this.clearDatepicker}
|
|
23
|
+
?disabled=${this.disabled}
|
|
23
24
|
></bl-button>
|
|
24
25
|
<div class="action-divider"></div>`:"";return p`
|
|
25
26
|
<div class="datepicker-content" id="datepicker-content" tabindex="-1">
|
|
@@ -40,11 +41,11 @@ import{a as g}from"./chunk-OTAAXK2L.js";import{a as f}from"./chunk-GRL4DWKG.js";
|
|
|
40
41
|
readonly
|
|
41
42
|
>
|
|
42
43
|
<div slot="icon" class="icon-container" id="icon-container">
|
|
43
|
-
${
|
|
44
|
+
${n} ${a}
|
|
44
45
|
<bl-icon name="calendar" size="small" class="calendar-icon"></bl-icon>
|
|
45
46
|
</div>
|
|
46
47
|
</bl-input>
|
|
47
48
|
${t}
|
|
48
49
|
</div>
|
|
49
50
|
`}};o([r({type:String,attribute:"placeholder",reflect:!0})],i.prototype,"placeholder",2),o([r({type:String,reflect:!0})],i.prototype,"size",2),o([r({type:Boolean,attribute:"label-fixed",reflect:!0})],i.prototype,"labelFixed",2),o([r({type:String,attribute:"label",reflect:!0})],i.prototype,"label",2),o([r({type:Function,attribute:"value-formatter"})],i.prototype,"valueFormatter",2),o([r({type:Boolean})],i.prototype,"disabled",2),o([r({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),o([c()],i.prototype,"_inputValue",2),o([c()],i.prototype,"_floatingDateCount",2),o([c()],i.prototype,"_fittingDateCount",2),o([_("bl-calendar")],i.prototype,"_calendarEl",2),o([_("bl-popover")],i.prototype,"_popoverEl",2),o([_("bl-input")],i.prototype,"_inputEl",2),o([f("bl-datepicker-change")],i.prototype,"_onBlDatepickerChange",2),i=o([b("bl-datepicker")],i);export{i as a};
|
|
50
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-RQOF4US5.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/components/datepicker/bl-datepicker.css", "../src/components/datepicker/bl-datepicker.ts"],
|
|
4
|
-
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}.datepicker-input{width:var(--bl-datepicker-input-width,auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`;\nexport default styles;\n", "import { CSSResultGroup, html, TemplateResult } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { BlCalendar, BlPopover } from \"../../baklava\";\nimport DatepickerCalendarMixin from \"../../mixins/datepicker-calendar-mixin/datepicker-calendar-mixin\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../calendar/bl-calendar\";\nimport { CALENDAR_TYPES } from \"../calendar/bl-calendar.constant\";\nimport \"../input/bl-input\";\nimport BlInput, { InputSize } from \"../input/bl-input\";\nimport \"../tooltip/bl-tooltip\";\nimport style from \"./bl-datepicker.css\";\n\n/**\n * @tag bl-datepicker\n * @summary Baklava DatePicker component\n *\n * @cssproperty [--bl-datepicker-input-width] - Sets the width of datepicker input\n **/\n@customElement(\"bl-datepicker\")\nexport default class BlDatepicker extends DatepickerCalendarMixin {\n /**\n * Defines the datepicker input placeholder\n */\n @property({ type: String, attribute: \"placeholder\", reflect: true })\n placeholder: string;\n /**\n * Sets input size.\n */\n @property({ type: String, reflect: true })\n size?: InputSize = \"medium\";\n\n /**\n * Makes datepicker input label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n /**\n * Defines the datepicker input label\n */\n @property({ type: String, attribute: \"label\", reflect: true })\n label: string;\n /**\n * Defines the custom formatter function\n */\n @property({ type: Function, attribute: \"value-formatter\" })\n valueFormatter: ((dates: Date[]) => string) | null = null;\n /**\n * Sets datepicker to disabled\n */\n @property({ type: Boolean })\n disabled: boolean;\n /**\n * Defines help text to datepicker input for users\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText: string;\n\n @state()\n _inputValue = \"\";\n\n @state()\n _floatingDateCount: number = 0;\n\n @state()\n _fittingDateCount: number = 0;\n\n @query(\"bl-calendar\")\n _calendarEl: BlCalendar;\n\n @query(\"bl-popover\")\n _popoverEl: BlPopover;\n\n @query(\"bl-input\")\n _inputEl!: BlInput;\n\n private _onCalendarMouseDown!: (event: MouseEvent) => void;\n private _onInputMouseDown!: (event: MouseEvent) => void;\n\n /**\n * Fires when date selection is changed\n */\n @event(\"bl-datepicker-change\") private _onBlDatepickerChange: EventDispatcher<Date[]>;\n\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n defaultInputValueFormatter() {\n if (this.type === CALENDAR_TYPES.SINGLE) {\n this._inputValue = this.formatDate(this._calendarEl?._dates[0]);\n this.closePopoverWithTimeout();\n } else if (this.type === CALENDAR_TYPES.MULTIPLE) {\n this.setFloatingDates();\n const values = this._calendarEl?._dates\n .slice(0, this._fittingDateCount)\n .map(date => this.formatDate(date));\n\n this._inputValue = values.join(\",\") + (this._floatingDateCount > 0 ? \" ,...\" : \"\");\n } else if (this.type === CALENDAR_TYPES.RANGE) {\n if (this._calendarEl?._dates[0])\n this._inputValue = this.formatDate(this._calendarEl?._dates[0]);\n if (this._calendarEl?._dates[1])\n this._inputValue = `${this._inputValue}-${this.formatDate(this._calendarEl?._dates[1])}`;\n if (this._calendarEl?._dates[0] && this._calendarEl?._dates[1])\n this.closePopoverWithTimeout();\n }\n }\n\n closePopoverWithTimeout() {\n setTimeout(() => {\n this.closePopover();\n this._inputEl.blur();\n }, 200);\n }\n\n setFloatingDates() {\n const datepickerInput = this.shadowRoot?.getElementById(\"datepicker-input\");\n const iconsContainer = this.shadowRoot?.getElementById(\"icon-container\");\n const datesTextTotalWidth = datepickerInput!.offsetWidth! - iconsContainer!.offsetWidth!;\n\n this._fittingDateCount = Math.floor(datesTextTotalWidth / 90);\n\n this._floatingDateCount = this._calendarEl?._dates.length - this._fittingDateCount;\n }\n\n setDatePickerInput() {\n if (!this._calendarEl?._dates.length) {\n this._inputValue = \"\";\n } else {\n if (this.valueFormatter) {\n this._inputValue = this.valueFormatter(this._calendarEl?._dates);\n } else {\n this.defaultInputValueFormatter();\n }\n }\n }\n\n formatDate(date: Date): string {\n return `${String(date?.getDate()).padStart(2, \"0\")}/${String(date?.getMonth() + 1).padStart(\n 2,\n \"0\"\n )}/${date?.getFullYear()}`;\n }\n\n clearDatepicker() {\n this._calendarEl.handleClearSelectedDates();\n this._inputValue = \"\";\n this._floatingDateCount = 0;\n }\n\n openPopover() {\n this._popoverEl.target = this._inputEl;\n this._popoverEl.show();\n }\n\n closePopover() {\n this._popoverEl.hide();\n }\n\n _togglePopover() {\n this._popoverEl.visible ? this.closePopover() : this.openPopover();\n }\n\n formatAdditionalDates(str: string): TemplateResult[] {\n const parts = str.split(\",\");\n\n return parts?.reduce<TemplateResult[]>((acc, part, index) => {\n if (index > 0 && index % 3 === 0) {\n acc.push(html`<br />`);\n }\n acc.push(html`<span>${part.trim()}${index < parts.length - 1 ? \", \" : \"\"}</span>`);\n return acc;\n }, []);\n }\n\n async firstUpdated() {\n this._onCalendarMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._onInputMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._calendarEl?.addEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.addEventListener(\"mousedown\", this._onInputMouseDown);\n\n if (this._calendarEl?._dates) {\n this.setDatePickerInput();\n }\n }\n\n onCalendarChange() {\n this.setDatePickerInput();\n this._onBlDatepickerChange(this._calendarEl?._dates);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._calendarEl?.removeEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.removeEventListener(\"mousedown\", this._onInputMouseDown);\n }\n\n render() {\n const renderCalendar = html`\n <bl-popover target=\"datepicker-content\" placement=\"bottom-start\">\n <bl-calendar\n type=${this.type}\n .minDate=${this.minDate}\n .maxDate=${this.maxDate}\n .startOfWeek=${this.startOfWeek}\n .disabledDates=${this.disabledDates}\n .value=${this.value}\n .locale=${this.locale}\n @bl-calendar-change=\"${this.onCalendarChange}\"\n ></bl-calendar>\n </bl-popover>\n `;\n const additionalDates =\n this._calendarEl?._dates\n ?.slice(this._fittingDateCount)\n .map(date => {\n return this.formatDate(date);\n })\n .join(\",\") ?? \"\";\n\n const formattedAdditionalDates = this.formatAdditionalDates(additionalDates);\n\n const additionalDatesView =\n this._floatingDateCount > 0\n ? html` <bl-tooltip>\n <span slot=\"tooltip-trigger\">+${this._floatingDateCount}</span>\n <div>${formattedAdditionalDates}</div>\n </bl-tooltip>`\n : \"\";\n\n const clearDatepickerButton =\n this._calendarEl?._dates.length > 0\n ? html` <bl-button\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this.clearDatepicker}\n ></bl-button>\n <div class=\"action-divider\"></div>`\n : \"\";\n\n return html`\n <div class=\"datepicker-content\" id=\"datepicker-content\" tabindex=\"-1\">\n <bl-input\n .value=\"${this._inputValue}\"\n .label=\"${this.label}\"\n placeholder=\"${this.placeholder}\"\n class=\"datepicker-input\"\n role=\"button\"\n id=\"datepicker-input\"\n aria-haspopup=\"listbox\"\n aria-labelledby=\"label\"\n @click=${this._togglePopover}\n help-text=${this.helpText}\n ?disabled=${this.disabled}\n .size=${this.size}\n .labelFixed=${this.labelFixed}\n readonly\n >\n <div slot=\"icon\" class=\"icon-container\" id=\"icon-container\">\n ${additionalDatesView} ${clearDatepickerButton}\n <bl-icon name=\"calendar\" size=\"small\" class=\"calendar-icon\"></bl-icon>\n </div>\n </bl-input>\n ${renderCalendar}\n </div>\n `;\n }\n}\n"],
|
|
5
|
-
"mappings": "+NACO,IAAMA,EAASC,gzBACfC,EAAQF,ECiBf,IAAqBG,EAArB,cAA0CC,CAAwB,CAAlE,kCAUE,UAAmB,SAMnB,gBAAa,GAUb,oBAAqD,KAarD,iBAAc,GAGd,wBAA6B,EAG7B,uBAA4B,EAmB5B,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAEA,4BAA6B,CAvF/B,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAwFI,GAAI,KAAK,gBACP,KAAK,YAAc,KAAK,YAAWP,EAAA,KAAK,cAAL,YAAAA,EAAkB,OAAO,EAAE,EAC9D,KAAK,wBAAwB,UACpB,KAAK,kBAAkC,CAChD,KAAK,iBAAiB,EACtB,IAAMQ,GAASP,EAAA,KAAK,cAAL,YAAAA,EAAkB,OAC9B,MAAM,EAAG,KAAK,mBACd,IAAIQ,GAAQ,KAAK,WAAWA,CAAI,GAEnC,KAAK,YAAcD,EAAO,KAAK,GAAG,GAAK,KAAK,mBAAqB,EAAI,QAAU,SACtE,KAAK,kBACVN,EAAA,KAAK,cAAL,MAAAA,EAAkB,OAAO,KAC3B,KAAK,YAAc,KAAK,YAAWC,EAAA,KAAK,cAAL,YAAAA,EAAkB,OAAO,EAAE,IAC5DC,EAAA,KAAK,cAAL,MAAAA,EAAkB,OAAO,KAC3B,KAAK,YAAc,GAAG,KAAK,eAAe,KAAK,YAAWC,EAAA,KAAK,cAAL,YAAAA,EAAkB,OAAO,EAAE,MACnFC,EAAA,KAAK,cAAL,MAAAA,EAAkB,OAAO,MAAMC,EAA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,KAAK;AAAA;AAAA;AAAA,MAI5BG,GACJnB,GAAAD,GAAAD,EAAA,KAAK,cAAL,YAAAA,EAAkB,SAAlB,YAAAC,EACI,MAAM,KAAK,mBACZ,IAAIQ,GACI,KAAK,WAAWA,CAAI,GAE5B,KAAK,OALR,KAAAP,EAKgB,GAEZoB,EAA2B,KAAK,sBAAsBD,CAAe,EAErEE,EACJ,KAAK,mBAAqB,EACtBL;AAAA,4CACkC,KAAK;AAAA,mBAC9BI;AAAA,yBAET,GAEAE,IACJrB,EAAA,KAAK,cAAL,YAAAA,EAAkB,OAAO,QAAS,EAC9Be;AAAA;AAAA;AAAA;AAAA;AAAA,uBAKa,KAAK;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}.datepicker-input{width:var(--bl-datepicker-input-width,auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`;\nexport default styles;\n", "import { CSSResultGroup, html, TemplateResult } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { BlCalendar, BlPopover } from \"../../baklava\";\nimport DatepickerCalendarMixin from \"../../mixins/datepicker-calendar-mixin/datepicker-calendar-mixin\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../calendar/bl-calendar\";\nimport { CALENDAR_TYPES } from \"../calendar/bl-calendar.constant\";\nimport \"../input/bl-input\";\nimport BlInput, { InputSize } from \"../input/bl-input\";\nimport \"../tooltip/bl-tooltip\";\nimport style from \"./bl-datepicker.css\";\n\n/**\n * @tag bl-datepicker\n * @summary Baklava DatePicker component\n *\n * @cssproperty [--bl-datepicker-input-width] - Sets the width of datepicker input\n **/\n@customElement(\"bl-datepicker\")\nexport default class BlDatepicker extends DatepickerCalendarMixin {\n /**\n * Defines the datepicker input placeholder\n */\n @property({ type: String, attribute: \"placeholder\", reflect: true })\n placeholder: string;\n /**\n * Sets input size.\n */\n @property({ type: String, reflect: true })\n size?: InputSize = \"medium\";\n\n /**\n * Makes datepicker input label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n /**\n * Defines the datepicker input label\n */\n @property({ type: String, attribute: \"label\", reflect: true })\n label: string;\n /**\n * Defines the custom formatter function\n */\n @property({ type: Function, attribute: \"value-formatter\" })\n valueFormatter: ((dates: Date[]) => string) | null = null;\n /**\n * Sets datepicker to disabled\n */\n @property({ type: Boolean })\n disabled: boolean;\n /**\n * Defines help text to datepicker input for users\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText: string;\n\n @state()\n _inputValue = \"\";\n\n @state()\n _floatingDateCount: number = 0;\n\n @state()\n _fittingDateCount: number = 0;\n\n @query(\"bl-calendar\")\n _calendarEl: BlCalendar;\n\n @query(\"bl-popover\")\n _popoverEl: BlPopover;\n\n @query(\"bl-input\")\n _inputEl!: BlInput;\n\n private _onCalendarMouseDown!: (event: MouseEvent) => void;\n private _onInputMouseDown!: (event: MouseEvent) => void;\n\n /**\n * Fires when date selection is changed\n */\n @event(\"bl-datepicker-change\") private _onBlDatepickerChange: EventDispatcher<Date[]>;\n\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n defaultInputValueFormatter() {\n if (this.type === CALENDAR_TYPES.SINGLE) {\n this._inputValue = this.formatDate(this._calendarEl?._dates[0]);\n this.closePopoverWithTimeout();\n } else if (this.type === CALENDAR_TYPES.MULTIPLE) {\n this.setFloatingDates();\n const values = this._calendarEl?._dates\n .slice(0, this._fittingDateCount)\n .map(date => this.formatDate(date));\n\n this._inputValue = values.join(\",\") + (this._floatingDateCount > 0 ? \" ,...\" : \"\");\n } else if (this.type === CALENDAR_TYPES.RANGE) {\n if (this._calendarEl?._dates[0])\n this._inputValue = this.formatDate(this._calendarEl?._dates[0]);\n if (this._calendarEl?._dates[1])\n this._inputValue = `${this._inputValue}-${this.formatDate(this._calendarEl?._dates[1])}`;\n if (this._calendarEl?._dates[0] && this._calendarEl?._dates[1])\n this.closePopoverWithTimeout();\n }\n }\n\n closePopoverWithTimeout() {\n setTimeout(() => {\n this.closePopover();\n this._inputEl.blur();\n }, 200);\n }\n\n setFloatingDates() {\n const datepickerInput = this.shadowRoot?.getElementById(\"datepicker-input\");\n const iconsContainer = this.shadowRoot?.getElementById(\"icon-container\");\n const datesTextTotalWidth = datepickerInput!.offsetWidth! - iconsContainer!.offsetWidth!;\n\n this._fittingDateCount = Math.floor(datesTextTotalWidth / 90);\n\n this._floatingDateCount = this._calendarEl?._dates.length - this._fittingDateCount;\n }\n\n setDatePickerInput() {\n if (!this._calendarEl?._dates.length) {\n this._inputValue = \"\";\n } else {\n if (this.valueFormatter) {\n this._inputValue = this.valueFormatter(this._calendarEl?._dates);\n } else {\n this.defaultInputValueFormatter();\n }\n }\n }\n\n formatDate(date: Date): string {\n return `${String(date?.getDate()).padStart(2, \"0\")}/${String(date?.getMonth() + 1).padStart(\n 2,\n \"0\"\n )}/${date?.getFullYear()}`;\n }\n\n clearDatepicker() {\n this._calendarEl.handleClearSelectedDates();\n this._inputValue = \"\";\n this._floatingDateCount = 0;\n }\n\n openPopover() {\n this._popoverEl.target = this._inputEl;\n this._popoverEl.show();\n }\n\n closePopover() {\n this._popoverEl.hide();\n }\n\n _togglePopover() {\n this._popoverEl.visible ? this.closePopover() : this.openPopover();\n }\n\n formatAdditionalDates(str: string): TemplateResult[] {\n const parts = str.split(\",\");\n\n return parts?.reduce<TemplateResult[]>((acc, part, index) => {\n if (index > 0 && index % 3 === 0) {\n acc.push(html`<br />`);\n }\n acc.push(html`<span>${part.trim()}${index < parts.length - 1 ? \", \" : \"\"}</span>`);\n return acc;\n }, []);\n }\n\n async firstUpdated() {\n this._onCalendarMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._onInputMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._calendarEl?.addEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.addEventListener(\"mousedown\", this._onInputMouseDown);\n\n if (this._calendarEl?._dates) {\n this.setDatePickerInput();\n }\n }\n\n onCalendarChange() {\n this.setDatePickerInput();\n this._onBlDatepickerChange(this._calendarEl?._dates);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._calendarEl?.removeEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.removeEventListener(\"mousedown\", this._onInputMouseDown);\n }\n\n render() {\n const renderCalendar = html`\n <bl-popover target=\"datepicker-content\" placement=\"bottom-start\">\n <bl-calendar\n type=${this.type}\n .minDate=${this.minDate}\n .maxDate=${this.maxDate}\n .startOfWeek=${this.startOfWeek}\n .disabledDates=${this.disabledDates}\n .value=${this.value}\n .locale=${this.locale}\n @bl-calendar-change=\"${this.onCalendarChange}\"\n ></bl-calendar>\n </bl-popover>\n `;\n const additionalDates =\n this._calendarEl?._dates\n ?.slice(this._fittingDateCount)\n .map(date => {\n return this.formatDate(date);\n })\n .join(\",\") ?? \"\";\n\n const formattedAdditionalDates = this.formatAdditionalDates(additionalDates);\n\n const additionalDatesView =\n this._floatingDateCount > 0\n ? html` <bl-tooltip>\n <span slot=\"tooltip-trigger\">+${this._floatingDateCount}</span>\n <div>${formattedAdditionalDates}</div>\n </bl-tooltip>`\n : \"\";\n\n const clearDatepickerButton =\n this._calendarEl?._dates.length > 0\n ? html` <bl-button\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this.clearDatepicker}\n ?disabled=${this.disabled}\n ></bl-button>\n <div class=\"action-divider\"></div>`\n : \"\";\n\n return html`\n <div class=\"datepicker-content\" id=\"datepicker-content\" tabindex=\"-1\">\n <bl-input\n .value=\"${this._inputValue}\"\n .label=\"${this.label}\"\n placeholder=\"${this.placeholder}\"\n class=\"datepicker-input\"\n role=\"button\"\n id=\"datepicker-input\"\n aria-haspopup=\"listbox\"\n aria-labelledby=\"label\"\n @click=${this._togglePopover}\n help-text=${this.helpText}\n ?disabled=${this.disabled}\n .size=${this.size}\n .labelFixed=${this.labelFixed}\n readonly\n >\n <div slot=\"icon\" class=\"icon-container\" id=\"icon-container\">\n ${additionalDatesView} ${clearDatepickerButton}\n <bl-icon name=\"calendar\" size=\"small\" class=\"calendar-icon\"></bl-icon>\n </div>\n </bl-input>\n ${renderCalendar}\n </div>\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": "+NACO,IAAMA,EAASC,gzBACfC,EAAQF,ECiBf,IAAqBG,EAArB,cAA0CC,CAAwB,CAAlE,kCAUE,UAAmB,SAMnB,gBAAa,GAUb,oBAAqD,KAarD,iBAAc,GAGd,wBAA6B,EAG7B,uBAA4B,EAmB5B,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAEA,4BAA6B,CAvF/B,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAwFI,GAAI,KAAK,gBACP,KAAK,YAAc,KAAK,YAAWP,EAAA,KAAK,cAAL,YAAAA,EAAkB,OAAO,EAAE,EAC9D,KAAK,wBAAwB,UACpB,KAAK,kBAAkC,CAChD,KAAK,iBAAiB,EACtB,IAAMQ,GAASP,EAAA,KAAK,cAAL,YAAAA,EAAkB,OAC9B,MAAM,EAAG,KAAK,mBACd,IAAIQ,GAAQ,KAAK,WAAWA,CAAI,GAEnC,KAAK,YAAcD,EAAO,KAAK,GAAG,GAAK,KAAK,mBAAqB,EAAI,QAAU,SACtE,KAAK,kBACVN,EAAA,KAAK,cAAL,MAAAA,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AAA,CADCC,EAAS,CAAE,KAAM,QAAS,UAAW,cAAe,QAAS,EAAK,CAAC,GAfjD7B,EAgBnB,0BAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,QAAS,QAAS,EAAK,CAAC,GApB1C7B,EAqBnB,qBAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,SAAU,UAAW,iBAAkB,CAAC,GAzBvC7B,EA0BnB,8BAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,CAAC,GA9BR7B,EA+BnB,wBAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,YAAa,QAAS,EAAK,CAAC,GAnC9C7B,EAoCnB,wBAGA4B,EAAA,CADCE,EAAM,GAtCY9B,EAuCnB,2BAGA4B,EAAA,CADCE,EAAM,GAzCY9B,EA0CnB,kCAGA4B,EAAA,CADCE,EAAM,GA5CY9B,EA6CnB,iCAGA4B,EAAA,CADCG,EAAM,aAAa,GA/CD/B,EAgDnB,2BAGA4B,EAAA,CADCG,EAAM,YAAY,GAlDA/B,EAmDnB,0BAGA4B,EAAA,CADCG,EAAM,UAAU,GArDE/B,EAsDnB,wBAQuC4B,EAAA,CAAtCN,EAAM,sBAAsB,GA9DVtB,EA8DoB,qCA9DpBA,EAArB4B,EAAA,CADCC,EAAc,eAAe,GACT7B",
|
|
6
6
|
"names": ["styles", "i", "bl_datepicker_default", "BlDatepicker", "DatepickerCalendarMixin", "bl_datepicker_default", "_a", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "values", "date", "datepickerInput", "iconsContainer", "datesTextTotalWidth", "str", "parts", "acc", "part", "index", "x", "event", "renderCalendar", "additionalDates", "formattedAdditionalDates", "additionalDatesView", "clearDatepickerButton", "__decorateClass", "e", "t", "i"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bl-datepicker.d.ts","sourceRoot":"","sources":["../../../src/components/datepicker/bl-datepicker.ts"],"names":[],"mappings":"A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EG;IAC4B,OAAO,CAAC,qBAAqB,CAA0B;IAEtF,MAAM,KAAK,MAAM,IAAI,cAAc,CAElC;IAED,0BAA0B;IAqB1B,uBAAuB;IAOvB,gBAAgB;IAUhB,kBAAkB;IAYlB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM;IAO9B,eAAe;IAMf,WAAW;IAKX,YAAY;IAIZ,cAAc;IAId,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,cAAc,EAAE;IAY9C,YAAY;IAmBlB,gBAAgB;IAKhB,oBAAoB;IAMpB,MAAM;CAyEP"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-RQOF4US5.js";import"../../chunk-DE3A37FL.js";import"../../chunk-UOGCEUXK.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-WC5CTIZH.js";import"../../chunk-23PSWIUF.js";import"../../chunk-OTAAXK2L.js";import"../../chunk-IPYZIIRV.js";import"../../chunk-WEEGH2F4.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-4UO3W4WP.js";import"../../chunk-ZE7GYACV.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-HBPBDC7T.js";import"../../chunk-DINNT5P2.js";import"../../chunk-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-datepicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-H4WETBHJ.js";import"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-H4WETBHJ.js";import"../../chunk-4XJNC424.js";import"../../chunk-RER7OLAQ.js";import"../../chunk-MWFGDECP.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-WC5CTIZH.js";import"../../chunk-23PSWIUF.js";import"../../chunk-IPYZIIRV.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-4UO3W4WP.js";import"../../chunk-ZE7GYACV.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-HBPBDC7T.js";import"../../chunk-ECPWEUBG.js";import"../../chunk-DINNT5P2.js";import"../../chunk-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-pagination.js.map
|
|
@@ -147,6 +147,7 @@ export default class BlSelect<ValueType extends FormValue = string> extends BlSe
|
|
|
147
147
|
close(): void;
|
|
148
148
|
private _interactOutsideHandler;
|
|
149
149
|
private _setupPopover;
|
|
150
|
+
private _handleToggleButtonClick;
|
|
150
151
|
connectedCallback(): void;
|
|
151
152
|
disconnectedCallback(): void;
|
|
152
153
|
private inputTemplate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bl-select.d.ts","sourceRoot":"","sources":["../../../src/components/select/bl-select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAOvF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,4BAA4B,CAAC;AAIpC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,wCAAwC,CAAC;AAEhD,OAAO,iBAAiB,CAAC;AAEzB,OAAO,mCAAmC,CAAC;AAC3C,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC;AAE5D,MAAM,WAAW,aAAa,CAAC,CAAC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AAE,QAAQ,CAAC;KACvB;CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-4XJNC424.js";import"../../chunk-RER7OLAQ.js";import"../../chunk-MWFGDECP.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-4UO3W4WP.js";import"../../chunk-ZE7GYACV.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-HBPBDC7T.js";import"../../chunk-ECPWEUBG.js";import"../../chunk-DINNT5P2.js";import"../../chunk-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-select.js.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trendyol/baklava",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "3.4.0-beta.
|
|
4
|
+
"version": "3.4.0-beta.3",
|
|
5
5
|
"description": "Trendyol Baklava Design System",
|
|
6
6
|
"main": "dist/baklava.js",
|
|
7
7
|
"module": "dist/baklava.js",
|
|
@@ -140,7 +140,7 @@
|
|
|
140
140
|
"stylelint-config-standard": "^34.0.0",
|
|
141
141
|
"ts-lit-plugin": "^2.0.1",
|
|
142
142
|
"typescript": "5.3.3",
|
|
143
|
-
"wait-on": "^
|
|
143
|
+
"wait-on": "^8.0.2"
|
|
144
144
|
},
|
|
145
145
|
"peerDependencies": {
|
|
146
146
|
"@trendyol/baklava-icons": ">=1.0.0"
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/select/bl-select.css", "../src/components/select/bl-select.ts"],
|
|
4
|
-
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-neutral-full);--border-color:var(--bl-color-neutral-lighter);--border-focus-color:var(--bl-color-primary-highlight);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--label-color:var(--bl-color-neutral-dark);--placeholder-color:var(--bl-color-neutral-light);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-neutral-lightest);--menu-height:250px;--popover-position:var(--bl-popover-position, fixed)}:host([multiple][view-select-all]) .select-wrapper{--menu-height:290px}:host([size=large]) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size=small]) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-neutral-light)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-highlight);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);-webkit-user-select:none;user-select:none;margin:0;width:auto;min-width:100%}.label,.placeholder{color:var(--placeholder-color);padding-inline-start:var(--label-padding);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.select-wrapper.selected .placeholder,:host(:not([placeholder])) .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}:host(:not([label])) .label,:host([label-fixed]) .label{display:none}.remove-all{display:none}.selected .remove-all{display:block}:host([disabled]) .remove-all,:host([disabled]) .remove-all::after{display:none}.dropdown-icon{font-size:var(--bl-font-size-m)}.dropdown-icon.open{display:none}.select-open .dropdown-icon.open{display:inline-block}.select-open .dropdown-icon.closed{display:none}.selected .dropdown-icon{--icon-color:var(--bl-color-neutral-darker)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-neutral-light)}.select-input:focus-visible,.select-open .select-input{border:solid 1px var(--border-focus-color);outline:0}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;padding-inline-start:var(--label-padding);margin:0;list-style:none;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([disabled]) .select-input .selected-options{color:var(--bl-color-neutral-light)}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}.selected-options li:not(:last-child)::after{content:\", \"}.select-input:not(.has-overflowed-options) .additional-selection-count{display:none}:host([disabled]) .additional-selection-count{color:var(--bl-color-neutral-light)}:host([disabled]) .selected-options li{color:var(--bl-color-neutral-light)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-4xs);margin-inline-start:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:var(--popover-position);border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--bl-index-popover);width:100%;top:var(--top);left:var(--left)}:host(:empty) .popover{display:none}.popover-no-result{display:flex;flex-direction:column;gap:var(--bl-size-2xs);align-items:center;justify-content:center;height:80px}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}label,legend{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;display:block;top:var(--padding-vertical);left:var(--padding-horizontal);inset-inline-end:calc(var(--bl-size-2xs) + var(--bl-size-m) + var(--bl-size-2xs));transition:.1s ease-in;pointer-events:none;opacity:0;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color)}legend{height:0;visibility:hidden;display:none}legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:host(:not([placeholder])) .selected .label,:host([placeholder]) :where(.select-open,.selected) .label{display:none}:where(.select-open,.selected) label{top:0;transform:translateY(-50%);font:var(--bl-font-caption);color:var(--label-color);pointer-events:initial;right:var(--padding-horizontal);opacity:1}:host([label]) :where(.select-open,.selected) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host([label-fixed]) label{position:static;padding:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--label-color);opacity:1}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.error-icon,.invalid-text{display:none}.dirty.invalid label,.error-icon,.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}.dirty.invalid .hint,:host([help-text]) .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.select-all{position:sticky;top:0;padding:var(--bl-size-xs) 0;background:var(--background-color);z-index:1;font:var(--bl-font-title-3-regular);box-shadow:10px 0 0 var(--background-color),-10px 0 0 var(--background-color)}.select-all::after{position:absolute;content:\"\";width:100%;bottom:0;border-bottom:1px solid var(--bl-color-neutral-lighter)}.search-bar-input{font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--text-color);border:none;outline:0;background-color:transparent;width:100%;height:100%;padding:0;margin:0;box-sizing:border-box}.search-bar-input::placeholder{color:var(--placeholder-color)}.search-bar-input:focus-visible{outline:0}.search-spinner{padding-inline-end:var(--bl-font-size-2xs)}.action-divider{display:none}.select-wrapper .action-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}.actions bl-icon{padding:4px}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, query, queryAll, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { autoUpdate, computePosition, flip, MiddlewareState, offset, size } from \"@floating-ui/dom\";\nimport { localized, msg } from \"@lit/localize\";\nimport { FormControlMixin, requiredValidator } from \"@open-wc/form-control\";\nimport { FormValue } from \"@open-wc/form-helpers\";\nimport \"element-internals-polyfill\";\nimport { LangKey } from \"../../localization\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { stringBooleanConverter } from \"../../utilities/string-boolean.converter\";\nimport \"../button/bl-button\";\nimport \"../checkbox-group/checkbox/bl-checkbox\";\nimport BlCheckbox from \"../checkbox-group/checkbox/bl-checkbox\";\nimport \"../icon/bl-icon\";\nimport style from \"../select/bl-select.css\";\nimport \"../select/option/bl-select-option\";\nimport type BlSelectOption from \"./option/bl-select-option\";\n\nexport interface ISelectOption<T = string> {\n value: T;\n text: string;\n selected: boolean;\n}\n\nexport type SelectSize = \"medium\" | \"large\" | \"small\";\n\nexport type CleanUpFunction = () => void;\n\n/**\n * @tag bl-select\n * @summary Baklava Select component\n *\n * @cssproperty [--bl-popover-position=fixed] Sets the positioning strategy of select popover. You can set it as `absolute` if you need to show popover relative to its trigger element.\n */\n@customElement(\"bl-select\")\n@localized()\nexport default class BlSelect<ValueType extends FormValue = string> extends FormControlMixin(\n LitElement\n) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static formControlValidators = [requiredValidator];\n\n /**\n * Sets name of the select field\n */\n @property()\n name: string;\n\n private _value: ValueType | ValueType[] | null;\n\n private _initialValue: ValueType | ValueType[] | null;\n\n /**\n * Sets the value of the select\n */\n @property()\n get value(): ValueType | ValueType[] | null {\n return this._value;\n }\n\n set value(val: ValueType | ValueType[] | null) {\n this._value = val;\n\n if (Array.isArray(val)) {\n const formData = new FormData();\n\n val.forEach(option => formData.append(this.name, `${option}`));\n this.setValue(formData);\n } else {\n this.setValue(val);\n }\n\n this.setOptionsSelected();\n }\n\n shouldFormValueUpdate(): boolean {\n return this.value !== null && this.value !== \"\";\n }\n\n /* Declare reactive properties */\n /**\n * Sets the label value\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Sets the placeholder value. If left blank, the label value (if specified) is set as placeholder.\n */\n @property({ reflect: true })\n placeholder?: string;\n\n /**\n * Sets the size value. Select component's height value will be changed accordingly\n */\n @property({ type: String, reflect: true })\n size: SelectSize = \"medium\";\n\n /**\n * When option is not selected, shows component in error state\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Shows the component in disabled state.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets whether the selected option is clearable\n */\n @property({ type: Boolean, reflect: true })\n clearable = false;\n\n /**\n * Allows multiple options to be selected\n */\n @property({ type: Boolean, reflect: true })\n multiple = false;\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText?: string;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: \"invalid-text\", reflect: true })\n customInvalidText?: string;\n\n /**\n * Views select all option in multiple select\n */\n @property({ type: Boolean, attribute: \"view-select-all\", converter: stringBooleanConverter() })\n viewSelectAll = false;\n\n /**\n * Sets select all text in multiple select\n */\n @property({ type: String, attribute: \"select-all-text\" })\n selectAllText?: string;\n\n /**\n * Enable search functionality for the options within the list\n */\n @property({ type: Boolean, attribute: \"search-bar\", reflect: true })\n searchBar = false;\n\n /**\n * Search for text variations such as \"search,\" \"searching,\" \"search by country,\" and so on\n */\n @property({ type: String, attribute: \"search-bar-placeholder\", reflect: true })\n searchBarPlaceholder?: string;\n\n /**\n * Display a loading icon in place of the search icon.\n */\n @property({\n type: Boolean,\n attribute: \"search-bar-loading-state\",\n converter: stringBooleanConverter(),\n })\n searchBarLoadingState = false;\n\n /**\n * Text to display when no search results are found.\n */\n @property({ type: String, attribute: \"search-not-found-text\", reflect: true })\n searchNotFoundText?: string;\n\n /**\n * Text to display on the clear search button.\n */\n @property({ type: String, attribute: \"popover-clear-search-text\", reflect: true })\n popoverClearSearchText?: string;\n\n /* Declare internal reactive properties */\n @state()\n private _isPopoverOpen = false;\n\n @state()\n private _additionalSelectedOptionCount = 0;\n\n @state()\n private _searchText = \"\";\n\n @query(\".selected-options\")\n private selectedOptionsContainer!: HTMLElement;\n\n @queryAll(\".selected-options li\")\n private selectedOptionsItems!: NodeListOf<HTMLElement>;\n\n @query(\".popover\")\n private _popover: HTMLElement;\n\n @query(\".select-input\")\n private _selectInput: HTMLElement;\n\n /**\n * Fires when selection changes\n */\n @event(\"bl-select\") private _onBlSelect: EventDispatcher<\n ISelectOption<ValueType>[] | ISelectOption<ValueType>\n >;\n\n /**\n * Fires when search text changes\n */\n @event(\"bl-search\") private _onBlSearch: EventDispatcher<string>;\n\n private userLang =\n (document.querySelector(\"html\")?.getAttribute(\"lang\") as LangKey | null) || navigator.language;\n\n private _connectedOptions: BlSelectOption<ValueType>[] = [];\n\n private _cleanUpPopover: CleanUpFunction | null = null;\n\n private setOptionsSelected() {\n this._connectedOptions.forEach(\n option =>\n (option.selected =\n this.value === option.value ||\n (Array.isArray(this.value) && this.value.includes(option.value)))\n );\n\n this._selectedOptions = [...this.options.filter(option => option.selected)];\n }\n\n get options() {\n return this._connectedOptions;\n }\n\n get opened() {\n return this._isPopoverOpen;\n }\n\n get noResultFound() {\n return this._searchText !== \"\" && this._connectedOptions.every(option => option.hidden);\n }\n\n @state()\n private _selectedOptions: BlSelectOption<ValueType>[] = [];\n\n @state()\n private dirty = false;\n\n get selectedOptions(): BlSelectOption<ValueType>[] {\n return this._selectedOptions;\n }\n\n get additionalSelectedOptionCount() {\n return this._additionalSelectedOptionCount;\n }\n\n validityCallback(): string | void {\n if (this.customInvalidText) {\n return this.customInvalidText;\n }\n const select = document.createElement(\"select\");\n\n select.required = this.required;\n\n return select.validationMessage;\n }\n\n reportValidity() {\n this.dirty = true;\n return this.checkValidity();\n }\n\n resetFormControl(): void {\n this.value = this._initialValue;\n }\n\n @query(\".select-input\")\n validationTarget: HTMLElement;\n\n open() {\n if (this.searchBar) {\n setTimeout(() => {\n document.activeElement?.shadowRoot?.querySelector(\"input\")?.focus();\n }, 100);\n }\n\n this._isPopoverOpen = true;\n this._setupPopover();\n document.addEventListener(\"click\", this._interactOutsideHandler, true);\n document.addEventListener(\"focus\", this._interactOutsideHandler, true);\n }\n\n close() {\n this._handleSearchOptions({ target: { value: \"\" } } as InputEvent & {\n target: HTMLInputElement;\n });\n\n this._isPopoverOpen = false;\n this.focusedOptionIndex = -1;\n this._cleanUpPopover && this._cleanUpPopover();\n document.removeEventListener(\"click\", this._interactOutsideHandler, true);\n document.removeEventListener(\"focus\", this._interactOutsideHandler, true);\n }\n\n private _interactOutsideHandler = (event: MouseEvent | FocusEvent) => {\n const eventPath = event.composedPath() as HTMLElement[];\n\n if (!eventPath?.find(el => el.tagName === \"BL-SELECT\")?.contains(this)) {\n this.close();\n }\n };\n\n private _setupPopover() {\n this._cleanUpPopover = autoUpdate(this._selectInput, this._popover, () => {\n computePosition(this._selectInput, this._popover, {\n placement: \"bottom\",\n strategy: \"fixed\",\n middleware: [\n flip(),\n offset(8),\n size({\n apply(args: MiddlewareState) {\n Object.assign(args.elements.floating.style, {\n width: `${args.elements.reference.getBoundingClientRect().width}px`,\n });\n },\n }),\n ],\n }).then(({ x, y }) => {\n this._popover.style.setProperty(\"--left\", `${x}px`);\n this._popover.style.setProperty(\"--top\", `${y}px`);\n });\n });\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.form?.addEventListener(\"submit\", (e: SubmitEvent) => {\n if (!this.reportValidity()) {\n e.preventDefault();\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this._cleanUpPopover && this._cleanUpPopover();\n }\n\n private inputTemplate() {\n const inputSelectedOptions = html`<ul class=\"selected-options\">\n ${this._selectedOptions.map(\n item => html`<li>${item.getAttribute(\"label\") || item.textContent}</li>`\n )}\n </ul>`;\n\n const isAllSelectedDisabled =\n this._selectedOptions.length > 0 && this._selectedOptions.every(option => option.disabled);\n const isRemoveButtonShown = !isAllSelectedDisabled && (this.clearable || this.multiple);\n const removeButton = isRemoveButtonShown\n ? html`<bl-button\n class=\"remove-all\"\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this._onClickRemove}\n ></bl-button>`\n : \"\";\n\n const isSearchBarVisible = this.searchBar && this.opened;\n const hasSelectedOptions = this._selectedOptions.length > 0;\n\n const isDividerShown = isSearchBarVisible || (hasSelectedOptions && isRemoveButtonShown);\n\n const searchbarPlaceholderText =\n this.searchBarPlaceholder ?? msg(\"Search\", { desc: \"bl-select: search placeholder text\" });\n\n const searchMagIcon = html`<bl-icon\n class=\"search-mag-icon\"\n name=\"search\"\n style=\"color: var(--bl-color-primary);font-size: var(--bl-font-size-s)\"\n ></bl-icon>`;\n\n const searchSpinner = html`<bl-spinner class=\"search-spinner\"></bl-spinner>`;\n\n const actionDivider = isDividerShown ? html`<div class=\"action-divider\"></div>` : \"\";\n\n const search = html`<fieldset\n class=${classMap({\n \"select-input\": true,\n \"has-overflowed-options\": this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${this.disabled ? \"-1\" : 0}\"\n .autofocus=${this.autofocus}\n role=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${this.opened}\"\n aria-labelledby=\"label\"\n @click=${this.open}\n >\n <legend><span>${this.label}</span></legend>\n\n ${this._selectedOptions.length > 0 && !this.opened\n ? inputSelectedOptions\n : html`\n <input\n class=\"search-bar-input\"\n placeholder=${this.opened || this.labelFixed\n ? searchbarPlaceholderText\n : this.label || searchbarPlaceholderText}\n @input=${this._handleSearchOptions}\n @keydown=${(e: KeyboardEvent) => {\n if (e.code === \"Space\") {\n e.stopPropagation();\n }\n }}\n .value=${this._searchText}\n />\n `}\n ${!this.opened\n ? html`<span class=\"additional-selection-count\"\n >+${this._additionalSelectedOptionCount}</span\n >`\n : \"\"}\n\n <div class=\"actions\">\n ${this.opened ? (this.searchBarLoadingState ? searchSpinner : searchMagIcon) : \"\"}\n ${!this.opened ? removeButton : \"\"} ${actionDivider}\n\n <div @click=${this._togglePopover}>\n <bl-icon class=\"dropdown-icon open\" name=\"arrow_up\"></bl-icon>\n\n <bl-icon class=\"dropdown-icon closed\" name=\"arrow_down\"></bl-icon>\n </div>\n </div>\n </fieldset>`;\n\n return this.searchBar\n ? search\n : html`<fieldset\n class=${classMap({\n \"select-input\": true,\n \"has-overflowed-options\": this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${ifDefined(this.disabled ? undefined : 0)}\"\n ?autofocus=${this.autofocus}\n @click=${this._togglePopover}\n role=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${this.opened}\"\n aria-labelledby=\"label\"\n >\n <legend><span>${this.label}</span></legend>\n <span class=\"placeholder\">${this.placeholder}</span>\n <span class=\"label\">${this.label}</span>\n ${inputSelectedOptions}\n <span class=\"additional-selection-count\">+${this._additionalSelectedOptionCount}</span>\n <div class=\"actions\">\n ${removeButton} ${actionDivider}\n <bl-icon class=\"dropdown-icon open\" name=\"arrow_up\"></bl-icon>\n\n <bl-icon class=\"dropdown-icon closed\" name=\"arrow_down\"></bl-icon>\n </div>\n </fieldset>`;\n }\n\n selectAllTemplate() {\n if (!this.multiple || !this.viewSelectAll || this.noResultFound) {\n return null;\n }\n\n const isAllRenderedOptionsSelected = this._connectedOptions\n .filter(option => !option.hidden)\n .every(option => option.selected);\n\n const isAnySelected = this._selectedOptions.filter(option => !option.hidden).length > 0;\n const selectAllText =\n this.selectAllText ?? msg(\"Select All\", { desc: \"bl-select: select all text\" });\n\n return html`<bl-checkbox\n class=\"select-all\"\n .checked=\"${isAllRenderedOptionsSelected}\"\n .indeterminate=\"${isAnySelected && !isAllRenderedOptionsSelected}\"\n role=\"option\"\n aria-selected=\"${isAllRenderedOptionsSelected}\"\n @bl-checkbox-change=\"${this._handleSelectAll}\"\n >\n ${selectAllText}\n </bl-checkbox>`;\n }\n\n render(): TemplateResult {\n const invalidMessage = !this.checkValidity()\n ? html`<p id=\"errorMessage\" aria-live=\"polite\" class=\"invalid-text\">\n ${this.validationMessage}\n </p>`\n : \"\";\n\n const helpMessage = this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : \"\";\n\n const label = this.label ? html`<label id=\"label\">${this.label}</label>` : \"\";\n\n const noDataText =\n this.searchNotFoundText ?? msg(\"No Data Found\", { desc: \"bl-select: search no data text\" });\n\n const clearSearchText =\n this.popoverClearSearchText ??\n msg(\"Clear Search\", { desc: \"bl-select: clear search button text\" });\n\n return html`<div\n class=${classMap({\n \"select-wrapper\": true,\n \"select-open\": this.opened,\n \"selected\": this._selectedOptions.length > 0,\n \"invalid\": !this.validity.valid,\n \"dirty\": this.dirty,\n })}\n @keydown=${this.handleKeydown}\n >\n ${label} ${this.inputTemplate()}\n <div\n class=\"popover\"\n tabindex=\"${ifDefined(this._isPopoverOpen ? undefined : \"-1\")}\"\n @bl-select-option=${this._handleSelectOptionEvent}\n role=\"listbox\"\n aria-multiselectable=\"${this.multiple}\"\n aria-labelledby=\"label\"\n >\n ${this.selectAllTemplate()}\n <slot></slot>\n ${this.searchBar && this.noResultFound\n ? html`<div name=\"popover-clear-search-text\" class=\"popover-no-result\">\n <span>${noDataText}</span>\n <bl-button\n variant=\"tertiary\"\n @click=${() => {\n this._handleSearchOptions({ target: { value: \"\" } } as InputEvent & {\n target: HTMLInputElement;\n });\n }}\n >${clearSearchText}</bl-button\n >\n </div>`\n : \"\"}\n </div>\n <div class=\"hint\">${invalidMessage} ${helpMessage}</div>\n </div> `;\n }\n\n private focusedOptionIndex = -1;\n private lastKeyPressedTime = 0;\n private typedCharacters = \"\";\n private keyPressThreshold = 500;\n\n private handleFocusOptionByKey(key: string) {\n const currentTime = Date.now();\n const elapsedTimeSinceLastKeyPress = currentTime - this.lastKeyPressedTime;\n\n if (elapsedTimeSinceLastKeyPress > this.keyPressThreshold) {\n this.typedCharacters = \"\";\n }\n\n this.lastKeyPressedTime = currentTime;\n this.typedCharacters += key.toLowerCase();\n\n const matchingOptionIndex = this.options.findIndex(option => {\n if (option.disabled) {\n return false;\n }\n const optionText = option.innerText.trim().toLowerCase();\n\n return optionText.startsWith(this.typedCharacters);\n });\n\n if (matchingOptionIndex !== -1) {\n this.focusedOptionIndex = matchingOptionIndex;\n this.options[matchingOptionIndex].focus();\n }\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (this.focusedOptionIndex === -1 && [\"Enter\", \"Space\"].includes(event.code)) {\n this._togglePopover();\n event.preventDefault();\n } else if (this._isPopoverOpen === false && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n this.open();\n event.preventDefault();\n } else if (event.code === \"Escape\") {\n this.close();\n event.preventDefault();\n } else if (this._isPopoverOpen && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n const activeOptions = this.options.filter(option => !option.disabled);\n\n event.code === \"ArrowDown\" && this.focusedOptionIndex++;\n event.code === \"ArrowUp\" && this.focusedOptionIndex--;\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, activeOptions.length - 1)\n );\n\n activeOptions[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n } else if (this._isPopoverOpen && !this.searchBar) {\n this.handleFocusOptionByKey(event.key);\n }\n }\n\n private _togglePopover() {\n this._isPopoverOpen ? this.close() : this.open();\n }\n\n private _handleSelectEvent() {\n const options = this._selectedOptions.map(\n option =>\n ({\n value: option.value,\n selected: option.selected,\n text: option.textContent,\n } as ISelectOption<ValueType>)\n );\n\n if (!this.multiple) this._onBlSelect(options[0]);\n else this._onBlSelect(options);\n }\n\n private _handleSearchEvent() {\n this._onBlSearch(this._searchText);\n }\n\n private _handleSearchOptions(e: InputEvent): void {\n if (!this.searchBar) return;\n\n this._searchText = (e.target as HTMLInputElement).value;\n\n this._handleSearchEvent();\n\n this._connectedOptions.forEach(option => {\n const searchText = this._searchText.toLowerCase();\n let optionText = \"\";\n\n if (option.textContent) {\n try {\n // Try locale-specific comparison first\n optionText = option.textContent.toLocaleLowerCase(this.userLang);\n } catch {\n // Fallback to basic toLowerCase if locale is not supported\n optionText = option.textContent.toLowerCase();\n }\n }\n\n const isVisible = optionText.includes(searchText);\n\n option.hidden = !isVisible;\n });\n\n this._selectedOptions = this.options.filter(option => option.selected);\n this._handleLastVisibleSearchedOption();\n this.requestUpdate();\n }\n\n private _handleLastVisibleSearchedOption() {\n const lastVisibleOption = [...this.options].reverse().find(option => !option.hidden);\n\n if (lastVisibleOption) {\n lastVisibleOption?.shadowRoot?.querySelector(\"div\")?.classList.add(\"no-border-bottom\");\n }\n\n this.options.map(option => {\n if (!option.hidden && option !== lastVisibleOption) {\n option.shadowRoot?.querySelector(\"div\")?.classList.remove(\"no-border-bottom\");\n }\n });\n }\n\n private _handleSingleSelect(optionItem: BlSelectOption<ValueType>) {\n this.value = optionItem.value;\n\n this._searchText = \"\";\n this._handleSelectEvent();\n this.close();\n }\n\n private _handleMultipleSelect() {\n this.value = this._connectedOptions\n .filter(option => option.selected)\n .map(option => option.value);\n\n this._handleSelectEvent();\n }\n\n private _handleSelectOptionEvent(e: CustomEvent) {\n const optionItem = e.target as BlSelectOption<ValueType>;\n\n this.dirty = true;\n\n if (this.multiple) {\n this._handleMultipleSelect();\n } else {\n this._handleSingleSelect(optionItem);\n }\n }\n\n private _handleSelectAll(e: CustomEvent) {\n const selectAllEl = this.shadowRoot?.querySelector(\".select-all\") as BlCheckbox;\n\n const checked = e.detail;\n const unselectedOptions = this._connectedOptions.filter(\n option => !option.selected && !option.hidden\n );\n const isAllUnselectedDisabled = unselectedOptions.every(option => option.disabled);\n\n // If all available options are selected, instead of checking, uncheck all options\n if (checked && isAllUnselectedDisabled) {\n setTimeout(() => {\n const checkbox = selectAllEl?.shadowRoot?.querySelector(\"input\");\n\n checkbox?.click();\n }, 0);\n return;\n }\n\n this._connectedOptions.forEach(option => {\n if (option.disabled || option.hidden) {\n return;\n }\n\n option.selected = checked;\n });\n\n this._handleMultipleSelect();\n }\n\n private _onClickRemove(e: MouseEvent) {\n e.stopPropagation();\n\n this._searchText = \"\";\n\n const selectedDisabledOptions = this._selectedOptions.filter(option => option.disabled);\n\n this._connectedOptions\n .filter(option => !option.disabled && option.selected)\n .forEach(option => {\n option.selected = false;\n });\n\n this.value = selectedDisabledOptions.length\n ? selectedDisabledOptions.map(option => option.value)\n : null;\n this._handleSelectEvent();\n }\n\n private _checkAdditionalItemCount() {\n if (!this.multiple || !this.selectedOptionsItems || this.selectedOptionsItems.length < 2) {\n this._additionalSelectedOptionCount = 0;\n return;\n }\n\n const firstNonVisibleItemIndex = [...this.selectedOptionsItems].findIndex(\n item => item.offsetLeft > this.selectedOptionsContainer.offsetWidth\n );\n\n if (firstNonVisibleItemIndex > -1) {\n this._additionalSelectedOptionCount =\n this.selectedOptionsItems.length - firstNonVisibleItemIndex;\n } else {\n this._additionalSelectedOptionCount = 0;\n }\n }\n\n protected firstUpdated(): void {\n if (this.value === undefined) {\n if (this.multiple) {\n this.value = [];\n } else {\n this.value = null;\n }\n }\n\n this._initialValue = this._value;\n }\n\n protected updated(_changedProperties: PropertyValues) {\n if (\n _changedProperties.has(\"multiple\") &&\n typeof _changedProperties.get(\"multiple\") === \"boolean\"\n ) {\n this.value = null;\n }\n\n if (_changedProperties.has(\"_selectedOptions\")) {\n this._checkAdditionalItemCount();\n }\n }\n\n /**\n * This method is used by `bl-select-option` component to register itself to bl-select.\n * @param option BlSelectOption reference to be registered\n */\n registerOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.push(option);\n\n if (option.selected) {\n if (this.multiple) {\n if (!Array.isArray(this.value)) {\n this.value = [];\n }\n this.value = [...this.value, option.value];\n } else {\n this.value = option.value;\n }\n }\n\n this.setOptionsSelected();\n this.requestUpdate();\n }\n\n /**\n * This method is used by `bl-select-option` component to unregister itself from bl-select.\n * @param option BlSelectOption reference to be unregistered\n */\n unregisterOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.splice(this._connectedOptions.indexOf(option), 1);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-select\": BlSelect;\n }\n}\n"],
|
|
5
|
-
"mappings": "qgBACO,IAAMA,EAASC,i8NACfC,EAAQF,ECFf,IAAAG,EAsCqBC,EAArB,cAA4EC,EAC1EC,CACF,CAAE,CAFF,kCAgEE,UAAmB,SAMnB,cAAW,GAMX,cAAW,GAMX,eAAY,GAMZ,cAAW,GAMX,eAAY,GAMZ,gBAAa,GAkBb,mBAAgB,GAYhB,eAAY,GAgBZ,2BAAwB,GAgBxB,KAAQ,eAAiB,GAGzB,KAAQ,+BAAiC,EAGzC,KAAQ,YAAc,GA0BtB,KAAQ,WACLH,EAAA,SAAS,cAAc,MAAM,IAA7B,YAAAA,EAAgC,aAAa,UAA8B,UAAU,SAExF,KAAQ,kBAAiD,CAAC,EAE1D,KAAQ,gBAA0C,KA0BlD,KAAQ,iBAAgD,CAAC,EAGzD,KAAQ,MAAQ,GA0DhB,KAAQ,wBAA2BI,GAAmC,CApUxE,IAAAJ,EAqUI,IAAMK,EAAYD,EAAM,aAAa,GAEhCJ,EAAAK,GAAA,YAAAA,EAAW,KAAKC,GAAMA,EAAG,UAAY,eAArC,MAAAN,EAAmD,SAAS,OAC/D,KAAK,MAAM,CAEf,EAkPA,KAAQ,mBAAqB,GAC7B,KAAQ,mBAA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GAjKYjE,EAkKX,8BAGA+D,EAAA,CADPE,EAAM,GApKYjE,EAqKX,8CAGA+D,EAAA,CADPE,EAAM,GAvKYjE,EAwKX,2BAGA+D,EAAA,CADPG,EAAM,mBAAmB,GA1KPlE,EA2KX,wCAGA+D,EAAA,CADP1C,EAAS,sBAAsB,GA7KbrB,EA8KX,oCAGA+D,EAAA,CADPG,EAAM,UAAU,GAhLElE,EAiLX,wBAGA+D,EAAA,CADPG,EAAM,eAAe,GAnLHlE,EAoLX,4BAKoB+D,EAAA,CAA3B5D,EAAM,WAAW,GAzLCH,EAyLS,2BAOA+D,EAAA,CAA3B5D,EAAM,WAAW,GAhMCH,EAgMS,2BAiCpB+D,EAAA,CADPE,EAAM,GAhOYjE,EAiOX,gCAGA+D,EAAA,CADPE,EAAM,GAnOYjE,EAoOX,qBA+BR+D,EAAA,CADCG,EAAM,eAAe,GAlQHlE,EAmQnB,gCAnQmBA,EAArB+D,EAAA,CAFC1C,EAAc,WAAW,EACzB8C,EAAU,GACUnE",
|
|
6
|
-
"names": ["styles", "i", "bl_select_default", "_a", "BlSelect", "FormControlMixin", "s", "event", "eventPath", "el", "bl_select_default", "val", "formData", "option", "select", "_b", "_c", "autoUpdate", "computePosition", "flip", "offset", "size", "args", "x", "y", "e", "inputSelectedOptions", "item", "isRemoveButtonShown", "removeButton", "isSearchBarVisible", "hasSelectedOptions", "isDividerShown", "searchbarPlaceholderText", "msg", "searchMagIcon", "searchSpinner", "actionDivider", "search", "o", "l", "isAllRenderedOptionsSelected", "isAnySelected", "selectAllText", "invalidMessage", "helpMessage", "label", "noDataText", "clearSearchText", "key", "currentTime", "matchingOptionIndex", "activeOptions", "options", "searchText", "optionText", "isVisible", "lastVisibleOption", "optionItem", "selectAllEl", "checked", "isAllUnselectedDisabled", "checkbox", "selectedDisabledOptions", "firstNonVisibleItemIndex", "_changedProperties", "requiredValidator", "__decorateClass", "stringBooleanConverter", "t", "i", "localized"]
|
|
7
|
-
}
|