@trendyol/baklava 3.4.0-beta.1 → 3.4.0-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (170) hide show
  1. package/dist/baklava-react.d.ts +2 -0
  2. package/dist/baklava-react.d.ts.map +1 -1
  3. package/dist/baklava-react.js +1 -1
  4. package/dist/baklava-react.js.map +2 -2
  5. package/dist/baklava.d.ts +1 -0
  6. package/dist/baklava.d.ts.map +1 -1
  7. package/dist/baklava.js +1 -1
  8. package/dist/{chunk-SBCJY5IU.js → chunk-23AVKNCC.js} +2 -2
  9. package/dist/chunk-2P3LD4HV.js +80 -0
  10. package/dist/chunk-2P3LD4HV.js.map +7 -0
  11. package/dist/{chunk-2IJL7HNY.js → chunk-2Q566BEQ.js} +25 -13
  12. package/dist/chunk-2Q566BEQ.js.map +7 -0
  13. package/dist/{chunk-5TPDRTCU.js → chunk-3MLXIDOD.js} +2 -2
  14. package/dist/{chunk-BH64QNLE.js → chunk-3OQA4BKQ.js} +2 -2
  15. package/dist/{chunk-JC4VETUE.js → chunk-3PA3PCTP.js} +2 -2
  16. package/dist/{chunk-GFBXJPT6.js → chunk-4BO66Y63.js} +7 -5
  17. package/dist/chunk-4BO66Y63.js.map +7 -0
  18. package/dist/{chunk-MWFGDECP.js → chunk-6XM52E7W.js} +2 -2
  19. package/dist/{chunk-GISZRI4I.js → chunk-7HEDOM2M.js} +2 -2
  20. package/dist/{chunk-WC5CTIZH.js → chunk-7KND5OUR.js} +2 -2
  21. package/dist/{chunk-DE3A37FL.js → chunk-BCRV6HG6.js} +2 -2
  22. package/dist/chunk-BWWXE4SL.js +2 -0
  23. package/dist/{chunk-MWG4TBH7.js → chunk-D7VPTSSK.js} +2 -2
  24. package/dist/{chunk-J5YZ4HBV.js → chunk-DPKNQOJX.js} +2 -2
  25. package/dist/{chunk-APLBTZ36.js → chunk-EXUCTLBU.js} +2 -2
  26. package/dist/chunk-FANRUDPK.js +5 -0
  27. package/dist/chunk-FANRUDPK.js.map +7 -0
  28. package/dist/{chunk-P5TOP3NH.js → chunk-FCOVZEHC.js} +2 -2
  29. package/dist/{chunk-IKYI4JCF.js → chunk-FS3MTRC3.js} +2 -2
  30. package/dist/{chunk-RER7OLAQ.js → chunk-H6EUN6QV.js} +2 -2
  31. package/dist/{chunk-ZLJF4SVG.js → chunk-HD7EU6S5.js} +2 -2
  32. package/dist/chunk-JN5BKKQZ.js +14 -0
  33. package/dist/chunk-JN5BKKQZ.js.map +7 -0
  34. package/dist/{chunk-ERL6CBPO.js → chunk-LCAPXVGE.js} +2 -2
  35. package/dist/{chunk-NXVLNG4L.js → chunk-LIUATY6B.js} +2 -2
  36. package/dist/{chunk-HSVSMABT.js → chunk-M54AQSC3.js} +2 -2
  37. package/dist/{chunk-5EAI6722.js → chunk-MUSNNPY5.js} +2 -2
  38. package/dist/{chunk-4UO3W4WP.js → chunk-NM74WWXQ.js} +2 -2
  39. package/dist/{chunk-4BLKAURK.js → chunk-NW7MDZJB.js} +2 -2
  40. package/dist/{chunk-EZJ3WW6Y.js → chunk-OTLTDVYZ.js} +2 -2
  41. package/dist/{chunk-ZE7GYACV.js → chunk-OYHUG47P.js} +2 -2
  42. package/dist/{chunk-H4WETBHJ.js → chunk-P4S537UY.js} +2 -2
  43. package/dist/{chunk-UOGCEUXK.js → chunk-RCHKJINV.js} +2 -2
  44. package/dist/{chunk-STZJ3LBU.js → chunk-UF5VCR36.js} +2 -2
  45. package/dist/{chunk-T5MEA7JO.js → chunk-UGRBWOQE.js} +2 -2
  46. package/dist/{chunk-QDYWH7BU.js → chunk-UK2ZEQBN.js} +2 -2
  47. package/dist/{chunk-QKII4FCI.js → chunk-UV7BOOVA.js} +2 -2
  48. package/dist/{chunk-QF4LGACD.js → chunk-WZBUJ4ER.js} +2 -2
  49. package/dist/chunk-XCSIJWLQ.js +2 -0
  50. package/dist/{chunk-DNSU2ZXO.js.map → chunk-XCSIJWLQ.js.map} +2 -2
  51. package/dist/{chunk-WPESQSKX.js → chunk-YH3MSMXL.js} +2 -2
  52. package/dist/{chunk-G4DOH6BQ.js → chunk-Z2AZS34W.js} +2 -2
  53. package/dist/components/accordion-group/accordion/bl-accordion.js +1 -1
  54. package/dist/components/accordion-group/bl-accordion-group.js +1 -1
  55. package/dist/components/alert/bl-alert.js +1 -1
  56. package/dist/components/badge/bl-badge.js +1 -1
  57. package/dist/components/button/bl-button.js +1 -1
  58. package/dist/components/calendar/bl-calendar.constant.js +1 -1
  59. package/dist/components/calendar/bl-calendar.d.ts +11 -6
  60. package/dist/components/calendar/bl-calendar.d.ts.map +1 -1
  61. package/dist/components/calendar/bl-calendar.js +1 -1
  62. package/dist/components/checkbox-group/bl-checkbox-group.js +1 -1
  63. package/dist/components/checkbox-group/checkbox/bl-checkbox.js +1 -1
  64. package/dist/components/datepicker/bl-datepicker.d.ts +5 -0
  65. package/dist/components/datepicker/bl-datepicker.d.ts.map +1 -1
  66. package/dist/components/datepicker/bl-datepicker.js +1 -1
  67. package/dist/components/dialog/bl-dialog.js +1 -1
  68. package/dist/components/dialog/bl-dialog.stories.js +1 -1
  69. package/dist/components/drawer/bl-drawer.js +1 -1
  70. package/dist/components/dropdown/bl-dropdown.js +1 -1
  71. package/dist/components/dropdown/group/bl-dropdown-group.js +1 -1
  72. package/dist/components/dropdown/item/bl-dropdown-item.js +1 -1
  73. package/dist/components/icon/bl-icon.js +1 -1
  74. package/dist/components/icon/icon-list.js +1 -1
  75. package/dist/components/input/bl-input.js +1 -1
  76. package/dist/components/notification/bl-notification.js +1 -1
  77. package/dist/components/notification/bl-notification.stories.js +1 -1
  78. package/dist/components/notification/card/bl-notification-card.js +1 -1
  79. package/dist/components/pagination/bl-pagination.js +1 -1
  80. package/dist/components/popover/bl-popover.js +1 -1
  81. package/dist/components/progress-indicator/bl-progress-indicator.js +1 -1
  82. package/dist/components/radio-group/bl-radio-group.js +1 -1
  83. package/dist/components/radio-group/radio/bl-radio.js +1 -1
  84. package/dist/components/select/bl-select.d.ts +1 -0
  85. package/dist/components/select/bl-select.d.ts.map +1 -1
  86. package/dist/components/select/bl-select.js +1 -1
  87. package/dist/components/select/option/bl-select-option.js +1 -1
  88. package/dist/components/spinner/bl-spinner.js +1 -1
  89. package/dist/components/split-button/bl-split-button.js +1 -1
  90. package/dist/components/switch/bl-switch.js +1 -1
  91. package/dist/components/tab-group/bl-tab-group.js +1 -1
  92. package/dist/components/tab-group/tab/bl-tab.js +1 -1
  93. package/dist/components/tab-group/tab-panel/bl-tab-panel.js +1 -1
  94. package/dist/components/table/bl-table.js +1 -1
  95. package/dist/components/table/table-body/bl-table-body.d.ts +5 -1
  96. package/dist/components/table/table-body/bl-table-body.d.ts.map +1 -1
  97. package/dist/components/table/table-body/bl-table-body.js +1 -1
  98. package/dist/components/table/table-cell/bl-table-cell.js +1 -1
  99. package/dist/components/table/table-header/bl-table-header.js +1 -1
  100. package/dist/components/table/table-header-cell/bl-table-header-cell.js +1 -1
  101. package/dist/components/table/table-row/bl-table-row.js +1 -1
  102. package/dist/components/tag/bl-tag.js +1 -1
  103. package/dist/components/textarea/bl-textarea.js +1 -1
  104. package/dist/components/tooltip/bl-tooltip.js +1 -1
  105. package/dist/custom-elements.json +7 -1
  106. package/dist/generated/locale-codes.d.ts +2 -2
  107. package/dist/generated/locale-codes.d.ts.map +1 -1
  108. package/dist/generated/locale-codes.js +1 -1
  109. package/dist/generated/locales/ar.d.ts +14 -0
  110. package/dist/generated/locales/ar.d.ts.map +1 -0
  111. package/dist/generated/locales/ar.js +2 -0
  112. package/dist/generated/locales/ar.js.map +7 -0
  113. package/dist/generated/locales/ro.d.ts +14 -0
  114. package/dist/generated/locales/ro.d.ts.map +1 -0
  115. package/dist/generated/locales/ro.js +2 -0
  116. package/dist/generated/locales/ro.js.map +7 -0
  117. package/dist/generated/locales/tr.d.ts +4 -0
  118. package/dist/generated/locales/tr.d.ts.map +1 -1
  119. package/dist/generated/locales/tr.js +1 -1
  120. package/dist/generated/locales/tr.js.map +4 -4
  121. package/dist/localization.d.ts +2 -1
  122. package/dist/localization.d.ts.map +1 -1
  123. package/dist/localization.js +1 -1
  124. package/dist/localization.js.map +3 -3
  125. package/package.json +4 -4
  126. package/dist/chunk-2IJL7HNY.js.map +0 -7
  127. package/dist/chunk-7F6RR2JV.js +0 -2
  128. package/dist/chunk-7F6RR2JV.js.map +0 -7
  129. package/dist/chunk-DNSU2ZXO.js +0 -2
  130. package/dist/chunk-GFBXJPT6.js.map +0 -7
  131. package/dist/chunk-HYBPEELZ.js +0 -5
  132. package/dist/chunk-HYBPEELZ.js.map +0 -7
  133. package/dist/chunk-IZ2LK5GK.js +0 -2
  134. package/dist/chunk-OTAAXK2L.js +0 -84
  135. package/dist/chunk-OTAAXK2L.js.map +0 -7
  136. package/dist/chunk-Y2Q465TD.js +0 -2
  137. package/dist/chunk-Y2Q465TD.js.map +0 -7
  138. /package/dist/{chunk-SBCJY5IU.js.map → chunk-23AVKNCC.js.map} +0 -0
  139. /package/dist/{chunk-5TPDRTCU.js.map → chunk-3MLXIDOD.js.map} +0 -0
  140. /package/dist/{chunk-BH64QNLE.js.map → chunk-3OQA4BKQ.js.map} +0 -0
  141. /package/dist/{chunk-JC4VETUE.js.map → chunk-3PA3PCTP.js.map} +0 -0
  142. /package/dist/{chunk-MWFGDECP.js.map → chunk-6XM52E7W.js.map} +0 -0
  143. /package/dist/{chunk-GISZRI4I.js.map → chunk-7HEDOM2M.js.map} +0 -0
  144. /package/dist/{chunk-WC5CTIZH.js.map → chunk-7KND5OUR.js.map} +0 -0
  145. /package/dist/{chunk-DE3A37FL.js.map → chunk-BCRV6HG6.js.map} +0 -0
  146. /package/dist/{chunk-IZ2LK5GK.js.map → chunk-BWWXE4SL.js.map} +0 -0
  147. /package/dist/{chunk-MWG4TBH7.js.map → chunk-D7VPTSSK.js.map} +0 -0
  148. /package/dist/{chunk-J5YZ4HBV.js.map → chunk-DPKNQOJX.js.map} +0 -0
  149. /package/dist/{chunk-APLBTZ36.js.map → chunk-EXUCTLBU.js.map} +0 -0
  150. /package/dist/{chunk-P5TOP3NH.js.map → chunk-FCOVZEHC.js.map} +0 -0
  151. /package/dist/{chunk-IKYI4JCF.js.map → chunk-FS3MTRC3.js.map} +0 -0
  152. /package/dist/{chunk-RER7OLAQ.js.map → chunk-H6EUN6QV.js.map} +0 -0
  153. /package/dist/{chunk-ZLJF4SVG.js.map → chunk-HD7EU6S5.js.map} +0 -0
  154. /package/dist/{chunk-ERL6CBPO.js.map → chunk-LCAPXVGE.js.map} +0 -0
  155. /package/dist/{chunk-NXVLNG4L.js.map → chunk-LIUATY6B.js.map} +0 -0
  156. /package/dist/{chunk-HSVSMABT.js.map → chunk-M54AQSC3.js.map} +0 -0
  157. /package/dist/{chunk-5EAI6722.js.map → chunk-MUSNNPY5.js.map} +0 -0
  158. /package/dist/{chunk-4UO3W4WP.js.map → chunk-NM74WWXQ.js.map} +0 -0
  159. /package/dist/{chunk-4BLKAURK.js.map → chunk-NW7MDZJB.js.map} +0 -0
  160. /package/dist/{chunk-EZJ3WW6Y.js.map → chunk-OTLTDVYZ.js.map} +0 -0
  161. /package/dist/{chunk-ZE7GYACV.js.map → chunk-OYHUG47P.js.map} +0 -0
  162. /package/dist/{chunk-H4WETBHJ.js.map → chunk-P4S537UY.js.map} +0 -0
  163. /package/dist/{chunk-UOGCEUXK.js.map → chunk-RCHKJINV.js.map} +0 -0
  164. /package/dist/{chunk-STZJ3LBU.js.map → chunk-UF5VCR36.js.map} +0 -0
  165. /package/dist/{chunk-T5MEA7JO.js.map → chunk-UGRBWOQE.js.map} +0 -0
  166. /package/dist/{chunk-QDYWH7BU.js.map → chunk-UK2ZEQBN.js.map} +0 -0
  167. /package/dist/{chunk-QKII4FCI.js.map → chunk-UV7BOOVA.js.map} +0 -0
  168. /package/dist/{chunk-QF4LGACD.js.map → chunk-WZBUJ4ER.js.map} +0 -0
  169. /package/dist/{chunk-WPESQSKX.js.map → chunk-YH3MSMXL.js.map} +0 -0
  170. /package/dist/{chunk-G4DOH6BQ.js.map → chunk-Z2AZS34W.js.map} +0 -0
