@trendyol/baklava 3.4.0-beta.14 → 3.4.0-beta.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/baklava.js +1 -1
- package/dist/chunk-IR2QY2VG.js +24 -0
- package/dist/chunk-IR2QY2VG.js.map +7 -0
- package/dist/chunk-KTG566MB.js +59 -0
- package/dist/chunk-KTG566MB.js.map +7 -0
- package/dist/components/accordion-group/accordion/bl-accordion.d.ts +1 -0
- package/dist/components/accordion-group/accordion/bl-accordion.d.ts.map +1 -1
- package/dist/components/accordion-group/accordion/bl-accordion.js +1 -1
- package/dist/components/accordion-group/bl-accordion-group.test.d.ts.map +1 -1
- package/dist/components/datepicker/bl-datepicker.js +1 -1
- package/dist/components/input/bl-input.js +1 -1
- package/dist/components/pagination/bl-pagination.js +1 -1
- package/dist/custom-elements.json +6 -1
- package/package.json +1 -1
- package/dist/chunk-ETFCJRBG.js +0 -59
- package/dist/chunk-ETFCJRBG.js.map +0 -7
- package/dist/chunk-EXUCTLBU.js +0 -24
- package/dist/chunk-EXUCTLBU.js.map +0 -7
package/dist/baklava.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as E}from"./chunk-TKTRDALH.js";import{b as z}from"./chunk-2EK4TAKQ.js";import{b as q}from"./chunk-QKUMEP5P.js";import{b as j}from"./chunk-JN5BKKQZ.js";import{b as O}from"./chunk-DPKNQOJX.js";import{a as l}from"./chunk-
|
|
1
|
+
import{b as E}from"./chunk-TKTRDALH.js";import{b as z}from"./chunk-2EK4TAKQ.js";import{b as q}from"./chunk-QKUMEP5P.js";import{b as j}from"./chunk-JN5BKKQZ.js";import{b as O}from"./chunk-DPKNQOJX.js";import{a as l}from"./chunk-IR2QY2VG.js";import{b as y}from"./chunk-7HEDOM2M.js";import{b as N}from"./chunk-NW7MDZJB.js";import{a as D}from"./chunk-3MLXIDOD.js";import{a as C}from"./chunk-WZBUJ4ER.js";import{a as w}from"./chunk-YH3MSMXL.js";import{b as L}from"./chunk-FCOVZEHC.js";import{a as J}from"./chunk-Z2AZS34W.js";import{a as I}from"./chunk-UF5VCR36.js";import{a as i}from"./chunk-7N7YHRPA.js";import{b as v}from"./chunk-23AVKNCC.js";import{a as b}from"./chunk-P4S537UY.js";import{a as P}from"./chunk-UK2ZEQBN.js";import{c as g,f as h}from"./chunk-FS3MTRC3.js";import{a as T}from"./chunk-2Q566BEQ.js";import{a as c}from"./chunk-H6EUN6QV.js";import{a as s}from"./chunk-UV7BOOVA.js";import{a as B}from"./chunk-D7VPTSSK.js";import{b as k,d as A,f as H}from"./chunk-LIUATY6B.js";import{b as R}from"./chunk-FANRUDPK.js";import{a as f}from"./chunk-LCAPXVGE.js";import"./chunk-ECPWEUBG.js";import{a as p}from"./chunk-UGRBWOQE.js";import{b as m,e as x}from"./chunk-6XM52E7W.js";import{a as K}from"./chunk-C2UDBDKV.js";import{a as S}from"./chunk-BCRV6HG6.js";import{b as G}from"./chunk-RCHKJINV.js";import"./chunk-EZSEQHRH.js";import{a as n}from"./chunk-KTG566MB.js";import"./chunk-23PSWIUF.js";import{b as F}from"./chunk-IEFQ6PGY.js";import"./chunk-IPYZIIRV.js";import{b as u}from"./chunk-NM74WWXQ.js";import{b as d}from"./chunk-OYHUG47P.js";import"./chunk-WEEGH2F4.js";import"./chunk-EG7U7PM3.js";import"./chunk-AYJMIZZ3.js";import"./chunk-XDUIVR6I.js";import"./chunk-HZ6A5QFC.js";import"./chunk-6LT7O7T2.js";import"./chunk-DINNT5P2.js";import{a,b as r,c as t}from"./chunk-3OQA4BKQ.js";import"./chunk-GRL4DWKG.js";import"./chunk-3USCFSFQ.js";import"./chunk-7GK5LKBV.js";import"./chunk-HBPBDC7T.js";import{a as e}from"./chunk-HD7EU6S5.js";import"./chunk-5MOOXA2X.js";import{b as o}from"./chunk-4OT5AMS5.js";import"./chunk-BWWXE4SL.js";export{l as BlAccordion,e as BlAccordionGroup,f as BlAlert,p as BlBadge,u as BlButton,F as BlCalendar,m as BlCheckbox,x as BlCheckboxGroup,K as BlDatePicker,s as BlDialog,B as BlDrawer,H as BlDropdown,R as BlDropdownGroup,A as BlDropdownItem,t as BlIcon,n as BlInput,i as BlLink,v as BlNotification,y as BlNotificationCard,b as BlPagination,G as BlPopover,P as BlProgressIndicator,g as BlRadio,h as BlRadioGroup,T as BlSelect,c as BlSelectOption,d as BlSpinner,k as BlSplitButton,N as BlSwitch,w as BlTab,D as BlTabGroup,C as BlTabPanel,L as BlTable,j as BlTableBody,E as BlTableCell,O as BlTableHeader,z as BlTableHeaderCell,q as BlTableRow,J as BlTag,I as BlTextarea,S as BlTooltip,r as getIconPath,o as litHtmlRenderer,a as setIconPath};
|
|
2
2
|
//# sourceMappingURL=baklava.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import{a as c}from"./chunk-ECPWEUBG.js";import{a as u}from"./chunk-6LT7O7T2.js";import{a as m}from"./chunk-GRL4DWKG.js";import{a as d,b as o,e as i}from"./chunk-5MOOXA2X.js";import{a as l,b as s,f as n}from"./chunk-4OT5AMS5.js";import{d as a}from"./chunk-BWWXE4SL.js";var p=l`:host{display:block}.accordion{--border:1px solid var(--bl-color-neutral-lighter);--default-radius:var(--bl-size-2xs);--radius-top-left:var(--bl-accordion-radius-top-left, var(--default-radius));--radius-top-right:var(--bl-accordion-radius-top-right, var(--default-radius));--radius-bottom-right:var(--bl-accordion-radius-bottom-right, var(--default-radius));--radius-bottom-left:var(--bl-accordion-radius-bottom-left, var(--default-radius));width:100%}.summary{list-style:none;user-select:none;cursor:pointer;font:var(--bl-font-title-3-medium);display:flex;align-items:center;justify-content:space-between;gap:var(--bl-size-2xs);padding:var(--bl-size-m);background:var(--bl-color-neutral-full);color:var(--bl-color-neutral-darker);border:var(--border);border-bottom:var(--bl-accordion-border-bottom,var(--border));border-radius:var(--radius-top-left) var(--radius-top-right) var(--radius-bottom-right) var(--radius-bottom-left);transition:background-color .2s,border-bottom .2s,border-radius .2s}.summary::-webkit-details-marker{display:none}.summary.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__,.summary:hover{background:var(--bl-color-neutral-lightest)}.summary:focus-visible{outline:2px solid var(--bl-color-primary);outline-offset:-1px}.indicator{transition:transform .2s}.accordion[open] .indicator{transform:rotate(180deg)}.accordion[open] .summary{border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.caption{flex:1}.accordion-content{padding:var(--bl-size-m);background:var(--bl-color-neutral-full);border:var(--border);border-top:0;border-bottom:var(--bl-accordion-border-bottom,var(--border));border-bottom-left-radius:var(--radius-bottom-left);border-bottom-right-radius:var(--radius-bottom-right);font:var(--bl-font-body-text-2-regular)}.disabled .summary{cursor:not-allowed;background:var(--bl-color-neutral-lightest);color:var(--bl-color-neutral-light)}.accordion:not([open]) .accordion-content{display:none}`,b=p;var e=class extends n{constructor(){super(...arguments);this.open=!1;this.disabled=!1;this.animationDuration=250;this._animationStatus=null}static get styles(){return[b]}_cleanupStyles(){this.detailsEl.style.height="",this.detailsEl.style.overflow="",this.contentEl.style.display="",this.contentEl.style.visibility=""}_animate(t){this._animationStatus=t?0:1,this._animation&&this._animation.cancel(),t&&(this.open=!0);let r=this.detailsEl.offsetHeight;t&&(this.contentEl.style.display="block",this.contentEl.style.visibility="hidden"),requestAnimationFrame(()=>{let h=t?this.summaryEl.offsetHeight+this.contentEl.offsetHeight:this.summaryEl.offsetHeight;t&&(this.contentEl.style.visibility=""),this.detailsEl.style.overflow="hidden",this.detailsEl.style.height=`${r}px`,requestAnimationFrame(()=>{this._animation=this.detailsEl.animate({height:[`${r}px`,`${h}px`]},{duration:this.animationDuration,easing:"ease-out",fill:"forwards"}),this._animation.onfinish=()=>this._onAnimationFinish(t),this._animation.oncancel=()=>{this._animationStatus=null,this._cleanupStyles(),t||(this.open=!1)}})})}_onAnimationFinish(t){this._cleanupStyles(),t||(this.open=!1),this._animation=null,this._animationStatus=null}expand(){this._animate(!0)}collapse(){this._animate(!1)}_clickHandler(t){if(t.preventDefault(),this.disabled)return;this._animationStatus===1||!this.open?this.expand():this.collapse()}updated(t){if(t.has("open")){if(this.disabled&&this.open){this._onAnimationFinish(!1);return}this._onToggle(this.open)}}render(){let t=this.icon?s`<bl-icon class="icon" name=${this.icon===!0?"info":this.icon}></bl-icon>`:null;return s`<details
|
|
2
|
+
?open=${this.open}
|
|
3
|
+
class=${u({accordion:!0,disabled:this.disabled})}
|
|
4
|
+
>
|
|
5
|
+
<summary
|
|
6
|
+
class="summary"
|
|
7
|
+
@click="${this._clickHandler}"
|
|
8
|
+
aria-expanded=${this.open?"true":"false"}
|
|
9
|
+
aria-controls="content"
|
|
10
|
+
aria-disabled=${this.disabled?"true":"false"}
|
|
11
|
+
tabindex=${this.disabled?"-1":"0"}
|
|
12
|
+
>
|
|
13
|
+
${t}
|
|
14
|
+
<slot name="caption">
|
|
15
|
+
<span class="caption"> ${this.caption} </span>
|
|
16
|
+
</slot>
|
|
17
|
+
<bl-icon name="arrow_down" class="indicator"></bl-icon>
|
|
18
|
+
</summary>
|
|
19
|
+
|
|
20
|
+
<div class="accordion-content" role="region" aria-labelledby="header" id="content">
|
|
21
|
+
<slot></slot>
|
|
22
|
+
</div>
|
|
23
|
+
</details>`}};a([o({reflect:!0,type:Boolean})],e.prototype,"open",2),a([o({reflect:!0})],e.prototype,"caption",2),a([o({converter:c()})],e.prototype,"icon",2),a([o({reflect:!0,type:Boolean})],e.prototype,"disabled",2),a([m("bl-toggle")],e.prototype,"_onToggle",2),a([o({type:Number})],e.prototype,"animationDuration",2),a([i("details")],e.prototype,"detailsEl",2),a([i("summary")],e.prototype,"summaryEl",2),a([i(".accordion-content")],e.prototype,"contentEl",2),e=a([d("bl-accordion")],e);export{e as a};
|
|
24
|
+
//# sourceMappingURL=chunk-IR2QY2VG.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/accordion-group/accordion/bl-accordion.css", "../src/components/accordion-group/accordion/bl-accordion.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:block}.accordion{--border:1px solid var(--bl-color-neutral-lighter);--default-radius:var(--bl-size-2xs);--radius-top-left:var(--bl-accordion-radius-top-left, var(--default-radius));--radius-top-right:var(--bl-accordion-radius-top-right, var(--default-radius));--radius-bottom-right:var(--bl-accordion-radius-bottom-right, var(--default-radius));--radius-bottom-left:var(--bl-accordion-radius-bottom-left, var(--default-radius));width:100%}.summary{list-style:none;user-select:none;cursor:pointer;font:var(--bl-font-title-3-medium);display:flex;align-items:center;justify-content:space-between;gap:var(--bl-size-2xs);padding:var(--bl-size-m);background:var(--bl-color-neutral-full);color:var(--bl-color-neutral-darker);border:var(--border);border-bottom:var(--bl-accordion-border-bottom,var(--border));border-radius:var(--radius-top-left) var(--radius-top-right) var(--radius-bottom-right) var(--radius-bottom-left);transition:background-color .2s,border-bottom .2s,border-radius .2s}.summary::-webkit-details-marker{display:none}.summary.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__,.summary:hover{background:var(--bl-color-neutral-lightest)}.summary:focus-visible{outline:2px solid var(--bl-color-primary);outline-offset:-1px}.indicator{transition:transform .2s}.accordion[open] .indicator{transform:rotate(180deg)}.accordion[open] .summary{border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.caption{flex:1}.accordion-content{padding:var(--bl-size-m);background:var(--bl-color-neutral-full);border:var(--border);border-top:0;border-bottom:var(--bl-accordion-border-bottom,var(--border));border-bottom-left-radius:var(--radius-bottom-left);border-bottom-right-radius:var(--radius-bottom-right);font:var(--bl-font-body-text-2-regular)}.disabled .summary{cursor:not-allowed;background:var(--bl-color-neutral-lightest);color:var(--bl-color-neutral-light)}.accordion:not([open]) .accordion-content{display:none}`;\nexport default styles;\n", "import { html, LitElement, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, query } from \"lit/decorators.js\";\nimport { CSSResultGroup } from \"lit/development\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { event, EventDispatcher } from \"../../../utilities/event\";\nimport { stringBooleanConverter } from \"../../../utilities/string-boolean.converter\";\nimport \"../../icon/bl-icon\";\nimport { BaklavaIcon } from \"../../icon/icon-list\";\nimport style from \"./bl-accordion.css\";\n\nenum AnimationStatus {\n EXPANDING,\n COLLAPSING,\n}\n\n@customElement(\"bl-accordion\")\nexport default class BlAccordion extends LitElement {\n /**\n * Whether the accordion is expanded\n */\n @property({ reflect: true, type: Boolean })\n open = false;\n\n /**\n * Sets accordion caption.\n */\n @property({ reflect: true })\n caption?: string;\n\n /**\n * Add icon to beginning of the title\n */\n @property({ converter: stringBooleanConverter() })\n icon?: boolean | BaklavaIcon;\n\n /**\n * Whether the accordion is disabled\n */\n @property({ reflect: true, type: Boolean })\n disabled = false;\n\n /**\n * Fires when accordion open state change.\n */\n @event(\"bl-toggle\") private _onToggle: EventDispatcher<boolean>;\n\n @property({ type: Number })\n animationDuration = 250;\n\n private _animation: Animation | null;\n private _animationStatus: AnimationStatus | null = null;\n\n @query(\"details\")\n detailsEl: HTMLDetailsElement;\n\n @query(\"summary\")\n summaryEl: HTMLElement;\n\n @query(\".accordion-content\")\n contentEl: HTMLElement;\n\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n private _cleanupStyles() {\n this.detailsEl.style.height = \"\";\n this.detailsEl.style.overflow = \"\";\n this.contentEl.style.display = \"\";\n this.contentEl.style.visibility = \"\";\n }\n\n _animate(isExpanding: boolean) {\n this._animationStatus = isExpanding ? AnimationStatus.EXPANDING : AnimationStatus.COLLAPSING;\n\n if (this._animation) {\n this._animation.cancel();\n }\n\n if (isExpanding) {\n this.open = true;\n }\n\n const startHeight = this.detailsEl.offsetHeight;\n\n if (isExpanding) {\n this.contentEl.style.display = \"block\";\n this.contentEl.style.visibility = \"hidden\";\n }\n\n requestAnimationFrame(() => {\n const endHeight = isExpanding\n ? this.summaryEl.offsetHeight + this.contentEl.offsetHeight\n : this.summaryEl.offsetHeight;\n\n if (isExpanding) {\n this.contentEl.style.visibility = \"\";\n }\n\n this.detailsEl.style.overflow = \"hidden\";\n this.detailsEl.style.height = `${startHeight}px`;\n\n requestAnimationFrame(() => {\n this._animation = this.detailsEl.animate(\n {\n height: [`${startHeight}px`, `${endHeight}px`],\n },\n {\n duration: this.animationDuration,\n easing: \"ease-out\",\n fill: \"forwards\",\n }\n );\n\n this._animation.onfinish = () => this._onAnimationFinish(isExpanding);\n this._animation.oncancel = () => {\n this._animationStatus = null;\n this._cleanupStyles();\n if (!isExpanding) {\n this.open = false;\n }\n };\n });\n });\n }\n\n private _onAnimationFinish(isExpanding: boolean) {\n this._cleanupStyles();\n\n if (!isExpanding) {\n this.open = false;\n }\n\n this._animation = null;\n this._animationStatus = null;\n }\n\n expand() {\n this._animate(true);\n }\n\n collapse() {\n this._animate(false);\n }\n\n private _clickHandler(e: Event) {\n e.preventDefault();\n\n if (this.disabled) return;\n\n const shouldExpand = this._animationStatus === AnimationStatus.COLLAPSING || !this.open;\n\n if (shouldExpand) {\n this.expand();\n } else {\n this.collapse();\n }\n }\n\n protected updated(_changedProperties: PropertyValues) {\n if (_changedProperties.has(\"open\")) {\n if (this.disabled && this.open) {\n this._onAnimationFinish(false);\n return;\n }\n\n this._onToggle(this.open);\n }\n }\n\n render(): TemplateResult {\n const icon = this.icon\n ? html`<bl-icon class=\"icon\" name=${this.icon === true ? \"info\" : this.icon}></bl-icon>`\n : null;\n\n return html`<details\n ?open=${this.open}\n class=${classMap({\n accordion: true,\n disabled: this.disabled,\n })}\n >\n <summary\n class=\"summary\"\n @click=\"${this._clickHandler}\"\n aria-expanded=${this.open ? \"true\" : \"false\"}\n aria-controls=\"content\"\n aria-disabled=${this.disabled ? \"true\" : \"false\"}\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n >\n ${icon}\n <slot name=\"caption\">\n <span class=\"caption\"> ${this.caption} </span>\n </slot>\n <bl-icon name=\"arrow_down\" class=\"indicator\"></bl-icon>\n </summary>\n\n <div class=\"accord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,GA5BCb,EA4BS,yBAG5BW,EAAA,CADCL,EAAS,CAAE,KAAM,MAAO,CAAC,GA9BPN,EA+BnB,iCAMAW,EAAA,CADC,EAAM,SAAS,GApCGX,EAqCnB,yBAGAW,EAAA,CADC,EAAM,SAAS,GAvCGX,EAwCnB,yBAGAW,EAAA,CADC,EAAM,oBAAoB,GA1CRX,EA2CnB,yBA3CmBA,EAArBW,EAAA,CADCL,EAAc,cAAc,GACRN",
|
|
6
|
+
"names": ["styles", "i", "bl_accordion_default", "BlAccordion", "s", "bl_accordion_default", "isExpanding", "startHeight", "endHeight", "e", "_changedProperties", "icon", "x", "o", "__decorateClass", "stringBooleanConverter", "event"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import{a as x}from"./chunk-23PSWIUF.js";import{a as b}from"./chunk-NM74WWXQ.js";import{c as m}from"./chunk-EG7U7PM3.js";import{a as g}from"./chunk-XDUIVR6I.js";import{a as p}from"./chunk-6LT7O7T2.js";import{a as l}from"./chunk-DINNT5P2.js";import{a as n}from"./chunk-GRL4DWKG.js";import{a as f,c as y}from"./chunk-HBPBDC7T.js";import{a as u,b as i,c,e as v}from"./chunk-5MOOXA2X.js";import{a as h,b as r,f as d}from"./chunk-4OT5AMS5.js";import{d as t}from"./chunk-BWWXE4SL.js";var M=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-4xs);--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-2xs);--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)}:host([size=small]) .wrapper{--height:var(--bl-size-xl);--input-font:var(--bl-font-body-text-3);--padding-vertical:var(--bl-size-3xs)}.input-wrapper{--border-size:1px;outline:0;display:flex;box-sizing:border-box;gap:var(--padding-vertical);height:var(--height);border:solid var(--border-size) var(--border-color);padding-block:0;padding-inline:calc(var(--bl-input-padding-start,var(--padding-horizontal)) - var(--label-padding) - var(--border-size)) calc(var(--bl-input-padding-end,var(--padding-horizontal)) - var(--label-padding) - var(--border-size));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:.1s ease-in;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(var(--bl-input-padding-end,var(--padding-horizontal)) + var(--icon-size) + var(--padding-vertical))}.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-block:0;padding-inline:var(--label-padding) 0;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::-webkit-search-cancel-button{display:none}input::-moz-calendar-picker-indicator{display:none}input:autofill{background-color:var(--autofill-bg-color);box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}input:-webkit-autofill{background-color:var(--autofill-bg-color);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)}.icon:has(.clear-icon){gap:var(--bl-size-3xs)}::slotted(bl-icon),bl-icon:not(.reveal-icon,.clear-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 .4s ease-out}:host :focus-within ::placeholder,:host([label-fixed]) ::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])) .has-value label,:host(:not([label-fixed])) :focus-within label{top:0;inset-inline-start:calc(var(--bl-input-padding-start,var(--padding-horizontal)) - var(--label-padding));inset-inline-end:calc(var(--bl-input-padding-end,var(--padding-horizontal)) - var(--label-padding));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,.error-icon,.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.dirty.invalid .hint,:host([help-text]) .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.dirty.invalid .error-icon{display:inline-block}.split-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}slot[name=icon] bl-icon{margin-inline-start:var(--bl-size-3xs);font-size:var(--bl-font-size-m)}`,w=M;var H={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}async handleSearchClear(){this.value="",this.setValue(this.value),this.onInput(this.value),await this.clearCustomError(),this.validationTarget.focus()}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=H[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()?"":r`<p id="errorMessage" aria-live="polite" class="invalid-text">
|
|
2
|
+
${this.validationMessage}
|
|
3
|
+
</p>`,o=this.helpText?r`<p id="helpText" class="help-text">${this.helpText}</p>`:"",k=r`
|
|
4
|
+
<slot name="icon">
|
|
5
|
+
${this.loading&&this.type==="search"&&this.value!==""&&this.value!==null?r`<bl-spinner></bl-spinner>`:this.icon?r`<bl-icon name="${this.icon}"></bl-icon>`:r`<bl-icon class="error-icon" name="alert"></bl-icon>`}
|
|
6
|
+
</slot>
|
|
7
|
+
`,z=this.label?r`<label for=${this.inputId}>${this.label}</label>`:"",s=this.type==="password",T=s?r`<bl-button
|
|
8
|
+
size="small"
|
|
9
|
+
kind="neutral"
|
|
10
|
+
variant="tertiary"
|
|
11
|
+
class="${p({"reveal-button":!0,"password-visible":this.passwordVisible})}"
|
|
12
|
+
aria-label="Toggle password reveal"
|
|
13
|
+
@bl-click="${this.textVisibilityToggle}"
|
|
14
|
+
>
|
|
15
|
+
<bl-icon class="reveal-icon" slot="icon" name="eye_on"></bl-icon>
|
|
16
|
+
<bl-icon class="reveal-icon" slot="icon" name="eye_off"></bl-icon>
|
|
17
|
+
</bl-button>`:"",$=this.type==="search"&&this.value!==""&&this.value!==null?r`
|
|
18
|
+
<bl-button
|
|
19
|
+
size="small"
|
|
20
|
+
kind="neutral"
|
|
21
|
+
variant="tertiary"
|
|
22
|
+
aria-label="Clear search"
|
|
23
|
+
icon="close"
|
|
24
|
+
@bl-click=${this.handleSearchClear}
|
|
25
|
+
>
|
|
26
|
+
</bl-button>
|
|
27
|
+
<div class="split-divider"></div>
|
|
28
|
+
`:"",V=this.icon||this._hasIconSlot,C={wrapper:!0,dirty:this.dirty,invalid:!this.checkValidity(),"has-icon":s||V||this.dirty&&!this.checkValidity(),"has-value":this.value!==null&&this.value!==""},E=this.passwordVisible?"text":"password",S=s?E:this.type;return r`<div class=${p(C)}>
|
|
29
|
+
${z}
|
|
30
|
+
<fieldset class="input-wrapper">
|
|
31
|
+
<legend><span>${this.label}</span></legend>
|
|
32
|
+
<input
|
|
33
|
+
id=${this.inputId}
|
|
34
|
+
type=${S}
|
|
35
|
+
.value=${m(this.value)}
|
|
36
|
+
inputmode="${l(this.inputmode)}"
|
|
37
|
+
?autofocus=${this.autofocus}
|
|
38
|
+
.autocomplete="${this.autocomplete}"
|
|
39
|
+
placeholder="${l(this.placeholder)}"
|
|
40
|
+
minlength="${l(this.minlength)}"
|
|
41
|
+
maxlength="${l(this.maxlength)}"
|
|
42
|
+
min="${l(this.min)}"
|
|
43
|
+
max="${l(this.max)}"
|
|
44
|
+
pattern="${l(this.pattern)}"
|
|
45
|
+
step="${l(this.step)}"
|
|
46
|
+
?required=${this.required}
|
|
47
|
+
?disabled=${this.disabled}
|
|
48
|
+
?readonly=${this.readonly}
|
|
49
|
+
@change=${this.changeHandler}
|
|
50
|
+
@input=${this.inputHandler}
|
|
51
|
+
aria-invalid=${this.checkValidity()?"false":"true"}
|
|
52
|
+
aria-describedby=${l(this.helpText?"helpText":void 0)}
|
|
53
|
+
aria-errormessage=${l(this.checkValidity()?void 0:"errorMessage")}
|
|
54
|
+
/>
|
|
55
|
+
<div class="icon">${T} ${$} ${k}</div>
|
|
56
|
+
</fieldset>
|
|
57
|
+
<div class="hint">${a} ${o}</div>
|
|
58
|
+
</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};
|
|
59
|
+
//# sourceMappingURL=chunk-KTG566MB.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-4xs);--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-2xs);--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)}:host([size=small]) .wrapper{--height:var(--bl-size-xl);--input-font:var(--bl-font-body-text-3);--padding-vertical:var(--bl-size-3xs)}.input-wrapper{--border-size:1px;outline:0;display:flex;box-sizing:border-box;gap:var(--padding-vertical);height:var(--height);border:solid var(--border-size) var(--border-color);padding-block:0;padding-inline:calc(var(--bl-input-padding-start,var(--padding-horizontal)) - var(--label-padding) - var(--border-size)) calc(var(--bl-input-padding-end,var(--padding-horizontal)) - var(--label-padding) - var(--border-size));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:.1s ease-in;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(var(--bl-input-padding-end,var(--padding-horizontal)) + var(--icon-size) + var(--padding-vertical))}.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-block:0;padding-inline:var(--label-padding) 0;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::-webkit-search-cancel-button{display:none}input::-moz-calendar-picker-indicator{display:none}input:autofill{background-color:var(--autofill-bg-color);box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}input:-webkit-autofill{background-color:var(--autofill-bg-color);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)}.icon:has(.clear-icon){gap:var(--bl-size-3xs)}::slotted(bl-icon),bl-icon:not(.reveal-icon,.clear-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 .4s ease-out}:host :focus-within ::placeholder,:host([label-fixed]) ::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])) .has-value label,:host(:not([label-fixed])) :focus-within label{top:0;inset-inline-start:calc(var(--bl-input-padding-start,var(--padding-horizontal)) - var(--label-padding));inset-inline-end:calc(var(--bl-input-padding-end,var(--padding-horizontal)) - var(--label-padding));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,.error-icon,.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.dirty.invalid .hint,:host([help-text]) .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.dirty.invalid .error-icon{display:inline-block}.split-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}slot[name=icon] bl-icon{margin-inline-start:var(--bl-size-3xs);font-size:var(--bl-font-size-m)}`;\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 { 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 private async handleSearchClear() {\n this.value = \"\";\n this.setValue(this.value);\n this.onInput(this.value);\n\n await this.clearCustomError();\n this.validationTarget.focus();\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 clearSearchButton =\n this.type === \"search\" && this.value !== \"\" && this.value !== null\n ? html`\n <bl-button\n size=\"small\"\n kind=\"neutral\"\n variant=\"tertiary\"\n aria-label=\"Clear search\"\n icon=\"close\"\n @bl-click=${this.handleSearchClear}\n >\n </bl-button>\n <div class=\"split-divider\"></div>\n `\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} ${clearSearchButton} ${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,4xLACfC,EAAQF,EC4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tB5B,EA2JnB,qBAQA0B,EAAA,CADCE,EAAS,CAAE,KAAM,OAAQ,UAAW,YAAa,QAAS,EAAK,CAAC,GAlK9C5B,EAmKnB,wBAK4B0B,EAAA,CAA3BvB,EAAM,WAAW,GAxKCH,EAwKS,wBAKD0B,EAAA,CAA1BvB,EAAM,UAAU,GA7KEH,EA6KQ,uBAKE0B,EAAA,CAA5BvB,EAAM,YAAY,GAlLAH,EAkLU,yBA0BZ0B,EAAA,CAAhBG,EAAM,GA5MY7B,EA4MF,qBAEA0B,EAAA,CAAhBG,EAAM,GA9MY7B,EA8MF,+BA9MEA,EAArB0B,EAAA,CAFCE,EAAc,UAAU,EACxBE,EAAU,GACU9B",
|
|
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", "clearSearchButton", "hasCustomIcon", "classes", "passwordType", "inputType", "l", "innerInputValidators", "__decorateClass", "i", "e", "t", "localized"]
|
|
7
|
+
}
|
|
@@ -30,6 +30,7 @@ export default class BlAccordion extends LitElement {
|
|
|
30
30
|
summaryEl: HTMLElement;
|
|
31
31
|
contentEl: HTMLElement;
|
|
32
32
|
static get styles(): CSSResultGroup;
|
|
33
|
+
private _cleanupStyles;
|
|
33
34
|
_animate(isExpanding: boolean): void;
|
|
34
35
|
private _onAnimationFinish;
|
|
35
36
|
expand(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bl-accordion.d.ts","sourceRoot":"","sources":["../../../../src/components/accordion-group/accordion/bl-accordion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAEvE,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAIjD,OAAO,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW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xD,SAAS,EAAE,kBAAkB,CAAC;IAG9B,SAAS,EAAE,WAAW,CAAC;IAGvB,SAAS,EAAE,WAAW,CAAC;IAEvB,MAAM,KAAK,MAAM,IAAI,cAAc,CAElC;IAED,OAAO,CAAC,cAAc;IAOtB,QAAQ,CAAC,WAAW,EAAE,OAAO;IAsD7B,OAAO,CAAC,kBAAkB;IAW1B,MAAM;IAIN,QAAQ;IAIR,OAAO,CAAC,aAAa;IAcrB,SAAS,CAAC,OAAO,CAAC,kBAAkB,EAAE,cAAc;IAWpD,MAAM,IAAI,cAAc;CAgCzB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../../chunk-
|
|
1
|
+
import{a}from"../../../chunk-IR2QY2VG.js";import"../../../chunk-ECPWEUBG.js";import"../../../chunk-6LT7O7T2.js";import"../../../chunk-3OQA4BKQ.js";import"../../../chunk-GRL4DWKG.js";import"../../../chunk-3USCFSFQ.js";import"../../../chunk-7GK5LKBV.js";import"../../../chunk-5MOOXA2X.js";import"../../../chunk-4OT5AMS5.js";import"../../../chunk-BWWXE4SL.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-accordion.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bl-accordion-group.test.d.ts","sourceRoot":"","sources":["../../../src/components/accordion-group/bl-accordion-group.test.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bl-accordion-group.test.d.ts","sourceRoot":"","sources":["../../../src/components/accordion-group/bl-accordion-group.test.ts"],"names":[],"mappings":"AACA,OAAO,0BAA0B,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-C2UDBDKV.js";import"../../chunk-BCRV6HG6.js";import"../../chunk-RCHKJINV.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-C2UDBDKV.js";import"../../chunk-BCRV6HG6.js";import"../../chunk-RCHKJINV.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-KTG566MB.js";import"../../chunk-23PSWIUF.js";import"../../chunk-IEFQ6PGY.js";import"../../chunk-IPYZIIRV.js";import"../../chunk-NM74WWXQ.js";import"../../chunk-OYHUG47P.js";import"../../chunk-WEEGH2F4.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-3OQA4BKQ.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-HBPBDC7T.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-BWWXE4SL.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-datepicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-KTG566MB.js";import"../../chunk-23PSWIUF.js";import"../../chunk-NM74WWXQ.js";import"../../chunk-OYHUG47P.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-3OQA4BKQ.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-HBPBDC7T.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-BWWXE4SL.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-input.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-P4S537UY.js";import"../../chunk-2Q566BEQ.js";import"../../chunk-H6EUN6QV.js";import"../../chunk-ECPWEUBG.js";import"../../chunk-6XM52E7W.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-P4S537UY.js";import"../../chunk-2Q566BEQ.js";import"../../chunk-H6EUN6QV.js";import"../../chunk-ECPWEUBG.js";import"../../chunk-6XM52E7W.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-KTG566MB.js";import"../../chunk-23PSWIUF.js";import"../../chunk-IPYZIIRV.js";import"../../chunk-NM74WWXQ.js";import"../../chunk-OYHUG47P.js";import"../../chunk-EG7U7PM3.js";import"../../chunk-AYJMIZZ3.js";import"../../chunk-XDUIVR6I.js";import"../../chunk-HZ6A5QFC.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-3OQA4BKQ.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-HBPBDC7T.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-BWWXE4SL.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-pagination.js.map
|
|
@@ -253,6 +253,11 @@
|
|
|
253
253
|
"text": "HTMLElement"
|
|
254
254
|
}
|
|
255
255
|
},
|
|
256
|
+
{
|
|
257
|
+
"kind": "method",
|
|
258
|
+
"name": "_cleanupStyles",
|
|
259
|
+
"privacy": "private"
|
|
260
|
+
},
|
|
256
261
|
{
|
|
257
262
|
"kind": "method",
|
|
258
263
|
"name": "_animate",
|
|
@@ -271,7 +276,7 @@
|
|
|
271
276
|
"privacy": "private",
|
|
272
277
|
"parameters": [
|
|
273
278
|
{
|
|
274
|
-
"name": "
|
|
279
|
+
"name": "isExpanding",
|
|
275
280
|
"type": {
|
|
276
281
|
"text": "boolean"
|
|
277
282
|
}
|
package/package.json
CHANGED
package/dist/chunk-ETFCJRBG.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import{a as x}from"./chunk-23PSWIUF.js";import{a as b}from"./chunk-NM74WWXQ.js";import{c as m}from"./chunk-EG7U7PM3.js";import{a as g}from"./chunk-XDUIVR6I.js";import{a as p}from"./chunk-6LT7O7T2.js";import{a as l}from"./chunk-DINNT5P2.js";import{a as n}from"./chunk-GRL4DWKG.js";import{a as f,c as y}from"./chunk-HBPBDC7T.js";import{a as u,b as i,c,e as v}from"./chunk-5MOOXA2X.js";import{a as h,b as r,f as d}from"./chunk-4OT5AMS5.js";import{d as t}from"./chunk-BWWXE4SL.js";var M=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-4xs);--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-2xs);--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)}:host([size=small]) .wrapper{--height:var(--bl-size-xl);--input-font:var(--bl-font-body-text-3);--padding-vertical:var(--bl-size-3xs)}.input-wrapper{--border-size:1px;outline:0;display:flex;box-sizing:border-box;gap:var(--padding-vertical);height:var(--height);border:solid var(--border-size) var(--border-color);padding:0 calc(var(--bl-input-padding-end,var(--padding-horizontal)) - var(--label-padding) - var(--border-size)) 0 calc(var(--bl-input-padding-start,var(--padding-horizontal)) - var(--label-padding) - var(--border-size));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:.1s ease-in;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(var(--bl-input-padding-end,var(--padding-horizontal)) + var(--icon-size) + var(--padding-vertical))}.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::-webkit-search-cancel-button{display:none}input::-moz-calendar-picker-indicator{display:none}input:autofill{background-color:var(--autofill-bg-color);box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}input:-webkit-autofill{background-color:var(--autofill-bg-color);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)}.icon:has(.clear-icon){gap:var(--bl-size-3xs)}::slotted(bl-icon),bl-icon:not(.reveal-icon,.clear-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 .4s ease-out}:host :focus-within ::placeholder,:host([label-fixed]) ::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])) .has-value label,:host(:not([label-fixed])) :focus-within label{top:0;inset-inline-start:calc(var(--bl-input-padding-start,var(--padding-horizontal)) - var(--label-padding));inset-inline-end:calc(var(--bl-input-padding-end,var(--padding-horizontal)) - var(--label-padding));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,.error-icon,.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.dirty.invalid .hint,:host([help-text]) .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.dirty.invalid .error-icon{display:inline-block}.split-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}slot[name=icon] bl-icon{margin-inline-start:var(--bl-size-3xs);font-size:var(--bl-font-size-m)}`,w=M;var H={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}async handleSearchClear(){this.value="",this.setValue(this.value),this.onInput(this.value),await this.clearCustomError(),this.validationTarget.focus()}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=H[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()?"":r`<p id="errorMessage" aria-live="polite" class="invalid-text">
|
|
2
|
-
${this.validationMessage}
|
|
3
|
-
</p>`,o=this.helpText?r`<p id="helpText" class="help-text">${this.helpText}</p>`:"",k=r`
|
|
4
|
-
<slot name="icon">
|
|
5
|
-
${this.loading&&this.type==="search"&&this.value!==""&&this.value!==null?r`<bl-spinner></bl-spinner>`:this.icon?r`<bl-icon name="${this.icon}"></bl-icon>`:r`<bl-icon class="error-icon" name="alert"></bl-icon>`}
|
|
6
|
-
</slot>
|
|
7
|
-
`,z=this.label?r`<label for=${this.inputId}>${this.label}</label>`:"",s=this.type==="password",T=s?r`<bl-button
|
|
8
|
-
size="small"
|
|
9
|
-
kind="neutral"
|
|
10
|
-
variant="tertiary"
|
|
11
|
-
class="${p({"reveal-button":!0,"password-visible":this.passwordVisible})}"
|
|
12
|
-
aria-label="Toggle password reveal"
|
|
13
|
-
@bl-click="${this.textVisibilityToggle}"
|
|
14
|
-
>
|
|
15
|
-
<bl-icon class="reveal-icon" slot="icon" name="eye_on"></bl-icon>
|
|
16
|
-
<bl-icon class="reveal-icon" slot="icon" name="eye_off"></bl-icon>
|
|
17
|
-
</bl-button>`:"",$=this.type==="search"&&this.value!==""&&this.value!==null?r`
|
|
18
|
-
<bl-button
|
|
19
|
-
size="small"
|
|
20
|
-
kind="neutral"
|
|
21
|
-
variant="tertiary"
|
|
22
|
-
aria-label="Clear search"
|
|
23
|
-
icon="close"
|
|
24
|
-
@bl-click=${this.handleSearchClear}
|
|
25
|
-
>
|
|
26
|
-
</bl-button>
|
|
27
|
-
<div class="split-divider"></div>
|
|
28
|
-
`:"",V=this.icon||this._hasIconSlot,C={wrapper:!0,dirty:this.dirty,invalid:!this.checkValidity(),"has-icon":s||V||this.dirty&&!this.checkValidity(),"has-value":this.value!==null&&this.value!==""},E=this.passwordVisible?"text":"password",S=s?E:this.type;return r`<div class=${p(C)}>
|
|
29
|
-
${z}
|
|
30
|
-
<fieldset class="input-wrapper">
|
|
31
|
-
<legend><span>${this.label}</span></legend>
|
|
32
|
-
<input
|
|
33
|
-
id=${this.inputId}
|
|
34
|
-
type=${S}
|
|
35
|
-
.value=${m(this.value)}
|
|
36
|
-
inputmode="${l(this.inputmode)}"
|
|
37
|
-
?autofocus=${this.autofocus}
|
|
38
|
-
.autocomplete="${this.autocomplete}"
|
|
39
|
-
placeholder="${l(this.placeholder)}"
|
|
40
|
-
minlength="${l(this.minlength)}"
|
|
41
|
-
maxlength="${l(this.maxlength)}"
|
|
42
|
-
min="${l(this.min)}"
|
|
43
|
-
max="${l(this.max)}"
|
|
44
|
-
pattern="${l(this.pattern)}"
|
|
45
|
-
step="${l(this.step)}"
|
|
46
|
-
?required=${this.required}
|
|
47
|
-
?disabled=${this.disabled}
|
|
48
|
-
?readonly=${this.readonly}
|
|
49
|
-
@change=${this.changeHandler}
|
|
50
|
-
@input=${this.inputHandler}
|
|
51
|
-
aria-invalid=${this.checkValidity()?"false":"true"}
|
|
52
|
-
aria-describedby=${l(this.helpText?"helpText":void 0)}
|
|
53
|
-
aria-errormessage=${l(this.checkValidity()?void 0:"errorMessage")}
|
|
54
|
-
/>
|
|
55
|
-
<div class="icon">${T} ${$} ${k}</div>
|
|
56
|
-
</fieldset>
|
|
57
|
-
<div class="hint">${a} ${o}</div>
|
|
58
|
-
</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};
|
|
59
|
-
//# sourceMappingURL=chunk-ETFCJRBG.js.map
|
|
@@ -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-4xs);--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-2xs);--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)}:host([size=small]) .wrapper{--height:var(--bl-size-xl);--input-font:var(--bl-font-body-text-3);--padding-vertical:var(--bl-size-3xs)}.input-wrapper{--border-size:1px;outline:0;display:flex;box-sizing:border-box;gap:var(--padding-vertical);height:var(--height);border:solid var(--border-size) var(--border-color);padding:0 calc(var(--bl-input-padding-end,var(--padding-horizontal)) - var(--label-padding) - var(--border-size)) 0 calc(var(--bl-input-padding-start,var(--padding-horizontal)) - var(--label-padding) - var(--border-size));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:.1s ease-in;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(var(--bl-input-padding-end,var(--padding-horizontal)) + var(--icon-size) + var(--padding-vertical))}.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::-webkit-search-cancel-button{display:none}input::-moz-calendar-picker-indicator{display:none}input:autofill{background-color:var(--autofill-bg-color);box-shadow:0 0 0 40rem var(--autofill-bg-color) inset}input:-webkit-autofill{background-color:var(--autofill-bg-color);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)}.icon:has(.clear-icon){gap:var(--bl-size-3xs)}::slotted(bl-icon),bl-icon:not(.reveal-icon,.clear-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 .4s ease-out}:host :focus-within ::placeholder,:host([label-fixed]) ::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])) .has-value label,:host(:not([label-fixed])) :focus-within label{top:0;inset-inline-start:calc(var(--bl-input-padding-start,var(--padding-horizontal)) - var(--label-padding));inset-inline-end:calc(var(--bl-input-padding-end,var(--padding-horizontal)) - var(--label-padding));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,.error-icon,.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.dirty.invalid .hint,:host([help-text]) .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.dirty.invalid .error-icon{display:inline-block}.split-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}slot[name=icon] bl-icon{margin-inline-start:var(--bl-size-3xs);font-size:var(--bl-font-size-m)}`;\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 { 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 private async handleSearchClear() {\n this.value = \"\";\n this.setValue(this.value);\n this.onInput(this.value);\n\n await this.clearCustomError();\n this.validationTarget.focus();\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 clearSearchButton =\n this.type === \"search\" && this.value !== \"\" && this.value !== null\n ? html`\n <bl-button\n size=\"small\"\n kind=\"neutral\"\n variant=\"tertiary\"\n aria-label=\"Clear search\"\n icon=\"close\"\n @bl-click=${this.handleSearchClear}\n >\n </bl-button>\n <div class=\"split-divider\"></div>\n `\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} ${clearSearchButton} ${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,svLACfC,EAAQF,EC4Bf,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,GAqGnC,KAAQ,QAAU,KAAK,OAAO,EAAE,SAAS,EAAE,EAAE,UAAU,CAAC,EAlTxD,WAAW,QAAyB,CAClC,MAAO,CAACC,CAA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EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAxGvB5B,EAyGnB,yBAMA0B,EAAA,CADCE,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GA9GtB5B,EA+GnB,oBAMA0B,EAAA,CADCE,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GApHtB5B,EAqHnB,oBAMA0B,EAAA,CADCE,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GA1HvB5B,EA2HnB,wBAMA0B,EAAA,CADCE,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAhIvB5B,EAiInB,wBAMA0B,EAAA,CADCE,EAAS,CAAE,KAAM,QAAS,UAAW,cAAe,QAAS,EAAK,CAAC,GAtIjD5B,EAuInB,0BAOI0B,EAAA,CADHE,EAAS,CAAE,KAAM,OAAQ,UAAW,eAAgB,QAAS,EAAK,CAAC,GA7IjD5B,EA8If,iCAaJ0B,EAAA,CADCE,EAAS,CAAE,QAAS,GAAM,KAAM,MAAO,CAAC,GA1JtB5B,EA2JnB,qBAQA0B,EAAA,CADCE,EAAS,CAAE,KAAM,OAAQ,UAAW,YAAa,QAAS,EAAK,CAAC,GAlK9C5B,EAmKnB,wBAK4B0B,EAAA,CAA3BvB,EAAM,WAAW,GAxKCH,EAwKS,wBAKD0B,EAAA,CAA1BvB,EAAM,UAAU,GA7KEH,EA6KQ,uBAKE0B,EAAA,CAA5BvB,EAAM,YAAY,GAlLAH,EAkLU,yBA0BZ0B,EAAA,CAAhBG,EAAM,GA5MY7B,EA4MF,qBAEA0B,EAAA,CAAhBG,EAAM,GA9MY7B,EA8MF,+BA9MEA,EAArB0B,EAAA,CAFCE,EAAc,UAAU,EACxBE,EAAU,GACU9B",
|
|
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", "clearSearchButton", "hasCustomIcon", "classes", "passwordType", "inputType", "l", "innerInputValidators", "__decorateClass", "i", "e", "t", "localized"]
|
|
7
|
-
}
|
package/dist/chunk-EXUCTLBU.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk-ECPWEUBG.js";import{a as d}from"./chunk-6LT7O7T2.js";import{a as u}from"./chunk-GRL4DWKG.js";import{a as l,b as o,e as i}from"./chunk-5MOOXA2X.js";import{a as s,b as r,f as n}from"./chunk-4OT5AMS5.js";import{d as e}from"./chunk-BWWXE4SL.js";var p=s`:host{display:block}.accordion{--border:1px solid var(--bl-color-neutral-lighter);--default-radius:var(--bl-size-2xs);--radius-top-left:var(--bl-accordion-radius-top-left, var(--default-radius));--radius-top-right:var(--bl-accordion-radius-top-right, var(--default-radius));--radius-bottom-right:var(--bl-accordion-radius-bottom-right, var(--default-radius));--radius-bottom-left:var(--bl-accordion-radius-bottom-left, var(--default-radius));width:100%}.summary{list-style:none;user-select:none;cursor:pointer;font:var(--bl-font-title-3-medium);display:flex;align-items:center;justify-content:space-between;gap:var(--bl-size-2xs);padding:var(--bl-size-m);background:var(--bl-color-neutral-full);color:var(--bl-color-neutral-darker);border:var(--border);border-bottom:var(--bl-accordion-border-bottom,var(--border));border-radius:var(--radius-top-left) var(--radius-top-right) var(--radius-bottom-right) var(--radius-bottom-left);transition:background-color .2s}.summary::-webkit-details-marker{display:none}.summary.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__,.summary:hover{background:var(--bl-color-neutral-lightest)}.summary:focus-visible{outline:2px solid var(--bl-color-primary);outline-offset:-1px}.indicator{transition:transform .2s}.accordion[open] .indicator{transform:rotate(180deg)}.accordion[open] .summary{border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.caption{flex:1}.accordion-content{padding:var(--bl-size-m);background:var(--bl-color-neutral-full);border:var(--border);border-top:0;border-bottom:var(--bl-accordion-border-bottom,var(--border));border-bottom-left-radius:var(--radius-bottom-left);border-bottom-right-radius:var(--radius-bottom-right);font:var(--bl-font-body-text-2-regular)}.disabled .summary{cursor:not-allowed;background:var(--bl-color-neutral-lightest);color:var(--bl-color-neutral-light)}.accordion:not([open]) .accordion-content{display:none}`,c=p;var t=class extends n{constructor(){super(...arguments);this.open=!1;this.disabled=!1;this.animationDuration=250;this._animationStatus=null}static get styles(){return[c]}_animate(a){this._animationStatus=a?0:1;let b=`${this.detailsEl.offsetHeight}px`,h=a?`${this.summaryEl.offsetHeight+this.contentEl.offsetHeight}px`:`${this.summaryEl.offsetHeight}px`;this._animation&&this._animation.cancel(),this._animation=this.detailsEl.animate({height:[b,h]},{duration:this.animationDuration,easing:"ease-out"}),this._animation.onfinish=()=>this._onAnimationFinish(a),this._animation.oncancel=()=>this._animationStatus=null}_onAnimationFinish(a){this.open=a,this._animation=null,this._animationStatus=null,this.detailsEl.style.height=this.detailsEl.style.overflow=""}expand(){this.detailsEl.style.overflow="hidden",this.detailsEl.style.height=`${this.detailsEl.offsetHeight}px`,this.open=!0,this._animate(!0)}collapse(){this._animate(!1)}_clickHandler(a){a.preventDefault(),!this.disabled&&(this._animationStatus===1||!this.open?this.expand():(this._animationStatus===0||this.open)&&this.collapse())}updated(a){if(a.has("open")){if(this.disabled&&this.open){this._onAnimationFinish(!1);return}this._onToggle(this.open)}}render(){let a=this.icon?r`<bl-icon class="icon" name=${this.icon===!0?"info":this.icon}></bl-icon>`:null;return r`<details
|
|
2
|
-
?open=${this.open}
|
|
3
|
-
class=${d({accordion:!0,disabled:this.disabled})}
|
|
4
|
-
>
|
|
5
|
-
<summary
|
|
6
|
-
class="summary"
|
|
7
|
-
@click="${this._clickHandler}"
|
|
8
|
-
aria-expanded=${this.open?"true":"false"}
|
|
9
|
-
aria-controls="content"
|
|
10
|
-
aria-disabled=${this.disabled?"true":"false"}
|
|
11
|
-
tabindex=${this.disabled?"-1":"0"}
|
|
12
|
-
>
|
|
13
|
-
${a}
|
|
14
|
-
<slot name="caption">
|
|
15
|
-
<span class="caption"> ${this.caption} </span>
|
|
16
|
-
</slot>
|
|
17
|
-
<bl-icon name="arrow_down" class="indicator"></bl-icon>
|
|
18
|
-
</summary>
|
|
19
|
-
|
|
20
|
-
<div class="accordion-content" role="region" aria-labelledby="header" id="content">
|
|
21
|
-
<slot></slot>
|
|
22
|
-
</div>
|
|
23
|
-
</details>`}};e([o({reflect:!0,type:Boolean})],t.prototype,"open",2),e([o({reflect:!0})],t.prototype,"caption",2),e([o({converter:m()})],t.prototype,"icon",2),e([o({reflect:!0,type:Boolean})],t.prototype,"disabled",2),e([u("bl-toggle")],t.prototype,"_onToggle",2),e([o({type:Number})],t.prototype,"animationDuration",2),e([i("details")],t.prototype,"detailsEl",2),e([i("summary")],t.prototype,"summaryEl",2),e([i(".accordion-content")],t.prototype,"contentEl",2),t=e([l("bl-accordion")],t);export{t as a};
|
|
24
|
-
//# sourceMappingURL=chunk-EXUCTLBU.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/accordion-group/accordion/bl-accordion.css", "../src/components/accordion-group/accordion/bl-accordion.ts"],
|
|
4
|
-
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:block}.accordion{--border:1px solid var(--bl-color-neutral-lighter);--default-radius:var(--bl-size-2xs);--radius-top-left:var(--bl-accordion-radius-top-left, var(--default-radius));--radius-top-right:var(--bl-accordion-radius-top-right, var(--default-radius));--radius-bottom-right:var(--bl-accordion-radius-bottom-right, var(--default-radius));--radius-bottom-left:var(--bl-accordion-radius-bottom-left, var(--default-radius));width:100%}.summary{list-style:none;user-select:none;cursor:pointer;font:var(--bl-font-title-3-medium);display:flex;align-items:center;justify-content:space-between;gap:var(--bl-size-2xs);padding:var(--bl-size-m);background:var(--bl-color-neutral-full);color:var(--bl-color-neutral-darker);border:var(--border);border-bottom:var(--bl-accordion-border-bottom,var(--border));border-radius:var(--radius-top-left) var(--radius-top-right) var(--radius-bottom-right) var(--radius-bottom-left);transition:background-color .2s}.summary::-webkit-details-marker{display:none}.summary.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__,.summary:hover{background:var(--bl-color-neutral-lightest)}.summary:focus-visible{outline:2px solid var(--bl-color-primary);outline-offset:-1px}.indicator{transition:transform .2s}.accordion[open] .indicator{transform:rotate(180deg)}.accordion[open] .summary{border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.caption{flex:1}.accordion-content{padding:var(--bl-size-m);background:var(--bl-color-neutral-full);border:var(--border);border-top:0;border-bottom:var(--bl-accordion-border-bottom,var(--border));border-bottom-left-radius:var(--radius-bottom-left);border-bottom-right-radius:var(--radius-bottom-right);font:var(--bl-font-body-text-2-regular)}.disabled .summary{cursor:not-allowed;background:var(--bl-color-neutral-lightest);color:var(--bl-color-neutral-light)}.accordion:not([open]) .accordion-content{display:none}`;\nexport default styles;\n", "import { html, LitElement, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, query } from \"lit/decorators.js\";\nimport { CSSResultGroup } from \"lit/development\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { event, EventDispatcher } from \"../../../utilities/event\";\nimport { stringBooleanConverter } from \"../../../utilities/string-boolean.converter\";\nimport \"../../icon/bl-icon\";\nimport { BaklavaIcon } from \"../../icon/icon-list\";\nimport style from \"./bl-accordion.css\";\n\nenum AnimationStatus {\n EXPANDING,\n COLLAPSING,\n}\n\n@customElement(\"bl-accordion\")\nexport default class BlAccordion extends LitElement {\n /**\n * Whether the accordion is expanded\n */\n @property({ reflect: true, type: Boolean })\n open = false;\n\n /**\n * Sets accordion caption.\n */\n @property({ reflect: true })\n caption?: string;\n\n /**\n * Add icon to beginning of the title\n */\n @property({ converter: stringBooleanConverter() })\n icon?: boolean | BaklavaIcon;\n\n /**\n * Whether the accordion is disabled\n */\n @property({ reflect: true, type: Boolean })\n disabled = false;\n\n /**\n * Fires when accordion open state change.\n */\n @event(\"bl-toggle\") private _onToggle: EventDispatcher<boolean>;\n\n @property({ type: Number })\n animationDuration = 250;\n\n private _animation: Animation | null;\n private _animationStatus: AnimationStatus | null = null;\n\n @query(\"details\")\n detailsEl: HTMLDetailsElement;\n\n @query(\"summary\")\n summaryEl: HTMLElement;\n\n @query(\".accordion-content\")\n contentEl: HTMLElement;\n\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n _animate(isExpanding: boolean) {\n this._animationStatus = isExpanding ? AnimationStatus.EXPANDING : AnimationStatus.COLLAPSING;\n\n const startHeight = `${this.detailsEl.offsetHeight}px`;\n const endHeight = isExpanding\n ? `${this.summaryEl.offsetHeight + this.contentEl.offsetHeight}px`\n : `${this.summaryEl.offsetHeight}px`;\n\n if (this._animation) {\n this._animation.cancel();\n }\n\n this._animation = this.detailsEl.animate(\n {\n height: [startHeight, endHeight],\n },\n {\n duration: this.animationDuration,\n easing: \"ease-out\",\n }\n );\n\n this._animation.onfinish = () => this._onAnimationFinish(isExpanding);\n this._animation.oncancel = () => (this._animationStatus = null);\n }\n\n private _onAnimationFinish(open: boolean) {\n this.open = open;\n this._animation = null;\n this._animationStatus = null;\n this.detailsEl.style.height = this.detailsEl.style.overflow = \"\";\n }\n\n expand() {\n this.detailsEl.style.overflow = \"hidden\";\n this.detailsEl.style.height = `${this.detailsEl.offsetHeight}px`;\n this.open = true;\n this._animate(true);\n }\n\n collapse() {\n this._animate(false);\n }\n\n private _clickHandler(e: Event) {\n e.preventDefault();\n\n if (this.disabled) return;\n\n if (this._animationStatus === AnimationStatus.COLLAPSING || !this.open) {\n this.expand();\n } else if (this._animationStatus === AnimationStatus.EXPANDING || this.open) {\n this.collapse();\n }\n }\n\n protected updated(_changedProperties: PropertyValues) {\n if (_changedProperties.has(\"open\")) {\n if (this.disabled && this.open) {\n this._onAnimationFinish(false);\n return;\n }\n\n this._onToggle(this.open);\n }\n }\n\n render(): TemplateResult {\n const icon = this.icon\n ? html`<bl-icon class=\"icon\" name=${this.icon === true ? \"info\" : this.icon}></bl-icon>`\n : null;\n\n return html`<details\n ?open=${this.open}\n class=${classMap({\n accordion: true,\n disabled: this.disabled,\n })}\n >\n <summary\n class=\"summary\"\n @click=\"${this._clickHandler}\"\n aria-expanded=${this.open ? \"true\" : \"false\"}\n aria-controls=\"content\"\n aria-disabled=${this.disabled ? \"true\" : \"false\"}\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n >\n ${icon}\n <slot name=\"caption\">\n <span class=\"caption\"> ${this.caption} </span>\n </slot>\n <bl-icon name=\"arrow_down\" class=\"indicator\"></bl-icon>\n </summary>\n\n <div class=\"accordion-content\" role=\"region\" aria-labelledby=\"header\" id=\"content\">\n <slot></slot>\n </div>\n </details>`;\n }\n}\n"],
|
|
5
|
-
"mappings": "4QACO,IAAMA,EAASC,s3DACfC,EAAQF,ECcf,IAAqBG,EAArB,cAAyCC,CAAW,CAApD,kCAKE,UAAO,GAkBP,cAAW,GAQX,uBAAoB,IAGpB,KAAQ,iBAA2C,KAWnD,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAEA,SAASC,EAAsB,CAC7B,KAAK,iBAAmBA,EAAc,EAA4B,EAElE,IAAMC,EAAc,GAAG,KAAK,UAAU,iBAChCC,EAAYF,EACd,GAAG,KAAK,UAAU,aAAe,KAAK,UAAU,iBAChD,GAAG,KAAK,UAAU,iBAElB,KAAK,YACP,KAAK,WAAW,OAAO,EAGzB,KAAK,WAAa,KAAK,UAAU,QAC/B,CACE,OAAQ,CAACC,EAAaC,CAAS,CACjC,EACA,CACE,SAAU,KAAK,kBACf,OAAQ,UACV,CACF,EAEA,KAAK,WAAW,SAAW,IAAM,KAAK,mBAAmBF,CAAW,EACpE,KAAK,WAAW,SAAW,IAAO,KAAK,iBAAmB,IAC5D,CAEQ,mBAAmBG,EAAe,CACxC,KAAK,KAAOA,EACZ,KAAK,WAAa,KAClB,KAAK,iBAAmB,KACxB,KAAK,UAAU,MAAM,OAAS,KAAK,UAAU,MAAM,SAAW,EAChE,CAEA,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B,wBAK4BY,EAAA,CAA3BE,EAAM,WAAW,GA5BCd,EA4BS,yBAG5BY,EAAA,CADCL,EAAS,CAAE,KAAM,MAAO,CAAC,GA9BPP,EA+BnB,iCAMAY,EAAA,CADC,EAAM,SAAS,GApCGZ,EAqCnB,yBAGAY,EAAA,CADC,EAAM,SAAS,GAvCGZ,EAwCnB,yBAGAY,EAAA,CADC,EAAM,oBAAoB,GA1CRZ,EA2CnB,yBA3CmBA,EAArBY,EAAA,CADCL,EAAc,cAAc,GACRP",
|
|
6
|
-
"names": ["styles", "i", "bl_accordion_default", "BlAccordion", "s", "bl_accordion_default", "isExpanding", "startHeight", "endHeight", "open", "e", "_changedProperties", "icon", "x", "o", "__decorateClass", "stringBooleanConverter", "event"]
|
|
7
|
-
}
|