@trendyol/baklava 3.3.0-beta.14 → 3.3.0-beta.15

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 (33) hide show
  1. package/dist/baklava.js +1 -1
  2. package/dist/chunk-23PSWIUF.js +2 -0
  3. package/dist/chunk-23PSWIUF.js.map +7 -0
  4. package/dist/{chunk-2I4NXKV5.js → chunk-55I5ZGJ7.js} +10 -10
  5. package/dist/chunk-55I5ZGJ7.js.map +7 -0
  6. package/dist/chunk-7F6RR2JV.js +2 -0
  7. package/dist/{chunk-XDCNO7EY.js.map → chunk-7F6RR2JV.js.map} +2 -2
  8. package/dist/{chunk-GQXMNZFC.js → chunk-KBNVATXF.js} +5 -5
  9. package/dist/{chunk-GQXMNZFC.js.map → chunk-KBNVATXF.js.map} +3 -3
  10. package/dist/chunk-P7PNSS73.js +50 -0
  11. package/dist/chunk-P7PNSS73.js.map +7 -0
  12. package/dist/components/datepicker/bl-datepicker.js +1 -1
  13. package/dist/components/input/bl-input.d.ts +13 -6
  14. package/dist/components/input/bl-input.d.ts.map +1 -1
  15. package/dist/components/input/bl-input.js +1 -1
  16. package/dist/components/pagination/bl-pagination.js +1 -1
  17. package/dist/components/textarea/bl-textarea.d.ts +7 -16
  18. package/dist/components/textarea/bl-textarea.d.ts.map +1 -1
  19. package/dist/components/textarea/bl-textarea.js +1 -1
  20. package/dist/custom-elements.json +14 -0
  21. package/dist/generated/locales/tr.d.ts +1 -0
  22. package/dist/generated/locales/tr.d.ts.map +1 -1
  23. package/dist/generated/locales/tr.js +1 -1
  24. package/dist/localization.js +1 -1
  25. package/dist/utilities/form-control.d.ts +3 -19
  26. package/dist/utilities/form-control.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/dist/chunk-2I4NXKV5.js.map +0 -7
  29. package/dist/chunk-7TWNQK6I.js +0 -50
  30. package/dist/chunk-7TWNQK6I.js.map +0 -7
  31. package/dist/chunk-MND5TXTF.js +0 -2
  32. package/dist/chunk-MND5TXTF.js.map +0 -7
  33. package/dist/chunk-XDCNO7EY.js +0 -2
package/dist/baklava.js CHANGED
@@ -1,2 +1,2 @@
1
- import{b as z}from"./chunk-N4GAO7FQ.js";import{b as q}from"./chunk-CAIHRZ24.js";import{b as j}from"./chunk-JAZGOWKA.js";import{b as O}from"./chunk-VJRVHJVZ.js";import{b as y}from"./chunk-T5EQ4OXS.js";import{d as v}from"./chunk-STMCW2R6.js";import{a as I}from"./chunk-GQXMNZFC.js";import{a as t}from"./chunk-X73CSBRO.js";import{b as N}from"./chunk-UZJOCLOO.js";import{a as b}from"./chunk-GMVJABPT.js";import{c as T,f as P}from"./chunk-FVBGMXMC.js";import{b as R}from"./chunk-J45OQI7D.js";import{a as D}from"./chunk-5TPDRTCU.js";import{a as w}from"./chunk-YZRAUVUQ.js";import{a as C}from"./chunk-QF4LGACD.js";import{a as s}from"./chunk-FCEMOH4J.js";import{b as G,d as k,f as A}from"./chunk-43SCA2ZJ.js";import{b as S}from"./chunk-73RGV4UX.js";import{b as H}from"./chunk-75V3FKJS.js";import{a as c}from"./chunk-5VEXMTA4.js";import{a as i}from"./chunk-OAF3R4PW.js";import{a as n}from"./chunk-WXWKIQAK.js";import"./chunk-IPYZIIRV.js";import{b as u,e as x}from"./chunk-FTQX7CEW.js";import{a as F}from"./chunk-7TWNQK6I.js";import{a as h}from"./chunk-AW5LBSEM.js";import{b as g}from"./chunk-47S2NIWC.js";import"./chunk-EZSEQHRH.js";import{a as m}from"./chunk-2I4NXKV5.js";import"./chunk-MND5TXTF.js";import{b as E}from"./chunk-O7VPXMZW.js";import"./chunk-WEEGH2F4.js";import"./chunk-EG7U7PM3.js";import"./chunk-XDUIVR6I.js";import"./chunk-HZ6A5QFC.js";import"./chunk-AYJMIZZ3.js";import{a as B}from"./chunk-GXDVWGFU.js";import{b as d}from"./chunk-VU6LRFZR.js";import{b as p}from"./chunk-IGNJQVQF.js";import"./chunk-6LT7O7T2.js";import"./chunk-HBPBDC7T.js";import{a as o}from"./chunk-NGJM4NWA.js";import{a as l}from"./chunk-4QFXDW3W.js";import"./chunk-ECPWEUBG.js";import"./chunk-DINNT5P2.js";import{a as f}from"./chunk-4BZSILLM.js";import{a as e,b as a,c as r}from"./chunk-BH64QNLE.js";import"./chunk-GRL4DWKG.js";import"./chunk-3USCFSFQ.js";import"./chunk-7GK5LKBV.js";import"./chunk-5MOOXA2X.js";import"./chunk-4OT5AMS5.js";import"./chunk-IZ2LK5GK.js";export{t as BlAccordion,o as BlAccordionGroup,l as BlAlert,f as BlBadge,d as BlButton,E as BlCalendar,u as BlCheckbox,x as BlCheckboxGroup,F as BlDatePicker,B as BlDialog,s as BlDrawer,A as BlDropdown,S as BlDropdownGroup,k as BlDropdownItem,r as BlIcon,m as BlInput,H as BlNotification,N as BlNotificationCard,c as BlPagination,g as BlPopover,b as BlProgressIndicator,T as BlRadio,P as BlRadioGroup,i as BlSelect,n as BlSelectOption,p as BlSpinner,G as BlSplitButton,R as BlSwitch,w as BlTab,D as BlTabGroup,C as BlTabPanel,v as BlTable,O as BlTableBody,z as BlTableCell,y as BlTableHeader,q as BlTableHeaderCell,j as BlTableRow,I as BlTextarea,h as BlTooltip,a as getIconPath,e as setIconPath};
1
+ import{b as z}from"./chunk-N4GAO7FQ.js";import{b as q}from"./chunk-CAIHRZ24.js";import{b as j}from"./chunk-JAZGOWKA.js";import{b as O}from"./chunk-VJRVHJVZ.js";import{b as y}from"./chunk-T5EQ4OXS.js";import{d as v}from"./chunk-STMCW2R6.js";import{a as I}from"./chunk-KBNVATXF.js";import{a as t}from"./chunk-X73CSBRO.js";import{b as N}from"./chunk-UZJOCLOO.js";import{a as b}from"./chunk-GMVJABPT.js";import{c as T,f as P}from"./chunk-FVBGMXMC.js";import{b as R}from"./chunk-J45OQI7D.js";import{a as D}from"./chunk-5TPDRTCU.js";import{a as w}from"./chunk-YZRAUVUQ.js";import{a as C}from"./chunk-QF4LGACD.js";import{a as s}from"./chunk-FCEMOH4J.js";import{b as G,d as k,f as A}from"./chunk-43SCA2ZJ.js";import{b as S}from"./chunk-73RGV4UX.js";import{b as H}from"./chunk-75V3FKJS.js";import{a as c}from"./chunk-5VEXMTA4.js";import{a as i}from"./chunk-OAF3R4PW.js";import{a as n}from"./chunk-WXWKIQAK.js";import"./chunk-IPYZIIRV.js";import{b as u,e as x}from"./chunk-FTQX7CEW.js";import{a as F}from"./chunk-P7PNSS73.js";import{a as h}from"./chunk-AW5LBSEM.js";import{b as g}from"./chunk-47S2NIWC.js";import"./chunk-EZSEQHRH.js";import{a as m}from"./chunk-55I5ZGJ7.js";import"./chunk-23PSWIUF.js";import{b as E}from"./chunk-O7VPXMZW.js";import"./chunk-WEEGH2F4.js";import"./chunk-EG7U7PM3.js";import"./chunk-XDUIVR6I.js";import"./chunk-HZ6A5QFC.js";import"./chunk-AYJMIZZ3.js";import{a as B}from"./chunk-GXDVWGFU.js";import{b as d}from"./chunk-VU6LRFZR.js";import{b as p}from"./chunk-IGNJQVQF.js";import"./chunk-6LT7O7T2.js";import"./chunk-HBPBDC7T.js";import{a as o}from"./chunk-NGJM4NWA.js";import{a as l}from"./chunk-4QFXDW3W.js";import"./chunk-ECPWEUBG.js";import"./chunk-DINNT5P2.js";import{a as f}from"./chunk-4BZSILLM.js";import{a as e,b as a,c as r}from"./chunk-BH64QNLE.js";import"./chunk-GRL4DWKG.js";import"./chunk-3USCFSFQ.js";import"./chunk-7GK5LKBV.js";import"./chunk-5MOOXA2X.js";import"./chunk-4OT5AMS5.js";import"./chunk-IZ2LK5GK.js";export{t as BlAccordion,o as BlAccordionGroup,l as BlAlert,f as BlBadge,d as BlButton,E as BlCalendar,u as BlCheckbox,x as BlCheckboxGroup,F as BlDatePicker,B as BlDialog,s as BlDrawer,A as BlDropdown,S as BlDropdownGroup,k as BlDropdownItem,r as BlIcon,m as BlInput,H as BlNotification,N as BlNotificationCard,c as BlPagination,g as BlPopover,b as BlProgressIndicator,T as BlRadio,P as BlRadioGroup,i as BlSelect,n as BlSelectOption,p as BlSpinner,G as BlSplitButton,R as BlSwitch,w as BlTab,D as BlTabGroup,C as BlTabPanel,v as BlTable,O as BlTableBody,z as BlTableCell,y as BlTableHeader,q as BlTableHeaderCell,j as BlTableRow,I as BlTextarea,h as BlTooltip,a as getIconPath,e as setIconPath};
2
2
  //# sourceMappingURL=baklava.js.map
@@ -0,0 +1,2 @@
1
+ import{b as e}from"./chunk-EG7U7PM3.js";var i=["valueMissing","typeMismatch","tooLong","tooShort","rangeUnderflow","rangeOverflow","stepMismatch","badInput","patternMismatch"],a=i.map(t=>({key:t,isValid(r){return r.validationTarget?!r.validationTarget.validity[t]:!0},message:""}));a.push({key:"customError",attribute:"error",message(t){return t.error},isValid(t){return t.error?!1:t.validationTarget?!t.validationTarget.validity.customError:!0}});var o={...e,isValid(t){return t.validationTarget&&t.getAttribute("maxlength")?Number(t.getAttribute("maxlength"))>=t.validationTarget.value.length:!0}},d=[...a,o];export{a,d as b};
2
+ //# sourceMappingURL=chunk-23PSWIUF.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/utilities/form-control.ts"],
4
+ "sourcesContent": ["import { maxLengthValidator, SyncValidator } from \"@open-wc/form-control\";\n\nconst validityStates: Array<keyof ValidityState> = [\n \"valueMissing\",\n \"typeMismatch\",\n \"tooLong\",\n \"tooShort\",\n \"rangeUnderflow\",\n \"rangeOverflow\",\n \"stepMismatch\",\n \"badInput\",\n \"patternMismatch\",\n];\n\nexport const innerInputValidators: SyncValidator[] = validityStates.map(key => ({\n key,\n isValid(instance: HTMLElement & { validationTarget: HTMLInputElement }) {\n if (instance.validationTarget) {\n return !instance.validationTarget.validity[key];\n }\n return true;\n },\n message: \"\",\n}));\n\ninnerInputValidators.push({\n key: \"customError\",\n attribute: \"error\",\n message(instance) {\n return instance.error;\n },\n isValid(instance: HTMLElement & { error: string; validationTarget: HTMLInputElement }) {\n if (instance.error) {\n return false;\n }\n\n if (instance.validationTarget) {\n return !instance.validationTarget.validity[\"customError\"];\n }\n\n return true;\n },\n});\n\nexport const textareaLengthValidator = {\n ...maxLengthValidator,\n isValid(instance: HTMLElement & { validationTarget: HTMLTextAreaElement }) {\n if (instance.validationTarget && instance.getAttribute(\"maxlength\")) {\n return Number(instance.getAttribute(\"maxlength\")) >= instance.validationTarget.value.length;\n }\n return true;\n },\n};\n\nexport const textAreaValidators = [...innerInputValidators, textareaLengthValidator];\n"],
5
+ "mappings": "wCAEA,IAAMA,EAA6C,CACjD,eACA,eACA,UACA,WACA,iBACA,gBACA,eACA,WACA,iBACF,EAEaC,EAAwCD,EAAe,IAAIE,IAAQ,CAC9E,IAAAA,EACA,QAAQC,EAAgE,CACtE,OAAIA,EAAS,iBACJ,CAACA,EAAS,iBAAiB,SAASD,CAAG,EAEzC,EACT,EACA,QAAS,EACX,EAAE,EAEFD,EAAqB,KAAK,CACxB,IAAK,cACL,UAAW,QACX,QAAQE,EAAU,CAChB,OAAOA,EAAS,KAClB,EACA,QAAQA,EAA+E,CACrF,OAAIA,EAAS,MACJ,GAGLA,EAAS,iBACJ,CAACA,EAAS,iBAAiB,SAAS,YAGtC,EACT,CACF,CAAC,EAEM,IAAMC,EAA0B,CACrC,GAAGC,EACH,QAAQF,EAAmE,CACzE,OAAIA,EAAS,kBAAoBA,EAAS,aAAa,WAAW,EACzD,OAAOA,EAAS,aAAa,WAAW,CAAC,GAAKA,EAAS,iBAAiB,MAAM,OAEhF,EACT,CACF,EAEaG,EAAqB,CAAC,GAAGL,EAAsBG,CAAuB",
6
+ "names": ["validityStates", "innerInputValidators", "key", "instance", "textareaLengthValidator", "maxLengthValidator", "textAreaValidators"]
7
+ }
@@ -1,4 +1,4 @@
1
- import{a as f}from"./chunk-MND5TXTF.js";import{c as m}from"./chunk-EG7U7PM3.js";import{a as g}from"./chunk-XDUIVR6I.js";import{a as b}from"./chunk-VU6LRFZR.js";import{a as p}from"./chunk-6LT7O7T2.js";import{a as r}from"./chunk-DINNT5P2.js";import{a as n}from"./chunk-GRL4DWKG.js";import{a as u,b as i,c,e as v}from"./chunk-5MOOXA2X.js";import{a as h,b as l,f as d}from"./chunk-4OT5AMS5.js";import{d as t}from"./chunk-IZ2LK5GK.js";var S=h`:host{display:inline-block;width:200px;position:relative}.wrapper{--border-color:var(--bl-color-neutral-lighter);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--height:var(--bl-size-2xl);--input-font:var(--bl-font-body-text-2);--line-height:var(--bl-font-body-text-2-line-height);--icon-size:var(--line-height);--icon-gap:var(--bl-size-xs);--padding-vertical:calc((var(--height) - var(--line-height)) / 2);--padding-horizontal:var(--bl-size-xs);--autofill-bg-color:var(--bl-color-primary-contrast);--label-padding:var(--bl-size-3xs);--background-color:var(--bl-color-neutral-full);display:grid;position:relative;gap:var(--bl-size-3xs)}.wrapper:focus-within{--border-color:var(--bl-color-primary);--icon-color:var(--bl-color-primary)}.wrapper.dirty.invalid{--border-color:var(--bl-color-danger);--icon-color:var(--bl-color-danger)}:host([size="large"]) .wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m);--icon-gap:var(--bl-size-m)}:host([size="small"]) .wrapper{--height:var(--bl-size-xl);--input-font:var(--bl-font-body-text-3);--padding-vertical:var(--bl-size-3xs);--icon-size:var(--bl-font-body-text-3-line-height);--icon-gap:var(--bl-size-2xs)}.input-wrapper{--border-size:1px;outline:none;display:flex;box-sizing:border-box;gap:var(--padding-vertical);height:var(--height);border:solid var(--border-size) var(--border-color);padding:0 calc(
1
+ import{a as x}from"./chunk-23PSWIUF.js";import{c as m}from"./chunk-EG7U7PM3.js";import{a as g}from"./chunk-XDUIVR6I.js";import{a as b}from"./chunk-VU6LRFZR.js";import{a as p}from"./chunk-6LT7O7T2.js";import{a as f,c as y}from"./chunk-HBPBDC7T.js";import{a as r}from"./chunk-DINNT5P2.js";import{a as n}from"./chunk-GRL4DWKG.js";import{a as u,b as i,c,e as v}from"./chunk-5MOOXA2X.js";import{a as h,b as l,f as d}from"./chunk-4OT5AMS5.js";import{d as t}from"./chunk-IZ2LK5GK.js";var E=h`:host{display:inline-block;width:200px;position:relative}.wrapper{--border-color:var(--bl-color-neutral-lighter);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--height:var(--bl-size-2xl);--input-font:var(--bl-font-body-text-2);--line-height:var(--bl-font-body-text-2-line-height);--icon-size:var(--line-height);--icon-gap:var(--bl-size-xs);--padding-vertical:calc((var(--height) - var(--line-height)) / 2);--padding-horizontal:var(--bl-size-xs);--autofill-bg-color:var(--bl-color-primary-contrast);--label-padding:var(--bl-size-3xs);--background-color:var(--bl-color-neutral-full);display:grid;position:relative;gap:var(--bl-size-3xs)}.wrapper:focus-within{--border-color:var(--bl-color-primary);--icon-color:var(--bl-color-primary)}.wrapper.dirty.invalid{--border-color:var(--bl-color-danger);--icon-color:var(--bl-color-danger)}:host([size="large"]) .wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m);--icon-gap:var(--bl-size-m)}:host([size="small"]) .wrapper{--height:var(--bl-size-xl);--input-font:var(--bl-font-body-text-3);--padding-vertical:var(--bl-size-3xs);--icon-size:var(--bl-font-body-text-3-line-height);--icon-gap:var(--bl-size-2xs)}.input-wrapper{--border-size:1px;outline:none;display:flex;box-sizing:border-box;gap:var(--padding-vertical);height:var(--height);border:solid var(--border-size) var(--border-color);padding:0 calc(
2
2
  var(--bl-input-padding-end, var(--padding-horizontal)) - var(--label-padding) -
3
3
  var(--border-size)
4
4
  ) 0 calc(
@@ -17,13 +17,13 @@ import{a as f}from"./chunk-MND5TXTF.js";import{c as m}from"./chunk-EG7U7PM3.js";
17
17
  var(--bl-input-padding-start, var(--padding-horizontal)) - var(--label-padding)
18
18
  );inset-inline-end:calc(
19
19
  var(--bl-input-padding-end, var(--padding-horizontal)) - var(--label-padding)
20
- );transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);padding:0 var(--label-padding);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]:not([label-fixed])) :where(:focus-within, .has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}.error-icon,.invalid-text{display:none}.dirty.invalid label,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}:host([help-text]) .hint,.dirty.invalid .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.dirty.invalid .error-icon{display:inline-block}`,y=S;var E={date:"calendar","datetime-local":"calendar",month:"calendar",week:"calendar",time:"clock",search:"search"},e=class extends g(d){constructor(){super(...arguments);this.type="text";this.value="";this.required=!1;this.loading=!1;this.autocomplete="on";this.autofocus=!1;this.size="medium";this.disabled=!1;this.readonly=!1;this.labelFixed=!1;this.onKeydown=a=>{a.code==="Enter"&&this.form&&setTimeout(()=>{a.defaultPrevented||b(this.form)})};this.dirty=!1;this.passwordVisible=!1;this.inputId=Math.random().toString(36).substring(2)}static get styles(){return[y]}set customInvalidText(a){this._customInvalidText=a,this.setValue(this.value)}get customInvalidText(){return this._customInvalidText}connectedCallback(){var a;super.connectedCallback(),this.addEventListener("keydown",this.onKeydown),(a=this.form)==null||a.addEventListener("submit",()=>{this.reportValidity()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.onKeydown)}textVisibilityToggle(){this.passwordVisible=!this.passwordVisible}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.validationTarget.showPicker()}validityCallback(){var a;return this.onInvalid(this.internals.validity),this.customInvalidText||((a=this.validationTarget)==null?void 0:a.validationMessage)}async forceCustomError(){await this.updateComplete,this.validationTarget.setCustomValidity(this.customInvalidText||"An error occurred"),this.setValue(this.value),this.reportValidity()}async clearCustomError(){await this.updateComplete,this.validationTarget.setCustomValidity(""),this.setValue(this.value),this.reportValidity()}reportValidity(){return this.dirty=!0,this.requestUpdate(),this.checkValidity()}inputHandler(a){let o=a.target.value;this.value=o,this.onInput(o)}changeHandler(a){let o=a.target.value;this.dirty=!0,this.value=o,this.onChange(o)}firstUpdated(){this.setValue(this.value),this.icon||(this.icon=E[this.type])}async updated(a){a.size>0&&(this.setValue(this.value),await this.validationComplete,this.requestUpdate())}get _hasIconSlot(){return this.querySelector(':scope > [slot="icon"]')!==null}render(){let a=this.checkValidity()?"":l`<p id="errorMessage" aria-live="polite" class="invalid-text">
20
+ );transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);padding:0 var(--label-padding);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]:not([label-fixed])) :where(:focus-within, .has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}.error-icon,.invalid-text{display:none}.dirty.invalid label,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}:host([help-text]) .hint,.dirty.invalid .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.dirty.invalid .error-icon{display:inline-block}`,w=E;var M={date:"calendar","datetime-local":"calendar",month:"calendar",week:"calendar",time:"clock",search:"search"},e=class extends g(d){constructor(){super(...arguments);this.type="text";this.value="";this.required=!1;this.loading=!1;this.autocomplete="on";this.autofocus=!1;this.size="medium";this.disabled=!1;this.readonly=!1;this.labelFixed=!1;this.onKeydown=a=>{a.code==="Enter"&&this.form&&setTimeout(()=>{a.defaultPrevented||b(this.form)})};this.dirty=!1;this.passwordVisible=!1;this.inputId=Math.random().toString(36).substring(2)}static get styles(){return[w]}set customInvalidText(a){this._customInvalidText=a,this.setValue(this.value)}get customInvalidText(){return this._customInvalidText}connectedCallback(){var a;super.connectedCallback(),this.addEventListener("keydown",this.onKeydown),(a=this.form)==null||a.addEventListener("submit",()=>{this.reportValidity()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this.onKeydown)}textVisibilityToggle(){this.passwordVisible=!this.passwordVisible}showPicker(){"showPicker"in HTMLInputElement.prototype&&this.validationTarget.showPicker()}validityCallback(){var a;return this.onInvalid(this.internals.validity),this.customInvalidText||((a=this.validationTarget)==null?void 0:a.validationMessage)}setCustomValidity(a){this.validationTarget.setCustomValidity(a)}async forceCustomError(){await this.updateComplete,this.setCustomValidity(this.customInvalidText||y("An error occurred",{desc:"bl-input: default custom error message"})),this.setValue(this.value),this.reportValidity()}async clearCustomError(){await this.updateComplete,this.setCustomValidity(""),this.setValue(this.value),this.reportValidity()}reportValidity(){return this.dirty=!0,this.requestUpdate(),this.checkValidity()}inputHandler(a){let o=a.target.value;this.value=o,this.setValue(this.value),this.onInput(o)}changeHandler(a){let o=a.target.value;this.dirty=!0,this.value=o,this.setValue(this.value),this.onChange(o)}firstUpdated(){this.setValue(this.value),this.icon||(this.icon=M[this.type])}async updated(a){a.size>0&&(this.setValue(this.value),await this.validationComplete,this.requestUpdate()),a.has("error")&&this.error&&!this.dirty&&this.reportValidity()}get _hasIconSlot(){return this.querySelector(':scope > [slot="icon"]')!==null}render(){let a=this.checkValidity()?"":l`<p id="errorMessage" aria-live="polite" class="invalid-text">
21
21
  ${this.validationMessage}