@@ -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 * 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[]): Date[] {\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\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) {\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) {\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 this._calendarView = this._calendarView !== view ? view : CALENDAR_VIEWS.DAYS;\n this.setHoverClass();\n }\n\n setMonthAndCalendarView(month: number) {\n this._calendarMonth = month;\n this._calendarView = CALENDAR_VIEWS.DAYS;\n if (this.type === CALENDAR_TYPES.RANGE) this.setHoverClass();\n }\n\n setYearAndCalendarView(year: number) {\n this._calendarYear = year;\n this._calendarView = 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 <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 <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,KA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;AAAA,cACzE,KAAK,yBAA0C,KAAK,qBAAqB,EAAI;AAAA,cAC7E,KAAK,wBAAyC,KAAK,oBAAoB,EAAI;AAAA;AAAA;AAAA;AAAA,KAKvF,CACF,EA1eEY,EAAA,CADCC,EAAM,GADY7D,EAEnB,qBAEA4D,EAAA,CADCC,EAAM,GAHY7D,EAInB,8BAEA4D,EAAA,CADCC,EAAM,GALY7D,EAMnB,6BAEA4D,EAAA,CADCC,EAAM,GAPY7D,EAQnB,6BAEA4D,EAAA,CADCC,EAAM,GATY7D,EAUnB,8BAEA4D,EAAA,CADCC,EAAM,GAXY7D,EAYnB,6BAEA4D,EAAA,CADCC,EAAM,GAbY7D,EAcnB,sBAOA4D,EAAA,CADCE,EAAS,CAAE,UAAW,EAAM,CAAC,GApBX9D,EAqBnB,2BAK6B4D,EAAA,CAA5BG,EAAM,oBAAoB,GA1BR/D,EA0BU,mCA1BVA,EAArB4D,EAAA,CAFCE,EAAc,aAAa,EAC3BE,EAAU,GACUhE",
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", "_a", "date", "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
+ }
@@ -1,4 +1,4 @@
1
- import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as $}from"./chunk-EG7U7PM3.js";import{a as k}from"./chunk-XDUIVR6I.js";import{a as f}from"./chunk-6LT7O7T2.js";import{a as z,c as b}from"./chunk-HBPBDC7T.js";import{a as y}from"./chunk-ECPWEUBG.js";import{a as x}from"./chunk-DINNT5P2.js";import{a as m}from"./chunk-GRL4DWKG.js";import{a as T,b as a,c as h,e as v,f as S}from"./chunk-5MOOXA2X.js";import{a as w,b as d,f as g}from"./chunk-4OT5AMS5.js";import{d as o}from"./chunk-IZ2LK5GK.js";var R=w`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-neutral-full);--border-color:var(--bl-color-neutral-lighter);--border-focus-color:var(--bl-color-primary-highlight);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--label-color:var(--bl-color-neutral-dark);--placeholder-color:var(--bl-color-neutral-light);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-neutral-lightest);--menu-height:250px;--popover-position:var(--bl-popover-position, fixed)}:host([multiple][view-select-all]) .select-wrapper{--menu-height:290px}:host([size=large]) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size=small]) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-neutral-light)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-highlight);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);-webkit-user-select:none;user-select:none;margin:0;width:auto;min-width:100%}.label,.placeholder{color:var(--placeholder-color);padding-inline-start:var(--label-padding);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.select-wrapper.selected .placeholder,:host(:not([placeholder])) .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}:host(:not([label])) .label,:host([label-fixed]) .label{display:none}.remove-all{display:none}.selected .remove-all{display:block}:host([disabled]) .remove-all,:host([disabled]) .remove-all::after{display:none}.dropdown-icon{font-size:var(--bl-font-size-m)}.dropdown-icon.open{display:none}.select-open .dropdown-icon.open{display:inline-block}.select-open .dropdown-icon.closed{display:none}.selected .dropdown-icon{--icon-color:var(--bl-color-neutral-darker)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-neutral-light)}.select-input:focus-visible,.select-open .select-input{border:solid 1px var(--border-focus-color);outline:0}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;padding-inline-start:var(--label-padding);margin:0;list-style:none;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([disabled]) .select-input .selected-options{color:var(--bl-color-neutral-light)}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}.selected-options li:not(:last-child)::after{content:", "}.select-input:not(.has-overflowed-options) .additional-selection-count{display:none}:host([disabled]) .additional-selection-count{color:var(--bl-color-neutral-light)}:host([disabled]) .selected-options li{color:var(--bl-color-neutral-light)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-4xs);margin-inline-start:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:var(--popover-position);border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--bl-index-popover);width:100%;top:var(--top);left:var(--left)}:host(:empty) .popover{display:none}.popover-no-result{display:flex;flex-direction:column;gap:var(--bl-size-2xs);align-items:center;justify-content:center;height:80px}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}label,legend{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;display:block;top:var(--padding-vertical);left:var(--padding-horizontal);inset-inline-end:calc(var(--bl-size-2xs) + var(--bl-size-m) + var(--bl-size-2xs));transition:.1s ease-in;pointer-events:none;opacity:0;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color)}legend{height:0;visibility:hidden;display:none}legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:host(:not([placeholder])) .selected .label,:host([placeholder]) :where(.select-open,.selected) .label{display:none}:where(.select-open,.selected) label{top:0;transform:translateY(-50%);font:var(--bl-font-caption);color:var(--label-color);pointer-events:initial;right:var(--padding-horizontal);opacity:1}:host([label]) :where(.select-open,.selected) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host([label-fixed]) label{position:static;padding:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--label-color);opacity:1}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.error-icon,.invalid-text{display:none}.dirty.invalid label,.error-icon,.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}.dirty.invalid .hint,:host([help-text]) .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.select-all{position:sticky;top:0;padding:var(--bl-size-xs) 0;background:var(--background-color);z-index:1;font:var(--bl-font-title-3-regular);box-shadow:10px 0 0 var(--background-color),-10px 0 0 var(--background-color)}.select-all::after{position:absolute;content:"";width:100%;bottom:0;border-bottom:1px solid var(--bl-color-neutral-lighter)}.search-bar-input{font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--text-color);border:none;outline:0;background-color:transparent;width:100%;height:100%;padding:0;margin:0;box-sizing:border-box}.search-bar-input::placeholder{color:var(--placeholder-color)}.search-bar-input:focus-visible{outline:0}.search-spinner{padding-inline-end:var(--bl-font-size-2xs)}.action-divider{display:none}.select-wrapper .action-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}.actions bl-icon{padding:4px}`,P=R;var A,i=class extends k(g){constructor(){super(...arguments);this.size="medium";this.required=!1;this.disabled=!1;this.clearable=!1;this.multiple=!1;this.autofocus=!1;this.labelFixed=!1;this.viewSelectAll=!1;this.searchBar=!1;this.searchBarLoadingState=!1;this._isPopoverOpen=!1;this._additionalSelectedOptionCount=0;this._searchText="";this.userLang=((A=document.querySelector("html"))==null?void 0:A.getAttribute("lang"))||navigator.language;this._connectedOptions=[];this._cleanUpPopover=null;this._selectedOptions=[];this.dirty=!1;this._interactOutsideHandler=e=>{var l;let t=e.composedPath();(l=t==null?void 0:t.find(s=>s.tagName==="BL-SELECT"))!=null&&l.contains(this)||this.close()};this.focusedOptionIndex=-1;this.lastKeyPressedTime=0;this.typedCharacters="";this.keyPressThreshold=500}static get styles(){return[P]}get value(){return this._value}set value(e){if(this._value=e,Array.isArray(e)){let t=new FormData;e.forEach(l=>t.append(this.name,`${l}`)),this.setValue(t)}else this.setValue(e);this.setOptionsSelected()}shouldFormValueUpdate(){return this.value!==null&&this.value!==""}setOptionsSelected(){this._connectedOptions.forEach(e=>e.selected=this.value===e.value||Array.isArray(this.value)&&this.value.includes(e.value)),this._selectedOptions=[...this.options.filter(e=>e.selected)]}get options(){return this._connectedOptions}get opened(){return this._isPopoverOpen}get noResultFound(){return this._searchText!==""&&this._connectedOptions.every(e=>e.hidden)}get selectedOptions(){return this._selectedOptions}get additionalSelectedOptionCount(){return this._additionalSelectedOptionCount}validityCallback(){if(this.customInvalidText)return this.customInvalidText;let e=document.createElement("select");return e.required=this.required,e.validationMessage}reportValidity(){return this.dirty=!0,this.checkValidity()}resetFormControl(){this.value=this._initialValue}open(){this.searchBar&&setTimeout(()=>{var e,t,l;(l=(t=(e=document.activeElement)==null?void 0:e.shadowRoot)==null?void 0:t.querySelector("input"))==null||l.focus()},100),this._isPopoverOpen=!0,this._setupPopover(),document.addEventListener("click",this._interactOutsideHandler,!0),document.addEventListener("focus",this._interactOutsideHandler,!0)}close(){this._handleSearchOptions({target:{value:""}}),this._isPopoverOpen=!1,this.focusedOptionIndex=-1,this._cleanUpPopover&&this._cleanUpPopover(),document.removeEventListener("click",this._interactOutsideHandler,!0),document.removeEventListener("focus",this._interactOutsideHandler,!0)}_setupPopover(){this._cleanUpPopover=V(this._selectInput,this._popover,()=>{L(this._selectInput,this._popover,{placement:"bottom",strategy:"fixed",middleware:[C(),E(8),I({apply(e){Object.assign(e.elements.floating.style,{width:`${e.elements.reference.getBoundingClientRect().width}px`})}})]}).then(({x:e,y:t})=>{this._popover.style.setProperty("--left",`${e}px`),this._popover.style.setProperty("--top",`${t}px`)})})}connectedCallback(){var e;super.connectedCallback(),(e=this.form)==null||e.addEventListener("submit",t=>{this.reportValidity()||t.preventDefault()})}disconnectedCallback(){super.disconnectedCallback(),this._cleanUpPopover&&this._cleanUpPopover()}inputTemplate(){var O;let e=d`<ul class="selected-options">
1
+ import{a as y}from"./chunk-ECPWEUBG.js";import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as $}from"./chunk-EG7U7PM3.js";import{a as k}from"./chunk-XDUIVR6I.js";import{a as f}from"./chunk-6LT7O7T2.js";import{a as x}from"./chunk-DINNT5P2.js";import{a as m}from"./chunk-GRL4DWKG.js";import{a as z,c as h}from"./chunk-HBPBDC7T.js";import{a as T,b as a,c as u,e as b,f as S}from"./chunk-5MOOXA2X.js";import{a as w,b as d,f as g}from"./chunk-4OT5AMS5.js";import{d as o}from"./chunk-BWWXE4SL.js";var R=w`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-neutral-full);--border-color:var(--bl-color-neutral-lighter);--border-focus-color:var(--bl-color-primary-highlight);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--label-color:var(--bl-color-neutral-dark);--placeholder-color:var(--bl-color-neutral-light);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-neutral-lightest);--menu-height:250px;--popover-position:var(--bl-popover-position, fixed)}:host([multiple][view-select-all]) .select-wrapper{--menu-height:290px}:host([size=large]) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size=small]) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-neutral-light)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-highlight);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);-webkit-user-select:none;user-select:none;margin:0;width:auto;min-width:100%}.label,.placeholder{color:var(--placeholder-color);padding-inline-start:var(--label-padding);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.select-wrapper.selected .placeholder,:host(:not([placeholder])) .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}:host(:not([label])) .label,:host([label-fixed]) .label{display:none}.remove-all{display:none}.selected .remove-all{display:block}:host([disabled]) .remove-all,:host([disabled]) .remove-all::after{display:none}.dropdown-icon{font-size:var(--bl-font-size-m)}.dropdown-icon.open{display:none}.select-open .dropdown-icon.open{display:inline-block}.select-open .dropdown-icon.closed{display:none}.selected .dropdown-icon{--icon-color:var(--bl-color-neutral-darker)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-neutral-light)}.select-input:focus-visible,.select-open .select-input{border:solid 1px var(--border-focus-color);outline:0}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;padding-inline-start:var(--label-padding);margin:0;list-style:none;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([disabled]) .select-input .selected-options{color:var(--bl-color-neutral-light)}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}.selected-options li:not(:last-child)::after{content:", "}.select-input:not(.has-overflowed-options) .additional-selection-count{display:none}:host([disabled]) .additional-selection-count{color:var(--bl-color-neutral-light)}:host([disabled]) .selected-options li{color:var(--bl-color-neutral-light)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-4xs);margin-inline-start:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:var(--popover-position);border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--bl-index-popover);width:100%;top:var(--top);left:var(--left)}:host(:empty) .popover{display:none}.popover-no-result{display:flex;flex-direction:column;gap:var(--bl-size-2xs);align-items:center;justify-content:center;height:80px}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}label,legend{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;display:block;top:var(--padding-vertical);left:var(--padding-horizontal);inset-inline-end:calc(var(--bl-size-2xs) + var(--bl-size-m) + var(--bl-size-2xs));transition:.1s ease-in;pointer-events:none;opacity:0;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color)}legend{height:0;visibility:hidden;display:none}legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:host(:not([placeholder])) .selected .label,:host([placeholder]) :where(.select-open,.selected) .label{display:none}:where(.select-open,.selected) label{top:0;transform:translateY(-50%);font:var(--bl-font-caption);color:var(--label-color);pointer-events:initial;right:var(--padding-horizontal);opacity:1}:host([label]) :where(.select-open,.selected) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host([label-fixed]) label{position:static;padding:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--label-color);opacity:1}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.error-icon,.invalid-text{display:none}.dirty.invalid label,.error-icon,.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}.dirty.invalid .hint,:host([help-text]) .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.select-all{position:sticky;top:0;padding:var(--bl-size-xs) 0;background:var(--background-color);z-index:1;font:var(--bl-font-title-3-regular);box-shadow:10px 0 0 var(--background-color),-10px 0 0 var(--background-color)}.select-all::after{position:absolute;content:"";width:100%;bottom:0;border-bottom:1px solid var(--bl-color-neutral-lighter)}.search-bar-input{font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--text-color);border:none;outline:0;background-color:transparent;width:100%;height:100%;padding:0;margin:0;box-sizing:border-box}.search-bar-input::placeholder{color:var(--placeholder-color)}.search-bar-input:focus-visible{outline:0}.search-spinner{padding-inline-end:var(--bl-font-size-2xs)}.action-divider{display:none}.select-wrapper .action-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}.actions bl-icon{padding:4px}`,P=R;var A,i=class extends k(g){constructor(){super(...arguments);this.size="medium";this.required=!1;this.disabled=!1;this.clearable=!1;this.multiple=!1;this.autofocus=!1;this.labelFixed=!1;this.viewSelectAll=!1;this.searchBar=!1;this.searchBarLoadingState=!1;this._isPopoverOpen=!1;this._additionalSelectedOptionCount=0;this._searchText="";this.userLang=((A=document.querySelector("html"))==null?void 0:A.getAttribute("lang"))||navigator.language;this._connectedOptions=[];this._cleanUpPopover=null;this._selectedOptions=[];this.dirty=!1;this._interactOutsideHandler=e=>{var l;let t=e.composedPath();(l=t==null?void 0:t.find(s=>s.tagName==="BL-SELECT"))!=null&&l.contains(this)||this.close()};this.focusedOptionIndex=-1;this.lastKeyPressedTime=0;this.typedCharacters="";this.keyPressThreshold=500}static get styles(){return[P]}get value(){return this._value}set value(e){if(this._value=e,Array.isArray(e)){let t=new FormData;e.forEach(l=>t.append(this.name,`${l}`)),this.setValue(t)}else this.setValue(e);this.setOptionsSelected()}shouldFormValueUpdate(){return this.value!==null&&this.value!==""}setOptionsSelected(){this._connectedOptions.forEach(e=>e.selected=this.value===e.value||Array.isArray(this.value)&&this.value.includes(e.value)),this._selectedOptions=[...this.options.filter(e=>e.selected)]}get options(){return this._connectedOptions}get opened(){return this._isPopoverOpen}get noResultFound(){return this._searchText!==""&&this._connectedOptions.every(e=>e.hidden)}get selectedOptions(){return this._selectedOptions}get additionalSelectedOptionCount(){return this._additionalSelectedOptionCount}validityCallback(){if(this.customInvalidText)return this.customInvalidText;let e=document.createElement("select");return e.required=this.required,e.validationMessage}reportValidity(){return this.dirty=!0,this.checkValidity()}resetFormControl(){this.value=this._initialValue}open(){this.searchBar&&setTimeout(()=>{var e,t,l;(l=(t=(e=document.activeElement)==null?void 0:e.shadowRoot)==null?void 0:t.querySelector("input"))==null||l.focus()},100),this._isPopoverOpen=!0,this._setupPopover(),document.addEventListener("click",this._interactOutsideHandler,!0),document.addEventListener("focus",this._interactOutsideHandler,!0)}close(){this._handleSearchOptions({target:{value:""}}),this._isPopoverOpen=!1,this.focusedOptionIndex=-1,this._cleanUpPopover&&this._cleanUpPopover(),document.removeEventListener("click",this._interactOutsideHandler,!0),document.removeEventListener("focus",this._interactOutsideHandler,!0)}_setupPopover(){this._cleanUpPopover=V(this._selectInput,this._popover,()=>{L(this._selectInput,this._popover,{placement:"bottom",strategy:"fixed",middleware:[C(),E(8),I({apply(e){Object.assign(e.elements.floating.style,{width:`${e.elements.reference.getBoundingClientRect().width}px`})}})]}).then(({x:e,y:t})=>{this._popover.style.setProperty("--left",`${e}px`),this._popover.style.setProperty("--top",`${t}px`)})})}_handleToggleButtonClick(e){e.stopPropagation(),this._togglePopover()}connectedCallback(){var e;super.connectedCallback(),(e=this.form)==null||e.addEventListener("submit",t=>{this.reportValidity()||t.preventDefault()})}disconnectedCallback(){super.disconnectedCallback(),this._cleanUpPopover&&this._cleanUpPopover()}inputTemplate(){var O;let e=d`<ul class="selected-options">
2
2
  ${this._selectedOptions.map(p=>d`<li>${p.getAttribute("label")||p.textContent}</li>`)}
