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.
 
 

10 lines
3.6 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 ../../core/accessorSupport/decorators/property ../../core/has ../../core/Logger ../../core/RandomLCG ../../core/accessorSupport/decorators/subclass ../Widget ../../chunks/componentsUtils ./timeWidgetUtils ./widgetUtils ./decorators/messageBundle ./jsxFactory".split(" "),function(l,d,e,f,x,y,z,q,r,t,u,A,v,g){function p(a,b){return a.find(c=>m(c)===b)}function w(a,b){return a.find(c=>c.utcOffset===b)}function m(a){return a?`${a.utcOffset}-${a.long}`:void 0}
const h={base:"esri-timezone-picker",trigger:"esri-timezone-picker__trigger",itemTitle:"esri-timezone-picker__item-title",itemDescription:"esri-timezone-picker__item_description"};d.TimezonePicker=class extends r{constructor(a,b){super(a,b);this.onChange=this.value=null;this.open=!1;this._selectedId=this.onClose=this.onOpen=null;this._onOpen=()=>{this.open=!0;this.onOpen?.()};this._onClose=()=>{this.open=!1;this.onClose?.()};this._killEvent=c=>{c.stopPropagation();return!0};this._onChange=c=>{c=c.target.selectedItems?.[0].getAttribute("data-id");
const k=p(this._gmtOffsets,c)?.utcOffset;k&&(this._selectedId=c,this.onChange?.(k))}}loadDependencies(){return t.loadCalciteComponents({button:()=>new Promise((a,b)=>l(["../../chunks/calcite-button"],a,b)),dropdown:()=>new Promise((a,b)=>l(["../../chunks/calcite-dropdown"],a,b)),"dropdown-group":()=>new Promise((a,b)=>l(["../../chunks/calcite-dropdown-group"],a,b)),"dropdown-item":()=>new Promise((a,b)=>l(["../../chunks/calcite-dropdown-item"],a,b))})}render(){const a=this._messages;if(!a)return g.tsx("div",
{class:h.base,key:"empty"});const b=this._selectedItem,c=m(b);return g.tsx("div",{class:h.base,key:"container",onpointerdown:this._killEvent},g.tsx("calcite-dropdown",{open:this.open,overlayPositioning:"fixed",placement:"bottom-end",scale:"s",onCalciteDropdownClose:this._onClose,onCalciteDropdownOpen:this._onOpen,onCalciteDropdownSelect:this._onChange},g.tsx("calcite-button",{appearance:"transparent",class:h.trigger,"data-testid":"timezone-picker-button",key:"trigger",kind:"neutral",scale:"s",slot:"trigger",
tabIndex:0,title:a.chooseTimezone},b?.short??""),g.tsx("calcite-dropdown-group",{selectionMode:"single"},this._gmtOffsets.map(k=>{const n=m(k);return g.tsx("calcite-dropdown-item",{"data-id":n,key:n,selected:c===n},g.tsx("div",{class:h.itemTitle,key:"title"},k.shortWithUTC),g.tsx("div",{class:h.itemDescription,key:"description"},k.long))}))))}get _gmtOffsets(){const a=this._messages;return a?u.getTimezoneInfos(a):[]}get _selectedItem(){const a=this._gmtOffsets,b=this.value,c=p(a,this._selectedId);
return c?.utcOffset===b?c:w(a,b)}};e.__decorate([f.property()],d.TimezonePicker.prototype,"value",void 0);e.__decorate([f.property()],d.TimezonePicker.prototype,"onChange",void 0);e.__decorate([f.property()],d.TimezonePicker.prototype,"open",void 0);e.__decorate([f.property()],d.TimezonePicker.prototype,"onOpen",void 0);e.__decorate([f.property()],d.TimezonePicker.prototype,"onClose",void 0);e.__decorate([f.property(),v.messageBundle("esri/widgets/support/t9n/timezone")],d.TimezonePicker.prototype,
"_messages",void 0);e.__decorate([f.property()],d.TimezonePicker.prototype,"_gmtOffsets",null);e.__decorate([f.property()],d.TimezonePicker.prototype,"_selectedItem",null);e.__decorate([f.property()],d.TimezonePicker.prototype,"_selectedId",void 0);d.TimezonePicker=e.__decorate([q.subclass("esri.widgets.support.TimezonePicker")],d.TimezonePicker);d.css=h;Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});