22
- </p>`,o=this.helpText?l`<p id="helpText" class="help-text">${this.helpText}</p>`:"",x=l`
22
+ </p>`,o=this.helpText?l`<p id="helpText" class="help-text">${this.helpText}</p>`:"",k=l`
23
23
  <slot name="icon">
24
24
  ${this.loading&&this.type==="search"&&this.value!==""&&this.value!==null?l`<bl-spinner></bl-spinner>`:this.icon?l`<bl-icon name="${this.icon}"></bl-icon>`:l`<bl-icon class="error-icon" name="alert"></bl-icon>`}
25
25
  </slot>
26
- `,w=this.label?l`<label for=${this.inputId}>${this.label}</label>`:"",s=this.type==="password",k=s?l`<bl-button
26
+ `,z=this.label?l`<label for=${this.inputId}>${this.label}</label>`:"",s=this.type==="password",T=s?l`<bl-button
27
27
  size="small"
28
28
  kind="neutral"
29
29
  variant="tertiary"
@@ -33,13 +33,13 @@ import{a as f}from"./chunk-MND5TXTF.js";import{c as m}from"./chunk-EG7U7PM3.js";
33
33
  >
34
34
  <bl-icon class="reveal-icon" slot="icon" name="eye_on"></bl-icon>
35
35
  <bl-icon class="reveal-icon" slot="icon" name="eye_off"></bl-icon>
36
- </bl-button>`:"",z=this.icon||this._hasIconSlot,T={wrapper:!0,dirty:this.dirty,invalid:!this.checkValidity(),"has-icon":s||z||this.dirty&&!this.checkValidity(),"has-value":this.value!==null&&this.value!==""},$=this.passwordVisible?"text":"password",V=s?$:this.type;return l`<div class=${p(T)}>
37
- ${w}
36
+ </bl-button>`:"",$=this.icon||this._hasIconSlot,V={wrapper:!0,dirty:this.dirty,invalid:!this.checkValidity(),"has-icon":s||$||this.dirty&&!this.checkValidity(),"has-value":this.value!==null&&this.value!==""},S=this.passwordVisible?"text":"password",C=s?S:this.type;return l`<div class=${p(V)}>
37
+ ${z}
38
38
  <fieldset class="input-wrapper">
39
39
  <legend><span>${this.label}</span></legend>
40
40
  <input
41
41
  id=${this.inputId}
42
- type=${V}
42
+ type=${C}
43
43
  .value=${m(this.value)}
44
44
  inputmode="${r(this.inputmode)}"
45
45
  ?autofocus=${this.autofocus}
@@ -60,8 +60,8 @@ import{a as f}from"./chunk-MND5TXTF.js";import{c as m}from"./chunk-EG7U7PM3.js";
60
60
  aria-describedby=${r(this.helpText?"helpText":void 0)}
61
61
  aria-errormessage=${r(this.checkValidity()?void 0:"errorMessage")}
62
62
  />
63
- <div class="icon">${k} ${x}</div>
63
+ <div class="icon">${T} ${k}</div>
64
64
  </fieldset>
65
65
  <div class="hint">${a} ${o}</div>
