UNPKG

@doegis/core

Version:

DOE GIS API

3 lines (1 loc) 2.31 kB
import{_ as t}from"../../../../chunks/tslib.es6.js";import"../../../../intl.js";import{unwrapOr as e}from"../../../../core/maybe.js";import{formatLength as s,formatRelativeLength as i,formatVerticalLength as r,formatRelativeVerticalLength as o,formatArea as n}from"../../../../core/quantityFormatUtils.js";import{property as a}from"../../../../core/accessorSupport/decorators/property.js";import"../../../../core/accessorSupport/ensureType.js";import"../../../../core/arrayUtils.js";import{subclass as p}from"../../../../core/accessorSupport/decorators/subclass.js";import{getDefaultUnitForView as m}from"../../../../support/getDefaultUnitForView.js";import l from"../../../../widgets/Widget.js";import"../../../../widgets/support/widgetUtils.js";import{messageBundle as g}from"../../../../widgets/support/decorators/messageBundle.js";import{formatNumber as c}from"../../../../intl/number.js";let u=class extends l{get _units(){const t=m(this.tooltip.view);return{length:t,verticalLength:t,area:t}}_getHelpMessage(t){const{info:e}=this,{tooltipOptions:s,helpMessage:i,viewType:r}=e,o=s?.visibleElements?.helpMessage,n=t??i,a="3d"===r?"helpMessages3d":"helpMessages2d";return o&&n?this._messagesTooltip?.sketch?.[a]?.[n]:void 0}_formatScale(t){return c(t,{style:"percent",maximumFractionDigits:0})}_formatRelativeOrientation(t){return c(t,{maximumFractionDigits:2,minimumFractionDigits:2,signDisplay:"exceptZero"})}_formatLength(t,i,r){return s(this._messagesUnits,t,e(i,this._units.length),r)}_formatRelativeLength(t){return i(this._messagesUnits,t,this._units.length)}_formatVerticalLength(t){return r(this._messagesUnits,t,this._units.verticalLength)}_formatRelativeVerticalLength(t){return o(this._messagesUnits,t,this._units.verticalLength)}_formatTotalLength(t){return s(this._messagesUnits,t,this._units.length)}_formatArea(t){return n(this._messagesUnits,t,this._units.area)}_formatPercentage(t){return c(t.value,{style:"percent"})}};t([a()],u.prototype,"info",void 0),t([a()],u.prototype,"tooltip",void 0),t([a()],u.prototype,"_units",null),t([g("esri/core/t9n/Units"),a()],u.prototype,"_messagesUnits",void 0),t([g("esri/views/interactive/tooltip/t9n/Tooltip"),a()],u.prototype,"_messagesTooltip",void 0),u=t([p("esri.views.interactive.tooltip.content.TooltipContent")],u);export{u as TooltipContent};