@trendyol/baklava 3.5.0-beta.5 → 3.5.0-beta.7
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-2ARF4VOQ.js +53 -0
- package/dist/chunk-2ARF4VOQ.js.map +7 -0
- package/dist/chunk-EFOTKJY4.js +80 -0
- package/dist/chunk-EFOTKJY4.js.map +7 -0
- package/dist/{chunk-CNJCPUQL.js → chunk-NODTAMYY.js} +2 -2
- package/dist/{chunk-CNJCPUQL.js.map → chunk-NODTAMYY.js.map} +3 -3
- package/dist/components/calendar/bl-calendar.js +1 -1
- package/dist/components/datepicker/bl-datepicker.js +1 -1
- package/dist/components/pagination/bl-pagination.js +1 -1
- package/dist/components/select/bl-select.d.ts.map +1 -1
- package/dist/components/select/bl-select.js +1 -1
- package/dist/custom-elements.json +1 -0
- package/dist/utilities/format-to-date-array.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-M3UQBIAS.js +0 -53
- package/dist/chunk-M3UQBIAS.js.map +0 -7
- package/dist/chunk-T7ECITFD.js +0 -80
- package/dist/chunk-T7ECITFD.js.map +0 -7
package/dist/baklava.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as F}from"./chunk-2JDJGZRM.js";import{b as J}from"./chunk-CNWKBBJJ.js";import{b as E}from"./chunk-L5U5XRNP.js";import{b as j}from"./chunk-X2MSD7NS.js";import{b as q}from"./chunk-J5YZ4HBV.js";import{a as M}from"./chunk-G4DOH6BQ.js";import{a as Q}from"./chunk-STZJ3LBU.js";import{a as r}from"./chunk-YIKU2R7W.js";import{b as C}from"./chunk-GISZRI4I.js";import{a as H}from"./chunk-JXB2O63E.js";import{a as A}from"./chunk-3CGZ2A5B.js";import{b as N}from"./chunk-4BLKAURK.js";import{a as K}from"./chunk-5TPDRTCU.js";import{a as z}from"./chunk-WPESQSKX.js";import{a as v}from"./chunk-QF4LGACD.js";import{b as O}from"./chunk-P5TOP3NH.js";import{a as h}from"./chunk-UQMXWLP6.js";import{b as w}from"./chunk-SBCJY5IU.js";import{a as k}from"./chunk-AIHL337R.js";import{a as L}from"./chunk-QDYWH7BU.js";import{c as R,f as y}from"./chunk-IKYI4JCF.js";import{a as G}from"./chunk-
|
|
1
|
+
import{b as F}from"./chunk-2JDJGZRM.js";import{b as J}from"./chunk-CNWKBBJJ.js";import{b as E}from"./chunk-L5U5XRNP.js";import{b as j}from"./chunk-X2MSD7NS.js";import{b as q}from"./chunk-J5YZ4HBV.js";import{a as M}from"./chunk-G4DOH6BQ.js";import{a as Q}from"./chunk-STZJ3LBU.js";import{a as r}from"./chunk-YIKU2R7W.js";import{b as C}from"./chunk-GISZRI4I.js";import{a as H}from"./chunk-JXB2O63E.js";import{a as A}from"./chunk-3CGZ2A5B.js";import{b as N}from"./chunk-4BLKAURK.js";import{a as K}from"./chunk-5TPDRTCU.js";import{a as z}from"./chunk-WPESQSKX.js";import{a as v}from"./chunk-QF4LGACD.js";import{b as O}from"./chunk-P5TOP3NH.js";import{a as h}from"./chunk-UQMXWLP6.js";import{b as w}from"./chunk-SBCJY5IU.js";import{a as k}from"./chunk-AIHL337R.js";import{a as L}from"./chunk-QDYWH7BU.js";import{c as R,f as y}from"./chunk-IKYI4JCF.js";import{a as G}from"./chunk-NODTAMYY.js";import{a as D}from"./chunk-S4BD3HT2.js";import{a as T}from"./chunk-QKII4FCI.js";import{a as b}from"./chunk-7WQEZTFP.js";import{b as g,d as P,f as S}from"./chunk-SIP5IK3N.js";import{b as I}from"./chunk-WUXXMMTM.js";import{a as f}from"./chunk-ERL6CBPO.js";import"./chunk-ECPWEUBG.js";import{a as p}from"./chunk-T5MEA7JO.js";import{b as x,e as s}from"./chunk-MWFGDECP.js";import{a as c}from"./chunk-2ARF4VOQ.js";import{a as i}from"./chunk-DE3A37FL.js";import{b as n}from"./chunk-UOGCEUXK.js";import"./chunk-EZSEQHRH.js";import{a as B}from"./chunk-UOF574WZ.js";import"./chunk-23PSWIUF.js";import{b as u}from"./chunk-EFOTKJY4.js";import"./chunk-IPYZIIRV.js";import{b as m}from"./chunk-4UO3W4WP.js";import{b as d}from"./chunk-ZE7GYACV.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 as o,b as t,c as a}from"./chunk-BH64QNLE.js";import"./chunk-GRL4DWKG.js";import"./chunk-3USCFSFQ.js";import"./chunk-7GK5LKBV.js";import{a as U,b as V}from"./chunk-KC4ECXJJ.js";import"./chunk-XCSIJWLQ.js";import"./chunk-6JU6I4L7.js";import"./chunk-EH2C72PD.js";import"./chunk-2PI5BUSE.js";import"./chunk-276RDWEQ.js";import{a as l}from"./chunk-ZLJF4SVG.js";import"./chunk-5MOOXA2X.js";import{b as e}from"./chunk-4OT5AMS5.js";import"./chunk-IZ2LK5GK.js";export{r as BlAccordion,l as BlAccordionGroup,f as BlAlert,p as BlBadge,m as BlButton,u as BlCalendar,x as BlCheckbox,s as BlCheckboxGroup,c as BlDatePicker,T as BlDialog,b as BlDrawer,S as BlDropdown,I as BlDropdownGroup,P as BlDropdownItem,a as BlIcon,B as BlInput,h as BlLink,w as BlNotification,C as BlNotificationCard,k as BlPagination,n as BlPopover,L as BlProgressIndicator,R as BlRadio,y as BlRadioGroup,G as BlSelect,D as BlSelectOption,d as BlSpinner,g as BlSplitButton,H as BlStepper,A as BlStepperItem,N as BlSwitch,z as BlTab,K as BlTabGroup,v as BlTabPanel,O as BlTable,j as BlTableBody,F as BlTableCell,q as BlTableHeader,J as BlTableHeaderCell,E as BlTableRow,M as BlTag,Q as BlTextarea,i as BlTooltip,t as getIconPath,U as getLocale,e as litHtmlRenderer,o as setIconPath,V as setLocale};
|
|
2
2
|
//# sourceMappingURL=baklava.js.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import{a as g}from"./chunk-EFOTKJY4.js";import{a as f}from"./chunk-GRL4DWKG.js";import{a as b,b as s,c,e as _}from"./chunk-5MOOXA2X.js";import{a as v,b as p}from"./chunk-4OT5AMS5.js";import{d as n}from"./chunk-IZ2LK5GK.js";var D=v`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}:host([disabled]) .datepicker-content{pointer-events:none}.datepicker-input{width:var(--bl-datepicker-input-width,auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`,E=D;var i=class extends g{constructor(){super(...arguments);this.size="medium";this.labelFixed=!1;this.valueFormatter=null;this._inputValue="";this._floatingDateCount=0;this._fittingDateCount=0}static get styles(){return[E]}defaultInputValueFormatter(){var t,e,o,l,a,r,d,h;if(this.type==="single")this._inputValue=this.formatDate((t=this._calendarEl)==null?void 0:t._dates[0]),this.closePopoverWithTimeout();else if(this.type==="multiple"){this.setFloatingDates();let u=(e=this._calendarEl)==null?void 0:e._dates.slice(0,this._fittingDateCount).map(m=>this.formatDate(m));this._inputValue=u.join(",")+(this._floatingDateCount>0?" ,...":"")}else this.type==="range"&&((o=this._calendarEl)!=null&&o._dates[0]&&(this._inputValue=this.formatDate((l=this._calendarEl)==null?void 0:l._dates[0])),(a=this._calendarEl)!=null&&a._dates[1]&&(this._inputValue=`${this._inputValue}-${this.formatDate((r=this._calendarEl)==null?void 0:r._dates[1])}`),(d=this._calendarEl)!=null&&d._dates[0]&&((h=this._calendarEl)!=null&&h._dates[1])&&this.closePopoverWithTimeout())}closePopoverWithTimeout(){setTimeout(()=>{this.closePopover(),this._inputEl.blur()},200)}setFloatingDates(){var l,a,r;let t=(l=this.shadowRoot)==null?void 0:l.getElementById("datepicker-input"),e=(a=this.shadowRoot)==null?void 0:a.getElementById("icon-container"),o=t.offsetWidth-e.offsetWidth;this._fittingDateCount=Math.floor(o/90),this._floatingDateCount=((r=this._calendarEl)==null?void 0:r._dates.length)-this._fittingDateCount}setDatePickerInput(){var t,e;(t=this._calendarEl)!=null&&t._dates.length?this.valueFormatter?this._inputValue=this.valueFormatter((e=this._calendarEl)==null?void 0:e._dates):this.defaultInputValueFormatter():this._inputValue=""}formatDate(t){return this.monthYearOnly?`${String((t==null?void 0:t.getMonth())+1).padStart(2,"0")}/${t==null?void 0:t.getFullYear()}`:`${String(t==null?void 0:t.getDate()).padStart(2,"0")}/${String((t==null?void 0:t.getMonth())+1).padStart(2,"0")}/${t==null?void 0:t.getFullYear()}`}clearDatepicker(){this._calendarEl.handleClearSelectedDates(),this._inputValue="",this._floatingDateCount=0}openPopover(){this._popoverEl.target=this._inputEl,this._popoverEl.show()}closePopover(){this._popoverEl.hide()}_togglePopover(){this._popoverEl.visible?this.closePopover():this.openPopover()}formatAdditionalDates(t){let e=t.split(",");return e==null?void 0:e.reduce((o,l,a)=>(a>0&&a%3===0&&o.push(p`<br />`),o.push(p`<span>${l.trim()}${a<e.length-1?", ":""}</span>`),o),[])}async firstUpdated(){var t,e,o;this._onCalendarMouseDown=l=>{var a;l.preventDefault(),(a=this._inputEl)==null||a.focus()},this._onInputMouseDown=l=>{var a;l.preventDefault(),(a=this._inputEl)==null||a.focus()},(t=this._calendarEl)==null||t.addEventListener("mousedown",this._onCalendarMouseDown),(e=this._inputEl)==null||e.addEventListener("mousedown",this._onInputMouseDown),(o=this._calendarEl)!=null&&o._dates&&this.setDatePickerInput()}onCalendarChange(){var t;this.setDatePickerInput(),this._onBlDatepickerChange((t=this._calendarEl)==null?void 0:t._dates)}disconnectedCallback(){var t,e;super.disconnectedCallback(),(t=this._calendarEl)==null||t.removeEventListener("mousedown",this._onCalendarMouseDown),(e=this._inputEl)==null||e.removeEventListener("mousedown",this._onInputMouseDown)}render(){var r,d,h,u;let t=p`
|
|
2
|
+
<bl-popover target="datepicker-content" placement="bottom-start">
|
|
3
|
+
<bl-calendar
|
|
4
|
+
type=${this.type}
|
|
5
|
+
.minDate=${this.minDate}
|
|
6
|
+
.maxDate=${this.maxDate}
|
|
7
|
+
.startOfWeek=${this.startOfWeek}
|
|
8
|
+
.disabledDates=${this.disabledDates}
|
|
9
|
+
.value=${this.value}
|
|
10
|
+
.locale=${this.locale}
|
|
11
|
+
.dayRenderer=${this.dayRenderer}
|
|
12
|
+
?month-year-only=${this.monthYearOnly}
|
|
13
|
+
@bl-calendar-change="${this.onCalendarChange}"
|
|
14
|
+
></bl-calendar>
|
|
15
|
+
</bl-popover>
|
|
16
|
+
`,e=(h=(d=(r=this._calendarEl)==null?void 0:r._dates)==null?void 0:d.slice(this._fittingDateCount).map(m=>this.formatDate(m)).join(","))!=null?h:"",o=this.formatAdditionalDates(e),l=this._floatingDateCount>0?p` <bl-tooltip>
|
|
17
|
+
<span slot="tooltip-trigger">+${this._floatingDateCount}</span>
|
|
18
|
+
<div>${o}</div>
|
|
19
|
+
</bl-tooltip>`:"",a=((u=this._calendarEl)==null?void 0:u._dates.length)>0?p` <bl-button
|
|
20
|
+
size="small"
|
|
21
|
+
variant="tertiary"
|
|
22
|
+
kind="neutral"
|
|
23
|
+
icon="close"
|
|
24
|
+
@click=${this.clearDatepicker}
|
|
25
|
+
?disabled=${this.disabled}
|
|
26
|
+
></bl-button>
|
|
27
|
+
<div class="action-divider"></div>`:"";return p`
|
|
28
|
+
<div class="datepicker-content" id="datepicker-content" tabindex="-1">
|
|
29
|
+
<bl-input
|
|
30
|
+
.value="${this._inputValue}"
|
|
31
|
+
.label="${this.label}"
|
|
32
|
+
placeholder="${this.placeholder}"
|
|
33
|
+
class="datepicker-input"
|
|
34
|
+
role="button"
|
|
35
|
+
id="datepicker-input"
|
|
36
|
+
aria-haspopup="listbox"
|
|
37
|
+
aria-labelledby="label"
|
|
38
|
+
@click=${this._togglePopover}
|
|
39
|
+
help-text=${this.helpText}
|
|
40
|
+
?disabled=${this.disabled}
|
|
41
|
+
.size=${this.size}
|
|
42
|
+
.labelFixed=${this.labelFixed}
|
|
43
|
+
readonly
|
|
44
|
+
>
|
|
45
|
+
<div slot="icon" class="icon-container" id="icon-container">
|
|
46
|
+
${l} ${a}
|
|
47
|
+
<bl-icon name="calendar" size="small" class="calendar-icon"></bl-icon>
|
|
48
|
+
</div>
|
|
49
|
+
</bl-input>
|
|
50
|
+
${t}
|
|
51
|
+
</div>
|
|
52
|
+
`}};n([s({type:String,attribute:"placeholder",reflect:!0})],i.prototype,"placeholder",2),n([s({type:String,reflect:!0})],i.prototype,"size",2),n([s({type:Boolean,attribute:"label-fixed",reflect:!0})],i.prototype,"labelFixed",2),n([s({type:String,attribute:"label",reflect:!0})],i.prototype,"label",2),n([s({type:Function,attribute:"value-formatter"})],i.prototype,"valueFormatter",2),n([s({type:Boolean,reflect:!0})],i.prototype,"disabled",2),n([s({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),n([s({attribute:!1})],i.prototype,"dayRenderer",2),n([c()],i.prototype,"_inputValue",2),n([c()],i.prototype,"_floatingDateCount",2),n([c()],i.prototype,"_fittingDateCount",2),n([_("bl-calendar")],i.prototype,"_calendarEl",2),n([_("bl-popover")],i.prototype,"_popoverEl",2),n([_("bl-input")],i.prototype,"_inputEl",2),n([f("bl-datepicker-change")],i.prototype,"_onBlDatepickerChange",2),i=n([b("bl-datepicker")],i);export{i as a};
|
|
53
|
+
//# sourceMappingURL=chunk-2ARF4VOQ.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/datepicker/bl-datepicker.css", "../src/components/datepicker/bl-datepicker.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}:host([disabled]) .datepicker-content{pointer-events:none}.datepicker-input{width:var(--bl-datepicker-input-width,auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`;\nexport default styles;\n", "import { CSSResultGroup, html, TemplateResult } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { BlCalendar, BlPopover } from \"../../baklava\";\nimport DatepickerCalendarMixin from \"../../mixins/datepicker-calendar-mixin/datepicker-calendar-mixin\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../calendar/bl-calendar\";\nimport { CALENDAR_TYPES } from \"../calendar/bl-calendar.constant\";\nimport \"../input/bl-input\";\nimport BlInput, { InputSize } from \"../input/bl-input\";\nimport \"../tooltip/bl-tooltip\";\nimport style from \"./bl-datepicker.css\";\n\n/**\n * @tag bl-datepicker\n * @summary Baklava DatePicker component\n *\n * @cssproperty [--bl-datepicker-input-width] - Sets the width of datepicker input\n **/\n@customElement(\"bl-datepicker\")\nexport default class BlDatepicker extends DatepickerCalendarMixin {\n /**\n * Defines the datepicker input placeholder\n */\n @property({ type: String, attribute: \"placeholder\", reflect: true })\n placeholder: string;\n /**\n * Sets input size.\n */\n @property({ type: String, reflect: true })\n size?: InputSize = \"medium\";\n\n /**\n * Makes datepicker input label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n /**\n * Defines the datepicker input label\n */\n @property({ type: String, attribute: \"label\", reflect: true })\n label: string;\n /**\n * Defines the custom formatter function\n */\n @property({ type: Function, attribute: \"value-formatter\" })\n valueFormatter: ((dates: Date[]) => string) | null = null;\n /**\n * Sets datepicker to disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled: boolean;\n /**\n * Defines help text to datepicker input for users\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText: string;\n\n /**\n * Custom function to render day cells in the calendar.\n * It receives the date as an argument and should return a TemplateResult.\n */\n @property({ attribute: false })\n dayRenderer?: (date: Date) => TemplateResult;\n\n @state()\n _inputValue = \"\";\n\n @state()\n _floatingDateCount: number = 0;\n\n @state()\n _fittingDateCount: number = 0;\n\n @query(\"bl-calendar\")\n _calendarEl: BlCalendar;\n\n @query(\"bl-popover\")\n _popoverEl: BlPopover;\n\n @query(\"bl-input\")\n _inputEl!: BlInput;\n\n private _onCalendarMouseDown!: (event: MouseEvent) => void;\n private _onInputMouseDown!: (event: MouseEvent) => void;\n\n /**\n * Fires when date selection is changed\n */\n @event(\"bl-datepicker-change\") private _onBlDatepickerChange: EventDispatcher<Date[]>;\n\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n defaultInputValueFormatter() {\n if (this.type === CALENDAR_TYPES.SINGLE) {\n this._inputValue = this.formatDate(this._calendarEl?._dates[0]);\n this.closePopoverWithTimeout();\n } else if (this.type === CALENDAR_TYPES.MULTIPLE) {\n this.setFloatingDates();\n const values = this._calendarEl?._dates\n .slice(0, this._fittingDateCount)\n .map(date => this.formatDate(date));\n\n this._inputValue = values.join(\",\") + (this._floatingDateCount > 0 ? \" ,...\" : \"\");\n } else if (this.type === CALENDAR_TYPES.RANGE) {\n if (this._calendarEl?._dates[0])\n this._inputValue = this.formatDate(this._calendarEl?._dates[0]);\n if (this._calendarEl?._dates[1])\n this._inputValue = `${this._inputValue}-${this.formatDate(this._calendarEl?._dates[1])}`;\n if (this._calendarEl?._dates[0] && this._calendarEl?._dates[1])\n this.closePopoverWithTimeout();\n }\n }\n\n closePopoverWithTimeout() {\n setTimeout(() => {\n this.closePopover();\n this._inputEl.blur();\n }, 200);\n }\n\n setFloatingDates() {\n const datepickerInput = this.shadowRoot?.getElementById(\"datepicker-input\");\n const iconsContainer = this.shadowRoot?.getElementById(\"icon-container\");\n const datesTextTotalWidth = datepickerInput!.offsetWidth! - iconsContainer!.offsetWidth!;\n\n this._fittingDateCount = Math.floor(datesTextTotalWidth / 90);\n\n this._floatingDateCount = this._calendarEl?._dates.length - this._fittingDateCount;\n }\n\n setDatePickerInput() {\n if (!this._calendarEl?._dates.length) {\n this._inputValue = \"\";\n } else {\n if (this.valueFormatter) {\n this._inputValue = this.valueFormatter(this._calendarEl?._dates);\n } else {\n this.defaultInputValueFormatter();\n }\n }\n }\n\n formatDate(date: Date): string {\n if (this.monthYearOnly) {\n return `${String(date?.getMonth() + 1).padStart(2, \"0\")}/${date?.getFullYear()}`;\n }\n return `${String(date?.getDate()).padStart(2, \"0\")}/${String(date?.getMonth() + 1).padStart(\n 2,\n \"0\"\n )}/${date?.getFullYear()}`;\n }\n\n clearDatepicker() {\n this._calendarEl.handleClearSelectedDates();\n this._inputValue = \"\";\n this._floatingDateCount = 0;\n }\n\n openPopover() {\n this._popoverEl.target = this._inputEl;\n this._popoverEl.show();\n }\n\n closePopover() {\n this._popoverEl.hide();\n }\n\n _togglePopover() {\n this._popoverEl.visible ? this.closePopover() : this.openPopover();\n }\n\n formatAdditionalDates(str: string): TemplateResult[] {\n const parts = str.split(\",\");\n\n return parts?.reduce<TemplateResult[]>((acc, part, index) => {\n if (index > 0 && index % 3 === 0) {\n acc.push(html`<br />`);\n }\n acc.push(html`<span>${part.trim()}${index < parts.length - 1 ? \", \" : \"\"}</span>`);\n return acc;\n }, []);\n }\n\n async firstUpdated() {\n this._onCalendarMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._onInputMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._calendarEl?.addEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.addEventListener(\"mousedown\", this._onInputMouseDown);\n\n if (this._calendarEl?._dates) {\n this.setDatePickerInput();\n }\n }\n\n onCalendarChange() {\n this.setDatePickerInput();\n this._onBlDatepickerChange(this._calendarEl?._dates);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._calendarEl?.removeEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.removeEventListener(\"mousedown\", this._onInputMouseDown);\n }\n\n render() {\n const renderCalendar = html`\n <bl-popover target=\"datepicker-content\" placement=\"bottom-start\">\n <bl-calendar\n type=${this.type}\n .minDate=${this.minDate}\n .maxDate=${this.maxDate}\n .startOfWeek=${this.startOfWeek}\n .disabledDates=${this.disabledDates}\n .value=${this.value}\n .locale=${this.locale}\n .dayRenderer=${this.dayRenderer}\n ?month-year-only=${this.monthYearOnly}\n @bl-calendar-change=\"${this.onCalendarChange}\"\n ></bl-calendar>\n </bl-popover>\n `;\n const additionalDates =\n this._calendarEl?._dates\n ?.slice(this._fittingDateCount)\n .map(date => {\n return this.formatDate(date);\n })\n .join(\",\") ?? \"\";\n\n const formattedAdditionalDates = this.formatAdditionalDates(additionalDates);\n\n const additionalDatesView =\n this._floatingDateCount > 0\n ? html` <bl-tooltip>\n <span slot=\"tooltip-trigger\">+${this._floatingDateCount}</span>\n <div>${formattedAdditionalDates}</div>\n </bl-tooltip>`\n : \"\";\n\n const clearDatepickerButton =\n this._calendarEl?._dates.length > 0\n ? html` <bl-button\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this.clearDatepicker}\n ?disabled=${this.disabled}\n ></bl-button>\n <div class=\"action-divider\"></div>`\n : \"\";\n\n return html`\n <div class=\"datepicker-content\" id=\"datepicker-content\" tabindex=\"-1\">\n <bl-input\n .value=\"${this._inputValue}\"\n .label=\"${this.label}\"\n placeholder=\"${this.placeholder}\"\n class=\"datepicker-input\"\n role=\"button\"\n id=\"datepicker-input\"\n aria-haspopup=\"listbox\"\n aria-labelledby=\"label\"\n @click=${this._togglePopover}\n help-text=${this.helpText}\n ?disabled=${this.disabled}\n .size=${this.size}\n .labelFixed=${this.labelFixed}\n readonly\n >\n <div slot=\"icon\" class=\"icon-container\" id=\"icon-container\">\n ${additionalDatesView} ${clearDatepickerButton}\n <bl-icon name=\"calendar\" size=\"small\" class=\"calendar-icon\"></bl-icon>\n </div>\n </bl-input>\n ${renderCalendar}\n </div>\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": "+NACO,IAAMA,EAASC,02BACfC,EAAQF,ECiBf,IAAqBG,EAArB,cAA0CC,CAAwB,CAAlE,kCAUE,UAAmB,SAMnB,gBAAa,GAUb,oBAAqD,KAoBrD,iBAAc,GAGd,wBAA6B,EAG7B,uBAA4B,EAmB5B,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAEA,4BAA6B,CA9F/B,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EA+FI,GAAI,KAAK,gBACP,KAAK,YAAc,KAAK,YAAWP,EAAA,KAAK,cAAL,YAAAA,EAAkB,OAAO,EAAE,EAC9D,KAAK,wBAAwB,UACpB,KAAK,kBAAkC,CAChD,KAAK,iBAAiB,EACtB,IAAMQ,GAASP,EAAA,KAAK,cAAL,YAAAA,EAAkB,OAC9B,MAAM,EAAG,KAAK,mBACd,IAAIQ,GAAQ,KAAK,WAAWA,CAAI,GAEnC,KAAK,YAAcD,EAAO,KAAK,GAAG,GAAK,KAAK,mBAAqB,EAAI,QAAU,SACtE,KAAK,kBACVN,EAAA,KAAK,cAAL,MAAAA,EAAkB,OAAO,KAC3B,KAAK,YAAc,KAAK,YAAWC,EAAA,KAAK,cAAL,YAAAA,EAAkB,OAAO,EAAE,IAC5DC,EAAA,KAAK,cAAL,MAAAA,EAAkB,OAAO,KAC3B,KAAK,YAAc,GA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EAAS,CAAE,KAAM,QAAS,UAAW,cAAe,QAAS,EAAK,CAAC,GAfjD7B,EAgBnB,0BAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,QAAS,QAAS,EAAK,CAAC,GApB1C7B,EAqBnB,qBAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,SAAU,UAAW,iBAAkB,CAAC,GAzBvC7B,EA0BnB,8BAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GA9BvB7B,EA+BnB,wBAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,YAAa,QAAS,EAAK,CAAC,GAnC9C7B,EAoCnB,wBAOA4B,EAAA,CADCC,EAAS,CAAE,UAAW,EAAM,CAAC,GA1CX7B,EA2CnB,2BAGA4B,EAAA,CADCE,EAAM,GA7CY9B,EA8CnB,2BAGA4B,EAAA,CADCE,EAAM,GAhDY9B,EAiDnB,kCAGA4B,EAAA,CADCE,EAAM,GAnDY9B,EAoDnB,iCAGA4B,EAAA,CADCG,EAAM,aAAa,GAtDD/B,EAuDnB,2BAGA4B,EAAA,CADCG,EAAM,YAAY,GAzDA/B,EA0DnB,0BAGA4B,EAAA,CADCG,EAAM,UAAU,GA5DE/B,EA6DnB,wBAQuC4B,EAAA,CAAtCN,EAAM,sBAAsB,GArEVtB,EAqEoB,qCArEpBA,EAArB4B,EAAA,CADCC,EAAc,eAAe,GACT7B",
|
|
6
|
+
"names": ["styles", "i", "bl_datepicker_default", "BlDatepicker", "DatepickerCalendarMixin", "bl_datepicker_default", "_a", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "values", "date", "datepickerInput", "iconsContainer", "datesTextTotalWidth", "str", "parts", "acc", "part", "index", "x", "event", "renderCalendar", "additionalDates", "formattedAdditionalDates", "additionalDatesView", "clearDatepickerButton", "__decorateClass", "e", "t", "i"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import{a as V}from"./chunk-IPYZIIRV.js";import{a as Y,b as k}from"./chunk-WEEGH2F4.js";import{a as T}from"./chunk-6LT7O7T2.js";import{a as A}from"./chunk-GRL4DWKG.js";import{b as C}from"./chunk-276RDWEQ.js";import{a as M,b as u,c as f}from"./chunk-5MOOXA2X.js";import{a as x,b as d,f as S}from"./chunk-4OT5AMS5.js";import{d as r}from"./chunk-IZ2LK5GK.js";function v(c){let D=[],e=c.split(",");return e==null||e.forEach(t=>{let a=new Date(t.trim());isNaN(a.getTime())||D.push(a)}),D}var h=class extends S{constructor(){super(...arguments);this.startOfWeek=0;this.locale=document.documentElement.lang||"en-EN";this.monthYearOnly=!1;this._disabledDates=[];this._value=[]}get disabledDates(){return this._disabledDates}set disabledDates(e){let t=[];typeof e=="string"?t=v(e):Array.isArray(e)&&(t=e.filter(a=>!isNaN(a.getTime()))),this.requestUpdate("disabledDates",t),this._disabledDates=t}get maxDate(){return this._maxDate}set maxDate(e){if(e&&isNaN(new Date(e).getTime())){console.warn("Invalid maxDate value.");return}this._minDate&&this._minDate>e?console.warn("maxDate cannot be smaller than minDate."):(this._maxDate=new Date(e),this.requestUpdate("maxDate",e))}get minDate(){return this._minDate}set minDate(e){if(e&&isNaN(new Date(e).getTime())){console.warn("Invalid minDate value.");return}this._maxDate&&this._maxDate<e?console.warn("minDate cannot be greater than maxDate."):(this._minDate=new Date(e),this.requestUpdate("minDate",e))}set value(e){let t=this._value;this._value=e,this.requestUpdate("value",t)}get value(){return this._value}};r([u()],h.prototype,"type",2),r([u({type:Number,attribute:"start-of-week",reflect:!0})],h.prototype,"startOfWeek",2),r([u()],h.prototype,"locale",2),r([u({type:Boolean,attribute:"month-year-only",reflect:!0})],h.prototype,"monthYearOnly",2),r([u({attribute:"disabled-dates",reflect:!0})],h.prototype,"disabledDates",1),r([u({type:Date,attribute:"max-date",reflect:!0})],h.prototype,"maxDate",1),r([u({type:Date,attribute:"min-date",reflect:!0})],h.prototype,"minDate",1),r([u({attribute:"value",reflect:!0})],h.prototype,"value",1);function N(c){return c?typeof c=="string"?v(c):c instanceof Date?[c]:Array.isArray(c)?c:[]:[]}var E=x`.calendar{display:flex;flex-direction:column}.calendar-content{display:flex;padding:var(--bl-size-m);flex-direction:column;align-items:center;gap:var(--bl-size-m);border-radius:var(--bl-border-radius-s);width:fit-content;background:var(--bl-color-neutral-full)}.calendar-header{display:flex;justify-content:space-between;width:100%;align-items:center;padding-bottom:var(--bl-size-s)}.arrow{flex:1}:host([dir=rtl]) .arrow{transform:scale(-1)}.header-text{flex:3}.header-text-hover{background:var(--bl-color-neutral-lightest);border-radius:var(--bl-border-radius-s)}.days-wrapper{display:flex;flex-direction:column}.day-wrapper{display:flex;align-items:center;justify-content:center}.week-row{display:flex;align-items:center;flex-direction:row;padding-bottom:var(--bl-size-2xs)}.day{display:flex;align-items:center;width:40px;--bl-button-focus-border-color:#000;--bl-font-title-4-medium:var(--bl-font-weight-regular) var(--bl-font-size-m);--bl-size-xl:40px;--bl-border-radius-m:50%;--bl-border-radius-l:50%}.day.today-day{--bl-color-neutral-darker:var(--bl-color-primary);--bl-color-neutral-darkest:var(--bl-color-primary)}.day.other-month-day{--bl-color-neutral-darker:var(--bl-color-neutral-dark)}.day.other-month-day.selected-day{--bl-color-neutral-darker:var(--bl-color-neutral-full)}.day.selected-day{background:var(--bl-color-primary);border-radius:50%;--bl-button-focus-border-color:var(--bl-color-primary);--bl-color-neutral-darker:var(--bl-color-neutral-full)}.range-day{background:var(--bl-color-primary-contrast);--bl-color-neutral-lightest:var(--bl-color-primary-contrast)}.range-end-day,.range-start-day,.selected-day{--bl-color-neutral-lightest:var(--bl-color-primary);--bl-color-neutral-darker:var(--bl-color-neutral-full);--bl-color-neutral-darkest:var(--bl-color-neutral-full)!important}.range-start-day{background:var(--bl-color-primary-contrast);border-start-start-radius:50%;border-end-start-radius:50%}.range-end-day{background:var(--bl-color-primary-contrast);border-start-end-radius:50%;border-end-end-radius:50%}.weekday-text{color:var(--bl-color-neutral-dark);text-align:center;padding:var(--bl-size-2xs) 0;width:40px}.grid-content{display:grid;grid-template-columns:auto auto auto;text-align:center}.grid-item{width:93.33px;--bl-size-3xs:15px}.grid-item:not(:nth-last-child(-n + 3)){padding-bottom:var(--bl-size-2xs)}.calendar-text{font:var(--bl-font-title-3-regular)}`,$=E;var o=class extends h{constructor(){super(...arguments);this.today=new Date;this._calendarMonth=this.today.getMonth();this._calendarYear=this.today.getFullYear();this._calendarView="days";this._calendarYears=[];this._calendarDays=[];this._dates=[];this.handleClearSelectedDates=()=>{this._dates=[],this._onBlCalendarChange([]),this.clearRangePickerStyles()}}static get styles(){return[$]}connectedCallback(){super.connectedCallback(),V(this),this.monthYearOnly&&(this._calendarView="months")}get months(){return[...Array(12).keys()].map(e=>({name:new Date(0,e+1,0).toLocaleString(this.locale,{month:"long"}),value:e}))}get days(){return[...Array(7).keys()].map(e=>({name:new Date(0,0,e).toLocaleString(this.locale,{weekday:"short"}),value:e}))}getDayNumInAMonth(e,t){return new Date(e,t+1,0).getDate()}getWeekDayOfDate(e,t){return new Date(e,t,1).getDay()}setPreviousCalendarView(){if(this.clearRangePickerStyles(),this._calendarView==="days"&&!this.monthYearOnly)this._calendarMonth===0?(this._calendarMonth=11,this._calendarYear-=1):this._calendarMonth-=1;else if(this._calendarView==="months")this._calendarYear-=1;else if(this._calendarView==="years"){let e=this._calendarYears[0];this._calendarYears=Array.from({length:12},(t,a)=>e-(a+1))}this.type==="range"&&this.setHoverClass()}setNextCalendarView(){if(this.clearRangePickerStyles(),this._calendarView==="days"&&!this.monthYearOnly)this._calendarMonth===11?(this._calendarMonth=0,this._calendarYear+=1):this._calendarMonth+=1;else if(this._calendarView==="months")this._calendarYear+=1;else if(this._calendarView==="years"){let e=this._calendarYears[11];this._calendarYears=Array.from({length:12},(t,a)=>e+(a+1))}this.setHoverClass()}setCurrentCalendarView(e){let t=this.monthYearOnly?"months":"days";this._calendarView=this._calendarView!==e?e:t,this.setHoverClass()}setMonthAndCalendarView(e){if(this._calendarMonth=e,this.monthYearOnly){let t=new Date(this._calendarYear,e,1);this.handleDate(t)}else this._calendarView="days",this.type==="range"&&this.setHoverClass()}setYearAndCalendarView(e){this._calendarYear=e,this._calendarView=this.monthYearOnly?"months":"days",this.type==="range"&&this.setHoverClass()}generateSurroundingYears(){this._calendarYears.length||(this._calendarYears=Array.from({length:12},(e,t)=>this._calendarYear-4+t))}clearRangePickerStyles(){var e;(e=this.shadowRoot)==null||e.querySelectorAll(".range-day, .range-start-day, .range-end-day").forEach(t=>t.classList.remove("range-day","range-start-day","range-end-day"))}handleDate(e){if(this.type!=="range"){let t=e.getFullYear()<this._calendarYear||e.getFullYear()===this._calendarYear&&e.getMonth()<this._calendarMonth,a=e.getFullYear()>this._calendarYear||e.getFullYear()===this._calendarYear&&e.getMonth()>this._calendarMonth;t?this.setPreviousCalendarView():a&&this.setNextCalendarView()}switch(this.type){case"single":this.handleSingleSelectCalendar(e);break;case"multiple":this.handleMultipleSelectCalendar(e);break;case"range":this.handleRangeSelectCalendar(e);break}this._onBlCalendarChange(this._dates),this.requestUpdate()}handleSingleSelectCalendar(e){this._dates=[e]}handleMultipleSelectCalendar(e){var a,l,s;((a=this._dates)==null?void 0:a.some(n=>n.getTime()===e.getTime()))?(s=this._dates)==null||s.splice((l=this._dates)==null?void 0:l.findIndex(n=>n.getTime()===e.getTime()),1):this._dates.push(e)}handleRangeSelectCalendar(e){if(!this._dates[0])this._dates[0]=e;else if(this._dates[1])this._dates=[],this._dates[0]=e;else if(e.getTime()>this._dates[0].getTime())this._dates[1]=e;else{let t=this._dates[0];this._dates[0]=e,this._dates[1]=t}this.setHoverClass()}checkIfSelectedDate(e){var t;return(t=this._dates)==null?void 0:t.some(a=>a.getFullYear()===e.getFullYear()&&a.getMonth()===e.getMonth()&&a.getDate()===e.getDate())}checkIfDateIsToday(e){let t=this.today;return t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}checkIfDateIsDisabled(e){var t,a,l;return e.getTime()<((t=this.minDate)==null?void 0:t.getTime())||e.getTime()>((a=this.maxDate)==null?void 0:a.getTime())?!0:this.disabledDates.length>0?(l=this.disabledDates)==null?void 0:l.some(s=>e.getDate()===s.getDate()&&e.getMonth()===s.getMonth()&&e.getFullYear()===s.getFullYear()):!1}setHoverClass(){this.clearRangePickerStyles(),this._dates[0]&&this._dates[1]&&setTimeout(()=>{var l,s,n,b,y,_,i,m,g;let e=(n=(s=this.shadowRoot)==null?void 0:s.getElementById(`${(l=this._dates[0])==null?void 0:l.getTime()}`))==null?void 0:n.parentElement;e==null||e.classList.add("range-start-day");let t=(_=(y=this.shadowRoot)==null?void 0:y.getElementById(`${(b=this._dates[1])==null?void 0:b.getTime()}`))==null?void 0:_.parentElement;t==null||t.classList.add("range-end-day");let a=[...this.createCalendarDays().values()].flat().filter(p=>p.getTime()>this._dates[0].getTime()&&p.getTime()<this._dates[1].getTime());for(let p=0;p<a.length;p++){let w=(m=(i=this.shadowRoot)==null?void 0:i.getElementById(`${a[p].getTime()}`))==null?void 0:m.parentElement;(g=w==null?void 0:w.classList)==null||g.add("range-day")}})}createCalendarDays(){var y,_;let e=new Map;this._calendarDays=this.days.slice(this.startOfWeek).concat(this.days.slice(0,this.startOfWeek));let t=this.getWeekDayOfDate(this._calendarYear,this._calendarMonth),a=t<this.startOfWeek?7-(this.startOfWeek-t):t-this.startOfWeek,l=this.getDayNumInAMonth(this._calendarYear,this._calendarMonth-1),s=this.getDayNumInAMonth(this._calendarYear,this._calendarMonth),n=this.startOfWeek;for(let i=a;i>0;i--){let m=n%7,g=new Date(this._calendarYear,this._calendarMonth-1,l-i+1);e.set(this.days[m].name,[g]),n+=1}for(let i=1;i<=s;i++){let m=n%7,g=new Date(this._calendarYear,this._calendarMonth,i);e.get(this.days[m].name)?(y=e.get(this.days[m].name))==null||y.push(g):e.set(this.days[m].name,[g]),n+=1}let b=this._calendarDays.findIndex(i=>i.value===n%7);if(b!==0)for(let i=1;i<=this._calendarDays.length-b;i++){let m=n%7,g=new Date(this._calendarYear,this._calendarMonth+1,i);(_=e.get(this.days[m].name))==null||_.push(g),n+=1}return e}updated(e){if(e.has("value")){let t=N(this._value);!t||!Array.isArray(t)||t.length===0?this.handleClearSelectedDates():t.forEach(a=>{this.handleDate(a)})}}renderCalendarHeader(){let e=this._calendarView==="months"?"header-text-hover":"",t=this._calendarView==="years"?"header-text-hover":"";return d`
|
|
2
|
+
<div class="calendar-header">
|
|
3
|
+
<bl-button
|
|
4
|
+
class="arrow"
|
|
5
|
+
icon="arrow_left"
|
|
6
|
+
variant="tertiary"
|
|
7
|
+
kind="neutral"
|
|
8
|
+
@click="${()=>this.setPreviousCalendarView()}"
|
|
9
|
+
></bl-button>
|
|
10
|
+
${this.monthYearOnly?d``:d`<bl-button
|
|
11
|
+
variant="tertiary"
|
|
12
|
+
kind="neutral"
|
|
13
|
+
class="header-text ${e}"
|
|
14
|
+
@click="${()=>this.setCurrentCalendarView("months")}"
|
|
15
|
+
>${this.months[this._calendarMonth].name}
|
|
16
|
+
</bl-button>`}
|
|
17
|
+
<bl-button
|
|
18
|
+
variant="tertiary"
|
|
19
|
+
kind="neutral"
|
|
20
|
+
class="header-text ${t}"
|
|
21
|
+
@click="${()=>this.setCurrentCalendarView("years")}"
|
|
22
|
+
>${this._calendarYear}
|
|
23
|
+
</bl-button>
|
|
24
|
+
<bl-button
|
|
25
|
+
class="arrow"
|
|
26
|
+
icon="arrow_right"
|
|
27
|
+
variant="tertiary"
|
|
28
|
+
kind="neutral"
|
|
29
|
+
@click="${()=>this.setNextCalendarView()}"
|
|
30
|
+
></bl-button>
|
|
31
|
+
</div>
|
|
32
|
+
`}renderCalendarDays(){let e=this.createCalendarDays(),t=Array.from(e.values());return d` <div class="week-row">
|
|
33
|
+
${[...e.keys()].map(a=>d` <div class="calendar-text weekday-text">${a}</div> `)}
|
|
34
|
+
</div>
|
|
35
|
+
<div class="days-wrapper">
|
|
36
|
+
${[...Array(t[0].length).keys()].map(a=>d` <div class="week-row">
|
|
37
|
+
${t.map(l=>{let s=l[a],n=this.checkIfSelectedDate(s),b=this.checkIfDateIsToday(s),y=this.checkIfDateIsDisabled(s),_=T({day:!0,"calendar-text":!0,"today-day":b,"selected-day":n,"other-month-day":l[a].getMonth()!==this._calendarMonth,"disabled-day":y});return d`<div class="day-wrapper">
|
|
38
|
+
<bl-button
|
|
39
|
+
id=${s.getTime()}
|
|
40
|
+
variant="tertiary"
|
|
41
|
+
kind="neutral"
|
|
42
|
+
size="small"
|
|
43
|
+
class=${_}
|
|
44
|
+
?disabled=${y}
|
|
45
|
+
@click="${()=>!y&&this.handleDate(s)}"
|
|
46
|
+
>
|
|
47
|
+
${this.dayRenderer?this.dayRenderer(s):s.getDate()}
|
|
48
|
+
</bl-button>
|
|
49
|
+
</div>`})}
|
|
50
|
+
</div>`)}
|
|
51
|
+
</div>`}renderCalendarMonths(){return d` <div class="grid-content">
|
|
52
|
+
${this.months.map((e,t)=>{let a=e.value===this._calendarMonth?"primary":"tertiary",l=e.value===this._calendarMonth?"default":"neutral";return d` <bl-button
|
|
53
|
+
variant=${a}
|
|
54
|
+
kind=${l}
|
|
55
|
+
class="grid-item"
|
|
56
|
+
size="small"
|
|
57
|
+
@click="${()=>this.setMonthAndCalendarView(t)}"
|
|
58
|
+
><span class="calendar-text">${e.name}</span></bl-button
|
|
59
|
+
>`})}
|
|
60
|
+
</div>`}renderCalendarYears(){return this.generateSurroundingYears(),d` <div class="grid-content">
|
|
61
|
+
${this._calendarYears.map(e=>{let t=e===this._calendarYear?"primary":"tertiary",a=e===this._calendarYear?"default":"neutral";return d` <bl-button
|
|
62
|
+
variant=${t}
|
|
63
|
+
kind=${a}
|
|
64
|
+
class="grid-item"
|
|
65
|
+
@click="${()=>this.setYearAndCalendarView(e)}"
|
|
66
|
+
><span class="calendar-text">${e}</span></bl-button
|
|
67
|
+
>`})}
|
|
68
|
+
</div>`}render(){return d`
|
|
69
|
+
<div>
|
|
70
|
+
<div class="calendar-content">
|
|
71
|
+
<div class="calendar">
|
|
72
|
+
${this.renderCalendarHeader()}
|
|
73
|
+
${this._calendarView==="days"?this.renderCalendarDays():""}
|
|
74
|
+
${this._calendarView==="months"?this.renderCalendarMonths():""}
|
|
75
|
+
${this._calendarView==="years"?this.renderCalendarYears():""}
|
|
76
|
+
</div>
|
|
77
|
+
</div>
|
|
78
|
+
</div>
|
|
79
|
+
`}};r([f()],o.prototype,"today",2),r([f()],o.prototype,"_calendarMonth",2),r([f()],o.prototype,"_calendarYear",2),r([f()],o.prototype,"_calendarView",2),r([f()],o.prototype,"_calendarYears",2),r([f()],o.prototype,"_calendarDays",2),r([f()],o.prototype,"_dates",2),r([u({attribute:!1})],o.prototype,"dayRenderer",2),r([A("bl-calendar-change")],o.prototype,"_onBlCalendarChange",2),o=r([M("bl-calendar"),C()],o);export{h as a,o as b};
|
|
80
|
+
//# sourceMappingURL=chunk-EFOTKJY4.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/utilities/string-to-date-converter.ts", "../src/mixins/datepicker-calendar-mixin/datepicker-calendar-mixin.ts", "../src/utilities/format-to-date-array.ts", "../src/components/calendar/bl-calendar.css", "../src/components/calendar/bl-calendar.ts"],
|
|
4
|
+
"sourcesContent": ["export function stringToDateArray(value: string): Date[] {\n const tempValue: Date[] = [];\n const splitDates = value.split(\",\");\n\n splitDates?.forEach(date => {\n const isDate = new Date(date.trim());\n\n if (!isNaN(isDate.getTime())) {\n tempValue.push(isDate);\n }\n });\n return tempValue;\n}\n", "import { LitElement } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { CalendarType, DayValues } from \"../../components/calendar/bl-calendar.types\";\nimport { stringToDateArray } from \"../../utilities/string-to-date-converter\";\n\nexport default class DatepickerCalendarMixin extends LitElement {\n /**\n * Defines the calendar types, available types are single, multiple and range\n */\n @property()\n type: CalendarType;\n /**\n * Defines the start day of the calendar (1 defines monday)\n */\n @property({ type: Number, attribute: \"start-of-week\", reflect: true })\n startOfWeek: DayValues = 0;\n /**\n * Defines the calendar language\n */\n @property()\n locale: string = document.documentElement.lang || \"en-EN\";\n\n /**\n * Enables month and year only selection mode\n */\n @property({ type: Boolean, attribute: \"month-year-only\", reflect: true })\n monthYearOnly = false;\n\n /**\n * Defines the unselectable dates for calendar\n */\n protected _disabledDates: Date[] = [];\n\n get disabledDates(): Date[] {\n return this._disabledDates;\n }\n\n @property({\n attribute: \"disabled-dates\",\n reflect: true,\n })\n set disabledDates(disabledDates: Date[] | string) {\n // Now we are using 1.6.0 version of @lit/reactive-elements and in this version even if our property has property decorator it doesn't run request update inside.\n // We added similar implementations to update when there is a change.\n // When we update the lit to 2.0 or upper versions we can remove the requestUpdate here\n\n let newVal: Date[] = [];\n\n if (typeof disabledDates === \"string\") {\n newVal = stringToDateArray(disabledDates);\n } else if (Array.isArray(disabledDates)) {\n newVal = disabledDates.filter(d => !isNaN(d.getTime()));\n }\n\n this.requestUpdate(\"disabledDates\", newVal);\n this._disabledDates = newVal;\n }\n\n /**\n * Defines the maximum date value for the calendar\n */\n _maxDate: Date;\n\n get maxDate() {\n return this._maxDate;\n }\n\n @property({ type: Date, attribute: \"max-date\", reflect: true })\n set maxDate(maxDate: Date) {\n if (maxDate && isNaN(new Date(maxDate).getTime())) {\n console.warn(\"Invalid maxDate value.\");\n return;\n }\n if (this._minDate && this._minDate > maxDate) {\n console.warn(\"maxDate cannot be smaller than minDate.\");\n } else {\n this._maxDate = new Date(maxDate);\n this.requestUpdate(\"maxDate\", maxDate);\n }\n }\n\n /**\n * Defines the minimum date value for the calendar\n */\n _minDate: Date;\n\n get minDate() {\n return this._minDate;\n }\n\n @property({ type: Date, attribute: \"min-date\", reflect: true })\n set minDate(minDate: Date) {\n if (minDate && isNaN(new Date(minDate).getTime())) {\n console.warn(\"Invalid minDate value.\");\n return;\n }\n if (this._maxDate && this._maxDate < minDate) {\n console.warn(\"minDate cannot be greater than maxDate.\");\n } else {\n this._minDate = new Date(minDate);\n this.requestUpdate(\"minDate\", minDate);\n }\n }\n\n @property({ attribute: \"value\", reflect: true })\n set value(value: string | Date | Date[]) {\n const oldValue = this._value;\n\n this._value = value;\n this.requestUpdate(\"value\", oldValue);\n }\n\n get value(): string | Date | Date[] {\n return this._value;\n }\n\n _value: string | Date | Date[] = [];\n}\n", "import { stringToDateArray } from \"./string-to-date-converter\";\n\nexport function formatToDateArray(value: string | Date | Date[] | undefined): Date[] {\n if (!value) {\n return [];\n }\n if (typeof value === \"string\") {\n return stringToDateArray(value);\n } else if (value instanceof Date) {\n return [value];\n } else if (Array.isArray(value)) {\n return value;\n }\n return [];\n}\n", "import {css} from 'lit';\nexport const styles = css`.calendar{display:flex;flex-direction:column}.calendar-content{display:flex;padding:var(--bl-size-m);flex-direction:column;align-items:center;gap:var(--bl-size-m);border-radius:var(--bl-border-radius-s);width:fit-content;background:var(--bl-color-neutral-full)}.calendar-header{display:flex;justify-content:space-between;width:100%;align-items:center;padding-bottom:var(--bl-size-s)}.arrow{flex:1}:host([dir=rtl]) .arrow{transform:scale(-1)}.header-text{flex:3}.header-text-hover{background:var(--bl-color-neutral-lightest);border-radius:var(--bl-border-radius-s)}.days-wrapper{display:flex;flex-direction:column}.day-wrapper{display:flex;align-items:center;justify-content:center}.week-row{display:flex;align-items:center;flex-direction:row;padding-bottom:var(--bl-size-2xs)}.day{display:flex;align-items:center;width:40px;--bl-button-focus-border-color:#000;--bl-font-title-4-medium:var(--bl-font-weight-regular) var(--bl-font-size-m);--bl-size-xl:40px;--bl-border-radius-m:50%;--bl-border-radius-l:50%}.day.today-day{--bl-color-neutral-darker:var(--bl-color-primary);--bl-color-neutral-darkest:var(--bl-color-primary)}.day.other-month-day{--bl-color-neutral-darker:var(--bl-color-neutral-dark)}.day.other-month-day.selected-day{--bl-color-neutral-darker:var(--bl-color-neutral-full)}.day.selected-day{background:var(--bl-color-primary);border-radius:50%;--bl-button-focus-border-color:var(--bl-color-primary);--bl-color-neutral-darker:var(--bl-color-neutral-full)}.range-day{background:var(--bl-color-primary-contrast);--bl-color-neutral-lightest:var(--bl-color-primary-contrast)}.range-end-day,.range-start-day,.selected-day{--bl-color-neutral-lightest:var(--bl-color-primary);--bl-color-neutral-darker:var(--bl-color-neutral-full);--bl-color-neutral-darkest:var(--bl-color-neutral-full)!important}.range-start-day{background:var(--bl-color-primary-contrast);border-start-start-radius:50%;border-end-start-radius:50%}.range-end-day{background:var(--bl-color-primary-contrast);border-start-end-radius:50%;border-end-end-radius:50%}.weekday-text{color:var(--bl-color-neutral-dark);text-align:center;padding:var(--bl-size-2xs) 0;width:40px}.grid-content{display:grid;grid-template-columns:auto auto auto;text-align:center}.grid-item{width:93.33px;--bl-size-3xs:15px}.grid-item:not(:nth-last-child(-n + 3)){padding-bottom:var(--bl-size-2xs)}.calendar-text{font:var(--bl-font-title-3-regular)}`;\nexport default styles;\n", "import { CSSResultGroup, html, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { localized } from \"@lit/localize\";\nimport DatepickerCalendarMixin from \"../../mixins/datepicker-calendar-mixin/datepicker-calendar-mixin\";\nimport { setDirectionProperty } from \"../../utilities/direction\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { formatToDateArray } from \"../../utilities/format-to-date-array\";\nimport \"../button/bl-button\";\nimport \"../icon/bl-icon\";\nimport {\n CALENDAR_TYPES,\n CALENDAR_VIEWS,\n FIRST_MONTH_INDEX,\n LAST_MONTH_INDEX,\n} from \"./bl-calendar.constant\";\nimport style from \"./bl-calendar.css\";\nimport { Calendar, CalendarDay, CalendarView } from \"./bl-calendar.types\";\n\n/**\n * @tag bl-calendar\n * @summary Baklava Calendar component\n **/\n@customElement(\"bl-calendar\")\n@localized()\nexport default class BlCalendar extends DatepickerCalendarMixin {\n @state()\n today = new Date();\n @state()\n _calendarMonth: number = this.today.getMonth();\n @state()\n _calendarYear: number = this.today.getFullYear();\n @state()\n _calendarView: CalendarView = CALENDAR_VIEWS.DAYS;\n @state()\n _calendarYears: number[] = [];\n @state()\n _calendarDays: CalendarDay[] = [];\n @state()\n _dates: Date[] = [];\n\n /**\n * Custom function to render day cells.\n * It receives the date as an argument and should return a TemplateResult.\n */\n @property({ attribute: false })\n dayRenderer?: (date: Date) => TemplateResult;\n\n /**\n * Fires when date selection changes\n */\n @event(\"bl-calendar-change\") _onBlCalendarChange: EventDispatcher<Date[]>;\n\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n connectedCallback() {\n super.connectedCallback();\n setDirectionProperty(this);\n\n if (this.monthYearOnly) {\n this._calendarView = CALENDAR_VIEWS.MONTHS;\n }\n }\n\n get months() {\n return [...Array(12).keys()].map(month => ({\n name: new Date(0, month + 1, 0).toLocaleString(this.locale, { month: \"long\" }),\n value: month,\n }));\n }\n\n get days() {\n return [...Array(7).keys()].map(day => ({\n name: new Date(0, 0, day).toLocaleString(this.locale, { weekday: \"short\" }),\n value: day,\n }));\n }\n\n public handleClearSelectedDates = () => {\n this._dates = [];\n this._onBlCalendarChange([]);\n this.clearRangePickerStyles();\n };\n\n getDayNumInAMonth(year: number, month: number) {\n return new Date(year, month + 1, 0).getDate();\n }\n\n getWeekDayOfDate(year: number, month: number) {\n return new Date(year, month, 1).getDay();\n }\n\n setPreviousCalendarView() {\n this.clearRangePickerStyles();\n if (this._calendarView === CALENDAR_VIEWS.DAYS && !this.monthYearOnly) {\n if (this._calendarMonth === FIRST_MONTH_INDEX) {\n this._calendarMonth = LAST_MONTH_INDEX;\n this._calendarYear -= 1;\n } else this._calendarMonth -= 1;\n } else if (this._calendarView === CALENDAR_VIEWS.MONTHS) {\n this._calendarYear -= 1;\n } else if (this._calendarView === CALENDAR_VIEWS.YEARS) {\n const fromYear = this._calendarYears[0];\n\n this._calendarYears = Array.from({ length: 12 }, (_, i) => fromYear - (i + 1));\n }\n if (this.type === CALENDAR_TYPES.RANGE) this.setHoverClass();\n }\n\n setNextCalendarView() {\n this.clearRangePickerStyles();\n if (this._calendarView === CALENDAR_VIEWS.DAYS && !this.monthYearOnly) {\n if (this._calendarMonth === LAST_MONTH_INDEX) {\n this._calendarMonth = FIRST_MONTH_INDEX;\n this._calendarYear += 1;\n } else this._calendarMonth += 1;\n } else if (this._calendarView === CALENDAR_VIEWS.MONTHS) {\n this._calendarYear += 1;\n } else if (this._calendarView === CALENDAR_VIEWS.YEARS) {\n const fromYear = this._calendarYears[11];\n\n this._calendarYears = Array.from({ length: 12 }, (_, i) => fromYear + (i + 1));\n }\n this.setHoverClass();\n }\n\n setCurrentCalendarView(view: CalendarView) {\n const defaultView = this.monthYearOnly ? CALENDAR_VIEWS.MONTHS : CALENDAR_VIEWS.DAYS;\n\n this._calendarView = this._calendarView !== view ? view : defaultView;\n this.setHoverClass();\n }\n\n setMonthAndCalendarView(month: number) {\n this._calendarMonth = month;\n\n if (this.monthYearOnly) {\n // In month-year only mode, selecting a month finalizes the selection\n const date = new Date(this._calendarYear, month, 1);\n\n this.handleDate(date);\n } else {\n this._calendarView = CALENDAR_VIEWS.DAYS;\n if (this.type === CALENDAR_TYPES.RANGE) this.setHoverClass();\n }\n }\n\n setYearAndCalendarView(year: number) {\n this._calendarYear = year;\n this._calendarView = this.monthYearOnly ? CALENDAR_VIEWS.MONTHS : CALENDAR_VIEWS.DAYS;\n if (this.type === CALENDAR_TYPES.RANGE) this.setHoverClass();\n }\n\n generateSurroundingYears() {\n if (!this._calendarYears.length) {\n this._calendarYears = Array.from({ length: 12 }, (_, i) => this._calendarYear - 4 + i);\n }\n }\n\n clearRangePickerStyles() {\n this.shadowRoot\n ?.querySelectorAll(\".range-day, .range-start-day, .range-end-day\")\n .forEach(day => day.classList.remove(\"range-day\", \"range-start-day\", \"range-end-day\"));\n }\n\n handleDate(date: Date) {\n if (this.type !== CALENDAR_TYPES.RANGE) {\n const isDateBeforeThanCalendar =\n date.getFullYear() < this._calendarYear ||\n (date.getFullYear() === this._calendarYear && date.getMonth() < this._calendarMonth);\n\n const isDateAfterThanCalendar =\n date.getFullYear() > this._calendarYear ||\n (date.getFullYear() === this._calendarYear && date.getMonth() > this._calendarMonth);\n\n if (isDateBeforeThanCalendar) {\n this.setPreviousCalendarView();\n } else if (isDateAfterThanCalendar) {\n this.setNextCalendarView();\n }\n }\n\n switch (this.type) {\n case CALENDAR_TYPES.SINGLE:\n this.handleSingleSelectCalendar(date);\n break;\n case CALENDAR_TYPES.MULTIPLE:\n this.handleMultipleSelectCalendar(date);\n break;\n case CALENDAR_TYPES.RANGE:\n this.handleRangeSelectCalendar(date);\n break;\n }\n\n this._onBlCalendarChange(this._dates);\n this.requestUpdate();\n }\n\n handleSingleSelectCalendar(calendarDate: Date) {\n this._dates = [calendarDate];\n }\n\n handleMultipleSelectCalendar(calendarDate: Date) {\n const dateExist = this._dates?.some(d => d.getTime() === calendarDate.getTime());\n\n dateExist\n ? this._dates?.splice(\n this._dates?.findIndex(d => d.getTime() === calendarDate.getTime()),\n 1\n )\n : this._dates.push(calendarDate);\n }\n\n handleRangeSelectCalendar(calendarDate: Date) {\n if (!this._dates[0]) {\n this._dates[0] = calendarDate;\n } else if (!this._dates[1]) {\n if (calendarDate.getTime() > this._dates[0].getTime()) {\n this._dates[1] = calendarDate;\n } else {\n const tempEndDate = this._dates[0];\n\n this._dates[0] = calendarDate;\n this._dates[1] = tempEndDate;\n }\n } else {\n this._dates = [];\n this._dates[0] = calendarDate;\n }\n this.setHoverClass();\n }\n\n checkIfSelectedDate(calendarDate: Date) {\n return this._dates?.some(\n date =>\n date.getFullYear() === calendarDate.getFullYear() &&\n date.getMonth() === calendarDate.getMonth() &&\n date.getDate() === calendarDate.getDate()\n );\n }\n\n checkIfDateIsToday(calendarDate: Date) {\n const today = this.today;\n\n return (\n today.getDate() === calendarDate.getDate() &&\n today.getMonth() === calendarDate.getMonth() &&\n today.getFullYear() === calendarDate.getFullYear()\n );\n }\n\n checkIfDateIsDisabled(calendarDate: Date) {\n if (\n calendarDate.getTime() < this.minDate?.getTime() ||\n calendarDate.getTime() > this.maxDate?.getTime()\n ) {\n return true;\n }\n if (this.disabledDates.length > 0) {\n return this.disabledDates?.some(disabledDate => {\n return (\n calendarDate.getDate() === disabledDate.getDate() &&\n calendarDate.getMonth() === disabledDate.getMonth() &&\n calendarDate.getFullYear() === disabledDate.getFullYear()\n );\n });\n }\n return false;\n }\n\n setHoverClass() {\n this.clearRangePickerStyles();\n\n if (this._dates[0] && this._dates[1]) {\n setTimeout(() => {\n const startDateParentElement = this.shadowRoot?.getElementById(\n `${this._dates[0]?.getTime()}`\n )?.parentElement;\n\n startDateParentElement?.classList.add(\"range-start-day\");\n\n const endDateParentElement = this.shadowRoot?.getElementById(\n `${this._dates[1]?.getTime()}`\n )?.parentElement;\n\n endDateParentElement?.classList.add(\"range-end-day\");\n const rangeDays = [...this.createCalendarDays().values()]\n .flat()\n .filter(\n date =>\n date.getTime() > this._dates[0]!.getTime() &&\n date.getTime() < this._dates[1]!.getTime()\n );\n\n for (let i = 0; i < rangeDays.length; i++) {\n const element = this.shadowRoot?.getElementById(\n `${rangeDays[i].getTime()}`\n )?.parentElement;\n\n element?.classList?.add(\"range-day\");\n }\n });\n }\n }\n\n createCalendarDays() {\n const calendar: Calendar = new Map();\n\n this._calendarDays = this.days\n .slice(this.startOfWeek)\n .concat(this.days.slice(0, this.startOfWeek));\n\n const currentMonthStartWeekDay = this.getWeekDayOfDate(this._calendarYear, this._calendarMonth); // 1\n\n const lastMonthDaysCount =\n currentMonthStartWeekDay < this.startOfWeek\n ? 7 - (this.startOfWeek - currentMonthStartWeekDay)\n : currentMonthStartWeekDay - this.startOfWeek;\n\n const previousMonthDayCount = this.getDayNumInAMonth(\n this._calendarYear,\n this._calendarMonth - 1\n );\n\n const currentMonthDayCount = this.getDayNumInAMonth(this._calendarYear, this._calendarMonth);\n\n let dayOfTheWeek = this.startOfWeek; // from sunday\n\n for (\n let lastMonthDaysIterator = lastMonthDaysCount;\n lastMonthDaysIterator > 0;\n lastMonthDaysIterator--\n ) {\n const mod = dayOfTheWeek % 7;\n const date = new Date(\n this._calendarYear,\n this._calendarMonth - 1,\n previousMonthDayCount - lastMonthDaysIterator + 1\n );\n\n calendar.set(this.days[mod].name, [date]);\n\n dayOfTheWeek += 1;\n }\n for (\n let currentMonthDaysIterator = 1;\n currentMonthDaysIterator <= currentMonthDayCount;\n currentMonthDaysIterator++\n ) {\n const mod = dayOfTheWeek % 7;\n const day = new Date(this._calendarYear, this._calendarMonth, currentMonthDaysIterator);\n\n if (calendar.get(this.days[mod].name)) {\n calendar.get(this.days[mod].name)?.push(day);\n } else {\n calendar.set(this.days[mod].name, [day]);\n }\n dayOfTheWeek += 1;\n }\n\n const index = this._calendarDays.findIndex(day => day.value === dayOfTheWeek % 7);\n\n if (index !== 0) {\n for (\n let nextMonthDaysIterator = 1;\n nextMonthDaysIterator <= this._calendarDays.length - index;\n nextMonthDaysIterator++\n ) {\n const mod = dayOfTheWeek % 7;\n const date = new Date(this._calendarYear, this._calendarMonth + 1, nextMonthDaysIterator);\n\n calendar.get(this.days[mod].name)?.push(date);\n\n dayOfTheWeek += 1;\n }\n }\n return calendar;\n }\n\n updated(changedProperties: PropertyValues) {\n if (changedProperties.has(\"value\")) {\n const dates = formatToDateArray(this._value);\n\n if (!dates || !Array.isArray(dates) || dates.length === 0) {\n this.handleClearSelectedDates();\n } else {\n dates.forEach(date => {\n this.handleDate(date);\n });\n }\n }\n }\n\n renderCalendarHeader() {\n const showMonthSelected =\n this._calendarView === CALENDAR_VIEWS.MONTHS ? \"header-text-hover\" : \"\";\n const showYearSelected = this._calendarView === CALENDAR_VIEWS.YEARS ? \"header-text-hover\" : \"\";\n\n return html`\n <div class=\"calendar-header\">\n <bl-button\n class=\"arrow\"\n icon=\"arrow_left\"\n variant=\"tertiary\"\n kind=\"neutral\"\n @click=\"${() => this.setPreviousCalendarView()}\"\n ></bl-button>\n ${!this.monthYearOnly\n ? html`<bl-button\n variant=\"tertiary\"\n kind=\"neutral\"\n class=\"header-text ${showMonthSelected}\"\n @click=\"${() => this.setCurrentCalendarView(CALENDAR_VIEWS.MONTHS)}\"\n >${this.months[this._calendarMonth].name}\n </bl-button>`\n : html``}\n <bl-button\n variant=\"tertiary\"\n kind=\"neutral\"\n class=\"header-text ${showYearSelected}\"\n @click=\"${() => this.setCurrentCalendarView(CALENDAR_VIEWS.YEARS)}\"\n >${this._calendarYear}\n </bl-button>\n <bl-button\n class=\"arrow\"\n icon=\"arrow_right\"\n variant=\"tertiary\"\n kind=\"neutral\"\n @click=\"${() => this.setNextCalendarView()}\"\n ></bl-button>\n </div>\n `;\n }\n\n renderCalendarDays() {\n const calendarDays = this.createCalendarDays();\n const valuesArray = Array.from(calendarDays.values());\n\n return html` <div class=\"week-row\">\n ${[...calendarDays.keys()].map(key => {\n return html` <div class=\"calendar-text weekday-text\">${key}</div> `;\n })}\n </div>\n <div class=\"days-wrapper\">\n ${[...Array(valuesArray[0].length).keys()].map(key => {\n return html` <div class=\"week-row\">\n ${valuesArray.map(values => {\n const date = values[key];\n\n const isSelectedDay = this.checkIfSelectedDate(date);\n const isDayToday = this.checkIfDateIsToday(date);\n const isDisabledDay = this.checkIfDateIsDisabled(date);\n\n const classes = classMap({\n \"day\": true,\n \"calendar-text\": true,\n \"today-day\": isDayToday,\n \"selected-day\": isSelectedDay,\n \"other-month-day\": values[key].getMonth() !== this._calendarMonth,\n \"disabled-day\": isDisabledDay,\n });\n\n return html`<div class=\"day-wrapper\">\n <bl-button\n id=${date.getTime()}\n variant=\"tertiary\"\n kind=\"neutral\"\n size=\"small\"\n class=${classes}\n ?disabled=${isDisabledDay}\n @click=\"${() => !isDisabledDay && this.handleDate(date)}\"\n >\n ${this.dayRenderer ? this.dayRenderer(date) : date.getDate()}\n </bl-button>\n </div>`;\n })}\n </div>`;\n })}\n </div>`;\n }\n\n renderCalendarMonths() {\n return html` <div class=\"grid-content\">\n ${this.months.map((month, index) => {\n const variant = month.value === this._calendarMonth ? \"primary\" : \"tertiary\";\n const neutral = month.value === this._calendarMonth ? \"default\" : \"neutral\";\n\n return html` <bl-button\n variant=${variant}\n kind=${neutral}\n class=\"grid-item\"\n size=\"small\"\n @click=\"${() => this.setMonthAndCalendarView(index)}\"\n ><span class=\"calendar-text\">${month.name}</span></bl-button\n >`;\n })}\n </div>`;\n }\n\n renderCalendarYears() {\n this.generateSurroundingYears();\n return html` <div class=\"grid-content\">\n ${this._calendarYears.map(year => {\n const variant = year === this._calendarYear ? \"primary\" : \"tertiary\";\n const neutral = year === this._calendarYear ? \"default\" : \"neutral\";\n\n return html` <bl-button\n variant=${variant}\n kind=${neutral}\n class=\"grid-item\"\n @click=\"${() => this.setYearAndCalendarView(year)}\"\n ><span class=\"calendar-text\">${year}</span></bl-button\n >`;\n })}\n </div>`;\n }\n\n render() {\n return html`\n <div>\n <div class=\"calendar-content\">\n <div class=\"calendar\">\n ${this.renderCalendarHeader()}\n ${this._calendarView === CALENDAR_VIEWS.DAYS ? this.renderCalendarDays() : \"\"}\n ${this._calendarView === CALENDAR_VIEWS.MONTHS ? this.renderCalendarMonths() : \"\"}\n ${this._calendarView === CALENDAR_VIEWS.YEARS ? this.renderCalendarYears() : \"\"}\n </div>\n </div>\n </div>\n `;\n }\n}\n"],
|
|
5
|
+
"mappings": "mWAAO,SAASA,EAAkBC,EAAuB,CACvD,IAAMC,EAAoB,CAAC,EACrBC,EAAaF,EAAM,MAAM,GAAG,EAElC,OAAAE,GAAA,MAAAA,EAAY,QAAQC,GAAQ,CAC1B,IAAMC,EAAS,IAAI,KAAKD,EAAK,KAAK,CAAC,EAE9B,MAAMC,EAAO,QAAQ,CAAC,GACzBH,EAAU,KAAKG,CAAM,CAEzB,GACOH,CACT,CCPA,IAAqBI,EAArB,cAAqDC,CAAW,CAAhE,kCAUE,iBAAyB,EAKzB,YAAiB,SAAS,gBAAgB,MAAQ,QAMlD,mBAAgB,GAKhB,KAAU,eAAyB,CAAC,EAqFpC,YAAiC,CAAC,EAnFlC,IAAI,eAAwB,CAC1B,OAAO,KAAK,cACd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C;AAAA;AAAA,oBAEG,IAAM,KAAK,uBAAuBtD,CAAI;AAAA,yCACjBA;AAAA,UAEnC,CAAC;AAAA,WAEL,CAEA,QAAS,CACP,OAAO2C;AAAA;AAAA;AAAA;AAAA,cAIG,KAAK,qBAAqB;AAAA,cAC1B,KAAK,uBAAwC,KAAK,mBAAmB,EAAI;AAAA,cACzE,KAAK,yBAA0C,KAAK,qBAAqB,EAAI;AAAA,cAC7E,KAAK,wBAAyC,KAAK,oBAAoB,EAAI;AAAA;AAAA;AAAA;AAAA,KAKvF,CACF,EA1fEY,EAAA,CADCC,EAAM,GADY9D,EAEnB,qBAEA6D,EAAA,CADCC,EAAM,GAHY9D,EAInB,8BAEA6D,EAAA,CADCC,EAAM,GALY9D,EAMnB,6BAEA6D,EAAA,CADCC,EAAM,GAPY9D,EAQnB,6BAEA6D,EAAA,CADCC,EAAM,GATY9D,EAUnB,8BAEA6D,EAAA,CADCC,EAAM,GAXY9D,EAYnB,6BAEA6D,EAAA,CADCC,EAAM,GAbY9D,EAcnB,sBAOA6D,EAAA,CADCE,EAAS,CAAE,UAAW,EAAM,CAAC,GApBX/D,EAqBnB,2BAK6B6D,EAAA,CAA5BG,EAAM,oBAAoB,GA1BRhE,EA0BU,mCA1BVA,EAArB6D,EAAA,CAFCE,EAAc,aAAa,EAC3BE,EAAU,GACUjE",
|
|
6
|
+
"names": ["stringToDateArray", "value", "tempValue", "splitDates", "date", "isDate", "DatepickerCalendarMixin", "s", "disabledDates", "newVal", "stringToDateArray", "d", "maxDate", "minDate", "value", "oldValue", "__decorateClass", "e", "formatToDateArray", "value", "stringToDateArray", "styles", "i", "bl_calendar_default", "BlCalendar", "DatepickerCalendarMixin", "bl_calendar_default", "setDirectionProperty", "month", "day", "year", "fromYear", "_", "i", "view", "defaultView", "date", "_a", "isDateBeforeThanCalendar", "isDateAfterThanCalendar", "calendarDate", "_b", "_c", "d", "tempEndDate", "today", "disabledDate", "_d", "_e", "_f", "_g", "_h", "_i", "startDateParentElement", "endDateParentElement", "rangeDays", "element", "calendar", "currentMonthStartWeekDay", "lastMonthDaysCount", "previousMonthDayCount", "currentMonthDayCount", "dayOfTheWeek", "lastMonthDaysIterator", "mod", "currentMonthDaysIterator", "index", "nextMonthDaysIterator", "changedProperties", "dates", "formatToDateArray", "showMonthSelected", "showYearSelected", "x", "calendarDays", "valuesArray", "key", "values", "isSelectedDay", "isDayToday", "isDisabledDay", "classes", "o", "variant", "neutral", "__decorateClass", "t", "e", "event", "localized"]
|
|
7
|
+
}
|
|
@@ -115,5 +115,5 @@ import{a as y}from"./chunk-ECPWEUBG.js";import{b as C,d as E,f as I,g as V,h as
|
|
|
115
115
|
</div>`:""}
|
|
116
116
|
</div>
|
|
117
117
|
<div class="hint">${e} ${t}</div>
|
|
118
|
-
</div> `}handleFocusOptionByKey(e){let t=Date.now();t-this.lastKeyPressedTime>this.keyPressThreshold&&(this.typedCharacters=""),this.lastKeyPressedTime=t,this.typedCharacters+=e.toLowerCase();let s=this.options.findIndex(n=>n.disabled?!1:n.innerText.trim().toLowerCase().startsWith(this.typedCharacters));s!==-1&&(this.focusedOptionIndex=s,this.options[s].focus())}handleKeydown(e){if(this.focusedOptionIndex===-1&&["Enter","Space"].includes(e.code))this._togglePopover(),e.preventDefault();else if(this._isPopoverOpen===!1&&["ArrowDown","ArrowUp"].includes(e.code))this.open(),e.preventDefault();else if(e.code==="Escape")this.close(),e.preventDefault();else if(this._isPopoverOpen&&["ArrowDown","ArrowUp"].includes(e.code)){let t=this.options.filter(l=>!l.disabled);e.code==="ArrowDown"&&this.focusedOptionIndex++,e.code==="ArrowUp"&&this.focusedOptionIndex--,this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,t.length-1)),t[this.focusedOptionIndex].focus(),e.preventDefault()}else this._isPopoverOpen&&!this.searchBar&&this.handleFocusOptionByKey(e.key)}_togglePopover(){this._isPopoverOpen?this.close():this.open()}_handleSelectEvent(){let e=this._selectedOptions.map(t=>({value:t.value,selected:t.selected,text:t.textContent}));this.multiple?this._onBlSelect(e):this._onBlSelect(e[0])}_handleSearchEvent(){this._onBlSearch(this._searchText)}_handleSearchOptions(e){this.searchBar&&(this._searchText=e.target.value,this._handleSearchEvent(),this._connectedOptions.forEach(t=>{let l=this._searchText.toLowerCase(),s="";if(t.textContent)try{s=t.textContent.toLocaleLowerCase(this.userLang)}catch{s=t.textContent.toLowerCase()}let n=s.includes(l);t.hidden=!n}),this._selectedOptions=this.options.filter(t=>t.selected),this._handleLastVisibleSearchedOption(),this.requestUpdate())}_handleLastVisibleSearchedOption(){var t,l;let e=[...this.options].reverse().find(s=>!s.hidden);e&&((l=(t=e==null?void 0:e.shadowRoot)==null?void 0:t.querySelector("div"))==null||l.classList.add("no-border-bottom")),this.options.map(s=>{var n,c;!s.hidden&&s!==e&&((c=(n=s.shadowRoot)==null?void 0:n.querySelector("div"))==null||c.classList.remove("no-border-bottom"))})}_handleSingleSelect(e){this.value=e.value,this._searchText="",this._handleSelectEvent(),this.close()}_handleMultipleSelect(){this.value=this._connectedOptions.filter(e=>e.selected).map(e=>e.value),this._handleSelectEvent()}_handleSelectOptionEvent(e){let t=e.target;this.dirty=!0,this.multiple?this._handleMultipleSelect():this._handleSingleSelect(t)}_handleSelectAll(e){var c;let t=(c=this.shadowRoot)==null?void 0:c.querySelector(".select-all"),l=e.detail,n=this._connectedOptions.filter(d=>!d.selected&&!d.hidden).every(d=>d.disabled);if(l&&n){setTimeout(()=>{var v;let d=(v=t==null?void 0:t.shadowRoot)==null?void 0:v.querySelector("input");d==null||d.click()},0);return}this._connectedOptions.forEach(d=>{d.disabled||d.hidden||(d.selected=l)}),this._handleMultipleSelect()}_onClickRemove(e){e.stopPropagation(),this._searchText="";let t=this._selectedOptions.filter(l=>l.disabled);this._connectedOptions.filter(l=>!l.disabled&&l.selected).forEach(l=>{l.selected=!1}),this.value=t.length?t.map(l=>l.value):null,this._handleSelectEvent()}_checkAdditionalItemCount(){if(!this.multiple||!this.selectedOptionsItems||this.selectedOptionsItems.length<2){this._additionalSelectedOptionCount=0;return}let e=[...this.selectedOptionsItems].findIndex(t=>t.offsetLeft>this.selectedOptionsContainer.offsetWidth);e>-1?this._additionalSelectedOptionCount=this.selectedOptionsItems.length-e:this._additionalSelectedOptionCount=0}firstUpdated(){this.value===void 0&&(this.multiple?this.value=[]:this.value=null),this._initialValue=this._value}updated(e){e.has("multiple")&&typeof e.get("multiple")=="boolean"&&(this.value=null),e.has("_selectedOptions")&&this._checkAdditionalItemCount()}registerOption(e){this._connectedOptions.push(e),e.selected&&(this.multiple?(Array.isArray(this.value)||(this.value=[]),this.value=[...this.value,e.value]):this.value=e.value),this.setOptionsSelected(),this.requestUpdate()}unregisterOption(e){this._connectedOptions.
|
|
119
|
-
//# sourceMappingURL=chunk-
|
|
118
|
+
</div> `}handleFocusOptionByKey(e){let t=Date.now();t-this.lastKeyPressedTime>this.keyPressThreshold&&(this.typedCharacters=""),this.lastKeyPressedTime=t,this.typedCharacters+=e.toLowerCase();let s=this.options.findIndex(n=>n.disabled?!1:n.innerText.trim().toLowerCase().startsWith(this.typedCharacters));s!==-1&&(this.focusedOptionIndex=s,this.options[s].focus())}handleKeydown(e){if(this.focusedOptionIndex===-1&&["Enter","Space"].includes(e.code))this._togglePopover(),e.preventDefault();else if(this._isPopoverOpen===!1&&["ArrowDown","ArrowUp"].includes(e.code))this.open(),e.preventDefault();else if(e.code==="Escape")this.close(),e.preventDefault();else if(this._isPopoverOpen&&["ArrowDown","ArrowUp"].includes(e.code)){let t=this.options.filter(l=>!l.disabled);e.code==="ArrowDown"&&this.focusedOptionIndex++,e.code==="ArrowUp"&&this.focusedOptionIndex--,this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,t.length-1)),t[this.focusedOptionIndex].focus(),e.preventDefault()}else this._isPopoverOpen&&!this.searchBar&&this.handleFocusOptionByKey(e.key)}_togglePopover(){this._isPopoverOpen?this.close():this.open()}_handleSelectEvent(){let e=this._selectedOptions.map(t=>({value:t.value,selected:t.selected,text:t.textContent}));this.multiple?this._onBlSelect(e):this._onBlSelect(e[0])}_handleSearchEvent(){this._onBlSearch(this._searchText)}_handleSearchOptions(e){this.searchBar&&(this._searchText=e.target.value,this._handleSearchEvent(),this._connectedOptions.forEach(t=>{let l=this._searchText.toLowerCase(),s="";if(t.textContent)try{s=t.textContent.toLocaleLowerCase(this.userLang)}catch{s=t.textContent.toLowerCase()}let n=s.includes(l);t.hidden=!n}),this._selectedOptions=this.options.filter(t=>t.selected),this._handleLastVisibleSearchedOption(),this.requestUpdate())}_handleLastVisibleSearchedOption(){var t,l;let e=[...this.options].reverse().find(s=>!s.hidden);e&&((l=(t=e==null?void 0:e.shadowRoot)==null?void 0:t.querySelector("div"))==null||l.classList.add("no-border-bottom")),this.options.map(s=>{var n,c;!s.hidden&&s!==e&&((c=(n=s.shadowRoot)==null?void 0:n.querySelector("div"))==null||c.classList.remove("no-border-bottom"))})}_handleSingleSelect(e){this.value=e.value,this._searchText="",this._handleSelectEvent(),this.close()}_handleMultipleSelect(){this.value=this._connectedOptions.filter(e=>e.selected).map(e=>e.value),this._handleSelectEvent()}_handleSelectOptionEvent(e){let t=e.target;this.dirty=!0,this.multiple?this._handleMultipleSelect():this._handleSingleSelect(t)}_handleSelectAll(e){var c;let t=(c=this.shadowRoot)==null?void 0:c.querySelector(".select-all"),l=e.detail,n=this._connectedOptions.filter(d=>!d.selected&&!d.hidden).every(d=>d.disabled);if(l&&n){setTimeout(()=>{var v;let d=(v=t==null?void 0:t.shadowRoot)==null?void 0:v.querySelector("input");d==null||d.click()},0);return}this._connectedOptions.forEach(d=>{d.disabled||d.hidden||(d.selected=l)}),this._handleMultipleSelect()}_onClickRemove(e){e.stopPropagation(),this._searchText="";let t=this._selectedOptions.filter(l=>l.disabled);this._connectedOptions.filter(l=>!l.disabled&&l.selected).forEach(l=>{l.selected=!1}),this.value=t.length?t.map(l=>l.value):null,this._handleSelectEvent()}_checkAdditionalItemCount(){if(!this.multiple||!this.selectedOptionsItems||this.selectedOptionsItems.length<2){this._additionalSelectedOptionCount=0;return}let e=[...this.selectedOptionsItems].findIndex(t=>t.offsetLeft>this.selectedOptionsContainer.offsetWidth);e>-1?this._additionalSelectedOptionCount=this.selectedOptionsItems.length-e:this._additionalSelectedOptionCount=0}firstUpdated(){this.value===void 0&&(this.multiple?this.value=[]:this.value=null),this._initialValue=this._value}updated(e){e.has("multiple")&&typeof e.get("multiple")=="boolean"&&(this.value=null),e.has("_selectedOptions")&&this._checkAdditionalItemCount()}registerOption(e){this._connectedOptions.includes(e)||(this._connectedOptions.push(e),e.selected&&(this.multiple?(Array.isArray(this.value)||(this.value=[]),this.value=[...this.value,e.value]):this.value=e.value),this.setOptionsSelected(),this.requestUpdate())}unregisterOption(e){let t=this._connectedOptions.indexOf(e);t!==-1&&this._connectedOptions.splice(t,1)}};i.shadowRootOptions={...g.shadowRootOptions,delegatesFocus:!0},i.formControlValidators=[z],o([a()],i.prototype,"name",2),o([a()],i.prototype,"value",1),o([a({reflect:!0})],i.prototype,"label",2),o([a({reflect:!0})],i.prototype,"placeholder",2),o([a({type:String,reflect:!0})],i.prototype,"size",2),o([a({type:Boolean,reflect:!0})],i.prototype,"required",2),o([a({type:Boolean,reflect:!0})],i.prototype,"disabled",2),o([a({type:Boolean,reflect:!0})],i.prototype,"clearable",2),o([a({type:Boolean,reflect:!0})],i.prototype,"multiple",2),o([a({type:Boolean,reflect:!0})],i.prototype,"autofocus",2),o([a({type:Boolean,attribute:"label-fixed",reflect:!0})],i.prototype,"labelFixed",2),o([a({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),o([a({type:String,attribute:"invalid-text",reflect:!0})],i.prototype,"customInvalidText",2),o([a({type:Boolean,attribute:"view-select-all",converter:y()})],i.prototype,"viewSelectAll",2),o([a({type:String,attribute:"select-all-text"})],i.prototype,"selectAllText",2),o([a({type:Boolean,attribute:"search-bar",reflect:!0})],i.prototype,"searchBar",2),o([a({type:String,attribute:"search-bar-placeholder",reflect:!0})],i.prototype,"searchBarPlaceholder",2),o([a({type:Boolean,attribute:"search-bar-loading-state",converter:y()})],i.prototype,"searchBarLoadingState",2),o([a({type:String,attribute:"search-not-found-text",reflect:!0})],i.prototype,"searchNotFoundText",2),o([a({type:String,attribute:"popover-clear-search-text",reflect:!0})],i.prototype,"popoverClearSearchText",2),o([u()],i.prototype,"_isPopoverOpen",2),o([u()],i.prototype,"_additionalSelectedOptionCount",2),o([u()],i.prototype,"_searchText",2),o([b(".selected-options")],i.prototype,"selectedOptionsContainer",2),o([S(".selected-options li")],i.prototype,"selectedOptionsItems",2),o([b(".popover")],i.prototype,"_popover",2),o([b(".select-input")],i.prototype,"_selectInput",2),o([m("bl-select")],i.prototype,"_onBlSelect",2),o([m("bl-search")],i.prototype,"_onBlSearch",2),o([u()],i.prototype,"_selectedOptions",2),o([u()],i.prototype,"dirty",2),o([b(".select-input")],i.prototype,"validationTarget",2),i=o([T("bl-select"),k()],i);export{i as a};
|
|
119
|
+
//# sourceMappingURL=chunk-NODTAMYY.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/components/select/bl-select.css", "../src/components/select/bl-select.ts"],
|
|
4
|
-
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-neutral-full);--border-color:var(--bl-color-neutral-lighter);--border-focus-color:var(--bl-color-primary-highlight);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--label-color:var(--bl-color-neutral-dark);--placeholder-color:var(--bl-color-neutral-light);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-neutral-lightest);--menu-height:250px;--popover-position:var(--bl-popover-position, fixed)}:host([multiple][view-select-all]) .select-wrapper{--menu-height:290px}:host([size=large]) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size=small]) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-neutral-light)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-highlight);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);-webkit-user-select:none;user-select:none;margin:0;width:auto;min-width:100%}.label,.placeholder{color:var(--placeholder-color);padding-inline-start:var(--label-padding);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.select-wrapper.selected .placeholder,:host(:not([placeholder])) .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}:host(:not([label])) .label,:host([label-fixed]) .label{display:none}.remove-all{display:none}.selected .remove-all{display:block}:host([disabled]) .remove-all,:host([disabled]) .remove-all::after{display:none}.dropdown-icon{font-size:var(--bl-font-size-m)}.dropdown-icon.open{display:none}.select-open .dropdown-icon.open{display:inline-block}.select-open .dropdown-icon.closed{display:none}.selected .dropdown-icon{--icon-color:var(--bl-color-neutral-darker)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-neutral-light)}.select-input:focus-visible,.select-open .select-input{border:solid 1px var(--border-focus-color);outline:0}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;padding-inline-start:var(--label-padding);margin:0;list-style:none;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([disabled]) .select-input .selected-options{color:var(--bl-color-neutral-light)}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}:host(:not([multiple])) .selected-options li{display:inline-flex;align-items:center;gap:var(--bl-size-2xs)}.selected-options li:not(:last-child)::after{content:\", \"}.select-input:not(.has-overflowed-options) .additional-selection-count{display:none}:host([disabled]) .additional-selection-count{color:var(--bl-color-neutral-light)}:host([disabled]) .selected-options li{color:var(--bl-color-neutral-light)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-4xs);margin-inline-start:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:var(--popover-position);border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--bl-index-popover);width:100%;top:var(--top);left:var(--left)}:host(:empty) .popover{display:none}.popover-no-result{display:flex;flex-direction:column;gap:var(--bl-size-2xs);align-items:center;justify-content:center;height:80px}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}label,legend{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;display:block;top:var(--padding-vertical);left:var(--padding-horizontal);inset-inline-end:calc(var(--bl-size-2xs) + var(--bl-size-m) + var(--bl-size-2xs));transition:.1s ease-in;pointer-events:none;opacity:0;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color)}legend{height:0;visibility:hidden;display:none}legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:host(:not([placeholder])) .selected .label,:host([placeholder]) :where(.select-open,.selected) .label{display:none}:where(.select-open,.selected) label{top:0;transform:translateY(-50%);font:var(--bl-font-caption);color:var(--label-color);pointer-events:initial;right:var(--padding-horizontal);opacity:1}:host([label]) :where(.select-open,.selected) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host([label-fixed]) label{position:static;padding:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--label-color);opacity:1}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.error-icon,.invalid-text{display:none}.dirty.invalid label,.error-icon,.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}.dirty.invalid .hint,:host([help-text]) .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.select-all{position:sticky;top:0;padding:var(--bl-size-xs) 0;background:var(--background-color);z-index:1;font:var(--bl-font-title-3-regular);box-shadow:10px 0 0 var(--background-color),-10px 0 0 var(--background-color)}.select-all::after{position:absolute;content:\"\";width:100%;bottom:0;border-bottom:1px solid var(--bl-color-neutral-lighter)}.search-bar-input{font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--text-color);border:none;outline:0;background-color:transparent;width:100%;height:100%;padding:0;margin:0;box-sizing:border-box}.search-bar-input::placeholder{color:var(--placeholder-color)}.search-bar-input:focus-visible{outline:0}.search-spinner{padding-inline-end:var(--bl-font-size-2xs)}.action-divider{display:none}.select-wrapper .action-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}.actions bl-icon{padding:4px}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, query, queryAll, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { autoUpdate, computePosition, flip, MiddlewareState, offset, size } from \"@floating-ui/dom\";\nimport { localized, msg } from \"@lit/localize\";\nimport { FormControlMixin, requiredValidator } from \"@open-wc/form-control\";\nimport { FormValue } from \"@open-wc/form-helpers\";\nimport \"element-internals-polyfill\";\nimport { LangKey } from \"../../localization\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { stringBooleanConverter } from \"../../utilities/string-boolean.converter\";\nimport \"../button/bl-button\";\nimport \"../checkbox-group/checkbox/bl-checkbox\";\nimport BlCheckbox from \"../checkbox-group/checkbox/bl-checkbox\";\nimport \"../icon/bl-icon\";\nimport style from \"../select/bl-select.css\";\nimport \"../select/option/bl-select-option\";\nimport type BlSelectOption from \"./option/bl-select-option\";\n\nexport interface ISelectOption<T = string> {\n value: T;\n text: string;\n selected: boolean;\n}\n\nexport type SelectSize = \"medium\" | \"large\" | \"small\";\n\nexport type CleanUpFunction = () => void;\n\n/**\n * @tag bl-select\n * @summary Baklava Select component\n *\n * @cssproperty [--bl-popover-position=fixed] Sets the positioning strategy of select popover. You can set it as `absolute` if you need to show popover relative to its trigger element.\n */\n@customElement(\"bl-select\")\n@localized()\nexport default class BlSelect<ValueType extends FormValue = string> extends FormControlMixin(\n LitElement\n) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static formControlValidators = [requiredValidator];\n\n /**\n * Sets name of the select field\n */\n @property()\n name: string;\n\n private _value: ValueType | ValueType[] | null;\n\n private _initialValue: ValueType | ValueType[] | null;\n\n /**\n * Sets the value of the select\n */\n @property()\n get value(): ValueType | ValueType[] | null {\n return this._value;\n }\n\n set value(val: ValueType | ValueType[] | null) {\n this._value = val;\n\n if (Array.isArray(val)) {\n const formData = new FormData();\n\n val.forEach(option => formData.append(this.name, `${option}`));\n this.setValue(formData);\n } else {\n this.setValue(val);\n }\n\n this.setOptionsSelected();\n }\n\n shouldFormValueUpdate(): boolean {\n return this.value !== null && this.value !== \"\";\n }\n\n /* Declare reactive properties */\n /**\n * Sets the label value\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Sets the placeholder value. If left blank, the label value (if specified) is set as placeholder.\n */\n @property({ reflect: true })\n placeholder?: string;\n\n /**\n * Sets the size value. Select component's height value will be changed accordingly\n */\n @property({ type: String, reflect: true })\n size: SelectSize = \"medium\";\n\n /**\n * When option is not selected, shows component in error state\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Shows the component in disabled state.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets whether the selected option is clearable\n */\n @property({ type: Boolean, reflect: true })\n clearable = false;\n\n /**\n * Allows multiple options to be selected\n */\n @property({ type: Boolean, reflect: true })\n multiple = false;\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText?: string;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: \"invalid-text\", reflect: true })\n customInvalidText?: string;\n\n /**\n * Views select all option in multiple select\n */\n @property({ type: Boolean, attribute: \"view-select-all\", converter: stringBooleanConverter() })\n viewSelectAll = false;\n\n /**\n * Sets select all text in multiple select\n */\n @property({ type: String, attribute: \"select-all-text\" })\n selectAllText?: string;\n\n /**\n * Enable search functionality for the options within the list\n */\n @property({ type: Boolean, attribute: \"search-bar\", reflect: true })\n searchBar = false;\n\n /**\n * Search for text variations such as \"search,\" \"searching,\" \"search by country,\" and so on\n */\n @property({ type: String, attribute: \"search-bar-placeholder\", reflect: true })\n searchBarPlaceholder?: string;\n\n /**\n * Display a loading icon in place of the search icon.\n */\n @property({\n type: Boolean,\n attribute: \"search-bar-loading-state\",\n converter: stringBooleanConverter(),\n })\n searchBarLoadingState = false;\n\n /**\n * Text to display when no search results are found.\n */\n @property({ type: String, attribute: \"search-not-found-text\", reflect: true })\n searchNotFoundText?: string;\n\n /**\n * Text to display on the clear search button.\n */\n @property({ type: String, attribute: \"popover-clear-search-text\", reflect: true })\n popoverClearSearchText?: string;\n\n /* Declare internal reactive properties */\n @state()\n private _isPopoverOpen = false;\n\n @state()\n private _additionalSelectedOptionCount = 0;\n\n @state()\n private _searchText = \"\";\n\n @query(\".selected-options\")\n private selectedOptionsContainer!: HTMLElement;\n\n @queryAll(\".selected-options li\")\n private selectedOptionsItems!: NodeListOf<HTMLElement>;\n\n @query(\".popover\")\n private _popover: HTMLElement;\n\n @query(\".select-input\")\n private _selectInput: HTMLElement;\n\n /**\n * Fires when selection changes\n */\n @event(\"bl-select\") private _onBlSelect: EventDispatcher<\n ISelectOption<ValueType>[] | ISelectOption<ValueType>\n >;\n\n /**\n * Fires when search text changes\n */\n @event(\"bl-search\") private _onBlSearch: EventDispatcher<string>;\n\n private userLang =\n (document.querySelector(\"html\")?.getAttribute(\"lang\") as LangKey | null) || navigator.language;\n\n private _connectedOptions: BlSelectOption<ValueType>[] = [];\n\n private _cleanUpPopover: CleanUpFunction | null = null;\n\n private setOptionsSelected() {\n this._connectedOptions.forEach(\n option =>\n (option.selected =\n this.value === option.value ||\n (Array.isArray(this.value) && this.value.includes(option.value)))\n );\n\n this._selectedOptions = [...this.options.filter(option => option.selected)];\n }\n\n get options() {\n return this._connectedOptions;\n }\n\n get opened() {\n return this._isPopoverOpen;\n }\n\n get noResultFound() {\n return this._searchText !== \"\" && this._connectedOptions.every(option => option.hidden);\n }\n\n @state()\n private _selectedOptions: BlSelectOption<ValueType>[] = [];\n\n @state()\n private dirty = false;\n\n get selectedOptions(): BlSelectOption<ValueType>[] {\n return this._selectedOptions;\n }\n\n get additionalSelectedOptionCount() {\n return this._additionalSelectedOptionCount;\n }\n\n validityCallback(): string | void {\n if (this.customInvalidText) {\n return this.customInvalidText;\n }\n const select = document.createElement(\"select\");\n\n select.required = this.required;\n\n return select.validationMessage;\n }\n\n reportValidity() {\n this.dirty = true;\n return this.checkValidity();\n }\n\n resetFormControl(): void {\n this.value = this._initialValue;\n }\n\n @query(\".select-input\")\n validationTarget: HTMLElement;\n\n open() {\n if (this.searchBar) {\n setTimeout(() => {\n document.activeElement?.shadowRoot?.querySelector(\"input\")?.focus();\n }, 100);\n }\n\n this._isPopoverOpen = true;\n this._setupPopover();\n document.addEventListener(\"click\", this._interactOutsideHandler, true);\n document.addEventListener(\"focus\", this._interactOutsideHandler, true);\n }\n\n close() {\n this._handleSearchOptions({ target: { value: \"\" } } as InputEvent & {\n target: HTMLInputElement;\n });\n\n this._isPopoverOpen = false;\n this.focusedOptionIndex = -1;\n this._cleanUpPopover && this._cleanUpPopover();\n document.removeEventListener(\"click\", this._interactOutsideHandler, true);\n document.removeEventListener(\"focus\", this._interactOutsideHandler, true);\n }\n\n private _interactOutsideHandler = (event: MouseEvent | FocusEvent) => {\n const eventPath = event.composedPath() as HTMLElement[];\n\n if (!eventPath?.find(el => el.tagName === \"BL-SELECT\")?.contains(this)) {\n this.close();\n }\n };\n\n private _setupPopover() {\n this._cleanUpPopover = autoUpdate(this._selectInput, this._popover, () => {\n computePosition(this._selectInput, this._popover, {\n placement: \"bottom\",\n strategy: \"fixed\",\n middleware: [\n flip(),\n offset(8),\n size({\n apply(args: MiddlewareState) {\n Object.assign(args.elements.floating.style, {\n width: `${args.elements.reference.getBoundingClientRect().width}px`,\n });\n },\n }),\n ],\n }).then(({ x, y }) => {\n this._popover.style.setProperty(\"--left\", `${x}px`);\n this._popover.style.setProperty(\"--top\", `${y}px`);\n });\n });\n }\n\n private _handleToggleButtonClick(e: MouseEvent) {\n e.stopPropagation();\n this._togglePopover();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.form?.addEventListener(\"submit\", (e: SubmitEvent) => {\n if (!this.reportValidity()) {\n e.preventDefault();\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this._cleanUpPopover && this._cleanUpPopover();\n }\n\n private inputTemplate() {\n const inputSelectedOptions = html`<ul class=\"selected-options\">\n ${this._selectedOptions.map(item => {\n const icon = item.icon\n ? html`<bl-icon name=${item.icon}></bl-icon>`\n : Array.from(item.querySelectorAll(\"[slot=icon]\")).map(el => el.cloneNode(true));\n\n return html`<li>${icon}${item.getAttribute(\"label\") || item.textContent}</li>`;\n })}\n </ul>`;\n\n const isAllSelectedDisabled =\n this._selectedOptions.length > 0 && this._selectedOptions.every(option => option.disabled);\n const isRemoveButtonShown = !isAllSelectedDisabled && (this.clearable || this.multiple);\n const removeButton = isRemoveButtonShown\n ? html`<bl-button\n class=\"remove-all\"\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this._onClickRemove}\n ></bl-button>`\n : \"\";\n\n const isSearchBarVisible = this.searchBar && this.opened;\n const hasSelectedOptions = this._selectedOptions.length > 0;\n\n const isDividerShown = isSearchBarVisible || (hasSelectedOptions && isRemoveButtonShown);\n\n const searchbarPlaceholderText =\n this.searchBarPlaceholder ?? msg(\"Search\", { desc: \"bl-select: search placeholder text\" });\n\n const searchMagIcon = html`<bl-icon\n class=\"search-mag-icon\"\n name=\"search\"\n style=\"color: var(--bl-color-primary);font-size: var(--bl-font-size-s)\"\n ></bl-icon>`;\n\n const searchSpinner = html`<bl-spinner class=\"search-spinner\"></bl-spinner>`;\n\n const actionDivider = isDividerShown ? html`<div class=\"action-divider\"></div>` : \"\";\n\n const search = html`<fieldset\n class=${classMap({\n \"select-input\": true,\n \"has-overflowed-options\": this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${this.disabled ? \"-1\" : 0}\"\n .autofocus=${this.autofocus}\n role=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${this.opened}\"\n aria-labelledby=\"label\"\n @click=${this.open}\n >\n <legend><span>${this.label}</span></legend>\n\n ${this._selectedOptions.length > 0 && !this.opened\n ? inputSelectedOptions\n : html`\n <input\n class=\"search-bar-input\"\n placeholder=${this.opened || this.labelFixed\n ? searchbarPlaceholderText\n : this.label || searchbarPlaceholderText}\n @input=${this._handleSearchOptions}\n @keydown=${(e: KeyboardEvent) => {\n if (e.code === \"Space\") {\n e.stopPropagation();\n }\n }}\n .value=${this._searchText}\n />\n `}\n ${!this.opened\n ? html`<span class=\"additional-selection-count\"\n >+${this._additionalSelectedOptionCount}</span\n >`\n : \"\"}\n\n <div class=\"actions\">\n ${this.opened ? (this.searchBarLoadingState ? searchSpinner : searchMagIcon) : \"\"}\n ${!this.opened ? removeButton : \"\"} ${actionDivider}\n <bl-button\n class=\"dropdown-icon open\"\n variant=\"tertiary\"\n kind=\"neutral\"\n size=\"small\"\n icon=\"arrow_up\"\n @click=${this._handleToggleButtonClick}\n aria-label=\"${msg(\"Close dropdown\", { desc: \"bl-select: close dropdown button\" })}\"\n ></bl-button>\n <bl-button\n class=\"closed dropdown-icon\"\n variant=\"tertiary\"\n kind=\"neutral\"\n size=\"small\"\n icon=\"arrow_down\"\n @click=${this._handleToggleButtonClick}\n aria-label=\"${msg(\"Open dropdown\", { desc: \"bl-select: open dropdown button\" })}\"\n ></bl-button>\n </div>\n </fieldset>`;\n\n return this.searchBar\n ? search\n : html`<fieldset\n class=${classMap({\n \"select-input\": true,\n \"has-overflowed-options\": this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${ifDefined(this.disabled ? undefined : 0)}\"\n ?autofocus=${this.autofocus}\n @click=${this._togglePopover}\n role=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${this.opened}\"\n aria-labelledby=\"label\"\n >\n <legend><span>${this.label}</span></legend>\n <span class=\"placeholder\">${this.placeholder}</span>\n <span class=\"label\">${this.label}</span>\n ${inputSelectedOptions}\n <span class=\"additional-selection-count\">+${this._additionalSelectedOptionCount}</span>\n <div class=\"actions\">\n ${removeButton} ${actionDivider}\n <bl-icon class=\"dropdown-icon open\" name=\"arrow_up\"></bl-icon>\n\n <bl-icon class=\"dropdown-icon closed\" name=\"arrow_down\"></bl-icon>\n </div>\n </fieldset>`;\n }\n\n selectAllTemplate() {\n if (!this.multiple || !this.viewSelectAll || this.noResultFound) {\n return null;\n }\n\n const isAllRenderedOptionsSelected = this._connectedOptions\n .filter(option => !option.hidden)\n .every(option => option.selected);\n\n const isAnySelected = this._selectedOptions.filter(option => !option.hidden).length > 0;\n const selectAllText =\n this.selectAllText ?? msg(\"Select All\", { desc: \"bl-select: select all text\" });\n\n return html`<bl-checkbox\n class=\"select-all\"\n .checked=\"${isAllRenderedOptionsSelected}\"\n .indeterminate=\"${isAnySelected && !isAllRenderedOptionsSelected}\"\n role=\"option\"\n aria-selected=\"${isAllRenderedOptionsSelected}\"\n @bl-checkbox-change=\"${this._handleSelectAll}\"\n >\n ${selectAllText}\n </bl-checkbox>`;\n }\n\n render(): TemplateResult {\n const invalidMessage = !this.checkValidity()\n ? html`<p id=\"errorMessage\" aria-live=\"polite\" class=\"invalid-text\">\n ${this.validationMessage}\n </p>`\n : \"\";\n\n const helpMessage = this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : \"\";\n\n const label = this.label ? html`<label id=\"label\">${this.label}</label>` : \"\";\n\n const noDataText =\n this.searchNotFoundText ?? msg(\"No Data Found\", { desc: \"bl-select: search no data text\" });\n\n const clearSearchText =\n this.popoverClearSearchText ??\n msg(\"Clear Search\", { desc: \"bl-select: clear search button text\" });\n\n return html`<div\n class=${classMap({\n \"select-wrapper\": true,\n \"select-open\": this.opened,\n \"selected\": this._selectedOptions.length > 0,\n \"invalid\": !this.validity.valid,\n \"dirty\": this.dirty,\n })}\n @keydown=${this.handleKeydown}\n >\n ${label} ${this.inputTemplate()}\n <div\n class=\"popover\"\n tabindex=\"${ifDefined(this._isPopoverOpen ? undefined : \"-1\")}\"\n @bl-select-option=${this._handleSelectOptionEvent}\n role=\"listbox\"\n aria-multiselectable=\"${this.multiple}\"\n aria-labelledby=\"label\"\n >\n ${this.selectAllTemplate()}\n <slot></slot>\n ${this.searchBar && this.noResultFound\n ? html`<div name=\"popover-clear-search-text\" class=\"popover-no-result\">\n <span>${noDataText}</span>\n <bl-button\n variant=\"tertiary\"\n @click=${() => {\n this._handleSearchOptions({ target: { value: \"\" } } as InputEvent & {\n target: HTMLInputElement;\n });\n }}\n >${clearSearchText}</bl-button\n >\n </div>`\n : \"\"}\n </div>\n <div class=\"hint\">${invalidMessage} ${helpMessage}</div>\n </div> `;\n }\n\n private focusedOptionIndex = -1;\n private lastKeyPressedTime = 0;\n private typedCharacters = \"\";\n private keyPressThreshold = 500;\n\n private handleFocusOptionByKey(key: string) {\n const currentTime = Date.now();\n const elapsedTimeSinceLastKeyPress = currentTime - this.lastKeyPressedTime;\n\n if (elapsedTimeSinceLastKeyPress > this.keyPressThreshold) {\n this.typedCharacters = \"\";\n }\n\n this.lastKeyPressedTime = currentTime;\n this.typedCharacters += key.toLowerCase();\n\n const matchingOptionIndex = this.options.findIndex(option => {\n if (option.disabled) {\n return false;\n }\n const optionText = option.innerText.trim().toLowerCase();\n\n return optionText.startsWith(this.typedCharacters);\n });\n\n if (matchingOptionIndex !== -1) {\n this.focusedOptionIndex = matchingOptionIndex;\n this.options[matchingOptionIndex].focus();\n }\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (this.focusedOptionIndex === -1 && [\"Enter\", \"Space\"].includes(event.code)) {\n this._togglePopover();\n event.preventDefault();\n } else if (this._isPopoverOpen === false && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n this.open();\n event.preventDefault();\n } else if (event.code === \"Escape\") {\n this.close();\n event.preventDefault();\n } else if (this._isPopoverOpen && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n const activeOptions = this.options.filter(option => !option.disabled);\n\n event.code === \"ArrowDown\" && this.focusedOptionIndex++;\n event.code === \"ArrowUp\" && this.focusedOptionIndex--;\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, activeOptions.length - 1)\n );\n\n activeOptions[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n } else if (this._isPopoverOpen && !this.searchBar) {\n this.handleFocusOptionByKey(event.key);\n }\n }\n\n private _togglePopover() {\n this._isPopoverOpen ? this.close() : this.open();\n }\n\n private _handleSelectEvent() {\n const options = this._selectedOptions.map(\n option =>\n ({\n value: option.value,\n selected: option.selected,\n text: option.textContent,\n } as ISelectOption<ValueType>)\n );\n\n if (!this.multiple) this._onBlSelect(options[0]);\n else this._onBlSelect(options);\n }\n\n private _handleSearchEvent() {\n this._onBlSearch(this._searchText);\n }\n\n private _handleSearchOptions(e: InputEvent): void {\n if (!this.searchBar) return;\n\n this._searchText = (e.target as HTMLInputElement).value;\n\n this._handleSearchEvent();\n\n this._connectedOptions.forEach(option => {\n const searchText = this._searchText.toLowerCase();\n let optionText = \"\";\n\n if (option.textContent) {\n try {\n // Try locale-specific comparison first\n optionText = option.textContent.toLocaleLowerCase(this.userLang);\n } catch {\n // Fallback to basic toLowerCase if locale is not supported\n optionText = option.textContent.toLowerCase();\n }\n }\n\n const isVisible = optionText.includes(searchText);\n\n option.hidden = !isVisible;\n });\n\n this._selectedOptions = this.options.filter(option => option.selected);\n this._handleLastVisibleSearchedOption();\n this.requestUpdate();\n }\n\n private _handleLastVisibleSearchedOption() {\n const lastVisibleOption = [...this.options].reverse().find(option => !option.hidden);\n\n if (lastVisibleOption) {\n lastVisibleOption?.shadowRoot?.querySelector(\"div\")?.classList.add(\"no-border-bottom\");\n }\n\n this.options.map(option => {\n if (!option.hidden && option !== lastVisibleOption) {\n option.shadowRoot?.querySelector(\"div\")?.classList.remove(\"no-border-bottom\");\n }\n });\n }\n\n private _handleSingleSelect(optionItem: BlSelectOption<ValueType>) {\n this.value = optionItem.value;\n\n this._searchText = \"\";\n this._handleSelectEvent();\n this.close();\n }\n\n private _handleMultipleSelect() {\n this.value = this._connectedOptions\n .filter(option => option.selected)\n .map(option => option.value);\n\n this._handleSelectEvent();\n }\n\n private _handleSelectOptionEvent(e: CustomEvent) {\n const optionItem = e.target as BlSelectOption<ValueType>;\n\n this.dirty = true;\n\n if (this.multiple) {\n this._handleMultipleSelect();\n } else {\n this._handleSingleSelect(optionItem);\n }\n }\n\n private _handleSelectAll(e: CustomEvent) {\n const selectAllEl = this.shadowRoot?.querySelector(\".select-all\") as BlCheckbox;\n\n const checked = e.detail;\n const unselectedOptions = this._connectedOptions.filter(\n option => !option.selected && !option.hidden\n );\n const isAllUnselectedDisabled = unselectedOptions.every(option => option.disabled);\n\n // If all available options are selected, instead of checking, uncheck all options\n if (checked && isAllUnselectedDisabled) {\n setTimeout(() => {\n const checkbox = selectAllEl?.shadowRoot?.querySelector(\"input\");\n\n checkbox?.click();\n }, 0);\n return;\n }\n\n this._connectedOptions.forEach(option => {\n if (option.disabled || option.hidden) {\n return;\n }\n\n option.selected = checked;\n });\n\n this._handleMultipleSelect();\n }\n\n private _onClickRemove(e: MouseEvent) {\n e.stopPropagation();\n\n this._searchText = \"\";\n\n const selectedDisabledOptions = this._selectedOptions.filter(option => option.disabled);\n\n this._connectedOptions\n .filter(option => !option.disabled && option.selected)\n .forEach(option => {\n option.selected = false;\n });\n\n this.value = selectedDisabledOptions.length\n ? selectedDisabledOptions.map(option => option.value)\n : null;\n this._handleSelectEvent();\n }\n\n private _checkAdditionalItemCount() {\n if (!this.multiple || !this.selectedOptionsItems || this.selectedOptionsItems.length < 2) {\n this._additionalSelectedOptionCount = 0;\n return;\n }\n\n const firstNonVisibleItemIndex = [...this.selectedOptionsItems].findIndex(\n item => item.offsetLeft > this.selectedOptionsContainer.offsetWidth\n );\n\n if (firstNonVisibleItemIndex > -1) {\n this._additionalSelectedOptionCount =\n this.selectedOptionsItems.length - firstNonVisibleItemIndex;\n } else {\n this._additionalSelectedOptionCount = 0;\n }\n }\n\n protected firstUpdated(): void {\n if (this.value === undefined) {\n if (this.multiple) {\n this.value = [];\n } else {\n this.value = null;\n }\n }\n\n this._initialValue = this._value;\n }\n\n protected updated(_changedProperties: PropertyValues) {\n if (\n _changedProperties.has(\"multiple\") &&\n typeof _changedProperties.get(\"multiple\") === \"boolean\"\n ) {\n this.value = null;\n }\n\n if (_changedProperties.has(\"_selectedOptions\")) {\n this._checkAdditionalItemCount();\n }\n }\n\n /**\n * This method is used by `bl-select-option` component to register itself to bl-select.\n * @param option BlSelectOption reference to be registered\n */\n registerOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.push(option);\n\n if (option.selected) {\n if (this.multiple) {\n if (!Array.isArray(this.value)) {\n this.value = [];\n }\n this.value = [...this.value, option.value];\n } else {\n this.value = option.value;\n }\n }\n\n this.setOptionsSelected();\n this.requestUpdate();\n }\n\n /**\n * This method is used by `bl-select-option` component to unregister itself from bl-select.\n * @param option BlSelectOption reference to be unregistered\n */\n unregisterOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.splice(this._connectedOptions.indexOf(option), 1);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-select\": BlSelect;\n }\n}\n"],
|
|
5
|
-
"mappings": "qgBACO,IAAMA,EAASC,4iOACfC,EAAQF,ECFf,IAAAG,EAsCqBC,EAArB,cAA4EC,EAC1EC,CACF,CAAE,CAFF,kCAgEE,UAAmB,SAMnB,cAAW,GAMX,cAAW,GAMX,eAAY,GAMZ,cAAW,GAMX,eAAY,GAMZ,gBAAa,GAkBb,mBAAgB,GAYhB,eAAY,GAgBZ,2BAAwB,GAgBxB,KAAQ,eAAiB,GAGzB,KAAQ,+BAAiC,EAGzC,KAAQ,YAAc,GA0BtB,KAAQ,WACLH,EAAA,SAAS,cAAc,MAAM,IAA7B,YAAAA,EAAgC,aAAa,UAA8B,UAAU,SAExF,KAAQ,kBAAiD,CAAC,EAE1D,KAAQ,gBAA0C,KA0BlD,KAAQ,iBAAgD,CAAC,EAGzD,KAAQ,MAAQ,GA0DhB,KAAQ,wBAA2BI,GAAmC,CApUxE,IAAAJ,EAqUI,IAAMK,EAAYD,EAAM,aAAa,GAEhCJ,EAAAK,GAAA,YAAAA,EAAW,KAAKC,GAAMA,EAAG,UAAY,eAArC,MAAAN,EAAmD,SAAS,OAC/D,KAAK,MAAM,CAEf,EAuQA,KAAQ,mBAAqB,GAC7B,KAAQ,mBAAqB,EAC7B,KAAQ,gBAAkB,GAC1B,KAAQ,kBAAoB,IA3iB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A0B,QAAS,EAAK,CAAC,GAvI3DrB,EAwInB,oCAUAgE,EAAA,CALC3C,EAAS,CACR,KAAM,QACN,UAAW,2BACX,UAAW4C,EAAuB,CACpC,CAAC,GAjJkBjE,EAkJnB,qCAMAgE,EAAA,CADC3C,EAAS,CAAE,KAAM,OAAQ,UAAW,wBAAyB,QAAS,EAAK,CAAC,GAvJ1DrB,EAwJnB,kCAMAgE,EAAA,CADC3C,EAAS,CAAE,KAAM,OAAQ,UAAW,4BAA6B,QAAS,EAAK,CAAC,GA7J9DrB,EA8JnB,sCAIQgE,EAAA,CADPE,EAAM,GAjKYlE,EAkKX,8BAGAgE,EAAA,CADPE,EAAM,GApKYlE,EAqKX,8CAGAgE,EAAA,CADPE,EAAM,GAvKYlE,EAwKX,2BAGAgE,EAAA,CADPG,EAAM,mBAAmB,GA1KPnE,EA2KX,wCAGAgE,EAAA,CADP3C,EAAS,sBAAsB,GA7KbrB,EA8KX,oCAGAgE,EAAA,CADPG,EAAM,UAAU,GAhLEnE,EAiLX,wBAGAgE,EAAA,CADPG,EAAM,eAAe,GAnLHnE,EAoLX,4BAKoBgE,EAAA,CAA3B7D,EAAM,WAAW,GAzLCH,EAyLS,2BAOAgE,EAAA,CAA3B7D,EAAM,WAAW,GAhMCH,EAgMS,2BAiCpBgE,EAAA,CADPE,EAAM,GAhOYlE,EAiOX,gCAGAgE,EAAA,CADPE,EAAM,GAnOYlE,EAoOX,qBA+BRgE,EAAA,CADCG,EAAM,eAAe,GAlQHnE,EAmQnB,gCAnQmBA,EAArBgE,EAAA,CAFC3C,EAAc,WAAW,EACzB+C,EAAU,GACUpE",
|
|
6
|
-
"names": ["styles", "i", "bl_select_default", "_a", "BlSelect", "FormControlMixin", "s", "event", "eventPath", "el", "bl_select_default", "val", "formData", "option", "select", "_b", "_c", "autoUpdate", "computePosition", "flip", "offset", "size", "args", "x", "y", "e", "inputSelectedOptions", "item", "icon", "isRemoveButtonShown", "removeButton", "isSearchBarVisible", "hasSelectedOptions", "isDividerShown", "searchbarPlaceholderText", "msg", "searchMagIcon", "searchSpinner", "actionDivider", "search", "o", "l", "isAllRenderedOptionsSelected", "isAnySelected", "selectAllText", "invalidMessage", "helpMessage", "label", "noDataText", "clearSearchText", "key", "currentTime", "matchingOptionIndex", "activeOptions", "options", "searchText", "optionText", "isVisible", "lastVisibleOption", "optionItem", "selectAllEl", "checked", "isAllUnselectedDisabled", "checkbox", "selectedDisabledOptions", "firstNonVisibleItemIndex", "_changedProperties", "requiredValidator", "__decorateClass", "stringBooleanConverter", "t", "i", "localized"]
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-neutral-full);--border-color:var(--bl-color-neutral-lighter);--border-focus-color:var(--bl-color-primary-highlight);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--label-color:var(--bl-color-neutral-dark);--placeholder-color:var(--bl-color-neutral-light);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-neutral-lightest);--menu-height:250px;--popover-position:var(--bl-popover-position, fixed)}:host([multiple][view-select-all]) .select-wrapper{--menu-height:290px}:host([size=large]) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size=small]) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-neutral-light)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-highlight);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);-webkit-user-select:none;user-select:none;margin:0;width:auto;min-width:100%}.label,.placeholder{color:var(--placeholder-color);padding-inline-start:var(--label-padding);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.select-wrapper.selected .placeholder,:host(:not([placeholder])) .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}:host(:not([label])) .label,:host([label-fixed]) .label{display:none}.remove-all{display:none}.selected .remove-all{display:block}:host([disabled]) .remove-all,:host([disabled]) .remove-all::after{display:none}.dropdown-icon{font-size:var(--bl-font-size-m)}.dropdown-icon.open{display:none}.select-open .dropdown-icon.open{display:inline-block}.select-open .dropdown-icon.closed{display:none}.selected .dropdown-icon{--icon-color:var(--bl-color-neutral-darker)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-neutral-light)}.select-input:focus-visible,.select-open .select-input{border:solid 1px var(--border-focus-color);outline:0}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;padding-inline-start:var(--label-padding);margin:0;list-style:none;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([disabled]) .select-input .selected-options{color:var(--bl-color-neutral-light)}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}:host(:not([multiple])) .selected-options li{display:inline-flex;align-items:center;gap:var(--bl-size-2xs)}.selected-options li:not(:last-child)::after{content:\", \"}.select-input:not(.has-overflowed-options) .additional-selection-count{display:none}:host([disabled]) .additional-selection-count{color:var(--bl-color-neutral-light)}:host([disabled]) .selected-options li{color:var(--bl-color-neutral-light)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-4xs);margin-inline-start:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:var(--popover-position);border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--bl-index-popover);width:100%;top:var(--top);left:var(--left)}:host(:empty) .popover{display:none}.popover-no-result{display:flex;flex-direction:column;gap:var(--bl-size-2xs);align-items:center;justify-content:center;height:80px}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}label,legend{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;display:block;top:var(--padding-vertical);left:var(--padding-horizontal);inset-inline-end:calc(var(--bl-size-2xs) + var(--bl-size-m) + var(--bl-size-2xs));transition:.1s ease-in;pointer-events:none;opacity:0;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color)}legend{height:0;visibility:hidden;display:none}legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:host(:not([placeholder])) .selected .label,:host([placeholder]) :where(.select-open,.selected) .label{display:none}:where(.select-open,.selected) label{top:0;transform:translateY(-50%);font:var(--bl-font-caption);color:var(--label-color);pointer-events:initial;right:var(--padding-horizontal);opacity:1}:host([label]) :where(.select-open,.selected) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host([label-fixed]) label{position:static;padding:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--label-color);opacity:1}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.error-icon,.invalid-text{display:none}.dirty.invalid label,.error-icon,.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}.dirty.invalid .hint,:host([help-text]) .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.select-all{position:sticky;top:0;padding:var(--bl-size-xs) 0;background:var(--background-color);z-index:1;font:var(--bl-font-title-3-regular);box-shadow:10px 0 0 var(--background-color),-10px 0 0 var(--background-color)}.select-all::after{position:absolute;content:\"\";width:100%;bottom:0;border-bottom:1px solid var(--bl-color-neutral-lighter)}.search-bar-input{font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--text-color);border:none;outline:0;background-color:transparent;width:100%;height:100%;padding:0;margin:0;box-sizing:border-box}.search-bar-input::placeholder{color:var(--placeholder-color)}.search-bar-input:focus-visible{outline:0}.search-spinner{padding-inline-end:var(--bl-font-size-2xs)}.action-divider{display:none}.select-wrapper .action-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}.actions bl-icon{padding:4px}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, query, queryAll, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { autoUpdate, computePosition, flip, MiddlewareState, offset, size } from \"@floating-ui/dom\";\nimport { localized, msg } from \"@lit/localize\";\nimport { FormControlMixin, requiredValidator } from \"@open-wc/form-control\";\nimport { FormValue } from \"@open-wc/form-helpers\";\nimport \"element-internals-polyfill\";\nimport { LangKey } from \"../../localization\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { stringBooleanConverter } from \"../../utilities/string-boolean.converter\";\nimport \"../button/bl-button\";\nimport \"../checkbox-group/checkbox/bl-checkbox\";\nimport BlCheckbox from \"../checkbox-group/checkbox/bl-checkbox\";\nimport \"../icon/bl-icon\";\nimport style from \"../select/bl-select.css\";\nimport \"../select/option/bl-select-option\";\nimport type BlSelectOption from \"./option/bl-select-option\";\n\nexport interface ISelectOption<T = string> {\n value: T;\n text: string;\n selected: boolean;\n}\n\nexport type SelectSize = \"medium\" | \"large\" | \"small\";\n\nexport type CleanUpFunction = () => void;\n\n/**\n * @tag bl-select\n * @summary Baklava Select component\n *\n * @cssproperty [--bl-popover-position=fixed] Sets the positioning strategy of select popover. You can set it as `absolute` if you need to show popover relative to its trigger element.\n */\n@customElement(\"bl-select\")\n@localized()\nexport default class BlSelect<ValueType extends FormValue = string> extends FormControlMixin(\n LitElement\n) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static formControlValidators = [requiredValidator];\n\n /**\n * Sets name of the select field\n */\n @property()\n name: string;\n\n private _value: ValueType | ValueType[] | null;\n\n private _initialValue: ValueType | ValueType[] | null;\n\n /**\n * Sets the value of the select\n */\n @property()\n get value(): ValueType | ValueType[] | null {\n return this._value;\n }\n\n set value(val: ValueType | ValueType[] | null) {\n this._value = val;\n\n if (Array.isArray(val)) {\n const formData = new FormData();\n\n val.forEach(option => formData.append(this.name, `${option}`));\n this.setValue(formData);\n } else {\n this.setValue(val);\n }\n\n this.setOptionsSelected();\n }\n\n shouldFormValueUpdate(): boolean {\n return this.value !== null && this.value !== \"\";\n }\n\n /* Declare reactive properties */\n /**\n * Sets the label value\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Sets the placeholder value. If left blank, the label value (if specified) is set as placeholder.\n */\n @property({ reflect: true })\n placeholder?: string;\n\n /**\n * Sets the size value. Select component's height value will be changed accordingly\n */\n @property({ type: String, reflect: true })\n size: SelectSize = \"medium\";\n\n /**\n * When option is not selected, shows component in error state\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Shows the component in disabled state.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets whether the selected option is clearable\n */\n @property({ type: Boolean, reflect: true })\n clearable = false;\n\n /**\n * Allows multiple options to be selected\n */\n @property({ type: Boolean, reflect: true })\n multiple = false;\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText?: string;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: \"invalid-text\", reflect: true })\n customInvalidText?: string;\n\n /**\n * Views select all option in multiple select\n */\n @property({ type: Boolean, attribute: \"view-select-all\", converter: stringBooleanConverter() })\n viewSelectAll = false;\n\n /**\n * Sets select all text in multiple select\n */\n @property({ type: String, attribute: \"select-all-text\" })\n selectAllText?: string;\n\n /**\n * Enable search functionality for the options within the list\n */\n @property({ type: Boolean, attribute: \"search-bar\", reflect: true })\n searchBar = false;\n\n /**\n * Search for text variations such as \"search,\" \"searching,\" \"search by country,\" and so on\n */\n @property({ type: String, attribute: \"search-bar-placeholder\", reflect: true })\n searchBarPlaceholder?: string;\n\n /**\n * Display a loading icon in place of the search icon.\n */\n @property({\n type: Boolean,\n attribute: \"search-bar-loading-state\",\n converter: stringBooleanConverter(),\n })\n searchBarLoadingState = false;\n\n /**\n * Text to display when no search results are found.\n */\n @property({ type: String, attribute: \"search-not-found-text\", reflect: true })\n searchNotFoundText?: string;\n\n /**\n * Text to display on the clear search button.\n */\n @property({ type: String, attribute: \"popover-clear-search-text\", reflect: true })\n popoverClearSearchText?: string;\n\n /* Declare internal reactive properties */\n @state()\n private _isPopoverOpen = false;\n\n @state()\n private _additionalSelectedOptionCount = 0;\n\n @state()\n private _searchText = \"\";\n\n @query(\".selected-options\")\n private selectedOptionsContainer!: HTMLElement;\n\n @queryAll(\".selected-options li\")\n private selectedOptionsItems!: NodeListOf<HTMLElement>;\n\n @query(\".popover\")\n private _popover: HTMLElement;\n\n @query(\".select-input\")\n private _selectInput: HTMLElement;\n\n /**\n * Fires when selection changes\n */\n @event(\"bl-select\") private _onBlSelect: EventDispatcher<\n ISelectOption<ValueType>[] | ISelectOption<ValueType>\n >;\n\n /**\n * Fires when search text changes\n */\n @event(\"bl-search\") private _onBlSearch: EventDispatcher<string>;\n\n private userLang =\n (document.querySelector(\"html\")?.getAttribute(\"lang\") as LangKey | null) || navigator.language;\n\n private _connectedOptions: BlSelectOption<ValueType>[] = [];\n\n private _cleanUpPopover: CleanUpFunction | null = null;\n\n private setOptionsSelected() {\n this._connectedOptions.forEach(\n option =>\n (option.selected =\n this.value === option.value ||\n (Array.isArray(this.value) && this.value.includes(option.value)))\n );\n\n this._selectedOptions = [...this.options.filter(option => option.selected)];\n }\n\n get options() {\n return this._connectedOptions;\n }\n\n get opened() {\n return this._isPopoverOpen;\n }\n\n get noResultFound() {\n return this._searchText !== \"\" && this._connectedOptions.every(option => option.hidden);\n }\n\n @state()\n private _selectedOptions: BlSelectOption<ValueType>[] = [];\n\n @state()\n private dirty = false;\n\n get selectedOptions(): BlSelectOption<ValueType>[] {\n return this._selectedOptions;\n }\n\n get additionalSelectedOptionCount() {\n return this._additionalSelectedOptionCount;\n }\n\n validityCallback(): string | void {\n if (this.customInvalidText) {\n return this.customInvalidText;\n }\n const select = document.createElement(\"select\");\n\n select.required = this.required;\n\n return select.validationMessage;\n }\n\n reportValidity() {\n this.dirty = true;\n return this.checkValidity();\n }\n\n resetFormControl(): void {\n this.value = this._initialValue;\n }\n\n @query(\".select-input\")\n validationTarget: HTMLElement;\n\n open() {\n if (this.searchBar) {\n setTimeout(() => {\n document.activeElement?.shadowRoot?.querySelector(\"input\")?.focus();\n }, 100);\n }\n\n this._isPopoverOpen = true;\n this._setupPopover();\n document.addEventListener(\"click\", this._interactOutsideHandler, true);\n document.addEventListener(\"focus\", this._interactOutsideHandler, true);\n }\n\n close() {\n this._handleSearchOptions({ target: { value: \"\" } } as InputEvent & {\n target: HTMLInputElement;\n });\n\n this._isPopoverOpen = false;\n this.focusedOptionIndex = -1;\n this._cleanUpPopover && this._cleanUpPopover();\n document.removeEventListener(\"click\", this._interactOutsideHandler, true);\n document.removeEventListener(\"focus\", this._interactOutsideHandler, true);\n }\n\n private _interactOutsideHandler = (event: MouseEvent | FocusEvent) => {\n const eventPath = event.composedPath() as HTMLElement[];\n\n if (!eventPath?.find(el => el.tagName === \"BL-SELECT\")?.contains(this)) {\n this.close();\n }\n };\n\n private _setupPopover() {\n this._cleanUpPopover = autoUpdate(this._selectInput, this._popover, () => {\n computePosition(this._selectInput, this._popover, {\n placement: \"bottom\",\n strategy: \"fixed\",\n middleware: [\n flip(),\n offset(8),\n size({\n apply(args: MiddlewareState) {\n Object.assign(args.elements.floating.style, {\n width: `${args.elements.reference.getBoundingClientRect().width}px`,\n });\n },\n }),\n ],\n }).then(({ x, y }) => {\n this._popover.style.setProperty(\"--left\", `${x}px`);\n this._popover.style.setProperty(\"--top\", `${y}px`);\n });\n });\n }\n\n private _handleToggleButtonClick(e: MouseEvent) {\n e.stopPropagation();\n this._togglePopover();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.form?.addEventListener(\"submit\", (e: SubmitEvent) => {\n if (!this.reportValidity()) {\n e.preventDefault();\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this._cleanUpPopover && this._cleanUpPopover();\n }\n\n private inputTemplate() {\n const inputSelectedOptions = html`<ul class=\"selected-options\">\n ${this._selectedOptions.map(item => {\n const icon = item.icon\n ? html`<bl-icon name=${item.icon}></bl-icon>`\n : Array.from(item.querySelectorAll(\"[slot=icon]\")).map(el => el.cloneNode(true));\n\n return html`<li>${icon}${item.getAttribute(\"label\") || item.textContent}</li>`;\n })}\n </ul>`;\n\n const isAllSelectedDisabled =\n this._selectedOptions.length > 0 && this._selectedOptions.every(option => option.disabled);\n const isRemoveButtonShown = !isAllSelectedDisabled && (this.clearable || this.multiple);\n const removeButton = isRemoveButtonShown\n ? html`<bl-button\n class=\"remove-all\"\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this._onClickRemove}\n ></bl-button>`\n : \"\";\n\n const isSearchBarVisible = this.searchBar && this.opened;\n const hasSelectedOptions = this._selectedOptions.length > 0;\n\n const isDividerShown = isSearchBarVisible || (hasSelectedOptions && isRemoveButtonShown);\n\n const searchbarPlaceholderText =\n this.searchBarPlaceholder ?? msg(\"Search\", { desc: \"bl-select: search placeholder text\" });\n\n const searchMagIcon = html`<bl-icon\n class=\"search-mag-icon\"\n name=\"search\"\n style=\"color: var(--bl-color-primary);font-size: var(--bl-font-size-s)\"\n ></bl-icon>`;\n\n const searchSpinner = html`<bl-spinner class=\"search-spinner\"></bl-spinner>`;\n\n const actionDivider = isDividerShown ? html`<div class=\"action-divider\"></div>` : \"\";\n\n const search = html`<fieldset\n class=${classMap({\n \"select-input\": true,\n \"has-overflowed-options\": this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${this.disabled ? \"-1\" : 0}\"\n .autofocus=${this.autofocus}\n role=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${this.opened}\"\n aria-labelledby=\"label\"\n @click=${this.open}\n >\n <legend><span>${this.label}</span></legend>\n\n ${this._selectedOptions.length > 0 && !this.opened\n ? inputSelectedOptions\n : html`\n <input\n class=\"search-bar-input\"\n placeholder=${this.opened || this.labelFixed\n ? searchbarPlaceholderText\n : this.label || searchbarPlaceholderText}\n @input=${this._handleSearchOptions}\n @keydown=${(e: KeyboardEvent) => {\n if (e.code === \"Space\") {\n e.stopPropagation();\n }\n }}\n .value=${this._searchText}\n />\n `}\n ${!this.opened\n ? html`<span class=\"additional-selection-count\"\n >+${this._additionalSelectedOptionCount}</span\n >`\n : \"\"}\n\n <div class=\"actions\">\n ${this.opened ? (this.searchBarLoadingState ? searchSpinner : searchMagIcon) : \"\"}\n ${!this.opened ? removeButton : \"\"} ${actionDivider}\n <bl-button\n class=\"dropdown-icon open\"\n variant=\"tertiary\"\n kind=\"neutral\"\n size=\"small\"\n icon=\"arrow_up\"\n @click=${this._handleToggleButtonClick}\n aria-label=\"${msg(\"Close dropdown\", { desc: \"bl-select: close dropdown button\" })}\"\n ></bl-button>\n <bl-button\n class=\"closed dropdown-icon\"\n variant=\"tertiary\"\n kind=\"neutral\"\n size=\"small\"\n icon=\"arrow_down\"\n @click=${this._handleToggleButtonClick}\n aria-label=\"${msg(\"Open dropdown\", { desc: \"bl-select: open dropdown button\" })}\"\n ></bl-button>\n </div>\n </fieldset>`;\n\n return this.searchBar\n ? search\n : html`<fieldset\n class=${classMap({\n \"select-input\": true,\n \"has-overflowed-options\": this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${ifDefined(this.disabled ? undefined : 0)}\"\n ?autofocus=${this.autofocus}\n @click=${this._togglePopover}\n role=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${this.opened}\"\n aria-labelledby=\"label\"\n >\n <legend><span>${this.label}</span></legend>\n <span class=\"placeholder\">${this.placeholder}</span>\n <span class=\"label\">${this.label}</span>\n ${inputSelectedOptions}\n <span class=\"additional-selection-count\">+${this._additionalSelectedOptionCount}</span>\n <div class=\"actions\">\n ${removeButton} ${actionDivider}\n <bl-icon class=\"dropdown-icon open\" name=\"arrow_up\"></bl-icon>\n\n <bl-icon class=\"dropdown-icon closed\" name=\"arrow_down\"></bl-icon>\n </div>\n </fieldset>`;\n }\n\n selectAllTemplate() {\n if (!this.multiple || !this.viewSelectAll || this.noResultFound) {\n return null;\n }\n\n const isAllRenderedOptionsSelected = this._connectedOptions\n .filter(option => !option.hidden)\n .every(option => option.selected);\n\n const isAnySelected = this._selectedOptions.filter(option => !option.hidden).length > 0;\n const selectAllText =\n this.selectAllText ?? msg(\"Select All\", { desc: \"bl-select: select all text\" });\n\n return html`<bl-checkbox\n class=\"select-all\"\n .checked=\"${isAllRenderedOptionsSelected}\"\n .indeterminate=\"${isAnySelected && !isAllRenderedOptionsSelected}\"\n role=\"option\"\n aria-selected=\"${isAllRenderedOptionsSelected}\"\n @bl-checkbox-change=\"${this._handleSelectAll}\"\n >\n ${selectAllText}\n </bl-checkbox>`;\n }\n\n render(): TemplateResult {\n const invalidMessage = !this.checkValidity()\n ? html`<p id=\"errorMessage\" aria-live=\"polite\" class=\"invalid-text\">\n ${this.validationMessage}\n </p>`\n : \"\";\n\n const helpMessage = this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : \"\";\n\n const label = this.label ? html`<label id=\"label\">${this.label}</label>` : \"\";\n\n const noDataText =\n this.searchNotFoundText ?? msg(\"No Data Found\", { desc: \"bl-select: search no data text\" });\n\n const clearSearchText =\n this.popoverClearSearchText ??\n msg(\"Clear Search\", { desc: \"bl-select: clear search button text\" });\n\n return html`<div\n class=${classMap({\n \"select-wrapper\": true,\n \"select-open\": this.opened,\n \"selected\": this._selectedOptions.length > 0,\n \"invalid\": !this.validity.valid,\n \"dirty\": this.dirty,\n })}\n @keydown=${this.handleKeydown}\n >\n ${label} ${this.inputTemplate()}\n <div\n class=\"popover\"\n tabindex=\"${ifDefined(this._isPopoverOpen ? undefined : \"-1\")}\"\n @bl-select-option=${this._handleSelectOptionEvent}\n role=\"listbox\"\n aria-multiselectable=\"${this.multiple}\"\n aria-labelledby=\"label\"\n >\n ${this.selectAllTemplate()}\n <slot></slot>\n ${this.searchBar && this.noResultFound\n ? html`<div name=\"popover-clear-search-text\" class=\"popover-no-result\">\n <span>${noDataText}</span>\n <bl-button\n variant=\"tertiary\"\n @click=${() => {\n this._handleSearchOptions({ target: { value: \"\" } } as InputEvent & {\n target: HTMLInputElement;\n });\n }}\n >${clearSearchText}</bl-button\n >\n </div>`\n : \"\"}\n </div>\n <div class=\"hint\">${invalidMessage} ${helpMessage}</div>\n </div> `;\n }\n\n private focusedOptionIndex = -1;\n private lastKeyPressedTime = 0;\n private typedCharacters = \"\";\n private keyPressThreshold = 500;\n\n private handleFocusOptionByKey(key: string) {\n const currentTime = Date.now();\n const elapsedTimeSinceLastKeyPress = currentTime - this.lastKeyPressedTime;\n\n if (elapsedTimeSinceLastKeyPress > this.keyPressThreshold) {\n this.typedCharacters = \"\";\n }\n\n this.lastKeyPressedTime = currentTime;\n this.typedCharacters += key.toLowerCase();\n\n const matchingOptionIndex = this.options.findIndex(option => {\n if (option.disabled) {\n return false;\n }\n const optionText = option.innerText.trim().toLowerCase();\n\n return optionText.startsWith(this.typedCharacters);\n });\n\n if (matchingOptionIndex !== -1) {\n this.focusedOptionIndex = matchingOptionIndex;\n this.options[matchingOptionIndex].focus();\n }\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (this.focusedOptionIndex === -1 && [\"Enter\", \"Space\"].includes(event.code)) {\n this._togglePopover();\n event.preventDefault();\n } else if (this._isPopoverOpen === false && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n this.open();\n event.preventDefault();\n } else if (event.code === \"Escape\") {\n this.close();\n event.preventDefault();\n } else if (this._isPopoverOpen && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n const activeOptions = this.options.filter(option => !option.disabled);\n\n event.code === \"ArrowDown\" && this.focusedOptionIndex++;\n event.code === \"ArrowUp\" && this.focusedOptionIndex--;\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, activeOptions.length - 1)\n );\n\n activeOptions[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n } else if (this._isPopoverOpen && !this.searchBar) {\n this.handleFocusOptionByKey(event.key);\n }\n }\n\n private _togglePopover() {\n this._isPopoverOpen ? this.close() : this.open();\n }\n\n private _handleSelectEvent() {\n const options = this._selectedOptions.map(\n option =>\n ({\n value: option.value,\n selected: option.selected,\n text: option.textContent,\n } as ISelectOption<ValueType>)\n );\n\n if (!this.multiple) this._onBlSelect(options[0]);\n else this._onBlSelect(options);\n }\n\n private _handleSearchEvent() {\n this._onBlSearch(this._searchText);\n }\n\n private _handleSearchOptions(e: InputEvent): void {\n if (!this.searchBar) return;\n\n this._searchText = (e.target as HTMLInputElement).value;\n\n this._handleSearchEvent();\n\n this._connectedOptions.forEach(option => {\n const searchText = this._searchText.toLowerCase();\n let optionText = \"\";\n\n if (option.textContent) {\n try {\n // Try locale-specific comparison first\n optionText = option.textContent.toLocaleLowerCase(this.userLang);\n } catch {\n // Fallback to basic toLowerCase if locale is not supported\n optionText = option.textContent.toLowerCase();\n }\n }\n\n const isVisible = optionText.includes(searchText);\n\n option.hidden = !isVisible;\n });\n\n this._selectedOptions = this.options.filter(option => option.selected);\n this._handleLastVisibleSearchedOption();\n this.requestUpdate();\n }\n\n private _handleLastVisibleSearchedOption() {\n const lastVisibleOption = [...this.options].reverse().find(option => !option.hidden);\n\n if (lastVisibleOption) {\n lastVisibleOption?.shadowRoot?.querySelector(\"div\")?.classList.add(\"no-border-bottom\");\n }\n\n this.options.map(option => {\n if (!option.hidden && option !== lastVisibleOption) {\n option.shadowRoot?.querySelector(\"div\")?.classList.remove(\"no-border-bottom\");\n }\n });\n }\n\n private _handleSingleSelect(optionItem: BlSelectOption<ValueType>) {\n this.value = optionItem.value;\n\n this._searchText = \"\";\n this._handleSelectEvent();\n this.close();\n }\n\n private _handleMultipleSelect() {\n this.value = this._connectedOptions\n .filter(option => option.selected)\n .map(option => option.value);\n\n this._handleSelectEvent();\n }\n\n private _handleSelectOptionEvent(e: CustomEvent) {\n const optionItem = e.target as BlSelectOption<ValueType>;\n\n this.dirty = true;\n\n if (this.multiple) {\n this._handleMultipleSelect();\n } else {\n this._handleSingleSelect(optionItem);\n }\n }\n\n private _handleSelectAll(e: CustomEvent) {\n const selectAllEl = this.shadowRoot?.querySelector(\".select-all\") as BlCheckbox;\n\n const checked = e.detail;\n const unselectedOptions = this._connectedOptions.filter(\n option => !option.selected && !option.hidden\n );\n const isAllUnselectedDisabled = unselectedOptions.every(option => option.disabled);\n\n // If all available options are selected, instead of checking, uncheck all options\n if (checked && isAllUnselectedDisabled) {\n setTimeout(() => {\n const checkbox = selectAllEl?.shadowRoot?.querySelector(\"input\");\n\n checkbox?.click();\n }, 0);\n return;\n }\n\n this._connectedOptions.forEach(option => {\n if (option.disabled || option.hidden) {\n return;\n }\n\n option.selected = checked;\n });\n\n this._handleMultipleSelect();\n }\n\n private _onClickRemove(e: MouseEvent) {\n e.stopPropagation();\n\n this._searchText = \"\";\n\n const selectedDisabledOptions = this._selectedOptions.filter(option => option.disabled);\n\n this._connectedOptions\n .filter(option => !option.disabled && option.selected)\n .forEach(option => {\n option.selected = false;\n });\n\n this.value = selectedDisabledOptions.length\n ? selectedDisabledOptions.map(option => option.value)\n : null;\n this._handleSelectEvent();\n }\n\n private _checkAdditionalItemCount() {\n if (!this.multiple || !this.selectedOptionsItems || this.selectedOptionsItems.length < 2) {\n this._additionalSelectedOptionCount = 0;\n return;\n }\n\n const firstNonVisibleItemIndex = [...this.selectedOptionsItems].findIndex(\n item => item.offsetLeft > this.selectedOptionsContainer.offsetWidth\n );\n\n if (firstNonVisibleItemIndex > -1) {\n this._additionalSelectedOptionCount =\n this.selectedOptionsItems.length - firstNonVisibleItemIndex;\n } else {\n this._additionalSelectedOptionCount = 0;\n }\n }\n\n protected firstUpdated(): void {\n if (this.value === undefined) {\n if (this.multiple) {\n this.value = [];\n } else {\n this.value = null;\n }\n }\n\n this._initialValue = this._value;\n }\n\n protected updated(_changedProperties: PropertyValues) {\n if (\n _changedProperties.has(\"multiple\") &&\n typeof _changedProperties.get(\"multiple\") === \"boolean\"\n ) {\n this.value = null;\n }\n\n if (_changedProperties.has(\"_selectedOptions\")) {\n this._checkAdditionalItemCount();\n }\n }\n\n /**\n * This method is used by `bl-select-option` component to register itself to bl-select.\n * @param option BlSelectOption reference to be registered\n */\n registerOption(option: BlSelectOption<ValueType>) {\n if (this._connectedOptions.includes(option)) return;\n\n this._connectedOptions.push(option);\n\n if (option.selected) {\n if (this.multiple) {\n if (!Array.isArray(this.value)) {\n this.value = [];\n }\n this.value = [...this.value, option.value];\n } else {\n this.value = option.value;\n }\n }\n\n this.setOptionsSelected();\n this.requestUpdate();\n }\n\n /**\n * This method is used by `bl-select-option` component to unregister itself from bl-select.\n * @param option BlSelectOption reference to be unregistered\n */\n unregisterOption(option: BlSelectOption<ValueType>) {\n const index = this._connectedOptions.indexOf(option);\n\n if (index === -1) return;\n\n this._connectedOptions.splice(index, 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E,KAAM,OAAQ,UAAW,4BAA6B,QAAS,EAAK,CAAC,GA7J9DrB,EA8JnB,sCAIQiE,EAAA,CADPE,EAAM,GAjKYnE,EAkKX,8BAGAiE,EAAA,CADPE,EAAM,GApKYnE,EAqKX,8CAGAiE,EAAA,CADPE,EAAM,GAvKYnE,EAwKX,2BAGAiE,EAAA,CADPG,EAAM,mBAAmB,GA1KPpE,EA2KX,wCAGAiE,EAAA,CADP5C,EAAS,sBAAsB,GA7KbrB,EA8KX,oCAGAiE,EAAA,CADPG,EAAM,UAAU,GAhLEpE,EAiLX,wBAGAiE,EAAA,CADPG,EAAM,eAAe,GAnLHpE,EAoLX,4BAKoBiE,EAAA,CAA3B9D,EAAM,WAAW,GAzLCH,EAyLS,2BAOAiE,EAAA,CAA3B9D,EAAM,WAAW,GAhMCH,EAgMS,2BAiCpBiE,EAAA,CADPE,EAAM,GAhOYnE,EAiOX,gCAGAiE,EAAA,CADPE,EAAM,GAnOYnE,EAoOX,qBA+BRiE,EAAA,CADCG,EAAM,eAAe,GAlQHpE,EAmQnB,gCAnQmBA,EAArBiE,EAAA,CAFC5C,EAAc,WAAW,EACzBgD,EAAU,GACUrE",
|
|
6
|
+
"names": ["styles", "i", "bl_select_default", "_a", "BlSelect", "FormControlMixin", "s", "event", "eventPath", "el", "bl_select_default", "val", "formData", "option", "select", "_b", "_c", "autoUpdate", "computePosition", "flip", "offset", "size", "args", "x", "y", "e", "inputSelectedOptions", "item", "icon", "isRemoveButtonShown", "removeButton", "isSearchBarVisible", "hasSelectedOptions", "isDividerShown", "searchbarPlaceholderText", "msg", "searchMagIcon", "searchSpinner", "actionDivider", "search", "o", "l", "isAllRenderedOptionsSelected", "isAnySelected", "selectAllText", "invalidMessage", "helpMessage", "label", "noDataText", "clearSearchText", "key", "currentTime", "matchingOptionIndex", "activeOptions", "options", "searchText", "optionText", "isVisible", "lastVisibleOption", "optionItem", "selectAllEl", "checked", "isAllUnselectedDisabled", "checkbox", "selectedDisabledOptions", "firstNonVisibleItemIndex", "_changedProperties", "index", "requiredValidator", "__decorateClass", "stringBooleanConverter", "t", "i", "localized"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as a}from"../../chunk-
|
|
1
|
+
import{b as a}from"../../chunk-EFOTKJY4.js";import"../../chunk-IPYZIIRV.js";import"../../chunk-4UO3W4WP.js";import"../../chunk-ZE7GYACV.js";import"../../chunk-WEEGH2F4.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-276RDWEQ.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-calendar.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-2ARF4VOQ.js";import"../../chunk-DE3A37FL.js";import"../../chunk-UOGCEUXK.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-UOF574WZ.js";import"../../chunk-23PSWIUF.js";import"../../chunk-EFOTKJY4.js";import"../../chunk-IPYZIIRV.js";import"../../chunk-4UO3W4WP.js";import"../../chunk-ZE7GYACV.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-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-276RDWEQ.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-datepicker.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-AIHL337R.js";import"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-AIHL337R.js";import"../../chunk-NODTAMYY.js";import"../../chunk-S4BD3HT2.js";import"../../chunk-ECPWEUBG.js";import"../../chunk-MWFGDECP.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-UOF574WZ.js";import"../../chunk-23PSWIUF.js";import"../../chunk-IPYZIIRV.js";import"../../chunk-4UO3W4WP.js";import"../../chunk-ZE7GYACV.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-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-276RDWEQ.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-pagination.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bl-select.d.ts","sourceRoot":"","sources":["../../../src/components/select/bl-select.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAQ,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAC;AAOvF,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,4BAA4B,CAAC;AAIpC,OAAO,qBAAqB,CAAC;AAC7B,OAAO,wCAAwC,CAAC;AAEhD,OAAO,iBAAiB,CAAC;AAEzB,OAAO,mCAAmC,CAAC;AAC3C,OAAO,KAAK,cAAc,MAAM,2BAA2B,CAAC;AAE5D,MAAM,WAAW,aAAa,CAAC,CAAC,GAAG,MAAM;IACvC,KAAK,EAAE,CAAC,CAAC;IACT,IAAI,EAA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AO;IAEhC,OAAO,CAAC,sBAAsB;IA0B9B,OAAO,CAAC,aAAa;IA8BrB,OAAO,CAAC,cAAc;IAItB,OAAO,CAAC,kBAAkB;IAc1B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,oBAAoB;IA+B5B,OAAO,CAAC,gCAAgC;IAcxC,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,qBAAqB;IAQ7B,OAAO,CAAC,wBAAwB;IAYhC,OAAO,CAAC,gBAAgB;IA8BxB,OAAO,CAAC,cAAc;IAmBtB,OAAO,CAAC,yBAAyB;IAkBjC,SAAS,CAAC,YAAY,IAAI,IAAI;IAY9B,SAAS,CAAC,OAAO,CAAC,kBAAkB,EAAE,cAAc;IAapD;;;OAGG;IACH,cAAc,CAAC,MAAM,EAAE,cAAc,CAAC,SAAS,CAAC;IAoBhD;;;OAGG;IACH,gBAAgB,CAAC,MAAM,EAAE,cAAc,CAAC,SAAS,CAAC;CAOnD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,WAAW,EAAE,QAAQ,CAAC;KACvB;CACF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-NODTAMYY.js";import"../../chunk-S4BD3HT2.js";import"../../chunk-ECPWEUBG.js";import"../../chunk-MWFGDECP.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-4UO3W4WP.js";import"../../chunk-ZE7GYACV.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-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-276RDWEQ.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format-to-date-array.d.ts","sourceRoot":"","sources":["../../src/utilities/format-to-date-array.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,EAAE,GAAG,SAAS,GAAG,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"format-to-date-array.d.ts","sourceRoot":"","sources":["../../src/utilities/format-to-date-array.ts"],"names":[],"mappings":"AAEA,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,EAAE,GAAG,SAAS,GAAG,IAAI,EAAE,CAYnF"}
|
package/package.json
CHANGED
package/dist/chunk-M3UQBIAS.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import{a as f}from"./chunk-T7ECITFD.js";import{a as g}from"./chunk-GRL4DWKG.js";import{a as b,b as s,c,e as _}from"./chunk-5MOOXA2X.js";import{a as v,b as p}from"./chunk-4OT5AMS5.js";import{d as n}from"./chunk-IZ2LK5GK.js";var D=v`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}.datepicker-input{width:var(--bl-datepicker-input-width,auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`,E=D;var i=class extends f{constructor(){super(...arguments);this.size="medium";this.labelFixed=!1;this.valueFormatter=null;this._inputValue="";this._floatingDateCount=0;this._fittingDateCount=0}static get styles(){return[E]}defaultInputValueFormatter(){var t,e,l,o,a,r,d,h;if(this.type==="single")this._inputValue=this.formatDate((t=this._calendarEl)==null?void 0:t._dates[0]),this.closePopoverWithTimeout();else if(this.type==="multiple"){this.setFloatingDates();let u=(e=this._calendarEl)==null?void 0:e._dates.slice(0,this._fittingDateCount).map(m=>this.formatDate(m));this._inputValue=u.join(",")+(this._floatingDateCount>0?" ,...":"")}else this.type==="range"&&((l=this._calendarEl)!=null&&l._dates[0]&&(this._inputValue=this.formatDate((o=this._calendarEl)==null?void 0:o._dates[0])),(a=this._calendarEl)!=null&&a._dates[1]&&(this._inputValue=`${this._inputValue}-${this.formatDate((r=this._calendarEl)==null?void 0:r._dates[1])}`),(d=this._calendarEl)!=null&&d._dates[0]&&((h=this._calendarEl)!=null&&h._dates[1])&&this.closePopoverWithTimeout())}closePopoverWithTimeout(){setTimeout(()=>{this.closePopover(),this._inputEl.blur()},200)}setFloatingDates(){var o,a,r;let t=(o=this.shadowRoot)==null?void 0:o.getElementById("datepicker-input"),e=(a=this.shadowRoot)==null?void 0:a.getElementById("icon-container"),l=t.offsetWidth-e.offsetWidth;this._fittingDateCount=Math.floor(l/90),this._floatingDateCount=((r=this._calendarEl)==null?void 0:r._dates.length)-this._fittingDateCount}setDatePickerInput(){var t,e;(t=this._calendarEl)!=null&&t._dates.length?this.valueFormatter?this._inputValue=this.valueFormatter((e=this._calendarEl)==null?void 0:e._dates):this.defaultInputValueFormatter():this._inputValue=""}formatDate(t){return this.monthYearOnly?`${String((t==null?void 0:t.getMonth())+1).padStart(2,"0")}/${t==null?void 0:t.getFullYear()}`:`${String(t==null?void 0:t.getDate()).padStart(2,"0")}/${String((t==null?void 0:t.getMonth())+1).padStart(2,"0")}/${t==null?void 0:t.getFullYear()}`}clearDatepicker(){this._calendarEl.handleClearSelectedDates(),this._inputValue="",this._floatingDateCount=0}openPopover(){this._popoverEl.target=this._inputEl,this._popoverEl.show()}closePopover(){this._popoverEl.hide()}_togglePopover(){this._popoverEl.visible?this.closePopover():this.openPopover()}formatAdditionalDates(t){let e=t.split(",");return e==null?void 0:e.reduce((l,o,a)=>(a>0&&a%3===0&&l.push(p`<br />`),l.push(p`<span>${o.trim()}${a<e.length-1?", ":""}</span>`),l),[])}async firstUpdated(){var t,e,l;this._onCalendarMouseDown=o=>{var a;o.preventDefault(),(a=this._inputEl)==null||a.focus()},this._onInputMouseDown=o=>{var a;o.preventDefault(),(a=this._inputEl)==null||a.focus()},(t=this._calendarEl)==null||t.addEventListener("mousedown",this._onCalendarMouseDown),(e=this._inputEl)==null||e.addEventListener("mousedown",this._onInputMouseDown),(l=this._calendarEl)!=null&&l._dates&&this.setDatePickerInput()}onCalendarChange(){var t;this.setDatePickerInput(),this._onBlDatepickerChange((t=this._calendarEl)==null?void 0:t._dates)}disconnectedCallback(){var t,e;super.disconnectedCallback(),(t=this._calendarEl)==null||t.removeEventListener("mousedown",this._onCalendarMouseDown),(e=this._inputEl)==null||e.removeEventListener("mousedown",this._onInputMouseDown)}render(){var r,d,h,u;let t=p`
|
|
2
|
-
<bl-popover target="datepicker-content" placement="bottom-start">
|
|
3
|
-
<bl-calendar
|
|
4
|
-
type=${this.type}
|
|
5
|
-
.minDate=${this.minDate}
|
|
6
|
-
.maxDate=${this.maxDate}
|
|
7
|
-
.startOfWeek=${this.startOfWeek}
|
|
8
|
-
.disabledDates=${this.disabledDates}
|
|
9
|
-
.value=${this.value}
|
|
10
|
-
.locale=${this.locale}
|
|
11
|
-
.dayRenderer=${this.dayRenderer}
|
|
12
|
-
?month-year-only=${this.monthYearOnly}
|
|
13
|
-
@bl-calendar-change="${this.onCalendarChange}"
|
|
14
|
-
></bl-calendar>
|
|
15
|
-
</bl-popover>
|
|
16
|
-
`,e=(h=(d=(r=this._calendarEl)==null?void 0:r._dates)==null?void 0:d.slice(this._fittingDateCount).map(m=>this.formatDate(m)).join(","))!=null?h:"",l=this.formatAdditionalDates(e),o=this._floatingDateCount>0?p` <bl-tooltip>
|
|
17
|
-
<span slot="tooltip-trigger">+${this._floatingDateCount}</span>
|
|
18
|
-
<div>${l}</div>
|
|
19
|
-
</bl-tooltip>`:"",a=((u=this._calendarEl)==null?void 0:u._dates.length)>0?p` <bl-button
|
|
20
|
-
size="small"
|
|
21
|
-
variant="tertiary"
|
|
22
|
-
kind="neutral"
|
|
23
|
-
icon="close"
|
|
24
|
-
@click=${this.clearDatepicker}
|
|
25
|
-
?disabled=${this.disabled}
|
|
26
|
-
></bl-button>
|
|
27
|
-
<div class="action-divider"></div>`:"";return p`
|
|
28
|
-
<div class="datepicker-content" id="datepicker-content" tabindex="-1">
|
|
29
|
-
<bl-input
|
|
30
|
-
.value="${this._inputValue}"
|
|
31
|
-
.label="${this.label}"
|
|
32
|
-
placeholder="${this.placeholder}"
|
|
33
|
-
class="datepicker-input"
|
|
34
|
-
role="button"
|
|
35
|
-
id="datepicker-input"
|
|
36
|
-
aria-haspopup="listbox"
|
|
37
|
-
aria-labelledby="label"
|
|
38
|
-
@click=${this._togglePopover}
|
|
39
|
-
help-text=${this.helpText}
|
|
40
|
-
?disabled=${this.disabled}
|
|
41
|
-
.size=${this.size}
|
|
42
|
-
.labelFixed=${this.labelFixed}
|
|
43
|
-
readonly
|
|
44
|
-
>
|
|
45
|
-
<div slot="icon" class="icon-container" id="icon-container">
|
|
46
|
-
${o} ${a}
|
|
47
|
-
<bl-icon name="calendar" size="small" class="calendar-icon"></bl-icon>
|
|
48
|
-
</div>
|
|
49
|
-
</bl-input>
|
|
50
|
-
${t}
|
|
51
|
-
</div>
|
|
52
|
-
`}};n([s({type:String,attribute:"placeholder",reflect:!0})],i.prototype,"placeholder",2),n([s({type:String,reflect:!0})],i.prototype,"size",2),n([s({type:Boolean,attribute:"label-fixed",reflect:!0})],i.prototype,"labelFixed",2),n([s({type:String,attribute:"label",reflect:!0})],i.prototype,"label",2),n([s({type:Function,attribute:"value-formatter"})],i.prototype,"valueFormatter",2),n([s({type:Boolean})],i.prototype,"disabled",2),n([s({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),n([s({attribute:!1})],i.prototype,"dayRenderer",2),n([c()],i.prototype,"_inputValue",2),n([c()],i.prototype,"_floatingDateCount",2),n([c()],i.prototype,"_fittingDateCount",2),n([_("bl-calendar")],i.prototype,"_calendarEl",2),n([_("bl-popover")],i.prototype,"_popoverEl",2),n([_("bl-input")],i.prototype,"_inputEl",2),n([g("bl-datepicker-change")],i.prototype,"_onBlDatepickerChange",2),i=n([b("bl-datepicker")],i);export{i as a};
|
|
53
|
-
//# sourceMappingURL=chunk-M3UQBIAS.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/datepicker/bl-datepicker.css", "../src/components/datepicker/bl-datepicker.ts"],
|
|
4
|
-
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}.datepicker-input{width:var(--bl-datepicker-input-width,auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`;\nexport default styles;\n", "import { CSSResultGroup, html, TemplateResult } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { BlCalendar, BlPopover } from \"../../baklava\";\nimport DatepickerCalendarMixin from \"../../mixins/datepicker-calendar-mixin/datepicker-calendar-mixin\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../calendar/bl-calendar\";\nimport { CALENDAR_TYPES } from \"../calendar/bl-calendar.constant\";\nimport \"../input/bl-input\";\nimport BlInput, { InputSize } from \"../input/bl-input\";\nimport \"../tooltip/bl-tooltip\";\nimport style from \"./bl-datepicker.css\";\n\n/**\n * @tag bl-datepicker\n * @summary Baklava DatePicker component\n *\n * @cssproperty [--bl-datepicker-input-width] - Sets the width of datepicker input\n **/\n@customElement(\"bl-datepicker\")\nexport default class BlDatepicker extends DatepickerCalendarMixin {\n /**\n * Defines the datepicker input placeholder\n */\n @property({ type: String, attribute: \"placeholder\", reflect: true })\n placeholder: string;\n /**\n * Sets input size.\n */\n @property({ type: String, reflect: true })\n size?: InputSize = \"medium\";\n\n /**\n * Makes datepicker input label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n /**\n * Defines the datepicker input label\n */\n @property({ type: String, attribute: \"label\", reflect: true })\n label: string;\n /**\n * Defines the custom formatter function\n */\n @property({ type: Function, attribute: \"value-formatter\" })\n valueFormatter: ((dates: Date[]) => string) | null = null;\n /**\n * Sets datepicker to disabled\n */\n @property({ type: Boolean })\n disabled: boolean;\n /**\n * Defines help text to datepicker input for users\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText: string;\n\n /**\n * Custom function to render day cells in the calendar.\n * It receives the date as an argument and should return a TemplateResult.\n */\n @property({ attribute: false })\n dayRenderer?: (date: Date) => TemplateResult;\n\n @state()\n _inputValue = \"\";\n\n @state()\n _floatingDateCount: number = 0;\n\n @state()\n _fittingDateCount: number = 0;\n\n @query(\"bl-calendar\")\n _calendarEl: BlCalendar;\n\n @query(\"bl-popover\")\n _popoverEl: BlPopover;\n\n @query(\"bl-input\")\n _inputEl!: BlInput;\n\n private _onCalendarMouseDown!: (event: MouseEvent) => void;\n private _onInputMouseDown!: (event: MouseEvent) => void;\n\n /**\n * Fires when date selection is changed\n */\n @event(\"bl-datepicker-change\") private _onBlDatepickerChange: EventDispatcher<Date[]>;\n\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n defaultInputValueFormatter() {\n if (this.type === CALENDAR_TYPES.SINGLE) {\n this._inputValue = this.formatDate(this._calendarEl?._dates[0]);\n this.closePopoverWithTimeout();\n } else if (this.type === CALENDAR_TYPES.MULTIPLE) {\n this.setFloatingDates();\n const values = this._calendarEl?._dates\n .slice(0, this._fittingDateCount)\n .map(date => this.formatDate(date));\n\n this._inputValue = values.join(\",\") + (this._floatingDateCount > 0 ? \" ,...\" : \"\");\n } else if (this.type === CALENDAR_TYPES.RANGE) {\n if (this._calendarEl?._dates[0])\n this._inputValue = this.formatDate(this._calendarEl?._dates[0]);\n if (this._calendarEl?._dates[1])\n this._inputValue = `${this._inputValue}-${this.formatDate(this._calendarEl?._dates[1])}`;\n if (this._calendarEl?._dates[0] && this._calendarEl?._dates[1])\n this.closePopoverWithTimeout();\n }\n }\n\n closePopoverWithTimeout() {\n setTimeout(() => {\n this.closePopover();\n this._inputEl.blur();\n }, 200);\n }\n\n setFloatingDates() {\n const datepickerInput = this.shadowRoot?.getElementById(\"datepicker-input\");\n const iconsContainer = this.shadowRoot?.getElementById(\"icon-container\");\n const datesTextTotalWidth = datepickerInput!.offsetWidth! - iconsContainer!.offsetWidth!;\n\n this._fittingDateCount = Math.floor(datesTextTotalWidth / 90);\n\n this._floatingDateCount = this._calendarEl?._dates.length - this._fittingDateCount;\n }\n\n setDatePickerInput() {\n if (!this._calendarEl?._dates.length) {\n this._inputValue = \"\";\n } else {\n if (this.valueFormatter) {\n this._inputValue = this.valueFormatter(this._calendarEl?._dates);\n } else {\n this.defaultInputValueFormatter();\n }\n }\n }\n\n formatDate(date: Date): string {\n if (this.monthYearOnly) {\n return `${String(date?.getMonth() + 1).padStart(2, \"0\")}/${date?.getFullYear()}`;\n }\n return `${String(date?.getDate()).padStart(2, \"0\")}/${String(date?.getMonth() + 1).padStart(\n 2,\n \"0\"\n )}/${date?.getFullYear()}`;\n }\n\n clearDatepicker() {\n this._calendarEl.handleClearSelectedDates();\n this._inputValue = \"\";\n this._floatingDateCount = 0;\n }\n\n openPopover() {\n this._popoverEl.target = this._inputEl;\n this._popoverEl.show();\n }\n\n closePopover() {\n this._popoverEl.hide();\n }\n\n _togglePopover() {\n this._popoverEl.visible ? this.closePopover() : this.openPopover();\n }\n\n formatAdditionalDates(str: string): TemplateResult[] {\n const parts = str.split(\",\");\n\n return parts?.reduce<TemplateResult[]>((acc, part, index) => {\n if (index > 0 && index % 3 === 0) {\n acc.push(html`<br />`);\n }\n acc.push(html`<span>${part.trim()}${index < parts.length - 1 ? \", \" : \"\"}</span>`);\n return acc;\n }, []);\n }\n\n async firstUpdated() {\n this._onCalendarMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._onInputMouseDown = event => {\n event.preventDefault();\n this._inputEl?.focus();\n };\n\n this._calendarEl?.addEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.addEventListener(\"mousedown\", this._onInputMouseDown);\n\n if (this._calendarEl?._dates) {\n this.setDatePickerInput();\n }\n }\n\n onCalendarChange() {\n this.setDatePickerInput();\n this._onBlDatepickerChange(this._calendarEl?._dates);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this._calendarEl?.removeEventListener(\"mousedown\", this._onCalendarMouseDown);\n this._inputEl?.removeEventListener(\"mousedown\", this._onInputMouseDown);\n }\n\n render() {\n const renderCalendar = html`\n <bl-popover target=\"datepicker-content\" placement=\"bottom-start\">\n <bl-calendar\n type=${this.type}\n .minDate=${this.minDate}\n .maxDate=${this.maxDate}\n .startOfWeek=${this.startOfWeek}\n .disabledDates=${this.disabledDates}\n .value=${this.value}\n .locale=${this.locale}\n .dayRenderer=${this.dayRenderer}\n ?month-year-only=${this.monthYearOnly}\n @bl-calendar-change=\"${this.onCalendarChange}\"\n ></bl-calendar>\n </bl-popover>\n `;\n const additionalDates =\n this._calendarEl?._dates\n ?.slice(this._fittingDateCount)\n .map(date => {\n return this.formatDate(date);\n })\n .join(\",\") ?? \"\";\n\n const formattedAdditionalDates = this.formatAdditionalDates(additionalDates);\n\n const additionalDatesView =\n this._floatingDateCount > 0\n ? html` <bl-tooltip>\n <span slot=\"tooltip-trigger\">+${this._floatingDateCount}</span>\n <div>${formattedAdditionalDates}</div>\n </bl-tooltip>`\n : \"\";\n\n const clearDatepickerButton =\n this._calendarEl?._dates.length > 0\n ? html` <bl-button\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this.clearDatepicker}\n ?disabled=${this.disabled}\n ></bl-button>\n <div class=\"action-divider\"></div>`\n : \"\";\n\n return html`\n <div class=\"datepicker-content\" id=\"datepicker-content\" tabindex=\"-1\">\n <bl-input\n .value=\"${this._inputValue}\"\n .label=\"${this.label}\"\n placeholder=\"${this.placeholder}\"\n class=\"datepicker-input\"\n role=\"button\"\n id=\"datepicker-input\"\n aria-haspopup=\"listbox\"\n aria-labelledby=\"label\"\n @click=${this._togglePopover}\n help-text=${this.helpText}\n ?disabled=${this.disabled}\n .size=${this.size}\n .labelFixed=${this.labelFixed}\n readonly\n >\n <div slot=\"icon\" class=\"icon-container\" id=\"icon-container\">\n ${additionalDatesView} ${clearDatepickerButton}\n <bl-icon name=\"calendar\" size=\"small\" class=\"calendar-icon\"></bl-icon>\n </div>\n </bl-input>\n ${renderCalendar}\n </div>\n `;\n }\n}\n"],
|
|
5
|
-
"mappings": "+NACO,IAAMA,EAASC,gzBACfC,EAAQF,ECiBf,IAAqBG,EAArB,cAA0CC,CAAwB,CAAlE,kCAUE,UAAmB,SAMnB,gBAAa,GAUb,oBAAqD,KAoBrD,iBAAc,GAGd,wBAA6B,EAG7B,uBAA4B,EAmB5B,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAEA,4BAA6B,CA9F/B,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EA+FI,GAAI,KAAK,gBACP,KAAK,YAAc,KAAK,YAAWP,EAAA,KAAK,c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,CADCG,EAAM,UAAU,GA5DE/B,EA6DnB,wBAQuC4B,EAAA,CAAtCN,EAAM,sBAAsB,GArEVtB,EAqEoB,qCArEpBA,EAArB4B,EAAA,CADCC,EAAc,eAAe,GACT7B",
|
|
6
|
-
"names": ["styles", "i", "bl_datepicker_default", "BlDatepicker", "DatepickerCalendarMixin", "bl_datepicker_default", "_a", "_b", "_c", "_d", "_e", "_f", "_g", "_h", "values", "date", "datepickerInput", "iconsContainer", "datesTextTotalWidth", "str", "parts", "acc", "part", "index", "x", "event", "renderCalendar", "additionalDates", "formattedAdditionalDates", "additionalDatesView", "clearDatepickerButton", "__decorateClass", "e", "t", "i"]
|
|
7
|
-
}
|
package/dist/chunk-T7ECITFD.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import{a as V}from"./chunk-IPYZIIRV.js";import{a as Y,b as k}from"./chunk-WEEGH2F4.js";import{a as T}from"./chunk-6LT7O7T2.js";import{a as C}from"./chunk-GRL4DWKG.js";import{b as A}from"./chunk-276RDWEQ.js";import{a as M,b as c,c as f}from"./chunk-5MOOXA2X.js";import{a as x,b as d,f as S}from"./chunk-4OT5AMS5.js";import{d as r}from"./chunk-IZ2LK5GK.js";function v(u){let D=[],e=u.split(",");return e==null||e.forEach(t=>{let a=new Date(t.trim());isNaN(a.getTime())||D.push(a)}),D}var h=class extends S{constructor(){super(...arguments);this.startOfWeek=0;this.locale=document.documentElement.lang||"en-EN";this.monthYearOnly=!1;this._disabledDates=[];this._value=[]}get disabledDates(){return this._disabledDates}set disabledDates(e){let t=[];typeof e=="string"?t=v(e):Array.isArray(e)&&(t=e.filter(a=>!isNaN(a.getTime()))),this.requestUpdate("disabledDates",t),this._disabledDates=t}get maxDate(){return this._maxDate}set maxDate(e){if(e&&isNaN(new Date(e).getTime())){console.warn("Invalid maxDate value.");return}this._minDate&&this._minDate>e?console.warn("maxDate cannot be smaller than minDate."):(this._maxDate=new Date(e),this.requestUpdate("maxDate",e))}get minDate(){return this._minDate}set minDate(e){if(e&&isNaN(new Date(e).getTime())){console.warn("Invalid minDate value.");return}this._maxDate&&this._maxDate<e?console.warn("minDate cannot be greater than maxDate."):(this._minDate=new Date(e),this.requestUpdate("minDate",e))}set value(e){let t=this._value;this._value=e,this.requestUpdate("value",t)}get value(){return this._value}};r([c()],h.prototype,"type",2),r([c({type:Number,attribute:"start-of-week",reflect:!0})],h.prototype,"startOfWeek",2),r([c()],h.prototype,"locale",2),r([c({type:Boolean,attribute:"month-year-only",reflect:!0})],h.prototype,"monthYearOnly",2),r([c({attribute:"disabled-dates",reflect:!0})],h.prototype,"disabledDates",1),r([c({type:Date,attribute:"max-date",reflect:!0})],h.prototype,"maxDate",1),r([c({type:Date,attribute:"min-date",reflect:!0})],h.prototype,"minDate",1),r([c({attribute:"value",reflect:!0})],h.prototype,"value",1);function N(u){return u?typeof u=="string"?v(u):u instanceof Date?[u]:u:[]}var E=x`.calendar{display:flex;flex-direction:column}.calendar-content{display:flex;padding:var(--bl-size-m);flex-direction:column;align-items:center;gap:var(--bl-size-m);border-radius:var(--bl-border-radius-s);width:fit-content;background:var(--bl-color-neutral-full)}.calendar-header{display:flex;justify-content:space-between;width:100%;align-items:center;padding-bottom:var(--bl-size-s)}.arrow{flex:1}:host([dir=rtl]) .arrow{transform:scale(-1)}.header-text{flex:3}.header-text-hover{background:var(--bl-color-neutral-lightest);border-radius:var(--bl-border-radius-s)}.days-wrapper{display:flex;flex-direction:column}.day-wrapper{display:flex;align-items:center;justify-content:center}.week-row{display:flex;align-items:center;flex-direction:row;padding-bottom:var(--bl-size-2xs)}.day{display:flex;align-items:center;width:40px;--bl-button-focus-border-color:#000;--bl-font-title-4-medium:var(--bl-font-weight-regular) var(--bl-font-size-m);--bl-size-xl:40px;--bl-border-radius-m:50%;--bl-border-radius-l:50%}.day.today-day{--bl-color-neutral-darker:var(--bl-color-primary);--bl-color-neutral-darkest:var(--bl-color-primary)}.day.other-month-day{--bl-color-neutral-darker:var(--bl-color-neutral-dark)}.day.other-month-day.selected-day{--bl-color-neutral-darker:var(--bl-color-neutral-full)}.day.selected-day{background:var(--bl-color-primary);border-radius:50%;--bl-button-focus-border-color:var(--bl-color-primary);--bl-color-neutral-darker:var(--bl-color-neutral-full)}.range-day{background:var(--bl-color-primary-contrast);--bl-color-neutral-lightest:var(--bl-color-primary-contrast)}.range-end-day,.range-start-day,.selected-day{--bl-color-neutral-lightest:var(--bl-color-primary);--bl-color-neutral-darker:var(--bl-color-neutral-full);--bl-color-neutral-darkest:var(--bl-color-neutral-full)!important}.range-start-day{background:var(--bl-color-primary-contrast);border-start-start-radius:50%;border-end-start-radius:50%}.range-end-day{background:var(--bl-color-primary-contrast);border-start-end-radius:50%;border-end-end-radius:50%}.weekday-text{color:var(--bl-color-neutral-dark);text-align:center;padding:var(--bl-size-2xs) 0;width:40px}.grid-content{display:grid;grid-template-columns:auto auto auto;text-align:center}.grid-item{width:93.33px;--bl-size-3xs:15px}.grid-item:not(:nth-last-child(-n + 3)){padding-bottom:var(--bl-size-2xs)}.calendar-text{font:var(--bl-font-title-3-regular)}`,$=E;var o=class extends h{constructor(){super(...arguments);this.today=new Date;this._calendarMonth=this.today.getMonth();this._calendarYear=this.today.getFullYear();this._calendarView="days";this._calendarYears=[];this._calendarDays=[];this._dates=[];this.handleClearSelectedDates=()=>{this._dates=[],this._onBlCalendarChange([]),this.clearRangePickerStyles()}}static get styles(){return[$]}connectedCallback(){super.connectedCallback(),V(this),this.monthYearOnly&&(this._calendarView="months")}get months(){return[...Array(12).keys()].map(e=>({name:new Date(0,e+1,0).toLocaleString(this.locale,{month:"long"}),value:e}))}get days(){return[...Array(7).keys()].map(e=>({name:new Date(0,0,e).toLocaleString(this.locale,{weekday:"short"}),value:e}))}getDayNumInAMonth(e,t){return new Date(e,t+1,0).getDate()}getWeekDayOfDate(e,t){return new Date(e,t,1).getDay()}setPreviousCalendarView(){if(this.clearRangePickerStyles(),this._calendarView==="days"&&!this.monthYearOnly)this._calendarMonth===0?(this._calendarMonth=11,this._calendarYear-=1):this._calendarMonth-=1;else if(this._calendarView==="months")this._calendarYear-=1;else if(this._calendarView==="years"){let e=this._calendarYears[0];this._calendarYears=Array.from({length:12},(t,a)=>e-(a+1))}this.type==="range"&&this.setHoverClass()}setNextCalendarView(){if(this.clearRangePickerStyles(),this._calendarView==="days"&&!this.monthYearOnly)this._calendarMonth===11?(this._calendarMonth=0,this._calendarYear+=1):this._calendarMonth+=1;else if(this._calendarView==="months")this._calendarYear+=1;else if(this._calendarView==="years"){let e=this._calendarYears[11];this._calendarYears=Array.from({length:12},(t,a)=>e+(a+1))}this.setHoverClass()}setCurrentCalendarView(e){let t=this.monthYearOnly?"months":"days";this._calendarView=this._calendarView!==e?e:t,this.setHoverClass()}setMonthAndCalendarView(e){if(this._calendarMonth=e,this.monthYearOnly){let t=new Date(this._calendarYear,e,1);this.handleDate(t)}else this._calendarView="days",this.type==="range"&&this.setHoverClass()}setYearAndCalendarView(e){this._calendarYear=e,this._calendarView=this.monthYearOnly?"months":"days",this.type==="range"&&this.setHoverClass()}generateSurroundingYears(){this._calendarYears.length||(this._calendarYears=Array.from({length:12},(e,t)=>this._calendarYear-4+t))}clearRangePickerStyles(){var e;(e=this.shadowRoot)==null||e.querySelectorAll(".range-day, .range-start-day, .range-end-day").forEach(t=>t.classList.remove("range-day","range-start-day","range-end-day"))}handleDate(e){if(this.type!=="range"){let t=e.getFullYear()<this._calendarYear||e.getFullYear()===this._calendarYear&&e.getMonth()<this._calendarMonth,a=e.getFullYear()>this._calendarYear||e.getFullYear()===this._calendarYear&&e.getMonth()>this._calendarMonth;t?this.setPreviousCalendarView():a&&this.setNextCalendarView()}switch(this.type){case"single":this.handleSingleSelectCalendar(e);break;case"multiple":this.handleMultipleSelectCalendar(e);break;case"range":this.handleRangeSelectCalendar(e);break}this._onBlCalendarChange(this._dates),this.requestUpdate()}handleSingleSelectCalendar(e){this._dates=[e]}handleMultipleSelectCalendar(e){var a,l,s;((a=this._dates)==null?void 0:a.some(n=>n.getTime()===e.getTime()))?(s=this._dates)==null||s.splice((l=this._dates)==null?void 0:l.findIndex(n=>n.getTime()===e.getTime()),1):this._dates.push(e)}handleRangeSelectCalendar(e){if(!this._dates[0])this._dates[0]=e;else if(this._dates[1])this._dates=[],this._dates[0]=e;else if(e.getTime()>this._dates[0].getTime())this._dates[1]=e;else{let t=this._dates[0];this._dates[0]=e,this._dates[1]=t}this.setHoverClass()}checkIfSelectedDate(e){var t;return(t=this._dates)==null?void 0:t.some(a=>a.getFullYear()===e.getFullYear()&&a.getMonth()===e.getMonth()&&a.getDate()===e.getDate())}checkIfDateIsToday(e){let t=this.today;return t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}checkIfDateIsDisabled(e){var t,a,l;return e.getTime()<((t=this.minDate)==null?void 0:t.getTime())||e.getTime()>((a=this.maxDate)==null?void 0:a.getTime())?!0:this.disabledDates.length>0?(l=this.disabledDates)==null?void 0:l.some(s=>e.getDate()===s.getDate()&&e.getMonth()===s.getMonth()&&e.getFullYear()===s.getFullYear()):!1}setHoverClass(){this.clearRangePickerStyles(),this._dates[0]&&this._dates[1]&&setTimeout(()=>{var l,s,n,b,y,_,i,m,g;let e=(n=(s=this.shadowRoot)==null?void 0:s.getElementById(`${(l=this._dates[0])==null?void 0:l.getTime()}`))==null?void 0:n.parentElement;e==null||e.classList.add("range-start-day");let t=(_=(y=this.shadowRoot)==null?void 0:y.getElementById(`${(b=this._dates[1])==null?void 0:b.getTime()}`))==null?void 0:_.parentElement;t==null||t.classList.add("range-end-day");let a=[...this.createCalendarDays().values()].flat().filter(p=>p.getTime()>this._dates[0].getTime()&&p.getTime()<this._dates[1].getTime());for(let p=0;p<a.length;p++){let w=(m=(i=this.shadowRoot)==null?void 0:i.getElementById(`${a[p].getTime()}`))==null?void 0:m.parentElement;(g=w==null?void 0:w.classList)==null||g.add("range-day")}})}createCalendarDays(){var y,_;let e=new Map;this._calendarDays=this.days.slice(this.startOfWeek).concat(this.days.slice(0,this.startOfWeek));let t=this.getWeekDayOfDate(this._calendarYear,this._calendarMonth),a=t<this.startOfWeek?7-(this.startOfWeek-t):t-this.startOfWeek,l=this.getDayNumInAMonth(this._calendarYear,this._calendarMonth-1),s=this.getDayNumInAMonth(this._calendarYear,this._calendarMonth),n=this.startOfWeek;for(let i=a;i>0;i--){let m=n%7,g=new Date(this._calendarYear,this._calendarMonth-1,l-i+1);e.set(this.days[m].name,[g]),n+=1}for(let i=1;i<=s;i++){let m=n%7,g=new Date(this._calendarYear,this._calendarMonth,i);e.get(this.days[m].name)?(y=e.get(this.days[m].name))==null||y.push(g):e.set(this.days[m].name,[g]),n+=1}let b=this._calendarDays.findIndex(i=>i.value===n%7);if(b!==0)for(let i=1;i<=this._calendarDays.length-b;i++){let m=n%7,g=new Date(this._calendarYear,this._calendarMonth+1,i);(_=e.get(this.days[m].name))==null||_.push(g),n+=1}return e}updated(e){if(e.has("value")){let t=N(this._value);t!=null&&t.length?t==null||t.forEach(a=>{this.handleDate(a)}):this.handleClearSelectedDates()}}renderCalendarHeader(){let e=this._calendarView==="months"?"header-text-hover":"",t=this._calendarView==="years"?"header-text-hover":"";return d`
|
|
2
|
-
<div class="calendar-header">
|
|
3
|
-
<bl-button
|
|
4
|
-
class="arrow"
|
|
5
|
-
icon="arrow_left"
|
|
6
|
-
variant="tertiary"
|
|
7
|
-
kind="neutral"
|
|
8
|
-
@click="${()=>this.setPreviousCalendarView()}"
|
|
9
|
-
></bl-button>
|
|
10
|
-
${this.monthYearOnly?d``:d`<bl-button
|
|
11
|
-
variant="tertiary"
|
|
12
|
-
kind="neutral"
|
|
13
|
-
class="header-text ${e}"
|
|
14
|
-
@click="${()=>this.setCurrentCalendarView("months")}"
|
|
15
|
-
>${this.months[this._calendarMonth].name}
|
|
16
|
-
</bl-button>`}
|
|
17
|
-
<bl-button
|
|
18
|
-
variant="tertiary"
|
|
19
|
-
kind="neutral"
|
|
20
|
-
class="header-text ${t}"
|
|
21
|
-
@click="${()=>this.setCurrentCalendarView("years")}"
|
|
22
|
-
>${this._calendarYear}
|
|
23
|
-
</bl-button>
|
|
24
|
-
<bl-button
|
|
25
|
-
class="arrow"
|
|
26
|
-
icon="arrow_right"
|
|
27
|
-
variant="tertiary"
|
|
28
|
-
kind="neutral"
|
|
29
|
-
@click="${()=>this.setNextCalendarView()}"
|
|
30
|
-
></bl-button>
|
|
31
|
-
</div>
|
|
32
|
-
`}renderCalendarDays(){let e=this.createCalendarDays(),t=Array.from(e.values());return d` <div class="week-row">
|
|
33
|
-
${[...e.keys()].map(a=>d` <div class="calendar-text weekday-text">${a}</div> `)}
|
|
34
|
-
</div>
|
|
35
|
-
<div class="days-wrapper">
|
|
36
|
-
${[...Array(t[0].length).keys()].map(a=>d` <div class="week-row">
|
|
37
|
-
${t.map(l=>{let s=l[a],n=this.checkIfSelectedDate(s),b=this.checkIfDateIsToday(s),y=this.checkIfDateIsDisabled(s),_=T({day:!0,"calendar-text":!0,"today-day":b,"selected-day":n,"other-month-day":l[a].getMonth()!==this._calendarMonth,"disabled-day":y});return d`<div class="day-wrapper">
|
|
38
|
-
<bl-button
|
|
39
|
-
id=${s.getTime()}
|
|
40
|
-
variant="tertiary"
|
|
41
|
-
kind="neutral"
|
|
42
|
-
size="small"
|
|
43
|
-
class=${_}
|
|
44
|
-
?disabled=${y}
|
|
45
|
-
@click="${()=>!y&&this.handleDate(s)}"
|
|
46
|
-
>
|
|
47
|
-
${this.dayRenderer?this.dayRenderer(s):s.getDate()}
|
|
48
|
-
</bl-button>
|
|
49
|
-
</div>`})}
|
|
50
|
-
</div>`)}
|
|
51
|
-
</div>`}renderCalendarMonths(){return d` <div class="grid-content">
|
|
52
|
-
${this.months.map((e,t)=>{let a=e.value===this._calendarMonth?"primary":"tertiary",l=e.value===this._calendarMonth?"default":"neutral";return d` <bl-button
|
|
53
|
-
variant=${a}
|
|
54
|
-
kind=${l}
|
|
55
|
-
class="grid-item"
|
|
56
|
-
size="small"
|
|
57
|
-
@click="${()=>this.setMonthAndCalendarView(t)}"
|
|
58
|
-
><span class="calendar-text">${e.name}</span></bl-button
|
|
59
|
-
>`})}
|
|
60
|
-
</div>`}renderCalendarYears(){return this.generateSurroundingYears(),d` <div class="grid-content">
|
|
61
|
-
${this._calendarYears.map(e=>{let t=e===this._calendarYear?"primary":"tertiary",a=e===this._calendarYear?"default":"neutral";return d` <bl-button
|
|
62
|
-
variant=${t}
|
|
63
|
-
kind=${a}
|
|
64
|
-
class="grid-item"
|
|
65
|
-
@click="${()=>this.setYearAndCalendarView(e)}"
|
|
66
|
-
><span class="calendar-text">${e}</span></bl-button
|
|
67
|
-
>`})}
|
|
68
|
-
</div>`}render(){return d`
|
|
69
|
-
<div>
|
|
70
|
-
<div class="calendar-content">
|
|
71
|
-
<div class="calendar">
|
|
72
|
-
${this.renderCalendarHeader()}
|
|
73
|
-
${this._calendarView==="days"?this.renderCalendarDays():""}
|
|
74
|
-
${this._calendarView==="months"?this.renderCalendarMonths():""}
|
|
75
|
-
${this._calendarView==="years"?this.renderCalendarYears():""}
|
|
76
|
-
</div>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
`}};r([f()],o.prototype,"today",2),r([f()],o.prototype,"_calendarMonth",2),r([f()],o.prototype,"_calendarYear",2),r([f()],o.prototype,"_calendarView",2),r([f()],o.prototype,"_calendarYears",2),r([f()],o.prototype,"_calendarDays",2),r([f()],o.prototype,"_dates",2),r([c({attribute:!1})],o.prototype,"dayRenderer",2),r([C("bl-calendar-change")],o.prototype,"_onBlCalendarChange",2),o=r([M("bl-calendar"),A()],o);export{h as a,o as b};
|
|
80
|
-
//# sourceMappingURL=chunk-T7ECITFD.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/utilities/string-to-date-converter.ts", "../src/mixins/datepicker-calendar-mixin/datepicker-calendar-mixin.ts", "../src/utilities/format-to-date-array.ts", "../src/components/calendar/bl-calendar.css", "../src/components/calendar/bl-calendar.ts"],
|
|
4
|
-
"sourcesContent": ["export function stringToDateArray(value: string): Date[] {\n const tempValue: Date[] = [];\n const splitDates = value.split(\",\");\n\n splitDates?.forEach(date => {\n const isDate = new Date(date.trim());\n\n if (!isNaN(isDate.getTime())) {\n tempValue.push(isDate);\n }\n });\n return tempValue;\n}\n", "import { LitElement } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { CalendarType, DayValues } from \"../../components/calendar/bl-calendar.types\";\nimport { stringToDateArray } from \"../../utilities/string-to-date-converter\";\n\nexport default class DatepickerCalendarMixin extends LitElement {\n /**\n * Defines the calendar types, available types are single, multiple and range\n */\n @property()\n type: CalendarType;\n /**\n * Defines the start day of the calendar (1 defines monday)\n */\n @property({ type: Number, attribute: \"start-of-week\", reflect: true })\n startOfWeek: DayValues = 0;\n /**\n * Defines the calendar language\n */\n @property()\n locale: string = document.documentElement.lang || \"en-EN\";\n\n /**\n * Enables month and year only selection mode\n */\n @property({ type: Boolean, attribute: \"month-year-only\", reflect: true })\n monthYearOnly = false;\n\n /**\n * Defines the unselectable dates for calendar\n */\n protected _disabledDates: Date[] = [];\n\n get disabledDates(): Date[] {\n return this._disabledDates;\n }\n\n @property({\n attribute: \"disabled-dates\",\n reflect: true,\n })\n set disabledDates(disabledDates: Date[] | string) {\n // Now we are using 1.6.0 version of @lit/reactive-elements and in this version even if our property has property decorator it doesn't run request update inside.\n // We added similar implementations to update when there is a change.\n // When we update the lit to 2.0 or upper versions we can remove the requestUpdate here\n\n let newVal: Date[] = [];\n\n if (typeof disabledDates === \"string\") {\n newVal = stringToDateArray(disabledDates);\n } else if (Array.isArray(disabledDates)) {\n newVal = disabledDates.filter(d => !isNaN(d.getTime()));\n }\n\n this.requestUpdate(\"disabledDates\", newVal);\n this._disabledDates = newVal;\n }\n\n /**\n * Defines the maximum date value for the calendar\n */\n _maxDate: Date;\n\n get maxDate() {\n return this._maxDate;\n }\n\n @property({ type: Date, attribute: \"max-date\", reflect: true })\n set maxDate(maxDate: Date) {\n if (maxDate && isNaN(new Date(maxDate).getTime())) {\n console.warn(\"Invalid maxDate value.\");\n return;\n }\n if (this._minDate && this._minDate > maxDate) {\n console.warn(\"maxDate cannot be smaller than minDate.\");\n } else {\n this._maxDate = new Date(maxDate);\n this.requestUpdate(\"maxDate\", maxDate);\n }\n }\n\n /**\n * Defines the minimum date value for the calendar\n */\n _minDate: Date;\n\n get minDate() {\n return this._minDate;\n }\n\n @property({ type: Date, attribute: \"min-date\", reflect: true })\n set minDate(minDate: Date) {\n if (minDate && isNaN(new Date(minDate).getTime())) {\n console.warn(\"Invalid minDate value.\");\n return;\n }\n if (this._maxDate && this._maxDate < minDate) {\n console.warn(\"minDate cannot be greater than maxDate.\");\n } else {\n this._minDate = new Date(minDate);\n this.requestUpdate(\"minDate\", minDate);\n }\n }\n\n @property({ attribute: \"value\", reflect: true })\n set value(value: string | Date | Date[]) {\n const oldValue = this._value;\n\n this._value = value;\n this.requestUpdate(\"value\", oldValue);\n }\n\n get value(): string | Date | Date[] {\n return this._value;\n }\n\n _value: string | Date | Date[] = [];\n}\n", "import { stringToDateArray } from \"./string-to-date-converter\";\n\nexport function formatToDateArray(value: string | Date | Date[] | undefined): Date[] {\n if (!value) {\n return [];\n }\n if (typeof value === \"string\") {\n return stringToDateArray(value);\n } else if (value instanceof Date) {\n return [value];\n } else {\n return value;\n }\n}\n", "import {css} from 'lit';\nexport const styles = css`.calendar{display:flex;flex-direction:column}.calendar-content{display:flex;padding:var(--bl-size-m);flex-direction:column;align-items:center;gap:var(--bl-size-m);border-radius:var(--bl-border-radius-s);width:fit-content;background:var(--bl-color-neutral-full)}.calendar-header{display:flex;justify-content:space-between;width:100%;align-items:center;padding-bottom:var(--bl-size-s)}.arrow{flex:1}:host([dir=rtl]) .arrow{transform:scale(-1)}.header-text{flex:3}.header-text-hover{background:var(--bl-color-neutral-lightest);border-radius:var(--bl-border-radius-s)}.days-wrapper{display:flex;flex-direction:column}.day-wrapper{display:flex;align-items:center;justify-content:center}.week-row{display:flex;align-items:center;flex-direction:row;padding-bottom:var(--bl-size-2xs)}.day{display:flex;align-items:center;width:40px;--bl-button-focus-border-color:#000;--bl-font-title-4-medium:var(--bl-font-weight-regular) var(--bl-font-size-m);--bl-size-xl:40px;--bl-border-radius-m:50%;--bl-border-radius-l:50%}.day.today-day{--bl-color-neutral-darker:var(--bl-color-primary);--bl-color-neutral-darkest:var(--bl-color-primary)}.day.other-month-day{--bl-color-neutral-darker:var(--bl-color-neutral-dark)}.day.other-month-day.selected-day{--bl-color-neutral-darker:var(--bl-color-neutral-full)}.day.selected-day{background:var(--bl-color-primary);border-radius:50%;--bl-button-focus-border-color:var(--bl-color-primary);--bl-color-neutral-darker:var(--bl-color-neutral-full)}.range-day{background:var(--bl-color-primary-contrast);--bl-color-neutral-lightest:var(--bl-color-primary-contrast)}.range-end-day,.range-start-day,.selected-day{--bl-color-neutral-lightest:var(--bl-color-primary);--bl-color-neutral-darker:var(--bl-color-neutral-full);--bl-color-neutral-darkest:var(--bl-color-neutral-full)!important}.range-start-day{background:var(--bl-color-primary-contrast);border-start-start-radius:50%;border-end-start-radius:50%}.range-end-day{background:var(--bl-color-primary-contrast);border-start-end-radius:50%;border-end-end-radius:50%}.weekday-text{color:var(--bl-color-neutral-dark);text-align:center;padding:var(--bl-size-2xs) 0;width:40px}.grid-content{display:grid;grid-template-columns:auto auto auto;text-align:center}.grid-item{width:93.33px;--bl-size-3xs:15px}.grid-item:not(:nth-last-child(-n + 3)){padding-bottom:var(--bl-size-2xs)}.calendar-text{font:var(--bl-font-title-3-regular)}`;\nexport default styles;\n", "import { CSSResultGroup, html, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { localized } from \"@lit/localize\";\nimport DatepickerCalendarMixin from \"../../mixins/datepicker-calendar-mixin/datepicker-calendar-mixin\";\nimport { setDirectionProperty } from \"../../utilities/direction\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { formatToDateArray } from \"../../utilities/format-to-date-array\";\nimport \"../button/bl-button\";\nimport \"../icon/bl-icon\";\nimport {\n CALENDAR_TYPES,\n CALENDAR_VIEWS,\n FIRST_MONTH_INDEX,\n LAST_MONTH_INDEX,\n} from \"./bl-calendar.constant\";\nimport style from \"./bl-calendar.css\";\nimport { Calendar, CalendarDay, CalendarView } from \"./bl-calendar.types\";\n\n/**\n * @tag bl-calendar\n * @summary Baklava Calendar component\n **/\n@customElement(\"bl-calendar\")\n@localized()\nexport default class BlCalendar extends DatepickerCalendarMixin {\n @state()\n today = new Date();\n @state()\n _calendarMonth: number = this.today.getMonth();\n @state()\n _calendarYear: number = this.today.getFullYear();\n @state()\n _calendarView: CalendarView = CALENDAR_VIEWS.DAYS;\n @state()\n _calendarYears: number[] = [];\n @state()\n _calendarDays: CalendarDay[] = [];\n @state()\n _dates: Date[] = [];\n\n /**\n * Custom function to render day cells.\n * It receives the date as an argument and should return a TemplateResult.\n */\n @property({ attribute: false })\n dayRenderer?: (date: Date) => TemplateResult;\n\n /**\n * Fires when date selection changes\n */\n @event(\"bl-calendar-change\") _onBlCalendarChange: EventDispatcher<Date[]>;\n\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n connectedCallback() {\n super.connectedCallback();\n setDirectionProperty(this);\n\n if (this.monthYearOnly) {\n this._calendarView = CALENDAR_VIEWS.MONTHS;\n }\n }\n\n get months() {\n return [...Array(12).keys()].map(month => ({\n name: new Date(0, month + 1, 0).toLocaleString(this.locale, { month: \"long\" }),\n value: month,\n }));\n }\n\n get days() {\n return [...Array(7).keys()].map(day => ({\n name: new Date(0, 0, day).toLocaleString(this.locale, { weekday: \"short\" }),\n value: day,\n }));\n }\n\n public handleClearSelectedDates = () => {\n this._dates = [];\n this._onBlCalendarChange([]);\n this.clearRangePickerStyles();\n };\n\n getDayNumInAMonth(year: number, month: number) {\n return new Date(year, month + 1, 0).getDate();\n }\n\n getWeekDayOfDate(year: number, month: number) {\n return new Date(year, month, 1).getDay();\n }\n\n setPreviousCalendarView() {\n this.clearRangePickerStyles();\n if (this._calendarView === CALENDAR_VIEWS.DAYS && !this.monthYearOnly) {\n if (this._calendarMonth === FIRST_MONTH_INDEX) {\n this._calendarMonth = LAST_MONTH_INDEX;\n this._calendarYear -= 1;\n } else this._calendarMonth -= 1;\n } else if (this._calendarView === CALENDAR_VIEWS.MONTHS) {\n this._calendarYear -= 1;\n } else if (this._calendarView === CALENDAR_VIEWS.YEARS) {\n const fromYear = this._calendarYears[0];\n\n this._calendarYears = Array.from({ length: 12 }, (_, i) => fromYear - (i + 1));\n }\n if (this.type === CALENDAR_TYPES.RANGE) this.setHoverClass();\n }\n\n setNextCalendarView() {\n this.clearRangePickerStyles();\n if (this._calendarView === CALENDAR_VIEWS.DAYS && !this.monthYearOnly) {\n if (this._calendarMonth === LAST_MONTH_INDEX) {\n this._calendarMonth = FIRST_MONTH_INDEX;\n this._calendarYear += 1;\n } else this._calendarMonth += 1;\n } else if (this._calendarView === CALENDAR_VIEWS.MONTHS) {\n this._calendarYear += 1;\n } else if (this._calendarView === CALENDAR_VIEWS.YEARS) {\n const fromYear = this._calendarYears[11];\n\n this._calendarYears = Array.from({ length: 12 }, (_, i) => fromYear + (i + 1));\n }\n this.setHoverClass();\n }\n\n setCurrentCalendarView(view: CalendarView) {\n const defaultView = this.monthYearOnly ? CALENDAR_VIEWS.MONTHS : CALENDAR_VIEWS.DAYS;\n\n this._calendarView = this._calendarView !== view ? view : defaultView;\n this.setHoverClass();\n }\n\n setMonthAndCalendarView(month: number) {\n this._calendarMonth = month;\n\n if (this.monthYearOnly) {\n // In month-year only mode, selecting a month finalizes the selection\n const date = new Date(this._calendarYear, month, 1);\n\n this.handleDate(date);\n } else {\n this._calendarView = CALENDAR_VIEWS.DAYS;\n if (this.type === CALENDAR_TYPES.RANGE) this.setHoverClass();\n }\n }\n\n setYearAndCalendarView(year: number) {\n this._calendarYear = year;\n this._calendarView = this.monthYearOnly ? CALENDAR_VIEWS.MONTHS : CALENDAR_VIEWS.DAYS;\n if (this.type === CALENDAR_TYPES.RANGE) this.setHoverClass();\n }\n\n generateSurroundingYears() {\n if (!this._calendarYears.length) {\n this._calendarYears = Array.from({ length: 12 }, (_, i) => this._calendarYear - 4 + i);\n }\n }\n\n clearRangePickerStyles() {\n this.shadowRoot\n ?.querySelectorAll(\".range-day, .range-start-day, .range-end-day\")\n .forEach(day => day.classList.remove(\"range-day\", \"range-start-day\", \"range-end-day\"));\n }\n\n handleDate(date: Date) {\n if (this.type !== CALENDAR_TYPES.RANGE) {\n const isDateBeforeThanCalendar =\n date.getFullYear() < this._calendarYear ||\n (date.getFullYear() === this._calendarYear && date.getMonth() < this._calendarMonth);\n\n const isDateAfterThanCalendar =\n date.getFullYear() > this._calendarYear ||\n (date.getFullYear() === this._calendarYear && date.getMonth() > this._calendarMonth);\n\n if (isDateBeforeThanCalendar) {\n this.setPreviousCalendarView();\n } else if (isDateAfterThanCalendar) {\n this.setNextCalendarView();\n }\n }\n\n switch (this.type) {\n case CALENDAR_TYPES.SINGLE:\n this.handleSingleSelectCalendar(date);\n break;\n case CALENDAR_TYPES.MULTIPLE:\n this.handleMultipleSelectCalendar(date);\n break;\n case CALENDAR_TYPES.RANGE:\n this.handleRangeSelectCalendar(date);\n break;\n }\n\n this._onBlCalendarChange(this._dates);\n this.requestUpdate();\n }\n\n handleSingleSelectCalendar(calendarDate: Date) {\n this._dates = [calendarDate];\n }\n\n handleMultipleSelectCalendar(calendarDate: Date) {\n const dateExist = this._dates?.some(d => d.getTime() === calendarDate.getTime());\n\n dateExist\n ? this._dates?.splice(\n this._dates?.findIndex(d => d.getTime() === calendarDate.getTime()),\n 1\n )\n : this._dates.push(calendarDate);\n }\n\n handleRangeSelectCalendar(calendarDate: Date) {\n if (!this._dates[0]) {\n this._dates[0] = calendarDate;\n } else if (!this._dates[1]) {\n if (calendarDate.getTime() > this._dates[0].getTime()) {\n this._dates[1] = calendarDate;\n } else {\n const tempEndDate = this._dates[0];\n\n this._dates[0] = calendarDate;\n this._dates[1] = tempEndDate;\n }\n } else {\n this._dates = [];\n this._dates[0] = calendarDate;\n }\n this.setHoverClass();\n }\n\n checkIfSelectedDate(calendarDate: Date) {\n return this._dates?.some(\n date =>\n date.getFullYear() === calendarDate.getFullYear() &&\n date.getMonth() === calendarDate.getMonth() &&\n date.getDate() === calendarDate.getDate()\n );\n }\n\n checkIfDateIsToday(calendarDate: Date) {\n const today = this.today;\n\n return (\n today.getDate() === calendarDate.getDate() &&\n today.getMonth() === calendarDate.getMonth() &&\n today.getFullYear() === calendarDate.getFullYear()\n );\n }\n\n checkIfDateIsDisabled(calendarDate: Date) {\n if (\n calendarDate.getTime() < this.minDate?.getTime() ||\n calendarDate.getTime() > this.maxDate?.getTime()\n ) {\n return true;\n }\n if (this.disabledDates.length > 0) {\n return this.disabledDates?.some(disabledDate => {\n return (\n calendarDate.getDate() === disabledDate.getDate() &&\n calendarDate.getMonth() === disabledDate.getMonth() &&\n calendarDate.getFullYear() === disabledDate.getFullYear()\n );\n });\n }\n return false;\n }\n\n setHoverClass() {\n this.clearRangePickerStyles();\n\n if (this._dates[0] && this._dates[1]) {\n setTimeout(() => {\n const startDateParentElement = this.shadowRoot?.getElementById(\n `${this._dates[0]?.getTime()}`\n )?.parentElement;\n\n startDateParentElement?.classList.add(\"range-start-day\");\n\n const endDateParentElement = this.shadowRoot?.getElementById(\n `${this._dates[1]?.getTime()}`\n )?.parentElement;\n\n endDateParentElement?.classList.add(\"range-end-day\");\n const rangeDays = [...this.createCalendarDays().values()]\n .flat()\n .filter(\n date =>\n date.getTime() > this._dates[0]!.getTime() &&\n date.getTime() < this._dates[1]!.getTime()\n );\n\n for (let i = 0; i < rangeDays.length; i++) {\n const element = this.shadowRoot?.getElementById(\n `${rangeDays[i].getTime()}`\n )?.parentElement;\n\n element?.classList?.add(\"range-day\");\n }\n });\n }\n }\n\n createCalendarDays() {\n const calendar: Calendar = new Map();\n\n this._calendarDays = this.days\n .slice(this.startOfWeek)\n .concat(this.days.slice(0, this.startOfWeek));\n\n const currentMonthStartWeekDay = this.getWeekDayOfDate(this._calendarYear, this._calendarMonth); // 1\n\n const lastMonthDaysCount =\n currentMonthStartWeekDay < this.startOfWeek\n ? 7 - (this.startOfWeek - currentMonthStartWeekDay)\n : currentMonthStartWeekDay - this.startOfWeek;\n\n const previousMonthDayCount = this.getDayNumInAMonth(\n this._calendarYear,\n this._calendarMonth - 1\n );\n\n const currentMonthDayCount = this.getDayNumInAMonth(this._calendarYear, this._calendarMonth);\n\n let dayOfTheWeek = this.startOfWeek; // from sunday\n\n for (\n let lastMonthDaysIterator = lastMonthDaysCount;\n lastMonthDaysIterator > 0;\n lastMonthDaysIterator--\n ) {\n const mod = dayOfTheWeek % 7;\n const date = new Date(\n this._calendarYear,\n this._calendarMonth - 1,\n previousMonthDayCount - lastMonthDaysIterator + 1\n );\n\n calendar.set(this.days[mod].name, [date]);\n\n dayOfTheWeek += 1;\n }\n for (\n let currentMonthDaysIterator = 1;\n currentMonthDaysIterator <= currentMonthDayCount;\n currentMonthDaysIterator++\n ) {\n const mod = dayOfTheWeek % 7;\n const day = new Date(this._calendarYear, this._calendarMonth, currentMonthDaysIterator);\n\n if (calendar.get(this.days[mod].name)) {\n calendar.get(this.days[mod].name)?.push(day);\n } else {\n calendar.set(this.days[mod].name, [day]);\n }\n dayOfTheWeek += 1;\n }\n\n const index = this._calendarDays.findIndex(day => day.value === dayOfTheWeek % 7);\n\n if (index !== 0) {\n for (\n let nextMonthDaysIterator = 1;\n nextMonthDaysIterator <= this._calendarDays.length - index;\n nextMonthDaysIterator++\n ) {\n const mod = dayOfTheWeek % 7;\n const date = new Date(this._calendarYear, this._calendarMonth + 1, nextMonthDaysIterator);\n\n calendar.get(this.days[mod].name)?.push(date);\n\n dayOfTheWeek += 1;\n }\n }\n return calendar;\n }\n\n updated(changedProperties: PropertyValues) {\n if (changedProperties.has(\"value\")) {\n const dates = formatToDateArray(this._value);\n\n if (!dates?.length) {\n this.handleClearSelectedDates();\n } else {\n dates?.forEach(date => {\n this.handleDate(date);\n });\n }\n }\n }\n\n renderCalendarHeader() {\n const showMonthSelected =\n this._calendarView === CALENDAR_VIEWS.MONTHS ? \"header-text-hover\" : \"\";\n const showYearSelected = this._calendarView === CALENDAR_VIEWS.YEARS ? \"header-text-hover\" : \"\";\n\n return html`\n <div class=\"calendar-header\">\n <bl-button\n class=\"arrow\"\n icon=\"arrow_left\"\n variant=\"tertiary\"\n kind=\"neutral\"\n @click=\"${() => this.setPreviousCalendarView()}\"\n ></bl-button>\n ${!this.monthYearOnly\n ? html`<bl-button\n variant=\"tertiary\"\n kind=\"neutral\"\n class=\"header-text ${showMonthSelected}\"\n @click=\"${() => this.setCurrentCalendarView(CALENDAR_VIEWS.MONTHS)}\"\n >${this.months[this._calendarMonth].name}\n </bl-button>`\n : html``}\n <bl-button\n variant=\"tertiary\"\n kind=\"neutral\"\n class=\"header-text ${showYearSelected}\"\n @click=\"${() => this.setCurrentCalendarView(CALENDAR_VIEWS.YEARS)}\"\n >${this._calendarYear}\n </bl-button>\n <bl-button\n class=\"arrow\"\n icon=\"arrow_right\"\n variant=\"tertiary\"\n kind=\"neutral\"\n @click=\"${() => this.setNextCalendarView()}\"\n ></bl-button>\n </div>\n `;\n }\n\n renderCalendarDays() {\n const calendarDays = this.createCalendarDays();\n const valuesArray = Array.from(calendarDays.values());\n\n return html` <div class=\"week-row\">\n ${[...calendarDays.keys()].map(key => {\n return html` <div class=\"calendar-text weekday-text\">${key}</div> `;\n })}\n </div>\n <div class=\"days-wrapper\">\n ${[...Array(valuesArray[0].length).keys()].map(key => {\n return html` <div class=\"week-row\">\n ${valuesArray.map(values => {\n const date = values[key];\n\n const isSelectedDay = this.checkIfSelectedDate(date);\n const isDayToday = this.checkIfDateIsToday(date);\n const isDisabledDay = this.checkIfDateIsDisabled(date);\n\n const classes = classMap({\n \"day\": true,\n \"calendar-text\": true,\n \"today-day\": isDayToday,\n \"selected-day\": isSelectedDay,\n \"other-month-day\": values[key].getMonth() !== this._calendarMonth,\n \"disabled-day\": isDisabledDay,\n });\n\n return html`<div class=\"day-wrapper\">\n <bl-button\n id=${date.getTime()}\n variant=\"tertiary\"\n kind=\"neutral\"\n size=\"small\"\n class=${classes}\n ?disabled=${isDisabledDay}\n @click=\"${() => !isDisabledDay && this.handleDate(date)}\"\n >\n ${this.dayRenderer ? this.dayRenderer(date) : date.getDate()}\n </bl-button>\n </div>`;\n })}\n </div>`;\n })}\n </div>`;\n }\n\n renderCalendarMonths() {\n return html` <div class=\"grid-content\">\n ${this.months.map((month, index) => {\n const variant = month.value === this._calendarMonth ? \"primary\" : \"tertiary\";\n const neutral = month.value === this._calendarMonth ? \"default\" : \"neutral\";\n\n return html` <bl-button\n variant=${variant}\n kind=${neutral}\n class=\"grid-item\"\n size=\"small\"\n @click=\"${() => this.setMonthAndCalendarView(index)}\"\n ><span class=\"calendar-text\">${month.name}</span></bl-button\n >`;\n })}\n </div>`;\n }\n\n renderCalendarYears() {\n this.generateSurroundingYears();\n return html` <div class=\"grid-content\">\n ${this._calendarYears.map(year => {\n const variant = year === this._calendarYear ? \"primary\" : \"tertiary\";\n const neutral = year === this._calendarYear ? \"default\" : \"neutral\";\n\n return html` <bl-button\n variant=${variant}\n kind=${neutral}\n class=\"grid-item\"\n @click=\"${() => this.setYearAndCalendarView(year)}\"\n ><span class=\"calendar-text\">${year}</span></bl-button\n >`;\n })}\n </div>`;\n }\n\n render() {\n return html`\n <div>\n <div class=\"calendar-content\">\n <div class=\"calendar\">\n ${this.renderCalendarHeader()}\n ${this._calendarView === CALENDAR_VIEWS.DAYS ? this.renderCalendarDays() : \"\"}\n ${this._calendarView === CALENDAR_VIEWS.MONTHS ? this.renderCalendarMonths() : \"\"}\n ${this._calendarView === CALENDAR_VIEWS.YEARS ? this.renderCalendarYears() : \"\"}\n </div>\n </div>\n </div>\n `;\n }\n}\n"],
|
|
5
|
-
"mappings": "mWAAO,SAASA,EAAkBC,EAA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Array", "value", "tempValue", "splitDates", "date", "isDate", "DatepickerCalendarMixin", "s", "disabledDates", "newVal", "stringToDateArray", "d", "maxDate", "minDate", "value", "oldValue", "__decorateClass", "e", "formatToDateArray", "value", "stringToDateArray", "styles", "i", "bl_calendar_default", "BlCalendar", "DatepickerCalendarMixin", "bl_calendar_default", "setDirectionProperty", "month", "day", "year", "fromYear", "_", "i", "view", "defaultView", "date", "_a", "isDateBeforeThanCalendar", "isDateAfterThanCalendar", "calendarDate", "_b", "_c", "d", "tempEndDate", "today", "disabledDate", "_d", "_e", "_f", "_g", "_h", "_i", "startDateParentElement", "endDateParentElement", "rangeDays", "element", "calendar", "currentMonthStartWeekDay", "lastMonthDaysCount", "previousMonthDayCount", "currentMonthDayCount", "dayOfTheWeek", "lastMonthDaysIterator", "mod", "currentMonthDaysIterator", "index", "nextMonthDaysIterator", "changedProperties", "dates", "formatToDateArray", "showMonthSelected", "showYearSelected", "x", "calendarDays", "valuesArray", "key", "values", "isSelectedDay", "isDayToday", "isDisabledDay", "classes", "o", "variant", "neutral", "__decorateClass", "t", "e", "event", "localized"]
|
|
7
|
-
}
|