@arcgis/map-components
Version:
ArcGIS Map Components
36 lines (35 loc) • 1.17 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import { c as i } from "../../chunks/runtime.js";
import { css as n, html as r } from "lit";
import { LitElement as c, safeStyleMap as l } from "@arcgis/lumina";
import { t as a } from "../../chunks/screenLocation.js";
const p = n`:host{display:contents}.root{position:absolute}`;
class m extends c {
constructor() {
super(...arguments), this.trackLocation = !1, this.screenLocation = a(this);
}
static {
this.properties = { trackLocation: 5, screenLocation: 32, label: 1, location: 0, view: 0 };
}
static {
this.styles = p;
}
_getPositionStyles() {
const { screenLocation: t, view: s } = this;
if (s == null || t == null)
return {};
const { padding: o } = s, e = 16;
return {
"--calcite-loader-size": `${e}px`,
left: `${t.x - (o.left ?? 0) - e / 2}px`,
top: `${t.y - (o.top ?? 0) - e / 2}px`
};
}
render() {
return this.screenLocation ? r`<calcite-loader class="root" .label=${this.label ?? ""} inline style=${l(this._getPositionStyles())}></calcite-loader>` : null;
}
}
i("arcgis-spinner", m);
export {
m as ArcgisSpinner
};