UNPKG

@arcgis/map-components

Version:
51 lines (50 loc) 3.9 kB
import { c as s } from "../../chunks/runtime.js"; import { usePropertyChange as i } from "@arcgis/components-controllers"; import { reEmitEvent as t } from "@arcgis/components-controllers/accessor"; import a from "@arcgis/core/widgets/Search.js"; import { LitElement as r, createEvent as h, noShadowRoot as l } from "@arcgis/lumina"; import { m as c } from "../../chunks/useWidget.js"; import { css as o } 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 g = o`@layer{arcgis-search{display:block}}`, d = c(a); class u extends r { constructor() { super(...arguments), this.widget = d(this), this.viewModel = this.widget.viewModel, this.activeMenu = this.widget.activeMenu, this.activeSource = this.widget.activeSource, this.activeSourceIndex = this.widget.activeSourceIndex, this.allPlaceholder = this.widget.allPlaceholder, this.allSources = this.widget.allSources, this.autoDestroyDisabled = !1, this.autoSelectDisabled = this.widget.autoSelect, this.defaultSources = this.widget.defaultSources, this.disabled = this.widget.disabled, this.icon = this.widget.icon, this.includeDefaultSourcesDisabled = this.widget.includeDefaultSources, this.label = this.widget.label, this.locationDisabled = this.widget.locationEnabled, this.maxResults = this.widget.maxResults, this.maxSuggestions = this.widget.maxSuggestions, this.minSuggestCharacters = this.widget.minSuggestCharacters, this.popupDisabled = this.widget.popupEnabled, this.popupTemplate = this.widget.popupTemplate, this.portal = this.widget.portal, this.position = "top-right", this.resultGraphic = this.widget.resultGraphic, this.resultGraphicDisabled = this.widget.resultGraphicEnabled, this.results = this.widget.results, this.searchAllDisabled = this.widget.searchAllEnabled, this.searchTerm = this.widget.searchTerm, this.selectedResult = this.widget.selectedResult, this.sources = this.widget.sources, this.state = this.viewModel.state, this.suggestions = this.widget.suggestions, this.suggestionsDisabled = this.widget.suggestionsEnabled, this.arcgisBlur = t(() => this.widget, "search-blur"), this.arcgisClear = t(() => this.widget, "search-clear"), this.arcgisComplete = t(() => this.widget, "search-complete"), this.arcgisFocus = t(() => this.widget, "search-focus"), this.arcgisPropertyChange = i()("state"), this.arcgisReady = h(), this.arcgisSelectResult = t(() => this.widget, "select-result"), this.arcgisStart = t(() => this.widget, "search-start"), this.arcgisSuggestComplete = t(() => this.widget, "suggest-complete"), this.arcgisSuggestStart = t(() => this.widget, "suggest-start"); } static { this.properties = { activeMenu: 1, activeSource: 0, activeSourceIndex: 9, allPlaceholder: 1, allSources: 0, autoDestroyDisabled: 5, autoSelectDisabled: 5, defaultSources: 0, disabled: 7, icon: 1, includeDefaultSourcesDisabled: 5, label: 1, locationDisabled: 5, maxResults: 9, maxSuggestions: 9, minSuggestCharacters: 9, popupDisabled: 5, popupTemplate: 0, portal: 0, position: 1, referenceElement: 1, resultGraphic: 0, resultGraphicDisabled: 5, results: 0, searchAllDisabled: 5, searchTerm: 1, selectedResult: 0, sources: 0, state: 3, suggestions: 0, suggestionsDisabled: 5 }; } static { this.shadowRootOptions = l; } static { this.styles = g; } // #endregion // #region Public Methods async blurSearch() { this.widget?.blur(); } async clearSearch() { this.widget?.clear(); } /** Permanently destroy the component */ async destroy() { await this.manager.destroy(); } async focusSearch() { this.widget?.focus(); } async search(e) { return await this.widget?.search(e); } async suggest(e) { return await this.widget?.suggest(e); } } s("arcgis-search", u); export { u as ArcgisSearch };