@clevercloud/components
Advanced tools
Comparing version 13.2.0 to 13.3.0
@@ -1,2 +0,2 @@ | ||
import"./cc-input-text.js";import"./cc-loader.js";import"./cc-block-section.js";import"./cc-block.js";import"./cc-notice.js";import{LitElement as t,html as i,css as e}from"lit";import{dispatchCustomEvent as n}from"./lib/events.js";import{i18n as s}from"./i18n.js";class o extends t{static get properties(){return{addon:{type:Object},error:{type:Boolean},saving:{type:Boolean},_name:{type:String,state:!0},_skeleton:{type:Boolean,state:!0},_tags:{type:Array,state:!0}}}constructor(){super(),this.addon=null,this.error=!1,this.saving=!1,this._name="",this._skeleton=!1,this._tags=[]}_onNameInput({detail:t}){this._name=t}_onNameSubmit(){n(this,"update-name",{name:this._name})}_onTagsInput({detail:t}){this._tags=t}_onTagsSubmit(){n(this,"update-tags",{tags:this._tags})}_onDeleteSubmit(){n(this,"delete-addon")}_onDismissError(){this.error=!1}willUpdate(t){t.has("addon")&&(this._skeleton=null==this.addon,this._name=this._skeleton?"":this.addon.name,this._tags=this._skeleton?[]:this.addon.tags)}render(){const t=this.error||this.saving,e=this.error&&!this.saving||this.error&&null==this.addon;return i`<cc-block><div slot=title>${s("cc-addon-admin.admin")}</div>${e?"":i`<cc-block-section><div slot=title>${s("cc-addon-admin.heading.name")}</div><div slot=info></div><div class=one-line-form><cc-input-text label=${s("cc-addon-admin.input.name")} ?skeleton=${this._skeleton} ?disabled=${t} .value=${this._name} @cc-input-text:input=${this._onNameInput} @cc-input-text:requestimplicitsubmit=${this._onNameSubmit}></cc-input-text><cc-button primary ?skeleton=${this._skeleton} ?disabled=${t} @cc-button:click=${this._onNameSubmit}>${s("cc-addon-admin.update")}</cc-button></div></cc-block-section><cc-block-section><div slot=title>${s("cc-addon-admin.heading.tags")}</div><div slot=info>${s("cc-addon-admin.tags-description")}</div><div class=one-line-form><cc-input-text label=${s("cc-addon-admin.input.tags")} ?skeleton=${this._skeleton} ?disabled=${t} .tags=${this._tags} placeholder=${s("cc-addon-admin.tags-empty")} @cc-input-text:tags=${this._onTagsInput} @cc-input-text:requestimplicitsubmit=${this._onTagsSubmit}></cc-input-text><cc-button primary ?skeleton=${this._skeleton} ?disabled=${t} @cc-button:click=${this._onTagsSubmit}>${s("cc-addon-admin.tags-update")}</cc-button></div></cc-block-section><cc-block-section><div slot=title class=danger>${s("cc-addon-admin.danger-zone")}</div><div slot=info>${s("cc-addon-admin.delete-description")}</div><div><cc-button danger ?skeleton=${this._skeleton} ?disabled=${t} @cc-button:click=${this._onDeleteSubmit}>${s("cc-addon-admin.delete")}</cc-button></div></cc-block-section>`} ${e?i`<cc-notice intent=warning message=${s("cc-addon-admin.error-loading")}></cc-notice>`:""}</cc-block>`}static get styles(){return[e`:host{display:block}.one-line-form{display:flex}.one-line-form cc-input-text{flex:1 1 10em;margin-right:.5em}.one-line-form cc-button{margin-top:var(--cc-margin-top-btn-horizontal-form)}`]}}window.customElements.define("cc-addon-admin",o);export{o as CcAddonAdmin}; | ||
import"./cc-input-text.js";import"./cc-loader.js";import"./cc-block-section.js";import"./cc-block.js";import"./cc-notice.js";import{LitElement as t,html as e,css as n}from"lit";import{dispatchCustomEvent as i}from"./lib/events.js";import{i18n as o}from"./i18n.js";class s extends t{static get properties(){return{addon:{type:Object},error:{type:Boolean},noDangerZoneBackupText:{type:Boolean,attribute:"no-danger-zone-backup-text"},noDangerZoneVmText:{type:Boolean,attribute:"no-danger-zone-vm-text"},saving:{type:Boolean},_name:{type:String,state:!0},_skeleton:{type:Boolean,state:!0},_tags:{type:Array,state:!0}}}constructor(){super(),this.addon=null,this.error=!1,this.noDangerZoneBackupText=!1,this.noDangerZoneVmText=!1,this.saving=!1,this._name="",this._skeleton=!1,this._tags=[]}_onNameInput({detail:t}){this._name=t}_onNameSubmit(){i(this,"update-name",{name:this._name})}_onTagsInput({detail:t}){this._tags=t}_onTagsSubmit(){i(this,"update-tags",{tags:this._tags})}_onDeleteSubmit(){i(this,"delete-addon")}_onDismissError(){this.error=!1}willUpdate(t){t.has("addon")&&(this._skeleton=null==this.addon,this._name=this._skeleton?"":this.addon.name,this._tags=this._skeleton?[]:this.addon.tags)}render(){const t=this.error||this.saving,n=this.error&&!this.saving||this.error&&null==this.addon,i=!this.noDangerZoneBackupText,s=!this.noDangerZoneVmText;return e`<cc-block><div slot=title>${o("cc-addon-admin.admin")}</div>${n?"":e`<cc-block-section><div slot=title>${o("cc-addon-admin.heading.name")}</div><div slot=info></div><div class=one-line-form><cc-input-text label=${o("cc-addon-admin.input.name")} ?skeleton=${this._skeleton} ?disabled=${t} .value=${this._name} @cc-input-text:input=${this._onNameInput} @cc-input-text:requestimplicitsubmit=${this._onNameSubmit}></cc-input-text><cc-button primary ?skeleton=${this._skeleton} ?disabled=${t} @cc-button:click=${this._onNameSubmit}>${o("cc-addon-admin.update")}</cc-button></div></cc-block-section><cc-block-section><div slot=title>${o("cc-addon-admin.heading.tags")}</div><div slot=info>${o("cc-addon-admin.tags-description")}</div><div class=one-line-form><cc-input-text label=${o("cc-addon-admin.input.tags")} ?skeleton=${this._skeleton} ?disabled=${t} .tags=${this._tags} placeholder=${o("cc-addon-admin.tags-empty")} @cc-input-text:tags=${this._onTagsInput} @cc-input-text:requestimplicitsubmit=${this._onTagsSubmit}></cc-input-text><cc-button primary ?skeleton=${this._skeleton} ?disabled=${t} @cc-button:click=${this._onTagsSubmit}>${o("cc-addon-admin.tags-update")}</cc-button></div></cc-block-section><cc-block-section><div slot=title class=danger>${o("cc-addon-admin.danger-zone")}</div><div slot=info class=danger-desc><p>${o("cc-addon-admin.delete-disclaimer")}</p>${s?e`<p>${o("cc-addon-admin.delete-vm")}</p>`:""} ${i?e`<p>${o("cc-addon-admin.delete-backups")}</p>`:""}</div><div><cc-button danger ?skeleton=${this._skeleton} ?disabled=${t} @cc-button:click=${this._onDeleteSubmit}>${o("cc-addon-admin.delete")}</cc-button></div></cc-block-section>`} ${n?e`<cc-notice intent=warning message=${o("cc-addon-admin.error-loading")}></cc-notice>`:""}</cc-block>`}static get styles(){return[n`:host{display:block}.one-line-form{display:flex}.one-line-form cc-input-text{flex:1 1 10em;margin-right:.5em}.one-line-form cc-button{margin-top:var(--cc-margin-top-btn-horizontal-form)}.danger-desc p{margin:0}`]}}window.customElements.define("cc-addon-admin",s);export{s as CcAddonAdmin}; | ||
//# sourceMappingURL=cc-addon-admin.js.map |
@@ -1,2 +0,2 @@ | ||
import"./cc-toggle.js";import"./cc-map-marker-dot.js";import"./cc-map.js";import{LitElement as t,html as e,css as o}from"lit";import{dispatchCustomEvent as i}from"./lib/events.js";import{i18n as a}from"./i18n.js";class s extends t{static get properties(){return{appName:{type:String,attribute:"app-name"},centerLat:{type:Number,attribute:"center-lat"},centerLon:{type:Number,attribute:"center-lon"},error:{type:Boolean,reflect:!0},heatmapPoints:{type:Array,attribute:"heatmap-points"},loading:{type:Boolean,reflect:!0},mode:{type:String},orgaName:{type:String,attribute:"orga-name"},viewZoom:{type:Number,attribute:"view-zoom"},_points:{type:Array,state:!0}}}constructor(){super(),this.appName=null,this.centerLat=48.9,this.centerLon=2.4,this.error=!1,this.heatmapPoints=null,this.loading=!1,this.mode="points",this.orgaName=null,this.viewZoom=2,this._points=[],this._pointsByCoords={}}addPoints(t,e={}){const{spreadDuration:o=!1}=e,i=!1!==o?Math.floor(o/t.length):0;t.forEach(((t,e)=>{setTimeout((()=>this._addPoint(t)),i*e)}))}_addPoint({lat:t,lon:e,count:o=1,delay:i=1e3,tooltip:a}){const s=[t,e].join(","),r={lat:t,lon:e,count:o,tooltip:a};null==this._pointsByCoords[s]&&(this._pointsByCoords[s]=[]),this._pointsByCoords[s].push(r),this._updatePoints(),setTimeout((()=>{this._pointsByCoords[s]=this._pointsByCoords[s].filter((t=>t!==r)),0===this._pointsByCoords[s].length&&delete this._pointsByCoords[s],this._updatePoints()}),i)}_updatePoints(){this._points=Object.entries(this._pointsByCoords).map((([t,e])=>{const{lat:o,lon:i}=e[0],a=e.map((t=>t.count)).reduce(((t,e)=>t+e),0),s=e.filter((t=>null!=t.tooltip&&""!==t.tooltip)).map((t=>t.tooltip)),r=Array.from(new Set(s));r.length>=3&&(r.length=3,r[2]=r[2]+"...");return{lat:o,lon:i,marker:{tag:"cc-map-marker-dot",count:a},tooltip:r.length>0?r.join("<br>"):null}}))}_getModes(){return[{label:a("cc-logsmap.mode.points"),value:"points"},{label:a("cc-logsmap.mode.heatmap"),value:"heatmap"}]}_getLegend(){return"points"===this.mode?null==this.appName?a("cc-logsmap.legend.points",{orgaName:this.orgaName}):a("cc-logsmap.legend.points.app",{appName:this.appName}):null==this.appName?a("cc-logsmap.legend.heatmap",{orgaName:this.orgaName}):a("cc-logsmap.legend.heatmap.app",{appName:this.appName})}render(){return e`<cc-toggle .choices=${this._getModes()} value=${this.mode} @cc-toggle:input=${this._onModeChange}></cc-toggle><cc-map center-lat=${this.centerLat} center-lon=${this.centerLon} view-zoom=${this.viewZoom} mode=${this.mode} ?loading=${this.loading} ?error=${this.error} .heatmapPoints=${this.heatmapPoints} .points=${this._points}>${this._getLegend()}</cc-map>`}_onModeChange({detail:t}){this.mode=t,i(this,"mode",this.mode)}static get styles(){return o`:host{position:relative;display:block;overflow:hidden;width:20em;height:15em;border:1px solid var(--cc-color-border-neutral,#aaa);background-color:var(--cc-color-bg-default,#fff);border-radius:var(--cc-border-radius-default,.25em)}cc-toggle{position:absolute;z-index:2;top:.5em;left:.5em}cc-map{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%}cc-map[view-zoom='1']{--cc-map-marker-dot-size:6px}cc-map[view-zoom='2']{--cc-map-marker-dot-size:8px}cc-map[view-zoom='3']{--cc-map-marker-dot-size:10px}cc-map[view-zoom='4']{--cc-map-marker-dot-size:12px}cc-map[view-zoom='5']{--cc-map-marker-dot-size:14px}cc-map[view-zoom='6']{--cc-map-marker-dot-size:16px}`}}window.customElements.define("cc-logsmap",s);export{s as CcLogsMap}; | ||
import"./cc-toggle.js";import"./cc-map-marker-dot.js";import"./cc-map.js";import{LitElement as t,html as e,css as o}from"lit";import{dispatchCustomEvent as a}from"./lib/events.js";import{i18n as i}from"./i18n.js";class s extends t{static get properties(){return{appName:{type:String,attribute:"app-name"},availableModes:{type:Array,attribute:"available-modes"},centerLat:{type:Number,attribute:"center-lat"},centerLon:{type:Number,attribute:"center-lon"},error:{type:Boolean,reflect:!0},heatmapPoints:{type:Array,attribute:"heatmap-points"},loading:{type:Boolean,reflect:!0},mode:{type:String},orgaName:{type:String,attribute:"orga-name"},viewZoom:{type:Number,attribute:"view-zoom"},_points:{type:Array,state:!0}}}constructor(){super(),this.appName=null,this.availableModes=["points","heatmap"],this.centerLat=48.9,this.centerLon=2.4,this.error=!1,this.heatmapPoints=null,this.loading=!1,this.mode="points",this.orgaName=null,this.viewZoom=2,this._points=[],this._pointsByCoords={}}addPoints(t,e={}){const{spreadDuration:o=!1}=e,a=!1!==o?Math.floor(o/t.length):0;t.forEach(((t,e)=>{setTimeout((()=>this._addPoint(t)),a*e)}))}_addPoint({lat:t,lon:e,count:o=1,delay:a=1e3,tooltip:i}){const s=[t,e].join(","),r={lat:t,lon:e,count:o,tooltip:i};null==this._pointsByCoords[s]&&(this._pointsByCoords[s]=[]),this._pointsByCoords[s].push(r),this._updatePoints(),setTimeout((()=>{this._pointsByCoords[s]=this._pointsByCoords[s].filter((t=>t!==r)),0===this._pointsByCoords[s].length&&delete this._pointsByCoords[s],this._updatePoints()}),a)}_updatePoints(){this._points=Object.entries(this._pointsByCoords).map((([t,e])=>{const{lat:o,lon:a}=e[0],i=e.map((t=>t.count)).reduce(((t,e)=>t+e),0),s=e.filter((t=>null!=t.tooltip&&""!==t.tooltip)).map((t=>t.tooltip)),r=Array.from(new Set(s));r.length>=3&&(r.length=3,r[2]=r[2]+"...");return{lat:o,lon:a,marker:{tag:"cc-map-marker-dot",count:i},tooltip:r.length>0?r.join("<br>"):null}}))}_getModes(){const t=[{label:i("cc-logsmap.mode.points"),value:"points"},{label:i("cc-logsmap.mode.heatmap"),value:"heatmap"}];return this.availableModes.map((e=>t.find((({value:t})=>t===e)))).filter((t=>null!=t))}_getLegend(){return"points"===this.mode?null==this.appName?i("cc-logsmap.legend.points",{orgaName:this.orgaName}):i("cc-logsmap.legend.points.app",{appName:this.appName}):null==this.appName?i("cc-logsmap.legend.heatmap",{orgaName:this.orgaName}):i("cc-logsmap.legend.heatmap.app",{appName:this.appName})}render(){const t=this._getModes();return e`${t.length>1?e`<cc-toggle .choices=${t} value=${this.mode} @cc-toggle:input=${this._onModeChange}></cc-toggle>`:""}<cc-map center-lat=${this.centerLat} center-lon=${this.centerLon} view-zoom=${this.viewZoom} mode=${this.mode} ?loading=${this.loading} ?error=${this.error} .heatmapPoints=${this.heatmapPoints} .points=${this._points}>${this._getLegend()}</cc-map>`}_onModeChange({detail:t}){this.mode=t,a(this,"mode",this.mode)}static get styles(){return o`:host{position:relative;display:block;overflow:hidden;width:20em;height:15em;border:1px solid var(--cc-color-border-neutral,#aaa);background-color:var(--cc-color-bg-default,#fff);border-radius:var(--cc-border-radius-default,.25em)}cc-toggle{position:absolute;z-index:2;top:.5em;left:.5em}cc-map{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%}cc-map[view-zoom='1']{--cc-map-marker-dot-size:6px}cc-map[view-zoom='2']{--cc-map-marker-dot-size:8px}cc-map[view-zoom='3']{--cc-map-marker-dot-size:10px}cc-map[view-zoom='4']{--cc-map-marker-dot-size:12px}cc-map[view-zoom='5']{--cc-map-marker-dot-size:14px}cc-map[view-zoom='6']{--cc-map-marker-dot-size:16px}`}}window.customElements.define("cc-logsmap",s);export{s as CcLogsMap}; | ||
//# sourceMappingURL=cc-logsmap.js.map |
{ | ||
"name": "@clevercloud/components", | ||
"version": "13.2.0", | ||
"version": "13.3.0", | ||
"description": "Collection of Web Components by Clever Cloud", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
5901701
19785