@telperion/elements 3.0.3 → 4.1.0
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/.build-manifest.json +12 -1
- package/README.md +45 -0
- package/_chunks/signal-watcher-lit-element-B9xodkLt.d.cts +29 -0
- package/_chunks/signal-watcher-lit-element-B9xodkLt.d.ts +29 -0
- package/drag-drop/drag-handle-element.cjs +1 -1
- package/drag-drop/drag-handle-element.js +1 -1
- package/fesm/elements.mjs +610 -30
- package/fesm/elements.mjs.map +1 -1
- package/iife/elements.js +192 -21
- package/iife/elements.js.map +1 -1
- package/iife/popover/index.js +44 -6
- package/iife/popover/index.js.map +1 -1
- package/iife/router/index.js.map +1 -1
- package/iife/select/index.js +278 -0
- package/iife/select/index.js.map +1 -0
- package/index.cjs +17 -0
- package/index.cjs.map +1 -1
- package/index.d.cts +2 -0
- package/index.d.ts +2 -0
- package/index.js +4 -0
- package/index.js.map +1 -1
- package/package.json +32 -5
- package/popover/index.d.cts +1 -1
- package/popover/index.d.ts +1 -1
- package/popover/popover-element.cjs +28 -18
- package/popover/popover-element.cjs.map +1 -1
- package/popover/popover-element.js +29 -19
- package/popover/popover-element.js.map +1 -1
- package/router/index.d.cts +2 -26
- package/router/index.d.ts +2 -26
- package/router/tha-router-config.cjs +2 -2
- package/router/tha-router-config.cjs.map +1 -1
- package/router/tha-router-config.js +2 -2
- package/router/tha-router-config.js.map +1 -1
- package/router/tha-router-link.cjs +1 -1
- package/router/tha-router-link.js +1 -1
- package/router/tha-router-outlet.cjs +1 -1
- package/router/tha-router-outlet.js +1 -1
- package/router/tha-router-param.cjs +1 -1
- package/router/tha-router-param.js +1 -1
- package/router/tha-router.cjs +1 -1
- package/router/tha-router.js +1 -1
- package/select/index.cjs +23 -0
- package/select/index.cjs.map +1 -0
- package/select/index.d.cts +284 -0
- package/select/index.d.ts +284 -0
- package/select/index.js +5 -0
- package/select/index.js.map +1 -0
- package/select/internal-props.cjs +10 -0
- package/select/internal-props.cjs.map +1 -0
- package/select/internal-props.js +6 -0
- package/select/internal-props.js.map +1 -0
- package/select/option.element.cjs +88 -0
- package/select/option.element.cjs.map +1 -0
- package/select/option.element.js +88 -0
- package/select/option.element.js.map +1 -0
- package/select/select-change-event.cjs +30 -0
- package/select/select-change-event.cjs.map +1 -0
- package/select/select-change-event.js +28 -0
- package/select/select-change-event.js.map +1 -0
- package/select/select-context.cjs +14 -0
- package/select/select-context.cjs.map +1 -0
- package/select/select-context.js +12 -0
- package/select/select-context.js.map +1 -0
- package/select/select.element.cjs +414 -0
- package/select/select.element.cjs.map +1 -0
- package/select/select.element.js +414 -0
- package/select/select.element.js.map +1 -0
- package/select/selected-content.element.cjs +65 -0
- package/select/selected-content.element.cjs.map +1 -0
- package/select/selected-content.element.js +65 -0
- package/select/selected-content.element.js.map +1 -0
- package/utils/signal-watcher-lit-element.cjs.map +1 -0
- package/utils/signal-watcher-lit-element.js.map +1 -0
- package/router/signal-watcher-lit-element.cjs.map +0 -1
- package/router/signal-watcher-lit-element.js.map +0 -1
- /package/{router → utils}/signal-watcher-lit-element.cjs +0 -0
- /package/{router → utils}/signal-watcher-lit-element.js +0 -0
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
this.TelperionElements=this.TelperionElements||{},function(t){"use strict";function e(t,e,s,i){var o,n=arguments.length,r=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,s):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,s,i);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(r=(n<3?o(r):n>3?o(e,s,r):o(e,s))||r);return n>3&&r&&Object.defineProperty(e,s,r),r}function s(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}"function"==typeof SuppressedError&&SuppressedError;
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2019 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
|
+
*/
|
|
7
|
+
const i=globalThis,o=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,n=Symbol(),r=new WeakMap;let c=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==n)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(o&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=r.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&r.set(e,t))}return t}toString(){return this.cssText}};const l=(t,...e)=>{const s=1===t.length?t[0]:e.reduce((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1],t[0]);return new c(s,t,n)},a=o?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new c("string"==typeof t?t:t+"",void 0,n))(e)})(t):t,{is:h,defineProperty:d,getOwnPropertyDescriptor:p,getOwnPropertyNames:u,getOwnPropertySymbols:f,getPrototypeOf:g}=Object,m=globalThis,v=m.trustedTypes,y=v?v.emptyScript:"",b=m.reactiveElementPolyfillSupport,S=(t,e)=>t,$={toAttribute(t,e){switch(e){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},_=(t,e)=>!h(t,e),w={attribute:!0,type:String,converter:$,reflect:!1,useDefault:!1,hasChanged:_};
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
* Copyright 2017 Google LLC
|
|
11
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
+
*/Symbol.metadata??=Symbol("metadata"),m.litPropertyMetadata??=new WeakMap;let E=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=w){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&d(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:o}=p(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:i,set(e){const n=i?.call(this);o?.call(this,e),this.requestUpdate(t,n,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??w}static _$Ei(){if(this.hasOwnProperty(S("elementProperties")))return;const t=g(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(S("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(S("properties"))){const t=this.properties,e=[...u(t),...f(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(a(t))}else void 0!==t&&e.push(a(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(t=>t(this))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(o)t.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(const s of e){const e=document.createElement("style"),o=i.litNonce;void 0!==o&&e.setAttribute("nonce",o),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach(t=>t.hostConnected?.())}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach(t=>t.hostDisconnected?.())}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$ET(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const o=(void 0!==s.converter?.toAttribute?s.converter:$).toAttribute(e,s.type);this._$Em=t,null==o?this.removeAttribute(i):this.setAttribute(i,o),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:$;this._$Em=i;const n=o.fromAttribute(e,t.type);this[i]=n??this._$Ej?.get(i)??n,this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){const i=this.constructor,o=this[t];if(s??=i.getPropertyOptions(t),!((s.hasChanged??_)(o,e)||s.useDefault&&s.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(i._$Eu(t,s))))return;this.C(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:s,reflect:i,wrapped:o},n){s&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,n??e??this[t]),!0!==o||void 0!==n)||(this._$AL.has(t)||(this.hasUpdated||s||(e=void 0),this._$AL.set(t,e)),!0===i&&this._$Em!==t&&(this._$Eq??=new Set).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t){const{wrapped:t}=s,i=this[e];!0!==t||this._$AL.has(e)||void 0===i||this.C(e,void 0,s,i)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach(t=>t.hostUpdate?.()),this.update(e)):this._$EM()}catch(e){throw t=!1,this._$EM(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach(t=>t.hostUpdated?.()),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&=this._$Eq.forEach(t=>this._$ET(t,this[t])),this._$EM()}updated(t){}firstUpdated(t){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[S("elementProperties")]=new Map,E[S("finalized")]=new Map,b?.({ReactiveElement:E}),(m.reactiveElementVersions??=[]).push("2.1.1");
|
|
13
|
+
/**
|
|
14
|
+
* @license
|
|
15
|
+
* Copyright 2017 Google LLC
|
|
16
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
|
+
*/
|
|
18
|
+
const C=globalThis,A=C.trustedTypes,x=A?A.createPolicy("lit-html",{createHTML:t=>t}):void 0,O="$lit$",N=`lit$${Math.random().toFixed(9).slice(2)}$`,k="?"+N,T=`<${k}>`,P=document,R=()=>P.createComment(""),I=t=>null===t||"object"!=typeof t&&"function"!=typeof t,M=Array.isArray,L="[ \t\n\f\r]",U=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,V=/-->/g,W=/>/g,j=RegExp(`>|${L}(?:([^\\s"'>=/]+)(${L}*=${L}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),H=/'/g,D=/"/g,q=/^(?:script|style|textarea|title)$/i,B=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),z=Symbol.for("lit-noChange"),F=Symbol.for("lit-nothing"),G=new WeakMap,J=P.createTreeWalker(P,129);function K(t,e){if(!M(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==x?x.createHTML(e):e}const Z=(t,e)=>{const s=t.length-1,i=[];let o,n=2===e?"<svg>":3===e?"<math>":"",r=U;for(let e=0;e<s;e++){const s=t[e];let c,l,a=-1,h=0;for(;h<s.length&&(r.lastIndex=h,l=r.exec(s),null!==l);)h=r.lastIndex,r===U?"!--"===l[1]?r=V:void 0!==l[1]?r=W:void 0!==l[2]?(q.test(l[2])&&(o=RegExp("</"+l[2],"g")),r=j):void 0!==l[3]&&(r=j):r===j?">"===l[0]?(r=o??U,a=-1):void 0===l[1]?a=-2:(a=r.lastIndex-l[2].length,c=l[1],r=void 0===l[3]?j:'"'===l[3]?D:H):r===D||r===H?r=j:r===V||r===W?r=U:(r=j,o=void 0);const d=r===j&&t[e+1].startsWith("/>")?" ":"";n+=r===U?s+T:a>=0?(i.push(c),s.slice(0,a)+O+s.slice(a)+N+d):s+N+(-2===a?e:d)}return[K(t,n+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class X{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let o=0,n=0;const r=t.length-1,c=this.parts,[l,a]=Z(t,e);if(this.el=X.createElement(l,s),J.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=J.nextNode())&&c.length<r;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(O)){const e=a[n++],s=i.getAttribute(t).split(N),r=/([.?@])?(.*)/.exec(e);c.push({type:1,index:o,name:r[2],strings:s,ctor:"."===r[1]?st:"?"===r[1]?it:"@"===r[1]?ot:et}),i.removeAttribute(t)}else t.startsWith(N)&&(c.push({type:6,index:o}),i.removeAttribute(t));if(q.test(i.tagName)){const t=i.textContent.split(N),e=t.length-1;if(e>0){i.textContent=A?A.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],R()),J.nextNode(),c.push({type:2,index:++o});i.append(t[e],R())}}}else if(8===i.nodeType)if(i.data===k)c.push({type:2,index:o});else{let t=-1;for(;-1!==(t=i.data.indexOf(N,t+1));)c.push({type:7,index:o}),t+=N.length-1}o++}}static createElement(t,e){const s=P.createElement("template");return s.innerHTML=t,s}}function Y(t,e,s=t,i){if(e===z)return e;let o=void 0!==i?s._$Co?.[i]:s._$Cl;const n=I(e)?void 0:e._$litDirective$;return o?.constructor!==n&&(o?._$AO?.(!1),void 0===n?o=void 0:(o=new n(t),o._$AT(t,s,i)),void 0!==i?(s._$Co??=[])[i]=o:s._$Cl=o),void 0!==o&&(e=Y(t,o._$AS(t,e.values),o,i)),e}class Q{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??P).importNode(e,!0);J.currentNode=i;let o=J.nextNode(),n=0,r=0,c=s[0];for(;void 0!==c;){if(n===c.index){let e;2===c.type?e=new tt(o,o.nextSibling,this,t):1===c.type?e=new c.ctor(o,c.name,c.strings,this,t):6===c.type&&(e=new nt(o,this,t)),this._$AV.push(e),c=s[++r]}n!==c?.index&&(o=J.nextNode(),n++)}return J.currentNode=P,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class tt{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=F,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Y(this,t,e),I(t)?t===F||null==t||""===t?(this._$AH!==F&&this._$AR(),this._$AH=F):t!==this._$AH&&t!==z&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>M(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==F&&I(this._$AH)?this._$AA.nextSibling.data=t:this.T(P.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=X.createElement(K(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new Q(i,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=G.get(t.strings);return void 0===e&&G.set(t.strings,e=new X(t)),e}k(t){M(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const o of t)i===e.length?e.push(s=new tt(this.O(R()),this.O(R()),this,this.options)):s=e[i],s._$AI(o),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class et{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,o){this.type=1,this._$AH=F,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=o,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=F}_$AI(t,e=this,s,i){const o=this.strings;let n=!1;if(void 0===o)t=Y(this,t,e,0),n=!I(t)||t!==this._$AH&&t!==z,n&&(this._$AH=t);else{const i=t;let r,c;for(t=o[0],r=0;r<o.length-1;r++)c=Y(this,i[s+r],e,r),c===z&&(c=this._$AH[r]),n||=!I(c)||c!==this._$AH[r],c===F?t=F:t!==F&&(t+=(c??"")+o[r+1]),this._$AH[r]=c}n&&!i&&this.j(t)}j(t){t===F?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class st extends et{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===F?void 0:t}}class it extends et{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==F)}}class ot extends et{constructor(t,e,s,i,o){super(t,e,s,i,o),this.type=5}_$AI(t,e=this){if((t=Y(this,t,e,0)??F)===z)return;const s=this._$AH,i=t===F&&s!==F||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,o=t!==F&&(s===F||i);i&&this.element.removeEventListener(this.name,this,s),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class nt{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Y(this,t)}}const rt=C.litHtmlPolyfillSupport;rt?.(X,tt),(C.litHtmlVersions??=[]).push("3.3.1");const ct=globalThis;
|
|
19
|
+
/**
|
|
20
|
+
* @license
|
|
21
|
+
* Copyright 2017 Google LLC
|
|
22
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
+
*/let lt=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{const i=s?.renderBefore??e;let o=i._$litPart$;if(void 0===o){const t=s?.renderBefore??null;i._$litPart$=o=new tt(e.insertBefore(R(),t),t,void 0,s??{})}return o._$AI(t),o})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return z}};lt._$litElement$=!0,lt.finalized=!0,ct.litElementHydrateSupport?.({LitElement:lt});const at=ct.litElementPolyfillSupport;at?.({LitElement:lt}),(ct.litElementVersions??=[]).push("4.2.1");
|
|
24
|
+
/**
|
|
25
|
+
* @license
|
|
26
|
+
* Copyright 2017 Google LLC
|
|
27
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
+
*/
|
|
29
|
+
const ht=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}):customElements.define(t,e)},dt={attribute:!0,type:String,converter:$,reflect:!1,hasChanged:_},pt=(t=dt,e,s)=>{const{kind:i,metadata:o}=s;let n=globalThis.litPropertyMetadata.get(o);if(void 0===n&&globalThis.litPropertyMetadata.set(o,n=new Map),"setter"===i&&((t=Object.create(t)).wrapped=!0),n.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const o=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,o,t)},init(e){return void 0!==e&&this.C(i,void 0,t,e),e}}}if("setter"===i){const{name:i}=s;return function(s){const o=this[i];e.call(this,s),this.requestUpdate(i,o,t)}}throw Error("Unsupported decorator location: "+i)};
|
|
30
|
+
/**
|
|
31
|
+
* @license
|
|
32
|
+
* Copyright 2017 Google LLC
|
|
33
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
+
*/function ut(t){return(e,s)=>"object"==typeof s?pt(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s)}
|
|
35
|
+
/**
|
|
36
|
+
* @license
|
|
37
|
+
* Copyright 2017 Google LLC
|
|
38
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
+
*/function ft(t){return ut({...t,state:!0,attribute:!1})}const gt={};const mt={popInline:"center",targetInline:"center",popBlock:"bottom",targetBlock:"top"},vt=new Set(["start","center","end"]),yt=new Set(["top","middle","bottom"]),bt={start:["end","start"],center:["center","center"],end:["start","end"]},St={top:["bottom","top"],middle:["middle","middle"],bottom:["top","bottom"]};function $t(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return vt.has(t)?bt[t]:null}return 2===e.length&&vt.has(e[0])&&vt.has(e[1])?[e[0],e[1]]:null}function _t(t){const e=t.trim().split(/\s+to\s+/);if(1===e.length){const t=e[0];return yt.has(t)?St[t]:null}return 2===e.length&&yt.has(e[0])&&yt.has(e[1])?[e[0],e[1]]:null}let wt=class extends lt{constructor(){var t;super(...arguments),this.mode="auto",this.target=null,this.position=null,this.trigger="click",this.#t=((t="tp-popover")in gt||(gt[t]=function*(t){let e=0;for(;;)yield`${t}-${e++}`}(t)),gt[t].next().value),this.#e=null,this.#s=!1,this.#i=[]}static{this.styles=(()=>{const t=l`
|
|
40
|
+
tp-popover {
|
|
41
|
+
--tp-popover-inline-position: attr(data-ti type(*));
|
|
42
|
+
--tp-popover-block-position: attr(data-tb type(*));
|
|
43
|
+
inset: auto;
|
|
44
|
+
translate: var(--tp-popover-translate-x, 0) var(--tp-popover-translate-y, 0);
|
|
45
|
+
position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
|
|
46
|
+
|
|
47
|
+
&[data-tb="middle"] {
|
|
48
|
+
--tp-popover-block-position: center;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&[data-pi="start"],
|
|
52
|
+
&[data-pi="center"] {
|
|
53
|
+
inset-inline-start: anchor(var(--tp-popover-inline-position));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
&[data-pi="center"] {
|
|
57
|
+
--tp-popover-translate-x: -50%;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&[data-pi="end"] {
|
|
61
|
+
inset-inline-end: anchor(var(--tp-popover-inline-position));
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&[data-pb="top"],
|
|
65
|
+
&[data-pb="middle"] {
|
|
66
|
+
inset-block-start: anchor(var(--tp-popover-block-position));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&[data-pb="middle"] {
|
|
70
|
+
--tp-popover-translate-y: -50%;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&[data-pb="bottom"] {
|
|
74
|
+
inset-block-end: anchor(var(--tp-popover-block-position));
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
`;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}#t;#e;get anchorElement(){return this.#e}get anchorName(){return`--${this.#t}`}#s;#i;createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.#o(),this.#n(),this.#r(),this.#c()}disconnectedCallback(){super.disconnectedCallback(),this.#l(),this.#a()}updated(t){t.has("mode")&&this.#o(),t.has("target")&&(this.#n(),this.#c()),t.has("position")&&this.#r(),t.has("trigger")&&this.#c()}render(){return B``}#o(){const t="manual"===this.mode?"manual":"auto";this.getAttribute("popover")!==t&&this.setAttribute("popover",t)}#h(){const t=this.target;if(t)try{const e=this.getRootNode().querySelector(t);if(e instanceof HTMLElement)return e;console.warn(`<tp-popover>: target "${t}" did not resolve to an HTMLElement; using parentElement.`)}catch{console.warn(`<tp-popover>: invalid target selector "${t}"; using parentElement.`)}const e=this.parentElement;if(e instanceof HTMLElement)return e;const s=this.getRootNode();return s instanceof ShadowRoot&&s.host instanceof HTMLElement?s.host:null}#n(){const t=this.#h();t!==this.#e?(this.#a(),this.#e=t,t&&this.#d(t)):t&&this.#d(t)}#d(t){const e=`--${this.#t}`,s=t.style.getPropertyValue("anchor-name").trim();if(s&&s!==e)return this.style.setProperty("position-anchor",s),void(this.#s=!1);t.style.setProperty("anchor-name",e),this.style.setProperty("position-anchor",e),this.#s=!0}#a(){if(this.#e&&this.#s){const t=`--${this.#t}`;this.#e.style.getPropertyValue("anchor-name").trim()===t&&this.#e.style.removeProperty("anchor-name")}this.#e=null,this.#s=!1,this.style.removeProperty("position-anchor")}#r(){let t=function(t){if(!t)return null;const e=t.trim().toLowerCase();if(!e)return null;if(!e.includes("/")){const t=$t(e);if(t){const[e,s]=St.middle;return{popInline:t[0],targetInline:t[1],popBlock:e,targetBlock:s}}const s=_t(e);if(s){const[t,e]=bt.center;return{popInline:t,targetInline:e,popBlock:s[0],targetBlock:s[1]}}return null}const s=e.split("/");if(2!==s.length)return null;const i=$t(s[0]),o=_t(s[1]);return i&&o?{popInline:i[0],targetInline:i[1],popBlock:o[0],targetBlock:o[1]}:null}(this.position);this.position&&!t&&console.warn(`<tp-popover>: invalid position "${this.position}"; using default.`),t??=mt,this.dataset.pi=t.popInline,this.dataset.ti=t.targetInline,this.dataset.pb=t.popBlock,this.dataset.tb=t.targetBlock}#l(){for(const t of this.#i)t();this.#i=[]}#c(){this.#l();const t=this.#e;if(t){if("click"===this.trigger){const e=t=>{if(!t.composedPath().includes(this))try{this.togglePopover()}catch{}};return t.addEventListener("click",e),void this.#i.push(()=>t.removeEventListener("click",e))}if("hover"===this.trigger){let e=null;const s=()=>{null!==e&&(clearTimeout(e),e=null)},i=()=>{s();try{this.showPopover()}catch{}},o=()=>{s(),e=setTimeout(()=>{try{this.hidePopover()}catch{}},120)};t.addEventListener("pointerenter",i),t.addEventListener("pointerleave",o),t.addEventListener("focusin",i),t.addEventListener("focusout",o),this.addEventListener("pointerenter",s),this.addEventListener("pointerleave",o),this.addEventListener("focusin",s),this.addEventListener("focusout",o),this.#i.push(()=>{s(),t.removeEventListener("pointerenter",i),t.removeEventListener("pointerleave",o),t.removeEventListener("focusin",i),t.removeEventListener("focusout",o),this.removeEventListener("pointerenter",s),this.removeEventListener("pointerleave",o),this.removeEventListener("focusin",s),this.removeEventListener("focusout",o)})}}}};e([ut({reflect:!0}),s("design:type",String)],wt.prototype,"mode",void 0),e([ut({reflect:!0}),s("design:type",Object)],wt.prototype,"target",void 0),e([ut({reflect:!0}),s("design:type",Object)],wt.prototype,"position",void 0),e([ut({reflect:!0}),s("design:type",String)],wt.prototype,"trigger",void 0),wt=e([ht("tp-popover")],wt);
|
|
78
|
+
/**
|
|
79
|
+
* @license
|
|
80
|
+
* Copyright 2021 Google LLC
|
|
81
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
82
|
+
*/
|
|
83
|
+
let Et=class extends Event{constructor(t,e,s,i){super("context-request",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e,this.callback=s,this.subscribe=i??!1}};
|
|
84
|
+
/**
|
|
85
|
+
* @license
|
|
86
|
+
* Copyright 2021 Google LLC
|
|
87
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
88
|
+
*/
|
|
89
|
+
/**
|
|
90
|
+
* @license
|
|
91
|
+
* Copyright 2021 Google LLC
|
|
92
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
93
|
+
*/
|
|
94
|
+
let Ct=class{constructor(t,e,s,i){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(t,e)=>{this.unsubscribe&&(this.unsubscribe!==e&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(t,e)),this.unsubscribe=e},this.host=t,void 0!==e.context){const t=e;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??!1}else this.context=e,this.callback=s,this.subscribe=i??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new Et(this.context,this.host,this.t,this.subscribe))}},At=class{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,e=!1){const s=e||!Object.is(t,this.o);this.o=t,s&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:e}]of this.subscriptions)t(this.o,e)},void 0!==t&&(this.value=t)}addCallback(t,e,s){if(!s)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:e});const{disposer:i}=this.subscriptions.get(t);t(this.value,i)}clearCallbacks(){this.subscriptions.clear()}},xt=class extends Event{constructor(t,e){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=e}},Ot=class extends At{constructor(t,e,s){super(void 0!==e.context?e.initialValue:s),this.onContextRequest=t=>{if(t.context!==this.context)return;const e=t.contextTarget??t.composedPath()[0];e!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,e,t.subscribe))},this.onProviderRequest=t=>{if(t.context!==this.context)return;if((t.contextTarget??t.composedPath()[0])===this.host)return;const e=new Set;for(const[t,{consumerHost:s}]of this.subscriptions)e.has(t)||(e.add(t),s.dispatchEvent(new Et(this.context,s,t,!0)));t.stopPropagation()},this.host=t,void 0!==e.context?this.context=e.context:this.context=e,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new xt(this.context,this.host))}};
|
|
95
|
+
/**
|
|
96
|
+
* @license
|
|
97
|
+
* Copyright 2021 Google LLC
|
|
98
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
99
|
+
*/
|
|
100
|
+
/**
|
|
101
|
+
* @license
|
|
102
|
+
* Copyright 2022 Google LLC
|
|
103
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
104
|
+
*/
|
|
105
|
+
function Nt({context:t,subscribe:e}){return(s,i)=>{"object"==typeof i?i.addInitializer(function(){new Ct(this,{context:t,callback:t=>{s.set.call(this,t)},subscribe:e})}):s.constructor.addInitializer(s=>{new Ct(s,{context:t,callback:t=>{s[i]=t},subscribe:e})})}}var kt=Object.defineProperty,Tt=(t,e,s)=>(((t,e,s)=>{e in t?kt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s})(t,"symbol"!=typeof e?e+"":e,s),s),Pt=(t,e)=>{if(Object(e)!==e)throw TypeError('Cannot use the "in" operator on this value');return t.has(e)},Rt=(t,e,s)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,s)},It=(t,e,s)=>(((t,e,s)=>{if(!e.has(t))throw TypeError("Cannot "+s)})(t,e,"access private method"),s);
|
|
106
|
+
/**
|
|
107
|
+
* @license
|
|
108
|
+
* Copyright Google LLC All Rights Reserved.
|
|
109
|
+
*
|
|
110
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
111
|
+
* found in the LICENSE file at https://angular.io/license
|
|
112
|
+
*/
|
|
113
|
+
function Mt(t,e){return Object.is(t,e)}
|
|
114
|
+
/**
|
|
115
|
+
* @license
|
|
116
|
+
* Copyright Google LLC All Rights Reserved.
|
|
117
|
+
*
|
|
118
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
119
|
+
* found in the LICENSE file at https://angular.io/license
|
|
120
|
+
*/let Lt=null,Ut=!1,Vt=1;const Wt=Symbol("SIGNAL");function jt(t){const e=Lt;return Lt=t,e}const Ht={version:0,lastCleanEpoch:0,dirty:!1,producerNode:void 0,producerLastReadVersion:void 0,producerIndexOfThis:void 0,nextProducerIndex:0,liveConsumerNode:void 0,liveConsumerIndexOfThis:void 0,consumerAllowSignalWrites:!1,consumerIsAlwaysLive:!1,producerMustRecompute:()=>!1,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function Dt(t){if(Ut)throw new Error("undefined"!=typeof ngDevMode&&ngDevMode?"Assertion error: signal read during notification phase":"");if(null===Lt)return;Lt.consumerOnSignalRead(t);const e=Lt.nextProducerIndex++;if(Kt(Lt),e<Lt.producerNode.length&&Lt.producerNode[e]!==t&&Jt(Lt)){Gt(Lt.producerNode[e],Lt.producerIndexOfThis[e])}Lt.producerNode[e]!==t&&(Lt.producerNode[e]=t,Lt.producerIndexOfThis[e]=Jt(Lt)?Ft(t,Lt,e):0),Lt.producerLastReadVersion[e]=t.version}function qt(t){if(t.dirty||t.lastCleanEpoch!==Vt){if(!t.producerMustRecompute(t)&&!function(t){Kt(t);for(let e=0;e<t.producerNode.length;e++){const s=t.producerNode[e],i=t.producerLastReadVersion[e];if(i!==s.version)return!0;if(qt(s),i!==s.version)return!0}return!1}(t))return t.dirty=!1,void(t.lastCleanEpoch=Vt);t.producerRecomputeValue(t),t.dirty=!1,t.lastCleanEpoch=Vt}}function Bt(t){if(void 0===t.liveConsumerNode)return;const e=Ut;Ut=!0;try{for(const e of t.liveConsumerNode)e.dirty||zt(e)}finally{Ut=e}}function zt(t){var e;t.dirty=!0,Bt(t),null==(e=t.consumerMarkedDirty)||e.call(t.wrapper??t)}function Ft(t,e,s){var i;if(Zt(t),Kt(t),0===t.liveConsumerNode.length){null==(i=t.watched)||i.call(t.wrapper);for(let e=0;e<t.producerNode.length;e++)t.producerIndexOfThis[e]=Ft(t.producerNode[e],t,e)}return t.liveConsumerIndexOfThis.push(s),t.liveConsumerNode.push(e)-1}function Gt(t,e){var s;if(Zt(t),Kt(t),"undefined"!=typeof ngDevMode&&ngDevMode&&e>=t.liveConsumerNode.length)throw new Error(`Assertion error: active consumer index ${e} is out of bounds of ${t.liveConsumerNode.length} consumers)`);if(1===t.liveConsumerNode.length){null==(s=t.unwatched)||s.call(t.wrapper);for(let e=0;e<t.producerNode.length;e++)Gt(t.producerNode[e],t.producerIndexOfThis[e])}const i=t.liveConsumerNode.length-1;if(t.liveConsumerNode[e]=t.liveConsumerNode[i],t.liveConsumerIndexOfThis[e]=t.liveConsumerIndexOfThis[i],t.liveConsumerNode.length--,t.liveConsumerIndexOfThis.length--,e<t.liveConsumerNode.length){const s=t.liveConsumerIndexOfThis[e],i=t.liveConsumerNode[e];Kt(i),i.producerIndexOfThis[s]=e}}function Jt(t){var e;return t.consumerIsAlwaysLive||((null==(e=null==t?void 0:t.liveConsumerNode)?void 0:e.length)??0)>0}function Kt(t){t.producerNode??(t.producerNode=[]),t.producerIndexOfThis??(t.producerIndexOfThis=[]),t.producerLastReadVersion??(t.producerLastReadVersion=[])}function Zt(t){t.liveConsumerNode??(t.liveConsumerNode=[]),t.liveConsumerIndexOfThis??(t.liveConsumerIndexOfThis=[])}
|
|
121
|
+
/**
|
|
122
|
+
* @license
|
|
123
|
+
* Copyright Google LLC All Rights Reserved.
|
|
124
|
+
*
|
|
125
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
126
|
+
* found in the LICENSE file at https://angular.io/license
|
|
127
|
+
*/function Xt(t){if(qt(t),Dt(t),t.value===te)throw t.error;return t.value}const Yt=Symbol("UNSET"),Qt=Symbol("COMPUTING"),te=Symbol("ERRORED"),ee=(()=>({...Ht,value:Yt,dirty:!0,error:null,equal:Mt,producerMustRecompute:t=>t.value===Yt||t.value===Qt,producerRecomputeValue(t){if(t.value===Qt)throw new Error("Detected cycle in computations.");const e=t.value;t.value=Qt;const s=function(t){return t&&(t.nextProducerIndex=0),jt(t)}(t);let i,o=!1;try{i=t.computation.call(t.wrapper);o=e!==Yt&&e!==te&&t.equal.call(t.wrapper,e,i)}catch(e){i=te,t.error=e}finally{!function(t,e){if(jt(e),t&&void 0!==t.producerNode&&void 0!==t.producerIndexOfThis&&void 0!==t.producerLastReadVersion){if(Jt(t))for(let e=t.nextProducerIndex;e<t.producerNode.length;e++)Gt(t.producerNode[e],t.producerIndexOfThis[e]);for(;t.producerNode.length>t.nextProducerIndex;)t.producerNode.pop(),t.producerLastReadVersion.pop(),t.producerIndexOfThis.pop()}}(t,s)}o?t.value=e:(t.value=i,t.version++)}}))();let se=
|
|
128
|
+
/**
|
|
129
|
+
* @license
|
|
130
|
+
* Copyright Google LLC All Rights Reserved.
|
|
131
|
+
*
|
|
132
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
133
|
+
* found in the LICENSE file at https://angular.io/license
|
|
134
|
+
*/
|
|
135
|
+
function(){throw new Error};function ie(){return Dt(this),this.value}function oe(t,e){!1===(null==Lt?void 0:Lt.consumerAllowSignalWrites)&&se(),t.equal.call(t.wrapper,t.value,e)||(t.value=e,function(t){t.version++,Vt++,Bt(t)}
|
|
136
|
+
/**
|
|
137
|
+
* @license
|
|
138
|
+
* Copyright 2024 Bloomberg Finance L.P.
|
|
139
|
+
*
|
|
140
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
141
|
+
* you may not use this file except in compliance with the License.
|
|
142
|
+
* You may obtain a copy of the License at
|
|
143
|
+
*
|
|
144
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
145
|
+
*
|
|
146
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
147
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
148
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
149
|
+
* See the License for the specific language governing permissions and
|
|
150
|
+
* limitations under the License.
|
|
151
|
+
*/(t))}const ne=(()=>({...Ht,equal:Mt,value:void 0}))();const re=Symbol("node");var ce;(t=>{var e,s,i,o;e=re,s=new WeakSet,t.isState=t=>"object"==typeof t&&Pt(s,t),t.State=class{constructor(i,o={}){Rt(this,s),Tt(this,e);const n=
|
|
152
|
+
/**
|
|
153
|
+
* @license
|
|
154
|
+
* Copyright Google LLC All Rights Reserved.
|
|
155
|
+
*
|
|
156
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
157
|
+
* found in the LICENSE file at https://angular.io/license
|
|
158
|
+
*/
|
|
159
|
+
function(t){const e=Object.create(ne);e.value=t;const s=()=>(Dt(e),e.value);return s[Wt]=e,s}(i),r=n[Wt];if(this[re]=r,r.wrapper=this,o){const e=o.equals;e&&(r.equal=e),r.watched=o[t.subtle.watched],r.unwatched=o[t.subtle.unwatched]}}get(){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.get");return ie.call(this[re])}set(e){if(!(0,t.isState)(this))throw new TypeError("Wrong receiver type for Signal.State.prototype.set");if(Ut)throw new Error("Writes to signals not permitted during Watcher callback");oe(this[re],e)}};i=re,o=new WeakSet,t.isComputed=t=>"object"==typeof t&&Pt(o,t),t.Computed=class{constructor(e,s){Rt(this,o),Tt(this,i);const n=function(t){const e=Object.create(ee);e.computation=t;const s=()=>Xt(e);return s[Wt]=e,s}(e),r=n[Wt];if(r.consumerAllowSignalWrites=!0,this[re]=r,r.wrapper=this,s){const e=s.equals;e&&(r.equal=e),r.watched=s[t.subtle.watched],r.unwatched=s[t.subtle.unwatched]}}get(){if(!(0,t.isComputed)(this))throw new TypeError("Wrong receiver type for Signal.Computed.prototype.get");return Xt(this[re])}},(e=>{var s,i,o,n;e.untrack=function(t){let e,s=null;try{s=jt(null),e=t()}finally{jt(s)}return e},e.introspectSources=function(e){var s;if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called introspectSources without a Computed or Watcher argument");return(null==(s=e[re].producerNode)?void 0:s.map(t=>t.wrapper))??[]},e.introspectSinks=function(e){var s;if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called introspectSinks without a Signal argument");return(null==(s=e[re].liveConsumerNode)?void 0:s.map(t=>t.wrapper))??[]},e.hasSinks=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isState)(e))throw new TypeError("Called hasSinks without a Signal argument");const s=e[re].liveConsumerNode;return!!s&&s.length>0},e.hasSources=function(e){if(!(0,t.isComputed)(e)&&!(0,t.isWatcher)(e))throw new TypeError("Called hasSources without a Computed or Watcher argument");const s=e[re].producerNode;return!!s&&s.length>0};s=re,i=new WeakSet,o=new WeakSet,n=function(e){for(const s of e)if(!(0,t.isComputed)(s)&&!(0,t.isState)(s))throw new TypeError("Called watch/unwatch without a Computed or State argument")},t.isWatcher=t=>Pt(i,t),e.Watcher=class{constructor(t){Rt(this,i),Rt(this,o),Tt(this,s);let e=Object.create(Ht);e.wrapper=this,e.consumerMarkedDirty=t,e.consumerIsAlwaysLive=!0,e.consumerAllowSignalWrites=!1,e.producerNode=[],this[re]=e}watch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");It(this,o,n).call(this,e);const s=this[re];s.dirty=!1;const i=jt(s);for(const t of e)Dt(t[re]);jt(i)}unwatch(...e){if(!(0,t.isWatcher)(this))throw new TypeError("Called unwatch without Watcher receiver");It(this,o,n).call(this,e);const s=this[re];Kt(s);for(let t=s.producerNode.length-1;t>=0;t--)if(e.includes(s.producerNode[t].wrapper)){Gt(s.producerNode[t],s.producerIndexOfThis[t]);const e=s.producerNode.length-1;if(s.producerNode[t]=s.producerNode[e],s.producerIndexOfThis[t]=s.producerIndexOfThis[e],s.producerNode.length--,s.producerIndexOfThis.length--,s.nextProducerIndex--,t<s.producerNode.length){const e=s.producerIndexOfThis[t],i=s.producerNode[t];Zt(i),i.liveConsumerIndexOfThis[e]=t}}}getPending(){if(!(0,t.isWatcher)(this))throw new TypeError("Called getPending without Watcher receiver");return this[re].producerNode.filter(t=>t.dirty).map(t=>t.wrapper)}},e.currentComputed=function(){var t;return null==(t=Lt)?void 0:t.wrapper},e.watched=Symbol("watched"),e.unwatched=Symbol("unwatched")})(t.subtle||(t.subtle={}))})(ce||(ce={}));
|
|
160
|
+
/**
|
|
161
|
+
* @license
|
|
162
|
+
* Copyright 2023 Google LLC
|
|
163
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
164
|
+
*/
|
|
165
|
+
let le=!1;const ae=new ce.subtle.Watcher(()=>{le||(le=!0,queueMicrotask(()=>{le=!1;for(const t of ae.getPending())t.get();ae.watch()}))}),he=Symbol("SignalWatcherBrand"),de=new FinalizationRegistry(t=>{t.unwatch(...ce.subtle.introspectSources(t))}),pe=new WeakMap;
|
|
166
|
+
/**
|
|
167
|
+
* @license
|
|
168
|
+
* Copyright 2023 Google LLC
|
|
169
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
170
|
+
*/
|
|
171
|
+
let ue=!1;const fe=new ce.subtle.Watcher(async()=>{ue||(ue=!0,queueMicrotask(()=>{ue=!1;for(const t of fe.getPending())t.get();fe.watch()}))});
|
|
172
|
+
/**
|
|
173
|
+
* @license
|
|
174
|
+
* Copyright 2023 Google LLC
|
|
175
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
176
|
+
*/ce.State,ce.Computed;const ge=(t,e)=>new ce.State(t,e);const me=Symbol("tp-select");class ve{#p;#u;#f=!1;constructor(t,e={}){const{attributes:s=!0,childList:i=!0,characterData:o=!0}=e;this.#p=t,this.clone=t.cloneNode(!0),this.#u=new MutationObserver(t=>this.#g(t)),this.#u.observe(t,{attributes:s,childList:i,characterData:o,subtree:!0})}disconnect(){this.#f||(this.#f=!0,this.#u.disconnect())}#g(t){for(const e of t){const t=this.#m(e.target);if(!t)continue;const s=this.#v(t);if(s)switch(e.type){case"attributes":this.#y(e,s);break;case"characterData":s.nodeValue=e.target.nodeValue;break;case"childList":this.#b(e.target,s)}}}#y(t,e){const s=t.attributeName;if(!s)return;const i=t.attributeNamespace??null,o=t.target,n=i?o.getAttributeNS(i,s):o.getAttribute(s);null===n?i?e.removeAttributeNS(i,s):e.removeAttribute(s):i?e.setAttributeNS(i,s,n):e.setAttribute(s,n)}#b(t,e){for(;e.firstChild;)e.removeChild(e.firstChild);for(const s of Array.from(t.childNodes))e.appendChild(s.cloneNode(!0))}#m(t){if(t===this.#p)return[];const e=[];let s=t;for(;s&&s!==this.#p;){const t=s.parentNode;if(!t)return null;e.push(Array.prototype.indexOf.call(t.childNodes,s)),s=t}return s===this.#p?e.reverse():null}#v(t){let e=this.clone;for(const s of t){const t=e.childNodes[s];if(!t)return null;e=t}return e}}const ye=function(t){return!0===t[he]?(console.warn("SignalWatcher should not be applied to the same class more than once."),t):class extends t{constructor(){super(...arguments),this._$St=new Map,this._$So=new ce.State(0),this._$Si=!1}_$Sl(){var t,e;const s=[],i=[];this._$St.forEach((t,e)=>{((null==t?void 0:t.beforeUpdate)?s:i).push(e)});const o=null===(t=this.h)||void 0===t?void 0:t.getPending().filter(t=>t!==this._$Su&&!this._$St.has(t));s.forEach(t=>t.get()),null===(e=this._$Su)||void 0===e||e.get(),o.forEach(t=>t.get()),i.forEach(t=>t.get())}_$Sv(){this.isUpdatePending||queueMicrotask(()=>{this.isUpdatePending||this._$Sl()})}_$S_(){if(void 0!==this.h)return;this._$Su=new ce.Computed(()=>{this._$So.get(),super.performUpdate()});const t=this.h=new ce.subtle.Watcher(function(){const t=pe.get(this);void 0!==t&&(!1===t._$Si&&(new Set(this.getPending()).has(t._$Su)?t.requestUpdate():t._$Sv()),this.watch())});pe.set(t,this),de.register(this,t),t.watch(this._$Su),t.watch(...Array.from(this._$St).map(([t])=>t))}_$Sp(){if(void 0===this.h)return;let t=!1;this.h.unwatch(...ce.subtle.introspectSources(this.h).filter(e=>{var s;const i=!0!==(null===(s=this._$St.get(e))||void 0===s?void 0:s.manualDispose);return i&&this._$St.delete(e),t||(t=!i),i})),t||(this._$Su=void 0,this.h=void 0,this._$St.clear())}updateEffect(t,e){var s;this._$S_();const i=new ce.Computed(()=>{t()});return this.h.watch(i),this._$St.set(i,e),null!==(s=null==e?void 0:e.beforeUpdate)&&void 0!==s&&s?ce.subtle.untrack(()=>i.get()):this.updateComplete.then(()=>ce.subtle.untrack(()=>i.get())),()=>{this._$St.delete(i),this.h.unwatch(i),!1===this.isConnected&&this._$Sp()}}performUpdate(){this.isUpdatePending&&(this._$S_(),this._$Si=!0,this._$So.set(this._$So.get()+1),this._$Si=!1,this._$Sl())}connectedCallback(){super.connectedCallback(),this.requestUpdate()}disconnectedCallback(){super.disconnectedCallback(),queueMicrotask(()=>{!1===this.isConnected&&this._$Sp()})}}}(lt),be=Symbol("select:register-option"),Se=Symbol("select:unregister-option"),$e=Symbol("option:should-register-to-select");var _e,we;t.SelectedContentElement=class extends ye{static{this.styles=(()=>{const t=l`
|
|
177
|
+
tp-selected-content {
|
|
178
|
+
display: inline-block;
|
|
179
|
+
|
|
180
|
+
tp-option {
|
|
181
|
+
display: inline-block;
|
|
182
|
+
|
|
183
|
+
&:not(:last-of-type)::after {
|
|
184
|
+
content: ",";
|
|
185
|
+
white-space: pre;
|
|
186
|
+
margin-right: 0.25em;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
`;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}#S=new WeakMap;createRenderRoot(){return this}render(){const t=this.select?.placeholder??"",e=this.select?.selectedOptions.get().map(t=>t.deref()).filter(Boolean)??[],s=this.#$(e);return e.length?s.map(t=>B`${t}`):B`<span part="placeholder">${t}</span>`}#$(t){return t.map(t=>{let e=this.#S.get(t);return e||(e=new ve(t),this.#S.set(t,e),e.clone.setAttribute("part","selected-content-option"),e.clone[$e]=!1),e.clone})}},e([Nt({context:me,subscribe:!0}),ft(),s("design:type",Function)],t.SelectedContentElement.prototype,"select",void 0),t.SelectedContentElement=e([ht("tp-selected-content")],t.SelectedContentElement),t.OptionElement=class extends ye{constructor(){super(...arguments),this[_e]=!0,this.value=""}static{_e=$e}static{this.styles=(()=>{const t=l`
|
|
191
|
+
tp-option:not([part="selected-content-option"]) {
|
|
192
|
+
display: block;
|
|
193
|
+
cursor: pointer;
|
|
194
|
+
background: var(--tp-select-option-color, white);
|
|
195
|
+
|
|
196
|
+
&:hover {
|
|
197
|
+
background: color-mix(in xyz, var(--tp-select-option-color, white) calc(100% - var(--tp-select-highlight-percent, 20%)), black var(--tp-select-highlight-percent, 20%));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
&[selected] {
|
|
201
|
+
background: var(--tp-select-selection-color, #0078d4);
|
|
202
|
+
color: var(--tp-select-selection-contrast-color, white);
|
|
203
|
+
|
|
204
|
+
&:hover {
|
|
205
|
+
background: color-mix(in xyz, var(--tp-select-selection-color, #0078d4) calc(100% - var(--tp-select-highlight-percent, 20%)), black var(--tp-select-highlight-percent, 20%));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
`;return document.adoptedStyleSheets=[...document.adoptedStyleSheets,t.styleSheet],t})()}connectedCallback(){super.connectedCallback(),this[$e]&&this.select?.[be](this)}disconnectedCallback(){super.disconnectedCallback(),this[$e]&&this.select?.[Se](this)}willUpdate(t){if(!this[$e])return;const e=this.select?.selectedOptions.get().some(t=>t.deref()===this)??!1;this.toggleAttribute("selected",e)}createRenderRoot(){return this}render(){return B``}},e([Nt({context:me,subscribe:!0}),ft(),s("design:type",Function)],t.OptionElement.prototype,"select",void 0),e([ut({type:String,reflect:!0}),s("design:type",Object)],t.OptionElement.prototype,"value",void 0),t.OptionElement=e([ht("tp-option")],t.OptionElement);class Ee extends Event{constructor(t,e){super("change",{bubbles:!0,composed:!1,cancelable:!1,...e}),this.value=t.value,this.selectedOptions=t.selectedOptions}}function Ce(){}t.SelectElement=class extends ye{static{we=this}static{this.formAssociated=!0}static{this.ALLOWED_OPTION_ELEMENTS=[t.OptionElement]}static{this.styles=l`
|
|
210
|
+
:host {
|
|
211
|
+
position: relative;
|
|
212
|
+
display: inline-flex;
|
|
213
|
+
height: fit-content;
|
|
214
|
+
|
|
215
|
+
--tp-select-option-color: white;
|
|
216
|
+
--tp-select-selection-color: #0078d4;
|
|
217
|
+
--tp-select-highlight-percent: 20%;
|
|
218
|
+
--tp-select-selection-contrast-color: white;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
:host([disabled]) {
|
|
222
|
+
pointer-events: none;
|
|
223
|
+
opacity: 0.6;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
:host([open]) {
|
|
227
|
+
[pseudo="indicator"] {
|
|
228
|
+
transform: rotateX(180deg);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
[pseudo="button"] {
|
|
233
|
+
background: white;
|
|
234
|
+
cursor: pointer;
|
|
235
|
+
display: inline-flex;
|
|
236
|
+
align-items: center;
|
|
237
|
+
padding: 0.25em 0.5em;
|
|
238
|
+
|
|
239
|
+
tp-selected-content {
|
|
240
|
+
margin-inline-end: 0.5em;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
[pseudo="indicator"] {
|
|
245
|
+
margin-inline-start: auto;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
tp-popover {
|
|
249
|
+
border: none;
|
|
250
|
+
padding: 0;
|
|
251
|
+
}
|
|
252
|
+
`}#_;#w;get value(){return this.#w.get()}set value(t){!function(t=Ce){new Promise((e,s)=>{setTimeout(()=>{try{const s=t();e(s)}catch(t){s(t)}},0)})}(()=>{const e=t.split(",").map(t=>t.trim()),s=Array.from(this.#_);this.selectedOptions.set(e.map(t=>s.find(e=>e.value===t)).filter(Boolean).map(t=>new WeakRef(t)))})}#E;get placeholder(){return this.#E.get()}set placeholder(t){this.#C(this.#E,"placeholder",t)}#A;#x;#O;constructor(){super(),this.#_=new Set,this.self=this,this.selectedOptions=ge([]),this.#w=((t,e)=>new ce.Computed(t,e))(()=>this.selectedOptions.get().map(t=>t.deref()?.value??"").filter(Boolean).join(",")),this.#E=ge("Select an option"),this.max=1,this.name=null,this.disabled=!1,this.required=!1,this.open=!1,this.#x="",this.#O=null,this.#A=this.attachInternals()}get internals(){return this.#A}get form(){return this.#A.form}get validity(){return this.#A.validity}get validationMessage(){return this.#A.validationMessage}get willValidate(){return this.#A.willValidate}checkValidity(){return this.#A.checkValidity()}reportValidity(){return this.#A.reportValidity()}createRenderRoot(){const e=super.createRenderRoot();return e.adoptedStyleSheets=[...e.adoptedStyleSheets,wt.styles.styleSheet,t.SelectedContentElement.styles.styleSheet,t.OptionElement.styles.styleSheet],e}connectedCallback(){super.connectedCallback(),this.#x=this.value}disconnectedCallback(){super.disconnectedCallback()}render(){return B`
|
|
253
|
+
<div pseudo="button" part="button">
|
|
254
|
+
<slot name="button">
|
|
255
|
+
<tp-selected-content part="selected-content"></tp-selected-content>
|
|
256
|
+
<slot name="indicator">
|
|
257
|
+
<span part="indicator" pseudo="indicator">▾</span>
|
|
258
|
+
</slot>
|
|
259
|
+
</slot>
|
|
260
|
+
</div>
|
|
261
|
+
<tp-popover
|
|
262
|
+
position="start to start / bottom"
|
|
263
|
+
target="[pseudo=button]"
|
|
264
|
+
@click=${this.#N}
|
|
265
|
+
@toggle=${this.#k}
|
|
266
|
+
part="popover">
|
|
267
|
+
<slot name="popover">
|
|
268
|
+
<slot></slot>
|
|
269
|
+
</slot>
|
|
270
|
+
</tp-popover>
|
|
271
|
+
`}updated(t){if(super.updated(t),t.has("max")&&Number.isFinite(this.max)){const t=this.selectedOptions.get();t.length>this.max&&this.selectedOptions.set(t.slice(t.length-this.max))}}willUpdate(t){this.#T(),this.#P()}formResetCallback(){this.value=this.#x}formDisabledCallback(t){this.disabled=t}formStateRestoreCallback(t){if(null!=t)if("string"!=typeof t){if(t instanceof FormData){const e=[];t.forEach(t=>{"string"==typeof t&&e.push(t)}),this.value=e.join(",")}}else this.value=t;else this.value=""}#T(){const t=""===this.value?[]:this.value.split(",");if(1===this.max)this.#A.setFormValue(t[0]??"");else{const e=new FormData,s=this.name??"";for(const i of t)e.append(s,i);this.#A.setFormValue(e)}this.required&&0===t.length?this.#A.setValidity({valueMissing:!0},"Please select an option."):this.#A.setValidity({})}#P(){const t=this.value;if(t===this.#O)return;const e=null===this.#O;if(this.#O=t,e)return;const s=this.selectedOptions.get().map(t=>t.deref()).filter(Boolean);this.dispatchEvent(new Ee({value:t,selectedOptions:s}))}selectOption(t){const e=this.selectedOptions.get();if(e.find(e=>e.deref()===t))return;const s=[...e,new WeakRef(t)],i=s.length>this.max?s.slice(s.length-this.max):s;this.selectedOptions.set(i)}deselectOption(t){const e=this.selectedOptions.get().find(e=>e.deref()===t);e&&this.selectedOptions.set(this.selectedOptions.get().filter(t=>t!==e))}toggleOption(t){this.selectedOptions.get().find(e=>e.deref()===t)?this.deselectOption(t):this.selectOption(t)}[be](t){this.#_.add(t)}[Se](t){this.#_.delete(t);const e=this.selectedOptions.get(),s=e.find(e=>e.deref()===t);s&&this.selectedOptions.set(e.filter(t=>t!==s))}#N(t){if(this.disabled)return;const e=function(t,e){const s=t.indexOf(e);return s<0?[]:t.slice(0,s)}(t.composedPath(),this).find(t=>we.ALLOWED_OPTION_ELEMENTS.some(e=>t instanceof e));if(!e)return;this.toggleOption(e);if(this.selectedOptions.get().length>=this.max){const t=this.shadowRoot?.querySelector("tp-popover");t?.hidePopover()}}#k(t){this.open="open"===t.newState}#C(t,e,s){const i=t.get();i!==s&&(t.set(s),this.requestUpdate(e,i))}},e([
|
|
272
|
+
/**
|
|
273
|
+
* @license
|
|
274
|
+
* Copyright 2017 Google LLC
|
|
275
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
276
|
+
*/
|
|
277
|
+
function({context:t}){return(e,s)=>{const i=new WeakMap;if("object"==typeof s)return{get(){return e.get.call(this)},set(t){return i.get(this).setValue(t),e.set.call(this,t)},init(e){return i.set(this,new Ot(this,{context:t,initialValue:e})),e}};{e.constructor.addInitializer(e=>{i.set(e,new Ot(e,{context:t}))});const o=Object.getOwnPropertyDescriptor(e,s);let n;if(void 0===o){const t=new WeakMap;n={get(){return t.get(this)},set(e){i.get(this).setValue(e),t.set(this,e)},configurable:!0,enumerable:!0}}else{const t=o.set;n={...o,set(e){i.get(this).setValue(e),t?.call(this,e)}}}return void Object.defineProperty(e,s,n)}}}({context:me}),s("design:type",t.SelectElement)],t.SelectElement.prototype,"self",void 0),e([ut({type:String,reflect:!0,noAccessor:!0}),s("design:type",String),s("design:paramtypes",[String])],t.SelectElement.prototype,"value",null),e([ut({type:String,reflect:!0,noAccessor:!0}),s("design:type",String),s("design:paramtypes",[String])],t.SelectElement.prototype,"placeholder",null),e([ut({reflect:!0,converter:{fromAttribute:t=>{if(null==t||""===t)return 1;const e=String(t).trim().toLowerCase();if("infinite"===e)return Number.POSITIVE_INFINITY;const s=Number(e);return Number.isFinite(s)&&s>=1?Math.floor(s):1},toAttribute:t=>Number.isFinite(t)?String(t):"infinite"}}),s("design:type",Number)],t.SelectElement.prototype,"max",void 0),e([ut({type:String,reflect:!0}),s("design:type",Object)],t.SelectElement.prototype,"name",void 0),e([ut({type:Boolean,reflect:!0}),s("design:type",Object)],t.SelectElement.prototype,"disabled",void 0),e([ut({type:Boolean,reflect:!0}),s("design:type",Object)],t.SelectElement.prototype,"required",void 0),e([ut({type:Boolean,reflect:!0}),s("design:type",Object)],t.SelectElement.prototype,"open",void 0),t.SelectElement=we=e([ht("tp-select"),s("design:paramtypes",[])],t.SelectElement),t.SelectChangeEvent=Ee}(this.TelperionElements.Select=this.TelperionElements.Select||{});
|
|
278
|
+
//# sourceMappingURL=index.js.map
|