@trendyol/baklava 3.3.0-beta.23 → 3.3.0-beta.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/baklava-react.d.ts +12 -0
- package/dist/baklava-react.d.ts.map +1 -1
- package/dist/baklava-react.js +1 -1
- package/dist/baklava-react.js.map +3 -3
- package/dist/baklava-vue.d.ts +1 -0
- package/dist/baklava.d.ts +1 -0
- package/dist/baklava.d.ts.map +1 -1
- package/dist/baklava.js +1 -1
- package/dist/{chunk-OAF3R4PW.js → chunk-2IJL7HNY.js} +2 -2
- package/dist/chunk-2IJL7HNY.js.map +7 -0
- package/dist/chunk-4BLKAURK.js +16 -0
- package/dist/chunk-4BLKAURK.js.map +7 -0
- package/dist/chunk-7VMGFJ5X.js +2 -0
- package/dist/chunk-7VMGFJ5X.js.map +7 -0
- package/dist/chunk-APLBTZ36.js +24 -0
- package/dist/chunk-APLBTZ36.js.map +7 -0
- package/dist/chunk-DE3A37FL.js +20 -0
- package/dist/chunk-DE3A37FL.js.map +7 -0
- package/dist/chunk-DIGACNOH.js +21 -0
- package/dist/chunk-DIGACNOH.js.map +7 -0
- package/dist/chunk-ERL6CBPO.js +31 -0
- package/dist/chunk-ERL6CBPO.js.map +7 -0
- package/dist/{chunk-5VEXMTA4.js → chunk-H4WETBHJ.js} +2 -2
- package/dist/chunk-H4WETBHJ.js.map +7 -0
- package/dist/chunk-HYBPEELZ.js +5 -0
- package/dist/chunk-HYBPEELZ.js.map +7 -0
- package/dist/chunk-HZV6GUII.js +26 -0
- package/dist/chunk-HZV6GUII.js.map +7 -0
- package/dist/chunk-IDRA37BX.js +59 -0
- package/dist/chunk-IDRA37BX.js.map +7 -0
- package/dist/chunk-KJUZJAHW.js +84 -0
- package/dist/chunk-KJUZJAHW.js.map +7 -0
- package/dist/chunk-LEAVDIGF.js +2 -0
- package/dist/chunk-LEAVDIGF.js.map +7 -0
- package/dist/chunk-MWFGDECP.js +35 -0
- package/dist/chunk-MWFGDECP.js.map +7 -0
- package/dist/chunk-MWG4TBH7.js +27 -0
- package/dist/chunk-MWG4TBH7.js.map +7 -0
- package/dist/chunk-NXVLNG4L.js +65 -0
- package/dist/chunk-NXVLNG4L.js.map +7 -0
- package/dist/chunk-OXHRXOBD.js +32 -0
- package/dist/chunk-OXHRXOBD.js.map +7 -0
- package/dist/{chunk-CAIHRZ24.js → chunk-Q5D7W6YP.js} +2 -2
- package/dist/chunk-Q7CEGCDI.js +50 -0
- package/dist/chunk-Q7CEGCDI.js.map +7 -0
- package/dist/{chunk-GMVJABPT.js → chunk-QDYWH7BU.js} +2 -2
- package/dist/chunk-QDYWH7BU.js.map +7 -0
- package/dist/chunk-RER7OLAQ.js +22 -0
- package/dist/chunk-RER7OLAQ.js.map +7 -0
- package/dist/chunk-SBCJY5IU.js +34 -0
- package/dist/{chunk-75V3FKJS.js.map → chunk-SBCJY5IU.js.map} +2 -2
- package/dist/chunk-STZJ3LBU.js +37 -0
- package/dist/{chunk-KBNVATXF.js.map → chunk-STZJ3LBU.js.map} +2 -2
- package/dist/{chunk-4BZSILLM.js → chunk-T5MEA7JO.js} +2 -2
- package/dist/chunk-T5MEA7JO.js.map +7 -0
- package/dist/chunk-TUUQIEDI.js +25 -0
- package/dist/chunk-TUUQIEDI.js.map +7 -0
- package/dist/{chunk-BNUJWONI.js → chunk-UOGCEUXK.js} +2 -2
- package/dist/chunk-UOGCEUXK.js.map +7 -0
- package/dist/chunk-WPESQSKX.js +31 -0
- package/dist/chunk-WPESQSKX.js.map +7 -0
- package/dist/chunk-X5XH4HTW.js +17 -0
- package/dist/chunk-X5XH4HTW.js.map +7 -0
- package/dist/{chunk-IGNJQVQF.js → chunk-ZE7GYACV.js} +2 -2
- package/dist/chunk-ZE7GYACV.js.map +7 -0
- package/dist/{chunk-N4GAO7FQ.js → chunk-ZJBBQHF3.js} +2 -2
- package/dist/chunk-ZLJF4SVG.js +4 -0
- package/dist/chunk-ZLJF4SVG.js.map +7 -0
- package/dist/components/accordion-group/accordion/bl-accordion.js +1 -1
- package/dist/components/accordion-group/bl-accordion-group.js +1 -1
- package/dist/components/alert/bl-alert.js +1 -1
- package/dist/components/badge/bl-badge.js +1 -1
- package/dist/components/button/bl-button.js +1 -1
- package/dist/components/calendar/bl-calendar.js +1 -1
- package/dist/components/checkbox-group/bl-checkbox-group.js +1 -1
- package/dist/components/checkbox-group/checkbox/bl-checkbox.js +1 -1
- package/dist/components/datepicker/bl-datepicker.js +1 -1
- package/dist/components/dialog/bl-dialog.js +1 -1
- package/dist/components/drawer/bl-drawer.js +1 -1
- package/dist/components/dropdown/bl-dropdown.js +1 -1
- package/dist/components/dropdown/group/bl-dropdown-group.js +1 -1
- package/dist/components/dropdown/item/bl-dropdown-item.js +1 -1
- package/dist/components/input/bl-input.js +1 -1
- package/dist/components/notification/bl-notification.js +1 -1
- package/dist/components/notification/bl-notification.stories.d.ts.map +1 -1
- package/dist/components/notification/bl-notification.stories.js +30 -196
- package/dist/components/notification/bl-notification.stories.js.map +3 -3
- package/dist/components/notification/card/bl-notification-card.js +1 -1
- package/dist/components/pagination/bl-pagination.js +1 -1
- package/dist/components/popover/bl-popover.js +1 -1
- package/dist/components/progress-indicator/bl-progress-indicator.js +1 -1
- package/dist/components/radio-group/bl-radio-group.js +1 -1
- package/dist/components/radio-group/radio/bl-radio.js +1 -1
- package/dist/components/select/bl-select.js +1 -1
- package/dist/components/select/option/bl-select-option.js +1 -1
- package/dist/components/spinner/bl-spinner.js +1 -1
- package/dist/components/split-button/bl-split-button.js +1 -1
- package/dist/components/switch/bl-switch.js +1 -1
- package/dist/components/tab-group/bl-tab-group.js +1 -1
- package/dist/components/tab-group/tab/bl-tab.js +1 -1
- package/dist/components/table/table-cell/bl-table-cell.js +1 -1
- package/dist/components/table/table-header/bl-table-header.js +1 -1
- package/dist/components/table/table-header-cell/bl-table-header-cell.js +1 -1
- package/dist/components/table/table-row/bl-table-row.js +1 -1
- package/dist/components/tag/bl-tag.d.ts +52 -0
- package/dist/components/tag/bl-tag.d.ts.map +1 -0
- package/dist/components/tag/bl-tag.js +2 -0
- package/dist/components/tag/bl-tag.js.map +7 -0
- package/dist/components/tag/bl-tag.test.d.ts +2 -0
- package/dist/components/tag/bl-tag.test.d.ts.map +1 -0
- package/dist/components/textarea/bl-textarea.js +1 -1
- package/dist/components/tooltip/bl-tooltip.js +1 -1
- package/dist/custom-elements.json +112 -0
- package/package.json +1 -1
- package/dist/chunk-4BZSILLM.js.map +0 -7
- package/dist/chunk-4QFXDW3W.js +0 -31
- package/dist/chunk-4QFXDW3W.js.map +0 -7
- package/dist/chunk-5VEXMTA4.js.map +0 -7
- package/dist/chunk-73RGV4UX.js +0 -16
- package/dist/chunk-73RGV4UX.js.map +0 -7
- package/dist/chunk-757CMI4A.js +0 -78
- package/dist/chunk-757CMI4A.js.map +0 -7
- package/dist/chunk-75V3FKJS.js +0 -34
- package/dist/chunk-BNUJWONI.js.map +0 -7
- package/dist/chunk-CJDCQC7C.js +0 -50
- package/dist/chunk-CJDCQC7C.js.map +0 -7
- package/dist/chunk-FCEMOH4J.js +0 -27
- package/dist/chunk-FCEMOH4J.js.map +0 -7
- package/dist/chunk-FTQX7CEW.js +0 -35
- package/dist/chunk-FTQX7CEW.js.map +0 -7
- package/dist/chunk-FVBGMXMC.js +0 -17
- package/dist/chunk-FVBGMXMC.js.map +0 -7
- package/dist/chunk-GMVJABPT.js.map +0 -7
- package/dist/chunk-GXDVWGFU.js +0 -32
- package/dist/chunk-GXDVWGFU.js.map +0 -7
- package/dist/chunk-IGNJQVQF.js.map +0 -7
- package/dist/chunk-ILK55FB6.js +0 -65
- package/dist/chunk-ILK55FB6.js.map +0 -7
- package/dist/chunk-J45OQI7D.js +0 -20
- package/dist/chunk-J45OQI7D.js.map +0 -7
- package/dist/chunk-JAZGOWKA.js +0 -2
- package/dist/chunk-JAZGOWKA.js.map +0 -7
- package/dist/chunk-KBNVATXF.js +0 -37
- package/dist/chunk-NGJM4NWA.js +0 -4
- package/dist/chunk-NGJM4NWA.js.map +0 -7
- package/dist/chunk-OAF3R4PW.js.map +0 -7
- package/dist/chunk-QMVEWMEI.js +0 -20
- package/dist/chunk-QMVEWMEI.js.map +0 -7
- package/dist/chunk-S6HEBXIR.js +0 -84
- package/dist/chunk-S6HEBXIR.js.map +0 -7
- package/dist/chunk-T5EQ4OXS.js +0 -2
- package/dist/chunk-T5EQ4OXS.js.map +0 -7
- package/dist/chunk-UZJOCLOO.js +0 -21
- package/dist/chunk-UZJOCLOO.js.map +0 -7
- package/dist/chunk-VU6LRFZR.js +0 -26
- package/dist/chunk-VU6LRFZR.js.map +0 -7
- package/dist/chunk-WXWKIQAK.js +0 -22
- package/dist/chunk-WXWKIQAK.js.map +0 -7
- package/dist/chunk-X73CSBRO.js +0 -24
- package/dist/chunk-X73CSBRO.js.map +0 -7
- package/dist/chunk-YZRAUVUQ.js +0 -31
- package/dist/chunk-YZRAUVUQ.js.map +0 -7
- /package/dist/{chunk-CAIHRZ24.js.map → chunk-Q5D7W6YP.js.map} +0 -0
- /package/dist/{chunk-N4GAO7FQ.js.map → chunk-ZJBBQHF3.js.map} +0 -0
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/select/bl-select.css", "../src/components/select/bl-select.ts"],
|
|
4
|
-
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;display:grid;gap:var(--bl-size-3xs);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--label-padding:var(--bl-size-3xs);--border-size:1px;--background-color:var(--bl-color-neutral-full);--border-color:var(--bl-color-neutral-lighter);--border-focus-color:var(--bl-color-primary-highlight);--icon-color:var(--bl-color-neutral-light);--text-color:var(--bl-color-neutral-darker);--label-color:var(--bl-color-neutral-dark);--placeholder-color:var(--bl-color-neutral-light);--height:var(--bl-size-2xl);--menu-padding:0 var(--bl-size-m);--menu-margin-top:var(--bl-size-2xs);--font-size:var(--bl-font-size-m);--disabled-color:var(--bl-color-neutral-lightest);--menu-height:250px;--popover-position:var(--bl-popover-position, fixed)}:host([multiple][view-select-all]) .select-wrapper{--menu-height:290px}:host([size=\"large\"]) .select-wrapper{--height:var(--bl-size-3xl);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-m)}:host([size=\"small\"]) .select-wrapper{--height:var(--bl-size-xl);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-xs);--font-size:var(--bl-font-size-s)}:host([disabled]) .select-wrapper{--placeholder-color:var(--bl-color-neutral-light)}.dirty.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-highlight);--label-color:var(--bl-color-danger)}.select-input{display:grid;align-items:center;justify-content:space-between;grid-template-columns:1fr max-content max-content;cursor:pointer;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 calc(var(--padding-horizontal) - var(--label-padding) - var(--border-size));border-radius:var(--bl-border-radius-s);color:var(--text-color);background-color:var(--background-color);/* 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>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AOA+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
|
-
}
|
package/dist/chunk-QMVEWMEI.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{a as p}from"./chunk-BNUJWONI.js";import{a as d}from"./chunk-DINNT5P2.js";import{a}from"./chunk-GRL4DWKG.js";import{a as v,b as s,e as n}from"./chunk-5MOOXA2X.js";import{a as l,b as i,f as h}from"./chunk-4OT5AMS5.js";import{d as o}from"./chunk-IZ2LK5GK.js";var m=l`:host{display:contents}.trigger{display:var(--bl-tooltip-trigger-display, inline-flex);cursor:pointer}bl-popover{--bl-popover-background-color:var(--bl-color-info);--bl-popover-arrow-display:block;--bl-popover-border-size:0px;--bl-popover-max-width:424px}.content{color:var(--bl-color-neutral-full)}`,c=m;var t=class extends h{constructor(){super(...arguments);this.placement="top"}static get styles(){return[c]}update(e){if(e.has("target")){let r=e.get("target");r&&this._removeEvents(r),this._addEvents()}super.update(e)}_addEvents(){let e=p(this.target);e&&(e.addEventListener("focus",this.show,{capture:!0}),e.addEventListener("mouseenter",this.show),e.addEventListener("blur",this.hide,{capture:!0}),e.addEventListener("mouseleave",this.hide))}_removeEvents(e){let r=p(e);r&&(r.removeEventListener("focus",this.show,{capture:!0}),r.removeEventListener("mouseenter",this.show),r.removeEventListener("blur",this.hide,{capture:!0}),r.removeEventListener("mouseleave",this.hide))}connectedCallback(){super.connectedCallback(),this.show=this.show.bind(this),this.hide=this.hide.bind(this),this._addEvents()}disconnectedCallback(){super.disconnectedCallback(),this._removeEvents(this.target)}show(){var e;this._popover.target=(e=this.target)!=null?e:this.trigger,this._popover.show(),this.onShow("")}hide(){this._popover.hide(),this.onHide("")}get visible(){return this._popover.visible}triggerTemplate(){return i`<slot
|
|
2
|
-
class="trigger"
|
|
3
|
-
name="tooltip-trigger"
|
|
4
|
-
aria-describedby="tooltip"
|
|
5
|
-
@focus=${{handleEvent:()=>this.show(),capture:!0}}
|
|
6
|
-
@blur=${{handleEvent:()=>this.hide(),capture:!0}}
|
|
7
|
-
@mouseenter=${()=>this.show()}
|
|
8
|
-
@mouseleave=${()=>this.hide()}
|
|
9
|
-
>
|
|
10
|
-
</slot>`}render(){var e;return i`
|
|
11
|
-
${this.target?"":this.triggerTemplate()}
|
|
12
|
-
<bl-popover
|
|
13
|
-
.target="${(e=this.target)!=null?e:this.trigger}"
|
|
14
|
-
placement="${d(this.placement)}"
|
|
15
|
-
@bl-popover-hide="${()=>this.onHide("")}"
|
|
16
|
-
>
|
|
17
|
-
<slot class="content" id="tooltip" role="tooltip"></slot>
|
|
18
|
-
</bl-popover>
|
|
19
|
-
`}};o([n(".trigger")],t.prototype,"trigger",2),o([n("bl-popover")],t.prototype,"_popover",2),o([s({type:String})],t.prototype,"placement",2),o([a("bl-tooltip-show")],t.prototype,"onShow",2),o([a("bl-tooltip-hide")],t.prototype,"onHide",2),o([s()],t.prototype,"target",2),t=o([v("bl-tooltip")],t);export{t as a};
|
|
20
|
-
//# sourceMappingURL=chunk-QMVEWMEI.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/tooltip/bl-tooltip.css", "../src/components/tooltip/bl-tooltip.ts"],
|
|
4
|
-
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:contents}.trigger{display:var(--bl-tooltip-trigger-display, inline-flex);cursor:pointer}bl-popover{--bl-popover-background-color:var(--bl-color-info);--bl-popover-arrow-display:block;--bl-popover-border-size:0px;--bl-popover-max-width:424px}.content{color:var(--bl-color-neutral-full)}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, PropertyValues, TemplateResult } from \"lit\";\nimport { customElement, property, query } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { ReferenceElement } from \"@floating-ui/core\";\nimport { getTarget } from \"../../utilities/elements\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../popover/bl-popover\";\nimport BlPopover, { Placement } from \"../popover/bl-popover\";\nimport style from \"./bl-tooltip.css\";\n\n/**\n * @tag bl-tooltip\n * @summary Baklava Tooltip component\n * @dependency bl-popover\n *\n * @cssproperty [--bl-tooltip-trigger-display=inline-flex] Set the display of the tooltip trigger.\n */\n@customElement(\"bl-tooltip\")\nexport default class BlTooltip extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n @query(\".trigger\") private trigger: ReferenceElement;\n @query(\"bl-popover\") private _popover: BlPopover;\n\n /**\n * Sets placement of the tooltip\n */\n @property({ type: String })\n placement: Placement = \"top\";\n\n /**\n * Fires when hovering over a trigger\n */\n @event(\"bl-tooltip-show\") private onShow: EventDispatcher<string>;\n\n /**\n * Fires when leaving over from trigger\n */\n @event(\"bl-tooltip-hide\") private onHide: EventDispatcher<string>;\n\n @property() target: string | Element;\n\n protected update(changedProperties: PropertyValues) {\n if (changedProperties.has(\"target\")) {\n const prev = changedProperties.get(\"target\");\n\n if (prev) {\n this._removeEvents(prev);\n }\n\n this._addEvents();\n }\n\n super.update(changedProperties);\n }\n\n private _addEvents() {\n const target = getTarget(this.target);\n\n if (target) {\n target.addEventListener(\"focus\", this.show, { capture: true });\n target.addEventListener(\"mouseenter\", this.show);\n target.addEventListener(\"blur\", this.hide, { capture: true });\n target.addEventListener(\"mouseleave\", this.hide);\n }\n }\n\n private _removeEvents(value: string | Element) {\n const target = getTarget(value);\n\n if (target) {\n target.removeEventListener(\"focus\", this.show, { capture: true });\n target.removeEventListener(\"mouseenter\", this.show);\n target.removeEventListener(\"blur\", this.hide, { capture: true });\n target.removeEventListener(\"mouseleave\", this.hide);\n }\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n this.show = this.show.bind(this);\n this.hide = this.hide.bind(this);\n\n this._addEvents();\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this._removeEvents(this.target);\n }\n\n /**\n * Shows tooltip\n */\n show() {\n this._popover.target = this.target ?? this.trigger;\n this._popover.show();\n this.onShow(\"\");\n }\n\n /**\n * Hides tooltip\n */\n hide() {\n this._popover.hide();\n this.onHide(\"\");\n }\n\n /**\n * Gives the visibility status of the tooltip\n */\n get visible(): boolean {\n return this._popover.visible;\n }\n\n private triggerTemplate() {\n return html`<slot\n class=\"trigger\"\n name=\"tooltip-trigger\"\n aria-describedby=\"tooltip\"\n @focus=${{ handleEvent: () => this.show(), capture: true }}\n @blur=${{ handleEvent: () => this.hide(), capture: true }}\n @mouseenter=${() => this.show()}\n @mouseleave=${() => this.hide()}\n >\n </slot>`;\n }\n\n render(): TemplateResult {\n return html`\n ${this.target ? \"\" : this.triggerTemplate()}\n <bl-popover\n .target=\"${this.target ?? this.trigger}\"\n placement=\"${ifDefined(this.placement)}\"\n @bl-popover-hide=\"${() => this.onHide(\"\")}\"\n >\n <slot class=\"content\" id=\"tooltip\" role=\"tooltip\"></slot>\n </bl-popover>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-tooltip\": BlTooltip;\n }\n}\n"],
|
|
5
|
-
"mappings": "uQACO,IAAMA,EAASC,+SACfC,EAAQF,ECgBf,IAAqBG,EAArB,cAAuCC,CAAW,CAAlD,kCAYE,eAAuB,MAXvB,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAuBU,OAAOC,EAAmC,CAClD,GAAIA,EAAkB,IAAI,QAAQ,EAAG,CACnC,IAAMC,EAAOD,EAAkB,IAAI,QAAQ,EAEvCC,GACF,KAAK,cAAcA,CAAI,EAGzB,KAAK,WAAW,EAGlB,MAAM,OAAOD,CAAiB,CAChC,CAEQ,YAAa,CACnB,IAAME,EAASC,EAAU,KAAK,MAAM,EAEhCD,IACFA,EAAO,iBAAiB,QAAS,KAAK,KAAM,CAAE,QAAS,EAAK,CAAC,EAC7DA,EAAO,iBAAiB,aAAc,KAAK,IAAI,EAC/CA,EAAO,iBAAiB,OAAQ,KAAK,KAAM,CAAE,QAAS,EAAK,CAAC,EAC5DA,EAAO,iBAAiB,aAAc,KAAK,IAAI,EAEnD,CAEQ,cAAcE,EAAyB,CAC7C,IAAMF,EAASC,EAAUC,CAAK,EAE1BF,IACFA,EAAO,oBAAoB,QAAS,KAAK,KAAM,CAAE,QAAS,EAAK,CAAC,EAChEA,EAAO,oBAAoB,aAAc,KAAK,IAAI,EAClDA,EAAO,oBAAoB,OAAQ,KAAK,KAAM,CAAE,QAAS,EAAK,CAAC,EAC/DA,EAAO,oBAAoB,aAAc,KAAK,IAAI,EAEtD,CAEA,mBAAoB,CAClB,MAAM,kBAAkB,EAExB,KAAK,KAAO,KAAK,KAAK,KAAK,IAAI,EAC/B,KAAK,KAAO,KAAK,KAAK,KAAK,IAAI,EAE/B,KAAK,WAAW,CAClB,CAE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ooltip", "s", "bl_tooltip_default", "changedProperties", "prev", "target", "getTarget", "value", "_a", "x", "l", "__decorateClass", "i", "e", "event"]
|
|
7
|
-
}
|
package/dist/chunk-S6HEBXIR.js
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import{a as V}from"./chunk-IPYZIIRV.js";import{a as Y,b as k}from"./chunk-WEEGH2F4.js";import{a as M}from"./chunk-6LT7O7T2.js";import{a as A}from"./chunk-HBPBDC7T.js";import{a as T}from"./chunk-GRL4DWKG.js";import{a as S,b as y,c as f}from"./chunk-5MOOXA2X.js";import{a as x,b as h,f as C}from"./chunk-4OT5AMS5.js";import{d as s}from"./chunk-IZ2LK5GK.js";function v(u){let D=[],e=u.split(",");return e==null||e.forEach(t=>{let a=new Date(t.trim());isNaN(a.getTime())||D.push(a)}),D}var d=class extends C{constructor(){super(...arguments);this.startOfWeek=0;this.locale=document.documentElement.lang||"en-EN";this._disabledDates=[];this._value=[]}get disabledDates(){return this._disabledDates}set disabledDates(e){let t=[];typeof e=="string"?t=v(e):Array.isArray(e)&&(t=e.filter(a=>!isNaN(a.getTime()))),this.requestUpdate("disabledDates",t),this._disabledDates=t}get maxDate(){return this._maxDate}set maxDate(e){if(e&&isNaN(new Date(e).getTime())){console.warn("Invalid maxDate value.");return}this._minDate&&this._minDate>=e?console.warn("maxDate cannot be smaller than minDate."):(this._maxDate=new Date(e),this.requestUpdate("maxDate",e))}get minDate(){return this._minDate}set minDate(e){if(e&&isNaN(new Date(e).getTime())){console.warn("Invalid minDate value.");return}this._maxDate&&this._maxDate<=e?console.warn("minDate cannot be greater than maxDate."):(this._minDate=new Date(e),this.requestUpdate("minDate",e))}set value(e){let t=this._value;this._value=e,this.requestUpdate("value",t)}get value(){return this._value}};s([y()],d.prototype,"type",2),s([y({type:Number,attribute:"start-of-week",reflect:!0})],d.prototype,"startOfWeek",2),s([y()],d.prototype,"locale",2),s([y({attribute:"disabled-dates",reflect:!0})],d.prototype,"disabledDates",1),s([y({type:Date,attribute:"max-date",reflect:!0})],d.prototype,"maxDate",1),s([y({type:Date,attribute:"min-date",reflect:!0})],d.prototype,"minDate",1),s([y({attribute:"value",reflect:!0})],d.prototype,"value",1);function E(u){return typeof u=="string"?v(u):u instanceof Date?[u]:u}var N=x`.calendar{display:flex;flex-direction:column}.calendar-content{display:flex;padding:var(--bl-size-m);flex-direction:column;align-items:center;gap:var(--bl-size-m);border-radius:var(--bl-border-radius-s);width:fit-content;background:var(--bl-color-neutral-full)}.calendar-header{display:flex;justify-content:space-between;width:100%;align-items:center;padding-bottom:var(--bl-size-s)}.arrow{flex:1}:host([dir="rtl"]) .arrow{transform:scale(-1)}.header-text{flex:3}.header-text-hover{background:var(--bl-color-neutral-lightest);border-radius:var(--bl-border-radius-s)}.days-wrapper{display:flex;flex-direction:column}.day-wrapper{display:flex;align-items:center;justify-content:center}.week-row{display:flex;align-items:center;flex-direction:row;padding-bottom:var(--bl-size-2xs)}.day{display:flex;align-items:center;width:40px;--bl-button-focus-border-color:#000;--bl-font-title-4-medium:var(--bl-font-weight-regular) var(--bl-font-size-m);--bl-size-xl:40px;--bl-border-radius-m:50%;--bl-border-radius-l:50%}.day.today-day{--bl-color-neutral-darker:var(--bl-color-primary);--bl-color-neutral-darkest:var(--bl-color-primary)}.day.other-month-day{--bl-color-neutral-darker:var(--bl-color-neutral-dark)}.day.other-month-day.selected-day{--bl-color-neutral-darker:var(--bl-color-neutral-full)}.day.selected-day{background:var(--bl-color-primary);border-radius:50%;--bl-button-focus-border-color:var(--bl-color-primary);--bl-color-neutral-darker:var(--bl-color-neutral-full)}.range-day{background:var(--bl-color-primary-contrast);--bl-color-neutral-lightest:var(--bl-color-primary-contrast)}.range-end-day,.range-start-day,.selected-day{--bl-color-neutral-lightest:var(--bl-color-primary);--bl-color-neutral-darker:var(--bl-color-neutral-full);--bl-color-neutral-darkest:var(--bl-color-neutral-full) !important}.range-start-day{background:var(--bl-color-primary-contrast);border-start-start-radius:50%;border-end-start-radius:50%}.range-end-day{background:var(--bl-color-primary-contrast);border-start-end-radius:50%;border-end-end-radius:50%}.weekday-text{color:var(--bl-color-neutral-dark);text-align:center;padding:var(--bl-size-2xs) 0;width:40px}.grid-content{display:grid;grid-template-columns:auto auto auto;text-align:center}.grid-item{width:93.33px;--bl-size-3xs:15px}.grid-item:not(:nth-last-child(-n + 3)){padding-bottom:var(--bl-size-2xs)}.calendar-text{font:var(--bl-font-title-3-regular)}`,$=N;var o=class extends d{constructor(){super(...arguments);this.today=new Date;this._calendarMonth=this.today.getMonth();this._calendarYear=this.today.getFullYear();this._calendarView="days";this._calendarYears=[];this._calendarDays=[];this._dates=[];this.handleClearSelectedDates=()=>{this._dates=[],this._onBlCalendarChange([]),this.clearRangePickerStyles()}}static get styles(){return[$]}connectedCallback(){super.connectedCallback(),V(this)}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._dates),this.requestUpdate()}handleSingleSelectCalendar(e){this._dates=[e]}handleMultipleSelectCalendar(e){var a,l,r;((a=this._dates)==null?void 0:a.some(n=>n.getTime()===e.getTime()))?(r=this._dates)==null||r.splice((l=this._dates)==null?void 0:l.findIndex(n=>n.getTime()===e.getTime()),1):this._dates.push(e)}handleRangeSelectCalendar(e){if(!this._dates[0])this._dates[0]=e;else if(this._dates[1])this._dates=[],this._dates[0]=e;else if(e.getTime()>this._dates[0].getTime())this._dates[1]=e;else{let t=this._dates[0];this._dates[0]=e,this._dates[1]=t}this.setHoverClass()}checkIfSelectedDate(e){var t;return(t=this._dates)==null?void 0:t.some(a=>a.getFullYear()===e.getFullYear()&&a.getMonth()===e.getMonth()&&a.getDate()===e.getDate())}checkIfDateIsToday(e){let t=this.today;return t.getDate()===e.getDate()&&t.getMonth()===e.getMonth()&&t.getFullYear()===e.getFullYear()}checkIfDateIsDisabled(e){var t,a,l;return e.getTime()<((t=this.minDate)==null?void 0:t.getTime())||e.getTime()>((a=this.maxDate)==null?void 0:a.getTime())?!0:this.disabledDates.length>0?(l=this.disabledDates)==null?void 0:l.some(r=>e.getDate()===r.getDate()&&e.getMonth()===r.getMonth()&&e.getFullYear()===r.getFullYear()):!1}setHoverClass(){this.clearRangePickerStyles(),this._dates[0]&&this._dates[1]&&setTimeout(()=>{var l,r,n,b,m,_,i,c,g;let e=(n=(r=this.shadowRoot)==null?void 0:r.getElementById(`${(l=this._dates[0])==null?void 0:l.getTime()}`))==null?void 0:n.parentElement;e==null||e.classList.add("range-start-day");let t=(_=(m=this.shadowRoot)==null?void 0:m.getElementById(`${(b=this._dates[1])==null?void 0:b.getTime()}`))==null?void 0:_.parentElement;t==null||t.classList.add("range-end-day");let a=[...this.createCalendarDays().values()].flat().filter(p=>p.getTime()>this._dates[0].getTime()&&p.getTime()<this._dates[1].getTime());for(let p=0;p<a.length;p++){let w=(c=(i=this.shadowRoot)==null?void 0:i.getElementById(`${a[p].getTime()}`))==null?void 0:c.parentElement;(g=w==null?void 0:w.classList)==null||g.add("range-day")}})}createCalendarDays(){var m,_;let e=new Map;this._calendarDays=this.days.slice(this.startOfWeek).concat(this.days.slice(0,this.startOfWeek));let t=this.getWeekDayOfDate(this._calendarYear,this._calendarMonth),a=t<this.startOfWeek?7-(this.startOfWeek-t):t-this.startOfWeek,l=this.getDayNumInAMonth(this._calendarYear,this._calendarMonth-1),r=this.getDayNumInAMonth(this._calendarYear,this._calendarMonth),n=this.startOfWeek;for(let i=a;i>0;i--){let c=n%7,g=new Date(this._calendarYear,this._calendarMonth-1,l-i+1);e.set(this.days[c].name,[g]),n+=1}for(let i=1;i<=r;i++){let c=n%7,g=new Date(this._calendarYear,this._calendarMonth,i);e.get(this.days[c].name)?(m=e.get(this.days[c].name))==null||m.push(g):e.set(this.days[c].name,[g]),n+=1}let b=this._calendarDays.findIndex(i=>i.value===n%7);if(b!==0)for(let i=1;i<=this._calendarDays.length-b;i++){let c=n%7,g=new Date(this._calendarYear,this._calendarMonth+1,i);(_=e.get(this.days[c].name))==null||_.push(g),n+=1}return e}updated(e){if(e.has("value")){let t=E(this._value);t.length?t==null||t.forEach(a=>{this.handleDate(a)}):(this._dates=[],this._onBlCalendarChange([]))}}renderCalendarHeader(){let e=this._calendarView==="months"?"header-text-hover":"",t=this._calendarView==="years"?"header-text-hover":"";return h`
|
|
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 h`
|
|
33
|
-
<div class="week-row">
|
|
34
|
-
${[...e.keys()].map(a=>h` <div class="calendar-text weekday-text">${a}</div> `)}
|
|
35
|
-
</div>
|
|
36
|
-
<div class="days-wrapper">
|
|
37
|
-
${[...Array(t[0].length).keys()].map(a=>h` <div class="week-row">
|
|
38
|
-
${t.map(l=>{let r=l[a],n=this.checkIfSelectedDate(r),b=this.checkIfDateIsToday(r),m=this.checkIfDateIsDisabled(r),_=M({day:!0,"calendar-text":!0,"today-day":b,"selected-day":n,"other-month-day":l[a].getMonth()!==this._calendarMonth,"disabled-day":m});return h`
|
|
39
|
-
<div class="day-wrapper">
|
|
40
|
-
<bl-button
|
|
41
|
-
id=${r.getTime()}
|
|
42
|
-
variant="tertiary"
|
|
43
|
-
kind="neutral"
|
|
44
|
-
size="small"
|
|
45
|
-
class=${_}
|
|
46
|
-
?disabled=${m}
|
|
47
|
-
@click="${()=>!m&&this.handleDate(r)}"
|
|
48
|
-
>
|
|
49
|
-
${r.getDate()}
|
|
50
|
-
</bl-button>
|
|
51
|
-
</div>
|
|
52
|
-
`})}
|
|
53
|
-
</div>`)}
|
|
54
|
-
</div>
|
|
55
|
-
</div>`}renderCalendarMonths(){return h` <div class="grid-content">
|
|
56
|
-
${this.months.map((e,t)=>{let a=e.value===this._calendarMonth?"primary":"tertiary",l=e.value===this._calendarMonth?"default":"neutral";return h` <bl-button
|
|
57
|
-
variant=${a}
|
|
58
|
-
kind=${l}
|
|
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(),h` <div class="grid-content">
|
|
65
|
-
${this._calendarYears.map(e=>{let t=e===this._calendarYear?"primary":"tertiary",a=e===this._calendarYear?"default":"neutral";return h` <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 h`
|
|
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
|
-
`}};s([f()],o.prototype,"today",2),s([f()],o.prototype,"_calendarMonth",2),s([f()],o.prototype,"_calendarYear",2),s([f()],o.prototype,"_calendarView",2),s([f()],o.prototype,"_calendarYears",2),s([f()],o.prototype,"_calendarDays",2),s([f()],o.prototype,"_dates",2),s([T("bl-calendar-change")],o.prototype,"_onBlCalendarChange",2),o=s([S("bl-calendar"),A()],o);export{d as a,o as b};
|
|
84
|
-
//# sourceMappingURL=chunk-S6HEBXIR.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/utilities/string-to-date-converter.ts", "../src/mixins/datepicker-calendar-mixin/datepicker-calendar-mixin.ts", "../src/utilities/format-to-date-array.ts", "../src/components/calendar/bl-calendar.css", "../src/components/calendar/bl-calendar.ts"],
|
|
4
|
-
"sourcesContent": ["export function stringToDateArray(value: string): Date[] {\n const tempValue: Date[] = [];\n const splitDates = value.split(\",\");\n\n splitDates?.forEach(date => {\n const isDate = new Date(date.trim());\n\n if (!isNaN(isDate.getTime())) {\n tempValue.push(isDate);\n }\n });\n return tempValue;\n}\n", "import { LitElement } from \"lit\";\nimport { property } from \"lit/decorators.js\";\nimport { CalendarType, DayValues } from \"../../components/calendar/bl-calendar.types\";\nimport { stringToDateArray } from \"../../utilities/string-to-date-converter\";\n\nexport default class DatepickerCalendarMixin extends LitElement {\n /**\n * Defines the calendar types, available types are single, multiple and range\n */\n @property()\n type: CalendarType;\n /**\n * Defines the start day of the calendar (1 defines monday)\n */\n @property({ type: Number, attribute: \"start-of-week\", reflect: true })\n startOfWeek: DayValues = 0;\n /**\n * Defines the calendar language\n */\n @property()\n locale: string = document.documentElement.lang || \"en-EN\";\n\n /**\n * Defines the unselectable dates for calendar\n */\n protected _disabledDates: Date[] = [];\n\n get disabledDates(): Date[] {\n return this._disabledDates;\n }\n\n @property({\n attribute: \"disabled-dates\",\n reflect: true,\n })\n set disabledDates(disabledDates: Date[] | string) {\n // Now we are using 1.6.0 version of @lit/reactive-elements and in this version even if our property has property decorator it doesn't run request update inside.\n // We added similar implementations to update when there is a change.\n // When we update the lit to 2.0 or upper versions we can remove the requestUpdate here\n\n let newVal: Date[] = [];\n\n if (typeof disabledDates === \"string\") {\n newVal = stringToDateArray(disabledDates);\n } else if (Array.isArray(disabledDates)) {\n newVal = disabledDates.filter(d => !isNaN(d.getTime()));\n }\n\n this.requestUpdate(\"disabledDates\", newVal);\n this._disabledDates = newVal;\n }\n\n /**\n * Defines the maximum date value for the calendar\n */\n _maxDate: Date;\n\n get maxDate() {\n return this._maxDate;\n }\n\n @property({ type: Date, attribute: \"max-date\", reflect: true })\n set maxDate(maxDate: Date) {\n if (maxDate && isNaN(new Date(maxDate).getTime())) {\n console.warn(\"Invalid maxDate value.\");\n return;\n }\n if (this._minDate && this._minDate >= maxDate) {\n console.warn(\"maxDate cannot be smaller than minDate.\");\n } else {\n this._maxDate = new Date(maxDate);\n this.requestUpdate(\"maxDate\", maxDate);\n }\n }\n\n /**\n * Defines the minimum date value for the calendar\n */\n _minDate: Date;\n\n get minDate() {\n return this._minDate;\n }\n\n @property({ type: Date, attribute: \"min-date\", reflect: true })\n set minDate(minDate: Date) {\n if (minDate && isNaN(new Date(minDate).getTime())) {\n console.warn(\"Invalid minDate value.\");\n return;\n }\n if (this._maxDate && this._maxDate <= minDate) {\n console.warn(\"minDate cannot be greater than maxDate.\");\n } else {\n this._minDate = new Date(minDate);\n this.requestUpdate(\"minDate\", minDate);\n }\n }\n\n @property({ attribute: \"value\", reflect: true })\n set value(value: string | Date | Date[]) {\n const oldValue = this._value;\n\n this._value = value;\n this.requestUpdate(\"value\", oldValue);\n }\n\n get value(): string | Date | Date[] {\n return this._value;\n }\n\n _value: string | Date | Date[] = [];\n}\n", "import { stringToDateArray } from \"./string-to-date-converter\";\n\nexport function formatToDateArray(value: string | Date | Date[]): Date[] {\n if (typeof value === \"string\") {\n return stringToDateArray(value);\n } else if (value instanceof Date) {\n return [value];\n } else {\n return value;\n }\n}\n", "import {css} from 'lit';\nexport const styles = css`.calendar{display:flex;flex-direction:column}.calendar-content{display:flex;padding:var(--bl-size-m);flex-direction:column;align-items:center;gap:var(--bl-size-m);border-radius:var(--bl-border-radius-s);width:fit-content;background:var(--bl-color-neutral-full)}.calendar-header{display:flex;justify-content:space-between;width:100%;align-items:center;padding-bottom:var(--bl-size-s)}.arrow{flex:1}:host([dir=\"rtl\"]) .arrow{transform:scale(-1)}.header-text{flex:3}.header-text-hover{background:var(--bl-color-neutral-lightest);border-radius:var(--bl-border-radius-s)}.days-wrapper{display:flex;flex-direction:column}.day-wrapper{display:flex;align-items:center;justify-content:center}.week-row{display:flex;align-items:center;flex-direction:row;padding-bottom:var(--bl-size-2xs)}.day{display:flex;align-items:center;width:40px;--bl-button-focus-border-color:#000;--bl-font-title-4-medium:var(--bl-font-weight-regular) var(--bl-font-size-m);--bl-size-xl:40px;--bl-border-radius-m:50%;--bl-border-radius-l:50%}.day.today-day{--bl-color-neutral-darker:var(--bl-color-primary);--bl-color-neutral-darkest:var(--bl-color-primary)}.day.other-month-day{--bl-color-neutral-darker:var(--bl-color-neutral-dark)}.day.other-month-day.selected-day{--bl-color-neutral-darker:var(--bl-color-neutral-full)}.day.selected-day{background:var(--bl-color-primary);border-radius:50%;--bl-button-focus-border-color:var(--bl-color-primary);--bl-color-neutral-darker:var(--bl-color-neutral-full)}.range-day{background:var(--bl-color-primary-contrast);--bl-color-neutral-lightest:var(--bl-color-primary-contrast)}.range-end-day,.range-start-day,.selected-day{--bl-color-neutral-lightest:var(--bl-color-primary);--bl-color-neutral-darker:var(--bl-color-neutral-full);--bl-color-neutral-darkest:var(--bl-color-neutral-full) !important}.range-start-day{background:var(--bl-color-primary-contrast);border-start-start-radius:50%;border-end-start-radius:50%}.range-end-day{background:var(--bl-color-primary-contrast);border-start-end-radius:50%;border-end-end-radius:50%}.weekday-text{color:var(--bl-color-neutral-dark);text-align:center;padding:var(--bl-size-2xs) 0;width:40px}.grid-content{display:grid;grid-template-columns:auto auto auto;text-align:center}.grid-item{width:93.33px;--bl-size-3xs:15px}.grid-item:not(:nth-last-child(-n + 3)){padding-bottom:var(--bl-size-2xs)}.calendar-text{font:var(--bl-font-title-3-regular)}`;\nexport default styles;\n", "import { CSSResultGroup, html, PropertyValues } from \"lit\";\nimport { customElement, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { localized } from \"@lit/localize\";\nimport DatepickerCalendarMixin from \"../../mixins/datepicker-calendar-mixin/datepicker-calendar-mixin\";\nimport { setDirectionProperty } from \"../../utilities/direction\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport { formatToDateArray } from \"../../utilities/format-to-date-array\";\nimport \"../button/bl-button\";\nimport \"../icon/bl-icon\";\nimport {\n CALENDAR_TYPES,\n CALENDAR_VIEWS,\n FIRST_MONTH_INDEX,\n LAST_MONTH_INDEX,\n} from \"./bl-calendar.constant\";\nimport style from \"./bl-calendar.css\";\nimport { Calendar, CalendarDay, CalendarView } from \"./bl-calendar.types\";\n\n/**\n * @tag bl-calendar\n * @summary Baklava Calendar component\n **/\n@customElement(\"bl-calendar\")\n@localized()\nexport default class BlCalendar extends DatepickerCalendarMixin {\n @state()\n today = new Date();\n @state()\n _calendarMonth: number = this.today.getMonth();\n @state()\n _calendarYear: number = this.today.getFullYear();\n @state()\n _calendarView: CalendarView = CALENDAR_VIEWS.DAYS;\n @state()\n _calendarYears: number[] = [];\n @state()\n _calendarDays: CalendarDay[] = [];\n @state()\n _dates: Date[] = [];\n /**\n * Fires when date selection changes\n */\n @event(\"bl-calendar-change\") _onBlCalendarChange: EventDispatcher<Date[]>;\n\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n connectedCallback() {\n super.connectedCallback();\n setDirectionProperty(this);\n }\n\n get months() {\n return [...Array(12).keys()].map(month => ({\n name: new Date(0, month + 1, 0).toLocaleString(this.locale, { month: \"long\" }),\n value: month,\n }));\n }\n\n get days() {\n return [...Array(7).keys()].map(day => ({\n name: new Date(0, 0, day).toLocaleString(this.locale, { weekday: \"short\" }),\n value: day,\n }));\n }\n\n public handleClearSelectedDates = () => {\n this._dates = [];\n this._onBlCalendarChange([]);\n this.clearRangePickerStyles();\n };\n\n getDayNumInAMonth(year: number, month: number) {\n return new Date(year, month + 1, 0).getDate();\n }\n\n getWeekDayOfDate(year: number, month: number) {\n return new Date(year, month, 1).getDay();\n }\n\n setPreviousCalendarView() {\n this.clearRangePickerStyles();\n if (this._calendarView === CALENDAR_VIEWS.DAYS) {\n if (this._calendarMonth === FIRST_MONTH_INDEX) {\n this._calendarMonth = LAST_MONTH_INDEX;\n this._calendarYear -= 1;\n } else this._calendarMonth -= 1;\n } else if (this._calendarView === CALENDAR_VIEWS.MONTHS) {\n this._calendarYear -= 1;\n } else if (this._calendarView === CALENDAR_VIEWS.YEARS) {\n const fromYear = this._calendarYears[0];\n\n this._calendarYears = Array.from({ length: 12 }, (_, i) => fromYear - (i + 1));\n }\n if (this.type === CALENDAR_TYPES.RANGE) this.setHoverClass();\n }\n\n setNextCalendarView() {\n this.clearRangePickerStyles();\n if (this._calendarView === CALENDAR_VIEWS.DAYS) {\n if (this._calendarMonth === LAST_MONTH_INDEX) {\n this._calendarMonth = FIRST_MONTH_INDEX;\n this._calendarYear += 1;\n } else this._calendarMonth += 1;\n } else if (this._calendarView === CALENDAR_VIEWS.MONTHS) {\n this._calendarYear += 1;\n } else if (this._calendarView === CALENDAR_VIEWS.YEARS) {\n const fromYear = this._calendarYears[11];\n\n this._calendarYears = Array.from({ length: 12 }, (_, i) => fromYear + (i + 1));\n }\n this.setHoverClass();\n }\n\n setCurrentCalendarView(view: CalendarView) {\n this._calendarView = this._calendarView !== view ? view : CALENDAR_VIEWS.DAYS;\n this.setHoverClass();\n }\n\n setMonthAndCalendarView(month: number) {\n this._calendarMonth = month;\n this._calendarView = CALENDAR_VIEWS.DAYS;\n if (this.type === CALENDAR_TYPES.RANGE) this.setHoverClass();\n }\n\n setYearAndCalendarView(year: number) {\n this._calendarYear = year;\n this._calendarView = CALENDAR_VIEWS.DAYS;\n if (this.type === CALENDAR_TYPES.RANGE) this.setHoverClass();\n }\n\n generateSurroundingYears() {\n if (!this._calendarYears.length) {\n this._calendarYears = Array.from({ length: 12 }, (_, i) => this._calendarYear - 4 + i);\n }\n }\n\n clearRangePickerStyles() {\n this.shadowRoot\n ?.querySelectorAll(\".range-day, .range-start-day, .range-end-day\")\n .forEach(day => day.classList.remove(\"range-day\", \"range-start-day\", \"range-end-day\"));\n }\n\n handleDate(date: Date) {\n if (this.type !== CALENDAR_TYPES.RANGE) {\n const isDateBeforeThanCalendar =\n date.getFullYear() < this._calendarYear ||\n (date.getFullYear() === this._calendarYear && date.getMonth() < this._calendarMonth);\n\n const isDateAfterThanCalendar =\n date.getFullYear() > this._calendarYear ||\n (date.getFullYear() === this._calendarYear && date.getMonth() > this._calendarMonth);\n\n if (isDateBeforeThanCalendar) {\n this.setPreviousCalendarView();\n } else if (isDateAfterThanCalendar) {\n this.setNextCalendarView();\n }\n }\n\n switch (this.type) {\n case CALENDAR_TYPES.SINGLE:\n this.handleSingleSelectCalendar(date);\n break;\n case CALENDAR_TYPES.MULTIPLE:\n this.handleMultipleSelectCalendar(date);\n break;\n case CALENDAR_TYPES.RANGE:\n this.handleRangeSelectCalendar(date);\n break;\n }\n\n this._onBlCalendarChange(this._dates);\n this.requestUpdate();\n }\n\n handleSingleSelectCalendar(calendarDate: Date) {\n this._dates = [calendarDate];\n }\n\n handleMultipleSelectCalendar(calendarDate: Date) {\n const dateExist = this._dates?.some(d => d.getTime() === calendarDate.getTime());\n\n dateExist\n ? this._dates?.splice(\n this._dates?.findIndex(d => d.getTime() === calendarDate.getTime()),\n 1\n )\n : this._dates.push(calendarDate);\n }\n\n handleRangeSelectCalendar(calendarDate: Date) {\n if (!this._dates[0]) {\n this._dates[0] = calendarDate;\n } else if (!this._dates[1]) {\n if (calendarDate.getTime() > this._dates[0].getTime()) {\n this._dates[1] = calendarDate;\n } else {\n const tempEndDate = this._dates[0];\n\n this._dates[0] = calendarDate;\n this._dates[1] = tempEndDate;\n }\n } else {\n this._dates = [];\n this._dates[0] = calendarDate;\n }\n this.setHoverClass();\n }\n\n checkIfSelectedDate(calendarDate: Date) {\n return this._dates?.some(\n date =>\n date.getFullYear() === calendarDate.getFullYear() &&\n date.getMonth() === calendarDate.getMonth() &&\n date.getDate() === calendarDate.getDate()\n );\n }\n\n checkIfDateIsToday(calendarDate: Date) {\n const today = this.today;\n\n return (\n today.getDate() === calendarDate.getDate() &&\n today.getMonth() === calendarDate.getMonth() &&\n today.getFullYear() === calendarDate.getFullYear()\n );\n }\n\n checkIfDateIsDisabled(calendarDate: Date) {\n if (\n calendarDate.getTime() < this.minDate?.getTime() ||\n calendarDate.getTime() > this.maxDate?.getTime()\n ) {\n return true;\n }\n if (this.disabledDates.length > 0) {\n return this.disabledDates?.some(disabledDate => {\n return (\n calendarDate.getDate() === disabledDate.getDate() &&\n calendarDate.getMonth() === disabledDate.getMonth() &&\n calendarDate.getFullYear() === disabledDate.getFullYear()\n );\n });\n }\n return false;\n }\n\n setHoverClass() {\n this.clearRangePickerStyles();\n\n if (this._dates[0] && this._dates[1]) {\n setTimeout(() => {\n const startDateParentElement = this.shadowRoot?.getElementById(\n `${this._dates[0]?.getTime()}`\n )?.parentElement;\n\n startDateParentElement?.classList.add(\"range-start-day\");\n\n const endDateParentElement = this.shadowRoot?.getElementById(\n `${this._dates[1]?.getTime()}`\n )?.parentElement;\n\n endDateParentElement?.classList.add(\"range-end-day\");\n const rangeDays = [...this.createCalendarDays().values()]\n .flat()\n .filter(\n date =>\n date.getTime() > this._dates[0]!.getTime() &&\n date.getTime() < this._dates[1]!.getTime()\n );\n\n for (let i = 0; i < rangeDays.length; i++) {\n const element = this.shadowRoot?.getElementById(\n `${rangeDays[i].getTime()}`\n )?.parentElement;\n\n element?.classList?.add(\"range-day\");\n }\n });\n }\n }\n\n createCalendarDays() {\n const calendar: Calendar = new Map();\n\n this._calendarDays = this.days\n .slice(this.startOfWeek)\n .concat(this.days.slice(0, this.startOfWeek));\n\n const currentMonthStartWeekDay = this.getWeekDayOfDate(this._calendarYear, this._calendarMonth); // 1\n\n const lastMonthDaysCount =\n currentMonthStartWeekDay < this.startOfWeek\n ? 7 - (this.startOfWeek - currentMonthStartWeekDay)\n : currentMonthStartWeekDay - this.startOfWeek;\n\n const previousMonthDayCount = this.getDayNumInAMonth(\n this._calendarYear,\n this._calendarMonth - 1\n );\n\n const currentMonthDayCount = this.getDayNumInAMonth(this._calendarYear, this._calendarMonth);\n\n let dayOfTheWeek = this.startOfWeek; // from sunday\n\n for (\n let lastMonthDaysIterator = lastMonthDaysCount;\n lastMonthDaysIterator > 0;\n lastMonthDaysIterator--\n ) {\n const mod = dayOfTheWeek % 7;\n const date = new Date(\n this._calendarYear,\n this._calendarMonth - 1,\n previousMonthDayCount - lastMonthDaysIterator + 1\n );\n\n calendar.set(this.days[mod].name, [date]);\n\n dayOfTheWeek += 1;\n }\n for (\n let currentMonthDaysIterator = 1;\n currentMonthDaysIterator <= currentMonthDayCount;\n currentMonthDaysIterator++\n ) {\n const mod = dayOfTheWeek % 7;\n const day = new Date(this._calendarYear, this._calendarMonth, currentMonthDaysIterator);\n\n if (calendar.get(this.days[mod].name)) {\n calendar.get(this.days[mod].name)?.push(day);\n } else {\n calendar.set(this.days[mod].name, [day]);\n }\n dayOfTheWeek += 1;\n }\n\n const index = this._calendarDays.findIndex(day => day.value === dayOfTheWeek % 7);\n\n if (index !== 0) {\n for (\n let nextMonthDaysIterator = 1;\n nextMonthDaysIterator <= this._calendarDays.length - index;\n nextMonthDaysIterator++\n ) {\n const mod = dayOfTheWeek % 7;\n const date = new Date(this._calendarYear, this._calendarMonth + 1, nextMonthDaysIterator);\n\n calendar.get(this.days[mod].name)?.push(date);\n\n dayOfTheWeek += 1;\n }\n }\n return calendar;\n }\n\n updated(changedProperties: PropertyValues) {\n if (changedProperties.has(\"value\")) {\n const dates = formatToDateArray(this._value);\n\n if (!dates.length) {\n this._dates = [];\n this._onBlCalendarChange([]);\n } else {\n dates?.forEach(date => {\n this.handleDate(date);\n });\n }\n }\n }\n\n renderCalendarHeader() {\n const showMonthSelected =\n this._calendarView === CALENDAR_VIEWS.MONTHS ? \"header-text-hover\" : \"\";\n const showYearSelected = this._calendarView === CALENDAR_VIEWS.YEARS ? \"header-text-hover\" : \"\";\n\n return html`\n <div class=\"calendar-header\">\n <bl-button\n class=\"arrow\"\n icon=\"arrow_left\"\n variant=\"tertiary\"\n kind=\"neutral\"\n @click=\"${() => this.setPreviousCalendarView()}\"\n ></bl-button>\n <bl-button\n variant=\"tertiary\"\n kind=\"neutral\"\n class=\"header-text ${showMonthSelected}\"\n @click=\"${() => this.setCurrentCalendarView(CALENDAR_VIEWS.MONTHS)}\"\n >${this.months[this._calendarMonth].name}\n </bl-button>\n <bl-button\n variant=\"tertiary\"\n kind=\"neutral\"\n class=\"header-text ${showYearSelected}\"\n @click=\"${() => this.setCurrentCalendarView(CALENDAR_VIEWS.YEARS)}\"\n >${this._calendarYear}\n </bl-button>\n <bl-button\n class=\"arrow\"\n icon=\"arrow_right\"\n variant=\"tertiary\"\n kind=\"neutral\"\n @click=\"${() => this.setNextCalendarView()}\"\n ></bl-button>\n </div>\n `;\n }\n\n renderCalendarDays() {\n const calendarDays = this.createCalendarDays();\n const valuesArray = Array.from(calendarDays.values());\n\n return html`\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.renderC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AK,eAAe,IAAI1C,GAAQ,CAChC,IAAMoD,EAAUpD,IAAS,KAAK,cAAgB,UAAY,WACpDqD,EAAUrD,IAAS,KAAK,cAAgB,UAAY,UAE1D,OAAO0C;AAAA,oBACKU;AAAA,iBACHC;AAAA;AAAA,oBAEG,IAAM,KAAK,uBAAuBrD,CAAI;AAAA,yCACjBA;AAAA,UAEnC,CAAC;AAAA,WAEL,CAEA,QAAS,CACP,OAAO0C;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,EAteEY,EAAA,CADCC,EAAM,GADY7D,EAEnB,qBAEA4D,EAAA,CADCC,EAAM,GAHY7D,EAInB,8BAEA4D,EAAA,CADCC,EAAM,GALY7D,EAMnB,6BAEA4D,EAAA,CADCC,EAAM,GAPY7D,EAQnB,6BAEA4D,EAAA,CADCC,EAAM,GATY7D,EAUnB,8BAEA4D,EAAA,CADCC,EAAM,GAXY7D,EAYnB,6BAEA4D,EAAA,CADCC,EAAM,GAbY7D,EAcnB,sBAI6B4D,EAAA,CAA5BE,EAAM,oBAAoB,GAlBR9D,EAkBU,mCAlBVA,EAArB4D,EAAA,CAFCG,EAAc,aAAa,EAC3BC,EAAU,GACUhE",
|
|
6
|
-
"names": ["stringToDateArray", "value", "tempValue", "splitDates", "date", "isDate", "DatepickerCalendarMixin", "s", "disabledDates", "newVal", "stringToDateArray", "d", "maxDate", "minDate", "value", "oldValue", "__decorateClass", "e", "formatToDateArray", "value", "stringToDateArray", "styles", "i", "bl_calendar_default", "BlCalendar", "DatepickerCalendarMixin", "bl_calendar_default", "setDirectionProperty", "month", "day", "year", "fromYear", "_", "i", "view", "_a", "date", "isDateBeforeThanCalendar", "isDateAfterThanCalendar", "calendarDate", "_b", "_c", "d", "tempEndDate", "today", "disabledDate", "_d", "_e", "_f", "_g", "_h", "_i", "startDateParentElement", "endDateParentElement", "rangeDays", "element", "calendar", "currentMonthStartWeekDay", "lastMonthDaysCount", "previousMonthDayCount", "currentMonthDayCount", "dayOfTheWeek", "lastMonthDaysIterator", "mod", "currentMonthDaysIterator", "index", "nextMonthDaysIterator", "changedProperties", "dates", "formatToDateArray", "showMonthSelected", "showYearSelected", "x", "calendarDays", "valuesArray", "key", "values", "isSelectedDay", "isDayToday", "isDisabledDay", "classes", "o", "variant", "neutral", "__decorateClass", "t", "event", "e", "localized"]
|
|
7
|
-
}
|
package/dist/chunk-T5EQ4OXS.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a}from"./chunk-STMCW2R6.js";import{a as r,b as i}from"./chunk-5MOOXA2X.js";import{a as o,b as l,f as s}from"./chunk-4OT5AMS5.js";import{d as t}from"./chunk-IZ2LK5GK.js";var p=o`:host{display:table-header-group}:host([sticky]){position:sticky;top:0;inset-inline-start:0;inset-inline-end:0;z-index:3;transition:top 0.05s ease;box-shadow:0 8px 16px 0 rgb(39 49 66 / 10%)}:host([sticky])::after{content:"";display:block;position:absolute;bottom:0;inset-inline-start:0;inset-inline-end:0;height:1px;background:var(--bl-color-neutral-lighter)}`,n=p;var b="bl-table-header",e=class extends s{constructor(){super(...arguments);this.sticky=!1}static get styles(){return[n]}connectedCallback(){super.connectedCallback(),this.closest(a)||console.warn("bl-table-header is designed to be used inside a bl-table",this)}render(){return l`<slot></slot> `}};t([i({type:Boolean,reflect:!0})],e.prototype,"sticky",2),e=t([r(b)],e);export{b as a,e as b};
|
|
2
|
-
//# sourceMappingURL=chunk-T5EQ4OXS.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/table/table-header/bl-table-header.css", "../src/components/table/table-header/bl-table-header.ts"],
|
|
4
|
-
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:table-header-group}:host([sticky]){position:sticky;top:0;inset-inline-start:0;inset-inline-end:0;z-index:3;transition:top 0.05s ease;box-shadow:0 8px 16px 0 rgb(39 49 66 / 10%)}:host([sticky])::after{content:\"\";display:block;position:absolute;bottom:0;inset-inline-start:0;inset-inline-end:0;height:1px;background:var(--bl-color-neutral-lighter)}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport \"element-internals-polyfill\";\nimport { blTableTag } from \"../bl-table\";\nimport type BlTable from \"../bl-table\";\nimport style from \"../table-header/bl-table-header.css\";\n\nexport const blTableHeaderTag = \"bl-table-header\";\n\n/**\n * @tag bl-table-header\n * @summary Baklava Table component\n */\n@customElement(blTableHeaderTag)\nexport default class BlTableHeader extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n /**\n * Set table header as sticky\n */\n @property({ type: Boolean, reflect: true })\n sticky = false;\n\n connectedCallback(): void {\n super.connectedCallback();\n if (!this.closest<BlTable>(blTableTag)) {\n console.warn(\"bl-table-header is designed to be used inside a bl-table\", this);\n }\n }\n\n render(): TemplateResult {\n return html`<slot></slot> `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n [blTableHeaderTag]: BlTableHeader;\n }\n}\n"],
|
|
5
|
-
"mappings": "gLACO,IAAMA,EAASC,4WACfC,EAAQF,ECKR,IAAMG,EAAmB,kBAOXC,EAArB,cAA2C,CAAW,CAAtD,kCAQE,YAAS,GAPT,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAOA,mBAA0B,CACxB,MAAM,kBAAkB,EACnB,KAAK,QAAiBC,CAAU,GACnC,QAAQ,KAAK,2DAA4D,IAAI,CAEjF,CAEA,QAAyB,CACvB,OAAOC,iBACT,CACF,EAZEC,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAPvBL,EAQnB,sBARmBA,EAArBI,EAAA,CADCC,EAAcN,CAAgB,GACVC",
|
|
6
|
-
"names": ["styles", "i", "bl_table_header_default", "blTableHeaderTag", "BlTableHeader", "bl_table_header_default", "blTableTag", "x", "__decorateClass", "e"]
|
|
7
|
-
}
|
package/dist/chunk-UZJOCLOO.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-ECPWEUBG.js";import{a as s}from"./chunk-DINNT5P2.js";import{a}from"./chunk-GRL4DWKG.js";import{a as u,b as r}from"./chunk-5MOOXA2X.js";import{a as l,b as i,f as c}from"./chunk-4OT5AMS5.js";import{d as o}from"./chunk-IZ2LK5GK.js";var p=l`:host{display:block}.notification{position:relative;border-radius:var(--bl-border-radius-m);box-shadow:0 5px 30px 0 rgba(39 49 66 / 25%)}.duration{position:absolute;inset-inline-start:0;inset-inline-end:0;bottom:0;height:var(--bl-size-2xs);width:100%}.duration > .remaining{position:absolute;height:100%;width:100%;border-radius:var(--bl-border-radius-s);border-top-left-radius:0;animation-name:to-zero;animation-duration:var(--duration, 7s);animation-timing-function:linear;animation-fill-mode:forwards;animation-play-state:running}.notification.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__ .duration > .remaining,.notification:hover .duration > .remaining{animation-play-state:paused}@keyframes to-zero{to{width:0}}.notification[variant="success"] .duration > .remaining{background-color:var(--bl-color-success)}.notification[variant="warning"] .duration > .remaining{background-color:var(--bl-color-warning)}.notification[variant="danger"] .duration > .remaining{background-color:var(--bl-color-danger)}.notification[variant="info"] .duration > .remaining{background-color:var(--bl-color-info)}`,m=p;var f=(e=>(e.DurationEnded="duration-ended",e.CloseButton="close-button",e))(f||{}),v={info:"info",success:"success",warning:"warning",error:"danger"},t=class extends c{constructor(){super(...arguments);this.caption="";this.variant="info";this.duration=7;this.permanent=!1;this.closed=!1}static get styles(){return[m]}firstUpdated(){this.setupDuration()}async setupDuration(){if(!this.permanent){if(this.duration<=0){this.close("duration-ended");return}setTimeout(()=>{var e,n;(n=(e=this.shadowRoot)==null?void 0:e.querySelector(".remaining"))==null||n.addEventListener("animationend",()=>{this.close("duration-ended")},{once:!0})},0)}}close(e){this.onRequestClose({source:e},{cancelable:!0}).defaultPrevented||(this.onClose({source:e}),this.closed=!0)}handleClose(e){let n=e.target;n.closed=!1,this.close("close-button")}renderProgress(){return this.permanent?null:i`
|
|
2
|
-
<div class="duration">
|
|
3
|
-
<div class="remaining" style="--duration: ${this.duration}s;"></div>
|
|
4
|
-
</div>
|
|
5
|
-
`}render(){let{icon:e=!0,variant:n="info"}=this;return i`
|
|
6
|
-
<bl-alert
|
|
7
|
-
class="notification"
|
|
8
|
-
caption="${s(this.caption)}"
|
|
9
|
-
icon=${e}
|
|
10
|
-
variant=${s(v[n])}
|
|
11
|
-
?closed=${this.closed}
|
|
12
|
-
?closable=${!0}
|
|
13
|
-
@bl-close=${this.handleClose}
|
|
14
|
-
>
|
|
15
|
-
<slot></slot>
|
|
16
|
-
${this.renderProgress()}
|
|
17
|
-
<slot name="primary-action" slot="action"></slot>
|
|
18
|
-
<slot name="secondary-action" slot="action-secondary"></slot>
|
|
19
|
-
</bl-alert>
|
|
20
|
-
`}};o([r({type:String})],t.prototype,"caption",2),o([r({converter:d()})],t.prototype,"icon",2),o([r({reflect:!0})],t.prototype,"variant",2),o([r({type:Number})],t.prototype,"duration",2),o([r({type:Boolean})],t.prototype,"permanent",2),o([r({type:Boolean})],t.prototype,"closed",2),o([a("bl-notification-card-request-close")],t.prototype,"onRequestClose",2),o([a("bl-notification-card-close")],t.prototype,"onClose",2),t=o([u("bl-notification-card")],t);export{f as a,t as b};
|
|
21
|
-
//# sourceMappingURL=chunk-UZJOCLOO.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/notification/card/bl-notification-card.css", "../src/components/notification/card/bl-notification-card.ts"],
|
|
4
|
-
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:block}.notification{position:relative;border-radius:var(--bl-border-radius-m);box-shadow:0 5px 30px 0 rgba(39 49 66 / 25%)}.duration{position:absolute;inset-inline-start:0;inset-inline-end:0;bottom:0;height:var(--bl-size-2xs);width:100%}.duration > .remaining{position:absolute;height:100%;width:100%;border-radius:var(--bl-border-radius-s);border-top-left-radius:0;animation-name:to-zero;animation-duration:var(--duration, 7s);animation-timing-function:linear;animation-fill-mode:forwards;animation-play-state:running}.notification.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__ .duration > .remaining,.notification:hover .duration > .remaining{animation-play-state:paused}@keyframes to-zero{to{width:0}}.notification[variant=\"success\"] .duration > .remaining{background-color:var(--bl-color-success)}.notification[variant=\"warning\"] .duration > .remaining{background-color:var(--bl-color-warning)}.notification[variant=\"danger\"] .duration > .remaining{background-color:var(--bl-color-danger)}.notification[variant=\"info\"] .duration > .remaining{background-color:var(--bl-color-info)}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { customElement, property } from \"lit/decorators.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { event, EventDispatcher } from \"../../../utilities/event\";\nimport { stringBooleanConverter } from \"../../../utilities/string-boolean.converter\";\nimport BlAlert, { AlertVariant } from \"../../alert/bl-alert\";\nimport { BaklavaIcon } from \"../../icon/icon-list\";\nimport style from \"./bl-notification-card.css\";\n\nexport enum CloseSource {\n DurationEnded = \"duration-ended\",\n CloseButton = \"close-button\",\n}\n\nexport type NotificationVariant = \"info\" | \"success\" | \"warning\" | \"error\";\n\nconst NOTIFICATION_VARIANT_ALERT_MAP: Readonly<Record<NotificationVariant, AlertVariant>> = {\n info: \"info\",\n success: \"success\",\n warning: \"warning\",\n error: \"danger\",\n};\n\n/**\n * @tag bl-notification-card\n * @summary Baklava Notification Card component\n */\n\n@customElement(\"bl-notification-card\")\nexport default class BlNotificationCard extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets notification caption.\n * @attr caption\n * @type {string}\n * @default \"\"\n */\n @property({ type: String })\n caption = \"\";\n\n /**\n * Allows to customize notification icon.\n * True value will display default icon.\n * False value will hide icon.\n * String value will display icon with specified name.\n * @attr icon\n * @type {boolean | BaklavaIcon}\n * @default true\n */\n @property({ converter: stringBooleanConverter() })\n icon?: boolean | BaklavaIcon;\n\n /**\n * Sets notification variant.\n * @attr variant\n * @type {NotificationVariant}\n * @default \"info\"\n */\n @property({ reflect: true })\n variant: NotificationVariant = \"info\";\n\n /**\n * Sets notification display duration in minutes.\n * Has no effect if permanent is set to true.\n * @attr closed\n * @type {boolean}\n * @default false\n */\n @property({ type: Number })\n duration = 7;\n\n /**\n * Prevents notification from being closed automatically.\n * @attr closed\n * @type {boolean}\n * @default false\n */\n @property({ type: Boolean })\n permanent = false;\n\n /**\n * Indicates whether the notification is closed.\n */\n @property({ type: Boolean })\n closed = false;\n\n /**\n * Dispatches close request event.\n * The notification will not be closed automatically if the event is prevented.\n */\n @event(\"bl-notification-card-request-close\") private onRequestClose: EventDispatcher<{\n source: \"duration-ended\" | \"close-button\";\n }>;\n\n /**\n * Dispatches close event.\n * The notification will hidden after the event is dispatched and the closed property is set to true.\n */\n @event(\"bl-notification-card-close\") private onClose: EventDispatcher<{\n source: \"duration-ended\" | \"close-button\";\n }>;\n\n protected firstUpdated() {\n this.setupDuration();\n }\n\n /**\n * Sets up duration animation.\n * The notification will dispatch a closed event after the animation ends.\n */\n private async setupDuration() {\n if (this.permanent) {\n return;\n }\n\n if (this.duration <= 0) {\n this.close(CloseSource.DurationEnded);\n return;\n }\n\n setTimeout(() => {\n this.shadowRoot?.querySelector(\".remaining\")?.addEventListener(\n \"animationend\",\n () => {\n this.close(CloseSource.DurationEnded);\n },\n { once: true }\n );\n }, 0);\n }\n\n private close(source: CloseSource) {\n const requestCloseEvent = this.onRequestClose({ source }, { cancelable: true });\n\n if (requestCloseEvent.defaultPrevented) {\n return;\n }\n\n this.onClose({ source });\n this.closed = true;\n }\n\n private handleClose(e: CustomEvent<boolean>) {\n const target = e.target as BlAlert;\n\n target.closed = false;\n\n this.close(CloseSource.CloseButton);\n }\n\n private renderProgress() {\n if (this.permanent) {\n return null;\n }\n\n return html`\n <div class=\"duration\">\n <div class=\"remaining\" style=\"--duration: ${this.duration}s;\"></div>\n </div>\n `;\n }\n\n render(): TemplateResult {\n const { icon = true, variant = \"info\" } = this;\n\n return html`\n <bl-alert\n class=\"notification\"\n caption=\"${ifDefined(this.caption)}\"\n icon=${icon}\n variant=${ifDefined(NOTIFICATION_VARIANT_ALERT_MAP[variant])}\n ?closed=${this.closed}\n ?closable=${true}\n @bl-close=${this.handleClose}\n >\n <slot></slot>\n ${this.renderProgress()}\n <slot name=\"primary-action\" slot=\"action\"></slot>\n <slot name=\"secondary-action\" slot=\"action-secondary\"></slot>\n </bl-alert>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-notification-card\": BlNotificationCard;\n }\n}\n"],
|
|
5
|
-
"mappings": "gQACO,IAAMA,EAASC,2kCACfC,EAAQF,ECOR,IAAKG,OACVA,EAAA,cAAgB,iBAChBA,EAAA,YAAc,eAFJA,OAAA,IAONC,EAAsF,CAC1F,KAAM,OACN,QAAS,UACT,QAAS,UACT,MAAO,QACT,EAQqBC,EAArB,cAAgDC,CAAW,CAA3D,kCAYE,aAAU,GAqBV,aAA+B,OAU/B,cAAW,EASX,eAAY,GAMZ,YAAS,GAzDT,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAyEU,cAAe,CACvB,KAAK,cAAc,CACrB,CAMA,MAAc,eAAgB,CAC5B,GAAI,MAAK,UAIT,IAAI,KAAK,UAAY,EAAG,CACtB,KAAK,MAAM,gBAAyB,EACpC,OAGF,WAAW,IAAM,CA3HrB,IAAAC,EAAAC,GA4HMA,GAAAD,EAAA,KAAK,aAAL,YAAAA,EAAiB,cAAc,gBAA/B,MAAAC,EAA8C,iBAC5C,eACA,IAAM,CACJ,KAAK,MAAM,gBAAyB,CACtC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d,EAwE0B,uBAxE1BA,EAArBW,EAAA,CADCC,EAAc,sBAAsB,GAChBZ",
|
|
6
|
-
"names": ["styles", "i", "bl_notification_card_default", "CloseSource", "NOTIFICATION_VARIANT_ALERT_MAP", "BlNotificationCard", "s", "bl_notification_card_default", "_a", "_b", "source", "target", "x", "icon", "variant", "l", "__decorateClass", "e", "stringBooleanConverter", "event"]
|
|
7
|
-
}
|
package/dist/chunk-VU6LRFZR.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import{a as f}from"./chunk-6LT7O7T2.js";import{a as n}from"./chunk-DINNT5P2.js";import{a as y}from"./chunk-GRL4DWKG.js";import{a as v,b as e,c as m,e as g}from"./chunk-5MOOXA2X.js";import{a as u,b as a,f as p}from"./chunk-4OT5AMS5.js";import{d as o}from"./chunk-IZ2LK5GK.js";var _=l=>{if(!(!l.noValidate&&!l.reportValidity())){let b=new SubmitEvent("submit",{bubbles:!0,cancelable:!0});l.dispatchEvent(b),b.defaultPrevented||l.submit()}};var z=u`:host{display:var(--bl-button-display, inline-block);max-width:100%;position:relative}.button{--main-color:var(--bl-color-primary);--main-hover-color:var(--bl-color-primary-highlight);--text-hover-color:var(--bl-color-neutral-lightest);--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-color);--border-color:var(--main-color);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-m);--margin-icon:var(--padding-vertical);--icon-size:var(--bl-size-m);--font:var(--bl-font-title-3-medium);--height:var(--bl-size-2xl);display:flex;gap:var(--margin-icon);justify-content:var(--bl-button-justify, center);align-items:center;box-sizing:border-box;width:100%;height:var(--height);border:solid 1px var(--border-color);border-radius:var(--bl-border-radius-m);text-decoration:none;padding:var(--padding-vertical) var(--padding-horizontal);cursor:pointer;background-color:var(--bg-color);color:var(--content-color);font:var(--font);font-kerning:none;user-select:none}:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button,:host(:hover) .button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}.label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([size="small"]) .button{--font:var(--bl-font-title-4-medium);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-2xs);--icon-size:var(--bl-size-s);--height:var(--bl-size-xl)}:host([size="large"]) .button{--font:var(--bl-font-title-3-medium);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-xl);--margin-icon:var(--bl-size-2xs);--height:var(--bl-size-3xl)}.button:focus{outline:none}.button:focus-visible{position:relative;outline:none}.button:focus-visible::after{border:2px solid var(--bl-button-focus-border-color, var(--main-color));border-radius:var(--bl-border-radius-l);content:"";position:absolute;inset:-4px}:host ::slotted(bl-icon){font-size:var(--icon-size)}:host([loading]) ::slotted(bl-icon){display:none}:host .has-icon:not(.has-content){--padding-horizontal:var(--padding-vertical);--margin-icon:0}:host([variant="secondary"]) .button{--bg-color:transparent;--content-color:var(--main-color)}:host([variant="tertiary"]) .button{--content-color:var(--main-color);--border-color:transparent;--bg-color:transparent}:host([kind="neutral"]) .button{--main-color:var(--bl-color-neutral-darker);--main-hover-color:var(--bl-color-neutral-darkest)}:host([kind="success"]) .button{--main-color:var(--bl-color-success);--main-hover-color:var(--bl-color-success-highlight)}:host([kind="danger"]) .button{--main-color:var(--bl-color-danger);--main-hover-color:var(--bl-color-danger-highlight)}:host([disabled]){cursor:not-allowed}:host([loading]){cursor:wait}:host .button[aria-disabled="true"]{--main-color:var(--bl-color-neutral-lightest);--main-hover-color:var(--bl-color-neutral-lightest);--content-color:var(--bl-color-neutral-lighter);--bg-color:var(--main-color);pointer-events:none;text-decoration:none}:host([variant="tertiary"]) .button[aria-disabled="true"]{--main-color:transparent}:host([variant="secondary"].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button[aria-disabled="false"],:host([variant="secondary"]:hover) .button[aria-disabled="false"]{--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-hover-color)}:host([variant="tertiary"].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button[aria-disabled="false"],:host([variant="tertiary"]:hover) .button[aria-disabled="false"]{--content-color:var(--main-hover-color);--bg-color:var(--text-hover-color)}:host([dropdown]) .open{display:none}:host([dropdown]) .active .open{display:inline-block}:host([dropdown]) .active .close{display:none}:host .active.button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}:host([variant="secondary"]) .active.button{--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-hover-color)}:host([variant="tertiary"]) .active.button{--content-color:var(--main-color);--bg-color:var(--bl-color-neutral-lightest);--border-color:transparent}`,x=z;var t=class extends p{constructor(){super(...arguments);this.variant="primary";this.kind="default";this.size="medium";this.loading=!1;this.disabled=!1;this.target="_self";this.dropdown=!1;this.autofocus=!1;this.active=!1}static get styles(){return[x]}get _isActive(){return this.active}connectedCallback(){super.connectedCallback()}caretTemplate(){return a` <bl-icon class="open" name="arrow_up"></bl-icon>
|
|
2
|
-
<bl-icon class="close" name="arrow_down"></bl-icon>`}_handleClick(){if(this.type==="submit"){let r;this.form instanceof HTMLFormElement?r=this.form:typeof this.form=="string"?r=document.getElementById(this.form):r=this.closest("form"),r&&_(r)}this.onClick("Click event fired!")}focus(){this.button.focus()}get _hasIconSlot(){return this.querySelector(':scope > [slot="icon"]')!==null}get _hasDefaultSlot(){return[...this.childNodes].some(i=>{var c;let s=i.nodeType;return s===i.TEXT_NODE&&((c=i.textContent)==null?void 0:c.trim())!==""||s===i.ELEMENT_NODE&&!i.hasAttribute("slot")})}render(){let r=this.loading||this.disabled,i=this.loading&&this.loadingLabel?this.loadingLabel:a`<slot></slot>`,s=!!this.href,c=this.icon?a`<bl-icon name=${this.icon}></bl-icon>`:"",T=a`<bl-spinner
|
|
3
|
-
class="loading-spinner"
|
|
4
|
-
?disabled="${r}"
|
|
5
|
-
size="${this.size}"
|
|
6
|
-
></bl-spinner>`,d=a`<slot name="icon">${this.loading?T:c}</slot>
|
|
7
|
-
<span class="label">${i}</span>`,E=this.dropdown?this.caretTemplate():"",h=f({button:!0,"has-icon":this.icon||this._hasIconSlot,"has-content":this._hasDefaultSlot,active:!s&&this._isActive});return s?a`<a
|
|
8
|
-
class=${h}
|
|
9
|
-
?autofocus=${this.autofocus}
|
|
10
|
-
aria-disabled="${n(r)}"
|
|
11
|
-
aria-label="${n(this.label)}"
|
|
12
|
-
href=${n(this.href)}
|
|
13
|
-
target=${n(this.target)}
|
|
14
|
-
role="button"
|
|
15
|
-
>${d}
|
|
16
|
-
</a>`:a`<button
|
|
17
|
-
class=${h}
|
|
18
|
-
?autofocus=${this.autofocus}
|
|
19
|
-
aria-disabled="${n(r)}"
|
|
20
|
-
aria-label="${n(this.label)}"
|
|
21
|
-
?disabled=${r}
|
|
22
|
-
@click="${this._handleClick}"
|
|
23
|
-
>
|
|
24
|
-
${d} ${E}
|
|
25
|
-
</button>`}};o([e({type:String,reflect:!0})],t.prototype,"variant",2),o([e({type:String,reflect:!0})],t.prototype,"kind",2),o([e({type:String,reflect:!0})],t.prototype,"size",2),o([e({type:String})],t.prototype,"label",2),o([e({type:String,attribute:"loading-label"})],t.prototype,"loadingLabel",2),o([e({type:Boolean,reflect:!0})],t.prototype,"loading",2),o([e({type:Boolean,reflect:!0})],t.prototype,"disabled",2),o([e({type:String})],t.prototype,"href",2),o([e({type:String})],t.prototype,"icon",2),o([e({type:String})],t.prototype,"target",2),o([e({type:String})],t.prototype,"type",2),o([e({type:Boolean})],t.prototype,"dropdown",2),o([e({type:Boolean,reflect:!0})],t.prototype,"autofocus",2),o([e({type:String})],t.prototype,"form",2),o([m({})],t.prototype,"active",2),o([g(".button")],t.prototype,"button",2),o([y("bl-click")],t.prototype,"onClick",2),t=o([v("bl-button")],t);export{_ as a,t as b};
|
|
26
|
-
//# sourceMappingURL=chunk-VU6LRFZR.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../node_modules/@open-wc/form-helpers/src/index.ts", "../src/components/button/bl-button.css", "../src/components/button/bl-button.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Implicitly submit a form by first validating all controls. If the form\n * is valid, issue a submit event and if that event is not prevented, manually\n * call the form's submit method.\n *\n * @param form {HTMLFormElement} - A form to implicitly submit\n */\nexport const submit = (form: HTMLFormElement): void => {\n if (!form.noValidate && !form.reportValidity()) {\n return;\n } else {\n const submitEvent = new SubmitEvent('submit', {\n bubbles: true,\n cancelable: true\n });\n form.dispatchEvent(submitEvent);\n if (!submitEvent.defaultPrevented) {\n form.submit();\n }\n }\n};\n\nexport type FormValue = string|FormData|File|FormValue[];\n\n/**\n * Parse a form and return a set of values based on the name/value pair.\n * If multiple controls of a similar name exist, return an array for those values;\n * otherwise return a single value.\n *\n * @param form {HTMLFormElement} - The form to parse for values\n * @returns {Record<string, any>} - An object representing the form's current values\n */\nexport const formValues = (form: HTMLFormElement): Record<string, FormValue> => {\n const formData = new FormData(form);\n const values: Record<string, FormValue> = {};\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore This does exist in all browsers. TypeScript is wrong\n for (const [key, value] of formData.entries()) {\n if (!values.hasOwnProperty(key)) {\n values[key] = value;\n } else if (Array.isArray(values[key])) {\n const pointer = values[key] as FormValue[];\n pointer.push(value);\n } else {\n values[key] = [values[key], value];\n }\n }\n\n return values;\n};\n\n/**\n * This method takes a form and parses it as an object. If any form control has a `.`\n * in its name, this utility will evaluate that name as a deep key for an object;\n * in other words, if a form has a named control, `name.first` and another, `name.last`\n * it will report back a nested object, name, with first and last properties\n * representing those controls' values.\n *\n * This can be useful when you have a complex model that you are attempting to represent\n * in declaratively in HTML.\n *\n * @param form {HTMLFormElement} - The form to grab values from\n * @returns {Object<string, FormValue>} - An object representation of the form\n */\nexport const parseFormAsObject = (form: HTMLFormElement): Record<string, FormValue> => {\n const data = formValues(form);\n const output: Record<string, FormValue> = {};\n\n Object.entries(data).forEach(([key, value]) => {\n /** If the key has a '.', parse it as an object */\n if (key.includes('.')) {\n const path = key.split('.');\n const destination: string | undefined = path.pop();\n let pointer = output;\n\n while (path.length) {\n const key = path.shift();\n pointer[key as string] = pointer[key as string] || ({} as FormValue);\n pointer = pointer[key as string] as unknown as Record<string, FormValue>;\n }\n\n pointer[destination as string] = value;\n } else {\n output[key] = data[key];\n }\n });\n\n return output;\n};\n", "import {css} from 'lit';\nexport const styles = css`:host{display:var(--bl-button-display, inline-block);max-width:100%;position:relative}.button{--main-color:var(--bl-color-primary);--main-hover-color:var(--bl-color-primary-highlight);--text-hover-color:var(--bl-color-neutral-lightest);--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-color);--border-color:var(--main-color);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-m);--margin-icon:var(--padding-vertical);--icon-size:var(--bl-size-m);--font:var(--bl-font-title-3-medium);--height:var(--bl-size-2xl);display:flex;gap:var(--margin-icon);justify-content:var(--bl-button-justify, center);align-items:center;box-sizing:border-box;width:100%;height:var(--height);border:solid 1px var(--border-color);border-radius:var(--bl-border-radius-m);text-decoration:none;padding:var(--padding-vertical) var(--padding-horizontal);cursor:pointer;background-color:var(--bg-color);color:var(--content-color);font:var(--font);font-kerning:none;user-select:none}:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button,:host(:hover) .button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}.label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}:host([size=\"small\"]) .button{--font:var(--bl-font-title-4-medium);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-2xs);--icon-size:var(--bl-size-s);--height:var(--bl-size-xl)}:host([size=\"large\"]) .button{--font:var(--bl-font-title-3-medium);--padding-vertical:var(--bl-size-xs);--padding-horizontal:var(--bl-size-xl);--margin-icon:var(--bl-size-2xs);--height:var(--bl-size-3xl)}.button:focus{outline:none}.button:focus-visible{position:relative;outline:none}.button:focus-visible::after{border:2px solid var(--bl-button-focus-border-color, var(--main-color));border-radius:var(--bl-border-radius-l);content:\"\";position:absolute;inset:-4px}:host ::slotted(bl-icon){font-size:var(--icon-size)}:host([loading]) ::slotted(bl-icon){display:none}:host .has-icon:not(.has-content){--padding-horizontal:var(--padding-vertical);--margin-icon:0}:host([variant=\"secondary\"]) .button{--bg-color:transparent;--content-color:var(--main-color)}:host([variant=\"tertiary\"]) .button{--content-color:var(--main-color);--border-color:transparent;--bg-color:transparent}:host([kind=\"neutral\"]) .button{--main-color:var(--bl-color-neutral-darker);--main-hover-color:var(--bl-color-neutral-darkest)}:host([kind=\"success\"]) .button{--main-color:var(--bl-color-success);--main-hover-color:var(--bl-color-success-highlight)}:host([kind=\"danger\"]) .button{--main-color:var(--bl-color-danger);--main-hover-color:var(--bl-color-danger-highlight)}:host([disabled]){cursor:not-allowed}:host([loading]){cursor:wait}:host .button[aria-disabled=\"true\"]{--main-color:var(--bl-color-neutral-lightest);--main-hover-color:var(--bl-color-neutral-lightest);--content-color:var(--bl-color-neutral-lighter);--bg-color:var(--main-color);pointer-events:none;text-decoration:none}:host([variant=\"tertiary\"]) .button[aria-disabled=\"true\"]{--main-color:transparent}:host([variant=\"secondary\"].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button[aria-disabled=\"false\"],:host([variant=\"secondary\"]:hover) .button[aria-disabled=\"false\"]{--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-hover-color)}:host([variant=\"tertiary\"].__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .button[aria-disabled=\"false\"],:host([variant=\"tertiary\"]:hover) .button[aria-disabled=\"false\"]{--content-color:var(--main-hover-color);--bg-color:var(--text-hover-color)}:host([dropdown]) .open{display:none}:host([dropdown]) .active .open{display:inline-block}:host([dropdown]) .active .close{display:none}:host .active.button{--bg-color:var(--main-hover-color);--border-color:var(--main-hover-color)}:host([variant=\"secondary\"]) .active.button{--content-color:var(--bl-color-neutral-full);--bg-color:var(--main-hover-color)}:host([variant=\"tertiary\"]) .active.button{--content-color:var(--main-color);--bg-color:var(--bl-color-neutral-lightest);--border-color:transparent}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { customElement, property, state, query } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ifDefined } from \"lit/directives/if-defined.js\";\nimport { submit } from \"@open-wc/form-helpers\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport \"../icon/bl-icon\";\nimport { BaklavaIcon } from \"../icon/icon-list\";\nimport \"../spinner/bl-spinner\";\nimport style from \"./bl-button.css\";\n\nexport type ButtonVariant = \"primary\" | \"secondary\" | \"tertiary\";\nexport type ButtonKind = \"default\" | \"neutral\" | \"success\" | \"danger\";\nexport type ButtonSize = \"small\" | \"medium\" | \"large\";\nexport type TargetType = \"_blank\" | \"_parent\" | \"_self\" | \"_top\";\n\n/**\n * @tag bl-button\n * @summary Baklava Button component\n *\n * @cssproperty [--bl-button-display=inline-block] Sets the display property of button\n * @cssproperty [--bl-button-justify=center] Sets the justify-content property of button\n *\n */\n@customElement(\"bl-button\")\nexport default class BlButton extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /**\n * Sets the button variant\n */\n @property({ type: String, reflect: true })\n variant: ButtonVariant = \"primary\";\n\n /**\n * Sets the button kind\n */\n @property({ type: String, reflect: true })\n kind: ButtonKind = \"default\";\n\n /**\n * Sets the button size\n */\n @property({ type: String, reflect: true })\n size: ButtonSize = \"medium\";\n\n /**\n * Sets the button label. Used for accessibility.\n */\n @property({ type: String })\n label: string;\n\n /**\n * Sets the button label for loading status.\n */\n @property({ type: String, attribute: \"loading-label\" })\n loadingLabel: string;\n\n /**\n * Sets loading state of button\n */\n @property({ type: Boolean, reflect: true })\n loading = false;\n\n /**\n * Sets button as disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Set link url. If set, button will be rendered as anchor tag.\n */\n @property({ type: String })\n href?: string;\n\n /**\n * Sets the icon name. Shows icon with bl-icon component\n */\n @property({ type: String })\n icon?: BaklavaIcon;\n\n /**\n * Sets the anchor target. Used when `href` is set.\n */\n @property({ type: String })\n target?: TargetType = \"_self\";\n\n /**\n * Sets the type of the button. Set `submit` to use button as the submitter of parent form.\n */\n @property({ type: String })\n type: \"submit\";\n\n /**\n * Sets button type to dropdown\n */\n @property({ type: Boolean })\n dropdown = false;\n\n /**\n * Sets button to get keyboard focus automatically\n */\n @property({ type: Boolean, reflect: true })\n autofocus = false;\n\n /**\n * Sets the associated form of the button. Use when `type` is set to `submit` and button is not inside the target form.\n */\n @property({ type: String })\n form: HTMLFormElement | string;\n\n /**\n * Active state\n */\n @state({})\n active = false;\n\n @query(\".button\")\n private button: HTMLAnchorElement | HTMLButtonElement;\n\n /**\n * Fires when button clicked\n */\n @event(\"bl-click\") private onClick: EventDispatcher<string>;\n\n private get _isActive() {\n return this.active;\n }\n\n connectedCallback() {\n super.connectedCallback();\n }\n\n private caretTemplate(): TemplateResult {\n return html` <bl-icon class=\"open\" name=\"arrow_up\"></bl-icon>\n <bl-icon class=\"close\" name=\"arrow_down\"></bl-icon>`;\n }\n\n private _handleClick() {\n if (this.type === \"submit\") {\n let targetForm: HTMLFormElement;\n\n if (this.form instanceof HTMLFormElement) {\n targetForm = this.form;\n } else if (typeof this.form === \"string\") {\n targetForm = document.getElementById(this.form) as HTMLFormElement;\n } else {\n targetForm = this.closest(\"form\") as HTMLFormElement;\n }\n\n if (targetForm) {\n submit(targetForm);\n }\n }\n\n this.onClick(\"Click event fired!\");\n }\n\n focus() {\n this.button.focus();\n }\n\n get _hasIconSlot() {\n return this.querySelector(':scope > [slot=\"icon\"]') !== null;\n }\n\n get _hasDefaultSlot() {\n const childNodes = [...this.childNodes];\n\n return childNodes.some(node => {\n const nodeType = node.nodeType;\n\n // has only text node.\n if (nodeType === node.TEXT_NODE && node.textContent?.trim() !== \"\") {\n return true;\n }\n // has element node, it should not have slot attribute.\n if (nodeType === node.ELEMENT_NODE) {\n if (!(node as HTMLElement).hasAttribute(\"slot\")) {\n return true;\n }\n }\n return false;\n });\n }\n\n render(): TemplateResult {\n const isDisabled = this.loading || this.disabled;\n const label = this.loading && this.loadingLabel ? this.loadingLabel : html`<slot></slot>`;\n const isAnchor = !!this.href;\n const icon = this.icon ? html`<bl-icon name=${this.icon}></bl-icon>` : \"\";\n const loadingIcon = html`<bl-spinner\n class=\"loading-spinner\"\n ?disabled=\"${isDisabled}\"\n size=\"${this.size}\"\n ></bl-spinner>`;\n const slots = html`<slot name=\"icon\">${this.loading ? loadingIcon : icon}</slot>\n <span class=\"label\">${label}</span>`;\n const caret = this.dropdown ? this.caretTemplate() : \"\";\n const classes = classMap({\n \"button\": true,\n \"has-icon\": this.icon || this._hasIconSlot,\n \"has-content\": this._hasDefaultSlot,\n \"active\": !isAnchor && this._isActive,\n });\n\n return isAnchor\n ? html`<a\n class=${classes}\n ?autofocus=${this.autofocus}\n aria-disabled=\"${ifDefined(isDisabled)}\"\n aria-label=\"${ifDefined(this.label)}\"\n href=${ifDefined(this.href)}\n target=${ifDefined(this.target)}\n role=\"button\"\n >${slots}\n </a>`\n : html`<button\n class=${classes}\n ?autofocus=${this.autofocus}\n aria-disabled=\"${ifDefined(isDisabled)}\"\n aria-label=\"${ifDefined(this.label)}\"\n ?disabled=${isDisabled}\n @click=\"${this._handleClick}\"\n >\n ${slots} ${caret}\n </button>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-button\": BlButton;\n }\n}\n"],
|
|
5
|
-
"mappings": "mRAOO,IAAMA,EAAUC,GAA+B,CACpD,GAAI,GAACA,EAAK,YAAc,CAACA,EAAK,eAAc,GAErC,CACL,IAAMC,EAAc,IAAI,YAAY,SAAU,CAC5C,QAAS,GACT,WAAY,GACb,EACDD,EAAK,cAAcC,CAAW,EACzBA,EAAY,kBACfD,EAAK,OAAM,EAGjB,ECnBO,IAAME,EAASC,u9HACfC,EAAQF,ECuBf,IAAqBG,EAArB,cAAsCC,CAAW,CAAjD,kCASE,aAA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B,EAAA,CADC,EAAS,CAAE,KAAM,MAAO,CAAC,GA9DPnB,EA+DnB,sBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,MAAO,CAAC,GApEPnB,EAqEnB,oBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,OAAQ,CAAC,GA1ERnB,EA2EnB,wBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GAhFvBnB,EAiFnB,yBAMAmB,EAAA,CADC,EAAS,CAAE,KAAM,MAAO,CAAC,GAtFPnB,EAuFnB,oBAMAmB,EAAA,CADCC,EAAM,CAAC,CAAC,GA5FUpB,EA6FnB,sBAGQmB,EAAA,CADPE,EAAM,SAAS,GA/FGrB,EAgGX,sBAKmBmB,EAAA,CAA1BG,EAAM,UAAU,GArGEtB,EAqGQ,uBArGRA,EAArBmB,EAAA,CADCI,EAAc,WAAW,GACLvB",
|
|
6
|
-
"names": ["submit", "form", "submitEvent", "styles", "i", "bl_button_default", "BlButton", "s", "bl_button_default", "x", "targetForm", "submit", "node", "_a", "nodeType", "isDisabled", "label", "isAnchor", "icon", "loadingIcon", "slots", "caret", "classes", "o", "l", "__decorateClass", "t", "i", "event", "e"]
|
|
7
|
-
}
|
package/dist/chunk-WXWKIQAK.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-GRL4DWKG.js";import{a as c,b as l,c as p,e as u}from"./chunk-5MOOXA2X.js";import{a as n,b as i,f as a}from"./chunk-4OT5AMS5.js";import{d as o}from"./chunk-IZ2LK5GK.js";var d=n`:host{position:relative}.option-container{--option-font:var(--bl-font-title-3-regular);--option-spacing:var(--bl-size-xs) 0;--option-selected-color:var(--bl-color-primary);--option-hover-color:var(--bl-color-primary-highlight);--option-color:var(--bl-color-neutral-darker);--option-disabled-color:var(--bl-color-neutral-light);--option-separator:1px solid var(--bl-color-neutral-lighter);--option-gap:var(--bl-size-2xs);--option-transition:color 120ms ease-out}.option-container::after{position:absolute;content:"";width:100%;bottom:0;border-bottom:var(--option-separator)}.no-border-bottom::after{border-bottom:none}:host(:last-of-type) .option-container::after{border-bottom:none}.single-option{width:100%;display:block;cursor:pointer;color:var(--option-color);margin:var(--option-spacing);transition:var(--option-transition);font:var(--option-font);user-select:none;position:relative;outline:none}.single-option:focus-visible::after{content:"";position:absolute;inset:calc(var(--bl-size-3xs) * -1);border:var(--bl-size-4xs) solid var(--option-hover-color);border-radius:var(--bl-size-4xs)}:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .single-option,:host(:hover) .single-option{color:var(--option-hover-color)}:host([selected]) .single-option{color:var(--option-selected-color)}:host([disabled]){cursor:not-allowed}:host([disabled]) .single-option{color:var(--option-disabled-color);cursor:not-allowed;pointer-events:none}.checkbox-option{width:100%;display:block;color:var(--option-color);padding:var(--option-spacing)}`,h=d;var e=class extends a{constructor(){super(...arguments);this.label="";this.disabled=!1;this.selected=!1;this.multiple=!1}static get styles(){return[h]}get value(){return this._value||this.textContent}set value(t){this._value=t}focus(){this.multiple||(this.focusTarget.tabIndex=0),this.focusTarget.focus(),this.onFocus(this.value)}blur(){this.onBlur(this.value),this.focusTarget.tabIndex=-1}singleOptionTemplate(){return i`<div
|
|
2
|
-
class="single-option focus-target"
|
|
3
|
-
@blur=${this.blur}
|
|
4
|
-
@keydown=${this.handleKeydown}
|
|
5
|
-
@click="${this._onClickOption}"
|
|
6
|
-
role="option"
|
|
7
|
-
aria-selected="${this.selected}"
|
|
8
|
-
>
|
|
9
|
-
<slot></slot>
|
|
10
|
-
</div>`}checkboxOptionTemplate(){return i`<bl-checkbox
|
|
11
|
-
class="checkbox-option focus-target"
|
|
12
|
-
.checked="${this.selected}"
|
|
13
|
-
.disabled="${this.disabled}"
|
|
14
|
-
@bl-checkbox-change="${this._onCheckboxChange}"
|
|
15
|
-
role="option"
|
|
16
|
-
aria-selected="${this.selected}"
|
|
17
|
-
>
|
|
18
|
-
<slot></slot>
|
|
19
|
-
</bl-checkbox>`}render(){return i`<div class="option-container">
|
|
20
|
-
${this.multiple?this.checkboxOptionTemplate():this.singleOptionTemplate()}
|
|
21
|
-
</div>`}handleKeydown(t){(t.code==="Enter"||t.code==="Space")&&(this._onClickOption(),t.preventDefault())}_handleEvent(){this._onSelect(this.value)}_onClickOption(){this.selected=!this.selected,this._handleEvent()}_onCheckboxChange(t){this.selected=t.detail,this._handleEvent()}connectedCallback(){super.connectedCallback(),this.updateComplete.then(()=>{var t,s;this.blSelect=this.closest("bl-select"),this.multiple=((t=this.blSelect)==null?void 0:t.multiple)||!1,(s=this.blSelect)==null||s.registerOption(this)})}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.blSelect)==null||t.unregisterOption(this)}};o([l({})],e.prototype,"value",1),o([l({type:String,reflect:!0,attribute:"label"})],e.prototype,"label",2),o([l({type:Boolean,reflect:!0})],e.prototype,"disabled",2),o([l({type:Boolean,reflect:!0})],e.prototype,"selected",2),o([p()],e.prototype,"multiple",2),o([r("bl-select-option")],e.prototype,"_onSelect",2),o([r("bl-focus")],e.prototype,"onFocus",2),o([r("bl-blur")],e.prototype,"onBlur",2),o([u(".focus-target")],e.prototype,"focusTarget",2),e=o([c("bl-select-option")],e);export{e as a};
|
|
22
|
-
//# sourceMappingURL=chunk-WXWKIQAK.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../src/components/select/option/bl-select-option.css", "../src/components/select/option/bl-select-option.ts"],
|
|
4
|
-
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{position:relative}.option-container{--option-font:var(--bl-font-title-3-regular);--option-spacing:var(--bl-size-xs) 0;--option-selected-color:var(--bl-color-primary);--option-hover-color:var(--bl-color-primary-highlight);--option-color:var(--bl-color-neutral-darker);--option-disabled-color:var(--bl-color-neutral-light);--option-separator:1px solid var(--bl-color-neutral-lighter);--option-gap:var(--bl-size-2xs);--option-transition:color 120ms ease-out}.option-container::after{position:absolute;content:\"\";width:100%;bottom:0;border-bottom:var(--option-separator)}.no-border-bottom::after{border-bottom:none}:host(:last-of-type) .option-container::after{border-bottom:none}.single-option{width:100%;display:block;cursor:pointer;color:var(--option-color);margin:var(--option-spacing);transition:var(--option-transition);font:var(--option-font);user-select:none;position:relative;outline:none}.single-option:focus-visible::after{content:\"\";position:absolute;inset:calc(var(--bl-size-3xs) * -1);border:var(--bl-size-4xs) solid var(--option-hover-color);border-radius:var(--bl-size-4xs)}:host(.__ONLY_FOR_STORYBOOK_DEMONSTRATION_HOVER__) .single-option,:host(:hover) .single-option{color:var(--option-hover-color)}:host([selected]) .single-option{color:var(--option-selected-color)}:host([disabled]){cursor:not-allowed}:host([disabled]) .single-option{color:var(--option-disabled-color);cursor:not-allowed;pointer-events:none}.checkbox-option{width:100%;display:block;color:var(--option-color);padding:var(--option-spacing)}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { FormValue } from \"@open-wc/form-helpers\";\nimport { event, EventDispatcher } from \"../../../utilities/event\";\nimport BlSelect from \"../bl-select\";\nimport style from \"./bl-select-option.css\";\n\n@customElement(\"bl-select-option\")\nexport default class BlSelectOption<ValueType extends FormValue = string> extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n private _value: ValueType;\n\n /* Declare reactive properties */\n /**\n * Sets the value for the option\n */\n @property({})\n get value(): ValueType {\n return this._value || (this.textContent as ValueType);\n }\n\n set value(val: ValueType) {\n this._value = val;\n }\n\n /**\n * Sets the label for bl-select, and bl-select renders this value instead of the option's textContent\n */\n @property({ type: String, reflect: true, attribute: \"label\" })\n label = \"\";\n\n /**\n * Sets option as disabled\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Sets option as selected state\n */\n @property({ type: Boolean, reflect: true })\n selected = false;\n\n @state()\n multiple = false;\n\n /**\n * Fires when clicked on the option\n */\n @event(\"bl-select-option\") private _onSelect: EventDispatcher<ValueType | string | null>;\n\n /**\n * Fires when checkbox is focused\n */\n @event(\"bl-focus\") private onFocus: EventDispatcher<ValueType | string | null>;\n\n /**\n * Fires when checkbox is blurred\n */\n @event(\"bl-blur\") private onBlur: EventDispatcher<ValueType | string | null>;\n\n @query(\".focus-target\") private focusTarget: HTMLElement;\n\n /**\n * Focuses this option\n */\n focus() {\n if (!this.multiple) {\n this.focusTarget.tabIndex = 0;\n }\n this.focusTarget.focus();\n this.onFocus(this.value);\n }\n\n /**\n * Blurs from this option\n */\n blur() {\n this.onBlur(this.value);\n this.focusTarget.tabIndex = -1;\n }\n\n private blSelect: BlSelect<ValueType> | null;\n\n private singleOptionTemplate() {\n return html`<div\n class=\"single-option focus-target\"\n @blur=${this.blur}\n @keydown=${this.handleKeydown}\n @click=\"${this._onClickOption}\"\n role=\"option\"\n aria-selected=\"${this.selected}\"\n >\n <slot></slot>\n </div>`;\n }\n\n private checkboxOptionTemplate() {\n return html`<bl-checkbox\n class=\"checkbox-option focus-target\"\n .checked=\"${this.selected}\"\n .disabled=\"${this.disabled}\"\n @bl-checkbox-change=\"${this._onCheckboxChange}\"\n role=\"option\"\n aria-selected=\"${this.selected}\"\n >\n <slot></slot>\n </bl-checkbox>`;\n }\n\n render() {\n return html`<div class=\"option-container\">\n ${this.multiple ? this.checkboxOptionTemplate() : this.singleOptionTemplate()}\n </div>`;\n }\n\n private handleKeydown(event: KeyboardEvent) {\n if (event.code === \"Enter\" || event.code === \"Space\") {\n this._onClickOption();\n event.preventDefault();\n }\n }\n\n private _handleEvent() {\n this._onSelect(this.value);\n }\n\n private _onClickOption() {\n this.selected = !this.selected;\n this._handleEvent();\n }\n\n private _onCheckboxChange(event: CustomEvent) {\n this.selected = event.detail;\n this._handleEvent();\n }\n\n connectedCallback() {\n super.connectedCallback();\n\n this.updateComplete.then(() => {\n this.blSelect = this.closest<BlSelect<ValueType>>(\"bl-select\");\n // FIXME: We should warn when parent is not bl-select\n\n this.multiple = this.blSelect?.multiple || false;\n this.blSelect?.registerOption(this);\n });\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.blSelect?.unregisterOption(this);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-select-option\": BlSelectOption;\n }\n}\n"],
|
|
5
|
-
"mappings": "mMACO,IAAMA,EAASC,6/CACfC,EAAQF,ECMf,IAAqBG,EAArB,cAAkFC,CAAW,CAA7F,kCAwBE,WAAQ,GAMR,cAAW,GAMX,cAAW,GAGX,cAAW,GAtCX,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CASA,IAAI,OAAmB,CACrB,OAAO,KAAK,QAAW,KAAK,WAC9B,CAEA,IAAI,MAAMC,EAAgB,CACxB,KAAK,OAASA,CAChB,CA2CA,OAAQ,CACD,KAAK,WACR,KAAK,YAAY,SAAW,GAE9B,KAAK,YAAY,MAAM,EACvB,KAAK,QAAQ,KAAK,KAAK,CACzB,CAKA,MAAO,CACL,KAAK,OAAO,KAAK,KAAK,EACtB,KAAK,YAAY,SAAW,EAC9B,CAIQ,sBAAuB,CAC7B,OAAOC;AAAA;AAAA,cAEG,KAAK;AAAA,iBACF,KAAK;AAAA,gBACN,KAAK;AAAA;AAAA,uBAEE,KAAK;AAAA;AAAA;AAAA,WAI1B,CAEQ,wBAAyB,CAC/B,OAAOA;AAAA;AAAA,kBAEO,KAAK;AAAA,mBACJ,KAAK;AAAA,6BACK,KAAK;AAAA;AAAA,uBAEX,KAAK;AAAA;AAAA;AAAA,mBAI1B,CAEA,QAAS,CACP,OAAOA;AAAA,QACH,KAAK,SAAW,KAAK,uBAAuB,EAAI,KAAK,qBAAqB;AAAA,WAEhF,CAEQ,cAAcC,EAAsB,EACtCA,EAAM,OAAS,SAAWA,EAAM,OAAS,WAC3C,KAAK,eAAe,EACpBA,EAAM,eAAe,EAEzB,CAEQ,cAAe,CACrB,KAAK,UAAU,KAAK,KAAK,CAC3B,CAEQ,gBAAiB,CACvB,KAAK,SAAW,CAAC,KAAK,SACtB,K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