@trendyol/baklava 2.0.0-beta.79 → 2.0.0-beta.81

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. package/dist/baklava-react.d.ts +5 -3
  2. package/dist/baklava-react.d.ts.map +1 -1
  3. package/dist/baklava-react.js +1 -1
  4. package/dist/baklava-react.js.map +2 -2
  5. package/dist/baklava.js +1 -1
  6. package/dist/{chunk-VHM6RRSN.js → chunk-2FBI46AY.js} +3 -3
  7. package/dist/chunk-2FBI46AY.js.map +7 -0
  8. package/dist/chunk-3B64VOWB.js +2 -0
  9. package/dist/{chunk-AEVRCHAZ.js.map → chunk-3B64VOWB.js.map} +4 -4
  10. package/dist/chunk-AYSPIQ23.js +26 -0
  11. package/dist/chunk-AYSPIQ23.js.map +7 -0
  12. package/dist/{chunk-2E7PEDV6.js → chunk-BD5KXTYS.js} +2 -2
  13. package/dist/chunk-DJOD4BTL.js +2 -0
  14. package/dist/chunk-DJOD4BTL.js.map +7 -0
  15. package/dist/{chunk-F3CGCLRX.js → chunk-DSM6T5MC.js} +2 -2
  16. package/dist/chunk-J774WKKH.js +51 -0
  17. package/dist/chunk-J774WKKH.js.map +7 -0
  18. package/dist/{chunk-VGPPX6IG.js → chunk-KUOLIJCN.js} +3 -3
  19. package/dist/{chunk-VGPPX6IG.js.map → chunk-KUOLIJCN.js.map} +2 -2
  20. package/dist/chunk-MCWRM3WC.js +19 -0
  21. package/dist/chunk-MCWRM3WC.js.map +7 -0
  22. package/dist/chunk-RST5NVHY.js +2 -0
  23. package/dist/chunk-RST5NVHY.js.map +7 -0
  24. package/dist/chunk-THIPCHAK.js +13 -0
  25. package/dist/chunk-THIPCHAK.js.map +7 -0
  26. package/dist/chunk-VAF7XRXM.js +42 -0
  27. package/dist/chunk-VAF7XRXM.js.map +7 -0
  28. package/dist/components/button/bl-button.d.ts +8 -0
  29. package/dist/components/button/bl-button.d.ts.map +1 -1
  30. package/dist/components/button/bl-button.js +1 -1
  31. package/dist/components/checkbox-group/bl-checkbox-group.js +1 -1
  32. package/dist/components/checkbox-group/checkbox/bl-checkbox.js +1 -1
  33. package/dist/components/dialog/bl-dialog.js +1 -1
  34. package/dist/components/drawer/bl-drawer.js +1 -1
  35. package/dist/components/dropdown/bl-dropdown.js +1 -1
  36. package/dist/components/dropdown/item/bl-dropdown-item.js +1 -1
  37. package/dist/components/input/bl-input.d.ts +3 -3
  38. package/dist/components/input/bl-input.d.ts.map +1 -1
  39. package/dist/components/input/bl-input.js +1 -1
  40. package/dist/components/pagination/bl-pagination.d.ts.map +1 -1
  41. package/dist/components/pagination/bl-pagination.js +1 -1
  42. package/dist/components/radio-group/bl-radio-group.js +1 -1
  43. package/dist/components/radio-group/radio/bl-radio.js +1 -1
  44. package/dist/components/select/bl-select.d.ts +48 -18
  45. package/dist/components/select/bl-select.d.ts.map +1 -1
  46. package/dist/components/select/bl-select.js +1 -1
  47. package/dist/components/select/option/bl-select-option.d.ts +24 -3
  48. package/dist/components/select/option/bl-select-option.d.ts.map +1 -1
  49. package/dist/components/select/option/bl-select-option.js +1 -1
  50. package/dist/components/textarea/bl-textarea.d.ts +1 -1
  51. package/dist/components/textarea/bl-textarea.d.ts.map +1 -1
  52. package/dist/components/textarea/bl-textarea.js +1 -1
  53. package/dist/custom-elements.json +78 -3
  54. package/package.json +3 -3
  55. package/dist/chunk-2PVZLIDX.js +0 -19
  56. package/dist/chunk-2PVZLIDX.js.map +0 -7
  57. package/dist/chunk-4WJJQP4L.js +0 -13
  58. package/dist/chunk-4WJJQP4L.js.map +0 -7
  59. package/dist/chunk-7K5FMQLQ.js +0 -2
  60. package/dist/chunk-7K5FMQLQ.js.map +0 -7
  61. package/dist/chunk-7R56R3UM.js +0 -35
  62. package/dist/chunk-7R56R3UM.js.map +0 -7
  63. package/dist/chunk-A6IEG6S5.js +0 -52
  64. package/dist/chunk-A6IEG6S5.js.map +0 -7
  65. package/dist/chunk-AEVRCHAZ.js +0 -2
  66. package/dist/chunk-TAU2CM6U.js +0 -26
  67. package/dist/chunk-TAU2CM6U.js.map +0 -7
  68. package/dist/chunk-VHM6RRSN.js.map +0 -7
  69. /package/dist/{chunk-2E7PEDV6.js.map → chunk-BD5KXTYS.js.map} +0 -0
  70. /package/dist/{chunk-F3CGCLRX.js.map → chunk-DSM6T5MC.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ var d=function(u,c,g,o){if(g==="a"&&!o)throw new TypeError("Private accessor was defined without a getter");if(typeof c=="function"?u!==c||!o:!c.has(u))throw new TypeError("Cannot read private member from an object whose class did not declare it");return g==="m"?o:g==="a"?o.call(u):o?o.value:c.get(u)},w=function(u,c,g,o,y){if(o==="m")throw new TypeError("Private method is not writable");if(o==="a"&&!y)throw new TypeError("Private accessor was defined without a setter");if(typeof c=="function"?u!==c||!y:!c.has(u))throw new TypeError("Cannot write private member to an object whose class did not declare it");return o==="a"?y.call(u,g):y?y.value=g:c.set(u,g),g};function pt(u){var c,g,o,y,S,P,E,Z,_,D,$,U,O,k,T,V,z,q,B;class J extends u{constructor(...s){var n,m,p;super(...s),c.add(this),this.internals=this.attachInternals(),g.set(this,!1),o.set(this,!1),y.set(this,!1),S.set(this,void 0),P.set(this,void 0),E.set(this,!0),_.set(this,""),D.set(this,()=>{w(this,y,!0,"f"),w(this,g,!0,"f"),d(this,c,"m",V).call(this)}),$.set(this,()=>{w(this,g,!1,"f"),d(this,c,"m",z).call(this,this.shouldFormValueUpdate()?d(this,_,"f"):""),!this.validity.valid&&d(this,y,"f")&&w(this,o,!0,"f");let F=d(this,c,"m",V).call(this);this.validationMessageCallback&&this.validationMessageCallback(F?this.internals.validationMessage:"")}),U.set(this,()=>{var F;d(this,E,"f")&&this.validationTarget&&(this.internals.setValidity(this.validity,this.validationMessage,this.validationTarget),w(this,E,!1,"f")),w(this,y,!0,"f"),w(this,o,!0,"f"),d(this,c,"m",V).call(this),(F=this===null||this===void 0?void 0:this.validationMessageCallback)===null||F===void 0||F.call(this,this.showError?this.internals.validationMessage:"")}),O.set(this,void 0),k.set(this,!1),T.set(this,Promise.resolve()),(n=this.addEventListener)===null||n===void 0||n.call(this,"focus",d(this,D,"f")),(m=this.addEventListener)===null||m===void 0||m.call(this,"blur",d(this,$,"f")),(p=this.addEventListener)===null||p===void 0||p.call(this,"invalid",d(this,U,"f")),this.setValue(null)}static get formAssociated(){return!0}static get validators(){return this.formControlValidators||[]}static get observedAttributes(){let s=this.validators.map(p=>p.attribute).flat(),n=super.observedAttributes||[];return[...new Set([...n,...s])]}static getValidator(s){return this.validators.find(n=>n.attribute===s)||null}static getValidators(s){return this.validators.filter(n=>{var m;if(n.attribute===s||!((m=n.attribute)===null||m===void 0)&&m.includes(s))return!0})}get form(){return this.internals.form}get showError(){return d(this,c,"m",V).call(this)}checkValidity(){return this.internals.checkValidity()}get validity(){return this.internals.validity}get validationMessage(){return this.internals.validationMessage}attributeChangedCallback(s,n,m){var p;(p=super.attributeChangedCallback)===null||p===void 0||p.call(this,s,n,m);let x=this.constructor.getValidators(s);x!=null&&x.length&&this.validationTarget&&this.setValue(d(this,_,"f"))}setValue(s){var n;w(this,o,!1,"f"),(n=this.validationMessageCallback)===null||n===void 0||n.call(this,""),w(this,_,s,"f");let p=this.shouldFormValueUpdate()?s:null;this.internals.setFormValue(p),d(this,c,"m",z).call(this,p),this.valueChangedCallback&&this.valueChangedCallback(p),d(this,c,"m",V).call(this)}shouldFormValueUpdate(){return!0}get validationComplete(){return new Promise(s=>s(d(this,T,"f")))}formResetCallback(){var s,n;w(this,y,!1,"f"),w(this,o,!1,"f"),d(this,c,"m",V).call(this),(s=this.resetFormControl)===null||s===void 0||s.call(this),(n=this.validationMessageCallback)===null||n===void 0||n.call(this,d(this,c,"m",V).call(this)?this.validationMessage:"")}}return g=new WeakMap,o=new WeakMap,y=new WeakMap,S=new WeakMap,P=new WeakMap,E=new WeakMap,_=new WeakMap,D=new WeakMap,$=new WeakMap,U=new WeakMap,O=new WeakMap,k=new WeakMap,T=new WeakMap,c=new WeakSet,Z=function(){let s=this.getRootNode(),n=`${this.localName}[name="${this.getAttribute("name")}"]`;return s.querySelectorAll(n)},V=function(){if(this.hasAttribute("disabled"))return!1;let s=d(this,o,"f")||d(this,y,"f")&&!this.validity.valid&&!d(this,g,"f");return s&&this.internals.states?this.internals.states.add("--show-error"):this.internals.states&&this.internals.states.delete("--show-error"),s},z=function(s){let n=this.constructor,m={},p=n.validators,F=[],x=p.some(M=>M.isValid instanceof Promise);d(this,k,"f")||(w(this,T,new Promise(M=>{w(this,O,M,"f")}),"f"),w(this,k,!0,"f")),d(this,S,"f")&&(d(this,S,"f").abort(),w(this,P,d(this,S,"f"),"f"));let R=new AbortController;w(this,S,R,"f");let L,H=!1;p.length&&(p.forEach(M=>{let K=M.key||"customError",N=M.isValid(this,s,R.signal);N instanceof Promise?(F.push(N),N.then(G=>{G!=null&&(m[K]=!G,L=d(this,c,"m",B).call(this,M,s),d(this,c,"m",q).call(this,m,L))})):(m[K]=!N,this.validity[K]!==!N&&(H=!0),!N&&!L&&(L=d(this,c,"m",B).call(this,M,s)))}),Promise.allSettled(F).then(()=>{var M;R!=null&&R.signal.aborted||(w(this,k,!1,"f"),(M=d(this,O,"f"))===null||M===void 0||M.call(this))}),(H||!x)&&d(this,c,"m",q).call(this,m,L))},q=function(s,n){if(this.validationTarget)this.internals.setValidity(s,n,this.validationTarget),w(this,E,!1,"f");else{if(this.internals.setValidity(s,n),this.internals.validity.valid)return;w(this,E,!0,"f")}},B=function(s,n){if(this.validityCallback){let m=this.validityCallback(s.key||"customError");if(m)return m}return s.message instanceof Function?s.message(this,n):s.message},J}(function(){"use strict";let u=new WeakMap,c=new WeakMap,g=new WeakMap,o=new WeakMap,y=new WeakMap,S=new WeakMap,P=new WeakMap,E=new WeakMap,Z=new WeakMap,_=new WeakMap,D=new WeakMap,$=new WeakMap,U=new WeakMap,O=new WeakMap,k=new WeakMap,T={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"},V=(e,t)=>{for(let a in T){t[a]=null;let i=null,r=T[a];Object.defineProperty(t,a,{get(){return i},set(h){i=h,e.isConnected?e.setAttribute(r,h):_.set(e,t)}})}};function z(e){let t=o.get(e),{form:a}=t;G(e,a,t),L(e,t.labels)}let q=(e,t=!1)=>{let a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode(h){return o.has(h)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),i=a.nextNode(),r=!t||e.disabled;for(;i;)i.formDisabledCallback&&r&&p(i,e.disabled),i=a.nextNode()},B={attributes:!0,attributeFilter:["disabled"]},J=new MutationObserver(e=>{for(let t of e){let a=t.target;a.constructor.formAssociated?p(a,a.hasAttribute("disabled")):a.localName==="fieldset"&&q(a)}});function A(e){e.forEach(t=>{let{addedNodes:a,removedNodes:i}=t,r=Array.from(a),h=Array.from(i);r.forEach(l=>{if(o.has(l)&&l.constructor.formAssociated&&z(l),_.has(l)){let v=_.get(l);Object.keys(T).filter(f=>v[f]!==null).forEach(f=>{l.setAttribute(T[f],v[f])}),_.delete(l)}if(k.has(l)){let v=k.get(l);l.setAttribute("internals-valid",v.validity.valid.toString()),l.setAttribute("internals-invalid",(!v.validity.valid).toString()),l.setAttribute("aria-invalid",(!v.validity.valid).toString()),k.delete(l)}if(l.localName==="form"){let v=E.get(l),C=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode(b){return o.has(b)&&!(v&&v.has(b))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),f=C.nextNode();for(;f;)z(f),f=C.nextNode()}l.localName==="fieldset"&&(J.observe(l,B),q(l,!0))}),h.forEach(l=>{let v=o.get(l);v&&g.get(v)&&F(v),P.has(l)&&P.get(l).disconnect()})})}function s(e){e.forEach(t=>{let{removedNodes:a}=t;a.forEach(i=>{let r=U.get(t.target);o.has(i)&&it(i),r.disconnect()})})}let n=e=>{let t=new MutationObserver(s);t.observe(e,{childList:!0}),U.set(e,t)};new MutationObserver(A);let m={childList:!0,subtree:!0},p=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?e.setAttribute("aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},F=e=>{g.get(e).forEach(a=>{a.remove()}),g.set(e,[])},x=(e,t)=>{let a=document.createElement("input");return a.type="hidden",a.name=e.getAttribute("name"),e.after(a),g.get(t).push(a),a},R=(e,t)=>{g.set(t,[]),J.observe(e,B)},L=(e,t)=>{if(t.length){Array.from(t).forEach(i=>i.addEventListener("click",e.click.bind(e)));let a=t[0].id;t[0].id||(a=`${t[0].htmlFor}_Label`,t[0].id=a),e.setAttribute("aria-labelledby",a)}},H=e=>{let t=Array.from(e.elements).filter(h=>!h.tagName.includes("-")&&h.validity).map(h=>h.validity.valid),a=E.get(e)||[],i=Array.from(a).filter(h=>h.isConnected).map(h=>o.get(h).validity.valid),r=[...t,...i].includes(!1);e.toggleAttribute("internals-invalid",r),e.toggleAttribute("internals-valid",!r)},M=e=>{H(Q(e.target))},K=e=>{H(Q(e.target))},N=e=>{let t=":is(:is(button, input)[type=submit], button:not([type])):not([disabled])",a=`${t}:not([form])`;e.id&&(a+=`,${t}[form='${e.id}']`),e.addEventListener("click",i=>{if(i.target.closest(a)){let h=E.get(e);if(e.noValidate)return;h.size&&Array.from(h).reverse().map(C=>o.get(C).reportValidity()).includes(!1)&&i.preventDefault()}})},et=e=>{let t=E.get(e.target);t&&t.size&&t.forEach(a=>{a.constructor.formAssociated&&a.formResetCallback&&a.formResetCallback.apply(a)})},G=(e,t,a)=>{if(t){let i=E.get(t);if(i)i.add(e);else{let r=new Set;r.add(e),E.set(t,r),N(t),t.addEventListener("reset",et),t.addEventListener("input",M),t.addEventListener("change",K)}S.set(t,{ref:e,internals:a}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout(()=>{e.formAssociatedCallback.apply(e,[t])},0),H(t)}},Q=e=>{let t=e.parentNode;return t&&t.tagName!=="FORM"&&(t=Q(t)),t},I=(e,t,a=DOMException)=>{if(!e.constructor.formAssociated)throw new a(t)},at=(e,t,a)=>{let i=E.get(e);return i&&i.size&&i.forEach(r=>{o.get(r)[a]()||(t=!1)}),t},it=e=>{if(e.constructor.formAssociated){let t=o.get(e),{labels:a,form:i}=t;L(e,a),G(e,i,t)}};class nt{constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}let lt=e=>(e.badInput=!1,e.customError=!1,e.patternMismatch=!1,e.rangeOverflow=!1,e.rangeUnderflow=!1,e.stepMismatch=!1,e.tooLong=!1,e.tooShort=!1,e.typeMismatch=!1,e.valid=!0,e.valueMissing=!1,e),ct=(e,t,a)=>(e.valid=dt(t),Object.keys(t).forEach(i=>e[i]=t[i]),a&&H(a),e),dt=e=>{let t=!0;for(let a in e)a!=="valid"&&e[a]!==!1&&(t=!1);return t},tt=new WeakMap;class X extends Set{static get isPolyfilled(){return!0}constructor(t){if(super(),!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");tt.set(this,t)}add(t){if(!/^--/.test(t)||typeof t!="string")throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${t} must start with '--'.`);let a=super.add(t),i=tt.get(this);return i.toggleAttribute(`state${t}`,!0),i.part&&i.part.add(`state${t}`),a}clear(){for(let[t]of this.entries())this.delete(t);super.clear()}delete(t){let a=super.delete(t),i=tt.get(this);return i.toggleAttribute(`state${t}`,!1),i.part&&i.part.remove(`state${t}`),a}}function st(e,t,a,i){if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return a==="m"?i:a==="a"?i.call(e):i?i.value:t.get(e)}function ht(e,t,a,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,a):r?r.value=a:t.set(e,a),a}var j;class ut{constructor(t){j.set(this,void 0),ht(this,j,t,"f");for(let a=0;a<t.length;a++){let i=t[a];this[a]=i,i.hasAttribute("name")&&(this[i.getAttribute("name")]=i)}Object.freeze(this)}get length(){return st(this,j,"f").length}[(j=new WeakMap,Symbol.iterator)](){return st(this,j,"f")[Symbol.iterator]()}item(t){return this[t]==null?null:this[t]}namedItem(t){return this[t]==null?null:this[t]}}class rt{static get isPolyfilled(){return!0}constructor(t){if(!t||!t.tagName||t.tagName.indexOf("-")===-1)throw new TypeError("Illegal constructor");let a=t.getRootNode(),i=new nt;this.states=new X(t),u.set(this,t),c.set(this,i),o.set(t,this),V(t,this),R(t,this),Object.seal(this),it(t),a instanceof DocumentFragment&&n(a)}checkValidity(){let t=u.get(this);if(I(t,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;let a=c.get(this);if(!a.valid){let i=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});t.dispatchEvent(i)}return a.valid}get form(){let t=u.get(this);I(t,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.");let a;return t.constructor.formAssociated===!0&&(a=Q(t)),a}get labels(){let t=u.get(this);I(t,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");let a=t.getAttribute("id"),i=t.getRootNode();return i&&a?i.querySelectorAll(`[for="${a}"]`):[]}reportValidity(){let t=u.get(this);if(I(t,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;let a=this.checkValidity(),i=$.get(this);if(i&&!t.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!a&&i&&(t.focus(),i.focus()),a}setFormValue(t){let a=u.get(this);if(I(a,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),F(this),t!=null&&!(t instanceof FormData)){if(a.getAttribute("name")){let i=x(a,this);i.value=t}}else t!=null&&t instanceof FormData&&Array.from(t).reverse().forEach(([i,r])=>{if(typeof r=="string"){let h=x(a,this);h.name=i,h.value=r}});Z.set(a,t)}setValidity(t,a,i){let r=u.get(this);if(I(r,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!t)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");$.set(this,i);let h=c.get(this),l={};for(let f in t)l[f]=t[f];Object.keys(l).length===0&&lt(h);let v={...h,...l};delete v.valid;let{valid:C}=ct(h,v,this.form);if(!C&&!a)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");y.set(this,C?"":a),r.isConnected?(r.toggleAttribute("internals-invalid",!C),r.toggleAttribute("internals-valid",C),r.setAttribute("aria-invalid",`${!C}`)):k.set(r,this)}get shadowRoot(){let t=u.get(this),a=D.get(t);return a||null}get validationMessage(){let t=u.get(this);return I(t,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),y.get(this)}get validity(){let t=u.get(this);return I(t,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element."),c.get(this)}get willValidate(){let t=u.get(this);return I(t,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(t.disabled||t.hasAttribute("disabled")||t.hasAttribute("readonly"))}}function mt(){if(!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}let t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);let a=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every(i=>i in a.internals)}if(mt()){if(!window.CustomStateSet){window.CustomStateSet=X;let e=HTMLElement.prototype.attachInternals;HTMLElement.prototype.attachInternals=function(...t){let a=e.call(this,t);return a.states=new X(this),a}}}else{let t=function(...f){let b=r.apply(this,f),W=new MutationObserver(A);return D.set(this,b),window.ShadyDOM?W.observe(this,m):W.observe(b,m),P.set(this,W),b},a=function(...f){let b=l.apply(this,f);return at(this,b,"checkValidity")},i=function(...f){let b=v.apply(this,f);return at(this,b,"reportValidity")};window.ElementInternals=rt;let e=customElements.define;customElements.define=function(f,b,W){if(b.formAssociated){let Y=b.prototype.connectedCallback;b.prototype.connectedCallback=function(){O.has(this)||(O.set(this,!0),this.hasAttribute("disabled")&&p(this,!0)),Y!=null&&Y.apply(this)}}e.apply(customElements,[f,b,W])},HTMLElement.prototype.attachInternals=function(){if(this.tagName){if(this.tagName.indexOf("-")===-1)throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.")}else return{};if(o.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new rt(this)};let r=Element.prototype.attachShadow;Element.prototype.attachShadow=t,new MutationObserver(A).observe(document.documentElement,m);let l=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=a;let v=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=i;let{get:C}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...f){let b=C.call(this,...f),W=Array.from(E.get(this)||[]);if(W.length===0)return b;let Y=Array.from(b).concat(W).sort((ot,ft)=>ot.compareDocumentPosition?ot.compareDocumentPosition(ft)&2?1:-1:0);return new ut(Y)}}),window.CustomStateSet||(window.CustomStateSet=X)}})();export{pt as a};
2
+ //# sourceMappingURL=chunk-DJOD4BTL.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../node_modules/@open-wc/form-control/src/FormControlMixin.ts", "../node_modules/element-internals-polyfill/dist/index.js"],
4
+ "sourcesContent": ["import { Constructor, CustomValidityState, FormControlInterface, FormValue, IControlHost, validationMessageCallback, Validator } from './types.js';\n\nexport function FormControlMixin<\n TBase extends Constructor<HTMLElement & IControlHost> & { observedAttributes?: string [] }\n>(SuperClass: TBase) {\n class FormControl extends SuperClass {\n /** Wires up control instances to be form associated */\n static get formAssociated(): boolean {\n return true;\n }\n\n /**\n * A list of Validator objects that will be evaluated when a control's form\n * value is modified or optionally when a given attribute changes.\n *\n * When a Validator's callback returns false, the entire form control will\n * be set to an invalid state.\n */\n declare static formControlValidators: Validator[];\n\n /**\n * If set to true the control described should be evaluated and validated\n * as part of a group. Like a radio, if any member of the group's validity\n * changes the the other members should update as well.\n */\n declare static formControlValidationGroup: boolean;\n\n private static get validators(): Validator[] {\n return this.formControlValidators || [];\n }\n\n /**\n * Allows the FormControl instance to respond to Validator attributes.\n * For instance, if a given Validator has a `required` attribute, that\n * validator will be evaluated whenever the host's required attribute\n * is updated.\n */\n static get observedAttributes(): string[] {\n const validatorAttributes = this.validators.map((validator) => validator.attribute).flat();\n\n const observedAttributes = super.observedAttributes || [];\n\n /** Make sure there are no duplicates inside the attributes list */\n const attributeSet = new Set([...observedAttributes, ...validatorAttributes]);\n return [...attributeSet] as string[];\n }\n\n /**\n * Return the validator associated with a given attribute. If no\n * Validator is associated with the attribute, it will return null.\n */\n static getValidator(attribute: string): Validator | null {\n return this.validators.find((validator) => validator.attribute === attribute) || null;\n }\n\n /**\n * Get all validators that are set to react to a given attribute\n * @param {string} attribute - The attribute that has changed\n * @returns {Validator[]}\n */\n static getValidators(attribute: string): Validator[] | null {\n return this.validators.filter(validator => {\n if (validator.attribute === attribute || validator.attribute?.includes(attribute)) {\n return true;\n }\n });\n }\n\n /** The ElementInternals instance for the control. */\n internals = this.attachInternals();\n\n /**\n * Keep track of if the control has focus\n * @private\n */\n #focused = false;\n\n /**\n * Exists to control when an error should be displayed\n * @private\n */\n #forceError = false;\n\n /**\n * Toggles to true whenever the element has been focused. This property\n * will reset whenever the control's formResetCallback is called.\n * @private\n */\n #touched = false;\n\n /** An internal abort controller for cancelling pending async validation */\n #abortController?: AbortController;\n #previousAbortController?: AbortController;\n\n /**\n * Used for tracking if a validation target has been set to manage focus\n * when the control's validity is reported\n */\n #awaitingValidationTarget = true;\n\n /** All of the controls within a root with a matching local name and form name */\n get #formValidationGroup(): NodeListOf<FormControl> {\n const rootNode = this.getRootNode() as HTMLElement;\n const selector = `${this.localName}[name=\"${this.getAttribute('name')}\"]`;\n return rootNode.querySelectorAll<FormControl>(selector);\n }\n\n /**\n * Acts as a cache for the current value so the value can be re-evaluated\n * whenever an attribute changes or on some other event.\n */\n #value: FormValue = '';\n\n /**\n * Set this[touched] and this[focused]\n * to true when the element is focused\n * @private\n */\n #onFocus = (): void => {\n this.#touched = true;\n this.#focused = true;\n this.#shouldShowError();\n };\n\n /**\n * Reset this[focused] on blur\n * @private\n */\n #onBlur = (): void => {\n this.#focused = false;\n\n this.#runValidators(this.shouldFormValueUpdate() ? this.#value : '');\n\n /**\n * Set forceError to ensure error messages persist until\n * the value is changed.\n */\n if (!this.validity.valid && this.#touched) {\n this.#forceError = true;\n }\n const showError = this.#shouldShowError();\n if (this.validationMessageCallback) {\n this.validationMessageCallback(showError ? this.internals.validationMessage : '');\n }\n };\n\n /**\n * For the show error state on invalid\n * @private\n */\n #onInvalid = (): void => {\n if (this.#awaitingValidationTarget && this.validationTarget) {\n this.internals.setValidity(\n this.validity,\n this.validationMessage,\n this.validationTarget\n );\n this.#awaitingValidationTarget = false;\n }\n this.#touched = true;\n this.#forceError = true;\n this.#shouldShowError();\n this?.validationMessageCallback?.(this.showError ? this.internals.validationMessage : '');\n };\n\n /** Return a reference to the control's form */\n get form(): HTMLFormElement {\n return this.internals.form;\n }\n\n /**\n * Will return true if it is recommended that the control shows an internal\n * error. If using this property, it is wise to listen for 'invalid' events\n * on the element host and call preventDefault on the event. Doing this will\n * prevent browsers from showing a validation popup.\n */\n get showError(): boolean {\n return this.#shouldShowError();\n }\n\n /**\n * Forward the internals checkValidity method\n * will return the valid state of the control.\n */\n checkValidity(): boolean {\n return this.internals.checkValidity();\n }\n\n /** The element's validity state */\n get validity(): ValidityState {\n return this.internals.validity;\n }\n\n /**\n * The validation message shown by a given Validator object. If the control\n * is in a valid state this should be falsy.\n */\n get validationMessage(): string {\n return this.internals.validationMessage;\n }\n\n /* eslint-disable @typescript-eslint/no-explicit-any */\n constructor(...args: any[]) {\n super(...args);\n this.addEventListener?.('focus', this.#onFocus);\n this.addEventListener?.('blur', this.#onBlur);\n this.addEventListener?.('invalid', this.#onInvalid);\n this.setValue(null);\n }\n\n attributeChangedCallback(name: string, oldValue: string, newValue: string): void {\n super.attributeChangedCallback?.(name, oldValue, newValue);\n\n /**\n * Check to see if a Validator is associated with the changed attribute.\n * If one exists, call control's validate function which will perform\n * control validation.\n */\n const proto = this.constructor as typeof FormControl;\n const validators = proto.getValidators(name);\n\n if (validators?.length && this.validationTarget) {\n this.setValue(this.#value);\n }\n }\n\n /** PUBLIC LIFECYCLE METHODS */\n\n /**\n * Sets the control's form value if the call to `shouldFormValueUpdate`\n * returns `true`.\n * @param value {FormValue} - The value to pass to the form\n */\n setValue(value: FormValue): void {\n this.#forceError = false;\n this.validationMessageCallback?.('');\n this.#value = value;\n const valueShouldUpdate = this.shouldFormValueUpdate();\n const valueToUpdate = valueShouldUpdate ? value : null;\n this.internals.setFormValue(valueToUpdate as string);\n this.#runValidators(valueToUpdate);\n if (this.valueChangedCallback) {\n this.valueChangedCallback(valueToUpdate);\n }\n this.#shouldShowError();\n }\n\n /**\n * This method can be overridden to determine if the control's form value\n * should be set on a call to `setValue`. An example of when a user might want\n * to skip this step is when implementing checkbox-like behavior, first checking\n * to see if `this.checked` is set to a truthy value. By default this returns\n * `true`.\n */\n shouldFormValueUpdate(): boolean {\n return true;\n }\n\n /** Save a reference to the validation complete resolver */\n #validationCompleteResolver?: (value: void | PromiseLike<void>) => void;\n\n /** When true validation will be pending */\n #isValidationPending = false;\n\n #validationComplete = Promise.resolve();\n\n /** A promise that will resolve when all pending validations are complete */\n get validationComplete(): Promise<void> {\n return new Promise(resolve => resolve(this.#validationComplete));\n }\n\n /** DECLARED INSTANCE METHODS AND PROPERTIES*/\n\n /**\n * Resets a form control to its initial state\n */\n declare resetFormControl: () => void;\n\n /**\n * This method is used to override the controls' validity message\n * for a given Validator key. This has the highest level of priority when\n * setting a validationMessage, so use this method wisely.\n *\n * The returned value will be used as the validationMessage for the given key.\n * @param validationKey {string} - The key that has returned invalid\n */\n declare validityCallback: (validationKey: string) => string | void;\n\n /**\n * Called when the control's validationMessage should be changed\n * @param message { string } - The new validation message\n */\n declare validationMessageCallback: (message: string) => void;\n\n /**\n * A callback for when the controls' form value changes. The value\n * passed to this function should not be confused with the control's\n * value property, this is the value that will appear on the form.\n *\n * In cases where `checked` did not exist on the control's prototype\n * upon initialization, this value and the value property will be identical;\n * in cases where `checked` is present upon initialization, this will be\n * effectively `this.checked && this.value`.\n */\n declare valueChangedCallback: (value: FormValue) => void;\n\n /**\n * The element that will receive focus when the control's validity\n * state is reported either by a form submission or via API\n *\n * We use declare since this is optional and we don't particularly\n * care how the consuming component implements this (as a field, member\n * or getter/setter)\n */\n declare validationTarget: HTMLElement | null;\n\n /** PRIVATE LIFECYCLE METHODS */\n\n /**\n * Check to see if an error should be shown. This method will also\n * update the internals state object with the --show-error state\n * if necessary.\n * @private\n */\n #shouldShowError(): boolean {\n if (this.hasAttribute('disabled')) {\n return false;\n }\n\n const showError = this.#forceError || (this.#touched && !this.validity.valid && !this.#focused);\n\n /**\n * At the time of writing Firefox doesn't support states\n * TODO: Remove when check for states when fully support is in place\n */\n if (showError && this.internals.states) {\n this.internals.states.add('--show-error');\n } else if (this.internals.states) {\n this.internals.states.delete('--show-error');\n }\n\n return showError;\n }\n\n #runValidators(value: FormValue): void {\n const proto = this.constructor as typeof FormControl;\n const validity: CustomValidityState = {};\n const validators = proto.validators;\n const asyncValidators: Promise<boolean|void>[] = [];\n const hasAsyncValidators = validators.some((validator) => validator.isValid instanceof Promise)\n\n if (!this.#isValidationPending) {\n this.#validationComplete = new Promise(resolve => {\n this.#validationCompleteResolver = resolve\n });\n this.#isValidationPending = true;\n }\n\n /**\n * If an abort controller exists from a previous validation step\n * notify still-running async validators that we are requesting they\n * discontinue any work.\n */\n if (this.#abortController) {\n this.#abortController.abort();\n this.#previousAbortController = this.#abortController;\n }\n\n /**\n * Create a new abort controller and replace the instance reference\n * so we can clean it up for next time\n */\n const abortController = new AbortController();\n this.#abortController = abortController;\n let validationMessage: string | undefined = undefined;\n\n /** Track to see if any validity key has changed */\n let hasChange = false;\n\n if (!validators.length) {\n return;\n }\n\n validators.forEach(validator => {\n const key = validator.key || 'customError';\n const isValid = validator.isValid(this, value, abortController.signal);\n const isAsyncValidator = isValid instanceof Promise;\n\n if (isAsyncValidator) {\n asyncValidators.push(isValid);\n\n isValid.then(isValidatorValid => {\n if (isValidatorValid === undefined || isValidatorValid === null) {\n return;\n }\n /** Invert the validity state to correspond to the ValidityState API */\n validity[key] = !isValidatorValid;\n\n validationMessage = this.#getValidatorMessageForValue(validator, value);\n this.#setValidityWithOptionalTarget(validity, validationMessage);\n });\n } else {\n /** Invert the validity state to correspond to the ValidityState API */\n validity[key] = !isValid;\n\n if (this.validity[key] !== !isValid) {\n hasChange = true;\n }\n\n // only update the validationMessage for the first invalid scenario\n // so that earlier invalid validators dont get their messages overwritten by later ones\n // in the validators array\n if (!isValid && !validationMessage) {\n validationMessage = this.#getValidatorMessageForValue(validator, value);\n }\n }\n });\n\n /** Once all the async validators have settled, resolve validationComplete */\n Promise.allSettled(asyncValidators)\n .then(() => {\n /** Don't resolve validations if the signal is aborted */\n if (!abortController?.signal.aborted) {\n this.#isValidationPending = false;\n this.#validationCompleteResolver?.();\n }\n });\n\n /**\n * If async validators are present:\n * Only run updates when a sync validator has a change. This is to prevent\n * situations where running sync validators can override async validators\n * that are still in progress\n *\n * If async validators are not present, always update validity\n */\n if (hasChange || !hasAsyncValidators) {\n this.#setValidityWithOptionalTarget(validity, validationMessage);\n }\n }\n\n /**\n * If the validationTarget is not set, the user can decide how they would\n * prefer to handle focus when the field is validated.\n */\n #setValidityWithOptionalTarget(validity: Partial<ValidityState>, validationMessage: string|undefined): void {\n if (this.validationTarget) {\n this.internals.setValidity(validity, validationMessage, this.validationTarget);\n this.#awaitingValidationTarget = false;\n } else {\n this.internals.setValidity(validity, validationMessage);\n\n if (this.internals.validity.valid) {\n return;\n }\n\n /**\n * Sets mark the component as awaiting a validation target\n * if the element dispatches an invalid event, the #onInvalid listener\n * will check to see if the validation target has been set since this call\n * has run. This useful in cases like Lit's use of the query\n * decorator for setting the validationTarget or any scenario\n * where the validationTarget isn't available upon construction\n */\n this.#awaitingValidationTarget = true;\n }\n }\n\n /** Process the validator message attribute */\n #getValidatorMessageForValue(validator: Validator, value: FormValue): string {\n /** If the validity callback exists and returns, use that as the result */\n if (this.validityCallback) {\n const message = this.validityCallback(validator.key || 'customError');\n\n if (message) {\n return message;\n }\n }\n\n if (validator.message instanceof Function) {\n return (validator.message as validationMessageCallback)(this, value);\n } else {\n return validator.message as string;\n }\n }\n\n /** Reset control state when the form is reset */\n formResetCallback() {\n this.#touched = false;\n this.#forceError = false;\n this.#shouldShowError();\n this.resetFormControl?.();\n\n this.validationMessageCallback?.(\n this.#shouldShowError() ? this.validationMessage : ''\n );\n }\n }\n\n return FormControl as Constructor<FormControlInterface> & TBase;\n}\n", "(function () {\n 'use strict';\n\n const refMap = new WeakMap();\n const validityMap = new WeakMap();\n const hiddenInputMap = new WeakMap();\n const internalsMap = new WeakMap();\n const validationMessageMap = new WeakMap();\n const formsMap = new WeakMap();\n const shadowHostsMap = new WeakMap();\n const formElementsMap = new WeakMap();\n const refValueMap = new WeakMap();\n const upgradeMap = new WeakMap();\n const shadowRootMap = new WeakMap();\n const validationAnchorMap = new WeakMap();\n const documentFragmentMap = new WeakMap();\n const connectedCallbackMap = new WeakMap();\n const validityUpgradeMap = new WeakMap();\n\n const aom = {\n ariaAtomic: 'aria-atomic',\n ariaAutoComplete: 'aria-autocomplete',\n ariaBusy: 'aria-busy',\n ariaChecked: 'aria-checked',\n ariaColCount: 'aria-colcount',\n ariaColIndex: 'aria-colindex',\n ariaColIndexText: 'aria-colindextext',\n ariaColSpan: 'aria-colspan',\n ariaCurrent: 'aria-current',\n ariaDisabled: 'aria-disabled',\n ariaExpanded: 'aria-expanded',\n ariaHasPopup: 'aria-haspopup',\n ariaHidden: 'aria-hidden',\n ariaInvalid: 'aria-invalid',\n ariaKeyShortcuts: 'aria-keyshortcuts',\n ariaLabel: 'aria-label',\n ariaLevel: 'aria-level',\n ariaLive: 'aria-live',\n ariaModal: 'aria-modal',\n ariaMultiLine: 'aria-multiline',\n ariaMultiSelectable: 'aria-multiselectable',\n ariaOrientation: 'aria-orientation',\n ariaPlaceholder: 'aria-placeholder',\n ariaPosInSet: 'aria-posinset',\n ariaPressed: 'aria-pressed',\n ariaReadOnly: 'aria-readonly',\n ariaRelevant: 'aria-relevant',\n ariaRequired: 'aria-required',\n ariaRoleDescription: 'aria-roledescription',\n ariaRowCount: 'aria-rowcount',\n ariaRowIndex: 'aria-rowindex',\n ariaRowIndexText: 'aria-rowindextext',\n ariaRowSpan: 'aria-rowspan',\n ariaSelected: 'aria-selected',\n ariaSetSize: 'aria-setsize',\n ariaSort: 'aria-sort',\n ariaValueMax: 'aria-valuemax',\n ariaValueMin: 'aria-valuemin',\n ariaValueNow: 'aria-valuenow',\n ariaValueText: 'aria-valuetext',\n role: 'role'\n };\n const initAom = (ref, internals) => {\n for (let key in aom) {\n internals[key] = null;\n let closureValue = null;\n const attributeName = aom[key];\n Object.defineProperty(internals, key, {\n get() {\n return closureValue;\n },\n set(value) {\n closureValue = value;\n if (ref.isConnected) {\n ref.setAttribute(attributeName, value);\n }\n else {\n upgradeMap.set(ref, internals);\n }\n }\n });\n }\n };\n\n function initNode(node) {\n const internals = internalsMap.get(node);\n const { form } = internals;\n initForm(node, form, internals);\n initLabels(node, internals.labels);\n }\n const walkFieldset = (node, firstRender = false) => {\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node) {\n return internalsMap.has(node) ?\n NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n let current = walker.nextNode();\n const isCallNecessary = (!firstRender || node.disabled);\n while (current) {\n if (current.formDisabledCallback && isCallNecessary) {\n setDisabled(current, node.disabled);\n }\n current = walker.nextNode();\n }\n };\n const disabledObserverConfig = { attributes: true, attributeFilter: ['disabled'] };\n const disabledObserver = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n const target = mutation.target;\n if (target.constructor['formAssociated']) {\n setDisabled(target, target.hasAttribute('disabled'));\n }\n else if (target.localName === 'fieldset') {\n walkFieldset(target);\n }\n }\n });\n function observerCallback(mutationList) {\n mutationList.forEach(mutationRecord => {\n const { addedNodes, removedNodes } = mutationRecord;\n const added = Array.from(addedNodes);\n const removed = Array.from(removedNodes);\n added.forEach(node => {\n if (internalsMap.has(node) && node.constructor['formAssociated']) {\n initNode(node);\n }\n if (upgradeMap.has(node)) {\n const internals = upgradeMap.get(node);\n const aomKeys = Object.keys(aom);\n aomKeys\n .filter(key => internals[key] !== null)\n .forEach(key => {\n node.setAttribute(aom[key], internals[key]);\n });\n upgradeMap.delete(node);\n }\n if (validityUpgradeMap.has(node)) {\n const internals = validityUpgradeMap.get(node);\n node.setAttribute('internals-valid', internals.validity.valid.toString());\n node.setAttribute('internals-invalid', (!internals.validity.valid).toString());\n node.setAttribute('aria-invalid', (!internals.validity.valid).toString());\n validityUpgradeMap.delete(node);\n }\n if (node.localName === 'form') {\n const formElements = formElementsMap.get(node);\n const walker = document.createTreeWalker(node, NodeFilter.SHOW_ELEMENT, {\n acceptNode(node) {\n return internalsMap.has(node) && !(formElements && formElements.has(node)) ?\n NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;\n }\n });\n let current = walker.nextNode();\n while (current) {\n initNode(current);\n current = walker.nextNode();\n }\n }\n if (node.localName === 'fieldset') {\n disabledObserver.observe(node, disabledObserverConfig);\n walkFieldset(node, true);\n }\n });\n removed.forEach(node => {\n const internals = internalsMap.get(node);\n if (internals && hiddenInputMap.get(internals)) {\n removeHiddenInputs(internals);\n }\n if (shadowHostsMap.has(node)) {\n const observer = shadowHostsMap.get(node);\n observer.disconnect();\n }\n });\n });\n }\n function fragmentObserverCallback(mutationList) {\n mutationList.forEach(mutation => {\n const { removedNodes } = mutation;\n removedNodes.forEach(node => {\n const observer = documentFragmentMap.get(mutation.target);\n if (internalsMap.has(node)) {\n upgradeInternals(node);\n }\n observer.disconnect();\n });\n });\n }\n const deferUpgrade = (fragment) => {\n const observer = new MutationObserver(fragmentObserverCallback);\n observer.observe(fragment, { childList: true });\n documentFragmentMap.set(fragment, observer);\n };\n new MutationObserver(observerCallback);\n const observerConfig = {\n childList: true,\n subtree: true\n };\n\n const setDisabled = (ref, disabled) => {\n ref.toggleAttribute('internals-disabled', disabled);\n if (disabled) {\n ref.setAttribute('aria-disabled', 'true');\n }\n else {\n ref.removeAttribute('aria-disabled');\n }\n if (ref.formDisabledCallback) {\n ref.formDisabledCallback.apply(ref, [disabled]);\n }\n };\n const removeHiddenInputs = (internals) => {\n const hiddenInputs = hiddenInputMap.get(internals);\n hiddenInputs.forEach(hiddenInput => {\n hiddenInput.remove();\n });\n hiddenInputMap.set(internals, []);\n };\n const createHiddenInput = (ref, internals) => {\n const input = document.createElement('input');\n input.type = 'hidden';\n input.name = ref.getAttribute('name');\n ref.after(input);\n hiddenInputMap.get(internals).push(input);\n return input;\n };\n const initRef = (ref, internals) => {\n hiddenInputMap.set(internals, []);\n disabledObserver.observe(ref, disabledObserverConfig);\n };\n const initLabels = (ref, labels) => {\n if (labels.length) {\n Array.from(labels).forEach(label => label.addEventListener('click', ref.click.bind(ref)));\n let firstLabelId = labels[0].id;\n if (!labels[0].id) {\n firstLabelId = `${labels[0].htmlFor}_Label`;\n labels[0].id = firstLabelId;\n }\n ref.setAttribute('aria-labelledby', firstLabelId);\n }\n };\n const setFormValidity = (form) => {\n const nativeControlValidity = Array.from(form.elements)\n .filter((element) => !element.tagName.includes('-') && element.validity)\n .map((element) => element.validity.valid);\n const polyfilledElements = formElementsMap.get(form) || [];\n const polyfilledValidity = Array.from(polyfilledElements)\n .filter(control => control.isConnected)\n .map((control) => internalsMap.get(control).validity.valid);\n const hasInvalid = [...nativeControlValidity, ...polyfilledValidity].includes(false);\n form.toggleAttribute('internals-invalid', hasInvalid);\n form.toggleAttribute('internals-valid', !hasInvalid);\n };\n const formInputCallback = (event) => {\n setFormValidity(findParentForm(event.target));\n };\n const formChangeCallback = (event) => {\n setFormValidity(findParentForm(event.target));\n };\n const wireSubmitLogic = (form) => {\n const SUBMIT_BUTTON_SELECTOR = ':is(:is(button, input)[type=submit], button:not([type])):not([disabled])';\n let submitButtonSelector = `${SUBMIT_BUTTON_SELECTOR}:not([form])`;\n if (form.id) {\n submitButtonSelector += `,${SUBMIT_BUTTON_SELECTOR}[form='${form.id}']`;\n }\n form.addEventListener('click', event => {\n const target = event.target;\n if (target.closest(submitButtonSelector)) {\n const elements = formElementsMap.get(form);\n if (form.noValidate) {\n return;\n }\n if (elements.size) {\n const nodes = Array.from(elements);\n const validityList = nodes\n .reverse()\n .map(node => {\n const internals = internalsMap.get(node);\n return internals.reportValidity();\n });\n if (validityList.includes(false)) {\n event.preventDefault();\n }\n }\n }\n });\n };\n const formResetCallback = (event) => {\n const elements = formElementsMap.get(event.target);\n if (elements && elements.size) {\n elements.forEach(element => {\n if (element.constructor.formAssociated && element.formResetCallback) {\n element.formResetCallback.apply(element);\n }\n });\n }\n };\n const initForm = (ref, form, internals) => {\n if (form) {\n const formElements = formElementsMap.get(form);\n if (formElements) {\n formElements.add(ref);\n }\n else {\n const initSet = new Set();\n initSet.add(ref);\n formElementsMap.set(form, initSet);\n wireSubmitLogic(form);\n form.addEventListener('reset', formResetCallback);\n form.addEventListener('input', formInputCallback);\n form.addEventListener('change', formChangeCallback);\n }\n formsMap.set(form, { ref, internals });\n if (ref.constructor['formAssociated'] && ref.formAssociatedCallback) {\n setTimeout(() => {\n ref.formAssociatedCallback.apply(ref, [form]);\n }, 0);\n }\n setFormValidity(form);\n }\n };\n const findParentForm = (elem) => {\n let parent = elem.parentNode;\n if (parent && parent.tagName !== 'FORM') {\n parent = findParentForm(parent);\n }\n return parent;\n };\n const throwIfNotFormAssociated = (ref, message, ErrorType = DOMException) => {\n if (!ref.constructor['formAssociated']) {\n throw new ErrorType(message);\n }\n };\n const overrideFormMethod = (form, returnValue, method) => {\n const elements = formElementsMap.get(form);\n if (elements && elements.size) {\n elements.forEach(element => {\n const internals = internalsMap.get(element);\n const valid = internals[method]();\n if (!valid) {\n returnValue = false;\n }\n });\n }\n return returnValue;\n };\n const upgradeInternals = (ref) => {\n if (ref.constructor['formAssociated']) {\n const internals = internalsMap.get(ref);\n const { labels, form } = internals;\n initLabels(ref, labels);\n initForm(ref, form, internals);\n }\n };\n\n class ValidityState {\n constructor() {\n this.badInput = false;\n this.customError = false;\n this.patternMismatch = false;\n this.rangeOverflow = false;\n this.rangeUnderflow = false;\n this.stepMismatch = false;\n this.tooLong = false;\n this.tooShort = false;\n this.typeMismatch = false;\n this.valid = true;\n this.valueMissing = false;\n Object.seal(this);\n }\n }\n const setValid = (validityObject) => {\n validityObject.badInput = false;\n validityObject.customError = false;\n validityObject.patternMismatch = false;\n validityObject.rangeOverflow = false;\n validityObject.rangeUnderflow = false;\n validityObject.stepMismatch = false;\n validityObject.tooLong = false;\n validityObject.tooShort = false;\n validityObject.typeMismatch = false;\n validityObject.valid = true;\n validityObject.valueMissing = false;\n return validityObject;\n };\n const reconcileValidity = (validityObject, newState, form) => {\n validityObject.valid = isValid(newState);\n Object.keys(newState).forEach(key => validityObject[key] = newState[key]);\n if (form) {\n setFormValidity(form);\n }\n return validityObject;\n };\n const isValid = (validityState) => {\n let valid = true;\n for (let key in validityState) {\n if (key !== 'valid' && validityState[key] !== false) {\n valid = false;\n }\n }\n return valid;\n };\n\n const customStateMap = new WeakMap();\n class CustomStateSet extends Set {\n static get isPolyfilled() {\n return true;\n }\n constructor(ref) {\n super();\n if (!ref || !ref.tagName || ref.tagName.indexOf('-') === -1) {\n throw new TypeError('Illegal constructor');\n }\n customStateMap.set(this, ref);\n }\n add(state) {\n if (!/^--/.test(state) || typeof state !== 'string') {\n throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${state} must start with '--'.`);\n }\n const result = super.add(state);\n const ref = customStateMap.get(this);\n ref.toggleAttribute(`state${state}`, true);\n if (ref.part) {\n ref.part.add(`state${state}`);\n }\n return result;\n }\n clear() {\n for (let [entry] of this.entries()) {\n this.delete(entry);\n }\n super.clear();\n }\n delete(state) {\n const result = super.delete(state);\n const ref = customStateMap.get(this);\n ref.toggleAttribute(`state${state}`, false);\n if (ref.part) {\n ref.part.remove(`state${state}`);\n }\n return result;\n }\n }\n\n function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n }\n function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n }\n\n var _HTMLFormControlsCollection_elements;\n class HTMLFormControlsCollection {\n constructor(elements) {\n _HTMLFormControlsCollection_elements.set(this, void 0);\n __classPrivateFieldSet(this, _HTMLFormControlsCollection_elements, elements, \"f\");\n for (let i = 0; i < elements.length; i++) {\n let element = elements[i];\n this[i] = element;\n if (element.hasAttribute('name')) {\n this[element.getAttribute('name')] = element;\n }\n }\n Object.freeze(this);\n }\n get length() {\n return __classPrivateFieldGet(this, _HTMLFormControlsCollection_elements, \"f\").length;\n }\n [(_HTMLFormControlsCollection_elements = new WeakMap(), Symbol.iterator)]() {\n return __classPrivateFieldGet(this, _HTMLFormControlsCollection_elements, \"f\")[Symbol.iterator]();\n }\n item(i) {\n return this[i] == null ? null : this[i];\n }\n namedItem(name) {\n return this[name] == null ? null : this[name];\n }\n }\n\n class ElementInternals {\n static get isPolyfilled() {\n return true;\n }\n constructor(ref) {\n if (!ref || !ref.tagName || ref.tagName.indexOf('-') === -1) {\n throw new TypeError('Illegal constructor');\n }\n const rootNode = ref.getRootNode();\n const validity = new ValidityState();\n this.states = new CustomStateSet(ref);\n refMap.set(this, ref);\n validityMap.set(this, validity);\n internalsMap.set(ref, this);\n initAom(ref, this);\n initRef(ref, this);\n Object.seal(this);\n upgradeInternals(ref);\n if (rootNode instanceof DocumentFragment) {\n deferUpgrade(rootNode);\n }\n }\n checkValidity() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);\n if (!this.willValidate) {\n return true;\n }\n const validity = validityMap.get(this);\n if (!validity.valid) {\n const validityEvent = new Event('invalid', {\n bubbles: false,\n cancelable: true,\n composed: false\n });\n ref.dispatchEvent(validityEvent);\n }\n return validity.valid;\n }\n get form() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n let form;\n if (ref.constructor['formAssociated'] === true) {\n form = findParentForm(ref);\n }\n return form;\n }\n get labels() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n const id = ref.getAttribute('id');\n const hostRoot = ref.getRootNode();\n if (hostRoot && id) {\n return hostRoot.querySelectorAll(`[for=\"${id}\"]`);\n }\n return [];\n }\n reportValidity() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);\n if (!this.willValidate) {\n return true;\n }\n const valid = this.checkValidity();\n const anchor = validationAnchorMap.get(this);\n if (anchor && !ref.constructor['formAssociated']) {\n throw new DOMException(`Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);\n }\n if (!valid && anchor) {\n ref.focus();\n anchor.focus();\n }\n return valid;\n }\n setFormValue(value) {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element.`);\n removeHiddenInputs(this);\n if (value != null && !(value instanceof FormData)) {\n if (ref.getAttribute('name')) {\n const hiddenInput = createHiddenInput(ref, this);\n hiddenInput.value = value;\n }\n }\n else if (value != null && value instanceof FormData) {\n Array.from(value).reverse().forEach(([formDataKey, formDataValue]) => {\n if (typeof formDataValue === 'string') {\n const hiddenInput = createHiddenInput(ref, this);\n hiddenInput.name = formDataKey;\n hiddenInput.value = formDataValue;\n }\n });\n }\n refValueMap.set(ref, value);\n }\n setValidity(validityChanges, validationMessage, anchor) {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element.`);\n if (!validityChanges) {\n throw new TypeError('Failed to execute \\'setValidity\\' on \\'ElementInternals\\': 1 argument required, but only 0 present.');\n }\n validationAnchorMap.set(this, anchor);\n const validity = validityMap.get(this);\n const validityChangesObj = {};\n for (const key in validityChanges) {\n validityChangesObj[key] = validityChanges[key];\n }\n if (Object.keys(validityChangesObj).length === 0) {\n setValid(validity);\n }\n const check = { ...validity, ...validityChangesObj };\n delete check.valid;\n const { valid } = reconcileValidity(validity, check, this.form);\n if (!valid && !validationMessage) {\n throw new DOMException(`Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.`);\n }\n validationMessageMap.set(this, valid ? '' : validationMessage);\n if (ref.isConnected) {\n ref.toggleAttribute('internals-invalid', !valid);\n ref.toggleAttribute('internals-valid', valid);\n ref.setAttribute('aria-invalid', `${!valid}`);\n }\n else {\n validityUpgradeMap.set(ref, this);\n }\n }\n get shadowRoot() {\n const ref = refMap.get(this);\n const shadowRoot = shadowRootMap.get(ref);\n if (shadowRoot) {\n return shadowRoot;\n }\n return null;\n }\n get validationMessage() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n return validationMessageMap.get(this);\n }\n get validity() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n const validity = validityMap.get(this);\n return validity;\n }\n get willValidate() {\n const ref = refMap.get(this);\n throwIfNotFormAssociated(ref, `Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element.`);\n if ((ref.disabled || ref.hasAttribute('disabled')) ||\n ref.hasAttribute('readonly')) {\n return false;\n }\n return true;\n }\n }\n function isElementInternalsSupported() {\n if (!window.ElementInternals || !HTMLElement.prototype.attachInternals) {\n return false;\n }\n class ElementInternalsFeatureDetection extends HTMLElement {\n constructor() {\n super();\n this.internals = this.attachInternals();\n }\n }\n const randomName = `element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g, '')}`;\n customElements.define(randomName, ElementInternalsFeatureDetection);\n const featureDetectionElement = new ElementInternalsFeatureDetection();\n return [\n 'shadowRoot',\n 'form',\n 'willValidate',\n 'validity',\n 'validationMessage',\n 'labels',\n 'setFormValue',\n 'setValidity',\n 'checkValidity',\n 'reportValidity'\n ].every(prop => prop in featureDetectionElement.internals);\n }\n if (!isElementInternalsSupported()) {\n window.ElementInternals = ElementInternals;\n const define = customElements.define;\n customElements.define = function (name, constructor, options) {\n if (constructor.formAssociated) {\n const connectedCallback = constructor.prototype.connectedCallback;\n constructor.prototype.connectedCallback = function () {\n if (!connectedCallbackMap.has(this)) {\n connectedCallbackMap.set(this, true);\n if (this.hasAttribute('disabled')) {\n setDisabled(this, true);\n }\n }\n if (connectedCallback != null) {\n connectedCallback.apply(this);\n }\n };\n }\n define.apply(customElements, [name, constructor, options]);\n };\n function attachShadowObserver(...args) {\n const shadowRoot = attachShadow.apply(this, args);\n const observer = new MutationObserver(observerCallback);\n shadowRootMap.set(this, shadowRoot);\n if (window.ShadyDOM) {\n observer.observe(this, observerConfig);\n }\n else {\n observer.observe(shadowRoot, observerConfig);\n }\n shadowHostsMap.set(this, observer);\n return shadowRoot;\n }\n function checkValidityOverride(...args) {\n let returnValue = checkValidity.apply(this, args);\n return overrideFormMethod(this, returnValue, 'checkValidity');\n }\n function reportValidityOverride(...args) {\n let returnValue = reportValidity.apply(this, args);\n return overrideFormMethod(this, returnValue, 'reportValidity');\n }\n HTMLElement.prototype.attachInternals = function () {\n if (!this.tagName) {\n return {};\n }\n else if (this.tagName.indexOf('-') === -1) {\n throw new Error(`Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.`);\n }\n if (internalsMap.has(this)) {\n throw new DOMException(`DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);\n }\n return new ElementInternals(this);\n };\n const attachShadow = Element.prototype.attachShadow;\n Element.prototype.attachShadow = attachShadowObserver;\n const documentObserver = new MutationObserver(observerCallback);\n documentObserver.observe(document.documentElement, observerConfig);\n const checkValidity = HTMLFormElement.prototype.checkValidity;\n HTMLFormElement.prototype.checkValidity = checkValidityOverride;\n const reportValidity = HTMLFormElement.prototype.reportValidity;\n HTMLFormElement.prototype.reportValidity = reportValidityOverride;\n const { get } = Object.getOwnPropertyDescriptor(HTMLFormElement.prototype, 'elements');\n Object.defineProperty(HTMLFormElement.prototype, 'elements', {\n get(...args) {\n const elements = get.call(this, ...args);\n const polyfilledElements = Array.from(formElementsMap.get(this) || []);\n if (polyfilledElements.length === 0) {\n return elements;\n }\n const orderedElements = Array.from(elements).concat(polyfilledElements).sort((a, b) => {\n if (a.compareDocumentPosition) {\n return a.compareDocumentPosition(b) & 2 ? 1 : -1;\n }\n return 0;\n });\n return new HTMLFormControlsCollection(orderedElements);\n },\n });\n if (!window.CustomStateSet) {\n window.CustomStateSet = CustomStateSet;\n }\n }\n else if (!window.CustomStateSet) {\n window.CustomStateSet = CustomStateSet;\n const attachInternals = HTMLElement.prototype.attachInternals;\n HTMLElement.prototype.attachInternals = function (...args) {\n const internals = attachInternals.call(this, args);\n internals.states = new CustomStateSet(this);\n return internals;\n };\n }\n\n})();\n"],
5
+ "mappings": "0pBAEM,SAAUA,GAEd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WAAY,CACzD,OAAOX,EAAM,CACT,IAAMrD,EAAWgE,EAAI,KAAK,KAAM,GAAGX,CAAI,EACjChE,EAAqB,MAAM,KAAK1D,EAAgB,IAAI,IAAI,GAAK,CAAC,CAAC,EACrE,GAAI0D,EAAmB,SAAW,EAC9B,OAAOW,EAEX,IAAMiE,EAAkB,MAAM,KAAKjE,CAAQ,EAAE,OAAOX,CAAkB,EAAE,KAAK,CAAC6E,GAAGC,KACzED,GAAE,wBACKA,GAAE,wBAAwBC,EAAC,EAAI,EAAI,EAAI,GAE3C,CACV,EACD,OAAO,IAAIrC,GAA2BmC,CAAe,CACzD,CACJ,CAAC,EACI,OAAO,iBACR,OAAO,eAAiB7C,GAapC,GAAG",
6
+ "names": ["FormControlMixin", "SuperClass", "FormControl", "args", "_FormControl_focused", "_FormControl_forceError", "_FormControl_touched", "_FormControl_abortController", "_FormControl_previousAbortController", "_FormControl_awaitingValidationTarget", "_FormControl_value", "_FormControl_onFocus", "__classPrivateFieldSet", "__classPrivateFieldGet", "_FormControl_instances", "_FormControl_shouldShowError", "_FormControl_onBlur", "_FormControl_runValidators", "showError", "_FormControl_onInvalid", "_a", "_FormControl_validationCompleteResolver", "_FormControl_isValidationPending", "_FormControl_validationComplete", "_b", "_c", "validatorAttributes", "validator", "observedAttributes", "attribute", "name", "oldValue", "newValue", "validators", "value", "valueToUpdate", "resolve", "rootNode", "selector", "proto", "validity", "asyncValidators", "hasAsyncValidators", "abortController", "validationMessage", "hasChange", "key", "isValid", "isValidatorValid", "_FormControl_getValidatorMessageForValue", "_FormControl_setValidityWithOptionalTarget", "message", "refMap", "validityMap", "hiddenInputMap", "internalsMap", "validationMessageMap", "formsMap", "shadowHostsMap", "formElementsMap", "refValueMap", "upgradeMap", "shadowRootMap", "validationAnchorMap", "documentFragmentMap", "connectedCallbackMap", "validityUpgradeMap", "aom", "initAom", "ref", "internals", "key", "closureValue", "attributeName", "value", "initNode", "node", "form", "initForm", "initLabels", "walkFieldset", "firstRender", "walker", "current", "isCallNecessary", "setDisabled", "disabledObserverConfig", "disabledObserver", "mutationsList", "mutation", "target", "observerCallback", "mutationList", "mutationRecord", "addedNodes", "removedNodes", "added", "removed", "formElements", "removeHiddenInputs", "fragmentObserverCallback", "observer", "upgradeInternals", "deferUpgrade", "fragment", "observerConfig", "disabled", "hiddenInput", "createHiddenInput", "input", "initRef", "labels", "label", "firstLabelId", "setFormValidity", "nativeControlValidity", "element", "polyfilledElements", "polyfilledValidity", "control", "hasInvalid", "formInputCallback", "event", "findParentForm", "formChangeCallback", "wireSubmitLogic", "SUBMIT_BUTTON_SELECTOR", "submitButtonSelector", "elements", "formResetCallback", "initSet", "elem", "parent", "throwIfNotFormAssociated", "message", "ErrorType", "overrideFormMethod", "returnValue", "method", "ValidityState", "setValid", "validityObject", "reconcileValidity", "newState", "isValid", "validityState", "valid", "customStateMap", "CustomStateSet", "state", "result", "entry", "__classPrivateFieldGet", "receiver", "kind", "f", "__classPrivateFieldSet", "_HTMLFormControlsCollection_elements", "HTMLFormControlsCollection", "i", "name", "ElementInternals", "rootNode", "validity", "validityEvent", "id", "hostRoot", "anchor", "formDataKey", "formDataValue", "validityChanges", "validationMessage", "validityChangesObj", "check", "shadowRoot", "isElementInternalsSupported", "ElementInternalsFeatureDetection", "randomName", "featureDetectionElement", "prop", "attachInternals", "args", "attachShadowObserver", "attachShadow", "checkValidityOverride", "checkValidity", "reportValidityOverride", "reportValidity", "define", "constructor", "options", "connectedCallback", "get", "orderedElements", "a", "b"]
7
+ }
@@ -1,4 +1,4 @@
1
- import{a as v}from"./chunk-EPJ347EQ.js";import{a as d}from"./chunk-7K5FMQLQ.js";import{a as f}from"./chunk-KPAWUBRO.js";import{a as l}from"./chunk-23UFIOHV.js";import{a as s,b as a,f as n,g as c,h as r,j as m}from"./chunk-57PTZNIL.js";import{a as t}from"./chunk-NZ3RGSR6.js";var E=s`:host{display:inline-block;vertical-align:middle}:host *{outline:0}label{display:flex;gap:var(--bl-size-2xs);color:var(--bl-color-secondary);font:var(--bl-font-title-3);cursor:pointer;user-select:none}.label{word-break:break-all}input{appearance:none;position:absolute}.check-mark{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--bl-size-m);height:var(--bl-size-m);min-width:var(--bl-size-m);min-height:var(--bl-size-m);max-width:var(--bl-size-m);max-height:var(--bl-size-m);border:1px solid var(--bl-color-border);border-radius:var(--bl-border-radius-xs);color:var(--bl-color-content-primary-contrast);font-size:var(--bl-font-size-2xs);line-height:100%;background-color:var(--bl-color-primary-background)}:host([checked]) .label,:host(:hover) .label,:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .label{color:var(--bl-color-primary)}:host(:is([checked],[indeterminate])) .check-mark{background-color:var(--bl-color-primary);border:0}:host([disabled]){cursor:not-allowed;pointer-events:none}:host([disabled]) .check-mark,:host([disabled]) .label{color:var(--bl-color-content-passive)}:host([disabled]) .check-mark{background-color:var(--bl-color-secondary-background)}:host(:not([disabled])) input:focus-visible+.check-mark{box-shadow:0 0 0 1px white,0 0 0 3px var(--bl-color-primary)}`,g=E;var O=s`:host{display:flex;flex-direction:row}fieldset{border:0;padding:0}legend{font:var(--bl-font-title-3-medium);color:var(--bl-color-content-primary)}.options{display:flex;flex-flow:var(--bl-checkbox-direction,column) wrap;gap:var(--bl-size-m);margin-block:var(--bl-size-xs)}`,k=O;var p="bl-checkbox-group",u="bl-checkbox-group-change",o=class extends d(n){constructor(){super(...arguments);this.value=[];this.required=!1;this.focusedOptionIndex=0}static get styles(){return[k]}get options(){return[].slice.call(this.querySelectorAll(h))}get checkedOptions(){return this.options.filter(e=>e.checked).map(e=>e.value)}get availableOptions(){return this.options.filter(e=>!e.disabled)}connectedCallback(){super.connectedCallback(),this.tabIndex=0,this.addEventListener("focus",this.handleFocus),this.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focus",this.handleFocus),this.removeEventListener("keydown",this.handleKeyDown)}updated(e){e.has("value")&&(this.setValue(this.checkedOptions.join(",")),this.onChange(this.value))}handleOptionChecked(){this.value=this.checkedOptions}handleKeyDown(e){if(["ArrowDown","ArrowRight"].includes(e.key))this.focusedOptionIndex++;else if(["ArrowUp","ArrowLeft"].includes(e.key))this.focusedOptionIndex--;else if(e.key==="Tab"){if(e.shiftKey?this.focusedOptionIndex--:this.focusedOptionIndex++,this.focusedOptionIndex===this.availableOptions.length){this.tabIndex=0,this.focusedOptionIndex=0;return}}else return;this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,this.availableOptions.length-1)),this.availableOptions[this.focusedOptionIndex].focus(),e.preventDefault()}handleFocus(){this.availableOptions[this.focusedOptionIndex].focus()}render(){return a`<fieldset role="group" aria-labelledby="label" aria-required=${this.required}>
1
+ import{a as v}from"./chunk-EPJ347EQ.js";import{a as d}from"./chunk-DJOD4BTL.js";import{a as f}from"./chunk-KPAWUBRO.js";import{a as l}from"./chunk-23UFIOHV.js";import{a as s,b as a,f as n,g as c,h as r,j as m}from"./chunk-57PTZNIL.js";import{a as t}from"./chunk-NZ3RGSR6.js";var E=s`:host{display:inline-block;vertical-align:middle}:host *{outline:0}label{display:flex;gap:var(--bl-size-2xs);color:var(--bl-color-secondary);font:var(--bl-font-title-3);cursor:pointer;user-select:none}.label{word-break:break-all}input{appearance:none;position:absolute}.check-mark{display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:var(--bl-size-m);height:var(--bl-size-m);min-width:var(--bl-size-m);min-height:var(--bl-size-m);max-width:var(--bl-size-m);max-height:var(--bl-size-m);border:1px solid var(--bl-color-border);border-radius:var(--bl-border-radius-xs);color:var(--bl-color-content-primary-contrast);font-size:var(--bl-font-size-2xs);line-height:100%;background-color:var(--bl-color-primary-background)}:host([checked]) .label,:host(:hover) .label,:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .label{color:var(--bl-color-primary)}:host(:is([checked],[indeterminate])) .check-mark{background-color:var(--bl-color-primary);border:0}:host([disabled]){cursor:not-allowed;pointer-events:none}:host([disabled]) .check-mark,:host([disabled]) .label{color:var(--bl-color-content-passive)}:host([disabled]) .check-mark{background-color:var(--bl-color-secondary-background)}:host(:not([disabled])) input:focus-visible+.check-mark{box-shadow:0 0 0 1px white,0 0 0 3px var(--bl-color-primary)}`,g=E;var O=s`:host{display:flex;flex-direction:row}fieldset{border:0;padding:0}legend{font:var(--bl-font-title-3-medium);color:var(--bl-color-content-primary)}.options{display:flex;flex-flow:var(--bl-checkbox-direction,column) wrap;gap:var(--bl-size-m);margin-block:var(--bl-size-xs)}`,k=O;var p="bl-checkbox-group",u="bl-checkbox-group-change",o=class extends d(n){constructor(){super(...arguments);this.value=[];this.required=!1;this.focusedOptionIndex=0}static get styles(){return[k]}get options(){return[].slice.call(this.querySelectorAll(h))}get checkedOptions(){return this.options.filter(e=>e.checked).map(e=>e.value)}get availableOptions(){return this.options.filter(e=>!e.disabled)}connectedCallback(){super.connectedCallback(),this.tabIndex=0,this.addEventListener("focus",this.handleFocus),this.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focus",this.handleFocus),this.removeEventListener("keydown",this.handleKeyDown)}updated(e){e.has("value")&&(this.setValue(this.checkedOptions.join(",")),this.onChange(this.value))}handleOptionChecked(){this.value=this.checkedOptions}handleKeyDown(e){if(["ArrowDown","ArrowRight"].includes(e.key))this.focusedOptionIndex++;else if(["ArrowUp","ArrowLeft"].includes(e.key))this.focusedOptionIndex--;else if(e.key==="Tab"){if(e.shiftKey?this.focusedOptionIndex--:this.focusedOptionIndex++,this.focusedOptionIndex===this.availableOptions.length){this.tabIndex=0,this.focusedOptionIndex=0;return}}else return;this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,this.availableOptions.length-1)),this.availableOptions[this.focusedOptionIndex].focus(),e.preventDefault()}handleFocus(){this.availableOptions[this.focusedOptionIndex].focus()}render(){return a`<fieldset role="group" aria-labelledby="label" aria-required=${this.required}>
2
2
  <legend id="label">${this.label}</legend>
3
3
  <div class="options" @bl-checkbox-change=${this.handleOptionChecked}>
4
4
  <slot></slot>
@@ -21,4 +21,4 @@ import{a as v}from"./chunk-EPJ347EQ.js";import{a as d}from"./chunk-7K5FMQLQ.js";
21
21
  <span class="label"><slot></slot></span>
22
22
  </label>
23
23
  `}};t([r({type:Boolean,reflect:!0})],i.prototype,"checked",2),t([r()],i.prototype,"value",2),t([r({type:Boolean,reflect:!0})],i.prototype,"required",2),t([r({type:Boolean,reflect:!0})],i.prototype,"disabled",2),t([r({type:Boolean,reflect:!0})],i.prototype,"indeterminate",2),t([l("bl-checkbox-change")],i.prototype,"onChange",2),t([l("bl-focus")],i.prototype,"onFocus",2),t([l("bl-blur")],i.prototype,"onBlur",2),t([m("[type=checkbox]")],i.prototype,"checkboxElement",2),i=t([c(h)],i);export{h as a,i as b,p as c,u as d,o as e};
24
- //# sourceMappingURL=chunk-F3CGCLRX.js.map
24
+ //# sourceMappingURL=chunk-DSM6T5MC.js.map
@@ -0,0 +1,51 @@
1
+ import{a as h}from"./chunk-KPAWUBRO.js";import{a as o}from"./chunk-23UFIOHV.js";import{a as p,b as s,f as u,g as c,h as i,i as g}from"./chunk-57PTZNIL.js";import{a as r}from"./chunk-NZ3RGSR6.js";var b=p`.pagination{display:flex;flex-wrap:wrap;justify-content:center;max-width:max-content;gap:var(--bl-size-s)}.pagination *{margin:0;padding:0;box-sizing:border-box}.page-container{display:flex;align-items:center}.page-list{display:flex;align-items:center;list-style:none;user-select:none;gap:var(--bl-size-3xs)}.dots{margin:0 var(--bl-size-2xs)}.dots::before{content:' \\B7 \\B7 \\B7';color:var(--bl-color-content-primary)}.pagination-helpers{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:var(--bl-size-m);color:var(--bl-color-content-primary)}.jumper,.select{display:flex;align-items:center;gap:var(--bl-size-2xs)}label{font:var(--bl-font-title-3-medium);font-size:var(--bl-font-size-m);font-weight:var(--bl-font-weight-medium);line-height:var(--bl-font-size-m);letter-spacing:0;user-select:none}bl-input{width:62px}bl-select{width:128px}@media only screen and (max-width:768px){label{display:none}}`,m=b;var t=class extends u{constructor(){super(...arguments);this.currentPage=1;this.totalItems=0;this.itemsPerPage=10;this.hasJumper=!1;this.jumperLabel="Go To";this.hasSelect=!1;this.selectLabel="Show";this.itemsPerPageOptions=[{text:"10 Items",value:10},{text:"25 Items",value:25},{text:"50 Items",value:50},{text:"100 Items",value:100}];this.pages=[]}static get styles(){return[m]}connectedCallback(){super.connectedCallback(),setTimeout(()=>{window==null||window.addEventListener("resize",()=>this._paginate())})}disconnectedCallback(){super.disconnectedCallback(),window==null||window.removeEventListener("resize",this._paginate)}updated(e){(e.has("currentPage")||e.has("itemsPerPage")||e.has("totalItems"))&&this._paginate()}_paginate(){this.pages=[];let e=Math.ceil(Math.abs(this.totalItems/this.itemsPerPage))||1;if(e<=8){this.pages=Array.from(Array(e),(a,l)=>l+1);return}this.pages.push(1),this.currentPage<5?this.pages.push(2,3,4,5,"..."):this.currentPage>=5&&this.currentPage<=e-4?this.pages.push("...",this.currentPage-1,this.currentPage,this.currentPage+1,"..."):this.pages.push("...",e-4,e-3,e-2,e-1),this.pages.push(e)}_changePage(e){let a=this.currentPage;this.currentPage=e,this.onChange({selectedPage:e,prevPage:a,itemsPerPage:this.itemsPerPage})}_pageBack(){this.currentPage!==1&&this._changePage(this.currentPage-1)}_pageForward(){this.currentPage!==this._getLastPage()&&this._changePage(this.currentPage+1)}_getLastPage(){return+this.pages[this.pages.length-1]}_inputHandler(e){e.stopPropagation();let a=+e.target.value,l=a>0?Math.min(this._getLastPage(),a):1;this._changePage(l)}_selectHandler(e){var a;this.itemsPerPage=+((a=e==null?void 0:e.detail[0])==null?void 0:a.value)||100,this._changePage(1)}_renderSinglePage(e){if(typeof e=="string")return s`<li class="dots"></li>`;let a=this.currentPage===e?"page":void 0;return s` <li>
2
+ <bl-button
3
+ @click="${()=>this._changePage(e)}"
4
+ variant=${this.currentPage===e?"primary":"tertiary"}
5
+ kind="neutral"
6
+ label="Page ${e}"
7
+ aria-current=${h(a)}
8
+ >
9
+ ${e}
10
+ </bl-button>
11
+ </li>`}renderPages(){return s`
12
+ <div class="page-container">
13
+ <bl-button
14
+ @click="${this._pageBack}"
15
+ variant="tertiary"
16
+ kind="neutral"
17
+ icon="arrow_left"
18
+ class="previous"
19
+ label="Previous"
20
+ ?disabled=${this.currentPage===1}
21
+ ></bl-button>
22
+ <ul class="page-list">
23
+ ${window.innerWidth<768?s`${this._renderSinglePage(this.currentPage)}`:this.pages.map(e=>s`${this._renderSinglePage(e)}`)}
24
+ </ul>
25
+ <bl-button
26
+ @click="${this._pageForward}"
27
+ variant="tertiary"
28
+ kind="neutral"
29
+ icon="arrow_right"
30
+ class="next"
31
+ label="Next"
32
+ ?disabled=${this.currentPage===this._getLastPage()}
33
+ ></bl-button>
34
+ </div>
35
+ `}render(){let e=this.hasSelect?s`
36
+ <div class="select">
37
+ <label>${this.selectLabel}</label>
38
+ <bl-select @bl-select="${this._selectHandler}" .value=${this.itemsPerPage}>
39
+ ${this.itemsPerPageOptions.map(n=>s`<bl-select-option
40
+ .value=${n.value}
41
+ >${n.text}</bl-select-option
42
+ >`)}
43
+ </bl-select>
44
+ </div>
45
+ `:null,a=this.hasJumper?s` <div class="jumper">
46
+ <label>${this.jumperLabel}</label>
47
+ <bl-input .value="${this.currentPage}" @bl-change="${this._inputHandler}"></bl-input>
48
+ </div>`:null;return s` <nav class="pagination" aria-label="Pagination">
49
+ ${(()=>{if(!(!this.hasSelect&&!this.hasJumper))return s` <div class="pagination-helpers">${e} ${a}</div> `})()} ${this.renderPages()}
50
+ </nav>`}};r([i({attribute:"current-page",type:Number,reflect:!0})],t.prototype,"currentPage",2),r([i({attribute:"total-items",type:Number})],t.prototype,"totalItems",2),r([i({attribute:"items-per-page",type:Number,reflect:!0})],t.prototype,"itemsPerPage",2),r([i({attribute:"has-jumper",type:Boolean})],t.prototype,"hasJumper",2),r([i({attribute:"jumper-label",type:String})],t.prototype,"jumperLabel",2),r([i({attribute:"has-select",type:Boolean})],t.prototype,"hasSelect",2),r([i({attribute:"select-label",type:String})],t.prototype,"selectLabel",2),r([i({type:Array,attribute:!1})],t.prototype,"itemsPerPageOptions",2),r([g()],t.prototype,"pages",2),r([o("bl-change")],t.prototype,"onChange",2),t=r([c("bl-pagination")],t);export{t as a};
51
+ //# sourceMappingURL=chunk-J774WKKH.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/pagination/bl-pagination.css", "../src/components/pagination/bl-pagination.ts"],
4
+ "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`.pagination{display:flex;flex-wrap:wrap;justify-content:center;max-width:max-content;gap:var(--bl-size-s)}.pagination *{margin:0;padding:0;box-sizing:border-box}.page-container{display:flex;align-items:center}.page-list{display:flex;align-items:center;list-style:none;user-select:none;gap:var(--bl-size-3xs)}.dots{margin:0 var(--bl-size-2xs)}.dots::before{content:' \\\\B7 \\\\B7 \\\\B7';color:var(--bl-color-content-primary)}.pagination-helpers{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:var(--bl-size-m);color:var(--bl-color-content-primary)}.jumper,.select{display:flex;align-items:center;gap:var(--bl-size-2xs)}label{font:var(--bl-font-title-3-medium);font-size:var(--bl-font-size-m);font-weight:var(--bl-font-weight-medium);line-height:var(--bl-font-size-m);letter-spacing:0;user-select:none}bl-input{width:62px}bl-select{width:128px}@media only screen and (max-width:768px){label{display:none}}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult, PropertyValues } from 'lit';\nimport { customElement, property, state } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { event, EventDispatcher } from '../../utilities/event';\nimport '../button/bl-button';\nimport '../input/bl-input';\nimport '../select/bl-select';\n\nimport style from './bl-pagination.css';\n\n/**\n * @tag bl-pagination\n * @summary Baklava Pagination component\n */\n\n@customElement('bl-pagination')\nexport default class BlPagination extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets the current page\n */\n @property({ attribute: 'current-page', type: Number, reflect: true })\n currentPage = 1;\n\n /**\n * Sets the total items to be paginated\n */\n @property({ attribute: 'total-items', type: Number })\n totalItems = 0;\n\n /**\n * Sets the number of items per page\n */\n @property({ attribute: 'items-per-page', type: Number, reflect: true })\n itemsPerPage = 10;\n\n /**\n * Adds jumper element if provided as true\n */\n @property({ attribute: 'has-jumper', type: Boolean })\n hasJumper = false;\n\n /**\n * Sets the jumper label\n */\n @property({ attribute: 'jumper-label', type: String })\n jumperLabel = 'Go To';\n\n /**\n * Adds select element to choose the items per page\n */\n @property({ attribute: 'has-select', type: Boolean })\n hasSelect = false;\n\n /**\n * Adds select element to choose the items per page\n */\n @property({ attribute: 'select-label', type: String })\n selectLabel = 'Show';\n\n /**\n * Sets the items per page options of the select element\n * PROPERTY\n */\n @property({ type: Array, attribute: false })\n itemsPerPageOptions = [\n {\n text: '10 Items',\n value: 10,\n },\n {\n text: '25 Items',\n value: 25,\n },\n {\n text: '50 Items',\n value: 50,\n },\n {\n text: '100 Items',\n value: 100,\n },\n ];\n\n @state() private pages: Array<number | string> = [];\n\n /**\n * Fires when the current page changes\n */\n @event('bl-change') private onChange: EventDispatcher<{\n selectedPage: number;\n prevPage: number;\n itemsPerPage: number;\n }>;\n\n connectedCallback() {\n super.connectedCallback();\n\n setTimeout(() => {\n window?.addEventListener('resize', () => this._paginate());\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n window?.removeEventListener('resize', this._paginate);\n }\n\n updated(changedProperties: PropertyValues<this>) {\n if (\n changedProperties.has('currentPage') ||\n changedProperties.has('itemsPerPage') ||\n changedProperties.has('totalItems')\n ) {\n this._paginate();\n }\n }\n\n private _paginate() {\n this.pages = [];\n const pageListLength = Math.ceil(Math.abs(this.totalItems / this.itemsPerPage)) || 1;\n\n if (pageListLength <= 8) {\n this.pages = Array.from(Array(pageListLength), (_, index) => index + 1);\n return;\n }\n\n this.pages.push(1);\n\n if (this.currentPage < 5) {\n this.pages.push(2, 3, 4, 5, '...');\n } else if (this.currentPage >= 5 && this.currentPage <= pageListLength - 4) {\n this.pages.push('...', this.currentPage - 1, this.currentPage, this.currentPage + 1, '...');\n } else {\n this.pages.push(\n '...',\n pageListLength - 4,\n pageListLength - 3,\n pageListLength - 2,\n pageListLength - 1\n );\n }\n\n this.pages.push(pageListLength);\n }\n\n private _changePage(selectedPage: number): void {\n const prevPage = this.currentPage;\n\n this.currentPage = selectedPage;\n\n this.onChange({\n selectedPage,\n prevPage,\n itemsPerPage: this.itemsPerPage,\n });\n }\n\n private _pageBack(): void {\n if (this.currentPage === 1) return;\n this._changePage(this.currentPage - 1);\n }\n\n private _pageForward(): void {\n if (this.currentPage === this._getLastPage()) return;\n this._changePage(this.currentPage + 1);\n }\n\n private _getLastPage(): number {\n return +this.pages[this.pages.length - 1];\n }\n\n private _inputHandler(event: CustomEvent) {\n event.stopPropagation();\n const inputValue = +(event.target as HTMLInputElement).value;\n const newPage = inputValue > 0 ? Math.min(this._getLastPage(), inputValue) : 1;\n this._changePage(newPage);\n }\n\n private _selectHandler(event: CustomEvent) {\n this.itemsPerPage = +event?.detail[0]?.value || 100;\n this._changePage(1);\n }\n\n private _renderSinglePage(page: number | string) {\n if (typeof page === 'string') {\n return html`<li class=\"dots\"></li>`;\n }\n const ariaCurrent = this.currentPage === page ? 'page' : undefined;\n return html` <li>\n <bl-button\n @click=\"${() => this._changePage(page)}\"\n variant=${this.currentPage === page ? 'primary' : 'tertiary'}\n kind=\"neutral\"\n label=\"Page ${page}\"\n aria-current=${ifDefined(ariaCurrent)}\n >\n ${page}\n </bl-button>\n </li>`;\n }\n\n private renderPages() {\n return html`\n <div class=\"page-container\">\n <bl-button\n @click=\"${this._pageBack}\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"arrow_left\"\n class=\"previous\"\n label=\"Previous\"\n ?disabled=${this.currentPage === 1}\n ></bl-button>\n <ul class=\"page-list\">\n ${window.innerWidth < 768\n ? html`${this._renderSinglePage(this.currentPage)}`\n : this.pages.map(page => html`${this._renderSinglePage(page)}`)}\n </ul>\n <bl-button\n @click=\"${this._pageForward}\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"arrow_right\"\n class=\"next\"\n label=\"Next\"\n ?disabled=${this.currentPage === this._getLastPage()}\n ></bl-button>\n </div>\n `;\n }\n\n render(): TemplateResult {\n const selectEl = this.hasSelect\n ? html`\n <div class=\"select\">\n <label>${this.selectLabel}</label>\n <bl-select @bl-select=\"${this._selectHandler}\" .value=${this.itemsPerPage}>\n ${this.itemsPerPageOptions.map(option => {\n return html`<bl-select-option\n .value=${option.value}\n >${option.text}</bl-select-option\n >`;\n })}\n </bl-select>\n </div>\n `\n : null;\n\n const jumperEl = this.hasJumper\n ? html` <div class=\"jumper\">\n <label>${this.jumperLabel}</label>\n <bl-input .value=\"${this.currentPage}\" @bl-change=\"${this._inputHandler}\"></bl-input>\n </div>`\n : null;\n\n const getHelperElements = () => {\n if (!this.hasSelect && !this.hasJumper) return;\n return html` <div class=\"pagination-helpers\">${selectEl} ${jumperEl}</div> `;\n };\n\n return html` <nav class=\"pagination\" aria-label=\"Pagination\">\n ${getHelperElements()} ${this.renderPages()}\n </nav>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bl-pagination': BlPagination;\n }\n}\n"],
5
+ "mappings": "mMACO,IAAMA,EAASC,i6BACfC,EAAQF,ECcf,IAAqBG,EAArB,cAA0CC,CAAW,CAArD,kCASE,iBAAc,EAMd,gBAAa,EAMb,kBAAe,GAMf,eAAY,GAMZ,iBAAc,QAMd,eAAY,GAMZ,iBAAc,OAOd,yBAAsB,CACpB,CACE,KAAM,WACN,MAAO,EACT,EACA,CACE,KAAM,WACN,MAAO,EACT,EACA,CACE,KAAM,WACN,MAAO,EACT,EACA,CACE,KAAM,YACN,MAAO,GACT,CACF,EAES,KAAQ,MAAgC,CAAC,EAtElD,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK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ListLength", "_", "index", "selectedPage", "prevPage", "event", "inputValue", "newPage", "_a", "page", "y", "ariaCurrent", "l", "selectEl", "option", "jumperEl", "__decorateClass", "e", "t"]
7
+ }
@@ -1,5 +1,5 @@
1
- import{b as $}from"./chunk-AEVRCHAZ.js";import{a as z}from"./chunk-EPJ347EQ.js";import{a as w}from"./chunk-7K5FMQLQ.js";import{a as x}from"./chunk-OLPYXE2P.js";import{a as d}from"./chunk-KPAWUBRO.js";import{a as m,b as y,c as f}from"./chunk-RLMJN536.js";import{a as h}from"./chunk-23UFIOHV.js";import{a as p,b as n,c as v,f as u,g,h as a,i as c,j as b}from"./chunk-57PTZNIL.js";import{a as i}from"./chunk-NZ3RGSR6.js";var C=y(class extends f{constructor(l){var o;if(super(l),l.type!==m.ATTRIBUTE||l.name!=="style"||((o=l.strings)===null||o===void 0?void 0:o.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(l){return Object.keys(l).reduce((o,e)=>{let r=l[e];return r==null?o:o+`${e=e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(l,[o]){let{style:e}=l.element;if(this.vt===void 0){this.vt=new Set;for(let r in o)this.vt.add(r);return this.render(o)}this.vt.forEach(r=>{o[r]==null&&(this.vt.delete(r),r.includes("-")?e.removeProperty(r):e[r]="")});for(let r in o){let s=o[r];s!=null&&(this.vt.add(r),r.includes("-")?e.setProperty(r,s):e[r]=s)}return v}});var R=p`:host{display:inline-block;width:200px;position:relative}.wrapper{--row-count:1;--maxrow-count:;--line-height:var(--bl-font-title-3-line-height);--scroll-height:var(--line-height);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--border-size:1px;--default-scroll-height:calc((var(--row-count) * var(--line-height)) + var(--padding-vertical));--height:max(var(--scroll-height),var(--default-scroll-height));--input-font:var(--bl-font-body-text-2);--border-radius:var(--bl-size-3xs);display:flex;flex-direction:column;position:relative;gap:var(--bl-size-3xs)}.input-wrapper{border:solid var(--border-size) var(--bl-color-border);border-radius:var(--border-radius);padding-top:var(--padding-vertical);display:flex;box-sizing:border-box}textarea{width:100%;align-self:stretch;outline:0;font:var(--input-font);padding:0 calc(var(--padding-horizontal) - var(--border-size));padding-bottom:var(--padding-vertical);margin:0;border:0;border-radius:var(--border-radius);color:var(--bl-color-content-primary);resize:vertical;display:block}:host([size='large']) .wrapper{--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size='small']) .wrapper{--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--input-font:var(--bl-font-body-text-3);--line-height:var(--bl-font-title-4-line-height)}textarea:disabled{background-color:var(--bl-color-secondary-background);color:var(--bl-color-content-tertiary);cursor:not-allowed}:host([disabled]) .wrapper{background-color:var(--bl-color-secondary-background)}:host([expand]) textarea{overflow:hidden;resize:none;height:var(--height)}:host([expand][max-rows]) textarea{--maxrow-height:calc((var(--maxrow-count) * var(--line-height)) + var(--padding-vertical));overflow-y:scroll;height:min(var(--height),var(--maxrow-height))}.wrapper:focus-within{border-color:var(--bl-color-primary)}.dirty.max-len-invalid,.dirty.invalid{border-color:var(--bl-color-danger)}:host([label]) ::placeholder{color:transparent;transition:color ease-out .4s}label{position:absolute;top:var(--padding-vertical);left:var(--padding-horizontal);right:var(--padding-horizontal);transition:all ease-in .2s;pointer-events:none;font:var(--bl-font-title-3-regular);color:var(--bl-color-content-tertiary);padding:0;max-width:max-content;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:where(.wrapper:focus-within,.wrapper.has-value) label{--label-padding:var(--bl-size-3xs);top:0;left:calc(var(--padding-horizontal) - var(--label-padding));transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-content-secondary);padding:0 var(--label-padding);background-color:var(--bl-color-content-primary-contrast);pointer-events:initial}:host ::placeholder,:host([label-fixed]) ::placeholder{color:var(--bl-color-content-tertiary)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-content-secondary);background-color:initial;padding:0}.hint{display:none;font:var(--bl-font-body-text-3)}:host([character-counter]) .hint,:host([help-text]) .hint,.dirty.invalid .hint{display:flex;gap:var(--bl-size-3xs)}.hint>*{margin:0;padding:0}.help-text,.invalid-text{flex:1}.counter-text{color:var(--bl-color-content-secondary);margin-left:auto}:where(.max-len-invalid,.dirty.invalid) .hint>.counter-text{color:var(--bl-color-danger)}.invalid-text{display:none;color:var(--bl-color-danger)}.help-text{color:var(--bl-color-content-secondary)}:where(.dirty.max-len-invalid,.dirty.invalid) .hint>.invalid-text{display:inline-block}.dirty.invalid .hint>.help-text{display:none}`,k=R;var t=class extends w(u){constructor(){super(...arguments);this.name="";this.required=!1;this.disabled=!1;this.expand=!1;this.size="medium";this.labelFixed=!1;this.characterCounter=!1;this.value="";this.rows=4;this.customScrollHeight=null;this.onError=()=>{this.onInvalid(this.internals.validity)};this.dirty=!1}static get styles(){return[k]}connectedCallback(){var e;super.connectedCallback(),(e=this.internals.form)==null||e.addEventListener("submit",()=>{this.reportValidity()})}inputHandler(e){this.autoResize();let r=e.target.value;this.setValue(r),this.onInput(r)}changeHandler(e){let r=e.target.value;this.dirty=!0,this.setValue(r),this.onChange(r)}firstUpdated(){this.setValue(this.value),this.autoResize()}updated(e){e.has("rows")&&this.autoResize()}reportValidity(){return this.dirty=!0,this.checkValidity()}valueChangedCallback(e){this.value=e}validityCallback(){var e;return this.customInvalidText||((e=this.validationTarget)==null?void 0:e.validationMessage)}autoResize(){if(!this.expand)return;this.validationTarget.style.height="auto";let e=this.validationTarget.scrollHeight;this.customScrollHeight=`${e}px`,this.validationTarget.style.removeProperty("height")}render(){let e=this.internals.validity.tooLong,r=this.checkValidity()?"":n`<p class="invalid-text">${this.validationMessage}</p>`,s=this.helpText?n`<p class="help-text">${this.helpText}</p>`:"",E=this.label?n`<label for="input">${this.label}</label>`:"",S=this.characterCounter&&this.maxlength?`${this.value.length}/${this.maxlength}`:this.characterCounter?`${this.value.length}`:"",M=this.characterCounter?n`<p class="counter-text">${S}</p>`:"",H={wrapper:!0,"has-value":this.value!==null&&this.value!=="",dirty:this.dirty,"max-len-invalid":e,invalid:!this.checkValidity()},V={"--row-count":`${this.rows}`,"--maxrow-count":this.maxRows?`${this.maxRows}`:null,"--scroll-height":this.customScrollHeight};return n`
2
- <div style=${C(V)} class=${x(H)}>
1
+ import{b as $}from"./chunk-RST5NVHY.js";import{a as z}from"./chunk-EPJ347EQ.js";import{a as w}from"./chunk-DJOD4BTL.js";import{a as x}from"./chunk-OLPYXE2P.js";import{a as d}from"./chunk-KPAWUBRO.js";import{a as m,b as y,c as f}from"./chunk-RLMJN536.js";import{a as h}from"./chunk-23UFIOHV.js";import{a as p,b as n,c as v,f as u,g,h as a,i as c,j as b}from"./chunk-57PTZNIL.js";import{a as i}from"./chunk-NZ3RGSR6.js";var C=y(class extends f{constructor(l){var o;if(super(l),l.type!==m.ATTRIBUTE||l.name!=="style"||((o=l.strings)===null||o===void 0?void 0:o.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(l){return Object.keys(l).reduce((o,e)=>{let r=l[e];return r==null?o:o+`${e=e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(l,[o]){let{style:e}=l.element;if(this.vt===void 0){this.vt=new Set;for(let r in o)this.vt.add(r);return this.render(o)}this.vt.forEach(r=>{o[r]==null&&(this.vt.delete(r),r.includes("-")?e.removeProperty(r):e[r]="")});for(let r in o){let s=o[r];s!=null&&(this.vt.add(r),r.includes("-")?e.setProperty(r,s):e[r]=s)}return v}});var V=p`:host{display:inline-block;width:200px;position:relative}.wrapper{--row-count:1;--maxrow-count:;--line-height:var(--bl-font-title-3-line-height);--scroll-height:var(--line-height);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--border-size:1px;--default-scroll-height:calc((var(--row-count) * var(--line-height)) + var(--padding-vertical));--height:max(var(--scroll-height),var(--default-scroll-height));--input-font:var(--bl-font-body-text-2);--border-radius:var(--bl-size-3xs);display:flex;flex-direction:column;position:relative;gap:var(--bl-size-3xs)}.input-wrapper{border:solid var(--border-size) var(--bl-color-border);border-radius:var(--border-radius);padding-top:var(--padding-vertical);display:flex;box-sizing:border-box}textarea{width:100%;align-self:stretch;outline:0;font:var(--input-font);padding:0 calc(var(--padding-horizontal) - var(--border-size));padding-bottom:var(--padding-vertical);margin:0;border:0;border-radius:var(--border-radius);color:var(--bl-color-content-primary);resize:vertical;display:block}:host([size='large']) .wrapper{--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size='small']) .wrapper{--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--input-font:var(--bl-font-body-text-3);--line-height:var(--bl-font-title-4-line-height)}textarea:disabled{background-color:var(--bl-color-secondary-background);color:var(--bl-color-content-tertiary);cursor:not-allowed}:host([disabled]) .wrapper{background-color:var(--bl-color-secondary-background)}:host([expand]) textarea{overflow:hidden;resize:none;height:var(--height)}:host([expand][max-rows]) textarea{--maxrow-height:calc((var(--maxrow-count) * var(--line-height)) + var(--padding-vertical));overflow-y:scroll;height:min(var(--height),var(--maxrow-height))}.wrapper:focus-within{border-color:var(--bl-color-primary)}.dirty.max-len-invalid,.dirty.invalid{border-color:var(--bl-color-danger)}:host([label]) ::placeholder{color:transparent;transition:color ease-out .4s}label{position:absolute;top:var(--padding-vertical);left:var(--padding-horizontal);right:var(--padding-horizontal);transition:all ease-in .2s;pointer-events:none;font:var(--bl-font-title-3-regular);color:var(--bl-color-content-tertiary);padding:0;max-width:max-content;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:where(.wrapper:focus-within,.wrapper.has-value) label{--label-padding:var(--bl-size-3xs);top:0;left:calc(var(--padding-horizontal) - var(--label-padding));transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-content-secondary);padding:0 var(--label-padding);background-color:var(--bl-color-content-primary-contrast);pointer-events:initial}:host ::placeholder,:host([label-fixed]) ::placeholder{color:var(--bl-color-content-tertiary)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-content-secondary);background-color:initial;padding:0}.hint{display:none;font:var(--bl-font-body-text-3)}:host([character-counter]) .hint,:host([help-text]) .hint,.dirty.invalid .hint{display:flex;gap:var(--bl-size-3xs)}.hint>*{margin:0;padding:0}.help-text,.invalid-text{flex:1}.counter-text{color:var(--bl-color-content-secondary);margin-left:auto}:where(.max-len-invalid,.dirty.invalid) .hint>.counter-text{color:var(--bl-color-danger)}.invalid-text{display:none;color:var(--bl-color-danger)}.help-text{color:var(--bl-color-content-secondary)}:where(.dirty.max-len-invalid,.dirty.invalid) .hint>.invalid-text{display:inline-block}.dirty.invalid .hint>.help-text{display:none}`,k=V;var t=class extends w(u){constructor(){super(...arguments);this.name="";this.required=!1;this.disabled=!1;this.expand=!1;this.size="medium";this.labelFixed=!1;this.characterCounter=!1;this.value="";this.rows=4;this.customScrollHeight=null;this.onError=()=>{this.onInvalid(this.internals.validity)};this.dirty=!1}static get styles(){return[k]}connectedCallback(){var e;super.connectedCallback(),(e=this.internals.form)==null||e.addEventListener("submit",()=>{this.reportValidity()})}inputHandler(e){this.autoResize();let r=e.target.value;this.value=r,this.onInput(r)}changeHandler(e){let r=e.target.value;this.dirty=!0,this.value=r,this.onChange(r)}firstUpdated(){this.setValue(this.value),this.autoResize()}async updated(e){e.has("rows")&&this.autoResize(),e.has("value")&&(this.setValue(this.value),await this.validationComplete,this.requestUpdate())}reportValidity(){return this.dirty=!0,this.checkValidity()}valueChangedCallback(e){this.value=e}validityCallback(){var e;return this.customInvalidText||((e=this.validationTarget)==null?void 0:e.validationMessage)}autoResize(){if(!this.expand)return;this.validationTarget.style.height="auto";let e=this.validationTarget.scrollHeight;this.customScrollHeight=`${e}px`,this.validationTarget.style.removeProperty("height")}render(){let e=this.internals.validity.tooLong,r=this.checkValidity()?"":n`<p class="invalid-text">${this.validationMessage}</p>`,s=this.helpText?n`<p class="help-text">${this.helpText}</p>`:"",E=this.label?n`<label for="input">${this.label}</label>`:"",S=this.characterCounter&&this.maxlength?`${this.value.length}/${this.maxlength}`:this.characterCounter?`${this.value.length}`:"",M=this.characterCounter?n`<p class="counter-text">${S}</p>`:"",H={wrapper:!0,"has-value":this.value!==null&&this.value!=="",dirty:this.dirty,"max-len-invalid":e,invalid:!this.checkValidity()},R={"--row-count":`${this.rows}`,"--maxrow-count":this.maxRows?`${this.maxRows}`:null,"--scroll-height":this.customScrollHeight};return n`
2
+ <div style=${C(R)} class=${x(H)}>
3
3
  ${E}
4
4
  <div class="input-wrapper">
5
5
  <textarea
@@ -29,4 +29,4 @@ lit-html/directives/style-map.js:
29
29
  * SPDX-License-Identifier: BSD-3-Clause
30
30
  *)
31
31
  */
32
- //# sourceMappingURL=chunk-VGPPX6IG.js.map
32
+ //# sourceMappingURL=chunk-KUOLIJCN.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../node_modules/lit-html/src/directives/style-map.ts", "../src/components/textarea/bl-textarea.css", "../src/components/textarea/bl-textarea.ts"],
4
- "sourcesContent": ["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {AttributePart, noChange} from '../lit-html.js';\nimport {\n directive,\n Directive,\n DirectiveParameters,\n PartInfo,\n PartType,\n} from '../directive.js';\n\n/**\n * A key-value set of CSS properties and values.\n *\n * The key should be either a valid CSS property name string, like\n * `'background-color'`, or a valid JavaScript camel case property name\n * for CSSStyleDeclaration like `backgroundColor`.\n */\nexport interface StyleInfo {\n [name: string]: string | undefined | null;\n}\n\nclass StyleMapDirective extends Directive {\n _previousStyleProperties?: Set<string>;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (\n partInfo.type !== PartType.ATTRIBUTE ||\n partInfo.name !== 'style' ||\n (partInfo.strings?.length as number) > 2\n ) {\n throw new Error(\n 'The `styleMap` directive must be used in the `style` attribute ' +\n 'and must be the only part in the attribute.'\n );\n }\n }\n\n render(styleInfo: Readonly<StyleInfo>) {\n return Object.keys(styleInfo).reduce((style, prop) => {\n const value = styleInfo[prop];\n if (value == null) {\n return style;\n }\n // Convert property names from camel-case to dash-case, i.e.:\n // `backgroundColor` -> `background-color`\n // Vendor-prefixed names need an extra `-` appended to front:\n // `webkitAppearance` -> `-webkit-appearance`\n // Exception is any property name containing a dash, including\n // custom properties; we assume these are already dash-cased i.e.:\n // `--my-button-color` --> `--my-button-color`\n prop = prop\n .replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, '-$&')\n .toLowerCase();\n return style + `${prop}:${value};`;\n }, '');\n }\n\n override update(part: AttributePart, [styleInfo]: DirectiveParameters<this>) {\n const {style} = part.element as HTMLElement;\n\n if (this._previousStyleProperties === undefined) {\n this._previousStyleProperties = new Set();\n for (const name in styleInfo) {\n this._previousStyleProperties.add(name);\n }\n return this.render(styleInfo);\n }\n\n // Remove old properties that no longer exist in styleInfo\n // We use forEach() instead of for-of so that re don't require down-level\n // iteration.\n this._previousStyleProperties!.forEach((name) => {\n // If the name isn't in styleInfo or it's null/undefined\n if (styleInfo[name] == null) {\n this._previousStyleProperties!.delete(name);\n if (name.includes('-')) {\n style.removeProperty(name);\n } else {\n // Note reset using empty string (vs null) as IE11 does not always\n // reset via null (https://developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style#setting_styles)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (style as any)[name] = '';\n }\n }\n });\n\n // Add or update properties\n for (const name in styleInfo) {\n const value = styleInfo[name];\n if (value != null) {\n this._previousStyleProperties.add(name);\n if (name.includes('-')) {\n style.setProperty(name, value);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (style as any)[name] = value;\n }\n }\n }\n return noChange;\n }\n}\n\n/**\n * A directive that applies CSS properties to an element.\n *\n * `styleMap` can only be used in the `style` attribute and must be the only\n * expression in the attribute. It takes the property names in the\n * {@link StyleInfo styleInfo} object and adds the property values as CSS\n * properties. Property names with dashes (`-`) are assumed to be valid CSS\n * property names and set on the element's style object using `setProperty()`.\n * Names without dashes are assumed to be camelCased JavaScript property names\n * and set on the element's style object using property assignment, allowing the\n * style object to translate JavaScript-style names to CSS property names.\n *\n * For example `styleMap({backgroundColor: 'red', 'border-top': '5px', '--size':\n * '0'})` sets the `background-color`, `border-top` and `--size` properties.\n *\n * @param styleInfo\n * @see {@link https://lit.dev/docs/templates/directives/#stylemap styleMap code samples on Lit.dev}\n */\nexport const styleMap = directive(StyleMapDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {StyleMapDirective};\n", "import {css} from 'lit';\nexport const styles = css`:host{display:inline-block;width:200px;position:relative}.wrapper{--row-count:1;--maxrow-count:;--line-height:var(--bl-font-title-3-line-height);--scroll-height:var(--line-height);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--border-size:1px;--default-scroll-height:calc((var(--row-count) * var(--line-height)) + var(--padding-vertical));--height:max(var(--scroll-height),var(--default-scroll-height));--input-font:var(--bl-font-body-text-2);--border-radius:var(--bl-size-3xs);display:flex;flex-direction:column;position:relative;gap:var(--bl-size-3xs)}.input-wrapper{border:solid var(--border-size) var(--bl-color-border);border-radius:var(--border-radius);padding-top:var(--padding-vertical);display:flex;box-sizing:border-box}textarea{width:100%;align-self:stretch;outline:0;font:var(--input-font);padding:0 calc(var(--padding-horizontal) - var(--border-size));padding-bottom:var(--padding-vertical);margin:0;border:0;border-radius:var(--border-radius);color:var(--bl-color-content-primary);resize:vertical;display:block}:host([size='large']) .wrapper{--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size='small']) .wrapper{--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--input-font:var(--bl-font-body-text-3);--line-height:var(--bl-font-title-4-line-height)}textarea:disabled{background-color:var(--bl-color-secondary-background);color:var(--bl-color-content-tertiary);cursor:not-allowed}:host([disabled]) .wrapper{background-color:var(--bl-color-secondary-background)}:host([expand]) textarea{overflow:hidden;resize:none;height:var(--height)}:host([expand][max-rows]) textarea{--maxrow-height:calc((var(--maxrow-count) * var(--line-height)) + var(--padding-vertical));overflow-y:scroll;height:min(var(--height),var(--maxrow-height))}.wrapper:focus-within{border-color:var(--bl-color-primary)}.dirty.max-len-invalid,.dirty.invalid{border-color:var(--bl-color-danger)}:host([label]) ::placeholder{color:transparent;transition:color ease-out .4s}label{position:absolute;top:var(--padding-vertical);left:var(--padding-horizontal);right:var(--padding-horizontal);transition:all ease-in .2s;pointer-events:none;font:var(--bl-font-title-3-regular);color:var(--bl-color-content-tertiary);padding:0;max-width:max-content;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:where(.wrapper:focus-within,.wrapper.has-value) label{--label-padding:var(--bl-size-3xs);top:0;left:calc(var(--padding-horizontal) - var(--label-padding));transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-content-secondary);padding:0 var(--label-padding);background-color:var(--bl-color-content-primary-contrast);pointer-events:initial}:host ::placeholder,:host([label-fixed]) ::placeholder{color:var(--bl-color-content-tertiary)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-content-secondary);background-color:initial;padding:0}.hint{display:none;font:var(--bl-font-body-text-3)}:host([character-counter]) .hint,:host([help-text]) .hint,.dirty.invalid .hint{display:flex;gap:var(--bl-size-3xs)}.hint>*{margin:0;padding:0}.help-text,.invalid-text{flex:1}.counter-text{color:var(--bl-color-content-secondary);margin-left:auto}:where(.max-len-invalid,.dirty.invalid) .hint>.counter-text{color:var(--bl-color-danger)}.invalid-text{display:none;color:var(--bl-color-danger)}.help-text{color:var(--bl-color-content-secondary)}:where(.dirty.max-len-invalid,.dirty.invalid) .hint>.invalid-text{display:inline-block}.dirty.invalid .hint>.help-text{display:none}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, PropertyValues, TemplateResult } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { FormControlMixin } from '@open-wc/form-control';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { event, EventDispatcher } from '../../utilities/event';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { live } from 'lit/directives/live.js';\nimport { textAreaValidators } from '../../utilities/form-control';\nimport 'element-internals-polyfill';\nimport style from './bl-textarea.css';\n\nexport type TextareaSize = 'small' | 'medium' | 'large';\n/**\n * @tag bl-textarea\n * @summary Baklava Textarea component\n */\n@customElement('bl-textarea')\nexport default class BlTextarea extends FormControlMixin(LitElement) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n static formControlValidators = textAreaValidators;\n\n @query('textarea')\n validationTarget: HTMLTextAreaElement;\n\n /**\n * Name of textarea\n */\n @property({ type: String })\n name = '';\n\n /**\n * Makes textarea a mandatory field\n */\n @property({ type: Boolean })\n required = false;\n\n /**\n * Disables the textarea\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets expandity\n */\n @property({ type: Boolean, reflect: true })\n expand = false;\n\n /**\n * Sets max row when expand is true\n */\n @property({ type: Number, reflect: true, attribute: 'max-rows' })\n maxRows?: number;\n\n /**\n * Sets textarea size.\n */\n @property({ type: String, reflect: true })\n size?: TextareaSize = 'medium';\n\n /**\n * Sets label of the textarea\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: 'label-fixed', reflect: true })\n labelFixed = false;\n\n /**\n * Sets placeholder of the textarea\n */\n @property({})\n placeholder?: string;\n\n /**\n * Enables showing character counter.\n */\n @property({ type: Boolean, attribute: 'character-counter' })\n characterCounter = false;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: 'help-text' })\n helpText?: string;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: 'invalid-text' })\n customInvalidText?: string;\n\n /**\n * Sets minimum length of the textarea\n */\n @property({ type: Number })\n minlength?: number;\n\n /**\n * Sets max length of textarea\n */\n @property({ type: Number })\n maxlength?: number;\n\n /**\n * Sets initial value of the textarea\n */\n @property()\n value = '';\n\n /**\n * Sets textarea visible row count.\n */\n @property({ type: Number })\n rows?: number = 4;\n\n @event('bl-input') private onInput: EventDispatcher<string>;\n\n @event('bl-change') private onChange: EventDispatcher<string>;\n\n @event('bl-invalid') private onInvalid: EventDispatcher<ValidityState>;\n\n @state()\n private customScrollHeight: string | null = null;\n\n connectedCallback() {\n super.connectedCallback();\n this.internals.form?.addEventListener('submit', () => {\n this.reportValidity();\n });\n }\n\n private onError = (): void => {\n this.onInvalid(this.internals.validity);\n };\n\n private inputHandler(event: Event) {\n this.autoResize();\n\n const value = (event.target as HTMLTextAreaElement).value;\n this.setValue(value);\n this.onInput(value);\n }\n\n private changeHandler(event: Event) {\n const value = (event.target as HTMLTextAreaElement).value;\n\n this.dirty = true;\n this.setValue(value);\n this.onChange(value);\n }\n\n firstUpdated() {\n this.setValue(this.value);\n this.autoResize();\n }\n\n protected updated(changedProperties: PropertyValues) {\n if (changedProperties.has('rows')) {\n this.autoResize();\n }\n }\n\n reportValidity() {\n this.dirty = true;\n return this.checkValidity();\n }\n\n valueChangedCallback(value: string): void {\n this.value = value;\n }\n\n validityCallback(): string | void {\n return this.customInvalidText || this.validationTarget?.validationMessage;\n }\n\n private autoResize() {\n if (!this.expand) {\n return;\n }\n\n this.validationTarget.style.height = 'auto';\n const scrollHeight = this.validationTarget.scrollHeight;\n this.customScrollHeight = `${scrollHeight}px`;\n this.validationTarget.style.removeProperty('height');\n }\n\n @state() private dirty = false;\n\n render(): TemplateResult {\n const maxLengthInvalid = this.internals.validity.tooLong;\n const invalidMessage = !this.checkValidity()\n ? html`<p class=\"invalid-text\">${this.validationMessage}</p>`\n : ``;\n const helpMessage =\n this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : ``;\n\n const label = this.label ? html`<label for=\"input\">${this.label}</label>` : '';\n const characterCounterText =\n this.characterCounter && this.maxlength\n ? `${this.value.length}/${this.maxlength}`\n : this.characterCounter\n ? `${this.value.length}`\n : '';\n const characterCounter = this.characterCounter\n ? html`<p class=\"counter-text\">${characterCounterText}</p>`\n : '';\n\n const wrapperClasses = {\n 'wrapper': true,\n 'has-value': this.value !== null && this.value !== '',\n 'dirty': this.dirty,\n 'max-len-invalid': maxLengthInvalid,\n 'invalid': !this.checkValidity(),\n };\n\n const styles = {\n '--row-count': `${this.rows}`,\n '--maxrow-count': this.maxRows ? `${this.maxRows}` : null,\n '--scroll-height': this.customScrollHeight,\n };\n\n return html`\n <div style=${styleMap(styles)} class=${classMap(wrapperClasses)}>\n ${label}\n <div class=\"input-wrapper\">\n <textarea\n id=\"input\"\n name=\"${ifDefined(this.name)}\"\n .value=${live(this.value)}\n placeholder=\"${ifDefined(this.placeholder)}\"\n minlength=\"${ifDefined(this.minlength)}\"\n rows=\"${ifDefined(this.rows)}\"\n ?required=${this.required}\n ?disabled=${this.disabled}\n @change=${this.changeHandler}\n @input=${this.inputHandler}\n @invalid=${this.onError}\n >\n </textarea>\n </div>\n <div class=\"hint\">${invalidMessage}${helpMessage}${characterCounter}</div>\n </div>\n `;\n }\n}\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bl-textarea': BlTextarea;\n }\n}\n"],
5
- "mappings": "saA+HaA,EAAWC,EArGxB,cAAgCC,CAAAA,CAG9BC,YAAYC,EAAAA,CAAAA,IAAAA,EAEV,GADAC,MAAMD,CAAAA,EAEJA,EAASE,OAASC,EAASC,WAC3BJ,EAASK,OAAS,WACjBC,EAAAN,EAASO,WADDF,MACCE,IAAAA,OAAAA,OAAAA,EAASC,QAAoB,EAEvC,MAAUC,MACR,4GAAA,CAIL,CAEDC,OAAOC,EAAAA,CACL,OAAOC,OAAOC,KAAKF,CAAAA,EAAWG,OAAO,CAACC,EAAOC,IAAAA,CAC3C,IAAMC,EAAQN,EAAUK,CAAAA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K,CAAC,GA3CtBvB,EA4CnB,oBAMAsB,EAAA,CADCC,EAAS,CAAE,QAAS,EAAK,CAAC,GAjDRvB,EAkDnB,qBAMAsB,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,UAAW,cAAe,QAAS,EAAK,CAAC,GAvDjDvB,EAwDnB,0BAMAsB,EAAA,CADCC,EAAS,CAAC,CAAC,GA7DOvB,EA8DnB,2BAMAsB,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,UAAW,mBAAoB,CAAC,GAnExCvB,EAoEnB,gCAMAsB,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,WAAY,CAAC,GAzE/BvB,EA0EnB,wBAMAsB,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,CAAC,GA/ElCvB,EAgFnB,iCAMAsB,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GArFPvB,EAsFnB,yBAMAsB,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GA3FPvB,EA4FnB,yBAMAsB,EAAA,CADCC,EAAS,GAjGSvB,EAkGnB,qBAMAsB,EAAA,CADCC,EAAS,CAAE,KAAM,MAAO,CAAC,GAvGPvB,EAwGnB,oBAE2BsB,EAAA,CAA1BjB,EAAM,UAAU,GA1GEL,EA0GQ,uBAECsB,EAAA,CAA3BjB,EAAM,WAAW,GA5GCL,EA4GS,wBAECsB,EAAA,CAA5BjB,EAAM,YAAY,GA9GAL,EA8GU,yBAGrBsB,EAAA,CADPE,EAAM,GAhHYxB,EAiHX,kCAgESsB,EAAA,CAAhBE,EAAM,GAjLYxB,EAiLF,qBAjLEA,EAArBsB,EAAA,CADCC,EAAc,aAAa,GACPvB",
4
+ "sourcesContent": ["/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nimport {AttributePart, noChange} from '../lit-html.js';\nimport {\n directive,\n Directive,\n DirectiveParameters,\n PartInfo,\n PartType,\n} from '../directive.js';\n\n/**\n * A key-value set of CSS properties and values.\n *\n * The key should be either a valid CSS property name string, like\n * `'background-color'`, or a valid JavaScript camel case property name\n * for CSSStyleDeclaration like `backgroundColor`.\n */\nexport interface StyleInfo {\n [name: string]: string | undefined | null;\n}\n\nclass StyleMapDirective extends Directive {\n _previousStyleProperties?: Set<string>;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n if (\n partInfo.type !== PartType.ATTRIBUTE ||\n partInfo.name !== 'style' ||\n (partInfo.strings?.length as number) > 2\n ) {\n throw new Error(\n 'The `styleMap` directive must be used in the `style` attribute ' +\n 'and must be the only part in the attribute.'\n );\n }\n }\n\n render(styleInfo: Readonly<StyleInfo>) {\n return Object.keys(styleInfo).reduce((style, prop) => {\n const value = styleInfo[prop];\n if (value == null) {\n return style;\n }\n // Convert property names from camel-case to dash-case, i.e.:\n // `backgroundColor` -> `background-color`\n // Vendor-prefixed names need an extra `-` appended to front:\n // `webkitAppearance` -> `-webkit-appearance`\n // Exception is any property name containing a dash, including\n // custom properties; we assume these are already dash-cased i.e.:\n // `--my-button-color` --> `--my-button-color`\n prop = prop\n .replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g, '-$&')\n .toLowerCase();\n return style + `${prop}:${value};`;\n }, '');\n }\n\n override update(part: AttributePart, [styleInfo]: DirectiveParameters<this>) {\n const {style} = part.element as HTMLElement;\n\n if (this._previousStyleProperties === undefined) {\n this._previousStyleProperties = new Set();\n for (const name in styleInfo) {\n this._previousStyleProperties.add(name);\n }\n return this.render(styleInfo);\n }\n\n // Remove old properties that no longer exist in styleInfo\n // We use forEach() instead of for-of so that re don't require down-level\n // iteration.\n this._previousStyleProperties!.forEach((name) => {\n // If the name isn't in styleInfo or it's null/undefined\n if (styleInfo[name] == null) {\n this._previousStyleProperties!.delete(name);\n if (name.includes('-')) {\n style.removeProperty(name);\n } else {\n // Note reset using empty string (vs null) as IE11 does not always\n // reset via null (https://developer.mozilla.org/en-US/docs/Web/API/ElementCSSInlineStyle/style#setting_styles)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (style as any)[name] = '';\n }\n }\n });\n\n // Add or update properties\n for (const name in styleInfo) {\n const value = styleInfo[name];\n if (value != null) {\n this._previousStyleProperties.add(name);\n if (name.includes('-')) {\n style.setProperty(name, value);\n } else {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (style as any)[name] = value;\n }\n }\n }\n return noChange;\n }\n}\n\n/**\n * A directive that applies CSS properties to an element.\n *\n * `styleMap` can only be used in the `style` attribute and must be the only\n * expression in the attribute. It takes the property names in the\n * {@link StyleInfo styleInfo} object and adds the property values as CSS\n * properties. Property names with dashes (`-`) are assumed to be valid CSS\n * property names and set on the element's style object using `setProperty()`.\n * Names without dashes are assumed to be camelCased JavaScript property names\n * and set on the element's style object using property assignment, allowing the\n * style object to translate JavaScript-style names to CSS property names.\n *\n * For example `styleMap({backgroundColor: 'red', 'border-top': '5px', '--size':\n * '0'})` sets the `background-color`, `border-top` and `--size` properties.\n *\n * @param styleInfo\n * @see {@link https://lit.dev/docs/templates/directives/#stylemap styleMap code samples on Lit.dev}\n */\nexport const styleMap = directive(StyleMapDirective);\n\n/**\n * The type of the class that powers this directive. Necessary for naming the\n * directive's return type.\n */\nexport type {StyleMapDirective};\n", "import {css} from 'lit';\nexport const styles = css`:host{display:inline-block;width:200px;position:relative}.wrapper{--row-count:1;--maxrow-count:;--line-height:var(--bl-font-title-3-line-height);--scroll-height:var(--line-height);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--border-size:1px;--default-scroll-height:calc((var(--row-count) * var(--line-height)) + var(--padding-vertical));--height:max(var(--scroll-height),var(--default-scroll-height));--input-font:var(--bl-font-body-text-2);--border-radius:var(--bl-size-3xs);display:flex;flex-direction:column;position:relative;gap:var(--bl-size-3xs)}.input-wrapper{border:solid var(--border-size) var(--bl-color-border);border-radius:var(--border-radius);padding-top:var(--padding-vertical);display:flex;box-sizing:border-box}textarea{width:100%;align-self:stretch;outline:0;font:var(--input-font);padding:0 calc(var(--padding-horizontal) - var(--border-size));padding-bottom:var(--padding-vertical);margin:0;border:0;border-radius:var(--border-radius);color:var(--bl-color-content-primary);resize:vertical;display:block}:host([size='large']) .wrapper{--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size='small']) .wrapper{--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--input-font:var(--bl-font-body-text-3);--line-height:var(--bl-font-title-4-line-height)}textarea:disabled{background-color:var(--bl-color-secondary-background);color:var(--bl-color-content-tertiary);cursor:not-allowed}:host([disabled]) .wrapper{background-color:var(--bl-color-secondary-background)}:host([expand]) textarea{overflow:hidden;resize:none;height:var(--height)}:host([expand][max-rows]) textarea{--maxrow-height:calc((var(--maxrow-count) * var(--line-height)) + var(--padding-vertical));overflow-y:scroll;height:min(var(--height),var(--maxrow-height))}.wrapper:focus-within{border-color:var(--bl-color-primary)}.dirty.max-len-invalid,.dirty.invalid{border-color:var(--bl-color-danger)}:host([label]) ::placeholder{color:transparent;transition:color ease-out .4s}label{position:absolute;top:var(--padding-vertical);left:var(--padding-horizontal);right:var(--padding-horizontal);transition:all ease-in .2s;pointer-events:none;font:var(--bl-font-title-3-regular);color:var(--bl-color-content-tertiary);padding:0;max-width:max-content;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:where(.wrapper:focus-within,.wrapper.has-value) label{--label-padding:var(--bl-size-3xs);top:0;left:calc(var(--padding-horizontal) - var(--label-padding));transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-content-secondary);padding:0 var(--label-padding);background-color:var(--bl-color-content-primary-contrast);pointer-events:initial}:host ::placeholder,:host([label-fixed]) ::placeholder{color:var(--bl-color-content-tertiary)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-content-secondary);background-color:initial;padding:0}.hint{display:none;font:var(--bl-font-body-text-3)}:host([character-counter]) .hint,:host([help-text]) .hint,.dirty.invalid .hint{display:flex;gap:var(--bl-size-3xs)}.hint>*{margin:0;padding:0}.help-text,.invalid-text{flex:1}.counter-text{color:var(--bl-color-content-secondary);margin-left:auto}:where(.max-len-invalid,.dirty.invalid) .hint>.counter-text{color:var(--bl-color-danger)}.invalid-text{display:none;color:var(--bl-color-danger)}.help-text{color:var(--bl-color-content-secondary)}:where(.dirty.max-len-invalid,.dirty.invalid) .hint>.invalid-text{display:inline-block}.dirty.invalid .hint>.help-text{display:none}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, PropertyValues, TemplateResult } from 'lit';\nimport { customElement, property, query, state } from 'lit/decorators.js';\nimport { FormControlMixin } from '@open-wc/form-control';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { event, EventDispatcher } from '../../utilities/event';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { live } from 'lit/directives/live.js';\nimport { textAreaValidators } from '../../utilities/form-control';\nimport 'element-internals-polyfill';\nimport style from './bl-textarea.css';\n\nexport type TextareaSize = 'small' | 'medium' | 'large';\n/**\n * @tag bl-textarea\n * @summary Baklava Textarea component\n */\n@customElement('bl-textarea')\nexport default class BlTextarea extends FormControlMixin(LitElement) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n static formControlValidators = textAreaValidators;\n\n @query('textarea')\n validationTarget: HTMLTextAreaElement;\n\n /**\n * Name of textarea\n */\n @property({ type: String })\n name = '';\n\n /**\n * Makes textarea a mandatory field\n */\n @property({ type: Boolean })\n required = false;\n\n /**\n * Disables the textarea\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets expandity\n */\n @property({ type: Boolean, reflect: true })\n expand = false;\n\n /**\n * Sets max row when expand is true\n */\n @property({ type: Number, reflect: true, attribute: 'max-rows' })\n maxRows?: number;\n\n /**\n * Sets textarea size.\n */\n @property({ type: String, reflect: true })\n size?: TextareaSize = 'medium';\n\n /**\n * Sets label of the textarea\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: 'label-fixed', reflect: true })\n labelFixed = false;\n\n /**\n * Sets placeholder of the textarea\n */\n @property({})\n placeholder?: string;\n\n /**\n * Enables showing character counter.\n */\n @property({ type: Boolean, attribute: 'character-counter' })\n characterCounter = false;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: 'help-text' })\n helpText?: string;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: 'invalid-text' })\n customInvalidText?: string;\n\n /**\n * Sets minimum length of the textarea\n */\n @property({ type: Number })\n minlength?: number;\n\n /**\n * Sets max length of textarea\n */\n @property({ type: Number })\n maxlength?: number;\n\n /**\n * Sets initial value of the textarea\n */\n @property()\n value = '';\n\n /**\n * Sets textarea visible row count.\n */\n @property({ type: Number })\n rows?: number = 4;\n\n @event('bl-input') private onInput: EventDispatcher<string>;\n\n @event('bl-change') private onChange: EventDispatcher<string>;\n\n @event('bl-invalid') private onInvalid: EventDispatcher<ValidityState>;\n\n @state()\n private customScrollHeight: string | null = null;\n\n connectedCallback() {\n super.connectedCallback();\n this.internals.form?.addEventListener('submit', () => {\n this.reportValidity();\n });\n }\n\n private onError = (): void => {\n this.onInvalid(this.internals.validity);\n };\n\n private inputHandler(event: Event) {\n this.autoResize();\n\n const value = (event.target as HTMLTextAreaElement).value;\n this.value = value;\n this.onInput(value);\n }\n\n private changeHandler(event: Event) {\n const value = (event.target as HTMLTextAreaElement).value;\n\n this.dirty = true;\n this.value = value;\n this.onChange(value);\n }\n\n firstUpdated() {\n this.setValue(this.value);\n this.autoResize();\n }\n\n protected async updated(changedProperties: PropertyValues) {\n if (changedProperties.has('rows')) {\n this.autoResize();\n }\n\n if (changedProperties.has('value')) {\n this.setValue(this.value);\n\n await this.validationComplete;\n\n this.requestUpdate();\n }\n }\n\n reportValidity() {\n this.dirty = true;\n return this.checkValidity();\n }\n\n valueChangedCallback(value: string): void {\n this.value = value;\n }\n\n validityCallback(): string | void {\n return this.customInvalidText || this.validationTarget?.validationMessage;\n }\n\n private autoResize() {\n if (!this.expand) {\n return;\n }\n\n this.validationTarget.style.height = 'auto';\n const scrollHeight = this.validationTarget.scrollHeight;\n this.customScrollHeight = `${scrollHeight}px`;\n this.validationTarget.style.removeProperty('height');\n }\n\n @state() private dirty = false;\n\n render(): TemplateResult {\n const maxLengthInvalid = this.internals.validity.tooLong;\n const invalidMessage = !this.checkValidity()\n ? html`<p class=\"invalid-text\">${this.validationMessage}</p>`\n : ``;\n const helpMessage =\n this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : ``;\n\n const label = this.label ? html`<label for=\"input\">${this.label}</label>` : '';\n const characterCounterText =\n this.characterCounter && this.maxlength\n ? `${this.value.length}/${this.maxlength}`\n : this.characterCounter\n ? `${this.value.length}`\n : '';\n const characterCounter = this.characterCounter\n ? html`<p class=\"counter-text\">${characterCounterText}</p>`\n : '';\n\n const wrapperClasses = {\n 'wrapper': true,\n 'has-value': this.value !== null && this.value !== '',\n 'dirty': this.dirty,\n 'max-len-invalid': maxLengthInvalid,\n 'invalid': !this.checkValidity(),\n };\n\n const styles = {\n '--row-count': `${this.rows}`,\n '--maxrow-count': this.maxRows ? `${this.maxRows}` : null,\n '--scroll-height': this.customScrollHeight,\n };\n\n return html`\n <div style=${styleMap(styles)} class=${classMap(wrapperClasses)}>\n ${label}\n <div class=\"input-wrapper\">\n <textarea\n id=\"input\"\n name=\"${ifDefined(this.name)}\"\n .value=${live(this.value)}\n placeholder=\"${ifDefined(this.placeholder)}\"\n minlength=\"${ifDefined(this.minlength)}\"\n rows=\"${ifDefined(this.rows)}\"\n ?required=${this.required}\n ?disabled=${this.disabled}\n @change=${this.changeHandler}\n @input=${this.inputHandler}\n @invalid=${this.onError}\n >\n </textarea>\n </div>\n <div class=\"hint\">${invalidMessage}${helpMessage}${characterCounter}</div>\n </div>\n `;\n }\n}\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bl-textarea': BlTextarea;\n }\n}\n"],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,oBAE2BsB,EAAA,CAA1BjB,EAAM,UAAU,GA1GEL,EA0GQ,uBAECsB,EAAA,CAA3BjB,EAAM,WAAW,GA5GCL,EA4GS,wBAECsB,EAAA,CAA5BjB,EAAM,YAAY,GA9GAL,EA8GU,yBAGrBsB,EAAA,CADPE,EAAM,GAhHYxB,EAiHX,kCAwESsB,EAAA,CAAhBE,EAAM,GAzLYxB,EAyLF,qBAzLEA,EAArBsB,EAAA,CADCC,EAAc,aAAa,GACPvB",
6
6
  "names": ["styleMap", "directive", "Directive", "constructor", "partInfo", "super", "type", "PartType", "ATTRIBUTE", "name", "_a", "strings", "length", "Error", "render", "styleInfo", "Object", "keys", "reduce", "style", "prop", "value", "replace", "toLowerCase", "update", "part", "element", "this", "_previousStyleProperties", "Set", "add", "forEach", "delete", "includes", "removeProperty", "setProperty", "noChange", "styles", "i", "bl_textarea_default", "BlTextarea", "FormControlMixin", "s", "bl_textarea_default", "_a", "event", "value", "changedProperties", "scrollHeight", "maxLengthInvalid", "invalidMessage", "y", "helpMessage", "label", "characterCounterText", "characterCounter", "wrapperClasses", "styles", "i", "o", "l", "textAreaValidators", "__decorateClass", "e", "t"]
7
7
  }
@@ -0,0 +1,19 @@
1
+ import{a as _}from"./chunk-OLPYXE2P.js";import{a as n}from"./chunk-KPAWUBRO.js";import{a as y}from"./chunk-23UFIOHV.js";import{a as h,b as e,f as u,g as m,h as r,i as g,j as f}from"./chunk-57PTZNIL.js";import{a as o}from"./chunk-NZ3RGSR6.js";var x=i=>{if(!(!i.noValidate&&!i.reportValidity())){let d=new SubmitEvent("submit",{bubbles:!0,cancelable:!0});i.dispatchEvent(d),d.defaultPrevented||i.submit()}};var T=h`@keyframes spin{from{transform:rotate(0)}to{transform:rotate(359deg)}}:host{display:var(--bl-button-display,inline-block);max-width:100%;position:relative}.button{--main-color:var(--bl-color-primary);--main-hover-color:var(--bl-color-primary-hover);--text-hover-color:var(--bl-color-secondary-background);--content-color:var(--bl-color-content-primary-contrast);--bg-color:var(--main-color);--border-color:var(--main-color);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-m);--margin-icon:var(--padding-vertical);--icon-size:var(--bl-size-m);--font:var(--bl-font-title-3-medium);--height:var(--bl-size-2xl);display:flex;gap:var(--margin-icon);justify-content:var(--bl-button-justify,center);align-items:center;box-sizing:border-box;width:100%;height:var(--height);border:solid 1px var(--border-color);border-radius:6px;text-decoration:none;padding:var(--padding-vertical) var(--padding-horizontal);cursor:pointer;background-color:var(--bg-color);color:var(--content-color);font:var(--font);font-kerning:none;user-select:none}:host(:hover) .button,:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}.label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([size='small']) .button{--font:var(--bl-font-title-4-medium);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-2xs);--icon-size:var(--bl-size-s);--height:var(--bl-size-xl)}:host([size='large']) .button{--font:var(--bl-font-title-3-medium);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-xl);--margin-icon:var(--bl-size-2xs);--height:var(--bl-size-3xl)}.button:focus{outline:0}.button:focus-visible{position:relative;outline:0}.button:focus-visible::after{border:2px solid var(--main-color);border-radius:var(--bl-border-radius-l);content:'';position:absolute;inset:-4px}.loading-icon{animation:spin 1s linear infinite;font-size:var(--icon-size)}:host ::slotted(bl-icon){font-size:var(--icon-size)}:host([loading]) ::slotted(bl-icon){display:none}:host .has-icon:not(.has-content){--padding-horizontal:var(--padding-vertical);--margin-icon:0}:host([variant='secondary']) .button{--bg-color:transparent;--content-color:var(--main-color)}:host([variant='tertiary']) .button{--content-color:var(--main-color);--border-color:transparent;--bg-color:transparent}:host([kind='neutral']) .button{--main-color:var(--bl-color-secondary);--main-hover-color:var(--bl-color-secondary-hover)}:host([kind='success']) .button{--main-color:var(--bl-color-success);--main-hover-color:var(--bl-color-success-hover)}:host([kind='danger']) .button{--main-color:var(--bl-color-danger);--main-hover-color:var(--bl-color-danger-hover)}:host([disabled]){cursor:not-allowed}:host([loading]){cursor:wait}:host([loading]) bl-icon:not(.loading-icon){display:none}:host .button[aria-disabled='true']{--main-color:var(--bl-color-tertiary);--main-hover-color:var(--bl-color-tertiary);--content-color:var(--bl-color-content-passive);--bg-color:var(--main-color);pointer-events:none;text-decoration:none}:host([variant='tertiary']) .button[aria-disabled='true']{--main-color:transparent}:host([variant='secondary']:hover) .button[aria-disabled='false'],:host([variant='secondary'].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button[aria-disabled='false']{--content-color:var(--bl-color-content-primary-contrast);--bg-color:var(--main-hover-color)}:host([variant='tertiary']:hover) .button[aria-disabled='false'],:host([variant='tertiary'].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button[aria-disabled='false']{--content-color:var(--main-hover-color);--bg-color:var(--text-hover-color)}:host([dropdown]) .open{display:none}:host([dropdown]) .active .open{display:inline-block}:host([dropdown]) .active .close{display:none}:host .active.button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}:host([variant='secondary']) .active.button{--content-color:var(--bl-color-content-primary-contrast);--bg-color:var(--main-hover-color)}:host([variant='tertiary']) .active.button{--content-color:var(--main-color);--bg-color:var(--bl-color-tertiary);--border-color:transparent}`,z=T;var t=class extends u{constructor(){super(...arguments);this.variant="primary";this.kind="default";this.size="medium";this.loading=!1;this.disabled=!1;this.target="_self";this.dropdown=!1;this.active=!1}static get styles(){return[z]}get _isActive(){return this.active}connectedCallback(){super.connectedCallback(),this.form=this.closest("form")}caretTemplate(){return e` <bl-icon class="open" name="arrow_up"></bl-icon>
2
+ <bl-icon class="close" name="arrow_down"></bl-icon>`}_handleClick(){this.type==="submit"&&this.form&&x(this.form),this.onClick("Click event fired!")}focus(){this.button.focus()}get _hasIconSlot(){return this.querySelector(':scope > [slot="icon"]')!==null}get _hasDefaultSlot(){return[...this.childNodes].some(a=>{var c;let l=a.nodeType;return l===a.TEXT_NODE&&((c=a.textContent)==null?void 0:c.trim())!==""||l===a.ELEMENT_NODE&&!a.hasAttribute("slot")})}render(){let s=this.loading||this.disabled,a=this.loading&&this.loadingLabel?this.loadingLabel:e`<slot></slot>`,l=!!this.href,c=this.icon?e`<bl-icon name=${this.icon}></bl-icon>`:"",b=this.loading?e`<bl-icon class="loading-icon" name="loading"></bl-icon>`:"",p=e`<slot name="icon">${c}</slot> <span class="label">${a}</span>`,O=this.dropdown?this.caretTemplate():"",v=_({button:!0,"has-icon":this.icon||this._hasIconSlot,"has-content":this._hasDefaultSlot,active:!l&&this._isActive});return l?e`<a
3
+ class=${v}
4
+ aria-disabled="${n(s)}"
5
+ aria-label="${n(this.label)}"
6
+ href=${n(this.href)}
7
+ target=${n(this.target)}
8
+ role="button"
9
+ >${b} ${p}
10
+ </a>`:e`<button
11
+ class=${v}
12
+ aria-disabled="${n(s)}"
13
+ aria-label="${n(this.label)}"
14
+ ?disabled=${s}
15
+ @click="${this._handleClick}"
16
+ >
17
+ ${b} ${p} ${O}
18
+ </button>`}};o([r({type:String,reflect:!0})],t.prototype,"variant",2),o([r({type:String,reflect:!0})],t.prototype,"kind",2),o([r({type:String,reflect:!0})],t.prototype,"size",2),o([r({type:String})],t.prototype,"label",2),o([r({type:String,attribute:"loading-label"})],t.prototype,"loadingLabel",2),o([r({type:Boolean,reflect:!0})],t.prototype,"loading",2),o([r({type:Boolean,reflect:!0})],t.prototype,"disabled",2),o([r({type:String})],t.prototype,"href",2),o([r({type:String})],t.prototype,"icon",2),o([r({type:String})],t.prototype,"target",2),o([r({type:String})],t.prototype,"type",2),o([r({type:Boolean})],t.prototype,"dropdown",2),o([g({})],t.prototype,"active",2),o([f(".button")],t.prototype,"button",2),o([y("bl-click")],t.prototype,"onClick",2),t=o([m("bl-button")],t);export{x as a,t as b};
19
+ //# sourceMappingURL=chunk-MCWRM3WC.js.map