66
- </div>`}};e.shadowRootOptions={...d.shadowRootOptions,delegatesFocus:!0},e.formControlValidators=f,t([v("input")],e.prototype,"validationTarget",2),t([i({reflect:!0})],e.prototype,"name",2),t([i({reflect:!0})],e.prototype,"type",2),t([i({reflect:!0})],e.prototype,"label",2),t([i({reflect:!0})],e.prototype,"placeholder",2),t([i({reflect:!0})],e.prototype,"value",2),t([i({type:Boolean,reflect:!0})],e.prototype,"required",2),t([i({type:Number,reflect:!0})],e.prototype,"minlength",2),t([i({type:Number,reflect:!0})],e.prototype,"maxlength",2),t([i({reflect:!0})],e.prototype,"min",2),t([i({type:Boolean,reflect:!0})],e.prototype,"loading",2),t([i({reflect:!0})],e.prototype,"max",2),t([i({type:String,reflect:!0})],e.prototype,"pattern",2),t([i({type:Number,reflect:!0})],e.prototype,"step",2),t([i({type:String,reflect:!0})],e.prototype,"autocomplete",2),t([i({type:String,reflect:!0})],e.prototype,"inputmode",2),t([i({type:Boolean,reflect:!0})],e.prototype,"autofocus",2),t([i({type:String,reflect:!0})],e.prototype,"icon",2),t([i({type:String,reflect:!0})],e.prototype,"size",2),t([i({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([i({type:Boolean,reflect:!0})],e.prototype,"readonly",2),t([i({type:Boolean,attribute:"label-fixed",reflect:!0})],e.prototype,"labelFixed",2),t([i({type:String,attribute:"invalid-text",reflect:!0})],e.prototype,"customInvalidText",1),t([i({type:String,attribute:"help-text",reflect:!0})],e.prototype,"helpText",2),t([n("bl-change")],e.prototype,"onChange",2),t([n("bl-input")],e.prototype,"onInput",2),t([n("bl-invalid")],e.prototype,"onInvalid",2),t([c()],e.prototype,"dirty",2),t([c()],e.prototype,"passwordVisible",2),e=t([u("bl-input")],e);export{e as a};
67
- //# sourceMappingURL=chunk-2I4NXKV5.js.map
66
+ </div>`}};e.shadowRootOptions={...d.shadowRootOptions,delegatesFocus:!0},e.formControlValidators=x,t([v("input")],e.prototype,"validationTarget",2),t([i({reflect:!0})],e.prototype,"name",2),t([i({reflect:!0})],e.prototype,"type",2),t([i({reflect:!0})],e.prototype,"label",2),t([i({reflect:!0})],e.prototype,"placeholder",2),t([i({reflect:!0})],e.prototype,"value",2),t([i({type:Boolean,reflect:!0})],e.prototype,"required",2),t([i({type:Number,reflect:!0})],e.prototype,"minlength",2),t([i({type:Number,reflect:!0})],e.prototype,"maxlength",2),t([i({reflect:!0})],e.prototype,"min",2),t([i({type:Boolean,reflect:!0})],e.prototype,"loading",2),t([i({reflect:!0})],e.prototype,"max",2),t([i({type:String,reflect:!0})],e.prototype,"pattern",2),t([i({type:Number,reflect:!0})],e.prototype,"step",2),t([i({type:String,reflect:!0})],e.prototype,"autocomplete",2),t([i({type:String,reflect:!0})],e.prototype,"inputmode",2),t([i({type:Boolean,reflect:!0})],e.prototype,"autofocus",2),t([i({type:String,reflect:!0})],e.prototype,"icon",2),t([i({type:String,reflect:!0})],e.prototype,"size",2),t([i({type:Boolean,reflect:!0})],e.prototype,"disabled",2),t([i({type:Boolean,reflect:!0})],e.prototype,"readonly",2),t([i({type:Boolean,attribute:"label-fixed",reflect:!0})],e.prototype,"labelFixed",2),t([i({type:String,attribute:"invalid-text",reflect:!0})],e.prototype,"customInvalidText",1),t([i({reflect:!0,type:String})],e.prototype,"error",2),t([i({type:String,attribute:"help-text",reflect:!0})],e.prototype,"helpText",2),t([n("bl-change")],e.prototype,"onChange",2),t([n("bl-input")],e.prototype,"onInput",2),t([n("bl-invalid")],e.prototype,"onInvalid",2),t([c()],e.prototype,"dirty",2),t([c()],e.prototype,"passwordVisible",2),e=t([u("bl-input"),f()],e);export{e as a};
67
+ //# sourceMappingURL=chunk-55I5ZGJ7.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/input/bl-input.css", "../src/components/input/bl-input.ts"],
4
+ "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:inline-block;width:200px;position:relative}.wrapper{--border-color:var(--bl-color-neutral-lighter);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--height:var(--bl-size-2xl);--input-font:var(--bl-font-body-text-2);--line-height:var(--bl-font-body-text-2-line-height);--icon-size:var(--line-height);--icon-gap:var(--bl-size-xs);--padding-vertical:calc((var(--height) - var(--line-height)) / 2);--padding-horizontal:var(--bl-size-xs);--autofill-bg-color:var(--bl-color-primary-contrast);--label-padding:var(--bl-size-3xs);--background-color:var(--bl-color-neutral-full);display:grid;position:relative;gap:var(--bl-size-3xs)}.wrapper:focus-within{--border-color:var(--bl-color-primary);--icon-color:var(--bl-color-primary)}.wrapper.dirty.invalid{--border-color:var(--bl-color-danger);--icon-color:var(--bl-color-danger)}:host([size=\"large\"]) .wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m);--icon-gap:var(--bl-size-m)}:host([size=\"small\"]) .wrapper{--height:var(--bl-size-xl);--input-font:var(--bl-font-body-text-3);--padding-vertical:var(--bl-size-3xs);--icon-size:var(--bl-font-body-text-3-line-height);--icon-gap:var(--bl-size-2xs)}.input-wrapper{--border-size:1px;outline:none;display:flex;box-sizing:border-box;gap:var(--padding-vertical);height:var(--height);border:solid var(--border-size) var(--border-color);padding:0 calc(\n var(--bl-input-padding-end, var(--padding-horizontal)) - var(--label-padding) -\n var(--border-size)\n ) 0 calc(\n var(--bl-input-padding-start, var(--padding-horizontal)) - var(--label-padding) -\n var(--border-size)\n );background-color:var(--background-color);border-radius:var(--bl-size-3xs);margin:0;width:0;min-width:100%}:host([disabled]) .wrapper{cursor:not-allowed;--background-color:var(--bl-color-neutral-lightest);--text-color:var(--bl-color-neutral-light)}.wrapper:has(input:autofill){--background-color:var(--autofill-bg-color)}.wrapper:has(input:-webkit-autofill){--background-color:var(--autofill-bg-color)}.input-wrapper legend,label{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;max-width:max-content;transition:all ease-in 0.1s;font:var(--input-font);top:var(--padding-vertical);inset-inline-start:var(--bl-input-padding-start, var(--padding-horizontal));inset-inline-end:var(--bl-input-padding-end, var(--padding-horizontal));pointer-events:none;color:var(--bl-color-neutral-light)}.has-icon label{inset-inline-end:calc(\n var(--bl-input-padding-end, var(--padding-horizontal)) + var(--icon-size) +\n var(--padding-vertical)\n )}.input-wrapper legend{height:0;visibility:hidden;display:none}.input-wrapper legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}input{width:100%;align-self:stretch;outline:0;border:0;padding:0 0 0 var(--label-padding);font:var(--input-font);color:var(--text-color);-webkit-text-fill-color:var(--text-color);background-color:transparent;cursor:var(--bl-input-cursor, unset)}input::-webkit-credentials-auto-fill-button{color:red}:where(.wrapper:focus-within, .wrapper.has-value) input{padding-inline-start:var(--label-padding)}input:disabled{cursor:not-allowed}input::-webkit-calendar-picker-indicator{display:none}input::-moz-calendar-picker-indicator{display:none}input:autofill{background-color:var(--autofill-bg-color);/**\n * Some browsers doesn't allow setting background-color\n * https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill\n */box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}input:-webkit-autofill{background-color:var(--autofill-bg-color);/**\n * Some browsers doesn't allow setting background-color\n * https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill\n */box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}.icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;height:var(--icon-size);margin-inline-end:var(--label-padding)}bl-icon:not(.reveal-icon),::slotted(bl-icon){font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.reveal-button bl-icon{display:none}bl-icon[name=\"eye_on\"]{display:inline-block}.password-visible bl-icon[name=\"eye_on\"]{display:none}.password-visible bl-icon[name=\"eye_off\"]{display:inline-block}.wrapper:not(.has-icon) .icon{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}::placeholder{color:var(--bl-color-neutral-light);-webkit-text-fill-color:var(--bl-color-neutral-light)}:host([label]) ::placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:color ease-out 0.4s}:host([label-fixed]) ::placeholder,:host :focus-within ::placeholder{color:var(--bl-color-neutral-light);-webkit-text-fill-color:var(--bl-color-neutral-light)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);padding:0}:host([label-fixed]) legend{display:none}:host(:not([label-fixed])) :focus-within label,:host(:not([label-fixed])) .has-value label{top:0;inset-inline-start:calc(\n var(--bl-input-padding-start, var(--padding-horizontal)) - var(--label-padding)\n );inset-inline-end:calc(\n var(--bl-input-padding-end, var(--padding-horizontal)) - var(--label-padding)\n );transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);padding:0 var(--label-padding);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]:not([label-fixed])) :where(:focus-within, .has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}.error-icon,.invalid-text{display:none}.dirty.invalid label,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}:host([help-text]) .hint,.dirty.invalid .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.dirty.invalid .error-icon{display:inline-block}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult, PropertyValues } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { localized, msg } from \"@lit/localize\";\nimport { FormControlMixin } from \"@open-wc/form-control\";\nimport { submit } from \"@open-wc/form-helpers\";\nimport \"element-internals-polyfill\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { innerInputValidators } from \"../../utilities/form-control\";\nimport \"../button/bl-button\";\nimport \"../icon/bl-icon\";\nimport { BaklavaIcon } from \"../icon/icon-list\";\nimport style from \"./bl-input.css\";\n\nexport type InputType =\n | \"text\"\n | \"email\"\n | \"date\"\n | \"time\"\n | \"datetime-local\"\n | \"month\"\n | \"week\"\n | \"password\"\n | \"number\"\n | \"tel\"\n | \"url\"\n | \"search\";\n\nconst inputTypeIcons: Partial<Record<InputType, BaklavaIcon>> = {\n \"date\": \"calendar\",\n \"datetime-local\": \"calendar\",\n \"month\": \"calendar\",\n \"week\": \"calendar\",\n \"time\": \"clock\",\n \"search\": \"search\",\n};\n\nexport type InputSize = \"small\" | \"medium\" | \"large\";\n/**\n * @tag bl-input\n * @summary Baklava Input component\n *\n * @cssproperty [--bl-input-padding-start] Sets the padding start\n * @cssproperty [--bl-input-padding-end] Sets the padding end\n */\n@customElement(\"bl-input\")\n@localized()\nexport default class BlInput extends FormControlMixin(LitElement) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static formControlValidators = innerInputValidators;\n\n @query(\"input\")\n validationTarget: HTMLInputElement;\n\n /**\n * Sets name of the input\n */\n @property({ reflect: true })\n name?: string;\n\n /**\n * Type of the input. It's used to set `type` attribute of native input inside.\n */\n @property({ reflect: true })\n type: InputType = \"text\";\n\n /**\n * Sets label of the input\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Sets placeholder of the input\n */\n @property({ reflect: true })\n placeholder?: string;\n\n /**\n * Sets initial value of the input\n */\n @property({ reflect: true })\n value = \"\";\n\n /**\n * Makes input a mandatory field\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Sets minimum length of the input\n */\n @property({ type: Number, reflect: true })\n minlength?: number;\n\n /**\n * Sets maximum length of the input\n */\n @property({ type: Number, reflect: true })\n maxlength?: number;\n\n /**\n * Sets the minimum acceptable value for the input\n */\n @property({ reflect: true })\n min?: number | string;\n\n /**\n * Sets the loading value for the input\n */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /**\n * Sets the maximum acceptable value for the input\n */\n @property({ reflect: true })\n max?: number | string;\n\n /**\n * Sets a regex pattern form the input validation\n */\n @property({ type: String, reflect: true })\n pattern?: string;\n\n /**\n * Sets the increase and decrease step to a `number` input\n */\n @property({ type: Number, reflect: true })\n step?: number;\n\n /**\n * Hints browser to autocomplete this field.\n */\n @property({ type: String, reflect: true })\n autocomplete: HTMLInputElement[\"autocomplete\"] = \"on\";\n\n /**\n * Sets the input mode of the field for asking browser to show the desired keyboard.\n */\n @property({ type: String, reflect: true })\n inputmode: HTMLInputElement[\"inputMode\"];\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Sets the custom icon name. `bl-icon` component is used to show an icon\n */\n @property({ type: String, reflect: true })\n icon?: BaklavaIcon;\n\n /**\n * Sets input size.\n */\n @property({ type: String, reflect: true })\n size?: InputSize = \"medium\";\n\n /**\n * Disables the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Makes the input readonly.\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n\n /**\n * Overrides error message. This message will override default error messages\n * @deprecated use setCustomValidity instead\n */\n @property({ type: String, attribute: \"invalid-text\", reflect: true })\n set customInvalidText(value: string) {\n this._customInvalidText = value;\n this.setValue(this.value);\n }\n\n /**\n * @deprecated\n */\n get customInvalidText(): string {\n return this._customInvalidText;\n }\n\n @property({ reflect: true, type: String })\n error: string;\n\n private _customInvalidText: string;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText?: string;\n\n /**\n * Fires when an alteration to the element's value is committed by the user. Unlike the input event, the change event is not necessarily fired for each alteration to an element's value.\n */\n @event(\"bl-change\") private onChange: EventDispatcher<string>;\n\n /**\n * Fires when the value of an input element has been changed.\n */\n @event(\"bl-input\") private onInput: EventDispatcher<string>;\n\n /**\n * Fires when the value of an input element has been changed.\n */\n @event(\"bl-invalid\") private onInvalid: EventDispatcher<ValidityState>;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\"keydown\", this.onKeydown);\n\n this.form?.addEventListener(\"submit\", () => {\n this.reportValidity();\n });\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(\"keydown\", this.onKeydown);\n }\n\n private onKeydown = (event: KeyboardEvent): void => {\n if (event.code === \"Enter\" && this.form) {\n setTimeout(() => {\n if (!event.defaultPrevented) {\n submit(this.form);\n }\n });\n }\n };\n\n @state() private dirty = false;\n\n @state() private passwordVisible = false;\n\n private textVisibilityToggle() {\n this.passwordVisible = !this.passwordVisible;\n }\n\n showPicker() {\n if (\"showPicker\" in HTMLInputElement.prototype) {\n this.validationTarget.showPicker();\n }\n }\n\n validityCallback(): string | void {\n this.onInvalid(this.internals.validity);\n return this.customInvalidText || this.validationTarget?.validationMessage;\n }\n\n /**\n * Sets a custom validity on the form element.\n * @param message\n */\n setCustomValidity(message: string) {\n this.validationTarget.setCustomValidity(message);\n }\n\n /**\n * Force to set input as in invalid state.\n * @deprecated use error attribute instead\n */\n async forceCustomError() {\n await this.updateComplete;\n this.setCustomValidity(\n this.customInvalidText ||\n msg(\"An error occurred\", { desc: \"bl-input: default custom error message\" })\n );\n this.setValue(this.value);\n this.reportValidity();\n }\n\n /**\n * Clear forced invalid state\n * @deprecated use error attribute instead\n */\n async clearCustomError() {\n await this.updateComplete;\n this.setCustomValidity(\"\");\n this.setValue(this.value);\n this.reportValidity();\n }\n\n reportValidity() {\n this.dirty = true;\n this.requestUpdate();\n return this.checkValidity();\n }\n\n private inputHandler(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n\n this.value = value;\n this.setValue(this.value);\n this.onInput(value);\n }\n\n private changeHandler(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n\n this.dirty = true;\n this.value = value;\n this.setValue(this.value);\n this.onChange(value);\n }\n\n firstUpdated() {\n this.setValue(this.value);\n if (!this.icon) this.icon = inputTypeIcons[this.type];\n }\n\n protected async updated(changedProperties: PropertyValues) {\n if (changedProperties.size > 0) {\n this.setValue(this.value);\n\n await this.validationComplete;\n\n this.requestUpdate();\n }\n\n if (changedProperties.has(\"error\") && this.error && !this.dirty) {\n this.reportValidity();\n }\n }\n\n private inputId = Math.random().toString(36).substring(2);\n\n private get _hasIconSlot() {\n return this.querySelector(':scope > [slot=\"icon\"]') !== null;\n }\n\n render(): TemplateResult {\n const invalidMessage = !this.checkValidity()\n ? html`<p id=\"errorMessage\" aria-live=\"polite\" class=\"invalid-text\">\n ${this.validationMessage}\n </p>`\n : \"\";\n const helpMessage = this.helpText\n ? html`<p id=\"helpText\" class=\"help-text\">${this.helpText}</p>`\n : \"\";\n\n const icon = html`\n <slot name=\"icon\">\n ${this.loading && this.type === \"search\" && this.value !== \"\" && this.value !== null\n ? html`<bl-spinner></bl-spinner>`\n : this.icon\n ? html`<bl-icon name=\"${this.icon}\"></bl-icon>`\n : html`<bl-icon class=\"error-icon\" name=\"alert\"></bl-icon>`}\n </slot>\n `;\n\n const label = this.label ? html`<label for=${this.inputId}>${this.label}</label>` : \"\";\n const passwordInput = this.type === \"password\";\n\n const revealButton = passwordInput\n ? html`<bl-button\n size=\"small\"\n kind=\"neutral\"\n variant=\"tertiary\"\n class=\"${classMap({\n \"reveal-button\": true,\n \"password-visible\": this.passwordVisible,\n })}\"\n aria-label=\"Toggle password reveal\"\n @bl-click=\"${this.textVisibilityToggle}\"\n >\n <bl-icon class=\"reveal-icon\" slot=\"icon\" name=\"eye_on\"></bl-icon>\n <bl-icon class=\"reveal-icon\" slot=\"icon\" name=\"eye_off\"></bl-icon>\n </bl-button>`\n : \"\";\n\n const hasCustomIcon = this.icon || this._hasIconSlot;\n const classes = {\n \"wrapper\": true,\n \"dirty\": this.dirty,\n \"invalid\": !this.checkValidity(),\n \"has-icon\": passwordInput || hasCustomIcon || (this.dirty && !this.checkValidity()),\n \"has-value\": this.value !== null && this.value !== \"\",\n };\n\n const passwordType = this.passwordVisible ? \"text\" : \"password\";\n const inputType = passwordInput ? passwordType : this.type;\n\n return html`<div class=${classMap(classes)}>\n ${label}\n <fieldset class=\"input-wrapper\">\n <legend><span>${this.label}</span></legend>\n <input\n id=${this.inputId}\n type=${inputType}\n .value=${live(this.value)}\n inputmode=\"${ifDefined(this.inputmode)}\"\n ?autofocus=${this.autofocus}\n .autocomplete=\"${this.autocomplete}\"\n placeholder=\"${ifDefined(this.placeholder)}\"\n minlength=\"${ifDefined(this.minlength)}\"\n maxlength=\"${ifDefined(this.maxlength)}\"\n min=\"${ifDefined(this.min)}\"\n max=\"${ifDefined(this.max)}\"\n pattern=\"${ifDefined(this.pattern)}\"\n step=\"${ifDefined(this.step)}\"\n ?required=${this.required}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n @change=${this.changeHandler}\n @input=${this.inputHandler}\n aria-invalid=${this.checkValidity() ? \"false\" : \"true\"}\n aria-describedby=${ifDefined(this.helpText ? \"helpText\" : undefined)}\n aria-errormessage=${ifDefined(this.checkValidity() ? undefined : \"errorMessage\")}\n />\n <div class=\"icon\">${revealButton} ${icon}</div>\n </fieldset>\n <div class=\"hint\">${invalidMessage} ${helpMessage}</div>\n </div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-input\": BlInput;\n }\n}\n"],
5
+ "mappings": "6dACO,IAAMA,EAASC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,spBAoBfC,EAAQF,ECSf,IAAMG,EAA0D,CAC9D,KAAQ,WACR,iBAAkB,WAClB,MAAS,WACT,KAAQ,WACR,KAAQ,QACR,OAAU,QACZ,EAYqBC,EAArB,cAAqCC,EAAiBC,CAAU,CAAE,CAAlE,kCAqBE,UAAkB,OAkBlB,WAAQ,GAMR,cAAW,GAwBX,aAAU,GAwBV,kBAAiD,KAYjD,eAAY,GAYZ,UAAmB,SAMnB,cAAW,GAMX,cAAW,GAMX,gBAAa,GA2Db,KAAQ,UAAaC,GAA+B,CAC9CA,EAAM,OAAS,SAAW,KAAK,MACjC,WAAW,IAAM,CACVA,EAAM,kBACTC,EAAO,KAAK,IAAI,CAEpB,CAAC,CAEL,EAES,KAAQ,MAAQ,GAEhB,KAAQ,gBAAkB,GA4FnC,KAAQ,QAAU,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,CAAC,EAzSxD,WAAW,QAAyB,CAClC,MAAO,CAACC,CA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yB,EAAA,CADCE,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAhIvB3B,EAiInB,wBAMAyB,EAAA,CADCE,EAAS,CAAE,KAAM,QAAS,UAAW,cAAe,QAAS,EAAK,CAAC,GAtIjD3B,EAuInB,0BAOIyB,EAAA,CADHE,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,QAAS,EAAK,CAAC,GA7IjD3B,EA8If,iCAaJyB,EAAA,CADCE,EAAS,CAAE,QAAS,GAAM,KAAM,MAAO,CAAC,GA1JtB3B,EA2JnB,qBAQAyB,EAAA,CADCE,EAAS,CAAE,KAAM,OAAQ,UAAW,YAAa,QAAS,EAAK,CAAC,GAlK9C3B,EAmKnB,wBAK4ByB,EAAA,CAA3BtB,EAAM,WAAW,GAxKCH,EAwKS,wBAKDyB,EAAA,CAA1BtB,EAAM,UAAU,GA7KEH,EA6KQ,uBAKEyB,EAAA,CAA5BtB,EAAM,YAAY,GAlLAH,EAkLU,yBA0BZyB,EAAA,CAAhBG,EAAM,GA5MY5B,EA4MF,qBAEAyB,EAAA,CAAhBG,EAAM,GA9MY5B,EA8MF,+BA9MEA,EAArByB,EAAA,CAFCE,EAAc,UAAU,EACxBE,EAAU,GACU7B",
6
+ "names": ["styles", "i", "bl_input_default", "inputTypeIcons", "BlInput", "FormControlMixin", "s", "event", "submit", "bl_input_default", "value", "_a", "message", "msg", "changedProperties", "invalidMessage", "x", "helpMessage", "icon", "label", "passwordInput", "revealButton", "o", "hasCustomIcon", "classes", "passwordType", "inputType", "l", "innerInputValidators", "__decorateClass", "i", "e", "t", "localized"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import{b as a}from"./chunk-IZ2LK5GK.js";var c={};a(c,{templates:()=>e});var e={s144508ac0e146c46:"Hi\xE7bir Sonu\xE7 Bulunamad\u0131",s3f9c368cd44f682b:"Bir hata olu\u015Ftu",s5d929ff1619ac0c9:"Arama",s716a6024e3fe999c:"G\xF6ster",s76ddb3a843ed8e06:"Aramay\u0131 Temizle",sb1ba2131b9a7c7b0:"Git",sbaace8219b5f4612:"T\xFCm\xFCn\xFC Se\xE7"};export{e as a,c as b};
2
+ //# sourceMappingURL=chunk-7F6RR2JV.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/generated/locales/tr.ts"],
4
- "sourcesContent": ["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 's144508ac0e146c46': `Hi\u00E7bir Sonu\u00E7 Bulunamad\u0131`,\n's5d929ff1619ac0c9': `Arama`,\n's716a6024e3fe999c': `G\u00F6ster`,\n's76ddb3a843ed8e06': `Aramay\u0131 Temizle`,\n'sb1ba2131b9a7c7b0': `Git`,\n'sbaace8219b5f4612': `T\u00FCm\u00FCn\u00FC Se\u00E7`,\n };\n "],
5
- "mappings": "wCAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,IAUW,IAAMA,EAAY,CACvB,kBAAqB,qCAC3B,kBAAqB,QACrB,kBAAqB,YACrB,kBAAqB,uBACrB,kBAAqB,MACrB,kBAAqB,wBACjB",
4
+ "sourcesContent": ["\n // Do not modify this file by hand!\n // Re-generate this file by running lit-localize\n\n \n \n\n /* eslint-disable no-irregular-whitespace */\n /* eslint-disable @typescript-eslint/no-explicit-any */\n\n export const templates = {\n 's144508ac0e146c46': `Hi\u00E7bir Sonu\u00E7 Bulunamad\u0131`,\n's3f9c368cd44f682b': `Bir hata olu\u015Ftu`,\n's5d929ff1619ac0c9': `Arama`,\n's716a6024e3fe999c': `G\u00F6ster`,\n's76ddb3a843ed8e06': `Aramay\u0131 Temizle`,\n'sb1ba2131b9a7c7b0': `Git`,\n'sbaace8219b5f4612': `T\u00FCm\u00FCn\u00FC Se\u00E7`,\n };\n "],
5
+ "mappings": "wCAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,eAAAE,IAUW,IAAMA,EAAY,CACvB,kBAAqB,qCAC3B,kBAAqB,uBACrB,kBAAqB,QACrB,kBAAqB,YACrB,kBAAqB,uBACrB,kBAAqB,MACrB,kBAAqB,wBACjB",
6
6
  "names": ["tr_exports", "__export", "templates"]
7
7
  }
