UNPKG

@arcgis/map-components

Version:
57 lines (56 loc) 2.46 kB
import { c as n } from "../../chunks/runtime.js"; import { html as s } from "lit-html"; import { usePropertyChange as c } from "@arcgis/components-controllers"; import { classes as d } from "@arcgis/components-utils"; import m from "@arcgis/core/widgets/Fullscreen/FullscreenViewModel.js"; import { LitElement as u, createEvent as h, noShadowRoot as p, safeClassMap as i, nothing as f } from "@arcgis/lumina"; import { u as g } from "../../chunks/useT9n.js"; import { m as w } from "../../chunks/useViewModel.js"; import { g as o } from "../../chunks/globalCss.js"; import { css as y } from "@lit/reactive-element/css-tag.js"; /*! All material copyright Esri, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.32/esri/copyright.txt for details. v4.32.14 */ const b = y`@layer{arcgis-fullscreen{display:block}}`, v = { base: "esri-fullscreen" }, M = w(m); class $ extends u { constructor() { super(...arguments), this.messages = g(), this.viewModel = M(this), this.autoDestroyDisabled = !1, this.element = this.viewModel.element, this.icon = "zoom-out-fixed", this.position = "top-left", this.state = this.viewModel.state, this.arcgisPropertyChange = c()("state"), this.arcgisReady = h(); } static { this.properties = { autoDestroyDisabled: 5, element: 0, icon: 3, label: 1, messageOverrides: 0, position: 3, referenceElement: 1, state: 3 }; } static { this.shadowRootOptions = p; } static { this.styles = b; } // #endregion // #region Private Properties get fullscreenTitle() { const e = this.viewModel?.state; return e === "active" ? this.messages.exit : e === "ready" ? this.messages.enter : ""; } // #endregion // #region Public Methods async destroy() { await this.manager.destroy(); } // #endregion // #region Private Methods _toggle() { this.viewModel.toggle(); } // #endregion // #region Rendering render() { const { fullscreenTitle: e, icon: r } = this, t = this.viewModel?.state, a = t === "feature-unsupported", l = t === "ready" || t === "disabled" || t === "feature-unsupported" ? "zoom-out-fixed" : "zoom-in-fixed"; return s`<div class=${i(d(v.base, o.widget))}>${!a && s`<calcite-button class=${i(o.widgetButton)} .disabled=${t === "disabled"} .iconStart=${r ?? l} kind=neutral .label=${e} @click=${this._toggle} title=${e ?? f}></calcite-button>` || ""}</div>`; } } n("arcgis-fullscreen", $); export { $ as ArcgisFullscreen };