3
3
  </ul>`,l=!(this._selectedOptions.length>0&&this._selectedOptions.every(p=>p.disabled))&&(this.clearable||this.multiple),s=l?d`<bl-button
4
4
  class="remove-all"
@@ -7,7 +7,7 @@ import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as
7
7
  kind="neutral"
8
8
  icon="close"
9
9
  @click=${this._onClickRemove}
10
- ></bl-button>`:"",n=this.searchBar&&this.opened,c=this._selectedOptions.length>0,r=n||c&&l,u=(O=this.searchBarPlaceholder)!=null?O:b("Search",{desc:"bl-select: search placeholder text"}),M=d`<bl-icon
10
+ ></bl-button>`:"",n=this.searchBar&&this.opened,c=this._selectedOptions.length>0,r=n||c&&l,v=(O=this.searchBarPlaceholder)!=null?O:h("Search",{desc:"bl-select: search placeholder text"}),M=d`<bl-icon
11
11
  class="search-mag-icon"
12
12
  name="search"
13
13
  style="color: var(--bl-color-primary);font-size: var(--bl-font-size-s)"
@@ -26,7 +26,7 @@ import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as
26
26
  ${this._selectedOptions.length>0&&!this.opened?e:d`
27
27
  <input
28
28
  class="search-bar-input"
29
- placeholder=${this.opened||this.labelFixed?u:this.label||u}
29
+ placeholder=${this.opened||this.labelFixed?v:this.label||v}
30
30
  @input=${this._handleSearchOptions}
31
31
  @keydown=${p=>{p.code==="Space"&&p.stopPropagation()}}
32
32
  .value=${this._searchText}
@@ -39,12 +39,24 @@ import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as
39
39
  <div class="actions">
40
40
  ${this.opened?this.searchBarLoadingState?D:M:""}
41
41
  ${this.opened?"":s} ${_}
42
-
43
- <div @click=${this._togglePopover}>
44
- <bl-icon class="dropdown-icon open" name="arrow_up"></bl-icon>
45
-
46
- <bl-icon class="dropdown-icon closed" name="arrow_down"></bl-icon>
47
- </div>
42
+ <bl-button
43
+ class="dropdown-icon open"
44
+ variant="tertiary"
45
+ kind="neutral"
46
+ size="small"
47
+ icon="arrow_up"
48
+ @click=${this._handleToggleButtonClick}
49
+ aria-label="${h("Close dropdown",{desc:"bl-select: close dropdown button"})}"
50
+ ></bl-button>
51
+ <bl-button
52
+ class="closed dropdown-icon"
53
+ variant="tertiary"
54
+ kind="neutral"
55
+ size="small"
56
+ icon="arrow_down"
57
+ @click=${this._handleToggleButtonClick}
58
+ aria-label="${h("Open dropdown",{desc:"bl-select: open dropdown button"})}"
59
+ ></bl-button>
48
60
  </div>
49
61
  </fieldset>`;return this.searchBar?F:d`<fieldset
50
62
  class=${f({"select-input":!0,"has-overflowed-options":this._additionalSelectedOptionCount>0})}
@@ -67,7 +79,7 @@ import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as
67
79
 
68
80
  <bl-icon class="dropdown-icon closed" name="arrow_down"></bl-icon>
69
81
  </div>
70
- </fieldset>`}selectAllTemplate(){var s;if(!this.multiple||!this.viewSelectAll||this.noResultFound)return null;let e=this._connectedOptions.filter(n=>!n.hidden).every(n=>n.selected),t=this._selectedOptions.filter(n=>!n.hidden).length>0,l=(s=this.selectAllText)!=null?s:b("Select All",{desc:"bl-select: select all text"});return d`<bl-checkbox
82
+ </fieldset>`}selectAllTemplate(){var s;if(!this.multiple||!this.viewSelectAll||this.noResultFound)return null;let e=this._connectedOptions.filter(n=>!n.hidden).every(n=>n.selected),t=this._selectedOptions.filter(n=>!n.hidden).length>0,l=(s=this.selectAllText)!=null?s:h("Select All",{desc:"bl-select: select all text"});return d`<bl-checkbox
71
83
  class="select-all"
72
84
  .checked="${e}"
73
85
  .indeterminate="${t&&!e}"
@@ -78,7 +90,7 @@ import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as
78
90
  ${l}
79
91
  </bl-checkbox>`}render(){var c,r;let e=this.checkValidity()?"":d`<p id="errorMessage" aria-live="polite" class="invalid-text">
80
92
  ${this.validationMessage}
81
- </p>`,t=this.helpText?d`<p class="help-text">${this.helpText}</p>`:"",l=this.label?d`<label id="label">${this.label}</label>`:"",s=(c=this.searchNotFoundText)!=null?c:b("No Data Found",{desc:"bl-select: search no data text"}),n=(r=this.popoverClearSearchText)!=null?r:b("Clear Search",{desc:"bl-select: clear search button text"});return d`<div
93
+ </p>`,t=this.helpText?d`<p class="help-text">${this.helpText}</p>`:"",l=this.label?d`<label id="label">${this.label}</label>`:"",s=(c=this.searchNotFoundText)!=null?c:h("No Data Found",{desc:"bl-select: search no data text"}),n=(r=this.popoverClearSearchText)!=null?r:h("Clear Search",{desc:"bl-select: clear search button text"});return d`<div
82
94
  class=${f({"select-wrapper":!0,"select-open":this.opened,selected:this._selectedOptions.length>0,invalid:!this.validity.valid,dirty:this.dirty})}
83
95
  @keydown=${this.handleKeydown}
84
96
  >
@@ -103,5 +115,5 @@ import{b as C,d as E,f as I,g as V,h as L}from"./chunk-EZSEQHRH.js";import{a as
103
115
  </div>`:""}
104
116
  </div>
105
117
  <div class="hint">${e} ${t}</div>
