@trendyol/baklava 2.0.0-beta.27 → 2.0.0-beta.28
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.js +1 -1
- package/dist/baklava-react.js.map +3 -3
- package/dist/baklava.js +1 -1
- package/dist/chunk-2TVOKUHE.js +7 -0
- package/dist/{chunk-E2DT737L.js.map → chunk-2TVOKUHE.js.map} +0 -0
- package/dist/{chunk-E6WXDMOY.js → chunk-6UWMQKJW.js} +2 -2
- package/dist/{chunk-E6WXDMOY.js.map → chunk-6UWMQKJW.js.map} +0 -0
- package/dist/{chunk-CEIAWSNF.js → chunk-C5HFLPOK.js} +2 -2
- package/dist/{chunk-CEIAWSNF.js.map → chunk-C5HFLPOK.js.map} +0 -0
- package/dist/chunk-ECPBIHTM.js +30 -0
- package/dist/chunk-ECPBIHTM.js.map +7 -0
- package/dist/{chunk-AS43M6VT.js → chunk-EELZVHM7.js} +2 -2
- package/dist/{chunk-AS43M6VT.js.map → chunk-EELZVHM7.js.map} +0 -0
- package/dist/{chunk-W53DEGK2.js → chunk-ENFFFE4I.js} +2 -2
- package/dist/{chunk-W53DEGK2.js.map → chunk-ENFFFE4I.js.map} +0 -0
- package/dist/{chunk-S7TTXZFP.js → chunk-HG7OBTQS.js} +2 -2
- package/dist/{chunk-S7TTXZFP.js.map → chunk-HG7OBTQS.js.map} +4 -4
- package/dist/chunk-IAT752ME.js +12 -0
- package/dist/chunk-IAT752ME.js.map +7 -0
- package/dist/{chunk-DCSIJZKF.js → chunk-IDG5M2QP.js} +2 -2
- package/dist/{chunk-DCSIJZKF.js.map → chunk-IDG5M2QP.js.map} +0 -0
- package/dist/{chunk-S7EEJXFV.js → chunk-IECHMCUY.js} +2 -2
- package/dist/{chunk-S7EEJXFV.js.map → chunk-IECHMCUY.js.map} +0 -0
- package/dist/{chunk-EWAVYEMK.js → chunk-KQBKSEYJ.js} +2 -2
- package/dist/{chunk-EWAVYEMK.js.map → chunk-KQBKSEYJ.js.map} +0 -0
- package/dist/chunk-KWTSWXUL.js +13 -0
- package/dist/chunk-KWTSWXUL.js.map +7 -0
- package/dist/{chunk-5YWWSNRQ.js → chunk-LZHSSAHO.js} +2 -2
- package/dist/{chunk-5YWWSNRQ.js.map → chunk-LZHSSAHO.js.map} +0 -0
- package/dist/{chunk-YAJ5XHMW.js → chunk-N6FF6F3Y.js} +2 -2
- package/dist/{chunk-YAJ5XHMW.js.map → chunk-N6FF6F3Y.js.map} +0 -0
- package/dist/{chunk-DJNJ4CN4.js → chunk-OJVJFWT3.js} +2 -2
- package/dist/{chunk-DJNJ4CN4.js.map → chunk-OJVJFWT3.js.map} +0 -0
- package/dist/{chunk-CVDMDPXP.js → chunk-U35464ML.js} +2 -2
- package/dist/{chunk-CVDMDPXP.js.map → chunk-U35464ML.js.map} +0 -0
- package/dist/chunk-VNGNBBSS.js +2 -0
- package/dist/chunk-VNGNBBSS.js.map +7 -0
- package/dist/{chunk-SJW4HPSY.js → chunk-WXJKPVRA.js} +2 -2
- package/dist/{chunk-SJW4HPSY.js.map → chunk-WXJKPVRA.js.map} +0 -0
- 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/checkbox/bl-checkbox.js +1 -1
- package/dist/components/icon/bl-icon.js +1 -1
- package/dist/components/input/bl-input.js +1 -1
- package/dist/components/progress-indicator/bl-progress-indicator.js +1 -1
- package/dist/components/select/bl-select.js +2 -0
- package/dist/components/select/bl-select.js.map +7 -0
- package/dist/components/select/option/bl-select-option.js +2 -0
- package/dist/components/select/option/bl-select-option.js.map +7 -0
- 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/tab-group/tab-panel/bl-tab-panel.js +1 -1
- package/dist/components/tooltip/bl-tooltip.js +1 -1
- package/dist/custom-elements.json +194 -0
- package/package.json +1 -1
- package/dist/chunk-E2DT737L.js +0 -7
- package/dist/chunk-RLRHLKBD.js +0 -12
- package/dist/chunk-RLRHLKBD.js.map +0 -7
package/dist/baklava-react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./chunk-NZ3RGSR6.js";import
|
|
1
|
+
import"./chunk-NZ3RGSR6.js";import o from"react";var f=new Set(["children","localName","ref","style","className"]),E=new WeakMap,v=(a,d,p,u,h)=>{let g=h==null?void 0:h[d];g!==void 0?p!==u&&((r,n,i)=>{let s=E.get(r);s===void 0&&E.set(r,s=new Map);let t=s.get(n);i!==void 0?t===void 0?(s.set(n,t={handleEvent:i}),r.addEventListener(n,t)):t.handleEvent=i:t!==void 0&&(s.delete(n),r.removeEventListener(n,t))})(a,g,p):a[d]=p},e=(a,d,p,u,h)=>{let g=a.Component,r=a.createElement,n=new Set(Object.keys(u!=null?u:{}));for(let t in p.prototype)t in HTMLElement.prototype||(f.has(t)?console.warn(`${d} contains property ${t} which is a React reserved property. It will be used by React and not set on the element.`):n.add(t));class i extends g{constructor(){super(...arguments),this.o=null}t(l){if(this.o!==null)for(let b in this.i)v(this.o,b,this.props[b],l?l[b]:void 0,u)}componentDidMount(){this.t()}componentDidUpdate(l){this.t(l)}render(){let l=this.props._$Gl;this.h!==void 0&&this.u===l||(this.h=c=>{this.o===null&&(this.o=c),l!==null&&((m,x)=>{typeof m=="function"?m(x):m.current=x})(l,c),this.u=l});let b={ref:this.h};this.i={};for(let[c,m]of Object.entries(this.props))c!=="__forwardedRef"&&(n.has(c)?this.i[c]=m:b[c==="className"?"class":c]=m);return r(d,b)}}i.displayName=h!=null?h:p.name;let s=a.forwardRef((t,l)=>r(i,{...t,_$Gl:l},t==null?void 0:t.children));return s.displayName=i.displayName,s};var S=e(o,"bl-alert",customElements.get("bl-alert"),{onClose:"bl-close"}),N=e(o,"bl-badge",customElements.get("bl-badge"),{}),I=e(o,"bl-button",customElements.get("bl-button"),{onClick:"bl-click"}),R=e(o,"bl-checkbox",customElements.get("bl-checkbox"),{onChange:"bl-checkbox-change"}),T=e(o,"bl-icon",customElements.get("bl-icon"),{onLoad:"bl-load",onError:"bl-error"}),L=e(o,"bl-input",customElements.get("bl-input"),{onChange:"bl-change",onInput:"bl-input"}),M=e(o,"bl-progress-indicator",customElements.get("bl-progress-indicator"),{}),O=e(o,"bl-select",customElements.get("bl-select"),{onSelect:"bl-select"}),_=e(o,"bl-tab-group",customElements.get("bl-tab-group"),{}),$=e(o,"bl-tooltip",customElements.get("bl-tooltip"),{onShow:"bl-tooltip-show",onHide:"bl-tooltip-hide"}),G=e(o,"bl-select-option",customElements.get("bl-select-option"),{onOption:"bl-select-option"}),j=e(o,"bl-tab",customElements.get("bl-tab"),{onSelected:"bl-tab-selected"}),D=e(o,"bl-tab-panel",customElements.get("bl-tab-panel"),{});export{S as BlAlert,N as BlBadge,I as BlButton,R as BlCheckbox,T as BlIcon,L as BlInput,M as BlProgressIndicator,O as BlSelect,G as BlSelectOption,j as BlTab,_ as BlTabGroup,D as BlTabPanel,$ as BlTooltip};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2018 Google LLC
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/baklava-react.ts", "../node_modules/@lit-labs/react/src/create-component.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/ban-ts-comment */\n// @ts-nocheck\nimport React from 'react';\nimport { createComponent } from '@lit-labs/react';\n\nexport const BlAlert = createComponent(\n React,\n 'bl-alert',\n customElements.get('bl-alert'),\n { onClose: 'bl-close' }\n);\n\nexport const BlBadge = createComponent(\n React,\n 'bl-badge',\n customElements.get('bl-badge'),\n {}\n);\n\nexport const BlButton = createComponent(\n React,\n 'bl-button',\n customElements.get('bl-button'),\n { onClick: 'bl-click' }\n);\n\nexport const BlCheckbox = createComponent(\n React,\n 'bl-checkbox',\n customElements.get('bl-checkbox'),\n { onChange: 'bl-checkbox-change' }\n);\n\nexport const BlIcon = createComponent(\n React,\n 'bl-icon',\n customElements.get('bl-icon'),\n { onLoad: 'bl-load', onError: 'bl-error' }\n);\n\nexport const BlInput = createComponent(\n React,\n 'bl-input',\n customElements.get('bl-input'),\n { onChange: 'bl-change', onInput: 'bl-input' }\n);\n\nexport const BlProgressIndicator = createComponent(\n React,\n 'bl-progress-indicator',\n customElements.get('bl-progress-indicator'),\n {}\n);\n\nexport const BlTabGroup = createComponent(\n React,\n 'bl-tab-group',\n customElements.get('bl-tab-group'),\n {}\n);\n\nexport const BlTooltip = createComponent(\n React,\n 'bl-tooltip',\n customElements.get('bl-tooltip'),\n { onShow: 'bl-tooltip-show', onHide: 'bl-tooltip-hide' }\n);\n\nexport const BlTab = createComponent(\n React,\n 'bl-tab',\n customElements.get('bl-tab'),\n { onSelected: 'bl-tab-selected' }\n);\n\nexport const BlTabPanel = createComponent(\n React,\n 'bl-tab-panel',\n customElements.get('bl-tab-panel'),\n {}\n);\n", "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nconst reservedReactProperties = new Set([\n 'children',\n 'localName',\n 'ref',\n 'style',\n 'className',\n]);\n\nconst listenedEvents: WeakMap<\n Element,\n Map<string, EventListenerObject>\n> = new WeakMap();\n\n/**\n * Adds an event listener for the specified event to the given node. In the\n * React setup, there should only ever be one event listener. Thus, for\n * efficiency only one listener is added and the handler for that listener is\n * updated to point to the given listener function.\n */\nconst addOrUpdateEventListener = (\n node: Element,\n event: string,\n listener: (event?: Event) => void\n) => {\n let events = listenedEvents.get(node);\n if (events === undefined) {\n listenedEvents.set(node, (events = new Map()));\n }\n let handler = events.get(event);\n if (listener !== undefined) {\n // If necessary, add listener and track handler\n if (handler === undefined) {\n events.set(event, (handler = {handleEvent: listener}));\n node.addEventListener(event, handler);\n // Otherwise just update the listener with new value\n } else {\n handler.handleEvent = listener;\n }\n // Remove listener if one exists and value is undefined\n } else if (handler !== undefined) {\n events.delete(event);\n node.removeEventListener(event, handler);\n }\n};\n\n/**\n * Sets properties and events on custom elements. These properties and events\n * have been pre-filtered so we know they should apply to the custom element.\n */\nconst setProperty = <E extends Element>(\n node: E,\n name: string,\n value: unknown,\n old: unknown,\n events?: Events\n) => {\n const event = events?.[name];\n if (event !== undefined) {\n // Dirty check event value.\n if (value !== old) {\n addOrUpdateEventListener(node, event, value as (e?: Event) => void);\n }\n } else {\n // But don't dirty check properties; elements are assumed to do this.\n node[name as keyof E] = value as E[keyof E];\n }\n};\n\n// Set a React ref. Note, there are 2 kinds of refs and there's no built in\n// React API to set a ref.\nconst setRef = (ref: React.Ref<unknown>, value: Element | null) => {\n if (typeof ref === 'function') {\n (ref as (e: Element | null) => void)(value);\n } else {\n (ref as {current: Element | null}).current = value;\n }\n};\n\ntype Constructor<T> = {new (): T};\n\n/***\n * Typecast that curries an Event type through a string. The goal of the type\n * cast is to match a prop name to a typed event callback.\n */\nexport type EventName<T extends Event = Event> = string & {\n __event_type: T;\n};\n\ntype Events = Record<string, EventName | string>;\n\ntype EventProps<R extends Events> = {\n [K in keyof R]: R[K] extends EventName\n ? (e: R[K]['__event_type']) => void\n : (e: Event) => void;\n};\n\n/**\n * Creates a React component for a custom element. Properties are distinguished\n * from attributes automatically, and events can be configured so they are\n * added to the custom element as event listeners.\n *\n * @param React The React module, typically imported from the `react` npm\n * package.\n * @param tagName The custom element tag name registered via\n * `customElements.define`.\n * @param elementClass The custom element class registered via\n * `customElements.define`.\n * @param events An object listing events to which the component can listen. The\n * object keys are the event property names passed in via React props and the\n * object values are the names of the corresponding events generated by the\n * custom element. For example, given `{onactivate: 'activate'}` an event\n * function may be passed via the component's `onactivate` prop and will be\n * called when the custom element fires its `activate` event.\n * @param displayName A React component display name, used in debugging\n * messages. Default value is inferred from the name of custom element class\n * registered via `customElements.define`.\n */\nexport const createComponent = <I extends HTMLElement, E extends Events = {}>(\n React: typeof window.React,\n tagName: string,\n elementClass: Constructor<I>,\n events?: E,\n displayName?: string\n) => {\n const Component = React.Component;\n const createElement = React.createElement;\n\n // Props the user is allowed to use, includes standard attributes, children,\n // ref, as well as special event and element properties.\n type ReactProps = Omit<React.HTMLAttributes<I>, keyof E>;\n type ElementWithoutPropsOrEvents = Omit<I, keyof E | keyof ReactProps>;\n type UserProps = Partial<\n ReactProps & ElementWithoutPropsOrEvents & EventProps<E>\n >;\n\n // Props used by this component wrapper. This is the UserProps and the\n // special `__forwardedRef` property. Note, this ref is special because\n // it's both needed in this component to get access to the rendered element\n // and must fulfill any ref passed by the user.\n type ComponentProps = UserProps & {\n __forwardedRef?: React.Ref<unknown>;\n };\n\n // Set of properties/events which should be specially handled by the wrapper\n // and not handled directly by React.\n const elementClassProps = new Set(Object.keys(events ?? {}));\n for (const p in elementClass.prototype) {\n if (!(p in HTMLElement.prototype)) {\n if (reservedReactProperties.has(p)) {\n // Note, this effectively warns only for `ref` since the other\n // reserved props are on HTMLElement.prototype. To address this\n // would require crawling down the prototype, which doesn't feel worth\n // it since implementing these properties on an element is extremely\n // rare.\n console.warn(\n `${tagName} contains property ${p} which is a React ` +\n `reserved property. It will be used by React and not set on ` +\n `the element.`\n );\n } else {\n elementClassProps.add(p);\n }\n }\n }\n\n class ReactComponent extends Component<ComponentProps> {\n private _element: I | null = null;\n private _elementProps!: {[index: string]: unknown};\n private _userRef?: React.Ref<unknown>;\n private _ref?: React.RefCallback<I>;\n\n static displayName = displayName ?? elementClass.name;\n\n private _updateElement(oldProps?: ComponentProps) {\n if (this._element === null) {\n return;\n }\n // Set element properties to the values in `this.props`\n for (const prop in this._elementProps) {\n setProperty(\n this._element,\n prop,\n this.props[prop as keyof ComponentProps],\n oldProps ? oldProps[prop as keyof ComponentProps] : undefined,\n events\n );\n }\n // Note, the spirit of React might be to \"unset\" any old values that\n // are no longer included; however, there's no reasonable value to set\n // them to so we just leave the previous state as is.\n }\n\n /**\n * Updates element properties correctly setting properties\n * on mount.\n */\n override componentDidMount() {\n this._updateElement();\n }\n\n /**\n * Updates element properties correctly setting properties\n * on every update. Note, this does not include mount.\n */\n override componentDidUpdate(old: ComponentProps) {\n this._updateElement(old);\n }\n\n /**\n * Renders the custom element with a `ref` prop which allows this\n * component to reference the custom element.\n *\n * Standard attributes are passed to React and element properties and events\n * are updated in componentDidMount/componentDidUpdate.\n *\n */\n override render() {\n // Since refs only get fulfilled once, pass a new one if the user's\n // ref changed. This allows refs to be fulfilled as expected, going from\n // having a value to null.\n const userRef = this.props.__forwardedRef as React.Ref<unknown>;\n if (this._ref === undefined || this._userRef !== userRef) {\n this._ref = (value: I | null) => {\n if (this._element === null) {\n this._element = value;\n }\n if (userRef !== null) {\n setRef(userRef, value);\n }\n this._userRef = userRef;\n };\n }\n // Filters class properties out and passes the remaining\n // attributes to React. This allows attributes to use framework rules\n // for setting attributes and render correctly under SSR.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {ref: this._ref};\n // Note, save element props while iterating to avoid the need to\n // iterate again when setting properties.\n this._elementProps = {};\n for (const [k, v] of Object.entries(this.props)) {\n if (k === '__forwardedRef') continue;\n\n if (elementClassProps.has(k)) {\n this._elementProps[k] = v;\n } else {\n // React does *not* handle `className` for custom elements so\n // coerce it to `class` so it's handled correctly.\n props[k === 'className' ? 'class' : k] = v;\n }\n }\n return createElement(tagName, props);\n }\n }\n\n const ForwardedComponent = React.forwardRef(\n (props?: UserProps, ref?: React.Ref<unknown>) =>\n createElement(\n ReactComponent,\n {...props, __forwardedRef: ref} as ComponentProps,\n props?.children\n )\n );\n\n // To ease debugging in the React Developer Tools\n ForwardedComponent.displayName = ReactComponent.displayName;\n\n return ForwardedComponent;\n};\n"],
|
|
5
|
-
"mappings": "4BAEA,OAAOA,MAAW,QCIlB,IAAMC,EAA0B,IAAIC,IAAI,CACtC,WACA,YACA,MACA,QACA,WAAA,CAAA,EAGIC,EAGF,IAAIC,QAsCFC,EAAc,CAClBC,EACAC,EACAC,EACAC,EACAC,IAAAA,CAEA,IAAMC,EAAQD,GAAAA,KAAAA,O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aG,EAAaJ,EACxBC,EACA,cACA,eAAe,IAAI,aAAa,EAChC,CAAE,SAAU,oBAAqB,CACnC,EAEaI,EAASL,EACpBC,EACA,UACA,eAAe,IAAI,SAAS,EAC5B,CAAE,OAAQ,UAAW,QAAS,UAAW,CAC3C,EAEaK,EAAUN,EACrBC,EACA,WACA,eAAe,IAAI,UAAU,EAC7B,CAAE,SAAU,YAAa,QAAS,UAAW,CAC/C,EAEaM,EAAsBP,EACjCC,EACA,wBACA,eAAe,IAAI,uBAAuB,EAC1C,CAAC,CACH,EAEaO,
|
|
6
|
-
"names": ["React", "reservedReactProperties", "Set", "listenedEvents", "WeakMap", "setProperty", "node", "name", "value", "old", "events", "event", "listener", "get", "set", "Map", "handler", "handleEvent", "addEventListener", "delete", "removeEventListener", "createComponent", "React", "tagName", "elementClass", "displayName", "Component", "createElement", "elementClassProps", "Object", "keys", "p", "prototype", "HTMLElement", "has", "console", "warn", "add", "ReactComponent", "constructor", "this", "_element", "_updateElement", "oldProps", "prop", "_elementProps", "props", "componentDidMount", "componentDidUpdate", "render", "userRef", "__forwardedRef", "_ref", "_userRef", "ref", "current", "k", "v", "entries", "ForwardedComponent", "forwardRef", "children", "BlAlert", "s", "React", "BlBadge", "BlButton", "BlCheckbox", "BlIcon", "BlInput", "BlProgressIndicator", "BlTabGroup", "BlTooltip", "BlTab", "BlTabPanel"]
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/ban-ts-comment */\n// @ts-nocheck\nimport React from 'react';\nimport { createComponent } from '@lit-labs/react';\n\nexport const BlAlert = createComponent(\n React,\n 'bl-alert',\n customElements.get('bl-alert'),\n { onClose: 'bl-close' }\n);\n\nexport const BlBadge = createComponent(\n React,\n 'bl-badge',\n customElements.get('bl-badge'),\n {}\n);\n\nexport const BlButton = createComponent(\n React,\n 'bl-button',\n customElements.get('bl-button'),\n { onClick: 'bl-click' }\n);\n\nexport const BlCheckbox = createComponent(\n React,\n 'bl-checkbox',\n customElements.get('bl-checkbox'),\n { onChange: 'bl-checkbox-change' }\n);\n\nexport const BlIcon = createComponent(\n React,\n 'bl-icon',\n customElements.get('bl-icon'),\n { onLoad: 'bl-load', onError: 'bl-error' }\n);\n\nexport const BlInput = createComponent(\n React,\n 'bl-input',\n customElements.get('bl-input'),\n { onChange: 'bl-change', onInput: 'bl-input' }\n);\n\nexport const BlProgressIndicator = createComponent(\n React,\n 'bl-progress-indicator',\n customElements.get('bl-progress-indicator'),\n {}\n);\n\nexport const BlSelect = createComponent(\n React,\n 'bl-select',\n customElements.get('bl-select'),\n { onSelect: 'bl-select' }\n);\n\nexport const BlTabGroup = createComponent(\n React,\n 'bl-tab-group',\n customElements.get('bl-tab-group'),\n {}\n);\n\nexport const BlTooltip = createComponent(\n React,\n 'bl-tooltip',\n customElements.get('bl-tooltip'),\n { onShow: 'bl-tooltip-show', onHide: 'bl-tooltip-hide' }\n);\n\nexport const BlSelectOption = createComponent(\n React,\n 'bl-select-option',\n customElements.get('bl-select-option'),\n { onOption: 'bl-select-option' }\n);\n\nexport const BlTab = createComponent(\n React,\n 'bl-tab',\n customElements.get('bl-tab'),\n { onSelected: 'bl-tab-selected' }\n);\n\nexport const BlTabPanel = createComponent(\n React,\n 'bl-tab-panel',\n customElements.get('bl-tab-panel'),\n {}\n);\n", "/**\n * @license\n * Copyright 2018 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */\n\nconst reservedReactProperties = new Set([\n 'children',\n 'localName',\n 'ref',\n 'style',\n 'className',\n]);\n\nconst listenedEvents: WeakMap<\n Element,\n Map<string, EventListenerObject>\n> = new WeakMap();\n\n/**\n * Adds an event listener for the specified event to the given node. In the\n * React setup, there should only ever be one event listener. Thus, for\n * efficiency only one listener is added and the handler for that listener is\n * updated to point to the given listener function.\n */\nconst addOrUpdateEventListener = (\n node: Element,\n event: string,\n listener: (event?: Event) => void\n) => {\n let events = listenedEvents.get(node);\n if (events === undefined) {\n listenedEvents.set(node, (events = new Map()));\n }\n let handler = events.get(event);\n if (listener !== undefined) {\n // If necessary, add listener and track handler\n if (handler === undefined) {\n events.set(event, (handler = {handleEvent: listener}));\n node.addEventListener(event, handler);\n // Otherwise just update the listener with new value\n } else {\n handler.handleEvent = listener;\n }\n // Remove listener if one exists and value is undefined\n } else if (handler !== undefined) {\n events.delete(event);\n node.removeEventListener(event, handler);\n }\n};\n\n/**\n * Sets properties and events on custom elements. These properties and events\n * have been pre-filtered so we know they should apply to the custom element.\n */\nconst setProperty = <E extends Element>(\n node: E,\n name: string,\n value: unknown,\n old: unknown,\n events?: Events\n) => {\n const event = events?.[name];\n if (event !== undefined) {\n // Dirty check event value.\n if (value !== old) {\n addOrUpdateEventListener(node, event, value as (e?: Event) => void);\n }\n } else {\n // But don't dirty check properties; elements are assumed to do this.\n node[name as keyof E] = value as E[keyof E];\n }\n};\n\n// Set a React ref. Note, there are 2 kinds of refs and there's no built in\n// React API to set a ref.\nconst setRef = (ref: React.Ref<unknown>, value: Element | null) => {\n if (typeof ref === 'function') {\n (ref as (e: Element | null) => void)(value);\n } else {\n (ref as {current: Element | null}).current = value;\n }\n};\n\ntype Constructor<T> = {new (): T};\n\n/***\n * Typecast that curries an Event type through a string. The goal of the type\n * cast is to match a prop name to a typed event callback.\n */\nexport type EventName<T extends Event = Event> = string & {\n __event_type: T;\n};\n\ntype Events = Record<string, EventName | string>;\n\ntype EventProps<R extends Events> = {\n [K in keyof R]: R[K] extends EventName\n ? (e: R[K]['__event_type']) => void\n : (e: Event) => void;\n};\n\n/**\n * Creates a React component for a custom element. Properties are distinguished\n * from attributes automatically, and events can be configured so they are\n * added to the custom element as event listeners.\n *\n * @param React The React module, typically imported from the `react` npm\n * package.\n * @param tagName The custom element tag name registered via\n * `customElements.define`.\n * @param elementClass The custom element class registered via\n * `customElements.define`.\n * @param events An object listing events to which the component can listen. The\n * object keys are the event property names passed in via React props and the\n * object values are the names of the corresponding events generated by the\n * custom element. For example, given `{onactivate: 'activate'}` an event\n * function may be passed via the component's `onactivate` prop and will be\n * called when the custom element fires its `activate` event.\n * @param displayName A React component display name, used in debugging\n * messages. Default value is inferred from the name of custom element class\n * registered via `customElements.define`.\n */\nexport const createComponent = <I extends HTMLElement, E extends Events = {}>(\n React: typeof window.React,\n tagName: string,\n elementClass: Constructor<I>,\n events?: E,\n displayName?: string\n) => {\n const Component = React.Component;\n const createElement = React.createElement;\n\n // Props the user is allowed to use, includes standard attributes, children,\n // ref, as well as special event and element properties.\n type ReactProps = Omit<React.HTMLAttributes<I>, keyof E>;\n type ElementWithoutPropsOrEvents = Omit<I, keyof E | keyof ReactProps>;\n type UserProps = Partial<\n ReactProps & ElementWithoutPropsOrEvents & EventProps<E>\n >;\n\n // Props used by this component wrapper. This is the UserProps and the\n // special `__forwardedRef` property. Note, this ref is special because\n // it's both needed in this component to get access to the rendered element\n // and must fulfill any ref passed by the user.\n type ComponentProps = UserProps & {\n __forwardedRef?: React.Ref<unknown>;\n };\n\n // Set of properties/events which should be specially handled by the wrapper\n // and not handled directly by React.\n const elementClassProps = new Set(Object.keys(events ?? {}));\n for (const p in elementClass.prototype) {\n if (!(p in HTMLElement.prototype)) {\n if (reservedReactProperties.has(p)) {\n // Note, this effectively warns only for `ref` since the other\n // reserved props are on HTMLElement.prototype. To address this\n // would require crawling down the prototype, which doesn't feel worth\n // it since implementing these properties on an element is extremely\n // rare.\n console.warn(\n `${tagName} contains property ${p} which is a React ` +\n `reserved property. It will be used by React and not set on ` +\n `the element.`\n );\n } else {\n elementClassProps.add(p);\n }\n }\n }\n\n class ReactComponent extends Component<ComponentProps> {\n private _element: I | null = null;\n private _elementProps!: {[index: string]: unknown};\n private _userRef?: React.Ref<unknown>;\n private _ref?: React.RefCallback<I>;\n\n static displayName = displayName ?? elementClass.name;\n\n private _updateElement(oldProps?: ComponentProps) {\n if (this._element === null) {\n return;\n }\n // Set element properties to the values in `this.props`\n for (const prop in this._elementProps) {\n setProperty(\n this._element,\n prop,\n this.props[prop as keyof ComponentProps],\n oldProps ? oldProps[prop as keyof ComponentProps] : undefined,\n events\n );\n }\n // Note, the spirit of React might be to \"unset\" any old values that\n // are no longer included; however, there's no reasonable value to set\n // them to so we just leave the previous state as is.\n }\n\n /**\n * Updates element properties correctly setting properties\n * on mount.\n */\n override componentDidMount() {\n this._updateElement();\n }\n\n /**\n * Updates element properties correctly setting properties\n * on every update. Note, this does not include mount.\n */\n override componentDidUpdate(old: ComponentProps) {\n this._updateElement(old);\n }\n\n /**\n * Renders the custom element with a `ref` prop which allows this\n * component to reference the custom element.\n *\n * Standard attributes are passed to React and element properties and events\n * are updated in componentDidMount/componentDidUpdate.\n *\n */\n override render() {\n // Since refs only get fulfilled once, pass a new one if the user's\n // ref changed. This allows refs to be fulfilled as expected, going from\n // having a value to null.\n const userRef = this.props.__forwardedRef as React.Ref<unknown>;\n if (this._ref === undefined || this._userRef !== userRef) {\n this._ref = (value: I | null) => {\n if (this._element === null) {\n this._element = value;\n }\n if (userRef !== null) {\n setRef(userRef, value);\n }\n this._userRef = userRef;\n };\n }\n // Filters class properties out and passes the remaining\n // attributes to React. This allows attributes to use framework rules\n // for setting attributes and render correctly under SSR.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const props: any = {ref: this._ref};\n // Note, save element props while iterating to avoid the need to\n // iterate again when setting properties.\n this._elementProps = {};\n for (const [k, v] of Object.entries(this.props)) {\n if (k === '__forwardedRef') continue;\n\n if (elementClassProps.has(k)) {\n this._elementProps[k] = v;\n } else {\n // React does *not* handle `className` for custom elements so\n // coerce it to `class` so it's handled correctly.\n props[k === 'className' ? 'class' : k] = v;\n }\n }\n return createElement(tagName, props);\n }\n }\n\n const ForwardedComponent = React.forwardRef(\n (props?: UserProps, ref?: React.Ref<unknown>) =>\n createElement(\n ReactComponent,\n {...props, __forwardedRef: ref} as ComponentProps,\n props?.children\n )\n );\n\n // To ease debugging in the React Developer Tools\n ForwardedComponent.displayName = ReactComponent.displayName;\n\n return ForwardedComponent;\n};\n"],
|
|
5
|
+
"mappings": "4BAEA,OAAOA,MAAW,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AC7B,CAAE,QAAS,UAAW,CACxB,EAEaC,EAAUF,EACrBC,EACA,WACA,eAAe,IAAI,UAAU,EAC7B,CAAC,CACH,EAEaE,EAAWH,EACtBC,EACA,YACA,eAAe,IAAI,WAAW,EAC9B,CAAE,QAAS,UAAW,CACxB,EAEaG,EAAaJ,EACxBC,EACA,cACA,eAAe,IAAI,aAAa,EAChC,CAAE,SAAU,oBAAqB,CACnC,EAEaI,EAASL,EACpBC,EACA,UACA,eAAe,IAAI,SAAS,EAC5B,CAAE,OAAQ,UAAW,QAAS,UAAW,CAC3C,EAEaK,EAAUN,EACrBC,EACA,WACA,eAAe,IAAI,UAAU,EAC7B,CAAE,SAAU,YAAa,QAAS,UAAW,CAC/C,EAEaM,EAAsBP,EACjCC,EACA,wBACA,eAAe,IAAI,uBAAuB,EAC1C,CAAC,CACH,EAEaO,EAAWR,EACtBC,EACA,YACA,eAAe,IAAI,WAAW,EAC9B,CAAE,SAAU,WAAY,CAC1B,EAEaQ,EAAaT,EACxBC,EACA,eACA,eAAe,IAAI,cAAc,EACjC,CAAC,CACH,EAEaS,EAAYV,EACvBC,EACA,aACA,eAAe,IAAI,YAAY,EAC/B,CAAE,OAAQ,kBAAmB,OAAQ,iBAAkB,CACzD,EAEaU,EAAiBX,EAC5BC,EACA,mBACA,eAAe,IAAI,kBAAkB,EACrC,CAAE,SAAU,kBAAmB,CACjC,EAEaW,EAAQZ,EACnBC,EACA,SACA,eAAe,IAAI,QAAQ,EAC3B,CAAE,WAAY,iBAAkB,CAClC,EAEaY,EAAab,EACxBC,EACA,eACA,eAAe,IAAI,cAAc,EACjC,CAAC,CACH",
|
|
6
|
+
"names": ["React", "reservedReactProperties", "Set", "listenedEvents", "WeakMap", "setProperty", "node", "name", "value", "old", "events", "event", "listener", "get", "set", "Map", "handler", "handleEvent", "addEventListener", "delete", "removeEventListener", "createComponent", "React", "tagName", "elementClass", "displayName", "Component", "createElement", "elementClassProps", "Object", "keys", "p", "prototype", "HTMLElement", "has", "console", "warn", "add", "ReactComponent", "constructor", "this", "_element", "_updateElement", "oldProps", "prop", "_elementProps", "props", "componentDidMount", "componentDidUpdate", "render", "userRef", "__forwardedRef", "_ref", "_userRef", "ref", "current", "k", "v", "entries", "ForwardedComponent", "forwardRef", "children", "BlAlert", "s", "React", "BlBadge", "BlButton", "BlCheckbox", "BlIcon", "BlInput", "BlProgressIndicator", "BlSelect", "BlTabGroup", "BlTooltip", "BlSelectOption", "BlTab", "BlTabPanel"]
|
|
7
7
|
}
|
package/dist/baklava.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as l}from"./chunk-
|
|
1
|
+
import{a as l}from"./chunk-U35464ML.js";import{a as d}from"./chunk-OJVJFWT3.js";import{a as n}from"./chunk-ECPBIHTM.js";import{a as m}from"./chunk-KWTSWXUL.js";import{a as s}from"./chunk-C5HFLPOK.js";import{a as f}from"./chunk-LZHSSAHO.js";import{a as p}from"./chunk-IDG5M2QP.js";import{a as u}from"./chunk-IAT752ME.js";import"./chunk-VNGNBBSS.js";import{a as B}from"./chunk-EELZVHM7.js";import{a as r}from"./chunk-6UWMQKJW.js";import{a}from"./chunk-IECHMCUY.js";import"./chunk-2TVOKUHE.js";import"./chunk-ENFFFE4I.js";import{a as x}from"./chunk-N6FF6F3Y.js";import"./chunk-KQBKSEYJ.js";import{a as t,b as o,c as e}from"./chunk-WXJKPVRA.js";import"./chunk-72IJCTLJ.js";import"./chunk-23UFIOHV.js";import"./chunk-HG7OBTQS.js";import"./chunk-NZ3RGSR6.js";export{B as BlAlert,r as BlBadge,a as BlButton,x as BlCheckbox,e as BlIcon,l as BlInput,d as BlProgressIndicator,n as BlSelect,m as BlSelectOption,f as BlTab,s as BlTabGroup,p as BlTabPanel,u as BlTooltip,o as getIconPath,t as setIconPath};
|
|
2
2
|
//# sourceMappingURL=baklava.js.map
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{a as o,b as i,f as a,g as l,h as r}from"./chunk-
|
|
1
|
+
import{a as o,b as i,f as a,g as l,h as r}from"./chunk-HG7OBTQS.js";import{a as t}from"./chunk-NZ3RGSR6.js";var c=o`:host{display:inline-block;max-width:100%}.badge{--bg-color:var(--bl-badge-bg-color,var(--bl-color-accent-primary-background));--color:var(--bl-badge-color,var(--bl-color-primary));--font:var(--bl-font-title-4-medium);--padding-vertical:var(--bl-size-3xs);--padding-horizontal:var(--bl-size-3xs);--margin-icon:var(--bl-size-3xs);--icon-size:var(--bl-size-s);--height:var(--bl-size-xl);display:flex;gap:var(--margin-icon);justify-content:center;align-items:center;box-sizing:border-box;width:100%;border:0;border-radius:var(--bl-size-4xs);margin:0;padding:var(--padding-vertical) var(--padding-horizontal);background-color:var(--bg-color);color:var(--color,white);font:var(--font);font-kerning:none;height:var(--height)}:host([size='small']) .badge{--font:var(--bl-font-caption-small-text);--height:var(--bl-size-m)}:host([size='large']) .badge{--font:var(--bl-font-title-3-medium);--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-2xs);--height:var(--bl-size-2xl);--icon-size:var(--bl-size-m)}:host ::slotted(bl-icon){font-size:var(--icon-size)}:host([size='small']) bl-icon{display:none}`,n=c;var e=class extends a{constructor(){super(...arguments);this.size="medium"}static get styles(){return[n]}render(){let s=this.icon?i`<bl-icon name=${this.icon}></bl-icon>`:"";return i`<span class="badge">
|
|
2
2
|
<slot name="icon">${s}</slot>
|
|
3
3
|
<slot></slot>
|
|
4
4
|
</span>`}};t([r({type:String,reflect:!0})],e.prototype,"size",2),t([r({type:String})],e.prototype,"icon",2),e=t([l("bl-badge")],e);export{e as a};
|
|
5
|
-
//# sourceMappingURL=chunk-
|
|
5
|
+
//# sourceMappingURL=chunk-6UWMQKJW.js.map
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as r,b as i,f as d,g as n}from"./chunk-
|
|
1
|
+
import{a as r,b as i,f as d,g as n}from"./chunk-HG7OBTQS.js";import{a as l}from"./chunk-NZ3RGSR6.js";var o=r`.tabs{background-color:var(--bl-color-primary-background);border-bottom:var(--bl-size-4xs) solid var(--bl-color-secondary-background);display:flex;flex-direction:row}.tabs-list{overflow-x:scroll;border-radius:var(--bl-border-radius-m) var(--bl-border-radius-m) 0 0}.panels{border-radius:0 0 var(--bl-border-radius-m) var(--bl-border-radius-m)}`,b=o;var s=class extends d{constructor(){super(...arguments);this._connectedTabs=[];this._connectedPanels=[]}static get styles(){return[b]}get tabs(){return this._connectedTabs}get panels(){return this._connectedPanels}registerTab(e){let t=this._connectedTabs.filter(a=>!a.disabled).length===0&&!e.disabled;this._connectedTabs.push(e),(!e.disabled&&e.selected||t)&&(this.selectedTabName=e.name)}unregisterTab(e){var t;this._connectedTabs.splice(this._connectedTabs.indexOf(e),1),e.selected&&((t=this._connectedTabs.find(a=>!a.disabled))==null||t.select())}registerTabPanel(e){e.visible=e.tab===this.selectedTabName,this._connectedPanels.push(e)}unregisterTabPanel(e){this._connectedTabs.splice(this._connectedPanels.indexOf(e),1)}get selectedTabName(){return this._selectedTabName}set selectedTabName(e){this._selectedTabName=e,this._connectedTabs.forEach(t=>{t.selected=e===t.name}),this._connectedPanels.forEach(t=>{t.visible=t.tab===this._selectedTabName})}_handleTabSelected(e){this.selectedTabName=e.detail}render(){return i` <div class="container" @bl-tab-selected="${this._handleTabSelected}">
|
|
2
2
|
<div role="tablist" class="tabs-list">
|
|
3
3
|
<div class="tabs">
|
|
4
4
|
<slot name="tabs"></slot>
|
|
@@ -8,4 +8,4 @@ import{a as r,b as i,f as d,g as n}from"./chunk-S7TTXZFP.js";import{a as l}from"
|
|
|
8
8
|
<slot></slot>
|
|
9
9
|
</div>
|
|
10
10
|
</div>`}};s=l([n("bl-tab-group")],s);export{s as a};
|
|
11
|
-
//# sourceMappingURL=chunk-
|
|
11
|
+
//# sourceMappingURL=chunk-C5HFLPOK.js.map
|
|
File without changes
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{b,c as f,e as m,f as _,g}from"./chunk-VNGNBBSS.js";import{a as u}from"./chunk-ENFFFE4I.js";import{a as h}from"./chunk-23UFIOHV.js";import{a as p,b as i,f as c,g as d,h as s,i as r,j as a,k as v}from"./chunk-HG7OBTQS.js";import{a as l}from"./chunk-NZ3RGSR6.js";var z=p`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--background-color:#fff;--border-color:var(--bl-color-border);--border-focus-color:var(--bl-color-primary-hover);--icon-color:var(--bl-color-content-tertiary);--text-color:var(--bl-color-content-primary);--label-color:var(--bl-color-content-secondary);--placeholder-color:var(--bl-color-content-tertiary);--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-tertiary);--z-index:1;--menu-height:250px}: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)}.placeholder{color:var(--placeholder-color)}:host([disabled]) .placeholder{--placeholder-color:var(--bl-color-content-passive)}.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-hover);--label-color:var(--bl-color-danger)}.select-input{display:flex;align-items:center;justify-content:space-between;cursor:pointer;outline:0;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 var(--padding-horizontal);border-radius:var(--bl-border-radius-s);color:var(--text-color);user-select:none}.remove-all{display:none}.remove-all::after{content:'';position:absolute;left:1.5rem;bottom:4px;height:1rem;border-left:1px solid var(--bl-color-border)}.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)}.selected .dropdown-icon{--icon-color:var(--bl-color-secondary)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-content-passive)}.select-open .select-input{border:solid 1px var(--border-focus-color)}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;margin:0;list-style:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}.selected-options li:not(:last-child)::after{content:', '}:host([disabled]) .selected-options li{color:var(--bl-color-content-passive)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-2xs);margin-left:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:fixed;border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--z-index);width:100%;top:var(--top);left:var(--left)}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}label{position:absolute;display:flex;align-items:center;top:var(--padding-vertical);left:var(--padding-horizontal);transition:all ease-in .2s;pointer-events:none;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color);padding:0}:where(.select-open,.selected) label{top:0;left:var(--bl-size-2xs);transform:translateY(-50%);font:var(--bl-font-form-label);color:var(--label-color);padding:0 var(--bl-size-3xs);background-color:var(--bl-color-primary-background);pointer-events:initial}:host([label-fixed]) .select-wrapper{padding-top:var(--bl-size-m)}:host([label-fixed]) label{top:0;left:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-form-label);color:var(--label-color);padding:0}.help-text,.invalid-text{margin:var(--bl-size-3xs) 0 0 var(--bl-size-2xs);font:var(--bl-font-title-4-regular);padding:var(--bl-size-3xs) var(--bl-input-padding-horizontal)}.help-text{color:var(--bl-color-content-secondary)}.invalid-text{color:var(--bl-color-danger)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}`,x=z;var o=class extends c{constructor(){super(...arguments);this.size="medium";this.required=!1;this.disabled=!1;this.multiple=!1;this.labelFixed=!1;this._isPopoverOpen=!1;this._selectedOptions=[];this._additionalSelectedOptionCount=0;this._isInvalid=!1;this._connectedOptions=[];this._cleanUpPopover=null;this._clickOutsideHandler=e=>{let t=e.target;!this.contains(t)&&this._isPopoverOpen&&(this.close(),this._checkRequired())}}static get styles(){return[x]}get options(){return this._connectedOptions}get isPopoverOpen(){return this._isPopoverOpen}get selectedOptions(){return this._selectedOptions}get additionalSelectedOptionCount(){return this._additionalSelectedOptionCount}get isInvalid(){return this._isInvalid}open(){this._isPopoverOpen=!0,this._setupPopover()}close(){this._isPopoverOpen=!1,this._cleanUpPopover&&this._cleanUpPopover()}_setupPopover(){this._cleanUpPopover=_(this._selectInput,this._popover,()=>{g(this._selectInput,this._popover,{placement:"bottom",strategy:"fixed",middleware:[b(),f(8),m({apply(e){Object.assign(e.elements.floating.style,{width:`${e.elements.reference.getBoundingClientRect().width}px`})}})]}).then(({x:e,y:t})=>{this._popover.style.setProperty("--left",`${e}px`),this._popover.style.setProperty("--top",`${t}px`)})})}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this._clickOutsideHandler)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this._clickOutsideHandler),this._cleanUpPopover&&this._cleanUpPopover()}inputTemplate(){let e=i`<ul class="selected-options">
|
|
2
|
+
${this._selectedOptions.map(y=>i`<li>${y.text}</li>`)}
|
|
3
|
+
</ul>`,t=this._additionalSelectedOptionCount?i`<span>+${this._additionalSelectedOptionCount}</span>`:null,n=i`<bl-button
|
|
4
|
+
class="remove-all"
|
|
5
|
+
variant="secondary"
|
|
6
|
+
size="small"
|
|
7
|
+
kind="text"
|
|
8
|
+
icon="close"
|
|
9
|
+
@click=${this._onClickRemove}></bl-button>`,O=this._showPlaceHolder?i`<span class="placeholder">${this.placeholder}</span>`:"";return i`<div
|
|
10
|
+
class="select-input"
|
|
11
|
+
?disabled=${this.disabled}
|
|
12
|
+
@click=${this._onClickSelectInput}
|
|
13
|
+
>
|
|
14
|
+
${O} ${e} ${t}
|
|
15
|
+
<div class="actions">
|
|
16
|
+
${n}
|
|
17
|
+
<bl-icon
|
|
18
|
+
class="dropdown-icon"
|
|
19
|
+
name="${this._isPopoverOpen?"arrow_up":"arrow_down"}"
|
|
20
|
+
></bl-icon>
|
|
21
|
+
</div>
|
|
22
|
+
</div>`}menuTemplate(){return i`<div class="popover" @bl-select-option=${this._handleSelectOptionEvent}>
|
|
23
|
+
<slot></slot>
|
|
24
|
+
</div>`}render(){let e=this._isInvalid&&this.customInvalidText?i`<p class="invalid-text">${this.customInvalidText}</p>`:"",t=this.helpText&&!e?i`<p class="help-text">${this.helpText}</p>`:"",n=this.label?i`<label>${this.label}</label>`:"";return i`<div
|
|
25
|
+
class=${u({"select-wrapper":!0,"select-open":this._isPopoverOpen,selected:this._selectedOptions.length>0,invalid:this._isInvalid})}
|
|
26
|
+
tabindex="-1"
|
|
27
|
+
>
|
|
28
|
+
${n} ${this.inputTemplate()} ${this.menuTemplate()} ${t} ${e}
|
|
29
|
+
</div> `}get _showPlaceHolder(){return this.label&&!this.labelFixed?!this._selectedOptions.length&&this._isPopoverOpen:!this._selectedOptions.length}_onClickSelectInput(){this._isPopoverOpen?this.close():this.open()}_handleSelectEvent(){this._onBlSelect(this._selectedOptions)}_handleSingleSelect(e){let t=this._connectedOptions.find(n=>n.selected);t&&(t.selected=!1),this._selectedOptions=[e],this._handleSelectEvent(),this._isPopoverOpen=!1}_handleMultipleSelect(e){let{value:t}=e;e.selected?this._selectedOptions=[...this._selectedOptions,e]:this._selectedOptions=this._selectedOptions.filter(n=>n.value!==t),this._handleSelectEvent()}_handleSelectOptionEvent(e){let t=e.detail;this.multiple?this._handleMultipleSelect(t):this._handleSingleSelect(t)}_onClickRemove(e){e.stopPropagation(),this._connectedOptions.filter(t=>t.selected).forEach(t=>{t.selected=!1}),this._selectedOptions=[],this._handleSelectEvent()}_checkAdditionalItemCount(){if(!this.multiple)return;let e=0;for(let t of this._selectedOptionsItems)if(t.offsetLeft<this._selectedOptionsContainer.offsetWidth)e++;else break;this._additionalSelectedOptionCount=this._selectedOptionsItems.length-e}_checkRequired(){this.required&&(this._isInvalid=this._selectedOptions.length===0)}updated(e){e.has("_selectedOptions")&&e.get("_selectedOptions")instanceof Array?(this._checkRequired(),this._checkAdditionalItemCount()):e.has("multiple")&&typeof e.get("multiple")=="boolean"&&(this._connectedOptions.forEach(t=>{t.multiple=this.multiple,t.selected=!1}),this._selectedOptions=[])}registerOption(e){if(this._connectedOptions.push(e),e.selected){let t={value:e.value,text:e.textContent,selected:e.selected};this.multiple?this._selectedOptions=[...this._selectedOptions,t]:this._selectedOptions=[t],this.requestUpdate()}}unregisterOption(e){this._connectedOptions.splice(this._connectedOptions.indexOf(e),1),this._selectedOptions=this._selectedOptions.filter(t=>t.value!==e.value)}};l([s({})],o.prototype,"label",2),l([s({})],o.prototype,"placeholder",2),l([s({type:String,reflect:!0})],o.prototype,"size",2),l([s({type:Boolean})],o.prototype,"required",2),l([s({type:Boolean})],o.prototype,"disabled",2),l([s({type:Boolean})],o.prototype,"multiple",2),l([s({type:Boolean,attribute:"label-fixed"})],o.prototype,"labelFixed",2),l([s({type:String,attribute:"help-text"})],o.prototype,"helpText",2),l([s({type:String,attribute:"invalid-text"})],o.prototype,"customInvalidText",2),l([r()],o.prototype,"_isPopoverOpen",2),l([r()],o.prototype,"_selectedOptions",2),l([r()],o.prototype,"_additionalSelectedOptionCount",2),l([r()],o.prototype,"_isInvalid",2),l([a(".selected-options")],o.prototype,"_selectedOptionsContainer",2),l([v(".selected-options li")],o.prototype,"_selectedOptionsItems",2),l([a(".popover")],o.prototype,"_popover",2),l([a(".select-input")],o.prototype,"_selectInput",2),l([h("bl-select")],o.prototype,"_onBlSelect",2),o=l([d("bl-select")],o);export{o as a};
|
|
30
|
+
//# sourceMappingURL=chunk-ECPBIHTM.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/components/select/bl-select.css", "../src/components/select/bl-select.ts"],
|
|
4
|
+
"sourcesContent": ["import {css} from 'lit';\nexport const styles = css`:host{width:200px;display:inline-block}.select-wrapper{width:100%;position:relative;--padding-vertical:var(--bl-size-2xs);--padding-horizontal:var(--bl-size-xs);--background-color:#fff;--border-color:var(--bl-color-border);--border-focus-color:var(--bl-color-primary-hover);--icon-color:var(--bl-color-content-tertiary);--text-color:var(--bl-color-content-primary);--label-color:var(--bl-color-content-secondary);--placeholder-color:var(--bl-color-content-tertiary);--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-tertiary);--z-index:1;--menu-height:250px}: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)}.placeholder{color:var(--placeholder-color)}:host([disabled]) .placeholder{--placeholder-color:var(--bl-color-content-passive)}.invalid{--border-color:var(--bl-color-danger);--border-focus-color:var(--bl-color-danger-hover);--label-color:var(--bl-color-danger)}.select-input{display:flex;align-items:center;justify-content:space-between;cursor:pointer;outline:0;box-sizing:border-box;height:var(--height);border:solid 1px var(--border-color);font:var(--bl-font-title-3-regular);padding:0 var(--padding-horizontal);border-radius:var(--bl-border-radius-s);color:var(--text-color);user-select:none}.remove-all{display:none}.remove-all::after{content:'';position:absolute;left:1.5rem;bottom:4px;height:1rem;border-left:1px solid var(--bl-color-border)}.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)}.selected .dropdown-icon{--icon-color:var(--bl-color-secondary)}:host([disabled]) .dropdown-icon{--icon-color:var(--bl-color-content-passive)}.select-open .select-input{border:solid 1px var(--border-focus-color)}:host([disabled]){cursor:not-allowed}:host([disabled]) .select-input{pointer-events:none;background-color:var(--disabled-color)}.select-input .selected-options{padding:0;margin:0;list-style:none;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.selected-options li{display:inline;font-size:var(--font-size);color:var(--text-color)}.selected-options li:not(:last-child)::after{content:', '}:host([disabled]) .selected-options li{color:var(--bl-color-content-passive)}.select-input .actions{display:flex;align-items:center;justify-content:center;gap:var(--bl-size-2xs);margin-left:var(--bl-size-2xs)}.popover{--left:0;--top:0;position:fixed;border:solid 1px var(--border-color);background-color:var(--background-color);font:var(--bl-font-title-3-regular);border-radius:var(--bl-border-radius-s);padding:var(--menu-padding);outline:0;box-sizing:border-box;max-height:var(--menu-height);overflow-y:auto;display:none;flex-direction:column;z-index:var(--z-index);width:100%;top:var(--top);left:var(--left)}.select-open .popover{display:flex;border:solid 1px var(--border-focus-color)}bl-icon{color:var(--icon-color)}label{position:absolute;display:flex;align-items:center;top:var(--padding-vertical);left:var(--padding-horizontal);transition:all ease-in .2s;pointer-events:none;font:var(--bl-font-title-3-regular);font-size:var(--font-size);color:var(--placeholder-color);padding:0}:where(.select-open,.selected) label{top:0;left:var(--bl-size-2xs);transform:translateY(-50%);font:var(--bl-font-form-label);color:var(--label-color);padding:0 var(--bl-size-3xs);background-color:var(--bl-color-primary-background);pointer-events:initial}:host([label-fixed]) .select-wrapper{padding-top:var(--bl-size-m)}:host([label-fixed]) label{top:0;left:0;transition:none;transform:none;pointer-events:initial;font:var(--bl-font-form-label);color:var(--label-color);padding:0}.help-text,.invalid-text{margin:var(--bl-size-3xs) 0 0 var(--bl-size-2xs);font:var(--bl-font-title-4-regular);padding:var(--bl-size-3xs) var(--bl-input-padding-horizontal)}.help-text{color:var(--bl-color-content-secondary)}.invalid-text{color:var(--bl-color-danger)}.select-open .help-text,.select-open .invalid-text{visibility:hidden}`;\nexport default styles;\n", "import { LitElement, html, CSSResultGroup, PropertyValues } from 'lit';\nimport { customElement, property, state, query, queryAll } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { computePosition, flip, MiddlewareArguments, offset, size, autoUpdate } from '@floating-ui/dom';\nimport style from '../select/bl-select.css';\nimport '../icon/bl-icon';\nimport '../select/option/bl-select-option';\nimport type BlSelectOption from './option/bl-select-option';\nimport { event, EventDispatcher } from '../../utilities/event';\n\nexport interface ISelectOption {\n value: string;\n text: string;\n selected: boolean;\n}\n\nexport type SelectSize = 'medium' | 'large' | 'small';\n\nexport type CleanUpFunction = () => void;\n\n@customElement('bl-select')\nexport default class BlSelect extends LitElement {\n static get styles(): CSSResultGroup {\n return [style];\n }\n\n /* Declare reactive properties */\n /**\n * Sets the label value\n */\n @property({})\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({})\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 })\n required = false;\n\n /**\n * Shows the component in disabled state.\n */\n @property({ type: Boolean })\n disabled = false;\n\n /**\n * Allows multiple options to be selected\n */\n @property({ type: Boolean })\n multiple = false;\n\n /**\n * Makes label as fixed positioned\n */\n @property({ type: Boolean, attribute: 'label-fixed' })\n labelFixed = false;\n\n /**\n * Adds help text\n */\n @property({ type: String, attribute: 'help-text' })\n helpText?: string;\n\n /**\n * Set custom error message\n */\n @property({ type: String, attribute: 'invalid-text' })\n customInvalidText?: string;\n\n /* Declare internal reactive properties */\n @state()\n private _isPopoverOpen = false;\n\n @state()\n private _selectedOptions: ISelectOption[] = [];\n\n @state()\n private _additionalSelectedOptionCount = 0;\n\n @state()\n private _isInvalid = false;\n\n @query('.selected-options')\n private _selectedOptionsContainer!: HTMLElement;\n\n @queryAll('.selected-options li')\n private _selectedOptionsItems!: Array<HTMLElement>;\n\n @query('.popover')\n private _popover: HTMLElement;\n\n @query('.select-input')\n private _selectInput: HTMLElement;\n\n @event('bl-select') private _onBlSelect: EventDispatcher<ISelectOption[]>;\n\n private _connectedOptions: BlSelectOption[] = [];\n\n private _cleanUpPopover: CleanUpFunction | null = null;\n\n get options() {\n return this._connectedOptions;\n }\n\n get isPopoverOpen() {\n return this._isPopoverOpen;\n }\n\n get selectedOptions() {\n return this._selectedOptions;\n }\n\n get additionalSelectedOptionCount() {\n return this._additionalSelectedOptionCount;\n }\n\n get isInvalid() {\n return this._isInvalid;\n }\n\n open() {\n this._isPopoverOpen = true;\n this._setupPopover();\n }\n\n close() {\n this._isPopoverOpen = false;\n this._cleanUpPopover && this._cleanUpPopover();\n }\n\n private _clickOutsideHandler = (event: MouseEvent) => {\n const target = event.target as HTMLElement;\n\n if (!this.contains(target) && this._isPopoverOpen) {\n this.close();\n this._checkRequired();\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: MiddlewareArguments) {\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() {\n super.connectedCallback();\n\n document.addEventListener('click', this._clickOutsideHandler);\n }\n disconnectedCallback() {\n super.disconnectedCallback();\n\n document.removeEventListener('click', this._clickOutsideHandler);\n this._cleanUpPopover && this._cleanUpPopover();\n }\n\n private inputTemplate() {\n const inputSelectedOptions = html`<ul class=\"selected-options\">\n ${this._selectedOptions.map(item => html`<li>${item.text}</li>`)}\n </ul>`;\n const _selectedItemCount = this._additionalSelectedOptionCount\n ? html`<span>+${this._additionalSelectedOptionCount}</span>`\n : null;\n const removeButton = html`<bl-button\n class=\"remove-all\"\n variant=\"secondary\"\n size=\"small\"\n kind=\"text\"\n icon=\"close\"\n @click=${this._onClickRemove}></bl-button>`;\n const placeholder = this._showPlaceHolder\n ? html`<span class=\"placeholder\">${this.placeholder}</span>`\n : '';\n\n return html`<div\n class=\"select-input\"\n ?disabled=${this.disabled}\n @click=${this._onClickSelectInput}\n >\n ${placeholder} ${inputSelectedOptions} ${_selectedItemCount}\n <div class=\"actions\">\n ${removeButton}\n <bl-icon\n class=\"dropdown-icon\"\n name=\"${this._isPopoverOpen ? 'arrow_up' : 'arrow_down'}\"\n ></bl-icon>\n </div>\n </div>`;\n }\n\n private menuTemplate() {\n return html`<div class=\"popover\" @bl-select-option=${this._handleSelectOptionEvent}>\n <slot></slot>\n </div>`;\n }\n\n render() {\n const invalidMessage = this._isInvalid && this.customInvalidText\n ? html`<p class=\"invalid-text\">${this.customInvalidText}</p>` : ``;\n const helpMessage = this.helpText && !invalidMessage\n ? html`<p class=\"help-text\">${this.helpText}</p>` : ``;\n const label = this.label\n ? html`<label>${this.label}</label>` : '';\n\n return html`<div\n class=${classMap({\n 'select-wrapper': true,\n 'select-open': this._isPopoverOpen,\n 'selected': this._selectedOptions.length > 0,\n 'invalid': this._isInvalid,\n })}\n tabindex=\"-1\"\n >\n ${label} ${this.inputTemplate()} ${this.menuTemplate()} ${helpMessage} ${invalidMessage}\n </div> `;\n }\n\n private get _showPlaceHolder() {\n if (this.label && !this.labelFixed) {\n return !this._selectedOptions.length && this._isPopoverOpen;\n }\n return !this._selectedOptions.length;\n }\n\n private _onClickSelectInput() {\n this._isPopoverOpen ? this.close() : this.open();\n }\n\n private _handleSelectEvent() {\n this._onBlSelect(this._selectedOptions);\n }\n\n private _handleSingleSelect(optionItem: ISelectOption) {\n const oldItem = this._connectedOptions.find(option => option.selected);\n\n if (oldItem) {\n oldItem.selected = false;\n }\n\n this._selectedOptions = [optionItem];\n this._handleSelectEvent();\n this._isPopoverOpen = false;\n }\n\n private _handleMultipleSelect(optionItem: ISelectOption) {\n const { value } = optionItem;\n\n if (!optionItem.selected) {\n this._selectedOptions = this._selectedOptions.filter(item => item.value !== value);\n } else {\n this._selectedOptions = [...this._selectedOptions, optionItem];\n }\n\n this._handleSelectEvent();\n }\n\n private _handleSelectOptionEvent(e: CustomEvent) {\n const optionItem = e.detail as ISelectOption;\n\n if (this.multiple) {\n this._handleMultipleSelect(optionItem);\n } else {\n this._handleSingleSelect(optionItem);\n }\n }\n\n private _onClickRemove(e: MouseEvent) {\n e.stopPropagation();\n\n this._connectedOptions\n .filter(option => option.selected)\n .forEach(option => {\n option.selected = false;\n });\n\n this._selectedOptions = [];\n this._handleSelectEvent();\n }\n\n private _checkAdditionalItemCount() {\n if (!this.multiple) return;\n\n let visibleItems = 0;\n for(const value of this._selectedOptionsItems) {\n if (value.offsetLeft < this._selectedOptionsContainer.offsetWidth) {\n visibleItems++;\n } else {\n break;\n }\n }\n\n this._additionalSelectedOptionCount = this._selectedOptionsItems.length - visibleItems;\n }\n\n private _checkRequired() {\n if (this.required) {\n this._isInvalid = this._selectedOptions.length === 0;\n }\n }\n\n protected updated(_changedProperties: PropertyValues) {\n if (\n _changedProperties.has('_selectedOptions') &&\n _changedProperties.get('_selectedOptions') instanceof Array\n ) {\n this._checkRequired();\n this._checkAdditionalItemCount();\n } else if (\n _changedProperties.has('multiple') &&\n typeof _changedProperties.get('multiple') === 'boolean'\n ) {\n this._connectedOptions.forEach(option => {\n option.multiple = this.multiple;\n option.selected = false;\n });\n this._selectedOptions = [];\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) {\n this._connectedOptions.push(option);\n\n if (option.selected) {\n const optionItem = {\n value: option.value,\n text: option.textContent,\n selected: option.selected,\n } as ISelectOption;\n\n if (this.multiple) {\n this._selectedOptions = [...this._selectedOptions, optionItem];\n } else {\n this._selectedOptions = [optionItem];\n }\n\n this.requestUpdate();\n }\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) {\n this._connectedOptions.splice(this._connectedOptions.indexOf(option), 1);\n this._selectedOptions = this._selectedOptions.filter(item => item.value !== option.value);\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'bl-select': BlSelect;\n }\n}\n"],
|
|
5
|
+
"mappings": "2QACO,IAAMA,EAASC,6tIACfC,EAAQF,ECmBf,IAAqBG,EAArB,cAAsCC,CAAW,CAAjD,kCAsBE,UAAmB,SAMnB,cAAW,GAMX,cAAW,GAMX,cAAW,GAMX,gBAAa,GAgBb,KAAQ,eAAiB,GAGzB,KAAQ,iBAAoC,CAAC,EAG7C,KAAQ,+BAAiC,EAGzC,KAAQ,WAAa,GAgBrB,KAAQ,kBAAsC,CAAC,EAE/C,KAAQ,gBAA0C,KAgClD,KAAQ,qBAAwBC,GAAsB,CACpD,IAAMC,EAASD,EAAM,OAEjB,CAAC,KAAK,SAASC,CAAM,GAAK,KAAK,iBACjC,KAAK,MAAM,EACX,KAAK,eAAe,EAExB,EA/HA,WAAW,QAAyB,CAClC,MAAO,CAACC,CAAK,CACf,CAwFA,IAAI,SAAU,CACZ,OAAO,KAAK,iBACd,CAEA,IAAI,eAAgB,CAClB,OAAO,KAAK,cACd,CAEA,IAAI,iBAAkB,CACpB,OAAO,KAAK,gBACd,CAEA,IAAI,+BAAgC,CAClC,OAAO,KAAK,8BACd,CAEA,IAAI,WAAY,CACd,OAAO,KAAK,UACd,CAEA,MAAO,CACL,KAAK,eAAiB,GACtB,KAAK,cAAc,CACrB,CAEA,OAAQ,CACN,KAAK,eAAiB,GACtB,KAAK,iBAAmB,KAAK,gBAAgB,CAC/C,CAWQ,eAAgB,CACtB,KAAK,gBAAkBC,EAAW,KAAK,aAAc,KAAK,SAAU,IAAM,CACxEC,EAAgB,KAAK,aAAc,KAAK,SAAU,CAChD,UAAW,SACX,SAAU,QACV,WAAY,CACV,EAAK,E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CAAC,GArBtB7B,EAsBnB,oBAMA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,CAAC,GA3BR7B,EA4BnB,wBAMA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,CAAC,GAjCR7B,EAkCnB,wBAMA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,CAAC,GAvCR7B,EAwCnB,wBAMA4B,EAAA,CADCC,EAAS,CAAE,KAAM,QAAS,UAAW,aAAc,CAAC,GA7ClC7B,EA8CnB,0BAMA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,WAAY,CAAC,GAnD/B7B,EAoDnB,wBAMA4B,EAAA,CADCC,EAAS,CAAE,KAAM,OAAQ,UAAW,cAAe,CAAC,GAzDlC7B,EA0DnB,iCAIQ4B,EAAA,CADPE,EAAM,GA7DY9B,EA8DX,8BAGA4B,EAAA,CADPE,EAAM,GAhEY9B,EAiEX,gCAGA4B,EAAA,CADPE,EAAM,GAnEY9B,EAoEX,8CAGA4B,EAAA,CADPE,EAAM,GAtEY9B,EAuEX,0BAGA4B,EAAA,CADPG,EAAM,mBAAmB,GAzEP/B,EA0EX,yCAGA4B,EAAA,CADPC,EAAS,sBAAsB,GA5Eb7B,EA6EX,qCAGA4B,EAAA,CADPG,EAAM,UAAU,GA/EE/B,EAgFX,wBAGA4B,EAAA,CADPG,EAAM,eAAe,GAlFH/B,EAmFX,4BAEoB4B,EAAA,CAA3B1B,EAAM,WAAW,GArFCF,EAqFS,2BArFTA,EAArB4B,EAAA,CADCI,EAAc,WAAW,GACLhC",
|
|
6
|
+
"names": ["styles", "r", "bl_select_default", "BlSelect", "s", "event", "target", "bl_select_default", "N", "z", "T", "k", "args", "x", "y", "inputSelectedOptions", "$", "item", "_selectedItemCount", "removeButton", "placeholder", "invalidMessage", "helpMessage", "label", "o", "optionItem", "oldItem", "option", "value", "visibleItems", "_changedProperties", "__decorateClass", "e", "t", "i", "n"]
|
|
7
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as b}from"./chunk-
|
|
1
|
+
import{a as b}from"./chunk-2TVOKUHE.js";import{a as m}from"./chunk-ENFFFE4I.js";import{a as u}from"./chunk-23UFIOHV.js";import{a as c,b as n,f as p,g as d,h as r}from"./chunk-HG7OBTQS.js";import{a as o}from"./chunk-NZ3RGSR6.js";var h=c`:host{display:block}.alert{--padding:var(--bl-size-m);--main-color:var(--bl-color-primary);--main-bg-color:var(--bl-color-accent-primary-background);position:relative;display:flex;align-items:flex-start;justify-content:space-between;background-color:var(--main-bg-color);color:var(--bl-color-content-primary);box-shadow:0 0 0 1px var(--main-color);border-radius:var(--bl-border-radius-s);padding:calc(var(--padding) / 2) var(--padding)}.description{font:var(--bl-font-title-3-regular)}.wrapper{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;flex:auto}.content{display:flex;align-items:center;padding:calc(var(--padding) / 2) 0;margin-right:var(--bl-size-2xs);flex:20 1 70%}.icon{margin-right:var(--bl-size-2xs);color:var(--main-color)}.text-content{display:flex;flex-direction:column}.caption{color:var(--main-color);font:var(--bl-font-title-3-medium);margin-bottom:var(--bl-size-4xs)}.action{display:flex;align-items:center;flex:1 1 0%}.caption+.description{font:var(--bl-font-caption-text)}.close-spaced{margin-top:calc(var(--padding) / 2)}:host([closed]){display:none}:host([variant='success']) .alert{--main-color:var(--bl-color-success);--main-bg-color:var(--bl-color-success-background)}:host([variant='warning']) .alert{--main-color:var(--bl-color-warning);--main-bg-color:var(--bl-color-warning-background)}:host([variant='danger']) .alert{--main-color:var(--bl-color-danger);--main-bg-color:var(--bl-color-danger-background)}`,f=h;var g=()=>({fromAttribute:a=>!a||a==="true"?!0:a==="false"?!1:a});var t=class extends p{constructor(){super(...arguments);this.variant="info";this.closable=!1;this.closed=!1}static get styles(){return[f]}open(){this.closed=!1}close(){this.closed=!0}get _hasAlertCaptionSlot(){return this.querySelector(':scope > [slot="caption"]')!==null}_closeHandler(){this.closed=!0,this.onClose(!0)}_predefinedIcons(){switch(this.variant){case"success":return"check_fill";case"danger":return"close_fill";default:return this.variant}}_getIcon(){if(!!this.icon)return this.icon===!0?this._predefinedIcons():this.icon}_initAlertActionSlot(i){i.target.assignedElements().forEach(e=>{var s;if(e.tagName!=="BL-BUTTON"){(s=e.parentNode)==null||s.removeChild(e);return}e.setAttribute("variant","secondary"),e.setAttribute("kind","text"),e.setAttribute("size","medium"),e.removeAttribute("icon")})}render(){let i=this.caption||this._hasAlertCaptionSlot?n`<span class="caption">
|
|
2
2
|
<slot name="caption"> ${this.caption} </slot>
|
|
3
3
|
</span>`:null,l=this._getIcon()?n`<bl-icon class="icon" name=${b(this._getIcon())}></bl-icon>`:null,e=m({close:!0,"close-spaced":!!i}),s=this.closable?n`<bl-button
|
|
4
4
|
class=${e}
|
|
@@ -21,4 +21,4 @@ import{a as b}from"./chunk-E2DT737L.js";import{a as m}from"./chunk-W53DEGK2.js";
|
|
|
21
21
|
${s}
|
|
22
22
|
</div>
|
|
23
23
|
`}};o([r({reflect:!0})],t.prototype,"variant",2),o([r()],t.prototype,"description",2),o([r({converter:g()})],t.prototype,"icon",2),o([r({type:Boolean,reflect:!0})],t.prototype,"closable",2),o([r()],t.prototype,"caption",2),o([r({type:Boolean,reflect:!0})],t.prototype,"closed",2),o([u("bl-close")],t.prototype,"onClose",2),t=o([d("bl-alert")],t);export{t as a};
|
|
24
|
-
//# sourceMappingURL=chunk-
|
|
24
|
+
//# sourceMappingURL=chunk-EELZVHM7.js.map
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{a as d,b as h,c as l}from"./chunk-72IJCTLJ.js";import{c as a}from"./chunk-
|
|
1
|
+
import{a as d,b as h,c as l}from"./chunk-72IJCTLJ.js";import{c as a}from"./chunk-HG7OBTQS.js";var u=h(class extends l{constructor(s){var e;if(super(s),s.type!==d.ATTRIBUTE||s.name!=="class"||((e=s.strings)===null||e===void 0?void 0:e.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(e=>s[e]).join(" ")+" "}update(s,[e]){var i,r;if(this.et===void 0){this.et=new Set,s.strings!==void 0&&(this.st=new Set(s.strings.join(" ").split(/\s/).filter(t=>t!=="")));for(let t in e)e[t]&&!(!((i=this.st)===null||i===void 0)&&i.has(t))&&this.et.add(t);return this.render(e)}let n=s.element.classList;this.et.forEach(t=>{t in e||(n.remove(t),this.et.delete(t))});for(let t in e){let o=!!e[t];o===this.et.has(t)||((r=this.st)===null||r===void 0?void 0:r.has(t))||(o?(n.add(t),this.et.add(t)):(n.remove(t),this.et.delete(t)))}return a}});export{u as a};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2018 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
6
|
*/
|
|
7
|
-
//# sourceMappingURL=chunk-
|
|
7
|
+
//# sourceMappingURL=chunk-ENFFFE4I.js.map
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var D,C=globalThis.trustedTypes,Q=C?C.createPolicy("lit-html",{createHTML:o=>o}):void 0,$=`lit$${(Math.random()+"").slice(9)}$`,j="?"+$,ft=`<${j}>`,w=document,U=(o="")=>w.createComment(o),T=o=>o===null||typeof o!="object"&&typeof o!="function",ot=Array.isArray,rt=o=>{var t;return ot(o)||typeof((t=o)===null||t===void 0?void 0:t[Symbol.iterator])=="function"},P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,X=/-->/g,Y=/>/g,y=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,tt=/'/g,et=/"/g,nt=/^(?:script|style|textarea|title)$/i,lt=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),St=lt(1),Et=lt(2),_=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),it=new WeakMap,at=(o,t,e)=>{var i,s;let r=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:t,n=r._$litPart$;if(n===void 0){let h=(s=e==null?void 0:e.renderBefore)!==null&&s!==void 0?s:null;r._$litPart$=n=new f(t.insertBefore(U(),h),h,void 0,e!=null?e:{})}return n._$AI(o),n},b=w.createTreeWalker(w,129,null,!1),ht=(o,t)=>{let e=o.length-1,i=[],s,r=t===2?"<svg>":"",n=P;for(let l=0;l<e;l++){let a=o[l],p,d,c=-1,v=0;for(;v<a.length&&(n.lastIndex=v,d=n.exec(a),d!==null);)v=n.lastIndex,n===P?d[1]==="!--"?n=X:d[1]!==void 0?n=Y:d[2]!==void 0?(nt.test(d[2])&&(s=RegExp("</"+d[2],"g")),n=y):d[3]!==void 0&&(n=y):n===y?d[0]===">"?(n=s!=null?s:P,c=-1):d[1]===void 0?c=-2:(c=n.lastIndex-d[2].length,p=d[1],n=d[3]===void 0?y:d[3]==='"'?et:tt):n===et||n===tt?n=y:n===X||n===Y?n=P:(n=y,s=void 0);let H=n===y&&o[l+1].startsWith("/>")?" ":"";r+=n===P?a+ft:c>=0?(i.push(p),a.slice(0,c)+"$lit$"+a.slice(c)+$+H):a+$+(c===-2?(i.push(void 0),l):H)}let h=r+(o[e]||"<?>")+(t===2?"</svg>":"");if(!Array.isArray(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return[Q!==void 0?Q.createHTML(h):h,i]},g=class{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,n=0,h=t.length-1,l=this.parts,[a,p]=ht(t,e);if(this.el=g.createElement(a,i),b.currentNode=this.el.content,e===2){let d=this.el.content,c=d.firstChild;c.remove(),d.append(...c.childNodes)}for(;(s=b.nextNode())!==null&&l.length<h;){if(s.nodeType===1){if(s.hasAttributes()){let d=[];for(let c of s.getAttributeNames())if(c.endsWith("$lit$")||c.startsWith($)){let v=p[n++];if(d.push(c),v!==void 0){let H=s.getAttribute(v.toLowerCase()+"$lit$").split($),N=/([.?@])?(.*)/.exec(v);l.push({type:1,index:r,name:N[2],strings:H,ctor:N[1]==="."?O:N[1]==="?"?M:N[1]==="@"?L:S})}else l.push({type:6,index:r})}for(let c of d)s.removeAttribute(c)}if(nt.test(s.tagName)){let d=s.textContent.split($),c=d.length-1;if(c>0){s.textContent=C?C.emptyScript:"";for(let v=0;v<c;v++)s.append(d[v],U()),b.nextNode(),l.push({type:2,index:++r});s.append(d[c],U())}}}else if(s.nodeType===8)if(s.data===j)l.push({type:2,index:r});else{let d=-1;for(;(d=s.data.indexOf($,d+1))!==-1;)l.push({type:7,index:r}),d+=$.length-1}r++}}static createElement(t,e){let i=w.createElement("template");return i.innerHTML=t,i}};function A(o,t,e=o,i){var s,r,n,h;if(t===_)return t;let l=i!==void 0?(s=e._$Cl)===null||s===void 0?void 0:s[i]:e._$Cu,a=T(t)?void 0:t._$litDirective$;return(l==null?void 0:l.constructor)!==a&&((r=l==null?void 0:l._$AO)===null||r===void 0||r.call(l,!1),a===void 0?l=void 0:(l=new a(o),l._$AT(o,e,i)),i!==void 0?((n=(h=e)._$Cl)!==null&&n!==void 0?n:h._$Cl=[])[i]=l:e._$Cu=l),l!==void 0&&(t=A(o,l._$AS(o,t.values),l,i)),t}var k=class{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;let{el:{content:i},parts:s}=this._$AD,r=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:w).importNode(i,!0);b.currentNode=r;let n=b.nextNode(),h=0,l=0,a=s[0];for(;a!==void 0;){if(h===a.index){let p;a.type===2?p=new f(n,n.nextSibling,this,t):a.type===1?p=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(p=new z(n,this,t)),this.v.push(p),a=s[++l]}h!==(a==null?void 0:a.index)&&(n=b.nextNode(),h++)}return r}m(t){let e=0;for(let i of this.v)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},f=class{constructor(t,e,i,s){var r;this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cg=(r=s==null?void 0:s.isConnected)===null||r===void 0||r}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=A(this,t,e),T(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==_&&this.$(t):t._$litType$!==void 0?this.T(t):t.nodeType!==void 0?this.k(t):rt(t)?this.S(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==u&&T(this._$AH)?this._$AA.nextSibling.data=t:this.k(w.createTextNode(t)),this._$AH=t}T(t){var e;let{values:i,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=g.createElement(s.h,this.options)),s);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===r)this._$AH.m(i);else{let n=new k(r,this),h=n.p(this.options);n.m(i),this.k(h),this._$AH=n}}_$AC(t){let e=it.get(t.strings);return e===void 0&&it.set(t.strings,e=new g(t)),e}S(t){ot(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,s=0;for(let r of t)s===e.length?e.push(i=new f(this.A(U()),this.A(U()),this,this.options)):i=e[s],i._$AI(r),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cg=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}},S=class{constructor(t,e,i,s,r){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=u}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){let r=this.strings,n=!1;if(r===void 0)t=A(this,t,e,0),n=!T(t)||t!==this._$AH&&t!==_,n&&(this._$AH=t);else{let h=t,l,a;for(t=r[0],l=0;l<r.length-1;l++)a=A(this,h[i+l],e,l),a===_&&(a=this._$AH[l]),n||(n=!T(a)||a!==this._$AH[l]),a===u?t=u:t!==u&&(t+=(a!=null?a:"")+r[l+1]),this._$AH[l]=a}n&&!s&&this.C(t)}C(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},O=class extends S{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===u?void 0:t}},yt=C?C.emptyScript:"",M=class extends S{constructor(){super(...arguments),this.type=4}C(t){t&&t!==u?this.element.setAttribute(this.name,yt):this.element.removeAttribute(this.name)}},L=class extends S{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){var i;if((t=(i=A(this,t,e,0))!==null&&i!==void 0?i:u)===_)return;let s=this._$AH,r=t===u&&s!==u||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==u&&(s===u||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;typeof this._$AH=="function"?this._$AH.call((i=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&i!==void 0?i:this.element,t):this._$AH.handleEvent(t)}},z=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){A(this,t)}},bt={P:"$lit$",L:$,V:j,I:1,N:ht,R:k,D:rt,j:A,H:f,O:S,F:M,B:L,W:O,Z:z},st=window.litHtmlPolyfillSupport;st==null||st(g,f),((D=globalThis.litHtmlVersions)!==null&&D!==void 0?D:globalThis.litHtmlVersions=[]).push("2.2.1");var q=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,I=Symbol(),dt=new Map,R=class{constructor(t,e){if(this._$cssResult$=!0,e!==I)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=dt.get(this.cssText);return q&&t===void 0&&(dt.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}},ct=o=>new R(typeof o=="string"?o:o+"",I),_t=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((i,s,r)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+o[r+1],o[0]);return new R(e,I)},V=(o,t)=>{q?o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{let i=document.createElement("style"),s=window.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,o.appendChild(i)})},B=q?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return ct(e)})(o):o;var K,ut=window.trustedTypes,gt=ut?ut.emptyScript:"",pt=window.reactiveElementPolyfillSupport,Z={toAttribute(o,t){switch(t){case Boolean:o=o?gt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},vt=(o,t)=>t!==o&&(t==t||o==o),W={attribute:!0,type:String,converter:Z,reflect:!1,hasChanged:vt},m=class extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;(e=this.l)!==null&&e!==void 0||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,i)=>{let s=this._$Eh(i,e);s!==void 0&&(this._$Eu.set(s,i),t.push(s))}),t}static createProperty(t,e=W){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let i=typeof t=="symbol"?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);s!==void 0&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){let r=this[t];this[e]=s,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||W}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){let e=this.properties,i=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let s of i)this.createProperty(s,e[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let s of i)e.unshift(B(s))}else t!==void 0&&e.push(B(t));return e}static _$Eh(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Em(),this.requestUpdate(),(t=this.constructor.l)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,i;((e=this._$Eg)!==null&&e!==void 0?e:this._$Eg=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var e;(e=this._$Eg)===null||e===void 0||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;let e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return V(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$Eg)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostConnected)===null||i===void 0?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$Eg)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostDisconnected)===null||i===void 0?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=W){var s,r;let n=this.constructor._$Eh(t,i);if(n!==void 0&&i.reflect===!0){let h=((r=(s=i.converter)===null||s===void 0?void 0:s.toAttribute)!==null&&r!==void 0?r:Z.toAttribute)(e,i.type);this._$Ei=t,h==null?this.removeAttribute(n):this.setAttribute(n,h),this._$Ei=null}}_$AK(t,e){var i,s,r;let n=this.constructor,h=n._$Eu.get(t);if(h!==void 0&&this._$Ei!==h){let l=n.getPropertyOptions(h),a=l.converter,p=(r=(s=(i=a)===null||i===void 0?void 0:i.fromAttribute)!==null&&s!==void 0?s:typeof a=="function"?a:null)!==null&&r!==void 0?r:Z.fromAttribute;this._$Ei=h,this[h]=p(e,l.type),this._$Ei=null}}requestUpdate(t,e,i){let s=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||vt)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Ei!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach((s,r)=>this[r]=s),this._$Et=void 0);let e=!1,i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$Eg)===null||t===void 0||t.forEach(s=>{var r;return(r=s.hostUpdate)===null||r===void 0?void 0:r.call(s)}),this.update(i)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$Eg)===null||e===void 0||e.forEach(i=>{var s;return(s=i.hostUpdated)===null||s===void 0?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,i)=>this._$ES(i,this[i],e)),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}};m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},pt==null||pt({ReactiveElement:m}),((K=globalThis.reactiveElementVersions)!==null&&K!==void 0?K:globalThis.reactiveElementVersions=[]).push("1.3.0");var J,F;var x=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;let i=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=i.firstChild),i}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=at(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!1)}render(){return _}};x.finalized=!0,x._$litElement$=!0,(J=globalThis.litElementHydrateSupport)===null||J===void 0||J.call(globalThis,{LitElement:x});var $t=globalThis.litElementPolyfillSupport;$t==null||$t({LitElement:x});((F=globalThis.litElementVersions)!==null&&F!==void 0?F:globalThis.litElementVersions=[]).push("3.2.0");var qt=o=>t=>typeof t=="function"?((e,i)=>(window.customElements.define(e,i),i))(o,t):((e,i)=>{let{kind:s,elements:r}=i;return{kind:s,elements:r,finisher(n){window.customElements.define(e,n)}}})(o,t);var At=(o,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,o)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,o)}};function mt(o){return(t,e)=>e!==void 0?((i,s,r)=>{s.constructor.createProperty(r,i)})(o,t,e):At(o,t)}function It(o){return mt({...o,state:!0})}var E=({finisher:o,descriptor:t})=>(e,i)=>{var s;if(i===void 0){let r=(s=e.originalKey)!==null&&s!==void 0?s:e.key,n=t!=null?{kind:"method",placement:"prototype",key:r,descriptor:t(e.key)}:{...e,key:r};return o!=null&&(n.finisher=function(h){o(h,r)}),n}{let r=e.constructor;t!==void 0&&Object.defineProperty(e,i,t(i)),o==null||o(r,i)}};function Zt(o,t){return E({descriptor:e=>{let i={get(){var s,r;return(r=(s=this.renderRoot)===null||s===void 0?void 0:s.querySelector(o))!==null&&r!==void 0?r:null},enumerable:!0,configurable:!0};if(t){let s=typeof e=="symbol"?Symbol():"__"+e;i.get=function(){var r,n;return this[s]===void 0&&(this[s]=(n=(r=this.renderRoot)===null||r===void 0?void 0:r.querySelector(o))!==null&&n!==void 0?n:null),this[s]}}return i}})}var G,ie=((G=window.HTMLSlotElement)===null||G===void 0?void 0:G.prototype.assignedElements)!=null?(o,t)=>o.assignedElements(t):(o,t)=>o.assignedNodes(t).filter(e=>e.nodeType===Node.ELEMENT_NODE);export{_t as a,St as b,_ as c,u as d,bt as e,x as f,qt as g,mt as h,It as i,Zt as j};
|
|
1
|
+
var D,C=globalThis.trustedTypes,Q=C?C.createPolicy("lit-html",{createHTML:o=>o}):void 0,$=`lit$${(Math.random()+"").slice(9)}$`,j="?"+$,ft=`<${j}>`,w=document,U=(o="")=>w.createComment(o),T=o=>o===null||typeof o!="object"&&typeof o!="function",ot=Array.isArray,rt=o=>{var t;return ot(o)||typeof((t=o)===null||t===void 0?void 0:t[Symbol.iterator])=="function"},P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,X=/-->/g,Y=/>/g,_=/>|[ \n\r](?:([^\s"'>=/]+)([ \n\r]*=[ \n\r]*(?:[^ \n\r"'`<>=]|("|')|))|$)/g,tt=/'/g,et=/"/g,nt=/^(?:script|style|textarea|title)$/i,lt=o=>(t,...e)=>({_$litType$:o,strings:t,values:e}),St=lt(1),Et=lt(2),g=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),it=new WeakMap,at=(o,t,e)=>{var i,s;let r=(i=e==null?void 0:e.renderBefore)!==null&&i!==void 0?i:t,n=r._$litPart$;if(n===void 0){let h=(s=e==null?void 0:e.renderBefore)!==null&&s!==void 0?s:null;r._$litPart$=n=new f(t.insertBefore(U(),h),h,void 0,e!=null?e:{})}return n._$AI(o),n},b=w.createTreeWalker(w,129,null,!1),ht=(o,t)=>{let e=o.length-1,i=[],s,r=t===2?"<svg>":"",n=P;for(let l=0;l<e;l++){let a=o[l],p,d,c=-1,v=0;for(;v<a.length&&(n.lastIndex=v,d=n.exec(a),d!==null);)v=n.lastIndex,n===P?d[1]==="!--"?n=X:d[1]!==void 0?n=Y:d[2]!==void 0?(nt.test(d[2])&&(s=RegExp("</"+d[2],"g")),n=_):d[3]!==void 0&&(n=_):n===_?d[0]===">"?(n=s!=null?s:P,c=-1):d[1]===void 0?c=-2:(c=n.lastIndex-d[2].length,p=d[1],n=d[3]===void 0?_:d[3]==='"'?et:tt):n===et||n===tt?n=_:n===X||n===Y?n=P:(n=_,s=void 0);let H=n===_&&o[l+1].startsWith("/>")?" ":"";r+=n===P?a+ft:c>=0?(i.push(p),a.slice(0,c)+"$lit$"+a.slice(c)+$+H):a+$+(c===-2?(i.push(void 0),l):H)}let h=r+(o[e]||"<?>")+(t===2?"</svg>":"");if(!Array.isArray(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return[Q!==void 0?Q.createHTML(h):h,i]},A=class{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let r=0,n=0,h=t.length-1,l=this.parts,[a,p]=ht(t,e);if(this.el=A.createElement(a,i),b.currentNode=this.el.content,e===2){let d=this.el.content,c=d.firstChild;c.remove(),d.append(...c.childNodes)}for(;(s=b.nextNode())!==null&&l.length<h;){if(s.nodeType===1){if(s.hasAttributes()){let d=[];for(let c of s.getAttributeNames())if(c.endsWith("$lit$")||c.startsWith($)){let v=p[n++];if(d.push(c),v!==void 0){let H=s.getAttribute(v.toLowerCase()+"$lit$").split($),N=/([.?@])?(.*)/.exec(v);l.push({type:1,index:r,name:N[2],strings:H,ctor:N[1]==="."?O:N[1]==="?"?M:N[1]==="@"?L:E})}else l.push({type:6,index:r})}for(let c of d)s.removeAttribute(c)}if(nt.test(s.tagName)){let d=s.textContent.split($),c=d.length-1;if(c>0){s.textContent=C?C.emptyScript:"";for(let v=0;v<c;v++)s.append(d[v],U()),b.nextNode(),l.push({type:2,index:++r});s.append(d[c],U())}}}else if(s.nodeType===8)if(s.data===j)l.push({type:2,index:r});else{let d=-1;for(;(d=s.data.indexOf($,d+1))!==-1;)l.push({type:7,index:r}),d+=$.length-1}r++}}static createElement(t,e){let i=w.createElement("template");return i.innerHTML=t,i}};function S(o,t,e=o,i){var s,r,n,h;if(t===g)return t;let l=i!==void 0?(s=e._$Cl)===null||s===void 0?void 0:s[i]:e._$Cu,a=T(t)?void 0:t._$litDirective$;return(l==null?void 0:l.constructor)!==a&&((r=l==null?void 0:l._$AO)===null||r===void 0||r.call(l,!1),a===void 0?l=void 0:(l=new a(o),l._$AT(o,e,i)),i!==void 0?((n=(h=e)._$Cl)!==null&&n!==void 0?n:h._$Cl=[])[i]=l:e._$Cu=l),l!==void 0&&(t=S(o,l._$AS(o,t.values),l,i)),t}var k=class{constructor(t,e){this.v=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}p(t){var e;let{el:{content:i},parts:s}=this._$AD,r=((e=t==null?void 0:t.creationScope)!==null&&e!==void 0?e:w).importNode(i,!0);b.currentNode=r;let n=b.nextNode(),h=0,l=0,a=s[0];for(;a!==void 0;){if(h===a.index){let p;a.type===2?p=new f(n,n.nextSibling,this,t):a.type===1?p=new a.ctor(n,a.name,a.strings,this,t):a.type===6&&(p=new z(n,this,t)),this.v.push(p),a=s[++l]}h!==(a==null?void 0:a.index)&&(n=b.nextNode(),h++)}return r}m(t){let e=0;for(let i of this.v)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}},f=class{constructor(t,e,i,s){var r;this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cg=(r=s==null?void 0:s.isConnected)===null||r===void 0||r}get _$AU(){var t,e;return(e=(t=this._$AM)===null||t===void 0?void 0:t._$AU)!==null&&e!==void 0?e:this._$Cg}get parentNode(){let t=this._$AA.parentNode,e=this._$AM;return e!==void 0&&t.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=S(this,t,e),T(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==g&&this.$(t):t._$litType$!==void 0?this.T(t):t.nodeType!==void 0?this.k(t):rt(t)?this.S(t):this.$(t)}A(t,e=this._$AB){return this._$AA.parentNode.insertBefore(t,e)}k(t){this._$AH!==t&&(this._$AR(),this._$AH=this.A(t))}$(t){this._$AH!==u&&T(this._$AH)?this._$AA.nextSibling.data=t:this.k(w.createTextNode(t)),this._$AH=t}T(t){var e;let{values:i,_$litType$:s}=t,r=typeof s=="number"?this._$AC(t):(s.el===void 0&&(s.el=A.createElement(s.h,this.options)),s);if(((e=this._$AH)===null||e===void 0?void 0:e._$AD)===r)this._$AH.m(i);else{let n=new k(r,this),h=n.p(this.options);n.m(i),this.k(h),this._$AH=n}}_$AC(t){let e=it.get(t.strings);return e===void 0&&it.set(t.strings,e=new A(t)),e}S(t){ot(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,i,s=0;for(let r of t)s===e.length?e.push(i=new f(this.A(U()),this.A(U()),this,this.options)):i=e[s],i._$AI(r),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;for((i=this._$AP)===null||i===void 0||i.call(this,!1,!0,e);t&&t!==this._$AB;){let s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cg=t,(e=this._$AP)===null||e===void 0||e.call(this,t))}},E=class{constructor(t,e,i,s,r){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=r,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=u}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(t,e=this,i,s){let r=this.strings,n=!1;if(r===void 0)t=S(this,t,e,0),n=!T(t)||t!==this._$AH&&t!==g,n&&(this._$AH=t);else{let h=t,l,a;for(t=r[0],l=0;l<r.length-1;l++)a=S(this,h[i+l],e,l),a===g&&(a=this._$AH[l]),n||(n=!T(a)||a!==this._$AH[l]),a===u?t=u:t!==u&&(t+=(a!=null?a:"")+r[l+1]),this._$AH[l]=a}n&&!s&&this.C(t)}C(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t!=null?t:"")}},O=class extends E{constructor(){super(...arguments),this.type=3}C(t){this.element[this.name]=t===u?void 0:t}},yt=C?C.emptyScript:"",M=class extends E{constructor(){super(...arguments),this.type=4}C(t){t&&t!==u?this.element.setAttribute(this.name,yt):this.element.removeAttribute(this.name)}},L=class extends E{constructor(t,e,i,s,r){super(t,e,i,s,r),this.type=5}_$AI(t,e=this){var i;if((t=(i=S(this,t,e,0))!==null&&i!==void 0?i:u)===g)return;let s=this._$AH,r=t===u&&s!==u||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==u&&(s===u||r);r&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e,i;typeof this._$AH=="function"?this._$AH.call((i=(e=this.options)===null||e===void 0?void 0:e.host)!==null&&i!==void 0?i:this.element,t):this._$AH.handleEvent(t)}},z=class{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){S(this,t)}},bt={P:"$lit$",L:$,V:j,I:1,N:ht,R:k,D:rt,j:S,H:f,O:E,F:M,B:L,W:O,Z:z},st=window.litHtmlPolyfillSupport;st==null||st(A,f),((D=globalThis.litHtmlVersions)!==null&&D!==void 0?D:globalThis.litHtmlVersions=[]).push("2.2.1");var q=window.ShadowRoot&&(window.ShadyCSS===void 0||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,I=Symbol(),dt=new Map,R=class{constructor(t,e){if(this._$cssResult$=!0,e!==I)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t}get styleSheet(){let t=dt.get(this.cssText);return q&&t===void 0&&(dt.set(this.cssText,t=new CSSStyleSheet),t.replaceSync(this.cssText)),t}toString(){return this.cssText}},ct=o=>new R(typeof o=="string"?o:o+"",I),_t=(o,...t)=>{let e=o.length===1?o[0]:t.reduce((i,s,r)=>i+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+o[r+1],o[0]);return new R(e,I)},V=(o,t)=>{q?o.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(e=>{let i=document.createElement("style"),s=window.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,o.appendChild(i)})},B=q?o=>o:o=>o instanceof CSSStyleSheet?(t=>{let e="";for(let i of t.cssRules)e+=i.cssText;return ct(e)})(o):o;var K,ut=window.trustedTypes,gt=ut?ut.emptyScript:"",pt=window.reactiveElementPolyfillSupport,Z={toAttribute(o,t){switch(t){case Boolean:o=o?gt:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,t){let e=o;switch(t){case Boolean:e=o!==null;break;case Number:e=o===null?null:Number(o);break;case Object:case Array:try{e=JSON.parse(o)}catch{e=null}}return e}},vt=(o,t)=>t!==o&&(t==t||o==o),W={attribute:!0,type:String,converter:Z,reflect:!1,hasChanged:vt},m=class extends HTMLElement{constructor(){super(),this._$Et=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Ei=null,this.o()}static addInitializer(t){var e;(e=this.l)!==null&&e!==void 0||(this.l=[]),this.l.push(t)}static get observedAttributes(){this.finalize();let t=[];return this.elementProperties.forEach((e,i)=>{let s=this._$Eh(i,e);s!==void 0&&(this._$Eu.set(s,i),t.push(s))}),t}static createProperty(t,e=W){if(e.state&&(e.attribute=!1),this.finalize(),this.elementProperties.set(t,e),!e.noAccessor&&!this.prototype.hasOwnProperty(t)){let i=typeof t=="symbol"?Symbol():"__"+t,s=this.getPropertyDescriptor(t,i,e);s!==void 0&&Object.defineProperty(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){return{get(){return this[e]},set(s){let r=this[t];this[e]=s,this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)||W}static finalize(){if(this.hasOwnProperty("finalized"))return!1;this.finalized=!0;let t=Object.getPrototypeOf(this);if(t.finalize(),this.elementProperties=new Map(t.elementProperties),this._$Eu=new Map,this.hasOwnProperty("properties")){let e=this.properties,i=[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)];for(let s of i)this.createProperty(s,e[s])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(t){let e=[];if(Array.isArray(t)){let i=new Set(t.flat(1/0).reverse());for(let s of i)e.unshift(B(s))}else t!==void 0&&e.push(B(t));return e}static _$Eh(t,e){let i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}o(){var t;this._$Ep=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Em(),this.requestUpdate(),(t=this.constructor.l)===null||t===void 0||t.forEach(e=>e(this))}addController(t){var e,i;((e=this._$Eg)!==null&&e!==void 0?e:this._$Eg=[]).push(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)===null||i===void 0||i.call(t))}removeController(t){var e;(e=this._$Eg)===null||e===void 0||e.splice(this._$Eg.indexOf(t)>>>0,1)}_$Em(){this.constructor.elementProperties.forEach((t,e)=>{this.hasOwnProperty(e)&&(this._$Et.set(e,this[e]),delete this[e])})}createRenderRoot(){var t;let e=(t=this.shadowRoot)!==null&&t!==void 0?t:this.attachShadow(this.constructor.shadowRootOptions);return V(e,this.constructor.elementStyles),e}connectedCallback(){var t;this.renderRoot===void 0&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$Eg)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostConnected)===null||i===void 0?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$Eg)===null||t===void 0||t.forEach(e=>{var i;return(i=e.hostDisconnected)===null||i===void 0?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ES(t,e,i=W){var s,r;let n=this.constructor._$Eh(t,i);if(n!==void 0&&i.reflect===!0){let h=((r=(s=i.converter)===null||s===void 0?void 0:s.toAttribute)!==null&&r!==void 0?r:Z.toAttribute)(e,i.type);this._$Ei=t,h==null?this.removeAttribute(n):this.setAttribute(n,h),this._$Ei=null}}_$AK(t,e){var i,s,r;let n=this.constructor,h=n._$Eu.get(t);if(h!==void 0&&this._$Ei!==h){let l=n.getPropertyOptions(h),a=l.converter,p=(r=(s=(i=a)===null||i===void 0?void 0:i.fromAttribute)!==null&&s!==void 0?s:typeof a=="function"?a:null)!==null&&r!==void 0?r:Z.fromAttribute;this._$Ei=h,this[h]=p(e,l.type),this._$Ei=null}}requestUpdate(t,e,i){let s=!0;t!==void 0&&(((i=i||this.constructor.getPropertyOptions(t)).hasChanged||vt)(this[t],e)?(this._$AL.has(t)||this._$AL.set(t,e),i.reflect===!0&&this._$Ei!==t&&(this._$EC===void 0&&(this._$EC=new Map),this._$EC.set(t,i))):s=!1),!this.isUpdatePending&&s&&(this._$Ep=this._$E_())}async _$E_(){this.isUpdatePending=!0;try{await this._$Ep}catch(e){Promise.reject(e)}let t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;this.hasUpdated,this._$Et&&(this._$Et.forEach((s,r)=>this[r]=s),this._$Et=void 0);let e=!1,i=this._$AL;try{e=this.shouldUpdate(i),e?(this.willUpdate(i),(t=this._$Eg)===null||t===void 0||t.forEach(s=>{var r;return(r=s.hostUpdate)===null||r===void 0?void 0:r.call(s)}),this.update(i)):this._$EU()}catch(s){throw e=!1,this._$EU(),s}e&&this._$AE(i)}willUpdate(t){}_$AE(t){var e;(e=this._$Eg)===null||e===void 0||e.forEach(i=>{var s;return(s=i.hostUpdated)===null||s===void 0?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$Ep}shouldUpdate(t){return!0}update(t){this._$EC!==void 0&&(this._$EC.forEach((e,i)=>this._$ES(i,this[i],e)),this._$EC=void 0),this._$EU()}updated(t){}firstUpdated(t){}};m.finalized=!0,m.elementProperties=new Map,m.elementStyles=[],m.shadowRootOptions={mode:"open"},pt==null||pt({ReactiveElement:m}),((K=globalThis.reactiveElementVersions)!==null&&K!==void 0?K:globalThis.reactiveElementVersions=[]).push("1.3.0");var J,F;var x=class extends m{constructor(){super(...arguments),this.renderOptions={host:this},this._$Dt=void 0}createRenderRoot(){var t,e;let i=super.createRenderRoot();return(t=(e=this.renderOptions).renderBefore)!==null&&t!==void 0||(e.renderBefore=i.firstChild),i}update(t){let e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Dt=at(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Dt)===null||t===void 0||t.setConnected(!1)}render(){return g}};x.finalized=!0,x._$litElement$=!0,(J=globalThis.litElementHydrateSupport)===null||J===void 0||J.call(globalThis,{LitElement:x});var $t=globalThis.litElementPolyfillSupport;$t==null||$t({LitElement:x});((F=globalThis.litElementVersions)!==null&&F!==void 0?F:globalThis.litElementVersions=[]).push("3.2.0");var qt=o=>t=>typeof t=="function"?((e,i)=>(window.customElements.define(e,i),i))(o,t):((e,i)=>{let{kind:s,elements:r}=i;return{kind:s,elements:r,finisher(n){window.customElements.define(e,n)}}})(o,t);var At=(o,t)=>t.kind==="method"&&t.descriptor&&!("value"in t.descriptor)?{...t,finisher(e){e.createProperty(t.key,o)}}:{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){typeof t.initializer=="function"&&(this[t.key]=t.initializer.call(this))},finisher(e){e.createProperty(t.key,o)}};function mt(o){return(t,e)=>e!==void 0?((i,s,r)=>{s.constructor.createProperty(r,i)})(o,t,e):At(o,t)}function It(o){return mt({...o,state:!0})}var y=({finisher:o,descriptor:t})=>(e,i)=>{var s;if(i===void 0){let r=(s=e.originalKey)!==null&&s!==void 0?s:e.key,n=t!=null?{kind:"method",placement:"prototype",key:r,descriptor:t(e.key)}:{...e,key:r};return o!=null&&(n.finisher=function(h){o(h,r)}),n}{let r=e.constructor;t!==void 0&&Object.defineProperty(e,i,t(i)),o==null||o(r,i)}};function Zt(o,t){return y({descriptor:e=>{let i={get(){var s,r;return(r=(s=this.renderRoot)===null||s===void 0?void 0:s.querySelector(o))!==null&&r!==void 0?r:null},enumerable:!0,configurable:!0};if(t){let s=typeof e=="symbol"?Symbol():"__"+e;i.get=function(){var r,n;return this[s]===void 0&&(this[s]=(n=(r=this.renderRoot)===null||r===void 0?void 0:r.querySelector(o))!==null&&n!==void 0?n:null),this[s]}}return i}})}function Gt(o){return y({descriptor:t=>({get(){var e,i;return(i=(e=this.renderRoot)===null||e===void 0?void 0:e.querySelectorAll(o))!==null&&i!==void 0?i:[]},enumerable:!0,configurable:!0})})}var G,se=((G=window.HTMLSlotElement)===null||G===void 0?void 0:G.prototype.assignedElements)!=null?(o,t)=>o.assignedElements(t):(o,t)=>o.assignedNodes(t).filter(e=>e.nodeType===Node.ELEMENT_NODE);export{_t as a,St as b,g as c,u as d,bt as e,x as f,qt as g,mt as h,It as i,Zt as j,Gt as k};
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2017 Google LLC
|
|
@@ -14,4 +14,4 @@ var D,C=globalThis.trustedTypes,Q=C?C.createPolicy("lit-html",{createHTML:o=>o})
|
|
|
14
14
|
* Copyright 2021 Google LLC
|
|
15
15
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
16
16
|
*/
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
17
|
+
//# sourceMappingURL=chunk-HG7OBTQS.js.map
|