@@ -1,5 +1,5 @@
1
- import{b as k}from"./chunk-MND5TXTF.js";import{c as $}from"./chunk-EG7U7PM3.js";import{a as z}from"./chunk-XDUIVR6I.js";import{a as w}from"./chunk-6LT7O7T2.js";import{a as s}from"./chunk-DINNT5P2.js";import{a as c}from"./chunk-GRL4DWKG.js";import{a as f,b as y,c as x}from"./chunk-7GK5LKBV.js";import{a as b,b as a,c as u,e as m}from"./chunk-5MOOXA2X.js";import{a as v,b as d,c as g,f as p}from"./chunk-4OT5AMS5.js";import{d as r}from"./chunk-IZ2LK5GK.js";var C="important",I=" !"+C,S=y(class extends x{constructor(o){var l;if(super(o),o.type!==f.ATTRIBUTE||o.name!=="style"||((l=o.strings)===null||l===void 0?void 0:l.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((l,e)=>{let i=o[e];return i==null?l:l+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(o,[l]){let{style:e}=o.element;if(this.ht===void 0){this.ht=new Set;for(let i in l)this.ht.add(i);return this.render(l)}this.ht.forEach(i=>{l[i]==null&&(this.ht.delete(i),i.includes("-")?e.removeProperty(i):e[i]="")});for(let i in l){let n=l[i];if(n!=null){this.ht.add(i);let h=typeof n=="string"&&n.endsWith(I);i.includes("-")||h?e.setProperty(i,h?n.slice(0,-11):n,h?C:""):e[i]=n}}return g}});var L=v`: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);--label-padding:var(--bl-size-3xs);--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);--border-color:var(--bl-color-neutral-lighter);--background-color:var(--bl-color-neutral-full);display:flex;flex-direction:column;position:relative;gap:var(--bl-size-3xs)}.input-wrapper{border:solid var(--border-size) var(--border-color);border-radius:var(--border-radius);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));padding-top:var(--padding-vertical);display:flex;box-sizing:border-box;background-color:var(--background-color);margin:0;width:0;min-width:100%}textarea{--parent-padding:calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));width:100%;align-self:stretch;outline:none;font:var(--input-font);padding:0 calc(var(--padding-horizontal) - var(--border-size));padding-bottom:var(--padding-vertical);margin:0 calc(-1 * var(--parent-padding));border:none;border-radius:var(--border-radius);color:var(--bl-color-neutral-darker);resize:vertical;background-color:transparent;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-neutral-lightest);color:var(--bl-color-neutral-light);cursor:not-allowed}:host([disabled]) .wrapper{--background-color:var(--bl-color-neutral-lightest)}: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 0.4s}.input-wrapper legend,label{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{max-width:max-content;position:absolute;transition:all ease-in 0.1s;font:var(--bl-font-title-3-regular);top:var(--padding-vertical);inset-inline-start:var(--padding-horizontal);inset-inline-end:var(--padding-horizontal);pointer-events:none;color:var(--bl-color-neutral-light)}.input-wrapper legend{height:0;visibility:hidden;display:none}.input-wrapper legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:where(.wrapper:focus-within, .wrapper.has-value) label{top:0;inset-inline-start:var(--padding-horizontal);transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]) :where(.wrapper:focus-within, .wrapper.has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host ::placeholder,:host([label-fixed]) ::placeholder{color:var(--bl-color-neutral-light)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);background-color:initial;padding:0}:host([label-fixed]) legend{display:none}.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-neutral-dark);margin-inline-start:auto}:where(.max-len-invalid, .dirty.invalid) .hint > .counter-text{color:var(--bl-color-danger)}.dirty.invalid label{color:var(--bl-color-danger)}.invalid-text{display:none;color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}:where(.dirty.max-len-invalid, .dirty.invalid) .hint > .invalid-text{display:inline-block}.dirty.invalid .hint > .help-text{display:none}`,E=L;var t=class extends z(p){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.autofocus=!1;this.spellchecker="false";this.customScrollHeight=null;this.inputId=Math.random().toString(36).substring(2);this.onError=()=>{this.onInvalid(this.internals.validity)};this.dirty=!1}static get styles(){return[E]}connectedCallback(){var e;super.connectedCallback(),(e=this.internals.form)==null||e.addEventListener("submit",()=>{this.reportValidity()})}inputHandler(e){this.autoResize();let i=e.target.value;this.value=i,this.onInput(i)}changeHandler(e){let i=e.target.value;this.dirty=!0,this.value=i,this.onChange(i)}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,i=this.checkValidity()?"":d`<p class="invalid-text">${this.validationMessage}</p>`,n=this.helpText?d`<p class="help-text">${this.helpText}</p>`:"",h=this.label?d`<label for="${this.inputId}">${this.label}</label>`:"",M=this.characterCounter&&this.maxlength?`${this.value.length}/${this.maxlength}`:this.characterCounter?`${this.value.length}`:"",R=this.characterCounter?d`<p class="counter-text">${M}</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 d`
2
- <div style=${S(V)} class=${w(H)}>
1
+ import{b as k}from"./chunk-23PSWIUF.js";import{c as $}from"./chunk-EG7U7PM3.js";import{a as z}from"./chunk-XDUIVR6I.js";import{a as w}from"./chunk-6LT7O7T2.js";import{a as s}from"./chunk-DINNT5P2.js";import{a as c}from"./chunk-GRL4DWKG.js";import{a as f,b as y,c as x}from"./chunk-7GK5LKBV.js";import{a as b,b as a,c as u,e as m}from"./chunk-5MOOXA2X.js";import{a as v,b as d,c as g,f as p}from"./chunk-4OT5AMS5.js";import{d as r}from"./chunk-IZ2LK5GK.js";var C="important",I=" !"+C,S=y(class extends x{constructor(o){var l;if(super(o),o.type!==f.ATTRIBUTE||o.name!=="style"||((l=o.strings)===null||l===void 0?void 0:l.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((l,e)=>{let i=o[e];return i==null?l:l+`${e=e.includes("-")?e:e.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${i};`},"")}update(o,[l]){let{style:e}=o.element;if(this.ht===void 0){this.ht=new Set;for(let i in l)this.ht.add(i);return this.render(l)}this.ht.forEach(i=>{l[i]==null&&(this.ht.delete(i),i.includes("-")?e.removeProperty(i):e[i]="")});for(let i in l){let n=l[i];if(n!=null){this.ht.add(i);let h=typeof n=="string"&&n.endsWith(I);i.includes("-")||h?e.setProperty(i,h?n.slice(0,-11):n,h?C:""):e[i]=n}}return g}});var L=v`: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);--label-padding:var(--bl-size-3xs);--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);--border-color:var(--bl-color-neutral-lighter);--background-color:var(--bl-color-neutral-full);display:flex;flex-direction:column;position:relative;gap:var(--bl-size-3xs)}.input-wrapper{border:solid var(--border-size) var(--border-color);border-radius:var(--border-radius);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));padding-top:var(--padding-vertical);display:flex;box-sizing:border-box;background-color:var(--background-color);margin:0;width:0;min-width:100%}textarea{--parent-padding:calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));width:100%;align-self:stretch;outline:none;font:var(--input-font);padding:0 calc(var(--padding-horizontal) - var(--border-size));padding-bottom:var(--padding-vertical);margin:0 calc(-1 * var(--parent-padding));border:none;border-radius:var(--border-radius);color:var(--bl-color-neutral-darker);resize:vertical;background-color:transparent;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-neutral-lightest);color:var(--bl-color-neutral-light);cursor:not-allowed}:host([disabled]) .wrapper{--background-color:var(--bl-color-neutral-lightest)}: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 0.4s}.input-wrapper legend,label{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{max-width:max-content;position:absolute;transition:all ease-in 0.1s;font:var(--bl-font-title-3-regular);top:var(--padding-vertical);inset-inline-start:var(--padding-horizontal);inset-inline-end:var(--padding-horizontal);pointer-events:none;color:var(--bl-color-neutral-light)}.input-wrapper legend{height:0;visibility:hidden;display:none}.input-wrapper legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:where(.wrapper:focus-within, .wrapper.has-value) label{top:0;inset-inline-start:var(--padding-horizontal);transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]) :where(.wrapper:focus-within, .wrapper.has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host ::placeholder,:host([label-fixed]) ::placeholder{color:var(--bl-color-neutral-light)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);background-color:initial;padding:0}:host([label-fixed]) legend{display:none}.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-neutral-dark);margin-inline-start:auto}:where(.max-len-invalid, .dirty.invalid) .hint > .counter-text{color:var(--bl-color-danger)}.dirty.invalid label{color:var(--bl-color-danger)}.invalid-text{display:none;color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}:where(.dirty.max-len-invalid, .dirty.invalid) .hint > .invalid-text{display:inline-block}.dirty.invalid .hint > .help-text{display:none}`,E=L;var t=class extends z(p){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.autofocus=!1;this.spellchecker="false";this.customScrollHeight=null;this.inputId=Math.random().toString(36).substring(2);this.onError=()=>{this.onInvalid(this.internals.validity)};this.dirty=!1}static get styles(){return[E]}connectedCallback(){var e;super.connectedCallback(),(e=this.internals.form)==null||e.addEventListener("submit",()=>{this.reportValidity()})}inputHandler(e){this.autoResize();let i=e.target.value;this.value=i,this.setValue(this.value),this.onInput(i)}changeHandler(e){let i=e.target.value;this.dirty=!0,this.value=i,this.setValue(this.value),this.onChange(i)}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()),e.has("error")&&this.error&&!this.dirty&&this.reportValidity()}setCustomValidity(e){this.validationTarget.setCustomValidity(e)}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,i=this.checkValidity()?"":d`<p class="invalid-text">${this.validationMessage}</p>`,n=this.helpText?d`<p class="help-text">${this.helpText}</p>`:"",h=this.label?d`<label for="${this.inputId}">${this.label}</label>`:"",V=this.characterCounter&&this.maxlength?`${this.value.length}/${this.maxlength}`:this.characterCounter?`${this.value.length}`:"",M=this.characterCounter?d`<p class="counter-text">${V}</p>`:"",R={wrapper:!0,"has-value":this.value!==null&&this.value!=="",dirty:this.dirty,"max-len-invalid":e,invalid:!this.checkValidity()},H={"--row-count":`${this.rows}`,"--maxrow-count":this.maxRows?`${this.maxRows}`:null,"--scroll-height":this.customScrollHeight};return d`
2
+ <div style=${S(H)} class=${w(R)}>
3
3
  ${h}
4
4
  <fieldset class="input-wrapper">
5
5
  <legend><span>${this.label}</span></legend>
@@ -22,9 +22,9 @@ import{b as k}from"./chunk-MND5TXTF.js";import{c as $}from"./chunk-EG7U7PM3.js";
22
22
  >
23
23
  </textarea>
24
24
  </fieldset>
25
- <div class="hint">${i}${n}${R}</div>
25
+ <div class="hint">${i}${n}${M}</div>
26
26
  </div>
27
- `}};t.shadowRootOptions={...p.shadowRootOptions,delegatesFocus:!0},t.formControlValidators=k,r([m("textarea")],t.prototype,"validationTarget",2),r([a({type:String,reflect:!0})],t.prototype,"name",2),r([a({type:Boolean,reflect:!0})],t.prototype,"required",2),r([a({type:Boolean,reflect:!0})],t.prototype,"disabled",2),r([a({type:Boolean,reflect:!0})],t.prototype,"expand",2),r([a({type:Number,reflect:!0,attribute:"max-rows"})],t.prototype,"maxRows",2),r([a({type:String,reflect:!0})],t.prototype,"size",2),r([a({reflect:!0})],t.prototype,"label",2),r([a({type:Boolean,attribute:"label-fixed",reflect:!0})],t.prototype,"labelFixed",2),r([a({reflect:!0})],t.prototype,"placeholder",2),r([a({type:Boolean,attribute:"character-counter",reflect:!0})],t.prototype,"characterCounter",2),r([a({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),r([a({type:String,attribute:"invalid-text",reflect:!0})],t.prototype,"customInvalidText",2),r([a({type:Number,reflect:!0})],t.prototype,"minlength",2),r([a({type:Number,reflect:!0})],t.prototype,"maxlength",2),r([a({reflect:!0})],t.prototype,"value",2),r([a({type:Number,reflect:!0})],t.prototype,"rows",2),r([a({type:String,reflect:!0})],t.prototype,"inputmode",2),r([a({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),r([a({type:String,reflect:!0})],t.prototype,"autocomplete",2),r([a({type:String,reflect:!0,attribute:"spellcheck"})],t.prototype,"spellchecker",2),r([c("bl-input")],t.prototype,"onInput",2),r([c("bl-change")],t.prototype,"onChange",2),r([c("bl-invalid")],t.prototype,"onInvalid",2),r([u()],t.prototype,"customScrollHeight",2),r([u()],t.prototype,"dirty",2),t=r([b("bl-textarea")],t);export{t as a};
27
+ `}};t.shadowRootOptions={...p.shadowRootOptions,delegatesFocus:!0},t.formControlValidators=k,r([m("textarea")],t.prototype,"validationTarget",2),r([a({reflect:!0,type:String})],t.prototype,"error",2),r([a({type:String,reflect:!0})],t.prototype,"name",2),r([a({type:Boolean,reflect:!0})],t.prototype,"required",2),r([a({type:Boolean,reflect:!0})],t.prototype,"disabled",2),r([a({type:Boolean,reflect:!0})],t.prototype,"expand",2),r([a({type:Number,reflect:!0,attribute:"max-rows"})],t.prototype,"maxRows",2),r([a({type:String,reflect:!0})],t.prototype,"size",2),r([a({reflect:!0})],t.prototype,"label",2),r([a({type:Boolean,attribute:"label-fixed",reflect:!0})],t.prototype,"labelFixed",2),r([a({reflect:!0})],t.prototype,"placeholder",2),r([a({type:Boolean,attribute:"character-counter",reflect:!0})],t.prototype,"characterCounter",2),r([a({type:String,attribute:"help-text",reflect:!0})],t.prototype,"helpText",2),r([a({type:String,attribute:"invalid-text",reflect:!0})],t.prototype,"customInvalidText",2),r([a({type:Number,reflect:!0})],t.prototype,"minlength",2),r([a({type:Number,reflect:!0})],t.prototype,"maxlength",2),r([a({reflect:!0})],t.prototype,"value",2),r([a({type:Number,reflect:!0})],t.prototype,"rows",2),r([a({type:String,reflect:!0})],t.prototype,"inputmode",2),r([a({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),r([a({type:String,reflect:!0})],t.prototype,"autocomplete",2),r([a({type:String,reflect:!0,attribute:"spellcheck"})],t.prototype,"spellchecker",2),r([c("bl-input")],t.prototype,"onInput",2),r([c("bl-change")],t.prototype,"onChange",2),r([c("bl-invalid")],t.prototype,"onInvalid",2),r([u()],t.prototype,"customScrollHeight",2),r([u()],t.prototype,"dirty",2),t=r([b("bl-textarea")],t);export{t as a};
28
28
  /*! Bundled license information:
29
29
 
30
30
  lit-html/directives/style-map.js:
@@ -34,4 +34,4 @@ lit-html/directives/style-map.js:
34
34
  * SPDX-License-Identifier: BSD-3-Clause
35
35
  *)
36
36
  */
37
- //# sourceMappingURL=chunk-GQXMNZFC.js.map
37
+ //# sourceMappingURL=chunk-KBNVATXF.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 | number | undefined | null;\n}\n\nconst important = 'important';\n// The leading space is important\nconst importantFlag = ' !' + important;\n// How many characters to remove from a value, as a negative number\nconst flagTrim = 0 - importantFlag.length;\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.includes('-')\n ? prop\n : 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 const isImportant =\n typeof value === 'string' && value.endsWith(importantFlag);\n if (name.includes('-') || isImportant) {\n style.setProperty(\n name,\n isImportant\n ? (value as string).slice(0, flagTrim)\n : (value as string),\n isImportant ? important : ''\n );\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 properties to the inline\n * style of the element.\n *\n * 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);--label-padding:var(--bl-size-3xs);--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);--border-color:var(--bl-color-neutral-lighter);--background-color:var(--bl-color-neutral-full);display:flex;flex-direction:column;position:relative;gap:var(--bl-size-3xs)}.input-wrapper{border:solid var(--border-size) var(--border-color);border-radius:var(--border-radius);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));padding-top:var(--padding-vertical);display:flex;box-sizing:border-box;background-color:var(--background-color);margin:0;width:0;min-width:100%}textarea{--parent-padding:calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));width:100%;align-self:stretch;outline:none;font:var(--input-font);padding:0 calc(var(--padding-horizontal) - var(--border-size));padding-bottom:var(--padding-vertical);margin:0 calc(-1 * var(--parent-padding));border:none;border-radius:var(--border-radius);color:var(--bl-color-neutral-darker);resize:vertical;background-color:transparent;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-neutral-lightest);color:var(--bl-color-neutral-light);cursor:not-allowed}:host([disabled]) .wrapper{--background-color:var(--bl-color-neutral-lightest)}: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 0.4s}.input-wrapper legend,label{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{max-width:max-content;position:absolute;transition:all ease-in 0.1s;font:var(--bl-font-title-3-regular);top:var(--padding-vertical);inset-inline-start:var(--padding-horizontal);inset-inline-end:var(--padding-horizontal);pointer-events:none;color:var(--bl-color-neutral-light)}.input-wrapper legend{height:0;visibility:hidden;display:none}.input-wrapper legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:where(.wrapper:focus-within, .wrapper.has-value) label{top:0;inset-inline-start:var(--padding-horizontal);transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]) :where(.wrapper:focus-within, .wrapper.has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host ::placeholder,:host([label-fixed]) ::placeholder{color:var(--bl-color-neutral-light)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);background-color:initial;padding:0}:host([label-fixed]) legend{display:none}.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-neutral-dark);margin-inline-start:auto}:where(.max-len-invalid, .dirty.invalid) .hint > .counter-text{color:var(--bl-color-danger)}.dirty.invalid label{color:var(--bl-color-danger)}.invalid-text{display:none;color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}: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 { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { FormControlMixin } from \"@open-wc/form-control\";\nimport \"element-internals-polyfill\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { textAreaValidators } from \"../../utilities/form-control\";\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 static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static formControlValidators = textAreaValidators;\n\n @query(\"textarea\")\n validationTarget: HTMLTextAreaElement;\n\n /**\n * Name of textarea\n */\n @property({ type: String, reflect: true })\n name = \"\";\n\n /**\n * Makes textarea a mandatory field\n */\n @property({ type: Boolean, reflect: true })\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({ reflect: true })\n placeholder?: string;\n\n /**\n * Enables showing character counter.\n */\n @property({ type: Boolean, attribute: \"character-counter\", reflect: true })\n characterCounter = false;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText?: string;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: \"invalid-text\", reflect: true })\n customInvalidText?: string;\n\n /**\n * Sets minimum length of the textarea\n */\n @property({ type: Number, reflect: true })\n minlength?: number;\n\n /**\n * Sets max length of textarea\n */\n @property({ type: Number, reflect: true })\n maxlength?: number;\n\n /**\n * Sets initial value of the textarea\n */\n @property({ reflect: true })\n value = \"\";\n\n /**\n * Sets textarea visible row count.\n */\n @property({ type: Number, reflect: true })\n rows?: number = 4;\n\n /**\n * Sets the input mode of the field for asking browser to show the desired keyboard.\n */\n @property({ type: String, reflect: true })\n inputmode: \"none\" | \"text\" | \"decimal\" | \"numeric\" | \"tel\" | \"search\" | \"email\" | \"url\";\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Hints browser to autocomplete this field.\n */\n @property({ type: String, reflect: true })\n autocomplete: string;\n\n /**\n * Enables/disables spellcheck feature inside the textarea\n */\n @property({ type: String, reflect: true, attribute: \"spellcheck\" })\n spellchecker: \"true\" | \"false\" = \"false\";\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 private inputId = Math.random().toString(36).substring(2);\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\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\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 = this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : \"\";\n\n const label = this.label ? html`<label for=\"${this.inputId}\">${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 <fieldset class=\"input-wrapper\">\n <legend><span>${this.label}</span></legend>\n <textarea\n id=\"${this.inputId}\"\n name=\"${ifDefined(this.name)}\"\n .value=${live(this.value)}\n ?autofocus=${this.autofocus}\n autocomplete=\"${ifDefined(this.autocomplete)}\"\n inputmode=\"${ifDefined(this.inputmode)}\"\n placeholder=\"${ifDefined(this.placeholder)}\"\n minlength=\"${ifDefined(this.minlength)}\"\n rows=\"${ifDefined(this.rows)}\"\n ?required=${this.required}\n ?disabled=${this.disabled}\n spellcheck=\"${this.spellchecker}\"\n @change=${this.changeHandler}\n @input=${this.inputHandler}\n @invalid=${this.onError}\n >\n </textarea>\n </fieldset>\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": "wcA0BA,IAAMA,EAAY,YAEZC,EAAgB,KAAOD,EAqHhBE,EAAWC,EAjHxB,cAAgCC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
- "names": ["important", "importantFlag", "styleMap", "directive", "Directive", "constructor", "partInfo", "super", "type", "PartType", "ATTRIBUTE", "name", "_a", "strings", "length", "Error", "render", "styleInfo", "Object", "keys", "reduce", "style", "prop", "value", "includes", "replace", "toLowerCase", "update", "part", "element", "this", "_previousStyleProperties", "Set", "add", "forEach", "delete", "removeProperty", "isImportant", "endsWith", "setProperty", "slice", "noChange", "styles", "i", "bl_textarea_default", "BlTextarea", "FormControlMixin", "s", "bl_textarea_default", "_a", "event", "value", "changedProperties", "scrollHeight", "maxLengthInvalid", "invalidMessage", "x", "helpMessage", "label", "characterCounterText", "characterCounter", "wrapperClasses", "styles", "o", "l", "textAreaValidators", "__decorateClass", "i", "e", "t"]
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 | number | undefined | null;\n}\n\nconst important = 'important';\n// The leading space is important\nconst importantFlag = ' !' + important;\n// How many characters to remove from a value, as a negative number\nconst flagTrim = 0 - importantFlag.length;\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.includes('-')\n ? prop\n : 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 const isImportant =\n typeof value === 'string' && value.endsWith(importantFlag);\n if (name.includes('-') || isImportant) {\n style.setProperty(\n name,\n isImportant\n ? (value as string).slice(0, flagTrim)\n : (value as string),\n isImportant ? important : ''\n );\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 properties to the inline\n * style of the element.\n *\n * 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);--label-padding:var(--bl-size-3xs);--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);--border-color:var(--bl-color-neutral-lighter);--background-color:var(--bl-color-neutral-full);display:flex;flex-direction:column;position:relative;gap:var(--bl-size-3xs)}.input-wrapper{border:solid var(--border-size) var(--border-color);border-radius:var(--border-radius);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));padding-top:var(--padding-vertical);display:flex;box-sizing:border-box;background-color:var(--background-color);margin:0;width:0;min-width:100%}textarea{--parent-padding:calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));width:100%;align-self:stretch;outline:none;font:var(--input-font);padding:0 calc(var(--padding-horizontal) - var(--border-size));padding-bottom:var(--padding-vertical);margin:0 calc(-1 * var(--parent-padding));border:none;border-radius:var(--border-radius);color:var(--bl-color-neutral-darker);resize:vertical;background-color:transparent;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-neutral-lightest);color:var(--bl-color-neutral-light);cursor:not-allowed}:host([disabled]) .wrapper{--background-color:var(--bl-color-neutral-lightest)}: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 0.4s}.input-wrapper legend,label{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{max-width:max-content;position:absolute;transition:all ease-in 0.1s;font:var(--bl-font-title-3-regular);top:var(--padding-vertical);inset-inline-start:var(--padding-horizontal);inset-inline-end:var(--padding-horizontal);pointer-events:none;color:var(--bl-color-neutral-light)}.input-wrapper legend{height:0;visibility:hidden;display:none}.input-wrapper legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:where(.wrapper:focus-within, .wrapper.has-value) label{top:0;inset-inline-start:var(--padding-horizontal);transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]) :where(.wrapper:focus-within, .wrapper.has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host ::placeholder,:host([label-fixed]) ::placeholder{color:var(--bl-color-neutral-light)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);background-color:initial;padding:0}:host([label-fixed]) legend{display:none}.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-neutral-dark);margin-inline-start:auto}:where(.max-len-invalid, .dirty.invalid) .hint > .counter-text{color:var(--bl-color-danger)}.dirty.invalid label{color:var(--bl-color-danger)}.invalid-text{display:none;color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}: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 { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { styleMap } from \"lit/directives/style-map.js\";\nimport { FormControlMixin } from \"@open-wc/form-control\";\nimport \"element-internals-polyfill\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { textAreaValidators } from \"../../utilities/form-control\";\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 static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static formControlValidators = textAreaValidators;\n\n @query(\"textarea\")\n validationTarget: HTMLTextAreaElement;\n\n @property({ reflect: true, type: String })\n error: string;\n\n /**\n * Name of textarea\n */\n @property({ type: String, reflect: true })\n name = \"\";\n\n /**\n * Makes textarea a mandatory field\n */\n @property({ type: Boolean, reflect: true })\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({ reflect: true })\n placeholder?: string;\n\n /**\n * Enables showing character counter.\n */\n @property({ type: Boolean, attribute: \"character-counter\", reflect: true })\n characterCounter = false;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText?: string;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: \"invalid-text\", reflect: true })\n customInvalidText?: string;\n\n /**\n * Sets minimum length of the textarea\n */\n @property({ type: Number, reflect: true })\n minlength?: number;\n\n /**\n * Sets max length of textarea\n */\n @property({ type: Number, reflect: true })\n maxlength?: number;\n\n /**\n * Sets initial value of the textarea\n */\n @property({ reflect: true })\n value = \"\";\n\n /**\n * Sets textarea visible row count.\n */\n @property({ type: Number, reflect: true })\n rows?: number = 4;\n\n /**\n * Sets the input mode of the field for asking browser to show the desired keyboard.\n */\n @property({ type: String, reflect: true })\n inputmode: \"none\" | \"text\" | \"decimal\" | \"numeric\" | \"tel\" | \"search\" | \"email\" | \"url\";\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Hints browser to autocomplete this field.\n */\n @property({ type: String, reflect: true })\n autocomplete: string;\n\n /**\n * Enables/disables spellcheck feature inside the textarea\n */\n @property({ type: String, reflect: true, attribute: \"spellcheck\" })\n spellchecker: \"true\" | \"false\" = \"false\";\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 private inputId = Math.random().toString(36).substring(2);\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\n this.value = value;\n this.setValue(this.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.setValue(this.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 if (changedProperties.has(\"error\") && this.error && !this.dirty) {\n this.reportValidity();\n }\n }\n\n /**\n * Sets a custom validity on the form element.\n * @param message\n */\n setCustomValidity(message: string) {\n this.validationTarget.setCustomValidity(message);\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\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 = this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : \"\";\n\n const label = this.label ? html`<label for=\"${this.inputId}\">${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 <fieldset class=\"input-wrapper\">\n <legend><span>${this.label}</span></legend>\n <textarea\n id=\"${this.inputId}\"\n name=\"${ifDefined(this.name)}\"\n .value=${live(this.value)}\n ?autofocus=${this.autofocus}\n autocomplete=\"${ifDefined(this.autocomplete)}\"\n inputmode=\"${ifDefined(this.inputmode)}\"\n placeholder=\"${ifDefined(this.placeholder)}\"\n minlength=\"${ifDefined(this.minlength)}\"\n rows=\"${ifDefined(this.rows)}\"\n ?required=${this.required}\n ?disabled=${this.disabled}\n spellcheck=\"${this.spellchecker}\"\n @change=${this.changeHandler}\n @input=${this.inputHandler}\n @invalid=${this.onError}\n >\n </textarea>\n </fieldset>\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": "wcA0BA,IAAMA,EAAY,YAEZC,EAAgB,KAAOD,EAqHhBE,EAAWC,EAjHxB,cAAgCC,CAAAA,CAG9BC,YAAYC,EAAAA,CAAAA,IAAAA,EAEV,GADAC,MAAMD,CAAAA,EAEJA,EAASE,OAASC,EAASC,WAC3BJ,EAASK,OAAS,WACjBC,EAAAN,EA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EA0IU,yBAGrBsB,EAAA,CADPG,EAAM,GA5IYzB,EA6IX,kCA0FSsB,EAAA,CAAhBG,EAAM,GAvOYzB,EAuOF,qBAvOEA,EAArBsB,EAAA,CADCE,EAAc,aAAa,GACPxB",
6
+ "names": ["important", "importantFlag", "styleMap", "directive", "Directive", "constructor", "partInfo", "super", "type", "PartType", "ATTRIBUTE", "name", "_a", "strings", "length", "Error", "render", "styleInfo", "Object", "keys", "reduce", "style", "prop", "value", "includes", "replace", "toLowerCase", "update", "part", "element", "this", "_previousStyleProperties", "Set", "add", "forEach", "delete", "removeProperty", "isImportant", "endsWith", "setProperty", "slice", "noChange", "styles", "i", "bl_textarea_default", "BlTextarea", "FormControlMixin", "s", "bl_textarea_default", "_a", "event", "value", "changedProperties", "message", "scrollHeight", "maxLengthInvalid", "invalidMessage", "x", "helpMessage", "label", "characterCounterText", "characterCounter", "wrapperClasses", "styles", "o", "l", "textAreaValidators", "__decorateClass", "i", "e", "t"]
7
7
  }
@@ -0,0 +1,50 @@
1
+ import{a as f}from"./chunk-O7VPXMZW.js";import{a as m}from"./chunk-GRL4DWKG.js";import{a as v,b as n,c as p,e as u}from"./chunk-5MOOXA2X.js";import{a as c,b as r}from"./chunk-4OT5AMS5.js";import{d as i}from"./chunk-IZ2LK5GK.js";var b=c`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}.datepicker-input{width:var(--bl-datepicker-input-width, auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`,_=b;var e=class extends f{constructor(){super(...arguments);this.size="medium";this.labelFixed=!1;this.valueFormatter=null;this._inputValue="";this._selectedDates=[];this._floatingDateCount=0;this._fittingDateCount=0}static get styles(){return[_]}defaultInputValueFormatter(){if(this.type==="single")this._inputValue=this.formatDate(this._selectedDates[0]),this.closePopoverWithTimeout();else if(this.type==="multiple"){this.setFloatingDates();let t=this._selectedDates.slice(0,this._fittingDateCount).map(s=>this.formatDate(s));this._inputValue=t.join(",")+(this._floatingDateCount>0?" ,...":"")}else this.type==="range"&&(this._selectedDates[0]&&(this._inputValue=this.formatDate(this._selectedDates[0])),this._selectedDates[1]&&(this._inputValue=`${this._inputValue}-${this.formatDate(this._selectedDates[1])}`),this._selectedDates[0]&&this._selectedDates[1]&&this.closePopoverWithTimeout())}closePopoverWithTimeout(){setTimeout(()=>{this.closePopover(),this._inputEl.blur()},200)}setFloatingDates(){var a,l;let t=(a=this.shadowRoot)==null?void 0:a.getElementById("datepicker-input"),s=(l=this.shadowRoot)==null?void 0:l.getElementById("icon-container"),o=t.offsetWidth-s.offsetWidth;this._fittingDateCount=Math.floor(o/90),this._floatingDateCount=this._selectedDates.length-this._fittingDateCount}setDatePickerInput(t){t.length?(this._selectedDates=t,this.valueFormatter?this._inputValue=this.valueFormatter(this._selectedDates):this.defaultInputValueFormatter()):this._inputValue="",this._onBlDatepickerChange(this._selectedDates)}formatDate(t){return`${String(t==null?void 0:t.getDate()).padStart(2,"0")}/${String((t==null?void 0:t.getMonth())+1).padStart(2,"0")}/${t==null?void 0:t.getFullYear()}`}clearDatepicker(){this._selectedDates=[],this._inputValue="",this._floatingDateCount=0,this._calendarEl.handleClearSelectedDates()}openPopover(){this._popoverEl.target=this._inputEl,this._popoverEl.show()}closePopover(){this._popoverEl.hide()}_togglePopover(){this._popoverEl.visible?this.closePopover():this.openPopover()}formatAdditionalDates(t){let s=t.split(",");return s.reduce((o,a,l)=>(l>0&&l%3===0&&o.push(r`<br />`),o.push(r`<span>${a.trim()}${l<s.length-1?", ":""}</span>`),o),[])}async firstUpdated(){var t,s;this._onCalendarMouseDown=o=>{var a;o.preventDefault(),(a=this._inputEl)==null||a.focus()},this._onInputMouseDown=o=>{var a;o.preventDefault(),(a=this._inputEl)==null||a.focus()},(t=this._calendarEl)==null||t.addEventListener("mousedown",this._onCalendarMouseDown),(s=this._inputEl)==null||s.addEventListener("mousedown",this._onInputMouseDown),this._selectedDates&&this.setDatePickerInput(this._selectedDates)}updated(t){t.has("_selectedDates")&&this.setDatePickerInput(this._selectedDates)}disconnectedCallback(){var t,s;super.disconnectedCallback(),(t=this._calendarEl)==null||t.removeEventListener("mousedown",this._onCalendarMouseDown),(s=this._inputEl)==null||s.removeEventListener("mousedown",this._onInputMouseDown)}render(){var d;let t=r`
2
+ <bl-popover target="datepicker-content" placement="bottom-start">
3
+ <bl-calendar
4
+ type=${this.type}
5
+ .minDate=${this.minDate}
6
+ .maxDate=${this.maxDate}
7
+ .startOfWeek=${this.startOfWeek}
8
+ .disabledDates=${this.disabledDates}
9
+ .value=${this.value}
10
+ .locale=${this.locale}
11
+ @bl-calendar-change="${h=>this.setDatePickerInput(h.detail)}"
12
+ ></bl-calendar>
13
+ </bl-popover>
14
+ `,s=(d=this._selectedDates)==null?void 0:d.slice(this._fittingDateCount).map(h=>this.formatDate(h)).join(","),o=this.formatAdditionalDates(s),a=this._floatingDateCount>0?r` <bl-tooltip>
15
+ <span slot="tooltip-trigger">+${this._floatingDateCount}</span>
16
+ <div>${o}</div>
17
+ </bl-tooltip>`:"",l=this._selectedDates.length>0?r` <bl-button
18
+ size="small"
19
+ variant="tertiary"
20
+ kind="neutral"
21
+ icon="close"
22
+ @click=${this.clearDatepicker}
23
+ ></bl-button>
24
+ <div class="action-divider"></div>`:"";return r`
25
+ <div class="datepicker-content" id="datepicker-content" tabindex="-1">
26
+ <bl-input
27
+ .value="${this._inputValue}"
28
+ .label="${this.label}"
29
+ placeholder="${this.placeholder}"
30
+ class="datepicker-input"
31
+ role="button"
32
+ id="datepicker-input"
33
+ aria-haspopup="listbox"
34
+ aria-labelledby="label"
35
+ @click=${this._togglePopover}
36
+ help-text=${this.helpText}
37
+ ?disabled=${this.disabled}
38
+ .size=${this.size}
39
+ .labelFixed=${this.labelFixed}
40
+ readonly
41
+ >
42
+ <div slot="icon" class="icon-container" id="icon-container">
43
+ ${a} ${l}
44
+ <bl-icon name="calendar" size="small" class="calendar-icon"></bl-icon>
45
+ </div>
46
+ </bl-input>
47
+ ${t}
48
+ </div>
49
+ `}};i([n({type:String,attribute:"placeholder",reflect:!0})],e.prototype,"placeholder",2),i([n({type:String,reflect:!0})],e.prototype,"size",2),i([n({type:Boolean,attribute:"label-fixed",reflect:!0})],e.prototype,"labelFixed",2),i([n({type:String,attribute:"label",reflect:!0})],e.prototype,"label",2),i([n({type:Function,attribute:"value-formatter"})],e.prototype,"valueFormatter",2),i([n({type:Boolean})],e.prototype,"disabled",2),i([n({type:String,attribute:"help-text",reflect:!0})],e.prototype,"helpText",2),i([p()],e.prototype,"_inputValue",2),i([p()],e.prototype,"_selectedDates",2),i([p()],e.prototype,"_floatingDateCount",2),i([p()],e.prototype,"_fittingDateCount",2),i([u("bl-calendar")],e.prototype,"_calendarEl",2),i([u("bl-popover")],e.prototype,"_popoverEl",2),i([u("bl-input")],e.prototype,"_inputEl",2),i([m("bl-datepicker-change")],e.prototype,"_onBlDatepickerChange",2),e=i([v("bl-datepicker")],e);export{e as a};
50
+ //# sourceMappingURL=chunk-P7PNSS73.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/datepicker/bl-datepicker.css", "../src/components/datepicker/bl-datepicker.ts"],
4
+ "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}.datepicker-input{width:var(--bl-datepicker-input-width, auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`;\nexport default styles;\n", "import { CSSResultGroup, html, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { BlCalendar, BlPopover } from \"../../baklava\";\nimport DatepickerCalendarMixin from \"../../mixins/datepicker-calendar-mixin/datepicker-calendar-mixin\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../calendar/bl-calendar\";\nimport { CALENDAR_TYPES } from \"../calendar/bl-calendar.constant\";\nimport \"../input/bl-input\";\nimport BlInput, { InputSize } from \"../input/bl-input\";\nimport \"../tooltip/bl-tooltip\";\nimport style from \"./bl-datepicker.css\";\n\n/**\n * @tag bl-datepicker\n * @summary Baklava DatePicker component\n *\n * @cssproperty [--bl-datepicker-input-width] - Sets the width of datepicker input\n **/\n@customElement(\"bl-datepicker\")\nexport default class BlDatepicker extends DatepickerCalendarMixin {\n /**\n * Defines the datepicker input placeholder\n */\n @property({ type: String, attribute: \"placeholder\", reflect: true })\n placeholder: string;\n /**\n * Sets input size.\n */\n @property({ type: String, reflect: true })\n size?: InputSize = \"medium\";\n\n /**\n * Makes datepicker input label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n /**\n * Defines the datepicker input label\n */\n @property({ type: String, attribute: \"label\", reflect: true })\n label: string;\n /**\n * Defines the custom formatter function\n */\n @property({ type: Function, attribute: \"value-formatter\" })\n valueFormatter: ((dates: Date[]) => string) | null = null;\n /**\n * Sets datepicker to disabled\n */\n @property({ type: Boolean })\n disabled: boolean;\n /**\n * Defines help text to datepicker input for users\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText: string;\n\n @state()\n _inputValue = \"\";\n\n @state()\n _selectedDates: Date[] = [];\n\n @state()\n _floatingDateCount: number = 0;\n\n @state()\n _fittingDateCount: number = 0;\n\n @query(\"bl-calendar\")\n _calendarEl: BlCalendar;\n\n @query(\"bl-popover\")\n _popoverEl: BlPopover;\n\n @query(\"bl-input\")\n _inputEl!: BlInput;\n\n private _onCalendarMouseDown!: (event: MouseEvent) => void;\n private _onInputMouseDown!: (event: MouseEvent) => void;\n\n /**\n * Fires when date selection is changed\n */\n @event(\"bl-datepicker-change\") private _onBlDatepickerChange: EventDispatcher<Date[]>;\n\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n defaultInputValueFormatter() {\n if (this.type === CALENDAR_TYPES.SINGLE) {\n this._inputValue = this.formatDate(this._selectedDates[0]);\n this.closePopoverWithTimeout();\n } else if (this.type === CALENDAR_TYPES.MULTIPLE) {\n this.setFloatingDates();\n const values = this._selectedDates\n .slice(0, this._fittingDateCount)\n .map(date => this.formatDate(date));\n\n this._inputValue = values.join(\",\") + (this._floatingDateCount > 0 ? \" ,...\" : \"\");\n } else if (this.type === CALENDAR_TYPES.RANGE) {\n if (this._selectedDates[0]) this._inputValue = this.formatDate(this._selectedDates[0]);\n if (this._selectedDates[1])\n this._inputValue = `${this._inputValue}-${this.formatDate(this._selectedDates[1])}`;\n if (this._selectedDates[0] && this._selectedDates[1]) this.closePopoverWithTimeout();\n }\n }\n\n closePopoverWithTimeout() {\n setTimeout(() => {\n this.closePopover();\n this._inputEl.blur();\n }, 200);\n }\n\n setFloatingDates() {\n const datepickerInput = this.shadowRoot?.getElementById(\"datepicker-input\");\n const iconsContainer = this.shadowRoot?.getElementById(\"icon-container\");\n const datesTextTotalWidth = datepickerInput!.offsetWidth! - iconsContainer!.offsetWidth!;\n\n this._fittingDateCount = Math.floor(datesTextTotalWidth / 90);\n\n this._floatingDateCount = this._selectedDates.length - this._fittingDateCount;\n }\n\n setDatePickerInput(dates: Date[] | []) {\n if (!dates.length) {\n this._inputValue = \"\";\n } else {\n this._selectedDates = dates;\n if (this.valueFormatter) {\n this._inputValue = this.valueFormatter(this._selectedDates);\n } else {\n this.defaultInputValueFormatter();\n }\n }\n\n this._onBlDatepickerChange(this._selectedDates);\n }\n\n formatDate(date: Date): string {\n return `${String(date?.getDate()).padStart(2, \"0\")}/${String(date?.getMonth() + 1).padStart(\n 2,\n \"0\"\n )}/${date?.getFullYear()}`;\n }\n\n clearDatepicker() {\n this._selectedDates = [];\n this._inputValue = \"\";\n this._floatingDateCount = 0;\n this._calendarEl.handleClearSelectedDates();\n }\n\n openPopover() {\n this._popoverEl.target = this._inputEl;\n this._popoverEl.show();\n }\n\n closePopover() {\n this._popoverEl.hide();\n }\n\n _togglePopover() {\n this._popoverEl.visible ? this.closePopover() : this.openPopover();\n }\n\n formatAdditionalDates(str: string): TemplateResult[] {\n const parts = str.split(\",\");\n\n return parts.reduce<TemplateResult[]>((acc, part, index) => {\n if (index > 0 && index % 3 === 0) {\n acc.push(html`<br />`);\n }\n acc.push(html`<span>${part.trim()}${index < parts.length - 1 ? \", \" : \"\"}</span>`);\n return acc;\n }, []);\n }\n\n async firstUpdated() {\n this._onCalendarMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._onInputMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._calendarEl?.addEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.addEventListener(\"mousedown\", this._onInputMouseDown);\n\n if (this._selectedDates) {\n this.setDatePickerInput(this._selectedDates);\n }\n }\n\n updated(changedProperties: PropertyValues) {\n if (changedProperties.has(\"_selectedDates\")) {\n this.setDatePickerInput(this._selectedDates);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._calendarEl?.removeEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.removeEventListener(\"mousedown\", this._onInputMouseDown);\n }\n\n render() {\n const renderCalendar = html`\n <bl-popover target=\"datepicker-content\" placement=\"bottom-start\">\n <bl-calendar\n type=${this.type}\n .minDate=${this.minDate}\n .maxDate=${this.maxDate}\n .startOfWeek=${this.startOfWeek}\n .disabledDates=${this.disabledDates}\n .value=${this.value}\n .locale=${this.locale}\n @bl-calendar-change=\"${(event: CustomEvent) => this.setDatePickerInput(event.detail)}\"\n ></bl-calendar>\n </bl-popover>\n `;\n const additionalDates = this._selectedDates\n ?.slice(this._fittingDateCount)\n .map(date => {\n return this.formatDate(date);\n })\n .join(\",\");\n\n const formattedAdditionalDates = this.formatAdditionalDates(additionalDates);\n\n const additionalDatesView =\n this._floatingDateCount > 0\n ? html` <bl-tooltip>\n <span slot=\"tooltip-trigger\">+${this._floatingDateCount}</span>\n <div>${formattedAdditionalDates}</div>\n </bl-tooltip>`\n : \"\";\n\n const clearDatepickerButton =\n this._selectedDates.length > 0\n ? html` <bl-button\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this.clearDatepicker}\n ></bl-button>\n <div class=\"action-divider\"></div>`\n : \"\";\n\n return html`\n <div class=\"datepicker-content\" id=\"datepicker-content\" tabindex=\"-1\">\n <bl-input\n .value=\"${this._inputValue}\"\n .label=\"${this.label}\"\n placeholder=\"${this.placeholder}\"\n class=\"datepicker-input\"\n role=\"button\"\n id=\"datepicker-input\"\n aria-haspopup=\"listbox\"\n aria-labelledby=\"label\"\n @click=${this._togglePopover}\n help-text=${this.helpText}\n ?disabled=${this.disabled}\n .size=${this.size}\n .labelFixed=${this.labelFixed}\n readonly\n >\n <div slot=\"icon\" class=\"icon-container\" id=\"icon-container\">\n ${additionalDatesView} ${clearDatepickerButton}\n <bl-icon name=\"calendar\" size=\"small\" class=\"calendar-icon\"></bl-icon>\n </div>\n </bl-input>\n ${renderCalendar}\n </div>\n `;\n }\n}\n"],
5
+ "mappings": "oOACO,IAAMA,EAASC,izBACfC,EAAQF,ECiBf,IAAqBG,EAArB,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A,UAI3BJ;AAAA;AAAA,KAGR,CACF,EAlQEK,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,QAAS,EAAK,CAAC,GAJhDzB,EAKnB,2BAKAwB,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GATtBzB,EAUnB,oBAMAwB,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,UAAW,cAAe,QAAS,EAAK,CAAC,GAfjDzB,EAgBnB,0BAKAwB,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,QAAS,QAAS,EAAK,CAAC,GApB1CzB,EAqBnB,qBAKAwB,EAAA,CADCC,EAAS,CAAE,KAAM,SAAU,UAAW,iBAAkB,CAAC,GAzBvCzB,EA0BnB,8BAKAwB,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,CAAC,GA9BRzB,EA+BnB,wBAKAwB,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,YAAa,QAAS,EAAK,CAAC,GAnC9CzB,EAoCnB,wBAGAwB,EAAA,CADCE,EAAM,GAtCY1B,EAuCnB,2BAGAwB,EAAA,CADCE,EAAM,GAzCY1B,EA0CnB,8BAGAwB,EAAA,CADCE,EAAM,GA5CY1B,EA6CnB,kCAGAwB,EAAA,CADCE,EAAM,GA/CY1B,EAgDnB,iCAGAwB,EAAA,CADCG,EAAM,aAAa,GAlDD3B,EAmDnB,2BAGAwB,EAAA,CADCG,EAAM,YAAY,GArDA3B,EAsDnB,0BAGAwB,EAAA,CADCG,EAAM,UAAU,GAxDE3B,EAyDnB,wBAQuCwB,EAAA,CAAtCP,EAAM,sBAAsB,GAjEVjB,EAiEoB,qCAjEpBA,EAArBwB,EAAA,CADCC,EAAc,eAAe,GACTzB",
6
+ "names": ["styles", "i", "bl_datepicker_default", "BlDatepicker", "DatepickerCalendarMixin", "bl_datepicker_default", "values", "date", "_a", "_b", "datepickerInput", "iconsContainer", "datesTextTotalWidth", "dates", "str", "parts", "acc", "part", "index", "x", "event", "changedProperties", "renderCalendar", "additionalDates", "formattedAdditionalDates", "additionalDatesView", "clearDatepickerButton", "__decorateClass", "e", "t", "i"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-7TWNQK6I.js";import"../../chunk-AW5LBSEM.js";import"../../chunk-47S2NIWC.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-2I4NXKV5.js";import"../../chunk-MND5TXTF.js";import"../../chunk-O7VPXMZW.js";import"../../chunk-WEEGH2F4.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-VU6LRFZR.js";import"../../chunk-IGNJQVQF.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
1
+ import{a}from"../../chunk-P7PNSS73.js";import"../../chunk-AW5LBSEM.js";import"../../chunk-47S2NIWC.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-55I5ZGJ7.js";import"../../chunk-23PSWIUF.js";import"../../chunk-O7VPXMZW.js";import"../../chunk-WEEGH2F4.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-VU6LRFZR.js";import"../../chunk-IGNJQVQF.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-HBPBDC7T.js";import"../../chunk-DINNT5P2.js";import"../../chunk-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
2
2
  //# sourceMappingURL=bl-datepicker.js.map
@@ -21,12 +21,7 @@ export default class BlInput extends BlInput_base {
21
21
  slotAssignment?: SlotAssignmentMode | undefined;
22
22
  customElements?: CustomElementRegistry | undefined;
23
23
  };
24
- static formControlValidators: {
25
- key: keyof ValidityState;
26
- isValid(instance: HTMLElement & {
27
- validationTarget: HTMLInputElement;
28
- }): boolean;
29
- }[];
24
+ static formControlValidators: import("@open-wc/form-control").SyncValidator[];
30
25
  validationTarget: HTMLInputElement;
31
26
  /**
32
27
  * Sets name of the input
@@ -114,9 +109,14 @@ export default class BlInput extends BlInput_base {
114
109
  labelFixed: boolean;
115
110
  /**
116
111
  * Overrides error message. This message will override default error messages
112
+ * @deprecated use setCustomValidity instead
117
113
  */
118
114
  set customInvalidText(value: string);
115
+ /**
116
+ * @deprecated
117
+ */
119
118
  get customInvalidText(): string;
119
+ error: string;
120
120
  private _customInvalidText;
121
121
  /**
122
122
  * Adds help text
@@ -142,12 +142,19 @@ export default class BlInput extends BlInput_base {
142
142
  private textVisibilityToggle;
143
143
  showPicker(): void;
144
144
  validityCallback(): string | void;
145
+ /**
146
+ * Sets a custom validity on the form element.
147
+ * @param message
148
+ */
149
+ setCustomValidity(message: string): void;
145
150
  /**
146
151
  * Force to set input as in invalid state.
152
+ * @deprecated use error attribute instead
147
153
  */
148
154
  forceCustomError(): Promise<void>;
149
155
  /**
150
156
  * Clear forced invalid state
157
+ * @deprecated use error attribute instead
151
158
  */
152
159
  clearCustomError(): Promise<void>;
153
160
  reportValidity(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"bl-input.d.ts","sourceRoot":"","sources":["../../../src/components/input/bl-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAOvF,OAAO,4BAA4B,CAAC;AAGpC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,iBAAiB,CAAC;AACzB,OAA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B,EAAE,cAAc;IAczD,OAAO,CAAC,OAAO,CAA2C;IAE1D,OAAO,KAAK,YAAY,GAEvB;IAED,MAAM,IAAI,cAAc;CAoFzB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-2I4NXKV5.js";import"../../chunk-MND5TXTF.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-VU6LRFZR.js";import"../../chunk-IGNJQVQF.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
1
+ import{a}from"../../chunk-55I5ZGJ7.js";import"../../chunk-23PSWIUF.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-VU6LRFZR.js";import"../../chunk-IGNJQVQF.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-HBPBDC7T.js";import"../../chunk-DINNT5P2.js";import"../../chunk-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
2
2
  //# sourceMappingURL=bl-input.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-5VEXMTA4.js";import"../../chunk-OAF3R4PW.js";import"../../chunk-WXWKIQAK.js";import"../../chunk-IPYZIIRV.js";import"../../chunk-FTQX7CEW.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-2I4NXKV5.js";import"../../chunk-MND5TXTF.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-VU6LRFZR.js";import"../../chunk-IGNJQVQF.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-HBPBDC7T.js";import"../../chunk-ECPWEUBG.js";import"../../chunk-DINNT5P2.js";import"../../chunk-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
1
+ import{a}from"../../chunk-5VEXMTA4.js";import"../../chunk-OAF3R4PW.js";import"../../chunk-WXWKIQAK.js";import"../../chunk-IPYZIIRV.js";import"../../chunk-FTQX7CEW.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-55I5ZGJ7.js";import"../../chunk-23PSWIUF.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-VU6LRFZR.js";import"../../chunk-IGNJQVQF.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-HBPBDC7T.js";import"../../chunk-ECPWEUBG.js";import"../../chunk-DINNT5P2.js";import"../../chunk-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
2
2
  //# sourceMappingURL=bl-pagination.js.map
@@ -14,23 +14,9 @@ export default class BlTextarea extends BlTextarea_base {
14
14
  slotAssignment?: SlotAssignmentMode | undefined;
15
15
  customElements?: CustomElementRegistry | undefined;
16
16
  };
17
- static formControlValidators: ({
18
- key: keyof ValidityState;
19
- isValid(instance: HTMLElement & {
20
- validationTarget: HTMLInputElement;
21
- }): boolean;
22
- } | {
23
- isValid(instance: HTMLElement & {
24
- validationTarget: HTMLTextAreaElement; /**
25
- * @tag bl-textarea
26
- * @summary Baklava Textarea component
27
- */
28
- }): boolean;
29
- attribute?: string | string[] | undefined;
30
- key?: keyof ValidityState | undefined;
31
- message: string | import("@open-wc/form-control").validationMessageCallback;
32
- })[];
17
+ static formControlValidators: import("@open-wc/form-control").SyncValidator[];
33
18
  validationTarget: HTMLTextAreaElement;
19
+ error: string;
34
20
  /**
35
21
  * Name of textarea
36
22
  */
@@ -122,6 +108,11 @@ export default class BlTextarea extends BlTextarea_base {
122
108
  private changeHandler;
123
109
  firstUpdated(): void;
124
110
  protected updated(changedProperties: PropertyValues): Promise<void>;
111
+ /**
112
+ * Sets a custom validity on the form element.
113
+ * @param message
114
+ */
115
+ setCustomValidity(message: string): void;
125
116
  reportValidity(): boolean;
126
117
  valueChangedCallback(value: string): void;
127
118
  validityCallback(): string | void;
@@ -1 +1 @@
1
- {"version":3,"file":"bl-textarea.d.ts","sourceRoot":"","sources":["../../../src/components/textarea/bl-textarea.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAOvF,OAAO,4BAA4B,CAAC;AAKpC,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;;AACxD;;;GAGG;AAEH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,eAA4B;IAClE,MAAM,KAAK,MAAM,IAAI,cAAc,CAElC;IACD,MAAM,CAAC,iBAAiB;;;;;MAA6D;IAErF,MAAM,CAAC,qBAAqB;;;;;;;mDAX9B;;;eAGG;;;;;SAQiD;IAGlD,gBAAgB,EAAE,mBAAmB,CAAC;IAEtC;;OAEG;IAEH,IAAI,SAAM;IAEV;;OAEG;IAEH,QAAQ,UAAS;IA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js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
1
+ import{a}from"../../chunk-KBNVATXF.js";import"../../chunk-23PSWIUF.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
2
2
  //# sourceMappingURL=bl-textarea.js.map
@@ -1509,6 +1509,13 @@
1509
1509
  },
1510
1510
  "fieldName": "customInvalidText"
1511
1511
  },
1512
+ {
1513
+ "name": "error",
1514
+ "type": {
1515
+ "text": "string"
1516
+ },
1517
+ "fieldName": "error"
1518
+ },
1512
1519
  {
1513
1520
  "name": "help-text",
1514
1521
  "type": {
@@ -3169,6 +3176,13 @@
3169
3176
  }
3170
3177
  ],
3171
3178
  "attributes": [
3179
+ {
3180
+ "name": "error",
3181
+ "type": {
3182
+ "text": "string"
3183
+ },
3184
+ "fieldName": "error"
3185
+ },
3172
3186
  {
3173
3187
  "name": "name",
3174
3188
  "type": {
@@ -1,5 +1,6 @@
1
1
  export declare const templates: {
2
2
  s144508ac0e146c46: string;
3
+ s3f9c368cd44f682b: string;
3
4
  s5d929ff1619ac0c9: string;
4
5
  s716a6024e3fe999c: string;
5
6
  s76ddb3a843ed8e06: string;
@@ -1 +1 @@
1
- {"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/tr.ts"],"names":[],"mappings":"AAUI,eAAO,MAAM,SAAS;;;;;;;CAOrB,CAAC"}
1
+ {"version":3,"file":"tr.d.ts","sourceRoot":"","sources":["../../../src/generated/locales/tr.ts"],"names":[],"mappings":"AAUI,eAAO,MAAM,SAAS;;;;;;;;CAQrB,CAAC"}
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-XDCNO7EY.js";import"../../chunk-IZ2LK5GK.js";export{a as templates};
1
+ import{a}from"../../chunk-7F6RR2JV.js";import"../../chunk-IZ2LK5GK.js";export{a as templates};
2
2
  //# sourceMappingURL=tr.js.map
@@ -1,2 +1,2 @@
1
- import{b as s}from"./chunk-HBPBDC7T.js";import{a as i,b as l,c as n}from"./chunk-DNSU2ZXO.js";import{b as c}from"./chunk-XDCNO7EY.js";import"./chunk-IZ2LK5GK.js";var g=new Map([["tr",c]]),{setLocale:u}=s({sourceLocale:i,targetLocales:l,loadLocale:async e=>g.get(e)}),L=async()=>{let e=document.querySelector("html"),o=e==null?void 0:e.getAttribute("lang");o&&n.includes(o)&&await u(o);let r=t=>{t.forEach(d=>{if(d.attributeName==="lang"){let a=e==null?void 0:e.getAttribute("lang");a&&n.includes(a)&&u(a)}})};typeof MutationObserver<"u"?new MutationObserver(r).observe(e,{attributes:!0}):e==null||e.addEventListener("DOMAttrModified",t=>r([t]))},M=L();export{M as default,L as init};
1
+ import{b as s}from"./chunk-HBPBDC7T.js";import{a as i,b as l,c as n}from"./chunk-DNSU2ZXO.js";import{b as c}from"./chunk-7F6RR2JV.js";import"./chunk-IZ2LK5GK.js";var g=new Map([["tr",c]]),{setLocale:u}=s({sourceLocale:i,targetLocales:l,loadLocale:async e=>g.get(e)}),L=async()=>{let e=document.querySelector("html"),o=e==null?void 0:e.getAttribute("lang");o&&n.includes(o)&&await u(o);let r=t=>{t.forEach(d=>{if(d.attributeName==="lang"){let a=e==null?void 0:e.getAttribute("lang");a&&n.includes(a)&&u(a)}})};typeof MutationObserver<"u"?new MutationObserver(r).observe(e,{attributes:!0}):e==null||e.addEventListener("DOMAttrModified",t=>r([t]))},M=L();export{M as default,L as init};
2
2
  //# sourceMappingURL=localization.js.map
@@ -1,9 +1,5 @@
1
- export declare const innerInputValidators: {
2
- key: keyof ValidityState;
3
- isValid(instance: HTMLElement & {
4
- validationTarget: HTMLInputElement;
5
- }): boolean;
6
- }[];
1
+ import { SyncValidator } from "@open-wc/form-control";
2
+ export declare const innerInputValidators: SyncValidator[];
7
3
  export declare const textareaLengthValidator: {
8
4
  isValid(instance: HTMLElement & {
9
5
  validationTarget: HTMLTextAreaElement;
@@ -19,17 +15,5 @@ export declare const textareaLengthValidator: {
19
15
  key?: keyof ValidityState | undefined;
20
16
  message: string | import("@open-wc/form-control").validationMessageCallback;
21
17
  };
22
- export declare const textAreaValidators: ({
23
- key: keyof ValidityState;
24
- isValid(instance: HTMLElement & {
25
- validationTarget: HTMLInputElement;
26
- }): boolean;
27
- } | {
28
- isValid(instance: HTMLElement & {
29
- validationTarget: HTMLTextAreaElement;
30
- }): boolean;
31
- attribute?: string | string[] | undefined;
32
- key?: keyof ValidityState | undefined;
33
- message: string | import("@open-wc/form-control").validationMessageCallback;
34
- })[];
18
+ export declare const textAreaValidators: SyncValidator[];
35
19
  //# sourceMappingURL=form-control.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-control.d.ts","sourceRoot":"","sources":["../../src/utilities/form-control.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,oBAAoB;;sBAEb,WAAW,GAAG;QAAE,gBAAgB,EAAE,gBAAgB,CAAA;KAAE;GAMrE,CAAC;AAEJ,eAAO,MAAM,uBAAuB;sBAEhB,WAAW,GAAG;QAAE,gBAAgB,EAAE,mBAAmB,CAAA;KAAE;;;;;sBAAvD,WAAW,GAAG;QAAE,gBAAgB,EAAE,mBAAmB,CAAA;KAAE;;;;CAM1E,CAAC;AAEF,eAAO,MAAM,kBAAkB;;sBAlBX,WAAW,GAAG;QAAE,gBAAgB,EAAE,gBAAgB,CAAA;KAAE;;sBAUpD,WAAW,GAAG;QAAE,gBAAgB,EAAE,mBAAmB,CAAA;KAAE;;;;IAQS,CAAC"}
1
+ {"version":3,"file":"form-control.d.ts","sourceRoot":"","sources":["../../src/utilities/form-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAsB,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAc1E,eAAO,MAAM,oBAAoB,EAAE,aAAa,EAS7C,CAAC;AAqBJ,eAAO,MAAM,uBAAuB;sBAEhB,WAAW,GAAG;QAAE,gBAAgB,EAAE,mBAAmB,CAAA;KAAE;;;;;sBAAvD,WAAW,GAAG;QAAE,gBAAgB,EAAE,mBAAmB,CAAA;KAAE;;;;CAM1E,CAAC;AAEF,eAAO,MAAM,kBAAkB,iBAAqD,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@trendyol/baklava",
3
3
  "type": "module",
4
- "version": "3.3.0-beta.14",
4
+ "version": "3.3.0-beta.15",
5
5
  "description": "Trendyol Baklava Design System",
6
6
  "main": "dist/baklava.js",
7
7
  "module": "dist/baklava.js",
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/components/input/bl-input.css", "../src/components/input/bl-input.ts"],
4
- "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:inline-block;width:200px;position:relative}.wrapper{--border-color:var(--bl-color-neutral-lighter);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--height:var(--bl-size-2xl);--input-font:var(--bl-font-body-text-2);--line-height:var(--bl-font-body-text-2-line-height);--icon-size:var(--line-height);--icon-gap:var(--bl-size-xs);--padding-vertical:calc((var(--height) - var(--line-height)) / 2);--padding-horizontal:var(--bl-size-xs);--autofill-bg-color:var(--bl-color-primary-contrast);--label-padding:var(--bl-size-3xs);--background-color:var(--bl-color-neutral-full);display:grid;position:relative;gap:var(--bl-size-3xs)}.wrapper:focus-within{--border-color:var(--bl-color-primary);--icon-color:var(--bl-color-primary)}.wrapper.dirty.invalid{--border-color:var(--bl-color-danger);--icon-color:var(--bl-color-danger)}:host([size=\"large\"]) .wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m);--icon-gap:var(--bl-size-m)}:host([size=\"small\"]) .wrapper{--height:var(--bl-size-xl);--input-font:var(--bl-font-body-text-3);--padding-vertical:var(--bl-size-3xs);--icon-size:var(--bl-font-body-text-3-line-height);--icon-gap:var(--bl-size-2xs)}.input-wrapper{--border-size:1px;outline:none;display:flex;box-sizing:border-box;gap:var(--padding-vertical);height:var(--height);border:solid var(--border-size) var(--border-color);padding:0 calc(\n var(--bl-input-padding-end, var(--padding-horizontal)) - var(--label-padding) -\n var(--border-size)\n ) 0 calc(\n var(--bl-input-padding-start, var(--padding-horizontal)) - var(--label-padding) -\n var(--border-size)\n );background-color:var(--background-color);border-radius:var(--bl-size-3xs);margin:0;width:0;min-width:100%}:host([disabled]) .wrapper{cursor:not-allowed;--background-color:var(--bl-color-neutral-lightest);--text-color:var(--bl-color-neutral-light)}.wrapper:has(input:autofill){--background-color:var(--autofill-bg-color)}.wrapper:has(input:-webkit-autofill){--background-color:var(--autofill-bg-color)}.input-wrapper legend,label{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;max-width:max-content;transition:all ease-in 0.1s;font:var(--input-font);top:var(--padding-vertical);inset-inline-start:var(--bl-input-padding-start, var(--padding-horizontal));inset-inline-end:var(--bl-input-padding-end, var(--padding-horizontal));pointer-events:none;color:var(--bl-color-neutral-light)}.has-icon label{inset-inline-end:calc(\n var(--bl-input-padding-end, var(--padding-horizontal)) + var(--icon-size) +\n var(--padding-vertical)\n )}.input-wrapper legend{height:0;visibility:hidden;display:none}.input-wrapper legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}input{width:100%;align-self:stretch;outline:0;border:0;padding:0 0 0 var(--label-padding);font:var(--input-font);color:var(--text-color);-webkit-text-fill-color:var(--text-color);background-color:transparent;cursor:var(--bl-input-cursor, unset)}input::-webkit-credentials-auto-fill-button{color:red}:where(.wrapper:focus-within, .wrapper.has-value) input{padding-inline-start:var(--label-padding)}input:disabled{cursor:not-allowed}input::-webkit-calendar-picker-indicator{display:none}input::-moz-calendar-picker-indicator{display:none}input:autofill{background-color:var(--autofill-bg-color);/**\n * Some browsers doesn't allow setting background-color\n * https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill\n */box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}input:-webkit-autofill{background-color:var(--autofill-bg-color);/**\n * Some browsers doesn't allow setting background-color\n * https://developer.mozilla.org/en-US/docs/Web/CSS/:autofill\n */box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}.icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;height:var(--icon-size);margin-inline-end:var(--label-padding)}bl-icon:not(.reveal-icon),::slotted(bl-icon){font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.reveal-button bl-icon{display:none}bl-icon[name=\"eye_on\"]{display:inline-block}.password-visible bl-icon[name=\"eye_on\"]{display:none}.password-visible bl-icon[name=\"eye_off\"]{display:inline-block}.wrapper:not(.has-icon) .icon{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}::placeholder{color:var(--bl-color-neutral-light);-webkit-text-fill-color:var(--bl-color-neutral-light)}:host([label]) ::placeholder{color:transparent;-webkit-text-fill-color:transparent;transition:color ease-out 0.4s}:host([label-fixed]) ::placeholder,:host :focus-within ::placeholder{color:var(--bl-color-neutral-light);-webkit-text-fill-color:var(--bl-color-neutral-light)}:host([label-fixed]) label{position:static;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);padding:0}:host([label-fixed]) legend{display:none}:host(:not([label-fixed])) :focus-within label,:host(:not([label-fixed])) .has-value label{top:0;inset-inline-start:calc(\n var(--bl-input-padding-start, var(--padding-horizontal)) - var(--label-padding)\n );inset-inline-end:calc(\n var(--bl-input-padding-end, var(--padding-horizontal)) - var(--label-padding)\n );transform:translateY(-50%);font:var(--bl-font-caption);color:var(--bl-color-neutral-dark);padding:0 var(--label-padding);pointer-events:initial;z-index:var(--bl-index-base)}:host([label]:not([label-fixed])) :where(:focus-within, .has-value) legend{max-width:100%;font:var(--bl-font-caption);display:block}.error-icon,.invalid-text{display:none}.dirty.invalid label,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}:host([help-text]) .hint,.dirty.invalid .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.dirty.invalid .error-icon{display:inline-block}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult, PropertyValues } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { live } from \"lit/directives/live.js\";\nimport { FormControlMixin } from \"@open-wc/form-control\";\nimport { submit } from \"@open-wc/form-helpers\";\nimport \"element-internals-polyfill\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { innerInputValidators } from \"../../utilities/form-control\";\nimport \"../button/bl-button\";\nimport \"../icon/bl-icon\";\nimport { BaklavaIcon } from \"../icon/icon-list\";\nimport style from \"./bl-input.css\";\n\nexport type InputType =\n | \"text\"\n | \"email\"\n | \"date\"\n | \"time\"\n | \"datetime-local\"\n | \"month\"\n | \"week\"\n | \"password\"\n | \"number\"\n | \"tel\"\n | \"url\"\n | \"search\";\n\nconst inputTypeIcons: Partial<Record<InputType, BaklavaIcon>> = {\n \"date\": \"calendar\",\n \"datetime-local\": \"calendar\",\n \"month\": \"calendar\",\n \"week\": \"calendar\",\n \"time\": \"clock\",\n \"search\": \"search\",\n};\n\nexport type InputSize = \"small\" | \"medium\" | \"large\";\n/**\n * @tag bl-input\n * @summary Baklava Input component\n *\n * @cssproperty [--bl-input-padding-start] Sets the padding start\n * @cssproperty [--bl-input-padding-end] Sets the padding end\n */\n@customElement(\"bl-input\")\nexport default class BlInput extends FormControlMixin(LitElement) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static formControlValidators = innerInputValidators;\n\n @query(\"input\")\n validationTarget: HTMLInputElement;\n\n /**\n * Sets name of the input\n */\n @property({ reflect: true })\n name?: string;\n\n /**\n * Type of the input. It's used to set `type` attribute of native input inside.\n */\n @property({ reflect: true })\n type: InputType = \"text\";\n\n /**\n * Sets label of the input\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Sets placeholder of the input\n */\n @property({ reflect: true })\n placeholder?: string;\n\n /**\n * Sets initial value of the input\n */\n @property({ reflect: true })\n value = \"\";\n\n /**\n * Makes input a mandatory field\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Sets minimum length of the input\n */\n @property({ type: Number, reflect: true })\n minlength?: number;\n\n /**\n * Sets maximum length of the input\n */\n @property({ type: Number, reflect: true })\n maxlength?: number;\n\n /**\n * Sets the minimum acceptable value for the input\n */\n @property({ reflect: true })\n min?: number | string;\n\n /**\n * Sets the loading value for the input\n */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /**\n * Sets the maximum acceptable value for the input\n */\n @property({ reflect: true })\n max?: number | string;\n\n /**\n * Sets a regex pattern form the input validation\n */\n @property({ type: String, reflect: true })\n pattern?: string;\n\n /**\n * Sets the increase and decrease step to a `number` input\n */\n @property({ type: Number, reflect: true })\n step?: number;\n\n /**\n * Hints browser to autocomplete this field.\n */\n @property({ type: String, reflect: true })\n autocomplete: HTMLInputElement[\"autocomplete\"] = \"on\";\n\n /**\n * Sets the input mode of the field for asking browser to show the desired keyboard.\n */\n @property({ type: String, reflect: true })\n inputmode: HTMLInputElement[\"inputMode\"];\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Sets the custom icon name. `bl-icon` component is used to show an icon\n */\n @property({ type: String, reflect: true })\n icon?: BaklavaIcon;\n\n /**\n * Sets input size.\n */\n @property({ type: String, reflect: true })\n size?: InputSize = \"medium\";\n\n /**\n * Disables the input\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Makes the input readonly.\n */\n @property({ type: Boolean, reflect: true })\n readonly = false;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n\n /**\n * Overrides error message. This message will override default error messages\n */\n @property({ type: String, attribute: \"invalid-text\", reflect: true })\n set customInvalidText(value: string) {\n this._customInvalidText = value;\n this.setValue(this.value);\n }\n\n get customInvalidText(): string {\n return this._customInvalidText;\n }\n\n private _customInvalidText: string;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText?: string;\n\n /**\n * Fires when an alteration to the element's value is committed by the user. Unlike the input event, the change event is not necessarily fired for each alteration to an element's value.\n */\n @event(\"bl-change\") private onChange: EventDispatcher<string>;\n\n /**\n * Fires when the value of an input element has been changed.\n */\n @event(\"bl-input\") private onInput: EventDispatcher<string>;\n\n /**\n * Fires when the value of an input element has been changed.\n */\n @event(\"bl-invalid\") private onInvalid: EventDispatcher<ValidityState>;\n\n connectedCallback(): void {\n super.connectedCallback();\n this.addEventListener(\"keydown\", this.onKeydown);\n\n this.form?.addEventListener(\"submit\", () => {\n this.reportValidity();\n });\n }\n\n disconnectedCallback(): void {\n super.disconnectedCallback();\n this.removeEventListener(\"keydown\", this.onKeydown);\n }\n\n private onKeydown = (event: KeyboardEvent): void => {\n if (event.code === \"Enter\" && this.form) {\n setTimeout(() => {\n if (!event.defaultPrevented) {\n submit(this.form);\n }\n });\n }\n };\n\n @state() private dirty = false;\n\n @state() private passwordVisible = false;\n\n private textVisibilityToggle() {\n this.passwordVisible = !this.passwordVisible;\n }\n\n showPicker() {\n if (\"showPicker\" in HTMLInputElement.prototype) {\n this.validationTarget.showPicker();\n }\n }\n\n validityCallback(): string | void {\n this.onInvalid(this.internals.validity);\n return this.customInvalidText || this.validationTarget?.validationMessage;\n }\n\n /**\n * Force to set input as in invalid state.\n */\n async forceCustomError() {\n await this.updateComplete;\n this.validationTarget.setCustomValidity(this.customInvalidText || \"An error occurred\");\n this.setValue(this.value);\n this.reportValidity();\n }\n\n /**\n * Clear forced invalid state\n */\n async clearCustomError() {\n await this.updateComplete;\n this.validationTarget.setCustomValidity(\"\");\n this.setValue(this.value);\n this.reportValidity();\n }\n\n reportValidity() {\n this.dirty = true;\n this.requestUpdate();\n return this.checkValidity();\n }\n\n private inputHandler(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n\n this.value = value;\n this.onInput(value);\n }\n\n private changeHandler(event: Event) {\n const value = (event.target as HTMLInputElement).value;\n\n this.dirty = true;\n this.value = value;\n this.onChange(value);\n }\n\n firstUpdated() {\n this.setValue(this.value);\n if (!this.icon) this.icon = inputTypeIcons[this.type];\n }\n\n protected async updated(changedProperties: PropertyValues) {\n if (changedProperties.size > 0) {\n this.setValue(this.value);\n\n await this.validationComplete;\n\n this.requestUpdate();\n }\n }\n\n private inputId = Math.random().toString(36).substring(2);\n\n private get _hasIconSlot() {\n return this.querySelector(':scope > [slot=\"icon\"]') !== null;\n }\n\n render(): TemplateResult {\n const invalidMessage = !this.checkValidity()\n ? html`<p id=\"errorMessage\" aria-live=\"polite\" class=\"invalid-text\">\n ${this.validationMessage}\n </p>`\n : \"\";\n const helpMessage = this.helpText\n ? html`<p id=\"helpText\" class=\"help-text\">${this.helpText}</p>`\n : \"\";\n\n const icon = html`\n <slot name=\"icon\">\n ${this.loading && this.type === \"search\" && this.value !== \"\" && this.value !== null\n ? html`<bl-spinner></bl-spinner>`\n : this.icon\n ? html`<bl-icon name=\"${this.icon}\"></bl-icon>`\n : html`<bl-icon class=\"error-icon\" name=\"alert\"></bl-icon>`}\n </slot>\n `;\n\n const label = this.label ? html`<label for=${this.inputId}>${this.label}</label>` : \"\";\n const passwordInput = this.type === \"password\";\n\n const revealButton = passwordInput\n ? html`<bl-button\n size=\"small\"\n kind=\"neutral\"\n variant=\"tertiary\"\n class=\"${classMap({\n \"reveal-button\": true,\n \"password-visible\": this.passwordVisible,\n })}\"\n aria-label=\"Toggle password reveal\"\n @bl-click=\"${this.textVisibilityToggle}\"\n >\n <bl-icon class=\"reveal-icon\" slot=\"icon\" name=\"eye_on\"></bl-icon>\n <bl-icon class=\"reveal-icon\" slot=\"icon\" name=\"eye_off\"></bl-icon>\n </bl-button>`\n : \"\";\n\n const hasCustomIcon = this.icon || this._hasIconSlot;\n const classes = {\n \"wrapper\": true,\n \"dirty\": this.dirty,\n \"invalid\": !this.checkValidity(),\n \"has-icon\": passwordInput || hasCustomIcon || (this.dirty && !this.checkValidity()),\n \"has-value\": this.value !== null && this.value !== \"\",\n };\n\n const passwordType = this.passwordVisible ? \"text\" : \"password\";\n const inputType = passwordInput ? passwordType : this.type;\n\n return html`<div class=${classMap(classes)}>\n ${label}\n <fieldset class=\"input-wrapper\">\n <legend><span>${this.label}</span></legend>\n <input\n id=${this.inputId}\n type=${inputType}\n .value=${live(this.value)}\n inputmode=\"${ifDefined(this.inputmode)}\"\n ?autofocus=${this.autofocus}\n .autocomplete=\"${this.autocomplete}\"\n placeholder=\"${ifDefined(this.placeholder)}\"\n minlength=\"${ifDefined(this.minlength)}\"\n maxlength=\"${ifDefined(this.maxlength)}\"\n min=\"${ifDefined(this.min)}\"\n max=\"${ifDefined(this.max)}\"\n pattern=\"${ifDefined(this.pattern)}\"\n step=\"${ifDefined(this.step)}\"\n ?required=${this.required}\n ?disabled=${this.disabled}\n ?readonly=${this.readonly}\n @change=${this.changeHandler}\n @input=${this.inputHandler}\n aria-invalid=${this.checkValidity() ? \"false\" : \"true\"}\n aria-describedby=${ifDefined(this.helpText ? \"helpText\" : undefined)}\n aria-errormessage=${ifDefined(this.checkValidity() ? undefined : \"errorMessage\")}\n />\n <div class=\"icon\">${revealButton} ${icon}</div>\n </fieldset>\n <div class=\"hint\">${invalidMessage} ${helpMess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AvMEA,EAArBuB,EAAA,CADCE,EAAc,UAAU,GACJzB",
6
- "names": ["styles", "i", "bl_input_default", "inputTypeIcons", "BlInput", "FormControlMixin", "s", "event", "submit", "bl_input_default", "value", "_a", "changedProperties", "invalidMessage", "x", "helpMessage", "icon", "label", "passwordInput", "revealButton", "o", "hasCustomIcon", "classes", "passwordType", "inputType", "l", "innerInputValidators", "__decorateClass", "i", "e", "t"]
7
- }
@@ -1,50 +0,0 @@
1
- import{a as f}from"./chunk-O7VPXMZW.js";import{a as m}from"./chunk-GRL4DWKG.js";import{a as v,b as n,c as p,e as u}from"./chunk-5MOOXA2X.js";import{a as d,b as r}from"./chunk-4OT5AMS5.js";import{d as i}from"./chunk-IZ2LK5GK.js";var _=d`:host{width:fit-content;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);--datepicker-width:314px;display:flex;flex-direction:column;gap:var(--bl-size-2xs);width:fit-content}.datepicker-input{width:var(--bl-datepicker-input-width, var(--datepicker-width));white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`,b=_;var e=class extends f{constructor(){super(...arguments);this.size="medium";this.labelFixed=!1;this.valueFormatter=null;this._inputValue="";this._selectedDates=[];this._floatingDateCount=0;this._fittingDateCount=0}static get styles(){return[b]}defaultInputValueFormatter(){if(this.type==="single")this._inputValue=this.formatDate(this._selectedDates[0]),this.closePopoverWithTimeout();else if(this.type==="multiple"){this.setFloatingDates();let t=this._selectedDates.slice(0,this._fittingDateCount).map(s=>this.formatDate(s));this._inputValue=t.join(",")+(this._floatingDateCount>0?" ,...":"")}else this.type==="range"&&(this._selectedDates[0]&&(this._inputValue=this.formatDate(this._selectedDates[0])),this._selectedDates[1]&&(this._inputValue=`${this._inputValue}-${this.formatDate(this._selectedDates[1])}`),this._selectedDates[0]&&this._selectedDates[1]&&this.closePopoverWithTimeout())}closePopoverWithTimeout(){setTimeout(()=>{this.closePopover(),this._inputEl.blur()},200)}setFloatingDates(){var a,l;let t=(a=this.shadowRoot)==null?void 0:a.getElementById("datepicker-input"),s=(l=this.shadowRoot)==null?void 0:l.getElementById("icon-container"),o=t.offsetWidth-s.offsetWidth;this._fittingDateCount=Math.floor(o/90),this._floatingDateCount=this._selectedDates.length-this._fittingDateCount}setDatePickerInput(t){t.length?(this._selectedDates=t,this.valueFormatter?this._inputValue=this.valueFormatter(this._selectedDates):this.defaultInputValueFormatter()):this._inputValue="",this._onBlDatepickerChange(this._selectedDates)}formatDate(t){return`${String(t==null?void 0:t.getDate()).padStart(2,"0")}/${String((t==null?void 0:t.getMonth())+1).padStart(2,"0")}/${t==null?void 0:t.getFullYear()}`}clearDatepicker(){this._selectedDates=[],this._inputValue="",this._floatingDateCount=0,this._calendarEl.handleClearSelectedDates()}openPopover(){this._popoverEl.target=this._inputEl,this._popoverEl.show()}closePopover(){this._popoverEl.hide()}_togglePopover(){this._popoverEl.visible?this.closePopover():this.openPopover()}formatAdditionalDates(t){let s=t.split(",");return s.reduce((o,a,l)=>(l>0&&l%3===0&&o.push(r`<br />`),o.push(r`<span>${a.trim()}${l<s.length-1?", ":""}</span>`),o),[])}async firstUpdated(){var t,s;this._onCalendarMouseDown=o=>{var a;o.preventDefault(),(a=this._inputEl)==null||a.focus()},this._onInputMouseDown=o=>{var a;o.preventDefault(),(a=this._inputEl)==null||a.focus()},(t=this._calendarEl)==null||t.addEventListener("mousedown",this._onCalendarMouseDown),(s=this._inputEl)==null||s.addEventListener("mousedown",this._onInputMouseDown),this._selectedDates&&this.setDatePickerInput(this._selectedDates)}updated(t){t.has("_selectedDates")&&this.setDatePickerInput(this._selectedDates)}disconnectedCallback(){var t,s;super.disconnectedCallback(),(t=this._calendarEl)==null||t.removeEventListener("mousedown",this._onCalendarMouseDown),(s=this._inputEl)==null||s.removeEventListener("mousedown",this._onInputMouseDown)}render(){var c;let t=r`
2
- <bl-popover target="datepicker-content" placement="bottom-start">
3
- <bl-calendar
4
- type=${this.type}
5
- .minDate=${this.minDate}
6
- .maxDate=${this.maxDate}
7
- .startOfWeek=${this.startOfWeek}
8
- .disabledDates=${this.disabledDates}
9
- .value=${this.value}
10
- .locale=${this.locale}
11
- @bl-calendar-change="${h=>this.setDatePickerInput(h.detail)}"
12
- ></bl-calendar>
13
- </bl-popover>
14
- `,s=(c=this._selectedDates)==null?void 0:c.slice(this._fittingDateCount).map(h=>this.formatDate(h)).join(","),o=this.formatAdditionalDates(s),a=this._floatingDateCount>0?r` <bl-tooltip>
15
- <span slot="tooltip-trigger">+${this._floatingDateCount}</span>
16
- <div>${o}</div>
17
- </bl-tooltip>`:"",l=this._selectedDates.length>0?r` <bl-button
18
- size="small"
19
- variant="tertiary"
20
- kind="neutral"
21
- icon="close"
22
- @click=${this.clearDatepicker}
23
- ></bl-button>
24
- <div class="action-divider"></div>`:"";return r`
25
- <div class="datepicker-content" id="datepicker-content" tabindex="-1">
26
- <bl-input
27
- .value="${this._inputValue}"
28
- label="${this.label}"
29
- placeholder="${this.placeholder}"
30
- class="datepicker-input"
31
- role="button"
32
- id="datepicker-input"
33
- aria-haspopup="listbox"
34
- aria-labelledby="label"
35
- @click=${this._togglePopover}
36
- help-text=${this.helpText}
37
- ?disabled=${this.disabled}
38
- .size=${this.size}
39
- .labelFixed=${this.labelFixed}
40
- readonly
41
- >
42
- <div slot="icon" class="icon-container" id="icon-container">
43
- ${a} ${l}
44
- <bl-icon name="calendar" size="small" class="calendar-icon"></bl-icon>
45
- </div>
46
- </bl-input>
47
- ${t}
48
- </div>
49
- `}};i([n({type:String,attribute:"placeholder",reflect:!0})],e.prototype,"placeholder",2),i([n({type:String,reflect:!0})],e.prototype,"size",2),i([n({type:Boolean,attribute:"label-fixed",reflect:!0})],e.prototype,"labelFixed",2),i([n({type:String,attribute:"label",reflect:!0})],e.prototype,"label",2),i([n({type:Function,attribute:"value-formatter"})],e.prototype,"valueFormatter",2),i([n({type:Boolean})],e.prototype,"disabled",2),i([n({type:String,attribute:"help-text",reflect:!0})],e.prototype,"helpText",2),i([p()],e.prototype,"_inputValue",2),i([p()],e.prototype,"_selectedDates",2),i([p()],e.prototype,"_floatingDateCount",2),i([p()],e.prototype,"_fittingDateCount",2),i([u("bl-calendar")],e.prototype,"_calendarEl",2),i([u("bl-popover")],e.prototype,"_popoverEl",2),i([u("bl-input")],e.prototype,"_inputEl",2),i([m("bl-datepicker-change")],e.prototype,"_onBlDatepickerChange",2),e=i([v("bl-datepicker")],e);export{e as a};
50
- //# sourceMappingURL=chunk-7TWNQK6I.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/components/datepicker/bl-datepicker.css", "../src/components/datepicker/bl-datepicker.ts"],
4
- "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:fit-content;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);--datepicker-width:314px;display:flex;flex-direction:column;gap:var(--bl-size-2xs);width:fit-content}.datepicker-input{width:var(--bl-datepicker-input-width, var(--datepicker-width));white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`;\nexport default styles;\n", "import { CSSResultGroup, html, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { BlCalendar, BlPopover } from \"../../baklava\";\nimport DatepickerCalendarMixin from \"../../mixins/datepicker-calendar-mixin/datepicker-calendar-mixin\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../calendar/bl-calendar\";\nimport { CALENDAR_TYPES } from \"../calendar/bl-calendar.constant\";\nimport \"../input/bl-input\";\nimport BlInput, { InputSize } from \"../input/bl-input\";\nimport \"../tooltip/bl-tooltip\";\nimport style from \"./bl-datepicker.css\";\n\n/**\n * @tag bl-datepicker\n * @summary Baklava DatePicker component\n *\n * @cssproperty [--bl-datepicker-input-width] - Sets the width of datepicker input\n **/\n@customElement(\"bl-datepicker\")\nexport default class BlDatepicker extends DatepickerCalendarMixin {\n /**\n * Defines the datepicker input placeholder\n */\n @property({ type: String, attribute: \"placeholder\", reflect: true })\n placeholder: string;\n /**\n * Sets input size.\n */\n @property({ type: String, reflect: true })\n size?: InputSize = \"medium\";\n\n /**\n * Makes datepicker input label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n /**\n * Defines the datepicker input label\n */\n @property({ type: String, attribute: \"label\", reflect: true })\n label: string;\n /**\n * Defines the custom formatter function\n */\n @property({ type: Function, attribute: \"value-formatter\" })\n valueFormatter: ((dates: Date[]) => string) | null = null;\n /**\n * Sets datepicker to disabled\n */\n @property({ type: Boolean })\n disabled: boolean;\n /**\n * Defines help text to datepicker input for users\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText: string;\n\n @state()\n _inputValue = \"\";\n\n @state()\n _selectedDates: Date[] = [];\n\n @state()\n _floatingDateCount: number = 0;\n\n @state()\n _fittingDateCount: number = 0;\n\n @query(\"bl-calendar\")\n _calendarEl: BlCalendar;\n\n @query(\"bl-popover\")\n _popoverEl: BlPopover;\n\n @query(\"bl-input\")\n _inputEl!: BlInput;\n\n private _onCalendarMouseDown!: (event: MouseEvent) => void;\n private _onInputMouseDown!: (event: MouseEvent) => void;\n\n /**\n * Fires when date selection is changed\n */\n @event(\"bl-datepicker-change\") private _onBlDatepickerChange: EventDispatcher<Date[]>;\n\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n defaultInputValueFormatter() {\n if (this.type === CALENDAR_TYPES.SINGLE) {\n this._inputValue = this.formatDate(this._selectedDates[0]);\n this.closePopoverWithTimeout();\n } else if (this.type === CALENDAR_TYPES.MULTIPLE) {\n this.setFloatingDates();\n const values = this._selectedDates\n .slice(0, this._fittingDateCount)\n .map(date => this.formatDate(date));\n\n this._inputValue = values.join(\",\") + (this._floatingDateCount > 0 ? \" ,...\" : \"\");\n } else if (this.type === CALENDAR_TYPES.RANGE) {\n if (this._selectedDates[0]) this._inputValue = this.formatDate(this._selectedDates[0]);\n if (this._selectedDates[1])\n this._inputValue = `${this._inputValue}-${this.formatDate(this._selectedDates[1])}`;\n if (this._selectedDates[0] && this._selectedDates[1]) this.closePopoverWithTimeout();\n }\n }\n\n closePopoverWithTimeout() {\n setTimeout(() => {\n this.closePopover();\n this._inputEl.blur();\n }, 200);\n }\n\n setFloatingDates() {\n const datepickerInput = this.shadowRoot?.getElementById(\"datepicker-input\");\n const iconsContainer = this.shadowRoot?.getElementById(\"icon-container\");\n const datesTextTotalWidth = datepickerInput!.offsetWidth! - iconsContainer!.offsetWidth!;\n\n this._fittingDateCount = Math.floor(datesTextTotalWidth / 90);\n\n this._floatingDateCount = this._selectedDates.length - this._fittingDateCount;\n }\n\n setDatePickerInput(dates: Date[] | []) {\n if (!dates.length) {\n this._inputValue = \"\";\n } else {\n this._selectedDates = dates;\n if (this.valueFormatter) {\n this._inputValue = this.valueFormatter(this._selectedDates);\n } else {\n this.defaultInputValueFormatter();\n }\n }\n\n this._onBlDatepickerChange(this._selectedDates);\n }\n\n formatDate(date: Date): string {\n return `${String(date?.getDate()).padStart(2, \"0\")}/${String(date?.getMonth() + 1).padStart(\n 2,\n \"0\"\n )}/${date?.getFullYear()}`;\n }\n\n clearDatepicker() {\n this._selectedDates = [];\n this._inputValue = \"\";\n this._floatingDateCount = 0;\n this._calendarEl.handleClearSelectedDates();\n }\n\n openPopover() {\n this._popoverEl.target = this._inputEl;\n this._popoverEl.show();\n }\n\n closePopover() {\n this._popoverEl.hide();\n }\n\n _togglePopover() {\n this._popoverEl.visible ? this.closePopover() : this.openPopover();\n }\n\n formatAdditionalDates(str: string): TemplateResult[] {\n const parts = str.split(\",\");\n\n return parts.reduce<TemplateResult[]>((acc, part, index) => {\n if (index > 0 && index % 3 === 0) {\n acc.push(html`<br />`);\n }\n acc.push(html`<span>${part.trim()}${index < parts.length - 1 ? \", \" : \"\"}</span>`);\n return acc;\n }, []);\n }\n\n async firstUpdated() {\n this._onCalendarMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._onInputMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._calendarEl?.addEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.addEventListener(\"mousedown\", this._onInputMouseDown);\n\n if (this._selectedDates) {\n this.setDatePickerInput(this._selectedDates);\n }\n }\n\n updated(changedProperties: PropertyValues) {\n if (changedProperties.has(\"_selectedDates\")) {\n this.setDatePickerInput(this._selectedDates);\n }\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._calendarEl?.removeEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.removeEventListener(\"mousedown\", this._onInputMouseDown);\n }\n\n render() {\n const renderCalendar = html`\n <bl-popover target=\"datepicker-content\" placement=\"bottom-start\">\n <bl-calendar\n type=${this.type}\n .minDate=${this.minDate}\n .maxDate=${this.maxDate}\n .startOfWeek=${this.startOfWeek}\n .disabledDates=${this.disabledDates}\n .value=${this.value}\n .locale=${this.locale}\n @bl-calendar-change=\"${(event: CustomEvent) => this.setDatePickerInput(event.detail)}\"\n ></bl-calendar>\n </bl-popover>\n `;\n const additionalDates = this._selectedDates\n ?.slice(this._fittingDateCount)\n .map(date => {\n return this.formatDate(date);\n })\n .join(\",\");\n\n const formattedAdditionalDates = this.formatAdditionalDates(additionalDates);\n\n const additionalDatesView =\n this._floatingDateCount > 0\n ? html` <bl-tooltip>\n <span slot=\"tooltip-trigger\">+${this._floatingDateCount}</span>\n <div>${formattedAdditionalDates}</div>\n </bl-tooltip>`\n : \"\";\n\n const clearDatepickerButton =\n this._selectedDates.length > 0\n ? html` <bl-button\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this.clearDatepicker}\n ></bl-button>\n <div class=\"action-divider\"></div>`\n : \"\";\n\n return html`\n <div class=\"datepicker-content\" id=\"datepicker-content\" tabindex=\"-1\">\n <bl-input\n .value=\"${this._inputValue}\"\n label=\"${this.label}\"\n placeholder=\"${this.placeholder}\"\n class=\"datepicker-input\"\n role=\"button\"\n id=\"datepicker-input\"\n aria-haspopup=\"listbox\"\n aria-labelledby=\"label\"\n @click=${this._togglePopover}\n help-text=${this.helpText}\n ?disabled=${this.disabled}\n .size=${this.size}\n .labelFixed=${this.labelFixed}\n readonly\n >\n <div slot=\"icon\" class=\"icon-container\" id=\"icon-container\">\n ${additionalDatesView} ${clearDatepickerButton}\n <bl-icon name=\"calendar\" size=\"small\" class=\"calendar-icon\"></bl-icon>\n </div>\n </bl-input>\n ${renderCalendar}\n </div>\n `;\n }\n}\n"],
5
- "mappings": "oOACO,IAAMA,EAASC,q4BACfC,EAAQF,ECiBf,IAAqBG,EAArB,cAA0CC,CAAwB,CAAlE,kCAUE,UAAmB,SAMnB,gBAAa,GAUb,oBAAqD,KAarD,iBAAc,GAGd,oBAAyB,CAAC,EAG1B,wBAA6B,EAG7B,uBAA4B,EAmB5B,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAEA,4BAA6B,CAC3B,GAAI,KAAK,gBACP,KAAK,YAAc,KAAK,WAAW,KAAK,eAAe,CAAC,CAAC,EACzD,KAAK,wBAAwB,UACpB,KAAK,kBAAkC,CAChD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A,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,QAAS,QAAS,EAAK,CAAC,GApB1CzB,EAqBnB,qBAKAwB,EAAA,CADCC,EAAS,CAAE,KAAM,SAAU,UAAW,iBAAkB,CAAC,GAzBvCzB,EA0BnB,8BAKAwB,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,CAAC,GA9BRzB,EA+BnB,wBAKAwB,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,YAAa,QAAS,EAAK,CAAC,GAnC9CzB,EAoCnB,wBAGAwB,EAAA,CADCE,EAAM,GAtCY1B,EAuCnB,2BAGAwB,EAAA,CADCE,EAAM,GAzCY1B,EA0CnB,8BAGAwB,EAAA,CADCE,EAAM,GA5CY1B,EA6CnB,kCAGAwB,EAAA,CADCE,EAAM,GA/CY1B,EAgDnB,iCAGAwB,EAAA,CADCG,EAAM,aAAa,GAlDD3B,EAmDnB,2BAGAwB,EAAA,CADCG,EAAM,YAAY,GArDA3B,EAsDnB,0BAGAwB,EAAA,CADCG,EAAM,UAAU,GAxDE3B,EAyDnB,wBAQuCwB,EAAA,CAAtCP,EAAM,sBAAsB,GAjEVjB,EAiEoB,qCAjEpBA,EAArBwB,EAAA,CADCC,EAAc,eAAe,GACTzB",
6
- "names": ["styles", "i", "bl_datepicker_default", "BlDatepicker", "DatepickerCalendarMixin", "bl_datepicker_default", "values", "date", "_a", "_b", "datepickerInput", "iconsContainer", "datesTextTotalWidth", "dates", "str", "parts", "acc", "part", "index", "x", "event", "changedProperties", "renderCalendar", "additionalDates", "formattedAdditionalDates", "additionalDatesView", "clearDatepickerButton", "__decorateClass", "e", "t", "i"]
7
- }
@@ -1,2 +0,0 @@
1
- import{b as e}from"./chunk-EG7U7PM3.js";var r=["valueMissing","typeMismatch","tooLong","tooShort","rangeUnderflow","rangeOverflow","stepMismatch","badInput","patternMismatch","customError"],i=r.map(t=>({key:t,isValid(a){return a.validationTarget?!a.validationTarget.validity[t]:!0}})),o={...e,isValid(t){return t.validationTarget&&t.getAttribute("maxlength")?Number(t.getAttribute("maxlength"))>=t.validationTarget.value.length:!0}},n=[...i,o];export{i as a,n as b};
2
- //# sourceMappingURL=chunk-MND5TXTF.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/utilities/form-control.ts"],
4
- "sourcesContent": ["import { maxLengthValidator } from \"@open-wc/form-control\";\n\nconst validityStates: Array<keyof ValidityState> = [\n \"valueMissing\",\n \"typeMismatch\",\n \"tooLong\",\n \"tooShort\",\n \"rangeUnderflow\",\n \"rangeOverflow\",\n \"stepMismatch\",\n \"badInput\",\n \"patternMismatch\",\n \"customError\",\n];\n\nexport const innerInputValidators = validityStates.map(key => ({\n key,\n isValid(instance: HTMLElement & { validationTarget: HTMLInputElement }) {\n if (instance.validationTarget) {\n return !instance.validationTarget.validity[key];\n }\n return true;\n },\n}));\n\nexport const textareaLengthValidator = {\n ...maxLengthValidator,\n isValid(instance: HTMLElement & { validationTarget: HTMLTextAreaElement }) {\n if (instance.validationTarget && instance.getAttribute(\"maxlength\")) {\n return Number(instance.getAttribute(\"maxlength\")) >= instance.validationTarget.value.length;\n }\n return true;\n },\n};\n\nexport const textAreaValidators = [...innerInputValidators, textareaLengthValidator];\n"],
5
- "mappings": "wCAEA,IAAMA,EAA6C,CACjD,eACA,eACA,UACA,WACA,iBACA,gBACA,eACA,WACA,kBACA,aACF,EAEaC,EAAuBD,EAAe,IAAIE,IAAQ,CAC7D,IAAAA,EACA,QAAQC,EAAgE,CACtE,OAAIA,EAAS,iBACJ,CAACA,EAAS,iBAAiB,SAASD,CAAG,EAEzC,EACT,CACF,EAAE,EAEWE,EAA0B,CACrC,GAAGC,EACH,QAAQF,EAAmE,CACzE,OAAIA,EAAS,kBAAoBA,EAAS,aAAa,WAAW,EACzD,OAAOA,EAAS,aAAa,WAAW,CAAC,GAAKA,EAAS,iBAAiB,MAAM,OAEhF,EACT,CACF,EAEaG,EAAqB,CAAC,GAAGL,EAAsBG,CAAuB",
6
- "names": ["validityStates", "innerInputValidators", "key", "instance", "textareaLengthValidator", "maxLengthValidator", "textAreaValidators"]
7
- }
@@ -1,2 +0,0 @@
1
- import{b as a}from"./chunk-IZ2LK5GK.js";var s={};a(s,{templates:()=>e});var e={s144508ac0e146c46:"Hi\xE7bir Sonu\xE7 Bulunamad\u0131",s5d929ff1619ac0c9:"Arama",s716a6024e3fe999c:"G\xF6ster",s76ddb3a843ed8e06:"Aramay\u0131 Temizle",sb1ba2131b9a7c7b0:"Git",sbaace8219b5f4612:"T\xFCm\xFCn\xFC Se\xE7"};export{e as a,s as b};
2
- //# sourceMappingURL=chunk-XDCNO7EY.js.map