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.
 
 

20 lines
8.5 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("exports ../../../chunks/Theme ../../../chunks/ResponsiveTheme ../../../chunks/Button2 ../../../chunks/Tooltip ../../../chunks/ColorSet".split(" "),function(k,g,q,p,r,t){class m extends g.Container{constructor(){super(...arguments);Object.defineProperty(this,"thumb",{enumerable:!0,configurable:!0,writable:!0,value:this._makeThumb()});Object.defineProperty(this,"startGrip",{enumerable:!0,configurable:!0,writable:!0,value:this._makeButton()});Object.defineProperty(this,"endGrip",{enumerable:!0,
configurable:!0,writable:!0,value:this._makeButton()});Object.defineProperty(this,"_thumbBusy",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_startDown",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_endDown",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_thumbDown",{enumerable:!0,configurable:!0,writable:!0,value:!1});Object.defineProperty(this,"_gripDown",{enumerable:!0,configurable:!0,writable:!0,
value:void 0})}_addOrientationClass(){this._settings.themeTags=g.mergeTags(this._settings.themeTags,["scrollbar",this._settings.orientation]);this._settings.background||(this._settings.background=p.RoundedRectangle.new(this._root,{themeTags:g.mergeTags(this._settings.themeTags,["main","background"])}))}_makeButton(){return this.children.push(p.Button.new(this._root,{themeTags:["resize","button",this.get("orientation")],icon:g.Graphics.new(this._root,{themeTags:["icon"]})}))}_makeThumb(){return this.children.push(p.RoundedRectangle.new(this._root,
{themeTags:["thumb",this.get("orientation")]}))}_handleAnimation(b){b&&this._disposers.push(b.events.on("stopped",()=>{this.setPrivateRaw("isBusy",!1);this._thumbBusy=!1}))}_afterNew(){this._addOrientationClass();super._afterNew();const b=this.startGrip,c=this.endGrip,d=this.thumb,f=this.get("background");f&&this._disposers.push(f.events.on("click",a=>{this.setPrivateRaw("isBusy",!0);var e=this._display.toLocal(a.point);a=this.width();var h=this.height(),l=this.get("orientation");e="vertical"==l?
(e.y-d.height()/2)/h:(e.x-d.width()/2)/a;"vertical"==l?(a=e*h,h="y"):(a*=e,h="x");l=this.get("animationDuration",0);0<l?(this._thumbBusy=!0,this._handleAnimation(this.thumb.animate({key:h,to:a,duration:l,easing:this.get("animationEasing")}))):(this.thumb.set(h,a),this._root.events.once("frameended",()=>{this.setPrivateRaw("isBusy",!1)}))}));this._disposers.push(d.events.on("dblclick",a=>{if(g.isLocalEvent(a.originalEvent,this)){a=this.get("animationDuration",0);var e=this.get("animationEasing");this.animate({key:"start",
to:0,duration:a,easing:e});this.animate({key:"end",to:1,duration:a,easing:e})}}));this._disposers.push(b.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0);this._startDown=!0;this._gripDown="start"}));this._disposers.push(c.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0);this._endDown=!0;this._gripDown="end"}));this._disposers.push(d.events.on("pointerdown",()=>{this.setPrivateRaw("isBusy",!0);this._thumbDown=!0;this._gripDown=void 0}));this._disposers.push(b.events.on("globalpointerup",
()=>{this._startDown&&(this.setPrivateRaw("isBusy",!1),this._released());this._startDown=!1}));this._disposers.push(c.events.on("globalpointerup",()=>{this._endDown&&(this.setPrivateRaw("isBusy",!1),this._released());this._endDown=!1}));this._disposers.push(d.events.on("globalpointerup",()=>{this._thumbDown&&(this.setPrivateRaw("isBusy",!1),this._released());this._thumbDown=!1}));this._disposers.push(b.on("x",()=>{this._updateThumb()}));this._disposers.push(c.on("x",()=>{this._updateThumb()}));this._disposers.push(b.on("y",
()=>{this._updateThumb()}));this._disposers.push(c.on("y",()=>{this._updateThumb()}));this._disposers.push(d.events.on("positionchanged",()=>{this._updateGripsByThumb()}));"vertical"==this.get("orientation")?(b.set("x",0),c.set("x",0),this._disposers.push(d.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()-d.height()),0))),this._disposers.push(d.adapters.add("x",a=>this.width()/2)),this._disposers.push(b.adapters.add("x",a=>this.width()/2)),this._disposers.push(c.adapters.add("x",a=>this.width()/
2)),this._disposers.push(b.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0))),this._disposers.push(c.adapters.add("y",a=>Math.max(Math.min(Number(a),this.height()),0)))):(b.set("y",0),c.set("y",0),this._disposers.push(d.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()-d.width()),0))),this._disposers.push(d.adapters.add("y",a=>this.height()/2)),this._disposers.push(b.adapters.add("y",a=>this.height()/2)),this._disposers.push(c.adapters.add("y",a=>this.height()/2)),this._disposers.push(b.adapters.add("x",
a=>Math.max(Math.min(Number(a),this.width()),0))),this._disposers.push(c.adapters.add("x",a=>Math.max(Math.min(Number(a),this.width()),0))))}_updateChildren(){super._updateChildren();(this.isDirty("end")||this.isDirty("start")||this._sizeDirty)&&this.updateGrips()}_changed(){super._changed();(this.isDirty("start")||this.isDirty("end"))&&this.events.isEnabled("rangechanged")&&this.events.dispatch("rangechanged",{type:"rangechanged",target:this,start:this.get("start",0),end:this.get("end",1),grip:this._gripDown})}_released(){this.events.isEnabled("released")&&
this.events.dispatch("released",{type:"released",target:this})}updateGrips(){const b=this.startGrip,c=this.endGrip;var d=this.get("orientation"),f=this.height(),a=this.width();"vertical"==d?(b.set("y",f*this.get("start",0)),c.set("y",f*this.get("end",1))):(b.set("x",a*this.get("start",0)),c.set("x",a*this.get("end",1)));var e=this.getPrivate("positionTextFunction");d=Math.round(100*this.get("start",0));f=Math.round(100*this.get("end",0));e?(a=e.call(this,this.get("start",0)),e=e.call(this,this.get("end",
0))):(a=d+"%",e=f+"%");b.set("ariaLabel",this._t("From %1",void 0,a));b.set("ariaValueNow",""+d);b.set("ariaValueText",d+"%");b.set("ariaValueMin","0");b.set("ariaValueMax","100");c.set("ariaLabel",this._t("To %1",void 0,e));c.set("ariaValueNow",""+f);c.set("ariaValueText",f+"%");c.set("ariaValueMin","0");c.set("ariaValueMax","100")}_updateThumb(){const b=this.thumb;var c=this.startGrip,d=this.endGrip,f=this.height(),a=this.width(),e=c.x(),h=d.x();c=c.y();d=d.y();let l=0,n=1;"vertical"==this.get("orientation")?
g.isNumber(c)&&g.isNumber(d)&&(this._thumbBusy||b.isDragging()||(b.set("height",d-c),b.set("y",c)),l=c/f,n=d/f):g.isNumber(e)&&g.isNumber(h)&&(this._thumbBusy||b.isDragging()||(b.set("width",h-e),b.set("x",e)),l=e/a,n=h/a);!this.getPrivate("isBusy")||this.get("start")==l&&this.get("end")==n||(this.set("start",l),this.set("end",n));e=this.getPrivate("positionTextFunction");f=Math.round(100*this.get("start",0));h=Math.round(100*this.get("end",0));e?(a=e.call(this,this.get("start",0)),e=e.call(this,
this.get("end",0))):(a=f+"%",e=h+"%");b.set("ariaLabel",this._t("From %1 to %2",void 0,a,e));b.set("ariaValueNow",""+f);b.set("ariaValueText",f+"%")}_updateGripsByThumb(){const b=this.thumb,c=this.startGrip,d=this.endGrip;if("vertical"==this.get("orientation")){var f=b.height();c.set("y",b.y());d.set("y",b.y()+f)}else f=b.width(),c.set("x",b.x()),d.set("x",b.x()+f)}}Object.defineProperty(m,"className",{enumerable:!0,configurable:!0,writable:!0,value:"Scrollbar"});Object.defineProperty(m,"classNames",
{enumerable:!0,configurable:!0,writable:!0,value:g.Container.classNames.concat([m.className])});class u extends g.Theme{setupDefaultRules(){super.setupDefaultRules();this.rule("Component").setAll({interpolationDuration:600});this.rule("Hierarchy").set("animationDuration",600);this.rule("Scrollbar").set("animationDuration",600);this.rule("Tooltip").set("animationDuration",300);this.rule("MapChart").set("animationDuration",1E3);this.rule("MapChart").set("wheelDuration",300);this.rule("Entity").setAll({stateAnimationDuration:600});
this.rule("Sprite").states.create("default",{stateAnimationDuration:600});this.rule("Tooltip",["axis"]).setAll({animationDuration:200});this.rule("WordCloud").set("animationDuration",500);this.rule("Polygon").set("animationDuration",600);this.rule("ArcDiagram").set("animationDuration",600)}}const v="#2888B8 #EB7028 #48A375 #9370B1 #e55035 #3d9ccc #DC7B04 #b87bb0 #3fa681 #EE6386".split(" ").map(b=>g.color(b));k.ThemeAm5=g.Theme;k.colorAm5=g.color;k.DarkThemeAm5=q.DarkTheme;k.ResponsiveThemeAm5=q.ResponsiveTheme;
k.TooltipAm5=r.Tooltip;k.ColorSetAm5=t.ColorSet;k.AnimatedThemeAm5=u;k.ScrollbarAm5=m;k.esriChartColorSet=v;Object.defineProperty(k,Symbol.toStringTag,{value:"Module"})});