12345 |
- /*
- All material copyright ESRI, All Rights Reserved, unless otherwise specified.
- See https://js.arcgis.com/4.25/esri/copyright.txt for details.
- */
- import{_ as o}from"../chunks/tslib.es6.js";import{destroyMaybe as t}from"../core/maybe.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import"../core/arrayUtils.js";import"../core/accessorSupport/ensureType.js";import{subclass as e}from"../core/accessorSupport/decorators/subclass.js";import i from"./Widget.js";import"./support/widgetUtils.js";import{messageBundle as r}from"./support/decorators/messageBundle.js";import{tsx as n}from"./support/jsxFactory.js";import m from"./Zoom/IconButton.js";import l from"./Zoom/ZoomViewModel.js";const u={base:"esri-zoom esri-widget",horizontalLayout:"esri-zoom--horizontal",zoomInIcon:"esri-icon-plus",zoomOutIcon:"esri-icon-minus",widgetIcon:"esri-icon-zoom-in-magnifying-glass"};let a=class extends i{constructor(o,t){super(o,t),this.iconClass=u.widgetIcon,this.messages=null,this.viewModel=new l}initialize(){this._zoomInButton=new m({action:this.zoomIn.bind(this),iconClass:u.zoomInIcon}),this._zoomOutButton=new m({action:this.zoomOut.bind(this),iconClass:u.zoomOutIcon})}destroy(){this._zoomInButton=t(this._zoomInButton),this._zoomOutButton=t(this._zoomOutButton)}get label(){return this.messages?.widgetLabel??""}set label(o){this._overrideIfSome("label",o)}set layout(o){"horizontal"!==o&&(o="vertical"),this._set("layout",o)}set view(o){this.viewModel.view=o}get view(){return this.viewModel.view}render(){const o=this.viewModel,t={[u.horizontalLayout]:"horizontal"===this.layout},{canZoomIn:s,canZoomOut:e}=o;this._zoomInButton.enabled=s,this._zoomOutButton.enabled=e;const{zoomIn:i,zoomOut:r}=this.messages;return this._zoomInButton.title=i,this._zoomOutButton.title=r,n("div",{class:this.classes(u.base,t)},this._zoomInButton.render(),this._zoomOutButton.render())}zoomIn(){return this.viewModel.zoomIn()}zoomOut(){return this.viewModel.zoomOut()}};o([s()],a.prototype,"iconClass",void 0),o([s()],a.prototype,"label",null),o([s({value:"vertical"})],a.prototype,"layout",null),o([s(),r("esri/widgets/Zoom/t9n/Zoom")],a.prototype,"messages",void 0),o([s()],a.prototype,"view",null),o([s({type:l})],a.prototype,"viewModel",void 0),a=o([e("esri.widgets.Zoom")],a);const c=a;export{c as default};
|