@trendyol/baklava 3.0.0-beta.18 → 3.0.0-beta.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/baklava.js +1 -1
- package/dist/{chunk-MPS76EJL.js → chunk-VGXYENGL.js} +2 -2
- package/dist/{chunk-MPS76EJL.js.map → chunk-VGXYENGL.js.map} +2 -2
- package/dist/components/popover/bl-popover.js +1 -1
- package/dist/components/tab-group/bl-tab-group.js +1 -1
- package/dist/components/tooltip/bl-tooltip.js +1 -1
- package/package.json +1 -1
package/dist/baklava.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as j}from"./chunk-P4FHU5BE.js";import{b as q}from"./chunk-LPHOBDYM.js";import{b as O}from"./chunk-Y3PONRYW.js";import{b as v}from"./chunk-LIW32ZGE.js";import{b as y}from"./chunk-73GEFGEG.js";import{b as H}from"./chunk-WQTBAXMP.js";import{b as R}from"./chunk-FQBDGFMR.js";import{a as P}from"./chunk-5TPDRTCU.js";import{a as
|
|
1
|
+
import{b as j}from"./chunk-P4FHU5BE.js";import{b as q}from"./chunk-LPHOBDYM.js";import{b as O}from"./chunk-Y3PONRYW.js";import{b as v}from"./chunk-LIW32ZGE.js";import{b as y}from"./chunk-73GEFGEG.js";import{b as H}from"./chunk-WQTBAXMP.js";import{b as R}from"./chunk-FQBDGFMR.js";import{a as P}from"./chunk-5TPDRTCU.js";import{a as w}from"./chunk-Q6MAW2EF.js";import{a as I}from"./chunk-QF4LGACD.js";import{d as N}from"./chunk-ASB5S6J4.js";import{a as g}from"./chunk-IZTTP5LH.js";import{a as C}from"./chunk-HAE5XKSY.js";import{a as r}from"./chunk-7QNX2GPS.js";import{b as k}from"./chunk-4T26H7PC.js";import{a as n}from"./chunk-X67Z2G2H.js";import{a as s}from"./chunk-LXYK2N4C.js";import"./chunk-MND5TXTF.js";import{a as h}from"./chunk-VGXYENGL.js";import{a as c}from"./chunk-2GQCCDR3.js";import{c as b,f as T}from"./chunk-FVBGMXMC.js";import{a as i}from"./chunk-XDJ3G3LW.js";import{a as m}from"./chunk-WXWKIQAK.js";import"./chunk-EZSEQHRH.js";import{b as d,e as u}from"./chunk-IWBCUOHE.js";import"./chunk-EG7U7PM3.js";import"./chunk-AYJMIZZ3.js";import"./chunk-XDUIVR6I.js";import"./chunk-HZ6A5QFC.js";import{a as x}from"./chunk-4DWODYIT.js";import{a as B}from"./chunk-PACDVPAB.js";import{b as D,d as S,f as A}from"./chunk-WH6MQCKK.js";import{b as G}from"./chunk-73RGV4UX.js";import{b as p}from"./chunk-N6FMS7MM.js";import"./chunk-6LT7O7T2.js";import"./chunk-HBPBDC7T.js";import{a as o}from"./chunk-NGJM4NWA.js";import{a as l}from"./chunk-RQEU3SZQ.js";import"./chunk-ECPWEUBG.js";import"./chunk-DINNT5P2.js";import{a as f}from"./chunk-4BZSILLM.js";import{a as e,b as a,c as t}from"./chunk-U752J5IG.js";import"./chunk-GRL4DWKG.js";import"./chunk-3USCFSFQ.js";import"./chunk-7GK5LKBV.js";import"./chunk-5MOOXA2X.js";import"./chunk-4OT5AMS5.js";import"./chunk-IZ2LK5GK.js";export{r as BlAccordion,o as BlAccordionGroup,l as BlAlert,f as BlBadge,p as BlButton,d as BlCheckbox,u as BlCheckboxGroup,x as BlDialog,B as BlDrawer,A as BlDropdown,G as BlDropdownGroup,S as BlDropdownItem,t as BlIcon,s as BlInput,k as BlNotification,H as BlNotificationCard,n as BlPagination,h as BlPopover,c as BlProgressIndicator,b as BlRadio,T as BlRadioGroup,i as BlSelect,m as BlSelectOption,D as BlSplitButton,R as BlSwitch,w as BlTab,P as BlTabGroup,I as BlTabPanel,N as BlTable,y as BlTableBody,q as BlTableCell,v as BlTableHeader,j as BlTableHeaderCell,O as BlTableRow,g as BlTextarea,C as BlTooltip,a as getIconPath,e as setIconPath};
|
|
2
2
|
//# sourceMappingURL=baklava.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as w,b as g,c as f,d as E,e as y,f as _,g as x,h as k}from"./chunk-EZSEQHRH.js";import{a as u}from"./chunk-6LT7O7T2.js";import{a as n}from"./chunk-GRL4DWKG.js";import{a as b,b as i,c as a,e as s}from"./chunk-5MOOXA2X.js";import{a as h,b as c,f as m}from"./chunk-4OT5AMS5.js";import{d as r}from"./chunk-IZ2LK5GK.js";var M=h`:host{display:contents}.popover{--arrow-display:var(--bl-popover-arrow-display, none);--background-color:var(--bl-popover-background-color, var(--bl-color-neutral-full));--border-color:var(--bl-popover-border-color, var(--bl-color-primary-highlight));--border-size:var(--bl-popover-border-size, 1px);--padding:var(--bl-popover-padding, var(--bl-size-m));--border-radius:var(--bl-popover-border-radius, var(--bl-size-3xs));--position:var(--bl-popover-position, fixed);--max-width:var(--bl-popover-max-width, 100vw);--max-viewport:calc(100vw - var(--bl-size-s));position:var(--position);box-sizing:border-box;border:var(--border-size) solid var(--border-color);padding:var(--padding);border-radius:var(--border-radius);z-index:var(--bl-index-popover);max-width:min(var(--max-viewport), var(--max-width));width:max-content;hyphens:auto;background-color:var(--background-color);font:var(--bl-font-title-3-regular);color:var(--bl-color-neutral-darker)}.popover:not(.visible){visibility:hidden}.arrow{--arrow-rotation:45deg;--size:var(--bl-size-2xs);--arrow-position:calc((var(--size) / -2) - var(--border-size));box-sizing:border-box;display:var(--arrow-display);position:absolute;background-color:var(--background-color);width:var(--size);height:var(--size);transform:rotate(var(--arrow-rotation));border:var(--border-size) solid var(--border-color);border-bottom:none;border-right:none}.popover[data-placement*="bottom"] .arrow{top:var(--arrow-position)}.popover[data-placement*="top"] .arrow{--arrow-rotation:225deg;bottom:var(--arrow-position)}.popover[data-placement*="left"] .arrow{--arrow-rotation:135deg;right:var(--arrow-position)}.popover[data-placement*="right"] .arrow{--arrow-rotation:315deg;left:var(--arrow-position)}`,z=M;var t=class extends m{constructor(){super(...arguments);this.placement="bottom";this.fitSize=!1;this.offset=8;this._visible=!1;this._handleClickOutside=e=>{let o=e.composedPath();!o.includes(this._target)&&!o.includes(this)&&this.hide()}}static get styles(){return[z]}connectedCallback(){super.connectedCallback(),this._handlePopoverShowEvent=this._handlePopoverShowEvent.bind(this),this._handleKeydownEvent=this._handleKeydownEvent.bind(this),this._handleClickOutside=this._handleClickOutside.bind(this)}disconnectedCallback(){super.disconnectedCallback(),this.popoverAutoUpdateCleanup&&this.popoverAutoUpdateCleanup()}getMiddleware(){let e=[];return e.push(E(this.offset),f(),g(),y({padding:4})),this.fitSize&&e.push(_({apply(o){o.elements.floating&&o.elements.reference&&Object.assign(o.elements.floating.style,{"min-width":`${o.elements.reference.getBoundingClientRect().width}px`})}})),e.push(w({element:this.arrow,padding:5})),e}setPopover(){this.target&&(this.popoverAutoUpdateCleanup=x(this.target,this._popover,()=>{k(this.target,this._popover,{placement:this.placement,strategy:"fixed",middleware:this.getMiddleware()}).then(({x:e,y:o,placement:l,middlewareData:p})=>{if(Object.assign(this._popover.style,{left:`${e}px`,top:`${o}px`}),this._popover.dataset.placement=l,p.arrow){let{x:d,y:v}=p.arrow;Object.assign(this.arrow.style,{left:d!=null?`${d}px`:"",top:v!=null?`${v}px`:""})}})}))}get target(){return this._target}set target(e){typeof e=="string"?this._target=document.getElementById(e):e instanceof Element?this._target=e:console.warn("BlPopover target only accepts an Element instance or a string id of a DOM element.")}show(){this._visible=!0,this.setPopover(),this.onBlPopoverShow(""),document.addEventListener("click",this._handleClickOutside),document.addEventListener("keydown",this._handleKeydownEvent),document.addEventListener("bl-popover-show",this._handlePopoverShowEvent)}hide(){this._visible=!1,document.removeEventListener("click",this._handleClickOutside),document.removeEventListener("keydown",this._handleKeydownEvent),document.removeEventListener("bl-popover-show",this._handlePopoverShowEvent),this.onBlPopoverHide("")}get visible(){return this._visible}_handlePopoverShowEvent(e){if(e.target!==this){let{parentElement:o}=e.target
|
|
1
|
+
import{a as w,b as g,c as f,d as E,e as y,f as _,g as x,h as k}from"./chunk-EZSEQHRH.js";import{a as u}from"./chunk-6LT7O7T2.js";import{a as n}from"./chunk-GRL4DWKG.js";import{a as b,b as i,c as a,e as s}from"./chunk-5MOOXA2X.js";import{a as h,b as c,f as m}from"./chunk-4OT5AMS5.js";import{d as r}from"./chunk-IZ2LK5GK.js";var M=h`:host{display:contents}.popover{--arrow-display:var(--bl-popover-arrow-display, none);--background-color:var(--bl-popover-background-color, var(--bl-color-neutral-full));--border-color:var(--bl-popover-border-color, var(--bl-color-primary-highlight));--border-size:var(--bl-popover-border-size, 1px);--padding:var(--bl-popover-padding, var(--bl-size-m));--border-radius:var(--bl-popover-border-radius, var(--bl-size-3xs));--position:var(--bl-popover-position, fixed);--max-width:var(--bl-popover-max-width, 100vw);--max-viewport:calc(100vw - var(--bl-size-s));position:var(--position);box-sizing:border-box;border:var(--border-size) solid var(--border-color);padding:var(--padding);border-radius:var(--border-radius);z-index:var(--bl-index-popover);max-width:min(var(--max-viewport), var(--max-width));width:max-content;hyphens:auto;background-color:var(--background-color);font:var(--bl-font-title-3-regular);color:var(--bl-color-neutral-darker)}.popover:not(.visible){visibility:hidden}.arrow{--arrow-rotation:45deg;--size:var(--bl-size-2xs);--arrow-position:calc((var(--size) / -2) - var(--border-size));box-sizing:border-box;display:var(--arrow-display);position:absolute;background-color:var(--background-color);width:var(--size);height:var(--size);transform:rotate(var(--arrow-rotation));border:var(--border-size) solid var(--border-color);border-bottom:none;border-right:none}.popover[data-placement*="bottom"] .arrow{top:var(--arrow-position)}.popover[data-placement*="top"] .arrow{--arrow-rotation:225deg;bottom:var(--arrow-position)}.popover[data-placement*="left"] .arrow{--arrow-rotation:135deg;right:var(--arrow-position)}.popover[data-placement*="right"] .arrow{--arrow-rotation:315deg;left:var(--arrow-position)}`,z=M;var t=class extends m{constructor(){super(...arguments);this.placement="bottom";this.fitSize=!1;this.offset=8;this._visible=!1;this._handleClickOutside=e=>{let o=e.composedPath();!o.includes(this._target)&&!o.includes(this)&&this.hide()}}static get styles(){return[z]}connectedCallback(){super.connectedCallback(),this._handlePopoverShowEvent=this._handlePopoverShowEvent.bind(this),this._handleKeydownEvent=this._handleKeydownEvent.bind(this),this._handleClickOutside=this._handleClickOutside.bind(this)}disconnectedCallback(){super.disconnectedCallback(),this.popoverAutoUpdateCleanup&&this.popoverAutoUpdateCleanup()}getMiddleware(){let e=[];return e.push(E(this.offset),f(),g(),y({padding:4})),this.fitSize&&e.push(_({apply(o){o.elements.floating&&o.elements.reference&&Object.assign(o.elements.floating.style,{"min-width":`${o.elements.reference.getBoundingClientRect().width}px`})}})),e.push(w({element:this.arrow,padding:5})),e}setPopover(){this.target&&(this.popoverAutoUpdateCleanup=x(this.target,this._popover,()=>{k(this.target,this._popover,{placement:this.placement,strategy:"fixed",middleware:this.getMiddleware()}).then(({x:e,y:o,placement:l,middlewareData:p})=>{if(Object.assign(this._popover.style,{left:`${e}px`,top:`${o}px`}),this._popover.dataset.placement=l,p.arrow){let{x:d,y:v}=p.arrow;Object.assign(this.arrow.style,{left:d!=null?`${d}px`:"",top:v!=null?`${v}px`:""})}})}))}get target(){return this._target}set target(e){typeof e=="string"?this._target=document.getElementById(e):e instanceof Element?this._target=e:console.warn("BlPopover target only accepts an Element instance or a string id of a DOM element.")}show(){this._visible=!0,this.setPopover(),this.onBlPopoverShow(""),document.addEventListener("click",this._handleClickOutside),document.addEventListener("keydown",this._handleKeydownEvent),document.addEventListener("bl-popover-show",this._handlePopoverShowEvent)}hide(){this._visible=!1,document.removeEventListener("click",this._handleClickOutside),document.removeEventListener("keydown",this._handleKeydownEvent),document.removeEventListener("bl-popover-show",this._handlePopoverShowEvent),this.onBlPopoverHide("")}get visible(){return this._visible}_handlePopoverShowEvent(e){if(e.target!==this){let{parentElement:o}=e.target;!this.contains(o)&&e.target.tagName===this.tagName&&this.hide()}}_handleKeydownEvent(e){e.key==="Escape"&&this.visible&&(e.preventDefault(),this.hide())}render(){let e=u({popover:!0,visible:this._visible});return c`<div class=${e}>
|
|
2
2
|
<slot id="popover" aria-live=${this._visible?"polite":"off"}></slot>
|
|
3
3
|
<div class="arrow" aria-hidden="true"></div>
|
|
4
4
|
</div>`}};r([s(".popover")],t.prototype,"_popover",2),r([s(".arrow")],t.prototype,"arrow",2),r([i({type:String})],t.prototype,"placement",2),r([a()],t.prototype,"_target",2),r([i({type:Boolean,attribute:"fit-size"})],t.prototype,"fitSize",2),r([i({type:Number})],t.prototype,"offset",2),r([a()],t.prototype,"_visible",2),r([n("bl-popover-show")],t.prototype,"onBlPopoverShow",2),r([n("bl-popover-hide")],t.prototype,"onBlPopoverHide",2),r([i()],t.prototype,"target",1),t=r([b("bl-popover")],t);export{t as a};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-VGXYENGL.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/components/popover/bl-popover.css", "../src/components/popover/bl-popover.ts"],
|
|
4
|
-
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:contents}.popover{--arrow-display:var(--bl-popover-arrow-display, none);--background-color:var(--bl-popover-background-color, var(--bl-color-neutral-full));--border-color:var(--bl-popover-border-color, var(--bl-color-primary-highlight));--border-size:var(--bl-popover-border-size, 1px);--padding:var(--bl-popover-padding, var(--bl-size-m));--border-radius:var(--bl-popover-border-radius, var(--bl-size-3xs));--position:var(--bl-popover-position, fixed);--max-width:var(--bl-popover-max-width, 100vw);--max-viewport:calc(100vw - var(--bl-size-s));position:var(--position);box-sizing:border-box;border:var(--border-size) solid var(--border-color);padding:var(--padding);border-radius:var(--border-radius);z-index:var(--bl-index-popover);max-width:min(var(--max-viewport), var(--max-width));width:max-content;hyphens:auto;background-color:var(--background-color);font:var(--bl-font-title-3-regular);color:var(--bl-color-neutral-darker)}.popover:not(.visible){visibility:hidden}.arrow{--arrow-rotation:45deg;--size:var(--bl-size-2xs);--arrow-position:calc((var(--size) / -2) - var(--border-size));box-sizing:border-box;display:var(--arrow-display);position:absolute;background-color:var(--background-color);width:var(--size);height:var(--size);transform:rotate(var(--arrow-rotation));border:var(--border-size) solid var(--border-color);border-bottom:none;border-right:none}.popover[data-placement*=\"bottom\"] .arrow{top:var(--arrow-position)}.popover[data-placement*=\"top\"] .arrow{--arrow-rotation:225deg;bottom:var(--arrow-position)}.popover[data-placement*=\"left\"] .arrow{--arrow-rotation:135deg;right:var(--arrow-position)}.popover[data-placement*=\"right\"] .arrow{--arrow-rotation:315deg;left:var(--arrow-position)}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport {\n computePosition,\n flip,\n shift,\n offset,\n arrow,\n inline,\n autoUpdate,\n size,\n Middleware,\n MiddlewareState,\n} from \"@floating-ui/dom\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport style from \"./bl-popover.css\";\n\nexport type Placement =\n | \"top-start\"\n | \"top\"\n | \"top-end\"\n | \"bottom-start\"\n | \"bottom\"\n | \"bottom-end\"\n | \"left-start\"\n | \"left\"\n | \"left-end\"\n | \"right-start\"\n | \"right\"\n | \"right-end\";\n\n/**\n * @tag bl-popover\n * @summary Baklava Popover component\n *\n * @cssproperty [--bl-popover-arrow-display=none] - Sets the display of popovers arrow. Set as `block` to make arrow visible.\n * @cssproperty [--bl-popover-background-color=--bl-color-neutral-full] - Sets the background color of popover.\n * @cssproperty [--bl-popover-border-color=--bl-color-primary-highlight] - Sets the border color of popover.\n * @cssproperty [--bl-popover-border-size=1px] - Sets the border size of popover. You can set it to `0px` to not have a border (if you use a custom background color). Always use with a length unit.\n * @cssproperty [--bl-popover-padding=--bl-size-m] - Sets the padding of popover.\n * @cssproperty [--bl-popover-border-radius=--bl-size-3xs] - Sets the border radius of popover.\n * @cssproperty [--bl-popover-max-width=100vw] - Sets the maximum width of the popover (including border and padding).\n * @cssproperty [--bl-popover-position=fixed] - Sets the position of popover. You can set it to `absolute` if parent element is a fixed positioned element like drawer or dialog.\n */\n@customElement(\"bl-popover\")\nexport default class BlPopover extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n @query(\".popover\") private _popover: HTMLElement;\n @query(\".arrow\") private arrow: HTMLElement;\n\n /**\n * Sets placement of the popover\n */\n @property({ type: String })\n placement: Placement = \"bottom\";\n\n /**\n * Target elements state\n */\n @state() _target: string | Element;\n\n /**\n * Sets size of popover same as trigger element\n */\n @property({ type: Boolean, attribute: \"fit-size\" })\n fitSize = false;\n\n /**\n * Sets the distance between popover and target/trigger element\n */\n @property({ type: Number })\n offset = 8;\n\n /**\n * Visibility state\n */\n @state() private _visible = false;\n\n /**\n * Fires when the popover is shown\n */\n @event(\"bl-popover-show\") private onBlPopoverShow: EventDispatcher<string>;\n\n /**\n * Fires when popover becomes hidden\n */\n @event(\"bl-popover-hide\") private onBlPopoverHide: EventDispatcher<string>;\n\n connectedCallback() {\n super.connectedCallback();\n\n this._handlePopoverShowEvent = this._handlePopoverShowEvent.bind(this);\n this._handleKeydownEvent = this._handleKeydownEvent.bind(this);\n this._handleClickOutside = this._handleClickOutside.bind(this);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.popoverAutoUpdateCleanup && this.popoverAutoUpdateCleanup();\n }\n\n private getMiddleware(): Middleware[] {\n const middlewareParams: Middleware[] = [];\n\n middlewareParams.push(offset(this.offset), inline(), flip(), shift({ padding: 4 }));\n\n if (this.fitSize) {\n middlewareParams.push(\n size({\n apply(args: MiddlewareState) {\n if (args.elements.floating && args.elements.reference) {\n Object.assign(args.elements.floating.style, {\n \"min-width\": `${args.elements.reference.getBoundingClientRect().width}px`,\n });\n }\n },\n })\n );\n }\n\n middlewareParams.push(arrow({ element: this.arrow, padding: 5 }));\n\n return middlewareParams;\n }\n\n private _handleClickOutside = (event: MouseEvent) => {\n const eventPath = event.composedPath() as HTMLElement[];\n\n if (!eventPath.includes(this._target as HTMLElement) && !eventPath.includes(this)) {\n this.hide();\n }\n };\n\n private popoverAutoUpdateCleanup: () => void;\n\n private setPopover() {\n if (this.target) {\n this.popoverAutoUpdateCleanup = autoUpdate(this.target as Element, this._popover, () => {\n computePosition(this.target as Element, this._popover, {\n placement: this.placement,\n strategy: \"fixed\",\n middleware: this.getMiddleware(),\n }).then(({ x, y, placement, middlewareData }) => {\n Object.assign(this._popover.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n\n this._popover.dataset.placement = placement;\n\n if (middlewareData.arrow) {\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(this.arrow.style, {\n left: arrowX != null ? `${arrowX}px` : \"\",\n top: arrowY != null ? `${arrowY}px` : \"\",\n });\n }\n });\n });\n }\n }\n\n /**\n * Sets the target element of the popover to align and trigger.\n * It can be a string id of the target element or can be a direct Element reference of it.\n */\n @property()\n get target(): string | Element {\n return this._target;\n }\n\n set target(value: string | Element) {\n if (typeof value === \"string\") {\n this._target = document.getElementById(value) as Element;\n } else if (value instanceof Element) {\n this._target = value;\n } else {\n console.warn(\n \"BlPopover target only accepts an Element instance or a string id of a DOM element.\"\n );\n }\n }\n\n /**\n * Shows popover\n */\n show() {\n this._visible = true;\n this.setPopover();\n this.onBlPopoverShow(\"\");\n document.addEventListener(\"click\", this._handleClickOutside);\n document.addEventListener(\"keydown\", this._handleKeydownEvent);\n document.addEventListener(\"bl-popover-show\", this._handlePopoverShowEvent);\n }\n\n /**\n * Hides popover\n */\n hide() {\n this._visible = false;\n document.removeEventListener(\"click\", this._handleClickOutside);\n document.removeEventListener(\"keydown\", this._handleKeydownEvent);\n document.removeEventListener(\"bl-popover-show\", this._handlePopoverShowEvent);\n this.onBlPopoverHide(\"\");\n }\n\n /**\n * Gives the visibility status of the popover\n */\n get visible(): boolean {\n return this._visible;\n }\n\n private _handlePopoverShowEvent(event: Event) {\n if (event.target !== this) {\n const { parentElement } = event.target as HTMLElement;\n const isNestedPopover = this.contains(parentElement);\n\n if (!isNestedPopover) {\n this.hide();\n }\n }\n }\n\n private _handleKeydownEvent(event: KeyboardEvent) {\n if (event.key === \"Escape\" && this.visible) {\n event.preventDefault();\n this.hide();\n }\n }\n\n render(): TemplateResult {\n const classes = classMap({\n popover: true,\n visible: this._visible,\n });\n\n return html`<div class=${classes}>\n <slot id=\"popover\" aria-live=${this._visible ? \"polite\" : \"off\"}></slot>\n <div class=\"arrow\" aria-hidden=\"true\"></div>\n </div>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n \"bl-popover\": BlPopover;\n }\n}\n"],
|
|
5
|
-
"mappings": "oUACO,IAAMA,EAASC,msDACfC,EAAQF,EC4Cf,IAAqBG,EAArB,cAAuCC,CAAW,CAAlD,kCAYE,eAAuB,SAWvB,aAAU,GAMV,YAAS,EAKA,KAAQ,SAAW,GAkD5B,KAAQ,oBAAuBC,GAAsB,CACnD,IAAMC,EAAYD,EAAM,aAAa,EAEjC,CAACC,EAAU,SAAS,KAAK,OAAsB,GAAK,CAACA,EAAU,SAAS,IAAI,GAC9E,KAAK,KAAK,CAEd,EAzFA,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CA2CA,mBAAoB,CAClB,MAAM,kBAAkB,EAExB,KAAK,wBAA0B,KAAK,wBAAwB,KAAK,IAAI,EACrE,KAAK,oBAAsB,KAAK,oBAAoB,KAAK,IAAI,EAC7D,KAAK,oBAAsB,KAAK,oBAAoB,KAAK,IAAI,CAC/D,CAEA,sBAAuB,CACrB,MAAM,qBAAqB,EAE3B,KAAK,0BAA4B,KAAK,yBAAyB,CACjE,CAEQ,eAA8B,CACpC,IAAMC,EAAiC,CAAC,EAExC,OAAAA,EAAiB,KAAKC,EAAO,KAAK,MAAM,EAAGC,EAAO,EAAGC,EAAK,EAAGC,EAAM,CAAE,QAAS,CAAE,CAAC,CAAC,EAE9E,KAAK,SACPJ,EAAiB,KACfK,EAAK,CACH,MAAMC,EAAuB,CACvBA,EAAK,SAAS,UAAYA,EAAK,SAAS,WAC1C,OAAO,OAAOA,EAAK,SAAS,SAAS,MAAO,CAC1C,YAA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SAAS,oBAAoB,QAAS,KAAK,mBAAmB,EAC9D,SAAS,oBAAoB,UAAW,KAAK,mBAAmB,EAChE,SAAS,oBAAoB,kBAAmB,KAAK,uBAAuB,EAC5E,KAAK,gBAAgB,EAAE,CACzB,CAKA,IAAI,SAAmB,CACrB,OAAO,KAAK,QACd,CAEQ,wBAAwBnB,EAAc,CAC5C,GAAIA,EAAM,SAAW,KAAM,CACzB,GAAM,CAAE,cAAAoB,CAAc,EAAIpB,EAAM,
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{display:contents}.popover{--arrow-display:var(--bl-popover-arrow-display, none);--background-color:var(--bl-popover-background-color, var(--bl-color-neutral-full));--border-color:var(--bl-popover-border-color, var(--bl-color-primary-highlight));--border-size:var(--bl-popover-border-size, 1px);--padding:var(--bl-popover-padding, var(--bl-size-m));--border-radius:var(--bl-popover-border-radius, var(--bl-size-3xs));--position:var(--bl-popover-position, fixed);--max-width:var(--bl-popover-max-width, 100vw);--max-viewport:calc(100vw - var(--bl-size-s));position:var(--position);box-sizing:border-box;border:var(--border-size) solid var(--border-color);padding:var(--padding);border-radius:var(--border-radius);z-index:var(--bl-index-popover);max-width:min(var(--max-viewport), var(--max-width));width:max-content;hyphens:auto;background-color:var(--background-color);font:var(--bl-font-title-3-regular);color:var(--bl-color-neutral-darker)}.popover:not(.visible){visibility:hidden}.arrow{--arrow-rotation:45deg;--size:var(--bl-size-2xs);--arrow-position:calc((var(--size) / -2) - var(--border-size));box-sizing:border-box;display:var(--arrow-display);position:absolute;background-color:var(--background-color);width:var(--size);height:var(--size);transform:rotate(var(--arrow-rotation));border:var(--border-size) solid var(--border-color);border-bottom:none;border-right:none}.popover[data-placement*=\"bottom\"] .arrow{top:var(--arrow-position)}.popover[data-placement*=\"top\"] .arrow{--arrow-rotation:225deg;bottom:var(--arrow-position)}.popover[data-placement*=\"left\"] .arrow{--arrow-rotation:135deg;right:var(--arrow-position)}.popover[data-placement*=\"right\"] .arrow{--arrow-rotation:315deg;left:var(--arrow-position)}`;\nexport default styles;\n", "import { CSSResultGroup, html, LitElement, TemplateResult } from \"lit\";\nimport { customElement, property, query, state } from \"lit/decorators.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport {\n computePosition,\n flip,\n shift,\n offset,\n arrow,\n inline,\n autoUpdate,\n size,\n Middleware,\n MiddlewareState,\n} from \"@floating-ui/dom\";\nimport { event, EventDispatcher } from \"../../utilities/event\";\nimport style from \"./bl-popover.css\";\n\nexport type Placement =\n | \"top-start\"\n | \"top\"\n | \"top-end\"\n | \"bottom-start\"\n | \"bottom\"\n | \"bottom-end\"\n | \"left-start\"\n | \"left\"\n | \"left-end\"\n | \"right-start\"\n | \"right\"\n | \"right-end\";\n\n/**\n * @tag bl-popover\n * @summary Baklava Popover component\n *\n * @cssproperty [--bl-popover-arrow-display=none] - Sets the display of popovers arrow. Set as `block` to make arrow visible.\n * @cssproperty [--bl-popover-background-color=--bl-color-neutral-full] - Sets the background color of popover.\n * @cssproperty [--bl-popover-border-color=--bl-color-primary-highlight] - Sets the border color of popover.\n * @cssproperty [--bl-popover-border-size=1px] - Sets the border size of popover. You can set it to `0px` to not have a border (if you use a custom background color). Always use with a length unit.\n * @cssproperty [--bl-popover-padding=--bl-size-m] - Sets the padding of popover.\n * @cssproperty [--bl-popover-border-radius=--bl-size-3xs] - Sets the border radius of popover.\n * @cssproperty [--bl-popover-max-width=100vw] - Sets the maximum width of the popover (including border and padding).\n * @cssproperty [--bl-popover-position=fixed] - Sets the position of popover. You can set it to `absolute` if parent element is a fixed positioned element like drawer or dialog.\n */\n@customElement(\"bl-popover\")\nexport default class BlPopover extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n @query(\".popover\") private _popover: HTMLElement;\n @query(\".arrow\") private arrow: HTMLElement;\n\n /**\n * Sets placement of the popover\n */\n @property({ type: String })\n placement: Placement = \"bottom\";\n\n /**\n * Target elements state\n */\n @state() _target: string | Element;\n\n /**\n * Sets size of popover same as trigger element\n */\n @property({ type: Boolean, attribute: \"fit-size\" })\n fitSize = false;\n\n /**\n * Sets the distance between popover and target/trigger element\n */\n @property({ type: Number })\n offset = 8;\n\n /**\n * Visibility state\n */\n @state() private _visible = false;\n\n /**\n * Fires when the popover is shown\n */\n @event(\"bl-popover-show\") private onBlPopoverShow: EventDispatcher<string>;\n\n /**\n * Fires when popover becomes hidden\n */\n @event(\"bl-popover-hide\") private onBlPopoverHide: EventDispatcher<string>;\n\n connectedCallback() {\n super.connectedCallback();\n\n this._handlePopoverShowEvent = this._handlePopoverShowEvent.bind(this);\n this._handleKeydownEvent = this._handleKeydownEvent.bind(this);\n this._handleClickOutside = this._handleClickOutside.bind(this);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n\n this.popoverAutoUpdateCleanup && this.popoverAutoUpdateCleanup();\n }\n\n private getMiddleware(): Middleware[] {\n const middlewareParams: Middleware[] = [];\n\n middlewareParams.push(offset(this.offset), inline(), flip(), shift({ padding: 4 }));\n\n if (this.fitSize) {\n middlewareParams.push(\n size({\n apply(args: MiddlewareState) {\n if (args.elements.floating && args.elements.reference) {\n Object.assign(args.elements.floating.style, {\n \"min-width\": `${args.elements.reference.getBoundingClientRect().width}px`,\n });\n }\n },\n })\n );\n }\n\n middlewareParams.push(arrow({ element: this.arrow, padding: 5 }));\n\n return middlewareParams;\n }\n\n private _handleClickOutside = (event: MouseEvent) => {\n const eventPath = event.composedPath() as HTMLElement[];\n\n if (!eventPath.includes(this._target as HTMLElement) && !eventPath.includes(this)) {\n this.hide();\n }\n };\n\n private popoverAutoUpdateCleanup: () => void;\n\n private setPopover() {\n if (this.target) {\n this.popoverAutoUpdateCleanup = autoUpdate(this.target as Element, this._popover, () => {\n computePosition(this.target as Element, this._popover, {\n placement: this.placement,\n strategy: \"fixed\",\n middleware: this.getMiddleware(),\n }).then(({ x, y, placement, middlewareData }) => {\n Object.assign(this._popover.style, {\n left: `${x}px`,\n top: `${y}px`,\n });\n\n this._popover.dataset.placement = placement;\n\n if (middlewareData.arrow) {\n const { x: arrowX, y: arrowY } = middlewareData.arrow;\n\n Object.assign(this.arrow.style, {\n left: arrowX != null ? `${arrowX}px` : \"\",\n top: arrowY != null ? `${arrowY}px` : \"\",\n });\n }\n });\n });\n }\n }\n\n /**\n * Sets the target element of the popover to align and trigger.\n * It can be a string id of the target element or can be a direct Element reference of it.\n */\n @property()\n get target(): string | Element {\n return this._target;\n }\n\n set target(value: string | Element) {\n if (typeof value === \"string\") {\n this._target = document.getElementById(value) as Element;\n } else if (value instanceof Element) {\n this._target = value;\n } else {\n console.warn(\n \"BlPopover target only accepts an Element instance or a string id of a DOM element.\"\n );\n }\n }\n\n /**\n * Shows popover\n */\n show() {\n this._visible = true;\n this.setPopover();\n this.onBlPopoverShow(\"\");\n document.addEventListener(\"click\", this._handleClickOutside);\n document.addEventListener(\"keydown\", this._handleKeydownEvent);\n document.addEventListener(\"bl-popover-show\", this._handlePopoverShowEvent);\n }\n\n /**\n * Hides popover\n */\n hide() {\n this._visible = false;\n document.removeEventListener(\"click\", this._handleClickOutside);\n document.removeEventListener(\"keydown\", this._handleKeydownEvent);\n document.removeEventListener(\"bl-popover-show\", this._handlePopoverShowEvent);\n this.onBlPopoverHide(\"\");\n }\n\n /**\n * Gives the visibility status of the popover\n */\n get visible(): boolean {\n return this._visible;\n }\n\n private _handlePopoverShowEvent(event: Event) {\n if (event.target !== this) {\n const { parentElement } = event.target as HTMLElement;\n const isNestedPopover = this.contains(parentElement);\n\n if (!isNestedPopover && (event.target as HTMLElement).tagName === this.tagName) {\n this.hide();\n }\n }\n }\n\n private _handleKeydownEvent(event: KeyboardEvent) {\n if (event.key === \"Escape\" && this.visible) {\n event.preventDefault();\n this.hide();\n }\n }\n\n render(): TemplateResult {\n const classes = classMap({\n popover: true,\n visible: this._visible,\n });\n\n return html`<div class=${classes}>\n <slot id=\"popover\" aria-live=${this._visible ? \"polite\" : \"off\"}></slot>\n <div class=\"arrow\" aria-hidden=\"true\"></div>\n </div>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CAC5C,GAAIA,EAAM,SAAW,KAAM,CACzB,GAAM,CAAE,cAAAoB,CAAc,EAAIpB,EAAM,OAG5B,CAFoB,KAAK,SAASoB,CAAa,GAE1BpB,EAAM,OAAuB,UAAY,KAAK,SACrE,KAAK,KAAK,EAGhB,CAEQ,oBAAoBA,EAAsB,CAC5CA,EAAM,MAAQ,UAAY,KAAK,UACjCA,EAAM,eAAe,EACrB,KAAK,KAAK,EAEd,CAEA,QAAyB,CACvB,IAAMqB,EAAUC,EAAS,CACvB,QAAS,GACT,QAAS,KAAK,QAChB,CAAC,EAED,OAAOT,eAAkBQ;AAAA,qCACQ,KAAK,SAAW,SAAW;AAAA;AAAA,WAG9D,CACF,EArM6BE,EAAA,CAA1BC,EAAM,UAAU,GALE1B,EAKQ,wBACFyB,EAAA,CAAxBC,EAAM,QAAQ,GANI1B,EAMM,qBAMzByB,EAAA,CADCE,EAAS,CAAE,KAAM,MAAO,CAAC,GAXP3B,EAYnB,yBAKSyB,EAAA,CAARG,EAAM,GAjBY5B,EAiBV,uBAMTyB,EAAA,CADCE,EAAS,CAAE,KAAM,QAAS,UAAW,UAAW,CAAC,GAtB/B3B,EAuBnB,uBAMAyB,EAAA,CADCE,EAAS,CAAE,KAAM,MAAO,CAAC,GA5BP3B,EA6BnB,sBAKiByB,EAAA,CAAhBG,EAAM,GAlCY5B,EAkCF,wBAKiByB,EAAA,CAAjCvB,EAAM,iBAAiB,GAvCLF,EAuCe,+BAKAyB,EAAA,CAAjCvB,EAAM,iBAAiB,GA5CLF,EA4Ce,+BAmF9ByB,EAAA,CADHE,EAAS,GA9HS3B,EA+Hf,sBA/HeA,EAArByB,EAAA,CADCE,EAAc,YAAY,GACN3B",
|
|
6
6
|
"names": ["styles", "i", "bl_popover_default", "BlPopover", "s", "event", "eventPath", "bl_popover_default", "middlewareParams", "offset", "inline", "flip", "shift", "size", "args", "arrow", "autoUpdate", "computePosition", "x", "y", "placement", "middlewareData", "arrowX", "arrowY", "value", "parentElement", "classes", "o", "__decorateClass", "i", "e", "t"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-VGXYENGL.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-popover.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-5TPDRTCU.js";import"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-5TPDRTCU.js";import"../../chunk-Q6MAW2EF.js";import"../../chunk-QF4LGACD.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-tab-group.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../../chunk-HAE5XKSY.js";import"../../chunk-
|
|
1
|
+
import{a}from"../../chunk-HAE5XKSY.js";import"../../chunk-VGXYENGL.js";import"../../chunk-EZSEQHRH.js";import"../../chunk-6LT7O7T2.js";import"../../chunk-DINNT5P2.js";import"../../chunk-GRL4DWKG.js";import"../../chunk-7GK5LKBV.js";import"../../chunk-5MOOXA2X.js";import"../../chunk-4OT5AMS5.js";import"../../chunk-IZ2LK5GK.js";export{a as default};
|
|
2
2
|
//# sourceMappingURL=bl-tooltip.js.map
|