@vscode-elements/elements 2.4.1-pre.0 → 2.4.1-pre.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/LICENSE +1 -1
- package/custom-elements.json +367 -323
- package/dist/bundled.js +11 -11
- package/dist/includes/VscElement.js +1 -1
- package/dist/includes/VscElement.js.map +1 -1
- package/dist/includes/sizes.d.ts +12 -0
- package/dist/includes/sizes.d.ts.map +1 -0
- package/dist/includes/sizes.js +30 -0
- package/dist/includes/sizes.js.map +1 -0
- package/dist/vscode-table/ColumnResizeController.d.ts +4 -3
- package/dist/vscode-table/ColumnResizeController.d.ts.map +1 -1
- package/dist/vscode-table/ColumnResizeController.js +10 -5
- package/dist/vscode-table/ColumnResizeController.js.map +1 -1
- package/dist/vscode-table/calculations.d.ts +2 -12
- package/dist/vscode-table/calculations.d.ts.map +1 -1
- package/dist/vscode-table/calculations.js +4 -32
- package/dist/vscode-table/calculations.js.map +1 -1
- package/dist/vscode-table/vscode-table.d.ts +2 -0
- package/dist/vscode-table/vscode-table.d.ts.map +1 -1
- package/dist/vscode-table/vscode-table.js +55 -28
- package/dist/vscode-table/vscode-table.js.map +1 -1
- package/dist/vscode-table-header-cell/vscode-table-header-cell.d.ts +12 -1
- package/dist/vscode-table-header-cell/vscode-table-header-cell.d.ts.map +1 -1
- package/dist/vscode-table-header-cell/vscode-table-header-cell.js +18 -0
- package/dist/vscode-table-header-cell/vscode-table-header-cell.js.map +1 -1
- package/package.json +1 -1
- package/vscode.css-custom-data.json +15 -15
- package/vscode.html-custom-data.json +18 -18
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)},h=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:l,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&&l(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(h(t))}else void 0!==t&&e.push(h(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,C="$lit$",B=`lit$${Math.random().toFixed(9).slice(2)}$`,A="?"+B,O=`<${A}>`,z=document,E=()=>z.createComment(""),I=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,M="[ \t\n\f\r]",D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,F=/-->/g,P=/>/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),H=L(2),G=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=D;for(let e=0;e<i;e++){const i=t[e];let h,a,l=-1,c=0;for(;c<i.length&&(n.lastIndex=c,a=n.exec(i),null!==a);)c=n.lastIndex,n===D?"!--"===a[1]?n=F:void 0!==a[1]?n=P: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??D,l=-1):void 0===a[1]?l=-2:(l=n.lastIndex-a[2].length,h=a[1],n=void 0===a[3]?V:'"'===a[3]?N:T):n===N||n===T?n=V:n===F||n===P?n=D:(n=V,o=void 0);const d=n===V&&t[e+1].startsWith("/>")?" ":"";r+=n===D?i+O:l>=0?(s.push(h),i.slice(0,l)+C+i.slice(l)+B+d):i+B+(-2===l?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,h=this.parts,[a,l]=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())&&h.length<n;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(C)){const e=l[r++],i=s.getAttribute(t).split(B),n=/([.?@])?(.*)/.exec(e);h.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(B)&&(h.push({type:6,index:o}),s.removeAttribute(t));if(R.test(s.tagName)){const t=s.textContent.split(B),e=t.length-1;if(e>0){s.textContent=_?_.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],E()),K.nextNode(),h.push({type:2,index:++o});s.append(t[e],E())}}}else if(8===s.nodeType)if(s.data===A)h.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(B,t+1));)h.push({type:7,index:o}),t+=B.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===G)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!==G&&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,h=i[0];for(;void 0!==h;){if(r===h.index){let e;2===h.type?e=new Q(o,o.nextSibling,this,t):1===h.type?e=new h.ctor(o,h.name,h.strings,this,t):6===h.type&&(e=new ot(o,this,t)),this._$AV.push(e),h=i[++n]}r!==h?.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!==G,r&&(this._$AH=t);else{const s=t;let n,h;for(t=o[0],n=0;n<o.length-1;n++)h=Z(this,s[i+n],e,n),h===G&&(h=this._$AH[n]),r||=!I(h)||h!==this._$AH[n],h===q?t=q:t!==q&&(t+=(h??"")+o[n+1]),this._$AH[n]=h}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)===G)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 ht=(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 lt=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=ht(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return G}};lt._$litElement$=!0,lt.finalized=!0,at.litElementHydrateSupport?.({LitElement:lt});const ct=at.litElementPolyfillSupport;ct?.({LitElement:lt}),(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.4.1-pre.0",wt="__vscodeElements_disableRegistryWarning__",yt=(t,e)=>{e?console.warn(`[VSCode Elements] ${t}\n%o`,e):console.warn(`${t}\n%o`,e)};class kt extends lt{get version(){return xt}warn(t){yt(t,this)}}const $t=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.",yt(`The custom element "${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)},h=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:l,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&&l(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(h(t))}else void 0!==t&&e.push(h(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,C="$lit$",B=`lit$${Math.random().toFixed(9).slice(2)}$`,A="?"+B,O=`<${A}>`,z=document,E=()=>z.createComment(""),I=t=>null===t||"object"!=typeof t&&"function"!=typeof t,j=Array.isArray,M="[ \t\n\f\r]",D=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,F=/-->/g,P=/>/g,V=RegExp(`>|${M}(?:([^\\s"'>=/]+)(${M}*=${M}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),N=/'/g,T=/"/g,R=/^(?:script|style|textarea|title)$/i,L=t=>(e,...i)=>({_$litType$:t,strings:e,values:i}),U=L(1),H=L(2),G=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=D;for(let e=0;e<i;e++){const i=t[e];let h,a,l=-1,c=0;for(;c<i.length&&(n.lastIndex=c,a=n.exec(i),null!==a);)c=n.lastIndex,n===D?"!--"===a[1]?n=F:void 0!==a[1]?n=P: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??D,l=-1):void 0===a[1]?l=-2:(l=n.lastIndex-a[2].length,h=a[1],n=void 0===a[3]?V:'"'===a[3]?T:N):n===T||n===N?n=V:n===F||n===P?n=D:(n=V,o=void 0);const d=n===V&&t[e+1].startsWith("/>")?" ":"";r+=n===D?i+O:l>=0?(s.push(h),i.slice(0,l)+C+i.slice(l)+B+d):i+B+(-2===l?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,h=this.parts,[a,l]=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())&&h.length<n;){if(1===s.nodeType){if(s.hasAttributes())for(const t of s.getAttributeNames())if(t.endsWith(C)){const e=l[r++],i=s.getAttribute(t).split(B),n=/([.?@])?(.*)/.exec(e);h.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(B)&&(h.push({type:6,index:o}),s.removeAttribute(t));if(R.test(s.tagName)){const t=s.textContent.split(B),e=t.length-1;if(e>0){s.textContent=_?_.emptyScript:"";for(let i=0;i<e;i++)s.append(t[i],E()),K.nextNode(),h.push({type:2,index:++o});s.append(t[e],E())}}}else if(8===s.nodeType)if(s.data===A)h.push({type:2,index:o});else{let t=-1;for(;-1!==(t=s.data.indexOf(B,t+1));)h.push({type:7,index:o}),t+=B.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===G)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!==G&&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,h=i[0];for(;void 0!==h;){if(r===h.index){let e;2===h.type?e=new Q(o,o.nextSibling,this,t):1===h.type?e=new h.ctor(o,h.name,h.strings,this,t):6===h.type&&(e=new ot(o,this,t)),this._$AV.push(e),h=i[++n]}r!==h?.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!==G,r&&(this._$AH=t);else{const s=t;let n,h;for(t=o[0],n=0;n<o.length-1;n++)h=Z(this,s[i+n],e,n),h===G&&(h=this._$AH[n]),r||=!I(h)||h!==this._$AH[n],h===q?t=q:t!==q&&(t+=(h??"")+o[n+1]),this._$AH[n]=h}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)===G)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 ht=(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 lt=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=ht(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return G}};lt._$litElement$=!0,lt.finalized=!0,at.litElementHydrateSupport?.({LitElement:lt});const ct=at.litElementPolyfillSupport;ct?.({LitElement:lt}),(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.4.1-pre.1",wt="__vscodeElements_disableRegistryWarning__",yt=(t,e)=>{e?console.warn(`[VSCode Elements] ${t}\n%o`,e):console.warn(`${t}\n%o`,e)};class kt extends lt{get version(){return xt}warn(t){yt(t,this)}}const $t=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.",yt(`The custom element "${t}" ${o}\nTo suppress this warning, set window.${wt} to true`)};var _t=n`
|
|
2
2
|
:host([hidden]) {
|
|
3
3
|
display: none;
|
|
4
4
|
}
|
|
@@ -118,7 +118,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
118
118
|
animation-timing-function: linear;
|
|
119
119
|
animation-iteration-count: infinite;
|
|
120
120
|
}
|
|
121
|
-
`];var Vt,
|
|
121
|
+
`];var Vt,Nt=function(t,e,i,s){for(var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,h=t.length-1;h>=0;h--)(o=t[h])&&(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 Tt=Vt=class extends kt{constructor(){super(...arguments),this.label="",this.name="",this.size=16,this.spin=!1,this.spinDuration=1.5,this.actionIcon=!1,this._onButtonClick=t=>{this.dispatchEvent(new CustomEvent("vsc-click",{detail:{originalEvent:t}}))}}connectedCallback(){super.connectedCallback();const{href:t,nonce:e}=this._getStylesheetConfig();Vt.stylesheetHref=t,Vt.nonce=e}_getStylesheetConfig(){const t=document.getElementById("vscode-codicon-stylesheet"),e=t?.getAttribute("href")||void 0,i=t?.nonce||void 0;if(!t){let t='To use the Icon component, the codicons.css file must be included in the page with the id "vscode-codicon-stylesheet"! ';t+="See https://vscode-elements.github.io/components/icon/ for more details.",this.warn(t)}return{nonce:i,href:e}}render(){const{stylesheetHref:t,nonce:e}=Vt,i=U`<span
|
|
122
122
|
class=${Mt({codicon:!0,["codicon-"+this.name]:!0,spin:this.spin})}
|
|
123
123
|
.style=${Ft({animationDuration:String(this.spinDuration)+"s",fontSize:this.size+"px",height:this.size+"px",width:this.size+"px"})}
|
|
124
124
|
></span>`,s=this.actionIcon?U` <button
|
|
@@ -136,7 +136,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
136
136
|
nonce=${Dt(e)}
|
|
137
137
|
>
|
|
138
138
|
${s}
|
|
139
|
-
`}};
|
|
139
|
+
`}};Tt.styles=Pt,Tt.stylesheetHref="",Tt.nonce="",Nt([pt()],Tt.prototype,"label",void 0),Nt([pt({type:String})],Tt.prototype,"name",void 0),Nt([pt({type:Number})],Tt.prototype,"size",void 0),Nt([pt({type:Boolean,reflect:!0})],Tt.prototype,"spin",void 0),Nt([pt({type:Number,attribute:"spin-duration"})],Tt.prototype,"spinDuration",void 0),Nt([pt({type:Boolean,reflect:!0,attribute:"action-icon"})],Tt.prototype,"actionIcon",void 0),Tt=Vt=Nt([$t("vscode-icon")],Tt);const Rt=[_t,n`
|
|
140
140
|
:host {
|
|
141
141
|
cursor: pointer;
|
|
142
142
|
display: inline-block;
|
|
@@ -1060,7 +1060,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
1060
1060
|
clip-rule="evenodd"
|
|
1061
1061
|
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"
|
|
1062
1062
|
/>
|
|
1063
|
-
</svg>`,{I:Me}=rt,De=()=>document.createComment(""),Fe=(t,e,i)=>{const s=t._$AA.parentNode,o=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=s.insertBefore(De(),o),r=s.insertBefore(De(),o);i=new Me(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},Pe=(t,e,i=t)=>(t._$AI(e,i),t),Ve={},Te=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}},Ne=(t,e,i)=>{const s=new Map;for(let o=e;o<=i;o++)s.set(t[o],o);return s},Re=It(class extends jt{constructor(t){if(super(t),t.type!==zt)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 h=this.ut??=[],a=[];let l,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(h[d]===n[p])a[p]=Pe(o[d],r[p]),d++,p++;else if(h[u]===n[v])a[v]=Pe(o[u],r[v]),u--,v--;else if(h[d]===n[v])a[v]=Pe(o[d],r[v]),Fe(t,a[v+1],o[d]),d++,v--;else if(h[u]===n[p])a[p]=Pe(o[u],r[p]),Fe(t,o[d],o[u]),u--,p++;else if(void 0===l&&(l=Ne(n,p,v),c=Ne(h,d,u)),l.has(h[d]))if(l.has(h[u])){const e=c.get(n[p]),i=void 0!==e?o[e]:null;if(null===i){const e=Fe(t,o[d]);Pe(e,r[p]),a[p]=e}else a[p]=Pe(i,r[p]),Fe(t,o[d],i),o[e]=null;p++}else Te(o[u]),u--;else Te(o[d]),d++;for(;p<=v;){const e=Fe(t,a[v+1]);Pe(e,r[p]),a[p++]=e}for(;d<=u;){const t=o[d++];null!==t&&Te(t)}return this.ut=n,((t,e=Ve)=>{t._$AH=e})(t,a),G}});var Le=function(t,e,i,s){for(var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,h=t.length-1;h>=0;h--)(o=t[h])&&(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 Ue=class extends kt{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>`}};Ue.styles=_t,Le([pt({type:String})],Ue.prototype,"value",void 0),Le([pt({type:String})],Ue.prototype,"description",void 0),Le([pt({type:Boolean,reflect:!0})],Ue.prototype,"selected",void 0),Le([pt({type:Boolean,reflect:!0})],Ue.prototype,"disabled",void 0),Ue=Le([$t("vscode-option")],Ue);const He=(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 h=e.indexOf(o),a=o.length;0===h&&(i.match=!0,i.ranges.push([n+h,Math.min(n+h+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},qe=(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},We=(t,e)=>{const i={match:!1,ranges:[]};let s=0,o=0;const r=e.length-1,n=t.toLowerCase(),h=e.toLowerCase();for(let t=0;t<=r;t++){if(o=n.indexOf(h[t],s),-1===o)return{match:!1,ranges:[]};i.match=!0,i.ranges.push([o,o+1]),s=o+1}return i},Ke=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 Xe{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 h=!0,a=[];if(this._combobox&&""!==this._filterPattern){const t=this._searchByPattern(o??"");h=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:h,ranges:a}),h&&(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=He(t,this._filterPattern);break;case"startsWith":e=Ge(t,this._filterPattern);break;case"contains":e=qe(t,this._filterPattern);break;default:e=We(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 Je=[_t,n`
|
|
1063
|
+
</svg>`,{I:Me}=rt,De=()=>document.createComment(""),Fe=(t,e,i)=>{const s=t._$AA.parentNode,o=void 0===e?t._$AB:e._$AA;if(void 0===i){const e=s.insertBefore(De(),o),r=s.insertBefore(De(),o);i=new Me(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},Pe=(t,e,i=t)=>(t._$AI(e,i),t),Ve={},Ne=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},Re=It(class extends jt{constructor(t){if(super(t),t.type!==zt)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 h=this.ut??=[],a=[];let l,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(h[d]===n[p])a[p]=Pe(o[d],r[p]),d++,p++;else if(h[u]===n[v])a[v]=Pe(o[u],r[v]),u--,v--;else if(h[d]===n[v])a[v]=Pe(o[d],r[v]),Fe(t,a[v+1],o[d]),d++,v--;else if(h[u]===n[p])a[p]=Pe(o[u],r[p]),Fe(t,o[d],o[u]),u--,p++;else if(void 0===l&&(l=Te(n,p,v),c=Te(h,d,u)),l.has(h[d]))if(l.has(h[u])){const e=c.get(n[p]),i=void 0!==e?o[e]:null;if(null===i){const e=Fe(t,o[d]);Pe(e,r[p]),a[p]=e}else a[p]=Pe(i,r[p]),Fe(t,o[d],i),o[e]=null;p++}else Ne(o[u]),u--;else Ne(o[d]),d++;for(;p<=v;){const e=Fe(t,a[v+1]);Pe(e,r[p]),a[p++]=e}for(;d<=u;){const t=o[d++];null!==t&&Ne(t)}return this.ut=n,((t,e=Ve)=>{t._$AH=e})(t,a),G}});var Le=function(t,e,i,s){for(var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,h=t.length-1;h>=0;h--)(o=t[h])&&(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 Ue=class extends kt{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>`}};Ue.styles=_t,Le([pt({type:String})],Ue.prototype,"value",void 0),Le([pt({type:String})],Ue.prototype,"description",void 0),Le([pt({type:Boolean,reflect:!0})],Ue.prototype,"selected",void 0),Le([pt({type:Boolean,reflect:!0})],Ue.prototype,"disabled",void 0),Ue=Le([$t("vscode-option")],Ue);const He=(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 h=e.indexOf(o),a=o.length;0===h&&(i.match=!0,i.ranges.push([n+h,Math.min(n+h+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},qe=(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},We=(t,e)=>{const i={match:!1,ranges:[]};let s=0,o=0;const r=e.length-1,n=t.toLowerCase(),h=e.toLowerCase();for(let t=0;t<=r;t++){if(o=n.indexOf(h[t],s),-1===o)return{match:!1,ranges:[]};i.match=!0,i.ranges.push([o,o+1]),s=o+1}return i},Ke=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 Xe{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 h=!0,a=[];if(this._combobox&&""!==this._filterPattern){const t=this._searchByPattern(o??"");h=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:h,ranges:a}),h&&(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=He(t,this._filterPattern);break;case"startsWith":e=Ge(t,this._filterPattern);break;case"contains":e=qe(t,this._filterPattern);break;default:e=We(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 Je=[_t,n`
|
|
1064
1064
|
:host {
|
|
1065
1065
|
display: block;
|
|
1066
1066
|
position: relative;
|
|
@@ -2348,7 +2348,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
2348
2348
|
table-layout: fixed;
|
|
2349
2349
|
width: 100%;
|
|
2350
2350
|
}
|
|
2351
|
-
`];var
|
|
2351
|
+
`];var Ni=function(t,e,i,s){for(var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,h=t.length-1;h>=0;h--)(o=t[h])&&(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 Ti=class extends kt{constructor(){super(...arguments),this.role="rowgroup"}render(){return U` <slot></slot> `}};Ti.styles=Vi,Ni([pt({reflect:!0})],Ti.prototype,"role",void 0),Ti=Ni([$t("vscode-table-header")],Ti);const Ri=[_t,n`
|
|
2352
2352
|
:host {
|
|
2353
2353
|
box-sizing: border-box;
|
|
2354
2354
|
color: var(--vscode-foreground, #cccccc);
|
|
@@ -2373,11 +2373,11 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
2373
2373
|
white-space: inherit;
|
|
2374
2374
|
width: 100%;
|
|
2375
2375
|
}
|
|
2376
|
-
`];var Li=function(t,e,i,s){for(var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,h=t.length-1;h>=0;h--)(o=t[h])&&(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 Ui=class extends kt{constructor(){super(...arguments),this.role="columnheader"}render(){return U`
|
|
2376
|
+
`];var Li=function(t,e,i,s){for(var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,h=t.length-1;h>=0;h--)(o=t[h])&&(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 Ui=class extends kt{constructor(){super(...arguments),this.minWidth="0",this.index=-1,this.role="columnheader"}willUpdate(t){t.has("minWidth")&&this.index>-1&&this.dispatchEvent(new CustomEvent("vsc-table-change-min-column-width",{detail:{columnIndex:this.index,propertyValue:this.minWidth},bubbles:!0}))}render(){return U`
|
|
2377
2377
|
<div class="wrapper">
|
|
2378
2378
|
<slot></slot>
|
|
2379
2379
|
</div>
|
|
2380
|
-
`}};Ui.styles=Ri,Li([pt({reflect:!0})],Ui.prototype,"role",void 0),Ui=Li([$t("vscode-table-header-cell")],Ui);const Hi=[_t,n`
|
|
2380
|
+
`}};Ui.styles=Ri,Li([pt({attribute:"min-width"})],Ui.prototype,"minWidth",void 0),Li([pt({type:Number})],Ui.prototype,"index",void 0),Li([pt({reflect:!0})],Ui.prototype,"role",void 0),Ui=Li([$t("vscode-table-header-cell")],Ui);const Hi=[_t,n`
|
|
2381
2381
|
:host {
|
|
2382
2382
|
border-top-color: var(
|
|
2383
2383
|
--vscode-editorGroup-border,
|
|
@@ -2522,7 +2522,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
2522
2522
|
position: absolute;
|
|
2523
2523
|
width: ${5}px;
|
|
2524
2524
|
}
|
|
2525
|
-
`];class Ji{constructor(t){this._hostWidth=0,this._hostX=0,this._activeSplitter=null,this._minColumnWidth=0,this._columnWidths=[],this._dragState=null,this._cachedSplitterPositions=null,(this._host=t).addController(this)}hostConnected(){this.saveHostDimensions()}get isDragging(){return null!==this._dragState}get splitterPositions(){if(this._cachedSplitterPositions)return this._cachedSplitterPositions;const t=[];let e=0;for(let i=0;i<this._columnWidths.length-1;i++)e+=this._columnWidths[i],t.push(e);return this._cachedSplitterPositions=t,t}getActiveSplitterCalculatedPosition(){const t=this.splitterPositions;if(!this._dragState)return 0;const e=t[this._dragState.splitterIndex];return this._toPx(e)}get columnWidths(){return this._columnWidths}saveHostDimensions(){const t=this._host.getBoundingClientRect(),{width:e,x:i}=t;return this._hostWidth=e,this._hostX=i,this}setActiveSplitter(t){return this._activeSplitter=t,this}getActiveSplitter(){return this._activeSplitter}setMinColumnWidth(t){return this._minColumnWidth=t,this}setColumWidths(t){return this._columnWidths=t,this._cachedSplitterPositions=null,this._host.requestUpdate(),this}shouldDrag(t){return+t.currentTarget.dataset.index===this._dragState?.splitterIndex}startDrag(t){if(t.stopPropagation(),this._dragState)return;this._activeSplitter?.setPointerCapture(t.pointerId);const e=t.pageX,i=t.currentTarget,s=e-i.getBoundingClientRect().x;this._dragState={dragOffset:s,pointerId:t.pointerId,splitterIndex:+i.dataset.index,prevX:e-s},this._host.requestUpdate()}drag(t){if(t.stopPropagation(),!t?.currentTarget?.hasPointerCapture?.(t.pointerId))return;if(!this._dragState)return;if(t.pointerId!==this._dragState.pointerId)return;if(!this.shouldDrag(t))return;const e=t.pageX,i=e-this._dragState.dragOffset,s=i-this._dragState.prevX,o=this._toPercent(s);this._dragState.prevX=i;const r=this.getActiveSplitterCalculatedPosition();s<=0&&e>r+this._hostX||s>0&&e<r+this._hostX||(this._columnWidths=function(t,e,i,s){const o=[...t];if(0===i||e<0||e>=t.length-1)return o;const r=Math.abs(i);let n=r;const h=[],a=[];for(let t=e;t>=0;t--)h.push(t);for(let i=e+1;i<t.length;i++)a.push(i);const l=i>0?a:h,c=i>0?h:a;let d=0;for(const t of l)d+=Math.max(0,o[t]-s);if(d<n)return o;for(const t of l){if(0===n)break;const e=Math.max(0,o[t]-s),i=Math.min(e,n);o[t]=o[t]-i,n-=i}let u=r;for(const t of c){if(0===u)break;o[t]=o[t]+u,u=0}return o}(this._columnWidths,this._dragState.splitterIndex,o,this._minColumnWidth),this._cachedSplitterPositions=null,this._host.requestUpdate())}stopDrag(t){if(t.stopPropagation(),!this._dragState)return;const e=t.currentTarget;try{e.releasePointerCapture(this._dragState.pointerId)}catch(t){}this._dragState=null,this._activeSplitter=null,this._host.requestUpdate()}_toPercent(t){return((t,e)=>t/e*100)(t,this._hostWidth)}_toPx(t){return((t,e)=>t/100*e)(t,this._hostWidth)}}var Yi=function(t,e,i,s){for(var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,h=t.length-1;h>=0;h--)(o=t[h])&&(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 Zi=class extends kt{constructor(){super(...arguments),this.role="table",this.resizable=!1,this.responsive=!1,this.bordered=!1,this.borderedColumns=!1,this.borderedRows=!1,this.breakpoint=300,this.minColumnWidth="50px",this.delayedResizing=!1,this.compact=!1,this.zebra=!1,this.zebraOdd=!1,this._sashPositions=[],this._isDragging=!1,this._sashHovers=[],this._columns=[],this._activeSashElementIndex=-1,this._componentH=0,this._componentW=0,this._headerCells=[],this._cellsOfFirstRow=[],this._prevHeaderHeight=0,this._prevComponentHeight=0,this._columnResizeController=new Ji(this),this._componentResizeObserverCallback=()=>{this._memoizeComponentDimensions(),this._updateResizeHandlersSize(),this.responsive&&this._toggleCompactView(),this._resizeTableBody()},this._headerResizeObserverCallback=()=>{this._updateResizeHandlersSize()},this._bodyResizeObserverCallback=()=>{this._resizeTableBody()},this._handleSplitterPointerMove=t=>{this._columnResizeController.shouldDrag(t)&&(this._columnResizeController.drag(t),this.delayedResizing?this._resizeColumns(!1):this._resizeColumns(!0))},this._handleSplitterPointerUp=t=>{this._stopDrag(t)},this._handleSplitterPointerCancel=t=>{this._stopDrag(t)}}set columns(t){if(!Array.isArray(t))return this.warn('Invalid value for "columns": expected an array.'),void(this._columns=[]);this._columns=t,this.isConnected&&this._initDefaultColumnSizes()}get columns(){return this._columns}connectedCallback(){super.connectedCallback(),this._memoizeComponentDimensions(),this._initDefaultColumnSizes()}disconnectedCallback(){super.disconnectedCallback(),this._componentResizeObserver?.unobserve(this),this._componentResizeObserver?.disconnect(),this._bodyResizeObserver?.disconnect()}willUpdate(t){if(t.has("minColumnWidth")){const t=Ki(this.minColumnWidth,this._componentW)??0;this._columnResizeController.setMinColumnWidth(t)}}_memoizeComponentDimensions(){const t=this.getBoundingClientRect();this._componentH=t.height,this._componentW=t.width}_queryHeaderCells(){const t=this._assignedHeaderElements;return t&&t[0]?Array.from(t[0].querySelectorAll("vscode-table-header-cell")):[]}_getHeaderCells(){return this._headerCells.length||(this._headerCells=this._queryHeaderCells()),this._headerCells}_queryCellsOfFirstRow(){const t=this._assignedBodyElements;return t&&t[0]?Array.from(t[0].querySelectorAll("vscode-table-row:first-child vscode-table-cell")):[]}_getCellsOfFirstRow(){return this._cellsOfFirstRow.length||(this._cellsOfFirstRow=this._queryCellsOfFirstRow()),this._cellsOfFirstRow}_resizeTableBody(){let t=0,e=0;const i=this.getBoundingClientRect().height;this._assignedHeaderElements&&this._assignedHeaderElements.length&&(t=this._assignedHeaderElements[0].getBoundingClientRect().height),this._assignedBodyElements&&this._assignedBodyElements.length&&(e=this._assignedBodyElements[0].getBoundingClientRect().height);const s=e-t-i;this._scrollableElement.style.height=s>0?i-t+"px":"auto"}_initResizeObserver(){this._componentResizeObserver=new ResizeObserver(this._componentResizeObserverCallback),this._componentResizeObserver.observe(this),this._headerResizeObserver=new ResizeObserver(this._headerResizeObserverCallback),this._headerResizeObserver.observe(this._headerElement)}_calculateInitialColumnWidths(){const t=this._getHeaderCells().length;let e=this.columns.slice(0,t);const i=e.filter((t=>"auto"===t)).length+t-e.length;let s=100;if(e=e.map((t=>{const e=Ki(t,this._componentW);return null===e?"auto":(s-=e,e)})),e.length<t)for(let i=e.length;i<t;i++)e.push("auto");return e=e.map((t=>"auto"===t?s/i:t)),e}_initHeaderCellSizes(t){this._getHeaderCells().forEach(((e,i)=>{e.style.width=`${t[i]}%`}))}_initBodyColumnSizes(t){this._getCellsOfFirstRow().forEach(((e,i)=>{e.style.width=`${t[i]}%`}))}_initSashes(t){const e=t.length;let i=0;this._sashPositions=[],t.forEach(((t,s)=>{if(s<e-1){const e=i+t;this._sashPositions.push(e),i=e}}))}_initDefaultColumnSizes(){const t=this._calculateInitialColumnWidths();this._columnResizeController.setColumWidths(t.map((t=>t))),this._initHeaderCellSizes(t),this._initBodyColumnSizes(t),this._initSashes(t)}_updateResizeHandlersSize(){const t=this._headerElement.getBoundingClientRect();if(t.height===this._prevHeaderHeight&&this._componentH===this._prevComponentHeight)return;this._prevHeaderHeight=t.height,this._prevComponentHeight=this._componentH;const e=this._componentH-t.height;this._sashVisibleElements.forEach((i=>{i.style.height=`${e}px`,i.style.top=`${t.height}px`}))}_applyCompactViewColumnLabels(){const t=this._getHeaderCells().map((t=>t.innerText));this.querySelectorAll("vscode-table-row").forEach((e=>{e.querySelectorAll("vscode-table-cell").forEach(((e,i)=>{e.columnLabel=t[i],e.compact=!0}))}))}_clearCompactViewColumnLabels(){this.querySelectorAll("vscode-table-cell").forEach((t=>{t.columnLabel="",t.compact=!1}))}_toggleCompactView(){const t=this.getBoundingClientRect().width<this.breakpoint;this.compact!==t&&(this.compact=t,t?this._applyCompactViewColumnLabels():this._clearCompactViewColumnLabels())}_stopDrag(t){const e=this._columnResizeController.getActiveSplitter();e&&(e.removeEventListener("pointermove",this._handleSplitterPointerMove),e.removeEventListener("pointerup",this._handleSplitterPointerUp),e.removeEventListener("pointercancel",this._handleSplitterPointerCancel)),this._columnResizeController.stopDrag(t),this._resizeColumns(!0),this._sashHovers[this._activeSashElementIndex]=!1,this._isDragging=!1,this._activeSashElementIndex=-1}_onDefaultSlotChange(){this._assignedElements.forEach((t=>{"vscode-table-header"!==t.tagName.toLowerCase()?"vscode-table-body"!==t.tagName.toLowerCase()||(t.slot="body"):t.slot="header"}))}_onHeaderSlotChange(){this._headerCells=this._queryHeaderCells()}_onBodySlotChange(){if(this._initDefaultColumnSizes(),this._initResizeObserver(),this._updateResizeHandlersSize(),!this._bodyResizeObserver){const t=this._assignedBodyElements[0]??null;t&&(this._bodyResizeObserver=new ResizeObserver(this._bodyResizeObserverCallback),this._bodyResizeObserver.observe(t))}}_onSashMouseOver(t){if(this._isDragging)return;const e=t.currentTarget,i=Number(e.dataset.index);this._sashHovers[i]=!0,this.requestUpdate()}_onSashMouseOut(t){if(t.stopPropagation(),this._isDragging)return;const e=t.currentTarget,i=Number(e.dataset.index);this._sashHovers[i]=!1,this.requestUpdate()}_resizeColumns(t=!0){const e=this._columnResizeController.columnWidths;if(this._getHeaderCells().forEach(((t,i)=>t.style.width=`${e[i]}%`)),t){this._getCellsOfFirstRow().forEach(((t,i)=>t.style.width=`${e[i]}%`))}}_handleSplitterPointerDown(t){t.stopPropagation();const e=t.currentTarget;this._columnResizeController.saveHostDimensions().setActiveSplitter(e).startDrag(t),e.addEventListener("pointermove",this._handleSplitterPointerMove),e.addEventListener("pointerup",this._handleSplitterPointerUp),e.addEventListener("pointercancel",this._handleSplitterPointerCancel)}render(){const t=this._columnResizeController.splitterPositions.map(((t,e)=>{const i=Mt({sash:!0,hover:this._sashHovers[e],resizable:this.resizable}),s=`${t}%`;return this.resizable?U`
|
|
2525
|
+
`];class Ji{constructor(t){this._hostWidth=0,this._hostX=0,this._activeSplitter=null,this._columnMinWidths=new Map,this._columnWidths=[],this._dragState=null,this._cachedSplitterPositions=null,(this._host=t).addController(this)}hostConnected(){this.saveHostDimensions()}get isDragging(){return null!==this._dragState}get splitterPositions(){if(this._cachedSplitterPositions)return this._cachedSplitterPositions;const t=[];let e=0;for(let i=0;i<this._columnWidths.length-1;i++)e+=this._columnWidths[i],t.push(e);return this._cachedSplitterPositions=t,t}getActiveSplitterCalculatedPosition(){const t=this.splitterPositions;if(!this._dragState)return 0;const e=t[this._dragState.splitterIndex];return this._toPx(e)}get columnWidths(){return this._columnWidths}get columnMinWidths(){return new Map(this._columnMinWidths)}saveHostDimensions(){const t=this._host.getBoundingClientRect(),{width:e,x:i}=t;return this._hostWidth=e,this._hostX=i,this}setActiveSplitter(t){return this._activeSplitter=t,this}getActiveSplitter(){return this._activeSplitter}setColumnMinWidthAt(t,e){return this._columnMinWidths.set(t,e),this._host.requestUpdate(),this}setColumWidths(t){return this._columnWidths=t,this._cachedSplitterPositions=null,this._host.requestUpdate(),this}shouldDrag(t){return+t.currentTarget.dataset.index===this._dragState?.splitterIndex}startDrag(t){if(t.stopPropagation(),this._dragState)return;this._activeSplitter?.setPointerCapture(t.pointerId);const e=t.pageX,i=t.currentTarget,s=e-i.getBoundingClientRect().x;this._dragState={dragOffset:s,pointerId:t.pointerId,splitterIndex:+i.dataset.index,prevX:e-s},this._host.requestUpdate()}drag(t){if(t.stopPropagation(),!t?.currentTarget?.hasPointerCapture?.(t.pointerId))return;if(!this._dragState)return;if(t.pointerId!==this._dragState.pointerId)return;if(!this.shouldDrag(t))return;const e=t.pageX,i=e-this._dragState.dragOffset,s=i-this._dragState.prevX,o=this._toPercent(s);this._dragState.prevX=i;const r=this.getActiveSplitterCalculatedPosition();s<=0&&e>r+this._hostX||s>0&&e<r+this._hostX||(this._columnWidths=function(t,e,i,s){const o=[...t];if(0===i||e<0||e>=t.length-1)return o;const r=Math.abs(i);let n=r;const h=[],a=[];for(let t=e;t>=0;t--)h.push(t);for(let i=e+1;i<t.length;i++)a.push(i);const l=i>0?a:h,c=i>0?h:a;let d=0;for(const t of l)d+=Math.max(0,o[t]-(s.get(t)??0));if(d<n)return o;for(const t of l){if(0===n)break;const e=Math.max(0,o[t]-(s.get(t)??0)),i=Math.min(e,n);o[t]=o[t]-i,n-=i}let u=r;for(const t of c){if(0===u)break;o[t]=o[t]+u,u=0}return o}(this._columnWidths,this._dragState.splitterIndex,o,this._columnMinWidths),this._cachedSplitterPositions=null,this._host.requestUpdate())}stopDrag(t){if(t.stopPropagation(),!this._dragState)return;const e=t.currentTarget;try{e.releasePointerCapture(this._dragState.pointerId)}catch(t){}this._dragState=null,this._activeSplitter=null,this._host.requestUpdate()}_toPercent(t){return((t,e)=>t/e*100)(t,this._hostWidth)}_toPx(t){return((t,e)=>t/100*e)(t,this._hostWidth)}}var Yi=function(t,e,i,s){for(var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,h=t.length-1;h>=0;h--)(o=t[h])&&(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 Zi=class extends kt{set columns(t){if(!Array.isArray(t))return this.warn('Invalid value for "columns": expected an array.'),void(this._columns=[]);this._columns=t,this.isConnected&&this._initDefaultColumnSizes()}get columns(){return this._columns}constructor(){super(),this.role="table",this.resizable=!1,this.responsive=!1,this.bordered=!1,this.borderedColumns=!1,this.borderedRows=!1,this.breakpoint=300,this.minColumnWidth="50px",this.delayedResizing=!1,this.compact=!1,this.zebra=!1,this.zebraOdd=!1,this._sashPositions=[],this._isDragging=!1,this._sashHovers=[],this._columns=[],this._activeSashElementIndex=-1,this._componentH=0,this._componentW=0,this._headerCells=[],this._cellsOfFirstRow=[],this._prevHeaderHeight=0,this._prevComponentHeight=0,this._columnResizeController=new Ji(this),this._componentResizeObserverCallback=()=>{this._memoizeComponentDimensions(),this._updateResizeHandlersSize(),this.responsive&&this._toggleCompactView(),this._resizeTableBody()},this._headerResizeObserverCallback=()=>{this._updateResizeHandlersSize()},this._bodyResizeObserverCallback=()=>{this._resizeTableBody()},this._handleSplitterPointerMove=t=>{this._columnResizeController.shouldDrag(t)&&(this._columnResizeController.drag(t),this.delayedResizing?this._resizeColumns(!1):this._resizeColumns(!0))},this._handleSplitterPointerUp=t=>{this._stopDrag(t)},this._handleSplitterPointerCancel=t=>{this._stopDrag(t)},this._handleMinColumnWidthChange=t=>{const{columnIndex:e,propertyValue:i}=t.detail,s=Ki(i,this._componentW);s&&this._columnResizeController.setColumnMinWidthAt(e,s)},this.addEventListener("vsc-table-change-min-column-width",this._handleMinColumnWidthChange)}connectedCallback(){super.connectedCallback(),this._memoizeComponentDimensions(),this._initDefaultColumnSizes()}disconnectedCallback(){super.disconnectedCallback(),this._componentResizeObserver?.unobserve(this),this._componentResizeObserver?.disconnect(),this._bodyResizeObserver?.disconnect()}willUpdate(t){if(t.has("minColumnWidth")){const t=Ki(this.minColumnWidth,this._componentW)??0,e=this._columnResizeController.columnMinWidths,i=this._columnResizeController.columnWidths;for(let s=0;s<i.length;s++)e.has(s)||this._columnResizeController.setColumnMinWidthAt(s,t)}}_memoizeComponentDimensions(){const t=this.getBoundingClientRect();this._componentH=t.height,this._componentW=t.width}_queryHeaderCells(){const t=this._assignedHeaderElements;return t&&t[0]?Array.from(t[0].querySelectorAll("vscode-table-header-cell")):[]}_getHeaderCells(){return this._headerCells.length||(this._headerCells=this._queryHeaderCells()),this._headerCells}_queryCellsOfFirstRow(){const t=this._assignedBodyElements;return t&&t[0]?Array.from(t[0].querySelectorAll("vscode-table-row:first-child vscode-table-cell")):[]}_getCellsOfFirstRow(){return this._cellsOfFirstRow.length||(this._cellsOfFirstRow=this._queryCellsOfFirstRow()),this._cellsOfFirstRow}_resizeTableBody(){let t=0,e=0;const i=this.getBoundingClientRect().height;this._assignedHeaderElements&&this._assignedHeaderElements.length&&(t=this._assignedHeaderElements[0].getBoundingClientRect().height),this._assignedBodyElements&&this._assignedBodyElements.length&&(e=this._assignedBodyElements[0].getBoundingClientRect().height);const s=e-t-i;this._scrollableElement.style.height=s>0?i-t+"px":"auto"}_initResizeObserver(){this._componentResizeObserver=new ResizeObserver(this._componentResizeObserverCallback),this._componentResizeObserver.observe(this),this._headerResizeObserver=new ResizeObserver(this._headerResizeObserverCallback),this._headerResizeObserver.observe(this._headerElement)}_calculateInitialColumnWidths(){const t=this._getHeaderCells().length;let e=this.columns.slice(0,t);const i=e.filter((t=>"auto"===t)).length+t-e.length;let s=100;if(e=e.map((t=>{const e=Ki(t,this._componentW);return null===e?"auto":(s-=e,e)})),e.length<t)for(let i=e.length;i<t;i++)e.push("auto");return e=e.map((t=>"auto"===t?s/i:t)),e}_initHeaderCellSizes(t){this._getHeaderCells().forEach(((e,i)=>{e.style.width=`${t[i]}%`}))}_initBodyColumnSizes(t){this._getCellsOfFirstRow().forEach(((e,i)=>{e.style.width=`${t[i]}%`}))}_initSashes(t){const e=t.length;let i=0;this._sashPositions=[],t.forEach(((t,s)=>{if(s<e-1){const e=i+t;this._sashPositions.push(e),i=e}}))}_initDefaultColumnSizes(){const t=this._calculateInitialColumnWidths();this._columnResizeController.setColumWidths(t.map((t=>t))),this._initHeaderCellSizes(t),this._initBodyColumnSizes(t),this._initSashes(t)}_updateResizeHandlersSize(){const t=this._headerElement.getBoundingClientRect();if(t.height===this._prevHeaderHeight&&this._componentH===this._prevComponentHeight)return;this._prevHeaderHeight=t.height,this._prevComponentHeight=this._componentH;const e=this._componentH-t.height;this._sashVisibleElements.forEach((i=>{i.style.height=`${e}px`,i.style.top=`${t.height}px`}))}_applyCompactViewColumnLabels(){const t=this._getHeaderCells().map((t=>t.innerText));this.querySelectorAll("vscode-table-row").forEach((e=>{e.querySelectorAll("vscode-table-cell").forEach(((e,i)=>{e.columnLabel=t[i],e.compact=!0}))}))}_clearCompactViewColumnLabels(){this.querySelectorAll("vscode-table-cell").forEach((t=>{t.columnLabel="",t.compact=!1}))}_toggleCompactView(){const t=this.getBoundingClientRect().width<this.breakpoint;this.compact!==t&&(this.compact=t,t?this._applyCompactViewColumnLabels():this._clearCompactViewColumnLabels())}_stopDrag(t){const e=this._columnResizeController.getActiveSplitter();e&&(e.removeEventListener("pointermove",this._handleSplitterPointerMove),e.removeEventListener("pointerup",this._handleSplitterPointerUp),e.removeEventListener("pointercancel",this._handleSplitterPointerCancel)),this._columnResizeController.stopDrag(t),this._resizeColumns(!0),this._sashHovers[this._activeSashElementIndex]=!1,this._isDragging=!1,this._activeSashElementIndex=-1}_onDefaultSlotChange(){this._assignedElements.forEach((t=>{"vscode-table-header"!==t.tagName.toLowerCase()?"vscode-table-body"!==t.tagName.toLowerCase()||(t.slot="body"):t.slot="header"}))}_onHeaderSlotChange(){this._headerCells=this._queryHeaderCells();[].fill(0,0,this._headerCells.length-1),this._headerCells.forEach(((t,e)=>{if(t.index=e,t.minWidth){const i=Ki(t.minWidth,this._componentW)??0;this._columnResizeController.setColumnMinWidthAt(e,i)}}))}_onBodySlotChange(){if(this._initDefaultColumnSizes(),this._initResizeObserver(),this._updateResizeHandlersSize(),!this._bodyResizeObserver){const t=this._assignedBodyElements[0]??null;t&&(this._bodyResizeObserver=new ResizeObserver(this._bodyResizeObserverCallback),this._bodyResizeObserver.observe(t))}}_onSashMouseOver(t){if(this._isDragging)return;const e=t.currentTarget,i=Number(e.dataset.index);this._sashHovers[i]=!0,this.requestUpdate()}_onSashMouseOut(t){if(t.stopPropagation(),this._isDragging)return;const e=t.currentTarget,i=Number(e.dataset.index);this._sashHovers[i]=!1,this.requestUpdate()}_resizeColumns(t=!0){const e=this._columnResizeController.columnWidths;if(this._getHeaderCells().forEach(((t,i)=>t.style.width=`${e[i]}%`)),t){this._getCellsOfFirstRow().forEach(((t,i)=>t.style.width=`${e[i]}%`))}}_handleSplitterPointerDown(t){t.stopPropagation();const e=t.currentTarget;this._columnResizeController.saveHostDimensions().setActiveSplitter(e).startDrag(t),e.addEventListener("pointermove",this._handleSplitterPointerMove),e.addEventListener("pointerup",this._handleSplitterPointerUp),e.addEventListener("pointercancel",this._handleSplitterPointerCancel)}render(){const t=this._columnResizeController.splitterPositions.map(((t,e)=>{const i=Mt({sash:!0,hover:this._sashHovers[e],resizable:this.resizable}),s=`${t}%`;return this.resizable?U`
|
|
2526
2526
|
<div
|
|
2527
2527
|
class=${i}
|
|
2528
2528
|
data-index=${e}
|
|
@@ -3338,7 +3338,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
3338
3338
|
:host([branch][open]) ::slotted(vscode-tree-item) {
|
|
3339
3339
|
display: block;
|
|
3340
3340
|
}
|
|
3341
|
-
`];var Vs,
|
|
3341
|
+
`];var Vs,Ns=function(t,e,i,s){for(var o,r=arguments.length,n=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s,h=t.length-1;h>=0;h--)(o=t[h])&&(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};const Ts=U`<svg
|
|
3342
3342
|
width="16"
|
|
3343
3343
|
height="16"
|
|
3344
3344
|
viewBox="0 0 16 16"
|
|
@@ -3361,7 +3361,7 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
3361
3361
|
class=${Mt({"arrow-container":!0,"icon-rotated":this.open})}
|
|
3362
3362
|
part="arrow-icon-container"
|
|
3363
3363
|
>
|
|
3364
|
-
${
|
|
3364
|
+
${Ts}
|
|
3365
3365
|
</div>`:q}
|
|
3366
3366
|
<div class=${Mt(c)} part="icon-container">
|
|
3367
3367
|
${this.branch&&!this.open?U`<slot
|
|
@@ -3416,4 +3416,4 @@ const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow
|
|
|
3416
3416
|
@slotchange=${this._handleChildrenSlotChange}
|
|
3417
3417
|
></slot>
|
|
3418
3418
|
</div>
|
|
3419
|
-
</div>`}};Ls.styles=Ps,
|
|
3419
|
+
</div>`}};Ls.styles=Ps,Ns([pt({type:Boolean})],Ls.prototype,"active",void 0),Ns([pt({type:Boolean,reflect:!0})],Ls.prototype,"branch",void 0),Ns([pt({type:Boolean})],Ls.prototype,"hasActiveItem",void 0),Ns([pt({type:Boolean})],Ls.prototype,"hasSelectedItem",void 0),Ns([pt({type:Boolean})],Ls.prototype,"highlightedGuides",void 0),Ns([pt({type:Boolean,reflect:!0})],Ls.prototype,"open",void 0),Ns([pt({type:Number,reflect:!0})],Ls.prototype,"level",void 0),Ns([pt({type:Boolean,reflect:!0})],Ls.prototype,"selected",null),Ns([vt()],Ls.prototype,"_hasBranchIcon",void 0),Ns([vt()],Ls.prototype,"_hasBranchOpenedIcon",void 0),Ns([vt()],Ls.prototype,"_hasLeafIcon",void 0),Ns([vt()],Ls.prototype,"_hasDescriptionSlotContent",void 0),Ns([vt()],Ls.prototype,"_hasActionsSlotContent",void 0),Ns([vt()],Ls.prototype,"_hasDecorationSlotContent",void 0),Ns([ys({context:$s,subscribe:!0})],Ls.prototype,"_treeContextState",void 0),Ns([ys({context:_s,subscribe:!0})],Ls.prototype,"_configContext",void 0),Ns([mt({selector:"vscode-tree-item"})],Ls.prototype,"_initiallyAssignedTreeItems",void 0),Ns([mt({selector:"vscode-tree-item",slot:"children"})],Ls.prototype,"_childrenTreeItems",void 0),Ns([mt({slot:"description",flatten:!0})],Ls.prototype,"_descriptionSlotElements",void 0),Ns([mt({slot:"actions",flatten:!0})],Ls.prototype,"_actionsSlotElements",void 0),Ns([mt({slot:"decoration",flatten:!0})],Ls.prototype,"_decorationSlotElements",void 0),Ls=Vs=Ns([$t("vscode-tree-item")],Ls);export{At as VscodeBadge,Ut as VscodeButton,qt as VscodeButtonGroup,te as VscodeCheckbox,se as VscodeCheckboxGroup,ne as VscodeCollapsible,ue as VscodeContextMenu,le as VscodeContextMenuItem,be as VscodeDivider,xe as VscodeFormContainer,ke as VscodeFormGroup,Ce as VscodeFormHelper,Tt as VscodeIcon,Ee as VscodeLabel,oi as VscodeMultiSelect,Ue as VscodeOption,ci as VscodeProgressBar,hi as VscodeProgressRing,pi as VscodeRadio,fi as VscodeRadioGroup,Ze as VscodeScrollable,mi as VscodeSingleSelect,Si as VscodeSplitLayout,Ai as VscodeTabHeader,Ei as VscodeTabPanel,Zi as VscodeTable,Mi as VscodeTableBody,Pi as VscodeTableCell,Ti as VscodeTableHeader,Ui as VscodeTableHeaderCell,qi as VscodeTableRow,es as VscodeTabs,os as VscodeTextarea,as as VscodeTextfield,ds as VscodeToolbarButton,vs as VscodeToolbarContainer,Fs as VscodeTree,Ls as VscodeTreeItem};
|
|
@@ -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,aAAa,CAAC;AAC9B,MAAM,UAAU,GAAG,2CAA2C,CAAC;AAE/D,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,iBAA8B,EAAE,EAAE;IAC/D,MAAM,MAAM,GAAG,oBAAoB,CAAC;IAEpC,IAAI,iBAAiB,EAAE,CAAC;QACtB,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC7D,CAAC;SAAM,CAAC;QACN,sCAAsC;QACtC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LitElement} from 'lit';\n\nconst VERSION = '2.4.1-pre.
|
|
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,aAAa,CAAC;AAC9B,MAAM,UAAU,GAAG,2CAA2C,CAAC;AAE/D,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,iBAA8B,EAAE,EAAE;IAC/D,MAAM,MAAM,GAAG,oBAAoB,CAAC;IAEpC,IAAI,iBAAiB,EAAE,CAAC;QACtB,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,GAAG,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;IAC7D,CAAC;SAAM,CAAC;QACN,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;IACpD,CAAC;AACH,CAAC,CAAC;AAEF,MAAM,OAAO,UAAW,SAAQ,UAAU;IACxC,8BAA8B;IAC9B,IAAI,OAAO;QACT,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,IAAI,CAAC,OAAe;QAClB,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACtB,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,IAAI,CACF,uBAAuB,OAAO,KAAK,OAAO,0CAA0C,UAAU,UAAU,CACzG,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["import {LitElement} from 'lit';\n\nconst VERSION = '2.4.1-pre.1';\nconst CONFIG_KEY = '__vscodeElements_disableRegistryWarning__';\n\nconst warn = (message: string, componentInstance?: VscElement) => {\n const prefix = '[VSCode Elements] ';\n\n if (componentInstance) {\n // eslint-disable-next-line no-console\n console.warn(`${prefix}${message}\\n%o`, componentInstance);\n } else {\n // eslint-disable-next-line no-console\n console.warn(`${message}\\n%o`, componentInstance);\n }\n};\n\nexport class VscElement extends LitElement {\n /** VSCode Elements version */\n get version(): string {\n return VERSION;\n }\n\n warn(message: string) {\n warn(message, this);\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 warn(\n `The custom element \"${tagName}\" ${message}\\nTo suppress this warning, set window.${CONFIG_KEY} to true`\n );\n };\n};\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type Px = number & {
|
|
2
|
+
readonly __unit: 'px';
|
|
3
|
+
};
|
|
4
|
+
export type Percent = number & {
|
|
5
|
+
readonly __unit: '%';
|
|
6
|
+
};
|
|
7
|
+
export declare const px: (value: number) => Px;
|
|
8
|
+
export declare const percent: (value: number) => Percent;
|
|
9
|
+
export declare const toPercent: (px: Px, container: Px) => Percent;
|
|
10
|
+
export declare const toPx: (p: Percent, container: Px) => Px;
|
|
11
|
+
export declare const parseSizeAttributeToPercent: (raw: string | number, base: number) => Percent | null;
|
|
12
|
+
//# sourceMappingURL=sizes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sizes.d.ts","sourceRoot":"","sources":["../../src/includes/sizes.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,EAAE,GAAG,MAAM,GAAG;IAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAA;CAAC,CAAC;AAClD,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG;IAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAA;CAAC,CAAC;AAEtD,eAAO,MAAM,EAAE,GAAI,OAAO,MAAM,KAAG,EAAiB,CAAC;AACrD,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,KAAG,OAA2B,CAAC;AAEpE,eAAO,MAAM,SAAS,GAAI,IAAI,EAAE,EAAE,WAAW,EAAE,KAAG,OACjB,CAAC;AAElC,eAAO,MAAM,IAAI,GAAI,GAAG,OAAO,EAAE,WAAW,EAAE,KAAG,EACtB,CAAC;AAsB5B,eAAO,MAAM,2BAA2B,GACtC,KAAK,MAAM,GAAG,MAAM,EACpB,MAAM,MAAM,KACX,OAAO,GAAG,IAaZ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export const px = (value) => value;
|
|
2
|
+
export const percent = (value) => value;
|
|
3
|
+
export const toPercent = (px, container) => percent((px / container) * 100);
|
|
4
|
+
export const toPx = (p, container) => px((p / 100) * container);
|
|
5
|
+
const parsers = [
|
|
6
|
+
{
|
|
7
|
+
test: (v) => /^-?\d+(\.\d+)?%$/.test(v),
|
|
8
|
+
parse: (v) => Number(v.slice(0, -1)),
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
test: (v) => /^-?\d+(\.\d+)?px$/.test(v),
|
|
12
|
+
parse: (v, base) => (Number(v.slice(0, -2)) / base) * 100,
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
test: (v) => /^-?\d+(\.\d+)?$/.test(v),
|
|
16
|
+
parse: (v, base) => (Number(v) / base) * 100,
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
export const parseSizeAttributeToPercent = (raw, base) => {
|
|
20
|
+
if (!Number.isFinite(base) || base === 0) {
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
if (typeof raw === 'number') {
|
|
24
|
+
return Number.isFinite(raw) ? percent((raw / base) * 100) : null;
|
|
25
|
+
}
|
|
26
|
+
const value = raw.trim();
|
|
27
|
+
const parser = parsers.find((p) => p.test(value));
|
|
28
|
+
return parser ? percent(parser.parse(value, base)) : null;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=sizes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sizes.js","sourceRoot":"","sources":["../../src/includes/sizes.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,KAAa,EAAM,EAA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,QAAQ,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,IAAI,CAAC;IACd,CAAC;IAED,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC5B,OAAO,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACnE,CAAC;IAED,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IAElD,OAAO,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC5D,CAAC,CAAC","sourcesContent":["export type Px = number & {readonly __unit: 'px'};\nexport type Percent = number & {readonly __unit: '%'};\n\nexport const px = (value: number): Px => value as Px;\nexport const percent = (value: number): Percent => value as Percent;\n\nexport const toPercent = (px: Px, container: Px): Percent =>\n percent((px / container) * 100);\n\nexport const toPx = (p: Percent, container: Px): Px =>\n px((p / 100) * container);\n\ntype Parser = {\n test: (value: string) => boolean;\n parse: (value: string, base: number) => number;\n};\n\nconst parsers: Parser[] = [\n {\n test: (v) => /^-?\\d+(\\.\\d+)?%$/.test(v),\n parse: (v) => Number(v.slice(0, -1)),\n },\n {\n test: (v) => /^-?\\d+(\\.\\d+)?px$/.test(v),\n parse: (v, base) => (Number(v.slice(0, -2)) / base) * 100,\n },\n {\n test: (v) => /^-?\\d+(\\.\\d+)?$/.test(v),\n parse: (v, base) => (Number(v) / base) * 100,\n },\n];\n\nexport const parseSizeAttributeToPercent = (\n raw: string | number,\n base: number\n): Percent | null => {\n if (!Number.isFinite(base) || base === 0) {\n return null;\n }\n\n if (typeof raw === 'number') {\n return Number.isFinite(raw) ? percent((raw / base) * 100) : null;\n }\n\n const value = raw.trim();\n const parser = parsers.find((p) => p.test(value));\n\n return parser ? percent(parser.parse(value, base)) : null;\n};\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ReactiveController } from 'lit';
|
|
2
2
|
import { type VscodeTable } from './vscode-table.js';
|
|
3
|
-
import { Percent, Px } from '
|
|
3
|
+
import { Percent, Px } from '../includes/sizes.js';
|
|
4
4
|
type SplitterElement = HTMLDivElement & {
|
|
5
5
|
dataset: DOMStringMap & {
|
|
6
6
|
index: string;
|
|
@@ -11,7 +11,7 @@ export declare class ColumnResizeController implements ReactiveController {
|
|
|
11
11
|
private _hostWidth;
|
|
12
12
|
private _hostX;
|
|
13
13
|
private _activeSplitter;
|
|
14
|
-
private
|
|
14
|
+
private _columnMinWidths;
|
|
15
15
|
private _columnWidths;
|
|
16
16
|
private _dragState;
|
|
17
17
|
private _cachedSplitterPositions;
|
|
@@ -21,10 +21,11 @@ export declare class ColumnResizeController implements ReactiveController {
|
|
|
21
21
|
get splitterPositions(): Percent[];
|
|
22
22
|
getActiveSplitterCalculatedPosition(): Px;
|
|
23
23
|
get columnWidths(): Percent[];
|
|
24
|
+
get columnMinWidths(): Map<number, Percent>;
|
|
24
25
|
saveHostDimensions(): this;
|
|
25
26
|
setActiveSplitter(splitter: HTMLElement): this;
|
|
26
27
|
getActiveSplitter(): SplitterElement | null;
|
|
27
|
-
|
|
28
|
+
setColumnMinWidthAt(colIndex: number, value: Percent): this;
|
|
28
29
|
setColumWidths(widths: Percent[]): this;
|
|
29
30
|
shouldDrag(event: PointerEvent): boolean;
|
|
30
31
|
startDrag(event: PointerEvent): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnResizeController.d.ts","sourceRoot":"","sources":["../../src/vscode-table/ColumnResizeController.ts"],"names":[],"mappings":"AAAA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AE,YAAY;IAwB7B,IAAI,CAAC,KAAK,EAAE,YAAY;IAiDxB,QAAQ,CAAC,KAAK,EAAE,YAAY;IAoB5B,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,KAAK;CAGd"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { percent, px, toPercent, toPx } from '../includes/sizes.js';
|
|
2
|
+
import { calculateColumnWidths } from './calculations.js';
|
|
2
3
|
export class ColumnResizeController {
|
|
3
4
|
constructor(host) {
|
|
4
5
|
this._hostWidth = px(0);
|
|
5
6
|
this._hostX = px(0);
|
|
6
7
|
this._activeSplitter = null;
|
|
7
|
-
this.
|
|
8
|
+
this._columnMinWidths = new Map();
|
|
8
9
|
this._columnWidths = [];
|
|
9
10
|
this._dragState = null;
|
|
10
11
|
this._cachedSplitterPositions = null;
|
|
@@ -41,6 +42,9 @@ export class ColumnResizeController {
|
|
|
41
42
|
get columnWidths() {
|
|
42
43
|
return this._columnWidths;
|
|
43
44
|
}
|
|
45
|
+
get columnMinWidths() {
|
|
46
|
+
return new Map(this._columnMinWidths);
|
|
47
|
+
}
|
|
44
48
|
saveHostDimensions() {
|
|
45
49
|
const cr = this._host.getBoundingClientRect();
|
|
46
50
|
const { width, x } = cr;
|
|
@@ -55,8 +59,9 @@ export class ColumnResizeController {
|
|
|
55
59
|
getActiveSplitter() {
|
|
56
60
|
return this._activeSplitter;
|
|
57
61
|
}
|
|
58
|
-
|
|
59
|
-
this.
|
|
62
|
+
setColumnMinWidthAt(colIndex, value) {
|
|
63
|
+
this._columnMinWidths.set(colIndex, value);
|
|
64
|
+
this._host.requestUpdate();
|
|
60
65
|
return this;
|
|
61
66
|
}
|
|
62
67
|
setColumWidths(widths) {
|
|
@@ -111,7 +116,7 @@ export class ColumnResizeController {
|
|
|
111
116
|
(deltaPx > 0 && mouseX < splitterPos + this._hostX)) {
|
|
112
117
|
return;
|
|
113
118
|
}
|
|
114
|
-
this._columnWidths = calculateColumnWidths(this._columnWidths, this._dragState.splitterIndex, delta, this.
|
|
119
|
+
this._columnWidths = calculateColumnWidths(this._columnWidths, this._dragState.splitterIndex, delta, this._columnMinWidths);
|
|
115
120
|
this._cachedSplitterPositions = null;
|
|
116
121
|
this._host.requestUpdate();
|
|
117
122
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColumnResizeController.js","sourceRoot":"","sources":["../../src/vscode-table/ColumnResizeController.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,qBAAqB,EAErB,OAAO,EAEP,EAAE,EACF,SAAS,EACT,IAAI,GACL,MAAM,mBAAmB,CAAC;AAQ3B,MAAM,OAAO,sBAAsB;IAejC,YAAY,IAAiB;QAbrB,eAAU,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACnB,WAAM,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACf,oBAAe,GAA2B,IAAI,CAAC;QAC/C,oBAAe,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAC7B,kBAAa,GAAc,EAAE,CAAC;QAC9B,eAAU,GAKP,IAAI,CAAC;QACR,6BAAwB,GAAqB,IAAI,CAAC;QAGxD,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IAED,aAAa;QACX,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;IAED,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC;IAClC,CAAC;IAED,IAAI,iBAAiB;QACnB,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC,wBAAwB,CAAC;QACvC,CAAC;QAED,MAAM,MAAM,GAAc,EAAE,CAAC;QAE7B,IAAI,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;QAErB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,aAAa,CAA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1B,KAAK,CAAC,eAAe,EAAE,CAAC;QAExB,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,OAAO;QACT,CAAC;QAED,MAAM,EAAE,GAAG,KAAK,CAAC,aAAgC,CAAC;QAElD,IAAI,CAAC;YACH,EAAE,CAAC,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;QACtD,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,SAAS;QACX,CAAC;QAED,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,CAAC;IAC7B,CAAC;IAEO,UAAU,CAAC,EAAM;QACvB,OAAO,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAEO,KAAK,CAAC,OAAgB;QAC5B,OAAO,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["import {ReactiveController} from 'lit';\nimport {type VscodeTable} from './vscode-table.js';\nimport {\n calculateColumnWidths,\n Percent,\n percent,\n Px,\n px,\n toPercent,\n toPx,\n} from './calculations.js';\n\ntype SplitterElement = HTMLDivElement & {\n dataset: DOMStringMap & {\n index: string;\n };\n};\n\nexport class ColumnResizeController implements ReactiveController {\n private _host: VscodeTable;\n private _hostWidth = px(0);\n private _hostX = px(0);\n private _activeSplitter: SplitterElement | null = null;\n private _minColumnWidth = percent(0);\n private _columnWidths: Percent[] = [];\n private _dragState: {\n splitterIndex: number;\n pointerId: number;\n prevX: Px;\n dragOffset: Px;\n } | null = null;\n private _cachedSplitterPositions: Percent[] | null = null;\n\n constructor(host: VscodeTable) {\n (this._host = host).addController(this);\n }\n\n hostConnected(): void {\n this.saveHostDimensions();\n }\n\n get isDragging(): boolean {\n return this._dragState !== null;\n }\n\n get splitterPositions(): Percent[] {\n if (this._cachedSplitterPositions) {\n return this._cachedSplitterPositions;\n }\n\n const result: Percent[] = [];\n\n let acc = percent(0);\n\n for (let i = 0; i < this._columnWidths.length - 1; i++) {\n acc = percent(acc + this._columnWidths[i]);\n result.push(acc);\n }\n\n this._cachedSplitterPositions = result;\n\n return result;\n }\n\n getActiveSplitterCalculatedPosition() {\n const splitterPositions = this.splitterPositions;\n\n if (!this._dragState) {\n return px(0);\n }\n\n const activeSplitterPos = splitterPositions[this._dragState.splitterIndex];\n const activeSplitterPosPx = this._toPx(activeSplitterPos);\n\n return activeSplitterPosPx;\n }\n\n get columnWidths() {\n return this._columnWidths;\n }\n\n saveHostDimensions() {\n const cr = this._host.getBoundingClientRect();\n const {width, x} = cr;\n this._hostWidth = px(width);\n this._hostX = px(x);\n return this;\n }\n\n setActiveSplitter(splitter: HTMLElement) {\n this._activeSplitter = splitter as SplitterElement;\n return this;\n }\n\n getActiveSplitter() {\n return this._activeSplitter;\n }\n\n setMinColumnWidth(width: Percent) {\n this._minColumnWidth = width;\n return this;\n }\n\n setColumWidths(widths: Percent[]) {\n this._columnWidths = widths;\n this._cachedSplitterPositions = null;\n this._host.requestUpdate();\n return this;\n }\n\n shouldDrag(event: PointerEvent) {\n return (\n +(event.currentTarget as SplitterElement).dataset.index ===\n this._dragState?.splitterIndex\n );\n }\n\n startDrag(event: PointerEvent) {\n event.stopPropagation();\n\n if (this._dragState) {\n return;\n }\n\n this._activeSplitter?.setPointerCapture(event.pointerId);\n\n const mouseX = event.pageX;\n const splitter = event.currentTarget as SplitterElement;\n const splitterX = splitter!.getBoundingClientRect().x;\n const xOffset = px(mouseX - splitterX);\n\n this._dragState = {\n dragOffset: px(xOffset),\n pointerId: event.pointerId,\n splitterIndex: +splitter.dataset.index,\n prevX: px(mouseX - xOffset),\n };\n\n this._host.requestUpdate();\n }\n\n drag(event: PointerEvent) {\n event.stopPropagation();\n\n if (\n !(event?.currentTarget as SplitterElement)?.hasPointerCapture?.(\n event.pointerId\n )\n ) {\n return;\n }\n\n if (!this._dragState) {\n return;\n }\n\n if (event.pointerId !== this._dragState.pointerId) {\n return;\n }\n\n if (!this.shouldDrag(event)) {\n return;\n }\n\n const mouseX = event.pageX;\n const x = px(mouseX - this._dragState.dragOffset);\n const deltaPx = px(x - this._dragState.prevX);\n const delta = this._toPercent(deltaPx);\n this._dragState.prevX = x;\n\n const splitterPos = this.getActiveSplitterCalculatedPosition();\n\n if (\n (deltaPx <= 0 && mouseX > splitterPos + this._hostX) ||\n (deltaPx > 0 && mouseX < splitterPos + this._hostX)\n ) {\n return;\n }\n\n this._columnWidths = calculateColumnWidths(\n this._columnWidths,\n this._dragState.splitterIndex,\n delta,\n this._minColumnWidth\n );\n this._cachedSplitterPositions = null;\n\n this._host.requestUpdate();\n }\n\n stopDrag(event: PointerEvent) {\n event.stopPropagation();\n\n if (!this._dragState) {\n return;\n }\n\n const el = event.currentTarget as SplitterElement;\n\n try {\n el.releasePointerCapture(this._dragState.pointerId);\n } catch (e) {\n // ignore\n }\n\n this._dragState = null;\n this._activeSplitter = null;\n this._host.requestUpdate();\n }\n\n private _toPercent(px: Px) {\n return toPercent(px, this._hostWidth);\n }\n\n private _toPx(percent: Percent) {\n return toPx(percent, this._hostWidth);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ColumnResizeController.js","sourceRoot":"","sources":["../../src/vscode-table/ColumnResizeController.ts"],"names":[],"mappings":"AAEA,OAAO,EAAU,OAAO,EAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAC,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAC,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAQxD,MAAM,OAAO,sBAAsB;IAejC,YAAY,IAAiB;QAbrB,eAAU,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACnB,WAAM,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACf,oBAAe,GAA2B,IAAI,CAAC;QAC/C,qBAAgB,GAAG,IAAI,GAAG,EAAmB,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AAa,EAAE,CAAC;IAC7B,CAAC;IAEO,UAAU,CAAC,EAAM;QACvB,OAAO,SAAS,CAAC,EAAE,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;IAEO,KAAK,CAAC,OAAgB;QAC5B,OAAO,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACxC,CAAC;CACF","sourcesContent":["import {ReactiveController} from 'lit';\nimport {type VscodeTable} from './vscode-table.js';\nimport {Percent, percent, Px, px, toPercent, toPx} from '../includes/sizes.js';\nimport {calculateColumnWidths} from './calculations.js';\n\ntype SplitterElement = HTMLDivElement & {\n dataset: DOMStringMap & {\n index: string;\n };\n};\n\nexport class ColumnResizeController implements ReactiveController {\n private _host: VscodeTable;\n private _hostWidth = px(0);\n private _hostX = px(0);\n private _activeSplitter: SplitterElement | null = null;\n private _columnMinWidths = new Map<number, Percent>();\n private _columnWidths: Percent[] = [];\n private _dragState: {\n splitterIndex: number;\n pointerId: number;\n prevX: Px;\n dragOffset: Px;\n } | null = null;\n private _cachedSplitterPositions: Percent[] | null = null;\n\n constructor(host: VscodeTable) {\n (this._host = host).addController(this);\n }\n\n hostConnected(): void {\n this.saveHostDimensions();\n }\n\n get isDragging(): boolean {\n return this._dragState !== null;\n }\n\n get splitterPositions(): Percent[] {\n if (this._cachedSplitterPositions) {\n return this._cachedSplitterPositions;\n }\n\n const result: Percent[] = [];\n\n let acc = percent(0);\n\n for (let i = 0; i < this._columnWidths.length - 1; i++) {\n acc = percent(acc + this._columnWidths[i]);\n result.push(acc);\n }\n\n this._cachedSplitterPositions = result;\n\n return result;\n }\n\n getActiveSplitterCalculatedPosition() {\n const splitterPositions = this.splitterPositions;\n\n if (!this._dragState) {\n return px(0);\n }\n\n const activeSplitterPos = splitterPositions[this._dragState.splitterIndex];\n const activeSplitterPosPx = this._toPx(activeSplitterPos);\n\n return activeSplitterPosPx;\n }\n\n get columnWidths() {\n return this._columnWidths;\n }\n\n get columnMinWidths() {\n return new Map(this._columnMinWidths);\n }\n\n saveHostDimensions() {\n const cr = this._host.getBoundingClientRect();\n const {width, x} = cr;\n this._hostWidth = px(width);\n this._hostX = px(x);\n return this;\n }\n\n setActiveSplitter(splitter: HTMLElement) {\n this._activeSplitter = splitter as SplitterElement;\n return this;\n }\n\n getActiveSplitter() {\n return this._activeSplitter;\n }\n\n setColumnMinWidthAt(colIndex: number, value: Percent) {\n this._columnMinWidths.set(colIndex, value);\n this._host.requestUpdate();\n return this;\n }\n\n setColumWidths(widths: Percent[]) {\n this._columnWidths = widths;\n this._cachedSplitterPositions = null;\n this._host.requestUpdate();\n return this;\n }\n\n shouldDrag(event: PointerEvent) {\n return (\n +(event.currentTarget as SplitterElement).dataset.index ===\n this._dragState?.splitterIndex\n );\n }\n\n startDrag(event: PointerEvent) {\n event.stopPropagation();\n\n if (this._dragState) {\n return;\n }\n\n this._activeSplitter?.setPointerCapture(event.pointerId);\n\n const mouseX = event.pageX;\n const splitter = event.currentTarget as SplitterElement;\n const splitterX = splitter!.getBoundingClientRect().x;\n const xOffset = px(mouseX - splitterX);\n\n this._dragState = {\n dragOffset: px(xOffset),\n pointerId: event.pointerId,\n splitterIndex: +splitter.dataset.index,\n prevX: px(mouseX - xOffset),\n };\n\n this._host.requestUpdate();\n }\n\n drag(event: PointerEvent) {\n event.stopPropagation();\n\n if (\n !(event?.currentTarget as SplitterElement)?.hasPointerCapture?.(\n event.pointerId\n )\n ) {\n return;\n }\n\n if (!this._dragState) {\n return;\n }\n\n if (event.pointerId !== this._dragState.pointerId) {\n return;\n }\n\n if (!this.shouldDrag(event)) {\n return;\n }\n\n const mouseX = event.pageX;\n const x = px(mouseX - this._dragState.dragOffset);\n const deltaPx = px(x - this._dragState.prevX);\n const delta = this._toPercent(deltaPx);\n this._dragState.prevX = x;\n\n const splitterPos = this.getActiveSplitterCalculatedPosition();\n\n if (\n (deltaPx <= 0 && mouseX > splitterPos + this._hostX) ||\n (deltaPx > 0 && mouseX < splitterPos + this._hostX)\n ) {\n return;\n }\n\n this._columnWidths = calculateColumnWidths(\n this._columnWidths,\n this._dragState.splitterIndex,\n delta,\n this._columnMinWidths\n );\n this._cachedSplitterPositions = null;\n\n this._host.requestUpdate();\n }\n\n stopDrag(event: PointerEvent) {\n event.stopPropagation();\n\n if (!this._dragState) {\n return;\n }\n\n const el = event.currentTarget as SplitterElement;\n\n try {\n el.releasePointerCapture(this._dragState.pointerId);\n } catch (e) {\n // ignore\n }\n\n this._dragState = null;\n this._activeSplitter = null;\n this._host.requestUpdate();\n }\n\n private _toPercent(px: Px) {\n return toPercent(px, this._hostWidth);\n }\n\n private _toPx(percent: Percent) {\n return toPx(percent, this._hostWidth);\n }\n}\n"]}
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
4
|
-
export type Percent = number & {
|
|
5
|
-
readonly __unit: '%';
|
|
6
|
-
};
|
|
7
|
-
export declare const px: (value: number) => Px;
|
|
8
|
-
export declare const percent: (value: number) => Percent;
|
|
9
|
-
export declare const toPercent: (px: Px, container: Px) => Percent;
|
|
10
|
-
export declare const toPx: (p: Percent, container: Px) => Px;
|
|
11
|
-
export declare function calculateColumnWidths(widths: Percent[], splitterIndex: number, delta: Percent, minWidth: Percent): Percent[];
|
|
12
|
-
export declare const parseSizeAttributeToPercent: (raw: string | number, base: number) => number | null;
|
|
1
|
+
import { Percent } from '../includes/sizes.js';
|
|
2
|
+
export declare function calculateColumnWidths(widths: Percent[], splitterIndex: number, delta: Percent, minWidths: Map<number, Percent>): Percent[];
|
|
13
3
|
//# sourceMappingURL=calculations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calculations.d.ts","sourceRoot":"","sources":["../../src/vscode-table/calculations.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"calculations.d.ts","sourceRoot":"","sources":["../../src/vscode-table/calculations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAU,MAAM,sBAAsB,CAAC;AAEtD,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,OAAO,EAAE,EACjB,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,EAAE,CAmEX"}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export const toPercent = (px, container) => percent((px / container) * 100);
|
|
4
|
-
export const toPx = (p, container) => px((p / 100) * container);
|
|
5
|
-
export function calculateColumnWidths(widths, splitterIndex, delta, minWidth) {
|
|
1
|
+
import { percent } from '../includes/sizes.js';
|
|
2
|
+
export function calculateColumnWidths(widths, splitterIndex, delta, minWidths) {
|
|
6
3
|
const result = [...widths];
|
|
7
4
|
// No-op for invalid splitter position or zero delta
|
|
8
5
|
if (delta === 0 || splitterIndex < 0 || splitterIndex >= widths.length - 1) {
|
|
@@ -26,7 +23,7 @@ export function calculateColumnWidths(widths, splitterIndex, delta, minWidth) {
|
|
|
26
23
|
// Calculate total shrinkable space respecting minWidth
|
|
27
24
|
let totalAvailable = percent(0);
|
|
28
25
|
for (const i of shrinkingSide) {
|
|
29
|
-
const available = Math.max(0, result[i] -
|
|
26
|
+
const available = Math.max(0, result[i] - (minWidths.get(i) ?? 0));
|
|
30
27
|
totalAvailable = percent(totalAvailable + available);
|
|
31
28
|
}
|
|
32
29
|
// Abort if the requested delta cannot be fully satisfied
|
|
@@ -38,7 +35,7 @@ export function calculateColumnWidths(widths, splitterIndex, delta, minWidth) {
|
|
|
38
35
|
if (remaining === 0) {
|
|
39
36
|
break;
|
|
40
37
|
}
|
|
41
|
-
const available = Math.max(0, result[i] -
|
|
38
|
+
const available = Math.max(0, result[i] - (minWidths.get(i) ?? 0));
|
|
42
39
|
const take = Math.min(available, remaining);
|
|
43
40
|
result[i] = percent(result[i] - take);
|
|
44
41
|
remaining = percent(remaining - take);
|
|
@@ -54,29 +51,4 @@ export function calculateColumnWidths(widths, splitterIndex, delta, minWidth) {
|
|
|
54
51
|
}
|
|
55
52
|
return result;
|
|
56
53
|
}
|
|
57
|
-
const parsers = [
|
|
58
|
-
{
|
|
59
|
-
test: (v) => /^-?\d+(\.\d+)?%$/.test(v),
|
|
60
|
-
parse: (v) => Number(v.slice(0, -1)),
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
test: (v) => /^-?\d+(\.\d+)?px$/.test(v),
|
|
64
|
-
parse: (v, base) => (Number(v.slice(0, -2)) / base) * 100,
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
test: (v) => /^-?\d+(\.\d+)?$/.test(v),
|
|
68
|
-
parse: (v, base) => (Number(v) / base) * 100,
|
|
69
|
-
},
|
|
70
|
-
];
|
|
71
|
-
export const parseSizeAttributeToPercent = (raw, base) => {
|
|
72
|
-
if (!Number.isFinite(base) || base === 0) {
|
|
73
|
-
return null;
|
|
74
|
-
}
|
|
75
|
-
if (typeof raw === 'number') {
|
|
76
|
-
return Number.isFinite(raw) ? (raw / base) * 100 : null;
|
|
77
|
-
}
|
|
78
|
-
const value = raw.trim();
|
|
79
|
-
const parser = parsers.find((p) => p.test(value));
|
|
80
|
-
return parser ? parser.parse(value, base) : null;
|
|
81
|
-
};
|
|
82
54
|
//# sourceMappingURL=calculations.js.map
|