@gravitee/ui-components 3.25.3-typescript-50960c3 → 3.25.3-typescript-fdacf14

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravitee/ui-components",
3
- "version": "3.25.3-typescript-50960c3",
3
+ "version": "3.25.3-typescript-fdacf14",
4
4
  "description": "Gravitee.io UI Components library, based on Web Components",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +1 @@
1
- var e=function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvIdentityPicture=void 0;const t=require("lit"),i=e(require("jdenticon")),r=require("../styles/skeleton"),o=require("lit/directives/style-map");require("../atoms/gv-image");class n extends t.LitElement{static get properties(){return{picture:{type:String},display_name:{type:String},_error:{type:Boolean,attribute:!1},notification:{type:Boolean},rounded:{type:Boolean,reflect:!0},skeleton:{type:Boolean}}}static get styles(){return[r.skeleton,t.css`:host{display:block;position:relative}div{text-align:center}.skeleton,svg{width:auto;height:auto;max-width:100%;max-height:100%}gv-image{width:100%;height:100%;--gv-image--of:contain}:host([rounded]) gv-image,:host([rounded]) svg{border:2px solid var(--gv-theme-neutral-color-lighter,#fafafa);border-radius:50%;box-sizing:border-box;--gv-image--of:cover}.notification{position:absolute;width:8px;height:8px;background-clip:padding-box;border-radius:50%;background-color:var(--gv-identity-picture-notification--bgc,var(--gv-theme-color-light,#86c3d0))}`]}_onError(){this._error=!0}_toNumber(e){return parseInt(e.replace("px",""),10)}_onLoaded(){this._error=!1}_getMaxSize(e,t){return Math.min(this._toNumber(e),this._toNumber(t))}updated(e){e.has("picture")&&(this._error=!1)}render(){const{width:e,height:r}=window.getComputedStyle(this);if((!this.picture||this._error)&&e&&r){const o=this._getMaxSize(e,r),n=document.createElement("div");if(this.skeleton&&n.classList.add("skeleton"),n.title=this.display_name,n.innerHTML=i.default.toSvg(this.display_name,o,{backColor:"#FFF"}),this.notification){const t=document.createElement("span");t.className="notification",t.style.left=e,n.appendChild(t)}return t.html`${n}`}return t.html`<gv-image src="${this.picture}" alt="${this.display_name}" title="${this.display_name}" @error="${this._onError}" @gv-image:loaded="${this._onLoaded}"></gv-image>${this.notification?t.html`<span class="notification" style="${(0,o.styleMap)({left:e})}"></span>`:""}`}}exports.GvIdentityPicture=n,window.customElements.define("gv-identity-picture",n);
1
+ Object.defineProperty(exports,"__esModule",{value:!0}),exports.GvIdentityPicture=void 0;const e=require("lit"),t=require("jdenticon"),i=require("../styles/skeleton"),r=require("lit/directives/style-map");require("../atoms/gv-image");class o extends e.LitElement{static get properties(){return{picture:{type:String},display_name:{type:String},_error:{type:Boolean,attribute:!1},notification:{type:Boolean},rounded:{type:Boolean,reflect:!0},skeleton:{type:Boolean}}}static get styles(){return[i.skeleton,e.css`:host{display:block;position:relative}div{text-align:center}.skeleton,svg{width:auto;height:auto;max-width:100%;max-height:100%}gv-image{width:100%;height:100%;--gv-image--of:contain}:host([rounded]) gv-image,:host([rounded]) svg{border:2px solid var(--gv-theme-neutral-color-lighter,#fafafa);border-radius:50%;box-sizing:border-box;--gv-image--of:cover}.notification{position:absolute;width:8px;height:8px;background-clip:padding-box;border-radius:50%;background-color:var(--gv-identity-picture-notification--bgc,var(--gv-theme-color-light,#86c3d0))}`]}_onError(){this._error=!0}_toNumber(e){return parseInt(e.replace("px",""),10)}_onLoaded(){this._error=!1}_getMaxSize(e,t){return Math.min(this._toNumber(e),this._toNumber(t))}updated(e){e.has("picture")&&(this._error=!1)}render(){const{width:i,height:o}=window.getComputedStyle(this);if((!this.picture||this._error)&&i&&o){const r=this._getMaxSize(i,o),n=document.createElement("div");if(this.skeleton&&n.classList.add("skeleton"),n.title=this.display_name,n.innerHTML=(0,t.toSvg)(this.display_name,r,{backColor:"#FFF"}),this.notification){const e=document.createElement("span");e.className="notification",e.style.left=i,n.appendChild(e)}return e.html`${n}`}return e.html`<gv-image src="${this.picture}" alt="${this.display_name}" title="${this.display_name}" @error="${this._onError}" @gv-image:loaded="${this._onLoaded}"></gv-image>${this.notification?e.html`<span class="notification" style="${(0,r.styleMap)({left:i})}"></span>`:""}`}}exports.GvIdentityPicture=o,window.customElements.define("gv-identity-picture",o);