UNPKG

@arcgis/map-components

Version:
39 lines (38 loc) 1.33 kB
import { c as a } from "../../chunks/runtime.js"; import { html as s } from "lit-html"; import { watch as n } from "@arcgis/core/core/reactiveUtils.js"; import { LitElement as r, noShadowRoot as p } from "@arcgis/lumina"; /*! All material copyright Esri, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.33/esri/copyright.txt for details. v4.33.16 */ class o extends r { constructor() { super(...arguments), this._dpi = 1; } static { this.properties = { _dpi: 16, viewModel: 0, messages: 0 }; } static { this.shadowRootOptions = p; } loaded() { this.manager.onLifecycle(() => [ n(() => this.viewModel.templateOptions.dpi, (t) => this._dpi = t <= 0 ? 1 : t, { initial: !0 }) ]); } _handleDPIChange(t) { const i = this.viewModel.templateOptions, e = Number(t.target.value); if (Number.isNaN(e) || e <= 0 || !Number.isFinite(e)) { t.target.value = `${this._dpi}`; return; } i.dpi = e; } render() { return s`<div><calcite-label>${this.messages.dpi}<calcite-input-number data-input-name=dpi min=1 .value=${`${this._dpi}`} .max=${Number.MAX_SAFE_INTEGER} @calciteInputNumberInput=${this._handleDPIChange}></calcite-input-number></calcite-label></div>`; } } a("arcgis-print-dpi-input", o); export { o as PrintDPIInput };