@trendyol/baklava 3.3.0-beta.1 → 3.3.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 (104) hide show
  1. package/dist/baklava-react.d.ts +13 -1
  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 +3 -3
  5. package/dist/baklava-vue.d.ts +1 -0
  6. package/dist/baklava.d.ts +1 -0
  7. package/dist/baklava.d.ts.map +1 -1
  8. package/dist/baklava.js +1 -1
  9. package/dist/{chunk-BCXEI2IY.js → chunk-2I4NXKV5.js} +6 -6
  10. package/dist/chunk-2I4NXKV5.js.map +7 -0
  11. package/dist/{chunk-U2GVQEOB.js → chunk-43SCA2ZJ.js} +12 -11
  12. package/dist/chunk-43SCA2ZJ.js.map +7 -0
  13. package/dist/chunk-47S2NIWC.js +5 -0
  14. package/dist/chunk-47S2NIWC.js.map +7 -0
  15. package/dist/{chunk-BJVM3LHO.js → chunk-AW5LBSEM.js} +2 -2
  16. package/dist/{chunk-HYB2HRRX.js → chunk-BH64QNLE.js} +2 -2
  17. package/dist/{chunk-HYB2HRRX.js.map → chunk-BH64QNLE.js.map} +2 -2
  18. package/dist/{chunk-I44SG6Y7.js → chunk-FCEMOH4J.js} +2 -1
  19. package/dist/{chunk-I44SG6Y7.js.map → chunk-FCEMOH4J.js.map} +2 -2
  20. package/dist/{chunk-JCODVOWY.js → chunk-FTQX7CEW.js} +6 -5
  21. package/dist/{chunk-JCODVOWY.js.map → chunk-FTQX7CEW.js.map} +2 -2
  22. package/dist/{chunk-2U3PTJEA.js → chunk-GMVJABPT.js} +2 -1
  23. package/dist/{chunk-2U3PTJEA.js.map → chunk-GMVJABPT.js.map} +2 -2
  24. package/dist/{chunk-7NZ7DYVG.js → chunk-GXDVWGFU.js} +2 -1
  25. package/dist/{chunk-7NZ7DYVG.js.map → chunk-GXDVWGFU.js.map} +2 -2
  26. package/dist/{chunk-OUFOJQAS.js → chunk-J45OQI7D.js} +2 -2
  27. package/dist/{chunk-OUFOJQAS.js.map → chunk-J45OQI7D.js.map} +2 -2
  28. package/dist/chunk-NGQ435PC.js +50 -0
  29. package/dist/chunk-NGQ435PC.js.map +7 -0
  30. package/dist/{chunk-2E2KYTNB.js → chunk-OAF3R4PW.js} +3 -3
  31. package/dist/{chunk-2E2KYTNB.js.map → chunk-OAF3R4PW.js.map} +3 -3
  32. package/dist/chunk-T3UQYGO3.js +84 -0
  33. package/dist/chunk-T3UQYGO3.js.map +7 -0
  34. package/dist/{chunk-7QNX2GPS.js → chunk-X73CSBRO.js} +2 -2
  35. package/dist/chunk-X73CSBRO.js.map +7 -0
  36. package/dist/components/accordion-group/accordion/bl-accordion.js +1 -1
  37. package/dist/components/alert/bl-alert.js +1 -1
  38. package/dist/components/badge/bl-badge.js +1 -1
  39. package/dist/components/button/bl-button.js +1 -1
  40. package/dist/components/calendar/bl-calendar.d.ts +26 -51
  41. package/dist/components/calendar/bl-calendar.d.ts.map +1 -1
  42. package/dist/components/calendar/bl-calendar.js +1 -1
  43. package/dist/components/calendar/bl-calendar.test.d.ts +2 -0
  44. package/dist/components/calendar/bl-calendar.test.d.ts.map +1 -0
  45. package/dist/components/calendar/bl-calendar.types.d.ts +3 -4
  46. package/dist/components/calendar/bl-calendar.types.d.ts.map +1 -1
  47. package/dist/components/checkbox-group/bl-checkbox-group.js +1 -1
  48. package/dist/components/checkbox-group/checkbox/bl-checkbox.d.ts +1 -0
  49. package/dist/components/checkbox-group/checkbox/bl-checkbox.d.ts.map +1 -1
  50. package/dist/components/checkbox-group/checkbox/bl-checkbox.js +1 -1
  51. package/dist/components/datepicker/bl-datepicker.d.ts +71 -0
  52. package/dist/components/datepicker/bl-datepicker.d.ts.map +1 -0
  53. package/dist/components/datepicker/bl-datepicker.js +2 -0
  54. package/dist/components/datepicker/bl-datepicker.js.map +7 -0
  55. package/dist/components/datepicker/bl-datepicker.test.d.ts +2 -0
  56. package/dist/components/datepicker/bl-datepicker.test.d.ts.map +1 -0
  57. package/dist/components/dialog/bl-dialog.d.ts.map +1 -1
  58. package/dist/components/dialog/bl-dialog.js +1 -1
  59. package/dist/components/drawer/bl-drawer.d.ts.map +1 -1
  60. package/dist/components/drawer/bl-drawer.js +1 -1
  61. package/dist/components/dropdown/bl-dropdown.d.ts +6 -2
  62. package/dist/components/dropdown/bl-dropdown.d.ts.map +1 -1
  63. package/dist/components/dropdown/bl-dropdown.js +1 -1
  64. package/dist/components/dropdown/item/bl-dropdown-item.js +1 -1
  65. package/dist/components/icon/bl-icon.d.ts +1 -0
  66. package/dist/components/icon/bl-icon.d.ts.map +1 -1
  67. package/dist/components/icon/bl-icon.js +1 -1
  68. package/dist/components/input/bl-input.d.ts +2 -2
  69. package/dist/components/input/bl-input.d.ts.map +1 -1
  70. package/dist/components/input/bl-input.js +1 -1
  71. package/dist/components/pagination/bl-pagination.js +1 -1
  72. package/dist/components/popover/bl-popover.d.ts +22 -22
  73. package/dist/components/popover/bl-popover.d.ts.map +1 -1
  74. package/dist/components/popover/bl-popover.js +1 -1
  75. package/dist/components/progress-indicator/bl-progress-indicator.d.ts.map +1 -1
  76. package/dist/components/progress-indicator/bl-progress-indicator.js +1 -1
  77. package/dist/components/select/bl-select.d.ts.map +1 -1
  78. package/dist/components/select/bl-select.js +1 -1
  79. package/dist/components/select/bl-select.test.d.ts.map +1 -1
  80. package/dist/components/spinner/bl-spinner.js +1 -1
  81. package/dist/components/split-button/bl-split-button.js +1 -1
  82. package/dist/components/switch/bl-switch.js +1 -1
  83. package/dist/components/table/table-cell/bl-table-cell.js +1 -1
  84. package/dist/components/table/table-header-cell/bl-table-header-cell.js +1 -1
  85. package/dist/components/table/table-row/bl-table-row.js +1 -1
  86. package/dist/components/tooltip/bl-tooltip.js +1 -1
  87. package/dist/custom-elements.json +157 -67
  88. package/dist/mixins/datepicker-calendar-mixin/datepicker-calendar-mixin.d.ts +46 -0
  89. package/dist/mixins/datepicker-calendar-mixin/datepicker-calendar-mixin.d.ts.map +1 -0
  90. package/dist/mixins/datepicker-calendar-mixin/datepicker-calendar-mixin.test.d.ts +2 -0
  91. package/dist/mixins/datepicker-calendar-mixin/datepicker-calendar-mixin.test.d.ts.map +1 -0
  92. package/dist/utilities/string-to-date-converter.d.ts +2 -0
  93. package/dist/utilities/string-to-date-converter.d.ts.map +1 -0
  94. package/dist/utilities/string-to-date-converter.test.d.ts +2 -0
  95. package/dist/utilities/string-to-date-converter.test.d.ts.map +1 -0
  96. package/package.json +4 -2
  97. package/dist/chunk-7QNX2GPS.js.map +0 -7
  98. package/dist/chunk-BCXEI2IY.js.map +0 -7
  99. package/dist/chunk-GY5V7SRK.js +0 -80
  100. package/dist/chunk-GY5V7SRK.js.map +0 -7
  101. package/dist/chunk-OPTFSJFM.js +0 -5
  102. package/dist/chunk-OPTFSJFM.js.map +0 -7
  103. package/dist/chunk-U2GVQEOB.js.map +0 -7
  104. /package/dist/{chunk-BJVM3LHO.js.map → chunk-AW5LBSEM.js.map} +0 -0
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/components/select/bl-select.css", "../src/components/select/bl-select.ts"],
4
- "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-neutral-full);--border-color:var(--bl-color-neutral-lighter);--border-focus-color:var(--bl-color-primary-highlight);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--label-color:var(--bl-color-neutral-dark);--placeholder-color:var(--bl-color-neutral-light);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-neutral-lightest);--menu-height:250px;--popover-position:var(--bl-popover-position, fixed)}:host([multiple][view-select-all]) .select-wrapper{--menu-height:290px}:host([size=\"large\"]) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size=\"small\"]) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-neutral-light)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-highlight);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);/* stylelint-disable-next-line property-no-vendor-prefix */-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}:host(:not([placeholder])) .placeholder,.select-wrapper.selected .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}:host([label-fixed]) .label,:host(:not([label])) .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-open .select-input,.select-input:focus-visible{border:solid 1px var(--border-focus-color);outline:none}: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:none;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)}legend,label{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:all ease-in 0.1s;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([placeholder]) :where(.select-open, .selected) .label,:host(:not([placeholder])) .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,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}:host([help-text]) .hint,.dirty.invalid .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);/* Make sure option focus doesn't overflow */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:none;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:none}.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 { msg, localized } 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 BlCheckbox from \"../checkbox-group/checkbox/bl-checkbox\";\nimport \"../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 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\n <div @click=${this._togglePopover}>\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 </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 isVisible = option.textContent\n ?.toLocaleLowerCase(this.userLang)\n .includes(this._searchText.toLocaleLowerCase(this.userLang));\n\n option.hidden = !isVisible;\n });\n\n this._selectedOptions = this.options.filter(option => option.selected);\n\n this._handleLastVisibleSearchedOption();\n\n this.requestUpdate();\n }\n\n private _handleLastVisibleSearchedOption() {\n const lastVisibleOption = [...this.options].reverse().find(option => !option.hidden);\n\n if (lastVisibleOption) {\n lastVisibleOption?.shadowRoot?.querySelector(\"div\")?.classList.add(\"no-border-bottom\");\n }\n\n this.options.map(option => {\n if (!option.hidden && option !== lastVisibleOption) {\n option.shadowRoot?.querySelector(\"div\")?.classList.remove(\"no-border-bottom\");\n }\n });\n }\n\n private _handleSingleSelect(optionItem: BlSelectOption<ValueType>) {\n this.value = optionItem.value;\n\n this._searchText = \"\";\n this._handleSelectEvent();\n this.close();\n }\n\n private _handleMultipleSelect() {\n this.value = this._connectedOptions\n .filter(option => option.selected)\n .map(option => option.value);\n\n this._handleSelectEvent();\n }\n\n private _handleSelectOptionEvent(e: CustomEvent) {\n const optionItem = e.target as BlSelectOption<ValueType>;\n\n this.dirty = true;\n\n if (this.multiple) {\n this._handleMultipleSelect();\n } else {\n this._handleSingleSelect(optionItem);\n }\n }\n\n private _handleSelectAll(e: CustomEvent) {\n const selectAllEl = this.shadowRoot?.querySelector(\".select-all\") as BlCheckbox;\n\n const checked = e.detail;\n const unselectedOptions = this._connectedOptions.filter(\n option => !option.selected && !option.hidden\n );\n const isAllUnselectedDisabled = unselectedOptions.every(option => option.disabled);\n\n // If all available options are selected, instead of checking, uncheck all options\n if (checked && isAllUnselectedDisabled) {\n setTimeout(() => {\n const checkbox = selectAllEl?.shadowRoot?.querySelector(\"input\");\n\n checkbox?.click();\n }, 0);\n return;\n }\n\n this._connectedOptions.forEach(option => {\n if (option.disabled || option.hidden) {\n return;\n }\n\n option.selected = checked;\n });\n\n this._handleMultipleSelect();\n }\n\n private _onClickRemove(e: MouseEvent) {\n e.stopPropagation();\n\n this._searchText = \"\";\n\n const selectedDisabledOptions = this._selectedOptions.filter(option => option.disabled);\n\n this._connectedOptions\n .filter(option => !option.disabled && option.selected)\n .forEach(option => {\n option.selected = false;\n });\n\n this.value = selectedDisabledOptions.length\n ? selectedDisabledOptions.map(option => option.value)\n : null;\n this._handleSelectEvent();\n }\n\n private _checkAdditionalItemCount() {\n if (!this.multiple || !this.selectedOptionsItems || this.selectedOptionsItems.length < 2) {\n this._additionalSelectedOptionCount = 0;\n return;\n }\n\n const firstNonVisibleItemIndex = [...this.selectedOptionsItems].findIndex(\n item => item.offsetLeft > this.selectedOptionsContainer.offsetWidth\n );\n\n if (firstNonVisibleItemIndex > -1) {\n this._additionalSelectedOptionCount =\n this.selectedOptionsItems.length - firstNonVisibleItemIndex;\n } else {\n this._additionalSelectedOptionCount = 0;\n }\n }\n\n protected firstUpdated(): void {\n if (this.value === undefined) {\n if (this.multiple) {\n this.value = [];\n } else {\n this.value = null;\n }\n }\n\n this._initialValue = this._value;\n }\n\n protected updated(_changedProperties: PropertyValues) {\n if (\n _changedProperties.has(\"multiple\") &&\n typeof _changedProperties.get(\"multiple\") === \"boolean\"\n ) {\n this.value = null;\n }\n\n if (_changedProperties.has(\"_selectedOptions\")) {\n this._checkAdditionalItemCount();\n }\n }\n\n /**\n * This method is used by `bl-select-option` component to register itself to bl-select.\n * @param option BlSelectOption reference to be registered\n */\n registerOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.push(option);\n\n if (option.selected) {\n if (this.multiple) {\n if (!Array.isArray(this.value)) {\n this.value = [];\n }\n this.value = [...this.value, option.value];\n } else {\n this.value = option.value;\n }\n }\n\n this.setOptionsSelected();\n this.requestUpdate();\n }\n\n /**\n * This method is used by `bl-select-option` component to unregister itself from bl-select.\n * @param option BlSelectOption reference to be unregistered\n */\n unregisterOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.splice(this._connectedOptions.indexOf(option), 1);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-select\": BlSelect;\n }\n}\n"],
5
- "mappings": "qgBACO,IAAMA,EAASC,ikOACfC,EAAQF,ECFf,IAAAG,EAsCqBC,EAArB,cAA4EC,EAC1EC,CACF,CAAE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ath", "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", "isVisible", "lastVisibleOption", "optionItem", "selectAllEl", "checked", "isAllUnselectedDisabled", "checkbox", "selectedDisabledOptions", "firstNonVisibleItemIndex", "_changedProperties", "requiredValidator", "__decorateClass", "stringBooleanConverter", "t", "i", "localized"]
4
+ "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-neutral-full);--border-color:var(--bl-color-neutral-lighter);--border-focus-color:var(--bl-color-primary-highlight);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--label-color:var(--bl-color-neutral-dark);--placeholder-color:var(--bl-color-neutral-light);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-neutral-lightest);--menu-height:250px;--popover-position:var(--bl-popover-position, fixed)}:host([multiple][view-select-all]) .select-wrapper{--menu-height:290px}:host([size=\"large\"]) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size=\"small\"]) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-neutral-light)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-highlight);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);/* stylelint-disable-next-line property-no-vendor-prefix */-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}:host(:not([placeholder])) .placeholder,.select-wrapper.selected .placeholder,:host([label]:not([label-fixed])) .select-wrapper:not(.select-open) .placeholder{display:none}:host([label-fixed]) .label,:host(:not([label])) .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-open .select-input,.select-input:focus-visible{border:solid 1px var(--border-focus-color);outline:none}: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:none;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)}legend,label{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:all ease-in 0.1s;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([placeholder]) :where(.select-open, .selected) .label,:host(:not([placeholder])) .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,.invalid-text,.error-icon{color:var(--bl-color-danger)}.help-text{color:var(--bl-color-neutral-dark)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}:host([help-text]) .hint,.dirty.invalid .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);/* Make sure option focus doesn't overflow */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:none;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:none}.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 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\n <div @click=${this._togglePopover}>\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 </div>\n </fieldset>`;\n\n return this.searchBar\n ? search\n : html`<fieldset\n class=${classMap({\n \"select-input\": true,\n \"has-overflowed-options\": this._additionalSelectedOptionCount > 0,\n })}\n tabindex=\"${ifDefined(this.disabled ? undefined : 0)}\"\n ?autofocus=${this.autofocus}\n @click=${this._togglePopover}\n role=\"button\"\n aria-haspopup=\"listbox\"\n aria-expanded=\"${this.opened}\"\n aria-labelledby=\"label\"\n >\n <legend><span>${this.label}</span></legend>\n <span class=\"placeholder\">${this.placeholder}</span>\n <span class=\"label\">${this.label}</span>\n ${inputSelectedOptions}\n <span class=\"additional-selection-count\">+${this._additionalSelectedOptionCount}</span>\n <div class=\"actions\">\n ${removeButton} ${actionDivider}\n <bl-icon class=\"dropdown-icon open\" name=\"arrow_up\"></bl-icon>\n\n <bl-icon class=\"dropdown-icon closed\" name=\"arrow_down\"></bl-icon>\n </div>\n </fieldset>`;\n }\n\n selectAllTemplate() {\n if (!this.multiple || !this.viewSelectAll || this.noResultFound) {\n return null;\n }\n\n const isAllRenderedOptionsSelected = this._connectedOptions\n .filter(option => !option.hidden)\n .every(option => option.selected);\n\n const isAnySelected = this._selectedOptions.filter(option => !option.hidden).length > 0;\n const selectAllText =\n this.selectAllText ?? msg(\"Select All\", { desc: \"bl-select: select all text\" });\n\n return html`<bl-checkbox\n class=\"select-all\"\n .checked=\"${isAllRenderedOptionsSelected}\"\n .indeterminate=\"${isAnySelected && !isAllRenderedOptionsSelected}\"\n role=\"option\"\n aria-selected=\"${isAllRenderedOptionsSelected}\"\n @bl-checkbox-change=\"${this._handleSelectAll}\"\n >\n ${selectAllText}\n </bl-checkbox>`;\n }\n\n render(): TemplateResult {\n const invalidMessage = !this.checkValidity()\n ? html`<p id=\"errorMessage\" aria-live=\"polite\" class=\"invalid-text\">\n ${this.validationMessage}\n </p>`\n : \"\";\n\n const helpMessage = this.helpText ? html`<p class=\"help-text\">${this.helpText}</p>` : \"\";\n\n const label = this.label ? html`<label id=\"label\">${this.label}</label>` : \"\";\n\n const noDataText =\n this.searchNotFoundText ?? msg(\"No Data Found\", { desc: \"bl-select: search no data text\" });\n\n const clearSearchText =\n this.popoverClearSearchText ??\n msg(\"Clear Search\", { desc: \"bl-select: clear search button text\" });\n\n return html`<div\n class=${classMap({\n \"select-wrapper\": true,\n \"select-open\": this.opened,\n \"selected\": this._selectedOptions.length > 0,\n \"invalid\": !this.validity.valid,\n \"dirty\": this.dirty,\n })}\n @keydown=${this.handleKeydown}\n >\n ${label} ${this.inputTemplate()}\n <div\n class=\"popover\"\n tabindex=\"${ifDefined(this._isPopoverOpen ? undefined : \"-1\")}\"\n @bl-select-option=${this._handleSelectOptionEvent}\n role=\"listbox\"\n aria-multiselectable=\"${this.multiple}\"\n aria-labelledby=\"label\"\n >\n ${this.selectAllTemplate()}\n <slot></slot>\n ${this.searchBar && this.noResultFound\n ? html`<div name=\"popover-clear-search-text\" class=\"popover-no-result\">\n <span>${noDataText}</span>\n <bl-button\n variant=\"tertiary\"\n @click=${() => {\n this._handleSearchOptions({ target: { value: \"\" } } as InputEvent & {\n target: HTMLInputElement;\n });\n }}\n >${clearSearchText}</bl-button\n >\n </div>`\n : \"\"}\n </div>\n <div class=\"hint\">${invalidMessage} ${helpMessage}</div>\n </div> `;\n }\n\n private focusedOptionIndex = -1;\n private lastKeyPressedTime = 0;\n private typedCharacters = \"\";\n private keyPressThreshold = 500;\n\n private handleFocusOptionByKey(key: string) {\n const currentTime = Date.now();\n const elapsedTimeSinceLastKeyPress = currentTime - this.lastKeyPressedTime;\n\n if (elapsedTimeSinceLastKeyPress > this.keyPressThreshold) {\n this.typedCharacters = \"\";\n }\n\n this.lastKeyPressedTime = currentTime;\n this.typedCharacters += key.toLowerCase();\n\n const matchingOptionIndex = this.options.findIndex(option => {\n if (option.disabled) {\n return false;\n }\n const optionText = option.innerText.trim().toLowerCase();\n\n return optionText.startsWith(this.typedCharacters);\n });\n\n if (matchingOptionIndex !== -1) {\n this.focusedOptionIndex = matchingOptionIndex;\n this.options[matchingOptionIndex].focus();\n }\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (this.focusedOptionIndex === -1 && [\"Enter\", \"Space\"].includes(event.code)) {\n this._togglePopover();\n event.preventDefault();\n } else if (this._isPopoverOpen === false && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n this.open();\n event.preventDefault();\n } else if (event.code === \"Escape\") {\n this.close();\n event.preventDefault();\n } else if (this._isPopoverOpen && [\"ArrowDown\", \"ArrowUp\"].includes(event.code)) {\n const activeOptions = this.options.filter(option => !option.disabled);\n\n event.code === \"ArrowDown\" && this.focusedOptionIndex++;\n event.code === \"ArrowUp\" && this.focusedOptionIndex--;\n\n // Don't exceed array indexes\n this.focusedOptionIndex = Math.max(\n 0,\n Math.min(this.focusedOptionIndex, activeOptions.length - 1)\n );\n\n activeOptions[this.focusedOptionIndex].focus();\n\n event.preventDefault();\n } else if (this._isPopoverOpen && !this.searchBar) {\n this.handleFocusOptionByKey(event.key);\n }\n }\n\n private _togglePopover() {\n this._isPopoverOpen ? this.close() : this.open();\n }\n\n private _handleSelectEvent() {\n const options = this._selectedOptions.map(\n option =>\n ({\n value: option.value,\n selected: option.selected,\n text: option.textContent,\n } as ISelectOption<ValueType>)\n );\n\n if (!this.multiple) this._onBlSelect(options[0]);\n else this._onBlSelect(options);\n }\n\n private _handleSearchEvent() {\n this._onBlSearch(this._searchText);\n }\n\n private _handleSearchOptions(e: InputEvent): void {\n if (!this.searchBar) return;\n\n this._searchText = (e.target as HTMLInputElement).value;\n\n this._handleSearchEvent();\n\n this._connectedOptions.forEach(option => {\n const searchText = this._searchText.toLowerCase();\n let optionText = \"\";\n\n if (option.textContent) {\n try {\n // Try locale-specific comparison first\n optionText = option.textContent.toLocaleLowerCase(this.userLang);\n } catch {\n // Fallback to basic toLowerCase if locale is not supported\n optionText = option.textContent.toLowerCase();\n }\n }\n\n const isVisible = optionText.includes(searchText);\n\n option.hidden = !isVisible;\n });\n\n this._selectedOptions = this.options.filter(option => option.selected);\n this._handleLastVisibleSearchedOption();\n this.requestUpdate();\n }\n\n private _handleLastVisibleSearchedOption() {\n const lastVisibleOption = [...this.options].reverse().find(option => !option.hidden);\n\n if (lastVisibleOption) {\n lastVisibleOption?.shadowRoot?.querySelector(\"div\")?.classList.add(\"no-border-bottom\");\n }\n\n this.options.map(option => {\n if (!option.hidden && option !== lastVisibleOption) {\n option.shadowRoot?.querySelector(\"div\")?.classList.remove(\"no-border-bottom\");\n }\n });\n }\n\n private _handleSingleSelect(optionItem: BlSelectOption<ValueType>) {\n this.value = optionItem.value;\n\n this._searchText = \"\";\n this._handleSelectEvent();\n this.close();\n }\n\n private _handleMultipleSelect() {\n this.value = this._connectedOptions\n .filter(option => option.selected)\n .map(option => option.value);\n\n this._handleSelectEvent();\n }\n\n private _handleSelectOptionEvent(e: CustomEvent) {\n const optionItem = e.target as BlSelectOption<ValueType>;\n\n this.dirty = true;\n\n if (this.multiple) {\n this._handleMultipleSelect();\n } else {\n this._handleSingleSelect(optionItem);\n }\n }\n\n private _handleSelectAll(e: CustomEvent) {\n const selectAllEl = this.shadowRoot?.querySelector(\".select-all\") as BlCheckbox;\n\n const checked = e.detail;\n const unselectedOptions = this._connectedOptions.filter(\n option => !option.selected && !option.hidden\n );\n const isAllUnselectedDisabled = unselectedOptions.every(option => option.disabled);\n\n // If all available options are selected, instead of checking, uncheck all options\n if (checked && isAllUnselectedDisabled) {\n setTimeout(() => {\n const checkbox = selectAllEl?.shadowRoot?.querySelector(\"input\");\n\n checkbox?.click();\n }, 0);\n return;\n }\n\n this._connectedOptions.forEach(option => {\n if (option.disabled || option.hidden) {\n return;\n }\n\n option.selected = checked;\n });\n\n this._handleMultipleSelect();\n }\n\n private _onClickRemove(e: MouseEvent) {\n e.stopPropagation();\n\n this._searchText = \"\";\n\n const selectedDisabledOptions = this._selectedOptions.filter(option => option.disabled);\n\n this._connectedOptions\n .filter(option => !option.disabled && option.selected)\n .forEach(option => {\n option.selected = false;\n });\n\n this.value = selectedDisabledOptions.length\n ? selectedDisabledOptions.map(option => option.value)\n : null;\n this._handleSelectEvent();\n }\n\n private _checkAdditionalItemCount() {\n if (!this.multiple || !this.selectedOptionsItems || this.selectedOptionsItems.length < 2) {\n this._additionalSelectedOptionCount = 0;\n return;\n }\n\n const firstNonVisibleItemIndex = [...this.selectedOptionsItems].findIndex(\n item => item.offsetLeft > this.selectedOptionsContainer.offsetWidth\n );\n\n if (firstNonVisibleItemIndex > -1) {\n this._additionalSelectedOptionCount =\n this.selectedOptionsItems.length - firstNonVisibleItemIndex;\n } else {\n this._additionalSelectedOptionCount = 0;\n }\n }\n\n protected firstUpdated(): void {\n if (this.value === undefined) {\n if (this.multiple) {\n this.value = [];\n } else {\n this.value = null;\n }\n }\n\n this._initialValue = this._value;\n }\n\n protected updated(_changedProperties: PropertyValues) {\n if (\n _changedProperties.has(\"multiple\") &&\n typeof _changedProperties.get(\"multiple\") === \"boolean\"\n ) {\n this.value = null;\n }\n\n if (_changedProperties.has(\"_selectedOptions\")) {\n this._checkAdditionalItemCount();\n }\n }\n\n /**\n * This method is used by `bl-select-option` component to register itself to bl-select.\n * @param option BlSelectOption reference to be registered\n */\n registerOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.push(option);\n\n if (option.selected) {\n if (this.multiple) {\n if (!Array.isArray(this.value)) {\n this.value = [];\n }\n this.value = [...this.value, option.value];\n } else {\n this.value = option.value;\n }\n }\n\n this.setOptionsSelected();\n this.requestUpdate();\n }\n\n /**\n * This method is used by `bl-select-option` component to unregister itself from bl-select.\n * @param option BlSelectOption reference to be unregistered\n */\n unregisterOption(option: BlSelectOption<ValueType>) {\n this._connectedOptions.splice(this._connectedOptions.indexOf(option), 1);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-select\": BlSelect;\n }\n}\n"],
5
+ "mappings": "qgBACO,IAAMA,EAASC,ikOACfC,EAAQF,ECFf,IAAAG,EAsCqBC,EAArB,cAA4EC,EAC1EC,CACF,CAAE,CAFF,kCAgEE,UAAmB,SAMnB,cAAW,GAMX,cAAW,GAMX,eAAY,GAMZ,cAAW,GAMX,eAAY,GAMZ,gBAAa,GAkBb,mBAAgB,GAYhB,eAAY,GA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1C,EAAS,CAAE,KAAM,QAAS,UAAW,aAAc,QAAS,EAAK,CAAC,GAjIhDrB,EAkInB,yBAMA+D,EAAA,CADC1C,EAAS,CAAE,KAAM,OAAQ,UAAW,yBAA0B,QAAS,EAAK,CAAC,GAvI3DrB,EAwInB,oCAUA+D,EAAA,CALC1C,EAAS,CACR,KAAM,QACN,UAAW,2BACX,UAAW2C,EAAuB,CACpC,CAAC,GAjJkBhE,EAkJnB,qCAMA+D,EAAA,CADC1C,EAAS,CAAE,KAAM,OAAQ,UAAW,wBAAyB,QAAS,EAAK,CAAC,GAvJ1DrB,EAwJnB,kCAMA+D,EAAA,CADC1C,EAAS,CAAE,KAAM,OAAQ,UAAW,4BAA6B,QAAS,EAAK,CAAC,GA7J9DrB,EA8JnB,sCAIQ+D,EAAA,CADPE,EAAM,GAjKYjE,EAkKX,8BAGA+D,EAAA,CADPE,EAAM,GApKYjE,EAqKX,8CAGA+D,EAAA,CADPE,EAAM,GAvKYjE,EAwKX,2BAGA+D,EAAA,CADPG,EAAM,mBAAmB,GA1KPlE,EA2KX,wCAGA+D,EAAA,CADP1C,EAAS,sBAAsB,GA7KbrB,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
7
  }
