@telperion/elements 4.0.1 → 4.2.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 +1 -1
- package/fesm/elements.mjs +65 -2
- package/fesm/elements.mjs.map +1 -1
- package/iife/elements.js +12 -7
- package/iife/elements.js.map +1 -1
- package/iife/select/index.js +24 -19
- package/iife/select/index.js.map +1 -1
- package/index.cjs +2 -0
- package/index.cjs.map +1 -1
- package/index.d.cts +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/select/index.cjs +2 -0
- package/select/index.cjs.map +1 -1
- package/select/index.d.cts +92 -14
- package/select/index.d.ts +92 -14
- package/select/index.js +1 -0
- package/select/index.js.map +1 -1
- 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.element.cjs +38 -0
- package/select/select.element.cjs.map +1 -1
- package/select/select.element.js +38 -0
- package/select/select.element.js.map +1 -1
- package/select/selected-content.element.cjs +1 -1
- package/select/selected-content.element.cjs.map +1 -1
- package/select/selected-content.element.js +1 -1
- package/select/selected-content.element.js.map +1 -1
package/iife/select/index.js
CHANGED
|
@@ -4,18 +4,18 @@ this.TelperionElements=this.TelperionElements||{},function(t){"use strict";funct
|
|
|
4
4
|
* Copyright 2019 Google LLC
|
|
5
5
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
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,
|
|
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
8
|
/**
|
|
9
9
|
* @license
|
|
10
10
|
* Copyright 2017 Google LLC
|
|
11
11
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
-
*/Symbol.metadata??=Symbol("metadata"),
|
|
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
13
|
/**
|
|
14
14
|
* @license
|
|
15
15
|
* Copyright 2017 Google LLC
|
|
16
16
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
17
|
*/
|
|
18
|
-
const
|
|
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
19
|
/**
|
|
20
20
|
* @license
|
|
21
21
|
* Copyright 2017 Google LLC
|
|
@@ -36,7 +36,7 @@ const ht=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
|
|
|
36
36
|
* @license
|
|
37
37
|
* Copyright 2017 Google LLC
|
|
38
38
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
-
*/function ft(t){return ut({...t,state:!0,attribute:!1})}const gt={};const
|
|
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
40
|
tp-popover {
|
|
41
41
|
--tp-popover-inline-position: attr(data-ti type(*));
|
|
42
42
|
--tp-popover-block-position: attr(data-tb type(*));
|
|
@@ -74,7 +74,7 @@ const ht=t=>(e,s)=>{void 0!==s?s.addInitializer(()=>{customElements.define(t,e)}
|
|
|
74
74
|
inset-block-end: anchor(var(--tp-popover-block-position));
|
|
75
75
|
}
|
|
76
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??=
|
|
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
78
|
/**
|
|
79
79
|
* @license
|
|
80
80
|
* Copyright 2021 Google LLC
|
|
@@ -91,7 +91,7 @@ let Et=class extends Event{constructor(t,e,s,i){super("context-request",{bubbles
|
|
|
91
91
|
* Copyright 2021 Google LLC
|
|
92
92
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
93
93
|
*/
|
|
94
|
-
let
|
|
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
95
|
/**
|
|
96
96
|
* @license
|
|
97
97
|
* Copyright 2021 Google LLC
|
|
@@ -102,7 +102,7 @@ let At=class{constructor(t,e,s,i){if(this.subscribe=!1,this.provided=!1,this.val
|
|
|
102
102
|
* Copyright 2022 Google LLC
|
|
103
103
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
104
104
|
*/
|
|
105
|
-
function Nt({context:t,subscribe:e}){return(s,i)=>{"object"==typeof i?i.addInitializer(function(){new
|
|
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
106
|
/**
|
|
107
107
|
* @license
|
|
108
108
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -117,14 +117,14 @@ function Mt(t,e){return Object.is(t,e)}
|
|
|
117
117
|
*
|
|
118
118
|
* Use of this source code is governed by an MIT-style license that can be
|
|
119
119
|
* found in the LICENSE file at https://angular.io/license
|
|
120
|
-
*/let Lt=null,Ut=!1,
|
|
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
121
|
/**
|
|
122
122
|
* @license
|
|
123
123
|
* Copyright Google LLC All Rights Reserved.
|
|
124
124
|
*
|
|
125
125
|
* Use of this source code is governed by an MIT-style license that can be
|
|
126
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),
|
|
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
128
|
/**
|
|
129
129
|
* @license
|
|
130
130
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -132,7 +132,7 @@ function Mt(t,e){return Object.is(t,e)}
|
|
|
132
132
|
* Use of this source code is governed by an MIT-style license that can be
|
|
133
133
|
* found in the LICENSE file at https://angular.io/license
|
|
134
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++,
|
|
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
136
|
/**
|
|
137
137
|
* @license
|
|
138
138
|
* Copyright 2024 Bloomberg Finance L.P.
|
|
@@ -156,7 +156,7 @@ function(){throw new Error};function ie(){return Dt(this),this.value}function oe
|
|
|
156
156
|
* Use of this source code is governed by an MIT-style license that can be
|
|
157
157
|
* found in the LICENSE file at https://angular.io/license
|
|
158
158
|
*/
|
|
159
|
-
function(t){const e=Object.create(ne);e.value=t;const s=()=>(Dt(e),e.value);return s[
|
|
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
160
|
/**
|
|
161
161
|
* @license
|
|
162
162
|
* Copyright 2023 Google LLC
|
|
@@ -173,7 +173,7 @@ let ue=!1;const fe=new ce.subtle.Watcher(async()=>{ue||(ue=!0,queueMicrotask(()=
|
|
|
173
173
|
* @license
|
|
174
174
|
* Copyright 2023 Google LLC
|
|
175
175
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
176
|
-
*/ce.State,ce.Computed;const ge=(t,e)=>new ce.State(t,e);const
|
|
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
177
|
tp-selected-content {
|
|
178
178
|
display: inline-block;
|
|
179
179
|
|
|
@@ -187,7 +187,7 @@ let ue=!1;const fe=new ce.subtle.Watcher(async()=>{ue||(ue=!0,queueMicrotask(()=
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
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
|
|
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`<slot name="placeholder"><span part="placeholder">${t}</span></slot>`}#$(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
191
|
tp-option:not([part="selected-content-option"]) {
|
|
192
192
|
display: block;
|
|
193
193
|
cursor: pointer;
|
|
@@ -206,7 +206,7 @@ let ue=!1;const fe=new ce.subtle.Watcher(async()=>{ue||(ue=!0,queueMicrotask(()=
|
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
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:
|
|
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
210
|
:host {
|
|
211
211
|
position: relative;
|
|
212
212
|
display: inline-flex;
|
|
@@ -234,6 +234,11 @@ let ue=!1;const fe=new ce.subtle.Watcher(async()=>{ue||(ue=!0,queueMicrotask(()=
|
|
|
234
234
|
cursor: pointer;
|
|
235
235
|
display: inline-flex;
|
|
236
236
|
align-items: center;
|
|
237
|
+
padding: 0.25em 0.5em;
|
|
238
|
+
|
|
239
|
+
tp-selected-content {
|
|
240
|
+
margin-inline-end: 0.5em;
|
|
241
|
+
}
|
|
237
242
|
}
|
|
238
243
|
|
|
239
244
|
[pseudo="indicator"] {
|
|
@@ -244,7 +249,7 @@ let ue=!1;const fe=new ce.subtle.Watcher(async()=>{ue||(ue=!0,queueMicrotask(()=
|
|
|
244
249
|
border: none;
|
|
245
250
|
padding: 0;
|
|
246
251
|
}
|
|
247
|
-
`}#_;#w;get value(){return this.#w.get()}set value(t){!function(t=
|
|
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`
|
|
248
253
|
<div pseudo="button" part="button">
|
|
249
254
|
<slot name="button">
|
|
250
255
|
<tp-selected-content part="selected-content"></tp-selected-content>
|
|
@@ -256,18 +261,18 @@ let ue=!1;const fe=new ce.subtle.Watcher(async()=>{ue||(ue=!0,queueMicrotask(()=
|
|
|
256
261
|
<tp-popover
|
|
257
262
|
position="start to start / bottom"
|
|
258
263
|
target="[pseudo=button]"
|
|
259
|
-
@click=${this.#
|
|
260
|
-
@toggle=${this.#
|
|
264
|
+
@click=${this.#N}
|
|
265
|
+
@toggle=${this.#k}
|
|
261
266
|
part="popover">
|
|
262
267
|
<slot name="popover">
|
|
263
268
|
<slot></slot>
|
|
264
269
|
</slot>
|
|
265
270
|
</tp-popover>
|
|
266
|
-
`}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.#
|
|
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([
|
|
267
272
|
/**
|
|
268
273
|
* @license
|
|
269
274
|
* Copyright 2017 Google LLC
|
|
270
275
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
271
276
|
*/
|
|
272
|
-
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:
|
|
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||{});
|
|
273
278
|
//# sourceMappingURL=index.js.map
|