@arcgis/map-components
Version:
ArcGIS Map Components
113 lines (112 loc) • 8.99 kB
JavaScript
import { c as n } from "../../chunks/runtime.js";
import { usePropertyChange as h } from "@arcgis/components-controllers";
import { reEmitEvent as i } from "@arcgis/components-controllers/accessor";
import s from "@arcgis/core/layers/Layer.js";
import d from "@arcgis/core/widgets/FeatureTable.js";
import { LitElement as a, createEvent as l, noShadowRoot as r } from "@arcgis/lumina";
import { m as g } from "../../chunks/useWidget.js";
import { f as m } from "../../chunks/component-utils.js";
import { css as c } 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.13 */
const u = c` {arcgis-feature-table{display:block}.arcgis-feature-table{width:100%;height:100%}}`, w = g(d);
class b extends a {
constructor() {
super(...arguments), this.widget = w(this), this.viewModel = this.widget.viewModel, this.attributeTableTemplate = this.widget.attributeTableTemplate, this.actionColumnConfig = this.widget.actionColumnConfig, this.activeFilters = this.widget.activeFilters, this.activeSortOrders = this.widget.activeSortOrders, this.allRelatedTablesVisible = this.widget.allRelatedTablesVisible, this.attachmentsEnabled = this.widget.attachmentsEnabled, this.autoDestroyDisabled = !1, this.autoRefreshDisabled = this.widget.autoRefreshEnabled, this.columnReorderingDisabled = this.widget.columnReorderingEnabled, this.columns = this.widget.columns, this.description = this.widget.description, this.editingEnabled = this.widget.editingEnabled, this.effectiveSize = this.widget.effectiveSize, this.filterBySelectionEnabled = this.widget.filterBySelectionEnabled, this.filterGeometry = this.widget.filterGeometry, this.hideColumnDescriptions = this.widget.visibleElements.columnDescriptions, this.hiddenFields = this.widget.hiddenFields, this.hideColumnMenuItemsSortAscending = this.widget.visibleElements.columnMenuItems.sortAscending, this.hideColumnMenuItemsSortDescending = this.widget.visibleElements.columnMenuItems.sortDescending, this.hideColumnMenus = this.widget.visibleElements.columnMenus, this.hideHeader = this.widget.visibleElements.header, this.hideMenu = this.widget.visibleElements.menu, this.hideMenuItemsClearSelection = this.widget.visibleElements.menuItems.clearSelection, this.hideMenuItemsDeleteSelection = this.widget.visibleElements.menuItems.deleteSelection, this.hideMenuItemsExportSelectionToCsv = this.widget.visibleElements.menuItems.exportSelectionToCSV, this.hideMenuItemsRefreshData = this.widget.visibleElements.menuItems.refreshData, this.hideMenuItemsSelectedRecordsShowAllToggle = this.widget.visibleElements.menuItems.selectedRecordsShowAllToggle, this.hideMenuItemsSelectedRecordsShowSelectedToggle = this.widget.visibleElements.menuItems.selectedRecordsShowSelectedToggle, this.hideMenuItemsToggleColumns = this.widget.visibleElements.menuItems.toggleColumns, this.hideMenuItemsZoomToSelection = this.widget.visibleElements.menuItems.zoomToSelection, this.hideProgress = this.widget.visibleElements.progress, this.hideSelectionColumn = this.widget.visibleElements.selectionColumn, this.hideTooltips = this.widget.visibleElements.tooltips, this.highlightDisabled = this.widget.highlightEnabled, this.highlightIds = this.widget.highlightIds, this.initialSize = this.widget.initialSize, this.icon = this.widget.icon, this.isQueryingOrSyncing = this.widget.isQueryingOrSyncing, this.label = this.widget.label, this.layer = this.widget.layer, this.layerView = this.widget.layerView, this.layers = this.widget.layers, this.maxSize = this.widget.maxSize, this.menuConfig = this.widget.menuConfig, this.multipleSelectionDisabled = this.widget.multipleSelectionEnabled, this.multipleSortEnabled = this.widget.multiSortEnabled, this.objectIds = this.widget.objectIds, this.outFields = this.widget.outFields, this.pageCount = this.widget.pageCount, this.pageIndex = this.widget.pageIndex, this.pageSize = this.widget.pageSize, this.paginationEnabled = this.widget.paginationEnabled, this.position = "manual", this.relatedRecordsEnabled = this.widget.relatedRecordsEnabled, this.relatedTable = this.widget.relatedTable, this.relatedTables = this.widget.relatedTables, this.returnGeometryEnabled = this.widget.returnGeometryEnabled, this.returnMEnabled = this.widget.returnMEnabled, this.returnZEnabled = this.widget.returnZEnabled, this.rowHighlightIds = this.widget.rowHighlightIds, this.size = this.widget.size, this.showLayerDropdown = this.widget.visibleElements.layerDropdown, this.state = this.widget.state, this.tableController = this.widget.tableController, this.tableDisabled = this.widget.disabled, this.tableParent = this.widget.tableParent, this.tableTemplate = this.widget.tableTemplate, this.timeExtent = this.widget.timeExtent, this.timeZone = this.widget.timeZone, this.arcgisCellClick = i(() => this.widget, "cell-click"), this.arcgisCellKeydown = i(() => this.widget, "cell-keydown"), this.arcgisCellPointerout = i(() => this.widget, "cell-pointerout"), this.arcgisCellPointerover = i(() => this.widget, "cell-pointerover"), this.arcgisColumnReorder = i(() => this.widget, "column-reorder"), this.arcgisPropertyChange = h()("effectiveSize", "isQueryingOrSyncing", "layerView", "size", "state"), this.arcgisReady = l(), this.arcgisSelectionChange = l();
}
static {
this.properties = { attributeTableTemplate: 0, actionColumnConfig: 0, activeFilters: 0, activeSortOrders: 0, allRelatedTablesVisible: 4, attachmentsEnabled: 5, autoDestroyDisabled: 5, autoRefreshDisabled: 5, columnReorderingDisabled: 5, columns: 0, description: 1, editingEnabled: 5, effectiveSize: 8, filterBySelectionEnabled: 5, filterGeometry: 0, hideColumnDescriptions: 5, hiddenFields: 0, hideColumnMenuItemsSortAscending: 5, hideColumnMenuItemsSortDescending: 5, hideColumnMenus: 5, hideHeader: 5, hideMenu: 5, hideMenuItemsClearSelection: 5, hideMenuItemsDeleteSelection: 5, hideMenuItemsExportSelectionToCsv: 5, hideMenuItemsRefreshData: 5, hideMenuItemsSelectedRecordsShowAllToggle: 5, hideMenuItemsSelectedRecordsShowSelectedToggle: 5, hideMenuItemsToggleColumns: 5, hideMenuItemsZoomToSelection: 5, hideProgress: 5, hideSelectionColumn: 5, hideTooltips: 5, highlightDisabled: 5, highlightIds: 0, initialSize: 9, icon: 1, isQueryingOrSyncing: 4, label: 1, layer: 0, layerItemId: 1, layerUrl: 1, layerView: 0, layers: 0, maxSize: 9, menuConfig: 0, multipleSelectionDisabled: 5, multipleSortEnabled: 5, objectIds: 0, outFields: 0, pageCount: 8, pageIndex: 9, pageSize: 9, paginationEnabled: 5, position: 1, referenceElement: 1, relatedRecordsEnabled: 5, relatedTable: 0, relatedTables: 0, returnGeometryEnabled: 5, returnMEnabled: 5, returnZEnabled: 5, rowHighlightIds: 0, size: 8, showLayerDropdown: 5, state: 3, tableController: 0, tableDisabled: 5, tableParent: 0, tableTemplate: 0, timeExtent: 0, timeZone: 1 };
}
static {
this.shadowRootOptions = r;
}
static {
this.styles = u;
}
// #endregion
// #region Public Methods
async deleteSelection(e) {
await this.widget?.deleteSelection(e);
}
/** Permanently destroy the component */
async destroy() {
await this.manager.destroy();
}
async exportSelectionToCSV(e) {
await this.widget?.exportSelectionToCSV(e);
}
async findColumn(e) {
return this.widget?.findColumn(e);
}
async goToPage(e) {
this.widget.goToPage(e);
}
async hideColumn(e) {
this.widget?.hideColumn(e);
}
async nextPage() {
this.widget.nextPage();
}
async previousPage() {
this.widget.previousPage();
}
async refresh() {
await this.widget?.refresh();
}
async scrollToBottom() {
this.widget.scrollToBottom();
}
async scrollToIndex(e) {
this.widget?.scrollToIndex(e);
}
async scrollToLeft() {
this.widget.scrollLeft();
}
async scrollToRow(e) {
this.widget?.scrollToRow(e);
}
async scrollToTop() {
this.widget.scrollToTop();
}
async showAllColumns() {
this.widget?.showAllColumns();
}
async showColumn(e) {
this.widget?.showColumn(e);
}
async sortColumn(e, t) {
this.widget?.sortColumn(e, t);
}
async zoomToSelection() {
this.widget?.zoomToSelection();
}
// #endregion
// #region Lifecycle
load() {
this.manager.onLifecycle(() => this.widget.highlightIds.on("change", this.arcgisSelectionChange.emit));
}
willUpdate(e) {
if (e.has("layerItemId") && (m(this.layerItemId) ? this.layer = null : this.layerItemId && s.fromPortalItem({
portalItem: {
id: this.layerItemId
}
}).then((t) => {
this.layer = t;
}).catch(console.error)), e.has("layerUrl")) {
const t = this.layerUrl;
t ? s.fromArcGISServerUrl({
url: t
}).then((o) => {
this.layer = o;
}).catch(console.error) : this.layer = null;
}
}
loaded() {
this.el.childElem?.classList.add("arcgis-feature-table");
}
}
n("arcgis-feature-table", b);
export {
b as ArcgisFeatureTable
};