@@ -0,0 +1,84 @@
1
+ import{a as w,b as Y}from"./chunk-WEEGH2F4.js";import{a as C}from"./chunk-6LT7O7T2.js";import{a as M}from"./chunk-GRL4DWKG.js";import{a as A,b as g,c as y}from"./chunk-5MOOXA2X.js";import{a as x,b as c,f as S}from"./chunk-4OT5AMS5.js";import{d as r}from"./chunk-IZ2LK5GK.js";function k(p){let _=[],e=p.split(",");return e==null||e.forEach(t=>{let a=new Date(t.trim());isNaN(a.getTime())||_.push(a)}),_}var o=class extends S{constructor(){super(...arguments);this.startOfWeek=0;this.locale=document.documentElement.lang||"en-EN";this._selectedDates=[];this._disabledDates=[]}get disabledDates(){return this._disabledDates}set disabledDates(e){let t=[];typeof e=="string"?t=k(e):Array.isArray(e)&&(t=e.filter(a=>!isNaN(a.getTime()))),this.requestUpdate("disabledDates",t),this._disabledDates=t}get maxDate(){return this._maxDate}set maxDate(e){this._minDate&&this._minDate>=e?console.warn("maxDate cannot be smaller than minDate."):this._maxDate=e}get minDate(){return this._minDate}set minDate(e){this._maxDate&&this._maxDate<=e?console.warn("minDate cannot be greater than maxDate."):this._minDate=e}get value(){return this._value}set value(e){if(e){let t=this._value,a=[];typeof e=="string"?a=k(e):e instanceof Date?a.push(e):Array.isArray(e)&&(a=e),a.length>0&&(this.type==="single"&&a.length>1?console.warn("'value' must be a single Date for single type selection."):this.type==="range"&&Array.isArray(a)&&a.length!=2?console.warn("'value' must be an array of two Date objects when the type selection mode is set to range."):(this._value=e,this._selectedDates=a)),this.requestUpdate("value",t)}}};r([g()],o.prototype,"type",2),r([g({type:Number,attribute:"start-of-week",reflect:!0})],o.prototype,"startOfWeek",2),r([g()],o.prototype,"locale",2),r([y()],o.prototype,"_selectedDates",2),r([g({attribute:"disabled-dates",type:Array,reflect:!0})],o.prototype,"disabledDates",1),r([g({type:Date,attribute:"max-date",reflect:!0})],o.prototype,"maxDate",1),r([g({type:Date,attribute:"min-date",reflect:!0})],o.prototype,"minDate",1),r([g({attribute:"value",reflect:!0})],o.prototype,"value",1);var E=x`.calendar{display:flex;flex-direction:column}.calendar-content{display:flex;padding:var(--bl-size-m);flex-direction:column;align-items:center;gap:var(--bl-size-m);border-radius:var(--bl-border-radius-s);width:fit-content;background:var(--bl-color-neutral-full)}.calendar-header{display:flex;justify-content:space-between;width:100%;align-items:center;padding-bottom:var(--bl-size-s)}.arrow{flex:1}.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-top-left-radius:50%;border-bottom-left-radius:50%}.range-end-day{background:var(--bl-color-primary-contrast);border-top-right-radius:50%;border-bottom-right-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)}`,T=E;var d=class extends o{constructor(){super(...arguments);this.today=new Date;this._calendarMonth=this.today.getMonth();this._calendarYear=this.today.getFullYear();this._calendarView="days";this._calendarYears=[];this._calendarDays=[];this.handleClearSelectedDates=()=>{this._selectedDates=[],this._onBlCalendarChange([]),this.clearRangePickerStyles()}}static get styles(){return[T]}get months(){return[...Array(12).keys()].map(e=>({name:new Date(0,e+1,0).toLocaleString(this.locale,{month:"long"}),value:e}))}get days(){return[...Array(7).keys()].map(e=>({name:new Date(0,0,e).toLocaleString(this.locale,{weekday:"short"}),value:e}))}getDayNumInAMonth(e,t){return new Date(e,t+1,0).getDate()}getWeekDayOfDate(e,t){return new Date(e,t,1).getDay()}setPreviousCalendarView(){if(this.clearRangePickerStyles(),this._calendarView==="days")this._calendarMonth===0?(this._calendarMonth=11,this._calendarYear-=1):this._calendarMonth-=1;else if(this._calendarView==="months")this._calendarYear-=1;else if(this._calendarView==="years"){let e=this._calendarYears[0];this._calendarYears=Array.from({length:12},(t,a)=>e-(a+1))}this.type==="range"&&this.setHoverClass()}setNextCalendarView(){if(this.clearRangePickerStyles(),this._calendarView==="days")this._calendarMonth===11?(this._calendarMonth=0,this._calendarYear+=1):this._calendarMonth+=1;else if(this._calendarView==="months")this._calendarYear+=1;else if(this._calendarView==="years"){let e=this._calendarYears[11];this._calendarYears=Array.from({length:12},(t,a)=>e+(a+1))}this.setHoverClass()}setCurrentCalendarView(e){this._calendarView=this._calendarView!==e?e:"days",this.setHoverClass()}setMonthAndCalendarView(e){this._calendarMonth=e,this._calendarView="days",this.type==="range"&&this.setHoverClass()}setYearAndCalendarView(e){this._calendarYear=e,this._calendarView="days",this.type==="range"&&this.setHoverClass()}generateSurroundingYears(){this._calendarYears.length||(this._calendarYears=Array.from({length:12},(e,t)=>this._calendarYear-4+t))}clearRangePickerStyles(){var e;(e=this.shadowRoot)==null||e.querySelectorAll(".range-day, .range-start-day, .range-end-day").forEach(t=>t.classList.remove("range-day","range-start-day","range-end-day"))}handleDate(e){if(this.type!=="range"){let t=e.getFullYear()<this._calendarYear||e.getFullYear()===this._calendarYear&&e.getMonth()<this._calendarMonth,a=e.getFullYear()>this._calendarYear||e.getFullYear()===this._calendarYear&&e.getMonth()>this._calendarMonth;t?this.setPreviousCalendarView():a&&this.setNextCalendarView()}switch(this.type){case"single":this.handleSingleSelectCalendar(e);break;case"multiple":this.handleMultipleSelectCalendar(e);break;case"range":this.handleRangeSelectCalendar(e);break}this._onBlCalendarChange(this._selectedDates),this.requestUpdate()}handleSingleSelectCalendar(e){this._selectedDates=[e]}handleMultipleSelectCalendar(e){var a,s,i;((a=this._selectedDates)==null?void 0:a.some(n=>n.getTime()===e.getTime()))?(i=this._selectedDates)==null||i.splice((s=this._selectedDates)==null?void 0:s.findIndex(n=>n.getTime()===e.getTime()),1):this._selectedDates.push(e)}handleRangeSelectCalendar(e){if(!this._selectedDates[0])this._selectedDates[0]=e;else if(this._selectedDates[1])this._selectedDates=[],this._selectedDates[0]=e;else if(e.getTime()>this._selectedDates[0].getTime())this._selectedDates[1]=e;else{let t=this._selectedDates[0];this._selectedDates[0]=e,this._selectedDates[1]=t}this.setHoverClass()}checkIfSelectedDate(e){var t;return(t=this._selectedDates)==null?void 0:t.some(a=>(a==null?void 0:a.getTime())===e.getTime())}checkIfDateIsToday(e){let t=this.today;return t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}checkIfDateIsDisabled(e){var t,a;return e.getTime()<((t=this.minDate)==null?void 0:t.getTime())||e.getTime()>((a=this.maxDate)==null?void 0:a.getTime())?!0:this.disabledDates.length>0?this.disabledDates.some(s=>e.getDate()===s.getDate()&&e.getMonth()===s.getMonth()&&e.getFullYear()===s.getFullYear()):!1}setHoverClass(){this.clearRangePickerStyles(),this._selectedDates[0]&&this._selectedDates[1]&&setTimeout(()=>{var s,i,n,b,u,f,l,h,m;let e=(n=(i=this.shadowRoot)==null?void 0:i.getElementById(`${(s=this._selectedDates[0])==null?void 0:s.getTime()}`))==null?void 0:n.parentElement;e==null||e.classList.add("range-start-day");let t=(f=(u=this.shadowRoot)==null?void 0:u.getElementById(`${(b=this._selectedDates[1])==null?void 0:b.getTime()}`))==null?void 0:f.parentElement;t==null||t.classList.add("range-end-day");let a=[...this.createCalendarDays().values()].flat().filter(D=>D.getTime()>this._selectedDates[0].getTime()&&D.getTime()<this._selectedDates[1].getTime());for(let D=0;D<a.length;D++){let v=(h=(l=this.shadowRoot)==null?void 0:l.getElementById(`${a[D].getTime()}`))==null?void 0:h.parentElement;(m=v==null?void 0:v.classList)==null||m.add("range-day")}})}createCalendarDays(){var u,f;let e=new Map;this._calendarDays=this.days.slice(this.startOfWeek).concat(this.days.slice(0,this.startOfWeek));let t=this.getWeekDayOfDate(this._calendarYear,this._calendarMonth),a=t<this.startOfWeek?7-(this.startOfWeek-t):t-this.startOfWeek,s=this.getDayNumInAMonth(this._calendarYear,this._calendarMonth-1),i=this.getDayNumInAMonth(this._calendarYear,this._calendarMonth),n=this.startOfWeek;for(let l=a;l>0;l--){let h=n%7,m=new Date(this._calendarYear,this._calendarMonth-1,s-l+1);e.set(this.days[h].name,[m]),n+=1}for(let l=1;l<=i;l++){let h=n%7,m=new Date(this._calendarYear,this._calendarMonth,l);e.get(this.days[h].name)?(u=e.get(this.days[h].name))==null||u.push(m):e.set(this.days[h].name,[m]),n+=1}let b=this._calendarDays.findIndex(l=>l.value===n%7);if(b!==0)for(let l=1;l<=this._calendarDays.length-b;l++){let h=n%7,m=new Date(this._calendarYear,this._calendarMonth+1,l);(f=e.get(this.days[h].name))==null||f.push(m),n+=1}return e}renderCalendarHeader(){let e=this._calendarView==="months"?"header-text-hover":"",t=this._calendarView==="years"?"header-text-hover":"";return c`
2
+ <div class="calendar-header">
3
+ <bl-button
4
+ class="arrow"
5
+ icon="arrow_left"
6
+ variant="tertiary"
7
+ kind="neutral"
8
+ @click="${()=>this.setPreviousCalendarView()}"
9
+ ></bl-button>
10
+ <bl-button
11
+ variant="tertiary"
12
+ kind="neutral"
13
+ class="header-text ${e}"
14
+ @click="${()=>this.setCurrentCalendarView("months")}"
15
+ >${this.months[this._calendarMonth].name}
16
+ </bl-button>
17
+ <bl-button
18
+ variant="tertiary"
19
+ kind="neutral"
20
+ class="header-text ${t}"
21
+ @click="${()=>this.setCurrentCalendarView("years")}"
22
+ >${this._calendarYear}
23
+ </bl-button>
24
+ <bl-button
25
+ class="arrow"
26
+ icon="arrow_right"
27
+ variant="tertiary"
28
+ kind="neutral"
29
+ @click="${()=>this.setNextCalendarView()}"
30
+ ></bl-button>
31
+ </div>
32
+ `}renderCalendarDays(){let e=this.createCalendarDays(),t=Array.from(e.values());return c`
33
+ <div class="week-row">
34
+ ${[...e.keys()].map(a=>c` <div class="calendar-text weekday-text">${a}</div> `)}
35
+ </div>
36
+ <div class="days-wrapper">
37
+ ${[...Array(t[0].length).keys()].map(a=>c` <div class="week-row">
38
+ ${t.map(s=>{let i=s[a],n=this.checkIfSelectedDate(i),b=this.checkIfDateIsToday(i),u=this.checkIfDateIsDisabled(i),f=C({day:!0,"calendar-text":!0,"today-day":b,"selected-day":n,"other-month-day":s[a].getMonth()!==this._calendarMonth,"disabled-day":u});return c`
39
+ <div class="day-wrapper">
40
+ <bl-button
41
+ id=${i.getTime()}
42
+ variant="tertiary"
43
+ kind="neutral"
44
+ size="small"
45
+ class=${f}
46
+ ?disabled=${u}
47
+ @click="${()=>!u&&this.handleDate(i)}"
48
+ >
49
+ ${i.getDate()}
50
+ </bl-button>
51
+ </div>
52
+ `})}
53
+ </div>`)}
54
+ </div>
55
+ </div>`}renderCalendarMonths(){return c` <div class="grid-content">
56
+ ${this.months.map((e,t)=>{let a=e.value===this._calendarMonth?"primary":"tertiary",s=e.value===this._calendarMonth?"default":"neutral";return c` <bl-button
57
+ variant=${a}
58
+ kind=${s}
59
+ class="grid-item"
60
+ size="small"
61
+ @click="${()=>this.setMonthAndCalendarView(t)}"
62
+ ><span class="calendar-text">${e.name}</span></bl-button
63
+ >`})}
64
+ </div>`}renderCalendarYears(){return this.generateSurroundingYears(),c` <div class="grid-content">
65
+ ${this._calendarYears.map(e=>{let t=e===this._calendarYear?"primary":"tertiary",a=e===this._calendarYear?"default":"neutral";return c` <bl-button
66
+ variant=${t}
67
+ kind=${a}
68
+ class="grid-item"
69
+ @click="${()=>this.setYearAndCalendarView(e)}"
70
+ ><span class="calendar-text">${e}</span></bl-button
71
+ >`})}
72
+ </div>`}render(){return c`
73
+ <div>
74
+ <div class="calendar-content">
75
+ <div class="calendar">
76
+ ${this.renderCalendarHeader()}
77
+ ${this._calendarView==="days"?this.renderCalendarDays():""}
78
+ ${this._calendarView==="months"?this.renderCalendarMonths():""}
79
+ ${this._calendarView==="years"?this.renderCalendarYears():""}
80
+ </div>
81
+ </div>
82
+ </div>
83
+ `}};r([y()],d.prototype,"today",2),r([y()],d.prototype,"_calendarMonth",2),r([y()],d.prototype,"_calendarYear",2),r([y()],d.prototype,"_calendarView",2),r([y()],d.prototype,"_calendarYears",2),r([y()],d.prototype,"_calendarDays",2),r([M("bl-calendar-change")],d.prototype,"_onBlCalendarChange",2),d=r([A("bl-calendar")],d);export{o as a,d as b};
84
+ //# sourceMappingURL=chunk-T3UQYGO3.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/utilities/string-to-date-converter.ts", "../src/mixins/datepicker-calendar-mixin/datepicker-calendar-mixin.ts", "../src/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, state } from \"lit/decorators.js\";\nimport { CALENDAR_TYPES } from \"../../components/calendar/bl-calendar.constant\";\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 @state()\n _selectedDates: Date[] = [];\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 type: Array,\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 (this._minDate && this._minDate >= maxDate) {\n console.warn(\"maxDate cannot be smaller than minDate.\");\n } else {\n this._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 (this._maxDate && this._maxDate <= minDate) {\n console.warn(\"minDate cannot be greater than maxDate.\");\n } else {\n this._minDate = minDate;\n }\n }\n\n /**\n * Target elements state\n */\n protected _value: Date | Date[] | string;\n\n /**\n * Sets the target element of the popover to align and trigger.\n * It can be a string id of the target element or can be a direct Element reference of it.\n */\n get value() {\n return this._value;\n }\n\n @property({ attribute: \"value\", reflect: true })\n set value(value: string | Date | Date[]) {\n if (value) {\n const oldValue = this._value;\n let tempVal: Date[] = [];\n\n if (typeof value === \"string\") {\n tempVal = stringToDateArray(value);\n } else if (value instanceof Date) {\n tempVal.push(value);\n } else if (Array.isArray(value)) {\n tempVal = value;\n }\n\n if (tempVal.length > 0) {\n if (this.type === CALENDAR_TYPES.SINGLE && tempVal.length > 1) {\n console.warn(\"'value' must be a single Date for single type selection.\");\n } else if (\n this.type === CALENDAR_TYPES.RANGE &&\n Array.isArray(tempVal) &&\n tempVal.length != 2\n ) {\n console.warn(\n \"'value' must be an array of two Date objects when the type selection mode is set to range.\"\n );\n } else {\n this._value = value;\n this._selectedDates = tempVal;\n }\n }\n\n this.requestUpdate(\"value\", oldValue);\n }\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}.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-top-left-radius:50%;border-bottom-left-radius:50%}.range-end-day{background:var(--bl-color-primary-contrast);border-top-right-radius:50%;border-bottom-right-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 } from \"lit\";\nimport { customElement, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport DatepickerCalendarMixin from \"../../mixins/datepicker-calendar-mixin/datepicker-calendar-mixin\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\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\")\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 /**\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 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._selectedDates = [];\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._selectedDates);\n this.requestUpdate();\n }\n\n handleSingleSelectCalendar(calendarDate: Date) {\n this._selectedDates = [calendarDate];\n }\n\n handleMultipleSelectCalendar(calendarDate: Date) {\n const dateExist = this._selectedDates?.some(d => d.getTime() === calendarDate.getTime());\n\n dateExist\n ? this._selectedDates?.splice(\n this._selectedDates?.findIndex(d => d.getTime() === calendarDate.getTime()),\n 1\n )\n : this._selectedDates.push(calendarDate);\n }\n\n handleRangeSelectCalendar(calendarDate: Date) {\n if (!this._selectedDates[0]) {\n this._selectedDates[0] = calendarDate;\n } else if (!this._selectedDates[1]) {\n if (calendarDate.getTime() > this._selectedDates[0].getTime()) {\n this._selectedDates[1] = calendarDate;\n } else {\n const tempEndDate = this._selectedDates[0];\n\n this._selectedDates[0] = calendarDate;\n this._selectedDates[1] = tempEndDate;\n }\n } else {\n this._selectedDates = [];\n this._selectedDates[0] = calendarDate;\n }\n this.setHoverClass();\n }\n\n checkIfSelectedDate(calendarDate: Date) {\n return this._selectedDates?.some(date => date?.getTime() === calendarDate.getTime());\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._selectedDates[0] && this._selectedDates[1]) {\n setTimeout(() => {\n const startDateParentElement = this.shadowRoot?.getElementById(\n `${this._selectedDates[0]?.getTime()}`\n )?.parentElement;\n\n startDateParentElement?.classList.add(\"range-start-day\");\n\n const endDateParentElement = this.shadowRoot?.getElementById(\n `${this._selectedDates[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._selectedDates[0]!.getTime() &&\n date.getTime() < this._selectedDates[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 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`\n <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 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`\n <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 ${date.getDate()}\n </bl-button>\n </div>\n `;\n })}\n </div>`;\n })}\n </div>\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": "mRAAO,SAASA,EAAkBC,EAAuB,CACvD,IAAMC,EAAoB,CAAC,EACrBC,EAAaF,EAAM,MAAM,GAAG,EAElC,OAAAE,GAAA,MAAAA,EAAY,QAAQC,GAAQ,CAC1B,IAAMC,EAAS,IAAI,KAAKD,EAAK,KAAK,CAAC,EAE9B,MAAMC,EAAO,QAAQ,CAAC,GACzBH,EAAU,KAAKG,CAAM,CAEzB,GACOH,CACT,CCNA,IAAqBI,EAArB,cAAqDC,CAAW,CAAhE,kCAUE,iBAAyB,EAKzB,YAAiB,SAAS,gBAAgB,MAAQ,QAElD,oBAAyB,CAAC,EAK1B,KAAU,eAAyB,CAAC,EAEpC,IAAI,eAAwB,CAC1B,OAAO,KAAK,cACd,CAOA,IAAI,cAAcC,EAAgC,CAKhD,IAAIC,EA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yC;AAAA,oBACKU;AAAA,iBACHC;AAAA;AAAA;AAAA,oBAGG,IAAM,KAAK,wBAAwBf,CAAK;AAAA,yCACnBrC,EAAM;AAAA,UAEzC,CAAC;AAAA,WAEL,CAEA,qBAAsB,CACpB,YAAK,yBAAyB,EACvByC;AAAA,QACH,KAAK,eAAe,IAAIvC,GAAQ,CAChC,IAAMiD,EAAUjD,IAAS,KAAK,cAAgB,UAAY,WACpDkD,EAAUlD,IAAS,KAAK,cAAgB,UAAY,UAE1D,OAAOuC;AAAA,oBACKU;AAAA,iBACHC;AAAA;AAAA,oBAEG,IAAM,KAAK,uBAAuBlD,CAAI;AAAA,yCACjBA;AAAA,UAEnC,CAAC;AAAA,WAEL,CAEA,QAAS,CACP,OAAOuC;AAAA;AAAA;AAAA;AAAA,cAIG,KAAK,qBAAqB;AAAA,cAC1B,KAAK,uBAAwC,KAAK,mBAAmB,EAAI;AAAA,cACzE,KAAK,yBAA0C,KAAK,qBAAqB,EAAI;AAAA,cAC7E,KAAK,wBAAyC,KAAK,oBAAoB,EAAI;AAAA;AAAA;AAAA;AAAA,KAKvF,CACF,EA3cEY,EAAA,CADCC,EAAM,GADYzD,EAEnB,qBAEAwD,EAAA,CADCC,EAAM,GAHYzD,EAInB,8BAEAwD,EAAA,CADCC,EAAM,GALYzD,EAMnB,6BAEAwD,EAAA,CADCC,EAAM,GAPYzD,EAQnB,6BAEAwD,EAAA,CADCC,EAAM,GATYzD,EAUnB,8BAEAwD,EAAA,CADCC,EAAM,GAXYzD,EAYnB,6BAI6BwD,EAAA,CAA5BE,EAAM,oBAAoB,GAhBR1D,EAgBU,mCAhBVA,EAArBwD,EAAA,CADCG,EAAc,aAAa,GACP3D",
6
+ "names": ["stringToDateArray", "value", "tempValue", "splitDates", "date", "isDate", "DatepickerCalendarMixin", "s", "disabledDates", "newVal", "stringToDateArray", "d", "maxDate", "minDate", "value", "oldValue", "tempVal", "__decorateClass", "e", "t", "styles", "i", "bl_calendar_default", "BlCalendar", "DatepickerCalendarMixin", "bl_calendar_default", "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", "showMonthSelected", "showYearSelected", "x", "calendarDays", "valuesArray", "key", "values", "isSelectedDay", "isDayToday", "isDisabledDay", "classes", "o", "variant", "neutral", "__decorateClass", "t", "event", "e"]
7
+ }
@@ -1,4 +1,4 @@
1
- import{a as d}from"./chunk-6LT7O7T2.js";import{a as u}from"./chunk-ECPWEUBG.js";import{a as m}from"./chunk-GRL4DWKG.js";import{a as l,b as o,e as i}from"./chunk-5MOOXA2X.js";import{a as s,b as r,f as n}from"./chunk-4OT5AMS5.js";import{d as e}from"./chunk-IZ2LK5GK.js";var p=s`:host{display:block}.accordion{--border:1px solid var(--bl-color-neutral-lighter);--default-radius:var(--bl-size-2xs);--radius-top-left:var(--bl-accordion-radius-top-left, var(--default-radius));--radius-top-right:var(--bl-accordion-radius-top-right, var(--default-radius));--radius-bottom-right:var(--bl-accordion-radius-bottom-right, var(--default-radius));--radius-bottom-left:var(--bl-accordion-radius-bottom-left, var(--default-radius));width:100%}.summary{list-style:none;user-select:none;cursor:pointer;font:var(--bl-font-title-3-medium);display:flex;align-items:center;justify-content:space-between;gap:var(--bl-size-2xs);padding:var(--bl-size-m);background:var(--bl-color-neutral-full);color:var(--bl-color-neutral-darker);border:var(--border);border-bottom:var(--bl-accordion-border-bottom, var(--border));border-radius:var(--radius-top-left) var(--radius-top-right) var(--radius-bottom-right) var(--radius-bottom-left);transition:background-color 200ms}.summary::-webkit-details-marker{display:none}.summary.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__,.summary:hover{background:var(--bl-color-neutral-lightest)}.summary:focus-visible{outline:2px solid var(--bl-color-primary);outline-offset:-1px}.indicator{transition:transform 200ms}.accordion[open] .indicator{transform:rotate(180deg)}.accordion[open] .summary{border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.caption{flex:1}.accordion-content{padding:var(--bl-size-m);background:var(--bl-color-neutral-full);border:var(--border);border-top:0;border-bottom:var(--bl-accordion-border-bottom, var(--border));border-bottom-left-radius:var(--radius-bottom-left);border-bottom-right-radius:var(--radius-bottom-right);font:var(--bl-font-body-text-2-regular)}.disabled .summary{cursor:not-allowed;background:var(--bl-color-neutral-lightest);color:var(--bl-color-neutral-light)}`,c=p;var t=class extends n{constructor(){super(...arguments);this.open=!1;this.disabled=!1;this.animationDuration=250;this._animationStatus=null}static get styles(){return[c]}_animate(a){this._animationStatus=a?0:1;let b=`${this.detailsEl.offsetHeight}px`,h=a?`${this.summaryEl.offsetHeight+this.contentEl.offsetHeight}px`:`${this.summaryEl.offsetHeight}px`;this._animation&&this._animation.cancel(),this._animation=this.detailsEl.animate({height:[b,h]},{duration:this.animationDuration,easing:"ease-out"}),this._animation.onfinish=()=>this._onAnimationFinish(a),this._animation.oncancel=()=>this._animationStatus=null}_onAnimationFinish(a){this.open=a,this._animation=null,this._animationStatus=null,this.detailsEl.style.height=this.detailsEl.style.overflow=""}expand(){this.detailsEl.style.overflow="hidden",this.detailsEl.style.height=`${this.detailsEl.offsetHeight}px`,this.open=!0,this._animate(!0)}collapse(){this._animate(!1)}_clickHandler(a){a.preventDefault(),!this.disabled&&(this._animationStatus===1||!this.open?this.expand():(this._animationStatus===0||this.open)&&this.collapse())}updated(a){if(a.has("open")){if(this.disabled&&this.open){this._onAnimationFinish(!1);return}this._onToggle(this.open)}}render(){let a=this.icon?r`<bl-icon class="icon" name=${this.icon===!0?"info":this.icon}></bl-icon>`:null;return r`<details
1
+ import{a as d}from"./chunk-6LT7O7T2.js";import{a as u}from"./chunk-ECPWEUBG.js";import{a as m}from"./chunk-GRL4DWKG.js";import{a as l,b as o,e as i}from"./chunk-5MOOXA2X.js";import{a as s,b as r,f as n}from"./chunk-4OT5AMS5.js";import{d as e}from"./chunk-IZ2LK5GK.js";var p=s`:host{display:block}.accordion{--border:1px solid var(--bl-color-neutral-lighter);--default-radius:var(--bl-size-2xs);--radius-top-left:var(--bl-accordion-radius-top-left, var(--default-radius));--radius-top-right:var(--bl-accordion-radius-top-right, var(--default-radius));--radius-bottom-right:var(--bl-accordion-radius-bottom-right, var(--default-radius));--radius-bottom-left:var(--bl-accordion-radius-bottom-left, var(--default-radius));width:100%}.summary{list-style:none;user-select:none;cursor:pointer;font:var(--bl-font-title-3-medium);display:flex;align-items:center;justify-content:space-between;gap:var(--bl-size-2xs);padding:var(--bl-size-m);background:var(--bl-color-neutral-full);color:var(--bl-color-neutral-darker);border:var(--border);border-bottom:var(--bl-accordion-border-bottom, var(--border));border-radius:var(--radius-top-left) var(--radius-top-right) var(--radius-bottom-right) var(--radius-bottom-left);transition:background-color 200ms}.summary::-webkit-details-marker{display:none}.summary.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__,.summary:hover{background:var(--bl-color-neutral-lightest)}.summary:focus-visible{outline:2px solid var(--bl-color-primary);outline-offset:-1px}.indicator{transition:transform 200ms}.accordion[open] .indicator{transform:rotate(180deg)}.accordion[open] .summary{border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.caption{flex:1}.accordion-content{padding:var(--bl-size-m);background:var(--bl-color-neutral-full);border:var(--border);border-top:0;border-bottom:var(--bl-accordion-border-bottom, var(--border));border-bottom-left-radius:var(--radius-bottom-left);border-bottom-right-radius:var(--radius-bottom-right);font:var(--bl-font-body-text-2-regular)}.disabled .summary{cursor:not-allowed;background:var(--bl-color-neutral-lightest);color:var(--bl-color-neutral-light)}.accordion:not([open]) .accordion-content{display:none}`,c=p;var t=class extends n{constructor(){super(...arguments);this.open=!1;this.disabled=!1;this.animationDuration=250;this._animationStatus=null}static get styles(){return[c]}_animate(a){this._animationStatus=a?0:1;let b=`${this.detailsEl.offsetHeight}px`,h=a?`${this.summaryEl.offsetHeight+this.contentEl.offsetHeight}px`:`${this.summaryEl.offsetHeight}px`;this._animation&&this._animation.cancel(),this._animation=this.detailsEl.animate({height:[b,h]},{duration:this.animationDuration,easing:"ease-out"}),this._animation.onfinish=()=>this._onAnimationFinish(a),this._animation.oncancel=()=>this._animationStatus=null}_onAnimationFinish(a){this.open=a,this._animation=null,this._animationStatus=null,this.detailsEl.style.height=this.detailsEl.style.overflow=""}expand(){this.detailsEl.style.overflow="hidden",this.detailsEl.style.height=`${this.detailsEl.offsetHeight}px`,this.open=!0,this._animate(!0)}collapse(){this._animate(!1)}_clickHandler(a){a.preventDefault(),!this.disabled&&(this._animationStatus===1||!this.open?this.expand():(this._animationStatus===0||this.open)&&this.collapse())}updated(a){if(a.has("open")){if(this.disabled&&this.open){this._onAnimationFinish(!1);return}this._onToggle(this.open)}}render(){let a=this.icon?r`<bl-icon class="icon" name=${this.icon===!0?"info":this.icon}></bl-icon>`:null;return r`<details
2
2
  ?open=${this.open}
3
3
  class=${d({accordion:!0,disabled:this.disabled})}
4
4
  >
@@ -21,4 +21,4 @@ import{a as d}from"./chunk-6LT7O7T2.js";import{a as u}from"./chunk-ECPWEUBG.js";
21
21
  <slot></slot>
22
22
  </div>
23
23
  </details>`}};e([o({reflect:!0,type:Boolean})],t.prototype,"open",2),e([o({reflect:!0})],t.prototype,"caption",2),e([o({converter:u()})],t.prototype,"icon",2),e([o({reflect:!0,type:Boolean})],t.prototype,"disabled",2),e([m("bl-toggle")],t.prototype,"_onToggle",2),e([o({type:Number})],t.prototype,"animationDuration",2),e([i("details")],t.prototype,"detailsEl",2),e([i("summary")],t.prototype,"summaryEl",2),e([i(".accordion-content")],t.prototype,"contentEl",2),t=e([l("bl-accordion")],t);export{t as a};
24
- //# sourceMappingURL=chunk-7QNX2GPS.js.map
24
+ //# sourceMappingURL=chunk-X73CSBRO.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/components/accordion-group/accordion/bl-accordion.css", "../src/components/accordion-group/accordion/bl-accordion.ts"],
4
+ "sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:block}.accordion{--border:1px solid var(--bl-color-neutral-lighter);--default-radius:var(--bl-size-2xs);--radius-top-left:var(--bl-accordion-radius-top-left, var(--default-radius));--radius-top-right:var(--bl-accordion-radius-top-right, var(--default-radius));--radius-bottom-right:var(--bl-accordion-radius-bottom-right, var(--default-radius));--radius-bottom-left:var(--bl-accordion-radius-bottom-left, var(--default-radius));width:100%}.summary{list-style:none;user-select:none;cursor:pointer;font:var(--bl-font-title-3-medium);display:flex;align-items:center;justify-content:space-between;gap:var(--bl-size-2xs);padding:var(--bl-size-m);background:var(--bl-color-neutral-full);color:var(--bl-color-neutral-darker);border:var(--border);border-bottom:var(--bl-accordion-border-bottom, var(--border));border-radius:var(--radius-top-left) var(--radius-top-right) var(--radius-bottom-right) var(--radius-bottom-left);transition:background-color 200ms}.summary::-webkit-details-marker{display:none}.summary.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__,.summary:hover{background:var(--bl-color-neutral-lightest)}.summary:focus-visible{outline:2px solid var(--bl-color-primary);outline-offset:-1px}.indicator{transition:transform 200ms}.accordion[open] .indicator{transform:rotate(180deg)}.accordion[open] .summary{border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.caption{flex:1}.accordion-content{padding:var(--bl-size-m);background:var(--bl-color-neutral-full);border:var(--border);border-top:0;border-bottom:var(--bl-accordion-border-bottom, var(--border));border-bottom-left-radius:var(--radius-bottom-left);border-bottom-right-radius:var(--radius-bottom-right);font:var(--bl-font-body-text-2-regular)}.disabled .summary{cursor:not-allowed;background:var(--bl-color-neutral-lightest);color:var(--bl-color-neutral-light)}.accordion:not([open]) .accordion-content{display:none}`;\nexport default styles;\n", "import { html, LitElement, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, query } from \"lit/decorators.js\";\nimport { CSSResultGroup } from \"lit/development\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { event, EventDispatcher } from \"../../../utilities/event\";\nimport { stringBooleanConverter } from \"../../../utilities/string-boolean.converter\";\nimport \"../../icon/bl-icon\";\nimport { BaklavaIcon } from \"../../icon/icon-list\";\nimport style from \"./bl-accordion.css\";\n\nenum AnimationStatus {\n EXPANDING,\n COLLAPSING,\n}\n\n@customElement(\"bl-accordion\")\nexport default class BlAccordion extends LitElement {\n /**\n * Whether the accordion is expanded\n */\n @property({ reflect: true, type: Boolean })\n open = false;\n\n /**\n * Sets accordion caption.\n */\n @property({ reflect: true })\n caption?: string;\n\n /**\n * Add icon to beginning of the title\n */\n @property({ converter: stringBooleanConverter() })\n icon?: boolean | BaklavaIcon;\n\n /**\n * Whether the accordion is disabled\n */\n @property({ reflect: true, type: Boolean })\n disabled = false;\n\n /**\n * Fires when accordion open state change.\n */\n @event(\"bl-toggle\") private _onToggle: EventDispatcher<boolean>;\n\n @property({ type: Number })\n animationDuration = 250;\n\n private _animation: Animation | null;\n private _animationStatus: AnimationStatus | null = null;\n\n @query(\"details\")\n detailsEl: HTMLDetailsElement;\n\n @query(\"summary\")\n summaryEl: HTMLElement;\n\n @query(\".accordion-content\")\n contentEl: HTMLElement;\n\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n _animate(isExpanding: boolean) {\n this._animationStatus = isExpanding ? AnimationStatus.EXPANDING : AnimationStatus.COLLAPSING;\n\n const startHeight = `${this.detailsEl.offsetHeight}px`;\n const endHeight = isExpanding\n ? `${this.summaryEl.offsetHeight + this.contentEl.offsetHeight}px`\n : `${this.summaryEl.offsetHeight}px`;\n\n if (this._animation) {\n this._animation.cancel();\n }\n\n this._animation = this.detailsEl.animate(\n {\n height: [startHeight, endHeight],\n },\n {\n duration: this.animationDuration,\n easing: \"ease-out\",\n }\n );\n\n this._animation.onfinish = () => this._onAnimationFinish(isExpanding);\n this._animation.oncancel = () => (this._animationStatus = null);\n }\n\n private _onAnimationFinish(open: boolean) {\n this.open = open;\n this._animation = null;\n this._animationStatus = null;\n this.detailsEl.style.height = this.detailsEl.style.overflow = \"\";\n }\n\n expand() {\n this.detailsEl.style.overflow = \"hidden\";\n this.detailsEl.style.height = `${this.detailsEl.offsetHeight}px`;\n this.open = true;\n this._animate(true);\n }\n\n collapse() {\n this._animate(false);\n }\n\n private _clickHandler(e: Event) {\n e.preventDefault();\n\n if (this.disabled) return;\n\n if (this._animationStatus === AnimationStatus.COLLAPSING || !this.open) {\n this.expand();\n } else if (this._animationStatus === AnimationStatus.EXPANDING || this.open) {\n this.collapse();\n }\n }\n\n protected updated(_changedProperties: PropertyValues) {\n if (_changedProperties.has(\"open\")) {\n if (this.disabled && this.open) {\n this._onAnimationFinish(false);\n return;\n }\n\n this._onToggle(this.open);\n }\n }\n\n render(): TemplateResult {\n const icon = this.icon\n ? html`<bl-icon class=\"icon\" name=${this.icon === true ? \"info\" : this.icon}></bl-icon>`\n : null;\n\n return html`<details\n ?open=${this.open}\n class=${classMap({\n accordion: true,\n disabled: this.disabled,\n })}\n >\n <summary\n class=\"summary\"\n @click=\"${this._clickHandler}\"\n aria-expanded=${this.open ? \"true\" : \"false\"}\n aria-controls=\"content\"\n aria-disabled=${this.disabled ? \"true\" : \"false\"}\n tabindex=${this.disabled ? \"-1\" : \"0\"}\n >\n ${icon}\n <slot name=\"caption\">\n <span class=\"caption\"> ${this.caption} </span>\n </slot>\n <bl-icon name=\"arrow_down\" class=\"indicator\"></bl-icon>\n </summary>\n\n <div class=\"accordion-content\" role=\"region\" aria-labelledby=\"header\" id=\"content\">\n <slot></slot>\n </div>\n </details>`;\n }\n}\n"],
5
+ "mappings": "4QACO,IAAMA,EAASC,43DACfC,EAAQF,ECcf,IAAqBG,EAArB,cAAyCC,CAAW,CAApD,kCAKE,UAAO,GAkBP,cAAW,GAQX,uBAAoB,IAGpB,KAAQ,iBAA2C,KAWnD,WAAW,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AA,cACG,KAAK;AAAA,cACLC,EAAS,CACf,UAAW,GACX,SAAU,KAAK,QACjB,CAAC;AAAA;AAAA;AAAA;AAAA,kBAIW,KAAK;AAAA,wBACC,KAAK,KAAO,OAAS;AAAA;AAAA,wBAErB,KAAK,SAAW,OAAS;AAAA,mBAC9B,KAAK,SAAW,KAAO;AAAA;AAAA,UAEhCF;AAAA;AAAA,mCAEyB,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAStC,CACF,EA/IEG,EAAA,CADCL,EAAS,CAAE,QAAS,GAAM,KAAM,OAAQ,CAAC,GAJvBP,EAKnB,oBAMAY,EAAA,CADCL,EAAS,CAAE,QAAS,EAAK,CAAC,GAVRP,EAWnB,uBAMAY,EAAA,CADCL,EAAS,CAAE,UAAWM,EAAuB,CAAE,CAAC,GAhB9Bb,EAiBnB,oBAMAY,EAAA,CADCL,EAAS,CAAE,QAAS,GAAM,KAAM,OAAQ,CAAC,GAtBvBP,EAuBnB,wBAK4BY,EAAA,CAA3BE,EAAM,WAAW,GA5BCd,EA4BS,yBAG5BY,EAAA,CADCL,EAAS,CAAE,KAAM,MAAO,CAAC,GA9BPP,EA+BnB,iCAMAY,EAAA,CADC,EAAM,SAAS,GApCGZ,EAqCnB,yBAGAY,EAAA,CADC,EAAM,SAAS,GAvCGZ,EAwCnB,yBAGAY,EAAA,CADC,EAAM,oBAAoB,GA1CRZ,EA2CnB,yBA3CmBA,EAArBY,EAAA,CADCL,EAAc,cAAc,GACRP",
6
+ "names": ["styles", "i", "bl_accordion_default", "BlAccordion", "s", "bl_accordion_default", "isExpanding", "startHeight", "endHeight", "open", "e", "_changedProperties", "icon", "x", "o", "__decorateClass", "stringBooleanConverter", "event"]
7
+ }
@@ -1,2 +1,2 @@
1
- import{a}from"../../../chunk-7QNX2GPS.js";import"../../../chunk-6LT7O7T2.js";import"../../../chunk-ECPWEUBG.js";import"../../../chunk-HYB2HRRX.js";import"../../../chunk-GRL4DWKG.js";import"../../../chunk-3USCFSFQ.js";import"../../../chunk-7GK5LKBV.js";import"../../../chunk-5MOOXA2X.js";import"../../../chunk-4OT5AMS5.js";import"../../../chunk-IZ2LK5GK.js";export{a as default};
1
+ import{a}from"../../../chunk-X73CSBRO.js";import"../../../chunk-6LT7O7T2.js";import"../../../chunk-ECPWEUBG.js";import"../../../chunk-BH64QNLE.js";import"../../../chunk-GRL4DWKG.js";import"../../../chunk-3USCFSFQ.js";import"../../../chunk-7GK5LKBV.js";import"../../../chunk-5MOOXA2X.js";import"../../../chunk-4OT5AMS5.js";import"../../../chunk-IZ2LK5GK.js";export{a as default};
2
2
  //# sourceMappingURL=bl-accordion.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-4QFXDW3W.js";import"../../chunk-ECPWEUBG.js";import"../../chunk-DINNT5P2.js";import"../../chunk-HYB2HRRX.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
1
+ import{a}from"../../chunk-4QFXDW3W.js";import"../../chunk-ECPWEUBG.js";import"../../chunk-DINNT5P2.js";import"../../chunk-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
2
2
  //# sourceMappingURL=bl-alert.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../../chunk-4BZSILLM.js";import"../../chunk-HYB2HRRX.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
1
+ import{a}from"../../chunk-4BZSILLM.js";import"../../chunk-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
2
2
  //# sourceMappingURL=bl-badge.js.map
@@ -1,2 +1,2 @@
1
- import{b as a}from"../../chunk-VU6LRFZR.js";import"../../chunk-IGNJQVQF.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-HYB2HRRX.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
1
+ import{b as a}from"../../chunk-VU6LRFZR.js";import"../../chunk-IGNJQVQF.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-BH64QNLE.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-3USCFSFQ.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
2
2
  //# sourceMappingURL=bl-button.js.map