@vscode-elements/elements 2.3.1-pre.2 → 2.3.1
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/custom-elements.json +691 -691
- package/dist/bundled.js +2 -2
- package/dist/includes/VscElement.js +1 -1
- package/dist/includes/VscElement.js.map +1 -1
- package/dist/includes/vscode-select/OptionListController.d.ts.map +1 -1
- package/dist/includes/vscode-select/OptionListController.js +9 -3
- package/dist/includes/vscode-select/OptionListController.js.map +1 -1
- package/package.json +1 -1
- package/vscode.css-custom-data.json +24 -24
- package/vscode.html-custom-data.json +52 -52
package/dist/bundled.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),s=new WeakMap;let o=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const i=this.t;if(e&&void 0===t){const e=void 0!==i&&1===i.length;e&&(t=s.get(i)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&s.set(i,t))}return t}toString(){return this.cssText}};const r=t=>new o("string"==typeof t?t:t+"",void 0,i),n=(t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,i,s)=>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.")})(i)+t[s+1]),t[0]);return new o(s,t,i)},l=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return r(e)})(t):t,{is:a,defineProperty:h,getOwnPropertyDescriptor:c,getOwnPropertyNames:d,getOwnPropertySymbols:u,getPrototypeOf:p}=Object,v=globalThis,b=v.trustedTypes,f=b?b.emptyScript:"",g=v.reactiveElementPolyfillSupport,m=(t,e)=>t,x={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},w=(t,e)=>!a(t,e),y={attribute:!0,type:String,converter:x,reflect:!1,useDefault:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),v.litPropertyMetadata??=new WeakMap;let k=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=y){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 i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&h(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:o}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const r=s?.call(this);o?.call(this,e),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=p(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...d(t),...u(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"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 i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const i=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((i,s)=>{if(e)i.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of s){const s=document.createElement("style"),o=t.litNonce;void 0!==o&&s.setAttribute("nonce",o),s.textContent=e.cssText,i.appendChild(s)}})(i,this.constructor.elementStyles),i}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,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==i.converter?.toAttribute?i.converter:x).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:x;this._$Em=s,this[s]=o.fromAttribute(e,t.type)??this._$Ej?.get(s)??null,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const s=this.constructor,o=this[t];if(i??=s.getPropertyOptions(t),!((i.hasChanged??w)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:o},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==o||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&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,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}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){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[m("elementProperties")]=new Map,k[m("finalized")]=new Map,g?.({ReactiveElement:k}),(v.reactiveElementVersions??=[]).push("2.1.0");const $=globalThis,_=$.trustedTypes,S=_?_.createPolicy("lit-html",{createHTML:t=>t}):void 0,B="$lit$",C=`lit$${Math.random().toFixed(9).slice(2)}$`,O="?"+C,A=`<${O}>`,z=document,E=()=>z.createComment(""),I=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,M="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,F=/>/g,V=RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),T=/'/g,N=/"/g,R=/^(?:script|style|textarea|title)$/i,L=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),U=L(1),G=L(2),H=Symbol.for("lit-noChange"),q=Symbol.for("lit-nothing"),W=new WeakMap,K=z.createTreeWalker(z,129);function X(t,e){if(!j(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(e):e}const J=(t,e)=>{const i=t.length-1,s=[];let o,r=2===e?"<svg>":3===e?"<math>":"",n=P;for(let e=0;e<i;e++){const i=t[e];let l,a,h=-1,c=0;for(;c<i.length&&(n.lastIndex=c,a=n.exec(i),null!==a);)c=n.lastIndex,n===P?"!--"===a[1]?n=D:void 0!==a[1]?n=F:void 0!==a[2]?(R.test(a[2])&&(o=RegExp("</"+a[2],"g")),n=V):void 0!==a[3]&&(n=V):n===V?">"===a[0]?(n=o??P,h=-1):void 0===a[1]?h=-2:(h=n.lastIndex-a[2].length,l=a[1],n=void 0===a[3]?V:'"'===a[3]?N:T):n===N||n===T?n=V:n===D||n===F?n=P:(n=V,o=void 0);const d=n===V&&t[e+1].startsWith("/>")?" ":"";r+=n===P?i+A:h>=0?(s.push(l),i.slice(0,h)+B+i.slice(h)+C+d):i+C+(-2===h?e:d)}return[X(t,r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]};class Y{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,r=0;const n=t.length-1,l=this.parts,[a,h]=J(t,e);if(this.el=Y.createElement(a,i),K.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=K.nextNode())&&l.length<n;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(B)){const e=h[r++],i=s.getAttribute(t).split(C),n=/([.?@])?(.*)/.exec(e);l.push({type:1,index:o,name:n[2],strings:i,ctor:"."===n[1]?et:"?"===n[1]?it:"@"===n[1]?st:tt}),s.removeAttribute(t)}else t.startsWith(C)&&(l.push({type:6,index:o}),s.removeAttribute(t));if(R.test(s.tagName)){const t=s.textContent.split(C),e=t.length-1;if(e>0){s.textContent=_?_.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],E()),K.nextNode(),l.push({type:2,index:++o});s.append(t[e],E())}}}else if(8===s.nodeType)if(s.data===O)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(C,t+1));)l.push({type:7,index:o}),t+=C.length-1}o++}}static createElement(t,e){const i=z.createElement("template");return i.innerHTML=t,i}}function Z(t,e,i=t,s){if(e===H)return e;let o=void 0!==s?i._$Co?.[s]:i._$Cl;const r=I(e)?void 0:e._$litDirective$;return o?.constructor!==r&&(o?._$AO?.(!1),void 0===r?o=void 0:(o=new r(t),o._$AT(t,i,s)),void 0!==s?(i._$Co??=[])[s]=o:i._$Cl=o),void 0!==o&&(e=Z(t,o._$AS(t,e.values),o,s)),e}class Q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=q,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=s?.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=Z(this,t,e),I(t)?t===q||null==t||""===t?(this._$AH!==q&&this._$AR(),this._$AH=q):t!==this._$AH&&t!==H&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>j(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!==q&&I(this._$AH)?this._$AA.nextSibling.data=t:this.T(z.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Y.createElement(X(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new class{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:i}=this._$AD,s=(t?.creationScope??z).importNode(e,!0);K.currentNode=s;let o=K.nextNode(),r=0,n=0,l=i[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new Q(o,o.nextSibling,this,t):1===l.type?e=new l.ctor(o,l.name,l.strings,this,t):6===l.type&&(e=new ot(o,this,t)),this._$AV.push(e),l=i[++n]}r!==l?.index&&(o=K.nextNode(),r++)}return K.currentNode=z,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=W.get(t.strings);return void 0===e&&W.set(t.strings,e=new Y(t)),e}k(t){j(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new Q(this.O(E()),this.O(E()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,o){this.type=1,this._$AH=q,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=q}_$AI(t,e=this,i,s){const o=this.strings;let r=!1;if(void 0===o)t=Z(this,t,e,0),r=!I(t)||t!==this._$AH&&t!==H,r&&(this._$AH=t);else{const s=t;let n,l;for(t=o[0],n=0;n<o.length-1;n++)l=Z(this,s[i+n],e,n),l===H&&(l=this._$AH[n]),r||=!I(l)||l!==this._$AH[n],l===q?t=q:t!==q&&(t+=(l??"")+o[n+1]),this._$AH[n]=l}r&&!s&&this.j(t)}j(t){t===q?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===q?void 0:t}}class it extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==q)}}class st extends tt{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){if((t=Z(this,t,e,0)??q)===H)return;const i=this._$AH,s=t===q&&i!==q||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==q&&(i===q||s);s&&this.element.removeEventListener(this.name,this,i),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 ot{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Z(this,t)}}const rt={I:Q},nt=$.litHtmlPolyfillSupport;nt?.(Y,Q),($.litHtmlVersions??=[]).push("3.3.0");const lt=(t,e,i)=>{const s=i?.renderBefore??e;let o=s._$litPart$;if(void 0===o){const t=i?.renderBefore??null;s._$litPart$=o=new Q(e.insertBefore(E(),t),t,void 0,i??{})}return o._$AI(t),o},at=globalThis;let ht=class extends k{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=lt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return H}};ht._$litElement$=!0,ht.finalized=!0,at.litElementHydrateSupport?.({LitElement:ht});const ct=at.litElementPolyfillSupport;ct?.({LitElement:ht}),(at.litElementVersions??=[]).push("4.2.0");const dt={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:w},ut=(t=dt,e,i)=>{const{kind:s,metadata:o}=i;let r=globalThis.litPropertyMetadata.get(o);if(void 0===r&&globalThis.litPropertyMetadata.set(o,r=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),r.set(i.name,t),"accessor"===s){const{name:s}=i;return{set(i){const o=e.get.call(this);e.set.call(this,i),this.requestUpdate(s,o,t)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=i;return function(i){const o=this[s];e.call(this,i),this.requestUpdate(s,o,t)}}throw Error("Unsupported decorator location: "+s)};function pt(t){return(e,i)=>"object"==typeof i?ut(t,e,i):((t,e,i)=>{const s=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),s?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function vt(t){return pt({...t,state:!0,attribute:!1})}const bt=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,i);function ft(t,e){return(i,s,o)=>{const r=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof s?i:o??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return bt(0,0,{get(){let i=t.call(this);return void 0===i&&(i=r(this),(null!==i||this.hasUpdated)&&e.call(this,i)),i}})}return bt(0,0,{get(){return r(this)}})}}let gt;function mt(t){return(e,i)=>{const{slot:s,selector:o}=t??{},r="slot"+(s?`[name=${s}]`:":not([name])");return bt(0,0,{get(){const e=this.renderRoot?.querySelector(r),i=e?.assignedElements(t)??[];return void 0===o?i:i.filter((t=>t.matches(o)))}})}}const xt="2.3.1-pre.2",wt="__vscodeElements_disableRegistryWarning__";class yt extends ht{get version(){return xt}}const kt=t=>e=>{if(!customElements.get(t))return void customElements.define(t,e);if(wt in window)return;const i=document.createElement(t),s=i?.version;let o="";s?s!==xt?(o+="is already registered by a different version of VSCode Elements. ",o+=`This version is "${xt}", while the other one is "${s}".`):o+=`is already registered by the same version of VSCode Elements (${xt}).`:o+="is already registered by an unknown custom element handler class.",console.warn(`[VSCode Elements] ${t} ${o}\nTo suppress this warning, set window.${wt} to true`)};var $t=n`
|
|
1
|
+
const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,i=Symbol(),s=new WeakMap;let o=class{constructor(t,e,s){if(this._$cssResult$=!0,s!==i)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const i=this.t;if(e&&void 0===t){const e=void 0!==i&&1===i.length;e&&(t=s.get(i)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&s.set(i,t))}return t}toString(){return this.cssText}};const r=t=>new o("string"==typeof t?t:t+"",void 0,i),n=(t,...e)=>{const s=1===t.length?t[0]:e.reduce(((e,i,s)=>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.")})(i)+t[s+1]),t[0]);return new o(s,t,i)},l=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return r(e)})(t):t,{is:a,defineProperty:h,getOwnPropertyDescriptor:c,getOwnPropertyNames:d,getOwnPropertySymbols:u,getPrototypeOf:p}=Object,v=globalThis,b=v.trustedTypes,f=b?b.emptyScript:"",g=v.reactiveElementPolyfillSupport,m=(t,e)=>t,x={toAttribute(t,e){switch(e){case Boolean:t=t?f:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let i=t;switch(e){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t)}catch(t){i=null}}return i}},w=(t,e)=>!a(t,e),y={attribute:!0,type:String,converter:x,reflect:!1,useDefault:!1,hasChanged:w};Symbol.metadata??=Symbol("metadata"),v.litPropertyMetadata??=new WeakMap;let k=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=y){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 i=Symbol(),s=this.getPropertyDescriptor(t,i,e);void 0!==s&&h(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:o}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get:s,set(e){const r=s?.call(this);o?.call(this,e),this.requestUpdate(t,r,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y}static _$Ei(){if(this.hasOwnProperty(m("elementProperties")))return;const t=p(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(m("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(m("properties"))){const t=this.properties,e=[...d(t),...u(t)];for(const i of e)this.createProperty(i,t[i])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const i=this._$Eu(t,e);void 0!==i&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const t of i)e.unshift(l(t))}else void 0!==t&&e.push(l(t));return e}static _$Eu(t,e){const i=e.attribute;return!1===i?void 0:"string"==typeof i?i:"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 i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const i=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((i,s)=>{if(e)i.adoptedStyleSheets=s.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of s){const s=document.createElement("style"),o=t.litNonce;void 0!==o&&s.setAttribute("nonce",o),s.textContent=e.cssText,i.appendChild(s)}})(i,this.constructor.elementStyles),i}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,i){this._$AK(t,i)}_$ET(t,e){const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(void 0!==s&&!0===i.reflect){const o=(void 0!==i.converter?.toAttribute?i.converter:x).toAttribute(e,i.type);this._$Em=t,null==o?this.removeAttribute(s):this.setAttribute(s,o),this._$Em=null}}_$AK(t,e){const i=this.constructor,s=i._$Eh.get(t);if(void 0!==s&&this._$Em!==s){const t=i.getPropertyOptions(s),o="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:x;this._$Em=s,this[s]=o.fromAttribute(e,t.type)??this._$Ej?.get(s)??null,this._$Em=null}}requestUpdate(t,e,i){if(void 0!==t){const s=this.constructor,o=this[t];if(i??=s.getPropertyOptions(t),!((i.hasChanged??w)(o,e)||i.useDefault&&i.reflect&&o===this._$Ej?.get(t)&&!this.hasAttribute(s._$Eu(t,i))))return;this.C(t,e,i)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:o},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??e??this[t]),!0!==o||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),!0===s&&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,i]of t){const{wrapped:t}=i,s=this[e];!0!==t||this._$AL.has(e)||void 0===s||this.C(e,void 0,i,s)}}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){}};k.elementStyles=[],k.shadowRootOptions={mode:"open"},k[m("elementProperties")]=new Map,k[m("finalized")]=new Map,g?.({ReactiveElement:k}),(v.reactiveElementVersions??=[]).push("2.1.0");const $=globalThis,_=$.trustedTypes,S=_?_.createPolicy("lit-html",{createHTML:t=>t}):void 0,B="$lit$",C=`lit$${Math.random().toFixed(9).slice(2)}$`,O="?"+C,A=`<${O}>`,z=document,E=()=>z.createComment(""),I=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,M="[ \t\n\f\r]",P=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,D=/-->/g,F=/>/g,V=RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),T=/'/g,N=/"/g,R=/^(?:script|style|textarea|title)$/i,L=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),U=L(1),G=L(2),H=Symbol.for("lit-noChange"),q=Symbol.for("lit-nothing"),W=new WeakMap,K=z.createTreeWalker(z,129);function X(t,e){if(!j(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==S?S.createHTML(e):e}const J=(t,e)=>{const i=t.length-1,s=[];let o,r=2===e?"<svg>":3===e?"<math>":"",n=P;for(let e=0;e<i;e++){const i=t[e];let l,a,h=-1,c=0;for(;c<i.length&&(n.lastIndex=c,a=n.exec(i),null!==a);)c=n.lastIndex,n===P?"!--"===a[1]?n=D:void 0!==a[1]?n=F:void 0!==a[2]?(R.test(a[2])&&(o=RegExp("</"+a[2],"g")),n=V):void 0!==a[3]&&(n=V):n===V?">"===a[0]?(n=o??P,h=-1):void 0===a[1]?h=-2:(h=n.lastIndex-a[2].length,l=a[1],n=void 0===a[3]?V:'"'===a[3]?N:T):n===N||n===T?n=V:n===D||n===F?n=P:(n=V,o=void 0);const d=n===V&&t[e+1].startsWith("/>")?" ":"";r+=n===P?i+A:h>=0?(s.push(l),i.slice(0,h)+B+i.slice(h)+C+d):i+C+(-2===h?e:d)}return[X(t,r+(t[i]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),s]};class Y{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,r=0;const n=t.length-1,l=this.parts,[a,h]=J(t,e);if(this.el=Y.createElement(a,i),K.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(s=K.nextNode())&&l.length<n;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(B)){const e=h[r++],i=s.getAttribute(t).split(C),n=/([.?@])?(.*)/.exec(e);l.push({type:1,index:o,name:n[2],strings:i,ctor:"."===n[1]?et:"?"===n[1]?it:"@"===n[1]?st:tt}),s.removeAttribute(t)}else t.startsWith(C)&&(l.push({type:6,index:o}),s.removeAttribute(t));if(R.test(s.tagName)){const t=s.textContent.split(C),e=t.length-1;if(e>0){s.textContent=_?_.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],E()),K.nextNode(),l.push({type:2,index:++o});s.append(t[e],E())}}}else if(8===s.nodeType)if(s.data===O)l.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(C,t+1));)l.push({type:7,index:o}),t+=C.length-1}o++}}static createElement(t,e){const i=z.createElement("template");return i.innerHTML=t,i}}function Z(t,e,i=t,s){if(e===H)return e;let o=void 0!==s?i._$Co?.[s]:i._$Cl;const r=I(e)?void 0:e._$litDirective$;return o?.constructor!==r&&(o?._$AO?.(!1),void 0===r?o=void 0:(o=new r(t),o._$AT(t,i,s)),void 0!==s?(i._$Co??=[])[s]=o:i._$Cl=o),void 0!==o&&(e=Z(t,o._$AS(t,e.values),o,s)),e}class Q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=q,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=s?.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=Z(this,t,e),I(t)?t===q||null==t||""===t?(this._$AH!==q&&this._$AR(),this._$AH=q):t!==this._$AH&&t!==H&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>j(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!==q&&I(this._$AH)?this._$AA.nextSibling.data=t:this.T(z.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:i}=t,s="number"==typeof i?this._$AC(t):(void 0===i.el&&(i.el=Y.createElement(X(i.h,i.h[0]),this.options)),i);if(this._$AH?._$AD===s)this._$AH.p(e);else{const t=new class{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:i}=this._$AD,s=(t?.creationScope??z).importNode(e,!0);K.currentNode=s;let o=K.nextNode(),r=0,n=0,l=i[0];for(;void 0!==l;){if(r===l.index){let e;2===l.type?e=new Q(o,o.nextSibling,this,t):1===l.type?e=new l.ctor(o,l.name,l.strings,this,t):6===l.type&&(e=new ot(o,this,t)),this._$AV.push(e),l=i[++n]}r!==l?.index&&(o=K.nextNode(),r++)}return K.currentNode=z,s}p(t){let e=0;for(const i of this._$AV)void 0!==i&&(void 0!==i.strings?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}(s,this),i=t.u(this.options);t.p(e),this.T(i),this._$AH=t}}_$AC(t){let e=W.get(t.strings);return void 0===e&&W.set(t.strings,e=new Y(t)),e}k(t){j(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new Q(this.O(E()),this.O(E()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class tt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,o){this.type=1,this._$AH=q,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||""!==i[0]||""!==i[1]?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=q}_$AI(t,e=this,i,s){const o=this.strings;let r=!1;if(void 0===o)t=Z(this,t,e,0),r=!I(t)||t!==this._$AH&&t!==H,r&&(this._$AH=t);else{const s=t;let n,l;for(t=o[0],n=0;n<o.length-1;n++)l=Z(this,s[i+n],e,n),l===H&&(l=this._$AH[n]),r||=!I(l)||l!==this._$AH[n],l===q?t=q:t!==q&&(t+=(l??"")+o[n+1]),this._$AH[n]=l}r&&!s&&this.j(t)}j(t){t===q?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class et extends tt{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===q?void 0:t}}class it extends tt{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==q)}}class st extends tt{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){if((t=Z(this,t,e,0)??q)===H)return;const i=this._$AH,s=t===q&&i!==q||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==q&&(i===q||s);s&&this.element.removeEventListener(this.name,this,i),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 ot{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){Z(this,t)}}const rt={I:Q},nt=$.litHtmlPolyfillSupport;nt?.(Y,Q),($.litHtmlVersions??=[]).push("3.3.0");const lt=(t,e,i)=>{const s=i?.renderBefore??e;let o=s._$litPart$;if(void 0===o){const t=i?.renderBefore??null;s._$litPart$=o=new Q(e.insertBefore(E(),t),t,void 0,i??{})}return o._$AI(t),o},at=globalThis;let ht=class extends k{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=lt(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return H}};ht._$litElement$=!0,ht.finalized=!0,at.litElementHydrateSupport?.({LitElement:ht});const ct=at.litElementPolyfillSupport;ct?.({LitElement:ht}),(at.litElementVersions??=[]).push("4.2.0");const dt={attribute:!0,type:String,converter:x,reflect:!1,hasChanged:w},ut=(t=dt,e,i)=>{const{kind:s,metadata:o}=i;let r=globalThis.litPropertyMetadata.get(o);if(void 0===r&&globalThis.litPropertyMetadata.set(o,r=new Map),"setter"===s&&((t=Object.create(t)).wrapped=!0),r.set(i.name,t),"accessor"===s){const{name:s}=i;return{set(i){const o=e.get.call(this);e.set.call(this,i),this.requestUpdate(s,o,t)},init(e){return void 0!==e&&this.C(s,void 0,t,e),e}}}if("setter"===s){const{name:s}=i;return function(i){const o=this[s];e.call(this,i),this.requestUpdate(s,o,t)}}throw Error("Unsupported decorator location: "+s)};function pt(t){return(e,i)=>"object"==typeof i?ut(t,e,i):((t,e,i)=>{const s=e.hasOwnProperty(i);return e.constructor.createProperty(i,t),s?Object.getOwnPropertyDescriptor(e,i):void 0})(t,e,i)}function vt(t){return pt({...t,state:!0,attribute:!1})}const bt=(t,e,i)=>(i.configurable=!0,i.enumerable=!0,i);function ft(t,e){return(i,s,o)=>{const r=e=>e.renderRoot?.querySelector(t)??null;if(e){const{get:t,set:e}="object"==typeof s?i:o??(()=>{const t=Symbol();return{get(){return this[t]},set(e){this[t]=e}}})();return bt(0,0,{get(){let i=t.call(this);return void 0===i&&(i=r(this),(null!==i||this.hasUpdated)&&e.call(this,i)),i}})}return bt(0,0,{get(){return r(this)}})}}let gt;function mt(t){return(e,i)=>{const{slot:s,selector:o}=t??{},r="slot"+(s?`[name=${s}]`:":not([name])");return bt(0,0,{get(){const e=this.renderRoot?.querySelector(r),i=e?.assignedElements(t)??[];return void 0===o?i:i.filter((t=>t.matches(o)))}})}}const xt="2.3.1",wt="__vscodeElements_disableRegistryWarning__";class yt extends ht{get version(){return xt}}const kt=t=>e=>{if(!customElements.get(t))return void customElements.define(t,e);if(wt in window)return;const i=document.createElement(t),s=i?.version;let o="";s?s!==xt?(o+="is already registered by a different version of VSCode Elements. ",o+=`This version is "${xt}", while the other one is "${s}".`):o+=`is already registered by the same version of VSCode Elements (${xt}).`:o+="is already registered by an unknown custom element handler class.",console.warn(`[VSCode Elements] ${t} ${o}\nTo suppress this warning, set window.${wt} to true`)};var $t=n`
|
|
2
2
|
:host([hidden]) {
|
|
3
3
|
display: none;
|
|
4
4
|
}
|
|
@@ -1045,7 +1045,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1045
1045
|
clip-rule="evenodd"
|
|
1046
1046
|
d="M14.431 3.323l-8.47 10-.79-.036-3.35-4.77.818-.574 2.978 4.24 8.051-9.506.764.646z"
|
|
1047
1047
|
/>
|
|
1048
|
-
</svg>`,{I:je}=rt,Me=()=>document.createComment(""),Pe=(t,e,i)=>{const s=t._$AA.parentNode,o=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=s.insertBefore(Me(),o),r=s.insertBefore(Me(),o);i=new je(e,r,t,t.options)}else{const e=i._$AB.nextSibling,r=i._$AM,n=r!==t;if(n){let e;i._$AQ?.(t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==r._$AU&&i._$AP(e)}if(e!==o||n){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;s.insertBefore(t,o),t=e}}}return i},De=(t,e,i=t)=>(t._$AI(e,i),t),Fe={},Ve=t=>{t._$AP?.(!1,!0);let e=t._$AA;const i=t._$AB.nextSibling;for(;e!==i;){const t=e.nextSibling;e.remove(),e=t}},Te=(t,e,i)=>{const s=new Map;for(let o=e;o<=i;o++)s.set(t[o],o);return s},Ne=Et(class extends It{constructor(t){if(super(t),t.type!==At)throw Error("repeat() can only be used in text expressions")}dt(t,e,i){let s;void 0===i?i=e:void 0!==e&&(s=e);const o=[],r=[];let n=0;for(const e of t)o[n]=s?s(e,n):n,r[n]=i(e,n),n++;return{values:r,keys:o}}render(t,e,i){return this.dt(t,e,i).values}update(t,[e,i,s]){const o=(t=>t._$AH)(t),{values:r,keys:n}=this.dt(e,i,s);if(!Array.isArray(o))return this.ut=n,r;const l=this.ut??=[],a=[];let h,c,d=0,u=o.length-1,p=0,v=r.length-1;for(;d<=u&&p<=v;)if(null===o[d])d++;else if(null===o[u])u--;else if(l[d]===n[p])a[p]=De(o[d],r[p]),d++,p++;else if(l[u]===n[v])a[v]=De(o[u],r[v]),u--,v--;else if(l[d]===n[v])a[v]=De(o[d],r[v]),Pe(t,a[v+1],o[d]),d++,v--;else if(l[u]===n[p])a[p]=De(o[u],r[p]),Pe(t,o[d],o[u]),u--,p++;else if(void 0===h&&(h=Te(n,p,v),c=Te(l,d,u)),h.has(l[d]))if(h.has(l[u])){const e=c.get(n[p]),i=void 0!==e?o[e]:null;if(null===i){const e=Pe(t,o[d]);De(e,r[p]),a[p]=e}else a[p]=De(i,r[p]),Pe(t,o[d],i),o[e]=null;p++}else Ve(o[u]),u--;else Ve(o[d]),d++;for(;p<=v;){const e=Pe(t,a[v+1]);De(e,r[p]),a[p++]=e}for(;d<=u;){const t=o[d++];null!==t&&Ve(t)}return this.ut=n,((t,e=Fe)=>{t._$AH=e})(t,a),H}});var Re=function(t,e,i,s){for(var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(o=t[l])&&(n=(r<3?o(n):r>3?o(e,i,n):o(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Le=class extends yt{constructor(){super(...arguments),this.description="",this.selected=!1,this.disabled=!1,this._initialized=!1,this._handleSlotChange=()=>{this._initialized&&this.dispatchEvent(new Event("vsc-option-state-change",{bubbles:!0}))}}connectedCallback(){super.connectedCallback(),this.updateComplete.then((()=>{this._initialized=!0}))}willUpdate(t){this._initialized&&(t.has("description")||t.has("value")||t.has("selected")||t.has("disabled"))&&this.dispatchEvent(new Event("vsc-option-state-change",{bubbles:!0}))}render(){return U`<slot @slotchange=${this._handleSlotChange}></slot>`}};Le.styles=$t,Re([pt({type:String})],Le.prototype,"value",void 0),Re([pt({type:String})],Le.prototype,"description",void 0),Re([pt({type:Boolean,reflect:!0})],Le.prototype,"selected",void 0),Re([pt({type:Boolean,reflect:!0})],Le.prototype,"disabled",void 0),Le=Re([kt("vscode-option")],Le);const Ue=(t,e)=>{const i={match:!1,ranges:[]},s=t.toLowerCase(),o=e.toLowerCase(),r=s.split(" ");let n=0;return r.forEach(((e,s)=>{if(s>0&&(n+=r[s-1].length+1),i.match)return;const l=e.indexOf(o),a=o.length;0===l&&(i.match=!0,i.ranges.push([n+l,Math.min(n+l+a,t.length)]))})),i},Ge=(t,e)=>{const i={match:!1,ranges:[]};return 0===t.toLowerCase().indexOf(e.toLowerCase())&&(i.match=!0,i.ranges=[[0,e.length]]),i},He=(t,e)=>{const i={match:!1,ranges:[]},s=t.toLowerCase().indexOf(e.toLowerCase());return s>-1&&(i.match=!0,i.ranges=[[s,s+e.length]]),i},qe=(t,e)=>{const i={match:!1,ranges:[]};let s=0,o=0;const r=e.length-1,n=t.toLowerCase(),l=e.toLowerCase();for(let t=0;t<=r;t++){if(o=n.indexOf(l[t],s),-1===o)return{match:!1,ranges:[]};i.match=!0,i.ranges.push([o,o+1]),s=o+1}return i},We=t=>{const e=[];return" "===t?(e.push(U` `),e):(0===t.indexOf(" ")&&e.push(U` `),e.push(U`${t.trimStart().trimEnd()}`),t.lastIndexOf(" ")===t.length-1&&e.push(U` `),e)};class Ke{constructor(t){this._activeIndex=-1,this._options=[],this._filterPattern="",this._filterMethod="fuzzy",this._combobox=!1,this._indexByValue=new Map,this._indexByLabel=new Map,this._selectedIndex=-1,this._selectedIndexes=new Set,this._multiSelect=!1,this._numOfVisibleOptions=0,(this._host=t).addController(this)}hostConnected(){}get activeIndex(){return this._activeIndex}set activeIndex(t){this._activeIndex=t,this._host.requestUpdate()}get relativeActiveIndex(){return this._options[this._activeIndex]?.filteredIndex??-1}set comboboxMode(t){this._combobox=t,this._host.requestUpdate()}get comboboxMode(){return this._combobox}get multiSelect(){return this._multiSelect}set multiSelect(t){this._selectedIndex=-1,this._selectedIndexes.clear(),this._multiSelect=t,this._host.requestUpdate()}get selectedIndex(){return this._selectedIndex}set selectedIndex(t){-1!==this._selectedIndex&&(this._options[this._selectedIndex].selected??=!1);const e=this.getOptionByIndex(t);this._selectedIndex=e?t:-1,this._host.requestUpdate()}get selectedIndexes(){return Array.from(this._selectedIndexes)}set selectedIndexes(t){this._selectedIndexes.forEach((t=>{this._options[t].selected=!1})),this._selectedIndexes=new Set(t),t.forEach((t=>{void 0!==this._options[t]&&(this._options[t].selected=!0)})),this._host.requestUpdate()}set value(t){if(this._multiSelect){const e=t.map((t=>this._indexByValue.get(t))).filter((t=>void 0!==t));this._selectedIndexes=new Set(e)}else this._selectedIndex=this._indexByValue.get(t)??-1;this._host.requestUpdate()}get value(){return this._multiSelect?this._selectedIndexes.size>0?Array.from(this._selectedIndexes).map((t=>this._options[t].value)):[]:this._selectedIndex>-1?this._options[this._selectedIndex].value:""}set multiSelectValue(t){const e=t.map((t=>this._indexByValue.get(t))).filter((t=>void 0!==t));this._selectedIndexes=new Set(e)}get multiSelectValue(){return this._selectedIndexes.size>0?Array.from(this._selectedIndexes).map((t=>this._options[t].value)):[]}get filterPattern(){return this._filterPattern}set filterPattern(t){t!==this._filterPattern&&(this._filterPattern=t,this._updateState())}get filterMethod(){return this._filterMethod}set filterMethod(t){t!==this._filterMethod&&(this._filterMethod=t,this._updateState())}get options(){return this._options}get numOfVisibleOptions(){return this._numOfVisibleOptions}get numOptions(){return this._options.length}populate(t){this._indexByValue.clear(),this._indexByLabel.clear(),this._options=t.map(((t,e)=>(this._indexByValue.set(t.value??"",e),this._indexByLabel.set(t.label??"",e),{description:t.description??"",disabled:t.disabled??!1,label:t.label??"",selected:t.selected??!1,value:t.value??"",index:e,filteredIndex:e,ranges:[],visible:!0}))),this._numOfVisibleOptions=this._options.length}add(t){const e=this._options.length,{description:i,disabled:s,label:o,selected:r,value:n}=t;let l=!0,a=[];if(this._combobox&&""!==this._filterPattern){const t=this._searchByPattern(o??"");l=t.match,a=t.ranges}this._indexByValue.set(n??"",e),this._indexByLabel.set(o??"",e),r&&(this._selectedIndex=e,this._selectedIndexes.add(e),this._activeIndex=e),this._options.push({index:e,filteredIndex:e,description:i??"",disabled:s??!1,label:o??"",selected:r??!1,value:n??"",visible:l,ranges:a}),l&&(this._numOfVisibleOptions+=1)}clear(){this._options=[],this._indexByValue.clear(),this._indexByLabel.clear(),this._numOfVisibleOptions=0}getIsIndexSelected(t){return this._multiSelect?this._selectedIndexes.has(t):this._selectedIndex===t}expandMultiSelection(t){t.forEach((t=>{const e=this._indexByValue.get(t)??-1;-1!==e&&this._selectedIndexes.add(e)})),this._host.requestUpdate()}toggleActiveMultiselectOption(){const t=this._options[this._activeIndex]??null;if(!t)return;this._selectedIndexes.has(t.index)?this._selectedIndexes.delete(t.index):this._selectedIndexes.add(t.index),this._host.requestUpdate()}toggleOptionSelected(t){const e=this._selectedIndexes.has(t);this._options[t].selected=!this._options[t].selected,e?this._selectedIndexes.delete(t):this._selectedIndexes.add(t),this._host.requestUpdate()}getActiveOption(){return this._options[this._activeIndex]??null}getSelectedOption(){return this._options[this._selectedIndex]??null}getOptionByIndex(t){return this._options[t]??null}findOptionIndex(t){return this._indexByValue.get(t)??-1}getOptionByValue(t,e=!1){const i=this._indexByValue.get(t)??-1;return-1===i?null:e||this._options[i].visible?this._options[i]:null}getOptionByLabel(t){const e=this._indexByLabel.get(t)??-1;return-1===e?null:this._options[e]}next(t){let e=-1;for(let i=(t??this._activeIndex)+1;i<this._options.length;i++)if(this._options[i]&&!this._options[i].disabled&&this._options[i].visible){e=i;break}return e>-1?this._options[e]:null}prev(t){let e=-1;for(let i=(t??this._activeIndex)-1;i>=0;i--)if(this._options[i]&&!this._options[i].disabled&&this._options[i].visible){e=i;break}return e>-1?this._options[e]:null}activateDefault(){if(this._multiSelect){if(this._selectedIndexes.size>0){const t=this._selectedIndexes.values().next();this._activeIndex=t.value?t.value:0}}else this._selectedIndex>-1?this._activeIndex=this._selectedIndex:this._activeIndex=0;this._host.requestUpdate()}selectAll(){this._multiSelect&&(this._options.forEach(((t,e)=>{this._options[e].selected=!0,this._selectedIndexes.add(e)})),this._host.requestUpdate())}selectNone(){this._multiSelect&&(this._options.forEach(((t,e)=>{this._options[e].selected=!1})),this._selectedIndexes.clear(),this._host.requestUpdate())}_searchByPattern(t){let e;switch(this._filterMethod){case"startsWithPerTerm":e=Ue(t,this._filterPattern);break;case"startsWith":e=Ge(t,this._filterPattern);break;case"contains":e=He(t,this._filterPattern);break;default:e=qe(t,this._filterPattern)}return e}_updateState(){if(this._combobox&&""!==this._filterPattern){let t=-1;this._numOfVisibleOptions=0,this._options.forEach((({label:e},i)=>{const s=this._searchByPattern(e);this._options[i].visible=s.match,this._options[i].ranges=s.ranges,this._options[i].filteredIndex=s.match?++t:-1,s.match&&(this._numOfVisibleOptions+=1)}))}else this._options.forEach(((t,e)=>{this._options[e].visible=!0,this._options[e].ranges=[]})),this._numOfVisibleOptions=this._options.length;this._host.requestUpdate()}}const Xe=[$t,n`
|
|
1048
|
+
</svg>`,{I:je}=rt,Me=()=>document.createComment(""),Pe=(t,e,i)=>{const s=t._$AA.parentNode,o=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=s.insertBefore(Me(),o),r=s.insertBefore(Me(),o);i=new je(e,r,t,t.options)}else{const e=i._$AB.nextSibling,r=i._$AM,n=r!==t;if(n){let e;i._$AQ?.(t),i._$AM=t,void 0!==i._$AP&&(e=t._$AU)!==r._$AU&&i._$AP(e)}if(e!==o||n){let t=i._$AA;for(;t!==e;){const e=t.nextSibling;s.insertBefore(t,o),t=e}}}return i},De=(t,e,i=t)=>(t._$AI(e,i),t),Fe={},Ve=t=>{t._$AP?.(!1,!0);let e=t._$AA;const i=t._$AB.nextSibling;for(;e!==i;){const t=e.nextSibling;e.remove(),e=t}},Te=(t,e,i)=>{const s=new Map;for(let o=e;o<=i;o++)s.set(t[o],o);return s},Ne=Et(class extends It{constructor(t){if(super(t),t.type!==At)throw Error("repeat() can only be used in text expressions")}dt(t,e,i){let s;void 0===i?i=e:void 0!==e&&(s=e);const o=[],r=[];let n=0;for(const e of t)o[n]=s?s(e,n):n,r[n]=i(e,n),n++;return{values:r,keys:o}}render(t,e,i){return this.dt(t,e,i).values}update(t,[e,i,s]){const o=(t=>t._$AH)(t),{values:r,keys:n}=this.dt(e,i,s);if(!Array.isArray(o))return this.ut=n,r;const l=this.ut??=[],a=[];let h,c,d=0,u=o.length-1,p=0,v=r.length-1;for(;d<=u&&p<=v;)if(null===o[d])d++;else if(null===o[u])u--;else if(l[d]===n[p])a[p]=De(o[d],r[p]),d++,p++;else if(l[u]===n[v])a[v]=De(o[u],r[v]),u--,v--;else if(l[d]===n[v])a[v]=De(o[d],r[v]),Pe(t,a[v+1],o[d]),d++,v--;else if(l[u]===n[p])a[p]=De(o[u],r[p]),Pe(t,o[d],o[u]),u--,p++;else if(void 0===h&&(h=Te(n,p,v),c=Te(l,d,u)),h.has(l[d]))if(h.has(l[u])){const e=c.get(n[p]),i=void 0!==e?o[e]:null;if(null===i){const e=Pe(t,o[d]);De(e,r[p]),a[p]=e}else a[p]=De(i,r[p]),Pe(t,o[d],i),o[e]=null;p++}else Ve(o[u]),u--;else Ve(o[d]),d++;for(;p<=v;){const e=Pe(t,a[v+1]);De(e,r[p]),a[p++]=e}for(;d<=u;){const t=o[d++];null!==t&&Ve(t)}return this.ut=n,((t,e=Fe)=>{t._$AH=e})(t,a),H}});var Re=function(t,e,i,s){for(var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,l=t.length-1;l>=0;l--)(o=t[l])&&(n=(r<3?o(n):r>3?o(e,i,n):o(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};let Le=class extends yt{constructor(){super(...arguments),this.description="",this.selected=!1,this.disabled=!1,this._initialized=!1,this._handleSlotChange=()=>{this._initialized&&this.dispatchEvent(new Event("vsc-option-state-change",{bubbles:!0}))}}connectedCallback(){super.connectedCallback(),this.updateComplete.then((()=>{this._initialized=!0}))}willUpdate(t){this._initialized&&(t.has("description")||t.has("value")||t.has("selected")||t.has("disabled"))&&this.dispatchEvent(new Event("vsc-option-state-change",{bubbles:!0}))}render(){return U`<slot @slotchange=${this._handleSlotChange}></slot>`}};Le.styles=$t,Re([pt({type:String})],Le.prototype,"value",void 0),Re([pt({type:String})],Le.prototype,"description",void 0),Re([pt({type:Boolean,reflect:!0})],Le.prototype,"selected",void 0),Re([pt({type:Boolean,reflect:!0})],Le.prototype,"disabled",void 0),Le=Re([kt("vscode-option")],Le);const Ue=(t,e)=>{const i={match:!1,ranges:[]},s=t.toLowerCase(),o=e.toLowerCase(),r=s.split(" ");let n=0;return r.forEach(((e,s)=>{if(s>0&&(n+=r[s-1].length+1),i.match)return;const l=e.indexOf(o),a=o.length;0===l&&(i.match=!0,i.ranges.push([n+l,Math.min(n+l+a,t.length)]))})),i},Ge=(t,e)=>{const i={match:!1,ranges:[]};return 0===t.toLowerCase().indexOf(e.toLowerCase())&&(i.match=!0,i.ranges=[[0,e.length]]),i},He=(t,e)=>{const i={match:!1,ranges:[]},s=t.toLowerCase().indexOf(e.toLowerCase());return s>-1&&(i.match=!0,i.ranges=[[s,s+e.length]]),i},qe=(t,e)=>{const i={match:!1,ranges:[]};let s=0,o=0;const r=e.length-1,n=t.toLowerCase(),l=e.toLowerCase();for(let t=0;t<=r;t++){if(o=n.indexOf(l[t],s),-1===o)return{match:!1,ranges:[]};i.match=!0,i.ranges.push([o,o+1]),s=o+1}return i},We=t=>{const e=[];return" "===t?(e.push(U` `),e):(0===t.indexOf(" ")&&e.push(U` `),e.push(U`${t.trimStart().trimEnd()}`),t.lastIndexOf(" ")===t.length-1&&e.push(U` `),e)};class Ke{constructor(t){this._activeIndex=-1,this._options=[],this._filterPattern="",this._filterMethod="fuzzy",this._combobox=!1,this._indexByValue=new Map,this._indexByLabel=new Map,this._selectedIndex=-1,this._selectedIndexes=new Set,this._multiSelect=!1,this._numOfVisibleOptions=0,(this._host=t).addController(this)}hostConnected(){}get activeIndex(){return this._activeIndex}set activeIndex(t){this._activeIndex=t,this._host.requestUpdate()}get relativeActiveIndex(){return this._options[this._activeIndex]?.filteredIndex??-1}set comboboxMode(t){this._combobox=t,this._host.requestUpdate()}get comboboxMode(){return this._combobox}get multiSelect(){return this._multiSelect}set multiSelect(t){this._selectedIndex=-1,this._selectedIndexes.clear(),this._multiSelect=t,this._host.requestUpdate()}get selectedIndex(){return this._selectedIndex}set selectedIndex(t){-1!==this._selectedIndex&&this._options[this._selectedIndex]&&(this._options[this._selectedIndex].selected??=!1);const e=this.getOptionByIndex(t);this._selectedIndex=e?t:-1,this._host.requestUpdate()}get selectedIndexes(){return Array.from(this._selectedIndexes)}set selectedIndexes(t){this._selectedIndexes.forEach((t=>{this._options[t].selected=!1})),this._selectedIndexes=new Set(t),t.forEach((t=>{void 0!==this._options[t]&&(this._options[t].selected=!0)})),this._host.requestUpdate()}set value(t){if(this._multiSelect){const e=t.map((t=>this._indexByValue.get(t))).filter((t=>void 0!==t));this._selectedIndexes=new Set(e)}else this._selectedIndex=this._indexByValue.get(t)??-1;this._host.requestUpdate()}get value(){return this._multiSelect?this._selectedIndexes.size>0?Array.from(this._selectedIndexes).filter((t=>t>=0&&t<this._options.length)).map((t=>this._options[t].value)):[]:this._selectedIndex>-1&&this._selectedIndex<this._options.length?this._options[this._selectedIndex].value:""}set multiSelectValue(t){const e=t.map((t=>this._indexByValue.get(t))).filter((t=>void 0!==t));this._selectedIndexes=new Set(e)}get multiSelectValue(){return this._selectedIndexes.size>0?Array.from(this._selectedIndexes).map((t=>this._options[t].value)):[]}get filterPattern(){return this._filterPattern}set filterPattern(t){t!==this._filterPattern&&(this._filterPattern=t,this._updateState())}get filterMethod(){return this._filterMethod}set filterMethod(t){t!==this._filterMethod&&(this._filterMethod=t,this._updateState())}get options(){return this._options}get numOfVisibleOptions(){return this._numOfVisibleOptions}get numOptions(){return this._options.length}populate(t){this._indexByValue.clear(),this._indexByLabel.clear(),this._options=t.map(((t,e)=>(this._indexByValue.set(t.value??"",e),this._indexByLabel.set(t.label??"",e),{description:t.description??"",disabled:t.disabled??!1,label:t.label??"",selected:t.selected??!1,value:t.value??"",index:e,filteredIndex:e,ranges:[],visible:!0}))),this._numOfVisibleOptions=this._options.length}add(t){const e=this._options.length,{description:i,disabled:s,label:o,selected:r,value:n}=t;let l=!0,a=[];if(this._combobox&&""!==this._filterPattern){const t=this._searchByPattern(o??"");l=t.match,a=t.ranges}this._indexByValue.set(n??"",e),this._indexByLabel.set(o??"",e),r&&(this._selectedIndex=e,this._selectedIndexes.add(e),this._activeIndex=e),this._options.push({index:e,filteredIndex:e,description:i??"",disabled:s??!1,label:o??"",selected:r??!1,value:n??"",visible:l,ranges:a}),l&&(this._numOfVisibleOptions+=1)}clear(){this._options=[],this._indexByValue.clear(),this._indexByLabel.clear(),this._numOfVisibleOptions=0,this._selectedIndex=-1,this._selectedIndexes.clear(),this._activeIndex=-1}getIsIndexSelected(t){return this._multiSelect?this._selectedIndexes.has(t):this._selectedIndex===t}expandMultiSelection(t){t.forEach((t=>{const e=this._indexByValue.get(t)??-1;-1!==e&&this._selectedIndexes.add(e)})),this._host.requestUpdate()}toggleActiveMultiselectOption(){const t=this._options[this._activeIndex]??null;if(!t)return;this._selectedIndexes.has(t.index)?this._selectedIndexes.delete(t.index):this._selectedIndexes.add(t.index),this._host.requestUpdate()}toggleOptionSelected(t){const e=this._selectedIndexes.has(t);this._options[t].selected=!this._options[t].selected,e?this._selectedIndexes.delete(t):this._selectedIndexes.add(t),this._host.requestUpdate()}getActiveOption(){return this._options[this._activeIndex]??null}getSelectedOption(){return this._options[this._selectedIndex]??null}getOptionByIndex(t){return this._options[t]??null}findOptionIndex(t){return this._indexByValue.get(t)??-1}getOptionByValue(t,e=!1){const i=this._indexByValue.get(t)??-1;return-1===i?null:e||this._options[i].visible?this._options[i]:null}getOptionByLabel(t){const e=this._indexByLabel.get(t)??-1;return-1===e?null:this._options[e]}next(t){let e=-1;for(let i=(t??this._activeIndex)+1;i<this._options.length;i++)if(this._options[i]&&!this._options[i].disabled&&this._options[i].visible){e=i;break}return e>-1?this._options[e]:null}prev(t){let e=-1;for(let i=(t??this._activeIndex)-1;i>=0;i--)if(this._options[i]&&!this._options[i].disabled&&this._options[i].visible){e=i;break}return e>-1?this._options[e]:null}activateDefault(){if(this._multiSelect){if(this._selectedIndexes.size>0){const t=this._selectedIndexes.values().next();this._activeIndex=t.value?t.value:0}}else this._selectedIndex>-1?this._activeIndex=this._selectedIndex:this._activeIndex=0;this._host.requestUpdate()}selectAll(){this._multiSelect&&(this._options.forEach(((t,e)=>{this._options[e].selected=!0,this._selectedIndexes.add(e)})),this._host.requestUpdate())}selectNone(){this._multiSelect&&(this._options.forEach(((t,e)=>{this._options[e].selected=!1})),this._selectedIndexes.clear(),this._host.requestUpdate())}_searchByPattern(t){let e;switch(this._filterMethod){case"startsWithPerTerm":e=Ue(t,this._filterPattern);break;case"startsWith":e=Ge(t,this._filterPattern);break;case"contains":e=He(t,this._filterPattern);break;default:e=qe(t,this._filterPattern)}return e}_updateState(){if(this._combobox&&""!==this._filterPattern){let t=-1;this._numOfVisibleOptions=0,this._options.forEach((({label:e},i)=>{const s=this._searchByPattern(e);this._options[i].visible=s.match,this._options[i].ranges=s.ranges,this._options[i].filteredIndex=s.match?++t:-1,s.match&&(this._numOfVisibleOptions+=1)}))}else this._options.forEach(((t,e)=>{this._options[e].visible=!0,this._options[e].ranges=[]})),this._numOfVisibleOptions=this._options.length;this._host.requestUpdate()}}const Xe=[$t,n`
|
|
1049
1049
|
:host {
|
|
1050
1050
|
display: block;
|
|
1051
1051
|
position: relative;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VscElement.js","sourceRoot":"","sources":["../../src/includes/VscElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,KAAK,CAAC;AAE/B,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"VscElement.js","sourceRoot":"","sources":["../../src/includes/VscElement.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,KAAK,CAAC;AAE/B,MAAM,OAAO,GAAG,OAAO,CAAC;AACxB,MAAM,UAAU,GAAG,2CAA2C,CAAC;AAE/D,MAAM,OAAO,UAAW,SAAQ,UAAU;IACxC,8BAA8B;IAC9B,IAAI,OAAO;QACT,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AASD;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,OAAe,EAAE,EAAE;IAC/C,OAAO,CAAC,aAAiC,EAAE,EAAE;QAC3C,MAAM,kBAAkB,GAAG,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QAEvD,IAAI,CAAC,kBAAkB,EAAE,CAAC;YACxB,cAAc,CAAC,MAAM,CAAC,OAAO,EAAE,aAAyC,CAAC,CAAC;YAC1E,OAAO;QACT,CAAC;QAED,IAAI,UAAU,IAAI,MAAM,EAAE,CAAC;YACzB,OAAO;QACT,CAAC;QAED,MAAM,EAAE,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QAC3C,MAAM,cAAc,GAAI,EAAiB,EAAE,OAAO,CAAC;QACnD,IAAI,OAAO,GAAG,EAAE,CAAC;QAEjB,IAAI,CAAC,cAAc,EAAE,CAAC;YACpB,OAAO;gBACL,mEAAmE,CAAC;QACxE,CAAC;aAAM,IAAI,cAAc,KAAK,OAAO,EAAE,CAAC;YACtC,OAAO;gBACL,mEAAmE,CAAC;YACtE,OAAO,IAAI,oBAAoB,OAAO,8BAA8B,cAAc,IAAI,CAAC;QACzF,CAAC;aAAM,CAAC;YACN,OAAO,IAAI,iEAAiE,OAAO,IAAI,CAAC;QAC1F,CAAC;QAED,sCAAsC;QACtC,OAAO,CAAC,IAAI,CACV,qBAAqB,OAAO,IAAI,OAAO,0CAA0C,UAAU,UAAU,CACtG,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {LitElement} from 'lit';\n\nconst VERSION = '2.3.1';\nconst CONFIG_KEY = '__vscodeElements_disableRegistryWarning__';\n\nexport class VscElement extends LitElement {\n /** VSCode Elements version */\n get version(): string {\n return VERSION;\n }\n}\n\ntype CustomElementClass = Omit<typeof HTMLElement, 'new'>;\n\nexport type Constructor<T> = {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n new (...args: any[]): T;\n};\n\n/**\n * Own implementation of Lit's customElement decorator.\n */\nexport const customElement = (tagName: string) => {\n return (classOrTarget: CustomElementClass) => {\n const customElementClass = customElements.get(tagName);\n\n if (!customElementClass) {\n customElements.define(tagName, classOrTarget as CustomElementConstructor);\n return;\n }\n\n if (CONFIG_KEY in window) {\n return;\n }\n\n const el = document.createElement(tagName);\n const anotherVersion = (el as VscElement)?.version;\n let message = '';\n\n if (!anotherVersion) {\n message +=\n 'is already registered by an unknown custom element handler class.';\n } else if (anotherVersion !== VERSION) {\n message +=\n 'is already registered by a different version of VSCode Elements. ';\n message += `This version is \"${VERSION}\", while the other one is \"${anotherVersion}\".`;\n } else {\n message += `is already registered by the same version of VSCode Elements (${VERSION}).`;\n }\n\n // eslint-disable-next-line no-console\n console.warn(\n `[VSCode Elements] ${tagName} ${message}\\nTo suppress this warning, set window.${CONFIG_KEY} to true`\n );\n };\n};\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionListController.d.ts","sourceRoot":"","sources":["../../../src/includes/vscode-select/OptionListController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,sBAAsB,EAAC,MAAM,KAAK,CAAC;AAC/D,OAAO,EAAC,YAAY,EAAE,cAAc,EAAE,MAAM,EAAC,MAAM,SAAS,CAAC;AAS7D,qBAAa,oBAAqB,YAAW,kBAAkB;IAC7D,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,KAAK,CAAyB;IACtC,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,cAAc,CAAM;IAC5B,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,aAAa,CAAkC;IACvD,OAAO,CAAC,aAAa,CAAkC;IACvD,OAAO,CAAC,cAAc,CAAM;IAC5B,OAAO,CAAC,gBAAgB,CAA0B;IAClD,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,oBAAoB,CAAK;gBAErB,IAAI,EAAE,sBAAsB;IAIxC,aAAa,IAAI,IAAI;IAIrB,IAAI,WAAW,IAAI,MAAM,CAExB;IAED,IAAI,WAAW,CAAC,KAAK,EAAE,MAAM,EAG5B;IAED,IAAI,mBAAmB,IAAI,MAAM,CAEhC;IAED,IAAI,YAAY,CAAC,OAAO,EAAE,OAAO,EAGhC;IAED,IAAI,YAAY,IALU,OAAO,CAOhC;IAED,IAAI,WAAW,IAIc,OAAO,CAFnC;IAED,IAAI,WAAW,CAAC,WAAW,EAAE,OAAO,EAKnC;IAED,IAAI,aAAa,IAIQ,MAAM,CAF9B;IAED,IAAI,aAAa,CAAC,KAAK,EAAE,MAAM,EAS9B;IAED,IAAI,eAAe,IAIQ,MAAM,EAAE,CAFlC;IAED,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,EAAE,EAclC;IAED,IAAI,KAAK,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,EAWpC;IAED,IAAI,KAAK,IAAI,MAAM,GAAG,MAAM,EAAE,
|
|
1
|
+
{"version":3,"file":"OptionListController.d.ts","sourceRoot":"","sources":["../../../src/includes/vscode-select/OptionListController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,EAAE,sBAAsB,EAAC,MAAM,KAAK,CAAC;AAC/D,OAAO,EAAC,YAAY,EAAE,cAAc,EAAE,MAAM,EAAC,MAAM,SAAS,CAAC;AAS7D,qBAAa,oBAAqB,YAAW,kBAAkB;IAC7D,OAAO,CAAC,YAAY,CAAM;IAC1B,OAAO,CAAC,KAAK,CAAyB;IACtC,OAAO,CAAC,QAAQ,CAAwB;IACxC,OAAO,CAAC,cAAc,CAAM;IAC5B,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,SAA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AO,EAAE,MAAM,EAAE;IAwB1B,GAAG,CAAC,MAAM,EAAE,MAAM;IAsClB,KAAK;IAUL,kBAAkB,CAAC,KAAK,EAAE,MAAM;IAQhC,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE;IAYrC,6BAA6B;IAkB7B,oBAAoB,CAAC,QAAQ,EAAE,MAAM;IAarC,eAAe,IAAI,cAAc,GAAG,IAAI;IAIxC,iBAAiB,IAAI,cAAc,GAAG,IAAI;IAI1C,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAI9B,eAAe,CAAC,KAAK,EAAE,MAAM;IAI7B,gBAAgB,CACd,KAAK,EAAE,MAAM,EACb,oBAAoB,UAAQ,GAC3B,cAAc,GAAG,IAAI;IAcxB,gBAAgB,CAAC,KAAK,EAAE,MAAM;IAU9B,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;IAkB/C,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,IAAI;IAmB/C,eAAe;IAkBf,SAAS;IAaT,UAAU;IAiBV,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,YAAY;CA6BrB"}
|
|
@@ -46,7 +46,7 @@ export class OptionListController {
|
|
|
46
46
|
return this._selectedIndex;
|
|
47
47
|
}
|
|
48
48
|
set selectedIndex(index) {
|
|
49
|
-
if (this._selectedIndex !== -1) {
|
|
49
|
+
if (this._selectedIndex !== -1 && this._options[this._selectedIndex]) {
|
|
50
50
|
this._options[this._selectedIndex].selected ??= false;
|
|
51
51
|
}
|
|
52
52
|
const op = this.getOptionByIndex(index);
|
|
@@ -83,11 +83,14 @@ export class OptionListController {
|
|
|
83
83
|
get value() {
|
|
84
84
|
if (this._multiSelect) {
|
|
85
85
|
return this._selectedIndexes.size > 0
|
|
86
|
-
? Array.from(this._selectedIndexes)
|
|
86
|
+
? Array.from(this._selectedIndexes)
|
|
87
|
+
.filter((i) => i >= 0 && i < this._options.length)
|
|
88
|
+
.map((v) => this._options[v].value)
|
|
87
89
|
: [];
|
|
88
90
|
}
|
|
89
91
|
else {
|
|
90
|
-
return this._selectedIndex > -1
|
|
92
|
+
return this._selectedIndex > -1 &&
|
|
93
|
+
this._selectedIndex < this._options.length
|
|
91
94
|
? this._options[this._selectedIndex].value
|
|
92
95
|
: '';
|
|
93
96
|
}
|
|
@@ -189,6 +192,9 @@ export class OptionListController {
|
|
|
189
192
|
this._indexByValue.clear();
|
|
190
193
|
this._indexByLabel.clear();
|
|
191
194
|
this._numOfVisibleOptions = 0;
|
|
195
|
+
this._selectedIndex = -1;
|
|
196
|
+
this._selectedIndexes.clear();
|
|
197
|
+
this._activeIndex = -1;
|
|
192
198
|
}
|
|
193
199
|
getIsIndexSelected(index) {
|
|
194
200
|
if (this._multiSelect) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OptionListController.js","sourceRoot":"","sources":["../../../src/includes/vscode-select/OptionListController.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,WAAW,EAEX,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAEnB,MAAM,OAAO,oBAAoB;IAc/B,YAAY,IAA4B;QAbhC,iBAAY,GAAG,CAAC,CAAC,CAAC;QAElB,aAAQ,GAAqB,EAAE,CAAC;QAChC,mBAAc,GAAG,EAAE,CAAC;QACpB,kBAAa,GAAiB,OAAO,CAAC;QACtC,cAAS,GAAG,KAAK,CAAC;QAClB,kBAAa,GAAwB,IAAI,GAAG,EAAE,CAAC;QAC/C,kBAAa,GAAwB,IAAI,GAAG,EAAE,CAAC;QAC/C,mBAAc,GAAG,CAAC,CAAC,CAAC;QACpB,qBAAgB,GAAgB,IAAI,GAAG,EAAE,CAAC;QAC1C,iBAAY,GAAG,KAAK,CAAC;QACrB,yBAAoB,GAAG,CAAC,CAAC;QAG/B,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;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AM,GAAG,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC;gBAC5C,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;gBACxC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;gBACxC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,aAAa,GAAG,MAAM,CAAC,KAAK;oBAC3C,CAAC,CAAC,EAAE,qBAAqB;oBACzB,CAAC,CAAC,CAAC,CAAC,CAAC;gBAEP,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;oBACjB,IAAI,CAAC,oBAAoB,IAAI,CAAC,CAAC;gBACjC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;CAGF","sourcesContent":["import {ReactiveController, ReactiveControllerHost} from 'lit';\nimport {FilterMethod, InternalOption, Option} from './types';\nimport {\n containsSearch,\n fuzzySearch,\n SearchResult,\n startsWithPerTermSearch,\n startsWithSearch,\n} from './helpers';\n\nexport class OptionListController implements ReactiveController {\n private _activeIndex = -1;\n private _host: ReactiveControllerHost;\n private _options: InternalOption[] = [];\n private _filterPattern = '';\n private _filterMethod: FilterMethod = 'fuzzy';\n private _combobox = false;\n private _indexByValue: Map<string, number> = new Map();\n private _indexByLabel: Map<string, number> = new Map();\n private _selectedIndex = -1;\n private _selectedIndexes: Set<number> = new Set();\n private _multiSelect = false;\n private _numOfVisibleOptions = 0;\n\n constructor(host: ReactiveControllerHost) {\n (this._host = host).addController(this);\n }\n\n hostConnected(): void {}\n\n //#region getters/setters\n\n get activeIndex(): number {\n return this._activeIndex;\n }\n\n set activeIndex(index: number) {\n this._activeIndex = index;\n this._host.requestUpdate();\n }\n\n get relativeActiveIndex(): number {\n return this._options[this._activeIndex]?.filteredIndex ?? -1;\n }\n\n set comboboxMode(enabled: boolean) {\n this._combobox = enabled;\n this._host.requestUpdate();\n }\n\n get comboboxMode() {\n return this._combobox;\n }\n\n get multiSelect() {\n return this._multiSelect;\n }\n\n set multiSelect(multiSelect: boolean) {\n this._selectedIndex = -1;\n this._selectedIndexes.clear();\n this._multiSelect = multiSelect;\n this._host.requestUpdate();\n }\n\n get selectedIndex() {\n return this._selectedIndex;\n }\n\n set selectedIndex(index: number) {\n if (this._selectedIndex !== -1) {\n this._options[this._selectedIndex].selected ??= false;\n }\n\n const op = this.getOptionByIndex(index);\n\n this._selectedIndex = op ? index : -1;\n this._host.requestUpdate();\n }\n\n get selectedIndexes() {\n return Array.from(this._selectedIndexes);\n }\n\n set selectedIndexes(value: number[]) {\n this._selectedIndexes.forEach((v) => {\n this._options[v].selected = false;\n });\n\n this._selectedIndexes = new Set(value);\n\n value.forEach((v) => {\n if (this._options[v] !== undefined) {\n this._options[v].selected = true;\n }\n });\n\n this._host.requestUpdate();\n }\n\n set value(newValue: string | string[]) {\n if (this._multiSelect) {\n const valueList = (newValue as string[])\n .map((v) => this._indexByValue.get(v))\n .filter((v) => v !== undefined);\n\n this._selectedIndexes = new Set(valueList);\n } else {\n this._selectedIndex = this._indexByValue.get(newValue as string) ?? -1;\n }\n this._host.requestUpdate();\n }\n\n get value(): string | string[] {\n if (this._multiSelect) {\n return this._selectedIndexes.size > 0\n ? Array.from(this._selectedIndexes).map((v) => this._options[v].value)\n : [];\n } else {\n return this._selectedIndex > -1\n ? this._options[this._selectedIndex].value\n : '';\n }\n }\n\n set multiSelectValue(newValue: string[]) {\n const valueList = (newValue as string[])\n .map((v) => this._indexByValue.get(v))\n .filter((v) => v !== undefined);\n\n this._selectedIndexes = new Set(valueList);\n }\n\n get multiSelectValue(): string[] {\n return this._selectedIndexes.size > 0\n ? Array.from(this._selectedIndexes).map((v) => this._options[v].value)\n : [];\n }\n\n get filterPattern() {\n return this._filterPattern;\n }\n\n set filterPattern(pattern: string) {\n if (pattern !== this._filterPattern) {\n this._filterPattern = pattern;\n this._updateState();\n }\n }\n\n get filterMethod(): FilterMethod {\n return this._filterMethod;\n }\n\n set filterMethod(method: FilterMethod) {\n if (method !== this._filterMethod) {\n this._filterMethod = method;\n this._updateState();\n }\n }\n\n get options(): InternalOption[] {\n return this._options;\n }\n\n get numOfVisibleOptions() {\n return this._numOfVisibleOptions;\n }\n\n get numOptions() {\n return this._options.length;\n }\n\n //#endregion\n\n //#region public functions\n\n populate(options: Option[]) {\n this._indexByValue.clear();\n this._indexByLabel.clear();\n\n this._options = options.map((op, index) => {\n this._indexByValue.set(op.value ?? '', index);\n this._indexByLabel.set(op.label ?? '', index);\n\n return {\n description: op.description ?? '',\n disabled: op.disabled ?? false,\n label: op.label ?? '',\n selected: op.selected ?? false,\n value: op.value ?? '',\n index,\n filteredIndex: index,\n ranges: [],\n visible: true,\n };\n });\n\n this._numOfVisibleOptions = this._options.length;\n }\n\n add(option: Option) {\n const nextIndex = this._options.length;\n const {description, disabled, label, selected, value} = option;\n let visible = true;\n let ranges: [number, number][] = [];\n\n if (this._combobox && this._filterPattern !== '') {\n const res = this._searchByPattern(label ?? '');\n visible = res.match;\n ranges = res.ranges;\n }\n\n this._indexByValue.set(value ?? '', nextIndex);\n this._indexByLabel.set(label ?? '', nextIndex);\n\n if (selected) {\n this._selectedIndex = nextIndex;\n this._selectedIndexes.add(nextIndex);\n this._activeIndex = nextIndex;\n }\n\n this._options.push({\n index: nextIndex,\n filteredIndex: nextIndex,\n description: description ?? '',\n disabled: disabled ?? false,\n label: label ?? '',\n selected: selected ?? false,\n value: value ?? '',\n visible,\n ranges,\n });\n\n if (visible) {\n this._numOfVisibleOptions += 1;\n }\n }\n\n clear() {\n this._options = [];\n this._indexByValue.clear();\n this._indexByLabel.clear();\n this._numOfVisibleOptions = 0;\n }\n\n getIsIndexSelected(index: number) {\n if (this._multiSelect) {\n return this._selectedIndexes.has(index);\n } else {\n return this._selectedIndex === index;\n }\n }\n\n expandMultiSelection(values: string[]) {\n values.forEach((v) => {\n const foundIndex = this._indexByValue.get(v) ?? -1;\n\n if (foundIndex !== -1) {\n this._selectedIndexes.add(foundIndex);\n }\n });\n\n this._host.requestUpdate();\n }\n\n toggleActiveMultiselectOption() {\n const activeOption = this._options[this._activeIndex] ?? null;\n\n if (!activeOption) {\n return;\n }\n\n const checked = this._selectedIndexes.has(activeOption.index);\n\n if (checked) {\n this._selectedIndexes.delete(activeOption.index);\n } else {\n this._selectedIndexes.add(activeOption.index);\n }\n\n this._host.requestUpdate();\n }\n\n toggleOptionSelected(optIndex: number) {\n const checked = this._selectedIndexes.has(optIndex);\n this._options[optIndex].selected = !this._options[optIndex].selected;\n\n if (checked) {\n this._selectedIndexes.delete(optIndex);\n } else {\n this._selectedIndexes.add(optIndex);\n }\n\n this._host.requestUpdate();\n }\n\n getActiveOption(): InternalOption | null {\n return this._options[this._activeIndex] ?? null;\n }\n\n getSelectedOption(): InternalOption | null {\n return this._options[this._selectedIndex] ?? null;\n }\n\n getOptionByIndex(index: number) {\n return this._options[index] ?? null;\n }\n\n findOptionIndex(value: string) {\n return this._indexByValue.get(value) ?? -1;\n }\n\n getOptionByValue(\n value: string,\n includeHiddenOptions = false\n ): InternalOption | null {\n const index = this._indexByValue.get(value) ?? -1;\n\n if (index === -1) {\n return null;\n }\n\n if (!includeHiddenOptions) {\n return this._options[index].visible ? this._options[index] : null;\n }\n\n return this._options[index];\n }\n\n getOptionByLabel(label: string) {\n const index = this._indexByLabel.get(label) ?? -1;\n\n if (index === -1) {\n return null;\n }\n\n return this._options[index];\n }\n\n next(fromIndex?: number): InternalOption | null {\n const from = fromIndex ?? this._activeIndex;\n let nextIndex = -1;\n\n for (let i = from + 1; i < this._options.length; i++) {\n if (\n this._options[i] &&\n !this._options[i].disabled &&\n this._options[i].visible\n ) {\n nextIndex = i;\n break;\n }\n }\n\n return nextIndex > -1 ? this._options[nextIndex] : null;\n }\n\n prev(fromIndex?: number): InternalOption | null {\n const from = fromIndex ?? this._activeIndex;\n\n let prevIndex = -1;\n\n for (let i = from - 1; i >= 0; i--) {\n if (\n this._options[i] &&\n !this._options[i].disabled &&\n this._options[i].visible\n ) {\n prevIndex = i;\n break;\n }\n }\n\n return prevIndex > -1 ? this._options[prevIndex] : null;\n }\n\n activateDefault() {\n if (this._multiSelect) {\n if (this._selectedIndexes.size > 0) {\n const indexes = this._selectedIndexes.values();\n const first = indexes.next();\n this._activeIndex = first.value ? first.value : 0;\n }\n } else {\n if (this._selectedIndex > -1) {\n this._activeIndex = this._selectedIndex;\n } else {\n this._activeIndex = 0;\n }\n }\n\n this._host.requestUpdate();\n }\n\n selectAll() {\n if (!this._multiSelect) {\n return;\n }\n\n this._options.forEach((_, i) => {\n this._options[i].selected = true;\n this._selectedIndexes.add(i);\n });\n\n this._host.requestUpdate();\n }\n\n selectNone() {\n if (!this._multiSelect) {\n return;\n }\n\n this._options.forEach((_, i) => {\n this._options[i].selected = false;\n });\n this._selectedIndexes.clear();\n\n this._host.requestUpdate();\n }\n\n //#endregion\n\n //#region private functions\n\n private _searchByPattern(text: string) {\n let result: SearchResult;\n\n switch (this._filterMethod) {\n case 'startsWithPerTerm':\n result = startsWithPerTermSearch(text, this._filterPattern);\n break;\n case 'startsWith':\n result = startsWithSearch(text, this._filterPattern);\n break;\n case 'contains':\n result = containsSearch(text, this._filterPattern);\n break;\n default:\n result = fuzzySearch(text, this._filterPattern);\n }\n\n return result;\n }\n\n private _updateState() {\n if (!this._combobox || this._filterPattern === '') {\n this._options.forEach((_, i) => {\n this._options[i].visible = true;\n this._options[i].ranges = [];\n });\n this._numOfVisibleOptions = this._options.length;\n } else {\n let filteredListNextIndex = -1;\n this._numOfVisibleOptions = 0;\n\n this._options.forEach(({label}, i) => {\n const result = this._searchByPattern(label);\n this._options[i].visible = result.match;\n this._options[i].ranges = result.ranges;\n this._options[i].filteredIndex = result.match\n ? ++filteredListNextIndex\n : -1;\n\n if (result.match) {\n this._numOfVisibleOptions += 1;\n }\n });\n }\n\n this._host.requestUpdate();\n }\n\n //#endregion\n}\n"]}
|
|
1
|
+
{"version":3,"file":"OptionListController.js","sourceRoot":"","sources":["../../../src/includes/vscode-select/OptionListController.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,WAAW,EAEX,uBAAuB,EACvB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AAEnB,MAAM,OAAO,oBAAoB;IAc/B,YAAY,IAA4B;QAbhC,iBAAY,GAAG,CAAC,CAAC,CAAC;QAElB,aAAQ,GAAqB,EAAE,CAAC;QAChC,mBAAc,GAAG,EAAE,CAAC;QACpB,kBAAa,GAAiB,OAAO,CAAC;QACtC,cAAS,GAAG,KAAK,CAAC;QAClB,kBAAa,GAAwB,IAAI,GAAG,EAAE,CAAC;QAC/C,kBAAa,GAAwB,IAAI,GAAG,EAAE,CAAC;QAC/C,mBAAc,GAAG,CAAC,CAAC,CAAC;QACpB,qBAAgB,GAAgB,IAAI,GAAG,EAAE,CAAC;QAC1C,iBAAY,GAAG,KAAK,CAAC;QACrB,yBAAoB,GAAG,CAAC,CAAC;QAG/B,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IAED,aAAa,KAAU,CAAC;IAExB,yBAAyB;IAEzB,IAAI,WAAW;QACb,OAAO,IAAI,CAAC,YAAY,CAAC;IAC3B,CAAC;IAED,IAAI,WAAW,CAAC,KAAa;QAC3B,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;IAED,IAAI,mBAAmB;QACrB,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,aAAa,IAAI,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED,IAAI,YAAY,CAAC,OAAgB;QAC/B,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC;QACzB,IAAI,CAAC,KAAK,CAAC,aA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AC,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;gBACxC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;gBACxC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,aAAa,GAAG,MAAM,CAAC,KAAK;oBAC3C,CAAC,CAAC,EAAE,qBAAqB;oBACzB,CAAC,CAAC,CAAC,CAAC,CAAC;gBAEP,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;oBACjB,IAAI,CAAC,oBAAoB,IAAI,CAAC,CAAC;gBACjC,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;QAED,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;CAGF","sourcesContent":["import {ReactiveController, ReactiveControllerHost} from 'lit';\nimport {FilterMethod, InternalOption, Option} from './types';\nimport {\n containsSearch,\n fuzzySearch,\n SearchResult,\n startsWithPerTermSearch,\n startsWithSearch,\n} from './helpers';\n\nexport class OptionListController implements ReactiveController {\n private _activeIndex = -1;\n private _host: ReactiveControllerHost;\n private _options: InternalOption[] = [];\n private _filterPattern = '';\n private _filterMethod: FilterMethod = 'fuzzy';\n private _combobox = false;\n private _indexByValue: Map<string, number> = new Map();\n private _indexByLabel: Map<string, number> = new Map();\n private _selectedIndex = -1;\n private _selectedIndexes: Set<number> = new Set();\n private _multiSelect = false;\n private _numOfVisibleOptions = 0;\n\n constructor(host: ReactiveControllerHost) {\n (this._host = host).addController(this);\n }\n\n hostConnected(): void {}\n\n //#region getters/setters\n\n get activeIndex(): number {\n return this._activeIndex;\n }\n\n set activeIndex(index: number) {\n this._activeIndex = index;\n this._host.requestUpdate();\n }\n\n get relativeActiveIndex(): number {\n return this._options[this._activeIndex]?.filteredIndex ?? -1;\n }\n\n set comboboxMode(enabled: boolean) {\n this._combobox = enabled;\n this._host.requestUpdate();\n }\n\n get comboboxMode() {\n return this._combobox;\n }\n\n get multiSelect() {\n return this._multiSelect;\n }\n\n set multiSelect(multiSelect: boolean) {\n this._selectedIndex = -1;\n this._selectedIndexes.clear();\n this._multiSelect = multiSelect;\n this._host.requestUpdate();\n }\n\n get selectedIndex() {\n return this._selectedIndex;\n }\n\n set selectedIndex(index: number) {\n if (this._selectedIndex !== -1 && this._options[this._selectedIndex]) {\n this._options[this._selectedIndex].selected ??= false;\n }\n\n const op = this.getOptionByIndex(index);\n\n this._selectedIndex = op ? index : -1;\n this._host.requestUpdate();\n }\n\n get selectedIndexes() {\n return Array.from(this._selectedIndexes);\n }\n\n set selectedIndexes(value: number[]) {\n this._selectedIndexes.forEach((v) => {\n this._options[v].selected = false;\n });\n\n this._selectedIndexes = new Set(value);\n\n value.forEach((v) => {\n if (this._options[v] !== undefined) {\n this._options[v].selected = true;\n }\n });\n\n this._host.requestUpdate();\n }\n\n set value(newValue: string | string[]) {\n if (this._multiSelect) {\n const valueList = (newValue as string[])\n .map((v) => this._indexByValue.get(v))\n .filter((v) => v !== undefined);\n\n this._selectedIndexes = new Set(valueList);\n } else {\n this._selectedIndex = this._indexByValue.get(newValue as string) ?? -1;\n }\n this._host.requestUpdate();\n }\n\n get value(): string | string[] {\n if (this._multiSelect) {\n return this._selectedIndexes.size > 0\n ? Array.from(this._selectedIndexes)\n .filter((i) => i >= 0 && i < this._options.length)\n .map((v) => this._options[v].value)\n : [];\n } else {\n return this._selectedIndex > -1 &&\n this._selectedIndex < this._options.length\n ? this._options[this._selectedIndex].value\n : '';\n }\n }\n\n set multiSelectValue(newValue: string[]) {\n const valueList = (newValue as string[])\n .map((v) => this._indexByValue.get(v))\n .filter((v) => v !== undefined);\n\n this._selectedIndexes = new Set(valueList);\n }\n\n get multiSelectValue(): string[] {\n return this._selectedIndexes.size > 0\n ? Array.from(this._selectedIndexes).map((v) => this._options[v].value)\n : [];\n }\n\n get filterPattern() {\n return this._filterPattern;\n }\n\n set filterPattern(pattern: string) {\n if (pattern !== this._filterPattern) {\n this._filterPattern = pattern;\n this._updateState();\n }\n }\n\n get filterMethod(): FilterMethod {\n return this._filterMethod;\n }\n\n set filterMethod(method: FilterMethod) {\n if (method !== this._filterMethod) {\n this._filterMethod = method;\n this._updateState();\n }\n }\n\n get options(): InternalOption[] {\n return this._options;\n }\n\n get numOfVisibleOptions() {\n return this._numOfVisibleOptions;\n }\n\n get numOptions() {\n return this._options.length;\n }\n\n //#endregion\n\n //#region public functions\n\n populate(options: Option[]) {\n this._indexByValue.clear();\n this._indexByLabel.clear();\n\n this._options = options.map((op, index) => {\n this._indexByValue.set(op.value ?? '', index);\n this._indexByLabel.set(op.label ?? '', index);\n\n return {\n description: op.description ?? '',\n disabled: op.disabled ?? false,\n label: op.label ?? '',\n selected: op.selected ?? false,\n value: op.value ?? '',\n index,\n filteredIndex: index,\n ranges: [],\n visible: true,\n };\n });\n\n this._numOfVisibleOptions = this._options.length;\n }\n\n add(option: Option) {\n const nextIndex = this._options.length;\n const {description, disabled, label, selected, value} = option;\n let visible = true;\n let ranges: [number, number][] = [];\n\n if (this._combobox && this._filterPattern !== '') {\n const res = this._searchByPattern(label ?? '');\n visible = res.match;\n ranges = res.ranges;\n }\n\n this._indexByValue.set(value ?? '', nextIndex);\n this._indexByLabel.set(label ?? '', nextIndex);\n\n if (selected) {\n this._selectedIndex = nextIndex;\n this._selectedIndexes.add(nextIndex);\n this._activeIndex = nextIndex;\n }\n\n this._options.push({\n index: nextIndex,\n filteredIndex: nextIndex,\n description: description ?? '',\n disabled: disabled ?? false,\n label: label ?? '',\n selected: selected ?? false,\n value: value ?? '',\n visible,\n ranges,\n });\n\n if (visible) {\n this._numOfVisibleOptions += 1;\n }\n }\n\n clear() {\n this._options = [];\n this._indexByValue.clear();\n this._indexByLabel.clear();\n this._numOfVisibleOptions = 0;\n this._selectedIndex = -1;\n this._selectedIndexes.clear();\n this._activeIndex = -1;\n }\n\n getIsIndexSelected(index: number) {\n if (this._multiSelect) {\n return this._selectedIndexes.has(index);\n } else {\n return this._selectedIndex === index;\n }\n }\n\n expandMultiSelection(values: string[]) {\n values.forEach((v) => {\n const foundIndex = this._indexByValue.get(v) ?? -1;\n\n if (foundIndex !== -1) {\n this._selectedIndexes.add(foundIndex);\n }\n });\n\n this._host.requestUpdate();\n }\n\n toggleActiveMultiselectOption() {\n const activeOption = this._options[this._activeIndex] ?? null;\n\n if (!activeOption) {\n return;\n }\n\n const checked = this._selectedIndexes.has(activeOption.index);\n\n if (checked) {\n this._selectedIndexes.delete(activeOption.index);\n } else {\n this._selectedIndexes.add(activeOption.index);\n }\n\n this._host.requestUpdate();\n }\n\n toggleOptionSelected(optIndex: number) {\n const checked = this._selectedIndexes.has(optIndex);\n this._options[optIndex].selected = !this._options[optIndex].selected;\n\n if (checked) {\n this._selectedIndexes.delete(optIndex);\n } else {\n this._selectedIndexes.add(optIndex);\n }\n\n this._host.requestUpdate();\n }\n\n getActiveOption(): InternalOption | null {\n return this._options[this._activeIndex] ?? null;\n }\n\n getSelectedOption(): InternalOption | null {\n return this._options[this._selectedIndex] ?? null;\n }\n\n getOptionByIndex(index: number) {\n return this._options[index] ?? null;\n }\n\n findOptionIndex(value: string) {\n return this._indexByValue.get(value) ?? -1;\n }\n\n getOptionByValue(\n value: string,\n includeHiddenOptions = false\n ): InternalOption | null {\n const index = this._indexByValue.get(value) ?? -1;\n\n if (index === -1) {\n return null;\n }\n\n if (!includeHiddenOptions) {\n return this._options[index].visible ? this._options[index] : null;\n }\n\n return this._options[index];\n }\n\n getOptionByLabel(label: string) {\n const index = this._indexByLabel.get(label) ?? -1;\n\n if (index === -1) {\n return null;\n }\n\n return this._options[index];\n }\n\n next(fromIndex?: number): InternalOption | null {\n const from = fromIndex ?? this._activeIndex;\n let nextIndex = -1;\n\n for (let i = from + 1; i < this._options.length; i++) {\n if (\n this._options[i] &&\n !this._options[i].disabled &&\n this._options[i].visible\n ) {\n nextIndex = i;\n break;\n }\n }\n\n return nextIndex > -1 ? this._options[nextIndex] : null;\n }\n\n prev(fromIndex?: number): InternalOption | null {\n const from = fromIndex ?? this._activeIndex;\n\n let prevIndex = -1;\n\n for (let i = from - 1; i >= 0; i--) {\n if (\n this._options[i] &&\n !this._options[i].disabled &&\n this._options[i].visible\n ) {\n prevIndex = i;\n break;\n }\n }\n\n return prevIndex > -1 ? this._options[prevIndex] : null;\n }\n\n activateDefault() {\n if (this._multiSelect) {\n if (this._selectedIndexes.size > 0) {\n const indexes = this._selectedIndexes.values();\n const first = indexes.next();\n this._activeIndex = first.value ? first.value : 0;\n }\n } else {\n if (this._selectedIndex > -1) {\n this._activeIndex = this._selectedIndex;\n } else {\n this._activeIndex = 0;\n }\n }\n\n this._host.requestUpdate();\n }\n\n selectAll() {\n if (!this._multiSelect) {\n return;\n }\n\n this._options.forEach((_, i) => {\n this._options[i].selected = true;\n this._selectedIndexes.add(i);\n });\n\n this._host.requestUpdate();\n }\n\n selectNone() {\n if (!this._multiSelect) {\n return;\n }\n\n this._options.forEach((_, i) => {\n this._options[i].selected = false;\n });\n this._selectedIndexes.clear();\n\n this._host.requestUpdate();\n }\n\n //#endregion\n\n //#region private functions\n\n private _searchByPattern(text: string) {\n let result: SearchResult;\n\n switch (this._filterMethod) {\n case 'startsWithPerTerm':\n result = startsWithPerTermSearch(text, this._filterPattern);\n break;\n case 'startsWith':\n result = startsWithSearch(text, this._filterPattern);\n break;\n case 'contains':\n result = containsSearch(text, this._filterPattern);\n break;\n default:\n result = fuzzySearch(text, this._filterPattern);\n }\n\n return result;\n }\n\n private _updateState() {\n if (!this._combobox || this._filterPattern === '') {\n this._options.forEach((_, i) => {\n this._options[i].visible = true;\n this._options[i].ranges = [];\n });\n this._numOfVisibleOptions = this._options.length;\n } else {\n let filteredListNextIndex = -1;\n this._numOfVisibleOptions = 0;\n\n this._options.forEach(({label}, i) => {\n const result = this._searchByPattern(label);\n this._options[i].visible = result.match;\n this._options[i].ranges = result.ranges;\n this._options[i].filteredIndex = result.match\n ? ++filteredListNextIndex\n : -1;\n\n if (result.match) {\n this._numOfVisibleOptions += 1;\n }\n });\n }\n\n this._host.requestUpdate();\n }\n\n //#endregion\n}\n"]}
|
package/package.json
CHANGED
|
@@ -2,21 +2,6 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
3
3
|
"version": 1.1,
|
|
4
4
|
"properties": [
|
|
5
|
-
{ "name": "--vscode-button-background", "values": [] },
|
|
6
|
-
{ "name": "--vscode-button-foreground", "values": [] },
|
|
7
|
-
{ "name": "--vscode-button-border", "values": [] },
|
|
8
|
-
{ "name": "--vscode-button-hoverBackground", "values": [] },
|
|
9
|
-
{
|
|
10
|
-
"name": "--vscode-font-family",
|
|
11
|
-
"description": "A sans-serif font type depends on the host OS.",
|
|
12
|
-
"values": []
|
|
13
|
-
},
|
|
14
|
-
{ "name": "--vscode-font-size", "values": [] },
|
|
15
|
-
{ "name": "--vscode-font-weight", "values": [] },
|
|
16
|
-
{ "name": "--vscode-button-secondaryForeground", "values": [] },
|
|
17
|
-
{ "name": "--vscode-button-secondaryBackground", "values": [] },
|
|
18
|
-
{ "name": "--vscode-button-secondaryHoverBackground", "values": [] },
|
|
19
|
-
{ "name": "--vscode-focusBorder", "values": [] },
|
|
20
5
|
{
|
|
21
6
|
"name": "--vscode-font-family",
|
|
22
7
|
"description": "A sans-serif font type depends on the host OS.",
|
|
@@ -58,6 +43,21 @@
|
|
|
58
43
|
{ "name": "--vscode-button-secondaryBackground", "values": [] },
|
|
59
44
|
{ "name": "--vscode-button-secondaryHoverBackground", "values": [] },
|
|
60
45
|
{ "name": "--vscode-focusBorder", "values": [] },
|
|
46
|
+
{ "name": "--vscode-button-background", "values": [] },
|
|
47
|
+
{ "name": "--vscode-button-foreground", "values": [] },
|
|
48
|
+
{ "name": "--vscode-button-border", "values": [] },
|
|
49
|
+
{ "name": "--vscode-button-hoverBackground", "values": [] },
|
|
50
|
+
{
|
|
51
|
+
"name": "--vscode-font-family",
|
|
52
|
+
"description": "A sans-serif font type depends on the host OS.",
|
|
53
|
+
"values": []
|
|
54
|
+
},
|
|
55
|
+
{ "name": "--vscode-font-size", "values": [] },
|
|
56
|
+
{ "name": "--vscode-font-weight", "values": [] },
|
|
57
|
+
{ "name": "--vscode-button-secondaryForeground", "values": [] },
|
|
58
|
+
{ "name": "--vscode-button-secondaryBackground", "values": [] },
|
|
59
|
+
{ "name": "--vscode-button-secondaryHoverBackground", "values": [] },
|
|
60
|
+
{ "name": "--vscode-focusBorder", "values": [] },
|
|
61
61
|
{ "name": "--vscode-font-family", "values": [] },
|
|
62
62
|
{ "name": "--vscode-font-size", "values": [] },
|
|
63
63
|
{ "name": "--vscode-font-weight", "values": [] },
|
|
@@ -68,6 +68,13 @@
|
|
|
68
68
|
{ "name": "--vscode-focusBorder", "values": [] },
|
|
69
69
|
{ "name": "--vscode-inputValidation-errorBackground", "values": [] },
|
|
70
70
|
{ "name": "--vscode-inputValidation-errorBorder", "values": [] },
|
|
71
|
+
{ "name": "--vscode-font-family", "values": [] },
|
|
72
|
+
{ "name": "--vscode-font-size", "values": [] },
|
|
73
|
+
{ "name": "--vscode-font-weight", "values": [] },
|
|
74
|
+
{ "name": "--vscode-menu-background", "values": [] },
|
|
75
|
+
{ "name": "--vscode-menu-border", "values": [] },
|
|
76
|
+
{ "name": "--vscode-menu-foreground", "values": [] },
|
|
77
|
+
{ "name": "--vscode-widget-shadow", "values": [] },
|
|
71
78
|
{
|
|
72
79
|
"name": "--vscode-sideBar-background",
|
|
73
80
|
"description": "Background color",
|
|
@@ -98,13 +105,7 @@
|
|
|
98
105
|
"description": "Header font color",
|
|
99
106
|
"values": []
|
|
100
107
|
},
|
|
101
|
-
{ "name": "--vscode-
|
|
102
|
-
{ "name": "--vscode-font-size", "values": [] },
|
|
103
|
-
{ "name": "--vscode-font-weight", "values": [] },
|
|
104
|
-
{ "name": "--vscode-menu-background", "values": [] },
|
|
105
|
-
{ "name": "--vscode-menu-border", "values": [] },
|
|
106
|
-
{ "name": "--vscode-menu-foreground", "values": [] },
|
|
107
|
-
{ "name": "--vscode-widget-shadow", "values": [] },
|
|
108
|
+
{ "name": "--vscode-foreground", "values": [] },
|
|
108
109
|
{ "name": "--vscode-font-family", "values": [] },
|
|
109
110
|
{ "name": "--vscode-font-size", "values": [] },
|
|
110
111
|
{ "name": "--vscode-font-weight", "values": [] },
|
|
@@ -114,7 +115,6 @@
|
|
|
114
115
|
{ "name": "--vscode-menu-selectionBackground", "values": [] },
|
|
115
116
|
{ "name": "--vscode-menu-selectionForeground", "values": [] },
|
|
116
117
|
{ "name": "--vscode-menu-separatorBackground", "values": [] },
|
|
117
|
-
{ "name": "--vscode-foreground", "values": [] },
|
|
118
118
|
{
|
|
119
119
|
"name": "--label-width",
|
|
120
120
|
"description": "The width of the label in horizontal mode",
|
|
@@ -168,7 +168,6 @@
|
|
|
168
168
|
{ "name": "--vscode-list-hoverBackground", "values": [] },
|
|
169
169
|
{ "name": "--vscode-list-hoverForeground", "values": [] },
|
|
170
170
|
{ "name": "--vscode-progressBar-background", "values": [] },
|
|
171
|
-
{ "name": "--vscode-progressBar-background", "values": [] },
|
|
172
171
|
{ "name": "--vscode-font-family", "values": [] },
|
|
173
172
|
{ "name": "--vscode-font-size", "values": [] },
|
|
174
173
|
{ "name": "--vscode-font-weight", "values": [] },
|
|
@@ -178,6 +177,7 @@
|
|
|
178
177
|
{ "name": "--vscode-focusBorder", "values": [] },
|
|
179
178
|
{ "name": "--vscode-inputValidation-errorBackground", "values": [] },
|
|
180
179
|
{ "name": "--vscode-inputValidation-errorBorder", "values": [] },
|
|
180
|
+
{ "name": "--vscode-progressBar-background", "values": [] },
|
|
181
181
|
{ "name": "--vscode-scrollbar-shadow", "values": [] },
|
|
182
182
|
{ "name": "--vscode-scrollbarSlider-background", "values": [] },
|
|
183
183
|
{ "name": "--vscode-scrollbarSlider-hoverBackground", "values": [] },
|
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
3
3
|
"version": 1.1,
|
|
4
4
|
"tags": [
|
|
5
|
+
{
|
|
6
|
+
"name": "vscode-badge",
|
|
7
|
+
"description": "Show counts or status information. Badges can also be used within [Textfield](https://vscode-elements.github.io/components/textfield) and [TabHeader](https://vscode-elements.github.io/components/tabs) components.\n---\n\n\n### **CSS Properties:**\n - **--vscode-font-family** - A sans-serif font type depends on the host OS. _(default: sans-serif)_\n- **--vscode-contrastBorder** - undefined _(default: transparent)_\n- **--vscode-badge-background** - default and counter variant background color _(default: #616161)_\n- **--vscode-badge-foreground** - default and counter variant foreground color _(default: #f8f8f8)_\n- **--vscode-activityBarBadge-background** - activity bar variant background color _(default: #0078d4)_\n- **--vscode-activityBarBadge-foreground** - activity bar variant foreground color _(default: #ffffff)_",
|
|
8
|
+
"attributes": [
|
|
9
|
+
{
|
|
10
|
+
"name": "variant",
|
|
11
|
+
"values": [
|
|
12
|
+
{ "name": "" },
|
|
13
|
+
{ "name": "default" },
|
|
14
|
+
{ "name": "counter" },
|
|
15
|
+
{ "name": "activity-bar-counter" },
|
|
16
|
+
{ "name": "tab-header-counter" }
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
],
|
|
20
|
+
"references": []
|
|
21
|
+
},
|
|
5
22
|
{
|
|
6
23
|
"name": "vscode-button",
|
|
7
24
|
"description": "Clickable element that are used to trigger actions.\n---\n\n\n### **Slots:**\n - **content-before** - Slot before the main content.\n- **content-after** - Slot after the main content.\n\n### **CSS Properties:**\n - **--vscode-button-background** - undefined _(default: #0078d4)_\n- **--vscode-button-foreground** - undefined _(default: #ffffff)_\n- **--vscode-button-border** - undefined _(default: var(--vscode-button-background, rgba(255, 255, 255, 0.07)))_\n- **--vscode-button-hoverBackground** - undefined _(default: #026ec1)_\n- **--vscode-font-family** - A sans-serif font type depends on the host OS. _(default: sans-serif)_\n- **--vscode-font-size** - undefined _(default: 13px)_\n- **--vscode-font-weight** - undefined _(default: normal)_\n- **--vscode-button-secondaryForeground** - undefined _(default: #cccccc)_\n- **--vscode-button-secondaryBackground** - undefined _(default: #313131)_\n- **--vscode-button-secondaryHoverBackground** - undefined _(default: #3c3c3c)_\n- **--vscode-focusBorder** - undefined _(default: #0078d4)_\n\n### **CSS Parts:**\n - **base** - The main content area of the component.",
|
|
@@ -58,23 +75,6 @@
|
|
|
58
75
|
],
|
|
59
76
|
"references": []
|
|
60
77
|
},
|
|
61
|
-
{
|
|
62
|
-
"name": "vscode-badge",
|
|
63
|
-
"description": "Show counts or status information. Badges can also be used within [Textfield](https://vscode-elements.github.io/components/textfield) and [TabHeader](https://vscode-elements.github.io/components/tabs) components.\n---\n\n\n### **CSS Properties:**\n - **--vscode-font-family** - A sans-serif font type depends on the host OS. _(default: sans-serif)_\n- **--vscode-contrastBorder** - undefined _(default: transparent)_\n- **--vscode-badge-background** - default and counter variant background color _(default: #616161)_\n- **--vscode-badge-foreground** - default and counter variant foreground color _(default: #f8f8f8)_\n- **--vscode-activityBarBadge-background** - activity bar variant background color _(default: #0078d4)_\n- **--vscode-activityBarBadge-foreground** - activity bar variant foreground color _(default: #ffffff)_",
|
|
64
|
-
"attributes": [
|
|
65
|
-
{
|
|
66
|
-
"name": "variant",
|
|
67
|
-
"values": [
|
|
68
|
-
{ "name": "" },
|
|
69
|
-
{ "name": "default" },
|
|
70
|
-
{ "name": "counter" },
|
|
71
|
-
{ "name": "activity-bar-counter" },
|
|
72
|
-
{ "name": "tab-header-counter" }
|
|
73
|
-
]
|
|
74
|
-
}
|
|
75
|
-
],
|
|
76
|
-
"references": []
|
|
77
|
-
},
|
|
78
78
|
{
|
|
79
79
|
"name": "vscode-button-group",
|
|
80
80
|
"description": "Shows a split button, including several components in a single button. Commonly used to show a button with a dropdown to the right.\n---\n\n\n### **CSS Properties:**\n - **--vscode-button-background** - undefined _(default: #0078d4)_\n- **--vscode-button-foreground** - undefined _(default: #ffffff)_\n- **--vscode-button-border** - undefined _(default: var(--vscode-button-background, rgba(255, 255, 255, 0.07)))_\n- **--vscode-button-hoverBackground** - undefined _(default: #026ec1)_\n- **--vscode-font-family** - A sans-serif font type depends on the host OS. _(default: sans-serif)_\n- **--vscode-font-size** - undefined _(default: 13px)_\n- **--vscode-font-weight** - undefined _(default: normal)_\n- **--vscode-button-secondaryForeground** - undefined _(default: #cccccc)_\n- **--vscode-button-secondaryBackground** - undefined _(default: #313131)_\n- **--vscode-button-secondaryHoverBackground** - undefined _(default: #3c3c3c)_\n- **--vscode-focusBorder** - undefined _(default: #0078d4)_",
|
|
@@ -135,6 +135,19 @@
|
|
|
135
135
|
],
|
|
136
136
|
"references": []
|
|
137
137
|
},
|
|
138
|
+
{
|
|
139
|
+
"name": "vscode-context-menu",
|
|
140
|
+
"description": "\n---\n\n\n### **Events:**\n - **vsc-menu-select** - Emitted when a menu item is clicked\n\n### **CSS Properties:**\n - **--vscode-font-family** - undefined _(default: sans-serif)_\n- **--vscode-font-size** - undefined _(default: 13px)_\n- **--vscode-font-weight** - undefined _(default: normal)_\n- **--vscode-menu-background** - undefined _(default: #1f1f1f)_\n- **--vscode-menu-border** - undefined _(default: #454545)_\n- **--vscode-menu-foreground** - undefined _(default: #cccccc)_\n- **--vscode-widget-shadow** - undefined _(default: rgba(0, 0, 0, 0.36))_",
|
|
141
|
+
"attributes": [
|
|
142
|
+
{
|
|
143
|
+
"name": "prevent-close",
|
|
144
|
+
"description": "By default, the menu closes when an item is clicked. This attribute prevents the menu from closing.",
|
|
145
|
+
"values": []
|
|
146
|
+
},
|
|
147
|
+
{ "name": "show", "values": [] }
|
|
148
|
+
],
|
|
149
|
+
"references": []
|
|
150
|
+
},
|
|
138
151
|
{
|
|
139
152
|
"name": "vscode-collapsible",
|
|
140
153
|
"description": "Allows users to reveal or hide related content on a page.\n---\n\n\n### **Events:**\n - **vsc-collapsible-toggle** - Dispatched when the content visibility is changed.\n\n### **Slots:**\n - _default_ - Main content.\n- **actions** - You can place any action icon in this slot in the header, but it's also possible to use any HTML element in it. It's only visible when the component is open.\n- **decorations** - The elements placed in the decorations slot are always visible.\n\n### **CSS Properties:**\n - **--vscode-sideBar-background** - Background color _(default: #181818)_\n- **--vscode-focusBorder** - Focus border color _(default: #0078d4)_\n- **--vscode-font-family** - Header font family _(default: sans-serif)_\n- **--vscode-sideBarSectionHeader-background** - Header background _(default: #181818)_\n- **--vscode-icon-foreground** - Arrow icon color _(default: #cccccc)_\n- **--vscode-sideBarTitle-foreground** - Header font color _(default: #cccccc)_\n\n### **CSS Parts:**\n - **body** - Container for the toggleable content of the component. The container's overflow content is hidden by default. This CSS part can serve as an escape hatch to modify this behavior.",
|
|
@@ -159,31 +172,6 @@
|
|
|
159
172
|
],
|
|
160
173
|
"references": []
|
|
161
174
|
},
|
|
162
|
-
{
|
|
163
|
-
"name": "vscode-context-menu",
|
|
164
|
-
"description": "\n---\n\n\n### **Events:**\n - **vsc-menu-select** - Emitted when a menu item is clicked\n\n### **CSS Properties:**\n - **--vscode-font-family** - undefined _(default: sans-serif)_\n- **--vscode-font-size** - undefined _(default: 13px)_\n- **--vscode-font-weight** - undefined _(default: normal)_\n- **--vscode-menu-background** - undefined _(default: #1f1f1f)_\n- **--vscode-menu-border** - undefined _(default: #454545)_\n- **--vscode-menu-foreground** - undefined _(default: #cccccc)_\n- **--vscode-widget-shadow** - undefined _(default: rgba(0, 0, 0, 0.36))_",
|
|
165
|
-
"attributes": [
|
|
166
|
-
{
|
|
167
|
-
"name": "prevent-close",
|
|
168
|
-
"description": "By default, the menu closes when an item is clicked. This attribute prevents the menu from closing.",
|
|
169
|
-
"values": []
|
|
170
|
-
},
|
|
171
|
-
{ "name": "show", "values": [] }
|
|
172
|
-
],
|
|
173
|
-
"references": []
|
|
174
|
-
},
|
|
175
|
-
{
|
|
176
|
-
"name": "vscode-context-menu-item",
|
|
177
|
-
"description": "\n---\n\n\n### **CSS Properties:**\n - **--vscode-font-family** - undefined _(default: sans-serif)_\n- **--vscode-font-size** - undefined _(default: 13px)_\n- **--vscode-font-weight** - undefined _(default: normal)_\n- **--vscode-menu-background** - undefined _(default: #1f1f1f)_\n- **--vscode-menu-selectionBorder** - undefined _(default: transparent)_\n- **--vscode-menu-foreground** - undefined _(default: #cccccc)_\n- **--vscode-menu-selectionBackground** - undefined _(default: #0078d4)_\n- **--vscode-menu-selectionForeground** - undefined _(default: #ffffff)_\n- **--vscode-menu-separatorBackground** - undefined _(default: #454545)_",
|
|
178
|
-
"attributes": [
|
|
179
|
-
{ "name": "label", "values": [] },
|
|
180
|
-
{ "name": "keybinding", "values": [] },
|
|
181
|
-
{ "name": "value", "values": [] },
|
|
182
|
-
{ "name": "separator", "values": [] },
|
|
183
|
-
{ "name": "tabindex", "values": [] }
|
|
184
|
-
],
|
|
185
|
-
"references": []
|
|
186
|
-
},
|
|
187
175
|
{
|
|
188
176
|
"name": "vscode-divider",
|
|
189
177
|
"description": "\n---\n\n\n### **CSS Properties:**\n - **--vscode-foreground** - undefined _(default: #cccccc)_",
|
|
@@ -204,6 +192,18 @@
|
|
|
204
192
|
],
|
|
205
193
|
"references": []
|
|
206
194
|
},
|
|
195
|
+
{
|
|
196
|
+
"name": "vscode-context-menu-item",
|
|
197
|
+
"description": "\n---\n\n\n### **CSS Properties:**\n - **--vscode-font-family** - undefined _(default: sans-serif)_\n- **--vscode-font-size** - undefined _(default: 13px)_\n- **--vscode-font-weight** - undefined _(default: normal)_\n- **--vscode-menu-background** - undefined _(default: #1f1f1f)_\n- **--vscode-menu-selectionBorder** - undefined _(default: transparent)_\n- **--vscode-menu-foreground** - undefined _(default: #cccccc)_\n- **--vscode-menu-selectionBackground** - undefined _(default: #0078d4)_\n- **--vscode-menu-selectionForeground** - undefined _(default: #ffffff)_\n- **--vscode-menu-separatorBackground** - undefined _(default: #454545)_",
|
|
198
|
+
"attributes": [
|
|
199
|
+
{ "name": "label", "values": [] },
|
|
200
|
+
{ "name": "keybinding", "values": [] },
|
|
201
|
+
{ "name": "value", "values": [] },
|
|
202
|
+
{ "name": "separator", "values": [] },
|
|
203
|
+
{ "name": "tabindex", "values": [] }
|
|
204
|
+
],
|
|
205
|
+
"references": []
|
|
206
|
+
},
|
|
207
207
|
{
|
|
208
208
|
"name": "vscode-form-group",
|
|
209
209
|
"description": "\n---\n\n\n### **CSS Properties:**\n - **--label-width** - The width of the label in horizontal mode _(default: 150px)_\n- **--label-right-margin** - The right margin of the label in horizontal mode _(default: 14px)_",
|
|
@@ -361,16 +361,6 @@
|
|
|
361
361
|
],
|
|
362
362
|
"references": []
|
|
363
363
|
},
|
|
364
|
-
{
|
|
365
|
-
"name": "vscode-progress-ring",
|
|
366
|
-
"description": "\n---\n\n\n### **CSS Properties:**\n - **--vscode-progressBar-background** - undefined _(default: #0078d4)_",
|
|
367
|
-
"attributes": [
|
|
368
|
-
{ "name": "aria-label", "values": [] },
|
|
369
|
-
{ "name": "aria-live", "values": [] },
|
|
370
|
-
{ "name": "role", "values": [] }
|
|
371
|
-
],
|
|
372
|
-
"references": []
|
|
373
|
-
},
|
|
374
364
|
{
|
|
375
365
|
"name": "vscode-radio",
|
|
376
366
|
"description": "When participating in a form, it supports the `:invalid` pseudo class. Otherwise the error styles\ncan be applied through the `invalid` property.\n---\n\n\n### **Events:**\n - **change** - Dispatched when checked state is changed.\n- **invalid** - Dispatched when the element is invalid and `checkValidity()` has been called or the form containing this element is submitted. [MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/invalid_event)\n\n### **CSS Properties:**\n - **--vscode-font-family** - undefined _(default: sans-serif)_\n- **--vscode-font-size** - undefined _(default: 13px)_\n- **--vscode-font-weight** - undefined _(default: normal)_\n- **--vscode-settings-checkboxBackground** - undefined _(default: #313131)_\n- **--vscode-settings-checkboxBorder** - undefined _(default: #3c3c3c)_\n- **--vscode-settings-checkboxForeground** - undefined _(default: #cccccc)_\n- **--vscode-focusBorder** - undefined _(default: #0078d4)_\n- **--vscode-inputValidation-errorBackground** - undefined _(default: #5a1d1d)_\n- **--vscode-inputValidation-errorBorder** - undefined _(default: #be1100)_",
|
|
@@ -396,6 +386,16 @@
|
|
|
396
386
|
],
|
|
397
387
|
"references": []
|
|
398
388
|
},
|
|
389
|
+
{
|
|
390
|
+
"name": "vscode-progress-ring",
|
|
391
|
+
"description": "\n---\n\n\n### **CSS Properties:**\n - **--vscode-progressBar-background** - undefined _(default: #0078d4)_",
|
|
392
|
+
"attributes": [
|
|
393
|
+
{ "name": "aria-label", "values": [] },
|
|
394
|
+
{ "name": "aria-live", "values": [] },
|
|
395
|
+
{ "name": "role", "values": [] }
|
|
396
|
+
],
|
|
397
|
+
"references": []
|
|
398
|
+
},
|
|
399
399
|
{
|
|
400
400
|
"name": "vscode-radio-group",
|
|
401
401
|
"description": "\n---\n\n\n### **Events:**\n - **change** - Dispatched when a child radio button is changed.",
|