106
- </div> `}handleFocusOptionByKey(e){let t=Date.now();t-this.lastKeyPressedTime>this.keyPressThreshold&&(this.typedCharacters=""),this.lastKeyPressedTime=t,this.typedCharacters+=e.toLowerCase();let s=this.options.findIndex(n=>n.disabled?!1:n.innerText.trim().toLowerCase().startsWith(this.typedCharacters));s!==-1&&(this.focusedOptionIndex=s,this.options[s].focus())}handleKeydown(e){if(this.focusedOptionIndex===-1&&["Enter","Space"].includes(e.code))this._togglePopover(),e.preventDefault();else if(this._isPopoverOpen===!1&&["ArrowDown","ArrowUp"].includes(e.code))this.open(),e.preventDefault();else if(e.code==="Escape")this.close(),e.preventDefault();else if(this._isPopoverOpen&&["ArrowDown","ArrowUp"].includes(e.code)){let t=this.options.filter(l=>!l.disabled);e.code==="ArrowDown"&&this.focusedOptionIndex++,e.code==="ArrowUp"&&this.focusedOptionIndex--,this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,t.length-1)),t[this.focusedOptionIndex].focus(),e.preventDefault()}else this._isPopoverOpen&&!this.searchBar&&this.handleFocusOptionByKey(e.key)}_togglePopover(){this._isPopoverOpen?this.close():this.open()}_handleSelectEvent(){let e=this._selectedOptions.map(t=>({value:t.value,selected:t.selected,text:t.textContent}));this.multiple?this._onBlSelect(e):this._onBlSelect(e[0])}_handleSearchEvent(){this._onBlSearch(this._searchText)}_handleSearchOptions(e){this.searchBar&&(this._searchText=e.target.value,this._handleSearchEvent(),this._connectedOptions.forEach(t=>{let l=this._searchText.toLowerCase(),s="";if(t.textContent)try{s=t.textContent.toLocaleLowerCase(this.userLang)}catch{s=t.textContent.toLowerCase()}let n=s.includes(l);t.hidden=!n}),this._selectedOptions=this.options.filter(t=>t.selected),this._handleLastVisibleSearchedOption(),this.requestUpdate())}_handleLastVisibleSearchedOption(){var t,l;let e=[...this.options].reverse().find(s=>!s.hidden);e&&((l=(t=e==null?void 0:e.shadowRoot)==null?void 0:t.querySelector("div"))==null||l.classList.add("no-border-bottom")),this.options.map(s=>{var n,c;!s.hidden&&s!==e&&((c=(n=s.shadowRoot)==null?void 0:n.querySelector("div"))==null||c.classList.remove("no-border-bottom"))})}_handleSingleSelect(e){this.value=e.value,this._searchText="",this._handleSelectEvent(),this.close()}_handleMultipleSelect(){this.value=this._connectedOptions.filter(e=>e.selected).map(e=>e.value),this._handleSelectEvent()}_handleSelectOptionEvent(e){let t=e.target;this.dirty=!0,this.multiple?this._handleMultipleSelect():this._handleSingleSelect(t)}_handleSelectAll(e){var c;let t=(c=this.shadowRoot)==null?void 0:c.querySelector(".select-all"),l=e.detail,n=this._connectedOptions.filter(r=>!r.selected&&!r.hidden).every(r=>r.disabled);if(l&&n){setTimeout(()=>{var u;let r=(u=t==null?void 0:t.shadowRoot)==null?void 0:u.querySelector("input");r==null||r.click()},0);return}this._connectedOptions.forEach(r=>{r.disabled||r.hidden||(r.selected=l)}),this._handleMultipleSelect()}_onClickRemove(e){e.stopPropagation(),this._searchText="";let t=this._selectedOptions.filter(l=>l.disabled);this._connectedOptions.filter(l=>!l.disabled&&l.selected).forEach(l=>{l.selected=!1}),this.value=t.length?t.map(l=>l.value):null,this._handleSelectEvent()}_checkAdditionalItemCount(){if(!this.multiple||!this.selectedOptionsItems||this.selectedOptionsItems.length<2){this._additionalSelectedOptionCount=0;return}let e=[...this.selectedOptionsItems].findIndex(t=>t.offsetLeft>this.selectedOptionsContainer.offsetWidth);e>-1?this._additionalSelectedOptionCount=this.selectedOptionsItems.length-e:this._additionalSelectedOptionCount=0}firstUpdated(){this.value===void 0&&(this.multiple?this.value=[]:this.value=null),this._initialValue=this._value}updated(e){e.has("multiple")&&typeof e.get("multiple")=="boolean"&&(this.value=null),e.has("_selectedOptions")&&this._checkAdditionalItemCount()}registerOption(e){this._connectedOptions.push(e),e.selected&&(this.multiple?(Array.isArray(this.value)||(this.value=[]),this.value=[...this.value,e.value]):this.value=e.value),this.setOptionsSelected(),this.requestUpdate()}unregisterOption(e){this._connectedOptions.splice(this._connectedOptions.indexOf(e),1)}};i.shadowRootOptions={...g.shadowRootOptions,delegatesFocus:!0},i.formControlValidators=[$],o([a()],i.prototype,"name",2),o([a()],i.prototype,"value",1),o([a({reflect:!0})],i.prototype,"label",2),o([a({reflect:!0})],i.prototype,"placeholder",2),o([a({type:String,reflect:!0})],i.prototype,"size",2),o([a({type:Boolean,reflect:!0})],i.prototype,"required",2),o([a({type:Boolean,reflect:!0})],i.prototype,"disabled",2),o([a({type:Boolean,reflect:!0})],i.prototype,"clearable",2),o([a({type:Boolean,reflect:!0})],i.prototype,"multiple",2),o([a({type:Boolean,reflect:!0})],i.prototype,"autofocus",2),o([a({type:Boolean,attribute:"label-fixed",reflect:!0})],i.prototype,"labelFixed",2),o([a({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),o([a({type:String,attribute:"invalid-text",reflect:!0})],i.prototype,"customInvalidText",2),o([a({type:Boolean,attribute:"view-select-all",converter:y()})],i.prototype,"viewSelectAll",2),o([a({type:String,attribute:"select-all-text"})],i.prototype,"selectAllText",2),o([a({type:Boolean,attribute:"search-bar",reflect:!0})],i.prototype,"searchBar",2),o([a({type:String,attribute:"search-bar-placeholder",reflect:!0})],i.prototype,"searchBarPlaceholder",2),o([a({type:Boolean,attribute:"search-bar-loading-state",converter:y()})],i.prototype,"searchBarLoadingState",2),o([a({type:String,attribute:"search-not-found-text",reflect:!0})],i.prototype,"searchNotFoundText",2),o([a({type:String,attribute:"popover-clear-search-text",reflect:!0})],i.prototype,"popoverClearSearchText",2),o([h()],i.prototype,"_isPopoverOpen",2),o([h()],i.prototype,"_additionalSelectedOptionCount",2),o([h()],i.prototype,"_searchText",2),o([v(".selected-options")],i.prototype,"selectedOptionsContainer",2),o([S(".selected-options li")],i.prototype,"selectedOptionsItems",2),o([v(".popover")],i.prototype,"_popover",2),o([v(".select-input")],i.prototype,"_selectInput",2),o([m("bl-select")],i.prototype,"_onBlSelect",2),o([m("bl-search")],i.prototype,"_onBlSearch",2),o([h()],i.prototype,"_selectedOptions",2),o([h()],i.prototype,"dirty",2),o([v(".select-input")],i.prototype,"validationTarget",2),i=o([T("bl-select"),z()],i);export{i as a};
107
- //# sourceMappingURL=chunk-2IJL7HNY.js.map
118
+ </div> `}handleFocusOptionByKey(e){let t=Date.now();t-this.lastKeyPressedTime>this.keyPressThreshold&&(this.typedCharacters=""),this.lastKeyPressedTime=t,this.typedCharacters+=e.toLowerCase();let s=this.options.findIndex(n=>n.disabled?!1:n.innerText.trim().toLowerCase().startsWith(this.typedCharacters));s!==-1&&(this.focusedOptionIndex=s,this.options[s].focus())}handleKeydown(e){if(this.focusedOptionIndex===-1&&["Enter","Space"].includes(e.code))this._togglePopover(),e.preventDefault();else if(this._isPopoverOpen===!1&&["ArrowDown","ArrowUp"].includes(e.code))this.open(),e.preventDefault();else if(e.code==="Escape")this.close(),e.preventDefault();else if(this._isPopoverOpen&&["ArrowDown","ArrowUp"].includes(e.code)){let t=this.options.filter(l=>!l.disabled);e.code==="ArrowDown"&&this.focusedOptionIndex++,e.code==="ArrowUp"&&this.focusedOptionIndex--,this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,t.length-1)),t[this.focusedOptionIndex].focus(),e.preventDefault()}else this._isPopoverOpen&&!this.searchBar&&this.handleFocusOptionByKey(e.key)}_togglePopover(){this._isPopoverOpen?this.close():this.open()}_handleSelectEvent(){let e=this._selectedOptions.map(t=>({value:t.value,selected:t.selected,text:t.textContent}));this.multiple?this._onBlSelect(e):this._onBlSelect(e[0])}_handleSearchEvent(){this._onBlSearch(this._searchText)}_handleSearchOptions(e){this.searchBar&&(this._searchText=e.target.value,this._handleSearchEvent(),this._connectedOptions.forEach(t=>{let l=this._searchText.toLowerCase(),s="";if(t.textContent)try{s=t.textContent.toLocaleLowerCase(this.userLang)}catch{s=t.textContent.toLowerCase()}let n=s.includes(l);t.hidden=!n}),this._selectedOptions=this.options.filter(t=>t.selected),this._handleLastVisibleSearchedOption(),this.requestUpdate())}_handleLastVisibleSearchedOption(){var t,l;let e=[...this.options].reverse().find(s=>!s.hidden);e&&((l=(t=e==null?void 0:e.shadowRoot)==null?void 0:t.querySelector("div"))==null||l.classList.add("no-border-bottom")),this.options.map(s=>{var n,c;!s.hidden&&s!==e&&((c=(n=s.shadowRoot)==null?void 0:n.querySelector("div"))==null||c.classList.remove("no-border-bottom"))})}_handleSingleSelect(e){this.value=e.value,this._searchText="",this._handleSelectEvent(),this.close()}_handleMultipleSelect(){this.value=this._connectedOptions.filter(e=>e.selected).map(e=>e.value),this._handleSelectEvent()}_handleSelectOptionEvent(e){let t=e.target;this.dirty=!0,this.multiple?this._handleMultipleSelect():this._handleSingleSelect(t)}_handleSelectAll(e){var c;let t=(c=this.shadowRoot)==null?void 0:c.querySelector(".select-all"),l=e.detail,n=this._connectedOptions.filter(r=>!r.selected&&!r.hidden).every(r=>r.disabled);if(l&&n){setTimeout(()=>{var v;let r=(v=t==null?void 0:t.shadowRoot)==null?void 0:v.querySelector("input");r==null||r.click()},0);return}this._connectedOptions.forEach(r=>{r.disabled||r.hidden||(r.selected=l)}),this._handleMultipleSelect()}_onClickRemove(e){e.stopPropagation(),this._searchText="";let t=this._selectedOptions.filter(l=>l.disabled);this._connectedOptions.filter(l=>!l.disabled&&l.selected).forEach(l=>{l.selected=!1}),this.value=t.length?t.map(l=>l.value):null,this._handleSelectEvent()}_checkAdditionalItemCount(){if(!this.multiple||!this.selectedOptionsItems||this.selectedOptionsItems.length<2){this._additionalSelectedOptionCount=0;return}let e=[...this.selectedOptionsItems].findIndex(t=>t.offsetLeft>this.selectedOptionsContainer.offsetWidth);e>-1?this._additionalSelectedOptionCount=this.selectedOptionsItems.length-e:this._additionalSelectedOptionCount=0}firstUpdated(){this.value===void 0&&(this.multiple?this.value=[]:this.value=null),this._initialValue=this._value}updated(e){e.has("multiple")&&typeof e.get("multiple")=="boolean"&&(this.value=null),e.has("_selectedOptions")&&this._checkAdditionalItemCount()}registerOption(e){this._connectedOptions.push(e),e.selected&&(this.multiple?(Array.isArray(this.value)||(this.value=[]),this.value=[...this.value,e.value]):this.value=e.value),this.setOptionsSelected(),this.requestUpdate()}unregisterOption(e){this._connectedOptions.splice(this._connectedOptions.indexOf(e),1)}};i.shadowRootOptions={...g.shadowRootOptions,delegatesFocus:!0},i.formControlValidators=[$],o([a()],i.prototype,"name",2),o([a()],i.prototype,"value",1),o([a({reflect:!0})],i.prototype,"label",2),o([a({reflect:!0})],i.prototype,"placeholder",2),o([a({type:String,reflect:!0})],i.prototype,"size",2),o([a({type:Boolean,reflect:!0})],i.prototype,"required",2),o([a({type:Boolean,reflect:!0})],i.prototype,"disabled",2),o([a({type:Boolean,reflect:!0})],i.prototype,"clearable",2),o([a({type:Boolean,reflect:!0})],i.prototype,"multiple",2),o([a({type:Boolean,reflect:!0})],i.prototype,"autofocus",2),o([a({type:Boolean,attribute:"label-fixed",reflect:!0})],i.prototype,"labelFixed",2),o([a({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),o([a({type:String,attribute:"invalid-text",reflect:!0})],i.prototype,"customInvalidText",2),o([a({type:Boolean,attribute:"view-select-all",converter:y()})],i.prototype,"viewSelectAll",2),o([a({type:String,attribute:"select-all-text"})],i.prototype,"selectAllText",2),o([a({type:Boolean,attribute:"search-bar",reflect:!0})],i.prototype,"searchBar",2),o([a({type:String,attribute:"search-bar-placeholder",reflect:!0})],i.prototype,"searchBarPlaceholder",2),o([a({type:Boolean,attribute:"search-bar-loading-state",converter:y()})],i.prototype,"searchBarLoadingState",2),o([a({type:String,attribute:"search-not-found-text",reflect:!0})],i.prototype,"searchNotFoundText",2),o([a({type:String,attribute:"popover-clear-search-text",reflect:!0})],i.prototype,"popoverClearSearchText",2),o([u()],i.prototype,"_isPopoverOpen",2),o([u()],i.prototype,"_additionalSelectedOptionCount",2),o([u()],i.prototype,"_searchText",2),o([b(".selected-options")],i.prototype,"selectedOptionsContainer",2),o([S(".selected-options li")],i.prototype,"selectedOptionsItems",2),o([b(".popover")],i.prototype,"_popover",2),o([b(".select-input")],i.prototype,"_selectInput",2),o([m("bl-select")],i.prototype,"_onBlSelect",2),o([m("bl-search")],i.prototype,"_onBlSearch",2),o([u()],i.prototype,"_selectedOptions",2),o([u()],i.prototype,"dirty",2),o([b(".select-input")],i.prototype,"validationTarget",2),i=o([T("bl-select"),z()],i);export{i as a};
119
+ //# sourceMappingURL=chunk-2Q566BEQ.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/select/bl-select.css", "../src/components/select/bl-select.ts"],
4
+ "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-neutral-full);--border-color:var(--bl-color-neutral-lighter);--border-focus-color:var(--bl-color-primary-highlight);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--label-color:var(--bl-color-neutral-dark);--placeholder-color:var(--bl-color-neutral-light);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-neutral-lightest);--menu-height:250px;--popover-position:var(--bl-popover-position, fixed)}:host([multiple][view-select-all]) .select-wrapper{--menu-height:290px}:host([size=large]) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size=small]) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-neutral-light)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-highlight);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);-webkit-user-select:none;user-select:none;margin:0;width:auto;min-width:100%}.label,.placeholder{color:var(--placeholder-color);padding-inline-start:var(--label-padding);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}.select-wrapper.selected .placeholder,:host(:not([placeholder])) .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}:host(:not([label])) .label,:host([label-fixed]) .label{display:none}.remove-all{display:none}.selected .remove-all{display:block}:host([disabled]) .remove-all,:host([disabled]) .remove-all::after{display:none}.dropdown-icon{font-size:var(--bl-font-size-m)}.dropdown-icon.open{display:none}.select-open .dropdown-icon.open{display:inline-block}.select-open .dropdown-icon.closed{display:none}.selected .dropdown-icon{--icon-color:var(--bl-color-neutral-darker)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-neutral-light)}.select-input:focus-visible,.select-open .select-input{border:solid 1px var(--border-focus-color);outline:0}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;padding-inline-start:var(--label-padding);margin:0;list-style:none;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}:host([disabled]) .select-input .selected-options{color:var(--bl-color-neutral-light)}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}.selected-options li:not(:last-child)::after{content:\", \"}.select-input:not(.has-overflowed-options) .additional-selection-count{display:none}:host([disabled]) .additional-selection-count{color:var(--bl-color-neutral-light)}:host([disabled]) .selected-options li{color:var(--bl-color-neutral-light)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-4xs);margin-inline-start:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:var(--popover-position);border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--bl-index-popover);width:100%;top:var(--top);left:var(--left)}:host(:empty) .popover{display:none}.popover-no-result{display:flex;flex-direction:column;gap:var(--bl-size-2xs);align-items:center;justify-content:center;height:80px}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}label,legend{padding:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}label{position:absolute;display:block;top:var(--padding-vertical);left:var(--padding-horizontal);inset-inline-end:calc(var(--bl-size-2xs) + var(--bl-size-m) + var(--bl-size-2xs));transition:.1s ease-in;pointer-events:none;opacity:0;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color)}legend{height:0;visibility:hidden;display:none}legend span{padding:0 var(--label-padding);display:inline-block;opacity:0;visibility:visible}:host(:not([placeholder])) .selected .label,:host([placeholder]) :where(.select-open,.selected) .label{display:none}:where(.select-open,.selected) label{top:0;transform:translateY(-50%);font:var(--bl-font-caption);color:var(--label-color);pointer-events:initial;right:var(--padding-horizontal);opacity:1}:host([label]) :where(.select-open,.selected) legend{max-width:100%;font:var(--bl-font-caption);display:block}:host([label-fixed]) label{position:static;padding:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-caption);color:var(--label-color);opacity:1}:host([label-fixed]) legend{display:none}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.error-icon,.invalid-text{display:none}.dirty.invalid label,.error-icon,.invalid-text{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}.dirty.invalid .hint,:host([help-text]) .hint{display:block}.dirty.invalid .invalid-text{display:block}.dirty.invalid .help-text{display:none}.select-all{position:sticky;top:0;padding:var(--bl-size-xs) 0;background:var(--background-color);z-index:1;font:var(--bl-font-title-3-regular);box-shadow:10px 0 0 var(--background-color),-10px 0 0 var(--background-color)}.select-all::after{position:absolute;content:\"\";width:100%;bottom:0;border-bottom:1px solid var(--bl-color-neutral-lighter)}.search-bar-input{font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--text-color);border:none;outline:0;background-color:transparent;width:100%;height:100%;padding:0;margin:0;box-sizing:border-box}.search-bar-input::placeholder{color:var(--placeholder-color)}.search-bar-input:focus-visible{outline:0}.search-spinner{padding-inline-end:var(--bl-font-size-2xs)}.action-divider{display:none}.select-wrapper .action-divider{display:block;height:1rem;width:1px;background-color:var(--bl-color-neutral-lighter)}.actions bl-icon{padding:4px}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, query, queryAll, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { autoUpdate, computePosition, flip, MiddlewareState, offset, size } from \"@floating-ui/dom\";\nimport { localized, msg } from \"@lit/localize\";\nimport { FormControlMixin, requiredValidator } from \"@open-wc/form-control\";\nimport { FormValue } from \"@open-wc/form-helpers\";\nimport \"element-internals-polyfill\";\nimport { LangKey } from \"../../localization\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { stringBooleanConverter } from \"../../utilities/string-boolean.converter\";\nimport \"../button/bl-button\";\nimport \"../checkbox-group/checkbox/bl-checkbox\";\nimport BlCheckbox from \"../checkbox-group/checkbox/bl-checkbox\";\nimport \"../icon/bl-icon\";\nimport style from \"../select/bl-select.css\";\nimport \"../select/option/bl-select-option\";\nimport type BlSelectOption from \"./option/bl-select-option\";\n\nexport interface ISelectOption<T = string> {\n value: T;\n text: string;\n selected: boolean;\n}\n\nexport type SelectSize = \"medium\" | \"large\" | \"small\";\n\nexport type CleanUpFunction = () => void;\n\n/**\n * @tag bl-select\n * @summary Baklava Select component\n *\n * @cssproperty [--bl-popover-position=fixed] Sets the positioning strategy of select popover. You can set it as `absolute` if you need to show popover relative to its trigger element.\n */\n@customElement(\"bl-select\")\n@localized()\nexport default class BlSelect<ValueType extends FormValue = string> extends FormControlMixin(\n LitElement\n) {\n static get styles(): CSSResultGroup {\n return [style];\n }\n static shadowRootOptions = { ...LitElement.shadowRootOptions, delegatesFocus: true };\n\n static formControlValidators = [requiredValidator];\n\n /**\n * Sets name of the select field\n */\n @property()\n name: string;\n\n private _value: ValueType | ValueType[] | null;\n\n private _initialValue: ValueType | ValueType[] | null;\n\n /**\n * Sets the value of the select\n */\n @property()\n get value(): ValueType | ValueType[] | null {\n return this._value;\n }\n\n set value(val: ValueType | ValueType[] | null) {\n this._value = val;\n\n if (Array.isArray(val)) {\n const formData = new FormData();\n\n val.forEach(option => formData.append(this.name, `${option}`));\n this.setValue(formData);\n } else {\n this.setValue(val);\n }\n\n this.setOptionsSelected();\n }\n\n shouldFormValueUpdate(): boolean {\n return this.value !== null && this.value !== \"\";\n }\n\n /* Declare reactive properties */\n /**\n * Sets the label value\n */\n @property({ reflect: true })\n label?: string;\n\n /**\n * Sets the placeholder value. If left blank, the label value (if specified) is set as placeholder.\n */\n @property({ reflect: true })\n placeholder?: string;\n\n /**\n * Sets the size value. Select component's height value will be changed accordingly\n */\n @property({ type: String, reflect: true })\n size: SelectSize = \"medium\";\n\n /**\n * When option is not selected, shows component in error state\n */\n @property({ type: Boolean, reflect: true })\n required = false;\n\n /**\n * Shows the component in disabled state.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets whether the selected option is clearable\n */\n @property({ type: Boolean, reflect: true })\n clearable = false;\n\n /**\n * Allows multiple options to be selected\n */\n @property({ type: Boolean, reflect: true })\n multiple = false;\n\n /**\n * Sets input to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: \"label-fixed\", reflect: true })\n labelFixed = false;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: \"help-text\", reflect: true })\n helpText?: string;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: \"invalid-text\", reflect: true })\n customInvalidText?: string;\n\n /**\n * Views select all option in multiple select\n */\n @property({ type: Boolean, attribute: \"view-select-all\", converter: stringBooleanConverter() })\n viewSelectAll = false;\n\n /**\n * Sets select all text in multiple select\n */\n @property({ type: String, attribute: \"select-all-text\" })\n selectAllText?: string;\n\n /**\n * Enable search functionality for the options within the list\n */\n @property({ type: Boolean, attribute: \"search-bar\", reflect: true })\n searchBar = false;\n\n /**\n * Search for text variations such as \"search,\" \"searching,\" \"search by country,\" and so on\n */\n @property({ type: String, attribute: \"search-bar-placeholder\", reflect: true })\n searchBarPlaceholder?: string;\n\n /**\n * Display a loading icon in place of the search icon.\n */\n @property({\n type: Boolean,\n attribute: \"search-bar-loading-state\",\n converter: stringBooleanConverter(),\n })\n searchBarLoadingState = false;\n\n /**\n * Text to display when no search results are found.\n */\n @property({ type: String, attribute: \"search-not-found-text\", reflect: true })\n searchNotFoundText?: string;\n\n /**\n * Text to display on the clear search button.\n */\n @property({ type: String, attribute: \"popover-clear-search-text\", reflect: true })\n popoverClearSearchText?: string;\n\n /* Declare internal reactive properties */\n @state()\n private _isPopoverOpen = false;\n\n @state()\n private _additionalSelectedOptionCount = 0;\n\n @state()\n private _searchText = \"\";\n\n @query(\".selected-options\")\n private selectedOptionsContainer!: HTMLElement;\n\n @queryAll(\".selected-options li\")\n private selectedOptionsItems!: NodeListOf<HTMLElement>;\n\n @query(\".popover\")\n private _popover: HTMLElement;\n\n @query(\".select-input\")\n private _selectInput: HTMLElement;\n\n /**\n * Fires when selection changes\n */\n @event(\"bl-select\") private _onBlSelect: EventDispatcher<\n ISelectOption<ValueType>[] | ISelectOption<ValueType>\n >;\n\n /**\n * Fires when search text changes\n */\n @event(\"bl-search\") private _onBlSearch: EventDispatcher<string>;\n\n private userLang =\n (document.querySelector(\"html\")?.getAttribute(\"lang\") as LangKey | null) || navigator.language;\n\n private _connectedOptions: BlSelectOption<ValueType>[] = [];\n\n private _cleanUpPopover: CleanUpFunction | null = null;\n\n private setOptionsSelected() {\n this._connectedOptions.forEach(\n option =>\n (option.selected =\n this.value === option.value ||\n (Array.isArray(this.value) && this.value.includes(option.value)))\n );\n\n this._selectedOptions = [...this.options.filter(option => option.selected)];\n }\n\n get options() {\n return this._connectedOptions;\n }\n\n get opened() {\n return this._isPopoverOpen;\n }\n\n get noResultFound() {\n return this._searchText !== \"\" && this._connectedOptions.every(option => option.hidden);\n }\n\n @state()\n private _selectedOptions: BlSelectOption<ValueType>[] = [];\n\n @state()\n private dirty = false;\n\n get selectedOptions(): BlSelectOption<ValueType>[] {\n return this._selectedOptions;\n }\n\n get additionalSelectedOptionCount() {\n return this._additionalSelectedOptionCount;\n }\n\n validityCallback(): string | void {\n if (this.customInvalidText) {\n return this.customInvalidText;\n }\n const select = document.createElement(\"select\");\n\n select.required = this.required;\n\n return select.validationMessage;\n }\n\n reportValidity() {\n this.dirty = true;\n return this.checkValidity();\n }\n\n resetFormControl(): void {\n this.value = this._initialValue;\n }\n\n @query(\".select-input\")\n validationTarget: HTMLElement;\n\n open() {\n if (this.searchBar) {\n setTimeout(() => {\n document.activeElement?.shadowRoot?.querySelector(\"input\")?.focus();\n }, 100);\n }\n\n this._isPopoverOpen = true;\n this._setupPopover();\n document.addEventListener(\"click\", this._interactOutsideHandler, true);\n document.addEventListener(\"focus\", this._interactOutsideHandler, true);\n }\n\n close() {\n this._handleSearchOptions({ target: { value: \"\" } } as InputEvent & {\n target: HTMLInputElement;\n });\n\n this._isPopoverOpen = false;\n this.focusedOptionIndex = -1;\n this._cleanUpPopover && this._cleanUpPopover();\n document.removeEventListener(\"click\", this._interactOutsideHandler, true);\n document.removeEventListener(\"focus\", this._interactOutsideHandler, true);\n }\n\n private _interactOutsideHandler = (event: MouseEvent | FocusEvent) => {\n const eventPath = event.composedPath() as HTMLElement[];\n\n if (!eventPath?.find(el => el.tagName === \"BL-SELECT\")?.contains(this)) {\n this.close();\n }\n };\n\n private _setupPopover() {\n this._cleanUpPopover = autoUpdate(this._selectInput, this._popover, () => {\n computePosition(this._selectInput, this._popover, {\n placement: \"bottom\",\n strategy: \"fixed\",\n middleware: [\n flip(),\n offset(8),\n size({\n apply(args: MiddlewareState) {\n Object.assign(args.elements.floating.style, {\n width: `${args.elements.reference.getBoundingClientRect().width}px`,\n });\n },\n }),\n ],\n }).then(({ x, y }) => {\n this._popover.style.setProperty(\"--left\", `${x}px`);\n this._popover.style.setProperty(\"--top\", `${y}px`);\n });\n });\n }\n\n private _handleToggleButtonClick(e: MouseEvent) {\n e.stopPropagation();\n this._togglePopover();\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n\n this.form?.addEventListener(\"submit\", (e: SubmitEvent) => {\n if (!this.reportValidity()) {\n e.preventDefault();\n }\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this._cleanUpPopover && this._cleanUpPopover();\n }\n\n private inputTemplate() {\n const inputSelectedOptions = html`<ul class=\"selected-options\">\n ${this._selectedOptions.map(\n item => html`<li>${item.getAttribute(\"label\") || item.textContent}</li>`\n )}\n </ul>`;\n\n const isAllSelectedDisabled =\n this._selectedOptions.length > 0 && this._selectedOptions.every(option => option.disabled);\n const isRemoveButtonShown = !isAllSelectedDisabled && (this.clearable || this.multiple);\n const removeButton = isRemoveButtonShown\n ? html`<bl-button\n class=\"remove-all\"\n size=\"small\"\n variant=\"tertiary\"\n kind=\"neutral\"\n icon=\"close\"\n @click=${this._onClickRemove}\n ></bl-button>`\n : \"\";\n\n const isSearchBarVisible = this.searchBar && this.opened;\n const hasSelectedOptions = this._selectedOptions.length > 0;\n\n const isDividerShown = isSearchBarVisible || (hasSelectedOptions && isRemoveButtonShown);\n\n const searchbarPlaceholderText =\n this.searchBarPlaceholder ?? msg(\"Search\", { desc: \"bl-select: search placeholder text\" });\n\n const searchMagIcon = html`<bl-icon\n class=\"search-mag-icon\"\n name=\"search\"\n style=\"color: var(--bl-color-primary);font-size: var(--bl-font-size-s)\"\n ></bl-icon>`;\n\n const searchSpinner = html`<bl-spinner class=\"search-spinner\"></bl-spinner>`;\n\n const actionDivider = isDividerShown ? html`<div class=\"action-divider\"></div>` : \"\";\n\n const search = html`<fieldset\n class=${classMap({\n \"select-input\": true,\n \"has-overflowed-options\": this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${this.disabled ? \"-1\" : 0}\"\n .autofocus=${this.autofocus}\n role=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${this.opened}\"\n aria-labelledby=\"label\"\n @click=${this.open}\n >\n <legend><span>${this.label}</span></legend>\n\n ${this._selectedOptions.length > 0 && !this.opened\n ? inputSelectedOptions\n : html`\n <input\n class=\"search-bar-input\"\n placeholder=${this.opened || this.labelFixed\n ? searchbarPlaceholderText\n : this.label || searchbarPlaceholderText}\n @input=${this._handleSearchOptions}\n @keydown=${(e: KeyboardEvent) => {\n if (e.code === \"Space\") {\n e.stopPropagation();\n }\n }}\n .value=${this._searchText}\n />\n `}\n ${!this.opened\n ? html`<span class=\"additional-selection-count\"\n >+${this._additionalSelectedOptionCount}</span\n >`\n : \"\"}\n\n <div class=\"actions\">\n ${this.opened ? (this.searchBarLoadingState ? searchSpinner : searchMagIcon) : \"\"}\n ${!this.opened ? removeButton : \"\"} ${actionDivider}\n <bl-button\n class=\"dropdown-icon open\"\n variant=\"tertiary\"\n kind=\"neutral\"\n size=\"small\"\n icon=\"arrow_up\"\n @click=${this._handleToggleButtonClick}\n aria-label=\"${msg(\"Close dropdown\", { desc: \"bl-select: close dropdown button\" })}\"\n ></bl-button>\n <bl-button\n class=\"closed dropdown-icon\"\n variant=\"tertiary\"\n kind=\"neutral\"\n size=\"small\"\n icon=\"arrow_down\"\n @click=${this._handleToggleButtonClick}\n aria-label=\"${msg(\"Open dropdown\", { desc: \"bl-select: open dropdown button\" })}\"\n ></bl-button>\n </div>\n </fieldset>`;\n\n return this.searchBar\n ? search\n : html`<fieldset\n class=${classMap({\n \"select-input\": true,\n \"has-overflowed-options\": this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${ifDefined(this.disabled ? undefined : 0)}\"\n ?autofocus=${this.autofocus}\n @click=${this._togglePopover}\n role=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${this.opened}\"\n aria-labelledby=\"label\"\n >\n <legend><span>${this.label}</span></legend>\n <span class=\"placeholder\">${this.placeholder}</span>\n <span class=\"label\">${this.label}</span>\n ${inputSelectedOptions}\n <span class=\"additional-selection-count\">+${this._additionalSelectedOptionCount}</span>\n <div class=\"actions\">\n ${removeButton} ${actionDivider}\n <bl-icon class=\"dropdown-icon open\" name=\"arrow_up\"></bl-icon>\n\n <bl-icon class=\"dropdown-icon closed\" name=\"arrow_down\"></bl-icon>\n </div>\n </fieldset>`;\n }\n\n selectAllTemplate() {\n if (!this.multiple || !this.viewSelectAll || this.noResultFound) {\n return null;\n }\n\n const isAllRenderedOptionsSelected = this._connectedOptions\n .filter(option => !option.hidden)\n .every(option => option.selected);\n\n const isAnySelected = this._selectedOptions.filter(option => !option.hidden).length > 0;\n const selectAllText =\n this.selectAllText ?? msg(\"Select All\", { desc: \"bl-select: select all text\" });\n\n return html`<bl-checkbox\n class=\"select-all\"\n .checked=\"${isAllRenderedOptionsSelected}\"\n .indeterminate=\"${isAnySelected && !isAllRenderedOptionsSelected}\"\n role=\"option\"\n aria-selected=\"${isAllRenderedOptionsSelected}\"\n @bl-checkbox-change=\"${this._handleSelectAll}\"\n >\n ${selectAllText}\n </bl-checkbox>`;\n }\n\n render(): TemplateResult {\n const invalidMessage = !this.checkValidity()\n ? html`<p id=\"errorMessage\" aria-live=\"polite\" class=\"invalid-text\">\n ${this.validationMessage}\n </p>`\n : \"\";\n\n const helpMessage = this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : \"\";\n\n const label = this.label ? html`<label id=\"label\">${this.label}</label>` : \"\";\n\n const noDataText =\n this.searchNotFoundText ?? msg(\"No Data Found\", { desc: \"bl-select: search no data text\" });\n\n const clearSearchText =\n this.popoverClearSearchText ??\n msg(\"Clear Search\", { desc: \"bl-select: clear search button text\" });\n\n return html`<div\n class=${classMap({\n \"select-wrapper\": true,\n \"select-open\": this.opened,\n \"selected\": this._selectedOptions.length > 0,\n \"invalid\": !this.validity.valid,\n \"dirty\": this.dirty,\n })}\n @keydown=${this.handleKeydown}\n >\n ${label} ${this.inputTemplate()}\n <div\n class=\"popover\"\n tabindex=\"${ifDefined(this._isPopoverOpen ? undefined : \"-1\")}\"\n @bl-select-option=${this._handleSelectOptionEvent}\n role=\"listbox\"\n aria-multiselectable=\"${this.multiple}\"\n aria-labelledby=\"label\"\n >\n ${this.selectAllTemplate()}\n <slot></slot>\n ${this.searchBar && this.noResultFound\n ? html`<div name=\"popover-clear-search-text\" class=\"popover-no-result\">\n <span>${noDataText}</span>\n <bl-button\n variant=\"tertiary\"\n @click=${() => {\n this._handleSearchOptions({ target: { value: \"\" } } as InputEvent & {\n target: HTMLInputElement;\n });\n }}\n >${clearSearchText}</bl-button\n >\n </div>`\n : \"\"}\n </div>\n <div class=\"hint\">${invalidMessage} ${helpMessage}</div>\n </div> `;\n }\n\n private focusedOptionIndex = -1;\n private lastKeyPressedTime = 0;\n private typedCharacters = \"\";\n private keyPressThreshold = 500;\n\n private handleFocusOptionByKey(key: string) {\n const currentTime = Date.now();\n const elapsedTimeSinceLastKeyPress = currentTime - this.lastKeyPressedTime;\n\n if (elapsedTimeSinceLastKeyPress > this.keyPressThreshold) {\n this.typedCharacters = \"\";\n }\n\n this.lastKeyPressedTime = currentTime;\n this.typedCharacters += key.toLowerCase();\n\n const matchingOptionIndex = this.options.findIndex(option => {\n if (option.disabled) {\n return false;\n }\n const optionText = option.innerText.trim().toLowerCase();\n\n return optionText.startsWith(this.typedCharacters);\n });\n\n if (matchingOptionIndex !== -1) {\n this.focusedOptionIndex = matchingOptionIndex;\n this.options[matchingOptionIndex].focus();\n }\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (this.focusedOptionIndex === -1 && [\"Enter\", \"Space\"].includes(event.code)) {\n this._togglePopover();\n event.preventDefault();\n } else if (this._isPopoverOpen === false && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n this.open();\n event.preventDefault();\n } else if (event.code === \"Escape\") {\n this.close();\n event.preventDefault();\n } else if (this._isPopoverOpen && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n const activeOptions = this.options.filter(option => !option.disabled);\n\n event.code === \"ArrowDown\" && this.focusedOptionIndex++;\n event.code === \"ArrowUp\" && this.focusedOptionIndex--;\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, activeOptions.length - 1)\n );\n\n activeOptions[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n } else if (this._isPopoverOpen && !this.searchBar) {\n this.handleFocusOptionByKey(event.key);\n }\n }\n\n private _togglePopover() {\n this._isPopoverOpen ? this.close() : this.open();\n }\n\n private _handleSelectEvent() {\n const options = this._selectedOptions.map(\n option =>\n ({\n value: option.value,\n selected: option.selected,\n text: option.textContent,\n } as ISelectOption<ValueType>)\n );\n\n if (!this.multiple) this._onBlSelect(options[0]);\n else this._onBlSelect(options);\n }\n\n private _handleSearchEvent() {\n this._onBlSearch(this._searchText);\n }\n\n private _handleSearchOptions(e: InputEvent): void {\n if (!this.searchBar) return;\n\n this._searchText = (e.target as HTMLInputElement).value;\n\n this._handleSearchEvent();\n\n this._connectedOptions.forEach(option => {\n const searchText = this._searchText.toLowerCase();\n let optionText = \"\";\n\n if (option.textContent) {\n try {\n // Try locale-specific comparison first\n optionText = option.textContent.toLocaleLowerCase(this.userLang);\n } catch {\n // Fallback to basic toLowerCase if locale is not supported\n optionText = option.textContent.toLowerCase();\n }\n }\n\n const isVisible = optionText.includes(searchText);\n\n option.hidden = !isVisible;\n });\n\n this._selectedOptions = this.options.filter(option => option.selected);\n this._handleLastVisibleSearchedOption();\n this.requestUpdate();\n }\n\n private _handleLastVisibleSearchedOption() {\n const lastVisibleOption = [...this.options].reverse().find(option => !option.hidden);\n\n if (lastVisibleOption) {\n lastVisibleOption?.shadowRoot?.querySelector(\"div\")?.classList.add(\"no-border-bottom\");\n }\n\n this.options.map(option => {\n if (!option.hidden && option !== lastVisibleOption) {\n option.shadowRoot?.querySelector(\"div\")?.classList.remove(\"no-border-bottom\");\n }\n });\n }\n\n private _handleSingleSelect(optionItem: BlSelectOption<ValueType>) {\n this.value = optionItem.value;\n\n this._searchText = \"\";\n this._handleSelectEvent();\n this.close();\n }\n\n private _handleMultipleSelect() {\n this.value = this._connectedOptions\n .filter(option => option.selected)\n .map(option => option.value);\n\n this._handleSelectEvent();\n }\n\n private _handleSelectOptionEvent(e: CustomEvent) {\n const optionItem = e.target as BlSelectOption<ValueType>;\n\n this.dirty = true;\n\n if (this.multiple) {\n this._handleMultipleSelect();\n } else {\n this._handleSingleSelect(optionItem);\n }\n }\n\n private _handleSelectAll(e: CustomEvent) {\n const selectAllEl = this.shadowRoot?.querySelector(\".select-all\") as BlCheckbox;\n\n const checked = e.detail;\n const unselectedOptions = this._connectedOptions.filter(\n option => !option.selected && !option.hidden\n );\n const isAllUnselectedDisabled = unselectedOptions.every(option => option.disabled);\n\n // If all available options are selected, instead of checking, uncheck all options\n if (checked && isAllUnselectedDisabled) {\n setTimeout(() => {\n const checkbox = selectAllEl?.shadowRoot?.querySelector(\"input\");\n\n checkbox?.click();\n }, 0);\n return;\n }\n\n this._connectedOptions.forEach(option => {\n if (option.disabled || option.hidden) {\n return;\n }\n\n option.selected = checked;\n });\n\n this._handleMultipleSelect();\n }\n\n private _onClickRemove(e: MouseEvent) {\n e.stopPropagation();\n\n this._searchText = \"\";\n\n const selectedDisabledOptions = this._selectedOptions.filter(option => option.disabled);\n\n this._connectedOptions\n .filter(option => !option.disabled && option.selected)\n .forEach(option => {\n option.selected = false;\n });\n\n this.value = selectedDisabledOptions.length\n ? selectedDisabledOptions.map(option => option.value)\n : null;\n this._handleSelectEvent();\n }\n\n private _checkAdditionalItemCount() {\n if (!this.multiple || !this.selectedOptionsItems || this.selectedOptionsItems.length < 2) {\n this._additionalSelectedOptionCount = 0;\n return;\n }\n\n const firstNonVisibleItemIndex = [...this.selectedOptionsItems].findIndex(\n item => item.offsetLeft > this.selectedOptionsContainer.offsetWidth\n );\n\n if (firstNonVisibleItemIndex > -1) {\n this._additionalSelectedOptionCount =\n this.selectedOptionsItems.length - firstNonVisibleItemIndex;\n } else {\n this._additionalSelectedOptionCount = 0;\n }\n }\n\n protected firstUpdated(): void {\n if (this.value === undefined) {\n if (this.multiple) {\n this.value = [];\n } else {\n this.value = null;\n }\n }\n\n this._initialValue = this._value;\n }\n\n protected updated(_changedProperties: PropertyValues) {\n if (\n _changedProperties.has(\"multiple\") &&\n typeof _changedProperties.get(\"multiple\") === \"boolean\"\n ) {\n this.value = null;\n }\n\n if (_changedProperties.has(\"_selectedOptions\")) {\n this._checkAdditionalItemCount();\n }\n }\n\n /**\n * This method is used by `bl-select-option` component to register itself to bl-select.\n * @param option BlSelectOption reference to be registered\n */\n registerOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.push(option);\n\n if (option.selected) {\n if (this.multiple) {\n if (!Array.isArray(this.value)) {\n this.value = [];\n }\n this.value = [...this.value, option.value];\n } else {\n this.value = option.value;\n }\n }\n\n this.setOptionsSelected();\n this.requestUpdate();\n }\n\n /**\n * This method is used by `bl-select-option` component to unregister itself from bl-select.\n * @param option BlSelectOption reference to be unregistered\n */\n unregisterOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.splice(this._connectedOptions.indexOf(option), 1);\n }\n}\n\ndeclare global {\n interface HTMLElement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A7KbrB,EA8KX,oCAGA+D,EAAA,CADPG,EAAM,UAAU,GAhLElE,EAiLX,wBAGA+D,EAAA,CADPG,EAAM,eAAe,GAnLHlE,EAoLX,4BAKoB+D,EAAA,CAA3B5D,EAAM,WAAW,GAzLCH,EAyLS,2BAOA+D,EAAA,CAA3B5D,EAAM,WAAW,GAhMCH,EAgMS,2BAiCpB+D,EAAA,CADPE,EAAM,GAhOYjE,EAiOX,gCAGA+D,EAAA,CADPE,EAAM,GAnOYjE,EAoOX,qBA+BR+D,EAAA,CADCG,EAAM,eAAe,GAlQHlE,EAmQnB,gCAnQmBA,EAArB+D,EAAA,CAFC1C,EAAc,WAAW,EACzB8C,EAAU,GACUnE",
6
+ "names": ["styles", "i", "bl_select_default", "_a", "BlSelect", "FormControlMixin", "s", "event", "eventPath", "el", "bl_select_default", "val", "formData", "option", "select", "_b", "_c", "autoUpdate", "computePosition", "flip", "offset", "size", "args", "x", "y", "e", "inputSelectedOptions", "item", "isRemoveButtonShown", "removeButton", "isSearchBarVisible", "hasSelectedOptions", "isDividerShown", "searchbarPlaceholderText", "msg", "searchMagIcon", "searchSpinner", "actionDivider", "search", "o", "l", "isAllRenderedOptionsSelected", "isAnySelected", "selectAllText", "invalidMessage", "helpMessage", "label", "noDataText", "clearSearchText", "key", "currentTime", "matchingOptionIndex", "activeOptions", "options", "searchText", "optionText", "isVisible", "lastVisibleOption", "optionItem", "selectAllEl", "checked", "isAllUnselectedDisabled", "checkbox", "selectedDisabledOptions", "firstNonVisibleItemIndex", "_changedProperties", "requiredValidator", "__decorateClass", "stringBooleanConverter", "t", "i", "localized"]
7
+ }
@@ -1,4 +1,4 @@
1
- import{a as d}from"./chunk-5MOOXA2X.js";import{a as l,b as n,f as r}from"./chunk-4OT5AMS5.js";import{d as i}from"./chunk-IZ2LK5GK.js";var b=l`.tabs{background-color:var(--bl-color-neutral-full);border-bottom:var(--bl-size-4xs) solid var(--bl-color-neutral-lightest);display:flex;flex-direction:row}.tabs-list{overflow-x:auto;border-radius:var(--bl-border-radius-m) var(--bl-border-radius-m) 0 0}.panels{border-radius:0 0 var(--bl-border-radius-m) var(--bl-border-radius-m)}`,o=b;var s=class extends r{constructor(){super(...arguments);this._connectedTabs=[];this._connectedPanels=[];this._tabFocus=0}static get styles(){return[o]}get tabs(){return this._connectedTabs}get panels(){return this._connectedPanels}registerTab(e){let t=this._connectedTabs.filter(a=>!a.disabled).length===0&&!e.disabled;this._connectedTabs.push(e),(!e.disabled&&e.selected||t)&&(this.selectedTabName=e.name,this._tabFocus=this._connectedTabs.length-1)}unregisterTab(e){var t;this._connectedTabs.splice(this._connectedTabs.indexOf(e),1),e.selected&&((t=this._connectedTabs.find(a=>!a.disabled))==null||t.select())}registerTabPanel(e){e.hidden=e.tab!==this.selectedTabName,e.tabIndex=0,this._connectedPanels.push(e)}unregisterTabPanel(e){this._connectedTabs.splice(this._connectedPanels.indexOf(e),1)}get selectedTabName(){return this._selectedTabName}set selectedTabName(e){this._selectedTabName=e,this._connectedTabs.forEach(t=>{t.selected=e===t.name}),this._connectedPanels.forEach(t=>{t.hidden=t.tab!==this._selectedTabName})}_handleTabSelected(e){this.selectedTabName=e.detail,this._tabFocus=this._connectedTabs.findIndex(t=>t.name===e.detail)}_handleTabListKeyDown(e){if(e.key==="ArrowRight"||e.key==="ArrowLeft"){if(e.key==="ArrowRight")do this._tabFocus++,this._tabFocus>=this._connectedTabs.length&&(this._tabFocus=0);while(this._connectedTabs[this._tabFocus].disabled);else if(e.key==="ArrowLeft")do this._tabFocus--,this._tabFocus<0&&(this._tabFocus=this._connectedTabs.length-1);while(this._connectedTabs[this._tabFocus].disabled);this._connectedTabs[this._tabFocus].focus()}}render(){return n` <div class="container" @bl-tab-selected="${this._handleTabSelected}">
1
+ import{a as d}from"./chunk-5MOOXA2X.js";import{a as l,b as n,f as r}from"./chunk-4OT5AMS5.js";import{d as i}from"./chunk-BWWXE4SL.js";var b=l`.tabs{background-color:var(--bl-color-neutral-full);border-bottom:var(--bl-size-4xs) solid var(--bl-color-neutral-lightest);display:flex;flex-direction:row}.tabs-list{overflow-x:auto;border-radius:var(--bl-border-radius-m) var(--bl-border-radius-m) 0 0}.panels{border-radius:0 0 var(--bl-border-radius-m) var(--bl-border-radius-m)}`,o=b;var s=class extends r{constructor(){super(...arguments);this._connectedTabs=[];this._connectedPanels=[];this._tabFocus=0}static get styles(){return[o]}get tabs(){return this._connectedTabs}get panels(){return this._connectedPanels}registerTab(e){let t=this._connectedTabs.filter(a=>!a.disabled).length===0&&!e.disabled;this._connectedTabs.push(e),(!e.disabled&&e.selected||t)&&(this.selectedTabName=e.name,this._tabFocus=this._connectedTabs.length-1)}unregisterTab(e){var t;this._connectedTabs.splice(this._connectedTabs.indexOf(e),1),e.selected&&((t=this._connectedTabs.find(a=>!a.disabled))==null||t.select())}registerTabPanel(e){e.hidden=e.tab!==this.selectedTabName,e.tabIndex=0,this._connectedPanels.push(e)}unregisterTabPanel(e){this._connectedTabs.splice(this._connectedPanels.indexOf(e),1)}get selectedTabName(){return this._selectedTabName}set selectedTabName(e){this._selectedTabName=e,this._connectedTabs.forEach(t=>{t.selected=e===t.name}),this._connectedPanels.forEach(t=>{t.hidden=t.tab!==this._selectedTabName})}_handleTabSelected(e){this.selectedTabName=e.detail,this._tabFocus=this._connectedTabs.findIndex(t=>t.name===e.detail)}_handleTabListKeyDown(e){if(e.key==="ArrowRight"||e.key==="ArrowLeft"){if(e.key==="ArrowRight")do this._tabFocus++,this._tabFocus>=this._connectedTabs.length&&(this._tabFocus=0);while(this._connectedTabs[this._tabFocus].disabled);else if(e.key==="ArrowLeft")do this._tabFocus--,this._tabFocus<0&&(this._tabFocus=this._connectedTabs.length-1);while(this._connectedTabs[this._tabFocus].disabled);this._connectedTabs[this._tabFocus].focus()}}render(){return n` <div class="container" @bl-tab-selected="${this._handleTabSelected}">
2
2
  <div role="tablist" @keydown=${this._handleTabListKeyDown} class="tabs-list">
3
3
  <div class="tabs">
4
4
  <slot name="tabs"></slot>
@@ -8,4 +8,4 @@ import{a as d}from"./chunk-5MOOXA2X.js";import{a as l,b as n,f as r}from"./chunk
8
8
  <slot></slot>
9
9
  </div>
10
10
  </div>`}};s=i([d("bl-tab-group")],s);export{s as a};
11
- //# sourceMappingURL=chunk-5TPDRTCU.js.map
11
+ //# sourceMappingURL=chunk-3MLXIDOD.js.map
@@ -1,4 +1,4 @@
1
- import{a as m}from"./chunk-GRL4DWKG.js";import{a as u}from"./chunk-3USCFSFQ.js";import{b as g}from"./chunk-7GK5LKBV.js";import{a as d,b as f,c as v}from"./chunk-5MOOXA2X.js";import{a as c,b as h,f as p}from"./chunk-4OT5AMS5.js";import{d as e}from"./chunk-IZ2LK5GK.js";var r=class extends u{};r.directiveName="unsafeSVG",r.resultType=2;var x=g(r);var y="https://cdn.jsdelivr.net/npm/@trendyol/baklava-icons@latest/icons";function G(s){y=s}function E(){return y}var b=c`:host{display:inline-block}:host div{display:flex;align-items:stretch;width:1em;height:1em;min-width:1em;min-height:1em;overflow:hidden;transform:translateZ(0)}:host svg{width:1em;height:1em}`,S=b;var l=new Map,t=class extends p{static get styles(){return[S]}get name(){return this._iconName}set name(n){n!==this._iconName&&(this._iconName=n,this.load())}async load(){let o=`${E()}/${this.name}.svg`;l.has(o)||l.set(o,fetch(o));try{let i=await l.get(o),a=i==null?void 0:i.clone();a!=null&&a.ok?(this.svg=await a.text(),this.onLoad(`${this.name} icon loaded`),this.requestUpdate()):this.onError(`${this.name} icon failed to load`)}catch(i){this.onError(`${this.name} icon failed to load [${i}]`)}}render(){return h`<div aria-hidden="true">${x(this.svg)}</div>`}};e([f({type:String,reflect:!0})],t.prototype,"name",1),e([m("bl-load")],t.prototype,"onLoad",2),e([m("bl-error")],t.prototype,"onError",2),e([v()],t.prototype,"svg",2),t=e([d("bl-icon")],t);export{G as a,E as b,t as c};
1
+ import{a as m}from"./chunk-GRL4DWKG.js";import{a as u}from"./chunk-3USCFSFQ.js";import{b as g}from"./chunk-7GK5LKBV.js";import{a as d,b as f,c as v}from"./chunk-5MOOXA2X.js";import{a as c,b as h,f as p}from"./chunk-4OT5AMS5.js";import{d as e}from"./chunk-BWWXE4SL.js";var r=class extends u{};r.directiveName="unsafeSVG",r.resultType=2;var x=g(r);var y="https://cdn.jsdelivr.net/npm/@trendyol/baklava-icons@latest/icons";function G(s){y=s}function E(){return y}var b=c`:host{display:inline-block}:host div{display:flex;align-items:stretch;width:1em;height:1em;min-width:1em;min-height:1em;overflow:hidden;transform:translateZ(0)}:host svg{width:1em;height:1em}`,S=b;var l=new Map,t=class extends p{static get styles(){return[S]}get name(){return this._iconName}set name(n){n!==this._iconName&&(this._iconName=n,this.load())}async load(){let o=`${E()}/${this.name}.svg`;l.has(o)||l.set(o,fetch(o));try{let i=await l.get(o),a=i==null?void 0:i.clone();a!=null&&a.ok?(this.svg=await a.text(),this.onLoad(`${this.name} icon loaded`),this.requestUpdate()):this.onError(`${this.name} icon failed to load`)}catch(i){this.onError(`${this.name} icon failed to load [${i}]`)}}render(){return h`<div aria-hidden="true">${x(this.svg)}</div>`}};e([f({type:String,reflect:!0})],t.prototype,"name",1),e([m("bl-load")],t.prototype,"onLoad",2),e([m("bl-error")],t.prototype,"onError",2),e([v()],t.prototype,"svg",2),t=e([d("bl-icon")],t);export{G as a,E as b,t as c};
2
2
  /*! Bundled license information:
3
3
 
4
4
  lit-html/directives/unsafe-svg.js:
@@ -8,4 +8,4 @@ lit-html/directives/unsafe-svg.js:
8
8
  * SPDX-License-Identifier: BSD-3-Clause
9
9
  *)
10
10
  */
11
- //# sourceMappingURL=chunk-BH64QNLE.js.map
11
+ //# sourceMappingURL=chunk-3OQA4BKQ.js.map
@@ -1,4 +1,4 @@
1
- import{a as b}from"./chunk-5EAI6722.js";import{a as s,b as n}from"./chunk-5MOOXA2X.js";import{a as i,b as o,f as a}from"./chunk-4OT5AMS5.js";import{d as l}from"./chunk-IZ2LK5GK.js";var d=i`:host{display:table-cell;border:1px solid var(--bl-color-neutral-lighter);padding:var(--bl-size-m);font:var(--bl-font-title-3-regular);color:var(--bl-color-neutral-darker);box-sizing:border-box;vertical-align:middle;word-break:break-word;background-color:var(--bl-color-neutral-full);background-clip:padding-box;border-top:none;border-inline-end:none}.table-cell{display:flex;align-items:center}.table-cell.shadow-right::before{content:"";position:absolute;inset-inline-end:-1px;top:0;width:16px;height:100%;z-index:-1;border-inline-end:1px solid var(--bl-color-neutral-lighter);box-shadow:calc(8px * var(--bl-text-x-direction)) 0 16px 0 rgb(39 49 66 / 10%)}.table-cell.shadow-left::before{content:"";position:absolute;inset-inline-start:-1px;top:0;width:16px;height:100%;z-index:-1;border-inline-start:1px solid var(--bl-color-neutral-lighter);box-shadow:calc(-8px * var(--bl-text-x-direction)) 0 16px 0 rgb(39 49 66 / 10%)}bl-checkbox{margin-inline-end:var(--bl-size-m)}`,c=d;var h="bl-table-cell",t=class extends a{constructor(){super(...arguments);this.disableSelection=!1}static get styles(){return[c]}get _table(){return this.closest("bl-table")}get _tableRow(){return this.closest("bl-table-row")}get disabled(){return this.disableSelection}get selectable(){var e;return this.index===0&&!!((e=this._table)!=null&&e.isSelectable(!1))&&this.selectionKey}get index(){let e=this.parentNode;return e?[...e.children].indexOf(this):-1}get selectionKey(){return this._tableRow?this._tableRow.selectionKey:""}get checked(){var e;return!!((e=this._tableRow)!=null&&e.checked)}get shadowRight(){var e;return!!((e=this._tableRow)!=null&&e.stickyFirstColumn)&&this.index===0}get shadowLeft(){var e;return!!((e=this._tableRow)!=null&&e.stickyLastColumn)&&this.nextElementSibling===null}connectedCallback(){super.connectedCallback(),this.closest(b)||console.warn("bl-table-cell is designed to be used inside a bl-table-row",this)}onChange(e){var r;(r=this._table)==null||r.onSelectionChange(!1,e.detail,this.selectionKey)}_renderCheckbox(){return this.selectable?o`<bl-checkbox
1
+ import{a as b}from"./chunk-MUSNNPY5.js";import{a as s,b as n}from"./chunk-5MOOXA2X.js";import{a as i,b as o,f as a}from"./chunk-4OT5AMS5.js";import{d as l}from"./chunk-BWWXE4SL.js";var d=i`:host{display:table-cell;border:1px solid var(--bl-color-neutral-lighter);padding:var(--bl-size-m);font:var(--bl-font-title-3-regular);color:var(--bl-color-neutral-darker);box-sizing:border-box;vertical-align:middle;word-break:break-word;background-color:var(--bl-color-neutral-full);background-clip:padding-box;border-top:none;border-inline-end:none}.table-cell{display:flex;align-items:center}.table-cell.shadow-right::before{content:"";position:absolute;inset-inline-end:-1px;top:0;width:16px;height:100%;z-index:-1;border-inline-end:1px solid var(--bl-color-neutral-lighter);box-shadow:calc(8px * var(--bl-text-x-direction)) 0 16px 0 rgb(39 49 66 / 10%)}.table-cell.shadow-left::before{content:"";position:absolute;inset-inline-start:-1px;top:0;width:16px;height:100%;z-index:-1;border-inline-start:1px solid var(--bl-color-neutral-lighter);box-shadow:calc(-8px * var(--bl-text-x-direction)) 0 16px 0 rgb(39 49 66 / 10%)}bl-checkbox{margin-inline-end:var(--bl-size-m)}`,c=d;var h="bl-table-cell",t=class extends a{constructor(){super(...arguments);this.disableSelection=!1}static get styles(){return[c]}get _table(){return this.closest("bl-table")}get _tableRow(){return this.closest("bl-table-row")}get disabled(){return this.disableSelection}get selectable(){var e;return this.index===0&&!!((e=this._table)!=null&&e.isSelectable(!1))&&this.selectionKey}get index(){let e=this.parentNode;return e?[...e.children].indexOf(this):-1}get selectionKey(){return this._tableRow?this._tableRow.selectionKey:""}get checked(){var e;return!!((e=this._tableRow)!=null&&e.checked)}get shadowRight(){var e;return!!((e=this._tableRow)!=null&&e.stickyFirstColumn)&&this.index===0}get shadowLeft(){var e;return!!((e=this._tableRow)!=null&&e.stickyLastColumn)&&this.nextElementSibling===null}connectedCallback(){super.connectedCallback(),this.closest(b)||console.warn("bl-table-cell is designed to be used inside a bl-table-row",this)}onChange(e){var r;(r=this._table)==null||r.onSelectionChange(!1,e.detail,this.selectionKey)}_renderCheckbox(){return this.selectable?o`<bl-checkbox
2
2
  ?checked=${this.checked}
3
3
  ?disabled=${this.disabled}
4
4
  value="row"
@@ -8,4 +8,4 @@ import{a as b}from"./chunk-5EAI6722.js";import{a as s,b as n}from"./chunk-5MOOXA
8
8
  ${this._renderCheckbox()}
9
9
  <slot></slot>
10
10
  </div>`}};l([n({type:Boolean,reflect:!0,attribute:"disabled"})],t.prototype,"disableSelection",2),t=l([s(h)],t);export{h as a,t as b};
11
- //# sourceMappingURL=chunk-JC4VETUE.js.map
11
+ //# sourceMappingURL=chunk-3PA3PCTP.js.map
@@ -1,4 +1,4 @@
1
- import{a as g}from"./chunk-OTAAXK2L.js";import{a as f}from"./chunk-GRL4DWKG.js";import{a as b,b as r,c,e as _}from"./chunk-5MOOXA2X.js";import{a as m,b as p}from"./chunk-4OT5AMS5.js";import{d as o}from"./chunk-IZ2LK5GK.js";var D=m`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}.datepicker-input{width:var(--bl-datepicker-input-width,auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`,E=D;var i=class extends g{constructor(){super(...arguments);this.size="medium";this.labelFixed=!1;this.valueFormatter=null;this._inputValue="";this._floatingDateCount=0;this._fittingDateCount=0}static get styles(){return[E]}defaultInputValueFormatter(){var t,e,n,l,a,s,d,u;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 h=(e=this._calendarEl)==null?void 0:e._dates.slice(0,this._fittingDateCount).map(v=>this.formatDate(v));this._inputValue=h.join(",")+(this._floatingDateCount>0?" ,...":"")}else this.type==="range"&&((n=this._calendarEl)!=null&&n._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((s=this._calendarEl)==null?void 0:s._dates[1])}`),(d=this._calendarEl)!=null&&d._dates[0]&&((u=this._calendarEl)!=null&&u._dates[1])&&this.closePopoverWithTimeout())}closePopoverWithTimeout(){setTimeout(()=>{this.closePopover(),this._inputEl.blur()},200)}setFloatingDates(){var l,a,s;let t=(l=this.shadowRoot)==null?void 0:l.getElementById("datepicker-input"),e=(a=this.shadowRoot)==null?void 0:a.getElementById("icon-container"),n=t.offsetWidth-e.offsetWidth;this._fittingDateCount=Math.floor(n/90),this._floatingDateCount=((s=this._calendarEl)==null?void 0:s._dates.length)-this._fittingDateCount}setDatePickerInput(){var t,e;(t=this._calendarEl)!=null&&t._dates.length?this.valueFormatter?this._inputValue=this.valueFormatter((e=this._calendarEl)==null?void 0:e._dates):this.defaultInputValueFormatter():this._inputValue=""}formatDate(t){return`${String(t==null?void 0:t.getDate()).padStart(2,"0")}/${String((t==null?void 0:t.getMonth())+1).padStart(2,"0")}/${t==null?void 0:t.getFullYear()}`}clearDatepicker(){this._calendarEl.handleClearSelectedDates(),this._inputValue="",this._floatingDateCount=0}openPopover(){this._popoverEl.target=this._inputEl,this._popoverEl.show()}closePopover(){this._popoverEl.hide()}_togglePopover(){this._popoverEl.visible?this.closePopover():this.openPopover()}formatAdditionalDates(t){let e=t.split(",");return e==null?void 0:e.reduce((n,l,a)=>(a>0&&a%3===0&&n.push(p`<br />`),n.push(p`<span>${l.trim()}${a<e.length-1?", ":""}</span>`),n),[])}async firstUpdated(){var t,e,n;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),(n=this._calendarEl)!=null&&n._dates&&this.setDatePickerInput()}onCalendarChange(){var t;this.setDatePickerInput(),this._onBlDatepickerChange((t=this._calendarEl)==null?void 0:t._dates)}disconnectedCallback(){var t,e;super.disconnectedCallback(),(t=this._calendarEl)==null||t.removeEventListener("mousedown",this._onCalendarMouseDown),(e=this._inputEl)==null||e.removeEventListener("mousedown",this._onInputMouseDown)}render(){var s,d,u,h;let t=p`
1
+ import{a as g}from"./chunk-2P3LD4HV.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 m,b as p}from"./chunk-4OT5AMS5.js";import{d as l}from"./chunk-BWWXE4SL.js";var D=m`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}.datepicker-input{width:var(--bl-datepicker-input-width,auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`,E=D;var i=class extends g{constructor(){super(...arguments);this.size="medium";this.labelFixed=!1;this.valueFormatter=null;this._inputValue="";this._floatingDateCount=0;this._fittingDateCount=0}static get styles(){return[E]}defaultInputValueFormatter(){var t,e,n,o,a,r,d,u;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 h=(e=this._calendarEl)==null?void 0:e._dates.slice(0,this._fittingDateCount).map(v=>this.formatDate(v));this._inputValue=h.join(",")+(this._floatingDateCount>0?" ,...":"")}else this.type==="range"&&((n=this._calendarEl)!=null&&n._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]&&((u=this._calendarEl)!=null&&u._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"),n=t.offsetWidth-e.offsetWidth;this._fittingDateCount=Math.floor(n/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`${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((n,o,a)=>(a>0&&a%3===0&&n.push(p`<br />`),n.push(p`<span>${o.trim()}${a<e.length-1?", ":""}</span>`),n),[])}async firstUpdated(){var t,e,n;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),(n=this._calendarEl)!=null&&n._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,u,h;let t=p`
2
2
  <bl-popover target="datepicker-content" placement="bottom-start">
3
3
  <bl-calendar
4
4
  type=${this.type}
@@ -8,10 +8,11 @@ import{a as g}from"./chunk-OTAAXK2L.js";import{a as f}from"./chunk-GRL4DWKG.js";
8
8
  .disabledDates=${this.disabledDates}
9
9
  .value=${this.value}
10
10
  .locale=${this.locale}
11
+ .dayRenderer=${this.dayRenderer}
11
12
  @bl-calendar-change="${this.onCalendarChange}"
12
13
  ></bl-calendar>
13
14
  </bl-popover>
14
- `,e=(u=(d=(s=this._calendarEl)==null?void 0:s._dates)==null?void 0:d.slice(this._fittingDateCount).map(v=>this.formatDate(v)).join(","))!=null?u:"",n=this.formatAdditionalDates(e),l=this._floatingDateCount>0?p` <bl-tooltip>
15
+ `,e=(u=(d=(r=this._calendarEl)==null?void 0:r._dates)==null?void 0:d.slice(this._fittingDateCount).map(v=>this.formatDate(v)).join(","))!=null?u:"",n=this.formatAdditionalDates(e),o=this._floatingDateCount>0?p` <bl-tooltip>
15
16
  <span slot="tooltip-trigger">+${this._floatingDateCount}</span>
16
17
  <div>${n}</div>
17
18
  </bl-tooltip>`:"",a=((h=this._calendarEl)==null?void 0:h._dates.length)>0?p` <bl-button
@@ -20,6 +21,7 @@ import{a as g}from"./chunk-OTAAXK2L.js";import{a as f}from"./chunk-GRL4DWKG.js";
20
21
  kind="neutral"
21
22
  icon="close"
22
23
  @click=${this.clearDatepicker}
24
+ ?disabled=${this.disabled}
23
25
  ></bl-button>
24
26
  <div class="action-divider"></div>`:"";return p`
25
27
  <div class="datepicker-content" id="datepicker-content" tabindex="-1">
@@ -40,11 +42,11 @@ import{a as g}from"./chunk-OTAAXK2L.js";import{a as f}from"./chunk-GRL4DWKG.js";
40
42
  readonly
41
43
  >
42
44
  <div slot="icon" class="icon-container" id="icon-container">
43
- ${l} ${a}
45
+ ${o} ${a}
44
46
  <bl-icon name="calendar" size="small" class="calendar-icon"></bl-icon>
45
47
  </div>
46
48
  </bl-input>
47
49
  ${t}
48
50
  </div>
49
- `}};o([r({type:String,attribute:"placeholder",reflect:!0})],i.prototype,"placeholder",2),o([r({type:String,reflect:!0})],i.prototype,"size",2),o([r({type:Boolean,attribute:"label-fixed",reflect:!0})],i.prototype,"labelFixed",2),o([r({type:String,attribute:"label",reflect:!0})],i.prototype,"label",2),o([r({type:Function,attribute:"value-formatter"})],i.prototype,"valueFormatter",2),o([r({type:Boolean})],i.prototype,"disabled",2),o([r({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),o([c()],i.prototype,"_inputValue",2),o([c()],i.prototype,"_floatingDateCount",2),o([c()],i.prototype,"_fittingDateCount",2),o([_("bl-calendar")],i.prototype,"_calendarEl",2),o([_("bl-popover")],i.prototype,"_popoverEl",2),o([_("bl-input")],i.prototype,"_inputEl",2),o([f("bl-datepicker-change")],i.prototype,"_onBlDatepickerChange",2),i=o([b("bl-datepicker")],i);export{i as a};
50
- //# sourceMappingURL=chunk-GFBXJPT6.js.map
51
+ `}};l([s({type:String,attribute:"placeholder",reflect:!0})],i.prototype,"placeholder",2),l([s({type:String,reflect:!0})],i.prototype,"size",2),l([s({type:Boolean,attribute:"label-fixed",reflect:!0})],i.prototype,"labelFixed",2),l([s({type:String,attribute:"label",reflect:!0})],i.prototype,"label",2),l([s({type:Function,attribute:"value-formatter"})],i.prototype,"valueFormatter",2),l([s({type:Boolean})],i.prototype,"disabled",2),l([s({type:String,attribute:"help-text",reflect:!0})],i.prototype,"helpText",2),l([s({attribute:!1})],i.prototype,"dayRenderer",2),l([c()],i.prototype,"_inputValue",2),l([c()],i.prototype,"_floatingDateCount",2),l([c()],i.prototype,"_fittingDateCount",2),l([_("bl-calendar")],i.prototype,"_calendarEl",2),l([_("bl-popover")],i.prototype,"_popoverEl",2),l([_("bl-input")],i.prototype,"_inputEl",2),l([f("bl-datepicker-change")],i.prototype,"_onBlDatepickerChange",2),i=l([b("bl-datepicker")],i);export{i as a};
52
+ //# sourceMappingURL=chunk-4BO66Y63.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/datepicker/bl-datepicker.css", "../src/components/datepicker/bl-datepicker.ts"],
4
+ "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:314px;display:block}.datepicker-content{--bl-input-cursor:pointer;--icon-size:var(--line-height);--icon-color:var(--bl-color-neutral-light);width:100%;position:relative;display:grid}.datepicker-input{width:var(--bl-datepicker-input-width,auto);white-space:nowrap;text-overflow:ellipsis}.icon-container{display:flex;gap:var(--bl-size-3xs);align-items:center}.calendar-icon{display:flex;align-items:center;gap:var(--icon-gap);flex-basis:var(--icon-size);align-self:center;margin-right:var(--label-padding);font-size:var(--icon-size);color:var(--icon-color);height:var(--icon-size)}.action-divider{display:block;height:var(--bl-size-m);width:1px;background-color:var(--bl-color-neutral-lighter);margin-right:var(--bl-size-3xs)}bl-popover{--bl-popover-padding:0;--bl-popover-background-color:transparent}`;\nexport default styles;\n", "import { CSSResultGroup, html, 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 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 @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,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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KAAM,OAAQ,UAAW,cAAe,QAAS,EAAK,CAAC,GAJhD7B,EAKnB,2BAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GATtB7B,EAUnB,oBAMA4B,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,UAAW,cAAe,QAAS,EAAK,CAAC,GAfjD7B,EAgBnB,0BAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,QAAS,QAAS,EAAK,CAAC,GApB1C7B,EAqBnB,qBAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,SAAU,UAAW,iBAAkB,CAAC,GAzBvC7B,EA0BnB,8BAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,CAAC,GA9BR7B,EA+BnB,wBAKA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,YAAa,QAAS,EAAK,CAAC,GAnC9C7B,EAoCnB,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
+ }
@@ -1,4 +1,4 @@
1
- import{a as g,c as w}from"./chunk-EG7U7PM3.js";import{a as f}from"./chunk-XDUIVR6I.js";import{a as b}from"./chunk-6LT7O7T2.js";import{a as E}from"./chunk-DINNT5P2.js";import{a as d}from"./chunk-GRL4DWKG.js";import{a as p,b as l,c as m,e as u}from"./chunk-5MOOXA2X.js";import{a as v,b as o,f as c}from"./chunk-4OT5AMS5.js";import{d as t}from"./chunk-IZ2LK5GK.js";var S=v`:host{display:flex;flex-direction:row}fieldset{border:none;padding:0}legend{font:var(--bl-font-title-3-medium);color:var(--bl-color-neutral-darker)}.options{display:flex;flex-flow:var(--bl-checkbox-direction,column) wrap;gap:var(--bl-size-m);margin-block:var(--bl-size-xs)}.dirty.invalid .options{margin-bottom:var(--bl-size-3xs)}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.invalid-text{display:none;color:var(--bl-color-danger)}.dirty.invalid .hint,.dirty.invalid .invalid-text{display:block}`,O=S;var k="bl-checkbox-group",x="bl-checkbox-group-change",s=class extends f(c){constructor(){super(...arguments);this.required=!1;this.dirty=!1;this.focusedOptionIndex=0}static get styles(){return[O]}get options(){return[...this.querySelectorAll(y)]}get checkedOptions(){return this.options.filter(e=>e.checked).map(e=>e.value)}get availableOptions(){return this.options.filter(e=>!e.disabled)}connectedCallback(){var e;super.connectedCallback(),this.tabIndex=0,this.addEventListener("focus",this.handleFocus),this.addEventListener("keydown",this.handleKeyDown),(e=this.form)==null||e.addEventListener("submit",i=>this.handleSubmit(i))}disconnectedCallback(){var e;super.disconnectedCallback(),this.removeEventListener("focus",this.handleFocus),this.removeEventListener("keydown",this.handleKeyDown),(e=this.form)==null||e.removeEventListener("submit",i=>this.handleSubmit(i))}firstUpdated(){this.required&&!this.value&&(this.setValue(null),this.onInvalid(this.internals.validity))}async updated(e){e.has("value")&&(this.setFormValue(),this.checkOptionsValidity(),this.value!==null&&this.onChange(this.value),await this.validationComplete,this.checkValidity()||this.onInvalid(this.internals.validity),this.requestUpdate())}setFormValue(){var e,i;if(this.value!==null&&this.value.length>0){let r=new FormData;(e=this.value)==null||e.forEach(n=>r.append(this.name,`${n}`)),this.setValue(r)}else((i=this.value)==null?void 0:i.length)===0&&this.setValue(null)}handleOptionChecked(){this.dirty=!0,this.value=this.checkedOptions}handleKeyDown(e){if(["ArrowDown","ArrowRight"].includes(e.key))this.focusedOptionIndex++;else if(["ArrowUp","ArrowLeft"].includes(e.key))this.focusedOptionIndex--;else if(e.key==="Tab"){if(e.shiftKey?this.focusedOptionIndex--:this.focusedOptionIndex++,this.focusedOptionIndex===this.availableOptions.length){this.tabIndex=0,this.focusedOptionIndex=0;return}}else return;this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,this.availableOptions.length-1)),this.availableOptions[this.focusedOptionIndex].focus(),e.preventDefault()}handleFocus(){this.availableOptions[this.focusedOptionIndex].focus()}handleSubmit(e){this.reportValidity()||(this.onInvalid(this.internals.validity),e.preventDefault()),this.checkOptionsValidity()}checkOptionsValidity(){var e,i;this.checkValidity()?(e=this.options)==null||e.forEach(r=>{var n,h;return(h=(n=r==null?void 0:r.shadowRoot)==null?void 0:n.querySelector("div"))==null?void 0:h.classList.remove("dirty","invalid")}):this.checkValidity()||(i=this.options)==null||i.forEach(r=>{var n,h;return(h=(n=r==null?void 0:r.shadowRoot)==null?void 0:n.querySelector("div"))==null?void 0:h.classList.add("dirty","invalid")})}validityCallback(){return this.customInvalidText?this.customInvalidText:this.validationMessage}reportValidity(){return this.dirty=!0,this.checkValidity()}render(){let e=this.checkValidity()?"":o`<p id="errorMessage" aria-live="polite" class="invalid-text">
1
+ import{a as g,c as w}from"./chunk-EG7U7PM3.js";import{a as f}from"./chunk-XDUIVR6I.js";import{a as b}from"./chunk-6LT7O7T2.js";import{a as E}from"./chunk-DINNT5P2.js";import{a as d}from"./chunk-GRL4DWKG.js";import{a as p,b as l,c as m,e as u}from"./chunk-5MOOXA2X.js";import{a as v,b as o,f as c}from"./chunk-4OT5AMS5.js";import{d as t}from"./chunk-BWWXE4SL.js";var S=v`:host{display:flex;flex-direction:row}fieldset{border:none;padding:0}legend{font:var(--bl-font-title-3-medium);color:var(--bl-color-neutral-darker)}.options{display:flex;flex-flow:var(--bl-checkbox-direction,column) wrap;gap:var(--bl-size-m);margin-block:var(--bl-size-xs)}.dirty.invalid .options{margin-bottom:var(--bl-size-3xs)}.hint{display:none;font:var(--bl-font-body-text-3)}.hint p{padding:0;margin:0}.invalid-text{display:none;color:var(--bl-color-danger)}.dirty.invalid .hint,.dirty.invalid .invalid-text{display:block}`,O=S;var k="bl-checkbox-group",x="bl-checkbox-group-change",s=class extends f(c){constructor(){super(...arguments);this.required=!1;this.dirty=!1;this.focusedOptionIndex=0}static get styles(){return[O]}get options(){return[...this.querySelectorAll(y)]}get checkedOptions(){return this.options.filter(e=>e.checked).map(e=>e.value)}get availableOptions(){return this.options.filter(e=>!e.disabled)}connectedCallback(){var e;super.connectedCallback(),this.tabIndex=0,this.addEventListener("focus",this.handleFocus),this.addEventListener("keydown",this.handleKeyDown),(e=this.form)==null||e.addEventListener("submit",i=>this.handleSubmit(i))}disconnectedCallback(){var e;super.disconnectedCallback(),this.removeEventListener("focus",this.handleFocus),this.removeEventListener("keydown",this.handleKeyDown),(e=this.form)==null||e.removeEventListener("submit",i=>this.handleSubmit(i))}firstUpdated(){this.required&&!this.value&&(this.setValue(null),this.onInvalid(this.internals.validity))}async updated(e){e.has("value")&&(this.setFormValue(),this.checkOptionsValidity(),this.value!==null&&this.onChange(this.value),await this.validationComplete,this.checkValidity()||this.onInvalid(this.internals.validity),this.requestUpdate())}setFormValue(){var e,i;if(this.value!==null&&this.value.length>0){let r=new FormData;(e=this.value)==null||e.forEach(n=>r.append(this.name,`${n}`)),this.setValue(r)}else((i=this.value)==null?void 0:i.length)===0&&this.setValue(null)}handleOptionChecked(){this.dirty=!0,this.value=this.checkedOptions}handleKeyDown(e){if(["ArrowDown","ArrowRight"].includes(e.key))this.focusedOptionIndex++;else if(["ArrowUp","ArrowLeft"].includes(e.key))this.focusedOptionIndex--;else if(e.key==="Tab"){if(e.shiftKey?this.focusedOptionIndex--:this.focusedOptionIndex++,this.focusedOptionIndex===this.availableOptions.length){this.tabIndex=0,this.focusedOptionIndex=0;return}}else return;this.focusedOptionIndex=Math.max(0,Math.min(this.focusedOptionIndex,this.availableOptions.length-1)),this.availableOptions[this.focusedOptionIndex].focus(),e.preventDefault()}handleFocus(){this.availableOptions[this.focusedOptionIndex].focus()}handleSubmit(e){this.reportValidity()||(this.onInvalid(this.internals.validity),e.preventDefault()),this.checkOptionsValidity()}checkOptionsValidity(){var e,i;this.checkValidity()?(e=this.options)==null||e.forEach(r=>{var n,h;return(h=(n=r==null?void 0:r.shadowRoot)==null?void 0:n.querySelector("div"))==null?void 0:h.classList.remove("dirty","invalid")}):this.checkValidity()||(i=this.options)==null||i.forEach(r=>{var n,h;return(h=(n=r==null?void 0:r.shadowRoot)==null?void 0:n.querySelector("div"))==null?void 0:h.classList.add("dirty","invalid")})}validityCallback(){return this.customInvalidText?this.customInvalidText:this.validationMessage}reportValidity(){return this.dirty=!0,this.checkValidity()}render(){let e=this.checkValidity()?"":o`<p id="errorMessage" aria-live="polite" class="invalid-text">
2
2
  ${this.validationMessage}
3
3
  </p>`,i={dirty:this.dirty,invalid:!this.validity.valid};return o`<div class=${b(i)}>
4
4
  <fieldset
@@ -32,4 +32,4 @@ import{a as g,c as w}from"./chunk-EG7U7PM3.js";import{a as f}from"./chunk-XDUIVR
32
32
  </label>
33
33
  <div class="hint">${i}</div>
34
34
  </div> `}};a.shadowRootOptions={...c.shadowRootOptions,delegatesFocus:!1},a.formControlValidators=[g],t([u("input")],a.prototype,"validationTarget",2),t([l({type:Boolean,reflect:!0})],a.prototype,"checked",2),t([l()],a.prototype,"value",2),t([l({type:Boolean,reflect:!0})],a.prototype,"required",2),t([l({type:String,attribute:"invalid-text",reflect:!0})],a.prototype,"customInvalidText",2),t([l({type:Boolean,reflect:!0})],a.prototype,"disabled",2),t([l({type:Boolean,reflect:!0})],a.prototype,"indeterminate",2),t([d("bl-checkbox-change")],a.prototype,"onChange",2),t([d("bl-focus")],a.prototype,"onFocus",2),t([d("bl-blur")],a.prototype,"onBlur",2),t([d("bl-checkbox-invalid")],a.prototype,"onInvalid",2),t([u("[type=checkbox]")],a.prototype,"checkboxElement",2),t([m()],a.prototype,"dirty",2),a=t([p(y)],a);export{y as a,a as b,k as c,x as d,s as e};
35
- //# sourceMappingURL=chunk-MWFGDECP.js.map
35
+ //# sourceMappingURL=chunk-6XM52E7W.js.map