Custom Gis Application with Arcgis Javascript API with modern layouting
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

11 lines
3.8 KiB

// All material copyright Esri, All Rights Reserved, unless otherwise specified.
// See https://js.arcgis.com/4.30/esri/copyright.txt for details.
//>>built
define("require exports ../../../chunks/tslib.es6 ../../../intl ../../../core/maybe ../../../core/reactiveUtils ../../../core/accessorSupport/decorators/property ../../../core/has ../../../core/Logger ../../../core/RandomLCG ../../../core/accessorSupport/decorators/subclass ../../Widget ../css ./Statistics ../support/intlUtils ../../../chunks/componentsUtils ../../support/widgetUtils ../../support/jsxFactory ../../../intl/substitute".split(" "),function(l,c,e,y,p,q,g,z,A,B,r,t,f,u,m,v,C,d,w){c.LegendItem=
class extends t{constructor(a,b){super(a,b);this.checkboxVisible=!0;this.expanded=!1}loadDependencies(){return v.loadCalciteComponents({action:()=>new Promise((a,b)=>l(["../../../chunks/calcite-action"],a,b)),checkbox:()=>new Promise((a,b)=>l(["../../../chunks/calcite-checkbox"],a,b)),label:()=>new Promise((a,b)=>l(["../../../chunks/calcite-label"],a,b)),tooltip:()=>new Promise((a,b)=>l(["../../../chunks/calcite-tooltip"],a,b))})}initialize(){this._statistics=new u.Statistics(this._statisticsProps);
this.addHandles(q.watch(()=>this._statisticsProps,a=>this._statistics.set(a)))}destroy(){this._statistics=p.destroyMaybe(this._statistics)}render(){const a=this.expanded;return d.tsx("div",{class:this.classes(f.legendItemCss.base,{[f.legendItemCss.disabled]:this.disabled,[f.legendItemCss.expanded]:a}),key:this},this._renderColorIndicator(),d.tsx("div",{class:f.legendItemCss.header,key:"header"},this._renderLabelWithCheckbox(),this._renderCollapseToggleButton()),a?d.tsx("div",{class:f.legendItemCss.content,
key:"content"},this._statistics.render()):null)}get disabled(){return!this.line.available}get _statisticsProps(){return{line:this.line,effectiveUnits:this.effectiveUnits}}_renderColorIndicator(){return d.tsx("div",{class:f.legendItemCss.colorIndicator,key:"color-indicator",styles:{backgroundColor:this.line.color.toCss()}})}_renderCollapseToggleButton(){const {expanded:a,messages:b}=this,h=a?b.hideDetails:b.showDetails;return d.tsx("calcite-action",{appearance:"transparent",bind:this,class:f.legendItemCss.collapseToggle,
"data-testid":"legend-toggle",icon:a?"chevron-up":"chevron-down",key:"collapse-toggle",onclick:this._onCollapseToggleClick,scale:"s",text:h,title:h})}_onCollapseToggleClick(){this.onExpandedToggle()}_renderLabelWithCheckbox(){const {line:a,checkboxVisible:b,disabled:h,messages:k}=this;return d.tsx("calcite-label",{class:f.legendItemCss.label,disabled:h,key:`label-${a.id}`,layout:"inline"},b?this._renderCheckbox(a.id):null,m.getTranslatedLineTitle(a,k))}_renderCheckbox(a){const {disabled:b,line:h,
messages:k}=this,n=h.visible;a=`${a}-checkbox`;const x=w.substitute(n?k.hideProfile:k.showProfile,{name:m.getTranslatedLineTitle(h,k)});return d.tsx(d.tsxFragment,null,d.tsx("calcite-checkbox",{checked:n,class:f.legendItemCss.checkbox,disabled:b,id:a,key:"checkbox",onCalciteCheckboxChange:()=>h.toggleVisibility()}),d.tsx("calcite-tooltip",{overlayPositioning:"fixed",placement:"top",referenceElement:a},x))}};e.__decorate([g.property()],c.LegendItem.prototype,"checkboxVisible",void 0);e.__decorate([g.property()],
c.LegendItem.prototype,"disabled",null);e.__decorate([g.property({nonNullable:!0})],c.LegendItem.prototype,"effectiveUnits",void 0);e.__decorate([g.property()],c.LegendItem.prototype,"expanded",void 0);e.__decorate([g.property({nonNullable:!0})],c.LegendItem.prototype,"line",void 0);e.__decorate([g.property()],c.LegendItem.prototype,"messages",void 0);e.__decorate([g.property()],c.LegendItem.prototype,"onExpandedToggle",void 0);e.__decorate([g.property()],c.LegendItem.prototype,"_statistics",void 0);
c.LegendItem=e.__decorate([r.subclass("esri.widgets.ElevationProfile.components.LegendItem")],c.LegendItem);Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});